Commit d94688e
committed
Merge #251: Improved CustomBuildField for std::optional in IPC/libmultiprocess
1977b9f Use std::forward in CustomBuildField for std::optional to allow move semantics, resolves FIXME (Mangoostaa)
Pull request description:
The function now uses std::forward(value) when building the field, so rvalues are forwarded correctly instead of always being treated as lvalues. This resolves the existing FIXME in that code path.
Details
Previously, the implementation forced every optional value to be accessed as an lvalue, which meant rvalues were unnecessarily copied. By applying perfect forwarding, the function now preserves the value category and allows moves where appropriate. The FIXME comment was removed since the intended behavior is now implemented
ACKs for top commit:
ryanofsky:
Code review ACK 1977b9f. Thanks for the fix! I'm guessing this change became possible after 3a96cdc from #172 which started to support perfect forwarding
Tree-SHA512: ff67a944aa7402f0652d562057f5a16e1190774a48a06e4f2502dbbedda86e40d4df99113e8a97b73d835bac883bad0705a285968ebd8d2e29e7bc96549f5d5f1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
0 commit comments