2013/7/11 Anton Daneyko <self@mezhaka.com>
Dear boost users, could someone tell me why this short program does not compile?

#include <boost/array.hpp>
#include <boost/static_assert.hpp>

int main(int argc, const char *argv[])
{
  boost::array<int, 3> a1 = {{1, 1, 1}};
  BOOST_STATIC_ASSERT(a1.static_size == 3);
  return 0;
}

You must write BOOST_STATIC_ASSERT(boost::array<int, 3>::static_size == 3);
Here is a fixed version:

#include <boost/array.hpp>
#include <boost/static_assert.hpp>

int main(int argc, const char *argv[])
{
  typedef boost::array<int, 3> array_t;
  array_t a1 = {{1, 1, 1}};
  BOOST_STATIC_ASSERT(array_t::static_size == 3);
  return 0;
}


--
Best regards,
Antony Polukhin