File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,26 @@ concept StringConvertible = requires(T a) {
2323 a.ToString ()
2424 } -> std::convertible_to<std::string>;
2525 };
26+ // For std::filesystem::path and similar types
27+ template <typename T>
28+ concept StringConvertibleFSPathLike = requires (T a) {
29+ {
30+ a.string ()
31+ } -> std::convertible_to<std::string>;
32+ };
2633
2734struct ToStringHelper {
2835 template <typename T>
2936 requires (StringConvertible<T>) && (!StringViewConvertible<T>)
3037 static std::string Convert (const T& value) {
3138 return value.ToString ();
3239 }
40+ template <typename T>
41+ requires (StringConvertibleFSPathLike<T>) && (!StringViewConvertible<T>) &&
42+ (!StringConvertible<T>)
43+ static std::string Convert (const T& value) {
44+ return value.string ();
45+ }
3346 template <typename T>
3447 requires StringViewConvertible<T>
3548 static std::string_view Convert (const T& value) {
You can’t perform that action at this time.
0 commit comments