Coyote on Nostr: bonkmaykr What is the vector's template parameter? If it's ...
bonkmaykr (nprofile…kwjl) What is the vector's template parameter? If it's std::vector<o_worldObjectGeneric> it'll still allow you to push derived objects, but it'll copy construct an o_worldObjectGeneric instead of pushing the entire derived object on the vector. Look at this; notice how despite calling push_back with four different objects, only "A copy construct" will be printed between "Before push_back" and "After push_back."
Published at
2025-01-20 22:37:28Event JSON
{
"id": "925cb70b51a54adeb0f2f4f20698d753164b0a530286cae8d0fb732f193d2ed8",
"pubkey": "778c5d9cdc5ff2220b7cf37c769c8815b50686784f38d81e50129d3758e9a29a",
"created_at": 1737412648,
"kind": 1,
"tags": [
[
"p",
"79e734708024766adafaed0415edfb6b5a9842c825d85d15021eeab49eafb4f9",
"wss://relay.mostr.pub"
],
[
"e",
"d5f651a84233afb4fa8241d96214b6977bac2fa60e4fb7190b89fd3fa1478795",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://social.singing.dog/objects/62cee082-63da-4fb3-b237-f3ba72e2f84a",
"activitypub"
]
],
"content": "nostr:nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpq08nnguyqy3mx4kh6a5zptm0mdddfsskgyhv969gzrm4tf840knusgkkwjl What is the vector's template parameter? If it's std::vector\u003co_worldObjectGeneric\u003e it'll still allow you to push derived objects, but it'll copy construct an o_worldObjectGeneric instead of pushing the entire derived object on the vector. Look at this; notice how despite calling push_back with four different objects, only \"A copy construct\" will be printed between \"Before push_back\" and \"After push_back.\"",
"sig": "0a59687f082711c10f866866cf1a97ede810e7c5ccbfd1dadcebfd7eb9d2f02bf1f59fdd5b70ad92ee046dcf28f4c1e09b34777f4d748748c42cd9277ac7dfb1"
}