MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1bcy0u/til_c11_stop_declaring_empty_destructors/c963vbw/?context=3
r/cpp • u/Jonkel • Mar 31 '13
18 comments sorted by
View all comments
14
Especially since visual studios create class
Whooa. So people actually use those things?
That aside, defining empty destructor/constructor is usefull (or required) at times - it can be used to prevent excessive inlining and ensure that you are deleting complete types.
1 u/Jonkel Mar 31 '13 Defining an empty constructor I can definently agree with. I almost always have uses for it later. Setting variables to base values etc.However I had no idea there were other issues with the defaults! When does the issues with ensuring deletion of complete types happen? 3 u/albinofrenchy Apr 01 '13 Setting variables to base values etc.Not sure if you knew this, but you can do this at the declaration now. Makes everything look much cleaner IMHO. 1 u/Jonkel Apr 01 '13 Nice! Definently a feature I've missed. Thanks!
1
Defining an empty constructor I can definently agree with. I almost always have uses for it later. Setting variables to base values etc.
However I had no idea there were other issues with the defaults! When does the issues with ensuring deletion of complete types happen?
3 u/albinofrenchy Apr 01 '13 Setting variables to base values etc.Not sure if you knew this, but you can do this at the declaration now. Makes everything look much cleaner IMHO. 1 u/Jonkel Apr 01 '13 Nice! Definently a feature I've missed. Thanks!
3
Setting variables to base values etc.
Not sure if you knew this, but you can do this at the declaration now. Makes everything look much cleaner IMHO.
1 u/Jonkel Apr 01 '13 Nice! Definently a feature I've missed. Thanks!
Nice! Definently a feature I've missed. Thanks!
14
u/00kyle00 Mar 31 '13
Whooa. So people actually use those things?
That aside, defining empty destructor/constructor is usefull (or required) at times - it can be used to prevent excessive inlining and ensure that you are deleting complete types.