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<geometry_msgs::msg::PoseStamped>()<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.)
Published at
2026-10-28 23:57:34 UTCEvent JSON
{
"id": "fc4169469d9b15b0f09e1eb10b07a35e67d7f4a51f9bbb27781d5cf206351114",
"pubkey": "bffe0d54195dce7360be42cbff46b04fd1c26b661afd701dca92f1a19fecd9c1",
"created_at": 1793231854,
"kind": 1,
"tags": [
[
"proxy",
"https://tech.lgbt/@solonovamax/117521242833162706",
"web"
],
[
"proxy",
"https://tech.lgbt/users/solonovamax/statuses/117521242833162706",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://tech.lgbt/users/solonovamax/statuses/117521242833162706",
"pink.momostr"
],
[
"-"
]
],
"content": "is it reasonable to assume that the compiler will optimize away the below builder (see reply) so that doing\u003ccode\u003econst auto pose = geometry_msgs::build\u0026lt;geometry_msgs::msg::PoseStamped\u0026gt;()\u003cbr\u003e .header(/* ... */)\u003cbr\u003e .pose(/* ... */);\u003cbr\u003e\u003c/code\u003e\n\nis equivalent to\u003ccode\u003ePoseStamped pose;\u003cbr\u003epose.header = /* ... */;\u003cbr\u003epose.pose = /* ... */;\u003cbr\u003e\u003c/code\u003e\n\nI'd try it in godbolt, but I don't want to copy in 3 bajillion header files (thanks ROS)\n\n(cont.)",
"sig": "542ee5153c47d131003918c1b47085a788b69bc78cc489cd63f7fc22ad3240ebff6bf43afd95cb1eba5f89fa3396a38325ae3016c33dd60e3ebb0f612faa866b"
}