/* @file unit_concept.hpp */ #pragma once #include "dimension_concept.hpp" namespace xo { namespace unit { /** @brief concept for a Unit type, suitable for use with the quantity template * * Example: * @code * using namespace xo::unit; * static_assert(unit_concept); * @endcode **/ template concept unit_concept = requires(Unit unit) { typename Unit::scalefactor_type; typename Unit::dim_type; typename Unit::canon_type; } && (ratio_concept && bpu_list_concept && bpu_list_concept); /** @brief concept for a Unit type, that contains exactly one basis dimension * * Example: * @code * using namespace xo::unit * static_assert(basis_unit_concept); * @endcode **/ template concept basis_unit_concept = requires(Unit unit) { typename Unit::dim_type; typename Unit::dim_type::rest_type; } && (std::same_as) && (unit_concept); } /*namespace unit*/ } /*namespace xo*/ /* end unit_concept.hpp */