diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab55c25..07ea1fa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ add_executable(kraken kraken.cc) target_link_libraries(kraken PRIVATE common_options) add_subdirectory(csv) +add_subdirectory(utils) target_link_libraries(kraken PRIVATE csv diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt new file mode 100644 index 0000000..51a558b --- /dev/null +++ b/src/utils/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(utils INTERFACE + strong-type.hh +) diff --git a/src/utils/strong-type.hh b/src/utils/strong-type.hh new file mode 100644 index 0000000..bee18e3 --- /dev/null +++ b/src/utils/strong-type.hh @@ -0,0 +1,18 @@ +#pragma once + +namespace kraken::utils { + +/// A very simple strong type wrapper. +template +struct StrongType { + explicit StrongType(T value) : value_(value) {} + + explicit operator T() const { + return value_; + } + +private: + T value_; +}; + +} // namespace kraken::utils