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

Notes about dump function #2027

Closed
mVento3 opened this issue Apr 4, 2020 · 4 comments
Closed

Notes about dump function #2027

mVento3 opened this issue Apr 4, 2020 · 4 comments
Labels
kind: question platform: visual studio related to MSVC state: help needed the issue needs help to proceed

Comments

@mVento3
Copy link

mVento3 commented Apr 4, 2020

Hi, while compiling my project I am getting many those notes:
note: see reference to function template instantiation 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::dump(const int,const char,const bool,const nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::error_handler_t) const' being compiled. Earlier I was compiling my project on windows 7 and it was fine, now i am on windows 10 and i have those notes. It is a bit annoying because it is thousands of this. I am using VS Code, custom build system based on MSVC 19.25.2861 x64 and dev branch of this library. Any solution for that?
Best regards, Aleksander.

@nlohmann
Copy link
Owner

nlohmann commented Apr 5, 2020

Do you have a complete error message, including a line number?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Apr 5, 2020
@mVento3
Copy link
Author

mVento3 commented Apr 5, 2020

Here is full error: ...\external\json\include\nlohmann/json.hpp(8104): note: see reference to function template instantiation 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::dump(const int,const char,const bool,const nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::error_handler_t) const' being compiled additionally I am compiling it using c++17, but earlier I was compiling it in this standard too.

@nlohmann nlohmann removed the state: needs more info the author of the issue needs to provide more details label Apr 5, 2020
@nlohmann
Copy link
Owner

nlohmann commented Apr 5, 2020

Thanks the line in question is the return in

/// hash value for JSON objects
template<>
struct hash<nlohmann::json>
{
    /*!
    @brief return a hash value for a JSON object

    @since version 1.0.0
    */
    std::size_t operator()(const nlohmann::json& j) const
    {
        // a naive hashing via the string representation
        const auto& h = hash<nlohmann::json::string_t>();
        return h(j.dump());
    }
};

Any ideas how to fix this?

@nlohmann nlohmann added platform: visual studio related to MSVC state: help needed the issue needs help to proceed labels Apr 5, 2020
@ArtemSarmini
Copy link
Contributor

ArtemSarmini commented Apr 11, 2020

@MisterVento3 please provide full log with all notes. These notes typically go after actual error message.

@nlohmann nlohmann closed this as completed May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question platform: visual studio related to MSVC state: help needed the issue needs help to proceed
Projects
None yet
Development

No branches or pull requests

3 participants