lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6234aec 2/6: Replace copy functions with expl


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6234aec 2/6: Replace copy functions with explicitly-defaulted equivalents
Date: Mon, 6 Mar 2017 19:46:57 -0500 (EST)

branch: master
commit 6234aec54070cf4c596e10ee00ccfe51328671e0
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Replace copy functions with explicitly-defaulted equivalents
    
    The removed implementations of the copy ctor and assignment operator
    were equivalent to those the compiler would have written anyway. Their
    declarations were retained with explicit '= default' as documentation.
---
 round_to.hpp | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/round_to.hpp b/round_to.hpp
index a5a7a58..de963cd 100644
--- a/round_to.hpp
+++ b/round_to.hpp
@@ -287,9 +287,8 @@ class round_to
   public:
     round_to();
     round_to(int decimals, rounding_style style);
-    round_to(round_to const&);
-
-    round_to& operator=(round_to const&);
+    round_to(round_to const&) = default;
+    round_to& operator=(round_to const&) = default;
 
     bool operator==(round_to const&) const;
     RealType operator()(RealType r) const;
@@ -385,27 +384,6 @@ round_to<RealType>::round_to(int decimals, rounding_style 
a_style)
 }
 
 template<typename RealType>
-round_to<RealType>::round_to(round_to const& z)
-    :decimals_          (z.decimals_         )
-    ,style_             (z.style_            )
-    ,scale_fwd_         (z.scale_fwd_        )
-    ,scale_back_        (z.scale_back_       )
-    ,rounding_function_ (z.rounding_function_)
-{
-}
-
-template<typename RealType>
-round_to<RealType>& round_to<RealType>::operator=(round_to const& z)
-{
-    decimals_          = z.decimals_         ;
-    style_             = z.style_            ;
-    scale_fwd_         = z.scale_fwd_        ;
-    scale_back_        = z.scale_back_       ;
-    rounding_function_ = z.rounding_function_;
-    return *this;
-}
-
-template<typename RealType>
 bool round_to<RealType>::operator==(round_to const& z) const
 {
     return decimals() == z.decimals() && style() == z.style();



reply via email to

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