Table: support initializer list constructor. (#915)

To avoid burdening the user with explicit type construction when using
the library, we can use a constructor that accepts an initializer list
(std::initializer_list). This allows users to pass initializer lists
directly without having to wrap them in
std::vector<std::vector<std::string>>. This resolves the ambiguous case
when the inner list contains only two elements.

Bug:https://github.com/ArthurSonzogni/FTXUI/issues/912
This commit is contained in:
Arthur Sonzogni
2024-08-13 15:55:09 +02:00
committed by GitHub
parent d7de24cd9e
commit fcd050c017
3 changed files with 29 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ class Table {
Table();
explicit Table(std::vector<std::vector<std::string>>);
explicit Table(std::vector<std::vector<Element>>);
Table(std::initializer_list<std::vector<std::string>> init);
TableSelection SelectAll();
TableSelection SelectCell(int column, int row);
TableSelection SelectRow(int row_index);