From d84c994088c3fd82f579f87673d91c15da5b5cf5 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 29 Jan 2020 16:21:12 -0500 Subject: [PATCH] Redefine return type of MenuTable::Items --- src/commands/CommandManager.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/commands/CommandManager.h b/src/commands/CommandManager.h index d5b894524..59fb72fdf 100644 --- a/src/commands/CommandManager.h +++ b/src/commands/CommandManager.h @@ -745,6 +745,17 @@ namespace MenuTable { Appender fn; }; + template< bool Transparent > + struct MenuPart : ConcreteGroupItem< Transparent, MenuVisitor > + { + template< typename... Args > + MenuPart( const wxString &internalName, Args&&... args ) + : ConcreteGroupItem< Transparent, MenuVisitor >{ + internalName, std::forward< Args >( args )... } + {} + }; + using MenuItems = MenuPart< true >; + // Following are the functions to use directly in writing table definitions. // Group items can be constructed two ways. @@ -755,9 +766,9 @@ namespace MenuTable { // in identification of items by path. Otherwise try to keep the name // stable across Audacity versions. template< typename... Args > - inline std::unique_ptr > Items( + inline std::unique_ptr< MenuItems > Items( const wxString &internalName, Args&&... args ) - { return std::make_unique >( + { return std::make_unique< MenuItems >( internalName, std::forward(args)... ); } // Menu items can be constructed two ways, as for group items