Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json.hpp won;t compile VS2019 CLR/CLI app but does in console app #1754

Closed
dmfoley734 opened this issue Sep 18, 2019 · 1 comment
Closed
Labels
kind: question state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated

Comments

@dmfoley734
Copy link

I am very new to c++ and trying to use the json.hpp within a CLR/CLI app but the compiler is having trouble and returning '': cannot convert from 'std::basic_string<char,std::char_traits,std::allocator>' to 'BasicJsonType'
with [ BasicJsonType=nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer ] @ the bool key(string_t% val)
but when compiled in a console app there are no issues

bool key(string_t& val)
{
BasicJsonType k = BasicJsonType(val); <<<<<<<<<<<<<<<<<<<ERROR

    // check callback for key
    const bool keep = callback(static_cast<int>(ref_stack.size()), parse_event_t::key, k);
    key_keep_stack.push_back(keep);

    // add discarded value at given key and store the reference for later
    if (keep and ref_stack.back())
    {
        object_element = &(ref_stack.back()->m_value.object->operator[](val) = discarded);
    }

    return true;
}

I have tried copying the single include code directly into a new hpp file, building under Default, C++14, C++17

Windows 10 SDK latest, Visual Studio 2019 v142, C++ Default

Receive the same error in 3.5,3.6 and 3.7 versions

@stale
Copy link

stale bot commented Oct 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Oct 18, 2019
@stale stale bot closed this as completed Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

No branches or pull requests

1 participant