Initial Course
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace cpp11 {
|
||||
|
||||
class MovableBuffer {
|
||||
public:
|
||||
MovableBuffer() = default;
|
||||
explicit MovableBuffer(std::vector<int> data);
|
||||
MovableBuffer(const MovableBuffer&) = delete;
|
||||
MovableBuffer(MovableBuffer&& other) noexcept;
|
||||
auto operator=(MovableBuffer&& other) noexcept -> MovableBuffer&;
|
||||
|
||||
[[nodiscard]] auto size() const -> std::size_t;
|
||||
[[nodiscard]] auto data() const -> const std::vector<int>&;
|
||||
|
||||
private:
|
||||
std::vector<int> data_;
|
||||
};
|
||||
|
||||
[[nodiscard]] auto consume(MovableBuffer buffer) -> std::size_t;
|
||||
|
||||
} // namespace cpp11
|
||||
Reference in New Issue
Block a user