title: c++ optional/default argument
body: <p>I have defined a method with an optional/defaulted last argument called <code>noAutoResolve</code> as follows:</p>
  
  <pre><code>typedef std::shared_ptr&lt;IMessage&gt; TMessagePtr;
  
  class NetworkService : public IConnectionManagerDelegate, public net::IStreamDelegate
  {    
  public:   
      void send_message(std::string identity, msg::TMessagePtr msg, QObject* window, std::function&lt;void(int, std::shared_ptr&lt;msg::IMessage&gt; msg)&gt; fn, bool noAutoResolve = false);
  }
  </code></pre>
  
  <p>and later:</p>
  
  <pre><code>void NetworkService::send_message(std::string endpoint, msg::TMessagePtr msg, QObject* window, std::function&lt;void(int res, std::shared_ptr&lt;msg::IMessage&gt; msg)&gt; fn, bool noAutoResolve)
  {
  }
  </code></pre>
  
  <p>The linker is now unhappy about unresolved externals in the following line where I intentionally omitted the last argument:</p>
  
  <pre><code>service_-&gt;send_message(endpoint_, msg, this, [this](int result, msg::TMessagePtr msg){
          // .....
  
      });
  </code></pre>
  
  <p>Is that not possible in c++?</p>
  
  <blockquote>
    <p>Error   LNK1120 1 unresolved externals  QTServer    QTServer.exe    1<br>
    Error   LNK2019 unresolved external symbol "public: void __thiscall NetworkService::send_message(class std::basic_string,class std::allocator >,class std::shared_ptr,class QObject *,class std::function)>)" (?send_message@NetworkService@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$shared_ptr@UIMessage@msg@@@3@PAVQObject@@V?$function@$$A6AXHV?$shared_ptr@UIMessage@msg@@@std@@@Z@3@@Z) referenced in function "public: void __thiscall QTWindow::ExecuteCommand(void)" (?ExecuteCommand@QTWindow@@QAEXXZ)    QTServer    QTWindow.obj    1   </p>
  </blockquote>