From bea3673ae1b3d19585dec56e96dbcd8a56b96e6d Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 3 Feb 2017 17:02:58 -0500 Subject: Renamed object join fields to prevent conflicts with class names This was not a problem with clang but it caused compilation errors with gcc. --- lib/form.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/form.cpp') diff --git a/lib/form.cpp b/lib/form.cpp index 4811f14..fe7d104 100644 --- a/lib/form.cpp +++ b/lib/form.cpp @@ -16,8 +16,8 @@ namespace verbly { const field form::complexity = field::integerField(object::form, "complexity"); const field form::proper = field::booleanField(object::form, "proper"); - const field form::lemma = field::joinField(object::form, "form_id", object::lemma); - const field form::pronunciation = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); + const field form::lemmas = field::joinField(object::form, "form_id", object::lemma); + const field form::pronunciations = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); form::form(const database& db, sqlite3_stmt* row) : db_(&db), valid_(true) { @@ -36,7 +36,7 @@ namespace verbly { if (!initializedPronunciations_) { - pronunciations_ = db_->pronunciations(pronunciation::form %= *this, verbly::pronunciation::id, -1).all(); + pronunciations_ = db_->pronunciations(pronunciation::forms %= *this, pronunciation::id, -1).all(); initializedPronunciations_ = true; } @@ -50,10 +50,10 @@ namespace verbly { throw std::domain_error("Bad access to uninitialized form"); } - const std::vector& pronunciations = getPronunciations(); + const std::vector& pronunciations = getPronunciations(); if (!pronunciations.empty()) { - return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (const verbly::pronunciation& p) { + return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (const pronunciation& p) { return p.getPhonemes().front().find_first_of("012") != std::string::npos; }); } else { -- cgit 1.4.1