Partial specialisation: howto? (in the right news group this time. *sigh*)
Jason House
jason.james.house at gmail.com
Sun May 17 07:41:39 PDT 2009
div0 wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thanks Simen,
>
> That's nicer than the chained static ifs.
> Is there anyway to get rid of the enum though?
>
> Using the enum is a pain as it means you have to edit that import
> anytime you need to create a specialistion.
It's nearly impossible to answer your question without knowing what you're
trying to achieve. For example, you're specializing on T... which means
there are more template arguments. Is there anything differentiating the
cases in those? Another candidate is a class hierarchy (or use of an
interface) where createHandlerCode is defined in the base definition, and
each inheriting class overrides the method.
More information about the Digitalmars-d-learn
mailing list