hh
Size: a a a
hh
hh
N
A
D
T&
is not an object typeD
D
D
std::is_object_v<int> // true
std::is_object_v<int&> // false
N
D
N
D
AP
ПК
D
LA
x
x
известно в компайл таймеtemplate <typename X, typename C, typename F>
constexpr std::list<X> foo(X x, C&& c, F&& f) {
if (c(x)) {
auto l = foo(f(x), std::forward<C>(c), std::forward<F>(f));
l.push_front(x);
return l;
}
else {
return std::list<X>{};
}
}
N
D
template <typename X, typename C, typename F>
constexpr std::list<X> foo(X x, C&& c, F&& f) {
if (c(x)) {
auto l = foo(f(x), std::forward<C>(c), std::forward<F>(f));
l.push_front(x);
return l;
}
else {
return std::list<X>{};
}
}
LA
D