mirror of
https://github.com/matrix-construct/construct
synced 2024-11-18 07:50:57 +01:00
ircd::buffer: Allow decay-like conversion to begin pointer.
This commit is contained in:
parent
d39d50e18a
commit
5d3ce83f52
1 changed files with 9 additions and 0 deletions
|
@ -20,6 +20,7 @@ struct ircd::buffer::buffer
|
|||
using iterator = it;
|
||||
using value_type = typename std::remove_pointer<iterator>::type;
|
||||
|
||||
explicit operator const it &() const;
|
||||
operator string_view() const;
|
||||
explicit operator std::string_view() const;
|
||||
explicit operator std::string() const;
|
||||
|
@ -92,3 +93,11 @@ const
|
|||
{
|
||||
return { reinterpret_cast<const char *>(data(*this)), size(*this) };
|
||||
}
|
||||
|
||||
template<class it>
|
||||
ircd::buffer::buffer<it>::operator
|
||||
const it &()
|
||||
const
|
||||
{
|
||||
return begin();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue