Boost logo

Boost :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2007-10-24 10:14:25


Markus Schöpflin wrote:
> Peter Dimov wrote:
>> Markus Schöpflin wrote:
>>
>>> Hmm, have a look at this:
>>>
>>> ---%<---
>>> template <class T> struct foo {
>>> void bar() { foobar(); }
>>> };
>>
>> This call to foobar is not dependent on T. Try
>>
>> template <class T> struct foo
>> {
>> void bar( T * p ) { foobar( p ); }
>> };
>
> OK, what about this:
>
> ---%<---
> template <class T> struct foo {
> T *p;
> void bar() { foobar(p); }
> };
>
> void foobar(int *p) {}
>
> void argl() {
> foo<int> f;
> f.bar();
> }
> --->%---
>

I don't think lookup works with built-in types. Try the above with e.g.
"struct bar{};" instead of "int".

/ Johan


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