Repository: mesos
Updated Branches:
  refs/heads/master 717a56bce -> 971129c8d


Add std::unique_ptr and std::move checks to configure script.

Review: https://reviews.apache.org/r/25448


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/971129c8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/971129c8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/971129c8

Branch: refs/heads/master
Commit: 971129c8deb775d9d2c1d05f2eac5c589262db9f
Parents: 717a56b
Author: Dominic Hamon <[email protected]>
Authored: Wed Oct 22 14:22:58 2014 -0700
Committer: Dominic Hamon <[email protected]>
Committed: Fri Oct 24 09:55:48 2014 -0700

----------------------------------------------------------------------
 m4/ax_cxx_compile_stdcxx_11.m4 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/971129c8/m4/ax_cxx_compile_stdcxx_11.m4
----------------------------------------------------------------------
diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
index d4b6628..72a1080 100644
--- a/m4/ax_cxx_compile_stdcxx_11.m4
+++ b/m4/ax_cxx_compile_stdcxx_11.m4
@@ -36,6 +36,8 @@
 #serial 3
 
 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
+  #include <memory>
+
   template <typename T, typename ...Args>
     struct check
     {
@@ -52,6 +54,27 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
   check_type&& cr = static_cast<check_type&&>(c);
 
   auto d = a;
+
+  struct Foo
+  {
+    void bar() const {}
+  };
+
+  void f(const Foo& foo) { foo.bar(); }
+
+  void baz() {
+    std::unique_ptr<Foo> p1(new Foo);  // p1 owns Foo.
+    p1->bar();
+
+    {
+      std::unique_ptr<Foo> p2(std::move(p1));  // Now p2 owns Foo.
+      f(*p2);
+
+      p1 = std::move(p2);  // Ownership returns to p1.
+    }
+
+    p1->bar();
+  }
 ])
 
 AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [

Reply via email to