mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-27 16:17:31 -04:00
View::add_children: Use std::list_initializer as argument.
Improvement in code size -- 944 bytes. Some day I will understand C++11 well enough to do the right thing the first time.
This commit is contained in:
parent
298324d6e4
commit
8a69b0523e
16 changed files with 57 additions and 55 deletions
|
@ -232,9 +232,11 @@ void View::add_child(Widget* const widget) {
|
|||
}
|
||||
}
|
||||
|
||||
void View::add_children(const std::vector<Widget*>& children) {
|
||||
void View::add_children(const std::initializer_list<Widget*> children) {
|
||||
children_.insert(std::end(children_), children);
|
||||
for(auto child : children) {
|
||||
add_child(child);
|
||||
child->set_parent(this);
|
||||
child->set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue