HamedMasafi / Nut

Advanced, Powerful and easy to use ORM for Qt
GNU Lesser General Public License v3.0
296 stars 75 forks source link

Q_OUTOFLINE_TEMPLATE Row<T> Query<T>::first() return nullptr error #119

Closed allowwind closed 3 years ago

allowwind commented 3 years ago

Q_OUTOFLINE_TEMPLATE Row Query::first() { skip(0); RowList list = toList(1);

if (list.count())
    return list.first();
else
    return nullptr;

}

In file included from ../../Nut/src/database.cpp:42:0: ../../Nut/src/query.h: In instantiation of ‘Nut::Row Nut::Query::first() [with T = Nut::ChangeLogTable; Nut::Row = QSharedPointer]’: ../../Nut/src/database.cpp:283:21: required from here ../../Nut/src/query.h:380:16: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘Nut::Row {aka QSharedPointer}’ return nullptr; ^

allowwind commented 3 years ago

qt 5.6.1 linux

HamedMasafi commented 3 years ago

Hi Did you tried using c++11 ?