neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib.hpp File Reference
#include <type_traits>
#include <cstdint>
#include <utility>
#include <variant>
#include <optional>
#include <chrono>
#include <stdexcept>
#include <string>
#include <neolib/neolib_export.hpp>

Go to the source code of this file.

Classes

struct  neolib::sfinae
 
struct  neolib::variadic_index< T, T, Ts... >
 
struct  neolib::variadic_index< T, Tail, Ts... >
 
struct  neolib::detail::is_pair< T >
 
struct  neolib::detail::is_pair< std::pair< T1, T2 > >
 
struct  neolib::detail::is_pair< const std::pair< T1, T2 > >
 
struct  neolib::detail::correct_const< T, AT, typename std::enable_if_t<!std::is_const_v< T >, sfinae > >
 
struct  neolib::detail::correct_const< T, AT, typename std::enable_if_t< std::is_const_v< T >, sfinae > >
 
struct  neolib::detail::abstract_type< typename, typename >
 
struct  neolib::detail::abstract_type< T, typename std::enable_if_t< abstract_class_possible_v< T >, sfinae > >
 
struct  neolib::detail::abstract_type< T, typename std::enable_if_t< std::is_arithmetic_v< T >, sfinae > >
 
struct  neolib::detail::abstract_type< T, typename std::enable_if_t< std::is_enum_v< T >, sfinae > >
 
struct  neolib::detail::abstract_type< T, typename std::enable_if_t< std::is_pointer_v< T >, sfinae > >
 
struct  neolib::detail::abstract_type< std::pair< T1, pair< T1, T2 > > >
 
struct  neolib::detail::abstract_type< const std::pair< T1, pair< T1, T2 > > >
 
struct  neolib::detail::abstract_type< std::monostate >
 
struct  neolib::detail::abstract_type< std::chrono::duration< Rep, Period > >
 
struct  neolib::detail::abstract_return_type< T, typename >
 
struct  neolib::detail::abstract_return_type< T, std::enable_if_t< std::is_scalar_v< T >, sfinae > >
 

Namespaces

namespace  neolib
 
namespace  neolib::detail
 

Macros

#define STRING2(x)   #x
 
#define STRING(x)   STRING2(x)
 
#define TODO_MSG   __FILE__ "(" STRING(__LINE__) "): TODO"
 
#define TODO    throw std::logic_error(std::string{ TODO_MSG });
 
#define rvalue_cast   static_cast
 
#define GENERATE_HAS_MEMBER_TYPE(Type)
 

Typedefs

template<typename T >
using neolib::to_const_reference_t = const std::remove_reference_t< T > &
 
template<typename T , typename AT >
using neolib::detail::correct_const_t = typename correct_const< T, AT >::type
 
template<typename T >
using neolib::abstract_t = typename detail::abstract_type< T >::type
 
template<typename T >
using neolib::abstract_return_t = typename detail::abstract_return_type< T >::type
 
template<typename T >
using neolib::cache = std::optional< T >
 

Functions

template<typename T >
to_const_reference_t< Tneolib::to_const (T &&object)
 
template<typename T , typename = std::enable_if_t<detail::abstract_type<T>::value, sfinae>>
const abstract_t< T > & neolib::to_abstract (const T &aArgument)
 
template<typename T , typename = std::enable_if_t<detail::abstract_type<T>::value, sfinae>>
abstract_t< T > & neolib::to_abstract (T &aArgument)
 
template<typename T1 , typename T2 >
const abstract_t< pair< T1, T2 > > & neolib::to_abstract (const std::pair< T1, pair< T1, T2 > > &aArgument)
 
template<typename T1 , typename T2 >
abstract_t< neolib::pair< T1, T2 > > & neolib::to_abstract (std::pair< T1, pair< T1, T2 > > &aArgument)
 
template<typename T >
void neolib::clear_cache (cache< T > &aCachedVariable)
 

Variables

constexpr bool ndebug = false
 
template<typename T , typename... Ts>
constexpr std::size_t neolib::index_of_v = variadic_index<T, Ts...>::value
 
template<typename T >
constexpr bool neolib::detail::is_pair_v = is_pair<T>::value
 
template<typename T >
constexpr bool neolib::detail::abstract_class_possible_v = std::is_class_v<T> && has_member_type_abstract_type<T>::value
 
constexpr auto neolib::invalid = std::nullopt
 

Macro Definition Documentation

◆ GENERATE_HAS_MEMBER_TYPE

#define GENERATE_HAS_MEMBER_TYPE (   Type)

Definition at line 71 of file neolib.hpp.

◆ rvalue_cast

#define rvalue_cast   static_cast

Definition at line 69 of file neolib.hpp.

◆ STRING

#define STRING (   x)    STRING2(x)

Definition at line 57 of file neolib.hpp.

◆ STRING2

#define STRING2 (   x)    #x

Definition at line 56 of file neolib.hpp.

◆ TODO

#define TODO    throw std::logic_error(std::string{ TODO_MSG });

Definition at line 65 of file neolib.hpp.

◆ TODO_MSG

#define TODO_MSG   __FILE__ "(" STRING(__LINE__) "): TODO"

Definition at line 59 of file neolib.hpp.

Variable Documentation

◆ ndebug

constexpr bool ndebug = false
constexpr

Definition at line 53 of file neolib.hpp.