0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 04:38:52 +02:00

ircd::buffer: Allow decay-like conversion to begin pointer.

This commit is contained in:
Jason Volk 2019-02-08 18:22:40 -08:00
parent d39d50e18a
commit 5d3ce83f52

View file

@ -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();
}