TRIQS/TRIQS
4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
macros.hpp
Go to the documentation of this file.
1
// Copyright (c) 2013-2018 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
2
// Copyright (c) 2013-2018 Centre national de la recherche scientifique (CNRS)
3
// Copyright (c) 2018-2023 Simons Foundation
4
//
5
// This program is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
14
//
15
// You may obtain a copy of the License at
16
// https://www.gnu.org/licenses/gpl-3.0.txt
17
//
18
// Authors: Michel Ferrero, Olivier Parcollet, Nils Wentzell
19
24
25
#pragma once
26
27
#include "
./first_include.hpp
"
28
#include "
./traits.hpp
"
29
30
#include <boost/utility/enable_if.hpp>
31
#include <nda/macros.hpp>
32
33
#include <type_traits>
34
39
41
#define DECL_AND_RETURN(...) \
42
->decltype(__VA_ARGS__) { return __VA_ARGS__; }
43
45
#define TRIQS_CATCH_AND_ABORT \
46
catch (std::exception const &e) { \
47
std::cout << e.what() << std::endl; \
48
return 1; \
49
}
50
51
// Unused, outdated macros. Should be removed.
52
#define TYPE_ENABLE_IF(Type, ...) typename boost::enable_if<__VA_ARGS__, Type>::type
53
#define TYPE_ENABLE_IFC(Type, ...) typename boost::enable_if_c<__VA_ARGS__, Type>::type
54
#define TYPE_DISABLE_IF(Type, ...) typename boost::disable_if<__VA_ARGS__, Type>::type
55
#define TYPE_DISABLE_IFC(Type, ...) typename boost::disable_if_c<__VA_ARGS__, Type>::type
56
58
#define TRIQS_DEPRECATED(Message) __attribute__((deprecated(AS_STRING(Message))))
59
61
#define TRIQS_PRINT(X) std::cerr << AS_STRING(X) << " = " << (X) << " at " << __FILE__ << ":" << __LINE__ << '\n'
62
64
#define FORCEINLINE __inline__ __attribute__((always_inline))
65
67
#define TERMINATE(X) \
68
std::cerr << "Terminating at " << __FILE__ << ":" << __LINE__ << "\n"; \
69
std::cerr << (X); \
70
std::terminate(); \
71
}
72
73
// Fallback definitions for the c2py annotation macros: when this header is not included via the clair-c2py
74
// binding generator, the annotations expand to nothing so the production binary is unaffected.
75
#ifndef C2PY_INCLUDED
76
#define C2PY_IGNORE
77
#define C2PY_WRAP_AS_METHOD
78
#define C2PY_MODULE_INIT
79
#define C2PY_NOGIL
80
#define C2PY_RENAME(X)
81
#define C2PY_PROPERTY_GET(X)
82
#define C2PY_PROPERTY_SET(X)
83
#define C2PY_DEPRECATED_PARAMETER_NAME(...)
84
#endif
// C2PY_INCLUDED
85
first_include.hpp
Compiler / platform glue and the dcomplex alias (must be included before any Boost header).
traits.hpp
Traits used in TRIQS.
triqs
utility
macros.hpp
Generated by
1.15.0