#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <iterator>
using namespace std;

template<typename F1, typename F2>
class unary_composer
{
    F1 f1;
    F2 f2;

public:
    unary_composer(F1 lf1, F2 lf2) : f1(lf1), f2(lf2){}

    template <typename ARG>
    auto operator()(ARG x)->decltype(f1(f2(x))) { return f1(f2(x)); }
};

template <typename F1, typename F2>
unary_composer<F1, F2> compose(F1 fone, F2 ftwo)
{
   return unary_composer<F1, F2>(fone, ftwo);
}

int main()
{
   const int SZ = 6;
   vector<string> vs{"1.2", "3.4", "5.6", "6.7", "7.8", "8.9"};
   vector<double> vd;

   transform(vs.begin(), vs.end(), back_inserter(vd), compose(std::atof, mem_fn(&string::c_str)));

   copy(vd.begin(), vd.end(), ostream_iterator<double>(cout, " ")); // print to console
   cout<<endl;

}