POV-Ray : Newsgroups : povray.off-topic : Generics annoyance : Re: Generics annoyance Server Time
4 Sep 2024 07:15:01 EDT (-0400)
  Re: Generics annoyance  
From: Invisible
Date: 13 Apr 2010 04:38:54
Message: <4bc42d9e$1@news.povray.org>
Darren New wrote:
> Actually, one place I think C++ style templates beat out generics is in 
> this:

As I've written before, AFAIK these are two entirely unrelated 
technologies that do totally different things.

> In MS's simple game libraries, there's a class called GameComponent.
> It inherits from IUpdatable, IDrawable, and IMumble, each of which 
> provides the declaration of one of the main routines in a game (update, 
> draw, and initialize, respectively).
> 
> Now, if I wanted (and I do) to make a collection of things that act like 
> GameComponent objects but aren't necessarily game components, I don't 
> think I can do that in C#. I would have to have a collection 
> parameterized on all three of those interfaces. GameComponent supports a 
> bunch of things that i might not want to have to support, but I can't 
> make a collection that'll let me add "anything with those three 
> routines, including GameComponent."

Heh, just use a language that has first-class functions, and store a 
collection of functions. ;-)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.