OmniSciDB  04ee39c94c
ConstExprLib.h
Go to the documentation of this file.
1 #ifndef CONSTEXPRLIB_H
2 #define CONSTEXPRLIB_H
3 
4 namespace Experimental {
5 
6 template <typename T1, typename T2>
7 struct ConstExprPair {
8  using first_type = T1;
9  using second_type = T2;
10 
11  constexpr ConstExprPair() : first(), second() {}
12  constexpr ConstExprPair(first_type const& t1, second_type const& t2)
13  : first(t1), second(t2) {}
14 
15  template <typename U1, typename U2>
17  : first(p.first), second(p.second) {}
18 
19  constexpr ConstExprPair& operator=(ConstExprPair& other) {
20  first = other.first;
21  second = other.second;
22  return *this;
23  }
24 
25  constexpr void swap(ConstExprPair& other) noexcept {
26  first_type tempt1 = first;
27  second_type tempt2 = second;
28  first = other.first;
29  second = other.second;
30  other.first = tempt1;
31  other.second = tempt2;
32  }
33 
36 };
37 
38 } // namespace Experimental
39 
40 #endif
constexpr ConstExprPair & operator=(ConstExprPair &other)
Definition: ConstExprLib.h:19
constexpr ConstExprPair(first_type const &t1, second_type const &t2)
Definition: ConstExprLib.h:12
constexpr ConstExprPair(ConstExprPair< U1, U2 > const &p)
Definition: ConstExprLib.h:16
constexpr void swap(ConstExprPair &other) noexcept
Definition: ConstExprLib.h:25