News for hackers. Stuff that matters.
Re:Modern C++ Won't Save Us by fooker on Tuesday April 23, 2019 @04:50AM (#19726671)
A look into the type_traits header reveals that is_standard_layout is implemented with standard C++.
Re:Modern C++ Won't Save Us by Kranar on Tuesday April 23, 2019 @08:37AM (#19727960)
Re:Modern C++ Won't Save Us by fooker on Tuesday April 23, 2019 @09:08AM (#19728191)
It checks if a non standard feature is available, otherwise falls back to a standard implementation.

My argument was that it was possible to implement it with standard C++.

Re:Modern C++ Won't Save Us by Kranar on Tuesday April 23, 2019 @01:54PM (#19731093)
There's no way to implement that type trait using standard C++. The implementation does check if a non-standard feature is available, and if not it delegates to is_scalar which in turn delegates to is_enum which in turn delegates to is_union. is_union can not be implemented in a standard conforming manner without compiler support and libc++ unconditionally returns false if compiler support is not available, which does not conform to the standard.