Using more constexpr in metaclass system, that was not possible before due to compiler bugs.

This commit is contained in:
Mat Sutcliffe
2019-02-28 20:09:49 +00:00
parent a366ad8943
commit 3454e08bb1
6 changed files with 20 additions and 20 deletions

View File

@@ -404,7 +404,7 @@ namespace BlackMisc
QJsonObject toJson() const
{
QJsonObject json;
auto meta = introspect<Derived>().without(MetaFlags<DisabledForJson>());
constexpr auto meta = introspect<Derived>().without(MetaFlags<DisabledForJson>());
meta.forEachMember([ &, this ](auto member)
{
json << std::make_pair(CExplicitLatin1String(member.latin1Name()), std::cref(member.in(*this->derived())));
@@ -423,7 +423,7 @@ namespace BlackMisc
void convertFromJson(const QJsonObject &json)
{
baseConvertFromJson(static_cast<TBaseOfT<Derived> *>(derived()), json);
auto meta = introspect<Derived>().without(MetaFlags<DisabledForJson>());
constexpr auto meta = introspect<Derived>().without(MetaFlags<DisabledForJson>());
meta.forEachMember([ &, this ](auto member)
{
const auto value = json.value(CExplicitLatin1String(member.latin1Name()));