November 24, 2024, 05:11:21 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Programming in C++ : STL problems in Linux  (Read 9616 times)

Offline a_mlt1

  • New Member
  • Posts: 3
Programming in C++ : STL problems in Linux
« on: June 22, 2004, 06:22:03 AM »
Hi Guys,

I am a new member of this forum.

I am facing some problems while porting my code from VC++ (ver 6) to Kdevelop on Linux.

for the sake of understanding it better here is the dummy of the problem :



Code: [Select]

#include <iostream>
#include <vector>

using namespace std;

template <typename CName>
class a
{
};

template <typename CName>
class b
{
    vector<a<CName>* > :: iterator c;
};


int main()
{
   return 0;
}



After compilation the above code returns some warnings.


Quote

The above code after compilation returns following warnings:

warning : 'typename std:vector<a<CName>*,std::allocator<a<CName>*> >::iterator is implicitly a typename

warning : implicit typename is deprecated, please see the documentation for details



I want to remove these warnings as these are giving errors in my code during compilation.

Can any one help me out in this !

Cheers !

a_mlt1

Offline a_mlt1

  • New Member
  • Posts: 3
Programming in C++ : STL problems in Linux
« Reply #1 on: June 22, 2004, 09:42:23 AM »
Hi Guys,

I got its solution.

I was missing the keyword 'typename'

Quote

typename  vector<a<CName>* > :: iterator c;


Thanks to guys who gave me solution or invested efforts !

Regards
a_mlt1