13 #ifndef TINYMPL_FUSED_MAP_HPP
14 #define TINYMPL_FUSED_MAP_HPP
16 #include <tinympl/variadic/all_of.hpp>
17 #include <tinympl/variadic/is_unique.hpp>
18 #include <tinympl/map.hpp>
23 template<
class ... KeyValuePairs>
24 struct fused_map : std::tuple<typename KeyValuePairs::second_type ... >
26 static_assert( variadic::all_of< is_pair, KeyValuePairs...>::type::value,
"All the arguments of a map must be key/value pairs");
27 static_assert( variadic::is_unique<typename KeyValuePairs::first_type ...>::type::value,
"Duplicate keys in the map");
29 typedef std::tuple<
typename KeyValuePairs::second_type ... > base_type;
30 typedef map<KeyValuePairs...> map_type;
32 using base_type::base_type;
35 typename map_type::template at<Key>::type & at()
37 return std::get< map_type::template at<Key>::index >(*this);
41 typename map_type::template at<Key>::type
const & at()
const
43 return std::get< map_type::template at<Key>::index >(*this);
50 using count =
typename map_type::template count<Key>;
55 #endif // TINYMPL_FUSED_MAP_HPP
The number of elements contained in the map.
Definition: map.hpp:77
Determines whether the map is empty.
Definition: map.hpp:82