Added static_assert for transmitting numbers
This commit is contained in:
parent
ecdefe40e7
commit
2a07744575
14
uart.hpp
14
uart.hpp
@ -107,7 +107,7 @@ class Uart {
|
||||
template <typename T, size_t Base = 10>
|
||||
static inline void txNumber(const T &val)
|
||||
{
|
||||
// static_assert(util::is_integral_v<T>, "Only supported on integral types");
|
||||
static_assert(util::is_integral_v<T>, "Only supported on integral types");
|
||||
|
||||
constexpr size_t numDigits = detail::maxNumDigits<T, Base>();
|
||||
typename Driver::data_t buffer[numDigits];
|
||||
@ -175,10 +175,10 @@ class Uart {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(unsigned int) const
|
||||
Uart &operator<<(const unsigned int &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
@ -223,10 +223,10 @@ class Uart {
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(bool) const
|
||||
Uart &operator<<(const bool &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txString(val ? F("true") : F("false"));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
|
Loading…
Reference in New Issue
Block a user