TorstenRobitzki / bluetoe

C++ Framework to build Bluetooth LE Server (GATT)
MIT License
142 stars 29 forks source link

error: ambiguous template instantiation for ... #51

Closed TorstenRobitzki closed 3 years ago

TorstenRobitzki commented 3 years ago

using arm-none-eabi-gcc version 8.3.1 20190703, with C++ version 17 or 2a, the following snipped:

#include <bluetoe/server.hpp>
#include <bluetoe/service.hpp>
#include <bluetoe/characteristic.hpp>

using s = typename bluetoe::details::remove_if_equal<
    std::tuple<
        std::tuple<
            bluetoe::details::characteristic_declaration_parameter,
            bluetoe::characteristic_uuid<745866312, 46925, 19597, 45443, 208696923798549>,
            bluetoe::details::empty_meta_type<bluetoe::details::characteristic_declaration_parameter>
        >,
        std::tuple<
            bluetoe::details::characteristic_value_declaration_parameter,
            bluetoe::characteristic_uuid<745866312, 46925, 19597, 45443, 208696923798549>,
            bluetoe::fixed_uint8_value<8>
        >,
        std::tuple<bluetoe::details::characteristic_user_description_parameter>,
        std::tuple<bluetoe::details::client_characteristic_configuration_parameter>,
        std::tuple<bluetoe::details::descriptor_parameter>
    >,
    std::tuple<bluetoe::details::wildcard>
>::type;

results in the following error message:

/Users/todi/bootloader_poc/bluetoe/bluetoe/utility/include/bluetoe/meta_tools.hpp: In instantiation of 'struct bluetoe::details::remove_if_equal<std::tuple<std::tuple<bluetoe::details::characteristic_user_description_parameter>, std::tuple<bluetoe::details::client_characteristic_configuration_parameter>, std::tuple<bluetoe::details::descriptor_parameter> >, std::tuple<bluetoe::details::wildcard> >':
/Users/todi/bootloader_poc/bluetoe/bluetoe/utility/include/bluetoe/meta_tools.hpp:170:17:   recursively required from 'struct bluetoe::details::remove_if_equal<std::tuple<std::tuple<bluetoe::details::characteristic_value_declaration_parameter, bluetoe::characteristic_uuid<745866312, 46925, 19597, 45443, 208696923798549>, bluetoe::fixed_value<unsigned char, 8> >, std::tuple<bluetoe::details::characteristic_user_description_parameter>, std::tuple<bluetoe::details::client_characteristic_configuration_parameter>, std::tuple<bluetoe::details::descriptor_parameter> >, std::tuple<bluetoe::details::wildcard> >'
/Users/todi/bootloader_poc/bluetoe/bluetoe/utility/include/bluetoe/meta_tools.hpp:170:17:   required from 'struct bluetoe::details::remove_if_equal<std::tuple<std::tuple<bluetoe::details::characteristic_declaration_parameter, bluetoe::characteristic_uuid<745866312, 46925, 19597, 45443, 208696923798549>, bluetoe::details::empty_meta_type<bluetoe::details::characteristic_declaration_parameter> >, std::tuple<bluetoe::details::characteristic_value_declaration_parameter, bluetoe::characteristic_uuid<745866312, 46925, 19597, 45443, 208696923798549>, bluetoe::fixed_value<unsigned char, 8> >, std::tuple<bluetoe::details::characteristic_user_description_parameter>, std::tuple<bluetoe::details::client_characteristic_configuration_parameter>, std::tuple<bluetoe::details::descriptor_parameter> >, std::tuple<bluetoe::details::wildcard> >'
/Users/todi/bootloader_poc/source/bootloader.cpp:23:2:   required from here
/Users/todi/bootloader_poc/bluetoe/bluetoe/utility/include/bluetoe/meta_tools.hpp:170:17: error: ambiguous template instantiation for 'struct bluetoe::details::remove_if_equal<std::tuple<std::tuple<bluetoe::details::characteristic_user_description_parameter> >, std::tuple<bluetoe::details::wildcard> >'
         >::type type;
                 ^~~~

compilation terminated due to -Wfatal-errors. With the same compiler, using C++ version 11 or 14 does not trigger this error.