Skip to content

Commit 2e8f227

Browse files
committed
Allow Monotonic to use custom types with to_string defined
ThrowExceptionPolicy tries to log the current and new values when the Monotonic Invariant fails. Rather than specifying std::to_string(value) use using std::to_string ... to_string(value) ... to allow the use of custom defined `to_string` (e.g., through ADL) Change-Id: Ibef1671f72adcec92fec2dcf28978583f2cadc14 Reviewed-on: http://review.couchbase.org/111811 Reviewed-by: Dave Rigby <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent 840c194 commit 2e8f227

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

engines/ep/src/monotonic.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ struct ThrowExceptionPolicy {
3838
void nonMonotonic(const std::string& label,
3939
const T& curValue,
4040
const T& newValue) {
41+
using std::to_string;
4142
throw std::logic_error(
4243
std::string("Monotonic<") + typeid(T).name() + "> (" + label +
43-
") invariant failed: new value (" + std::to_string(newValue) +
44+
") invariant failed: new value (" + to_string(newValue) +
4445
") breaks invariant on current value (" +
45-
std::to_string(curValue) + ")");
46+
to_string(curValue) + ")");
4647
}
4748
};
4849

0 commit comments

Comments
 (0)