On Sunday, 16 August 2015 at 02:42:18 UTC, BBasile wrote:
---
enum Ti {tibyte, tiubyte, ...}
Ti getTypeInfo(T)(T t){statif is(t == ubyte) return Ti.tibyte;
else...}
You could also just use D's own run time typeinfo with the
typeid() thing. It returns an instance of class TypeInfo. (This
is w
On Sunday, 16 August 2015 at 01:39:54 UTC, DarthCthulhu wrote:
Say I want to do something like:
Propertery!int pi = 42;
PropertyCollection pc;
pc.attach("Life_and_Everything", pi);
assert(pc.Life_and_Everything == 42);
Property!string ps = "Hello World";
pc.attach("text", ps);
assert(pc.tex
On Sunday, 16 August 2015 at 01:51:36 UTC, Adam D. Ruppe wrote:
On Sunday, 16 August 2015 at 01:39:54 UTC, DarthCthulhu wrote:
How would one store the Property objects in the
PropertyCollection?
You don't, not like that anyway. The attach call is the ruin of
it. If it was all one definition,
On Sunday, 16 August 2015 at 01:39:54 UTC, DarthCthulhu wrote:
How would one store the Property objects in the
PropertyCollection?
You don't, not like that anyway. The attach call is the ruin of
it. If it was all one definition, you could use something like
std.typecons.Tuple, but multiple ca
Say I want to do something like:
Propertery!int pi = 42;
PropertyCollection pc;
pc.attach("Life_and_Everything", pi);
assert(pc.Life_and_Everything == 42);
Property!string ps = "Hello World";
pc.attach("text", ps);
assert(pc.text == "Hello World");
How would one store the Property objects i
On Friday, 14 August 2015 at 15:39:39 UTC, Timon Gehr wrote:
I don't understand. It is evidently fixable. E.g. if TypeInfo
was just a template without the mostly redundant additional
compiler support, this would be a trivial fix.
It appears that this was suggested already after a bit of diggin
On 08/15/2015 04:45 AM, cym13 wrote:
> On Saturday, 15 August 2015 at 11:34:01 UTC, cym13 wrote:
>> On Saturday, 15 August 2015 at 11:25:20 UTC, vladde wrote:
>>> I made a PR to phobos where I modified `std.format.format`.
>>> https://github.com/D-Programming-Language/phobos/pull/3528
>>>
>>> How
On 08/15/2015 09:22 AM, QuizzicalFella wrote:
On Saturday, 15 August 2015 at 15:53:23 UTC, Adam D. Ruppe wrote:
On Saturday, 15 August 2015 at 15:37:42 UTC, QuizzicalFella wrote:
I'd like to be able to call someFunc(TRIANGLE) rather than
someFunc(PolygonT.TRIANGLE).
Two options come to mind:
On Saturday, 15 August 2015 at 19:50:56 UTC, Temtaime wrote:
There's a problem with « dst[0 .. n] = val; ».
It should be « dst[0 .. n][] = val; »
No, you don't need the `[]`.
On Saturday, 15 August 2015 at 18:49:15 UTC, anonymous wrote:
On Saturday, 15 August 2015 at 18:04:30 UTC, D_Learner wrote:
[...]
Those two slices have different lengths (when shift != 0). They
must have equal lengths, and they must not overlap.
[...]
Am now sorted. Thanks, your workout s
There's a problem with « dst[0 .. n] = val; ».
It should be « dst[0 .. n][] = val; »
On Saturday, 15 August 2015 at 18:04:30 UTC, D_Learner wrote:
memcpy(&skip[0], &skip[0]+shift, (m-shift)*(int.sizeof));
memset(&skip[0]+(m-shift),0, shift*(int.sizeof))
I was thinking conversion would be :-
skip[0 .. size-1] = skip[shift .. size-1 ]; //For the
memcpy();
Those
On Saturday, 15 August 2015 at 01:13:02 UTC, Adam D. Ruppe wrote:
On Saturday, 15 August 2015 at 01:09:15 UTC, D_Learner wrote:
When writting a pure fucntion involving C non pure functions
like
memcpy() and memset()
Those functions are pure already, and marked so in the newest
dmd (and I
On Saturday, 15 August 2015 at 15:53:23 UTC, Adam D. Ruppe wrote:
On Saturday, 15 August 2015 at 15:37:42 UTC, QuizzicalFella
wrote:
I'd like to be able to call someFunc(TRIANGLE) rather than
someFunc(PolygonT.TRIANGLE).
Two options come to mind:
alias TRIANGLE = PolygonT.TRIANGLE;
// etc
..
On Saturday, 15 August 2015 at 15:37:42 UTC, QuizzicalFella wrote:
I'd like to be able to call someFunc(TRIANGLE) rather than
someFunc(PolygonT.TRIANGLE).
Two options come to mind:
alias TRIANGLE = PolygonT.TRIANGLE;
// etc
Or at the usage site:
with(PolygonT) {
someFunc(TRIANGLE);
}
I
I have a named enum that I'd like to keep named, that I'd like to
use as a type, but every time I use a member I'd rather not write
out the enum name. I have a situation like the following:
enum PolygonT : byte { TRIANGLE, RECTANGLE, STAR }
void someFunc(PolygonT shape) { //some stuff }
I'd l
On 08/15/2015 01:47 AM, TSalm wrote:
> Must create a ticket for it ?
I think so. Unless others object in 10 minutes... :)
> In the other hand using "string" is not
> efficient since this certainly make a copy of the original string.
Right ?
> This is better to use "replaceInPlace" with "char[
On 08/15/2015 01:54 PM, Timon Gehr wrote:
On 08/15/2015 01:25 PM, vladde wrote:
I made a PR to phobos where I modified `std.format.format`.
https://github.com/D-Programming-Language/phobos/pull/3528
However the auto builder fails, with the error message:
runnable/test23.d(1219): Error: cannot
On 08/15/2015 01:25 PM, vladde wrote:
I made a PR to phobos where I modified `std.format.format`.
https://github.com/D-Programming-Language/phobos/pull/3528
However the auto builder fails, with the error message:
runnable/test23.d(1219): Error: cannot implicitly convert expression
(format("s =
On Saturday, 15 August 2015 at 11:34:01 UTC, cym13 wrote:
On Saturday, 15 August 2015 at 11:25:20 UTC, vladde wrote:
I made a PR to phobos where I modified `std.format.format`.
https://github.com/D-Programming-Language/phobos/pull/3528
However the auto builder fails, with the error message:
ru
On Saturday, 15 August 2015 at 11:25:20 UTC, vladde wrote:
I made a PR to phobos where I modified `std.format.format`.
https://github.com/D-Programming-Language/phobos/pull/3528
However the auto builder fails, with the error message:
runnable/test23.d(1219): Error: cannot implicitly convert
ex
I made a PR to phobos where I modified `std.format.format`.
https://github.com/D-Programming-Language/phobos/pull/3528
However the auto builder fails, with the error message:
runnable/test23.d(1219): Error: cannot implicitly convert
expression (format("s = %s", s)) of type char[] to string
Th
On Saturday, 15 August 2015 at 08:07:43 UTC, Ali Çehreli wrote:
This looks like a bug to me. The template constraints of the
two overloads are pretty complicated. This case should match
only one of them.
Yes I understand. I've used ldc2. With DMD (v0.067.1) the error
is more clear :
inout.d(1
This looks like a bug to me. The template constraints of the two
overloads are pretty complicated. This case should match only one of them.
On 08/15/2015 12:43 AM, TSalm wrote:
> Don't understand why this doesn't work: it compiles fine and runs
> perfectly if I change "char[]" by "string"
You
Hi,
A newbie question :
I wrote this simple code :
import std.array;
import std.stdio;
void main()
{
char[] a = "mon texte 1".dup;
char[] b = "abc".dup;
size_t x = 4;
size_t y = 9;
replaceInPlace( a, x , y, b );
25 matches
Mail list logo