Using gcc-4.1.1.  Info says variable-length array is supported in c++ mode,
but doesn't seem to work:

#include <boost/range.hpp>
#include <vector>

template<typename in_t>
void F (in_t const& in, int size, int x[size]) {}

void G (std::vector<int> const& in, int size, int x[size]) {}

int main () {
  std::vector<int> i (10);
  int x (10);
  F (i, boost::size (i), x);
  G (i, boost::size (i), x);
}
g++ -c Test.cc -I /usr/local/src/boost.cvs
Test.cc:5: error: ‘size’ was not declared in this scope
Test.cc:7: error: ‘size’ was not declared in this scope
Test.cc: In function ‘int main()’:
Test.cc:12: error: no matching function for call to ‘F(std::vector<int,
std::allocator<int> >&, size_t, int&)’
Test.cc:7: error: too many arguments to function ‘void G(const
std::vector<int, std::allocator<int> >&, int)’
Test.cc:13: error: at this point in file


Reply via email to