Converting to a std::string
requires a “user defined conversion”.
Converting to void const*
does not.
User defined conversions are ordered behind built in ones.
Related Contents:
- Why is a public const method not called when the non-const one is private?
- String literal matches bool overload instead of std::string
- Why is an overloaded function with two arguments of type double called when passing a long long?
- How to concatenate a std::string and an int
- C++ multiline string literal
- convert a char* to std::string
- Is it possible to use std::string in a constexpr?
- Single quotes vs. double quotes in C or C++
- How to trim an std::string?
- Alternative to itoa() for converting integer to string C++? [duplicate]
- Default parameters with C++ constructors [closed]
- Legality of COW std::string implementation in C++11
- How to get the number of characters in a std::string?
- How does `is_base_of` work?
- How to efficiently get a `string_view` for a substring of `std::string`
- Overloading by return type
- Why does the most negative int value cause an error about ambiguous function overloads?
- How do you convert CString and std::string std::wstring to each other?
- What is the point of STL Character Traits?
- char* vs std::string in c++ [closed]
- c++ integer->std::string conversion. Simple function?
- What is the use of const overloading in C++?
- Padding stl strings in C++
- Why does the compiler match “char” to “int” but not “short”?
- Why is my log in the std namespace?
- Is main() overloaded in C++?
- Overload bracket operators [] to get and set
- I want to convert std::string into a const wchar_t *
- std::string::c_str() and temporaries
- Are there downsides to using std::string as a buffer?
- Overload resolution between object, rvalue reference, const reference
- How to construct a std::string from a std::vector?
- How to check if a string contains a char?
- what does cout
- How is ambiguity determined in the overload resolution algorithm?
- Why does the number of elements in a initializer list cause an ambiguous call error?
- What are the pitfalls of ADL?
- Overload resolution for inherited functions
- Why are my two tuples containing strings, created the same way, not equal?
- Remove First and Last Character C++
- Any reason to overload global new and delete?
- Value and size of an uninitialized std::string variable in c++
- How can I get double quotes into a string literal?
- C/C++, can you #include a file into a string literal? [duplicate]
- Differentiate between function overloading and function overriding
- Why do string literals (char*) in C++ have to be constants?
- Why do multiple-inherited functions with same name but different signatures not get treated as overloaded functions?
- Include )” in raw string literal without terminating said literal
- C++20 with u8, char8_t and std::string
- How do you convert a C++ string to an int? [duplicate]