mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Using standard library instead of std_ namespace.
Currently tested only in VS2015.
This commit is contained in:
@@ -351,13 +351,13 @@ private:
|
||||
template <typename Object>
|
||||
class object_ptr {
|
||||
public:
|
||||
object_ptr(std_::nullptr_t) {
|
||||
object_ptr(std::nullptr_t) {
|
||||
}
|
||||
|
||||
// No default constructor, but constructors with at least
|
||||
// one argument are simply make functions.
|
||||
template <typename Parent, typename... Args>
|
||||
explicit object_ptr(Parent &&parent, Args&&... args) : _object(new Object(std_::forward<Parent>(parent), std_::forward<Args>(args)...)) {
|
||||
explicit object_ptr(Parent &&parent, Args&&... args) : _object(new Object(std::forward<Parent>(parent), std::forward<Args>(args)...)) {
|
||||
}
|
||||
|
||||
object_ptr(const object_ptr &other) = delete;
|
||||
@@ -365,23 +365,23 @@ public:
|
||||
object_ptr(object_ptr &&other) : _object(base::take(other._object)) {
|
||||
}
|
||||
object_ptr &operator=(object_ptr &&other) {
|
||||
auto temp = std_::move(other);
|
||||
auto temp = std::move(other);
|
||||
destroy();
|
||||
std_::swap_moveable(_object, temp._object);
|
||||
std::swap(_object, temp._object);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename OtherObject, typename = std_::enable_if_t<std_::is_base_of<Object, OtherObject>::value>>
|
||||
template <typename OtherObject, typename = std::enable_if_t<std::is_base_of<Object, OtherObject>::value>>
|
||||
object_ptr(object_ptr<OtherObject> &&other) : _object(base::take(other._object)) {
|
||||
}
|
||||
|
||||
template <typename OtherObject, typename = std_::enable_if_t<std_::is_base_of<Object, OtherObject>::value>>
|
||||
template <typename OtherObject, typename = std::enable_if_t<std::is_base_of<Object, OtherObject>::value>>
|
||||
object_ptr &operator=(object_ptr<OtherObject> &&other) {
|
||||
_object = base::take(other._object);
|
||||
return *this;
|
||||
}
|
||||
|
||||
object_ptr &operator=(std_::nullptr_t) {
|
||||
object_ptr &operator=(std::nullptr_t) {
|
||||
_object = nullptr;
|
||||
return *this;
|
||||
}
|
||||
@@ -409,7 +409,7 @@ public:
|
||||
template <typename Parent, typename... Args>
|
||||
void create(Parent &&parent, Args&&... args) {
|
||||
destroy();
|
||||
_object = new Object(std_::forward<Parent>(parent), std_::forward<Args>(args)...);
|
||||
_object = new Object(std::forward<Parent>(parent), std::forward<Args>(args)...);
|
||||
}
|
||||
void destroy() {
|
||||
delete base::take(_object);
|
||||
@@ -446,7 +446,7 @@ template <typename ResultType, typename SourceType>
|
||||
inline object_ptr<ResultType> static_object_cast(object_ptr<SourceType> source) {
|
||||
auto result = object_ptr<ResultType>(nullptr);
|
||||
result._object = static_cast<ResultType*>(base::take(source._object));
|
||||
return std_::move(result);
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton button, const QPoint &globalPoint);
|
||||
|
Reference in New Issue
Block a user