Ian Lance Taylor wrote:
> typedef void (*HandlerFunction)();
> typedef HandlerFunction (*SetHandlerFunction)(HandlerFunction);
>
> template <SetHandlerFunction set_function>
> class HandlerStack {
> public:
> static void defaultHandler();
> };
>
> typedef HandlerStack<std::set_terminate> Terminate;
>
> template<> void Terminate::defaultHandler() {}
> ==================================================
>
> This test case uses a typedef when defining the function
> defaultHandler. Is this code legal? If yes, then what is the
> difference between this and the example above?
Yes, that's valid.
> // PR c++/19244
>
> typedef struct { void f(); } f;
> void f::f() { }
> ==================================================
So's, that.
IIRC, it's specifically the situation where the typedef is nested in
another class. Now, it would sure be useful if I had the standardese to
justify that, wouldn't it? :-) I'll see if I can find it.
--
Mark Mitchell
CodeSourcery, LLC
[EMAIL PROTECTED]
(916) 791-8304