Boost logo

Boost :

Subject: Re: [boost] [property] interest in C# like properties for C++?
From: Peder Holt (peder.holt_at_[hidden])
Date: 2009-10-20 16:29:08


> Thanks ! Very clever. The self() idea is very worthy, and I may steal it
> for my own idea/implementation about "property" in C++, which I have been
> working on indefinitely ( may never get completed to my satisfaction ). The
> metaprogramming is breathtaking, if I can slowly figure it out <g> . In my
> own implementation a "property" does not need to be nested class but can
> exist as a global/static object, so I don't know how I can use your self()
> idea but I really appreciate your doing it and publishing it.
Thank you :)

It would be very interesting to look at your implementation to see how you
tackle the problem. Have you posted your code anywhere that I can look?

Actually, the property implementation does not have to be a nested class.
The following:
template<typename Base>
class Property_Length : public Base {
   const double& get() const {
        return sqrt(
template<typename Base>
class Property_Double : public Base {
   const double& get() const {return m_arg;}
   void set(const double& arg) {m_arg=arg;}
   double m_arg;
class Vector {

is legal. (but untested.)


> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at