Boost logo

Boost Users :

From: Edward Diener (eldiener_at_[hidden])
Date: 2008-05-19 15:18:32


I have a class template, templated on type T, which I need to hold as a
data value in the class. I use value_initialized for this type T
effectively, and the value gets value initialized correctly when the
default constructor of my class is used.

If, however, I add a second constructor to my class which takes a T, for
initializing my 'value_initialized<T> data' value, things do not work as
well. Obviously I can still value initialize my data value, as in my
default constructor, and then use 'boost::get(data) = arg;' to set the
value of my value initialized variable. But this will not work if the
type T is a top-level const, whereas I do want to initialize the data
value in this case to the T arg passed into my second constructor.

Is there a good solution to this which I have overlooked ?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net