I understand that from C ++ 11 I can initialize a container using a list of initializers enclosed in brackets:
std::map<int, char> m = {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};
Is this also possible for container containers?
For example, I tried the following without success:
std::pair<std::map<int, char>, int> a = {{1, 'c'}, 2};
In Visual Studio 2015, I get the following compilation error:
no constructor instance "std :: map <_Kty, _Ty, _Pr, _Alloc> :: map [with _Kty = std :: map, std :: allocator →, _Ty = int, _Pr = std :: less, std :: allocator →>, _Alloc = std :: allocator, std :: allocator →, int →] "matches the list of arguments Types of arguments: ({...}, int)
With MinGW32, a compilation error was in the lines
Failed to convert {...} from the list of initializers enclosed in brackets to std :: pair ...