![]() |
As the library evolves over time, names sometimes change or old features are
removed to make way for new features. To ease transition, Boost.Filesystem
deprecates the old names and features, but by default continues to provide
many of them. The deprecated names and other workarounds can be suppressed
by defining macro BOOST_FILESYSTEM_NO_DEPRECATED,
and this is recommended for all new code.
In the table below, ✔ indicates a synonym or other workaround is provided
unless BOOST_FILESYSTEM_NO_DEPRECATED
is defined.
Additionally, when not disabled, most of the deprecated components will generate
compilation warnings when used. These warnings are intended to highlight the
library usage that needs to be updated. For convenience during the transition
period, these warnings can be suppressed by defining BOOST_FILESYSTEM_ALLOW_DEPRECATED
macro.
Table 1.3. Deprecated Names and Features
|
Component or location |
Old name, now deprecated |
✔ |
New name |
|---|---|---|---|
|
|
Construction, assignment and appending from container types. |
Use string types or iterators as the source for path construction, assignment and appending. |
|
|
|
template<class String, class Traits> class basic_path; |
Class template |
|
|
|
|
✔ |
|
|
|
|
✔ |
Function removed. Cache |
|
Build system |
Auto-linking on Windows |
No longer supported. When users are linking against static library of Boost.Filesystem, they are recommended to explicitly add Boost.Filesystem dependencies to their linker command line. Shared library of Boost.Filesystem is not affected by this as it is already linked with all its dependencies. |
Some library features were removed in one of the past releases. The table below lists some of those features along with suggested replacements.
Table 1.4. Removed Names and Features
|
Component or location |
Removed name |
Possible replacement |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Replace |
|
|
|
|
|
|
|
|
|
|
|
Replace |
|
|
|
Replace |
|
|
|
Replace |
|
|
template <class Path> Path complete(const Path& p, const Path& base=initial_path<Path>()) |
|
|
|
|
|
|
|
|
Replace |
|
|
|
|
|
|
|
Replace |
|
|
|
Replace |
|
|
|
Replace |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use corresponding values of |
|
|
|
|
|
|
The header provides |
Explicitly include headers |
|
|
The header contained implementation details of class |
Remove the include. |
|
|
The header contained helper functions that were deprecated and then removed. |
Remove the include. |
Full implementation of initial_path() would require support from the C++ runtime
startup code, and that doesn't seem likely to happen. Depending on the
user to call initial_path() at the beginning of main() is too error prone. An equivalent function
can trivially be provided by a user.