We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29244b7 commit 7fa095bCopy full SHA for 7fa095b
src/qtils/strict_sptr.hpp
@@ -4,6 +4,8 @@
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
+#pragma once
8
+
9
#include <memory>
10
#include <stdexcept>
11
#include <type_traits>
@@ -43,6 +45,13 @@ namespace qtils {
43
45
}
44
46
47
48
+ private:
49
+ struct ForceInject{}; // Auxiliary arg appended to select ctor for DI
50
51
+ public:
52
+ StrictSharedPtr(std::shared_ptr<T> sptr, ForceInject):
53
+ StrictSharedPtr(std::move(sptr)) {}
54
55
// Copy constructor and assignment
56
StrictSharedPtr(const StrictSharedPtr &) = default;
57
StrictSharedPtr &operator=(const StrictSharedPtr &) = default;
0 commit comments