I have a simple code:
#include <type_traits>
class A {
public:
static int a;
};
void a() {}
int A::a = [](){static_assert(std::is_function<decltype(a)>::value,"'a' is not a function");return 777;}();
int main() {
return 0;
}
At compile time (with g ++ 4.8.1 and clang 3.4), getting a static assert error about 'a' is not a function. But inside assert, in decltype I put 'a' (which is a function) not A :: a. Shouldnt component use function (a) instead of class member (A :: a)?
Can you give a link to the C ++ specification where this is explained?
source
share