Boost Filesystem basename() and extension() functions are deprecated since v1.36.0.
See more: https://lists.boost.org/Archives/boost/2010/01/160905.php
Also this PR prevents further use of deprecated Boost Filesystem functions. Ref: https://www.boost.org/doc/libs/1_64_0/libs/filesystem/doc/index.htm#Coding-guidelines
Note: On my Linux system Boost 1.65.1 header /usr/include/boost/filesystem/convenience.hpp contains:
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
inline std::string extension(const path & p)
{
return p.extension().string();
}
inline std::string basename(const path & p)
{
return p.stem().string();
}
inline path change_extension( const path & p, const path & new_extension )
{
path new_p( p );
new_p.replace_extension( new_extension );
return new_p;
}
# endif
UPDATE: Also removed unused code as noted by ryanofsky.