Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Problem with **...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 44204 of 47926
Post > Topic >>

Problem with ****ting some STL code from VS to GCC

by Frank Steinmetzger <Warp_7@[EMAIL PROTECTED] > Mar 29, 2008 at 08:37 PM

Hello group,

I have a small program that has been written using Visual Studio. However,
I
work with Linux and GCC. During ****ting I encountered a little problem
that
I don't know how to solve. I should add that STL is pretty new to me ATM.


There is a class "cc":
template <int Dimension, typename ftype> class cc;

And a class "database", which holds a vector of cc:
template <int Dimension, typename ftype> class database {
[...]
private:
        static std::vector<cc<Dimension, ftype>*> list;
}


The following is located in the destructor of database:

template <int Dimension, typename ftype>
database<Dimension, ftype>::~database()
{
[...]
        for (std::vector<cc<Dimension, ftype>*>::iterator it =
list.begin();
        it!= list.end(); it++)
                delete *it;
[...]
}

When compiling this, I get this error:
Curve.cpp: In destructor 'database<Dimension, ftype>::~database()':
Curve.cpp:630: error: expected `;' before 'it'
Curve.cpp:630: error: 'it' was not declared in this scope

(Line 630 is the one with the for loop).
For testing, I used std::vector<int*>::iterator in the loop and the error
disappeared. Hence cc<Dimension, ftype>* seems to be unknown or not
accepted as a template type for the vector, but how and why? Could you
please give me some advice?

Thanks in advance.
 




 3 Posts in Topic:
Problem with porting some STL code from VS to GCC
Frank Steinmetzger <Wa  2008-03-29 20:37:26 
Re: Problem with porting some STL code from VS to GCC
Kai-Uwe Bux <jkherciue  2008-03-29 15:45:03 
Re: Problem with porting some STL code from VS to GCC
Frank Steinmetzger <Wa  2008-03-29 22:10:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 18:26:08 CDT 2008.