【发布时间】:2016-09-28 12:28:45
【问题描述】:
来自 boost/filesystem/path.hpp:
# 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
对于 wstring(),它正好相反——在 Windows 上按引用返回,在 POSIX 上按值返回。这有什么有趣的原因吗?
【问题讨论】:
标签: c++ boost boost-filesystem