1

In Python we can do this, since we can have both int and dict data type values

dict1 = {'a':1, 'b':2, 'c':{'x':3, 'y':3, 'z':5}, 'q':3}

Is there a way to do this in C++ for maps?

Mark
  • 117
  • 2
  • 9
  • 3
    Does this answer your question? [C++ std::map holding ANY type of value](https://stackoverflow.com/questions/24702235/c-stdmap-holding-any-type-of-value) – ggorlen Apr 08 '20 at 05:31
  • 2
    Many other dupes: [1](https://stackoverflow.com/questions/47404870/stdmap-with-different-data-types-for-values), [2](https://stackoverflow.com/questions/14142832/store-different-data-types-in-map-with-info-on-type), [3](https://stackoverflow.com/questions/21384739/how-can-i-implement-a-map-with-different-data-types-as-values), [4](https://stackoverflow.com/questions/31993839/have-a-map-with-keys-consisting-of-different-types-in-c) – ggorlen Apr 08 '20 at 05:32
  • 1
    I guess it does. Thanks. – Mark Apr 08 '20 at 06:23

0 Answers0