Jason House wrote:
>   Well, I know that in MSVC simply refuses to use strings as template
> parameters...  If this truly is illegal by the standard, then a string
> template parameter could default to a type for that string.  As far as
> use in other places, maybe use of some keyword as a function.  Like
> maybe struct("foo").

    Both the Standard & MSVC6 allow a (const char*) as a template parameter.
What is rejected (by both) is a text literal parameter.   For a non-type
parameter, the value must be a constant across all translation units linked
together, hence it must be defined extern.

    template <const char* S>   SomeClass { ...};

    SomeClass<"YourParam">   NoGood;

extern const char* MyParam = "MyParam";
    SomeClass<MyParam>    Acceptable;


--
Truth,
James Curran
www.noveltheory.com (personal)
www.njtheater.com (professional)



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to