Theoretica
A C++ numerical and automatic mathematical library
core_traits.h File Reference

Fundamental type traits. More...

#include <type_traits>
#include <tuple>
#include "constants.h"

Go to the source code of this file.

Classes

struct  theoretica::_internal::make_void< Args >
 
struct  theoretica::is_real_type< Type >
 Type trait to check whether a type represents a real number. More...
 
struct  theoretica::is_real_type< real >
 Type trait to check whether a type represents a real number. More...
 
struct  theoretica::is_orderable< Structure, typename >
 Check whether a structure is orderable, by checking that it has a comparison operator<(). More...
 
struct  theoretica::is_orderable< Structure, _internal::void_t< decltype(std::declval< Structure >()< std::declval< Structure >())> >
 
struct  theoretica::is_indexable< Structure, typename >
 Check whether a structure is indexable by a single integer index, by checking that it has the operator[](0). More...
 
struct  theoretica::is_indexable< Structure, _internal::void_t< decltype(std::declval< Structure >()[0])> >
 
struct  theoretica::is_iterable< Structure, typename >
 Check whether a structure is iterable, by checking that it has a method begin(). More...
 
struct  theoretica::is_iterable< Structure, _internal::void_t< decltype(std::declval< Structure >().begin())> >
 
struct  theoretica::is_vector< Structure, typename >
 Check whether a structure is considerable a vector, by checking that it has an operator[] and a size() method. More...
 
struct  theoretica::is_vector< Structure, _internal::void_t< decltype(std::declval< Structure >()[0]), decltype(std::declval< Structure >().size())> >
 
struct  theoretica::is_matrix< Structure, typename >
 Check whether a structure is considerable a matrix, by checking that it has an operator(), a rows() method and a cols() method. More...
 
struct  theoretica::is_matrix< Structure, _internal::void_t< decltype(std::declval< Structure >()(0, 0)), decltype(std::declval< Structure >().rows()), decltype(std::declval< Structure >().cols())> >
 
struct  theoretica::_internal::vector_element_or_void< Structure, typename >
 Helper structure for vector_element_t. More...
 
struct  theoretica::_internal::vector_element_or_void< Structure, _internal::void_t< decltype(std::declval< Structure & >()[0])> >
 Helper structure for vector_element_t. More...
 
struct  theoretica::has_type_elements< Structure, Type >
 Type trait to check whether an indexable container has elements of the given type. More...
 
struct  theoretica::extract_func_args< Function(Args...)>
 
struct  theoretica::_internal::return_type_or_void< Function, T, typename >
 
struct  theoretica::_internal::return_type_or_void< Function, T, _internal::void_t< decltype(std::declval< Function >()(T(0.0)))> >
 
struct  theoretica::_internal::func_helper< T >
 
struct  theoretica::_internal::func_helper< ReturnType(Args...)>
 
struct  theoretica::_internal::func_helper< ReturnType(*)(Args...)>
 
struct  theoretica::_internal::func_helper< ReturnType(Class::*)(Args...) const >
 

Namespaces

 theoretica
 Main namespace of the library which contains all functions and objects.
 

Typedefs

template<typename ... Args>
using theoretica::_internal::void_t = typename make_void< Args... >::type
 
template<typename Structure >
using theoretica::vector_element_or_void_t = typename _internal::vector_element_or_void< Structure >::type
 Extract the type of a vector (or any indexable container) from its operator[], returning void if the type has no operator[].
 
template<typename Structure >
using theoretica::vector_element_t = std::remove_reference_t< decltype(std::declval< Structure >()[0])>
 Extract the type of a vector (or any indexable container) from its operator[].
 
template<typename Structure >
using theoretica::matrix_element_t = std::remove_reference_t< decltype(std::declval< Structure >()(0, 0))>
 Extract the type of a matrix (or any doubly indexable container) from its operator().
 
template<typename Structure >
using theoretica::has_real_elements = is_real_type< vector_element_t< Structure > >
 Type trait to check whether an indexable container has real elements.
 
template<typename Structure , typename T = bool>
using theoretica::enable_matrix = std::enable_if_t< is_matrix< Structure >::value, T >
 Enable a function overload if the template typename is considerable a matrix. More...
 
template<typename Structure , typename T = bool>
using theoretica::enable_vector = std::enable_if_t< is_vector< Structure >::value, T >
 Enable a function overload if the template typename is considerable a vector. More...
 
template<typename Function >
using theoretica::is_real_func = std::conditional_t< is_real_type< typename _internal::return_type_or_void< Function, real >::type >::value, std::true_type, std::false_type >
 Type trait to check whether the given function takes a real number as its first argument.
 
template<typename Function , typename T = bool>
using theoretica::enable_real_func = typename std::enable_if_t< is_real_func< Function >::value, T >
 Enable a certain function overload if the given type is a function taking as first argument a real number.
 
template<typename Function >
using theoretica::return_type_t = typename _internal::func_helper< Function >::return_type
 Extract the return type of a Callable object, such as a function pointer or lambda function.
 

Detailed Description

Fundamental type traits.