[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();
- [lmi-commits] [lmi] master updated (b05b682 -> 638d421), Greg Chicares, 2017/03/06
- [lmi-commits] [lmi] master 6234aec 2/6: Replace copy functions with explicitly-defaulted equivalents,
Greg Chicares <=
- [lmi-commits] [lmi] master c6035b5 1/6: Write explicitly-defaulted [cd]tors inline, in class defn, Greg Chicares, 2017/03/06
- [lmi-commits] [lmi] master 5c7028a 3/6: Write explicitly-defaulted [cd]tor inline, in class defn, Greg Chicares, 2017/03/06
- [lmi-commits] [lmi] master 638d421 6/6: Prefer explicitly-defaulted to user-written default ctor, Greg Chicares, 2017/03/06
- [lmi-commits] [lmi] master c123152 5/6: Replace typedefs with alias-declarations, Greg Chicares, 2017/03/06
- [lmi-commits] [lmi] master c025291 4/6: Write explicitly-defaulted dtor inline, in class defn, Greg Chicares, 2017/03/06