Commit a3cd1a2
authored
fix(bytes): replace std::forward<D>(d) with std::move(d) in move constructors (#776)
MSVC 19.44 (VS 2022 17.14) rejects std::forward<D>(d) when D is deduced
as decltype(d) — a local lambda type (always non-reference). The compiler
cannot convert the lvalue lambda to D&&, yielding C2665/C3536.
std::move(d) is the correct form here: D is never a reference type in
these constructors so std::forward<D> is semantically equivalent to
std::move, but newer MSVC enforces the distinction.
Affects three Bytes constructors:
- Bytes(std::vector<uint8_t, Allocator>&&)
- Bytes(std::string&&)
- Bytes(uint8_t*, size_t, Deleter)
Fixes ROS 2 buildfarm Windows build failure:
https://ci.ros2.org/job/ci_windows/27547/1 parent 67f6728 commit a3cd1a2
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments