How do I capture the results of a recursive function at compile-time?
问题 #include <iostream> template <typename T> struct node { T value; node const* prev; constexpr node(const T& value, node const* prev = nullptr) : value{value}, prev{prev} {} constexpr node push_front(const T& value) const { return node(value, this); } }; struct Something { node<int> n; constexpr Something(const int i) : n{node<int>(i)} {} constexpr Something(const node<int>& n) : n{n} {} }; constexpr void print(const Something& s) { bool first = true; for (const node<int>* i = &s.n; i !=