From 932dd480263d06d00bf4b40a323dc3f4ace266e2 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Wed, 13 Apr 2022 22:51:10 -0400 Subject: [PATCH] Compatibility with GCC 4.6 --- include/boost/io/nullstream.hpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/boost/io/nullstream.hpp b/include/boost/io/nullstream.hpp index c623297..bd98f5a 100644 --- a/include/boost/io/nullstream.hpp +++ b/include/boost/io/nullstream.hpp @@ -1,5 +1,5 @@ /* -Copyright 2021 Glen Joseph Fernandes +Copyright 2021-2022 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. @@ -32,8 +32,14 @@ protected: namespace detail { template -struct nullbuf { - boost::io::basic_nullbuf buf; +class nullbuf { +public: + boost::io::basic_nullbuf* buf() { + return &buf_; + } + +private: + boost::io::basic_nullbuf buf_; }; } /* detail */ @@ -44,8 +50,8 @@ class basic_onullstream , public std::basic_ostream { public: basic_onullstream() - : std::basic_ostream(&(detail::nullbuf::buf)) { } + : std::basic_ostream(detail::nullbuf::buf()) { } }; typedef basic_onullstream onullstream;