Commit 0066f7a8 authored by Max Kellermann's avatar Max Kellermann

util/{Const,Writable}Buffer: add constructor with two pointers

parent 65059f2a
...@@ -109,6 +109,9 @@ struct ConstBuffer { ...@@ -109,6 +109,9 @@ struct ConstBuffer {
constexpr ConstBuffer(pointer_type _data, size_type _size) constexpr ConstBuffer(pointer_type _data, size_type _size)
:data(_data), size(_size) {} :data(_data), size(_size) {}
constexpr ConstBuffer(pointer_type _data, pointer_type _end)
:data(_data), size(_end - _data) {}
/** /**
* Convert array to ConstBuffer instance. * Convert array to ConstBuffer instance.
*/ */
......
...@@ -103,6 +103,9 @@ struct WritableBuffer { ...@@ -103,6 +103,9 @@ struct WritableBuffer {
constexpr WritableBuffer(pointer_type _data, size_type _size) constexpr WritableBuffer(pointer_type _data, size_type _size)
:data(_data), size(_size) {} :data(_data), size(_size) {}
constexpr WritableBuffer(pointer_type _data, pointer_type _end)
:data(_data), size(_end - _data) {}
/** /**
* Convert array to WritableBuffer instance. * Convert array to WritableBuffer instance.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment