@op: please expand because i dont quite understand what you are asking. also as to the third post, you kind of can. std::function is what you are looking for i believe.
@kes: or rather than bothering op with questions, we can answer them. why would we ask that? it could be just for learning purposes
you actually are being forced to think, because you first have to think of the question... and there doesnt always have to be a problem or a reason to use it. for example i havent yet come across a reason to use #pragma anywhere in my code,but iwant to use it and cant think of a situation, but that doesnt mean there isnt. and even if i could think of one what would that achieve? it wouldnt advance my code. and actually you can return a type of array and/or function. you use std::function or std::array. do some research first.
std::function is a copyable object. It is not a function.
std::array is a copyable object. It is not an array.
What an object contains is secondary here.
Semantics, but compilers are rather pedantic about it.
of course std::function isnt a function. its a better version of c's function pointers. if you return it you are essentially returning a function. std::array is an array... i dont see where you got that from. its not the built in array but it is in fact an array