The size of std::array is known at compile time, but the size
member function isn\'t static. Is there any reason for that? It\'s slightly inconvenient not to be
Note that the Microsoft Visual C++ doesn't currently support constexpr (http://msdn.microsoft.com/en-us/library/hh567368.aspx), so the following valid code won't work:
array dog;
array cat;
The following class provides a compile time static variable:
/**
* hack around MSVC's 2012 lack of size for const expr
*/
template
struct vcarray : public std::array {
static const size_t ArraySize= N;
};
which can be used as:
vcarray cat;
vcarray dog;