The CPPType class allows writing generic algorithms and data structures. In that way they are similar to c++ templates. The difference is that the type used by templated algorithms and data structures has to be known at compile time. Using CPPType allows writing code that only knows that exact underlying data type at run-time. For more details see the comment in BLI_cpp_type.hh.
CPPType is already the basis for various algorithms and data structures in the functions module. Those are used extensively by geometry nodes but can be useful in more contexts.
We already have other run-time type systems in Blender. Most notably, there is CustomDataType. In its current state, CustomDataType state is not suitable as a generic run-time type system (it was never designed to be one), because it mixes data type and other semantic information about the data. It also does not support arbitrary C++ types (which have life-time semantics) and is centralized (there is a centralized list with all the types).
Given that CPPType is very foundational for generic data structures, I'd like to move it to blenlib. It only depends on blenlib anyway. As a follow up commit, I want to move the generic data structures that exist already to blenlib as well. In most cases, those are the generic version of types that exist in blenlib already. The types to move are GArray, GPointer, GSpan and GVArray (as well as their mutable variants).