473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Implement for each ability in a non-generic class

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.
May 12 '06 #1
2 1619
"RFOG" <rf*******@QUITAME.yahoo.es> wrote in message
news:a6*************************@msnews.microsoft. com...
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
May 12 '06 #2
"Marcus Heege" <NO****@heege.net> wrote in message
news:uw*************@TK2MSFTNGP02.phx.gbl...
"RFOG" <rf*******@QUITAME.yahoo.es> wrote in message
news:a6*************************@msnews.microsoft. com...
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


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.
May 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: takashi | last post by:
Hi, I have a question. I am learning about how to use c++ language. I have attempted to make my own programs, using the knowledge that I have, but sometimes when I get stuck on writing a code, it...
11
by: Kai-Uwe Bux | last post by:
Hi folks, does anyone see a way to implement the following enum_limits template: template < typename EnumType > struct enum_limits { // first element in range of EnumType: static...
2
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous...
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
7
by: Cerebrus99 | last post by:
Hi all, I am confused about how to sort an XML file. I mean how to *actually* sort the data in the physical file, not how to display sorted data. I am using a large XML file as a back-end...
17
by: nicolas.hilaire | last post by:
Hi all, i'm doing a quite long treatment in a function, and i'm showing the progress of the treatment with a progressbar. The code is something like this : for each(entry in entries) // about...
6
by: Smithers | last post by:
Just looking to compile a list of "all the ways to implement events". I'm NOT looking to get into the merits or mechanics of each in this thread... just want to identify them all - good, bad, and...
139
by: ravi | last post by:
Hi can anybody tell me that which ds will be best suited to implement a hash table in C/C++ thanx. in advanced
8
by: John | last post by:
Hi, gurus, How can I implement the following feature in C#: Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ", group") For Each objMember In objGroup.Members...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.