This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

no matching function for call to ``vector<C1, allocator<C1> >::at (int &) const'


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]