In this example, how is it possible that a0 and a1 are not identical?
1 2 3 4 5 6 7 8 9 10 11
struct A{
A(){/*allows declaration of non-pointer type w/o args; does not actually initialize the object*/};
A(void* arg1){/*...*/};
/*...*/
};
int main(int argc, char** argv){
A a0;
a0=A(somevalue);
A a1(somevalue);
};
What I meant was declare an A instead of a A*. "A a0;" wouldn't be valid if I only had the second constructor. The resulting object isn't actually usable as far as member functions returning meaningful values, not segfaulting, etc
For that matter, am I correct in assuming that operator. for reference types is as expensive as operator-> for pointers?