fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <unsigned int N>
  5. struct array_wrapper {
  6. int arr[N];
  7.  
  8. template<int Index>
  9. constexpr int const& at() const {
  10. return arr[Index];
  11. }
  12. };
  13.  
  14. template <unsigned int> struct deliberate_error;
  15.  
  16. int main() {
  17. constexpr array_wrapper<3> aw = { 1, 2, 3 };
  18.  
  19. static_assert(aw.at<0>() == 1, "");
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty