Commit 75aa6814 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

Minor operator QValueEnd removal

parent 9611e755
......@@ -217,20 +217,6 @@ template<class T_> class QVal;
#include <type_traits>
template<class T> using RemoveCvRef = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
//! A QValueEnd represents the end of a QValue traversal and processing
//!
//! \warning isValid does not take into account intermediate errors that are handled by QValueErrorFilter
//!
class QValueEnd {
public:
QValueEnd() = default;
QValueEnd(bool result) : status(result) {}
bool isValid() { return status; }
explicit operator bool() { return isValid(); }
private:
bool status = false;
};
//! A QCur is a cursor inside a structured value implemented as a move-only, non-owning pointer to QAbstractValue
//!
//! Its public interface only allows to check the status of QAbstractValue calls using explicit operator bool(), and to isErrorFiltered().
......@@ -259,11 +245,6 @@ public:
bool isValid() const noexcept { return impl && impl->isValid(); } //!< Drives QTransmogrifier<T>::bind() traversal
QCur* operator->() noexcept { return this; }
QVal<QCur> value() noexcept ;
operator QValueEnd() {
bool isValid = impl && impl->isValid();
impl = nullptr;
return QValueEnd{isValid};
}
QValueErrorFilter setErrorFilter(QValueErrorFilter newFilter) { return Q_LIKELY(impl) ? impl->setErrorFilter(newFilter) : newFilter; }
bool isErrorFiltered(QIdentifierLiteral name, QString context = QString()) const { return Q_LIKELY(impl) && impl->isErrorFiltered(name, context); }
......@@ -358,6 +339,20 @@ private:
QAbstractValue* impl = nullptr;
};
//! A QValueEnd represents the end of a QValue traversal and processing
//!
//! \warning isValid does not take into account intermediate errors that are handled by QValueErrorFilter
//!
class QValueEnd {
public:
QValueEnd() = default;
QValueEnd(QCur&& result) : cursor(std::move(result)) {}
bool isValid() { return cursor.isValid(); }
explicit operator bool() { return cursor.isValid(); }
private:
QCur cursor;
};
//!< A pair of T value reference and defaultValue to use instead of null()
template<typename T> struct QDefaultValue { T& value; const T& defaultValue; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment