8#ifndef OPENFPM_DATA_SRC_VECTOR_MAP_VECTOR_STD_UTIL_HPP_
9#define OPENFPM_DATA_SRC_VECTOR_MAP_VECTOR_STD_UTIL_HPP_
11#include "util/common.hpp"
18template<
bool,
typename T,
typename S>
29 static inline void push_back(std::vector<T> & base,
const S & obj)
31#ifndef DISABLE_ALL_RTTI
32 std::cerr << __FILE__ <<
":" << __LINE__ <<
" error cannot push " << demangle(
typeid(S).name()) <<
" into a vector of " << demangle(
typeid(T).name()) << std::endl;
42template<
typename T,
typename S>
54 static inline void push_back(std::vector<T> & base,
const S & obj)
57 base[base.size()-1] = obj;
66template<
bool,
typename T,
typename S>
78 static inline void push_back(std::vector<T> & base,
const S & obj)
80#ifndef DISABLE_ALL_RTTI
81 std::cerr << __FILE__ <<
":" << __LINE__ <<
" error cannot push " << demangle(
typeid(S).name()) <<
" into a vector of " << demangle(
typeid(T).name()) << std::endl;
86template<
typename T,
typename S>
89 static inline void push_back(std::vector<T> & base,
const S & obj)
91 base.reserve(base.size() + obj.size());
92 for (
size_t i = 0 ; i < obj.size() ; i++)
94 base.push_back(obj.get(i));
99template<
bool is_t,
bool is_s,
typename T,
typename S>
102 static inline void push_back(std::vector<T> & base,
const S & obj)
104#ifndef DISABLE_ALL_RTTI
105 std::cerr << __FILE__ <<
":" << __LINE__ <<
" error cannot push " << demangle(
typeid(S).name()) <<
" into a vector of " << demangle(
typeid(T).name()) << std::endl;
110template<
typename T,
typename S>
113 static inline void push_back(std::vector<T> & base,
const S & obj)
119template<
typename T,
typename S>
122 static inline void push_back(std::vector<T> & base,
const S & obj)
130template<
typename T,
typename S>
133 static inline void push_back(std::vector<T> & base,
const S & obj)
135 std::is_same<typename T::value_type,typename S::value_type>::value,T,S>::push_back(base,obj);}
139template<
bool has_base,
typename base_obj,
typename v_obj>
142 static inline void copy(base_obj & base,
const v_obj & obj)
145 base.resize(obj.size());
147 for (
size_t i = 0 ; i < obj.size() ; i++)
149 base.get(i) = obj.get(i);
154template<
typename base_obj,
typename v_obj>
157 static inline void copy(base_obj & base,
const v_obj & obj)
163template<
typename T,
typename Sfinae =
void>
static void push_back(std::vector< T > &base, const S &obj)
Push_back on a vector.
pack/add function selector
static void push_back(std::vector< T > &base, const S &obj)
push_back
pack/add function selector
static void push_back(std::vector< T > &base, const S &obj)
push_back