.. _program_listing_file_include_predicates.hpp: Program Listing for File predicates.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``include/predicates.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "htlist.hpp" #include #include #include #include #include namespace ctql { template concept HasStaticSize = requires { { T::size } -> std::convertible_to; }; template struct Size { using type = T; static constexpr std::size_t size = T::size; }; template struct SizeOf { using type = T; static constexpr std::size_t size = sizeof(T); }; template struct AlignOf { using type = T; static constexpr std::size_t size = alignof(T); }; template struct cmp { static constexpr bool value = Cmp{}(static_cast(A::size), static_cast(B::size)); }; template struct PredBy { template struct t { static constexpr bool value = cmp::value; }; }; template struct op_tag { template using pred = typename PredBy::template t; }; struct ops { using leq = op_tag>; using geq = op_tag>; using lt = op_tag>; using gt = op_tag>; using eq = op_tag>; using neq = op_tag>; }; template using op_type = ctql::match_t< str, case_<"<="_ct, ops::leq>, case_<"<"_ct, ops::lt>, case_<">="_ct, ops::geq>, case_<">"_ct, ops::gt>, case_<"=="_ct, ops::eq>, case_<"!="_ct, ops::neq>, default_ >; template using Size_t = detail::HTList...>; template using SizeOf_t = detail::HTList...>; template using AlignOf_t = detail::HTList...>; template