C++ modules are not quite here yet. However, some features of C++20 already require to have header-only implementation like bitwise.hpp. Currently, bitwise.hpp is included in map.h which included in many source files. Hence, any change in map.h or bitwise.hpp causes recompilation of many source files, which is not great. Consider following:
Use target_precompile_headers that luckily does exist in cmake>=3.16
Replace inline function declarations in headers with non-inline declarations and inline definitions in source files, because it is totally valid
Research a bit best practices of using pch.h to make it properly defined and used
C++ modules are not quite here yet. However, some features of C++20 already require to have header-only implementation like
bitwise.hpp
. Currently,bitwise.hpp
is included inmap.h
which included in many source files. Hence, any change inmap.h
orbitwise.hpp
causes recompilation of many source files, which is not great. Consider following:target_precompile_headers
that luckily does exist in cmake>=3.16inline
function declarations in headers with non-inline
declarations andinline
definitions in source files, because it is totally validpch.h
to make it properly defined and used