Merge pull request #2509 from adbridge/copy_constructor

Utest: default copy constructor for failure_t doesn't behave as expected
pull/2557/head
Sam Grove 2016-08-26 09:23:21 -05:00 committed by GitHub
commit 2fe3e5214e
1 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,12 @@ namespace v1 {
failure_t(location_t location) : reason(REASON_NONE), location(location) {}
failure_t(failure_reason_t reason, location_t location) : reason(reason), location(location) {}
/// Copy constructor
failure_t(const failure_t &obj){
reason = obj.reason;
location = obj.location;
}
/// @returns a copy of the failure with the reason ignored.
failure_t ignored() const {
return failure_t(failure_reason_t(reason | REASON_IGNORE), location);