Changeset 4245


Ignore:
Timestamp:
Sep 21, 2022, 7:41:41 AM (2 months ago)
Author:
Peter
Message:

GCC -Wdeprecated-copy complains when some but not all of copy ctor, dtor and operator= are user-implemented. When the implementation is identical with the one generated by the compiler, there is no reason to keep the code. DataWeightProxy? is a different story (see #986)

Location:
trunk/yat
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/Target.cc

    r4051 r4245  
    116116
    117117
    118   Target::~Target(void)
    119   {
    120   }
    121 
    122118  bool Target::binary(size_t i) const
    123119  {
     
    212208  }
    213209
    214   const Target& Target::operator=(const Target& other)
    215   {
    216     binary_ = other.binary_;
    217     classes_ = other.classes_;
    218     class_map_ = other.class_map_;
    219     labels_ = other.labels_;
    220     return *this;
    221   }
    222 
    223210
    224211  std::ostream& operator<<(std::ostream& s, const Target& a)
  • trunk/yat/classifier/Target.h

    r4051 r4245  
    7777    ///
    7878    Target(const Target& org, const utility::Index& vec);
    79 
    80     ///
    81     /// @brief Destructor
    82     ///
    83     ~Target();
    8479
    8580    ///
     
    163158    size_t operator[](size_t sample) const YAT_DEPRECATE;
    164159
    165     ///
    166     /// @brief assignment operator
    167     ///
    168     const Target& operator=(const Target&);
    169 
    170160  private:
    171161    /// @brief Copy Constructor
  • trunk/yat/omic/DNA.cc

    r4089 r4245  
    5151      std::throw_with_nested(std::invalid_argument(msg));
    5252    }
    53     assert(code_<16);
    54   }
    55 
    56 
    57   DNA::DNA(const DNA& other)
    58     : code_(other.code_)
    59   {
    60     assert(other.code_<16);
    6153    assert(code_<16);
    6254  }
  • trunk/yat/omic/DNA.h

    r3550 r4245  
    6868     */
    6969    DNA(void);
    70 
    71     /**
    72        \brief Copy Constructor
    73      */
    74     DNA(const DNA&);
    7570
    7671    /**
  • trunk/yat/statistics/AveragerWeighted.cc

    r4207 r4245  
    3434  AveragerWeighted::AveragerWeighted(void)
    3535    : mean_(0), m2_(0), w_(0), ww_(0), wwxx_(0), wxx_(0)
    36   {
    37   }
    38 
    39 
    40   AveragerWeighted::AveragerWeighted(const AveragerWeighted& a)
    41     : mean_(a.mean_), m2_(a.m2_), w_(a.w_),
    42       ww_(a.ww_), wwxx_(a.wwxx_), wxx_(a.wxx_)
    4336  {
    4437  }
  • trunk/yat/statistics/AveragerWeighted.h

    r3550 r4245  
    7474
    7575    ///
    76     /// @brief The copy constructor
    77     ///
    78     AveragerWeighted(const AveragerWeighted&);
    79 
    80     ///
    8176    /// Adding a data point \a d, with weight \a w (default is 1)
    8277    ///
  • trunk/yat/utility/Range.h

    r3259 r4245  
    8080
    8181
    82     /**
    83        @brief Does not modify underlying data.
    84 
    85        This only changes this object by reassigning two iterators,
    86        begin() and end(). If you would like to modify the underlying
    87        data, use std::copy instead.
    88     */
    89     Range& operator=(const Range&);
    90 
    9182  private:
    9283    // Using compiler generated copy constructor
     
    180171  T Range<T>::end(void) const
    181172  { return last_; }
    182 
    183 
    184   template<typename T>
    185   Range<T>& Range<T>::operator=(const Range<T>& rhs)
    186   {
    187     first_ = rhs.begin();
    188     last_ = rhs.end();
    189     return *this;
    190   }
    191173
    192174
Note: See TracChangeset for help on using the changeset viewer.