Go to the documentation of this file.00001 #ifndef guard_value_traits_hpp
00002 #define guard_value_traits_hpp
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "tao/Versioned_Namespace.h"
00015
00016 #include <algorithm>
00017
00018 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00019
00020 namespace TAO
00021 {
00022 namespace details
00023 {
00024
00025 template<typename T, bool dummy>
00026 struct value_traits
00027 {
00028 typedef T value_type;
00029 typedef T const const_value_type;
00030
00031 inline static void zero_range(
00032 value_type * begin , value_type * end)
00033 {
00034 std::fill(begin, end, value_type ());
00035 }
00036
00037 inline static void initialize_range(
00038 value_type * begin, value_type * end)
00039 {
00040 std::fill(begin, end, value_type ());
00041 }
00042
00043 inline static void release_range(
00044 value_type *, value_type *)
00045 {
00046
00047 }
00048
00049 # if !defined (ACE_LACKS_MEMBER_TEMPLATES)
00050
00051 template <typename iter>
00052 inline static void copy_range(
00053 value_type * begin, value_type * end, iter dst)
00054 {
00055 std::copy(begin, end, dst);
00056 }
00057 # else
00058 inline static void copy_range(
00059 value_type * begin, value_type * end, value_type * dst)
00060 {
00061 std::copy(begin, end, dst);
00062 }
00063 # endif
00064
00065 # if !defined (ACE_LACKS_MEMBER_TEMPLATES)
00066
00067 template <typename iter>
00068 inline static void copy_swap_range(
00069 value_type * begin, value_type * end, iter dst)
00070 {
00071 copy_range(begin, end, dst);
00072 }
00073 # else
00074 inline static void copy_swap_range(
00075 value_type * begin, value_type * end, value_type * dst)
00076 {
00077 copy_range(begin, end, dst);
00078 }
00079 # endif
00080 };
00081
00082 }
00083 }
00084
00085 TAO_END_VERSIONED_NAMESPACE_DECL
00086
00087 #endif // guard_value_traits_hpp