Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

Getting "incomplete type is not allowed" error

$
0
0

Hi,

  while trying to compile following code using "icc compiler 15.0.0", I am getting the follow error (this code compiles fine with gcc 4.7.2)

>cat foo.cpp
#include "boost/mpl/pop_back.hpp"
#include "boost/mpl/copy_if.hpp"
#include "boost/mpl/vector.hpp"
#include "boost/mpl/eval_if.hpp"
#include "boost/mpl/empty.hpp"
template <class T>
struct LastEnrollerHelper
{
  static void enroll(int, T*) {}
};
template< class T, class TVector>
struct EnrollerHelper
{
  static void enroll(int iReg, T* iT)
  {
    typedef typename boost::mpl::eval_if<boost::mpl::empty<TVector>,
           boost::mpl::identity<LastEnrollerHelper<T> >,
           boost::mpl::identity<EnrollerHelper<T, typename boost::mpl::pop_back< TVector >::type > >>::type NextEnroller;
    NextEnroller::enroll(iReg,iT);
  }
};
void func(){EnrollerHelper<int,boost::mpl::vector<int> >::enroll(1,0);}

muzaffar@cmsdev03.cern.ch>icpc -v
icpc version 15.0.0 (gcc version 4.7.2 compatibility)
muzaffar@cmsdev03.cern.ch>icpc -c -I/boost/1.47.0/include -o foo.o foo.cpp
/boost/1.47.0/include/boost/mpl/pop_back.hpp(29): error: incomplete type is not allowed
      : pop_back_impl< typename sequence_tag<Sequence>::type >
        ^
          detected during:
            instantiation of class "boost::mpl::pop_back<Sequence> [with Sequence=boost::mpl::vector0<boost::mpl::na>]" at line 20 of "foo.cpp"
            instantiation of "void EnrollerHelper<T, TVector>::enroll(int, T *) [with T=int, TVector=boost::mpl::vector0<boost::mpl::na>]" at line 22 of "foo.cpp"
            instantiation of "void EnrollerHelper<T, TVector>::enroll(int, T *) [with T=int, TVector=boost::mpl::vector<int, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na>]" at line 26 of "foo.cpp"

foo.cpp(20): error: class "boost::mpl::pop_back<boost::mpl::vector0<boost::mpl::na>>" has no member "type"
             boost::mpl::identity<EnrollerHelper<T, typename boost::mpl::pop_back< TVector >::type > >
                                                                                              ^
          detected during:
            instantiation of "void EnrollerHelper<T, TVector>::enroll(int, T *) [with T=int, TVector=boost::mpl::vector0<boost::mpl::na>]" at line 22
            instantiation of "void EnrollerHelper<T, TVector>::enroll(int, T *) [with T=int, TVector=boost::mpl::vector<int, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na, boost::mpl::na>]" at line 26

compilation aborted for foo.cpp (code 2)

 

Any idea what am I doing wrong here?


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>