⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sstream.hpp

📁 boost库提供标准的C++ API 配合dev c++使用,功能更加强大
💻 HPP
字号:
/*=============================================================================
    Copyright (c) 2003 Martin Wille
    http://spirit.sourceforge.net/

    Use, modification and distribution is subject to the Boost Software
    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#include <boost/config.hpp>

///////////////////////////////////////////////////////////////////////////
// workaround for prestandard support of stringstreams
//
// * defines sstream_t for the string stream type
// * defines std::string getstring(sstream_t &);
//

#ifdef BOOST_NO_STRINGSTREAM
#   include <strstream>
    typedef strstream sstream_t;
    std::string
    getstring(std::strstream& ss)
    {
        ss << ends;
        std::string rval = ss.str();
        ss.freeze(false);
        return rval;
    }
#else
#   include <sstream>
    typedef std::stringstream sstream_t;
    std::string
    getstring(std::stringstream &ss)
    {
        return ss.str();
    }
#endif

void use_getstring_to_avoid_compiler_warnings_about_unused_functions()
{
    sstream_t ss;
    getstring(ss);
    if(!ss) { // to be not recursive on all control paths
        use_getstring_to_avoid_compiler_warnings_about_unused_functions();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -