diff --git a/src/WordList.cpp b/src/WordList.cpp index 16f3b92e86..d883994a76 100644 --- a/src/WordList.cpp +++ b/src/WordList.cpp @@ -73,9 +73,8 @@ struct WordList::Impl { }; -WordList::WordList() +WordList::WordList() : d(new Impl) { - d = new Impl; d->c_ = 0; #if 0 @@ -86,12 +85,6 @@ WordList::WordList() } -WordList::~WordList() -{ - delete d; -} - - docstring const & WordList::word(size_t idx) const { Impl::Words::const_iterator it = d->words_.find_summed_weight(idx); diff --git a/src/WordList.h b/src/WordList.h index d21f9c8c7e..5b0488bb04 100644 --- a/src/WordList.h +++ b/src/WordList.h @@ -14,18 +14,14 @@ #include "support/docstring.h" +#include + namespace lyx { class WordList { - // noncopyable because of pimpl - WordList(WordList const &); - WordList & operator=(WordList const &); public: /// WordList(); - /// - ~WordList(); - /// docstring const & word(size_t idx) const; /// @@ -39,7 +35,7 @@ public: private: struct Impl; - Impl * d; + std::unique_ptr d; }; WordList * theWordList(std::string const & lang); diff --git a/src/insets/ExternalTemplate.h b/src/insets/ExternalTemplate.h index 8ba8672967..d6be5734ab 100644 --- a/src/insets/ExternalTemplate.h +++ b/src/insets/ExternalTemplate.h @@ -125,11 +125,11 @@ public: * If it isn't found, return an empty std::string. */ std::string const getPreambleDefByName(std::string const & name) const; + /// noncopyable + TemplateManager(TemplateManager const &) = delete; + void operator=(TemplateManager const &) = delete; private: TemplateManager(); - /// noncopyable - TemplateManager(TemplateManager const &); - void operator=(TemplateManager const &); void readTemplates(support::FileName const & path); void dumpTemplates(std::ostream &) const; diff --git a/src/support/unicode.cpp b/src/support/unicode.cpp index 26f834a58b..995fa10c59 100644 --- a/src/support/unicode.cpp +++ b/src/support/unicode.cpp @@ -54,10 +54,11 @@ static const iconv_t invalid_cd = (iconv_t)(-1); class IconvProcessor::Impl { - // noncopyable because iconv_close() is called in destructor - Impl(Impl const &); - Impl & operator=(Impl const &); public: + // noncopyable because iconv_close() is called in destructor + Impl(Impl const &) = delete; + Impl & operator=(Impl const &) = delete; + Impl(string const & to, string const & from) : cd(invalid_cd), tocode_(to), fromcode_(from) {}