Jump to page: 1 24  
Page
Thread overview
Comparison chart of D and C++ templates
Jan 19, 2007
Walter Bright
Jan 19, 2007
Kazuhiro Inaba
Jan 19, 2007
Walter Bright
Jan 19, 2007
Lionello Lunesu
Jan 19, 2007
Lionello Lunesu
Jan 19, 2007
Frits van Bommel
Jan 19, 2007
Leandro Lucarella
Jan 19, 2007
Walter Bright
Jan 19, 2007
Kyle Furlong
Jan 19, 2007
Don Clugston
Jan 19, 2007
Don Clugston
Jan 19, 2007
Leandro Lucarella
Jan 19, 2007
Walter Bright
Jan 19, 2007
Marcin Kuszczak
Jan 20, 2007
Walter Bright
Jan 19, 2007
Yauheni Akhotnikau
Jan 19, 2007
Walter Bright
Jan 19, 2007
Lutger
Jan 19, 2007
Don Clugston
Jan 19, 2007
BCS
Jan 20, 2007
Walter Bright
Jan 20, 2007
John Reimer
Jan 20, 2007
Walter Bright
Jan 20, 2007
Bruno Medeiros
Jan 20, 2007
John Reimer
Jan 20, 2007
janderson
Jan 20, 2007
janderson
Jan 20, 2007
Walter Bright
Jan 20, 2007
janderson
Jan 20, 2007
janderson
Jan 20, 2007
Kirk McDonald
Jan 21, 2007
janderson
January 19, 2007
http://www.digitalmars.com/d/template-comparison.html

Comments?
January 19, 2007
>                          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
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
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
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
!!?! I just did a reload of the page and now it's OK!
January 19, 2007
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
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
Walter Bright wrote:
> http://www.digitalmars.com/d/template-comparison.html
> 
> Comments?

You left out specialisation of template value parameters <g>.


January 19, 2007
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
« First   ‹ Prev
1 2 3 4