Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <vector>
- #include <boost/variant.hpp>
- typedef boost::variant<
- int,
- bool,
- double,
- std::string,
- char> basic_types;
- typedef std::vector<basic_types> array_types;
- typedef std::vector<array_types> matrix_types;
- typedef boost::variant<basic_types, array_types, matrix_types> all_types;
- int main() {
- std::map<all_types, all_types> test;
- test[0] = 23;
- test[1] = "hello";
- test[15] = 34.5;
- test["mamma mia!"] = 42;
- all_types tt = 42;
- std::cout << (tt == test["mamma mia!"]) << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement