|
39 | 39 |
|
40 | 40 | namespace cucumber_cpp::library |
41 | 41 | { |
42 | | - Lineage Lineage::operator+(std::shared_ptr<const cucumber::messages::gherkin_document> gherkinDocument) const |
| 42 | + Lineage operator+(Lineage lineage, std::shared_ptr<const cucumber::messages::gherkin_document> gherkinDocument) |
43 | 43 | { |
44 | | - Lineage copy = *this; |
45 | | - copy.gherkinDocument = gherkinDocument; |
46 | | - return copy; |
| 44 | + lineage.gherkinDocument = gherkinDocument; |
| 45 | + return std::move(lineage); |
47 | 46 | } |
48 | 47 |
|
49 | | - Lineage Lineage::operator+(std::shared_ptr<const cucumber::messages::feature> feature) const |
| 48 | + Lineage operator+(Lineage lineage, std::shared_ptr<const cucumber::messages::feature> feature) |
50 | 49 | { |
51 | | - Lineage copy = *this; |
52 | | - copy.feature = feature; |
53 | | - return copy; |
| 50 | + lineage.feature = feature; |
| 51 | + return std::move(lineage); |
54 | 52 | } |
55 | 53 |
|
56 | | - Lineage Lineage::operator+(std::shared_ptr<const cucumber::messages::rule> rule) const |
| 54 | + Lineage operator+(Lineage lineage, std::shared_ptr<const cucumber::messages::rule> rule) |
57 | 55 | { |
58 | | - Lineage copy = *this; |
59 | | - copy.rule = rule; |
60 | | - return copy; |
| 56 | + lineage.rule = rule; |
| 57 | + return std::move(lineage); |
61 | 58 | } |
62 | 59 |
|
63 | | - Lineage Lineage::operator+(std::shared_ptr<const cucumber::messages::scenario> scenario) const |
| 60 | + Lineage operator+(Lineage lineage, std::shared_ptr<const cucumber::messages::scenario> scenario) |
64 | 61 | { |
65 | | - Lineage copy = *this; |
66 | | - copy.scenario = scenario; |
67 | | - return copy; |
| 62 | + lineage.scenario = scenario; |
| 63 | + return std::move(lineage); |
68 | 64 | } |
69 | 65 |
|
70 | | - Lineage Lineage::operator+(std::shared_ptr<const cucumber::messages::examples> examples) const |
| 66 | + Lineage operator+(Lineage lineage, std::shared_ptr<const cucumber::messages::examples> examples) |
71 | 67 | { |
72 | | - Lineage copy = *this; |
73 | | - copy.examples = examples; |
74 | | - return copy; |
| 68 | + lineage.examples = examples; |
| 69 | + return std::move(lineage); |
75 | 70 | } |
76 | 71 |
|
77 | | - Lineage Lineage::operator+(std::shared_ptr<const cucumber::messages::table_row> tableRow) const |
| 72 | + Lineage operator+(Lineage lineage, std::shared_ptr<const cucumber::messages::table_row> tableRow) |
78 | 73 | { |
79 | | - Lineage copy = *this; |
80 | | - copy.tableRow = tableRow; |
81 | | - return copy; |
| 74 | + lineage.tableRow = tableRow; |
| 75 | + return std::move(lineage); |
82 | 76 | } |
83 | 77 |
|
84 | | - Lineage Lineage::operator+(std::uint32_t featureIndex) const |
| 78 | + Lineage operator+(Lineage lineage, std::uint32_t featureIndex) |
85 | 79 | { |
86 | | - Lineage copy = *this; |
87 | | - copy.featureIndex = featureIndex; |
88 | | - return copy; |
| 80 | + lineage.featureIndex = featureIndex; |
| 81 | + return std::move(lineage); |
89 | 82 | } |
90 | 83 |
|
91 | 84 | std::string Lineage::GetUniqueFeatureName() const |
|
0 commit comments