9 Jan
2015
9 Jan
'15
8:30 p.m.
Beman Dawes wrote:
Filesystem has a dependency on
in order to supply this: inline std::size_t hash_value(const path& x) { # ifdef BOOST_WINDOWS_API std::size_t seed = 0; for(const path::value_type* it = x.c_str(); *it; ++it) hash_combine(seed, *it == '/' ? L'\\' : *it); return seed; # else // BOOST_POSIX_API return hash_range(x.native().begin(), x.native().end()); # endif } ... Is there any recommended way to avoid the functional dependency?
In this specific case, I would forward-declare hash_combine and hash_range.
There is also the option of just returning hash_value( x.native() ). This would require a forward declaration of hash_value for string.