Boost logo

Boost Testing :

Subject: Re: [Boost-testing] [VC++10] Could someone please see if this compiles?
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-05-30 21:26:12


On Mon, 31 May 2010, KTC wrote:

> On 31/05/2010 02:14, Jeremiah Willcock wrote:
>> On Mon, 31 May 2010, KTC wrote:
>>
>>> On 31/05/2010 01:58, Jeremiah Willcock wrote:
>>>> Now, trying the old one with just some things renamed (and no
>>>> initializer for x):
>>>>
>>>> <snip>
>>>>
>>>> I think I'll just submit this if it ends up failing.
>>>
>>> Too bad...
>>>
>>> 1>Build succeeded.
>>
>> What about now:
>>
>
> Not enough codes... :D
>
> 1>Build succeeded.

I think I got a couple of template parameters backwards. Could you please
try having each line in main commented in and see which of them make it
fail? There are three declarations for "x" so you can only have one
enabled at a time; is there one of the declarations that by itself causes
the build to fail? If not, does uncommenting the declaration of "member"
make it fail? Thanks for trying these.

template <typename G, typename P>
struct a {};

template <typename G, typename T, typename B>
struct a<G, T B::*> {
   typedef int type;
};

struct c {};

template <typename P, typename R, typename Q>
struct d {};

template <typename P, typename Q, typename T, typename B>
struct a<d<P, c, Q>, T B::*> {
   typedef double type;
};

struct e {
   // float member;
};

int main(int, char**) {
   // a<d<e, c, int>, float e::*>::type** x = (double**)0;
   // a<d<e, c, int>, float e::*>::type** x;
   a<d<e, c, int>, float e::*> x;
   return 0;
}


Boost-testing list run by mbergal at meta-comm.com