Changeset 3600


Ignore:
Timestamp:
Jan 22, 2017, 1:33:39 PM (5 years ago)
Author:
Peter
Message:

move constructor aand assignmnet for BamHeader?; refs #878

Location:
trunk/yat/omic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamHeader.cc

    r3573 r3600  
    7676    header_ = bam_hdr_dup(other.header_);
    7777  }
     78
     79
     80#ifdef YAT_HAVE_RVALUE
     81  BamHeader::BamHeader(BamHeader&& other)
     82    : header_(NULL)
     83  {
     84    swap(other);
     85  }
     86#endif
    7887
    7988
     
    305314  }
    306315
     316
     317#ifdef YAT_HAVE_RVALUE
     318  BamHeader& BamHeader::operator=(BamHeader&& rhs)
     319  {
     320    swap(rhs);
     321    return *this;
     322  }
     323#endif
     324
     325
    307326#ifndef YAT_HAVE_HTSLIB
    308327  namespace detail {
  • trunk/yat/omic/BamHeader.h

    r3599 r3600  
    7878    BamHeader(const BamHeader&);
    7979
     80#ifdef YAT_HAVE_RVALUE
     81    /**
     82       \brief Move constructor
     83     */
     84    BamHeader(BamHeader&&);
     85#endif
     86
    8087    /**
    8188       Parse a region in the format: 'chr2:100,000-200,000 and return
     
    232239    BamHeader& operator=(const BamHeader& rhs);
    233240
     241#ifdef YAT_HAVE_RVALUE
     242    /**
     243       \brief move assignment operator
     244     */
     245    BamHeader& operator=(BamHeader&& rhs);
     246#endif
     247
    234248  private:
    235249#ifndef YAT_HAVE_HTSLIB
Note: See TracChangeset for help on using the changeset viewer.