Skip to content

json::parse of std::string being underlined by Visual Studio #402

Closed

Description

@Noitidart

This was just a nit pick. I don't know why but it keeps underlining my json::parse from strings. I use json::parse on varaibles like this:

	void listenMain(std::string payload_str) {
            json payload = json::parse(payload_str);

This compiles, but it gets underlined by visual studio like this:

Do you know why this is? It works fine. Is there a way to properly use json::parse with variables?

Thank you!

Activity

  1. gregmarr commented on Dec 21, 2016

    @gregmarr
    Contributor

    The compiler used by Intellisense is not the same as the compiler used to build the program. The Intellisense compiler doesn't always have all the information it needs to figure out whether something is valid or not, unfortunately. As long as the program compiles, you'd need to report this Intellisense failure to Microsoft.

  2. Noitidart commented on Dec 21, 2016

    @Noitidart
    Author

    Ah interesting @gregmarr thanks for sharing that! I'll do some research and see if I can fix it. Will report back what I find. :)

  3. nlohmann commented on Dec 22, 2016

    @nlohmann
    Owner

    Thanks @Noitidart. I shall close this issue in the meantime as there is nothing we can do about it.

  4. Noitidart commented on Dec 22, 2016

    @Noitidart
    Author

    Makes total sense thanks for telling me before closing. :)

  5. Noitidart commented on Jan 1, 2017

    @Noitidart
    Author

    Hey all, I found a weird fix for this silly issue. If I do .c_str() it doesnt underline it. It makes no sense to me. Does this make sense to anyone?

      json payload = json::parse(payload_str.c_str());
    
  6. nlohmann commented on Jan 1, 2017

    @nlohmann
    Owner

    @Noitidart Thanks for checking back!

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions