Conditional Templates

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Jan 29 06:07:17 PST 2007


"Derek Parnell" <derek at nomail.afraid.org> wrote in message 
news:1p0qyzhxblvjj$.xbog5ahy31gi$.dlg at 40tude.net...
> Help! The D documentation makes me seem such a fool.
>
> Here is what I want to do ...
>
> I want to create a template for a single class member method that behaves
> differently depending on the type of the one parameter supplied to the
> method. In other words, if the method is called with a integer type of
> parameter, D should instantiate one form of the member method, and if the
> parameter is a floating point data type, D should instantiate another form
> of the member method, and finally if the parameter is a specific class, D
> should instantiate yet another form of the member method.

I'm probably missing something important, but can't this be done with normal 
function overloading? 




More information about the Digitalmars-d-learn mailing list