9 #ifndef LIBPMEMOBJ_CPP_TEMP_VALUE_HPP
10 #define LIBPMEMOBJ_CPP_TEMP_VALUE_HPP
25 #ifndef LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE
26 #define LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE 64 * (1 << 10)
34 template <
typename T,
bool NoExcept,
typename Enable =
void>
42 template <
typename T,
bool NoExcept>
45 typename std::enable_if<NoExcept &&
47 LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE)>::type> {
48 template <
typename... Args>
49 temp_value(Args &&... args) noexcept : t(std::forward<Args>(args)...)
67 template <
typename T,
bool NoExcept>
70 typename std::enable_if<!NoExcept ||
72 LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE)>::type> {
73 template <
typename... Args>
76 ptr = pmem::obj::make_persistent<T>(
77 std::forward<Args>(args)...);
82 pmem::obj::delete_persistent<T>(ptr);