[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost
Subject:    Re: [boost] [multi_index]: Migration of code to VS12 does not compile anymore
From:       Sergiu Dotenco <sergiu.dotenco () gmail ! com>
Date:       2014-08-11 15:56:18
Message-ID: 53E8E7A2.6050908 () gmail ! com
[Download RAW message or body]

On 8/11/2014 5:05 PM, Johannes Brunen wrote:
> Hello,
> 
>  
> 
> I'm porting some code fromVS10 to the VS12 compiler on windows. I have a
> problem compiling code like the following:
> 
>  
> 
> //Test.cpp 
> 
> #include <boost/multi_index_container.hpp>
> 
> #include <boost/multi_index/random_access_index.hpp>
> 
> #include <boost/multi_index/hashed_index.hpp>
> 
> #include <boost/multi_index/identity.hpp>
> 
>  
> 
> template<typename T>
> 
> class test
> 
> {
> 
> public:
> 
>     typedef typename boost::multi_index_container <
> 
>         T*,
> 
>         boost::multi_index::indexed_by <
> 
>             boost::multi_index::random_access<>,
> 
>             boost::multi_index::hashed_non_unique <
> boost::multi_index::identity<T*> >
> 
>         >
> 
>     > container_t;
> 
>  
> 
>     typedef typename container_t::nth_index<0>::type sequence_index_t;
> 
> };
> 
>  
> 
> This does not compile and gives the following error message:
> 
>  
> 
> 1>  Test.cpp
> 
> 1>D:\test\Test.cpp(18): error C2059: syntax error : '<'
> 
> 1>          D:\test\Test.cpp(19) : see reference to class template
> instantiation 'test<T>' being compiled
> 
> 1>D:\test\Test.cpp(18): error C2238: unexpected token(s) preceding ';'
> 
>  
> 
> I'm unable to find the reason for this error. Is it a compiler error, or
> is something wrong with my declaration?
> 
>  
> 
> Regards,
> 
> Johannes

You're missing the template keyword in front of nth_index:

typedef typename container_t::template nth_index<0>::type sequence_index_t;

VC is just being standard compliant here.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic