Is there a way to create compile-time delegates?
    Sean Kelly 
    sean at invisibleduck.org
       
    Wed Jul 21 08:12:56 PDT 2010
    
    
  
Don Wrote:
> Philippe Sigaud wrote:
> > On Mon, Jul 19, 2010 at 22:01, torhu <no at spam.invalid> wrote:
> > 
> > 
> > 
> >     I wasn't able to make it work.  
> > 
> > 
> > Me too :(
> >  
> > 
> >     The compiler probably sees delegates as something that just can't be
> >     created at compile time, since no runtime contexts exist then.
> >      Which is reasonable.
> > 
> > 
> > Can you initialize pointers in general, at compile-time?
> 
> You cannot initialize a pointer to runtime-allocated data at 
> compile-time, and will never be able to. This particular example cannot 
> ever work.
You can get pretty close by using structs with opCall defined though.
    
    
More information about the Digitalmars-d-learn
mailing list