10 #ifndef BOOST_BEAST_CORE_SPAN_HPP 11 #define BOOST_BEAST_CORE_SPAN_HPP 18 #include <type_traits> 35 std::size_t size_ = 0;
81 : data_(data), size_(size)
89 template<
class ContiguousContainer
90 #if ! BOOST_BEAST_DOXYGEN 91 ,
class =
typename std::enable_if<
93 ContiguousContainer, T>::value>::type
97 span(ContiguousContainer&& container)
98 : data_(container.
data())
99 , size_(container.
size())
103 #if ! BOOST_BEAST_DOXYGEN 104 template<
class CharT,
class Traits,
class Allocator>
106 span(std::basic_string<CharT, Traits, Allocator>& s)
112 template<
class CharT,
class Traits,
class Allocator>
114 span(std::basic_string<CharT, Traits, Allocator>
const& s)
125 template<
class ContiguousContainer>
126 #if BOOST_BEAST_DOXYGEN 130 ContiguousContainer, T>::value,
135 data_ = container.data();
136 size_ = container.size();
140 #if ! BOOST_BEAST_DOXYGEN 141 template<
class CharT,
class Traits,
class Allocator>
144 CharT, Traits, Allocator>& s)
151 template<
class CharT,
class Traits,
class Allocator>
154 CharT, Traits, Allocator>
const& s)
201 return data_ + size_;
208 return data_ + size_;
span(std::basic_string< CharT, Traits, Allocator > &s)
Definition: span.hpp:106
T const & const_reference
The const reference used by the container.
Definition: span.hpp:60
span(T *data, std::size_t size)
Definition: span.hpp:80
Definition: async_result.hpp:20
T * data() const
Returns a pointer to the beginning of the span.
Definition: span.hpp:171
pointer iterator
The iterator used by the container.
Definition: span.hpp:54
const_pointer const_iterator
The const iterator used by the container.
Definition: span.hpp:63
T const * const_pointer
The const pointer used by the container.
Definition: span.hpp:57
T * pointer
A pointer to a span element.
Definition: span.hpp:48
typename std::remove_const< T >::type value_type
The type of value of each span element.
Definition: span.hpp:42
span(std::basic_string< CharT, Traits, Allocator > const &s)
Definition: span.hpp:114
span(ContiguousContainer &&container)
Definition: span.hpp:97
span & operator=(std::basic_string< CharT, Traits, Allocator > const &s)
Definition: span.hpp:153
span()=default
Constructor.
std::size_t size() const
Returns the number of elements in the span.
Definition: span.hpp:178
std::enable_if< detail::is_contiguous_container< ContiguousContainer, T >::value, span & >::type operator=(ContiguousContainer &&container)
Definition: span.hpp:133
const_iterator cend() const
Returns an iterator to one past the end of the span.
Definition: span.hpp:206
span & operator=(std::basic_string< CharT, Traits, Allocator > &s)
Definition: span.hpp:143
T element_type
The type of value, including cv qualifiers.
Definition: span.hpp:39
T & reference
A reference to a span element.
Definition: span.hpp:51
span & operator=(span const &)=default
Assignment.
std::ptrdiff_t index_type
The type of integer used to index the span.
Definition: span.hpp:45
const_iterator cbegin() const
Returns an iterator to the beginning of the span.
Definition: span.hpp:192
bool empty() const
Returns true if the span is empty.
Definition: span.hpp:164
const_iterator end() const
Returns an iterator to one past the end of the span.
Definition: span.hpp:199
const_iterator begin() const
Returns an iterator to the beginning of the span.
Definition: span.hpp:185
Definition: type_traits.hpp:163