nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
41.33k stars 6.58k forks source link

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

Closed nlohmann closed 7 months ago

nlohmann commented 9 months ago

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

colbychaskell commented 9 months ago

@nlohmann I can start working on this

nlohmann commented 9 months ago

Sure!

perryHV commented 9 months ago

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

nlohmann commented 9 months ago

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

@colbychaskell is already working on this.

AbuDarda25 commented 8 months ago

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

nlohmann commented 8 months ago

Go ahead.

juwalter commented 7 months ago

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

kleuter commented 7 months ago

Very annoying indeed:

Screenshot 2023-11-13 at 12 22 12
gregmarr commented 7 months ago

See #4179 for a potential fix.