Boost logo

Boost :

Subject: Re: [boost] Help! Detecting that two template aliases are equal.
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-11-04 01:43:30


On Fri, Nov 2, 2012 at 7:06 PM, Matt Calabrese <rivorus_at_[hidden]> wrote:
[...]

> Sorry, I should have been more specific. I'm not dealing with the general
> case of any arbitrary template alias, I'm dealing with the special case
> where the template parameters of the underlying template are deducible from
> the template parameters of the alias. In other words, cases similar to
> where template argument deduction works in C++11 when dealing with a
> template alias:
>
> ////////////////////
> // A simple template
> template< class T > struct foo {};
>
> // An alias where the underlying template's
> // parameters are deducible from the alias's
> // template parameters.
> template< class T >
> using foo_alias = foo< T >;
>
> // A function template taking a foo< T >, deduction works
> template< class T >
> void bar( foo< T > );
>
> // The equivalent function written in terms of the alias
> template< class T >
> void bar_alias( foo_alias< T > );
>
[...]

I don't really know what you're trying to do, so this might be a completely
irrelevant suggestion, but can you do something that would take advantage
of, say, ambiguous overloads or ill-defined overloads if you renamed
bar_alias to bar, and maybe add some dummy parameter (e.g., "...")?

- Jeff


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