How I’m suppose to implement a macro that would do something like this:
//pseudocode
#define CHOOSE(X) if(X) expand to "" and if !X expand to return nullptr;
Edit
template<class SomePolicy>
struct M
{
template<class Policy = SomePolicy>
typename std::enable_if<IsThrow<Policy>::value,void>::type fnc()
{
}
template<class Policy = SomePolicy>
typename std::enable_if<!IsThrow<Policy>::value,std::nullptr_t>::type fnc()
{
return nullptr;
}
};
@All_WHO_TRIED_TO_HELP_ME Hey Guys I want to thank you very much for your priceless help. It couldn’t be done without you. Thanks to all of you. Thank you.
Answer to edit section.
Use the fact that expression
return g();is valid even ifgreturnvoid.and use
or