Skip to content

Commit

Permalink
added c++0x
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincenzo Innocente committed May 14, 2011
1 parent d005be6 commit 9f85e72
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion interface/DetGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
#include <vector>
#include <utility>

#include <algorithm>

class DetGroupElement {
public:
Expand All @@ -19,6 +19,21 @@ class DetGroupElement {
DetGroupElement( const Det* d, const TrajectoryStateOnSurface& s) :
det_(d), state_(s) {}

#if defined( __GXX_EXPERIMENTAL_CXX0X__)
DetGroupElement(DetGroupElement const & rhs) : det_(rhs.det_), state_(rhs.state_){}
DetGroupElement(DetGroupElement && rhs) : det_(rhs.det_), state_(std::move(rhs.state_)){}
DetGroupElement & operator=(DetGroupElement const & rhs) {
det_=rhs.det_;
state_ = rhs.state_;
return *this;
}
DetGroupElement & operator=(DetGroupElement && rhs) {
det_=rhs.det_;
state_ = std::move(rhs.state_);
return *this;
}
#endif

const Det* det() const {return det_;}
const TrajectoryStateOnSurface& trajectoryState() const {return state_;}

Expand All @@ -37,6 +52,24 @@ class DetGroup : public std::vector< DetGroupElement> {
typedef DetGroupElement::DetWithState DetWithState;

DetGroup() {}
#if defined( __GXX_EXPERIMENTAL_CXX0X__)
DetGroup(DetGroup const & rhs) : Base(rhs), index_(rhs.index_), indexSize_(rhs.indexSize_) {}
DetGroup(DetGroup && rhs) : Base(std::forward<Base>(rhs)), index_(rhs.index_), indexSize_(rhs.indexSize_) {}
DetGroup & operator=(DetGroup const & rhs) {
Base::operator=(rhs);
index_ = rhs.index_;
indexSize_ = rhs.indexSize_;
return *this;
}
DetGroup & operator=(DetGroup && rhs) {
Base::operator=(std::forward<Base>(rhs));
index_ = rhs.index_;
indexSize_ = rhs.indexSize_;
return *this;
}
#endif


DetGroup(int ind, int indSize) : index_(ind), indexSize_(indSize) {}

DetGroup(const std::vector<DetWithState>& vec) {
Expand Down

0 comments on commit 9f85e72

Please sign in to comment.