On Wednesday, 25 April 2018 at 03:32:09 UTC, Meta wrote:
On Wednesday, 25 April 2018 at 02:32:32 UTC, Per Nordlöw wrote:
On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin
wrote:
Are people using self assignment of structs as a way of
force-running the postblit? Is there a valid use ca
On Thursday, 30 August 2018 at 16:12:24 UTC, kinke wrote:
Nope, I now think this is more likely an issue with the default
config (etc/ldc2.conf). It contains a new section for
WebAssembly, which specificies `-link-internally`, which seems
to be wrongly used for non-WebAssembly too in your case.
On Thursday, 30 August 2018 at 20:36:02 UTC, kinke wrote:
On Thursday, 30 August 2018 at 19:41:38 UTC, Nordlöw wrote:
I'm using the tar.xz for x64 Linux. Ok?
You're explicitly adding `-link-internally` in your top-level
dub.sdl:
dflags "-link-internally" platform="linux-ldc" # use GNU gold
How does DIP 1000 treat the lifetime scoped class parameters and
containers of classes?
What's the fastest XML-parser on code.dlang.org?
Are there any benchmarks that show performance improvements
compared to std.xml?
I'm want to define a specialization of `append()` that takes only
static arrays as inputs and returns a static array being the sum
of the lengths of the inputs.
Have anybody already implemented this?
If not, I'm specifically interested in how to most conveniently
infer the length (as an enum)
On Monday, 17 July 2017 at 17:46:42 UTC, ag0aep6g wrote:
int[n + m] result = a ~ b;
Further, the expression `a ~ b` here will allocate and create a
copy on the GC-heap before writing `result`.
Maybe LDC optimizes away this now or in the future but DMD cannot.
Yeah I know, kind of dumb b
On Monday, 17 July 2017 at 17:46:42 UTC, ag0aep6g wrote:
Like so?
int[n + m] append(size_t n, size_t m)(int[n] a, int[m] b)
{
int[n + m] result = a ~ b;
return result;
}
Thanks, but I'm talking about the variadic case where the number
of input arguments are unknown (>= 2) where the fu
On Monday, 17 July 2017 at 17:38:23 UTC, Nordlöw wrote:
I'm want to define a specialization of `append()` that takes
only static arrays as inputs and returns a static array being
the sum of the lengths of the inputs.
Have anybody already implemented this?
If not, I'm specifically interested i
On Monday, 17 July 2017 at 18:54:31 UTC, Stefan Koch wrote:
So all you need to do make it so
auto cat(T[]...)(T args)
{
T[] result;
mixin(() {
string mix = `result = `;
foreach(i;args.length)
{
mix ~= `args[` ~ itos(i) ~ `] ~`;
}
mix[$-1] = ';';
On Monday, 17 July 2017 at 18:54:31 UTC, Stefan Koch wrote:
we have special code in the compiler to optimize a ~ b ~ c.
Interesting, can you elaborate on what you mean with "optimize".
In that case, is there a reason why
int x[2];
int y[2];
int z[x.length + y.length] = x ~ y;
isn
On Monday, 17 July 2017 at 19:11:26 UTC, H. S. Teoh wrote:
Hmm, since we already have sumOfLengths available at
compile-time, what about:
T[sumOfLengths!StaticArrays]
append(StaticArrays...)(StaticArrays arrays)
if (allSatisfy!(isStaticArray, StaticArrays))
{
On Monday, 17 July 2017 at 20:10:31 UTC, H. S. Teoh wrote:
On Mon, Jul 17, 2017 at 08:11:03PM +, Nordlöw via
Digitalmars-d-learn wrote: [...]
Does this have a place in Phobos?
Never know till you try. :-D
If so,
- under what name: append, concat or cat?
I'd vote for c
On Monday, 17 July 2017 at 20:53:36 UTC, H. S. Teoh wrote:
See the working implementation in my latest post on this
thread. That version supports CommonType, and works correctly
with empty tuples as well.
T
Thanks.
On Monday, 17 July 2017 at 20:01:41 UTC, H. S. Teoh wrote:
OK, here's an actual, compilable, runnable version:
import std.algorithm : sum;
import std.meta : allSatisfy, staticMap;
import std.range : only;
import std.traits : CommonType, isStaticArray;
ali
On Monday, 17 July 2017 at 20:28:12 UTC, Nordlöw wrote:
Made some adjustments with working unittest and put it up on
https://github.com/nordlow/phobos-next/blob/master/src/algorithm_ex.d#L2467
Moved here
https://github.com/nordlow/phobos-next/blob/master/src/array_ex.d#L2765
On Tuesday, 18 July 2017 at 08:07:45 UTC, Jacob Carlborg wrote:
append - add array or element to existing array
concat (concatenate) - add to arrays (or element) together to
create a new array
Seems like this is a concatenation. But please avoid shortening
the names. I vote you go with "conca
Given the `struct S` with lots of data fields, I've written the
following functional way of initializing only a subset of the
members in an instance of `S`:
struct S
{
int i;
float f;
...
this(int i) { this.i = i; }
S withF(float f)
{
// will this be optimized
Has anybody written a wrapper around `std.file.readText` (or
similar) that appends a final zero-byte terminator in order to
realize sentinel-based search in textual parsers.
Why doesn't appending to `subs` work with std.array.Appender in
struct T
{
string src;
import std.array : Appender;
Appender!(T[]) subs;
}
T t;
t.subs ~= T.init; // ERRORS
t.subs.put(T.init); // ERRORS
when it works with builtin arrays as in
s
On Wednesday, 9 August 2017 at 19:00:54 UTC, Steven Schveighoffer
wrote:
If I change the definition of ElementType to use R.init.front
instead of R.init.front.init, it compiles. But I'm pretty sure
this will break other ranges.
If Phobos compiles with the change would that change deserve a PR?
I recall seeing some C/C++/D code that optimizes the comment- and
whitespace-skipping parts (tokens) of lexers by operating on 2, 4
or 8-byte chunks instead of single-byte chunks. This in the case
when token-terminators are expressed as sets of (alternative)
ASCII-characters.
For instance, wh
Given
enum e = ['a', 'b', 'c'];
import std.meta : AliasSeq;
enum a = AliasSeq!['a', 'b', 'c'];
is it somehow possible to convert (at compile-time) `e` to `a`?
Is it cheaper CT-performance wise to use AliasSeq instead of enum
static arrays?
My use case is expressed by the TODOs in t
On Thursday, 24 August 2017 at 22:38:29 UTC, Meta wrote:
https://dlang.org/phobos/std_meta.html#aliasSeqOf
Thanks!
Your advice led to the following sample solution
import std.meta : aliasSeqOf;
immutable englishIndefiniteArticles = [`a`, `an`];
bool isEnglishIndefiniteArticle(S)(S s)
{
re
On Friday, 25 August 2017 at 08:27:41 UTC, Jacob Carlborg wrote:
Since you're converting the returned index to a bool, can't you
use "canFind" instead?
immutable englishIndefiniteArticles = [`a`, `an`];
bool isEnglishIndefiniteArticle(S)(S s)
{
return englishIndefiniteArticles.canFind(s);
}
On Friday, 25 August 2017 at 09:40:28 UTC, Igor wrote:
As for a nice reference of intel intrinsics:
https://software.intel.com/sites/landingpage/IntrinsicsGuide/
Wow, what a fabulous UX!
On Tuesday, 29 August 2017 at 16:41:48 UTC, Jonathan M Davis
wrote:
Regardless, using assumeUnique or using a pure function to
construct the object and implicitly convert it to immutable
works for types in general.
- Jonathan M Davis
I'm, as always, grateful for your thorough answers, Jonath
Have anybody cooked together high-level bindings on top of the
C-bindings for libreadline here
http://code.dlang.org/packages/readline
?
On Thursday, 7 September 2017 at 13:44:52 UTC, Adam D. Ruppe
wrote:
On Thursday, 7 September 2017 at 13:37:16 UTC, Nordlöw wrote:
Have anybody cooked together high-level bindings on top of the
C-bindings for libreadline here
Have you ever used readline?
The basic C api is already very high le
On Thursday, 7 September 2017 at 16:23:46 UTC, Adam D. Ruppe
wrote:
On Thursday, 7 September 2017 at 16:18:09 UTC, bauss wrote:
Isn't it pointless to make "prompt" in?
No, it promises the function isn't doing anything weird to it
(modify, which immutable covers, but also scope.. .unless dmd
On Thursday, 7 September 2017 at 15:31:13 UTC, Nemanja Boric
wrote:
Minor point: you should add_history only if `lineStringz &&
lineStringz[0] != '\0'`
Wonderful. That prevented a crashs when writing history. Thanks!
On Thursday, 7 September 2017 at 19:45:06 UTC, Adam D. Ruppe
wrote:
On Thursday, 7 September 2017 at 19:38:38 UTC, Nordlöw wrote:
But I believe it's ok to relax it from `string` to
`const(char)[]`, right?
Yeah, it should be const(char)[] or even `in char[]`
Ahh, correct.
When I clone master of
https://github.com/nordlow/phobos-next.git
and test it with DMD 2.076 as
/usr/bin/dub test --compiler=dmd
linking fails as
Generating test runner configuration 'phobos-next-test-library'
for 'library' (library).
Performing "unittest" build using dmd for x86_64.
phobos
On Saturday, 9 September 2017 at 15:41:48 UTC, Nordlöw wrote:
When I compile it separately I don't get the linker error.
/usr/bin/dmd --version: DMD64 D Compiler v2.076.0-dirty
/usr/bin/dub --version: DUB version 1.5.0, built on Sep 1 2017
Making the contents of the module zio.d empty has no
If I have a function like
`extern(C) void f(void *x, size_t x_sz)`
can I instead declare it as
`extern(C) void f(void[] x)`
?
How do I temporarily enable -vgc when building my app with DUB?
I've tried
DFLAGS=-vgc /usr/bin/dub build --build=unittest
but it doesn't seem to have any effect as it doesn't rebuild
directly after the call
/usr/bin/dub build --build=unittest
I'm using DUB version 1.5.0
Or is adding a new
How can
T[n] asStatic(T, size_t n)(T[n] arr)
{
import std.traits : isCopyable;
static if (isCopyable!T)
{
return arr;
}
else
{
static assert(false, "TODO support forwarding of
uncopyable elements");
}
}
be extended to support uncopyable element types
On Sunday, 17 September 2017 at 13:00:04 UTC, Nordlöw wrote:
How can
...
be extended to support uncopyable element types?
That is, when `T` is uncopyable.
On Sunday, 17 September 2017 at 13:00:04 UTC, Nordlöw wrote:
How can
T[n] asStatic(T, size_t n)(T[n] arr)
{
import std.traits : isCopyable;
static if (isCopyable!T)
{
return arr;
}
else
{
static assert(false, "TODO support forwarding of
uncopyable element
On Saturday, 16 September 2017 at 03:30:51 UTC, Joseph wrote:
Are there any simple direct serialization libraries where I can
mark elements of a class or struct that I want serialized with
an attribute and it will take care of all the rest(including
recursive structures, arrays, etc) then deser
When is
__traits(compiles, { ... } )
preferred over
is(typeof( { ... } ))
and vice versa when writing stuff like
enum isCopyable(S) = is(typeof( { S foo = S.init; S copy =
foo; } ));
?
Further, are there cases where the two idioms aren't exchangable?
On Wednesday, 20 September 2017 at 12:20:18 UTC, Stefan Koch
wrote:
Yes there are.
Prefer __traits(compiles) it includes stricter visibility
checks then is() does.
1. Can you give example of such visibility checks?
2. If so, should `isCopyable` (along with more defs in
std.traits) be convert
I've added
buildType "release" {
buildOptions "releaseMode" "optimize" "inline"
dflags-posix-ldc "-flto=thin" "-Xcc=-fuse-ld=gold"
}
to my dub.sdl and built (on Linux) as
/usr/bin/dub -v run --compiler=ldc2 --build=release
but neither the flag "-flto=thin" nor "-Xcc=-fuse
On Saturday, 23 September 2017 at 15:19:09 UTC, Nordlöw wrote:
I've added
buildType "release" {
buildOptions "releaseMode" "optimize" "inline"
dflags-posix-ldc "-flto=thin" "-Xcc=-fuse-ld=gold"
}
to my dub.sdl and built (on Linux) as
/usr/bin/dub -v run --compiler=ldc2 --
On Monday, 25 September 2017 at 07:47:28 UTC, Sebastiaan Koppe
wrote:
Maybe you are looking for
dflags "..." platform="..."
Ahh, you're right.
Thanks!
At
https://github.com/nordlow/phobos-next/blob/03b4736fdd65ef84c6fc583eddee4196629cea81/src/variant_arrays.d
I've implemented a lightweight-polymorphic array container I call
`VariantArrays(Types...)` indexed by a corresponding polymorphic
index I call `VariantIndex(Types...)`.
It uses `.man
On Wednesday, 27 September 2017 at 18:24:04 UTC, Nordlöw wrote:
At ...
Thanks Adam for your advice at
https://stackoverflow.com/questions/46454887/inter-module-symbol-resolution-error-of-template-type-parameter-when-using-mixin?noredirect=1#comment79867792_46454887
I made things work in this
Is implementing opCall(size_t) for structures such as array
containers that already define opIndex and opSlice deprecated?
I can't find any documentation on the subject on when opCall
should be defined to enable foreach (isIterable).
Does anyone have any good reads on the subject of statically
choosing suitable hash-functions depending on the type (and in
turn size) of the key?
I wonder because I'm currently experimenting with a hash set
implementation at
https://github.com/nordlow/phobos-next/blob/40e2973b74d58470a13a5a
Is it currently possible to somehow do @nogc formatted output to
string?
I'm currently using my `pure @nogc nothrow` array-container
`CopyableArray` as
@safe pure /*TODO nothrow @nogc*/ unittest
{
import std.format : formattedWrite;
const x = "42";
alias A = CopyableArray!(char);
Why isn't there an array/range version of `emplace`, when there
is one for `moveEmplace`, namely
https://dlang.org/library/std/algorithm/mutation/move_emplace_all.html
?
Once again I need to pick up Dustmite to track down a DMD and LDC
ICE in release mode for my project. But I can't figure out how
call Dustmite correctly:
When I build https://github.com/nordlow/phobos-next as
/usr/bin/dub build --compiler=dmd --build=release
it prints
Performing "rel
On Tuesday, 10 October 2017 at 19:00:59 UTC, Nordlöw wrote:
Why isn't there an array/range version of `emplace`, when there
is one for `moveEmplace`, namely
Ping!
I can't find any algorithm/range in Phobos that can be used to
split (eagerly or lazily) a sequence using a binary predicate on
adjacent elements as follows
[1,2,3,5,10,11,12,13,20,21,100].splitBy!"a + 1 != b"()
should evaluate to
[[1,2,3], [5], [10,11,12,13], [20,21], [100]]
.
Is there one
On Tuesday, 17 October 2017 at 13:09:18 UTC, Nordlöw wrote:
Is there one?
If not, what should we call it?...yet another overload of
`splitter()` with a binary predicate and only a single parameter
`Range input`?
On Tuesday, 17 October 2017 at 15:47:25 UTC, Andrea Fontana wrote:
More phobos-ized version:
https://run.dlang.io/is/iwgeAl
Thanks!
On Tuesday, 17 October 2017 at 14:15:02 UTC, Andrea Fontana wrote:
auto splitBy(alias F, R)(R range)
Because of lazyness shouldn't it be named something with
splitter, say splitterBy, instead?
On Wednesday, 18 October 2017 at 07:01:19 UTC, Andrea Fontana
wrote:
If you try to use your data with chunkBy!"a != b+1", it does
not work, as expected.
What's the motivation behind this limitation?
Without it
chunkBy!"a + 1 == b"
is exactly what I want.
On Wednesday, 18 October 2017 at 09:32:39 UTC, Jonathan M Davis
wrote:
On Wednesday, October 18, 2017 09:13:47 Per Nordlöw via
Digitalmars-d-learn wrote:
Are there any nearby plans to make more template
instantiations (especially aggregate members) lazy in DMD?
Are there any specific
On Wednesday, 18 October 2017 at 11:04:10 UTC, Biotronic wrote:
On Wednesday, 18 October 2017 at 11:01:56 UTC, Per Nordlöw
wrote:
On Wednesday, 18 October 2017 at 09:01:30 UTC, Per Nordlöw
wrote:
Creates an actor (goroutine, whatever), which spawns 10 new
actors, each of them spawns 10 more act
On Wednesday, 18 October 2017 at 11:52:08 UTC, Biotronic wrote:
It seems to make very little difference in terms of run time,
though. I tried using a mix of these approaches - parallel at
low depth, basically just to fill up the cores, and serial
closer to the leaves. The difference is still ne
On Wednesday, 18 October 2017 at 11:18:31 UTC, Biotronic wrote:
I'm not actually sure why D behaves this way - C++ doesn't. I
guess there is some value as tests - instantiating the type
tests that all its methods compile. Not actually sure that's
more of a positive than a negative, but it's cer
The docs for the third argument to
https://dlang.org/library/core/memory/gc.add_range.html
says:
"The GC might use this information to improve scanning for
pointers or to call finalizers."
Can somebody elaborate a bit on what "improve scanning" means
here?
Shouldn't associative arrays with key types (K) having mutable
indirections (std.traits.hasAliasing!K) such as
string[ubyte[]]
be disallowed?
If not, in what cases do we want this?
What effect does `scope`-qualification have for destructors such
as
~this() @trusted scope;
used here
https://github.com/dlang/dmd/pull/7284/files#diff-da63c10313833b6da044c7e5e3a85c03R67
?
What kinds of intrinsics are explicitly available to the
developer when compiling with LDC?
And are there any docs?
Have anybody used allocators to construct class instances?
Have anybody added logic to Emacs' `comment-dwim` that
automagically inserts a (Ddoc-style) multi-line comment like
/** ...
*/
void foo
{
}
if the cursor is currently in front of a (function) definition
(or declaration)?
I realize that the challenge here is context detection; perhaps
`begi
On Sunday, 12 November 2017 at 12:52:48 UTC, Nordlöw wrote:
Have anybody added logic to Emacs' `comment-dwim` that
automagically inserts a (Ddoc-style) multi-line comment like
Posted also here:
https://stackoverflow.com/questions/47249052/automatic-insertion-of-multiline-declaration-comments
On Sunday, 12 November 2017 at 20:41:03 UTC, Basile B. wrote:
No, the classes and structs of the examples are simply declared
as 'static' because they are located in a 'unittest' block. You
can ignore the keyword...it just means that they are declared
as if they would stand at the global scope.
Are there any plans on a compiler pass that finds scoped
GC-allocations and makes their destructors deterministic similar
to D's struct scope behaviour?
On Thursday, 16 November 2017 at 17:39:02 UTC, Petar Kirov
[ZombineDev] wrote:
https://github.com/ldc-developers/ldc/blob/master/gen/passes/GarbageCollect2Stack.cpp
Does this include GC allocations that don't fit on stack?
I'm looking at
http://vibed.org/api/vibe.core.concurrency/makeIsolated
which is a great idea for safe inter-thread communication.
Are there any more usage examples for vibe's worker tasks that
show how to send instances of `Isolated` to an existing such
worker task via some low-latency (non-l
On Thursday, 23 November 2017 at 10:15:26 UTC, Nordlöw wrote:
I'm looking at
http://vibed.org/api/vibe.core.concurrency/makeIsolated
Further, what does "weakly isolated" mean here
http://vibed.org/api/vibe.core.core/runWorkerTask
?
On Thursday, 23 November 2017 at 10:15:26 UTC, Nordlöw wrote:
I'm looking at
http://vibed.org/api/vibe.core.concurrency/makeIsolated
which is a great idea for safe inter-thread communication.
Are there any more usage examples for vibe's worker tasks that
show how to send instances of `Isolate
If I get the following stack trace ___without line numbers___
(instead ??:?) what's missing?
core.exception.AssertError@src/knet/linking.d(444): Assertion
failure
??:? _d_assertp [0x5092ab19]
??:? pure @safe knet.storage.Edge
knet.linking.dlink!(knet.storage.ZingOf!(knet.stor
In a graph library I'm working on I have the following algorithm
bool hasContext(Node sub,// TODO in
Node sup) nothrow // TODO in
{
Node curr = sub;
while (true)
{
Node ctx = curr.context;
if (!ctx) { break;}
if (ctx is sup)
retu
On Monday, 25 December 2017 at 15:16:55 UTC, ag0aep6g wrote:
https://dlang.org/phobos/std_typecons.html#Rebindable
Thanks.
Why isn't
class X {}
class Y : X {}
X[] xs = cast(X[])(Y[].init);
compilable in safe D?
What's unsafe about such a cast?
How do I check whether an aggregate member function (call for a
specific argument) is @nogc or not?
I want to check whether
Allocator.allocate(1)
(for a any Allocator) is @nogc or not?
Is
https://dlang.org/phobos/std_traits.html#hasFunctionAttributes
the way to do it?
Is there no equivalent of `calloc()` for
`std.experimental.allocator`, something like
Allocator.zeroAllocate(size_t numberOfElements)
?
On Thursday, 11 January 2018 at 21:57:28 UTC, MrSmith wrote:
http://dpldocs.info/experimental-docs/std.experimental.allocator.makeArray.4.html
Thanks!
Given my combined hashmap and hashset container `HashMapOrSet`
defined at
https://github.com/nordlow/phobos-next/blob/master/src/hashmap_or_hashset.d
with deterministic memory management and disabled copy
constructions and a member byElement() defined as
@property auto byElement()()
On Sunday, 14 January 2018 at 14:04:46 UTC, kinke wrote:
That sounds reasonable. For something like `foreach (e;
makeRange().wrapRangeByRef())`, referencing the makeRange()
struct rvalue by pointer in the wrapped range won't work, as
the underlying range lifetime ends with the foreach range
ex
On Sunday, 14 January 2018 at 21:57:37 UTC, Nordlöw wrote:
Note that __trait(isLvalue, this) cannot be used to detect
whether `this` is an l-value or an r-value, which I find
strange.
Shall be
__traits(isRef, this)
Why do I get errors like
template instance remove!((_) => _ == 1) cannot use local
'__lambda5' as parameter to non-global template remove()(in K key)
for
x.remove!(_ => _ == 1);
but not for
x.remove!"a == 11";
?
How are these two lambdas different?
The function `remove` is a temp
On Monday, 15 January 2018 at 15:27:23 UTC, Meta wrote:
void main()
{
auto arr = [1, 2, 3];
arr.remove!(_ => _ == 1);
writeln(arr);
}
Or was that code meant as an example?
The problem occurs when the templated function is a member of the
struct `arr`. I've moved the algorithm into
Why isn't polymorphic down-casts such as in the following pattern
matching on sub-class
class Base {}
class Sub : Base {}
@safe unittest
{
auto base = new Base();
if (auto sub = cast(Sub)base)
{
// use sub
}
}
allowed in safe D?
On Wednesday, 17 January 2018 at 13:19:42 UTC, Nordlöw wrote:
Why isn't polymorphic down-casts such as in the following
pattern matching on sub-class
class Base {}
class Sub : Base {}
@safe unittest
{
auto base = new Base();
if (auto sub = cast(Sub)base)
{
// use sub
}
Why is the memory overhead for a class instance as high as 3
words (24 bytes on 64-bit systems? I find that annoyingly much
for my knowledge database application. I'm aware of extern(C++),
having one word overhead, but such extern(C++)-classes cannot use
all of D; I get compilation errors such
On Wednesday, 24 January 2018 at 21:47:26 UTC, H. S. Teoh wrote:
On Wed, Jan 24, 2018 at 09:48:21PM +, Nordlöw via
Digitalmars-d-learn wrote:
Why is the memory overhead for a class instance as high as 3
words (24 bytes on 64-bit systems? I find that annoyingly much
for my knowledge
I'm struggling with my definition of assumePure that should make
a non-pure function `f` callable as pure `pureF`.
I've copied the definition of assumePure from the Phobos docs at
https://dlang.org/phobos/std_traits.html#SetFunctionAttributes
and managed to define pureF using it but I cannot c
On Saturday, 17 February 2018 at 12:33:25 UTC, Nordlöw wrote:
PureMallocator.instance.allocate(16);
currently errors as
pure_mallocator.d(84,16): Error: pure function
'pure_mallocator.__unittest_pure_mallocator_82_0' cannot access
mutable static data 'instance'
I'm struggling with making
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d
callable in pure functions such as here
https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84
Shouldn't a shared
static shared PureMallocator instance;
make it possi
On Saturday, 17 February 2018 at 12:35:00 UTC, rikki cattermole
wrote:
in pure functions?
pure means no globals. As in none :)
I don't understand.
I thought std.experimental.allocators API was designed to be able
express these needs, @andralex?
On Saturday, 17 February 2018 at 12:35:00 UTC, rikki cattermole
wrote:
in pure functions?
pure means no globals. As in none :)
I guess one solution is to make the member functions in
PureMallocator static and change how the template argument
`Allocator` for a container is used to call these
On Friday, 16 February 2018 at 18:03:40 UTC, Ali Çehreli wrote:
auto pureF = assumePure(&f);
pureF(42);
Ali
Thanks!
On Saturday, 17 February 2018 at 14:54:37 UTC, ag0aep6g wrote:
Nordlöw's methods are only weakly pure. They have mutable
indirections either in the return type or in a parameter type.
So calls to them should not be optimized away.
I found a solution at
https://github.com/nordlow/phobos-next/b
I'm currently developing a combined HashMap and HashSet with open
addressing at
https://github.com/nordlow/phobos-next/blob/master/src/open_hashmap_or_hashset.d
with probing using steps of triangular numbers when length is a
power of two at
https://github.com/nordlow/phobos-next/blob/master/
Is `cast(void*)size_t.max` always an invalid address?
Is so, could it be used to indicate removed/delete elements in
hash tables with open addressing and a key type being either a
pointer or class?
And will it work correctly with the GC?
1 - 100 of 865 matches
Mail list logo