C:\boost_1_70_0>.\b2 --with-date_time link=static runtime-link=static
Category: Visual Studio
Routes stream to specified buffer
Developer Command Prompt for VS 2019
cl basic_ios_rdbuf.cpp /EHsc
MSDN Source Code
#include <ios>
#include <iostream>
#include <fstream>
int main( )
{
using namespace std;
ofstream file( "rdbuf.txt" );
streambuf *x = cout.rdbuf( file.rdbuf( ) );
cout << "test" << endl; // Goes to file
cout.rdbuf(x);
cout << "test2" << endl; //normal
}
Upgrade to Visual Studio 2019 : Build Problems
1. std::toupper —> ::toupper
Original Code (It’s OKay in VS2017) :
VS Upgraded :
Code Updated (It’s OKay in VS2019) :
Some built-in macros inside CMakeSettings.json:
- ${workspaceRoot} – provides the full path to the workspace folder
- ${workspaceHash} – hash of workspace location; useful for creating a unique identifier for the current workspace (e.g. to use in folder paths)
- ${projectFile} – the full path for the root CMakeLists.txt
- ${projectDir} – the full path to the folder of the root CMakeLists.txt file
- ${thisFile} – the full path to the CMakeSettings.json file
- ${name} – the name of the configuration
- ${generator} – the name of the CMake generator used in this configuration