Refactor buffers_suffix:

* Tidy up tests
* Increase code coverage
* Remove unnecessary move special members
* Correct behavior for default constructed iterators
This commit is contained in:
Vinnie Falco
2018-12-19 20:59:20 -08:00
parent 9d27f2659f
commit 477e5a6f98
5 changed files with 87 additions and 103 deletions
+2 -1
View File
@@ -78,7 +78,7 @@ public:
`net::const_buffer`.
*/
#if BOOST_BEAST_DOXYGEN
using value_type = __implementation_defined__;
using value_type = __see_below__;
#elif 0
using value_type = typename std::conditional<
std::is_convertible<typename
@@ -121,6 +121,7 @@ public:
@param args Arguments forwarded to the buffers constructor.
*/
template<class... Args>
explicit
buffers_suffix(boost::in_place_init_t, Args&&... args);
/// Assignment
@@ -49,9 +49,7 @@ public:
std::bidirectional_iterator_tag;
const_iterator() = default;
const_iterator(const_iterator&& other) = default;
const_iterator(const_iterator const& other) = default;
const_iterator& operator=(const_iterator&& other) = default;
const_iterator& operator=(const_iterator const& other) = default;
bool
@@ -69,9 +67,9 @@ public:
reference
operator*() const
{
return it_ == b_->begin_
? value_type{*it_} + b_->skip_
: *it_;
if(it_ == b_->begin_)
return value_type(*it_) + b_->skip_;
return value_type{*it_};
}
pointer