S
Steven T. Hatton
If I do:
typedef vector<size_t> v_T;
pair<v_T, v_T> b_T;
b_T bounds(v_T(n), v_T(n)); // if that doesn't work
// std::make_pair(v_T(n), v_T(n));
b_T diff_v(n);
void populate_bounds(&bounds); // all bounds.first <= bounds.second
If I then:
transform(bounds.first.begin(),
bounds.first.end(),
bounds.second.begin(),
diff_v.begin(),
minus<size_t>());
diff_t should get filled with
diff_v == bounds.second - bounds.first
I can then pass diff_v to a function which takes a const &v_T argument. Is
there a way to iliminate diff_v, and simply feed the transform to the
function taking &v_T?
typedef vector<size_t> v_T;
pair<v_T, v_T> b_T;
b_T bounds(v_T(n), v_T(n)); // if that doesn't work
// std::make_pair(v_T(n), v_T(n));
b_T diff_v(n);
void populate_bounds(&bounds); // all bounds.first <= bounds.second
If I then:
transform(bounds.first.begin(),
bounds.first.end(),
bounds.second.begin(),
diff_v.begin(),
minus<size_t>());
diff_t should get filled with
diff_v == bounds.second - bounds.first
I can then pass diff_v to a function which takes a const &v_T argument. Is
there a way to iliminate diff_v, and simply feed the transform to the
function taking &v_T?