Can we create a Virtual function with tribool return type? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we create a Virtual function with tribool return type?

I am trying to create a Virtual function with boost::tribool return type. The tribool is a data type that can be in any one of the state true,false or indeterminate. While adding definition of this function in my cpp getting error that the function does not match in signature with the declaration in the header. So in header the declaration is: virtual boost::tribool _determineState(string& a) const; In Cpp. boost::tribool _determineState(string& a) const //Function body Any input will be appreciated.

11th Jan 2021, 4:55 PM
Vipin Chauhan
Vipin Chauhan - avatar
2 Answers
+ 1
The function names are not the same in the declaration and definition
13th Jan 2021, 2:11 PM
Anthony Maina
Anthony Maina - avatar
0
Yes, thanks for pointing it out.Need to edit the question, made the typo while entering the question. But in IDE just copy pasted the names so no error there. The question remains same.
13th Jan 2021, 3:23 PM
Vipin Chauhan
Vipin Chauhan - avatar