Why is std::is_assignable counter-intuitive?

前端 未结 3 651

std::is_assignable::value == false in a conforming implementation (e.g. clang/libc++, gcc/libstdc++, but not VS2012).

Intuitively, this

3条回答
  •  有刺的猬
    2021-01-02 01:23

    std::is_assignable::value == false means that "an int literal cannot be assigned to an int literal" (among other things).

    Your statement int x = 3 is std::is_assignable::value.

    For more info: http://en.cppreference.com/w/cpp/types/is_assignable

提交回复
热议问题