9 #ifndef LIBPMEMOBJ_PAIR_HPP
10 #define LIBPMEMOBJ_PAIR_HPP
22 template <
typename F,
typename S>
24 constexpr pair() : first(), second()
28 template <
typename... Args1,
typename... Args2>
29 pair(std::piecewise_construct_t pc, std::tuple<Args1...> first_args,
30 std::tuple<Args2...> second_args)
31 : pair(pc, first_args, second_args, index_sequence_for<Args1...>{},
32 index_sequence_for<Args2...>{})
36 constexpr pair(
const F &k,
const S &v) : first(k), second(v)
40 template <
typename K,
typename V>
41 constexpr pair(K &&k, V &&v)
42 : first(std::forward<K>(k)), second(std::forward<V>(v))
46 template <
typename K,
typename V>
47 constexpr pair(
const std::pair<K, V> &p)
48 : first(p.first), second(p.second)
52 template <
typename K,
typename V>
53 constexpr pair(std::pair<K, V> &&p)
54 : first(std::forward<K>(p.first)), second(std::forward<V>(p.second))
62 template <
typename... Args1,
typename... Args2,
size_t... I1,
64 pair(std::piecewise_construct_t, std::tuple<Args1...> &first_args,
65 std::tuple<Args2...> &second_args, index_sequence<I1...>,
66 index_sequence<I2...>)
67 : first(std::forward<Args1>(std::get<I1>(first_args))...),
68 second(std::forward<Args2>(std::get<I2>(second_args))...)
73 template <
class T1,
class T2>
75 operator==(
const pair<T1, T2> &lhs,
const pair<T1, T2> &rhs)
77 return lhs.first == rhs.first && lhs.second == rhs.second;
80 template <
class T1,
class T2>
82 operator!=(
const pair<T1, T2> &lhs,
const pair<T1, T2> &rhs)
Create c++14 style index sequence.
Persistent memory namespace.
Definition: allocation_flag.hpp:15