Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <utility>
- #include <tuple>
- #include <unordered_map>
- #include <array>
- typedef std::array<float, 3> arr;
- typedef std::tuple<int, int, arr> object;
- typedef std::unordered_map<int, object> fmap;
- int main()
- {
- fmap FMap;
- arr maparray;
- maparray[0] = 5.5f;
- maparray[1] = 6.6f;
- maparray[2] = 7.7f;
- auto t1 = std::make_tuple(10,3,maparray);
- FMap.insert(fmap::value_type(5,t1));
- fmap::iterator j = FMap.find(5);
- if(j != FMap.end()) {
- std::cout << "Sim" << std::endl;
- std::cout << std::get<0>(j->second) << std::get<1>(j->second) << std::endl;
- auto ti = std::get<2>(j->second);
- std::cout << std::get<0>(ti) << std::get<1>(ti) << std::get<2>(ti) << std::endl;
- }
- else {
- std::cout << "Nao" << std::endl;
- }
- system("pause");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement