What is known about C# generics closing the gap with C++ templates in
the future? Template specialization is especially badly missed. What
new language features are coming in the next release of C#?

Re: C# plans towards metaprogramming by Marc

Marc
Thu May 08 08:30:12 CDT 2008

Which perceived gaps, in particular? What is it you need to do (and
can't)?

I'm not "in the know", but one thing that is regularly discussed is
allowing more dynamic access to members, which would be a step towards
the duck-typing of C++ templates - but I'm not sure if this is a step
forwards or backwards (in this context; obviously in *specific cases*
dynamic member access is good, but I wouldn't want to use it too
often).

Marc

Re: C# plans towards metaprogramming by Ignacio

Ignacio
Thu May 08 08:33:16 CDT 2008

On May 8, 9:17=A0am, Valery <vale...@gmail.com> wrote:
> What is known about C# generics closing the gap with C++ templates in
> the future? Template specialization is especially badly missed. What
> new language features are coming in the next release of C#?

Hi,

I do not know the answer of your question, but take a look at
http://blogs.msdn.com/ericlippert/default.aspx
you will find a good deal of exploration of future features of C#

Re: C# plans towards metaprogramming by Peter

Peter
Thu May 08 19:18:19 CDT 2008

I saw a recent article on codeproject.com with an managed code
implementation of C++ Templates for .NET. That might satisfy your curiosity
while you are waiting for the "next version" of C#.
Peter
"Valery" <valerka@gmail.com> wrote in message
news:94b068b0-41b4-46ea-b728-f394c08e32da@p39g2000prm.googlegroups.com...
> What is known about C# generics closing the gap with C++ templates in
> the future? Template specialization is especially badly missed. What
> new language features are coming in the next release of C#?


Re: C# plans towards metaprogramming by Valery

Valery
Fri May 09 07:09:16 CDT 2008

On May 8, 11:30=A0pm, Marc Gravell <marc.grav...@gmail.com> wrote:
> Which perceived gaps, in particular? What is it you need to do (and
> can't)?
>
> I'm not "in the know", but one thing that is regularly discussed is
> allowing more dynamic access to members, which would be a step towards
> the duck-typing of C++ templates - but I'm not sure if this is a step
> forwards or backwards (in this context; obviously in *specific cases*
> dynamic member access is good, but I wouldn't want to use it too
> often).
>
> Marc

Some of the areas of interest: dimensional types (doubles in units of
a particular measure); types with arithmetical features for high-
performance calculations (I need evaluation of sophisticated generic
types with minimal overheads - specialised templates provide for this
well); policy-based programming - to mention a few.

Thanks

Re: C# plans towards metaprogramming by Valery

Valery
Fri May 09 07:23:55 CDT 2008

On May 9, 10:18=A0am, "Peter Bromberg [C# MVP]"
<pbromb...@nospammaam.yahoo.com> wrote:
> I saw a recent article on codeproject.com with an managed code
> implementation of C++ Templates for .NET. That might satisfy your curiosit=
y
> while you are waiting for the "next version" of C#.
> Peter"Valery" <vale...@gmail.com> wrote in message
>
> news:94b068b0-41b4-46ea-b728-f394c08e32da@p39g2000prm.googlegroups.com...
>
>
>
> > What is known about C# generics closing the gap with C++ templates in
> > the future? Template specialization is especially badly missed. What
> > new language features are coming in the next release of C#?- Hide quoted=
text -
>
> - Show quoted text -

Hm. Couldn't find anything there ...

Re: C# plans towards metaprogramming by Marc

Marc
Fri May 09 07:22:45 CDT 2008

Tuple support is an interesting one, especially given that this is how
F# works... but I'm not sure it is especially hard to knock a few tuples
together as generic types (or indeed as an anonymous type if only the
caller need know)...

Re the arithmetic - yes; definitely a weakness. If it helps, I've spent
quite a bit of time looking at generic arithmetic; not *quite* as quick,
but still fast (and no additional coding):
http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html
(download as part of "miscutil")

To be honest I'm not too familiar with policy-based, so I won't presume
to comment.

Marc

Re: C# plans towards metaprogramming by Anders

Anders
Sat May 10 00:55:07 CDT 2008

I'm just after variance in return types - that's it. I'd recommend looking
at Jon Skeets blog also for additional requests to C#.

--
With regards
Anders Borum / SphereWorks
Microsoft Certified Professional (.NET MCP)