I don’t think it’s possible to completely hide the Windows/Unix divide with this one (unless, maybe, Boost has something).
The most portable way would have to be getenv("HOME")
on Unix and concatenating the results of getenv("HOMEDRIVE")
and getenv("HOMEPATH")
on Windows.