build a vector applying a transformation to each element of an input vector

helper template function to build a vector by applying a transformation function to each elements of an input vector
 - return type deduction by Matti
 - reference and cv-qualified return types should be properly handled