|
From: William L. (B. B. <bb...@cf...> - 2003-04-14 19:18:15
|
>>>>> On 14 Apr 2003 12:34:52 -0500, Robert McLay <mc...@cf...> said:
Robert> The idea behind TEMPLATE is that it would be 1 in the case of
Robert> angle brackets found in the class definition (e.g Foo<T>
Robert> versus Foo).
Can you also detect a templated function and set $TEMPLATE based on
that? Consider the following:
------------------------------------------------------------------------
template <typename T>
T& func(T t)
{
return t;
}
template <typename T>
class Foo
{
public:
void setA(T t);
private:
T m_a;
};
template <typename T>
void Foo<T>::setA(T t)
{
m_a = t;
}
int main()
{
int a;
float b;
a = func<int>(1);
b = func<float>(1.0);
Foo<int> fi;
Foo<float> ff;
fi.setA(a);
ff.setA(b);
return 0;
}
------------------------------------------------------------------------
ariel(616)$ ~/scratch/traceString-V0.3/traceString --name *.C
func(T t)
Foo<T>::setA(T t)
main()
------------------------------------------------------------------------
Would $TEMPLATE be set for the function on line 1 of the output above?
I think that it should be, but there are no '<>' anywhere in that
list. I understand that this may be hard to implement, but I thought
I'd point it out.
Bill.
P.S. I can't tell if Alfred is on the list yet are not. Let me know
when you are, Alfred, and I'll stop CC'ing you here.
--
Bill Barth | Home: (512) 797-3045
bb...@cf... | Work: (512) 471-4069
Office: WRW 111 | Fax: (512) 232-3357
|