remove \r
[extl.git] / extl / memory / object_memory_traits.h
blobd05e275bee8a1f9a90fe159154fb95bfe2c570af
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: object_memory_traits.h
4 * Created: 08.07.30
5 * Updated: 08.10.08
7 * Brief:: object_memory_traits class
9 * [<Home>]
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
19 #ifndef __cplusplus
20 # error object_memory_traits.h need be supported by c++.
21 #endif
23 /* ///////////////////////////////////////////////////////////////////////
24 * Includes
26 #include "prefix.h"
27 #include "initialiser_selector.h"
29 /* ///////////////////////////////////////////////////////////////////////
30 * ::extl namespace
32 EXTL_BEGIN_NAMESPACE
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
43 /// \name Types
44 /// @{
45 public:
46 typedef object_memory_traits<T> class_type;
47 typedef T value_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;
55 /// @}
57 public:
58 /// Copy
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);
64 /// Move
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);
70 /// Fill
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);
76 /// Fill 0
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);
82 };
84 /* ///////////////////////////////////////////////////////////////////////
85 * ::extl namespace
87 EXTL_END_NAMESPACE
89 /* //////////////////////////////////////////////////////////////////// */
90 #endif /* EXTL_MEMORY_OBJECT_MEMORY_TRAITS_H */
91 /* //////////////////////////////////////////////////////////////////// */