Re: Win Headers

2013-12-12 Thread Mike Parker
On 12/12/2013 4:44 PM, frustrated2 wrote: thanks for your reply. its a shame that the language does not supply ready to use headers. i can live with missing libraries, but not with incomplete or non working bare minimal prerequisites to use it with an os. that is a sad and sorry state! I don't

Re: Win Headers

2013-12-12 Thread bearophile
Mike Parker: I would be content if DMD did not ship Win32 bindings at all, except for the minimal needed to implement cross-platform stuff in Phobos. As it stands, the static libs for the Win32 API that ship with DMD are old and don't include a good number of modern functions anyway. IMO,

Re: File Picker

2013-12-12 Thread Jeremy DeHaan
On Thursday, 12 December 2013 at 03:17:29 UTC, Malkierian wrote: On Tuesday, 10 December 2013 at 03:42:10 UTC, Malkierian wrote: On Tuesday, 10 December 2013 at 02:05:12 UTC, Jeremy DeHaan wrote: On Monday, 9 December 2013 at 16:49:04 UTC, Malkierian wrote: On Monday, 9 December 2013 at

Re: Question about function aliases

2013-12-12 Thread Gary Willoughby
On Thursday, 12 December 2013 at 00:51:56 UTC, dnewbie wrote: On Wednesday, 11 December 2013 at 23:42:44 UTC, Gary Willoughby wrote: For example i have some C code like this: typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp)); void

Re: How to handle nested structs when converting C headers?

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 00:04:07 -, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Dec 12, 2013 at 12:54:58AM +0100, Gary Willoughby wrote: On Wednesday, 11 December 2013 at 23:38:13 UTC, Adam D. Ruppe wrote: On Wednesday, 11 December 2013 at 23:35:04 UTC, Gary Willoughby wrote: static

Re: Win Headers

2013-12-12 Thread Rikki Cattermole
On Wednesday, 11 December 2013 at 09:04:32 UTC, frustrated2 wrote: Are there complete windows headers and if yes where can i find them and will they work for 64bit? I've also generated from Mingw64 windows static binding[1]. So it definitely will work with Windows 7 64bit. However I've only

Re: How to handle nested structs when converting C headers?

2013-12-12 Thread bearophile
Regan Heath: I would stop nesting the struct definition. I think that is both cleaner and closer to the original intent - the only reason it is nested in C is because C allows definition and declaration that way, and D does not. Then you don't need static at all. It's mostly a matter of

Re: Win Headers

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 08:18:51 -, Mike Parker aldac...@gmail.com wrote: On 12/12/2013 4:44 PM, frustrated2 wrote: thanks for your reply. its a shame that the language does not supply ready to use headers. i can live with missing libraries, but not with incomplete or non working bare minimal

Re: Win Headers

2013-12-12 Thread frustrated2
I prefer languages with more batteries included - for sure. its a nice compiler, love the language, but i do not want to waste the time to do everything myself. even basic compilers (yuck) offer more tools, windows programming and db stuff than D. On Thursday, 12 December 2013 at 09:49:31

Re: Question about function aliases

2013-12-12 Thread bearophile
Gary Willoughby: alias void function(ClientData clientData, Tcl_Interp* interp) Tcl_InterpDeleteProc; extern (C) void Tcl_CallWhenDeleted(Tcl_Interp* interp, Tcl_InterpDeleteProc proc, ClientData clientData); With recent D compilers I prefer the alias with = and a more aligned colums

Re: Question about function aliases

2013-12-12 Thread FreeSlave
On Thursday, 12 December 2013 at 11:11:55 UTC, bearophile wrote: Gary Willoughby: alias void function(ClientData clientData, Tcl_Interp* interp) Tcl_InterpDeleteProc; extern (C) void Tcl_CallWhenDeleted(Tcl_Interp* interp, Tcl_InterpDeleteProc proc, ClientData clientData); With recent D

Re: Win Headers

2013-12-12 Thread evilrat
On Thursday, 12 December 2013 at 11:08:41 UTC, Regan Heath wrote: Does DMD support the M$ dll/lib format or is that still an issue? I know there is a conversion tool, but IIRC you have to pay for that.. this hassle was another reason I stopped using D for my personal projects. with -m64

