diff --git a/README.md b/README.md index 1644102..1bac29b 100644 --- a/README.md +++ b/README.md @@ -314,30 +314,23 @@ You can add menus to existing menus, to get a hierarchy: ```C++ auto rootMenu = make_unique("myprompt"); - auto menuA = make_unique("a_prompt"); -rootMenu->Insert( std::move(menuA) ); - auto menuAA = make_unique("aa_prompt"); -menuA->Insert( std::move(menuAA) ); - auto menuAB = make_unique("ab_prompt"); -menuA->Insert( std::move(menuAB) ); - auto menuAC = make_unique("ac_prompt"); -menuA->Insert( std::move(menuAC) ); - auto menuACA = make_unique("aca_prompt"); -menuAC->Insert( std::move(menuACA) ); - auto menuB = make_unique("b_prompt"); -rootMenu->Insert( std::move(menuB) ); - auto menuBA = make_unique("ba_prompt"); -menuB->Insert( std::move(menuBA) ); - auto menuBB = make_unique("bb_prompt"); + +menuAC->Insert( std::move(menuACA) ); +menuB->Insert( std::move(menuBA) ); menuB->Insert( std::move(menuBB) ); +menuA->Insert( std::move(menuAA) ); +menuA->Insert( std::move(menuAB) ); +menuA->Insert( std::move(menuAC) ); +rootMenu->Insert( std::move(menuA) ); +rootMenu->Insert( std::move(menuB) ); ``` This results in this tree: