With the code below, I get a very confusing error in MSVC that seems to suggest the key type (an std::tuple) is being converted to an std::string.
#include &
Strange. Your code works fine in Visual Studio 2012 RC and output is "x: test data".
The problem for ideone is that key_t
already exists:
prog.cpp:7:42: error: conflicting declaration 'typedef class std::tuple<std::basic_string<char>, int, char> key_t'
/usr/include/sys/types.h:123:17: error: 'key_t' has a previous declaration as 'typedef __key_t key_t'
Rename your key_t
to something else, or put it into some namespaces.
Your code works after this change in both g++ and clang++. I believe this is a bug in MSVC.