util: remove obsolete backport of std::to_string
Change-Id: Ib2ba051b84032b227ce75f41e242af20b4a43c3c
This commit is contained in:
1 parent
05ec0be21b
commit
869d1a3c36
4 files changed
+6
-54
No files matched your search
@@ -1,30 +0,0 @@
|
||||
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
from waflib.Configure import conf
|
||||
|
||||
STD_TO_STRING = '''
|
||||
#include <string>
|
||||
int
|
||||
main()
|
||||
{
|
||||
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();
|
||||
}
|
||||
'''
|
||||
|
||||
@conf
|
||||
def check_std_to_string(self):
|
||||
if self.check_cxx(msg='Checking for std::to_string',
|
||||
fragment=STD_TO_STRING, mandatory=False):
|
||||
self.define('HAVE_STD_TO_STRING', 1)
|
||||
|
||||
def configure(conf):
|
||||
conf.check_std_to_string()
|
||||
@@ -73,6 +73,7 @@ using std::dynamic_pointer_cast;
|
||||
using std::const_pointer_cast;
|
||||
|
||||
using std::function;
|
||||
using std::to_string;
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
@@ -28,29 +28,10 @@
|
||||
#include <boost/predef/compiler/gcc.h>
|
||||
#include <boost/predef/compiler/visualc.h>
|
||||
|
||||
#ifndef NDN_CXX_HAVE_STD_TO_STRING
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#endif
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace ndn {
|
||||
|
||||
//
|
||||
// https://redmine.named-data.net/issues/2743
|
||||
// std::to_string() (C++11)
|
||||
//
|
||||
#ifdef NDN_CXX_HAVE_STD_TO_STRING
|
||||
using std::to_string;
|
||||
#else
|
||||
template<typename T>
|
||||
std::string
|
||||
to_string(const T& val)
|
||||
{
|
||||
return boost::lexical_cast<std::string>(val);
|
||||
}
|
||||
#endif // NDN_CXX_HAVE_STD_TO_STRING
|
||||
|
||||
//
|
||||
// https://wg21.link/P1682
|
||||
// std::to_underlying() (C++23)
|
||||
|
||||
@@ -9,8 +9,8 @@ GIT_TAG_PREFIX = 'ndn-cxx-'
|
||||
|
||||
def options(opt):
|
||||
opt.load(['compiler_cxx', 'gnu_dirs', 'c_osx'])
|
||||
opt.load(['cross', 'default-compiler-flags', 'compiler-features',
|
||||
'coverage', 'pch', 'sanitizers', 'osx-frameworks',
|
||||
opt.load(['cross', 'default-compiler-flags', 'pch',
|
||||
'coverage', 'sanitizers', 'osx-frameworks',
|
||||
'boost', 'openssl', 'sqlite3',
|
||||
'doxygen', 'sphinx_build'],
|
||||
tooldir=['.waf-tools'])
|
||||
@@ -69,9 +69,9 @@ def configure(conf):
|
||||
if not conf.options.enable_shared and not conf.options.enable_static:
|
||||
conf.fatal('Either static library or shared library must be enabled')
|
||||
|
||||
conf.load(['cross', 'compiler_cxx', 'gnu_dirs', 'c_osx',
|
||||
'default-compiler-flags', 'compiler-features',
|
||||
'pch', 'osx-frameworks', 'boost', 'openssl', 'sqlite3',
|
||||
conf.load(['compiler_cxx', 'gnu_dirs', 'c_osx',
|
||||
'cross', 'default-compiler-flags', 'pch',
|
||||
'osx-frameworks', 'boost', 'openssl', 'sqlite3',
|
||||
'doxygen', 'sphinx_build'])
|
||||
|
||||
conf.env.WITH_TESTS = conf.options.with_tests
|
||||
|
||||
Reference in new issue
Block a user