Boost logo

Boost :

Subject: Re: [boost] Interest in a '' 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

> 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
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, gregod at, cpdaniel at, john at