diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 5733f0dc76..d7084fb7ba 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -7,6 +7,7 @@ #include #include +#include #include #ifdef ESPHOME_LOG_HAS_VERY_VERBOSE @@ -289,11 +290,9 @@ class ProtoWriteBuffer { void encode_varint(uint32_t value) { this->encode_varint(static_cast(value)); } // size_t overload (only enabled if size_t is distinct from uint32_t and uint64_t) - template::value && !std::is_same::value && - !std::is_same::value, - int>::type = 0> - void encode_varint(T value) { + template + requires std::is_same_v && !std::is_same_v && + !std::is_same_v void encode_varint(T value) { this->encode_varint(static_cast(value)); }