MSVC12 thinks aggregate derived from std::array is not pod

☆樱花仙子☆ 提交于 2019-12-04 03:17:39
  1. GCC and Clang; that class is POD.

  2. That depends on what exactly you mean with "make MSVC treat the class as pod." If you mean the compiler internals, then no. However, you can (in practice) specialise the trait for litmus:

    namespace std {
    
    template <>
    struct is_pod<litmus> : std::true_type
    {};
    
    }
    

    Note that going strictly by the standard, this gives undefined behaviour (thanks @R.MartinhoFernandes for pointing this out). However, as a compiler-specific workaround, I'd expect it to work. Use without any warranty.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!