Re: Win Headers

2013-12-12 Thread Mike Parker
On 12/12/2013 8:20 PM, frustrated2 wrote: I prefer languages with more batteries included - for sure. its a nice compiler, love the language, but i do not want to waste the time to do everything myself. even basic compilers (yuck) offer more tools, windows programming and db stuff than D. I

Re: Win Headers

2013-12-12 Thread Mike Parker
On 12/12/2013 8:08 PM, Regan Heath wrote: MinGW distros. Even with VC, you still have to download the Windows SDK separately. I don't believe this last statement is true. I am fairly certain that upon installing VC you have everything you need to call/use Win32 functions. The only reason to

Re: can clone a thread?

2013-12-12 Thread Marco Leise
Am Wed, 11 Dec 2013 11:04:29 +0100 schrieb Gianni Pisetta pisetta.gia...@alice.it: On Wednesday, 11 December 2013 at 08:54:18 UTC, Marco Leise wrote: Am Wed, 11 Dec 2013 09:10:09 +0100 schrieb Gianni Pisetta pisetta.gia...@alice.it: No, i think fork or something similar is the way i

Re: Performance of ranges verses direct

2013-12-12 Thread Marco Leise
Am Wed, 11 Dec 2013 17:40:39 +0100 schrieb Joseph Rushton Wakeling joseph.wakel...@webdrake.net: On 11/12/13 11:10, John Colvin wrote: A lot of the performance loss is down to missed optimisations, in particular inlining. Simple example: foreach(i; iota(0, 10)) { ... } should

Re: Type inference and overloaded functions

2013-12-12 Thread Namespace
I created a separate branch for the syntax Type[$] and auto[$]: https://github.com/Dgame/dmd/commit/438a519d28d1683086083e673b2630a64c269f5f Example: int[$] arr_a1 = [54, 74, 90, 2010]; assert(is(typeof(arr_a1) == int[4])); assert(arr_a1 == [54, 74, 90, 2010]); int[$] arr_a2 = [2010, 90,

Re: Type inference and overloaded functions

2013-12-12 Thread bearophile
Namespace: Sadly I don't know how I could deduce the type of: auto[$] a_arr2 = dyn_arr[4 .. 8]; /// Sadly not possible for me It seems a valid use case. Bye, bearophile

Re: Type inference and overloaded functions

2013-12-12 Thread bearophile
I presume the situation with this code is not changed by your patches: string[3] a = [redgreen,blue]; void main() {} Bye, bearophile

Re: How to handle nested structs when converting C headers?

2013-12-12 Thread Jacob Carlborg
On 2013-12-11 23:45, Gary Willoughby wrote: How to handle nested structs when converting C headers? In the following snippet i'm currently converting, how would you convert the nested typed union and structures? Would you declare them separately then use their types in the Tcl_Obj struct? or is

Re: Type inference and overloaded functions

2013-12-12 Thread bearophile
string[3] a = [redgreen,blue]; void main() {} I suggested to support such incomplete literals only with this extra syntax: int[3] a = [1, 2, ...]; void main() {} Bye, bearophile

A good advertisement for 'static if'

2013-12-12 Thread Craig Dillabaugh
I am not sure if this belongs in D.learn, but it might be of interest. I was writing some C++ code for a project at work and have a class that stores image data from a file. The image data can be in just about any numeric (int/float/complex) type, so I wanted a 'wrapper' class/struct that

Re: Performance of ranges verses direct

2013-12-12 Thread John Colvin
On Wednesday, 11 December 2013 at 16:40:48 UTC, Joseph Rushton Wakeling wrote: [* If I recall right, it's achievable by special-casing iota when the increment is 1, but don't quote me on that.] That shouldn't be necessary if the iota operations are inlined (which, if their not, is a much

Re: Type inference and overloaded functions

2013-12-12 Thread Ali Çehreli
On 12/11/2013 05:09 PM, bearophile wrote: Ali Çehreli: int[] arr2 = [7, 8, 9]s; assert(is(typeof(arr2) == int[3])); That looks very confusing. The left-hand side looks like a slice, which I can append elements to but its type is a static array? No, the type of the literal is

Re: Win Headers

