Re: Partial specialisation: howto? (in the right news group this time. *sigh*)

2009-05-17 Thread Jason House
div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks Simen, That's nicer than the chained static ifs. Is there anyway to get rid of the enum though? Using the enum is a pain as it means you have to edit that import anytime you need to create a specialistion. It's nearly

Re: Partial specialisation: howto? (in the right news group this time. *sigh*)

2009-05-17 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jason House wrote: div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks Simen, That's nicer than the chained static ifs. Is there anyway to get rid of the enum though? Using the enum is a pain as it means you have to edit that

Re: Partial specialisation: howto? (in the right news group this time. *sigh*)

2009-05-17 Thread Simen Kjaeraas
div0 wrote: Thanks Simen, That's nicer than the chained static ifs. Is there anyway to get rid of the enum though? I would believe this to work: template createHandlerCode( T... ) if ( is( T == msgRangeHdlr ) ) { string format( ) { return

Comparing D structs

2009-05-17 Thread Dan
Structs can't easily be compared in C because of potential 'padding' inside the struct which may (or may not) exist. I was jut wondering if D somehow gets round this, and allows something like memcmp to easily compare two structs.

Re: Comparing D structs

2009-05-17 Thread Jarrett Billingsley
On Sun, May 17, 2009 at 3:55 PM, Dan twinbe...@skytopia.com wrote: Structs can't easily be compared in C because of potential 'padding' inside the struct which may (or may not) exist. I was jut wondering if D somehow gets round this, and allows something like memcmp to easily compare two

Re: Comparing D structs

2009-05-17 Thread Dan
That sounds great, and seems like yet another reason for me to switch to D (other than the removal of header files which always seemed like a kludge). Just for the record though, I think one can initialize/blank/calloc C structs too, but the problem is that some struct elements (of the same

Re: Comparing D structs

2009-05-17 Thread grauzone
Dan wrote: That sounds great, and seems like yet another reason for me to switch to D (other than the removal of header files which always seemed like a kludge). I heard that the compiler can change the padding bytes to non-null on some occasions. For example, the compiler could treat member

Sellecting randomly from a range

2009-05-17 Thread Jesse Phillips
This is more a tutorial which I'll put up on a wiki, but one question I have is why can't 0..8 work in a randomCover, and wouldn't it be nice to use regex for creating a range ([A-Z] being all uppercase letters)? Selecting randomly from a collection of elements is common and usually entails

Re: Comparing D structs

2009-05-17 Thread Dan
Jarrett Billingsley Wrote: On Sun, May 17, 2009 at 5:00 PM, Dan twinbe...@skytopia.com wrote: That sounds great, and seems like yet another reason for me to switch to D (other than the removal of header files which always seemed like a kludge). Just for the record though, I think one

Re: D1/D2 co-install?

2009-05-17 Thread Robert Clipsham
BCS wrote: Does anyone have a good solution to installing both D1 and D2 on the same system? Possible solutions: * Rename the D2 dmd binary to dmd2 and make sure it uses a different config file for each to use the right libs. * Install them in different directories and use a script to

Re: D1/D2 co-install?

2009-05-17 Thread Georg Wrede
BCS wrote: Does anyone have a good solution to installing both D1 and D2 on the same system? ~$ cd /usr/local/digitalmars/ digitalmars$ ls -l total 25216 drwxr-xr-x 9 root root 4096 2009-04-03 03:19 dmd1042 -rw-r--r-- 1 root root 7240365 2009-04-03 03:18 dmd.1.042.zip drwxr-xr-x 9 root

Re: D1/D2 co-install?

2009-05-17 Thread Daniel Keep
BCS wrote: Does anyone have a good solution to installing both D1 and D2 on the same system? I have... (goes to check) 10 different compilers on my system. There's \dmd\bin\dmd-default which is the only one on the PATH (and is basically a stable version of Tango and DMD). If I want to use