U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
Let's speak about Reflexion in C++
https://www.ultimatepp.org/forums/index.php?t=rview&goto=51283&th=10587#msg_51283
Today I want speak about Reflexion, what you think about it ?
unlike modern language, C++ do not have any features allowing it easily.
Why ?
I mean, I guess they already thought about adding that kind of stuff to the
standard lib, but they did not do it and I guess it's for a good reason.
So can someone explain me why it still not exist in modern C++ ?
Thanks in advance everybody.
Have a good day ! ]]>Xemuth2019-03-01T13:19:49-00:00Re: Let's speak about Reflexion in C++
https://www.ultimatepp.org/forums/index.php?t=rview&goto=51284&th=10587#msg_51284
Xemuth wrote on Fri, 01 March 2019 14:19
Hello Upp community !
Today I want speak about Reflexion, what you think about it ?
unlike modern language, C++ do not have any features allowing it easily.
Why ?
I mean, I guess they already thought about adding that kind of stuff to the
standard lib, but they did not do it and I guess it's for a good reason.
So can someone explain me why it still not exist in modern C++ ?
Thanks in advance everybody.
Have a good day !
While I miss the feature from time to time, I do not consider it that much important. Usually, there is a way around that is perhaps different, but usually not really inferior (e.g. database model .sch files in U++).
Anyway, I would say that the reason why this is not in C++ standard is that perhaps because of worries about code bloat. Thing is reflection is not really needed most of time and even the most trivial use would need the whole program database present...]]>mirek2019-03-01T13:32:05-00:00Re: Let's speak about Reflexion in C++
https://www.ultimatepp.org/forums/index.php?t=rview&goto=51301&th=10587#msg_51301
Thanks for the response,
however you pointed my curiosity with the idea of database Model.
I thought that the .sch was just a way to easily create database via the code like lot of ORM do.
What's the point with Reflexion ? Reflexion is to be able to read the name of all method / arg of object via the code ?
Do you mean we can create class via .sch and know the name of method/arg of the running object via the code ?
Sorry if the question look's stupid but I'm a little lost !
Thanks in advance
]]>Xemuth2019-03-04T11:15:20-00:00Re: Let's speak about Reflexion in C++
https://www.ultimatepp.org/forums/index.php?t=rview&goto=51303&th=10587#msg_51303
Xemuth wrote on Mon, 04 March 2019 12:15
Hello Mirek,
Thanks for the response,
however you pointed my curiosity with the idea of database Model.
I thought that the .sch was just a way to easily create database via the code like lot of ORM do.
What's the point with Reflexion ? Reflexion is to be able to read the name of all method / arg of object via the code ?
Do you mean we can create class via .sch and know the name of method/arg of the running object via the code ?
Sorry if the question look's stupid but I'm a little lost !
.sch has several possible 'outputs'. Creating database is one of them. But it also creates structs representing rows of individual tables and mapping between these and database, which IMO is one of things that one would probably want to use reflection for, would it be available.
IMO, another example is binary serialization and Jsonize/Xmlize. All these might benefit from reflection, but doing it without is not that hard (and in fact has advantages of its own).
I am not really aware about other applications of reflection. And IMO existing use cases are too easy to do without reflection...