Click here to Skip to main content
15,949,686 members

Comments by honey the codewitch (Top 200 by date)

honey the codewitch 20-Jul-24 0:29am View    
FreeRTOS has a built in thread safe circular buffer for uneven length items, but I'm not sure it's appropriate here.
honey the codewitch 26-Jun-24 14:24pm View    
It makes a surprising amount of sense to me. It's simpler than anything I expected I'd have to do.
honey the codewitch 26-Jun-24 10:49am View    
actually someone just solved it for me. Thanks!

and it was simple. so simple I feel dumb. LOL

// sets the integer channel value by name
template<typename name="">
constexpr inline void channel(typename channel_by_index<channel_index_by_name<name>::value>::int_type value) {
constexpr const int index = channel_index_by_name<name>::value;
channel<index>(value);
}

// sets the integer channel values by name
template<typename name1,="" typename...="" names="">
constexpr inline void channel(typename channel_by_index<type::channel_index_by_name<name1>::value>::int_type value1,
typename type::channel_by_index<channel_index_by_name<names>::value>::int_type... values) {
constexpr const int index1 = type::channel_index_by_name<name1>::value;
channel<index1>(value1);
channel<names...>(values...);
}
honey the codewitch 26-Jun-24 10:41am View    
template<typename name="">
constexpr inline void channel(typename channel_by_index<channel_index_by_name<name>::value>::int_type value) {
constexpr const int index = channel_index_by_name<name>::value;
channel<index>(value);
}

and then

template<typename name=""> using channel_index_by_name = typename helpers::channel_index_by_name_impl<0,Name,ChannelTraits...>;
honey the codewitch 26-Jun-24 10:23am View    
I'll have to figure out SFINAE with std to do that.