+ 1
Why extra object when initialising vector of custom class objects
Hello Please refer code below : When I initialise five object of class without any argument to constructor, it seems ok If I decide to go with parametric constructor for 5 objects, why am I able to observe 6 destructor calls ? https://code.sololearn.com/c0L2B0cdpJ7p/?ref=app
2 Antworten
+ 4
This is weird, where are you observing the 6th call ?
https://code.sololearn.com/c20D8c5993Hd/?ref=app
0
Due to some issue currently at sololearn on mobile app for Android, I cannot check your entire code as still only having first few lines
However I got idea of increasing count for each constructor call.
Doing so also, got the count of constructors as 6 as updated in code. So , still issue of additional constructor call is there..
And I never thought of making member variables as inline... What's the advantage of same ? Only inline functions I have seen earlier but not member variables as inline