c++.beta - Boost: is_reference
-
Christof Meerwald
(21/21)
Jan 19 2003
#include
- Christof Meerwald (8/28) Jan 20 2003 With DMC 8.33.3 I now also get a "0" for
- gf (10/39) Mar 13 2003 Interesting,
#include <stdio.h> template<typename T> struct is_reference { enum { value = false }; }; template<typename T> struct is_reference<T&> { enum { value = true }; }; int main() { printf("%d\n", is_reference<int>::value); printf("%d\n", is_reference<void (int)>::value); } Compiled with DMC, the output is both times "1" (but I guess it should be 0). Medium-high priority (preferred boost::function syntax depends on it) bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Jan 19 2003
On Sun, 19 Jan 2003 12:52:50 +0000 (UTC), Christof Meerwald wrote:#include <stdio.h> template<typename T> struct is_reference { enum { value = false }; }; template<typename T> struct is_reference<T&> { enum { value = true }; }; int main() { printf("%d\n", is_reference<int>::value); printf("%d\n", is_reference<void (int)>::value); } Compiled with DMC, the output is both times "1" (but I guess it should be 0). Medium-high priority (preferred boost::function syntax depends on it)With DMC 8.33.3 I now also get a "0" for printf("%d\n", is_reference<int &>::value); bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Jan 20 2003
Christof Meerwald <cmeerw web.de> wrote in news:b0h1qp$15qs$1 digitaldaemon.com:On Sun, 19 Jan 2003 12:52:50 +0000 (UTC), Christof Meerwald wrote:Interesting, the output of Borland's C++ builder 5 for the line "printf("%d\n", is_reference<int>::value);" is 0 (zero) but it won't compile the line "printf("%d\n", is_reference<void (int)>::value);". I guess the second line is a typo, right? With "printf("%d\n", is_reference<int &>::value);" Borland's compiler will output 1. /gf#include <stdio.h> template<typename T> struct is_reference { enum { value = false }; }; template<typename T> struct is_reference<T&> { enum { value = true }; }; int main() { printf("%d\n", is_reference<int>::value); printf("%d\n", is_reference<void (int)>::value); } Compiled with DMC, the output is both times "1" (but I guess it should be 0). Medium-high priority (preferred boost::function syntax depends on it)With DMC 8.33.3 I now also get a "0" for printf("%d\n", is_reference<int &>::value); bye, Christof
Mar 13 2003