Hello
I found this code and it works in Visual C++ 6.0 and also in Microsoft Visual Studio 2005. But as per "The C++ Programming Language" there is no keyword like
property
.
Can any one please put more light on internals of this snippet?
You *can* create your own, but it's hideous. Here's one way to do it, which gives some insight into what MS is doing. It would probably be better to define the get and set functions in the template, not the constructor, however.
If anyone knows how to do this without passing *this to the constructor of the Property object, I'd love to see it!
I have not read it but I clocked this the other day:
Implementing Properties In C++
By Emad Barsoum
http://www.codeproject.com/KB/cpp/cppproperties.aspx
Acualy this is the one I saw the other day:
C++ implementation of the C# Property and Indexer with Accessor-Modifiers
By jeff00seattle
http://www.codeproject.com/KB/cpp/cpp_property_indexer.aspx