Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Variables
error.h File Reference

Predefined exceptions for common errors. More...

#include <stdexcept>
#include "util/macro_util.h"

Go to the source code of this file.

Classes

struct  dependent_false< T >
 

Namespaces

namespace  bbm
 

Macros

#define BBM_ERROR_MSG(...)   BBM_STRINGIFY( __VA_ARGS__ (__FILE__ : __LINE__). )
 
Predefined Run-time Errors
#define bbm_incomplete_init   std::runtime_error(BBM_ERROR_MSG(BBM: accessing incompletely initialized object))
 
#define bbm_unassigned_ref   std::runtime_error(BBM_ERROR_MSG(BBM: Unassigned references cannot be cast/read))
 
#define bbm_out_of_range   std::runtime_error(BBM_ERROR_MSG(BBM: index out of range))
 
#define bbm_size_error   std::runtime_error(BBM_ERROR_MSG(BBM: size error))
 
#define bbm_unevaluable   std::runtime_error(BBM_ERROR_MSG(BBM: cannot evaluate expression))
 
Predefined Compile-time Errors
#define BBM_SIZE_MISMATCH   "BBM: size mismatch"
 
#define BBM_NO_MATCH   "BBM: no matching argument found"
 
#define BBM_NOT_DIFF   "BBM: type does not support gradients"
 
#define BBM_INVALID_LAMBDA   "BBM: invalid lambda signature"
 
#define BBM_CONST_ASSIGNMENT   "BBM: cannot assign to a const type"
 

Variables

template<typename... T>
static constexpr bool dependent_false_v = dependent_false<T...>::value
 
template<typename... T>
static constexpr bool dependent_true_v = !dependent_false<T...>::value
 

Detailed Description

Predefined exceptions for common errors.

Macro Definition Documentation

◆ BBM_CONST_ASSIGNMENT

#define BBM_CONST_ASSIGNMENT   "BBM: cannot assign to a const type"

◆ BBM_ERROR_MSG

#define BBM_ERROR_MSG (   ...)    BBM_STRINGIFY( __VA_ARGS__ (__FILE__ : __LINE__). )

◆ bbm_incomplete_init

#define bbm_incomplete_init   std::runtime_error(BBM_ERROR_MSG(BBM: accessing incompletely initialized object))

◆ BBM_INVALID_LAMBDA

#define BBM_INVALID_LAMBDA   "BBM: invalid lambda signature"

◆ BBM_NO_MATCH

#define BBM_NO_MATCH   "BBM: no matching argument found"

◆ BBM_NOT_DIFF

#define BBM_NOT_DIFF   "BBM: type does not support gradients"

◆ bbm_out_of_range

#define bbm_out_of_range   std::runtime_error(BBM_ERROR_MSG(BBM: index out of range))

◆ bbm_size_error

#define bbm_size_error   std::runtime_error(BBM_ERROR_MSG(BBM: size error))

◆ BBM_SIZE_MISMATCH

#define BBM_SIZE_MISMATCH   "BBM: size mismatch"

◆ bbm_unassigned_ref

#define bbm_unassigned_ref   std::runtime_error(BBM_ERROR_MSG(BBM: Unassigned references cannot be cast/read))

◆ bbm_unevaluable

#define bbm_unevaluable   std::runtime_error(BBM_ERROR_MSG(BBM: cannot evaluate expression))