|
Boost : |
Subject: Re: [boost] [functional] How to avoid a dependency on functional?
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2015-01-09 14:51:31
2015-01-09 20:42 GMT+01:00 Beman Dawes <bdawes_at_[hidden]>:
> Filesystem has a dependency on <boost/functional/hash_fwd.hpp> 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
> }
>
> The problem with this is that functional is a heavy-weight dependency
> for such relatively minor feature.
>
> See http://www.pdimov.com/tmp/report-develop-3b5a9f4/module-weights.html
>
> Is there any recommended way to avoid the functional dependency?
>
A good question. For the same reason I am reluctant to implement hash
support in Boost.Optional.
Regards,
Andrzej
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk