Unlike C/C++, char is not a numeric type in D; It's a UTF-8 code
point:
import std.traits;
void main()
{
pragma(msg, isNumeric!char); //Prints false
}
Sorry for this lengthy post:
```x.d
void foo (T) ()
{
import std.experimental.checkedint;
alias CT = Checked!(T, Throw);
CT a = CT.min;
CT x;
--x;
CT b = x;
CT c = a / b;
}
void bar (T) ()
{
import std.stdio;
try foo!T ();
catch (Exception e)
writefln
On Thursday, 16 April 2020 at 19:59:57 UTC, Basile B. wrote:
[snip]
And remove the extra assert() BTW... I don't know why this is
accepted.
Thanks, I hadn't realized about approxEqual. I think that
resolves my near-term issue, I would need to play around with
things a little more to be
For future reference, newer dubs (v 1.17 + i think) allow
--compiler=dmd-version for example.
You need to put the exe in your PATH and rename it yourself, but
it recognizes *dmd-* (or *ldc2-* or *gdc-*) all the same so you
can specifiy them.
I was doing that in early versions of my android
On Thursday, 16 April 2020 at 19:56:21 UTC, Basile B. wrote:
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
[...]
`approxEqual` cant work with ranges. If you look at the
signature there is a use of the constructor syntax, e.g const
`T maxRelDiff = T(0x1p-20f)` so when `T` is not a
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote:
In the code below, I multiply some slice by 5 and then check
whether it equals another slice. This fails for mir's
approxEqual because the two are not the same types (yes, I know
that isClose in std.math works). I was trying to convert
On 4/16/20 3:34 PM, Jonathan M Davis wrote:
I_was_ going to suggest just building dub yourself
I already tried that of course ;)
-Steve
On Thursday, April 16, 2020 12:41:14 PM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 4/16/20 2:28 PM, Steven Schveighoffer wrote:
> > OK, I thought, just put it in ~/bin, and run it from there. Doesn't
> > work, now it looks in ~/bin (where there is no compiler), and fails.
>
> I
On 4/16/20 2:28 PM, Steven Schveighoffer wrote:
OK, I thought, just put it in ~/bin, and run it from there. Doesn't
work, now it looks in ~/bin (where there is no compiler), and fails.
I wish I could delete this idiotic post.
I had a broken link to a dmd compiler in ~/bin. Removing that now
On Tuesday, 14 April 2020 at 17:51:58 UTC, Robert M. Münch wrote:
I use a C libary and created D imports with dstep. It
translates the C structs to D structs.
When I now use them, everything compiles fine but I get an
unresolved external error:
WindowsApp1.obj : error LNK2019: unresolved
I'm running into an issue where I need to run an old compiler to build
something, but the dub installation included with that compiler seems to
have an infinite loop problem. So I want to run a standalone version of
dub, but whatever compiler is selected with my path. Problem is, when I
run
On Thursday, 16 April 2020 at 12:45:21 UTC, kinke wrote:
On Thursday, 16 April 2020 at 10:04:54 UTC, Basile B. wrote:
Just got it to work using
"libs" : [
"druntime-ldc",
"phobos2-ldc"
]
$ ldc2 -help | grep -- -link-defaultlib-shared
--link-defaultlib-shared -
On Thursday, 16 April 2020 at 10:04:54 UTC, Basile B. wrote:
Just got it to work using
"libs" : [
"druntime-ldc",
"phobos2-ldc"
]
$ ldc2 -help | grep -- -link-defaultlib-shared
--link-defaultlib-shared - Link with shared
versions of default libraries. Defaults to
On 4/16/20 5:20 AM, Robert M. Münch wrote:
On 2020-04-15 15:18:43 +, Steven Schveighoffer said:
The difference is you are telling the compiler that it should generate
any symbols for those types. If you just import them, then it's
expecting something else to build those symbols.
Maybe
On Thursday, 16 April 2020 at 09:48:21 UTC, Basile B. wrote:
My dub recipe includes this
"dflags" : [
"bin/libdruntime-ldc.a",
"bin/libphobos2-ldc.a"
]
so that ideally I'll get everything in the library but this
does not work. For example rt_init and rt_term are no visible
in the
My dub recipe includes this
"dflags" : [
"bin/libdruntime-ldc.a",
"bin/libphobos2-ldc.a"
]
so that ideally I'll get everything in the library but this does
not work. For example rt_init and rt_term are no visible in the
exports
$ nm -D libdexed-d.so | grep rt_init
$
and the
On 2020-04-15 15:18:43 +, Steven Schveighoffer said:
The difference is you are telling the compiler that it should generate
any symbols for those types. If you just import them, then it's
expecting something else to build those symbols.
Maybe I'm a bit confused, but that's quite
On Wednesday, 15 April 2020 at 22:09:32 UTC, H. S. Teoh wrote:
On Wed, Apr 15, 2020 at 09:46:58PM +, p.shkadzko via
Digitalmars-d-learn wrote:
[...]
Are you sure the error is on the line you indicated? The error
message
claims that your argument types are (double[string], string,
18 matches
Mail list logo