xerus
a general purpose tensor library
exceptions.h File Reference

Header file for xerus::misc::generic_error exception class. More...

#include <exception>
#include <sstream>
#include "stringFromTo.h"

Go to the source code of this file.

Classes

class  xerus::misc::generic_error
 The xerus exception class. More...
 

Namespaces

 xerus
 The main namespace of xerus.
 
 xerus::misc
 Collection of classes and functions that provide elementary functionality that is not special to xerus as a tensor library.
 

Macros

#define XERUS_THROW(...)   throw (__VA_ARGS__ << "\nexception thrown in function: " << (__func__) << " (" << (__FILE__) <<" : " << (__LINE__) << ")\n")
 Helper macro to throw a generic_error (or derived exception) with some additional information included (function name, file name and line number). More...
 

Functions

template<typename error_t , class T >
std::enable_if< std::is_base_of< generic_error, error_t >::value, error_t & >::type xerus::misc::operator<< (error_t &o, const T &_info) noexcept
 The pipe operator allows to add everything that can be converted to string to the error_info and derived exceptions. More...
 
template<typename error_t , class T >
std::enable_if< std::is_base_of< generic_error, error_t >::value, error_t & >::type xerus::misc::operator<< (error_t &&o, const T &_info) noexcept
 The pipe operator allows to add everything that can be converted to string to the error_info and derived exceptions. More...
 

Detailed Description

Header file for xerus::misc::generic_error exception class.

Definition in file exceptions.h.

Macro Definition Documentation

◆ XERUS_THROW

#define XERUS_THROW (   ...)    throw (__VA_ARGS__ << "\nexception thrown in function: " << (__func__) << " (" << (__FILE__) <<" : " << (__LINE__) << ")\n")

Helper macro to throw a generic_error (or derived exception) with some additional information included (function name, file name and line number).

Definition at line 73 of file exceptions.h.