BackMath: a compile time symbolic math lib.

BCS ao at pathlink.com
Tue Dec 4 15:04:34 PST 2007


Reply to Robert,

> Where was this lib when I was doing Algebra I in middle school :-)?
> 
> Very cool stuff; I'm always amazed at what D can do with
> metaprogramming.

thanks :)

> FWIW, I think local variables can be template alias
> parameters, I'm using just that fact to get the names of the functions
> a particular template is instantiated in. I'm not sure if this is what
> you meant, though.
> 


what I need is something that would work like this:

struct S(alias r)
{
   real Get(){return r;}
}

void Do()
{
   real a;
   S!(a) s;
   real b = s.Get();
}

the issue is that the struct doesn't have access to the function. There is 
no reason this should be impossible, but the semantics of how to make it 
work would be a major project in and of it's self.

If anyone can find a workaround I'm open to suggestions.





More information about the Digitalmars-d-announce mailing list