[Boost-bugs] [Boost C++ Libraries] #9418: key of fusion map could not be abstract type

Subject: [Boost-bugs] [Boost C++ Libraries] #9418: key of fusion map could not be abstract type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-21 07:29:06


#9418: key of fusion map could not be abstract type
---------------------------------+----------------------
 Reporter: record.nctu.cis91@… | Owner: dgregor
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: function
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
---------------------------------+----------------------
 The following code fails to be compiled with Boost 1.55.0 using gcc 4.8.1.
 But work with Boost 1.53.0 using gcc 4.8.1.
 {{{
 #include <boost/fusion/include/map.hpp>
 #include <boost/fusion/include/pair.hpp>

 namespace bf = boost::fusion;

 struct tagging
 {
     virtual void foo() = 0;
 };

 int main()
 {
     bf::map<bf::pair<tagging, int>> booom;

     return 0;
 }
 }}}

 gcc complains with the following
 {{{
 In file included from
 /usr/local/include/boost/fusion/container/map/map_fwd.hpp:24:0,
                  from
 /usr/local/include/boost/fusion/container/map/map.hpp:10,
                  from
 /usr/local/include/boost/fusion/container/map.hpp:10,
                  from /usr/local/include/boost/fusion/include/map.hpp:10,
                  from main.cpp:1:
 /usr/local/include/boost/fusion/container/map/detail/map_impl.hpp: In
 instantiation of ‘struct boost::fusion::detail::map_impl<0,
 boost::fusion::pair<tagging, int> >’:
 /usr/local/include/boost/fusion/container/map/map.hpp:45:12: required
 from ‘struct boost::fusion::map<boost::fusion::pair<tagging, int> >’
 main.cpp:13:37: required from here
 /usr/local/include/boost/fusion/container/map/detail/map_impl.hpp:116:18:
 error: cannot allocate an object of abstract type ‘tagging’
          key_type get_key(mpl::int_<index>);
                   ^
 main.cpp:6:8: note: because the following virtual functions are pure
 within ‘tagging’:
  struct tagging
         ^
 main.cpp:8:18: note: virtual void tagging::foo()
      virtual void foo() = 0;
                   ^
 In file included from
 /usr/local/include/boost/fusion/container/map/map_fwd.hpp:24:0,
                  from
 /usr/local/include/boost/fusion/container/map/map.hpp:10,
                  from
 /usr/local/include/boost/fusion/container/map.hpp:10,
                  from /usr/local/include/boost/fusion/include/map.hpp:10,
                  from main.cpp:1:
 /usr/local/include/boost/fusion/container/map/detail/map_impl.hpp:117:18:
 error: cannot allocate an object of abstract type ‘tagging’
          key_type get_key(mpl::int_<index>) const;
                   ^
 main.cpp:6:8: note: since type ‘tagging’ has pure virtual functions
  struct tagging
         ^
 }}}

 I guess the failure is caused by the return value of 'get_key' in
 'map_impl'.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9418>
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:14 UTC