diff --git a/include/blt/std/memory.h b/include/blt/std/memory.h index a6436e9..e72b843 100755 --- a/include/blt/std/memory.h +++ b/include/blt/std/memory.h @@ -80,6 +80,9 @@ namespace blt private: V* _v; }; + + template || std::is_copy_assignable_v> + class scoped_buffer; /** * Creates an encapsulation of a T array which will be automatically deleted when this object goes out of scope. @@ -88,8 +91,8 @@ namespace blt * The operator * has been overloaded to return the internal buffer. * @tparam T type that is stored in buffer eg char */ - template || std::is_copy_assignable_v> - class scoped_buffer + template + class scoped_buffer { public: using element_type = T; @@ -247,16 +250,6 @@ namespace blt { return buffer_; } - -// inline auto begin() -// { -// return ptr_iterator{buffer_}; -// } -// -// inline ptr_iterator end() -// { -// return ptr_iterator{&buffer_[size_]}; -// } constexpr iterator begin() noexcept { @@ -304,6 +297,16 @@ namespace blt } }; + template + class scoped_buffer : scoped_buffer + { + using scoped_buffer::scoped_buffer; + public: + scoped_buffer(const scoped_buffer& copy) = delete; + + scoped_buffer operator=(scoped_buffer& copyAssignment) = delete; + }; + template class static_vector { @@ -388,16 +391,6 @@ namespace blt } }; - template - class scoped_buffer : scoped_buffer - { - using scoped_buffer::scoped_buffer; - public: - scoped_buffer(const scoped_buffer& copy) = delete; - - scoped_buffer operator=(scoped_buffer& copyAssignment) = delete; - }; - template struct nullptr_initializer {