commit 3853c5ce4b2e2e26e564a006ca116d7d11b1a307
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Sun Feb 16 17:59:22 2025 +0100

    Remove support/unique_ptr.h wrapper
    
    This header was only needed when we did not require C++14.
    
    Remove all relevant #incldues, re-add #include <memory> as needed. It
    is expected that we'll have to add it in a few other places (I tested
    gcc/qt5, gcc/qt6, clang+libc++/qt5).
    
    Add explicit std:: namespace as needed in header files.
    
    Remove lyx:: before make_unique() as needed.
    
    No change intended.
---
 configure.ac                            |  3 --
 development/cmake/ConfigureChecks.cmake | 10 -----
 src/Buffer.cpp                          |  2 +-
 src/Buffer.h                            |  6 +--
 src/BufferList.cpp                      |  2 +-
 src/CutAndPaste.cpp                     |  1 -
 src/LyX.cpp                             |  1 -
 src/LyXVC.h                             |  4 +-
 src/Text.cpp                            |  1 -
 src/TocBackend.cpp                      |  2 +-
 src/TocBackend.h                        |  3 --
 src/WordList.cpp                        |  1 -
 src/client/client.cpp                   |  1 -
 src/factory.cpp                         |  1 -
 src/frontends/qt/GuiDocument.h          |  5 +--
 src/frontends/qt/GuiViewSource.h        |  2 +-
 src/graphics/GraphicsCacheItem.cpp      |  3 +-
 src/insets/ExternalTransforms.h         |  5 +--
 src/insets/InsetCollapsible.h           |  6 +--
 src/insets/InsetExternal.h              |  3 +-
 src/insets/InsetIPA.h                   |  3 +-
 src/insets/InsetInclude.h               |  5 +--
 src/insets/InsetPreview.h               |  3 +-
 src/insets/InsetTabular.cpp             |  1 -
 src/mathed/InsetMathHull.h              |  3 +-
 src/mathed/InsetMathSymbol.cpp          |  1 -
 src/mathed/MathAtom.h                   |  2 +-
 src/mathed/MathExtern.cpp               |  9 ++--
 src/support/Changer.h                   |  9 ++--
 src/support/FileMonitor.cpp             |  5 +--
 src/support/Makefile.am                 |  1 -
 src/support/unicode.h                   |  4 +-
 src/support/unique_ptr.h                | 74 ---------------------------------
 src/texstream.h                         |  7 ++--
 34 files changed, 39 insertions(+), 150 deletions(-)

diff --git a/configure.ac b/configure.ac
index 58b698ec4c..b400a77ddf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,9 +101,6 @@ AC_C_BIGENDIAN
 # Nice to have when an assertion triggers
 LYX_CHECK_CALLSTACK_PRINTING
 
-# C++14 only
-LYX_CHECK_DEF(make_unique, memory, [using std::make_unique;])
-
 # Needed for our char_type
 AC_CHECK_SIZEOF(wchar_t)
 
diff --git a/development/cmake/ConfigureChecks.cmake 
b/development/cmake/ConfigureChecks.cmake
index d04e2feebf..47d3b871cd 100644
--- a/development/cmake/ConfigureChecks.cmake
+++ b/development/cmake/ConfigureChecks.cmake
@@ -209,16 +209,6 @@ check_cxx_source_compiles(
        "
 lyx_cv_prog_clang)
 
-check_cxx_source_compiles(
-  "
-  #include <memory>
-  using std::make_unique;
-  int main() {
-    return(0);
-  }
-  "
-HAVE_DEF_MAKE_UNIQUE)
-
 if (ENCHANT_FOUND)
   set(CMAKE_REQUIRED_INCLUDES ${ENCHANT_INCLUDE_DIR})
   set(CMAKE_REQUIRED_LIBRARIES ${ENCHANT_LIBRARY})
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index ce796e7069..26a42beb64 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1519,7 +1519,7 @@ bool Buffer::save() const
        // proper location once that has been done successfully. that
        // way we preserve the original file if something goes wrong.
        string const justname = fileName().onlyFileNameWithoutExt();
