Thread overview
Natural Word Length
Dec 24, 2013
Mike
Dec 24, 2013
Jakob Ovrum
Dec 27, 2013
Marco Leise
Dec 27, 2013
JR
Dec 27, 2013
Timon Gehr
December 24, 2013
Is there a type in D that represents is always the unsigned natural word of the platform?
December 24, 2013
On Tuesday, 24 December 2013 at 08:57:43 UTC, Mike wrote:
> Is there a type in D that represents is always the unsigned natural word of the platform?

Yes, use the type `size_t`.

It is an alias defined in object.d, which is a module part of druntime that is implicitly/automatically imported in all D modules, so `size_t` is available in all D code that uses druntime.

Usually questions like this are better aimed at the D.learn group :)
December 27, 2013
Am Tue, 24 Dec 2013 08:57:41 +0000
schrieb "Mike" <none@none.com>:

> Is there a type in D that represents is always the unsigned natural word of the platform?

alias ℕ = size_t;

ℕ myWord = 123;

-- 
Marco

December 27, 2013
On Friday, 27 December 2013 at 07:25:46 UTC, Marco Leise wrote:
> alias ℕ = size_t;
>
> ℕ myWord = 123;

One part of me thinks that's absolutely beautiful and another part cries out in terror. ;>
December 27, 2013
On 12/27/2013 12:05 PM, JR wrote:
> On Friday, 27 December 2013 at 07:25:46 UTC, Marco Leise wrote:
>> alias ℕ = size_t;
>>
>> ℕ myWord = 123;
>
> One part of me thinks that's absolutely beautiful and another part cries
> out in terror. ;>

size_t is not the type of natural numbers.