33namespace triqs::utility {
52 using type = T
const &;
54 template <
class T>
struct remove_rvalue_ref<T &&> {
90 static const char name =
'+';
91 template <
typename L,
typename R>
auto operator()(L &&l, R &&r)
const DECL_AND_RETURN(std::forward<L>(l) + std::forward<R>(r))
96 static const char name =
'-';
97 template <
typename L,
typename R>
auto operator()(L &&l, R &&r)
const DECL_AND_RETURN(std::forward<L>(l) - std::forward<R>(r))
101 template <>
struct operation<tags::multiplies> {
102 static const char name =
'*';
103 template <
typename L,
typename R>
auto operator()(L &&l, R &&r)
const DECL_AND_RETURN(std::forward<L>(l) * std::forward<R>(r))
107 template <>
struct operation<tags::divides> {
108 static const char name =
'/';
109 template <
typename L,
typename R>
auto operator()(L &&l, R &&r)
const DECL_AND_RETURN(std::forward<L>(l) / std::forward<R>(r))
119 template <
typename T>
struct is_in_ZRC : std::is_arithmetic<T> {};
120 template <>
struct is_in_ZRC<bool> : std::true_type {};
121 template <
typename T>
struct is_in_ZRC<std::complex<T>> : std::true_type {};
122 template <
typename T>
struct is_in_ZRC<T &> : is_in_ZRC<T> {};
135 using type =
decltype(std::declval<std::remove_reference_t<A>>() * std::declval<std::remove_reference_t<B>>());
const_view_type operator()() const
Make a const view of *this.
#define DECL_AND_RETURN(...)
Trailing-return-type convenience: expands to -> decltype(...) { return ...; }.
typename remove_rvalue_ref< T >::type remove_rvalue_ref_t
Alias for the nested type in remove_rvalue_ref.
Common macros used in TRIQS.
Trait identifying types that lie in .
Callable wrapper that evaluates the operation identified by Tag on two operands.
Strip rvalue references from T while turning lvalue references into const &.
Trait whose nested type is decltype(a * b) with cv-/ref-qualifiers stripped from the operands.