mirror of
https://github.com/matrix-construct/construct
synced 2024-12-24 14:34:00 +01:00
ircd::buffer: Add unique_buffer ctor for mutable to const move conversion.
This commit is contained in:
parent
b260bd85a7
commit
32d4d44662
1 changed files with 14 additions and 0 deletions
|
@ -32,6 +32,7 @@ struct ircd::buffer::unique_buffer
|
|||
unique_buffer() = default;
|
||||
unique_buffer(const size_t &size, const size_t &align = 0);
|
||||
explicit unique_buffer(const const_buffer &);
|
||||
template<class T> unique_buffer(unique_buffer<T> &&) noexcept;
|
||||
unique_buffer(unique_buffer &&) noexcept;
|
||||
unique_buffer(const unique_buffer &) = delete;
|
||||
unique_buffer &operator=(unique_buffer &&) & noexcept;
|
||||
|
@ -71,6 +72,19 @@ ircd::buffer::unique_buffer<buffer_type>::unique_buffer(const size_t &size,
|
|||
}
|
||||
{}
|
||||
|
||||
template<class buffer_type>
|
||||
template<class other_type>
|
||||
inline
|
||||
ircd::buffer::unique_buffer<buffer_type>::unique_buffer(unique_buffer<other_type> &&other)
|
||||
noexcept
|
||||
:buffer_type
|
||||
{
|
||||
other.release()
|
||||
}
|
||||
{
|
||||
assert(std::get<0>(other) == nullptr);
|
||||
}
|
||||
|
||||
template<class buffer_type>
|
||||
inline
|
||||
ircd::buffer::unique_buffer<buffer_type>::unique_buffer(unique_buffer &&other)
|
||||
|
|
Loading…
Reference in a new issue