summaryrefslogtreecommitdiff
path: root/AK/Tests/TestDistinctNumeric.cpp
AgeCommit message (Collapse)Author
2020-08-10AK: Implement and test DistinctNumeric classBen Wiederhake
This template class allows for easy generation of incompatible numeric types. This is useful whenever code has to handle heterogenous data (like meters and seconds) but the underlying data types are compatible (like int and int). The motivation comes from the Kernel's inconsistent use of pid_t for process and thread IDs even though the ID spaces are incompatible, and translating forth/back is nontrivial. Other uses could be units (as described above), or incompatible index systems. A popular use in real life is image manipulation, when there are multiple coordinate systems.