【发布时间】:2013-11-22 02:29:48
【问题描述】:
我正在尝试这样做:
class bbb
{
public:
bbb(std::list<int> lst) { }
};
int main()
{
bbb b((std::list<int>)boost::assign::list_of<int>(10)(10));
return 0;
}
并从 g++ 得到以下错误:
some.cc:35: error: call of overloaded 'bbb(boost::assign_detail::generic_list<int>&)' is ambiguous
some.cc:15: note: candidates are: bbb::bbb(std::list<int, std::allocator<int> >)
some.cc:13: note: bbb::bbb(const bbb&)
有没有办法解决这个问题? 请注意,我使用的是 gcc 4.4.6。它不支持整个c++11,所以我正在为c++03编译。
谢谢...
【问题讨论】:
标签: c++ boost stl constructor