title: g++ expected unqualified-id before ‘(’ token
body: <p>I'm getting this error when using <code>stl_vector.h</code>. I'm on Linux using g++ to compile.</p>
  
  <pre><code>{
    if (max_size() - size() &lt; __n)
      __throw_length_error(__N(__s));
  
    const size_type __len = size() + std::max(size(), __n); //THE ERROR IS ON THIS LINE!
    return (__len &lt; size() || __len &gt; max_size()) ? max_size() : __len;
  }
  </code></pre>
  
  <blockquote>
    <p>usr/include/c++/4.5/bits/stl_vector.h:1143:40: error: expected unqualified-id before <code>‘(’</code> token</p>
  </blockquote>
  
  <p>I'm not sure why I'm getting this error, I have searched a lot and found some "similar" problems but I can't solve mine.</p>
  
  <p>EDIT: so here's the error log:</p>
  
  <pre><code>In file included from /usr/include/c++/4.5/vector:65:0,
               from ../../RL_Toolbox/include/caction.h:34,
               from ../../RL_Toolbox/include/cagent.h:35,
               from shortestpathQLearning.cpp:42:
  /usr/include/c++/4.5/bits/stl_vector.h:1143:40: error: expected unqualified-id before ‘(’ token
  </code></pre>
  
  <p>You can see in the previous error log that "vector" gets called by the header "caction.h" like this: </p>
  
  <pre><code>//THESE ARE THE INCLUDES IN "caction.h"
  #ifndef CACTION_H
  #define CACTION_H
  #include &lt;stdio.h&gt; 
  #include &lt;vector&gt; //HERE IT CALLS &lt;vector&gt;
  #include &lt;list&gt;
  #include &lt;map&gt;
  #include "cbaseobjects.h"
  </code></pre>
  
  <p>then Vector calls bits/stl_vector.h like this:</p>
  
  <pre><code>#ifndef _GLIBCXX_VECTOR
  #define _GLIBCXX_VECTOR 1
  
  #pragma GCC system_header
  
  #include &lt;bits/stl_algobase.h&gt;
  #include &lt;bits/allocator.h&gt;
  #include &lt;bits/stl_construct.h&gt;
  #include &lt;bits/stl_uninitialized.h&gt;
  #include &lt;bits/stl_vector.h&gt;//HERE IT CALLS stl_vector.h
  #include &lt;bits/stl_bvector.h&gt; //Im actually getting the exact same error from  stl_vector.h on this header
  </code></pre>
  
  <p>just the last 2 headers from vector (stl_vector and stl_bvector) give me the exact same error, the rest are ok. Any ideas?</p>
  
  <p>Thanks in advance for your help.</p>