I have 4 functions:
boost::variant<type1,type2,type3>processFile(const char* file){
if(----expression that if true means I have to process as type 1----)
return processType1(file); //this just returns type1
else if(----expression that if true means I have to process as either type 1 or type 2----)
return processType23(file); //this returns boost::variant<type2,type3>. This also calls 2 more processing functions depending on type.
}
processType23 takes a script file which will determine which type gets sent back. I want to keep the determination of the type in this file. However I cannot return the boost::variant. I get the following error:
error: could not convert 'engine::fileManager::processLua(const char*)()' from 'boost::variant<engine::material, engine::shader>' to 'boost::variant<engine::material, engine::shader, unsigned int>'
What is the (proper) way to return the data?