This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch no_sstream_in_to_string
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git


The following commit(s) were added to refs/heads/no_sstream_in_to_string by 
this push:
     new db4ad1f  added alternative to stream-based conversion to string
db4ad1f is described below

commit db4ad1f6d21403a58a94a7d6b761c05ded5c17ca
Author: AlexanderSaydakov <[email protected]>
AuthorDate: Tue Oct 12 15:15:43 2021 -0700

    added alternative to stream-based conversion to string
---
 common/include/common_defs.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/include/common_defs.hpp b/common/include/common_defs.hpp
index fa0e204..caa649c 100644
--- a/common/include/common_defs.hpp
+++ b/common/include/common_defs.hpp
@@ -85,6 +85,14 @@ template<typename T> struct ostream_based_to_string {
   }
 };
 
+// alternative to the above
+// relies on std::to_string for type T
+template<typename T> struct std_to_string {
+  std::string operator()(const T& item) const {
+    return std::to_string(item);
+  }
+};
+
 } // namespace
 
 #endif // _COMMON_DEFS_HPP_

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to