i am using a boost::array which has the format < char, const std::size_t >
void test(const std::size_t XXX)
{
boost::shared_ptr<boost::array<unsigned char, XXX>> buf(new boost::array<unsigned char, max_size>);
.
.
.
};
test(100);
test(20);
This is leading
to the Error:
error C2971: 'boost::array' : template parameter 'N' : 'size' : a local variable cannot be used as a non-type argument
Can you give me a hint how to pass boost::array the second parameter?
thanks
boost::shared_array<unsigned char>instead? - ildjarnvector<unsigned char>- by the looks of the code, I'd guess thatbufis not intended to outlive the call totest, so shared ownership isn't needed. The only way it would be is ifteststores it to some long-lived object (like a global, orthisiftestis a member function). - Steve Jessop