Newsgroup: comp.lang.c++
Subject: Does anyone have a workaround for this gcc4.3 issue?
From: huili80@...
Date: Sun, 15 Dec 2013 12:57:02 -0800 (PST)
Code is as follows. It's legal c++ code, however doesn't compile with g++4.3.
Would really appreciate if anyone has a workaround!! Thanks!
-----------------------------------------------
template < typename T > T& obj();
template < typename T, typename=typeof(obj<T>().memfun()) >
struct test {};
template < typename T > test<T> f(int){}
template <typename> char f(...){}
struct X
{
void memfun(int){};
};
int main()
{
f<X>(0);
}
Subject: Does anyone have a workaround for this gcc4.3 issue?
From: huili80@...
Date: Sun, 15 Dec 2013 12:57:02 -0800 (PST)
Code is as follows. It's legal c++ code, however doesn't compile with g++4.3.
Would really appreciate if anyone has a workaround!! Thanks!
-----------------------------------------------
template < typename T > T& obj();
template < typename T, typename=typeof(obj<T>().memfun()) >
struct test {};
template < typename T > test<T> f(int){}
template <typename> char f(...){}
struct X
{
void memfun(int){};
};
int main()
{
f<X>(0);
}
via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?151634-Does-anyone-have-a-workaround-for-this-gcc4-3-issue&goto=newpost
View all the progranning help forums at:
http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums
No comments:
Post a Comment