I Need to perform a unit test on AddToDB() API. Below is my Attemp but i get error when i create a callback with notify type 2 mention below
- typedef std::function<bool(std::string)> strnotify;
- typedef std::function<void(strnotify &)> notify;
- bool AddToDB(notify data);
// callback for typedef std::function<bool(std::string)> strnotify;
bool StringNotify(std::string){
std::cout<<"String success";
return true;
}
// callback for typedef std::function<void(strnotify &)> notify;
void StringObject(strnotify & obj){ // i get error here as type is not allowed
std::cout<<"string obj success";
}
//Call to API
AddToDB(StringObject)
I get error as type is not allowed.
Aucun commentaire:
Enregistrer un commentaire