Simplify multi_buffer and static_buffer sequences

This commit is contained in:
Vinnie Falco committed 2018-12-02 17:52:01 -08:00
1 parent f995fd41a3
commit 773048c551
5 files changed
+100 -96

No files matched your search

+14 -5
View File
@@ -149,19 +149,28 @@ public:
class const_iterator;
readable_bytes() = delete;
readable_bytes(readable_bytes const&) = default;
readable_bytes& operator=(readable_bytes const&) = default;
template<
bool OtherIsMutable,
bool ThisIsMutable = IsMutable>
bool IsMutable_ = IsMutable,
class = typename std::enable_if<! IsMutable_>::type>
readable_bytes(
readable_bytes<OtherIsMutable> const& other,
typename std::enable_if<
! ThisIsMutable || OtherIsMutable>::type* = 0)
readable_bytes<true> const& other) noexcept
: b_(other.b_)
{
}
template<
bool IsMutable_ = IsMutable,
class = typename std::enable_if<! IsMutable_>::type>
readable_bytes& operator=(
readable_bytes<true> const& other) noexcept
{
b_ = other.b_;
return *this;
}
const_iterator begin() const noexcept;
const_iterator end() const noexcept;