|
-
April 9th, 1999, 09:39 AM
#2
Re: How to fix template ambiguity
Excuse the last message , as I was saying, I have defined this pair of templates :
template<class T>
inline
CArchive& AFXAPI operator >>(CArchive& ar, T& t)
{
...
}
template<class T>
CArchive& AFXAPI operator >>(CArchive& ar, std::vector<T>& v)
{
...
}
when I compile:
...
std::vector<short> m_vector;
ar >> m_vector;
...
I get the following error :
error C2667: '>>' : none of 2 overload have a best conversion
error C2593: 'operator >>' is ambiguous
why it is ambiguous? it is not the second version a better conversion? and how do I get rid of it?
adios!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|