mirror of
https://github.com/boostorg/filesystem.git
synced 2026-02-23 03:32:18 +00:00
701ae4054947b1643eb6cd42f7e172f83536b764
The rvalue-aware operator/ needs to return an rvalue, not an rvalue reference so that binding its result to a const reference in the caller's code doesn't leave a dangling reference. This hampers operator/ efficiency to some degree, but it is still better than the non-rvalue-aware version as it still allows to avoid copying the path body. The non-rvalue-aware operator/ is now creating an automatic variable which will be returned to leverage NRVO. The previous implementation used to return an lvalue reference to a temporary, which did not match NRVO criteria[1]. Fixes https://github.com/boostorg/filesystem/issues/110. Closes https://github.com/boostorg/filesystem/pull/111. [1]: https://en.cppreference.com/w/cpp/language/copy_elision
Boost.Filesystem
Boost.Filesystem, part of collection of the Boost C++ Libraries, provides facilities to manipulate files and directories, and the paths that identify them.
Directories
- doc - Documentation sources
- include - Interface headers of Boost.Filesystem
- src - Compilable source files of Boost.Filesystem
- test - Boost.Filesystem unit tests
- example - Boost.Filesystem usage examples
More information
- Documentation
- Report bugs. Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
- Submit your patches as pull requests against develop branch. Note that by submitting patches you agree to license your modifications under the Boost Software License, Version 1.0.
Build status
License
Distributed under the Boost Software License, Version 1.0.
Description
Languages
C++
98.4%
CMake
1.5%