summaryrefslogtreecommitdiff
path: root/boost/iostreams/chain.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:08:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:09:00 +0900
commitb5c87084afaef42b2d058f68091be31988a6a874 (patch)
treeadef9a65870a41181687e11d57fdf98e7629de3c /boost/iostreams/chain.hpp
parent34bd32e225e2a8a94104489b31c42e5801cc1f4a (diff)
downloadboost-b5c87084afaef42b2d058f68091be31988a6a874.tar.gz
boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.bz2
boost-b5c87084afaef42b2d058f68091be31988a6a874.zip
Imported Upstream version 1.64.0upstream/1.64.0
Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/iostreams/chain.hpp')
-rw-r--r--boost/iostreams/chain.hpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/boost/iostreams/chain.hpp b/boost/iostreams/chain.hpp
index a199c9df38..4e108c8b09 100644
--- a/boost/iostreams/chain.hpp
+++ b/boost/iostreams/chain.hpp
@@ -14,10 +14,9 @@
#include <boost/assert.hpp>
#include <exception>
-#include <functional> // unary_function.
#include <iterator> // advance.
#include <list>
-#include <memory> // allocator, auto_ptr.
+#include <memory> // allocator, auto_ptr or unique_ptr.
#include <typeinfo>
#include <stdexcept> // logic_error, out_of_range.
#include <boost/checked_delete.hpp>
@@ -243,8 +242,19 @@ private:
pback_size != -1 ?
pback_size :
pimpl_->pback_size_;
+
+#if defined(BOOST_NO_CXX11_SMART_PTR)
+
std::auto_ptr<streambuf_t>
buf(new streambuf_t(t, buffer_size, pback_size));
+
+#else
+
+ std::unique_ptr<streambuf_t>
+ buf(new streambuf_t(t, buffer_size, pback_size));
+
+#endif
+
list().push_back(buf.get());
buf.release();
if (is_device<component_type>::value) {
@@ -281,7 +291,9 @@ private:
static void set_auto_close(streambuf_type* b, bool close)
{ b->set_auto_close(close); }
- struct closer : public std::unary_function<streambuf_type*, void> {
+ struct closer {
+ typedef streambuf_type* argument_type;
+ typedef void result_type;
closer(BOOST_IOS::openmode m) : mode_(m) { }
void operator() (streambuf_type* b)
{
@@ -472,7 +484,7 @@ public:
BOOST_IOSTREAMS_DEFINE_PUSH(push, mode, char_type, push_impl)
void pop() { chain_->pop(); }
bool empty() const { return chain_->empty(); }
- size_type size() { return chain_->size(); }
+ size_type size() const { return chain_->size(); }
void reset() { chain_->reset(); }
// Returns a copy of the underlying chain.