Last active
June 12, 2016 19:27
-
-
Save wngreene/0d401abed67604c671b4f91ea3698a31 to your computer and use it in GitHub Desktop.
Example of use of default specifier that fails to compile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \brief Class to represent a feature track. | |
*/ | |
class FeatureTrack final { | |
public: | |
explicit FeatureTrack(const uint32_t id = 0, const uint32_t img_idx = 0, | |
const cv::Point2f& feat = cv::Point2f()) : | |
id(id), | |
pos(1, feat), | |
img(1, img_idx) {} | |
~FeatureTrack() = default; | |
FeatureTrack(const FeatureTrack& rhs) = default; | |
FeatureTrack& operator=(const FeatureTrack& rhs) = default; | |
FeatureTrack(const FeatureTrack&& rhs) = default; | |
FeatureTrack& operator=(const FeatureTrack&& rhs) = default; | |
uint32_t id; // Track id. | |
std::vector<uint32_t> img; // Image indices. | |
std::vector<cv::Point2f> pos; // Feature positions. | |
}; |
For future reference this fails because the arguments to the move constructor and assignment operator are const (which doesn't make any sense given what they're supposed to do).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler output: