template & void argument
From: Manuel Maria Diaz Gomez (Manuel.Maria.Diaz.Gomez_at_cern.ch)
Date: 04/29/04
- Next message: lothar: "Samsung CD-R/RW SW 248B problems writing data"
- Previous message: Dave Moore: "Re: template and disambiguation"
- Next in thread: Dave Moore: "Re: template & void argument"
- Reply: Dave Moore: "Re: template & void argument"
- Reply: tom_usenet: "Re: template & void argument"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 12:07:17 +0200
Thanks Victor for your previous answer!
I have the following problem:
I would like to implement an interface class that defines a pure virtual
method that could take any parameter as input, void inlcuded.
The first idea was to use a template, but in that case void is not admited
as a type right?
i.e.
template<typename T>
class A {
virtual do_something(T) = 0;
};
Then, one of the derive classes can't just do :
do_something(){...}
Because the compiler will complain for void not being a type...
Any work-around this?
Cheers
Manuel
-- ======================================================================== Manuel Diaz-Gomez | ATLAS Bldg. 32/SB-008 tel. +41 22 76 76304 CERN EP Division CH-1211 Geneva 23 SWITZERLAND ========================================================================
- Next message: lothar: "Samsung CD-R/RW SW 248B problems writing data"
- Previous message: Dave Moore: "Re: template and disambiguation"
- Next in thread: Dave Moore: "Re: template & void argument"
- Reply: Dave Moore: "Re: template & void argument"
- Reply: tom_usenet: "Re: template & void argument"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|