Indexable

class zhetapi::Indexable : public virtual zhetapi::Token

An interface for any primitive type that can be indexed with the bracket operator, [].

Subclassed by zhetapi::Collection, zhetapi::Dictionary

Public Functions

virtual Token *index(Token *tptr, bool ref = false) = 0

The indexing function that must be overriden by any primitive type that is to be indexable.

Parameters
  • tptr – the “index” to be taken.

  • cref – determines whether to return a reference to the indexed value.

Returns

the value at the specified “index”.