diff options
author | Tobias Markmann <tm@ayena.de> | 2016-09-26 12:49:48 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2016-09-26 22:04:37 (GMT) |
commit | 65596031acaf7d4f277bd75758bb1c551501ce86 (patch) | |
tree | aac3a8bf6dbdccc1d476225b50ba25decf1a46cc /Swiften/Parser | |
parent | 05fbe78f5c3b30517f7152b37c157a99120682dc (diff) | |
download | swift-65596031acaf7d4f277bd75758bb1c551501ce86.zip swift-65596031acaf7d4f277bd75758bb1c551501ce86.tar.bz2 |
Use const std::unique_ptr for pimpl idiom usage
All our pimpl idiom usage used std::shared_ptr due to being
written in C++03. Now we use C++11 and const std::unique_ptr
is more sensible.
Test-Information:
Builds on macOS 10.12 and unit tests pass.
Change-Id: I1b9b3fbb22e337d53ae71e5a5e03118998cc3376
Diffstat (limited to 'Swiften/Parser')
-rw-r--r-- | Swiften/Parser/ExpatParser.cpp | 4 | ||||
-rw-r--r-- | Swiften/Parser/ExpatParser.h | 2 | ||||
-rw-r--r-- | Swiften/Parser/LibXMLParser.cpp | 1 | ||||
-rw-r--r-- | Swiften/Parser/LibXMLParser.h | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/Swiften/Parser/ExpatParser.cpp b/Swiften/Parser/ExpatParser.cpp index 80cfe76..77d959c 100644 --- a/Swiften/Parser/ExpatParser.cpp +++ b/Swiften/Parser/ExpatParser.cpp @@ -6,9 +6,9 @@ #include <Swiften/Parser/ExpatParser.h> -#include <string> - #include <cassert> +#include <memory> +#include <string> #include <expat.h> diff --git a/Swiften/Parser/ExpatParser.h b/Swiften/Parser/ExpatParser.h index 6580a7a..12df463 100644 --- a/Swiften/Parser/ExpatParser.h +++ b/Swiften/Parser/ExpatParser.h @@ -25,6 +25,6 @@ namespace Swift { private: struct Private; - std::shared_ptr<Private> p; + const std::unique_ptr<Private> p; }; } diff --git a/Swiften/Parser/LibXMLParser.cpp b/Swiften/Parser/LibXMLParser.cpp index a880141..be0a92d 100644 --- a/Swiften/Parser/LibXMLParser.cpp +++ b/Swiften/Parser/LibXMLParser.cpp @@ -8,6 +8,7 @@ #include <cassert> #include <cstring> +#include <memory> #include <string> #include <boost/numeric/conversion/cast.hpp> diff --git a/Swiften/Parser/LibXMLParser.h b/Swiften/Parser/LibXMLParser.h index e63a628..9f752ce 100644 --- a/Swiften/Parser/LibXMLParser.h +++ b/Swiften/Parser/LibXMLParser.h @@ -28,6 +28,6 @@ namespace Swift { static bool initialized; struct Private; - std::shared_ptr<Private> p; + const std::unique_ptr<Private> p; }; } |