01777777777777777777777 [std.conv.octal]
Steven Schveighoffer
schveiguy at gmail.com
Thu Apr 7 17:38:54 UTC 2022
On 4/7/22 12:38 PM, Adam Ruppe wrote:
> On Thursday, 7 April 2022 at 16:28:39 UTC, kdevel wrote:
>> That was not my objection. My point is that it won't compile for
>> certain valid octal literals.
>
> They're not actually octal literals.
>
> The implementation is (ridiculously) overcomplicated - ironically, as a
> result of code review nitpicking types - but the concept isn't: it
> *pretends* it is an octal literal. This is a convenience method that is
> not expected to work for all possible values, which is why the string
> one exists.
Yes. In fact, this compiles and is just... not useful.
```d
assert(octal!0b1111001 == octal!0x79);
```
-Steve
More information about the Digitalmars-d
mailing list