mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Namespaces | Functions
misc.h File Reference
#include <string>
#include <vector>
#include "misc.tcc"

Go to the source code of this file.

Namespaces

 mf
 

Functions

bool mf::file_exists (const std::string &filename)
 Check if a file at filename exists. More...
 
template<typename Numeric >
Numeric mf::sq (Numeric n)
 Compute square of a number. More...
 
template<typename T >
T * mf::advance_raw_ptr (T *ptr, std::ptrdiff_t diff) noexcept
 Advance a pointer ptr of any type by diff bytes. More...
 
template<typename T >
mf::clamp (T value, T minimum, T maximum)
 Clamp value between minimum and maximum value. More...
 
template<typename T >
mf::gcd (T a, T b)
 Compute greatest common divisor of a and b. More...
 
template<typename T >
bool mf::is_power_of_two (T x)
 Check if x is a power of 2. More...
 
template<typename T >
bool mf::is_multiple_of (T x, T base)
 Check if x is a multiple of base, including zero. More...
 
template<typename T >
bool mf::is_nonzero_multiple_of (T x, T base)
 Check if x is a non-zero multiple of base. More...
 
template<typename T >
bool mf::is_odd (T x)
 Check if x is odd. More...
 
template<typename T >
bool mf::is_even (T x)
 Check if x is even. More...