I'm experiencing a weird behavior when using static_assert
for asserting that the return type of a function object
is the same as another type. Something like (This code is just for presenting the problem and not actually what i'm trying to do).
int foo() {
return 0;
}
int main() {
auto funcObj = std::bind(foo);
static_assert(std::is_same<std::result_of<funcObj()>, int>::value, "FuncObj return type is not int");
return 0;
}
The assertion fails. What's going wrong here?