1#ifndef _MAKE_TUPLE_HEAP_H
2#define _MAKE_TUPLE_HEAP_H
110template <
typename Arg,
typename... TupleElem>
111auto tuple_append(
xlist<std::shared_ptr<heap_arg_deleter_base>>& heapArgs,
const std::tuple<TupleElem...> &tup, Arg** arg)
113 Arg** heap_arg =
nullptr;
116 if (arg !=
nullptr && *arg !=
nullptr) {
143#if !defined(__cpp_exceptions) || defined(DMQ_ASSERTS)
144 heapArgs.push_back(deleter);
145 return std::tuple_cat(tup, std::make_tuple(heap_arg));
148 heapArgs.push_back(deleter);
149 return std::tuple_cat(tup, std::make_tuple(heap_arg));
151 catch (
const std::bad_alloc&) {
159template <
typename Arg,
typename... TupleElem>
160auto tuple_append(
xlist<std::shared_ptr<heap_arg_deleter_base>>& heapArgs,
const std::tuple<TupleElem...> &tup, Arg* arg)
162 Arg* heap_arg =
nullptr;
163 if (arg !=
nullptr) {
175#if !defined(__cpp_exceptions) || defined(DMQ_ASSERTS)
176 heapArgs.push_back(deleter);
177 return std::tuple_cat(tup, std::make_tuple(heap_arg));
180 heapArgs.push_back(deleter);
181 return std::tuple_cat(tup, std::make_tuple(heap_arg));
183 catch (
const std::bad_alloc&) {
191template <
typename Arg,
typename... TupleElem>
192auto tuple_append(
xlist<std::shared_ptr<heap_arg_deleter_base>>& heapArgs,
const std::tuple<TupleElem...> &tup, Arg& arg)
204#if !defined(__cpp_exceptions) || defined(DMQ_ASSERTS)
205 heapArgs.push_back(deleter);
207 auto temp = std::make_tuple(std::forward_as_tuple(*heap_arg));
208 auto new_type = std::get<0>(temp);
209 return std::tuple_cat(tup, new_type);
212 heapArgs.push_back(deleter);
214 auto temp = std::make_tuple(std::forward_as_tuple(*heap_arg));
215 auto new_type = std::get<0>(temp);
216 return std::tuple_cat(tup, new_type);
218 catch (
const std::bad_alloc&) {
231template<
typename... Ts>
254template<
typename Arg1,
typename... Args,
typename... Ts>
255auto make_tuple_heap(
xlist<std::shared_ptr<heap_arg_deleter_base>>& heapArgs, std::tuple<Ts...> tup, Arg1 arg1, Args... args)
259 "std::shared_ptr reference argument not allowed");
260 static_assert(!std::is_same<Arg1, void*>::value,
"void* argument not allowed");
Delegate library options header file.
#define XALLOCATOR
Definition DelegateOpt.h:152
void xdelete(T *p)
Definition DelegateOpt.h:182
std::shared_ptr< T > xmake_shared(Args &&... args)
Definition DelegateOpt.h:170
#define BAD_ALLOC()
Definition DelegateOpt.h:123
T * xnew(Args &&... args)
Definition DelegateOpt.h:177
heap_arg_deleter(T *arg)
Definition make_tuple_heap.h:83
virtual ~heap_arg_deleter()
Definition make_tuple_heap.h:84
heap_arg_deleter(T **arg)
Definition make_tuple_heap.h:99
virtual ~heap_arg_deleter()
Definition make_tuple_heap.h:100
Base class for all deleter's.
Definition make_tuple_heap.h:58
virtual ~heap_arg_deleter_base()=default
Frees heap memory for reference heap argument.
Definition make_tuple_heap.h:68
virtual ~heap_arg_deleter()
Definition make_tuple_heap.h:71
heap_arg_deleter(T &arg)
Definition make_tuple_heap.h:70
Definition DelegateOpt.h:156
The delegate library namespace.
Definition Delegate.h:27
auto make_tuple_heap(xlist< std::shared_ptr< heap_arg_deleter_base > > &heapArgs, std::tuple< Ts... > tup)
Terminate the template metaprogramming argument loop. This function is called when there are no more ...
Definition make_tuple_heap.h:232
auto tuple_append(xlist< std::shared_ptr< heap_arg_deleter_base > > &heapArgs, const std::tuple< TupleElem... > &tup, Arg **arg)
Append a pointer to pointer argument to the tuple.
Definition make_tuple_heap.h:111
Definition make_tuple_heap.h:33
Definition make_tuple_heap.h:51