|
|
Warp wrote:
> Can you give me a concrete example?
I probably have all the syntax mixed up, and maybe you need to do
something more complicated with friend functions and everything else,
but this is my understanding of what they were talking about in the
paper? Basically, the environment in which X<T> is expanded is
different, so the xyz.xx(4) would promote 4 to a long in main1 and not
main2.
*** A.h
void X<T>(void);
class A {
void xx(long i) {
cout << "Alpha!\n";
}
}
*** X.cpp
void X<T>(void) {
T xyz;
xyz.xx(4);
}
*** Main1.cpp
#include <A.h>
void main1(void) {
X<A>();
}
*** Main2.cpp
#include <A.h>
void A::xx(int i) {
cout << "Beta!\n";
}
void main2(void) {
X<A>();
}
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|