The actual error goes as below,
"tracking.cpp", line 157: Error: Call to 'cppListToWire' is ambiguous.
"/app/sdasup/home/mhp/source/develop/wv/include/cppmarsh.h", line 62: Note, overloadcand: Viable candidate 'void cppListToWire<RWTValSlist<TrackingRec*, std::allocator<TrackingRec*>>>(RWTValSlist<TrackingRec*, std::allocator<TrackingRec*>>&, void*&)'.
"/app/sdasup/home/mhp/source/develop/bc/include/bcMwMrsh.h", line 160: Note, overloadcand: Viable candidate 'void bcMwMrsh::cppListToWire<RWTValSlist<TrackingRec*, std::allocator<TrackingRec*>>>(RWTValSlist<TrackingRec*, std::allocator<TrackingRec*>>&, void*&)'.
"tracking.cpp", line 178: Error: Call to 'cppListToWire' is ambiguous.
"/app/sdasup/home/mhp/source/develop/wv/include/cppmarsh.h", line 62: Note, overloadcand: Viable candidate 'void cppListToWire<RWTValSlist<TrackingSummary*, std::allocator<TrackingSummary*>>>(RWTValSlist<TrackingSummary*, std::allocator<TrackingSummary*>>&, void*&)'.
"/app/sdasup/home/mhp/source/develop/bc/include/bcMwMrsh.h", line 160: Note, overloadcand: Viable candidate 'void bcMwMrsh::cppListToWire<RWTValSlist<TrackingSummary*, std::allocator<TrackingSummary*>>>(RWTValSlist<TrackingSummary*, std::allocator<TrackingSummary*>>&, void*&)'.
This is the example code,
//under bc/include/bcMwMrsh.h
namespace bcMwMrsh
{
template<typename listT>
void cppListToWire(listT &src, void *&dest);
)
//under "bc/bcComSupports/bcMwMrsh.cpp
template<typename listT>
void bcMwMrsh::cppListToWire(listT &list, void *&dest)
{
LOG (LM_MARSHAL_COM, (" bcMwMrsh::cppListToWire()...\n"));
int nItems = (int) list.entries();
bcMwMrsh::cppIntToWire (nItems, dest);
//RWSlistIterator next(list);
RWTValSlistIterator<void *> next(list);
while (next())
((AbcObject*)next.key())->toWire(dest);
LOG (LM_MARSHAL_COM, (" bcMwMrsh::cppListToWire(): done\n"));
}
//under wv/include/cppmarsh.h
#ifndef __CPPMARSH_H__
#define __CPPMARSH_H__
template<typename listT>
void cppListToWire(listT &src, void *&dest);
#endif
//under wv/wvCommon/cppmarsh.cpp
template<typename listT>
void cppListToWire(listT &list, void *&dest)
{
LOG (LM_MARSHAL_COM, (" cppmarsh::cppListToWire()...\n"));
short nItems = (short) list.entries();
bcMwMrsh::cppShortToWire(nItems, dest);
//RWSlistIterator next(list);
RWTValSlist<void *> next(list);
while (next())
((AISObject*)next.key())->toWire(dest, 0);
LOG (LM_MARSHAL_COM, (" cppmarsh::cppListToWire(): done\n"));
}
To eliminate duplication, calls to cppListToWire from cppmarsh been redirected to bcMwMrsh and hence commenting or removing cppListToWire in cppmarsh would clear the error.
However two question one, is it safe to comment/remove the lines from cppmarsh, because you can see nItems in cppmarsh is short as opposed to int in bcMwMrsh?
Second one, is there a way to solve without commenting the cppListToWire under cppmarsh?
Thanks in advance.