Dear boosters,
Could someone out there verify that the following piece of code fails
with Intel Compiler v11.0.066 on Windows (Microsoft SDK v6.1):
---------------------
#include
#include <vector>
using namespace std;
int main(int argc, char* argv[])
{
vector< int > testvec;
BOOST_TYPEOF( testvec.begin() ) i = testvec.begin();
return 0;
}
---------------------
The compiler output is:
---------------------
using typeof emulation
C:\boost\include\boost-1_37\boost/typeof/encode_decode.hpp(50): error:
incomplete type is not allowed
struct encode_type :
BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl
^
detected during instantiation of class
"boost::type_of::encode_type [with
V=boost::type_of::vector0<void>, T=std::_Vector_iterator]" at line 9 of "typeoftest.cpp"
...
---------------------
Preprocessor output shows that encode_type_impl is indeed just
forward-declared before encode_type:
---------------------
#line 30 "C:\\boost\\include\\boost-1_37\\boost/typeof/encode_decode.hpp"
namespace { namespace boost_typeof {
template
struct encode_type_impl;
<snip>
}}
namespace boost { namespace type_of {
template
struct encode_type : boost_typeof::encode_type_impl
{};
template<class Iter>
struct decode_type : boost_typeof::decode_type_impl<
typename Iter::type,
typename Iter::next
>
{};
}}
---------------------
Is this a bug? Should a header containing the implementation of
encode_type_impl be included prior to encode_decode.hpp? Any help
appreciated.
Cheers,
Mikko