boostorg / json

A C++11 library for parsing and serializing JSON to and from a DOM container in memory.
https://boost.org/libs/json
Boost Software License 1.0
432 stars 94 forks source link

boost::json::value_to on std::bitset? #966

Closed infn-ke closed 9 months ago

infn-ke commented 9 months ago

Does boost json support std::bitset? On boost json 1.82 I cannot use boost::json::value_to on a std::bitset, does this require a custom tag_invoke?

grisumbras commented 9 months ago

We don't support it at the moment. But we probably should.

infn-ke commented 9 months ago

Ok, thanks for confirming. I added handling of them using ADL and that works for me.

pdimov commented 9 months ago

What is your chosen JSON representation of a std::bitset?

infn-ke commented 9 months ago

I made to_ulong on the bitset. I only had 16 and 32 bitsets.

grisumbras commented 9 months ago

Maybe I should reopen the issue and rename it to "add conversion implementation for std::bitset"?

infn-ke commented 9 months ago

Maybe I should reopen the issue and rename it to "add conversion implementation for std::bitset"?

Ok for me if you want. I guess I would have to remove my tag_invoke implementation once boost natively handles bitsets?