C++ Traits

C++ standard libraries contains type_traits and iterator_traits defined in the libraries <type_traits> and <iterator> respectively. They are used heavily in 202204181536# and 202204182011# but soon deem unnecessary due to the introduction of #202203281200 in C++20.

You could get an #202202241727’s category by using the following alias:

template<typename Iter>
using Iterator_category_v = typename std::iterator_traits<Iter>::iterator_category;
Links to this page
#metaprogramming #cpp