CAlive will introduce the ability to access a uniquely named child member using the ~~>
shorthand pointer, rather than the -> standard pointer. When ~~> is used, it will traverse the child classes or structures to find the uniquely named member, referencing it without explicitly naming the intermediate child members. The ~~> shorthand pointer will work where -> or . would normally be used. It is a common syntax for both.
// Define a structure
struct SGrandChild
{
s32 gcInt;
};
struct SChild
{
SGrandChild gc;
};
struct SExample
{
SChild* child;
};
// Use in code:
SExample* e = generate_new_e();
e->child->gc.gcInt = 5; // Traditional access
e~~>gcInt = 5; // New CAlive ~~> access
In this way, the construction is read as "the gcInt member of e's progeny, being distinct and unique in its name."
--
Rick C. Hodgin