__ct__4LunaFv on Nostr: Alright, next challenge for the C++ folks, initialize a std::array<T, N> so every ...
Alright, next challenge for the C++ folks, initialize a std::array<T, N> so every element contains a given default value, but also T's default constructor has been explicitly deleted.
I know it's possible via some inscrutable template variadics, but there's gotta be a clean/idiomatic way of doing it, right?
Published at
2025-03-04 18:37:31 UTCEvent JSON
{
"id": "2442d8a6167f1ac54dc68a5a4a8346a4aaff6bf5f551ddea6867bba14e9e17a6",
"pubkey": "a698838a55f210819f761af5acde5fd5a1684bffe07e515ee877a6ea6eeda5e6",
"created_at": 1741113451,
"kind": 1,
"tags": [
[
"proxy",
"https://pony.social/users/luna/statuses/114105611178810764",
"activitypub"
]
],
"content": "Alright, next challenge for the C++ folks, initialize a std::array\u003cT, N\u003e so every element contains a given default value, but also T's default constructor has been explicitly deleted.\n\nI know it's possible via some inscrutable template variadics, but there's gotta be a clean/idiomatic way of doing it, right?",
"sig": "4b9cad0dd1aeb0e521f4ad9212aa20a67479d5a0a7cef33bb777c62030b84280d6b882a12d407cf8382475f22e262bf8ddd957df4c4fddfefed8dd9287d4f77d"
}