BCS:
I like the idea, but how should it interact with overloaded templates?
The syntax/semantics I have shown is just a starting point, there are probably
way better ways to reach the same goal. For example a kind of run-time
error/exception for templates that shows an error message and
Yao G.:
Something I would like to see with template constraints, is the ability to
show text messages, like when static if is used.
This is a problem I too have.
In D1 I used to write code like:
template Foo(T) {
static assert(condition1, error message1);
static assert(condition2, error
Hello bearophile,
A syntax like the following allows to add the user-defined error
messages too, but it's bad looking, so probably something quite better
can be invented:
template Foo(T)
if (condition1) else pragma(msg, error message1)
if (condition2) else pragma(msg, error message2) {
}
I