Subject: Re: Templates
From: [email-masked] (Earnie Boyd)

14 Oct 1998 13:39:51 -0700
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: [email-masked], [email-masked]

Have you updated your compiler yet??  See my web page for more info.

[email-masked] wrote:
>
> I was wondering if cygwin32 b19 works with templates.  I made a real
easy
> template class for a list, which compiles fine on MSVC++, but throws a
> bunch of errors when I try with cygnwin32.  Below are the errors
that it
> pops out.
> 
> In file influded from test4.cpp:10:
> listarr.cpp:13: syntax error before '<'
> test4.cpp: In function 'int main(...)':
> test4.cpp:144: confused by earlier errors, bailing out
> 
> That is it.  The last error occurs on the last brace of the program.
> Below is  snippet from the two files:  listarr.cpp test4.cpp
> 
> listarr.cpp
> -----------
> #include "listarr.h"
> 
> template <class LE>
> List<LE>::List<LE>(int maxNumber)
> {
> 	maxSize = maxNumber;
> 	element = new LE [maxSize];
> 	size = 0;
> 	cursor = -1;
> }
> 
> template <class LE>
> List<LE::~List<LE>()
> {
> 	delete [] element;
> }
> 
> test4.cpp
> ---------
> #include <iostream.h>
> #include "listarr.cpp"
> 
> void main()
> {
> 	List<char> testList(8);
> 	char testElement;
> 	
> 	.. missing ..
> 
> 	cout << "Enter element: ";
> 	cin >> testElement;
> 	testList.insert(testElement);
> 
> 	.. missing ..
> }
> 
> This looks like it should work fine.  I am not quite sure what the
errors
> are.  I don't know if cygwin32 handles template differently than
MSVC++ or
> what.
> 
> Thanks,
> Ryan
> [email-masked]
> 
> -
> For help on using this list (especially unsubscribing), send a
message to
> "[email-masked]" with one line of text: "help".
> 

==
-                \\||//
-----------o0O0--Earnie--0O0o------------
--        [email-masked]        --
-- http://freeyellow.com/members5/gw32 --
--------------ooo0O--O0ooo---------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".