2013-12-12 Thread Regan Heath
On Thu, 12 Dec 2013 12:16:57 -, Mike Parker aldac...@gmail.com wrote: On 12/12/2013 8:08 PM, Regan Heath wrote: MinGW distros. Even with VC, you still have to download the Windows SDK separately. I don't believe this last statement is true. I am fairly certain that upon installing VC

Re: Type inference and overloaded functions

2013-12-12 Thread bearophile
Ali Çehreli: But look at the assertion: the type of the *slice* arr2 is int[3]. :) I didn't notice that. It looks strange... I don't understand it. Bye, bearophile

Re: Type inference and overloaded functions

2013-12-12 Thread Namespace
On Thursday, 12 December 2013 at 15:35:52 UTC, bearophile wrote: Ali Çehreli: But look at the assertion: the type of the *slice* arr2 is int[3]. :) I didn't notice that. It looks strange... I don't understand it. Bye, bearophile I already pointed out why it was that way AND that it's

Ranges: is it ok if front is a data member?

2013-12-12 Thread Adam D. Ruppe
Consider the following: struct JustZeroes { int front = 0; enum bool = false; void popFront() {} } Is that guaranteed to work as an input range? I ask because I've so often written: T current; @property T front() { return current; } that it just seems silly to me to write

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Dicebot
I'd expect http://dlang.org/phobos/std_range.html#.isInputRange to be standard answer to this question (== yes, it is ok).

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread H. S. Teoh
On Thu, Dec 12, 2013 at 05:19:28PM +0100, Adam D. Ruppe wrote: Consider the following: struct JustZeroes { int front = 0; enum bool = false; void popFront() {} } Is that guaranteed to work as an input range? I ask because I've so often written: T current; @property

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread bearophile
Adam D. Ruppe: Consider the following: struct JustZeroes { int front = 0; enum bool = false; void popFront() {} } Is that guaranteed to work as an input range? It seems similar to 0.repeat When you are not sure add a static assert below the range, to verify it is the kind of

updating druntime

2013-12-12 Thread Benji
Hello, when I try to compile something with dmd, I get following message: /usr/include/dmd/phobos/std/bitmanip.d(416): Error: undefined identifier '_xopCmp' Error: ICE: _xopCmp not found in object module. You must update druntime How to 'update druntime' ?

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Ali Çehreli
On 12/12/2013 08:19 AM, Adam D. Ruppe wrote: Consider the following: struct JustZeroes { int front = 0; enum bool = false; You meant empty = false; void popFront() {} } Is that guaranteed to work as an input range? Yes it is perfectly fine. And if it works for empty it

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Joseph Rushton Wakeling
On 12/12/13 17:19, Adam D. Ruppe wrote: Is that guaranteed to work as an input range? I ask because I've so often written: T current; @property T front() { return current; } that it just seems silly to me to write the extra lines when current == front. I realize there is a small

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Joseph Rushton Wakeling
On 12/12/13 17:51, Joseph Rushton Wakeling wrote: Isn't the issue here not whether or not it will work in terms of your type being a range, and more that it means that users can overwrite the value of front? ... if OTOH the idea is that front never changes, then I'd suggest an enum, as is

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Adam D. Ruppe
On Thursday, 12 December 2013 at 16:52:12 UTC, Joseph Rushton Wakeling wrote: and more that it means that users can overwrite the value of front? Yeah, that's what I meant by the lvalue thing, though most the time I don't think it is even that big of a deal if it gets overwritten since the

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Adam D. Ruppe
On Thursday, 12 December 2013 at 16:45:05 UTC, H. S. Teoh wrote: I do this with my own ranges sometimes. Sometimes, it's more performant to precompute the value of .front and store it (as .front) Yeah, that's exactly what I was doing here. My question was mostly on if there's the chance that

Is file.rename() atomic?

2013-12-12 Thread Jacek Furmankiewicz
void rename(in char[] from, in char[] to); Rename file from to to. If the target file exists, it is overwritten. Throws: FileException on error. Just wanted to know if this operation is atomic? or does it depend on the underlying file system? In short, in the file

Re: A good advertisement for 'static if'

