title: ISO C++ forbids declaration of ‘tuple’ with no type
body: <p>When trying to compile a simple class (<code>g++ myclass.cpp</code>), I get the following error:</p>
  
  <blockquote>
    <p>ISO C++ forbids declaration of ‘tuple’ with no type</p>
  </blockquote>
  
  <p>I searched for this problem, and in most cases people seemed to forget <code>std::</code> or including <code>&lt;tuple&gt;</code> in the header. But I have both. Here is my code:</p>
  
  <p><strong>myclass.h</strong></p>
  
  <pre><code>#ifndef MYCLASS
  #define MYCLASS
  
  #include &lt;iostream&gt;
  #include &lt;tuple&gt;
  
  class MyClass {
      std::tuple&lt;bool, int, int&gt; my_method();
  };
  
  #endif
  </code></pre>
  
  <p><strong>myclass.cpp</strong></p>
  
  <pre><code>#include "myclass.h"
  
  using namespace std;
  
  tuple&lt;bool, int, int&gt; MyClass::my_method() {
      return make_tuple(true, 1, 1);
  }
  </code></pre>
  
  <p>If I do the same using <code>pair</code> instead, leaving out the second <code>int</code> and including <code>&lt;set&gt;</code>, it works.</p>
  
  <p>What am I missing?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here is the full output:</p>
  
  <blockquote>
    <p>$ g++ myclass.cpp -o prog<br>
        In file included from myclass.cpp:1:<br>
        myclass.h:7: error: ISO C++ forbids declaration of ‘tuple’ with no type<br>
        myclass.h:7: error: invalid use of ‘::’<br>
        myclass.h:7: error: expected ‘;’ before ‘&lt;’ token<br>
        myclass.cpp:5: error: expected constructor, destructor, or type conversion 
    before ‘&lt;’ token</p>
    
    <p>$ g++ --version<br>
        i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)<br>
        (LLVM build 2336.11.00)</p>
  </blockquote>