9 #ifndef metaprogramming_H 10 #define metaprogramming_H 24 namespace metaprogramming
43 for_each(container.begin(), container.end(),
ObjectDelete());
56 if (ptr) ptr->clear();
93 template <
typename TARGET_TYPE>
99 return TARGET_TYPE(
val);
108 template <
typename T>
111 ptr.reset(dynamic_cast<typename T::element_type*>(ptr->clone()));
119 template <
typename T>
123 dynamic_cast<typename T::first_type::element_type*>(
124 ptr.first->clone()));
126 dynamic_cast<typename T::second_type::element_type*>(
127 ptr.first->clone()));
134 template <
typename T>
149 template <
typename it_src,
typename it_dst>
152 for (it_src i =
first; i != last; ++i, ++target)
153 *target = static_cast<typename it_dst::value_type>(*i);
168 template <
typename src_container,
typename dst_container>
170 const src_container&
src, dst_container& trg)
172 trg.resize(
src.size());
176 for (; i != last; ++i, ++target)
177 *target = static_cast<typename dst_container::value_type>(*i);
187 template <
typename T,
typename U>
248 return *(
this + off);
258 inline bool operator<(const MemoryBypasserIterator<T, U>& i)
const 273 template <
typename U,
typename T>
285 template <
typename T,
typename U1,
typename U2,
typename V>
307 template <
typename T,
typename U,
typename V>
327 template <
typename T,
typename V>
342 template <
typename T,
typename U1,
typename U2,
typename V>
344 V&
obj, T (V::*fun)(U1, U2))
348 template <
typename T,
typename U,
typename V>
353 template <
typename T,
typename V>
361 template <
typename Op>
366 typename Op::first_argument_type&
val;
378 template <
typename Op>
380 Op& o,
typename Op::first_argument_type&
t)
386 template <
typename Op>
391 typename Op::second_argument_type&
val;
403 template <
typename Op>
405 Op& o,
typename Op::second_argument_type&
t)
NonConstBind2nd< Op > nonConstBind2nd(Op &o, typename Op::second_argument_type &t)
Do not directly use the NonConstBind2nd class directly.
const Scalar * const_iterator
NonConstBind1st< Op > nonConstBind1st(Op &o, typename Op::first_argument_type &t)
Use this function instead of directly calling NonConstBind1st.
GLsizei GLsizei GLuint * obj
void DeleteContainer(T &container)
A function which deletes a container of pointers.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void copy_typecasting(it_src first, it_src last, it_dst target)
Behaves like std::copy but allows the source and target iterators to be of different types through st...
MemoryBypasserIterator< T, U > bypassPointer(const T &baseIterator)
Sintactic sugar for MemoryBypasserIterator.
BinaryMemberFunctionWrapper< T, U1, U2, V > wrapMember(V &obj, T(V::*fun)(U1, U2))
This function creates a function from an object and a member function.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
void copy_container_typecasting(const src_container &src, dst_container &trg)
Copy all the elements in a container (vector, deque, list) into a different one performing the approp...