forked from Ferdi265/cxx-ring-buffer
basic_ring_buffer: allow to move construct from wrapped container type
This commit is contained in:
@ -104,6 +104,9 @@ The iterators returned by the container need to be random access iterators.
|
|||||||
- `basic_ring_buffer(const Container&)`:
|
- `basic_ring_buffer(const Container&)`:
|
||||||
copy-constructs the container and value-initializes the internal
|
copy-constructs the container and value-initializes the internal
|
||||||
`front_index` variable of `size_type`.
|
`front_index` variable of `size_type`.
|
||||||
|
- `basic_ring_buffer(Container&&)`:
|
||||||
|
move-constructs the container and value-initializes the internal
|
||||||
|
`front_index` variable of `size_type`.
|
||||||
- `basic_ring_buffer(const basic_ring_buffer&)`:
|
- `basic_ring_buffer(const basic_ring_buffer&)`:
|
||||||
copy-constructs a `basic_ring_buffer` from another instance with the same
|
copy-constructs a `basic_ring_buffer` from another instance with the same
|
||||||
container type.
|
container type.
|
||||||
|
@ -22,6 +22,7 @@ public:
|
|||||||
basic_ring_buffer() = default;
|
basic_ring_buffer() = default;
|
||||||
~basic_ring_buffer() = default;
|
~basic_ring_buffer() = default;
|
||||||
CONSTEXPR basic_ring_buffer(const Container& other) COND_NOEXCEPT(noexcept(Container(other))) : container(other) {}
|
CONSTEXPR basic_ring_buffer(const Container& other) COND_NOEXCEPT(noexcept(Container(other))) : container(other) {}
|
||||||
|
CONSTEXPR basic_ring_buffer(Container&& other) COND_NOEXCEPT(noexcept(Container(other))) : container(other) {}
|
||||||
basic_ring_buffer(const basic_ring_buffer& other) = default;
|
basic_ring_buffer(const basic_ring_buffer& other) = default;
|
||||||
basic_ring_buffer(basic_ring_buffer&& other) = default;
|
basic_ring_buffer(basic_ring_buffer&& other) = default;
|
||||||
basic_ring_buffer& operator=(const basic_ring_buffer& other) = default;
|
basic_ring_buffer& operator=(const basic_ring_buffer& other) = default;
|
||||||
|
Reference in New Issue
Block a user