No.
But you can implement it by doing something like this:
namespace bfs = boost::filesystem; using std; bfs::path expand (bfs::path in) { if (in.size () < 1) return in; const char * home = getenv ("HOME"); if (home == NULL) { cerr << "error: HOME variable not set." << endl; throw std::invalid_argument ("error: HOME environment variable not set."); } string s = in.c_str (); if (s[0] == '~') { s = string(home) + s.substr (1, s.size () - 1); return bfs::path (s); } else { return in; } }
Also, look at a similar question suggested by @WhiteViking.
source share