Skip to content

Deprecation warning about std::char_traits<unsigned char> #4163

Closed

Description

@nlohmann

Description

When parsing a binary format from a std::vector<std::uint8_t>, there is a deprecation warning:

Screenshot 2023-09-24 at 11 36 41

Reproduction steps

Call nlohmann::json::from_bjdata on a std::vector<std::uint8_t>.

Expected vs. actual results

Expected: no deprecation warning.

Actual:

Screenshot 2023-09-24 at 11 36 41

Minimal code example

std::vector<std::uint8_t> vec {{ 0x7b, 0x55, 0x0b }};
nlohmann::json j = nlohmann::json::from_bjdata(vec);

Error messages

See screenshot above.

Compiler and operating system

Apple clang version 15.0.0 (clang-1500.0.40.1)

Library version

develop

Validation

Activity

  1. colbychaskell commented on Oct 5, 2023

    @colbychaskell
    Contributor

    @nlohmann I can start working on this

  2. nlohmann commented on Oct 5, 2023

    @nlohmann
    OwnerAuthor

    Sure!

  3. perryHV commented on Oct 8, 2023

    @perryHV

    Hii @nlohmann I want to work on this issue please assign me.

  4. nlohmann commented on Oct 8, 2023

    @nlohmann
    OwnerAuthor

    Hii @nlohmann I want to work on this issue please assign me.

    @colbychaskell is already working on this.

  5. AbuDarda25 commented on Oct 26, 2023

    @AbuDarda25

    please assign this to me .
    I will solve this issue in two days.

  6. nlohmann commented on Oct 26, 2023

    @nlohmann
    OwnerAuthor

    Go ahead.

  7. juwalter commented on Nov 12, 2023

    @juwalter

    I have also been running into this. did you get a chance to work on this @AbuDarda25 @colbychaskell ?

  8. kleuter commented on Nov 13, 2023

    @kleuter

    Very annoying indeed:
    Screenshot 2023-11-13 at 12 22 12

  9. gregmarr commented on Nov 13, 2023

    @gregmarr
    Contributor

    See #4179 for a potential fix.

  10. linked a pull request that will close this issueFix char_traits deprecation warning #4179on Nov 26, 2023
  11. added this to the Release 3.11.3 milestone on Nov 26, 2023
  12. added a commit that references this issue on Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址