← Home ← Back to /g/

Thread 105681708

11 posts 8 images /g/
Anonymous No.105681708 [Report] >>105681855 >>105682137 >>105682156 >>105683572 >>105683583
you WILL use the newly added compile-time reflection coming with C++26, right anon???
Anonymous No.105681855 [Report] >>105682137
>>105681708 (OP)
I bet its over engineered whilst being minimally useful.
Anonymous No.105682137 [Report] >>105682153
>>105681708 (OP)
>>105681855
Beef > C++ > C# > ... > Python
Anonymous No.105682153 [Report]
>>105682137
Go to bed, Christian
Anonymous No.105682156 [Report]
>>105681708 (OP)
Finnster programs?
Anonymous No.105683572 [Report] >>105683720
>>105681708 (OP)
wait what? even though C++ is the biggest bloated fucking language on this planet it can't do this:?
Anonymous No.105683583 [Report]
>>105681708 (OP)
Didn't know Ghandi was a programmer.
Anonymous No.105683720 [Report] >>105683809
>>105683572
Name one use case for this, protip: you can't.
Anonymous No.105683809 [Report] >>105683944
>>105683720
parsing json. the unity game engine also uses reflection to showcase your variables on the ui (pic related).
I also used it to create a tool that diffs our test databases when running tests to recognize unintentional changes to the database. it's extremely useful and powerful. the fact that you ask this proves you are either not an employed programmer or a junior with a major case of dunning-kruger.
Anonymous No.105683944 [Report] >>105684255
>>105683809
>parsing json
oh shit we didn't have C++ json parsers until now???
>the unity game engine also uses reflection to showcase your variables on the ui (pic related).
oh shit we didn't have C++ debuggers until now???
Anonymous No.105684255 [Report]
>>105683944
you are a retard. in C++ parsing doesn’t automatically map JSON keys to struct fields by name. Instead, you define how to map the JSON to your object by hand like this
void from_json(const json& j, MyType& obj) {
j.at("some_json_key").get_to(obj.member_variable);
}

which gets very repetitive after a while. this is grudgework that reflection can save you from.
in other languages with reflection you can just say:
var myobj = json.parse("file.json");


>the unity game engine also uses reflection to showcase your variables on the ui (pic related).

>oh shit we didn't have C++ debuggers until now???

what does showing objects dynamically on the UI have to do with debugging? you truly are a fucking retard.

you are the embodiment of dunning-kruger