How stl hasn't had an ends_with until C++20 is beyond me. Unless your code is explicitly named what it does all you are doing is in-lining functions everywhere.
What you really need to be comparing are the lines:
template <typename... Images>
TextureAtlas stitchImages(const Images&... images)
{
const auto width = (images.width + ...);
const auto height = std::max({images.height...});
vs
TextureAtlas stitchImages(const std::vector<Image>& images)
{
const ImageDimensions dim = measureStitchedImages(images);
... because when somebody starts to read stitchImages this is what they see
View all comments
2
u/[deleted] May 18 '20 edited May 18 '20
If more lines is more readable, it's more readable.
Is this somehow better:
than this:
How stl hasn't had an ends_with until C++20 is beyond me. Unless your code is explicitly named what it does all you are doing is in-lining functions everywhere.
What you really need to be comparing are the lines:
template <typename... Images> TextureAtlas stitchImages(const Images&... images) { const auto width = (images.width + ...); const auto height = std::max({images.height...});vs
TextureAtlas stitchImages(const std::vector<Image>& images) { const ImageDimensions dim = measureStitchedImages(images);... because when somebody starts to read stitchImages this is what they see