c++/6030: ...

Nathanael Nerode neroden@twcny.rr.com
Mon Jan 13 05:17:00 GMT 2003


I'm a little confused by all this, but note that the following seems to work:
--
#include <utility>
#include <iostream>

using namespace std;

template <typename _T, _T _V>
        void foo()
        {
                cout << __PRETTY_FUNCTION__ << endl;
        }

int a = 0;

int b(void) { cout << __PRETTY_FUNCTION__ << endl; }

typedef int (* blah_fn) (void) ;

int main()
{
        foo<int, 9>();
        foo<blah_fn, b>();
}
--

And so does the following:
--
#include <utility>
#include <iostream>

using namespace std;

template <typename _T, _T _V>
        void foo()
        {
                cout << __PRETTY_FUNCTION__ << endl;
        }

int a = 0;

int b(void) { cout << __PRETTY_FUNCTION__ << endl; }

int main()
{
        foo<int, 9>();
        foo<int (*) (void), b>();
}
--

This seems like a sufficient workaround for most any purpose.  It also works 
if you replace the * by &.

And it leaves me wondering about the validity of the original. :-)



More information about the Gcc-bugs mailing list