Remove illegal std::to_string definition and use ndn::to_string in its place
Change-Id: I81481fea3267bde669c45df182e0aea8ccd1a188
Refs: #3214
diff --git a/.waf-tools/compiler-features.py b/.waf-tools/compiler-features.py
index 774784d..1fd529e 100644
--- a/.waf-tools/compiler-features.py
+++ b/.waf-tools/compiler-features.py
@@ -23,32 +23,5 @@
define_name='HAVE_CXX_OVERRIDE',
features='cxx', mandatory=False)
-STD_TO_STRING = '''
-#include <string>
-int
-main(int argc, char** argv)
-{
- std::string s = std::to_string(0);
- s = std::to_string(0l);
- s = std::to_string(0ll);
- s = std::to_string(0u);
- s = std::to_string(0ul);
- s = std::to_string(0ull);
- s = std::to_string(0.0f);
- s = std::to_string(0.0);
- s = std::to_string(0.0l);
- s.clear();
- return 0;
-}
-'''
-
-@conf
-def check_std_to_string(self):
- self.check_cxx(msg='Checking for std::to_string',
- fragment=STD_TO_STRING,
- define_name='HAVE_STD_TO_STRING',
- features='cxx', mandatory=False)
-
def configure(conf):
conf.check_override()
- conf.check_std_to_string()
diff --git a/common.hpp b/common.hpp
index 25cc4a6..3e4f44f 100644
--- a/common.hpp
+++ b/common.hpp
@@ -101,6 +101,8 @@
using std::ref;
using std::cref;
+using ndn::to_string;
+
using ndn::Interest;
using ndn::Data;
using ndn::Name;
@@ -121,16 +123,4 @@
} // namespace nfd
-// Some platforms are missing std::to_string (issue #2743)
-#ifndef HAVE_STD_TO_STRING
-namespace std {
-template<typename V>
-inline std::string
-to_string(const V& v)
-{
- return boost::lexical_cast<std::string>(v);
-}
-} // namespace std
-#endif // HAVE_STD_TO_STRING
-
#endif // NFD_COMMON_HPP
diff --git a/rib/fib-updater.cpp b/rib/fib-updater.cpp
index 91d1bdd..cddb086 100644
--- a/rib/fib-updater.cpp
+++ b/rib/fib-updater.cpp
@@ -305,8 +305,7 @@
}
}
else {
- BOOST_THROW_EXCEPTION(Error("Non-recoverable error: " + error + " code: " +
- std::to_string(code)));
+ BOOST_THROW_EXCEPTION(Error("Non-recoverable error: " + error + " code: " + to_string(code)));
}
}
diff --git a/tools/ndn-autoconfig/base-dns.cpp b/tools/ndn-autoconfig/base-dns.cpp
index bcd1f65..c4f27b3 100644
--- a/tools/ndn-autoconfig/base-dns.cpp
+++ b/tools/ndn-autoconfig/base-dns.cpp
@@ -160,7 +160,7 @@
std::string uri = "udp://";
uri.append(hostName);
uri.append(":");
- uri.append(std::to_string(convertedPort));
+ uri.append(to_string(convertedPort));
return uri;
}