Treeview example iterator
This commit is contained in:
parent
9df509dd3b
commit
4acca85a13
|
@ -173,9 +173,9 @@ class Treeview final : public finalcut::FDialog
|
||||||
void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
bool initialized{false};
|
bool initialized{false};
|
||||||
finalcut::FListView listview{this};
|
finalcut::FListView listview{this};
|
||||||
finalcut::FButton quit{this};
|
finalcut::FButton quit{this};
|
||||||
std::vector<TreeItem> africa{initAfrica()};
|
std::vector<TreeItem> africa{initAfrica()};
|
||||||
std::vector<TreeItem> asia{initAsia()};
|
std::vector<TreeItem> asia{initAsia()};
|
||||||
std::vector<TreeItem> europe{initEurope()};
|
std::vector<TreeItem> europe{initEurope()};
|
||||||
|
@ -191,11 +191,13 @@ class Treeview final : public finalcut::FDialog
|
||||||
|
|
||||||
struct Treeview::TreeItem
|
struct Treeview::TreeItem
|
||||||
{
|
{
|
||||||
const char* const* begin() const
|
using const_iterator = const char* const*;
|
||||||
|
|
||||||
|
const_iterator begin() const noexcept
|
||||||
{ return &name; }
|
{ return &name; }
|
||||||
|
|
||||||
const char* const* end() const
|
const_iterator end() const noexcept
|
||||||
{ return &density + 1; }
|
{ return std::next(&density); }
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
const char* name;
|
const char* name;
|
||||||
|
|
Loading…
Reference in New Issue