[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.
- [lmi-commits] [lmi] master b8f43e0 06/14: Transpose several unit-test functions, (continued)
- [lmi-commits] [lmi] master b8f43e0 06/14: Transpose several unit-test functions, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master e6ed669 01/14: Test guideline premium calculations with more complications, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master b1eecea 02/14: Stabilize unit-test timing, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 28cabc2 04/14: Prefer lambdas to std::bind(), Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 61a04eb 08/14: Make commutation functions default constructible, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master df25463 12/14: Avoid operator new, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master b657767 13/14: Remove conditionals that serve no further purpose, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 23fe71f 11/14: Do away with an undesirable smart pointer [290], Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 485e19b 07/14: Favor the rule of zero, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 762056e 05/14: Prefer PETE's operator<<=() to assign(), Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master ed251fc 09/14: Test implicit special member functions,
Greg Chicares <=
- [lmi-commits] [lmi] master c2087ae 10/14: Update a comment, Greg Chicares, 2021/04/05
- [lmi-commits] [lmi] master 8aa09b9 14/14: Expunge some pointless defect markers [287], Greg Chicares, 2021/04/05