Re: can't reinterpret_cast to/from the same type

2007-09-09 Thread Jonathan Wakely
On 08/09/2007, Joe Buck [EMAIL PROTECTED] wrote: It still seems odd, and this restriction could make the coding of templates more complex. Agreed, but I'm not sure making reinterpret_cast convenient to use is a noble aim :-) It should be used a last resort, in the knowledge that the result is

Re: can't reinterpret_cast to/from the same type

2007-09-08 Thread Jonathan Wakely
On 06/09/2007, Peter A. Felvegi [EMAIL PROTECTED] wrote: i don't know if it's a bug, please clarify: int y = reinterpret_castint(x); rc.cpp:4: error: invalid cast from type 'int' to type 'int' 5.2.10 in the C++ standard lists the conversions allowed by reinterpret_cast. This is not one

Re: can't reinterpret_cast to/from the same type

2007-09-08 Thread Joe Buck
On Sat, Sep 08, 2007 at 05:51:39PM +0100, Jonathan Wakely wrote: On 06/09/2007, Peter A. Felvegi [EMAIL PROTECTED] wrote: i don't know if it's a bug, please clarify: int y = reinterpret_castint(x); rc.cpp:4: error: invalid cast from type 'int' to type 'int' 5.2.10 in the C++

can't reinterpret_cast to/from the same type

2007-09-06 Thread Peter A. Felvegi
hello, i don't know if it's a bug, please clarify: rc.cpp: --8-- void f() { int x = 0; int y = reinterpret_castint(x); } --8-- gcc -v: Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v