Boost logo

Boost :

Subject: Re: [boost] Help! Detecting that two template aliases are equal.
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-11-02 20:44:36


On 03/11/12 00:26, Matt Calabrese wrote:

> // In Clang and GCC, the following static_assert will be triggered
> static_assert( templates_are_the_same< template_, template_alias >::value
> , "Templates are not the same."
> );
> ////////////////////
>
> This behavior is observed in both Clang and GCC, though I haven't verified
> that it is correct behavior in the standard.

I believe so.

> Assuming that it is in fact
> standard, can anyone conceive of a way around this limitation? I've
> considered passing dummy arguments to the templates based on the template
> parameter list and checking that the resultant types are equal, but I'd
> like to avoid that if at all possible, since it seems like it would be
> difficult or impossible to support certain templates properly (I.E.
> consider the template parameter list of a template where one parameter type
> is dependent on another, like std::integral_constant). This type of
> detection is very important in making Boost.Generic work as closely to
> N2914 as possible so any workaround, however hairy, would be a huge help.

Since you're working with concepts, couldn't you use archetypes?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk