On Monday, 19 February 2018 at 07:08:49 UTC, Fra Mecca wrote:
Is there a way to avoid using to! conversion here?
immutable string[] dst = to!(immutable
string[])(array(pipe.readEnd.byLineCopy));
assumeUnique.
immutable string[] dst =
pipe.readEnd.byLineCopy.array.assumeUnique;
On Monday, 19 February 2018 at 07:08:49 UTC, Fra Mecca wrote:
Is there a way to avoid using to! conversion here?
immutable string[] dst = to!(immutable
string[])(array(pipe.readEnd.byLineCopy));
Are you looking for something like assumeUnique [1]?
```
pipe.readEnd.byLineCopy.array.assumeUniq
Is there a way to avoid using to! conversion here?
immutable string[] dst = to!(immutable
string[])(array(pipe.readEnd.byLineCopy));
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote:
I´m experimenting with threads and related recently.
(i´m just started so may be some terrrible mistakes here)
With this base work:
foreach(i ; 0 .. SIZE)
{
results[i] = values1[i] * values2[i];
}
and then with this 3 others met
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote:
I´m experimenting with threads and related recently.
(i´m just started so may be some terrrible mistakes here)
With this base work:
foreach(i ; 0 .. SIZE)
{
results[i] = values1[i] * values2[i];
}
and then with this 3 others met
On Sunday, 18 February 2018 at 15:23:14 UTC, Cym13 wrote:
On Sunday, 18 February 2018 at 14:48:59 UTC, Cym13 wrote:
[...]
Just thought of a much better/simpler solution for that last
case that also doesn't force you to read all data (which might
be impossible when dealing with infinite range
On Monday, 19 February 2018 at 00:42:05 UTC, aliak wrote:
struct B(T) {
T t;
A a;
alias a this;
auto opDispatch(string name)() if (hasMember!(T, name)) {
return mixin("t." ~ name);
Did you perhaps mean `A` instead of `T` here? cuz in your code T
is int, not the struct.
I have a scenario where I'm wrapping functionality for a type,
but only if the contained type has a member. I want those to take
precedence. If the member is not there, then I want to delegate
to an aliases type via alias this.
I get an error here when I call b.p. Even though property p is in
On Sunday, February 18, 2018 19:10:02 Tofu Ninja via Digitalmars-d-learn
wrote:
> What is __traits(isFuture)? The language documents says it tests
> for @future which doesn't really help as @future is undocumented.
https://github.com/dlang/DIPs/blob/master/DIPs/DIP1007.md
- Jonathan M Davis
What is __traits(isFuture)? The language documents says it tests
for @future which doesn't really help as @future is undocumented.
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote:
I´m experimenting with threads and related recently.
(i´m just started so may be some terrrible mistakes here)
With this base work:
foreach(i ; 0 .. SIZE)
{
results[i] = values1[i] * values2[i];
}
and then with this 3 others met
I´m experimenting with threads and related recently.
(i´m just started so may be some terrrible mistakes here)
With this base work:
foreach(i ; 0 .. SIZE)
{
results[i] = values1[i] * values2[i];
}
and then with this 3 others methods: parallel, spawn and Threads.
this was my results:
_base
Thanks for all the insights :)
On Sunday, 18 February 2018 at 14:48:59 UTC, Cym13 wrote:
[...]
Just thought of a much better/simpler solution for that last case
that also doesn't force you to read all data (which might be
impossible when dealing with infinite ranges):
import std.range;
import std.algorithm;
On Sunday, 18 February 2018 at 14:52:37 UTC, Tony wrote:
At
https://dlang.org/library/std/traits/is_boolean.html
it has:
enum isBoolean(T) = is(BooleanTypeOf!T) && !isAggregateType!T;
per:
https://dlang.org/library/std/traits/is_aggregate_type.html
isAggregateType is true for [struct, union,
At
https://dlang.org/library/std/traits/is_boolean.html
it has:
enum isBoolean(T) = is(BooleanTypeOf!T) && !isAggregateType!T;
per:
https://dlang.org/library/std/traits/is_aggregate_type.html
isAggregateType is true for [struct, union, class, interface].
So BooleanTypeOf!T is true for struct
On Sunday, 18 February 2018 at 13:08:09 UTC, thorstein wrote:
On Sunday, 18 February 2018 at 12:51:04 UTC, thorstein wrote:
// Solution 1
foreach(row; arr)
{ foreach(col; row)
{ col[] *= skalar;
}
}
return arr;
// Solution 2
import std.array;
return array(arr.map!(b => array(b[].map!(c =>
On Sunday, 18 February 2018 at 11:55:37 UTC, Vino wrote:
Hi All,
Request your help on printing the all index of an array
element , eg; the below code prints the index of the string
"Test2" as [1], but the string "Test2" is present 2 times at
index 1 and 4, so how do I print all the index
On Saturday, 17 February 2018 at 13:47:28 UTC, meppl wrote:
On Saturday, 17 February 2018 at 07:58:40 UTC, ANtlord wrote:
...
...
sadly I have no good idea how to name the title of that issue :/
I looked at it again and came up with a title name:
https://issues.dlang.org/show_bug.cgi?id=184
On Sunday, 18 February 2018 at 12:51:04 UTC, thorstein wrote:
Thank you for the very informative answers showing different
gears in D!
However, there are still some details I'm struggling with:
Assume some calculations on a very big numeric array
'double[][][] arr'.
Now we could choose 1 out
Thank you for the very informative answers showing different
gears in D!
However, there are still some details I'm struggling with:
Assume some calculations on a very big numeric array
'double[][][] arr'.
Now we could choose 1 out of 3 different implementations:
// Solution 1
foreach(row; arr
Hi All,
Request your help on printing the all index of an array element
, eg; the below code prints the index of the string "Test2" as
[1], but the string "Test2" is present 2 times at index 1 and
4, so how do I print all the index of a given string.
import std.stdio;
import std.containe
22 matches
Mail list logo