Intel® C++ Compiler Classic Developer Guide and Reference
A newer version of this document is available. Customers should click here to go to the newest version.
Visible to Intel only — GUID: GUID-30C1BA30-DE83-4C1C-8A23-711CBBE21E36
Visible to Intel only — GUID: GUID-30C1BA30-DE83-4C1C-8A23-711CBBE21E36
make_ n_container template function
Factory function to construct an instance of a properly-typed n_container<…> based on n_extent_t passed to it.
Syntax
template< typename PrimitiveT, typename LayoutT, typename AllocatorT = allocator::default_alloc, typename ExtentsT > auto make_n_container(const ExtentsT &_extents) ->n_container<PrimitiveT, LayoutT, ExtentsT, AllocatorT>
Description
Use make_n_container to more easily create an n-dimensional container using template argument deduction, and avoid specifying the type of extents.
An example of the instantiation of a High Definition image object is below.
typedef n_container<RGBAs, layout::soa, n_extent_t<int, int>> HdImage; HdImage image1(n_extent[1080][1920]);
Alternatively, it is possible to use factory function with the C++11 keyword auto, as shown below.
auto image1 = make_n_container<RGBAs, layout::soa>(n_extent[1080][1920]);