C++ property support (was: C++ attribute support)

Christian Parpart trapni@gentoo.org
Sat Apr 9 18:51:00 GMT 2005


On Saturday 09 April 2005 9:32 pm, Stefan Strasser wrote:
> Christian Parpart schrieb:
> > Hi,
> >
> > as I just read about, that C++ will support attributes within
> > next standard, I'd be curious about how G++ will think about.
> > And, wether it already has any extensions to support them.
>
> what do you mean by "attributes"? I can't find a proposal describing
> something by that name. in case you're referring to your earlier emails:
> there is a proposal for modules in C++ which you can find here:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1778.pdf

oopsie! that's been a mixup. too many conversations at the same time. sorry.

The borland proposal:

class my_foo {
public:
    property<int> foo { read getFoo, write setFoo };

private:
    int getFoo() { return value; }
    void setFoo(int v) { value = v}

    int value;
};

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1384.pdf

and the microsoft proposal (derived from C#)

class my_bar {
public: 
    property int bar {
        int get() { return value; }
        void set(int v) { value = v; }
    }
private:
    int value;
}

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1600.html

Regards,
Christian Parpart.

-- 
Netiquette: http://www.ietf.org/rfc/rfc1855.txt
 20:45:21 up 17 days,  9:51,  1 user,  load average: 0.38, 0.51, 0.58
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20050409/06033ca1/attachment.sig>


More information about the Gcc-help mailing list