Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Let's speak about Reflexion in C++ (I want know your point of view )
Let's speak about Reflexion in C++ [message #51283] Fri, 01 March 2019 14:19 Go to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
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 !

[Updated on: Fri, 01 March 2019 14:25]

Report message to a moderator

Re: Let's speak about Reflexion in C++ [message #51284 is a reply to message #51283] Fri, 01 March 2019 14:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
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...

[Updated on: Fri, 01 March 2019 14:32]

Report message to a moderator

Re: Let's speak about Reflexion in C++ [message #51301 is a reply to message #51283] Mon, 04 March 2019 12:15 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
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 !

Thanks in advance
Re: Let's speak about Reflexion in C++ [message #51303 is a reply to message #51301] Mon, 04 March 2019 15:00 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
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...

Mirek
Previous Topic: Windows Cert store with Upp::HttpRequest and Core/SSL
Next Topic: Macbook pro: what to buy?
Goto Forum:
  


Current Time: Thu Mar 28 14:11:29 CET 2024

Total time taken to generate the page: 0.01617 seconds