> I argue that top-level const type arguments are meaningless in the context
> of variant. Given the example you provide:
>
>   typedef boost::variant<int const, std::string const> GlobalParameter;
>
>   GlobalParameter input_socket(12345);
>   input_socket = 54321; // no way to prevent this!!

How come!? It should be very easy to prohibit all mutating operations for
variant once it has top level const bound types (with static asserts)

> We can put it in the docs, but it seems straightforward that a const
variant
> would, in fact, not allow modification. What reason would lead someone to
> believe otherwise?

No. I meant that: Would we decide to keep the current semantic (without top
level const) we need to say explecetly what to do to define variant type for
constant object.

Gennadiy



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to