This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6030: ...
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: philippeb at videotron dot ca, gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: Sat, 11 Jan 2003 18:57:18 -0500
- Subject: Re: c++/6030: ...
- Reply-to: neroden at twcny dot rr dot com
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. :-)