Opened 13 years ago
Closed 13 years ago
#3337 closed Bugs (fixed)
mpl::has_push_back_arg/mpl:::has_push_front_arg are incomplete types
| Reported by: | Christopher Schmidt | Owned by: | Aleksey Gurtovoy | 
|---|---|---|---|
| Milestone: | Boost 1.40.0 | Component: | mpl | 
| Version: | Boost Development Trunk | Severity: | Problem | 
| Keywords: | Cc: | Christopher Schmidt | 
Description
boost::mpl::has_push_back_arg (https://svn.boost.org/trac/boost/browser/trunk/boost/mpl/aux_/push_back_impl.hpp?rev=54948#L28) and boost::mpl::push_front_arg (https://svn.boost.org/trac/boost/browser/trunk/boost/mpl/aux_/push_front_impl.hpp?rev=54948#L28) are both declared but not defined. This leads to a compiler error when using mpl::has_push_back (https://svn.boost.org/trac/boost/browser/trunk/boost/mpl/push_back.hpp?rev=54948#L40) / mpl::has_push_front (https://svn.boost.org/trac/boost/browser/trunk/boost/mpl/push_front.hpp?rev=54948#L40) on a mpl sequence (to be precise a fusion sequence) which needs complete 'argument' types when being instanced.
Minimal testcase:
#include <boost/mpl/transform.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/mpl.hpp>
boost::mpl::transform<boost::fusion::vector<>,boost::mpl::_1>::type t;
Change History (3)
comment:1 by , 13 years ago
| Cc: | added | 
|---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 


I don't think that it's safe in general to rely on the default implementation of has_push_back for sequences where push_back has any requirements on the arguments. I guess it doesn't hurt to make them complete types, though, since this is a pretty minimal requirement.