Use of 'auto […] 'before deduction of 'auto' with recursive, concept-based function template
- 阅读更多 关于 Use of 'auto […] 'before deduction of 'auto' with recursive, concept-based function template
问题 I wanted to create a deep_flatten function template that would produce a range of elements that are deeply join ed. For example, if we take into account only nested std::vector s, I can have: template <typename T> struct is_vector : public std::false_type { }; template <typename T, typename A> struct is_vector<std::vector<T, A>> : public std::true_type { }; template <typename T> auto deepFlatten(const std::vector<std::vector<T>>& vec) { using namespace std::ranges; if constexpr (is_vector<T>: