Another attempt to suppress MSVC warnings (refs #9271)

[SVN r86388]
This commit is contained in:
Antony Polukhin
2013-10-22 09:07:02 +00:00
parent d78d334dbb
commit edde5f442e

View File

@@ -23,12 +23,6 @@
namespace boost { namespace detail { namespace boost { namespace detail {
#ifdef BOOST_MSVC
#pragma warning(push)
// VC mistakenly assumes that `setbuf` and other functions are not referenced.
#pragma warning(disable: 4505) //Unreferenced local function has been removed
#endif
// //
// class basic_pointerbuf: // class basic_pointerbuf:
// acts as a stream buffer which wraps around a pair of pointers: // acts as a stream buffer which wraps around a pair of pointers:
@@ -57,9 +51,13 @@ public:
#endif #endif
protected: protected:
base_type* setbuf(char_type* s, streamsize n); // VC mistakenly assumes that `setbuf` and other functions are not referenced.
typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which); // Marking those functions with `inline` suppresses the warnings.
typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which); // There must be no harm from marking virtual functions as inline: inline virtual
// call can be inlined ONLY when the compiler knows the "exact class".
inline base_type* setbuf(char_type* s, streamsize n);
inline typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which);
inline typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which);
private: private:
basic_pointerbuf& operator=(const basic_pointerbuf&); basic_pointerbuf& operator=(const basic_pointerbuf&);
@@ -135,10 +133,6 @@ basic_pointerbuf<charT, BufferT>::seekpos(pos_type sp, ::std::ios_base::openmode
return pos_type(off_type(-1)); return pos_type(off_type(-1));
} }
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}} // namespace boost::detail }} // namespace boost::detail
#endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP #endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP