From 3a0cbbcee96b79b331ea9c619bff658919c97b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Mon, 4 May 2020 10:25:40 +0200 Subject: [PATCH] Replace some use of Boost smart pointers by std equivalents --- util/common/EqualsPrevious.hh | 3 ++- util/create/main.cpp | 4 +--- util/extract/main.cpp | 3 +-- util/get/main.cpp | 4 +--- util/stats/main.cpp | 4 +--- util/xpath/main.cpp | 8 +------- util/xquery/main.cpp | 4 +--- util/xslt/main.cpp | 5 +---- 8 files changed, 9 insertions(+), 26 deletions(-) diff --git a/util/common/EqualsPrevious.hh b/util/common/EqualsPrevious.hh index 71452a4..ca5ac26 100644 --- a/util/common/EqualsPrevious.hh +++ b/util/common/EqualsPrevious.hh @@ -2,6 +2,7 @@ #define ALPINOCORPUS_EQUALSPREVIOUS_HH #include +#include #include @@ -23,7 +24,7 @@ public: } // operator() is often expected to be const. - mutable boost::shared_ptr d_previous; + mutable std::unique_ptr d_previous; }; template diff --git a/util/create/main.cpp b/util/create/main.cpp index 75d6a59..521e45f 100644 --- a/util/create/main.cpp +++ b/util/create/main.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -28,7 +27,6 @@ #include #include -#include #include #include @@ -89,7 +87,7 @@ void writeCorpus(std::shared_ptr reader, int main(int argc, char *argv[]) { - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "c:d:m:nq:r")); diff --git a/util/extract/main.cpp b/util/extract/main.cpp index e56ad33..f5bd502 100644 --- a/util/extract/main.cpp +++ b/util/extract/main.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -26,7 +25,7 @@ void usage(std::string const &programName) { } int main(int argc, char *argv[]) { - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "q")); diff --git a/util/get/main.cpp b/util/get/main.cpp index 3f7d815..8ff22b1 100644 --- a/util/get/main.cpp +++ b/util/get/main.cpp @@ -7,8 +7,6 @@ #include #include -#include - #include #include @@ -29,7 +27,7 @@ void usage(std::string const &programName) { } int main(int argc, char *argv[]) { - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "a:m:q:v:")); diff --git a/util/stats/main.cpp b/util/stats/main.cpp index 57879a9..96357c3 100644 --- a/util/stats/main.cpp +++ b/util/stats/main.cpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include @@ -64,7 +62,7 @@ void usage(std::string const &programName) int main(int argc, char *argv[]) { - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "m:p")); diff --git a/util/xpath/main.cpp b/util/xpath/main.cpp index 345be3b..b885f79 100644 --- a/util/xpath/main.cpp +++ b/util/xpath/main.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -138,11 +137,6 @@ void listCorpus(std::shared_ptr reader, } } -void readEntry(boost::shared_ptr reader, std::string const &entry) -{ - std::cout << reader->read(entry); -} - void usage(std::string const &programName) { std::cerr << "Usage: " << programName << " [OPTION] treebank(s)" << @@ -156,7 +150,7 @@ void usage(std::string const &programName) int main(int argc, char *argv[]) { - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "a:cm:q:s")); diff --git a/util/xquery/main.cpp b/util/xquery/main.cpp index 8418987..e2cf9e5 100644 --- a/util/xquery/main.cpp +++ b/util/xquery/main.cpp @@ -2,8 +2,6 @@ #include #include -#include - #include #include #include @@ -51,7 +49,7 @@ void usage(std::string const &programName) int main(int argc, char *argv[]) { - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "f:m:q:")); diff --git a/util/xslt/main.cpp b/util/xslt/main.cpp index 1f487a3..47444ee 100644 --- a/util/xslt/main.cpp +++ b/util/xslt/main.cpp @@ -4,8 +4,6 @@ #include #include -#include - extern "C" { #include #include @@ -20,7 +18,6 @@ extern "C" { #include "../src/util/textfile.hh" // XXX - hmpf -#include #include #include #include @@ -95,7 +92,7 @@ int main (int argc, char *argv[]) // XPath xmlXPathInit(); - boost::scoped_ptr opts; + std::unique_ptr opts; try { opts.reset(new ProgramOptions(argc, const_cast(argv), "g:m:q:"));