Andrey Semashev 701ae40549 Fixed rvalue-aware operator/ return type, leverage NRVO.
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
2019-06-19 14:57:23 +03:00
2019-01-14 20:08:41 +03:00
2018-10-30 11:48:16 +03:00
2014-07-23 10:11:34 -04:00

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

Master: AppVeyor Travis CI Develop: AppVeyor Travis CI

License

Distributed under the Boost Software License, Version 1.0.

Description
Mirrored via gitea-mirror
Readme 14 MiB
Languages
C++ 98.4%
CMake 1.5%