Re: [Boost-bugs] [Boost C++ Libraries] #1892: boost::spirit::static_ causes link error (using wave)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1892: boost::spirit::static_ causes link error (using wave)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-07-09 14:10:00


#1892: boost::spirit::static_ causes link error (using wave)
---------------------------+------------------------------------------------
  Reporter: anonymous | Owner: djowel
      Type: Bugs | Status: new
 Milestone: Boost 1.36.0 | Component: spirit
   Version: Boost 1.35.0 | Severity: Regression
Resolution: | Keywords:
---------------------------+------------------------------------------------

Comment(by eric.malenfant_at_[hidden]):

 Proposed fix:

  Move the definitions of the "destructor" and "default_constructor" out of
 static_'s ctor body, and put them inside the class template definition
 instead.

 A patch against Boost release 1.35 of
 /boost/spirit/core/non_terminal/impl/static.hpp gives:

 {{{
 @@ -40,20 +40,15 @@
      struct static_
          : boost::noncopyable
      {
 - typedef T value_type;
 - typedef typename boost::call_traits<T>::reference reference;
 - typedef typename boost::call_traits<T>::const_reference
 const_reference;
 -
 - static_(Tag = Tag())
 - {
 - struct destructor
 + private:
 + struct destructor
              {
                  ~destructor()
                  {
                      static_::get_address()->~value_type();
                  }
              };
 -
 +
              struct default_ctor
              {
                  static void construct()
 @@ -63,6 +58,13 @@
                  }
              };

 + public:
 + typedef T value_type;
 + typedef typename boost::call_traits<T>::reference reference;
 + typedef typename boost::call_traits<T>::const_reference
 const_reference;
 +
 + static_(Tag = Tag())
 + {
              boost::call_once(&default_ctor::construct, constructed_);
          }
 }}}

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1892#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC