ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
sltk_util.h
Go to the documentation of this file.
1#ifndef UTIL_H
2#define UTIL_H
3
4#include <string>
5
6/*** Data ***/
7
8static struct { template<typename T> operator T*() const { return static_cast<T*>(0); } } NullPtr;
9
10/*** Function ***/
11template<typename exception>
12static inline void affirm(const bool b)
13
14{ if (!b) throw exception(); }
15
16template<typename exception>
17static inline void affirm(const bool b, const char* const message)
18
19{ if (!b) throw exception(message); }
20
21template<typename exception>
22static inline void affirm(const bool b, const std::string& message)
23
24{ if (!b) throw exception(message); }
25
26#endif
#define T
Definition exp.cpp:237