29 template<
typename T1,
typename T2>
30 inline constexpr
bool decayed_is_same = std::is_same_v<std::decay_t<T1>, std::decay_t<T2>>;
45 template<
typename Container,
typename Value>
48 static bool eval(
const Container& container,
const Value& value)
50 typename Container::const_iterator end = container.end();
51 return std::find(container.begin(), end, value) != end;
60 template<
typename Container>
63 static bool eval(
const Container& container,
const typename Container::key_type& value)
65 return container.find(value) != container.end();
79 template<
typename Container,
typename Value>
80 inline bool contains(
const Container& container,
const Value& value)
99 template<
typename Container,
typename Predicate>
100 void erase_if(Container& container,
const Predicate& predicate)
102 container.erase(std::remove_if(container.begin(), container.end(), predicate), container.end());
110 template<
typename Container,
typename Value>
111 std::size_t
erase(Container& container,
const Value& value)
113 auto iter =
std::remove(container.begin(), container.end(), value);
114 auto num_removed = container.end() - iter;
115 container.erase(iter, container.end());
123 template<
typename Container,
typename Predicate>
124 void sort_if(Container& container,
const Predicate& predicate)
126 std::sort(container.begin(), container.end(), predicate);
void remove()
Removes a tip.
constexpr bool decayed_is_same
Equivalent to as std::is_same_v except both types are passed through std::decay first.
std::size_t erase(Container &container, const Value &value)
Convenience wrapper for using std::remove on a container.
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
std::string get_unknown_exception_type()
Utility function for finding the type of thing caught with catch(...).
void erase_if(Container &container, const Predicate &predicate)
Convenience wrapper for using std::remove_if on a container.
constexpr bool dependent_false_v
Workaround for the fact that static_assert(false) is invalid.
void sort_if(Container &container, const Predicate &predicate)
Convenience wrapper for using std::sort on a container.
static bool eval(const Container &container, const typename Container::key_type &value)
A struct that exists to implement a generic wrapper for std::find.
static bool eval(const Container &container, const Value &value)