map a key to different number of values

hi guys.
I need to create a map such as :
1
2
3
4
  map<string, int> mymap;
mymap["varchar"]=23,24,25,500,800;
mymap["ineger"]=203,1000,541;
mymap["boolean"]=1,54;

how can I create a map with different number of values for each key?
thanks in advance.
Either std::map<std::string, std::vector<int>> or std::multimap<std::string, int>
Thank you for your response LB,
I used std::map<std::string, std::vector<int>>Mymap; to create Mymap and then i used:
1
2
3
4
5
6
7
8
9
10
PgDataTyp["varchar"].push_back(23);
PgDataTyp["varchar"].push_back(24);
PgDataTyp["varchar"].push_back(25);
PgDataTyp["varchar"].push_back(500);
PgDataTyp["varchar"].push_back(800);
PgDataTyp["integer"].push_back(203);
PgDataTyp["integer"].push_back(1000);
PgDataTyp["integer"].push_back(541);
PgDataTyp["boolean"].push_back(1);
PgDataTyp["boolean"].push_back(54);

now, I know its not related to this topic but my another question which came up is that if its possible to
assign multiple values to a key at once;
Something like :
PgDataTyp["varchar"].push_back(23,24,25,500,800);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include <string>
#include <map>
#include <vector>

void push_back( std::map< std::string, std::vector<int> >& map, std::string key, std::initializer_list<int> il )
{
    auto& values = map[key] ;
    values.insert( values.end(), il ) ;
}

template < typename ITERATOR >
void push_back( std::map< std::string, std::vector<int> >& map, std::string key, ITERATOR begin, ITERATOR end )
{
    auto& values = map[key] ;
    values.insert( values.end(), begin, end ) ;
}

int main()
{
    std::map< std::string, std::vector<int> > map ;

    push_back( map, "abcd", { 0, 1, 2, 3, 4 } ) ;

    const int values[] = { 5, 6, 7, 8 } ;
    push_back( map, "abcd", std::begin(values), std::end(values) ) ;

    for( int v : map["abcd"] ) std::cout << v << ' ' ;
    std::cout << '\n' ;
}

http://coliru.stacked-crooked.com/a/3e6e7c24f096ac53
Many thanks JLBorges.
Topic archived. No new replies allowed.