[PATCH] D22796: [ADT] Add make_scope_exit().
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 11:01:34 PDT 2016
dblaikie added a comment.
Maybe add some comments - one explaining that the test case is (also) testing that the device supports move-only functors. Another explaining that the device is inspired by the standard one, though is not complete - but can be made so (ie: it wasn't deliberately made not to match, just "this is all we need for now").
================
Comment at: include/llvm/ADT/ScopeExit.h:33-34
@@ +32,4 @@
+
+ scope_exit(const scope_exit &) = default;
+ scope_exit(scope_exit &&) = default;
+
----------------
These won't work in the MSVC versions we need to support (they don't support synthesizing move ops at all) - so you'll have to write them out.
Also, should this type be copyable? I guess if the functor is copyable?
I'd probably just make it move-only for now & you'll have to write out the move ctor explicitly.
Repository:
rL LLVM
https://reviews.llvm.org/D22796
More information about the llvm-commits
mailing list