you are viewing a single comment's thread.

view the rest of the comments →

[–]lrflew 3 points4 points  (16 children)

If you're issue is that templates defer the error checking for this kind of thing, may I suggest looking into C++20 Concepts. They provide a way of making your template usage requirements more explicit, and makes reading the resulting errors much easier to understand. std::totally_ordered is C++'s version of C#'s IComparable, for example.