Function does not match?
The namespace shop_message {
The class object {
Protected:
Double attack_n;
Int price_b;
Double sheid_n;
Private:
String names;
Int level;
Tuple
Const get_all_object_message ()
{
Return make_tuple (names, price_b attack_n,
Sheid_n, level);
}
Public:
Bool is_in_shop;
Bool can_buy_it (const personal_message & amp; P)
{
Return p.g et_gold_n () & gt;=price_b;
}
Virtual tool * turn_to_tool ()=0;
Void buy_it ()
{
Is_in_shop=false;
}
Auto get_basic_message () - & gt;
Const decltype (get_all_object_message ())
{
Return get_all_object_message ();
}
};
Boolean operator==(object& One, object& Two)
{
The return one. Get_basic_message ()==two get_basic_message ();
}
The class basket {
Protected:
Int find_num (const object * & amp; This_o, const
Vector& To)
{
Int c=1;
For (const auto& P: to)
If (p.f irst==this_o)
Return the c;
The else
+ + c;
return 0;
}
Private:
String who_buy;
VectorVector Num_object;
Void new_num ()
{
VectorVo;
for(int i=0; i<=my_buy. The size (); + + I)
{
if(! Find_num (my_buy [I], vo))
Vo. Push_back ({my_buy [I], 1});
The else
+ + vo [find_num (my_buy [I], vo) - 1]. The second;
}
Num_object=vo;
}
Public:
PairDouble> Net_price ();
Shopping_message get_recorde ();
Void add_item (const object * & amp; This_object);
Void delete_item (const object * & amp; That_object);
};
}
E: \ \ VS_2019_C private information + + final project \ \ space space battle project, experimental code. CPP In member function 'void shop_message: : basket: : new_num ()' :
750 31 E: \ \ VS_2019_C private information + + final project \ \ space space battle project, experimental code. CPP [Error] no matching function for the call to 'shop_message: : basket: : find_num (shop_message: : object * & amp; , STD: : vector
750 31 E: \ \ VS_2019_C private information + + final project \ \ space space battle project, experimental code. CPP [Note] candidate is:
730 8 E: \ \ VS_2019_C + + private information battle project \ \ space space battle project, experimental code. CPP [Note] int shop_message: : basket: : find_num (const shop_message: : object * & amp; The const STD: : vector
730 8 E: \ \ VS_2019_C + + private information battle project \ \ space space battle project, experimental code. CPP [Note] no known conversion for argument 1 from '__gnu_cxx: : __alloc_traits & lt; STD: : allocator
753 33 E: \ \ VS_2019_C private information + + final project \ \ space space battle project, experimental code. CPP [Error] no matching function for the call to 'shop_message: : basket: : find_num (shop_message: : object * & amp; , STD: : vector
753 33 E: \ \ VS_2019_C private information + + final project \ \ space space battle project, experimental code. CPP [Note] candidate is:
730 8 E: \ \ VS_2019_C + + private information battle project \ \ space space battle project, experimental code. CPP [Note] int shop_message: : basket: : find_num (const shop_message: : object * & amp; The const STD: : vector
730 8 E: \ \ VS_2019_C + + private information battle project \ \ space space battle project, experimental code. CPP [Note] no known conversion for argument 1 from '__gnu_cxx: : __alloc_traits & lt; STD: : allocator
The function of the parameter is not match?
CodePudding user response:
Find_num parameter types do not match, into find_num (const object * this_o, constVector
CodePudding user response: