OpenCyphal / CETL

Cyphal Embedded Template Library
MIT License
12 stars 3 forks source link

Initializing VLA from std::string causes compile error #61

Closed skeetsaz closed 1 year ago

skeetsaz commented 1 year ago
std::string data = "stuff";
cetl::VariableLengthArray<uint8_t, std::allocator<uint8_t>> foo{
        data.cbegin(),
        data.cend(),
        std::allocator<uint8_t>()
};

Gives a nasty error. Sampling from the error message:

template argument deduction/substitution failed:
mismatched types ‘const SrcType*’ and ‘__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >’