Implement for each ability in a non-generic class

  • Thread starter Thread starter RFOG
  • Start date Start date
R

RFOG

Hi all!

I need a class that will be capable to enumerate some internal data, then
my idea is to implement "for each" loop access. Doc says that I've to inherit
form IEnumerable, but then compiler says

"Error 1 error C2955: 'System::Collections::Generic::IEnumerable' : use of
class generic requires generic argument list"

I understand that my class have to be a generic class, but I don't need that.
Is it possible to do?

Thanks in advance.
 
RFOG said:
Hi all!

I need a class that will be capable to enumerate some internal data, then
my idea is to implement "for each" loop access. Doc says that I've to
inherit form IEnumerable, but then compiler says
"Error 1 error C2955: 'System::Collections::Generic::IEnumerable' : use of
class generic requires generic argument list"

I understand that my class have to be a generic class, but I don't need
that. Is it possible to do?

Thanks in advance.

There is a non-generic System::Collections::IEnumerable and a generic
System::Collections::Geneic::IEnumeable.
Choose the first one if you don't need generics.

Marcus
 
Marcus Heege said:
There is a non-generic System::Collections::IEnumerable and a generic
System::Collections::Geneic::IEnumeable.
Choose the first one if you don't need generics.

Marcus

Yes, it works. Thank you.

--
Visita mi blog: http://rfog.blogsome.com
Libros, ciencia ficción y programación
========================================
El placer es un pobre sustituto del amor.
-- Rocha.
 
Back
Top