fork download
  1. #include <string.h>
  2. #include <type_traits>
  3.  
  4. struct Something
  5. {
  6. int a;
  7. int b;
  8.  
  9. Something(char* buffer = nullptr)
  10. {
  11. if (buffer) {
  12. memcpy(this, buffer, sizeof(Something));
  13. }
  14. };
  15. };
  16.  
  17. int main() {
  18. static_assert(std::is_pod<Something>::value, "Something must be a POD type!");
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:18:2: error: static assertion failed: Something must be a POD type!
  static_assert(std::is_pod<Something>::value, "Something must be a POD type!");
  ^~~~~~~~~~~~~
stdout
Standard output is empty