deduction guides for std::valarray - cppreference.com

From cppreference.com

template<typenameT,std::size_tcnt>valarray(constT(&)[cnt],std::size_t)->valarray<T>;(since C++17)This

deduction guide

is provided for

std::valarray

to allow deduction from array and size (note that deduction from pointer and size is covered by the implicit guides).

Example

Run this code

#include<iostream>#include<valarray>intmain(){inta[]={1,2,3,4};std::valarrayva(a,3);// uses explicit deduction guidefor(intx:va)std::cout<<x<<' ';std::cout<<'\n';}Output:

1 2 3