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 @makortel 
 - reference and cv-qualified return types should be properly handled