Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
(Unwillingly) protect against overloaded comma operators in decltype #1029
It seems that the doc doesn't explicitly ban overloading comma operators. So this PR adds guards against overloaded comma operators by sprinkling void casts.
Here is a (nonsense) test case:
Another options would be: adding a note to the doc that pathological types are not supported.
TL;DR - this is only theoretical.
Formatted output is one of headaches in teaching C++. So I sincerely hope that this great library, fmt, will be adopted in C++20! As for teachability, I'm quite happy that fmt also provides a way to support custom types via
I don't think this code breaks in real-world use cases at all, but...
I'm generally in favor of adding constraints that the type should not have overloaded comma operators; but in this case, the (formal) constraint that we need is not so simple because