MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / addBack

Method addBack

source/core/StarOrderedSet.hpp:202–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201template <template <typename...> class Map, typename Value, typename Allocator, typename... Args>
202bool OrderedSetWrapper<Map, Value, Allocator, Args...>::addBack(Value const& v) {
203 auto i = m_map.find(v);
204 if (i != m_map.end()) {
205 m_order.splice(m_order.end(), m_order, i->second);
206 return false;
207 } else {
208 iterator orderIt = m_order.insert(m_order.end(), v);
209 m_map.insert(typename MapType::value_type(std::cref(*orderIt), orderIt));
210 return true;
211 }
212}
213
214template <template <typename...> class Map, typename Value, typename Allocator, typename... Args>
215bool OrderedSetWrapper<Map, Value, Allocator, Args...>::addFront(Value const& v) {

Callers 1

TESTFunction · 0.80

Calls 4

value_typeClass · 0.85
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by 1

TESTFunction · 0.64