Go to the documentation of this file.
13 #ifndef MOMO_INCLUDE_GUARD_STDISH_SET_MAP_UTILITY
14 #define MOMO_INCLUDE_GUARD_STDISH_SET_MAP_UTILITY
17 # if __has_include(<momo/Utility.h>)
21 #ifndef MOMO_PARENT_HEADER
22 # include "../Utility.h"
25 #include MOMO_PARENT_HEADER(SetUtility)
26 #include MOMO_PARENT_HEADER(MapUtility)
28 #ifdef MOMO_HAS_CONTAINERS_RANGES
40 template<
typename TSetExtractedItem>
56 noexcept(std::is_nothrow_move_constructible<SetExtractedItem>::value)
57 : mSetExtractedItem(
std::move(node.mSetExtractedItem))
63 template<
typename Set>
65 : mSetExtractedItem(
set.get_nested_container(), iter)
77 return mSetExtractedItem.IsEmpty();
80 explicit operator bool() const noexcept
87 return mSetExtractedItem.GetItem();
92 return mSetExtractedItem.GetItem();
103 return mSetExtractedItem;
110 template<
typename TMapExtractedPair>
122 template<
typename Map>
123 struct ConstIteratorProxy :
private Map::const_iterator
125 typedef typename Map::const_iterator ConstIterator;
135 noexcept(std::is_nothrow_move_constructible<MapExtractedPair>::value)
136 : mMapExtractedPair(
std::move(node.mMapExtractedPair))
142 template<
typename Map>
144 : mMapExtractedPair(
map.get_nested_container(),
145 ConstIteratorProxy<Map>::GetBaseIterator(iter))
157 return mMapExtractedPair.IsEmpty();
160 explicit operator bool() const noexcept
167 return mMapExtractedPair.GetKey();
172 return mMapExtractedPair.GetKey();
177 return mMapExtractedPair.GetValue();
182 return mMapExtractedPair.GetValue();
193 return mMapExtractedPair;
200 template<
typename Iterator,
typename NodeHandle>
208 #ifdef MOMO_HAS_DEDUCTION_GUIDES
209 template<
typename Key,
typename Allocator,
typename Hasher,
210 typename EqualComparer = std::equal_to<Key>,
211 typename = decltype(std::declval<Allocator&>().allocate(
size_t{})),
212 typename = decltype(std::declval<Hasher&>()(std::declval<const Key&>())),
213 typename = decltype(std::declval<EqualComparer&>()(std::declval<const Key&>(),
214 std::declval<const Key&>()))>
215 class unordered_checker
219 template<
typename Key,
typename Allocator,
220 typename LessComparer = std::less<Key>,
221 typename = decltype(std::declval<Allocator&>().allocate(
size_t{})),
222 typename = decltype(std::declval<LessComparer&>()(std::declval<const Key&>(),
223 std::declval<const Key&>()))>
224 class ordered_checker
227 #endif // MOMO_HAS_DEDUCTION_GUIDES
234 #endif // MOMO_INCLUDE_GUARD_STDISH_SET_MAP_UTILITY
SetExtractedItem::Item value_type
Definition: set_map_utility.h:47
momo::stdish::map is similar to std::map, but much more efficient in memory usage....
Definition: map.h:824
SetExtractedItem & ptGetExtractedItem() noexcept
Definition: set_map_utility.h:101
map_node_handle(map_node_handle &&node) noexcept(std::is_nothrow_move_constructible< MapExtractedPair >::value)
Definition: set_map_utility.h:134
const mapped_type & mapped() const
Definition: set_map_utility.h:175
Definition: set_map_utility.h:202
map_node_handle(Map &map, typename Map::const_iterator iter)
Definition: set_map_utility.h:143
set_node_handle & operator=(const set_node_handle &)=delete
set_node_handle(Set &set, typename Set::const_iterator iter)
Definition: set_map_utility.h:64
momo::stdish::set is similar to std::set, but much more efficient in memory usage....
Definition: set.h:67
MOMO_NODISCARD bool empty() const noexcept
Definition: set_map_utility.h:155
MapExtractedPair & ptGetExtractedPair() noexcept
Definition: set_map_utility.h:191
map_node_handle(const map_node_handle &)=delete
TMapExtractedPair MapExtractedPair
Definition: set_map_utility.h:114
NodeHandle node
Definition: set_map_utility.h:205
Definition: set_map_utility.h:112
map_node_handle & operator=(const map_node_handle &)=delete
value_type & value()
Definition: set_map_utility.h:90
set_node_handle() noexcept
Definition: set_map_utility.h:51
bool inserted
Definition: set_map_utility.h:204
MapExtractedPair::Key key_type
Definition: set_map_utility.h:117
TSetExtractedItem SetExtractedItem
Definition: set_map_utility.h:44
#define MOMO_DECLARE_PROXY_FUNCTION(Object, Func)
Definition: Utility.h:126
MOMO_NODISCARD bool empty() const noexcept
Definition: set_map_utility.h:75
const value_type & value() const
Definition: set_map_utility.h:85
MapExtractedPair::Value mapped_type
Definition: set_map_utility.h:118
~set_node_handle()=default
const key_type & key() const
Definition: set_map_utility.h:165
Definition: set_map_utility.h:42
Iterator position
Definition: set_map_utility.h:203
mapped_type & mapped()
Definition: set_map_utility.h:180
set_node_handle(set_node_handle &&node) noexcept(std::is_nothrow_move_constructible< SetExtractedItem >::value)
Definition: set_map_utility.h:55
map_node_handle() noexcept
Definition: set_map_utility.h:130
set_node_handle(const set_node_handle &)=delete
#define MOMO_NODISCARD
Definition: UserSettings.h:217
key_type & key()
Definition: set_map_utility.h:170
~map_node_handle()=default