The Battle for Wesnoth  1.19.5+dev
Classes | Namespaces | Functions | Variables
general.hpp File Reference
#include <algorithm>
#include <cctype>
#include <string>
Include dependency graph for general.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  utils::detail::contains_impl< Container, Value >
 A struct that exists to implement a generic wrapper for std::find. More...
 
struct  utils::detail::contains_impl< Container, typename Container::key_type >
 A struct that exists to implement a generic wrapper for the find() member of associative containers. More...
 

Namespaces

 utils
 
 utils::detail
 

Functions

template<typename Container , typename Value >
bool utils::contains (const Container &container, const Value &value)
 Returns true iff value is found in container. More...
 
std::string utils::get_unknown_exception_type ()
 Utility function for finding the type of thing caught with catch(...). More...
 
template<typename Container , typename Predicate >
void utils::erase_if (Container &container, const Predicate &predicate)
 Convenience wrapper for using std::remove_if on a container. More...
 
template<typename Container , typename Value >
std::size_t utils::erase (Container &container, const Value &value)
 Convenience wrapper for using std::remove on a container. More...
 
template<typename Container , typename Predicate >
void utils::sort_if (Container &container, const Predicate &predicate)
 Convenience wrapper for using std::sort on a container. More...
 

Variables

template<typename T1 , typename T2 >
constexpr bool utils::decayed_is_same = std::is_same_v<std::decay_t<T1>, std::decay_t<T2>>
 Equivalent to as std::is_same_v except both types are passed through std::decay first. More...
 
template<typename >
constexpr bool utils::dependent_false_v = false
 Workaround for the fact that static_assert(false) is invalid. More...