fork(1) download
  1.  
  2.  
  3. // This thing can make an array of given type.
  4. template <typename T>
  5. struct Foo {
  6. T data[100];
  7. };
  8.  
  9. template <typename T>
  10. T Foo::data[100] = {1, 2, 3};
  11.  
  12.  
  13. // Don't seem to be able to tell it to make a progmem array.
  14. // warning: ignoring attributes applied to dependent type 'const int' without an associated declaration [-Wattributes]
  15. using MyFoo = Foo<int PROGMEM const>;
  16.  
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:3: error: ‘template<class T> struct Foo’ used without template parameters
 T Foo::data[100] = {1, 2, 3};
   ^
prog.cpp:10:16: error: template declaration of ‘T data [100]’
 T Foo::data[100] = {1, 2, 3};
                ^
prog.cpp:15:36: error: template argument 1 is invalid
 using MyFoo = Foo<int PROGMEM const>;
                                    ^
stdout
Standard output is empty