diff --git a/results.cpp b/results.cpp index c5334652..91a4cc22 100644 --- a/results.cpp +++ b/results.cpp @@ -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) { } diff --git a/results.hpp b/results.hpp index 6ce19a77..27127e8d 100644 --- a/results.hpp +++ b/results.hpp @@ -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; };