On 6/18/21 9:46 AM, Steven Schveighoffer wrote:
On 6/18/21 5:05 AM, Mike Brown wrote:
Hi all,
I would like to convert a D string to an int - im doing this in a
compile time function as well. conv throws an error due to it using
TypeInfo?
How would I do this?
std.conv.to really should
On 6/18/21 5:05 AM, Mike Brown wrote:
Hi all,
I would like to convert a D string to an int - im doing this in a
compile time function as well. conv throws an error due to it using
TypeInfo?
How would I do this?
std.conv.to really should support it, that seems like a bug.
But just FYI,
On 18.06.21 14:40, vit wrote:
Are asserts enough to make method @trusted or is something like throw
exception or return error code necessary?
Asserts are a debugging feature. They're not suitable to ensure safety,
because they're simply skipped in release mode.
`assert(false);` is the
Are asserts enough to make method @trusted or is something like
throw exception or return error code necessary? How it work in
phobos?
Example:
```d
struct Slice(T){
private T[] data;
this(T[] data){
this.data = data;
}
inout(T)[] opSlice()inout scope return
On 6/18/21 12:40 AM, Mathias LANG wrote:
On Thursday, 17 June 2021 at 21:41:28 UTC, Steven Schveighoffer wrote:
A final switch on an enum complains if you don't handle all the enum's
cases. I like this feature.
However, sometimes the data I'm switching on is coming from elsewhere
(i.e. a
On 6/18/21 6:35 AM, Johan wrote:
On Thursday, 17 June 2021 at 21:41:28 UTC, Steven Schveighoffer wrote:
However, sometimes the data I'm switching on is coming from elsewhere
(i.e. a user), and while I want to enforce that the data is valid
(it's one of the enum values), I don't want to crash
On 6/17/21 5:54 PM, H. S. Teoh wrote:
On Thu, Jun 17, 2021 at 05:41:28PM -0400, Steven Schveighoffer via
Digitalmars-d-learn wrote:
[.[..]
Oh, and to throw a monkey wrench in here, the value is a string, not
an integer. So I can't use std.conv.to to verify the enum is valid
(plus, then I'm
On Thursday, 17 June 2021 at 21:41:28 UTC, Steven Schveighoffer
wrote:
However, sometimes the data I'm switching on is coming from
elsewhere (i.e. a user), and while I want to enforce that the
data is valid (it's one of the enum values), I don't want to
crash the program if the incoming
On Friday, 18 June 2021 at 09:05:38 UTC, Mike Brown wrote:
im doing this in a compile time function as well.
If it's a compile time string you can use mixin()
On Friday, 18 June 2021 at 09:05:38 UTC, Mike Brown wrote:
Hi all,
I would like to convert a D string to an int - im doing this in
a compile time function as well. conv throws an error due to it
using TypeInfo?
How would I do this?
Kind regards,
Mike
BetterC has [some CTFE-related
Hi all,
I would like to convert a D string to an int - im doing this in a
compile time function as well. conv throws an error due to it
using TypeInfo?
How would I do this?
Kind regards,
Mike
11 matches
Mail list logo