fork download
  1. #include <utility>
  2.  
  3. struct Forward_declared_type;
  4.  
  5. struct Foo{
  6. Forward_declared_type get(char *buffer, std::size_t size); //works
  7. template<std::size_t size>
  8. Forward_declared_type get(char (&buffer)[size]){
  9. return get(buffer, size); //how do I get this to compile?
  10. }
  11. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function 'Forward_declared_type Foo::get(char (&)[size])':
prog.cpp:8:49: error: return type 'struct Forward_declared_type' is incomplete
  Forward_declared_type get(char (&buffer)[size]){
                                                 ^
stdout
Standard output is empty