By performing the /= operation on a named local variable instead of a
temporary the copy made for the return value can be elided.
Backport from mainline
2018-05-07 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/85671
* include/experimental/bits/fs_path.h (operator/): Likewise.
From-SVN: r262404
2018-07-04 Jonathan Wakely <jwakely@redhat.com>
+ Backport from mainline
+ 2018-05-07 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/85671
+ * include/experimental/bits/fs_path.h (operator/): Likewise.
+
Backport from mainline
2018-06-14 Daniel Trebbien <dtrebbien@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
/// Append one path to another
inline path operator/(const path& __lhs, const path& __rhs)
- { return path(__lhs) /= __rhs; }
+ {
+ path __result(__lhs);
+ __result /= __rhs;
+ return __result;
+ }
/// Write a path to a stream
template<typename _CharT, typename _Traits>