Board index » cppbuilder » boost::ref_list_of<> and BCB 6
Sam
![]() CBuilder Developer |
boost::ref_list_of<> and BCB 62005-09-29 04:23:26 AM cppbuilder85 I'm trying to use boost::ref_list_of (in boost 1.33.0) but BCB 6 give me errors. //----- code ------ enum Enum { one, two, three, four, five }; void PrintVector( const std::vector<Enum>& vec ) { // print the vec } void AssignTest() { Enum a = one, b = two, c = three; PrintVector( boost::assign::ref_list_of<3>(a)(b)(c) ); // <-- error } //----- end code ------ on the line marked "<--error" I get: [C++ Error] list_of.hpp(129): E2299 Cannot generate template specialization from 'converter<static_generic_list<Enum,3>>::convert<Container>(const Container *,default_type_tag) const' [C++ Error] list_of.hpp(129): E2285 Could not find a match for 'converter<static_generic_list<Enum,3>>::convert<Container>(const std::vector<Enum,std::allocator<Enum>>& *,default_type_tag)' I also tried: //----- code ------ enum Enum { one, two, three, four, five }; void AssignTest() { Enum a = one, b = two, c = three; std::vector<Enum>vec( boost::assign::ref_list_of<3>(a)(b)(c) ); } //----- end code ------ and I get (on the ref_list_of line): [C++ Error] AssignB.cpp(28): E2015 Ambiguity between 'std::vector<Enum,std::allocator<Enum>>::vector(const std::allocator<Enum> &)' and 'std::vector<Enum,std::allocator<Enum>>::vector(unsigned int)' Is there a known workaround on this? Am I doing something wrong? Thanks. -- Please remove "sam_" from email address. |