Elias Mårtenson on Nostr: Can someone knowledgeable in C++ tell me why someone would declare a class member ...
Can someone knowledgeable in C++ tell me why someone would declare a class member like so:
double x { 0.0 };
Rather than:
double x = 0.0;
These should do the same thing, but surely the second in much more clear?
Published at
2024-06-12 05:09:06Event JSON
{
"id": "191b6f28e9a420c42950c4bf2489419bffb8cfaaffce1cd2c001909e1a8417d2",
"pubkey": "91eeae4b1c813861a59f3eeea96dce64548560dd6df2cf058cea564655e3cc1a",
"created_at": 1718168946,
"kind": 1,
"tags": [
[
"proxy",
"https://functional.cafe/users/loke/statuses/112601920050975094",
"activitypub"
]
],
"content": "Can someone knowledgeable in C++ tell me why someone would declare a class member like so:\n\ndouble x { 0.0 };\n\n\nRather than:\n\ndouble x = 0.0;\n\n\nThese should do the same thing, but surely the second in much more clear?",
"sig": "25ecde95f58ce05e4fc40de129913981ed69fd27dbf2374a0dfd1535bed9355037a094010e92a58ea72d6d37678c690a9e26cee5e8f87b463f181357d9689fba"
}