Simen kjaeraas:
> void foo(T,U)(const T[] a, U b) if (is(Unqual!T == Unqual!U)) {
> ...
> }
Yes, this was my solution.
My first solution was:
import std.traits: Unqual;
void foo(T)(T[] a, Unqual!T b) {}
void main () {
"asd".foo('s');
}
But it doesn't work, and I don't know if it's supposed to work.
A problem with Unqual is that it strips away too much, so something like this
can be better:
void foo(TA, T)(const TA[] a, T b) if (is(Deconst!TA == Deconst!T)) {}
Bye,
bearophile
