Skip to content

Ambiguous call to overloaded function #2210

Description

I'm using json object with Electronic Arts' EASTL library, just like in #2059, and after a recent json update, I get:

1>P:\bcview\external\json\include\nlohmann\detail\input\input_adapters.hpp(377,1): error C2668: 'eastl::begin': ambiguous call to overloaded function (compiling source file ..\src\materialcache.cpp)
1>P:\bcview\external\EASTL\include\EASTL\iterator.h(1074,34): message : could be 'const char *eastl::begin<ContainerType>(const Container &)' [found using argument-dependent lookup]
1>        with
1>        [
1>            ContainerType=bc9::stdstring,
1>            Container=bc9::stdstring
1>        ] (compiling source file ..\src\materialcache.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xutility(1966,30): message : or       'const char *std::begin<ContainerType>(const _Container &)'
1>        with
1>        [
1>            ContainerType=bc9::stdstring,
1>            _Container=bc9::stdstring
1>        ] (compiling source file ..\src\materialcache.cpp)
1>P:\bcview\external\json\include\nlohmann\detail\input\input_adapters.hpp(377,1): message : while trying to match the argument list '(const ContainerType)'

It seems to be having a problem here (in input_adapters.hpp):

template<typename ContainerType>
auto input_adapter(const ContainerType& container) -> decltype(input_adapter(begin(container), end(container)))
{
    // Enable ADL
    using std::begin;
    using std::end;

    return input_adapter(begin(container), end(container));
}

I worked around the issue locally by just adding std::

    return input_adapter(std::begin(container), std::end(container));

but doesn't seem like I should've had to do that?

I've got json commit 7444c7, Windows 10, MSVC 2019.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions