From d4f5f45e56aee4969012f7e9f7d0a9c3673194a4 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Fri, 8 Jan 2016 13:05:13 -0800 Subject: [PATCH] fix for member initializtion ordering --- results.cpp | 4 ++-- results.hpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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; };