Error converting std :: tr2 :: sys :: path to std :: string?
I am using the Visual Studio 2013 TR2 File System Library. I see an error while converting the UNC path to string:
#include "StdAfx.h"
#include <filesystem>
#include <iostream>
//------------------------------------------------------------------------------
int _tmain(int argc, _TCHAR* argv[])
{
namespace fs = std::tr2::sys;
fs::path fsPath = "//server/dir";
std::string sPath = fsPath;
std::cout << sPath.c_str() << "\n";
}
This will print "\ server \ dir", not "\\ server \ dir".
Is there a fix or workaround for this? Am I doing something wrong?
+3
source to share