I'm very new to D, coming from C++ I'm missing parameter pack
expansion and fold expressions.
For example, I want to write a function `f(x[0], ..., x[n])`
which accepts any number of objects and calls `g(x[0].member,
..., x[n].member)`.
In C++, I would write this:
template
void f(X
On Thursday, 30 May 2019 at 20:34:18 UTC, Adam D. Ruppe wrote:
Foo foo;
test(foo.tupleof); // works!
This is really neat! I will definitely use this in the future.
import std.meta;
then staticMap is like what your myMap thing was.
On Thursday, 30 May 2019 at 20:55:00 UTC, Q. Schroll wrote:
If it would be implemented, you could place your parameter pack
into a Tuple-like structure with an opDispatch that returns
such a Tuple again, but the contents would be the member
components "projection" to the member. It's
On 30.05.19 22:20, Tomas wrote:
Surely, there has to be a
standard function which does exactly(probably better) the same thing as
what `myMap` does.
Nope.
On Thursday, 30 May 2019 at 20:20:47 UTC, Tomas wrote:
I'm very new to D, coming from C++ I'm missing parameter pack
expansion and fold expressions.
I also miss the expansion operator and fold expressions.
In D, there is no such thing, and simulating it in a general way
has so much friction,
On Thursday, 30 May 2019 at 20:20:47 UTC, Tomas wrote:
How do I do something like this in D?
D's built-in tuples expand automatically when they are used.
Library tuples (from phobos std.typecons) have a `.expand` method
you can use.
Fun fact: all structs also have a `.tupleof` thing that
widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol
"_D6object__T10RTInfoImplVAmA2i48i57ZQyyG2m".
widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol
"_D6object__T10RTInfoImplVAmA2i32i14ZQyyG2m".
immutable(ulong[2]) object.RTInfoImpl!([48, 57]).RTInfoImpl
On 2019-05-30 16:06:48 +, KnightMare said:
immutable(ulong[2]) object.RTInfoImpl!([48, 57]).RTInfoImpl
immutable(ulong[2]) object.RTInfoImpl!([32, 14]).RTInfoImpl
through
writeln( demangle("_D6object__T10RTInfoImplVAmA2i48i57ZQyyG2m"));
writeln(
On 2019-05-30 15:36:53 +, Robert M. Münch said:
I updated to the latest DMD compiler and just re-compiled a project and
now I get two unresolved external errors:
widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol
"_D6object__T10RTInfoImplVAmA2i48i57ZQyyG2m".
widgets.obj :
I updated to the latest DMD compiler and just re-compiled a project and
now I get two unresolved external errors:
widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol
"_D6object__T10RTInfoImplVAmA2i48i57ZQyyG2m".
widgets.obj : error LNK2001: Nicht aufgelöstes externes Symbol
On Thursday, 30 May 2019 at 16:45:45 UTC, Robert M. Münch wrote:
Is there a best practice how I can use a fork if mine of a
project that can be access via "dependencies": {...} so that my
own code is used?
I think that would make it pretty easy to switch between
different versions.
Github
I have myClass and I want to add a way where I can provide a delegate
to iterate over myClass.objects when a member function put(...) of
myClass is called. The idea is that a user of myClass can provide
something like an "iterator filter" so that the function is only called
on a subset of
Is there a best practice how I can use a fork if mine of a project that
can be access via "dependencies": {...} so that my own code is used?
I think that would make it pretty easy to switch between different versions.
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
On 5/30/19 12:45 PM, Robert M. Münch wrote:
Is there a best practice how I can use a fork if mine of a project that
can be access via "dependencies": {...} so that my own code is used?
I think that would make it pretty easy to switch between different
versions.
You can dub add-local your
14 matches
Mail list logo