Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wcy168 opened this issue Apr 19, 2024 · 5 comments

Comments

@wcy168
Copy link

wcy168 commented Apr 19, 2024

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!

@grisumbras
Copy link
Member

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?

@wcy168
Copy link
Author

wcy168 commented Apr 21, 2024

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.

@grisumbras
Copy link
Member

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

@wcy168
Copy link
Author

wcy168 commented Apr 22, 2024

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

@grisumbras
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants