Fix error checking for failure type in example

validity_failure_type is an enum, not a bitflag. Correct example code
that looked like it was trying to treat it as a bitflag, but instead
assumed that any failure was fixable.
This commit is contained in:
Nicholas Devenish 2021-08-03 11:11:25 +01:00 committed by GitHub
parent 135b9264fd
commit eb617fa1c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ int main()
// if the invalidity is only due to lack of closing points and/or wrongly oriented rings, then bg::correct can fix it
bool could_be_fixed = (failure == boost::geometry::failure_not_closed
|| boost::geometry::failure_wrong_orientation);
|| failure == boost::geometry::failure_wrong_orientation);
std::cout << "is valid? " << (valid ? "yes" : "no") << std::endl;
if (! valid)
{