Skip to content

Commit e7c6a67

Browse files
committed
Fix to_string(std::any) overload
1 parent fc80e7f commit e7c6a67

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

include/cpp2util.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,9 @@ inline auto to_string(...) -> std::string {
11141114
return "(customize me - no cpp2::to_string overload exists for this type)";
11151115
}
11161116

1117-
inline auto to_string(std::any const&) -> std::string {
1117+
template<typename T>
1118+
requires std::is_same_v<T, std::any>
1119+
inline auto to_string(T const&) -> std::string {
11181120
return "std::any";
11191121
}
11201122

regression-tests/test-results/clang-12/mixed-string-interpolation.cpp.execution

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ p = (first, (empty))
1414
t = (3.140000, (empty), (empty))
1515
vv = 0
1616
vv = (1, 2.300000)
17-
custom = std::any
17+
custom = (customize me - no cpp2::to_string overload exists for this type)

0 commit comments

Comments
 (0)