Using a function’s argument to produce the type of another function’s argument
In program as follows function template f
having two arguments declares the type of the second argument by using decltype
with lambda expression inside referring to the first function’s argument p
(here for illustration purposes it just removes the reference from the type):