So I have created a nested template (a map of vectors) using stanford’s CS106 C++ library—which I believe is created to follow regular comp-sci modus operandi.
Map<Vector<char> > mv;
I can’t figure out the syntax for adding a key/value pair, where the value is of course a vector entry…
So far I’ve tried variations of this:
mv.put("key", 'A');
Error from the above code: No viable conversion from ‘char’ to ‘Vector’
put() is the member function that adds a key/value pair.
The key is working fine. The problem is inserting the char into the a vector. I have no troubles adding a value to an already created key, it’s just creating a new key with a value that I can’t do.
add() is the member function for adding a char into the vector.
Totally unsure how the syntax is meant to look, I’ve tried searching for a solution with no luck, and my tinkering has been fruitless thus far.
Thanks for any help, much appreciated 🙂
edit: Sorry I should have included this from the start, here is the library documentation: http://www.stanford.edu/class/cs106b/cs106lib/
You can do something like this: