diff --git a/include/etl/generators/message_packet_generator.h b/include/etl/generators/message_packet_generator.h index f15efb03..354601b9 100644 --- a/include/etl/generators/message_packet_generator.h +++ b/include/etl/generators/message_packet_generator.h @@ -88,13 +88,13 @@ namespace etl private: template - static constexpr bool IsMessagePacket = etl::is_same_v< etl::remove_const_t>, etl::message_packet>; + static constexpr bool IsMessagePacket = etl::is_same_v>, etl::message_packet>; template static constexpr bool IsInMessageList = etl::is_one_of_v>, TMessageTypes...>; template - static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; + static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; public: @@ -102,7 +102,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + constexpr message_packet() noexcept : valid(false) { } @@ -403,14 +403,14 @@ namespace etl { private: - //template - //static constexpr bool IsMessagePacket = etl::is_same_v< etl::remove_const_t>, etl::message_packet>; + template + static constexpr bool IsMessagePacket = etl::is_same_v>, etl::message_packet>; template static constexpr bool IsInMessageList = false; template - static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; + static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; public: @@ -418,7 +418,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + constexpr message_packet() noexcept { } #include "private/diagnostic_pop.h" @@ -620,7 +620,7 @@ namespace etl cog.outl(" //********************************************") cog.outl("#include \"private/diagnostic_uninitialized_push.h\"") - cog.outl(" message_packet()") + cog.outl(" ETL_CONSTEXPR message_packet() ETL_NOEXCEPT") cog.outl(" : valid(false)") cog.outl(" {") cog.outl(" }") @@ -934,7 +934,7 @@ namespace etl cog.outl(" //********************************************") cog.outl("#include \"private/diagnostic_uninitialized_push.h\"") - cog.outl(" message_packet()") + cog.outl(" ETL_CONSTEXPR message_packet() ETL_NOEXCEPT") cog.outl(" : valid(false)") cog.outl(" {") cog.outl(" }") @@ -1219,7 +1219,7 @@ namespace etl using message_types = etl::type_list<>; #endif - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } diff --git a/include/etl/generators/message_router_generator.h b/include/etl/generators/message_router_generator.h index 1f8e19da..02140088 100644 --- a/include/etl/generators/message_router_generator.h +++ b/include/etl/generators/message_router_generator.h @@ -623,7 +623,7 @@ namespace etl //********************************************** using imessage_router::accepts; - bool accepts(etl::message_id_t /*id*/) const ETL_OVERRIDE + bool accepts(etl::message_id_t id) const ETL_OVERRIDE { if (has_successor()) { diff --git a/include/etl/message_packet.h b/include/etl/message_packet.h index 9c6f5eb1..a097d55c 100644 --- a/include/etl/message_packet.h +++ b/include/etl/message_packet.h @@ -76,13 +76,13 @@ namespace etl private: template - static constexpr bool IsMessagePacket = etl::is_same_v< etl::remove_const_t>, etl::message_packet>; + static constexpr bool IsMessagePacket = etl::is_same_v>, etl::message_packet>; template static constexpr bool IsInMessageList = etl::is_one_of_v>, TMessageTypes...>; template - static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; + static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; public: @@ -90,7 +90,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + constexpr message_packet() noexcept : valid(false) { } @@ -391,14 +391,14 @@ namespace etl { private: - //template - //static constexpr bool IsMessagePacket = etl::is_same_v< etl::remove_const_t>, etl::message_packet>; + template + static constexpr bool IsMessagePacket = etl::is_same_v>, etl::message_packet>; template static constexpr bool IsInMessageList = false; template - static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; + static constexpr bool IsIMessage = etl::is_same_v>, etl::imessage>; public: @@ -406,7 +406,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + constexpr message_packet() noexcept { } #include "private/diagnostic_pop.h" @@ -528,7 +528,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -856,7 +856,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -1182,7 +1182,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -1505,7 +1505,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -1824,7 +1824,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -2137,7 +2137,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -2447,7 +2447,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -2754,7 +2754,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -3057,7 +3057,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -3354,7 +3354,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -3648,7 +3648,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -3939,7 +3939,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -4226,7 +4226,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -4507,7 +4507,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -4785,7 +4785,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -5060,7 +5060,7 @@ namespace etl //******************************************** #include "private/diagnostic_uninitialized_push.h" - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } @@ -5331,7 +5331,7 @@ namespace etl using message_types = etl::type_list<>; #endif - message_packet() + ETL_CONSTEXPR message_packet() ETL_NOEXCEPT : valid(false) { } diff --git a/include/etl/message_router.h b/include/etl/message_router.h index 42735ab0..b53d9071 100644 --- a/include/etl/message_router.h +++ b/include/etl/message_router.h @@ -611,7 +611,7 @@ namespace etl //********************************************** using imessage_router::accepts; - bool accepts(etl::message_id_t /*id*/) const ETL_OVERRIDE + bool accepts(etl::message_id_t id) const ETL_OVERRIDE { if (has_successor()) { diff --git a/include/etl/type_list.h b/include/etl/type_list.h index 2d0dcdac..19eddc15 100644 --- a/include/etl/type_list.h +++ b/include/etl/type_list.h @@ -59,6 +59,11 @@ namespace etl template struct is_type_list> : etl::true_type {}; +#if ETL_USING_CPP17 + template + inline constexpr bool is_type_list_v = is_type_list::value; +#endif + //*************************************************************************** /// The empty type list. //*************************************************************************** diff --git a/test/test_message_router.cpp b/test/test_message_router.cpp index a6691297..cfe2e9b1 100644 --- a/test/test_message_router.cpp +++ b/test/test_message_router.cpp @@ -448,31 +448,6 @@ namespace CHECK_EQUAL(1, r1.message4_count); CHECK_EQUAL(0, r1.message_unknown_count); CHECK_EQUAL(4, r2.callback_count); - - //// Send from the null router. - //etl::send_message(r0, message1); - //CHECK_EQUAL(1, r2.message1_count); - //CHECK_EQUAL(0, r2.message2_count); - //CHECK_EQUAL(0, r2.message4_count); - //CHECK_EQUAL(0, r2.message_unknown_count); - - //etl::send_message(r0, message2); - //CHECK_EQUAL(1, r2.message1_count); - //CHECK_EQUAL(1, r2.message2_count); - //CHECK_EQUAL(0, r2.message4_count); - //CHECK_EQUAL(0, r2.message_unknown_count); - - //etl::send_message(r0, message3); - //CHECK_EQUAL(1, r2.message1_count); - //CHECK_EQUAL(1, r2.message2_count); - //CHECK_EQUAL(0, r2.message4_count); - //CHECK_EQUAL(1, r2.message_unknown_count); - - //etl::send_message(r0, message4); - //CHECK_EQUAL(1, r2.message1_count); - //CHECK_EQUAL(1, r2.message2_count); - //CHECK_EQUAL(1, r2.message4_count); - //CHECK_EQUAL(1, r2.message_unknown_count); } //************************************************************************* diff --git a/test/test_type_list.cpp b/test/test_type_list.cpp index cd53981c..b8124dee 100644 --- a/test/test_type_list.cpp +++ b/test/test_type_list.cpp @@ -37,6 +37,24 @@ namespace #if ETL_USING_CPP11 SUITE(test_type_list) { + //************************************************************************* + TEST(test_is_type_list) + { + using t0 = etl::type_list<>; + using t1 = etl::type_list; + using t2 = int; + + CHECK_TRUE((etl::is_type_list::value)); + CHECK_TRUE((etl::is_type_list::value)); + CHECK_FALSE((etl::is_type_list::value)); + +#if ETL_USING_CPP17 + CHECK_TRUE((etl::is_type_list_v)); + CHECK_TRUE((etl::is_type_list_v)); + CHECK_FALSE((etl::is_type_list_v)); +#endif + } + //************************************************************************* TEST(test_type_list_select) {