On Tue, Jul 26, 2016 at 2:05 AM, Vincent Reverdy <vinc...@gmail.com> wrote:Hello.
Please find the document attached.
It's not really a proposal... but we need help on this question and people really don't seem to agree.
So... any help, advice, opinion is welcome.I would say value<const T> makes no sense.A value is a value. All values are const. 17 is const. It is always 17.What may be NOT const is a variable holding the value 17.
So value<const T> should not exist. It should be collapsed to value<T>. const value<T> is fine.
On terça-feira, 26 de julho de 2016 18:34:36 PDT Tony V E wrote:
> So value<const T> should not exist. It should be collapsed to value<T>.
> const value<T> is fine.
>
> But for value<T> I assume the T lives within value<T>.
>
> Alternatively, value<const T> should work the same as const value<T>.
I still don't understand the point of value<T>. If T stores a value, why do we
need value<T>? It stands to reason that value<T> does something extra, on top
of what T can do. That something extra is quite important and may affect what
a value<const T> might be.
Should I understand it like optional<T>, which can store a T, but it can also
be disengaged and store nothing? optional<const int> makes no sense.
Or maybe like atomic<T>. Here we have that atomic<const T> is the same as
const atomic<T>.
If you want to assume that T lives within lifetime of value<T>, you perhaps have to also assume T stores a value, as I don't find another obvious way to guarantee the lifetime of T.
I still don't understand the point of value<T>. If T stores a value, why do we
need value<T>?
Basically what it does with cv qualification is it encapsulates the cv-unqualified version, with the associated functions of a Regular type defined in terms of the cv-unqualified version, but with user-level accessors of the underlying object that only ever give back references to the object with the originally-specified qualifiers attached.