38 #ifndef LIBPMEMOBJ_CPP_TEMP_VALUE_HPP
39 #define LIBPMEMOBJ_CPP_TEMP_VALUE_HPP
54 #ifndef LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE
55 #define LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE 64 * (1 << 10)
63 template <
typename T,
bool NoExcept,
typename Enable =
void>
71 template <
typename T,
bool NoExcept>
74 typename std::enable_if<NoExcept &&
76 LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE)>::type> {
77 template <
typename... Args>
78 temp_value(Args &&... args) noexcept : t(std::forward<Args>(args)...)
96 template <
typename T,
bool NoExcept>
99 typename std::enable_if<!NoExcept ||
101 LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE)>::type> {
102 template <
typename... Args>
105 ptr = pmem::obj::make_persistent<T>(
106 std::forward<Args>(args)...);
111 pmem::obj::delete_persistent<T>(ptr);