36 #ifndef VIGRA_MEMORY_HXX 37 #define VIGRA_MEMORY_HXX 39 #include "metaprogramming.hxx" 43 enum SkipInitializationTag { SkipInitialization};
46 struct CanSkipInitialization
48 typedef typename TypeTraits<T>::isBuiltinType type;
49 static const bool value = type::asBool;
55 template <
class Src,
class Dest>
56 Dest uninitializedCopy(Src s, Src end, Dest d)
58 typedef typename std::iterator_traits<Dest>::value_type T;
59 for(; s != end; ++s, ++d)
60 new(d) T(static_cast<T const &>(*s));
65 inline void destroy_n(T * , std::ptrdiff_t , VigraTrueType )
70 inline void destroy_n(T * p, std::ptrdiff_t n, VigraFalseType )
78 inline void destroy_n(T * p, std::ptrdiff_t n)
80 destroy_n(p, n,
typename TypeTraits<T>::isPOD());
86 #if !defined(__GNUC__) || __GNUC__ >= 3 89 inline void destroy(T * p, VigraTrueType )
94 inline void destroy(T * p, VigraFalseType )
100 inline void destroy(T * p)
102 destroy(p,
typename TypeTraits<T>::isPOD());
111 namespace vigra {
namespace detail {
119 #endif // VIGRA_MEMORY_HXX Definition: accessor.hxx:43