
Ovanes Markarian writes:
I posted the following message http://lists.boost.org/boost-users/2006/06/20271.php a few days ago, but did not get any replies.
I know there is an error in the const_ref class. But nevertheless the problem which occures is that my class accepts a vector of supported types as template parameter.
It has two constructors (no default ctor):
template<class Seq_> class my_class { public: typedef my_class
this_type; explicit inline my_class(const this_type& copy_from) :... {...}
template<class TypeFromVector> explicit inline my_class(typename const_ref<TypeFromVector>::type inst) :... {...} };
Now if I try to initialize my_class with type declared in vector I get an error:
error C2664: 'discriminated_union
::discriminated_union(const discriminated_union &)' : cannot convert parameter 1 from 't1' to 'const discriminated_union &' with [ Seq_=types_vector ] Reason: cannot convert from 't1' to 'const discriminated_union ' with [ Seq_=types_vector ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
In the context of overload resolution, any dependent type expression
in a form of
typename something