I tried to compile the following snippets with gcc4.7
vector > vp = {{1,'a'},{2,'b'}};
//For pair vector, it works like a charm.
vector > vt = {{1,0.1,'a'},{2,4.2,'b'}};
However, for the vector of tuples, the compiler complains:
error: converting to ‘std::tuple’ from initializer list would use explicit constructor ‘constexpr std::tuple< >::tuple(_UElements&& ...) [with _UElements = {int, double, char}; = void; _Elements = {int, double, char}]’
The error info spilled by the compiler is total gibberish for me, and I have no idea how were the constructors of tuple implemented, yet I do know they're totally okay with uniform initialization (like: tuple
), therefore, I wonder if the problem I encountered is only a TODO of the compiler or it's something defined by the C++11 standard.
No comments:
Post a Comment