public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: no matching function for call to ``vector<C1, allocator<C1>>::at (int &) const'
@ 2003-01-23 13:13 Ajay Bansal
  2003-01-23 13:18 ` John Love-Jensen
  0 siblings, 1 reply; 7+ messages in thread
From: Ajay Bansal @ 2003-01-23 13:13 UTC (permalink / raw)
  To: John Love-Jensen, gcc-help

Yups.. Using gcc 3.2.1 on Redhat Linux 7.3

Even I have not been able to reproduce this in my sample code. This
error occurs only in my application.

-----Original Message-----
From: John Love-Jensen [mailto:eljay@adobe.com] 
Sent: Thursday, January 23, 2003 6:35 PM
To: Ajay Bansal; gcc-help@gcc.gnu.org
Subject: Re: no matching function for call to ``vector<C1,
allocator<C1>>::at (int &) const'


Hi Ajay,

Works fine on my machine.  OS X 10.2.3 and GCC 3.1.

I presume you are using GCC 3.2.

--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no matching function for call to ``vector<C1, allocator<C1>>::at (int &) const'
  2003-01-23 13:13 no matching function for call to ``vector<C1, allocator<C1>>::at (int &) const' Ajay Bansal
@ 2003-01-23 13:18 ` John Love-Jensen
  0 siblings, 0 replies; 7+ messages in thread
From: John Love-Jensen @ 2003-01-23 13:18 UTC (permalink / raw)
  To: Ajay Bansal, gcc-help

Hi Ajay,

It seems like your GCC 3.2.1 compiler is using the GCC 2.95 or RH 2.96
(non)Standard C++ Libraries.

Those header files don't have the at() method in the vector template.

(You are including <vector> and not <vector.h>, of course....)

--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: no matching function for call to``vector<C1,allocator<C1>>::at (int &) const'
@ 2003-01-23 18:12 Ajay Bansal
  0 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-01-23 18:12 UTC (permalink / raw)
  To: John Love-Jensen, gcc-help

Thanks John

We were doing a blunder... Compiling with a older version of g++ without
even knowing about it. "-M" option helped us know about the problem.

-Ajay

-----Original Message-----
From: John Love-Jensen [mailto:eljay@adobe.com] 
Sent: Thursday, January 23, 2003 6:52 PM
To: Ajay Bansal; gcc-help@gcc.gnu.org
Subject: Re: no matching function for call
to``vector<C1,allocator<C1>>::at (int &) const'


Hi Ajay,

You can check out which header files are introduced into your source
code
via:

g++ -M foo.cpp > foo.d

...and take a critical look at foo.d.  It will tell you which header
files, in particular compiler header files, are being pulled in.