2013-12-12 Thread FreeSlave
On Thursday, 12 December 2013 at 14:55:28 UTC, Craig Dillabaugh wrote: I am not sure if this belongs in D.learn, but it might be of interest. I was writing some C++ code for a project at work and have a class that stores image data from a file. The image data can be in just about any numeric

Re: A good advertisement for 'static if'

2013-12-12 Thread FreeSlave
With some improvements you also can provide compile-time error about instantiation of non-specialized function (i.e. which has T as parameter), but I'm not sure what's good way to do it in C++.

Re: Type inference and overloaded functions

2013-12-12 Thread bearophile
Namespace: Your gig: https://github.com/D-Programming-Language/dmd/pull/2952#discussion_r8288045 This is part of the thread there: Furhtermore, what if we indeed want to pass a dynamic array ? Kenji Use cast. In real world, if overloaded function takes both int[] and int[3], normally

Re: updating druntime

2013-12-12 Thread John Colvin
On Thursday, 12 December 2013 at 16:44:28 UTC, Benji wrote: Hello, when I try to compile something with dmd, I get following message: /usr/include/dmd/phobos/std/bitmanip.d(416): Error: undefined identifier '_xopCmp' Error: ICE: _xopCmp not found in object module. You must update druntime

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Jesse Phillips
On Thursday, 12 December 2013 at 16:52:12 UTC, Joseph Rushton Wakeling wrote: On 12/12/13 17:19, Adam D. Ruppe wrote: Is that guaranteed to work as an input range? I ask because I've so often written: T current; @property T front() { return current; } that it just seems silly to me to

Re: Is file.rename() atomic?

2013-12-12 Thread John Colvin
On Thursday, 12 December 2013 at 17:08:13 UTC, Jacek Furmankiewicz wrote: void rename(in char[] from, in char[] to); Rename file from to to. If the target file exists, it is overwritten. Throws: FileException on error. Just wanted to know if this operation is

Re: updating druntime

2013-12-12 Thread Benji
On Thursday, 12 December 2013 at 19:11:03 UTC, John Colvin wrote: On Thursday, 12 December 2013 at 16:44:28 UTC, Benji wrote: Hello, when I try to compile something with dmd, I get following message: /usr/include/dmd/phobos/std/bitmanip.d(416): Error: undefined identifier '_xopCmp' Error:

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread H. S. Teoh
On Thu, Dec 12, 2013 at 08:12:50PM +0100, Jesse Phillips wrote: On Thursday, 12 December 2013 at 16:52:12 UTC, Joseph Rushton Wakeling wrote: On 12/12/13 17:19, Adam D. Ruppe wrote: Is that guaranteed to work as an input range? I ask because I've so often written: T current; @property

Re: Ensuring template argument is descendant of class

2013-12-12 Thread Adam D. Ruppe
On Thursday, 12 December 2013 at 21:51:14 UTC, Ross Hays wrote: if (cast(Asset)T) Try this instead: if(is(T : Asset)) the is thing checks types. You can do is(T == Asset) for the specific class, or is(T : Asset) which means it implicitly converts to it - in otherworts, if T is

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Ali Çehreli
On 12/12/2013 12:06 PM, H. S. Teoh wrote: On Thu, Dec 12, 2013 at 08:12:50PM +0100, Jesse Phillips wrote: On Thursday, 12 December 2013 at 16:52:12 UTC, Joseph Rushton Wakeling wrote: On 12/12/13 17:19, Adam D. Ruppe wrote: Is that guaranteed to work as an input range? I ask because I've so

Re: Ensuring template argument is descendant of class

2013-12-12 Thread Ross Hays
On Thursday, 12 December 2013 at 21:53:20 UTC, Adam D. Ruppe wrote: On Thursday, 12 December 2013 at 21:51:14 UTC, Ross Hays wrote: if (cast(Asset)T) Try this instead: if(is(T : Asset)) the is thing checks types. You can do is(T == Asset) for the specific class, or is(T : Asset)

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Joseph Rushton Wakeling
On 12/12/13 22:55, Ali Çehreli wrote: That condition is what makes a slice an OutputRange, which causes the super confusing state of output range losing elements after put'ting: :) import std.range; void main() { auto s = [ 1, 2, 3 ]; s.put(10); assert(s.length == 2); // PASSES!

