Boost logo

Boost :

Subject: [boost] [multi-array] compiler errors with visual studio 2012
From: nfarnsworth_at_[hidden]
Date: 2013-03-23 09:12:24

   have this c++ example which compiles with Visual Studio 2010 but with Visual
   Studio 2012 I got this compiler errors:
   1>------ Build started: Project: MultiArrayDemo, Configuration: Debug Win32
   1> MultiArrayDemo.cpp
   C2059: syntax error : '<'
   1> d:\sandbox\multiarraydemo\multiarraydemo\multiarraydemo.cpp(25)
   : see reference to class template instantiation 'Data<T>' being compiled
   C2238: unexpected token(s) preceding ';'
   ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
   The example uses the boost 1.53 version. Here is the example code:
   #include "stdafx.h"
   #include <boost/multi_array.hpp>
   const int rows = 3;
   const int cols = 5;
   template<class T> struct Data
    typedef boost::multi_array<T,2> data_type;
    typedef typename data_type::array_view<1>::type view_type; //here is the
   first error
    typedef typename data_type::index_range range;
      double tmp[] =
      A.assign(tmp,tmp+ (rows * cols));
    data_type A;
   int _tmain(int argc, _TCHAR* argv[])

    Data<double>* data = new Data<double>();
    Data<double>::view_type myView =
    delete data;
     return 0;
   Does anybody know how to solve this problem?
   Best regards and thank you in advance

Boost list run by bdawes at, gregod at, cpdaniel at, john at