fix for member initializtion ordering

This commit is contained in:
Ari Lazier 2016-01-08 13:05:13 -08:00
parent d0715cc8e4
commit d4f5f45e56
2 changed files with 6 additions and 5 deletions

View File

@ -36,19 +36,19 @@ using namespace realm;
Results::Results(SharedRealm r, const ObjectSchema &o, Query q, SortOrder s)
: m_realm(std::move(r))
, m_object_schema(&o)
, m_query(std::move(q))
, m_table(m_query.get_table().get())
, m_sort(std::move(s))
, m_mode(Mode::Query)
, m_object_schema(&o)
{
}
Results::Results(SharedRealm r, const ObjectSchema &o, Table& table)
: m_realm(std::move(r))
, m_object_schema(&o)
, m_table(&table)
, m_mode(Mode::Table)
, m_object_schema(&o)
{
}

View File

@ -135,9 +135,10 @@ public:
// The input index parameter was out of bounds
struct OutOfBoundsIndexException : public std::out_of_range
{
OutOfBoundsIndexException(size_t r, size_t c) : requested(r), valid_count(c),
OutOfBoundsIndexException(size_t r, size_t c) :
std::out_of_range((std::string)"Requested index " + std::to_string(r) +
" greater than max " + std::to_string(c)) {}
" greater than max " + std::to_string(c)),
requested(r), valid_count(c) {}
const size_t requested;
const size_t valid_count;
};
@ -150,7 +151,7 @@ public:
// The input Row object belongs to a different table
struct IncorrectTableException : public std::runtime_error {
IncorrectTableException(StringData e, StringData a, const std::string &error) :
expected(e), actual(a), std::runtime_error(error) {}
std::runtime_error(error), expected(e), actual(a) {}
const StringData expected;
const StringData actual;
};