Exiting program problems, DAllegro

2011-02-17 Thread Joel Christensen
I'm using a wrapper (or what ever it's called ) that I made on top of DAllegro binding of the C library Allegro). But I get this error when exiting a DAllegro program with my JEC2 library. It's a long standing problem I've had. I think it's my JEC2 library that makes it fail. An exception wa

Checking if something is a template specialization?

2011-02-17 Thread Sean Eskapp
If I have class Bar(T) { } void foo(Y)() { ... } Is there a way to check inside foo() that Y is in some way an instantiation of Bar? Is there a way to find WHICH instantiation it is?

Re: opSlice and foreach with ranges

2011-02-17 Thread Ali Çehreli
On 02/17/2011 01:49 PM, Jesse Phillips wrote: Ali �ehreli Wrote: ... if the iterated object offers the slice operator with no arguments lst[], __c is initialized with lst[] instead of lst. This is in order to allow "extracting" the iteration means out of a container without requiring the conta

Re: opSlice and foreach with ranges

2011-02-17 Thread Jesse Phillips
Ali Çehreli Wrote: > > ... if the iterated object offers the slice operator with no arguments > lst[], __c is initialized with lst[] instead of lst. This is in order to > allow "extracting" the iteration means out of a container without > requiring the container to define the three iteration p

__stack_chk_guard on Mac OSX

2011-02-17 Thread HansR
I followed the directions on http://www.digitalmars.com/d/2.0/dmd-osx.html for the hello.d example and I kept getting an error about __stack_chk_guard.

opSlice and foreach with ranges

2011-02-17 Thread Ali Çehreli
Is that not implemented yet? TDPL mentions a very useful feature on page 381 under "12.9.1 foreach with Iteration Primitives". (Note: I am copying all of this manually; the typos are mine): It first shows a function that includes a possible "compiler rewrite" of a foreach loop: void proces

Re: class invariants and property declarations

2011-02-17 Thread Jonathan M Davis
On Thursday, February 17, 2011 10:39:20 Jesse Phillips wrote: > Jonathan M Davis Wrote: > > Except that @property is for _functions_. You mark a function with > > @property so that it _acts_ like a variable. @property on a variable is > > _meaningless_. It would be like marking a variable nothrow.

Re: class invariants and property declarations

2011-02-17 Thread Jesse Phillips
Jonathan M Davis Wrote: > Except that @property is for _functions_. You mark a function with @property > so > that it _acts_ like a variable. @property on a variable is _meaningless_. It > would be like marking a variable nothrow. It makes no sense. Neither should > be > legal. The fact that

Re: Isn't using find with retro awkward?

2011-02-17 Thread Steven Schveighoffer
On Wed, 16 Feb 2011 17:58:12 -0500, jam wrote: On Wed, 16 Feb 2011 22:00:13 +0100, Andrej Mitrovic wrote: On 2/16/11, jam wrote: void main() { auto a = [5,1,2,3,4,5,1]; auto index = countUntil(retro(a),5); writeln(a[a.length-1-index .. a.length]); } That works for random-acce