title: How to prevent constructor from casting argument types in c++?
body: <p>I have a class to store big unsigned numbers and I'd like to allow user to create object using types such as <code>long long</code>, <code>int</code>, <code>unsigned int</code> and so on and also from <code>string</code> . I created a constructor <code>BigNumber(const unsigned long long)</code> and <code>BigNumber(const std::string)</code> but I want to disallow user to use constructions like: <code>BigNumber('a')</code> or <code>BigNumber(true)</code>. I heard about <code>explicit</code> so I decided to write in my class definition following lines:</p>
  
  <p><code>explicit BigNumber(const bool) = delete;
  explicit BigNumber(const char) = delete;</code></p>
  
  <p>Unfortunately when I want to create object like: <code>BigNumber x(1)</code> or <code>BigNumber("1234")</code> I get error that call of overloaded constructor is ambiguous. I didn't get this message before I wrote these lines with  <code>explicit</code>. How to solve this problem?</p>