Are those header files the ones from the old 2.10 or 2.90 Standard
Library, or are they the ones from the 3.x Standard Library?  (The
Standard Library has it's own version, independent of the GCC release.)

If you are unsure, you might want to open the vector header file (i.e.,
stl_vector.h has the implementation) and confirm that it has an at()
method.

--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no matching function for call to ``vector<C1,allocator<C1>>::at (int &) const'
  2003-01-23 13:20 no matching function for call to ``vector<C1,allocator<C1>>::at " Ajay Bansal
@ 2003-01-23 13:27 ` John Love-Jensen
  0 siblings, 0 replies; 7+ messages in thread
From: John Love-Jensen @ 2003-01-23 13:27 UTC (permalink / raw)
  To: Ajay Bansal, gcc-help

Hi Ajay,

You can check out which header files are introduced into your source code
via:

g++ -M foo.cpp > foo.d

...and take a critical look at foo.d.  It will tell you which header files,
in particular compiler header files, are being pulled in.

Are those header files the ones from the old 2.10 or 2.90 Standard Library,
or are they the ones from the 3.x Standard Library?  (The Standard Library
has it's own version, independent of the GCC release.)

If you are unsure, you might want to open the vector header file (i.e.,
stl_vector.h has the implementation) and confirm that it has an at() method.

--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: no matching function for call to ``vector<C1,allocator<C1>>::at (int &) const'
@ 2003-01-23 13:20 Ajay Bansal
  2003-01-23 13:27 ` John Love-Jensen
  0 siblings, 1 reply; 7+ messages in thread
From: Ajay Bansal @ 2003-01-23 13:20 UTC (permalink / raw)
  To: John Love-Jensen, gcc-help

Looks like the root cause. But I do not know how to confirm this???

Which command??

And if this is the issue.. How do I resolve this?



-----Original Message-----
From: John Love-Jensen [mailto:eljay@adobe.com] 
Sent: Thursday, January 23, 2003 6:43 PM
To: Ajay Bansal; gcc-help@gcc.gnu.org
Subject: Re: no matching function for call to
``vector<C1,allocator<C1>>::at (int &) const'


Hi Ajay,

It seems like your GCC 3.2.1 compiler is using the GCC 2.95 or RH 2.96
(non)Standard C++ Libraries.

Those header files don't have the at() method in the vector template.

(You are including <vector> and not <vector.h>, of course....)

--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no matching function for call to ``vector<C1, allocator<C1> >::at (int &) const'
  2003-01-23 12:52 no matching function for call to ``vector<C1, allocator<C1> >::at " Ajay Bansal
@ 2003-01-23 13:11 ` John Love-Jensen
  0 siblings, 0 replies; 7+ messages in thread
From: John Love-Jensen @ 2003-01-23 13:11 UTC (permalink / raw)
  To: Ajay Bansal, gcc-help

Hi Ajay,

Works fine on my machine.  OS X 10.2.3 and GCC 3.1.

I presume you are using GCC 3.2.

--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* no matching function for call to ``vector<C1, allocator<C1> >::at (int &) const'
@ 2003-01-23 12:52 Ajay Bansal
  2003-01-23 13:11 ` John Love-Jensen
  0 siblings, 1 reply; 7+ messages in thread
From: Ajay Bansal @ 2003-01-23 12:52 UTC (permalink / raw)
  To: gcc-help

Hi All

I am getting the following error on compiling the code

/home/porting/ajay/project/Code/CObArray.h: In 
method `T1 &CObArray<T1, T2>::GetAt (int) const [with T1 = C1, T2 = C1
&]':
/home/porting/ajay/project/Code/DbUtilities.h:575:   instantiated from
`C2<T>::Find (CString &, T &) [with T = C1]' DbManager.cpp:217:
instantiated from here /home/porting/ajay/project/Code/CObArray.h:152:
no matching function for call to ``vector<C1, allocator<C1> >::at (int
&) const'


Relevent code from different files is 

***************CObArray.h************************************

template<class T1,class T2>
class CObArray
{
        public:
                        CObArray();
                virtual ~CObArray();
			.               
                T1 & GetAt(int) const
			{
        			if(index < arr.size())
                			return (T1&) arr.at(index);
			}
			.
			.
        protected:
                vector<T1>      arr;
        private:
                typename vector<T1>::iterator   iter;
}


*******************************************************

***********DbManager.cpp:217**************

Result = m_UserDirectorySessionList.Find(Index, SessionResult);

******************************

Where m_UserDirectorySessionList is of type 

C2<C1>   m_UserDirectorySessionList;


And C2::Find function is in DbUtilities.h

template <class T>
class C2
{
private:
        CObArray<T, T&>                           m_ValueList;
public:
 	.
	.
	.       
	long C2::Find(long Index, T& Item)
                {
                Item = m_ValueList.GetAt(Index);
                }

}


What coud be the possible error?

-Ajay

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-01-23 18:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-23 13:13 no matching function for call to ``vector<C1, allocator<C1>>::at (int &) const' Ajay Bansal
2003-01-23 13:18 ` John Love-Jensen
  -- strict thread matches above, loose matches on Subject: below --
2003-01-23 18:12 no matching function for call to``vector<C1,allocator<C1>>::at " Ajay Bansal
2003-01-23 13:20 no matching function for call to ``vector<C1,allocator<C1>>::at " Ajay Bansal
2003-01-23 13:27 ` John Love-Jensen
2003-01-23 12:52 no matching function for call to ``vector<C1, allocator<C1> >::at " Ajay Bansal
2003-01-23 13:11 ` John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).