News for hackers. Stuff that matters.
Re:My favourite C++ footgun by layer8 on Wednesday June 23, 2021 @11:29AM (#27605644)
That doesn’t compose in a class hierarchy, though.
Re:My favourite C++ footgun by remram on Wednesday June 23, 2021 @01:18PM (#27607108)
That's a good point... You might be able to work around that using a template function factory e.g. `make_foobar<ChildrenFooBar>()`. I'm not sure what's a good pattern here, I don't write much C++.
Re:My favourite C++ footgun by gpderetta on Wednesday June 23, 2021 @01:53PM (#27607661)
As long as the every element of the hierarchy is noexcept-movable it still composes. It is just very cumbersome.