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

This commit is contained in:
Max Kellermann 2017-11-15 22:03:44 +01:00
parent 65059f2add
commit 0066f7a818
2 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,9 @@ struct ConstBuffer {
constexpr ConstBuffer(pointer_type _data, size_type _size)
:data(_data), size(_size) {}
constexpr ConstBuffer(pointer_type _data, pointer_type _end)
:data(_data), size(_end - _data) {}
/**
* Convert array to ConstBuffer instance.
*/

View File

@ -103,6 +103,9 @@ struct WritableBuffer {
constexpr WritableBuffer(pointer_type _data, size_type _size)
:data(_data), size(_size) {}
constexpr WritableBuffer(pointer_type _data, pointer_type _end)
:data(_data), size(_end - _data) {}
/**
* Convert array to WritableBuffer instance.
*/