From f4ea3c9c0ab1667add847ad9438621f63073a061 Mon Sep 17 00:00:00 2001 From: dgeelen Date: Tue, 16 Feb 2021 16:30:01 +0100 Subject: [PATCH] Resolve visual studio warning C4127: conditional expression is constant. (#118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniƫl Geelen --- .../iostreams/detail/streambuf/indirect_streambuf.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp b/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp index 6eb105071..9f159a369 100644 --- a/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp +++ b/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp @@ -390,11 +390,18 @@ inline void indirect_streambuf::close_impl sync(); setp(0, 0); } + #if defined(BOOST_MSVC) + #pragma warning(push) + #pragma warning(disable: 4127) // conditional expression is constant + #endif if ( !is_convertible::value || is_convertible::value == (which == BOOST_IOS::in) ) { obj().close(which, next_); } + #if defined(BOOST_MSVC) + #pragma warning(pop) + #endif } //----------State changing functions------------------------------------------//