Re: Ensuring template argument is descendant of class

2013-12-12 Thread Adam D. Ruppe
On Thursday, 12 December 2013 at 22:05:17 UTC, Ross Hays wrote: http://dlang.org/expression.html#IsExpression and had no idea is could be used with that syntax. The more D I learn the more counter-intuitive I find some aspects of the language syntax. Yeah, the is expression is one of the

Creating a class at a specific address in memory.

2013-12-12 Thread TheFlyingFiddle
What i am looking for is something like the following. class Foo { int a, b, c; } void main() { void[] buffer = new void[1024]; auto foo = createAt!(Foo)(buffer.ptr); } Where the createAt!(Foo) creates a class of the type Foo at the specified pointer.

What is the common way of porting opaque types in C header files?

2013-12-12 Thread Gary Willoughby
I have a lot of opaque types in C headers i'm porting to D. What is the best way to handle these? Would you just use void pointers? In the below example Tcl_AsyncHandler_ is not defined anywhere. C: typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; D: alias void* Tcl_AsyncHandler;

Re: Creating a class at a specific address in memory.

2013-12-12 Thread Brad Anderson
On Thursday, 12 December 2013 at 22:54:26 UTC, TheFlyingFiddle wrote: What i am looking for is something like the following. class Foo { int a, b, c; } void main() { void[] buffer = new void[1024]; auto foo = createAt!(Foo)(buffer.ptr); } Where the createAt!(Foo) creates a class

Re: Creating a class at a specific address in memory.

2013-12-12 Thread TheFlyingFiddle
emplace() is what you are looking for (found inexplicably in std.conv). http://dlang.org/phobos/std_conv.html#.emplace Exactly what i wanted :) Thanks for the quick answer! And yeah... std.conv seems like a wierd place to have this functionallity.

Re: Ensuring template argument is descendant of class

2013-12-12 Thread H. S. Teoh
On Thu, Dec 12, 2013 at 11:23:15PM +0100, Adam D. Ruppe wrote: On Thursday, 12 December 2013 at 22:05:17 UTC, Ross Hays wrote: http://dlang.org/expression.html#IsExpression and had no idea is could be used with that syntax. The more D I learn the more counter-intuitive I find some aspects of

Re: Type inference and overloaded functions

2013-12-12 Thread Namespace
Why don't you discuss on github? And finally I did it: auto[$] a_arr2 = dyn_arr[4 .. 8]; assert(is(typeof(a_arr2) == int[4])); I will make a Pull Request tomorrow. Hope my code isn't that bad. :/

Implementing vector swizzle.

2013-12-12 Thread TheFlyingFiddle
I would like to be able to do this. auto vector = vec4(1,2,3,4); vector.zxy += vec3(4,4,4); I'm currently able to do this: vector.zxy = vec3(4,4,4); Assigns 4 to the x,y and z components. and this auto other = vector.zxy; other is a vector3 with other.x == vector.z other.y == vector.x

Re: What is the common way of porting opaque types in C header files?

2013-12-12 Thread Mike Parker
On 12/13/2013 7:52 AM, Gary Willoughby wrote: I have a lot of opaque types in C headers i'm porting to D. What is the best way to handle these? Would you just use void pointers? In the below example Tcl_AsyncHandler_ is not defined anywhere. C: typedef struct Tcl_AsyncHandler_

Allowing string value with getopt without requiring it

2013-12-12 Thread Ithy
Hello. I'm just getting into D (literally writing my first program), and I can't figure out how to do this with getopt: I want to have the option --log, which will enable logging (set a bool variable to true). However, I want the program to also accept --log=filename to allow the user to

Re: Type inference and overloaded functions

2013-12-12 Thread Kenji Hara
On Thursday, 12 December 2013 at 18:20:25 UTC, bearophile wrote: Namespace: Your gig: https://github.com/D-Programming-Language/dmd/pull/2952#discussion_r8288045 This is part of the thread there: Furhtermore, what if we indeed want to pass a dynamic array ? Kenji Use cast. In real world,

segfault when using std.parallelism and std.process.executeShell

