|
Boost : |
Subject: Re: [boost] Interest in a 'Boost.property' library?
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-07-08 13:32:48
On Mon, Jul 8, 2013 at 6:49 PM, Evgeny Panasyuk
<evgeny.panasyuk_at_[hidden]>wrote:
>
> I think need for properties-like things may arise IFF: "property"'s
> set/get need access to enveloping object or set/get should be overridable
> by enveloping class descendants, while keeping same syntax.
Which actually happen a lot, like when you want to have vectors and strings
in that data. I'm not talking about low-level data that needs to be all in
the struct.
Anyway, there is no current C++ solution equivalent to the
short-and-expressive way to do properties in other languages. You can find
tons of ways
to do something similar, they are all flawed because not generic enough and
often hard to read (like your example, where the semantic of the type is
separated from the use which is a bit like declaring manually callable
objects when you could have lambdas).
Anyway, the point is not that it could be done the same in the language, it
can't. Whatever the implementation, the point is that the idea is useful
sometimes.
So it's worth having a solution for it, but I don't believe in a
non-language feature for it or not relying on Reflection.
Joel Lamotte
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk