ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
select_traits.cpp
Go to the documentation of this file.
1#include "select_traits.h"
2
3namespace esphome::select {
4
5// Runtime option lists are copied, since the argument may not outlive the select; one
6// out of line copy keeps a single instance of the copy code.
7void SelectTraits::set_options_copy_(const char *const *options, size_t count) {
8 this->options_.assign_copy(options, count);
9}
10
11void SelectTraits::set_options(const std::initializer_list<const char *> &options) {
12 this->set_options_copy_(options.begin(), options.size());
13}
14
18
19} // namespace esphome::select
Fixed-capacity vector - sized once through init() or try_init(); push_back never reallocates This avo...
Definition helpers.h:624
void set_options(const SelectOptions &options)
Runtime lists: the pointer list is copied, as before; the strings must still outlive the select.
void set_options_copy_(const char *const *options, size_t count)
uint8_t options
unsigned count
Definition gif.cpp:51