lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master ed251fc 09/14: Test implicit special member f


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ed251fc 09/14: Test implicit special member functions
Date: Mon, 5 Apr 2021 18:26:47 -0400 (EDT)

branch: master
commit ed251fc8b60a2996a1ee18f4bbc6e9853b7bf1f3
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Test implicit special member functions
    
    There's no reason not to have them all, with no work other than
    specifying a defaulted default ctor.
---
 commutation_functions_test.cpp | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/commutation_functions_test.cpp b/commutation_functions_test.cpp
index e0c1b0c..8e71db8 100644
--- a/commutation_functions_test.cpp
+++ b/commutation_functions_test.cpp
@@ -34,6 +34,7 @@
 #include <cmath>                        // fabs()
 #include <iomanip>                      // setw() etc.
 #include <ios>                          // ios_base::fixed()
+#include <utility>                      // move()
 #include <vector>
 
 namespace
@@ -56,8 +57,24 @@ std::vector<double> const& sample_q()
 void test_fundamentals()
 {
     // default ctors
-    OLCommFns();
-    ULCommFns();
+    OLCommFns olcf0;
+    ULCommFns ulcf0;
+
+    // copy
+    OLCommFns olcf1(olcf0);
+    ULCommFns ulcf1(ulcf0);
+
+    // copy-assign
+    olcf0 = olcf1;
+    ulcf0 = ulcf1;
+
+    // move
+    OLCommFns olcf2(std::move(olcf0));
+    ULCommFns ulcf2(std::move(ulcf0));
+
+    // move-assign
+    olcf2 = std::move(olcf1);
+    ulcf2 = std::move(ulcf1);
 }
 
 /// Exactly reproduce Table 2 from Eckley's paper.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]