]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid auto_ptr in bundled boost
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 30 Mar 2018 10:54:48 +0000 (12:54 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 30 Mar 2018 10:55:45 +0000 (12:55 +0200)
bundled/boost-1.62.0/include/boost/date_time/gregorian/greg_facet.hpp
bundled/boost-1.62.0/include/boost/detail/lightweight_thread.hpp
bundled/boost-1.62.0/include/boost/graph/detail/adjacency_list.hpp
bundled/boost-1.62.0/include/boost/iostreams/chain.hpp
bundled/boost-1.62.0/include/boost/random/uniform_on_sphere.hpp
bundled/boost-1.62.0/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
bundled/boost-1.62.0/include/boost/spirit/home/classic/symbols/impl/tst.ipp
bundled/boost-1.62.0/include/boost/spirit/home/support/detail/lexer/generator.hpp

index b8c6d57fe5596fc829a7f5ca928d93d86bd7195e..45d9da1d40cd5a27c03a3771a9b4934e57510e0f 100644 (file)
@@ -290,7 +290,11 @@ namespace gregorian {
      * names as a default. */
     catch(std::bad_cast&){
       charT a = '\0';
+#if defined(BOOST_NO_CXX11_SMART_PTR)
       std::auto_ptr< const facet_def > f(create_facet_def(a));
+#else
+      std::unique_ptr< const facet_def > f(create_facet_def(a));
+#endif
       num = date_time::find_match(f->get_short_month_names(), 
                                   f->get_long_month_names(), 
                                   (greg_month::max)(), s); // greg_month spans 1..12, so max returns the array size,
@@ -332,7 +336,11 @@ namespace gregorian {
      * names as a default. */
     catch(std::bad_cast&){
       charT a = '\0';
+#if defined(BOOST_NO_CXX11_SMART_PTR)
       std::auto_ptr< const facet_def > f(create_facet_def(a));
+#else
+      std::unique_ptr< const facet_def > f(create_facet_def(a));
+#endif
       num = date_time::find_match(f->get_short_weekday_names(), 
                                   f->get_long_weekday_names(), 
                                   (greg_weekday::max)() + 1, s); // greg_weekday spans 0..6, so increment is needed
index 6fe70a613d297c24f0536544158747be4dc7bf50..090eeb56a761da9c00b84e38d40c29cc88604498 100644 (file)
@@ -77,7 +77,11 @@ public:
 
 extern "C" void * lw_thread_routine( void * pv )
 {
+#if defined(BOOST_NO_CXX11_SMART_PTR)
     std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+#else
+    std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+#endif
 
     pt->run();
 
@@ -88,7 +92,11 @@ extern "C" void * lw_thread_routine( void * pv )
 
 unsigned __stdcall lw_thread_routine( void * pv )
 {
+#if defined(BOOST_NO_CXX11_SMART_PTR)
     std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+#else
+    std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+#endif
 
     pt->run();
 
@@ -117,7 +125,11 @@ private:
 
 template<class F> int lw_thread_create( pthread_t & pt, F f )
 {
+#if defined(BOOST_NO_CXX11_SMART_PTR)
     std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
+#else
+    std::unique_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
+#endif
 
     int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
 
index 3c3ab0ec38648b56aad1b1dabed740314583c10e..b6955fd8533b3024fd37b6050b078de0d80cf199 100644 (file)
@@ -289,7 +289,11 @@ namespace boost {
       // invalidation for add_edge() with EdgeList=vecS. Instead we
       // hold a pointer to the property. std::auto_ptr is not
       // a perfect fit for the job, but it is darn close.
+#if defined(BOOST_NO_CXX11_SMART_PTR)
       std::auto_ptr<Property> m_property;
+#else
+      std::unique_ptr<Property> m_property;
+#endif
     };
 #else
     template <class Vertex, class Property>
index a199c9df38ff5fa92b1f465c5b46237226e20295..bc0fab58ea128e5ce37232f8fe7140acb7feaf4e 100644 (file)
@@ -243,8 +243,13 @@ private:
             pback_size != -1 ?
                 pback_size :
                 pimpl_->pback_size_;
+#if defined(BOOST_NO_CXX11_SMART_PTR)
         std::auto_ptr<streambuf_t>
             buf(new streambuf_t(t, buffer_size, pback_size));
+#else
+        std::unique_ptr<streambuf_t>
+            buf(new streambuf_t(t, buffer_size, pback_size));
+#endif
         list().push_back(buf.get());
         buf.release();
         if (is_device<component_type>::value) {
index 72c25ef78142ae82c20a103df80d0e7caacfc088..ce2e35237e05c6ff39703296bf6b878518ea57ed 100644 (file)
@@ -225,8 +225,12 @@ public:
                     }
                 } while(sqsum == 0);
                 // for all i: result[i] /= sqrt(sqsum)
-                std::transform(_container.begin(), _container.end(), _container.begin(),
-                               std::bind2nd(std::multiplies<RealType>(), 1/sqrt(sqsum)));
+                RealType inverse_distance = 1 / sqrt(sqsum);
+                for(typename Cont::iterator it = _container.begin();
+                    it != _container.end();
+                    ++it) {
+                    *it *= inverse_distance;
+                }
             }
         }
         return _container;
index 002d221eeb43f4705be274b2181e3929cb06dcb6..96677e70201e8fd81b0e1a532bb0a8a219577995 100644 (file)
@@ -156,8 +156,13 @@ struct grammar_definition
             if (definitions[id]!=0)
                 return *definitions[id];
 
+#if defined(BOOST_NO_CXX11_SMART_PTR)
             std::auto_ptr<definition_t>
                 result(new definition_t(target_grammar->derived()));
+#else
+            std::unique_ptr<definition_t>
+                result(new definition_t(target_grammar->derived()));
+#endif
 
 #ifdef BOOST_SPIRIT_THREADSAFE
             boost::unique_lock<boost::mutex> lock(helpers.mutex());
index 1a4a0c1052fcdff5b3d286fd41725eb2b7dcd3f6..305d40025c5be63339e981384a24a370ce0f5ad1 100644 (file)
@@ -62,7 +62,11 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
         tst_node*
         clone() const
         {
+#if defined(BOOST_NO_CXX11_SMART_PTR)
             std::auto_ptr<tst_node> copy(new tst_node(value));
+#else
+            std::unique_ptr<tst_node> copy(new tst_node(value));
+#endif
 
             if (left)
                 copy->left = left->clone();
@@ -75,7 +79,11 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
             }
             else
             {
+#if defined(BOOST_NO_CXX11_SMART_PTR)
                 std::auto_ptr<T> mid_data(new T(*middle.data));
+#else
+                std::unique_ptr<T> mid_data(new T(*middle.data));
+#endif
                 copy->middle.data = mid_data.release();
             }
 
index daa06e7944cd76edd5d8675974e36f4884171f94..49f93e491de601f7dcfd1cd0cbde3e78dfc8bb34 100644 (file)
@@ -116,10 +116,18 @@ public:
 protected:
     typedef detail::basic_charset<CharT> charset;
     typedef detail::ptr_list<charset> charset_list;
+#if defined(BOOST_NO_CXX11_SMART_PTR)
     typedef std::auto_ptr<charset> charset_ptr;
+#else
+    typedef std::unique_ptr<charset> charset_ptr;
+#endif
     typedef detail::equivset equivset;
     typedef detail::ptr_list<equivset> equivset_list;
+#if defined(BOOST_NO_CXX11_SMART_PTR)
     typedef std::auto_ptr<equivset> equivset_ptr;
+#else
+    typedef std::unique_ptr<equivset> equivset_ptr;
+#endif
     typedef typename charset::index_set index_set;
     typedef std::vector<index_set> index_set_vector;
     typedef detail::basic_parser<CharT> parser;
@@ -377,8 +385,13 @@ protected:
         if (followpos_->empty ()) return npos;
 
         std::size_t index_ = 0;
+#if defined(BOOST_NO_CXX11_SMART_PTR)
         std::auto_ptr<node_set> set_ptr_ (new node_set);
         std::auto_ptr<node_vector> vector_ptr_ (new node_vector);
+#else
+        std::unique_ptr<node_set> set_ptr_ (new node_set);
+        std::unique_ptr<node_vector> vector_ptr_ (new node_vector);
+#endif
 
         for (typename detail::node::node_vector::const_iterator iter_ =
             followpos_->begin (), end_ = followpos_->end ();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.