3 #ifndef OSL_CONSTRUCT_H
4 #define OSL_CONSTRUCT_H
6 #include <boost/type_traits/has_trivial_destructor.hpp>
7 #include <boost/type_traits/is_pod.hpp>
8 #include <boost/utility/enable_if.hpp>
29 static const bool value=boost::is_pod<T>::value;
38 template <
typename T1,
typename T2>
47 template <
typename T1,
typename T2>
62 template <
typename ForwardIterator>
63 inline void destroy(ForwardIterator first, ForwardIterator last)
65 typedef typename std::iterator_traits<ForwardIterator>::value_type
67 if (boost::has_trivial_destructor<value_type>::value)
69 for (; first != last; ++first)
void construct(T1 *ptr, const T2 &value, typename boost::enable_if< detail::BitCopyTraits< T1 > >::type *=0)
use raw memory copy instead of placement new not to test a given pointer is null