Thread overview
Re: On the richness of C++
Apr 15, 2008
bearophile
Apr 15, 2008
Janice Caron
Apr 15, 2008
Bill Baxter
April 15, 2008
I can't follow the newsgroup now, but I'd really like to know if you can use D to implement the tricks used by the Blitz++ C++ lib (http://www.oonumerics.org/blitz/ ).

bearophile
April 15, 2008
On 15/04/2008, bearophile <bearophileHUGS@lycos.com> wrote:
> I can't follow the newsgroup now, but I'd really like to know if you can use D to implement the tricks used by the Blitz++ C++ lib (http://www.oonumerics.org/blitz/ ).

Given that D templates are way, way, /way/ more powerful than C++ templates, what's to stop you?
April 15, 2008
Janice Caron wrote:
> On 15/04/2008, bearophile <bearophileHUGS@lycos.com> wrote:
>> I can't follow the newsgroup now, but I'd really like to know if you can use D to implement the tricks used by the Blitz++ C++ lib (http://www.oonumerics.org/blitz/ ).
> 
> Given that D templates are way, way, /way/ more powerful than C++
> templates, what's to stop you?

The fact that D structs are way way /way/ more wimpy than C++ structs. :-)

But that's changing.

Also that argument deduction in D templates isn't very complete.  Nested types mess it up, like Mike Parker found just recently in another thread.

Lack of template overloading and of overloading across modules can cause headaches too.

But anyway some people made a "Blitz++-like" library for C#.  It just requires that you use various shades of "unnatural" syntax like expr.AssignTo(r) instead of r = expr:
http://www.codeproject.com/KB/recipes/dynmatrixmath.aspx
D could at least do better than that, I'm sure.

--bb