If it even exists, what would a std::map extended initializer list look like?
I’ve tried some combinations of… well, everything I could think of with GCC 4.4, but found nothing that compiled.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It exists and works well:
Remember that value type of a map is
pair <const key_type, mapped_type>, so you basically need a list of pairs with of the same or convertible types.With unified initialization with std::pair, the code becomes even simpler