mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2509 from adbridge/copy_constructor
Utest: default copy constructor for failure_t doesn't behave as expectedpull/2557/head
commit
2fe3e5214e
|
@ -88,6 +88,12 @@ namespace v1 {
|
||||||
failure_t(location_t location) : reason(REASON_NONE), location(location) {}
|
failure_t(location_t location) : reason(REASON_NONE), location(location) {}
|
||||||
failure_t(failure_reason_t reason, location_t location) : reason(reason), 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.
|
/// @returns a copy of the failure with the reason ignored.
|
||||||
failure_t ignored() const {
|
failure_t ignored() const {
|
||||||
return failure_t(failure_reason_t(reason | REASON_IGNORE), location);
|
return failure_t(failure_reason_t(reason | REASON_IGNORE), location);
|
||||||
|
|
Loading…
Reference in New Issue