10#ifndef nf_buffer_h_included
11#define nf_buffer_h_included
14#if defined __cplusplus
28 using const_iterator = T
const *;
32 nf_Buffer() noexcept : m_data(
nullptr), m_length(0) {}
35 nf_Buffer(nf_Buffer
const &c) :
36 m_data(new T[c.m_length]),
39 for(
size_t i = 0;i < m_length;++ i){
40 m_data[i] = c.m_data[i];
45 ~nf_Buffer() noexcept {
51 size_t size() const noexcept {
return m_length; }
55 for(
size_t i = 0;i < m_length;++ i){
64 m_data =
new T[length];
74 void resize(
size_t length){
79 std::vector<T> vector()
const {
80 return std::vector<T>(cbegin(), cend());
84 T* data() noexcept {
return m_data;}
88 T
const * data() const noexcept {
return m_data;}
92 T& operator[](I idx)
noexcept {
return m_data[idx];}
97 T
const & operator[](I idx)
const noexcept {
return m_data[idx];}
101 iterator begin() noexcept {
return m_data; }
105 const_iterator begin() const noexcept {
return m_data; }
108 iterator end() noexcept {
return m_data + m_length; }
112 const_iterator end() const noexcept {
return m_data + m_length; }
116 const_iterator cbegin() const noexcept {
return m_data; }
120 const_iterator cend() const noexcept {
return m_data + m_length; }
allocation_function xml_memory_management_function_storage< T >::allocate
deallocation_function xml_memory_management_function_storage< T >::deallocate