6 #include <zk/config.hpp>
18 #ifndef ZKPP_BUFFER_USE_CUSTOM
19 # define ZKPP_BUFFER_USE_CUSTOM 0
25 #ifndef ZKPP_BUFFER_USE_STD_VECTOR
26 # if ZKPP_BUFFER_USE_CUSTOM
27 # define ZKPP_BUFFER_USE_STD_VECTOR 0
29 # define ZKPP_BUFFER_USE_STD_VECTOR 1
33 #if ZKPP_BUFFER_USE_STD_VECTOR
34 # define ZKPP_BUFFER_INCLUDE <vector>
35 # define ZKPP_BUFFER_TYPE std::vector<char>
36 #elif ZKPP_BUFFER_USE_CUSTOM
37 # if !defined ZKPP_BUFFER_INCLUDE || !defined ZKPP_BUFFER_TYPE
38 # error "When ZKPP_BUFFER_USE_CUSTOM is set, you must also define ZKPP_BUFFER_INCLUDE and ZKPP_BUFFER_TYPE"
41 # error "Unknown type to use for zk::buffer"
46 #include ZKPP_BUFFER_INCLUDE
70 static_assert(
sizeof(buffer::value_type) == 1,
"buffer::value_type must be single-byte elements");
71 static_assert(std::is_same<std::size_t, buffer::size_type>::value,
"buffer::size_type must be std::size_t");
73 "buffer must be constructible with two pointers"
75 static_assert(std::is_move_constructible<buffer>::value,
"buffer must be move-constructible");
76 static_assert(std::is_same<decltype(std::declval<const buffer&>().size()), buffer::size_type>::value,
77 "buffer::size() must return buffer::size_type"
80 decltype(std::declval<const buffer&>().data())
82 "buffer::data() must return ptr<const buffer::value_type>"
T * ptr
A simple, unowned pointer.
ZKPP_BUFFER_TYPE buffer
The buffer type.