Join Nostr
2026-10-28 23:57:34 UTC

solo on Nostr: is it reasonable to assume that the compiler will optimize away the below builder ...

is it reasonable to assume that the compiler will optimize away the below builder (see reply) so that doing<code>const auto pose = geometry_msgs::build&lt;geometry_msgs::msg::PoseStamped&gt;()<br> .header(/* ... */)<br> .pose(/* ... */);<br></code>

is equivalent to<code>PoseStamped pose;<br>pose.header = /* ... */;<br>pose.pose = /* ... */;<br></code>

I'd try it in godbolt, but I don't want to copy in 3 bajillion header files (thanks ROS)

(cont.)