B
Bubba
Greetings,
I don't know whether I have stipulated subject correctly, but this is what
I need.
There is a class that consists of a STL map<string,short>, amongst other
interfaces. Operator << should accept a string as right parameter. After
that string, it should again be possible to enter either string or number.
If number is entered, then it is associated with a map, if another string
is entered, new member of map is created. Expression must end with a
number and that number should be associated with all strings in the map.
If it doesn't, it should throw an exception.
IOW, it should look like this:
mVar1 << "string1" << 2; //one entry in map, with values "string1",2
mVar2 << "string2" << "string3" << "string4" << 10; //three map entries
//each with short
//valeu of 10
I'm simply clueless about what should I even Google for in order to
implement something like that, let alone do it. Manipulating with map STL
within the implementation is not a problem (I suppose?), but syntax and
idea behind those multiple parameters is what bugs me...
TIA!
I don't know whether I have stipulated subject correctly, but this is what
I need.
There is a class that consists of a STL map<string,short>, amongst other
interfaces. Operator << should accept a string as right parameter. After
that string, it should again be possible to enter either string or number.
If number is entered, then it is associated with a map, if another string
is entered, new member of map is created. Expression must end with a
number and that number should be associated with all strings in the map.
If it doesn't, it should throw an exception.
IOW, it should look like this:
mVar1 << "string1" << 2; //one entry in map, with values "string1",2
mVar2 << "string2" << "string3" << "string4" << 10; //three map entries
//each with short
//valeu of 10
I'm simply clueless about what should I even Google for in order to
implement something like that, let alone do it. Manipulating with map STL
within the implementation is not a problem (I suppose?), but syntax and
idea behind those multiple parameters is what bugs me...
TIA!