Skip to content

"ambiguous overload" when assigning to std::string #13

@Spongman

Description

@Spongman

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='
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions