update boost on linux

This commit is contained in:
Bassem Girgis
2019-08-10 16:06:25 -05:00
parent 76ad52be58
commit 861b918727
5363 changed files with 483306 additions and 116507 deletions

View File

@@ -2,7 +2,7 @@
// buffers_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -66,7 +66,44 @@ namespace detail
typedef buffers_iterator_types_helper<is_mutable> helper;
typedef typename helper::buffer_type buffer_type;
typedef typename helper::template byte_type<ByteType>::type byte_type;
typedef typename BufferSequence::const_iterator const_iterator;
};
template <typename ByteType>
struct buffers_iterator_types<mutable_buffer, ByteType>
{
typedef mutable_buffer buffer_type;
typedef ByteType byte_type;
typedef const mutable_buffer* const_iterator;
};
template <typename ByteType>
struct buffers_iterator_types<const_buffer, ByteType>
{
typedef const_buffer buffer_type;
typedef typename add_const<ByteType>::type byte_type;
typedef const const_buffer* const_iterator;
};
#if !defined(BOOST_ASIO_NO_DEPRECATED)
template <typename ByteType>
struct buffers_iterator_types<mutable_buffers_1, ByteType>
{
typedef mutable_buffer buffer_type;
typedef ByteType byte_type;
typedef const mutable_buffer* const_iterator;
};
template <typename ByteType>
struct buffers_iterator_types<const_buffers_1, ByteType>
{
typedef const_buffer buffer_type;
typedef typename add_const<ByteType>::type byte_type;
typedef const const_buffer* const_iterator;
};
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
}
/// A random access iterator over the bytes in a buffer sequence.
@@ -77,6 +114,9 @@ private:
typedef typename detail::buffers_iterator_types<
BufferSequence, ByteType>::buffer_type buffer_type;
typedef typename detail::buffers_iterator_types<BufferSequence,
ByteType>::const_iterator buffer_sequence_iterator_type;
public:
/// The type used for the distance between two iterators.
typedef std::ptrdiff_t difference_type;
@@ -131,13 +171,13 @@ public:
#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
{
buffers_iterator new_iter;
new_iter.begin_ = buffers.begin();
new_iter.current_ = buffers.begin();
new_iter.end_ = buffers.end();
new_iter.begin_ = boost::asio::buffer_sequence_begin(buffers);
new_iter.current_ = boost::asio::buffer_sequence_begin(buffers);
new_iter.end_ = boost::asio::buffer_sequence_end(buffers);
while (new_iter.current_ != new_iter.end_)
{
new_iter.current_buffer_ = *new_iter.current_;
if (boost::asio::buffer_size(new_iter.current_buffer_) > 0)
if (new_iter.current_buffer_.size() > 0)
break;
++new_iter.current_;
}
@@ -151,13 +191,13 @@ public:
#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
{
buffers_iterator new_iter;
new_iter.begin_ = buffers.begin();
new_iter.current_ = buffers.begin();
new_iter.end_ = buffers.end();
new_iter.begin_ = boost::asio::buffer_sequence_begin(buffers);
new_iter.current_ = boost::asio::buffer_sequence_begin(buffers);
new_iter.end_ = boost::asio::buffer_sequence_end(buffers);
while (new_iter.current_ != new_iter.end_)
{
buffer_type buffer = *new_iter.current_;
new_iter.position_ += boost::asio::buffer_size(buffer);
new_iter.position_ += buffer.size();
++new_iter.current_;
}
return new_iter;
@@ -301,7 +341,8 @@ private:
// Dereference the iterator.
reference dereference() const
{
return buffer_cast<pointer>(current_buffer_)[current_buffer_position_];
return static_cast<pointer>(
current_buffer_.data())[current_buffer_position_];
}
// Compare two iterators for equality.
@@ -318,7 +359,7 @@ private:
// Check if the increment can be satisfied by the current buffer.
++current_buffer_position_;
if (current_buffer_position_ != boost::asio::buffer_size(current_buffer_))
if (current_buffer_position_ != current_buffer_.size())
return;
// Find the next non-empty buffer.
@@ -327,7 +368,7 @@ private:
while (current_ != end_)
{
current_buffer_ = *current_;
if (boost::asio::buffer_size(current_buffer_) > 0)
if (current_buffer_.size() > 0)
return;
++current_;
}
@@ -347,12 +388,12 @@ private:
}
// Find the previous non-empty buffer.
typename BufferSequence::const_iterator iter = current_;
buffer_sequence_iterator_type iter = current_;
while (iter != begin_)
{
--iter;
buffer_type buffer = *iter;
std::size_t buffer_size = boost::asio::buffer_size(buffer);
std::size_t buffer_size = buffer.size();
if (buffer_size > 0)
{
current_ = iter;
@@ -372,8 +413,7 @@ private:
for (;;)
{
std::ptrdiff_t current_buffer_balance
= boost::asio::buffer_size(current_buffer_)
- current_buffer_position_;
= current_buffer_.size() - current_buffer_position_;
// Check if the advance can be satisfied by the current buffer.
if (current_buffer_balance > n)
@@ -427,12 +467,12 @@ private:
}
// Find the previous non-empty buffer.
typename BufferSequence::const_iterator iter = current_;
buffer_sequence_iterator_type iter = current_;
while (iter != begin_)
{
--iter;
buffer_type buffer = *iter;
std::size_t buffer_size = boost::asio::buffer_size(buffer);
std::size_t buffer_size = buffer.size();
if (buffer_size > 0)
{
current_ = iter;
@@ -453,9 +493,9 @@ private:
buffer_type current_buffer_;
std::size_t current_buffer_position_;
typename BufferSequence::const_iterator begin_;
typename BufferSequence::const_iterator current_;
typename BufferSequence::const_iterator end_;
buffer_sequence_iterator_type begin_;
buffer_sequence_iterator_type current_;
buffer_sequence_iterator_type end_;
std::size_t position_;
};