std::shared_ptr
authorCarl Hetherington <cth@carlh.net>
Sun, 20 Dec 2020 13:09:01 +0000 (14:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 20 Dec 2020 16:56:55 +0000 (17:56 +0100)
cscript
src/cxml.cc
src/cxml.h
test/tests.cc
wscript

diff --git a/cscript b/cscript
index af1793ae15b4f9c371d6ece517ed3da1395caad9..b440d5511f5f1c01949bf709ebffb1028d23188e 100644 (file)
--- a/cscript
+++ b/cscript
@@ -20,8 +20,6 @@
 
 import os
 
-option_defaults = { 'force-cpp11': False }
-
 def build(target, options):
     cmd = './waf configure --prefix=%s' % target.directory
     if target.platform == 'linux':
@@ -33,22 +31,6 @@ def build(target, options):
     elif target.platform == 'windows':
         cmd += ' --target-windows'
 
-    # Centos 7 ships with glibmm 2.50.0 which requires C++11
-    # but its compiler (gcc 4.8.5) defaults to C++97.  Go figure.
-    # I worry that this will cause ABI problems but I don't have
-    # a better solution.  Mageia 6 pulls the same stunt except it's
-    # libxml++ that requires C++11
-    force_cpp11 = False
-    if target.platform == 'linux':
-        if target.distro == 'centos' and target.version == '7':
-            force_cpp11 = True
-        if target.distro == 'mageia' and target.version == '6':
-            force_cpp11 = True
-    if target.platform == 'windows':
-        force_cpp11 = True
-    if force_cpp11 or options['force-cpp11']:
-        cmd += ' --force-cpp11'
-
     target.command(cmd)
     target.command('./waf build install')
 
index 667da5515851b6a8ea8fd109f92cee71457fbc15..fac787fd45ae1a809f88f526386be9c8564b14bd 100644 (file)
@@ -26,7 +26,7 @@
 
 using std::string;
 using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
 using boost::optional;
 
 cxml::Node::Node ()
index 24174ff60b3a326c0b5c5f86f8c1c3f5637b2b39..d9c8ef6e5e930d55c5b773b322c231de6fb9e70b 100644 (file)
@@ -221,11 +221,11 @@ public:
        /** @return namespace prefix of this node */
        std::string namespace_prefix () const;
 
-       boost::shared_ptr<Node> node_child (std::string) const;
-       boost::shared_ptr<Node> optional_node_child (std::string) const;
+       std::shared_ptr<Node> node_child (std::string) const;
+       std::shared_ptr<Node> optional_node_child (std::string) const;
 
-       std::list<boost::shared_ptr<Node> > node_children () const;
-       std::list<boost::shared_ptr<Node> > node_children (std::string) const;
+       std::list<std::shared_ptr<Node> > node_children () const;
+       std::list<std::shared_ptr<Node> > node_children (std::string) const;
 
        xmlpp::Node* node () const {
                return _node;
@@ -238,8 +238,8 @@ private:
        mutable std::list<std::string> _taken;
 };
 
-typedef boost::shared_ptr<cxml::Node> NodePtr;
-typedef boost::shared_ptr<const cxml::Node> ConstNodePtr;
+typedef std::shared_ptr<cxml::Node> NodePtr;
+typedef std::shared_ptr<const cxml::Node> ConstNodePtr;
 
 class Document : public Node
 {
index 4fc72b2fb1cf4c4af6b09803bb531a049dbb4381..6867ac05805606418a53219b750d1a492aff1e15 100644 (file)
@@ -30,7 +30,7 @@
 using std::string;
 using std::vector;
 using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
 
 BOOST_AUTO_TEST_CASE (test)
 {
diff --git a/wscript b/wscript
index b4f47474daa74cad077bc0964548838a80a8a2af..7504c594a0bc83242650775ae5c2ca74737e733b 100644 (file)
--- a/wscript
+++ b/wscript
@@ -40,15 +40,12 @@ def options(opt):
     opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
     opt.add_option('--static', action='store_true', default=False, help='build statically')
     opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
-    opt.add_option('--force-cpp11', action='store_true', default=False, help='force use of C++11')
 
 def configure(conf):
     conf.load('compiler_cxx')
     if conf.options.enable_debug:
         conf.env.append_value('CXXFLAGS', '-g')
-    conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-O2', '-Wno-deprecated-declarations'])
-    if conf.options.force_cpp11:
-        conf.env.append_value('CXXFLAGS', ['-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
+    conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-O2', '-Wno-deprecated-declarations', '-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
 
     conf.env.TARGET_WINDOWS = conf.options.target_windows
     conf.env.STATIC = conf.options.static