38 #ifndef LIBPMEMOBJ_CPP_V_HPP 39 #define LIBPMEMOBJ_CPP_V_HPP 52 namespace experimental
69 static_assert(std::is_default_constructible<T>::value,
70 "Type T must be default constructible");
107 return *
this = rhs.
get();
115 template <
typename Y,
116 typename =
typename std::enable_if<
117 std::is_convertible<Y, T>::value>::type>
121 return *
this = rhs.
get();
133 template <
typename... Args>
135 get(Args &&... args) noexcept
138 std::forward_as_tuple(std::forward<Args>(args)...);
140 PMEMobjpool *pop = pmemobj_pool_by_ptr(
this);
144 T *value =
static_cast<T *
>(pmemobj_volatile(
145 pop, &this->vlt, &this->val,
sizeof(T),
146 pmem::detail::c_style_construct<T, decltype(arg_pack),
148 static_cast<void *>(&arg_pack)));
170 operator T &() noexcept
181 std::swap(
get(), other.
get());
v & operator=(const T &rhs)
Assignment operator.
Definition: v.hpp:91
T & unsafe_get()
Retrieves reference to the object.
Definition: v.hpp:162
T & get(Args &&... args) noexcept
Retrieves reference to the object.
Definition: v.hpp:135
pmem::obj::experimental::v - volatile resides on pmem class.
Definition: v.hpp:67
Functions for destroying arrays.
Commonly used functionality.
v & operator=(v< Y > &rhs)
Converting assignment operator from a different v<>.
Definition: v.hpp:119
v & operator=(v &rhs)
Assignment operator.
Definition: v.hpp:105
~v()
Destructor.
Definition: v.hpp:82
Definition: allocation_flag.hpp:43
void swap(v &other)
Swaps two v objects of the same type.
Definition: v.hpp:179
v() noexcept
Defaulted constructor.
Definition: v.hpp:75