Re: std::size_t vs. unsigned int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In most compilers you will find that std::size_t ist just a typedef:

namespace std { typedef unsigned int size_t };

It might even be defined in ISO C99 that size_t is an unsigned int.

And a typedef is silently convertible into its counterpart.

Am Dienstag, 27. Dezember 2005 09:27 schrieb Dima Sorkin:
> Hi.
>  Is the relation between "std::size_t" and "unsigned int" in C++
> architecture dependent ? I always thought that they cannot be
> assigned each to other without static_cast , regardless of
> architecture.
>
> I succeded to assign each to other without warnings on gcc-4.0.0
> (g++ -ansi -pedantic -Wall -Wno-long-long,  Pentium4 - 32bit , fedora core
> 4). I remember that gxx-3.4. (dgpp) gave me errors in such case, a year ago
> (gxx -ansi -pedantic -Wall).
>
> Thank you.
>  Dima.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux