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 » Newbie corner » Order of member initialization
Re: Order of member initialization [message #58895 is a reply to message #58889] Fri, 23 September 2022 00:26 Go to previous messageGo to previous message
peterh is currently offline  peterh
Messages: 108
Registered: November 2018
Location: Germany
Experienced Member
[/quote]

with inherited classes, that's what I thought too (that it proceeded left to right), but I didn't check.

https://en.cppreference.com/w/cpp/language/eval_order

Looks like they call them sequence points and they proceed in order - here's initialization lists:

Quote:

10) In list-initialization, every value computation and side effect of a given initializer clause is sequenced before every value computation and side effect associated with any initializer clause that follows it in the brace-enclosed comma-separated list of initializers.


Oh my god, I am german spoken and this is hard to understand in english.
The DeepL transator, (which is usually very good) makes it completely confused.

I hope this translates to this semantically:
1) A sequence point is a finalizing point where all preceding calculations and initializations are completely processed.
2) An initializer list is strictly evaluated from left to right, and each bracketed,comma separated initializer term ends with a sequencing point.

I hope I am not in error ; (I hope and assume this, because it makes some sense for me)

[Updated on: Fri, 23 September 2022 00:58]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can TheIDE be used in two instances?
Next Topic: Some Questions
Goto Forum:
  


Current Time: Wed May 08 15:02:02 CEST 2024

Total time taken to generate the page: 0.01643 seconds