Skip to content

Commit f4ea3c9

Browse files
Resolve visual studio warning C4127: conditional expression is constant. (#118)
Co-authored-by: Daniël Geelen <[email protected]>
1 parent 323ec06 commit f4ea3c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,18 @@ inline void indirect_streambuf<T, Tr, Alloc, Mode>::close_impl
390390
sync();
391391
setp(0, 0);
392392
}
393+
#if defined(BOOST_MSVC)
394+
#pragma warning(push)
395+
#pragma warning(disable: 4127) // conditional expression is constant
396+
#endif
393397
if ( !is_convertible<category, dual_use>::value ||
394398
is_convertible<Mode, input>::value == (which == BOOST_IOS::in) )
395399
{
396400
obj().close(which, next_);
397401
}
402+
#if defined(BOOST_MSVC)
403+
#pragma warning(pop)
404+
#endif
398405
}
399406

400407
//----------State changing functions------------------------------------------//

0 commit comments

Comments
 (0)