autoppl  v0.8
A C++ template library for probabilistic programming
type_traits.hpp File Reference
#include <cstddef>
#include <type_traits>

Go to the source code of this file.

Classes

struct  ppl::util::BaseCRTP< T >
 

Namespaces

 ppl
 
 ppl::util
 

Macros

#define DEFINE_ASSERT_ONE_PARAM(name)
 
#define DEFINE_ASSERT_TWO_PARAM(name)
 
#define PPL_CONT_XOR_DISC
 

Functions

 ppl::util::DEFINE_ASSERT_TWO_PARAM (is_explicitly_convertible_v)
 

Variables

template<class From , class To >
constexpr bool ppl::util::is_explicitly_convertible_v
 
template<class T >
constexpr bool ppl::util::is_cont_v = std::is_floating_point_v<T>
 
template<class T >
constexpr bool ppl::util::is_disc_v = std::is_integral_v<T>
 

Macro Definition Documentation

◆ DEFINE_ASSERT_ONE_PARAM

#define DEFINE_ASSERT_ONE_PARAM (   name)
Value:
namespace details { \
template <bool b> \
struct assert_##name \
{ \
static_assert(b, \
"Assert "#name" failed" \
); \
}; \
\
template<> \
struct assert_##name<true> : std::true_type \
{}; \
} \
template <class T> \
inline constexpr bool assert_##name = \
details::assert_##name<name<T>>::value; \

◆ DEFINE_ASSERT_TWO_PARAM

#define DEFINE_ASSERT_TWO_PARAM (   name)
Value:
namespace details { \
template <bool b> \
struct assert_##name \
{ \
static_assert(b, \
"Assert "#name" failed" \
); \
}; \
\
template<> \
struct assert_##name<true> : std::true_type \
{}; \
} \
template <class T, class U> \
inline constexpr bool assert_##name = \
details::assert_##name<name<T, U>>::value; \

◆ PPL_CONT_XOR_DISC

#define PPL_CONT_XOR_DISC
Value:
"Expression must be either continuous or discrete. " \
"It cannot be both continuous and discrete. "