On Monday, 2 January 2017 at 14:38:53 UTC, Nordlöw wrote:
I've tried as many combinations of `return` and `scope` as I
can think of such as
Update:
Qualifying `asStatic` with `@safe pure nothrow @nogc` as
T[length] asStatic(T, size_t length)(T[length] arr)
@safe pure nothrow @nogc
{
r
Why isn't there an overload for `std.algorithm.sorting.sort` that
takes a `unaryFun` lambda?
Something like
x[].sort!"a.m";
sorting elements in `x` according to the value of element member
`m` compared to the longer
x[].sort!"a.m < b.m";
On Friday, 6 January 2017 at 15:36:42 UTC, Nordlöw wrote:
Something like
x[].sort!"a.m";
Perhaps under a different name `sortBy`
x[].sortBy!"a.m";
On Friday, 6 January 2017 at 15:36:42 UTC, Nordlöw wrote:
Why isn't there an overload for `std.algorithm.sorting.sort`
that takes a `unaryFun` lambda?
x[].sort!"a.m < b.m";
Oops,
http://forum.dlang.org/post/nxdsmdimnfssqmeyb...@forum.dlang.org
https://github.com/nordlow/phobos-next/blob/
If taggedPointer!char* allocated on the heap the pointer
On Wednesday, 11 January 2017 at 00:11:47 UTC, Nordlöw wrote:
If taggedPointer!char* allocated on the heap the pointer
A taggedPointer!char* cannot use any tags, eventhough a
heap-allocated pointer clearly has non-byte alignment. Is there a
way around this?
On Wednesday, 11 January 2017 at 01:18:24 UTC, Ali Çehreli wrote:
Ali
Thanks!
On Wednesday, 11 January 2017 at 00:26:27 UTC, Ali Çehreli wrote:
@property char* p() {
Should be
@property inout(char)* p() inout
Thanks!
Is there a way to query at compile-time whether a call to
f(T)(auto ref const T x)
passed the variable `x` from a l-value or r-value?
A call to `isRef!T` inside the function `f` is always `false` for
`l-value` and `r-value` passing.
I need this to detect automatic delayed evaluation of
On Sunday, 15 January 2017 at 14:33:25 UTC, Nordlöw wrote:
Is there a way to query at compile-time whether a call to
Further, overloading such as
struct S { int x, y; }
static f(in S s) {}
static f(const ref S s) {}
f(S.init);
S s;
f(s);
fails as
declaration f is
On Sunday, 15 January 2017 at 17:00:41 UTC, kinke wrote:
On Sunday, 15 January 2017 at 14:33:25 UTC, Nordlöw wrote:
A call to `isRef!T` inside the function `f` is always `false`
for `l-value` and `r-value` passing.
According to
https://dlang.org/spec/template.html#auto-ref-parameters, it
sho
On Sunday, 15 January 2017 at 17:41:36 UTC, Nordlöw wrote:
This
struct S { int x, y; }
void f()(auto ref const S s)
{
pragma(msg, "type:", typeof(s), " isRef:", isRef!s);
}
f(S.init);
S s;
f(s);
prints
type:const(S) isRef:false
type:const(S) isRef:tr
How do I best initialize a D double to an exact mantissa and
exponent representation?
I'm specifically interested in
2^^i for all i in [min_exp, max_exp]
On Tuesday, 17 January 2017 at 16:40:57 UTC, kinke wrote:
If it doesn't have to be D ;), it can be as simple as
`core.stdc.math.ldexp(1, exponent)`. No CTFE though.
Isn't it a simple as
2.0^^exponent
?
On Tuesday, 17 January 2017 at 18:25:46 UTC, kinke wrote:
It should and I looked into that as well, but I didn't like the
implementation as loop:
https://github.com/dlang/phobos/blob/master/std/math.d#L5988
A special case for base x == 2 wouldn't hurt.
That seems strange. Why isn't that a bu
Is there a way to mimic C++-style `mutable` members in D?
On Tuesday, 17 January 2017 at 20:47:35 UTC, ketmar wrote:
Is there a way to mimic C++-style `mutable` members in D?
sure: don't use `const`. otherwise — no, there is simply no way
to «mimic» 'em due to completely different meaning of `const`
in D and C++.
I'm aware of the difference. I'm jus
I can't find nextUp(x) and nextDown(x) described in
https://dlang.org/d-floating-point.html
Are these D1 only? Is there anything like it in D2/Phobos?
On Tuesday, 17 January 2017 at 23:38:46 UTC, Ali Çehreli wrote:
Found'em! :)
https://dlang.org/phobos/std_math.html#.nextUp
Thanks!
What's the easiest way to print a double in maximum precision?
A compilation of
struct T
{
int x;
@disable this(this); // this has no effect on the issue
ref inout(T) memberFun() inout
{
pragma(msg, "memberFun:", __traits(isRef, this) ? "ref" :
"non-ref", " this");
return this;
}
}
void freeFun()(auto ref const T x)
On Thursday, 19 January 2017 at 00:44:51 UTC, Nordlöw wrote:
Any clues on how to retrieve this information?
Another much more common use case:
Chained property setters could be optimized iff the property
setter is called on an r-value, that is when
`__traits(isRef,this)` is `false`
Typ
On Saturday, 28 January 2017 at 00:09:45 UTC, Arun Chandrasekaran
wrote:
Does phobos offer concurrent containers?
I couldn't find one at
http://dlang.org/phobos/std_container.html
Any other in the D land?
You can always search here http://code.dlang.org/
Is there an in-place version of std.uni.toLower()
If not, how do I most elegantly construct one?
I have a project with the tree structure
├── knetquery
└── src
└── knet
├── lectures
├── readers
└── tests
├── linenoise (submodule)
├── linenoise-d (submodule)
│ ...
└── phobos-next (submodule)
...
and a DUB-conversion whoose `dub.json` currently contains
{
On Monday, 10 April 2017 at 12:56:49 UTC, Nordlöw wrote:
I have a project with the tree structure
├── knetquery
Ignore this sub-directory. It's unused.
Further, `dub -v` outputs
Using dub registry url 'http://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for
What's the plan for the recent adding __equal overloads at
https://github.com/dlang/druntime/pull/1808/files
Is it only meant for runtime and phobos to be updated? Or does
user-libraries, such as container libraries, need to be updated
aswell?
Have anybody found a way to do transitive packing of bitfields?
For instance, in
import std.bitmanip : bitfields;
struct X
{
// one bit too many to fit in one byte
mixin(bitfields!(bool, `a`, 1,
bool, `b`, 1,
ubyte, `c`, 7,
I've tagged the ref-returning functions (in this case `opSlice`)
with `return scope` for my statically allocated array struct at
https://github.com/nordlow/phobos-next/blob/master/src/arrayn.d
but for some reason the scope-checking (via -dip1000) allows both
https://github.com/nordlow/phobos-n
On Tuesday, 9 May 2017 at 11:52:35 UTC, Nordlöw wrote:
I've tagged the ref-returning functions (in this case
`opSlice`) with `return scope` for my statically allocated
array struct at
Here's a simpler example
https://github.com/nordlow/phobos-next/blob/cf85f449d24981fbe6269f8096db23282e2fbb65
On Tuesday, 9 May 2017 at 12:25:29 UTC, Nordlöw wrote:
On Tuesday, 9 May 2017 at 11:52:35 UTC, Nordlöw wrote:
I've tagged the ref-returning functions (in this case
`opSlice`) with `return scope` for my statically allocated
array struct at
Here's a simpler example
https://github.com/nordlow/p
On Tuesday, 9 May 2017 at 13:30:49 UTC, Nordlöw wrote:
I'll write a Bugzilla issue later today.
https://issues.dlang.org/show_bug.cgi?id=17388
What's fastest way to on-the-fly-decompress and process a gzipped
csv-fil line by line?
Is it possible to combine
http://dlang.org/phobos/std_zlib.html
with some stream variant of
File(path).byLineFast
?
After having watched Jonathan Blow's talk on Jai
https://www.youtube.com/watch?v=TH9VCN6UkyQ&t=2880s
I realized that we should add his Array-of-Structures (AoS)
concept to Phobos, preferrably in std.typecons.StructArrays, as
something like
template StructArrays(Members...)
{
struct Struc
On Monday, 15 May 2017 at 06:50:04 UTC, Nicholas Wilson wrote:
Yes, https://maikklein.github.io/post/soa-d/
Ok, great. Thanks.
I can't seem to find any Github code repo, tough. Does it exist?
On Monday, 15 May 2017 at 17:10:49 UTC, Per Nordlöw wrote:
On Monday, 15 May 2017 at 07:31:25 UTC, Nordlöw wrote:
On Monday, 15 May 2017 at 06:50:04 UTC, Nicholas Wilson wrote:
Yes, https://maikklein.github.io/post/soa-d/
Ok, great. Thanks.
I can't seem to find any Github code repo, tough. D
Why isn't there a function, say `tempFile()`, in
https://dlang.org/phobos/std_file.html
that creates a temporary _file_ when we already have
https://dlang.org/phobos/std_file.html#tempDir
?
What's the status of atomicity of file-copying and -moving
(renaming) using std.file on different platforms?
On Wednesday, 17 May 2017 at 20:02:44 UTC, Per Nordlöw wrote:
The standard way is to copy the source to a temporary file on
the same file system as the target file followed by hardlinking
Correction: should be renaming.
Here's an implementation in Python (3):
https://github.com/nordlow/conta
On Monday, 15 May 2017 at 19:52:03 UTC, Nordlöw wrote:
soa.d-mixin-143(143,7): Error: variable
soa.SOA!(S).SOA.container0LU cannot be further field because it
will change the determined SOA size
soa.d-mixin-143(143,28): Error: variable
soa.SOA!(S).SOA.container1LU cannot be further field becaus
On Tuesday, 23 May 2017 at 16:46:18 UTC, Nordlöw wrote:
http://forum.dlang.org/post/wvulryummkqtskiwr...@forum.dlang.org
Correction; should be:
https://github.com/nordlow/phobos-next/blob/a324f16515bd1c3c1185ba0482dae2886d811bb1/src/soa.d
My gmp-d tests successfully on Linux as
dub test
but on OS X it fails as
Undefined symbols for architecture x86_64:
"free", referenced from:
...
"malloc", referenced from:
...
Any ideas on why?
https://github.com/nordlow/gmp-d/issues/4#issuecomment-305974761
Why isn't
bool c = a[] == 4;
allowed when
a[] = b[] + 4;
is?
given that
int[] a, b;
I've made an update to version 0.1 at
https://github.com/nordlow/gmp-d/tree/v0.1.
But the version on http://code.dlang.org/packages/gmp-d isn't
bumped to version 0.1 and I can't find a way to change it.
What to do?
On Monday, 26 June 2017 at 08:07:56 UTC, Seb wrote:
The crawler runs every hour. Though you can login and trigger a
manual refresh.
I bumped a couple of days ago so that can't be it. How do I
trigger a manual refresh?
On Monday, 26 June 2017 at 08:07:56 UTC, Seb wrote:
The crawler runs every hour. Though you can login and trigger a
manual refresh.
"Show all versions" doesn't show the latest tag version `v1.0`.
On Monday, 26 June 2017 at 09:37:11 UTC, Basile B. wrote:
Don't worry, it's just your tag that's malformed;
"v1.0" while it should be "v1.0.0"
so... git tag -d v1.0 and add v1.0.0 this time
Thanks.
How do I index an `AliasSeq` with an integer known at run-time?
On Sunday, 14 August 2022 at 10:41:20 UTC, ag0aep6g wrote:
On 14.08.22 12:08, Per Nordlöw wrote:
How do I index an `AliasSeq` with an integer known at run-time?
Thanks
Given shared library `X` depending on other shared libraries
`Ys`, is it possible, using dub, to use extra `dflags` `F` when
building the sources of `X` only and not have those extra flags
`F` be used when (re)compiling `Ys`. In my specific case those
flags are `-fsanitize=address` and `-cov`.
On Sunday, 18 September 2022 at 08:24:27 UTC, Per Nordlöw wrote:
Given shared library `X` depending on other shared libraries
`Ys`, is it possible, using dub, to use extra `dflags` `F` when
building the sources of `X` only and not have those extra flags
`F` be used when (re)compiling `Ys`. In m
In dub, is it possible to override the dflags, in my case `-cov`,
for a single file only without it affecting the rest of the
compiling and linking? Currently, dub enforces static linking of
the dependencies when the `-cov` flag is set via `dflags "-cov"`
in dub.sdl which makes our build fail.
What property of a container (type) `T` enables iteration as
```d
foreach (k, v; T.init)
{
...
}
```
? I thought it sufficed to define `T.byKeyValue` but its presence
seem to have no effect.
On Monday, 24 October 2022 at 20:43:45 UTC, ryuukk_ wrote:
I wish we could do ``version(DebugFast | Release)``
Moreover, I've been using, for instance,
```d
version(D_Coverage) {} else pragma(inline, true);
void foo() {}
```
to get correct coverage inclusion of `foo()`. Is this still neeed?
When is it preferrable to use
```d
struct S { private T t; alias t this; }
```
instead of
```d
struct S { public T t; alias t this; }
```
for any given type `T`?
Have anybody created a wrapper container
```d
struct Sorted(ArrayLike, alias lessThanPred)
```
that wraps an array-like type `ArrayLike` so that it's always
sorted according to the binary predicate `lessThanPred`?
On Monday, 14 November 2022 at 00:29:40 UTC, Tejas wrote:
He said on Discord he want contiguous data structure, rbtree
allocates too much
rbtree has it's uses cases. I wanted a sorted array because I
want to include it in a benchmark suite and study it's time and
space complexity. No applicat
This is what I have so far.
```d
import std.algorithm.mutation : SwapStrategy;
/** Wrapper container around array (slice) or array-like
(container) `A`.
*
* See_Also: https://en.wikipedia.org/wiki/Sorted_array
*/
struct Sorted(A, alias less = "a < b", SwapStrategy ss =
SwapStrategy.unstabl
On Tuesday, 15 November 2022 at 21:03:24 UTC, Per Nordlöw wrote:
This is what I have so far.
Found some issues but still cannot instantiate my solution at
https://github.com/nordlow/phobos-next/blob/master/src/nxt/sorted.d#L15
when I uncomment the line containing
```d
// TODO: completeSort!(
On Tuesday, 15 November 2022 at 22:15:36 UTC, Per Nordlöw wrote:
On Tuesday, 15 November 2022 at 21:03:24 UTC, Per Nordlöw wrote:
This is what I have so far.
Found some issues but still cannot instantiate my solution at
https://github.com/nordlow/phobos-next/blob/master/src/nxt/sorted.d#L15
On Monday, 28 November 2022 at 20:58:43 UTC, Per Nordlöw wrote:
For which types `T` does
```d
__traits(isCopyable, T)
```
differ from
```d
__traits(isPOD, T)
```
?
I'm asking because I have code like
```d
static if (__traits(isCopyable, Element))
insertAt(elemen
On Monday, 28 November 2022 at 22:59:13 UTC, Paul Backus wrote:
Lots of types. For example, types with copy constructors or
destructors are not POD but may still be copyable.
This should be obvious if you read the definition of POD linked
from the language spec: https://dlang.org/glossary.html
On Tuesday, 29 November 2022 at 00:50:54 UTC, Paul Backus wrote:
If your goal is to avoid calling the copy constructor (and, I
assume, to avoid unnecessary instantiations of `move`), then
yeah, `isPOD` is the one you want.
Thanks.
Is there a D lsp-server available? I couldn't find anything at
https://code.dlang.org/search?q=lsp. Am I not using the correct
search terms?
On Monday, 5 December 2022 at 12:23:24 UTC, Per Nordlöw wrote:
Is there a D lsp-server available? I couldn't find anything at
https://code.dlang.org/search?q=lsp. Am I not using the correct
search terms?
Ahh, it's at https://code.dlang.org/packages/serve-d.
On Monday, 5 December 2022 at 12:38:07 UTC, Per Nordlöw wrote:
On Monday, 5 December 2022 at 12:23:24 UTC, Per Nordlöw wrote:
Is there a D lsp-server available? I couldn't find anything at
https://code.dlang.org/search?q=lsp. Am I not using the
correct search terms?
Ahh, it's at https://code.
On Tuesday, 6 December 2022 at 01:48:54 UTC, ryuukk_ wrote:
Have you tried this?
https://github.com/Pure-D/serve-d/blob/master/editor-emacs.md
It should be similar for lsp-mode make sure you provide the
proper parameters
Ok, thanks.
On Tuesday, 13 December 2022 at 11:22:35 UTC, Per Nordlöw wrote:
IRC, the specs says that it's an error to modify a foreach
aggregate but the compiler curretly doesn't diagnose it.
I believe it should.
On Monday, 12 December 2022 at 17:29:00 UTC, Steven Schveighoffer
wrote:
Removing keys while iterating is not supported. It will break,
in confusing ways, and possibly include a null pointer
dereference.
IRC, the specs says that it's an error to modify a foreach
aggregate but the compiler cur
I just tried activating Linux and Windows CI for
https://code.dlang.org/packages/gmp-d
via
https://github.com/nordlow/gmp-d/.github/workflows/d.yml
Linux passes but the Windows builds all fail because `gmp.lib` is
not provisioned in the Windows CI. This is new to me so I need
some initial gu
On Wednesday, 28 April 2021 at 23:04:27 UTC, Christian Köstlin
wrote:
if you configure it yourself, feel free to share the
configuration and maybe PR it to serve-d repo.
Its a little tricky, because the basic setup works e.g. with
emacs 27.2 or newer, but not with 27.1.
All that is needed (if yo
On Wednesday, 19 April 2023 at 09:37:56 UTC, Per Nordlöw wrote:
. Has anybody gotten these things to work?
I'm gonna try `lsp-mode` instead of `eglot`.
On Wednesday, 19 April 2023 at 09:39:19 UTC, Per Nordlöw wrote:
On Wednesday, 19 April 2023 at 09:37:56 UTC, Per Nordlöw wrote:
. Has anybody gotten these things to work?
I'm gonna try `lsp-mode` instead of `eglot`.
I believe this should work
```elisp
(defun serve-d-command ()
"Shell comm
On Wednesday, 19 April 2023 at 10:35:31 UTC, Per Nordlöw wrote:
I believe this should work
```elisp
(defun serve-d-command ()
"Shell command to start serve-d."
'("dub" "run" "--vquiet" "serve-d"))
(when (require 'lsp nil t)
(dolist (mode '(d-mode d-ts-mode))
(add-hook mode #'lsp)
On Wednesday, 19 April 2023 at 10:35:31 UTC, Per Nordlöw wrote:
On Wednesday, 19 April 2023 at 09:39:19 UTC, Per Nordlöw wrote:
On Wednesday, 19 April 2023 at 09:37:56 UTC, Per Nordlöw wrote:
. Has anybody gotten these things to work?
I'm gonna try `lsp-mode` instead of `eglot`.
I believe t
Does anybody know of an autoformatted of SDLang, specifically for
dub.sdl?
On Friday, 6 October 2023 at 13:44:14 UTC, d007 wrote:
I am search for a fast 128bit integer ucent boolfilter, used
for server side duplicate request filter.
Is 128bit boolfilter a doable thing? or it will not work or
will be much more slow compare to 64 bit solution?
Can you describe or gi
How do I make LDC stacktraces like
```test-library(+0x1fb232)[0x562230d82232]
test-library(+0x2a35b7)[0x562230e2a5b7]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f6ad2242520]
test-library(+0x7521a)[0x562230bfc21a]
test-library(+0x79083)[0x562230c00083]
test-library(+0x2a35f5)[0x562230e2a5f5]
tes
On Sunday, 11 February 2024 at 06:43:19 UTC, Per Nordlöw wrote:
How do I make LDC stacktraces like
```test-library(+0x1fb232)[0x562230d82232]
So it turns out that ldc2 doesn't show symbols in stack traces by
default.
IMHO, in debug mode D should adhere to what other languages do.
Meaning a
Why does disabling a struct's postblit increase its sizeof by one
word?
The following holds:
```d
struct S { @disable this(this); int _; }
struct T { int _; }
static assert(S.sizeof == 16);
static assert(T.sizeof == int.sizeof);
```
. Why is this needed?
On Saturday, 2 March 2024 at 19:11:42 UTC, kinke wrote:
Not according to run.dlang.io, for all available DMD versions.
Perhaps your tested `S` was nested in some function/aggregate
and so had an implicit context pointer.
Ahh. Yes. Indeed. My mistake. Thanks.
On Saturday, 2 March 2024 at 19:28:08 UTC, Per Nordlöw wrote:
On Saturday, 2 March 2024 at 19:11:42 UTC, kinke wrote:
Not according to run.dlang.io, for all available DMD versions.
Perhaps your tested `S` was nested in some function/aggregate
and so had an implicit context pointer.
Ahh. Yes.
On Saturday, 2 March 2024 at 19:09:23 UTC, kinke wrote:
On Saturday, 2 March 2024 at 15:22:03 UTC, Per Nordlöw wrote:
How do I at compile-time check whether an aggregate field is
static?
https://dlang.org/phobos/std_traits.html#hasStaticMember
perhaps.
Thanks. Neither my web searches nor Ch
https://github.com/nordlow/phobos-next/releases/tag/v0.6.10
fails to build as
```
../../.dub/cache/phobos-next/0.6.10/code/phobos-next-test-library-unittest-nyN4MEoglVgAJ1A9GyL6uA/dub_test_root.d(11,15):
Error: module `nxt.algorithm.comparsion` from file
src/nxt/algorithm/comparison.d must be
On Saturday, 16 March 2024 at 07:23:09 UTC, Per Nordlöw wrote:
Do you?
Fixed it. There was some invisible character that confused the
compiler.
On Saturday, 16 March 2024 at 07:27:17 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Do you?
``module nxt.algorithm.comparsion;``
comparsion doesn't look much like comparison to me ;)
I know. I'm crushed. Am I getting dislyctic? ;)
I was surprised that the compiler cannot compile
```d
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
```
. Shouldn't it?
On Sunday, 17 March 2024 at 20:38:16 UTC, Per Nordlöw wrote:
I was surprised that the compiler cannot compile
```d
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
```
. Shouldn't it?
Ahh, nevermind. I defined these inside a unittest scope so that's
why it failed. Defining
Is there a reason why
```d
class Base {}
class Derived : Base {}
@safe pure nothrow unittest {
Base b;
Derived d;
b = d; // pass
Base[] bs;
Derived[] ds;
bs ~= ds; // pass
bs = ds; // fail [1], should pass
bs = cast(Base[])ds; // f
On Saturday, 23 March 2024 at 11:04:04 UTC, Dmitry Olshansky
wrote:
The first and second is unsound (infamously allowed in Java).
In the general case, yes. But, do you see any errors with the code
```d
class Base {}
class Derived : Base {}
@safe pure nothrow unittest {
Base b;
Does anybody recognize the error
```
Attribute 'nocapture' does not apply to function return values
%12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull
%10, { i64, ptr } %11) #2, !dbg !7978
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz1
Attribute 'nocaptu
On Thursday, 28 March 2024 at 01:53:52 UTC, Steven Schveighoffer
wrote:
```d
class Base {}
class Derived : Base {}
@safe pure nothrow unittest {
Base b;
Derived d;
b = d; // pass
Base[] bs;
Derived[] ds;
bs ~= ds; // pass
bs = ds; // fail
https://forum.dlang.org/post/cvsajblducyanpqah...@forum.dlang.org
On Monday, 15 May 2017 at 06:44:53 UTC, Nordlöw wrote:
After having watched Jonathan Blow's talk on Jai
https://www.youtube.com/watch?v=TH9VCN6UkyQ&t=2880s
I realized that we should add his Array-of-Structures (AoS)
concept to
On Monday, 26 August 2019 at 09:54:30 UTC, Per Nordlöw wrote:
I have made some significant optimizations with regards to
compilation performance at
https://github.com/nordlow/phobos-next/blob/master/src/soa.d
What is the preferred way to implement to support foreach over
`x` in
struct
Is there still a limitation in the number of symbols DMD/LDC can
handle for a single compilation unit?
Is this limitation target specific and related to a specific
linker?
I have a wrapper container FixedArray at
https://github.com/nordlow/phobos-next/blob/25f4a4ee7347427cebd5cd375c9990b44108d2ef/src/fixed_array.d
on top of a static array store that provides the member
void insertBack(Es...)(Es es) @trusted
if (Es.length <= capacity) // TODO use `isAssign
I want to check whether
auto _ = pred(T.init);
static assert(is(typeof(_) == bool));
compiles or not.
Which one
__traits(compiles, { auto _ = pred(T.init); static
assert(is(typeof(_) == bool)); })
and
is(typeof(pred(T.init)) == bool)
is preferred compilation performance-wi
Why isn't a call to
skipOver(string, string)
nothrow?
I see no reason why it shouldn't be.
Further, this test should be qualifyable as nothrow:
@safe pure /* TODO nothrow @nogc */ unittest
{
import std.algorithm.searching : skipOver;
auto x = "beta version";
assert(x.skipOver(
On Tuesday, 22 October 2019 at 15:39:17 UTC, Adam D. Ruppe wrote:
On Tuesday, 22 October 2019 at 15:33:05 UTC, Per Nordlöw wrote:
Why isn't a call to
skipOver(string, string)
nothrow?
without really looking, probably because of invalid utf
sequences potentially throwing. Using the .repr
On Tuesday, 22 October 2019 at 14:30:32 UTC, lili wrote:
Hi:
In C++20 Concepts is great idear. but I thinks it is too
difficult to write.
I like Rust traits simple and elegancy.
Andrei Alexandrescou's keynote from CppCon 2018 [1] explains why
D's existing template restrictions togeth
401 - 500 of 865 matches
Mail list logo