problem with size_t and an easy solution
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Sun Dec 7 18:36:50 PST 2014
On Mon, 08 Dec 2014 02:29:49 +0000
Freddy via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> On Monday, 8 December 2014 at 02:04:58 UTC, ketmar via
> Digitalmars-d wrote:
> > On Mon, 08 Dec 2014 01:50:44 +0000
> > Freddy via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> >
> >> I would like if usize wasn't implictly convertable to uint or
> >> ulong
> > me too, but this change is too radical. it will not break any
> > of my
> > own code ('cause i used to write casts for that stupid 64-bit
> > systems to
> > shut up), but i doubt that other people will agree with such
> > change.
>
> Why not keep size_t implictly convertable but disallow it for
> usize.
'cause there is no such type as `size_t` (and `usize` for that matter).
`size_t` is defined as the alias for the corresponding unsigned
integral type, and so i did with `usize`.
so both `size_t` and `usize` are actually `uint`/`ulong`. so they not
just "convertible", they are the same type.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141208/a0c454d6/attachment.sig>
More information about the Digitalmars-d
mailing list