2013-12-12 Thread Nikhil Padmanabhan
Hi, The following code dies with a segfault : import std.stdio, std.parallelism, std.process; void main() { auto a=[hello,world,goodbye]; foreach(s; parallel(a,1)) { auto ls=executeShell(echo ~s); writeln(ls.output); } } both in ldc and

Re: A good advertisement for 'static if'

2013-12-12 Thread Craig Dillabaugh
On Thursday, 12 December 2013 at 17:34:13 UTC, FreeSlave wrote: On Thursday, 12 December 2013 at 14:55:28 UTC, Craig Dillabaugh wrote: I am not sure if this belongs in D.learn, but it might be of interest. I was writing some C++ code for a project at work and have a class that stores image

Re: Implementing vector swizzle.

2013-12-12 Thread evilrat
On Friday, 13 December 2013 at 00:53:17 UTC, TheFlyingFiddle wrote: I would like to be able to do this. auto vector = vec4(1,2,3,4); vector.zxy += vec3(4,4,4); I'm currently able to do this: vector.zxy = vec3(4,4,4); Assigns 4 to the x,y and z components. and this auto other =

Re: Ensuring template argument is descendant of class

2013-12-12 Thread Ross Hays
Yeah, is-expression syntax is one of the dark, ugly corners of D that unfortunately we're stuck with, because changing it now will totally break a LOT of code for merely cosmetic reasons. I honestly wish that one day this mess could be cleared up, though I'm not holding my breath for it. T

Re: Ensuring template argument is descendant of class

2013-12-12 Thread Brian Rogoff
On Friday, 13 December 2013 at 05:22:26 UTC, Ross Hays wrote: Yeah, is-expression syntax is one of the dark, ugly corners of D that unfortunately we're stuck with, because changing it now will totally break a LOT of code for merely cosmetic reasons. I honestly wish that one day this mess could

Re: Ensuring template argument is descendant of class

2013-12-12 Thread H. S. Teoh
On Fri, Dec 13, 2013 at 06:42:26AM +0100, Brian Rogoff wrote: On Friday, 13 December 2013 at 05:22:26 UTC, Ross Hays wrote: Yeah, is-expression syntax is one of the dark, ugly corners of D that unfortunately we're stuck with, because changing it now will totally break a LOT of code for merely

Re: Type inference and overloaded functions

2013-12-12 Thread Maxim Fomin
On Friday, 13 December 2013 at 04:13:04 UTC, Kenji Hara wrote: On Thursday, 12 December 2013 at 18:20:25 UTC, bearophile wrote: If I have a function foo that takes a slice as input, and I want to pass it two arrays, the first time allocated on the heap and the second on the stack, I have to

Re: Type inference and overloaded functions

2013-12-12 Thread Jonathan M Davis
On Friday, December 13, 2013 07:19:50 Maxim Fomin wrote: On Friday, 13 December 2013 at 04:13:04 UTC, Kenji Hara wrote: On Thursday, 12 December 2013 at 18:20:25 UTC, bearophile wrote: If I have a function foo that takes a slice as input, and I want to pass it two arrays, the first time

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Jonathan M Davis
On Thursday, December 12, 2013 17:19:28 Adam D. Ruppe wrote: Consider the following: struct JustZeroes { int front = 0; enum bool = false; void popFront() {} } Is that guaranteed to work as an input range? I ask because I've so often written: T current;

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread qznc
On Thursday, 12 December 2013 at 21:55:20 UTC, Ali Çehreli wrote: The third condition that is checked to determine whether it is an OutputRange is indeed assignment to front. http://dlang.org/phobos/std_range.html#.put That condition is what makes a slice an OutputRange, which causes the

Re: Ranges: is it ok if front is a data member?

2013-12-12 Thread Chris Cain
On Friday, 13 December 2013 at 07:28:57 UTC, qznc wrote: Ouch. That surely is confusing. Why don't arrays provide .put which appends the element? Basically, when you're using an array as an output range, you're saying Hey, here's a slice of memory to put the results in. You're _not_ saying

Re: Ensuring template argument is descendant of class

2013-12-12 Thread Ross Hays
I remember seeing some posts about D and how the way it sounded was that D kind of filled the role of C++, without all the burden of years of full backwards comparability. I wouldn't dare say it is that bad, but this is how the problem starts I feel. I would love to see a release cycle like