Re:When noexcept?
by lmm on Monday December 19, 2016 @09:24AM
(#13211536)
It shouldn't have to be assertions though - you should make it correct by, well, construction. When the fields are RAII the constructor can just initialize them. If your class has different possible states and flags it's usually correct to promote the different states to differnt types (subclasses).
[ Parent
| on HN ]
Re:When noexcept?
by SamReidHughes on Monday December 19, 2016 @08:16PM
(#13216525)
I don't think we're disagreeing about anything. The scope of my comment is in reference to "So how do you protect yourself against inadvertently passing around uninitialized objects?" The answer is, with a run-time error.