C++ boost::array usage

  • 2020-04-02 02:56:31
  • OfStack

This article illustrates the use of boost::array in C++. The details are as follows:

#include <string>  
#include <iostream> 
#include <boost/array.hpp> 
#include <algorithm> 
using namespace std; 
int main() 

    boost::array<int, 5> array_temp = {{12, 8, 45, 23, 9}}; 
    sort(array_temp.begin(), array_temp.end()); 
         
    copy(array_temp.begin(), array_temp.end(), ostream_iterator<int>(cout, " ")); 
         
    return 0; 
}

Hope that the article described in the C++ programming to help you.


Related articles: