static_string icon indicating copy to clipboard operation
static_string copied to clipboard

"ambiguous overload" when assigning to std::string

Open Spongman opened this issue 5 years ago • 0 comments

https://godbolt.org/z/88MK6z

#define AK_TOOLKIT_CONFIG_USING_STRING_VIEW 4
//#define AK_TOOLKIT_CONFIG_USING_STRING

#include <static_string.hpp>

namespace sstring = ak_toolkit::static_str;

int Foo()
{
    constexpr auto foo = sstring::literal("foo");
    std::string str1 = foo;
    std::string str2;
    str2 = foo;  // <<--- error: ambiguous overload for 'operator='
}

Spongman avatar Oct 28 '20 06:10 Spongman