mirror of https://github.com/CGAL/cgal
use one lambda
This commit is contained in:
parent
5da7e84bab
commit
32b31fdc9b
|
|
@ -906,10 +906,9 @@ void get_precached_poly(int var, const NT& key, int /* level */, Poly_1& poly)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(not_cached||not_found) {
|
if(not_cached||not_found) {
|
||||||
poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(),
|
auto fn = [&key1](const Poly_1& poly){ return evaluate(poly, key1); };
|
||||||
std::function<NT(const Poly_1&)>([&key1](const Poly_1& poly){ return evaluate(poly, key1); })),
|
poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(), fn),
|
||||||
::boost::make_transform_iterator(coeffs->end(),
|
::boost::make_transform_iterator(coeffs->end(), fn));
|
||||||
std::function<NT(const Poly_1&)>([&key1](const Poly_1& poly){ return evaluate(poly, key1); })));
|
|
||||||
if(not_cached)
|
if(not_cached)
|
||||||
return;
|
return;
|
||||||
// all available space consumed: drop the least recently used entry
|
// all available space consumed: drop the least recently used entry
|
||||||
|
|
|
||||||
|
|
@ -109,9 +109,10 @@ struct Transform {
|
||||||
typedef typename InputPoly_2::NT NT_in;
|
typedef typename InputPoly_2::NT NT_in;
|
||||||
typedef typename OutputPoly_2::NT NT_out;
|
typedef typename OutputPoly_2::NT NT_out;
|
||||||
Transform<NT_out, NT_in, Op> tr;
|
Transform<NT_out, NT_in, Op> tr;
|
||||||
|
auto fn = [&op, &tr](const NT_in& v){ return tr(v, op); };
|
||||||
return OutputPoly_2(
|
return OutputPoly_2(
|
||||||
::boost::make_transform_iterator(p.begin(), std::function<NT_out(const NT_in&)>([&op, &tr](const NT_in& v){ return tr(v, op); })),
|
::boost::make_transform_iterator(p.begin(), fn),
|
||||||
::boost::make_transform_iterator(p.end(), std::function<NT_out(const NT_in&)>([&op, &tr](const NT_in& v){ return tr(v, op); })));
|
::boost::make_transform_iterator(p.end(), fn));
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPoly_2 operator()(
|
OutputPoly_2 operator()(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue