I am currently playing with static_assert
and came across this problem:
class A
{
public:
void func( const int a ){
static_assert( a == 3 );
}
};
Gives me:
error: non-constant condition for static assertion static_assert( a == 3 );
Why is this? My a is const. I could imagine that the value will be cast to const and was previously non const, then yes an error should appear. But only inside the member function, I wouldn't expect any errors.
How can I solve that? If not solveable I am also glad about an answer, kinda curious here.