Jonathan M Davis wrote:
> A clearer way to create such template constraints would definitely be nice.
> But
> aside from the fact that I'd absolutely hate to see interfaces be conflated
> with
> template constraints in this manner, you'd need a way to deal with the fact
> that
> the parameters and return types for such functions are frequently dependent
> on
> the type that the template is being instantiated with. A concept as you
> describe
> it would have to somehow take templated types into account in a way that
> interfaces can't. For instance, you could never define an interface which
> defined
> a forward range like isForwardRange!() does because the interface wouldn't be
> properly templatized.
>
Why not?
==============================8<------------------------------
concept FooBar(U)
{
int foo (int);
bool bar (U);
}
template Test(T, U) if (is!(FooBar!U, T)) ...
------------------------------>8==============================
This already works with class and interface templates...
Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]
signature.asc
Description: OpenPGP digital signature
