fork download
  1. #include <cstddef>
  2. #include <array>
  3. #include <iostream>
  4.  
  5. // Cursor.h header
  6.  
  7. namespace detail
  8. {
  9. template<typename T = void>
  10. struct Cursor
  11. {
  12. static constexpr Cursor<T> const ZERO{};
  13. std::size_t row, column;
  14. };
  15.  
  16. template<typename T>
  17. constexpr Cursor<T> Cursor<T>::ZERO;
  18. }
  19.  
  20. using Cursor = detail::Cursor<>;
  21.  
  22. // main.cpp
  23.  
  24. //#include "Cursor.h"
  25.  
  26. int main(int, char**) noexcept
  27. {
  28. std::array<int, Cursor::ZERO.row> row_arr{};
  29. std::cout << row_arr.size() << "\n";
  30. //foo::bar(); // static method defined in second translation unit
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
0