-       auto tempfile = lyx::make_unique<TempFile>(fileName().onlyPath(),
+       auto tempfile = make_unique<TempFile>(fileName().onlyPath(),
                                              justname + "-XXXXXX.lyx");
        bool const symlink = fileName().isSymLink();
        if (!symlink)
diff --git a/src/Buffer.h b/src/Buffer.h
index 8c19d3d18a..f385682772 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -15,12 +15,12 @@
 #include "FuncCode.h"
 #include "OutputEnums.h"
 
-#include "support/unique_ptr.h"
 #include "support/docstring.h"
 #include "support/types.h"
 
-#include <map>
 #include <list>
+#include <map>
+#include <memory>
 #include <set>
 #include <vector>
 
@@ -639,7 +639,7 @@ public:
        /// get source code (latex/docbook) for some paragraphs, or all 
paragraphs
        /// including preamble
        /// returns nullptr if Id to Row conversion is unsupported
-       unique_ptr<TexRow> getSourceCode(odocstream & os,
+       std::unique_ptr<TexRow> getSourceCode(odocstream & os,
                        std::string const & format, pit_type par_begin,
                        pit_type par_end, OutputWhat output, bool master) const;
 
diff --git a/src/BufferList.cpp b/src/BufferList.cpp
index d69438846f..757bf46cf7 100644
--- a/src/BufferList.cpp
+++ b/src/BufferList.cpp
@@ -129,7 +129,7 @@ Buffer * BufferList::createNewBuffer(string const & s)
 {
        unique_ptr<Buffer> tmpbuf;
        try {
-               tmpbuf = lyx::make_unique<Buffer>(s);
+               tmpbuf = make_unique<Buffer>(s);
        } catch (ExceptionMessage const & message) {
                if (message.type_ == ErrorException) {
                        Alert::error(message.title_, message.details_);
diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index ffd4dfa10d..b12fb15a7d 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -60,7 +60,6 @@
 #include "support/limited_stack.h"
 #include "support/lstrings.h"
 #include "support/TempFile.h"
-#include "support/unique_ptr.h"
 
 #include "frontends/alert.h"
 #include "frontends/Clipboard.h"
diff --git a/src/LyX.cpp b/src/LyX.cpp
index 9d2e25ce01..055a886ce3 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -60,7 +60,6 @@
 #include "support/Messages.h"
 #include "support/os.h"
 #include "support/Package.h"
-#include "support/unique_ptr.h"
 
 #include <csignal>
 #include <iostream>
diff --git a/src/LyXVC.h b/src/LyXVC.h
index 48e544808f..ec130f240d 100644
--- a/src/LyXVC.h
+++ b/src/LyXVC.h
@@ -13,8 +13,8 @@
 #define LYX_VC_H
 
 #include "support/docstring.h"
-#include "support/unique_ptr.h"
 
+#include <memory>
 
 namespace lyx {
 
@@ -190,7 +190,7 @@ private:
        Buffer * owner_;
 
        ///
-       unique_ptr<VCS> vcs_;
+       std::unique_ptr<VCS> vcs_;
 };
 
 
diff --git a/src/Text.cpp b/src/Text.cpp
index 8050c50e29..30b3e6d8e1 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -101,7 +101,6 @@
 #include "support/lstrings.h"
 #include "support/lyxtime.h"
 #include "support/textutils.h"
-#include "support/unique_ptr.h"
 
 #include <clocale>
 #include <regex>
diff --git a/src/TocBackend.cpp b/src/TocBackend.cpp
index c0a4373923..70a70982f8 100644
--- a/src/TocBackend.cpp
+++ b/src/TocBackend.cpp
@@ -146,7 +146,7 @@ shared_ptr<Toc> TocBackend::toc(string const & type)
 
 TocBuilder & TocBackend::builder(string const & type)
 {
-       auto p = lyx::make_unique<TocBuilder>(toc(type));
+       auto p = make_unique<TocBuilder>(toc(type));
        return * builders_.insert(make_pair(type, std::move(p))).first->second;
 }
 
diff --git a/src/TocBackend.h b/src/TocBackend.h
index 3f5a1c5893..5fa41364cd 100644
--- a/src/TocBackend.h
+++ b/src/TocBackend.h
@@ -21,9 +21,6 @@
 #include "Toc.h"
 #include "TocBuilder.h"
 
-#include "support/unique_ptr.h"
-
-
 namespace lyx {
 
 class Buffer;
diff --git a/src/WordList.cpp b/src/WordList.cpp
index 27d7b31d00..a8e1334b82 100644
--- a/src/WordList.cpp
+++ b/src/WordList.cpp
@@ -16,7 +16,6 @@
 #include "support/debug.h"
 #include "support/docstring.h"
 #include "support/lassert.h"
-#include "support/unique_ptr.h"
 #include "support/weighted_btree.h"
 
 #include <QThreadStorage>
diff --git a/src/client/client.cpp b/src/client/client.cpp
index 02ea67c008..8d584d258f 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -21,7 +21,6 @@
 #include "support/lstrings.h"
 #include "support/Messages.h"
 #include "support/unicode.h"
-#include "support/unique_ptr.h"
 
 // getpid(), getppid()
 #ifdef HAVE_SYS_TYPES_H
diff --git a/src/factory.cpp b/src/factory.cpp
index bb36eadef0..310fbb8b86 100644
--- a/src/factory.cpp
+++ b/src/factory.cpp
@@ -66,7 +66,6 @@
 #include "support/ExceptionMessage.h"
 #include "support/Lexer.h"
 #include "support/lstrings.h"
-#include "support/unique_ptr.h"
 
 #include <sstream>
 
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index 566d32165c..5035719554 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -40,7 +40,6 @@
 #include "ui_PreambleUi.h"
 #include "ui_TextLayoutUi.h"
 
-#include "support/unique_ptr.h"
 
 #include <QStandardItemModel>
 #include <QStyledItemDelegate>
@@ -426,7 +425,7 @@ private:
        typedef std::map<BufferId, std::pair<int,int> > Coords;
        Coords preamble_coords_;
        BufferId current_id_;
-       unique_ptr<support::TempFile> tempfile_;
+       std::unique_ptr<support::TempFile> tempfile_;
        /// LaTeX syntax highlighter
        LaTeXHighlighter * highlighter_;
 
@@ -465,7 +464,7 @@ private Q_SLOTS:
 private:
        BufferId current_id_;
        bool validated_;
-       unique_ptr<support::TempFile> tempfile_;
+       std::unique_ptr<support::TempFile> tempfile_;
 };
 
 
diff --git a/src/frontends/qt/GuiViewSource.h b/src/frontends/qt/GuiViewSource.h
index f75978d34e..acbc15680b 100644
--- a/src/frontends/qt/GuiViewSource.h
+++ b/src/frontends/qt/GuiViewSource.h
@@ -88,7 +88,7 @@ private:
        std::string view_format_;
        /// TexRow information from the last source view. If TexRow is 
unavailable
        /// for the last format then texrow_ is null.
-       unique_ptr<TexRow> texrow_;
+       std::unique_ptr<TexRow> texrow_;
 };
 
 
diff --git a/src/graphics/GraphicsCacheItem.cpp 
b/src/graphics/GraphicsCacheItem.cpp
index 397b39810e..2fce6672bd 100644
--- a/src/graphics/GraphicsCacheItem.cpp
+++ b/src/graphics/GraphicsCacheItem.cpp
@@ -27,7 +27,6 @@
 #include "support/filetools.h"
 #include "support/FileMonitor.h"
 #include "support/lassert.h"
-#include "support/unique_ptr.h"
 
 #include "support/TempFile.h"
 
@@ -442,7 +441,7 @@ void CacheItem::Impl::convertToDisplayFormat()
        // Connect a signal to this->imageConverted and pass this signal to
        // the graphics converter so that we can load the modified file
        // on completion of the conversion process.
-       converter_ = lyx::make_unique<Converter>(doc_file_, filename,
+       converter_ = make_unique<Converter>(doc_file_, filename,
                                            to_file_base.absFileName(),
                                            from, to_);
        // Connection is closed at the same time as *this is destroyed.
diff --git a/src/insets/ExternalTransforms.h b/src/insets/ExternalTransforms.h
index e5dd226301..b7bf821913 100644
--- a/src/insets/ExternalTransforms.h
+++ b/src/insets/ExternalTransforms.h
@@ -15,7 +15,6 @@
 #include "graphics/GraphicsParams.h"
 
 #include "support/Length.h"
-#include "support/unique_ptr.h"
 
 #include <any>
 #include <functional>
@@ -120,7 +119,7 @@ public:
  */
 class TransformCommand {
 public:
-       typedef unique_ptr<TransformCommand const> ptr_type;
+       typedef std::unique_ptr<TransformCommand const> ptr_type;
        virtual ~TransformCommand() {}
 
        /// The string from the External Template that we seek to replace.
@@ -199,7 +198,7 @@ private:
  */
 class TransformOption {
 public:
-       typedef unique_ptr<TransformOption const> ptr_type;
+       typedef std::unique_ptr<TransformOption const> ptr_type;
        virtual ~TransformOption() {}
 
        /// The string from the External Template that we seek to replace.
diff --git a/src/insets/InsetCollapsible.h b/src/insets/InsetCollapsible.h
index 22f846b89a..9e62a4df15 100644
--- a/src/insets/InsetCollapsible.h
+++ b/src/insets/InsetCollapsible.h
@@ -18,7 +18,6 @@
 
 #include "Box.h"
 
-#include "support/unique_ptr.h"
 
 #include <map>
 
@@ -171,8 +170,9 @@ protected:
        Inset * editXY(Cursor & cur, int x, int y) override;
        ///
        mutable CollapseStatus status_;
-        ///
-        unique_ptr<support::TempFile> tempfile_;
+       ///
+       std::unique_ptr<support::TempFile> tempfile_;
+
 private:
        ///
        Dimension dimensionCollapsed(BufferView const & bv) const;
diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h
index 28316d3be1..d64864f7ba 100644
--- a/src/insets/InsetExternal.h
+++ b/src/insets/InsetExternal.h
@@ -17,7 +17,6 @@
 #include "ExternalTemplate.h"
 
 #include "support/FileName.h"
-#include "support/unique_ptr.h"
 
 
 namespace lyx {
@@ -182,7 +181,7 @@ private:
        /// The current params
        InsetExternalParams params_;
        /// The thing that actually draws the image on LyX's screen.
-       mutable unique_ptr<RenderBase> renderer_;
+       mutable std::unique_ptr<RenderBase> renderer_;
        /// changes color of the button when mouse enters/leaves this inset
        mutable std::map<BufferView const *, bool> mouse_hover_;
 };
diff --git a/src/insets/InsetIPA.h b/src/insets/InsetIPA.h
index 2df77ce159..a1b73b4d57 100644
--- a/src/insets/InsetIPA.h
+++ b/src/insets/InsetIPA.h
@@ -14,7 +14,6 @@
 
 #include "InsetText.h"
 
-#include "support/unique_ptr.h"
 
 
 namespace lyx {
@@ -97,7 +96,7 @@ protected:
        void preparePreview(DocIterator const & pos) const;
 
        ///
-       unique_ptr<RenderPreview> preview_;
+       std::unique_ptr<RenderPreview> preview_;
 };
 
 
diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h
index d62c751abe..14b78faa5a 100644
--- a/src/insets/InsetInclude.h
+++ b/src/insets/InsetInclude.h
@@ -15,9 +15,6 @@
 
 #include "InsetCommand.h"
 
-#include "support/unique_ptr.h"
-
-
 namespace lyx {
 
 class Buffer;
@@ -163,7 +160,7 @@ private:
        docstring const include_label;
 
        /// The pointer never changes although *preview_'s contents may.
-       unique_ptr<RenderMonitoredPreview> const preview_;
+       std::unique_ptr<RenderMonitoredPreview> const preview_;
 
        ///
        mutable bool failedtoload_;
diff --git a/src/insets/InsetPreview.h b/src/insets/InsetPreview.h
index db2a2af96b..518e3718d7 100644
--- a/src/insets/InsetPreview.h
+++ b/src/insets/InsetPreview.h
@@ -14,7 +14,6 @@
 
 #include "InsetText.h"
 
-#include "support/unique_ptr.h"
 
 
 namespace lyx {
@@ -83,7 +82,7 @@ protected:
        void preparePreview(DocIterator const & pos) const;
 
        ///
-       unique_ptr<RenderPreview> preview_;
+       std::unique_ptr<RenderPreview> preview_;
 
 };
 
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 016d90a692..746b8dca27 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -66,7 +66,6 @@
 #include "support/lassert.h"
 #include "support/Lexer.h"
 #include "support/lstrings.h"
-#include "support/unique_ptr.h"
 
 #include <cstring>
 #include <iomanip>
diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h
index e7505a6b26..89352ab60d 100644
--- a/src/mathed/InsetMathHull.h
+++ b/src/mathed/InsetMathHull.h
@@ -17,7 +17,6 @@
 #include "DocIterator.h"
 #include "OutputEnums.h"
 
-#include "support/unique_ptr.h"
 
 
 namespace lyx {
@@ -270,7 +269,7 @@ private:
        ///
        std::vector<InsetLabel *> label_;
        ///
-       unique_ptr<RenderPreview> preview_;
+       std::unique_ptr<RenderPreview> preview_;
        ///
        DocIterator docit_;
 //
diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index f0ab5abd42..108156f27d 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -24,7 +24,6 @@
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/textutils.h"
-#include "support/unique_ptr.h"
 
 using namespace std;
 
diff --git a/src/mathed/MathAtom.h b/src/mathed/MathAtom.h
index aa6e317f89..7375b0d9ea 100644
--- a/src/mathed/MathAtom.h
+++ b/src/mathed/MathAtom.h
@@ -12,6 +12,7 @@
 #ifndef MATH_ATOM_H
 #define MATH_ATOM_H
 
+#include <memory>
 
 /**
 Wrapper for InsetMath * with copy-semantics
@@ -40,7 +41,6 @@ Andre'
 
 */
 
-#include "support/unique_ptr.h"
 
 namespace lyx {
 
diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
index 990d35e9d2..550a768d4f 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -45,7 +45,6 @@
 #include "support/lstrings.h"
 #include "support/TempFile.h"
 #include "support/textutils.h"
-#include "support/unique_ptr.h"
 
 #include <algorithm>
 #include <sstream>
@@ -652,7 +651,7 @@ void extractFunctions(MathData & ar, ExternalMath kind)
                extractScript(exp, jt, ar.end(), true);
 
                // create a proper inset as replacement
-               auto p = lyx::make_unique<InsetMathExFunc>(buf, name);
+               auto p = make_unique<InsetMathExFunc>(buf, name);
 
                // jt points to the "argument". Get hold of this.
                MathData::iterator st =
@@ -725,7 +724,7 @@ void extractIntegrals(MathData & ar, ExternalMath kind)
                        continue;
 
                // core is part from behind the scripts to the 'd'
-               auto p = lyx::make_unique<InsetMathExInt>(buf, 
from_ascii("int"));
+               auto p = make_unique<InsetMathExInt>(buf, from_ascii("int"));
 
                // handle scripts if available
                if (!testIntSymbol(*it)) {
@@ -810,7 +809,7 @@ void extractSums(MathData & ar)
                        continue;
 
                // create a proper inset as replacement
-               auto p = lyx::make_unique<InsetMathExInt>(buf, 
from_ascii("sum"));
+               auto p = make_unique<InsetMathExInt>(buf, from_ascii("sum"));
 
                // collect lower bound and summation index
                InsetMathScript const * sub = ar[i]->asScriptInset();
@@ -898,7 +897,7 @@ void extractDiff(MathData & ar)
                }
 
                // create a proper diff inset
-               auto diff = lyx::make_unique<InsetMathDiff>(buf);
+               auto diff = make_unique<InsetMathDiff>(buf);
 
                // collect function, let jt point behind last used item
                MathData::iterator jt = it + 1;
diff --git a/src/support/Changer.h b/src/support/Changer.h
index 4c79052665..8cd04894c8 100644
--- a/src/support/Changer.h
+++ b/src/support/Changer.h
@@ -12,8 +12,7 @@
 #ifndef LYX_CHANGER_H
 #define LYX_CHANGER_H
 
-#include "support/unique_ptr.h"
-
+#include <memory>
 
 namespace lyx {
 
@@ -21,7 +20,7 @@ struct Revertible {
        virtual ~Revertible() = default;
 };
 
-using Changer = unique_ptr<Revertible>;
+using Changer = std::unique_ptr<Revertible>;
 
 
 /// A RefChanger records the current value of \param ref, allowing to
@@ -54,14 +53,14 @@ private:
 
 
 template <typename X>
-using RefChanger = unique_ptr<RevertibleRef<X>>;
+using RefChanger = std::unique_ptr<RevertibleRef<X>>;
 
 
 /// Saves the value of \param ref in a movable object
 template <typename X>
 inline RefChanger<X> make_save(X & ref)
 {
-       return make_unique<RevertibleRef<X>>(ref);
+       return std::make_unique<RevertibleRef<X>>(ref);
 }
 
 inline Changer noChange()
diff --git a/src/support/FileMonitor.cpp b/src/support/FileMonitor.cpp
index 3d007ba96c..8cf70a7199 100644
--- a/src/support/FileMonitor.cpp
+++ b/src/support/FileMonitor.cpp
@@ -16,7 +16,6 @@
 #include "support/debug.h"
 #include "support/FileName.h"
 #include "support/qstring_helpers.h"
-#include "support/unique_ptr.h"
 
 #include <QFile>
 #include <QStringList>
@@ -59,7 +58,7 @@ FileSystemWatcher::getGuard(FileName const & filename)
 //static
 FileMonitorPtr FileSystemWatcher::monitor(FileName const & filename)
 {
-       return lyx::make_unique<FileMonitor>(instance().getGuard(filename));
+       return make_unique<FileMonitor>(instance().getGuard(filename));
 }
 
 
@@ -67,7 +66,7 @@ FileMonitorPtr FileSystemWatcher::monitor(FileName const & 
filename)
 ActiveFileMonitorPtr FileSystemWatcher::activeMonitor(FileName const & 
filename,
                                                       int interval)
 {
-       return 
lyx::make_unique<ActiveFileMonitor>(instance().getGuard(filename),
+       return make_unique<ActiveFileMonitor>(instance().getGuard(filename),
                                              filename, interval);
 }
 
diff --git a/src/support/Makefile.am b/src/support/Makefile.am
index a59fa2ccbf..1cfab1791a 100644
--- a/src/support/Makefile.am
+++ b/src/support/Makefile.am
@@ -113,7 +113,6 @@ liblyxsupport_a_SOURCES = \
        Timeout.cpp \
        Timeout.h \
        types.h \
-       unique_ptr.h \
        userinfo.cpp \
        userinfo.h \
        unicode.cpp \
diff --git a/src/support/unicode.h b/src/support/unicode.h
index 46cea696cc..a8befa54bd 100644
--- a/src/support/unicode.h
+++ b/src/support/unicode.h
@@ -15,9 +15,9 @@
 #define LYX_SUPPORT_UNICODE_H
 
 #include "support/docstring.h"
-#include "support/unique_ptr.h"
 
 #include <cstddef>
+#include <memory>
 #include <vector>
 
 
@@ -52,7 +52,7 @@ class IconvProcessor
        std::string const tocode_;
        std::string const fromcode_;
        struct Handler;
-       unique_ptr<Handler> h_;
+       std::unique_ptr<Handler> h_;
 public:
        IconvProcessor(std::string tocode, std::string fromcode);
        /// convert any data from \c fromcode to \c tocode unicode format.
diff --git a/src/support/unique_ptr.h b/src/support/unique_ptr.h
deleted file mode 100644
index 46f3bdd8b3..0000000000
--- a/src/support/unique_ptr.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// -*- C++ -*-
-/**
- * \file unique_ptr.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Guillaume Munch
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef LYX_UNIQUE_PTR_H
-#define LYX_UNIQUE_PTR_H
-
-#include <memory>
-
-namespace lyx { using std::unique_ptr; }
-
-
-/// Define lyx::make_unique() across platforms
-
-#ifdef HAVE_DEF_MAKE_UNIQUE
-
-namespace lyx { using std::make_unique; }
-
-#else
-// For all other compilers:
-// using https://isocpp.org/files/papers/N3656.txt
-
-#include <cstddef>
-#include <type_traits>
-#include <utility>
-
-
-namespace lyx {
-
-namespace {
-
-template<class T> struct _Unique_if {
-       typedef unique_ptr<T> _Single_object;
-};
-
-template<class T> struct _Unique_if<T[]> {
-       typedef unique_ptr<T[]> _Unknown_bound;
-};
-
-template<class T, size_t N> struct _Unique_if<T[N]> {
-       typedef void _Known_bound;
-};
-
-} // namespace
-
-template<class T, class... Args>
-typename _Unique_if<T>::_Single_object
-make_unique(Args&&... args) {
-       return unique_ptr<T>(new T(std::forward<Args>(args)...));
-}
-
-template<class T>
-typename _Unique_if<T>::_Unknown_bound
-make_unique(size_t n) {
-       typedef typename std::remove_extent<T>::type U;
-       return unique_ptr<T>(new U[n]());
-}
-
-template<class T, class... Args>
-typename _Unique_if<T>::_Known_bound
-make_unique(Args&&...) = delete;
-
-} // namespace lyx
-
-#endif // definition of make_unique
-
-#endif // LYX_UNIQUE_PTR_H
diff --git a/src/texstream.h b/src/texstream.h
index a14f84bf95..e2922ae5fe 100644
--- a/src/texstream.h
+++ b/src/texstream.h
@@ -13,7 +13,8 @@
 #define LYX_TEXSTREAM_H
 
 #include "support/docstream.h"
-#include "support/unique_ptr.h"
+
+#include <memory>
 
 namespace lyx {
 
@@ -37,7 +38,7 @@ public:
        ///
        TexRow & texrow() { return *texrow_; }
        ///
-       unique_ptr<TexRow> releaseTexRow();
+       std::unique_ptr<TexRow> releaseTexRow();
        ///
        void put(char_type const & c);
        ///
@@ -46,7 +47,7 @@ private:
        ///
        odocstream & os_;
        ///
-       unique_ptr<TexRow> texrow_;
+       std::unique_ptr<TexRow> texrow_;
 };
 
 ///
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to