Boost logo

Boost :

Subject: Re: [boost] Interest in a 'Boost.property' library?
From: Evgeny Panasyuk (evgeny.panasyuk_at_[hidden])
Date: 2013-07-07 14:05:09


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-f674c1a6d04c632b71a62362c0ccfc51

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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk