Empirical
Namespaces | Functions
functions.h File Reference
#include <ctime>
#include <functional>
#include <iostream>
#include <type_traits>
#include <sstream>
#include "../base/assert.h"
#include "../base/vector.h"
#include "const.h"
#include "math.h"

Go to the source code of this file.

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 

Functions

static double emp::TimeFun (std::function< void()> test_fun)
 A function timer that takes a functor an identifies how long it takes to complete when run. More...
 
bool emp::Toggle (bool &in_bool)
 Toggle an input bool. More...
 
constexpr bool emp::AllTrue ()
 Combine bools to AND them all together. More...
 
template<typename... Ts>
bool emp::AllTrue (bool result, Ts...OTHER)
 
constexpr bool emp::AnyTrue ()
 Combine bools to OR them all together. More...
 
template<typename... Ts>
bool emp::AnyTrue (bool result, Ts...OTHER)
 
template<typename T >
static emp::vector< T > emp::BuildRange (T min, T max, T step=1)
 Build a vector with a range of values from min to max at the provided step size. More...
 
template<typename T , size_t N>
constexpr size_t emp::GetSize (T(&)[N])
 Determine the size of a built-in array. More...
 
static size_t emp::UniqueVal ()
 A function that will always return a unique value (and trip an assert if it can't...) More...
 
static std::string emp::UniqueName (const std::string &prefix="", const std::string &postfix="")