json icon indicating copy to clipboard operation
json copied to clipboard

Can the value_from function add iterator parameters, such as value_from (Iterator begin, Iterator end)

Open wcy168 opened this issue 10 months ago • 5 comments

PLEASE DON'T FORGET TO "STAR" THIS REPOSITORY :)

When reporting a bug please include the following:

Version of Boost

You can find the version number in the file <boost/version.hpp>

Steps necessary to reproduce the problem

A small compiling program is the best. If your code is public, you can provide a link to the repository.

All relevant compiler information

If you are unable to compile please include the type and version of compiler you are using as well as all compiler output including the error message, file, and line numbers involved.

The more information you provide the sooner your issue can get resolved!

wcy168 avatar Apr 19 '24 08:04 wcy168

You didn't explain the desired semantics, so I assume it's supposed to produces a json::value that stores an array. So, my questions are these. Why converting a sequence object doesn't work for you? Where do you get the iterators?

grisumbras avatar Apr 19 '24 09:04 grisumbras

You don't have the required semantics to explain, so I think it should produce a store. Why doesn't converting sequence objects work for you? Where do you get iterators?json::value``array

Due to the large amount of data in my sequential container, I can only send a part of it at a time. Therefore, I need to serialize just this portion, so I expect to transmit the iterator range.

wcy168 avatar Apr 21 '24 09:04 wcy168

But can't you wrap two iterators into a range-like class? This one should work: https://www.boost.org/doc/libs/1_85_0/libs/range/doc/html/range/reference/utilities/iterator_range.html But if you have access to C++20, this should also work: https://en.cppreference.com/w/cpp/ranges/subrange

grisumbras avatar Apr 21 '24 11:04 grisumbras

But can't you wrap two iterators into a range-like class? This one should work: https://www.boost.org/doc/libs/1_85_0/libs/range/doc/html/range/reference/utilities/iterator_range.html But if you have access to C++20, this should also work: https://en.cppreference.com/w/cpp/ranges/subrange

good idea,thank you

wcy168 avatar Apr 22 '24 02:04 wcy168

So, did it work for you? Can I close this?

grisumbras avatar Apr 22 '24 07:04 grisumbras