fork(2) download
  1. #include <iostream>
  2.  
  3. template <typename T>
  4. constexpr size_t get_pretty_function_size()
  5. {
  6. return sizeof(__PRETTY_FUNCTION__);
  7. }
  8.  
  9. static_assert(87 == get_pretty_function_size<int>(), "invalid size");
  10. static_assert(90 == get_pretty_function_size<double>(), "invalid size");
  11. static_assert(116 == get_pretty_function_size<std::string>(), "invalid size");
  12.  
  13. template <int SS> struct sizeof_struct { char a__[SS]; };
  14.  
  15. template <typename T, int Size>
  16. inline sizeof_struct<Size> count_of_array(T (&a)[Size]) {}
  17. template <char const* C> struct SSS;
  18. int main()
  19. {
  20. static_assert("1"[0] == '1', "It is not a compiletime array");
  21. }
Success #stdin #stdout 0s 4456KB
stdin
Standard input is empty
stdout
Standard output is empty