PlayRho  2.0.0
An interactive physics engine & library.
Templates.hpp File Reference

Definitions of miscellaneous template related code. More...

#include <cstdlib>
#include <type_traits>
#include <playrho/detail/Templates.hpp>
Include dependency graph for Templates.hpp:
This graph shows which files directly or indirectly include this file:

Classes

struct  playrho::LexicographicalGreater< T >
 Function object for performing lexicographical greater-than comparisons of containers. More...
 
struct  playrho::LexicographicalGreaterEqual< T >
 Function object for performing lexicographical greater-than or equal-to comparisons of containers. More...
 
struct  playrho::LexicographicalLess< T >
 Function object for performing lexicographical less-than comparisons of containers. More...
 
struct  playrho::LexicographicalLessEqual< T >
 Function object for performing lexicographical less-than or equal-to comparisons of containers. More...
 
struct  playrho::ReversionWrapper< T >
 Wrapper for reversing ranged-for loop ordering. More...
 

Namespaces

 playrho
 

Typedefs

template<typename Type , typename Check , typename DecayedType = std::decay_t<Type>>
using playrho::DecayedTypeIfNotSame = std::enable_if_t<!std::is_same_v< DecayedType, Check >, DecayedType >
 Decayed type if not same as the checked type. More...
 
template<typename Type , typename Return >
using playrho::HasNullaryFunctor = detail::HasFunctor< Type, Return()>
 Has nullary functor type alias. More...
 
template<typename Type , typename Return , typename Arg >
using playrho::HasUnaryFunctor = detail::HasFunctor< Type, Return(Arg)>
 Has unary functor type alias. More...
 

Functions

template<typename T >
auto playrho::begin (ReversionWrapper< T > w)
 Begin function for getting a reversed order iterator.
 
template<typename T >
auto playrho::end (ReversionWrapper< T > w)
 End function for getting a reversed order iterator.
 
template<class InputIt1 , class InputIt2 >
constexpr auto playrho::Equal (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) -> decltype(first1==last1, first2==last2,++first1,++first2, *first1== *first2)
 A pre-C++20 constant expression implementation of std::equal. More...
 
template<typename T , typename U >
auto playrho::EraseAll (T &container, const U &value) -> decltype(distance(container.erase(remove(begin(container), end(container), value), end(container)), end(container)))
 Convenience template function for erasing specified value from container. More...
 
template<typename T , typename U >
auto playrho::EraseFirst (T &container, const U &value) -> decltype(container.erase(find(begin(container), end(container), value)) !=end(container))
 Convenience template function for erasing first found value from container. More...
 
template<typename T >
constexpr auto playrho::IsValid (const T &value) noexcept -> bool
 Determines if the given value is valid, using the equality operator. More...
 
constexpr auto playrho::IsValid (std::size_t value) noexcept -> bool
 Determines if the given value is valid.
 
template<typename T >
std::enable_if_t< IsReverseIterableV< T >, ReversionWrapper< T > > playrho::Reverse (T &&iterable)
 Gets a reversed order iterated wrapper. More...
 

Variables

template<class T1 , class T2 = T1>
constexpr bool playrho::IsAddableV = detail::IsAddable<T1, T2>::value
 Determines whether the given type is an addable type.
 
template<class T >
constexpr bool playrho::IsArithmeticV = detail::IsArithmetic<T>::value
 Determines whether the given type is an arithmetic type.
 
template<class T1 , class T2 = T1>
constexpr bool playrho::IsDivisableV = detail::IsDivisable<T1, T2>::value
 Determines whether the given type is a divisible type.
 
template<class T1 , class T2 = T1>
constexpr bool playrho::IsEqualityComparableV = detail::IsEqualityComparable<T1, T2>::value
 Determines whether the given types are equality comparable.
 
template<class T1 , class T2 = T1>
constexpr bool playrho::IsInequalityComparableV = detail::IsInequalityComparable<T1, T2>::value
 Determines whether the given types are inequality comparable.
 
template<class T >
constexpr bool playrho::IsIterableV = detail::IsIterable<T>::value
 Determines whether the given type is an iterable type.
 
template<class T1 , class T2 = T1>
constexpr bool playrho::IsMultipliableV = detail::IsMultipliable<T1, T2>::value
 Determines whether the given type is a multipliable type.
 
template<class T >
constexpr bool playrho::IsReverseIterableV = detail::IsReverseIterable<T>::value
 Determines whether the given type is a reverse iterable type.
 

Detailed Description

Definitions of miscellaneous template related code.