1 /* ///////////////////////////////////////////////////////////////////////
2 * File: object_memory_traits.h
7 * Brief:: object_memory_traits class
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 #ifndef EXTL_MEMORY_OBJECT_MEMORY_TRAITS_H
14 #define EXTL_MEMORY_OBJECT_MEMORY_TRAITS_H
16 /*!\file object_memory_traits.h
17 * \brief object_memory_traits class
20 # error object_memory_traits.h need be supported by c++.
23 /* ///////////////////////////////////////////////////////////////////////
27 #include "initialiser_selector.h"
29 /* ///////////////////////////////////////////////////////////////////////
34 /*!\brief object_memory_traits class which is compatible with std.
36 * \param T the value type
38 * \ingroup extl_group_memory
40 template<typename_param_k T
>
41 struct object_memory_traits
46 typedef object_memory_traits
<T
> class_type
;
48 typedef value_type
* pointer
;
49 typedef value_type
const* const_pointer
;
50 typedef value_type
& reference
;
51 typedef value_type
const& const_reference
;
52 typedef e_size_t size_type
;
53 typedef e_int_t int_type
;
54 typedef typename_type_k initialiser_selector
<T
>::initialiser_type initialiser_type
;
59 static const_pointer
copy(pointer dest
, const_pointer src
, size_type n
)
61 EXTL_ASSERT(NULL
!= dest
);
62 return non_pod_copy_n(dest
, src
, n
);
65 static const_pointer
move(pointer dest
, const_pointer src
, size_type n
)
67 EXTL_ASSERT(NULL
!= dest
);
68 return non_pod_move_n(dest
, src
, n
);
71 static const_pointer
fill(pointer dest
, const_reference value
, size_type n
)
73 EXTL_ASSERT(NULL
!= dest
);
74 return non_pod_fill_n(dest
, value
, n
);
77 static const_pointer
fill_0(pointer dest
, size_type n
)
79 EXTL_ASSERT(NULL
!= dest
);
80 return non_pod_fill_0_n(dest
, n
);
84 /* ///////////////////////////////////////////////////////////////////////
89 /* //////////////////////////////////////////////////////////////////// */
90 #endif /* EXTL_MEMORY_OBJECT_MEMORY_TRAITS_H */
91 /* //////////////////////////////////////////////////////////////////// */