ABACUS
develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
source
source_cell
module_neighbor
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
8
static
struct
{
template
<
typename
T>
operator
T
*()
const
{
return
static_cast<
T
*
>
(0); } } NullPtr;
9
10
/*** Function ***/
11
template
<
typename
exception>
12
static
inline
void
affirm(
const
bool
b)
13
14
{
if
(!b)
throw
exception(); }
15
16
template
<
typename
exception>
17
static
inline
void
affirm(
const
bool
b,
const
char
*
const
message)
18
19
{
if
(!b)
throw
exception(message); }
20
21
template
<
typename
exception>
22
static
inline
void
affirm(
const
bool
b,
const
std::string& message)
23
24
{
if
(!b)
throw
exception(message); }
25
26
#endif
T
#define T
Definition
exp.cpp:237
Generated by
1.9.8