Category : struct

We have Boost.PFR and we have the tuple iterator. If we combine the two, we might have a way of applying std algorithms over structs. Does a solution already exist? What I’m looking for is: S a, b; auto const ra(to_range(a)), rb(to_range(b)); std::transform(ra.begin(), ra.end(), rb.begin(), [](auto&& a)noexcept{return a;}); This would allow us to use the ..

Read more

I am working on a simulation program of Feedback Scheduling in operating systems. I have a struct process_t like this. struct process_t { int process_id; int my_queue; int arrival_time; vector<service_t> service_seq; service_t cur_service; string next_service_type; int cur_service_idx; int cur_service_tick; // for counting time spent on the service vector<int> working; // for logging the result } ..

Read more