title: C++ Invalid arguments, Candidates are : ".." on Setters from different classes
body: <p>Getting a weird error which I could not solve.</p>
  
  <p>I have few files, Store.cpp, Store.h (Class Store is defined here), Order.cpp, Order.h (class Order is defined here).</p>
  
  <p>Store.cpp has <code>#include "Order.h"</code>.</p>
  
  <p>Inside the class <code>Order</code> I have a few setters and getters in the public section, one of them is :</p>
  
  <pre><code>void setStatus(const OrderStatus&amp; orderStatus);
  </code></pre>
  
  <p>OrderStatus is an enum.</p>
  
  <p>When I'm trying to use it in Store.cpp with the following line :</p>
  
  <pre><code>(*itr).setStatus(ORDER_DONE);
  </code></pre>
  
  <p>I get this error from eclipse :</p>
  
  <pre>
      Invalid arguments '
      Candidates are:
      void setStatus(const enum {order.h:140} &)
      '
  </pre>
  
  <p>And this error from GCC :</p>
  
  <pre>
  Store.cpp:250:31: error: no matching function for call to
  âOrder::setStatus(OrderStatus) constâ 
     Store.cpp:250:31: note: candidate is: <br>
     order.h:47:7: note: void Order::setStatus(const OrderStatus&)  <br>
     order.h:47:7: note:   no known conversion for implicit âthisâ parameter from âconst Order*â to âOrder*â
  </pre>
  
  <p>I really do not know where the const came from (line 250).</p>