Topic: Value/object representation


Author: maciej@maciejsobczak.com ("Maciej Sobczak")
Date: Thu, 14 Nov 2002 17:50:27 +0000 (UTC)
Raw View
Hi,

On comp.lang.c++.moderated there is an interesting thread running about
possibility to reinterpret int as unsinged int via pointer.
The biggest source of confusion is the difference between value
representation and obejct representation. I understand that it is possible
for the implementation to have fever bits in value representation for
unsigned int than bits in its object representation. For example, 32 bits in
object representation vs. 30 bits in value representation, with traps
waiting in the highest 2 bits.

18.2.1.2 defines numeric_limits members.

Let's say that for the imaginary platform described above

sizeof(unsigned int) * CHAR_BIT == 32

What is the value of

std::numeric_limits<unsigned int>::digits

on the same platform? 32? 30?

My understanding is that numeric_limits<unsigned int>::digits should store
number of bits in VALUE representation (30 in this case), but 18.2.1.2/7 is
not clear about this.

Is this a DR?

Regards,

--
Maciej Sobczak
http://www.maciejsobczak.com/



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]