title: Call to overloaded to_string ambiguous
body: <p>I have two files: error.h and error.cpp. Compiling with</p>
  
  <pre><code>g++ -std=c++0x
  </code></pre>
  
  <p>gives me an error:</p>
  
  <pre><code>error.cpp:9:33:**call of overloaded "to_string(char*&amp;)" is ambiguous**
  </code></pre>
  
  <p>How can i fix this problem?</p>
  
  <p>error.h:</p>
  
  <pre><code>  1 #ifndef ERROR_H_GUARD
    2 #define ERROR_H_GUARD
    4 #include &lt;string&gt;
    6 class Error {
    7   public:
    8     Error(int pos, std::string&amp; msg); 
   10     Error(int pos, char* msg); 
   12     const char* what() throw();
   14   private:
   15     std::string msg;
   17     void setMsg(int pos, std::string&amp; msg);
   18 };
   19 
   20 #endif
  </code></pre>
  
  <p>error.cpp:</p>
  
  <pre><code>  2 #include "error.h"
    4 Error::Error(int pos, std::string&amp; msg){
    5   setMsg(pos, msg);
    6 }
    8 Error::Error(int pos, char* msg) {
    9   setMsg(pos, std::to_string(msg));
   10 }   
   12 const char* Error::what() throw() {
   13   return msg.c_str();
   14 } 
   16 void Error::setMsg(int pos, std::string&amp; msg){
   17   this-&gt;msg = std::to_string(pos) + msg + std::string("\n") + std::string(pos - 1, ' ') + std::string("^");
   18 }
  </code></pre>