[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum
The LinuxSolved.com GNU/Linux User Communit - Forum
Welcome to LinuxCommunity You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
  Show Posts
Pages: [1]
1  Linux in General / Linux Development & Programming / Programming in C++ : STL problems in Linux on: June 22, 2004, 05: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
2  Linux in General / Linux Development & Programming / No matching Call Error on: June 22, 2004, 05:30:58 AM
Hi

Following code is giving compilation error in g++.

Code:
#include<iostream>
#include<vector>
using namespace std;

template<typename T>
struct subvector_traits
{
typedef T* iterator;
};


template<typename T>
class subvector
{

public:
typedef typename subvector_traits<T>::iterator iterator;
void initialize(iterator start,iterator end)
{
m_pstart=start;
m_pend=end;

}
private:
iterator m_pstart;
iterator m_pend;
};


int main()
{
subvector<unsigned int> cells;
static vector<unsigned int> m_nMembercells; cells.initialize(m_nMembercells.begin(),m_nMembercells.begin());
return 0;
}


Quote
Error Message:- >

no matching function for call to `subvector<unsigned int>:: initialize(__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, __gnu_cxx::__normal_iterator<unsigned
int*, std::vector<unsigned int, std::allocator<unsigned int> > > )'
initialize.cpp:20: candidates are: void subvector<T>::initialize(subvector_traits<T>::iterator,
subvector_traits<T>::iterator) [with T = unsigned int]
initialize.cpp:37:2: warning: no newline at end of file

If anyone has some idea then please help
Thank you! in advance
3  Linux in General / Linux Development & Programming / Programming in C++ : STL problems in Linux on: June 22, 2004, 02: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:

#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
Pages: [1]
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 06:45:58 PM

Login with username, password and session length
Navigation
Recent Discussions
[November 29, 2008, 02:23:49 PM]

[November 29, 2008, 02:14:14 PM]

[November 29, 2008, 04:00:36 AM]

[November 28, 2008, 07:05:28 AM]

[November 28, 2008, 07:04:39 AM]

[November 28, 2008, 06:58:16 AM]

[November 28, 2008, 06:47:09 AM]

[November 26, 2008, 11:53:32 AM]

[November 26, 2008, 04:00:22 AM]

[November 25, 2008, 06:44:47 PM]
Members
Total Members: 6252
Latest: rash31
Stats
Total Posts: 8285
Total Topics: 2257
Online Today: 34
Online Ever: 111
(June 28, 2007, 06:47:29 AM)
Users Online
Users: 0
Guests: 9
Total: 9
Privacy Policy| Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Theme & TinyPortal v0.9.8 © Bloc