Thread overview | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 19, 2007 Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
http://www.digitalmars.com/d/template-comparison.html Comments? |
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | > D C++98 C++0x >Partial Specialization | Yes Yes NoChange Actually, partial specialization in D is a kind of yes-and-no. In C++98, we can do this: template<class T, class U> class Foo< map<T,U> > { ... }; // Partially specialized to "associative arrays" while in D, cannot: class Foo(T: /* ? */) {} Combination of staticIf/typeof/IFTI may achieve the same effect, but in my opinion it is not partial specialization anymore. -- k.inaba / $B0pMU0l9@(B (http://www.kmonos.net) |
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kazuhiro Inaba | Kazuhiro Inaba wrote: >> D C++98 C++0x >> Partial Specialization | Yes Yes NoChange > > Actually, partial specialization in D is a kind of yes-and-no. > In C++98, we can do this: > template<class T, class U> > class Foo< map<T,U> > { ... }; // Partially specialized to "associative arrays" > while in D, cannot: > class Foo(T: /* ? */) {} You're right there is a problem when one wants to specialize on a type dependent on more than one parameter. You can do things like: class Foo(T, U, M : map!(T,U)) ... but it isn't quite as clean. > Combination of staticIf/typeof/IFTI may achieve the same effect, but in my opinion it is not partial specialization anymore. static if can do a reasonable job covering for it. |
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | I haven't checked the contents yet, but in Firefox the code blocks are way too wide. The width of the page is more than twice my screen width (1280). In IE7 it's ok. L. |
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lionello Lunesu | Lionello Lunesu kirjoitti:
> I haven't checked the contents yet, but in Firefox the code blocks are way too wide. The width of the page is more than twice my screen width (1280). In IE7 it's ok.
I'm using Firefox 2.0 (1280x1024) on Linux and it's working just fine.
|
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jari-Matti Mäkelä | !!?! I just did a reload of the page and now it's OK! |
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lionello Lunesu | Lionello Lunesu wrote:
> !!?! I just did a reload of the page and now it's OK!
The stylesheet must have changed or something.
It was also *way* too wide for me before, but a complete reload fixed it somewhat. It's still slightly too wide, but at least if I scroll to the right I can now get the entire width of the table onto the screen. While I look at the table I don't need the menu anyway.
Still, it could be a little less wide.
|
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> http://www.digitalmars.com/d/template-comparison.html
>
> Comments?
Links on the "Yes"'s in the D column to the relevant parts of the spec would be nice and also consistent with the old feature comparison table.
|
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> http://www.digitalmars.com/d/template-comparison.html
>
> Comments?
You left out specialisation of template value parameters <g>.
|
January 19, 2007 Re: Comparison chart of D and C++ templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lionello Lunesu | Lionello Lunesu escribió: > !!?! I just did a reload of the page and now it's OK! I had the same problem, and reloaded too, and was gone too. Weird... -- Leandro Lucarella Integratech S.A. 4571-5252 |
Copyright © 1999-2021 by the D Language Foundation