I installed Firebase with Auth, Firestore, Functions, per pod and I was filled with alerts that I was solving little by little, after that configure and test firebase functions and works fine. The only one I can’t solve is the following:
Implicit conversion loses integer precision: ‘typename std::enable_if<!std::is_same<void, decltype(block())>::value, decltype(block())>::type’ (aka ‘unsigned long’) to ‘int’
Here!
int LocalStore::Backfill() const {
return persistence_-> Run("Backfill Indexes", [&] {
return index_backfiller_->WriteIndexEntries(this);
});
}
App and firebase DB seems to work fine but I don’t know what is that and what problem could I have it in the future!
Any help?
4
Although I do not know the tool you are using, I can read the error message for you and this should help you to answer your question.
So function int LocalStore::Backfill() const
wants to return integer
, a signed integer. But is fed with unsigned long
by statement:
persistence_-> Run("Backfill Indexes", [&] {
return index_backfiller_->WriteIndexEntries(this);
});
which returns the type described as
typename std::enable_if<!std::is_same<void, decltype(block())>::value, decltype(block())>::type
which turns out to be a (aka 'unsigned long')
, so unsigned long
.
So this is now your decision if such implicit casting is OK. I just want to say that this is a messy way of coding to confuse signed and unsigned and integer and long, even if it works.
IMO you should change Backfill
to return unsigned long
.
1
auto LocalStore::Backfill() const {
return persistence_-> Run("Backfill Indexes", [&] {
return index_backfiller_->WriteIndexEntries(this);
});
}
return “auto”
1