Re: [Boost-bugs] [Boost C++ Libraries] #8414: flyweights causes weird library initialization error

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8414: flyweights causes weird library initialization error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-08 17:07:22


#8414: flyweights causes weird library initialization error
-----------------------------------------------------------+----------------
  Reporter: charles quarra <charlls_quarra@…> | Owner: joaquin
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: flyweight
   Version: Boost 1.53.0 | Severity: Showstopper
Resolution: invalid | Keywords:
-----------------------------------------------------------+----------------

Comment (by joaquin):

 Seems like a bug to me, rather than default behavior. Unfortunately GCC is
 not my area of expertise. Let's do a final try: you can resort to a user-
 defined holder with a slightly different behavior wrt static construction:

 {{{
 template<typename C>
 struct GCC_dyn_holder_class:boost::flyweights::holder_marker
 {
   static C c;
   static C& get()
   {
     return c;
   }
 };

 template<typename C> C GCC_dyn_holder_class<C>::c;

 struct GCC_dyn_holder:boost::flyweights::holder_marker
 {
   template<typename C>
   struct apply
   {
     typedef GCC_dyn_holder_class<C> type;
   };
 };

 typedef boost::flyweight<std::string,GCC_dyn_holder> SymbolName_t;
 }}}

 Does this change anything?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8414#comment:6>
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:50:12 UTC