|
Boost : |
From: Dragan Milenkovic (tyrant_at_[hidden])
Date: 2002-05-13 13:12:08
On May 13, 2002, Aaron Linnen wrote:
[snip]
> Borland's C++ Builder compiler has this feature, and it's handy. Their syntax:
> class Foo {
> public:
> __property TRect Bounds = {read = FBounds, write = SetBounds};
> __property int Width = {read=FWidth};
> private:
> int FWidth;
> TRect FBounds;
> void SetBounds(TRect R);
> }
> You can use the variables directly (e.g. to read the FBounds above), or a function
> (the SetBounds). If either read or write isn't specified, the property becomes
> write only or read only. In the second example, Width becomes a read only access
> to the FWidth private member.
>
> Of course, Borland has the option of compiler extensions, while boost doesn't.
> Aaron
But I think it is easy to create a class that would implement the
above behavior. It still requires some work to make it a template
class that people would like to use. If there is interest, I would
like to provide some sample implementations (as soon as I have them).
I was just wondering why there already isn't something like this
in the boost... It seems that beside this, the only thing that was
left out is the Pope's Ear.
-- Dragan Milenkovic
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk