41template<
typename Container,
typename Pred>
43 auto old_size = container.size();
44 container.erase(std::remove_if(container.begin(), container.end(), pred), container.end());
45 return old_size - container.size();
56template<
typename Map,
typename Key>
58 if (
auto it = map.find(key); it != map.end())
60 return typename Map::mapped_type {};
64template<
typename T, std::size_t N,
typename F, std::size_t... Is>
72template<
typename T, std::
size_t N,
typename F>
size_t stl_remove_if(Container &container, Pred pred)
Convenience function to remove items from an stl container which match pred.
std::array< T, N > generate_array(F &&f)
Helper function to initialize std::array with non-copyable types.
auto stl_get_or_default(const Map &map, const Key &key) -> typename Map::mapped_type
Convenience function to get an item from a map, or if the item doesn't exist return a default value.
std::array< T, N > generate_array_impl(F &&f, std::index_sequence< Is... >)