class object {
public:
object (string t, string n, int p)
}
object item("string1", "string2",5 );
vector<object *> list;
item.push_back( item);
error C2664: 'std::vector<_T y>::push_back' : cannot convert parameter 1 from 'item' to 'object *const &'
1> with
1> [
1> _Ty=SellableIte m *
1> ]
1> Reason: cannot convert from 'item' to 'object *const '
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Why it happened ?
public:
object (string t, string n, int p)
}
object item("string1", "string2",5 );
vector<object *> list;
item.push_back( item);
error C2664: 'std::vector<_T y>::push_back' : cannot convert parameter 1 from 'item' to 'object *const &'
1> with
1> [
1> _Ty=SellableIte m *
1> ]
1> Reason: cannot convert from 'item' to 'object *const '
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Why it happened ?
Comment