Implement for each ability in a non-generic class

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.
 
M

Marcus Heege

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
 
S

solved by design

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top