07.07.2013 18:04, Metodi Todorov:
Example: http://sourceforge.net/projects/cproperty/?source=dlp
1. Your property_rw, property_ro, property_wo have implicitly declared copy constructor and copy assignment operator, which have wrong semantic - they copy "this", while it must be tied to enveloping object. 2. FYI: I saw somewhere (maybe at stackoverflow) following C++11 approach for properties: http://coliru.stacked-crooked.com/view?id=1e7d98d17a1f945c3bd4bb3c8d69b204-f... class Widget { int value_; public: PROPERTY ( int, value, (cout << "getter" << endl; return value_;), (cout << "setter" << endl; value_ = x;) ); };
Is there any interest of "C# property" like library?
Personally, I don't remember if I ever need properties. Though, it is possible that there are some application domains where they are needed. I think such kind of property library should be mature and provide convenient interface, in order to be accepted into Boost. -- Evgeny Panasyuk