Da boost/filesystem/path.hpp:Perché boost :: filesystem :: path :: string() restituisce per valore su Windows e per riferimento su POSIX?
# ifdef BOOST_WINDOWS_API
const std::string string() const
{
[...]
}
# else // BOOST_POSIX_API
// string_type is std::string, so there is no conversion
const std::string& string() const { return m_pathname; }
[...]
# endif
Per wstring() è esattamente il contrario - restituzione per riferimento su Windows e per valore su POSIX. C'è una ragione interessante per questo?