1. Matt Oswald
  2. xUnit++

Commits

Matt Oswald  committed 2eabccc

cleaning up some dead code: unless required, it's better to let the compiler generate copy/move constructors (thanks to R. Martinho Fernandez for the tip on Stackoverflow)

  • Participants
  • Parent commits f6b0631
  • Branches default

Comments (0)

Files changed (6)

File xUnit++/src/Attributes.cpp

View file
 {
 }
 
-AttributeCollection::AttributeCollection(const AttributeCollection &other)
-    : sortedAttributes(other.sortedAttributes)
-    , skipped(other.skipped)
-{
-}
-
-AttributeCollection::AttributeCollection(AttributeCollection &&other)
-    : sortedAttributes(std::move(other.sortedAttributes))
-    , skipped(std::move(other.skipped))
-{
-}
-
-AttributeCollection &AttributeCollection::operator =(AttributeCollection other)
-{
-    swap(*this, other);
-    return *this;
-}
-
 void swap(AttributeCollection &a, AttributeCollection &b)
 {
     using std::swap;

File xUnit++/src/TestDetails.cpp

View file
 {
 }
 
-TestDetails::TestDetails(const TestDetails &other)
-    : Id(other.Id)
-    , TestInstance(other.TestInstance)
-    , Name(other.Name)
-    , Params(other.Params)
-    , Suite(other.Suite)
-    , Attributes(other.Attributes)
-    , TimeLimit(other.TimeLimit)
-    , LineInfo(other.LineInfo)
-{
-}
-
-TestDetails::TestDetails(TestDetails &&other)
-{
-    swap(*this, other);
-}
-
-TestDetails &TestDetails::operator =(TestDetails other)
-{
-    swap(*this, other);
-    return *this;
-}
-
 void swap(TestDetails &td0, TestDetails &td1)
 {
     using std::swap;

File xUnit++/xUnit++/Attributes.h

View file
     typedef std::pair<const_iterator, const_iterator> iterator_range;
 
     AttributeCollection();
-    AttributeCollection(const AttributeCollection &other);
-    AttributeCollection(AttributeCollection &&other);
-    AttributeCollection &operator =(AttributeCollection other);
     friend void swap(AttributeCollection &a, AttributeCollection &b);
 
     // !!!VS My kingdom for initialization lists!

File xUnit++/xUnit++/TestDetails.h

View file
     TestDetails(std::string &&name, int testInstance, std::string &&params, const std::string &suite,
         AttributeCollection &&attributes, Time::Duration timeLimit,
         std::string &&filename, int line);
-    TestDetails(const TestDetails &other);
-    TestDetails(TestDetails &&other);
-    TestDetails &operator =(TestDetails other);
     friend void swap(TestDetails &td0, TestDetails &td1);
 
     std::string FullName() const;

File xUnit++/xUnit++/xUnitAssert.h

View file
 public:
     xUnitFailure(xUnitAssert &&assert, std::function<void(const xUnitAssert &)> onFailureComplete);
     xUnitFailure(const xUnitFailure &other);
+
+#if !defined(_MSC_VER) // !!!VS remove the #if/#endif when VS can compile this code
+    xUnitFailure(xUnitFailure &&) = default;
+#endif
+
     ~xUnitFailure() noexcept(false);
 
     static xUnitFailure None();
     }
 
 private:
-    xUnitFailure &operator =(xUnitFailure other);
+    xUnitFailure &operator =(xUnitFailure other) /* = delete */;
 
 private:
     std::function<void(const xUnitAssert &)> OnFailureComplete;

File xUnit++/xUnit++/xUnitLog.h

View file
         public:
             Message(std::function<void(const std::string &, const LineInfo &)> recordMessage, const LineInfo &lineInfo = LineInfo());
             Message(const Message &other);
+
+#if !defined(_MSC_VER) // !!!VS remove the #if/#endif when VS can compile this code
+            Message(Message &&) = default;
+#endif
+
             ~Message();
 
             template<typename T>