Skip to content

Commit

Permalink
Use override in example C++ code
Browse files Browse the repository at this point in the history
  • Loading branch information
ojwb committed May 21, 2024
1 parent b94b042 commit fc91d81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion code/c++/search_ranges2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ search(const string & dbpath, const string & querystring,
PopulationRangeProcessor(Xapian::valueno slot, int low_, int high_)
: Xapian::NumberRangeProcessor(slot), low(low_), high(high_) { }

Xapian::Query operator()(const string& begin, const string& end) {
Xapian::Query operator()(const string& begin,
const string& end) override {
if (!check_range_end(begin))
return Xapian::Query(Xapian::Query::OP_INVALID);
if (!check_range_end(end))
Expand Down
2 changes: 1 addition & 1 deletion code/c++/search_sorting3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ search(const string & dbpath, const string & querystring,
enquire.set_query(query);
// Start of example code.
class DistanceKeyMaker : public Xapian::KeyMaker {
string operator()(const Xapian::Document& doc) const {
string operator()(const Xapian::Document& doc) const override {
// we want to return a sortable string which represents
// the distance from Washington, DC to the middle of this
// state.
Expand Down

0 comments on commit fc91d81

Please # to comment.