>From: "Gennaro Prota" <[EMAIL PROTECTED]> > On Thu, 30 Jan 2003 12:20:32 -0000, "John Maddock" > <[EMAIL PROTECTED]> wrote: > > >> Can you show, with an example, why the code used for named template > >> arguments can't reasonably use an expression? > > > >It doesn't have access to one, only a type: the usage is take some template > >parameter, see if it is convertible to some policy type, and if it is, then > >extract the policy information. > > The technique I know relies on detecting whether the template argument > is *derived* from some policy, and that's doable with expressions.
You don't need expressions (if by that you mean an object of the type to test, or pointer/reference to it) to check for convertibility, as it may be done with sizeof, so no object of any kind need to be created. However, you may need an object, or pointer/reference to it, to use function templates. Also, that won't make it a compile-time expression, so why use function templates for this? Regards, Terje _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost