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"
18 template<
bool,
typename T,
typename S>
29 static inline void push_back(std::vector<T> & base,
const S & obj)
31 std::cerr << __FILE__ <<
":" << __LINE__ <<
" error cannot push " << demangle(
typeid(S).name()) <<
" into a vector of " << demangle(
typeid(T).name()) << std::endl;
40 template<
typename T,
typename S>
52 static inline void push_back(std::vector<T> & base,
const S & obj)
55 base[base.size()-1] = obj;
64 template<
bool,
typename T,
typename S>
76 static inline void push_back(std::vector<T> & base,
const S & obj)
78 std::cerr << __FILE__ <<
":" << __LINE__ <<
" error cannot push " << demangle(
typeid(S).name()) <<
" into a vector of " << demangle(
typeid(T).name()) << std::endl;
82 template<
typename T,
typename S>
85 static inline void push_back(std::vector<T> & base,
const S & obj)
87 base.reserve(base.size() + obj.size());
88 for (
size_t i = 0 ; i < obj.size() ; i++)
90 base.push_back(obj.get(i));
95 template<
bool is_t,
bool is_s,
typename T,
typename S>
98 static inline void push_back(std::vector<T> & base,
const S & obj)
99 {std::cerr << __FILE__ <<
":" << __LINE__ <<
" error cannot push " << demangle(
typeid(S).name()) <<
" into a vector of " << demangle(
typeid(T).name()) << std::endl;}
102 template<
typename T,
typename S>
105 static inline void push_back(std::vector<T> & base,
const S & obj)
111 template<
typename T,
typename S>
114 static inline void push_back(std::vector<T> & base,
const S & obj)
122 template<
typename T,
typename S>
125 static inline void push_back(std::vector<T> & base,
const S & obj)
127 std::is_same<typename T::value_type,typename S::value_type>::value,T,S>::push_back(base,obj);}
131 template<
bool has_base,
typename base_obj,
typename v_obj>
134 static inline void copy(base_obj & base,
const v_obj & obj)
137 base.resize(obj.size());
139 for (
size_t i = 0 ; i < obj.size() ; i++)
141 base.get(i) = obj.get(i);
146 template<
typename base_obj,
typename v_obj>
149 static inline void copy(base_obj & base,
const v_obj & obj)
155 template<
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
static void push_back(std::vector< T > &base, const S &obj)
push_back
pack/add function selector