Good day!
I have an application class with property which is object too:
// C class
class Foo
{TName * name; // TName is class
TName * get_name(); // for registering as getter
};
I'm registering a getter for 'name':
TName & get_name();
Class TName has 'opAssign' methods for different types.
Now I'm trying to create a Foo class object and assign 'name' value using TName assign methods:
Foo foo();
foo.name = "TEST"
foo.name = anything else...
And I have an error 'Property 'name' has no setter'.
But next code is legal:
foo.get_name() = "TEST" // here working TName.opAssign
I want keep a TName assigning functionality without complicated setters in Foo class. How can I legally write it?