LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-22-2004, 04:01 AM   #1
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Rep: Reputation: 15
Question "No matching Call Error"


Hi
Following code is giving compilation error in g++.

#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;
}


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
Thanx in advance
Ashwini
 
Old 06-23-2004, 01:37 PM   #2
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
That is some sweet code... sweetly broken that is. I am still learning C++, but I can tell you some things:
(1): I don't know what your doing with those typedefs, but it isn't healthy.
(2): struct subvector_traits is an empty stucture.
(3 The usual reason the comiler would be giving that error is because you need to do some type-casting.

Basically I am no help, so you shouldn't listen to me!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"mythtv-setup" giving "Session management error: Authentication Rejected" Mitchua Ubuntu 0 10-09-2005 04:32 PM
FC4 install errors, "diabling IRQ #10" "nobody cares" error message??? A6Quattro Fedora 6 07-20-2005 12:49 PM
"Function not implemented" error in call to "sem_open()" Krishnendu8 Linux - Newbie 1 06-07-2003 02:52 AM
"Function not imlemented" error in call to "sem_open()" Krishnendu8 Linux - Networking 0 06-07-2003 02:19 AM
dump + restore to backup linux ; "Couldn't find matching filesystem: LABEL=/" on boot markus1982 Linux - General 4 09-21-2002 01:16 PM


All times are GMT -5. The time now is 11:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration