I cannot point any difference in the signature of unmatched
and available
overloads.
The error says No matching call to addSupport(NestedConnection<Paragraph, NestedConnection<Line, void> >*&)
But the candidates are addSupport(const NestedConnection<Paragraph, NestedConnection<Line, void> >*&)
(they can be converted to const implicitly)
error: no matching function for call to ‘NestedConnection<Section, NestedConnection<Paragraph, NestedConnection<Line, void> > >::addSupport(NestedConnection<Paragraph, NestedConnection<Line, void> >*&)’
note: candidates are: void Collection<T>::addSupport(const T*&) [with T = NestedConnection<Paragraph, NestedConnection<Line, void> >]
This is what I am doing
template<typename T>
class Collection{
public:
typedef T Type;
typedef std::vector<T*> CollectionT;
typedef Collection<T> self;
private:
CollectionT _supports;
public:
void addSupport(const T*& connection){_supports.push_back(connection);};
const CollectionT& supports() const{return _supports;}
};
template<typename T, typename C=void>
class NestedConnection: public Connection<T>, Collection<C>{
public:
typedef T ParentT;
typedef C ChildT;
typedef Connection<T> ConnectionT;
typedef Collection<C> CollectionT;
enum{
leaf = 0
};
public:
NestedConnection(const T* l, const T* r): Connection<T>(l, r){}
};
I am invoking by doing
NestedConnection<ParentT, ChildT>* connection = new NestedConnection<ParentT, ChildT>(lhs, rhs);
//This will be unfolded till void and it starts from
//NestedConnection<Section, NestedConnection<Paragraph, NestedConnection<Line, void>>>
connection->addSupport(con_lr);
//con_lr:ChildT*