diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2023-05-05 23:05:10 +0300 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2023-05-10 09:40:29 +0000 |
commit | 99c1fa4037c106d2f5268826ee392e00208bc24e (patch) | |
tree | 3775fdfd3417a72ed0ad87274ecff48ee736bbe2 /src/lib/corelib/loader/groupshandler.cpp | |
parent | d849e77fd2bc748f04cc3f15faafb8f1c8328670 (diff) | |
download | qbs-99c1fa4037c106d2f5268826ee392e00208bc24e.tar.gz |
Implement Pimpl class using std::unique_ptr
... and propagate_const from KDAB tools.
The propagate_const class fixes the issue that d-pointer in const-methods
is not const.
Such Pimpl class has several advantages over the raw pointer.
- the d-tor is trivial and removes the burden for the author/reviewer to
remember to check if pointer is deleted correctly.
- constness is now propageted correctly to the d-pointer in const
methods.
- makes the intention clear that we're using the PIMPL idiom
Change-Id: Ibc42cdaeb6d3303fea81ac6edd63bea0da2ac08d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/loader/groupshandler.cpp')
-rw-r--r-- | src/lib/corelib/loader/groupshandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/corelib/loader/groupshandler.cpp b/src/lib/corelib/loader/groupshandler.cpp index dd183eb16..04970a9a3 100644 --- a/src/lib/corelib/loader/groupshandler.cpp +++ b/src/lib/corelib/loader/groupshandler.cpp @@ -80,8 +80,8 @@ public: GroupsHandler::GroupsHandler(const SetupProjectParameters ¶meters, ModuleInstantiator &instantiator, Evaluator &evaluator, Logger &logger) - : d(new Private(parameters, instantiator, evaluator, logger)) {} -GroupsHandler::~GroupsHandler() { delete d; } + : d(makePimpl<Private>(parameters, instantiator, evaluator, logger)) {} +GroupsHandler::~GroupsHandler() = default; void GroupsHandler::setupGroups(Item *product, Item *productScope) { |