Exiv2
Loading...
Searching...
No Matches
Functions
enforce.hpp File Reference

Port of D's enforce() to C++ & Exiv2. More...

#include <string>
#include "error.hpp"

Go to the source code of this file.

Functions

template<typename exception_t , typename T >
void enforce (bool condition, const T &arg1)
 Ensure that condition is true, otherwise throw an exception of the type exception_t.
 
void enforce (bool condition, Exiv2::ErrorCode err_code)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code.
 
template<typename T >
void enforce (bool condition, Exiv2::ErrorCode err_code, const T &arg1)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code & arg1.
 
template<typename T , typename U >
void enforce (bool condition, Exiv2::ErrorCode err_code, const T &arg1, const U &arg2)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code, arg1 & arg2.
 
template<typename T , typename U , typename V >
void enforce (bool condition, Exiv2::ErrorCode err_code, const T &arg1, const U &arg2, const V &arg3)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code, arg1, arg2 & arg3.
 

Detailed Description

Port of D's enforce() to C++ & Exiv2.

Author
Dan Čermák (D4N) dan.cermak@cgc-instruments.com
Date
11-March-18, D4N: created

Function Documentation

◆ enforce()

template<typename exception_t , typename T >
void enforce ( bool  condition,
const T &  arg1 
)
inline