1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

movable_ptr(_with_deleter) -> std::unique_ptr

This commit is contained in:
Paul Licameli
2018-04-16 13:47:44 -04:00
parent b8a8712ba0
commit a9e7a7e5d5
53 changed files with 69 additions and 69 deletions

View File

@@ -77,7 +77,7 @@ OldStyleCommandType *CommandDirectory::LookUp(const wxString &cmdName) const
return iter->second.get();
}
void CommandDirectory::AddCommand(movable_ptr<OldStyleCommandType> &&type)
void CommandDirectory::AddCommand(std::unique_ptr<OldStyleCommandType> &&type)
{
wxASSERT(type != NULL);
// Internal string is shown but only in assertion message

View File

@@ -44,7 +44,7 @@ public:
OldStyleCommandType *LookUp(const wxString &cmdName) const;
/// Register a type of command with the directory.
void AddCommand(movable_ptr<OldStyleCommandType> &&type);
void AddCommand(std::unique_ptr<OldStyleCommandType> &&type);
/// Get a pointer to the singleton instance
static CommandDirectory *Get();

View File

@@ -90,11 +90,11 @@ struct CommandListEntry
using MenuBarList = std::vector < MenuBarListEntry >;
// to do: remove the extra indirection when Mac compiler moves to newer version
using SubMenuList = std::vector < movable_ptr<SubMenuListEntry> >;
using SubMenuList = std::vector < std::unique_ptr<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.
using CommandList = std::vector<movable_ptr<CommandListEntry>>;
using CommandList = std::vector<std::unique_ptr<CommandListEntry>>;
namespace std
{

View File

@@ -29,10 +29,10 @@ typedef std::map<wxString, bool> ParamBoolMap;
// Map from parameter name to a suitable Validator
// to do: use hash
typedef std::map<wxString, movable_ptr<Validator>> ValidatorMap;
typedef std::map<wxString, std::unique_ptr<Validator>> ValidatorMap;
// Map from command name to type
// to do: use hash
typedef std::map<wxString, movable_ptr<OldStyleCommandType>> CommandMap;
typedef std::map<wxString, std::unique_ptr<OldStyleCommandType>> CommandMap;
#endif /* End of include guard: __COMMANDMISC__ */

View File

@@ -24,7 +24,7 @@ CommandSignature::~CommandSignature()
void CommandSignature::AddParameter(const wxString &name,
const wxVariant &dft,
movable_ptr<Validator> &&valid)
std::unique_ptr<Validator> &&valid)
{
wxASSERT_MSG(valid->Validate(dft),
wxT("Invalid command signature: the default value of '")

View File

@@ -41,7 +41,7 @@ public:
// valid: a suitable validator (caller doesn't need to DELETE it)
void AddParameter(const wxString &name,
const wxVariant &dft,
movable_ptr<Validator> &&valid);
std::unique_ptr<Validator> &&valid);
// Methods for accessing the signature
ParamValueMap GetDefaults() const;