licornea_tools
Namespaces | Typedefs | Functions
misc.h File Reference
#include <string>
#include <vector>
#include <random>
#include <memory>
#include <type_traits>
#include "misc.tcc"

Go to the source code of this file.

Namespaces

 tlz
 

Typedefs

using tlz::default_random_engine = std::mt19937
 
template<typename... >
using tlz::void_t = void
 

Functions

template<typename Numeric >
Numeric tlz::sq (Numeric n)
 Compute square of a number. More...
 
template<typename T , typename T2 , typename T3 >
tlz::clamp (T value, T2 minimum, T3 maximum)
 Clamp value between minimum and maximum value. More...
 
template<typename T >
tlz::gcd (T a, T b)
 Compute greatest common divisor of a and b. More...
 
template<typename T >
tlz::lcm (T a, T b)
 Compute least common multiple of a and b. More...
 
template<typename T >
bool tlz::is_power_of_two (T x)
 Check if x is a power of 2. More...
 
template<typename T , typename T2 >
bool tlz::is_multiple_of (T x, T2 base)
 Check if x is a multiple of base, including zero. More...
 
template<typename T , typename T2 >
bool tlz::is_nonzero_multiple_of (T x, T2 base)
 Check if x is a non-zero multiple of base. More...
 
template<typename T >
bool tlz::is_odd (T x)
 Check if x is odd. More...
 
template<typename T >
bool tlz::is_even (T x)
 Check if x is even. More...
 
default_random_engine & tlz::random_engine ()
 
template<typename T >
tlz::randint (T a, T b)
 
template<typename T >
auto tlz::forward_make_shared (T &&t)
 Get shared_ptr to new object copy- or move- constructed from t. More...
 
template<typename T >
auto tlz::forward_make_shared_const (T &&t)
 Get shared_ptr to new const object copy- or move- constructed from t. More...