Skip to content

Commit 228835a

Browse files
committed
Fix to_string to call cpp2::to_string
Calling std::to_string makes it impossible to use to_string on optional that contains std::string. The solution is to call cpp2::to_string instead of std::to_string.
1 parent 8d5c9b7 commit 228835a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/cpp2util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ auto to_string(std::string const& s) -> std::string const&
741741
template<typename T>
742742
auto to_string(std::optional<T> const& o) -> std::string {
743743
if (o.has_value()) {
744-
return std::to_string(o.value());
744+
return cpp2::to_string(o.value());
745745
}
746746
return "(empty)";
747747
}

0 commit comments

Comments
 (0)