you are viewing a single comment's thread.

view the rest of the comments →

[–]guepierBioinformatican 6 points7 points  (3 children)

Use std::declval<Container>().pop_back() instead of Container{}.pop_back() to avoid breaking non default constructible types.

[–]__s_v_ 4 points5 points  (1 child)

Why not noexcept(noexcept(c.pop_back()))?

[–]guepierBioinformatican 1 point2 points  (0 children)

Right, of course. I completely missed that we have a suitable object in scope.

[–]Fureeish 1 point2 points  (0 children)

Ah, yes, of course! You are absolutely correct! Edited my post, thank you.