diff --git a/code/include/swoc/swoc_meta.h b/code/include/swoc/swoc_meta.h index bbd0cf6..7da1765 100644 --- a/code/include/swoc/swoc_meta.h +++ b/code/include/swoc/swoc_meta.h @@ -152,6 +152,10 @@ template struct is_any_of { static constexpr bool value = std::disjunction...>::value; }; +/// Helper variable template for is_any_of +template +inline constexpr bool is_any_of_v = is_any_of::value; + /** Type list support class. * * @tparam Types List of types. diff --git a/example/ex_netdb.cc b/example/ex_netdb.cc index 36a5f6c..cae19df 100644 --- a/example/ex_netdb.cc +++ b/example/ex_netdb.cc @@ -120,7 +120,6 @@ BufferWriter& bwformat(BufferWriter& w, bwf::Spec const& spec, FlagSet const& fl } return w; } - } // namespace SWOC_NAMESPACE // These are used to keep pointers for the same string identical so the payloads diff --git a/unit_tests/test_meta.cc b/unit_tests/test_meta.cc index 00ce1c4..b4021e2 100644 --- a/unit_tests/test_meta.cc +++ b/unit_tests/test_meta.cc @@ -53,6 +53,9 @@ TEST_CASE("Meta Example", "[meta][example]") REQUIRE(true == swoc::meta::is_any_of::value); REQUIRE(false == swoc::meta::is_any_of::value); REQUIRE(false == swoc::meta::is_any_of::value); // verify degenerate use case. + + REQUIRE(true == swoc::meta::is_any_of_v); + REQUIRE(false == swoc::meta::is_any_of_v); } // Start of ts::meta testing.