- events tested and implemented multithreading support through mpscq
This commit is contained in:
@@ -117,13 +117,20 @@ public:
|
||||
}
|
||||
|
||||
///
|
||||
/// \brief Move Constructor, transfers ownership from \f$other\f$
|
||||
/// \param other The unique_ptr to take ownership from
|
||||
constexpr unique_ptr(unique_ptr&& other)
|
||||
: _handle(other._handle) {
|
||||
other._handle = nullptr;
|
||||
}
|
||||
|
||||
///
|
||||
/// \brief Move Constructor, transfers ownership from \f$other\f$
|
||||
/// \param other The unique_ptr to take ownership from
|
||||
template<typename DerivedT> requires(is_base_of_v<TypeT, DerivedT>)
|
||||
constexpr unique_ptr(unique_ptr<DerivedT>&& other)
|
||||
: _handle(other.release()) {
|
||||
}
|
||||
|
||||
// Delete copy constructor
|
||||
constexpr unique_ptr(const unique_ptr&) = delete;
|
||||
|
||||
@@ -225,6 +232,11 @@ unique_ptr<TypeT> make_unique(ArgsT&&...args) {
|
||||
return unique_ptr<TypeT>(new TypeT(fennec::forward<ArgsT>(args)...));
|
||||
}
|
||||
|
||||
template<typename TypeT>
|
||||
unique_ptr<TypeT> make_unique(TypeT* ptr) {
|
||||
return unique_ptr<TypeT>(ptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // FENNEC_MEMORY_POINTERS_H
|
||||
|
||||
Reference in New Issue
Block a user