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

Definition of the Interval class template and closely related code. More...

#include <algorithm>
#include <limits>
#include <initializer_list>
#include <iostream>
#include <type_traits>
#include <utility>
#include <playrho/NonNegative.hpp>
Include dependency graph for Interval.hpp:
This graph shows which files directly or indirectly include this file:

Classes

class  playrho::Interval< T >
 Interval template type. More...
 

Namespaces

 playrho
 

Functions

template<typename T , typename U = decltype(Interval<T>{}, ((T{} + T{}) / 2))>
constexpr auto playrho::GetCenter (const Interval< T > &v) noexcept(noexcept((v.GetMin()+v.GetMax())/2))
 Gets the center of the given interval. More...
 
template<typename T >
constexpr Interval< T > playrho::GetIntersection (Interval< T > a, const Interval< T > &b) noexcept
 Gets the intersecting interval of two given ranges.
 
template<typename T , typename U = decltype(Interval<T>{}, (T{} - T{}))>
constexpr auto playrho::GetSize (const Interval< T > &v) noexcept(noexcept(v.GetMax() - v.GetMin()))
 Gets the size of the given interval. More...
 
template<typename T >
constexpr bool playrho::IsEntirelyAfter (const Interval< T > &a, const Interval< T > &b)
 Determines whether the first range is entirely after the second range.
 
template<typename T >
constexpr bool playrho::IsEntirelyBefore (const Interval< T > &a, const Interval< T > &b)
 Determines whether the first range is entirely before the second range.
 
template<typename T >
constexpr bool playrho::IsEntirelyEnclosing (const Interval< T > &a, const Interval< T > &b)
 Determines whether the first range entirely encloses the second.
 
template<typename T , typename U = decltype(Interval<T>{}, T{} < T{}, T{} >= T{})>
constexpr bool playrho::IsIntersecting (const Interval< T > &a, const Interval< T > &b) noexcept(noexcept(T{}< T{}) &&noexcept(T{} >=T{}))
 Checks whether two value ranges have any intersection/overlap at all. More...
 
template<typename T >
constexpr bool playrho::operator!= (const Interval< T > &a, const Interval< T > &b) noexcept
 Inequality operator. More...
 
template<typename T >
constexpr bool playrho::operator< (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Less-than operator. More...
 
template<typename T >
::std::ostream & playrho::operator<< (::std::ostream &os, const Interval< T > &value)
 Output stream operator.
 
template<typename T >
constexpr bool playrho::operator<= (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Less-than or equal-to operator. More...
 
template<typename T >
constexpr bool playrho::operator== (const Interval< T > &a, const Interval< T > &b) noexcept
 Equality operator. More...
 
template<typename T >
constexpr bool playrho::operator> (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Greater-than operator. More...
 
template<typename T >
constexpr bool playrho::operator>= (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Greater-than or equal-to operator. More...
 

Detailed Description

Definition of the Interval class template and closely related code.