mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 22:12:58 +02:00
Define movable_ptr and make_movable, use __AUDACITY_OLD_STD__ in fewer places
This commit is contained in:
@@ -811,7 +811,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
||||
{
|
||||
{
|
||||
// Make a unique_ptr or shared_ptr as appropriate:
|
||||
auto entry = CommandList::value_type{ safenew CommandListEntry() };
|
||||
auto entry = make_movable<CommandListEntry>();
|
||||
|
||||
wxString labelPrefix;
|
||||
if (!mSubMenuList.empty()) {
|
||||
|
@@ -83,11 +83,7 @@ using SubMenuList = std::vector < SubMenuListEntry >;
|
||||
|
||||
// This is an array of pointers, not structures, because the hash maps also point to them,
|
||||
// so we don't want the structures to relocate with vector operations.
|
||||
#ifdef __AUDACITY_OLD_STD__
|
||||
using CommandList = std::vector < std::shared_ptr<CommandListEntry> >;
|
||||
#else
|
||||
using CommandList = std::vector < std::unique_ptr<CommandListEntry> >;
|
||||
#endif
|
||||
using CommandList = std::vector<movable_ptr<CommandListEntry>>;
|
||||
|
||||
WX_DECLARE_STRING_HASH_MAP_WITH_DECL(CommandListEntry *, CommandNameHash, class AUDACITY_DLL_API);
|
||||
WX_DECLARE_HASH_MAP_WITH_DECL(int, CommandListEntry *, wxIntegerHash, wxIntegerEqual, CommandIDHash, class AUDACITY_DLL_API);
|
||||
|
Reference in New Issue
Block a user