I have a class that has a reference field that needs to be reassigned. But unlike pointer, it can't be null.
Requirements:
- Reference syntax:
field.foo()
to invoke method, instead offield->foo();
- Re-assignable:
foo = new_val; // OK
Is it possible to model model this concept in C++?