Thread overview | |||||
---|---|---|---|---|---|
|
October 28, 2011 template expressions in C++ to an equivalent in D | ||||
---|---|---|---|---|
| ||||
Hello, I want to compute, for example d = a + b + c where a..d are of some derived type, without incurring the cost of temporaries for each overloaded operation. In a similar post a while ago, Walter Bright proposed using function literals instead of template expressions to do this. After looking at function literals, I can't work out what he had in mind with this suggestion. May someone present a succinct complete example to demonstrate how solve this? Many thanks, Dominic Jones |
October 28, 2011 Re: template expressions in C++ to an equivalent in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dominic Jones | Le 28/10/2011 19:18, Dominic Jones a écrit : > Hello, > > I want to compute, for example > d = a + b + c > where a..d are of some derived type, without incurring the cost of temporaries for each overloaded operation. > > In a similar post a while ago, Walter Bright proposed using function literals instead of template expressions to do this. After looking at function literals, I can't work out what he had in mind with this suggestion. May someone present a succinct > complete example to demonstrate how solve this? > > Many thanks, > Dominic Jones I was thinking about porting http://eigen.tuxfamily.org/index.php in D. I'm currently on SFML2 but it goes quite fast (thanks to Trass3r for porting SFML to D2 so a big part of the job is done). You may want to do so ? Anyway, I'm not surefunction literal can do the trick. I would be interested on knowing more on the topic. If it is more suitable, maybe I should reconside my project to port eigen. Deadalnix |
October 30, 2011 Re: template expressions in C++ to an equivalent in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | > I was thinking about porting http://eigen.tuxfamily.org/index.php in D. Don't we have a LinAlg library now thx to that GSoC project? > I'm currently on SFML2 but it goes quite fast (thanks to Trass3r for porting SFML to D2 so a big part of the job is done). You're welcome. |
Copyright © 1999-2021 by the D Language Foundation