On 08/30/2016 11:28 PM, wobbles wrote:
I'll have to try find a workaround for now :/
This also seems to work, but has a slightly different meaning:
class Node(T, alias func = t => t*t) {/* ... */}
The default func is a template here. Equivalent to this:
auto square(T)(T t) {
On 08/30/2016 11:28 PM, wobbles wrote:
I'll have to try find a workaround for now :/
This seems to work and isn't too ugly:
class Node(T, alias func) {/*...*/}
alias Node(T) = Node!(T, (T t) => t*t);
On Tuesday, 30 August 2016 at 20:55:20 UTC, ag0aep6g wrote:
On 08/30/2016 10:41 PM, wobbles wrote:
class Node(T, alias func = (T t => t*t))(){
//whatever
}
//instantiate
Node!(int) intNode;
Node!(float) floatNode; // fails as lambda func expects an
int.
Am I doing something wrong or is
On 08/30/2016 10:41 PM, wobbles wrote:
class Node(T, alias func = (T t => t*t))(){
//whatever
}
//instantiate
Node!(int) intNode;
Node!(float) floatNode; // fails as lambda func expects an int.
Am I doing something wrong or is this a bug?
Proper test case:
class Node(T, alias func =
On Monday, 29 August 2016 at 20:32:27 UTC, e-y-e wrote:
[...]
Does anyone know of anywhere else I can get help with this error?
It's a blocker on me using vibe.d, which is quite frustrating.
Hi,
Code here:
https://gist.github.com/grogancolin/066a8a8c105fa473dfee961e2481a30e
Basically, it seems when a template has an alias parameter like
class Node(T, alias func = (T t => t*t))(){
//whatever
}
//instantiate
Node!(int) intNode;
Node!(float) floatNode; // fails as lambda func
On 08/30/2016 12:06 PM, Yuxuan Shui wrote:
Is there a way to use a range defined with disabled post-blit in
foreach? In other words, is there a way to prevent foreach from copying
the range?
It's not possible. You can't do much with such a range anyway. For
example, even r.take(10) requires
On 08/30/2016 10:25 AM, WhatMeWorry wrote:
Error: module std.string import 'removeChars' not found, did you mean
template 'removechars(S)(S s, in S pattern) if (isSomeString!S)'?
Shouldn't it be removeChars? All the other library calls seem to be
camelCased. Should i not bother to open a
On Tuesday, 30 August 2016 at 00:57:05 UTC, Meta wrote:
There's a Generator class in std.concurrency. I haven't used
https://dlang.org/phobos/std_concurrency.html#.Generator
Thanks, Meta.
On Tuesday, 30 August 2016 at 19:03:06 UTC, Nordlöw wrote:
https://github.com/nordlow/phobos-next/blob/master/src/dbg.d#L58
Renamed to
https://github.com/nordlow/phobos-next/blob/master/src/dbgio.d#L58
Is there a way to use a range defined with disabled post-blit in
foreach? In other words, is there a way to prevent foreach from
copying the range?
Should I use move()?
On Tuesday, 30 August 2016 at 17:11:48 UTC, Johannes Pfau wrote:
Nice! Here's a slightly modified version:
https://dpaste.dzfl.pl/8c5ec90c5b39
This version does not need an additional delegate. It can be
used like this:
assumeNogc!writefln("foo %s", 42);
assumeNogc!writeln("foo", 42);
Error: module std.string import 'removeChars' not found, did you
mean template 'removechars(S)(S s, in S pattern) if
(isSomeString!S)'?
Shouldn't it be removeChars? All the other library calls seem to
be camelCased. Should i not bother to open a change request
because this would cause too
Am Tue, 30 Aug 2016 16:37:53 +
schrieb Cauterite :
> On Tuesday, 30 August 2016 at 14:38:47 UTC, Nordlöw wrote:
> > Just being able to print a string is not good enough. I want
> > the variadic part writeln so I can debug-print values in my
> > buggy code. Do you have a
On Tuesday, 30 August 2016 at 14:38:47 UTC, Nordlöw wrote:
Just being able to print a string is not good enough. I want
the variadic part writeln so I can debug-print values in my
buggy code. Do you have a similar solution?
Take a look at the example here:
On Tuesday, 30 August 2016 at 11:52:21 UTC, Johannes Pfau wrote:
import std.stdio;
debug
{
enum writelnPtr = !string;
enum void function(string) @nogc writelnNoGC =
cast(void function(string) @nogc)writelnPtr;
}
void main() @nogc
{
debug writelnNoGC("foo");
}
Just being
On Tuesday, 30 August 2016 at 13:33:44 UTC, Nick wrote:
Is it possible to compile from D to C++?
Explanation:
I do some competition programming and would like to write it in
D instead of C++ :)
maybe will help https://wiki.dlang.org/Calypso
Am Tue, 30 Aug 2016 10:26:28 +
schrieb Nordlöw :
> I'm struggling with debug printing in my @nogc-containers.
>
> The alternatives:
>
> assert(false, "Fixed message with no parameters");
>
> is not enough for my needs
>
> debug writeln("Fixed");
>
>
On 30/08/2016 11:10 PM, Nordlöw wrote:
On Tuesday, 30 August 2016 at 10:36:13 UTC, rikki cattermole wrote:
On 30/08/2016 10:26 PM, Nordlöw wrote:
I'm struggling with debug printing in my @nogc-containers.
The alternatives:
assert(false, "Fixed message with no parameters");
is not enough
On Tuesday, 30 August 2016 at 10:36:13 UTC, rikki cattermole
wrote:
On 30/08/2016 10:26 PM, Nordlöw wrote:
I'm struggling with debug printing in my @nogc-containers.
The alternatives:
assert(false, "Fixed message with no parameters");
is not enough for my needs
debug
On 30/08/2016 10:26 PM, Nordlöw wrote:
I'm struggling with debug printing in my @nogc-containers.
The alternatives:
assert(false, "Fixed message with no parameters");
is not enough for my needs
debug writeln("Fixed");
doesn't bypass @nogc checking. Why?
And temporary commenting out
On Tuesday, 30 August 2016 at 10:26:28 UTC, Nordlöw wrote:
I'm struggling with debug printing in my @nogc-containers.
The alternatives:
assert(false, "Fixed message with no parameters");
is not enough for my needs
debug writeln("Fixed");
doesn't bypass @nogc checking. Why?
And
I'm struggling with debug printing in my @nogc-containers.
The alternatives:
assert(false, "Fixed message with no parameters");
is not enough for my needs
debug writeln("Fixed");
doesn't bypass @nogc checking. Why?
And temporary commenting out @nogc is cumbersome.
I'm aware of
On Tuesday, 30 August 2016 at 02:04:55 UTC, kookman wrote:
I need to access the x86_64 RDTSCP assembly instruction from D.
I found this for C++:
http://stackoverflow.com/questions/14783782/which-inline-assembly-code-is-correct-for-rdtscp
Does anyone here know how (if?) I can do this from D?
24 matches
Mail list logo