Specify interface requirements as an C++ concept

PR #19440.
This commit is contained in:
Chocobo1 2023-08-12 20:53:03 +08:00 committed by GitHub
parent 850da9dd83
commit 69d60b5f1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 144 additions and 28 deletions

View file

@ -39,6 +39,7 @@
#include <QRegularExpression>
#include <QStringView>
#include "base/concepts/stringable.h"
#include "base/global.h"
#if defined(Q_OS_WIN)
@ -69,6 +70,9 @@ namespace
#endif
}
// `Path` should satisfy `Stringable` concept in order to be stored in settings as string
static_assert(Stringable<Path>);
Path::Path(const QString &pathStr)
: m_pathStr {cleanPath(pathStr)}
{