这适用于 Visual Studio 2010,但不适用于 2012 Update 2(使用 Boost 1.5.3):
vector<vector<BYTE>> data = assign::list_of (assign::list_of (0x06)(0x02));
编译器给出的错误(更新):
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory0(617): error C2668: 'std::vector<_Ty>::vector' : ambiguous call to overloaded function
with
[
_Ty=BYTE
]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(786): could be 'std::vector<_Ty>::vector(std::vector<_Ty> &&)'
with
[
_Ty=BYTE
]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(693): or 'std::vector<_Ty>::vector(unsigned __int64)'
with
[
_Ty=BYTE
]
while trying to match the argument list '(boost::assign_detail::generic_list<T>)'
with
[
T=int
]
... (dozens of more lines)
有什么办法可以解决这个错误?