This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/6030: ...


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. :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]