summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2022-06-30 20:13:00 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-06 15:17:27 +0000
commit501b2dc980abcc8090cff1998141af30b42d8dd1 (patch)
tree804539df912dd3857cea6116851df468190877b3 /src/mongo/db/pipeline
parent3cc20216a850af1d4bf63956740d73e8fc3779df (diff)
downloadmongo-501b2dc980abcc8090cff1998141af30b42d8dd1.tar.gz
SERVER-67709 rename visit_helper
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/change_stream_document_diff_parser.cpp11
-rw-r--r--src/mongo/db/pipeline/document_source_densify.cpp212
-rw-r--r--src/mongo/db/pipeline/document_source_densify.h52
-rw-r--r--src/mongo/db/pipeline/document_source_fill.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_set_window_fields.cpp2
-rw-r--r--src/mongo/db/pipeline/sharded_agg_helpers.cpp4
-rw-r--r--src/mongo/db/pipeline/window_function/partition_iterator.cpp10
-rw-r--r--src/mongo/db/pipeline/window_function/window_bounds.cpp4
-rw-r--r--src/mongo/db/pipeline/window_function/window_function_exec.cpp4
-rw-r--r--src/mongo/db/pipeline/window_function/window_function_exec_non_removable.h2
-rw-r--r--src/mongo/db/pipeline/window_function/window_function_exec_removable_document.cpp4
11 files changed, 154 insertions, 153 deletions
diff --git a/src/mongo/db/pipeline/change_stream_document_diff_parser.cpp b/src/mongo/db/pipeline/change_stream_document_diff_parser.cpp
index c847f32872e..6818a80393d 100644
--- a/src/mongo/db/pipeline/change_stream_document_diff_parser.cpp
+++ b/src/mongo/db/pipeline/change_stream_document_diff_parser.cpp
@@ -189,7 +189,7 @@ void buildUpdateDescriptionWithDeltaOplog(
}
stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](DocumentDiffReader* reader) {
boost::optional<BSONElement> nextMod;
while ((nextMod = reader->nextUpdate()) || (nextMod = reader->nextInsert())) {
@@ -202,10 +202,9 @@ void buildUpdateDescriptionWithDeltaOplog(
while (auto nextSubDiff = reader->nextSubDiff()) {
stdx::variant<DocumentDiffReader*, ArrayDiffReader*> nextReader;
- stdx::visit(visit_helper::Overloaded{[&nextReader](auto& reader) {
- nextReader = &reader;
- }},
- nextSubDiff->second);
+ stdx::visit(
+ OverloadedVisitor{[&nextReader](auto& reader) { nextReader = &reader; }},
+ nextSubDiff->second);
buildUpdateDescriptionWithDeltaOplog(
nextReader, builder, {{nextSubDiff->first}});
}
@@ -222,7 +221,7 @@ void buildUpdateDescriptionWithDeltaOplog(
for (auto nextMod = reader->next(); nextMod; nextMod = reader->next()) {
stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](BSONElement elem) {
builder->addToUpdatedFields(nextMod->first, Value(elem));
},
diff --git a/src/mongo/db/pipeline/document_source_densify.cpp b/src/mongo/db/pipeline/document_source_densify.cpp
index 740ef193431..daae674995b 100644
--- a/src/mongo/db/pipeline/document_source_densify.cpp
+++ b/src/mongo/db/pipeline/document_source_densify.cpp
@@ -34,7 +34,7 @@
#include "mongo/db/query/sort_pattern.h"
#include "mongo/stdx/variant.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/visit_helper.h"
+#include "mongo/util/overloaded_visitor.h"
using boost::intrusive_ptr;
using boost::optional;
@@ -493,7 +493,7 @@ DocumentSource::GetNextResult DocumentSourceInternalDensify::finishDensifyingPar
return DocumentSource::GetNextResult::makeEOF();
}
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](Full) {
// Densify between partitions's last seen value and global max.
tassert(5733707, "_current must be set if partitionTable is non-empty", _current);
@@ -518,7 +518,7 @@ DocumentSource::GetNextResult DocumentSourceInternalDensify::finishDensifyingPar
DocumentSource::GetNextResult DocumentSourceInternalDensify::handleSourceExhausted() {
_eof = true;
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](RangeStatement::Full) {
if (_partitionExpr) {
return finishDensifyingPartitionedInput();
@@ -705,7 +705,7 @@ DocumentSource::GetNextResult DocumentSourceInternalDensify::doGetNext() {
}
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](Full) {
_current = val;
_globalMin = val;
@@ -742,59 +742,64 @@ DocumentSource::GetNextResult DocumentSourceInternalDensify::doGetNext() {
auto val = getDensifyValue(currentDoc);
return stdx::visit(
- visit_helper::Overloaded{
- [&](Full) {
- if (_partitionExpr) {
- // Keep track of '_globalMax' for later. The latest document from the
- // source is always the max.
- _globalMax = val;
- // If we haven't seen this partition before, densify between
- // '_globalMin' and this value.
- auto partitionVal = getDensifyPartition(currentDoc);
- auto foundPartitionVal = _partitionTable.find(partitionVal);
- if (foundPartitionVal == _partitionTable.end()) {
- // _current represents the last value seen. We want to generate
- // _globalMin, so pretend we've seen the value before that.
- _current = _globalMin->decrement(_range);
- // Insert the new partition into the table.
- setPartitionValue(currentDoc);
- return handleNeedGen(currentDoc);
- }
- // Otherwise densify between the last seen value and this one.
- _current = foundPartitionVal->second;
- }
- return handleNeedGen(currentDoc);
- },
- [&](Partition) {
- // If we haven't seen this partition before, add it to the table then
- // return.
- auto partitionVal = getDensifyPartition(currentDoc);
- auto foundPartitionVal = _partitionTable.find(partitionVal);
- if (foundPartitionVal == _partitionTable.end()) {
- setPartitionValue(currentDoc);
- return nextDoc;
- }
- // Reset current to be the last value in this partition.
- _current = foundPartitionVal->second;
- return handleNeedGen(currentDoc);
- },
- [&](ExplicitBounds bounds) {
- if (_partitionExpr) {
- // If we haven't seen this partition before, add it to the table
- // then check where it is in the range.
- auto partitionVal = getDensifyPartition(currentDoc);
- auto foundPartitionVal = _partitionTable.find(partitionVal);
- if (foundPartitionVal == _partitionTable.end()) {
- setPartitionValue(currentDoc);
- // This partition has seen no values.
- _current = boost::none;
- return processFirstDocForExplicitRange(currentDoc);
- }
- // Otherwise reset current to be the last value in this partition.
- _current = foundPartitionVal->second;
- }
- return handleNeedGenExplicit(nextDoc.getDocument());
- }},
+ OverloadedVisitor{[&](Full) {
+ if (_partitionExpr) {
+ // Keep track of '_globalMax' for later. The latest
+ // document from the source is always the max.
+ _globalMax = val;
+ // If we haven't seen this partition before, densify
+ // between
+ // '_globalMin' and this value.
+ auto partitionVal = getDensifyPartition(currentDoc);
+ auto foundPartitionVal =
+ _partitionTable.find(partitionVal);
+ if (foundPartitionVal == _partitionTable.end()) {
+ // _current represents the last value seen. We want to
+ // generate _globalMin, so pretend we've seen the
+ // value before that.
+ _current = _globalMin->decrement(_range);
+ // Insert the new partition into the table.
+ setPartitionValue(currentDoc);
+ return handleNeedGen(currentDoc);
+ }
+ // Otherwise densify between the last seen value and this
+ // one.
+ _current = foundPartitionVal->second;
+ }
+ return handleNeedGen(currentDoc);
+ },
+ [&](Partition) {
+ // If we haven't seen this partition before, add it to the
+ // table then return.
+ auto partitionVal = getDensifyPartition(currentDoc);
+ auto foundPartitionVal = _partitionTable.find(partitionVal);
+ if (foundPartitionVal == _partitionTable.end()) {
+ setPartitionValue(currentDoc);
+ return nextDoc;
+ }
+ // Reset current to be the last value in this partition.
+ _current = foundPartitionVal->second;
+ return handleNeedGen(currentDoc);
+ },
+ [&](ExplicitBounds bounds) {
+ if (_partitionExpr) {
+ // If we haven't seen this partition before, add it to the
+ // table then check where it is in the range.
+ auto partitionVal = getDensifyPartition(currentDoc);
+ auto foundPartitionVal =
+ _partitionTable.find(partitionVal);
+ if (foundPartitionVal == _partitionTable.end()) {
+ setPartitionValue(currentDoc);
+ // This partition has seen no values.
+ _current = boost::none;
+ return processFirstDocForExplicitRange(currentDoc);
+ }
+ // Otherwise reset current to be the last value in this
+ // partition.
+ _current = foundPartitionVal->second;
+ }
+ return handleNeedGenExplicit(nextDoc.getDocument());
+ }},
_range.getBounds());
}
case DensifyState::kHaveGenerator: {
@@ -805,50 +810,49 @@ DocumentSource::GetNextResult DocumentSourceInternalDensify::doGetNext() {
auto generatedDoc = _docGenerator->getNextDocument();
return stdx::visit(
- visit_helper::Overloaded{[&](Full) {
- if (_docGenerator->done()) {
- _docGenerator = boost::none;
- if (_eof && _partitionExpr) {
- _densifyState =
- DensifyState::kFinishingDensify;
- } else {
- _densifyState = DensifyState::kNeedGen;
- }
- }
- // The generator's final document may not be on the
- // step.
- auto genDensifyVal = getDensifyValue(generatedDoc);
- if (genDensifyVal == _current->increment(_range)) {
- _current = genDensifyVal;
- setPartitionValue(generatedDoc);
- }
- return generatedDoc;
- },
- [&](Partition) {
- if (_docGenerator->done()) {
- _docGenerator = boost::none;
- _densifyState = DensifyState::kNeedGen;
- }
- // The generator's final document may not be on the
- // step.
- auto genDensifyVal = getDensifyValue(generatedDoc);
- if (genDensifyVal == _current->increment(_range)) {
- _current = genDensifyVal;
- setPartitionValue(generatedDoc);
- }
- return generatedDoc;
- },
- [&](ExplicitBounds bounds) {
- auto val = getDensifyValue(generatedDoc);
- // Only want to update the rangeMin if the value -
- // current is divisible by the step.
- if (val.isOnStepRelativeTo(*_current, _range)) {
- _current = val;
- setPartitionValue(generatedDoc);
- }
- resetDocGen(bounds);
- return generatedDoc;
- }},
+ OverloadedVisitor{[&](Full) {
+ if (_docGenerator->done()) {
+ _docGenerator = boost::none;
+ if (_eof && _partitionExpr) {
+ _densifyState = DensifyState::kFinishingDensify;
+ } else {
+ _densifyState = DensifyState::kNeedGen;
+ }
+ }
+ // The generator's final document may not be on the
+ // step.
+ auto genDensifyVal = getDensifyValue(generatedDoc);
+ if (genDensifyVal == _current->increment(_range)) {
+ _current = genDensifyVal;
+ setPartitionValue(generatedDoc);
+ }
+ return generatedDoc;
+ },
+ [&](Partition) {
+ if (_docGenerator->done()) {
+ _docGenerator = boost::none;
+ _densifyState = DensifyState::kNeedGen;
+ }
+ // The generator's final document may not be on the
+ // step.
+ auto genDensifyVal = getDensifyValue(generatedDoc);
+ if (genDensifyVal == _current->increment(_range)) {
+ _current = genDensifyVal;
+ setPartitionValue(generatedDoc);
+ }
+ return generatedDoc;
+ },
+ [&](ExplicitBounds bounds) {
+ auto val = getDensifyValue(generatedDoc);
+ // Only want to update the rangeMin if the value -
+ // current is divisible by the step.
+ if (val.isOnStepRelativeTo(*_current, _range)) {
+ _current = val;
+ setPartitionValue(generatedDoc);
+ }
+ resetDocGen(bounds);
+ return generatedDoc;
+ }},
_range.getBounds());
}
case DensifyState::kFinishingDensify: {
@@ -875,7 +879,7 @@ DocumentSource::GetNextResult DocumentSourceInternalDensify::doGetNext() {
DensifyValue DensifyValue::increment(const RangeStatement& range) const {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](Value val) {
return DensifyValue(uassertStatusOK(ExpressionAdd::apply(val, range.getStep())));
},
@@ -888,7 +892,7 @@ DensifyValue DensifyValue::increment(const RangeStatement& range) const {
DensifyValue DensifyValue::decrement(const RangeStatement& range) const {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](Value val) {
return DensifyValue(
uassertStatusOK(ExpressionSubtract::apply(val, range.getStep())));
@@ -902,7 +906,7 @@ DensifyValue DensifyValue::decrement(const RangeStatement& range) const {
bool DensifyValue::isOnStepRelativeTo(DensifyValue base, RangeStatement range) const {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](Value val) {
Value diff = uassertStatusOK(ExpressionSubtract::apply(val, base.getNumber()));
Value remainder = uassertStatusOK(ExpressionMod::apply(diff, range.getStep()));
diff --git a/src/mongo/db/pipeline/document_source_densify.h b/src/mongo/db/pipeline/document_source_densify.h
index 6415c5425d8..fc629977ce6 100644
--- a/src/mongo/db/pipeline/document_source_densify.h
+++ b/src/mongo/db/pipeline/document_source_densify.h
@@ -38,8 +38,8 @@
#include "mongo/db/pipeline/field_path.h"
#include "mongo/db/pipeline/memory_usage_tracker.h"
#include "mongo/db/query/datetime/date_time_support.h"
+#include "mongo/util/overloaded_visitor.h"
#include "mongo/util/time_support.h"
-#include "mongo/util/visit_helper.h"
namespace mongo {
@@ -61,12 +61,11 @@ public:
* Convert a DensifyValue into a Value for use in documents/serialization.
*/
Value toValue() const {
- return stdx::visit(
- visit_helper::Overloaded{[&](Value unwrappedVal) { return unwrappedVal; },
- [&](Date_t dateVal) { return Value(dateVal); }
+ return stdx::visit(OverloadedVisitor{[&](Value unwrappedVal) { return unwrappedVal; },
+ [&](Date_t dateVal) { return Value(dateVal); }
- },
- _value);
+ },
+ _value);
}
/**
@@ -74,17 +73,16 @@ public:
* of (lhs - rhs). Returns -1 if lhs < rhs, 0 if lhs == rhs, and 1 if lhs > rhs.
*/
static int compare(const DensifyValue& lhs, const DensifyValue& rhs) {
- return stdx::visit(
- visit_helper::Overloaded{[&](Value lhsVal) {
- Value rhsVal = stdx::get<Value>(rhs._value);
- return Value::compare(lhsVal, rhsVal, nullptr);
- },
- [&](Date_t lhsVal) {
- Date_t rhsVal = stdx::get<Date_t>(rhs._value);
- return Value::compare(
- Value(lhsVal), Value(rhsVal), nullptr);
- }},
- lhs._value);
+ return stdx::visit(OverloadedVisitor{[&](Value lhsVal) {
+ Value rhsVal = stdx::get<Value>(rhs._value);
+ return Value::compare(lhsVal, rhsVal, nullptr);
+ },
+ [&](Date_t lhsVal) {
+ Date_t rhsVal = stdx::get<Date_t>(rhs._value);
+ return Value::compare(
+ Value(lhsVal), Value(rhsVal), nullptr);
+ }},
+ lhs._value);
}
/**
@@ -104,8 +102,8 @@ public:
}
std::string toString() const {
- return stdx::visit(visit_helper::Overloaded{[&](Value v) { return v.toString(); },
- [&](Date_t d) { return d.toString(); }},
+ return stdx::visit(OverloadedVisitor{[&](Value v) { return v.toString(); },
+ [&](Date_t d) { return d.toString(); }},
_value);
}
@@ -124,8 +122,8 @@ public:
*/
size_t getApproximateSize() const {
return stdx::visit(
- visit_helper::Overloaded{[&](Value v) { return v.getApproximateSize(); },
- [&](Date_t d) { return Value(d).getApproximateSize(); }},
+ OverloadedVisitor{[&](Value v) { return v.getApproximateSize(); },
+ [&](Date_t d) { return Value(d).getApproximateSize(); }},
_value);
}
@@ -245,12 +243,12 @@ public:
MutableDocument spec;
spec[kArgStep] = _step;
spec[kArgBounds] = stdx::visit(
- visit_helper::Overloaded{[&](Full) { return Value(kValFull); },
- [&](Partition) { return Value(kValPartition); },
- [&](ExplicitBounds bounds) {
- return Value(std::vector<Value>(
- {bounds.first.toValue(), bounds.second.toValue()}));
- }},
+ OverloadedVisitor{[&](Full) { return Value(kValFull); },
+ [&](Partition) { return Value(kValPartition); },
+ [&](ExplicitBounds bounds) {
+ return Value(std::vector<Value>(
+ {bounds.first.toValue(), bounds.second.toValue()}));
+ }},
_bounds);
if (_unit)
spec[kArgUnit] = Value(serializeTimeUnit(*_unit));
diff --git a/src/mongo/db/pipeline/document_source_fill.cpp b/src/mongo/db/pipeline/document_source_fill.cpp
index f7938a89a63..755b1f397df 100644
--- a/src/mongo/db/pipeline/document_source_fill.cpp
+++ b/src/mongo/db/pipeline/document_source_fill.cpp
@@ -37,7 +37,7 @@
#include "mongo/db/pipeline/field_path.h"
#include "mongo/stdx/variant.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/visit_helper.h"
+#include "mongo/util/overloaded_visitor.h"
#include <string>
namespace mongo {
diff --git a/src/mongo/db/pipeline/document_source_set_window_fields.cpp b/src/mongo/db/pipeline/document_source_set_window_fields.cpp
index 0920fdda988..aaee42b59d0 100644
--- a/src/mongo/db/pipeline/document_source_set_window_fields.cpp
+++ b/src/mongo/db/pipeline/document_source_set_window_fields.cpp
@@ -41,7 +41,7 @@
#include "mongo/db/pipeline/lite_parsed_document_source.h"
#include "mongo/db/query/query_knobs_gen.h"
#include "mongo/db/query/sort_pattern.h"
-#include "mongo/util/visit_helper.h"
+#include "mongo/util/overloaded_visitor.h"
using boost::intrusive_ptr;
using boost::optional;
diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.cpp b/src/mongo/db/pipeline/sharded_agg_helpers.cpp
index 522ff971056..8b8f6e476dd 100644
--- a/src/mongo/db/pipeline/sharded_agg_helpers.cpp
+++ b/src/mongo/db/pipeline/sharded_agg_helpers.cpp
@@ -64,7 +64,7 @@
#include "mongo/s/stale_exception.h"
#include "mongo/s/transaction_router.h"
#include "mongo/util/fail_point.h"
-#include "mongo/util/visit_helper.h"
+#include "mongo/util/overloaded_visitor.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kQuery
@@ -734,7 +734,7 @@ std::unique_ptr<Pipeline, PipelineDeleter> targetShardsAndAddMergeCursors(
boost::optional<BSONObj> readConcern) {
auto&& [aggRequest, pipeline] = [&] {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](std::unique_ptr<Pipeline, PipelineDeleter>&& pipeline) {
return std::make_pair(
AggregateCommandRequest(expCtx->ns, pipeline->serializeToBson()),
diff --git a/src/mongo/db/pipeline/window_function/partition_iterator.cpp b/src/mongo/db/pipeline/window_function/partition_iterator.cpp
index d8992aec28c..ea59f5c6e09 100644
--- a/src/mongo/db/pipeline/window_function/partition_iterator.cpp
+++ b/src/mongo/db/pipeline/window_function/partition_iterator.cpp
@@ -30,7 +30,7 @@
#include "mongo/platform/basic.h"
#include "mongo/db/pipeline/window_function/partition_iterator.h"
-#include "mongo/util/visit_helper.h"
+#include "mongo/util/overloaded_visitor.h"
using boost::optional;
@@ -196,7 +196,7 @@ PartitionIterator::AdvanceResult PartitionIterator::advanceInternal() {
namespace {
optional<int> numericBound(WindowBounds::Bound<int> bound) {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[](WindowBounds::Unbounded) -> optional<int> { return boost::none; },
[](WindowBounds::Current) -> optional<int> { return 0; },
[](int i) -> optional<int> { return i; },
@@ -259,7 +259,7 @@ optional<std::pair<int, int>> PartitionIterator::getEndpointsRangeBased(
// 'lower' is the smallest offset in the partition that's within the lower bound of the window.
optional<int> lower = stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](WindowBounds::Current) -> optional<int> {
// 'range: ["current", _]' means the current document, which is always offset 0.
return 0;
@@ -318,7 +318,7 @@ optional<std::pair<int, int>> PartitionIterator::getEndpointsRangeBased(
// 'upper' is the largest offset in the partition that's within the upper bound of the window.
optional<int> upper = stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](WindowBounds::Current) -> optional<int> {
// 'range: [_, "current"]' means the current document, which is offset 0.
return 0;
@@ -445,7 +445,7 @@ optional<std::pair<int, int>> PartitionIterator::getEndpoints(
tassert(5423301, "getEndpoints assumes there is a current document", (*this)[0] != boost::none);
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](const WindowBounds::DocumentBased docBounds) {
return getEndpointsDocumentBased(docBounds, hint);
},
diff --git a/src/mongo/db/pipeline/window_function/window_bounds.cpp b/src/mongo/db/pipeline/window_function/window_bounds.cpp
index dd082135e02..6025e255be9 100644
--- a/src/mongo/db/pipeline/window_function/window_bounds.cpp
+++ b/src/mongo/db/pipeline/window_function/window_bounds.cpp
@@ -65,7 +65,7 @@ WindowBounds::Bound<T> parseBound(ExpressionContext* expCtx,
template <class T>
Value serializeBound(const WindowBounds::Bound<T>& bound) {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[](const WindowBounds::Unbounded&) { return Value(WindowBounds::kValUnbounded); },
[](const WindowBounds::Current&) { return Value(WindowBounds::kValCurrent); },
[](const T& n) { return Value(n); },
@@ -220,7 +220,7 @@ WindowBounds WindowBounds::parse(BSONObj args,
}
void WindowBounds::serialize(MutableDocument& args) const {
stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](const DocumentBased& docBounds) {
args[kArgDocuments] = Value{std::vector<Value>{
serializeBound(docBounds.lower),
diff --git a/src/mongo/db/pipeline/window_function/window_function_exec.cpp b/src/mongo/db/pipeline/window_function/window_function_exec.cpp
index 6de2a88f3f6..5afcdfb3197 100644
--- a/src/mongo/db/pipeline/window_function/window_function_exec.cpp
+++ b/src/mongo/db/pipeline/window_function/window_function_exec.cpp
@@ -77,7 +77,7 @@ std::unique_ptr<WindowFunctionExec> translateDocumentWindow(
auto inputExpr = translateInputExpression(expr, sortBy);
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](const WindowBounds::Unbounded&) -> std::unique_ptr<WindowFunctionExec> {
// A left unbounded window will always be non-removable regardless of the upper
// bound.
@@ -145,7 +145,7 @@ std::unique_ptr<WindowFunctionExec> WindowFunctionExec::create(
WindowBounds bounds = functionStmt.expr->bounds();
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](const WindowBounds::DocumentBased& docBounds) {
return translateDocumentWindow(
iter, functionStmt.expr, sortBy, docBounds, &functionMemTracker);
diff --git a/src/mongo/db/pipeline/window_function/window_function_exec_non_removable.h b/src/mongo/db/pipeline/window_function/window_function_exec_non_removable.h
index 6d858d7646f..c96f2a4695f 100644
--- a/src/mongo/db/pipeline/window_function/window_function_exec_non_removable.h
+++ b/src/mongo/db/pipeline/window_function/window_function_exec_non_removable.h
@@ -109,7 +109,7 @@ private:
void initialize() {
auto needMore = [&](int index) {
return stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[&](const WindowBounds::Unbounded&) { return true; },
[&](const WindowBounds::Current&) { return index == 0; },
[&](const int& n) { return index <= n; },
diff --git a/src/mongo/db/pipeline/window_function/window_function_exec_removable_document.cpp b/src/mongo/db/pipeline/window_function/window_function_exec_removable_document.cpp
index ef053afdc30..625b15aac09 100644
--- a/src/mongo/db/pipeline/window_function/window_function_exec_removable_document.cpp
+++ b/src/mongo/db/pipeline/window_function/window_function_exec_removable_document.cpp
@@ -46,7 +46,7 @@ WindowFunctionExecRemovableDocument::WindowFunctionExecRemovableDocument(
memTracker) {
stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[](const WindowBounds::Unbounded&) {
// If the window is left unbounded we should use the non-removable executor.
MONGO_UNREACHABLE_TASSERT(5339802);
@@ -57,7 +57,7 @@ WindowFunctionExecRemovableDocument::WindowFunctionExecRemovableDocument(
bounds.lower);
stdx::visit(
- visit_helper::Overloaded{
+ OverloadedVisitor{
[](const WindowBounds::Unbounded&) {
// Pass. _upperBound defaults to boost::none which represents no upper
// bound.