[PATCH] D46593: Allow copy elision in path concatenation

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 9 12:00:56 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCXX331910: Allow copy elision in path concatenation (authored by xbolva00, committed by ).

Repository:
  rCXX libc++

https://reviews.llvm.org/D46593

Files:
  include/experimental/filesystem


Index: include/experimental/filesystem
===================================================================
--- include/experimental/filesystem
+++ include/experimental/filesystem
@@ -1140,7 +1140,9 @@
 
 inline _LIBCPP_INLINE_VISIBILITY
 path operator/(const path& __lhs, const path& __rhs) {
-    return path(__lhs) /= __rhs;
+    path __result(__lhs);
+    __result /= __rhs;
+    return __result;
 }
 
 template <class _Source>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46593.145980.patch
Type: text/x-patch
Size: 431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180509/67363f0f/attachment.bin>


More information about the cfe-commits mailing list