25 Mar
2013
25 Mar
'13
6:50 p.m.
On Mon, Mar 25, 2013 at 2:32 PM, Alexander Lamaison
Yakov Galka
writes: [...] I admit that a path class is a matter of preference. But this is why it is unfair that exists(const path &x) uses a path in its interface towards those who do not like using this class.
You realise Boost.Filesystem actually works the way you describe? :-P Nothing forces you to use class path to benefit from the operation functions. Try this for example:
assert(boost::filesystem::exists("c:\\"));
Yes, of course. But on, say, POSIX platforms, you pay for yet another string allocation even if you don't care for the path. In addition some library functions return a path, so there are always places where the path class pops up. -- Yakov