I can't figure out how to in-place construct the contents of a boost::variant. the error message using GCC is merely 516 kb in size. from the boost.variant tutoral:
By default, a variant default-constructs its first bounded type, so v initially contains int(0). If this is not desired, or if the first bounded type is not default-constructible, a variant can be constructed directly from any value convertible to one of its bounded types.
from the synopsis:
template<typename T> variant(const T &); template<typename T> variant & operator=(const T &);
so why does the following fail: struct A : noncopyable{ A(int); A &operator=(int); }; struct B{}; int main(){ A a(5); //ok a=5; //ok variant var(5); //error var=5; //error } both error messages complain about noncopyable being - noncopyable. compiler is gcc 4.3.2 thank you