Re:But I was helping the compiler
by jeffbee on Friday August 21, 2020 @03:49PM
(#24238245)
Depending on what is in the body of the function, I usually prefer to see an output iterator taken as a function parameter, instead of functions returning whole collections. In the article's style the caller is forced to deal with std::array even if that's not suitable at the call site. With an output iterator and a template function the caller gets to pick whatever suits the purpose best. Not having to think about how the output was allocated and deleted is just a bonus of this style.
[ Parent
| on HN ]
There are no comments on this comment yet.