On 08/30/2015 10:38 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Monday, August 31, 2015 04:57:05 WhatMeWorry via Digitalmars-d-learn wrote:
This seemingly trivial array initialization has caused me hours
of grief.
enum Purpose { POSITIONAL, COLOR_ONLY, COLOR_AND_ALPHA,
GENERIC_TRIPL
On Monday, August 31, 2015 04:57:05 WhatMeWorry via Digitalmars-d-learn wrote:
>
> This seemingly trivial array initialization has caused me hours
> of grief.
>
> enum Purpose { POSITIONAL, COLOR_ONLY, COLOR_AND_ALPHA,
> GENERIC_TRIPLE, GENERIC_QUAD }
> Purpose purpose;
>
> struct Chameleon(T, Purp
On Monday, August 31, 2015 01:31:58 Yuxuan Shui via Digitalmars-d-learn wrote:
> Why is reduce defined as 'auto reduce(S, R)(S seed, R r)',
> instead of reduce(R r, S seed)? I can't chain it.
>
> Maybe provide both?
The reasons why the seed is first are historical. It predates UFCS being
added to
This seemingly trivial array initialization has caused me hours
of grief.
enum Purpose { POSITIONAL, COLOR_ONLY, COLOR_AND_ALPHA,
GENERIC_TRIPLE, GENERIC_QUAD }
Purpose purpose;
struct Chameleon(T, Purpose p) // template
{
static if (is (p == POSITIONAL)) {
T x, y, z;
} el
can someone explain a bit how the @before hooks works in detail,
i mainly have problems understanding why ensureAuth in belows
example refers to
"SampleService." as an instance:
https://github.com/rejectedsoftware/vibe.d/blob/a1efc05c09135ca8aca21ccec72790ddfaca67c9/examples/web/source/app.d#
Why is reduce defined as 'auto reduce(S, R)(S seed, R r)',
instead of reduce(R r, S seed)? I can't chain it.
Maybe provide both?
On Saturday, 29 August 2015 at 12:56:08 UTC, cym13 wrote:
Hi,
Let's say I have a simple binary file whose structure is
well-known. Here is
an example which stores points:
struct Point {
long x;
long y;
long z;
}
struct BinFile {
uintmagicNumber; // Some identifier
ul
On Sunday, 30 August 2015 at 20:09:25 UTC, Timon Gehr wrote:
On 08/30/2015 07:02 PM, Spacen Jasset wrote:
[...]
import std.math: sqrt;
import std.algorithm: map,sum,canFind;
struct Vector3{
float[3] xyz;
void normalise(){ this/=magnitude(); }
float magnitude(){ return sqrt(xyz[].
On Saturday, August 29, 2015 05:25:33 rumbu via Digitalmars-d-learn wrote:
> On Friday, 28 August 2015 at 23:03:16 UTC, Jonathan M Davis wrote:
>
> >
> > I _really_ wish that Microsoft would just use the TZ database
> > like everyone else...
> >
> > - Jonathan M Davis
>
> Starting with Windows 8.1,
On 08/30/2015 07:02 PM, Spacen Jasset wrote:
I have just added an opDiv to this class, but it doesn't seem to pick it
up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is a Vector3
I can't see why that is, becuase my opMul works in the same place. Can
anyone point out what I have d
On Saturday, 29 August 2015 at 12:56:08 UTC, cym13 wrote:
Hi,
Let's say I have a simple binary file whose structure is
well-known. Here is
an example which stores points:
struct Point {
long x;
long y;
long z;
}
struct BinFile {
uintmagicNumber; // Some identifier
ul
On Sunday, 30 August 2015 at 18:12:40 UTC, BBasile wrote:
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
[...]
try
---
Vector3 opBinary(string op)(Vector3 rhs)
{
static if (op =="/"){}
else static assert(0, op ~ " not implemented");
}
---
you used the char litteral d
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
I have just added an opDiv to this class, but it doesn't seem
to pick it up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is
a Vector3
I can't see why that is, becuase my opMul works in the same
place. Can anyone p
On Sunday 30 August 2015 04:42, Spacen Jasset wrote:
> immutable(ElementEncodingType!(ElementType!Range))[]
> buildPath(Range)(Range segments) if (isInputRange!Range &&
> isSomeString!(ElementType!Range));
> pure nothrow @safe immutable(C)[] buildPath(C)(const(C)[][]
> paths...) if (isSomeChar!C);
On Sunday, 30 August 2015 at 17:02:58 UTC, Spacen Jasset wrote:
I have just added an opDiv to this class, but it doesn't seem
to pick it up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is
a Vector3
I can't see why that is, becuase my opMul works in the same
place. Can anyone p
On Sun, Aug 30, 2015 at 07:36:53AM +, BBasile via Digitalmars-d-learn wrote:
> On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
> >immutable(ElementEncodingType!(ElementType!Range))[]
> >buildPath(Range)(Range segments) if (isInputRange!Range &&
> >isSomeString!(ElementType!Range
I have just added an opDiv to this class, but it doesn't seem to
pick it up.
math/vector.d(30): Error: 'this /= mag' is not a scalar, it is a
Vector3
I can't see why that is, becuase my opMul works in the same
place. Can anyone point out what I have done wrong?
Class Matrix {
void norma
On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
The following reminds me of the good old C++ template errors
the C++ compiler spits out.
Whilst D has fixed that problem, some things have gotten more
complex. I just wanted to find a replacement for D1 path join,
and found this,
On Sunday, 30 August 2015 at 10:42:24 UTC, Spacen Jasset wrote:
On Sunday, 30 August 2015 at 07:36:55 UTC, BBasile wrote:
On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
immutable(ElementEncodingType!(ElementType!Range))[]
buildPath(Range)(Range segments) if (isInputRange!Range
On Sunday, 30 August 2015 at 07:36:55 UTC, BBasile wrote:
On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
immutable(ElementEncodingType!(ElementType!Range))[]
buildPath(Range)(Range segments) if (isInputRange!Range &&
isSomeString!(ElementType!Range));
pure nothrow @safe immutab
On Sunday, 30 August 2015 at 09:55:02 UTC, Dominikus Dittes
Scherkl wrote:
And the constraints you need not read - unless you want to
understand why your call to the function failed. C++ is just
lacking without them. Having them avoids that you always have
to handle ridiculous input within your
On Sunday, 30 August 2015 at 07:36:55 UTC, BBasile wrote:
On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
immutable(ElementEncodingType!(ElementType!Range))[]
buildPath(Range)(Range segments) if (isInputRange!Range &&
isSomeString!(ElementType!Range));
pure nothrow @safe immutab
On Sunday, 30 August 2015 at 00:02:16 UTC, anonymous wrote:
On Saturday, 29 August 2015 at 23:34:47 UTC, Gary Willoughby
wrote:
But it might not be safe:
http://forum.dlang.org/thread/ztefzijqhwrouzlag...@forum.dlang.org
That link just takes me to this thread here again.
Here's the correct l
On Thursday, 27 August 2015 at 22:09:07 UTC, Jordan Wilson wrote:
Hello,
Just wondering why compiling the following fails with the
-debug switch, but appears to compile and execute fine without
it:
import std.stdio;
import std.algorithm;
import std.container;
int main(string[] args) {
A
On Sunday, 30 August 2015 at 02:42:30 UTC, Spacen Jasset wrote:
immutable(ElementEncodingType!(ElementType!Range))[]
buildPath(Range)(Range segments) if (isInputRange!Range &&
isSomeString!(ElementType!Range));
pure nothrow @safe immutable(C)[] buildPath(C)(const(C)[][]
paths...) if (isSomeChar
25 matches
Mail list logo