Code:
void f(const vector<int>& a, vector<float>& b)
{
typedef decltype(a[0]*b[0]) Tmp;
for (int i=0; i < b.size(); ++i) {
auto p0 = new auto(a[i]*b[i]);
auto p1 = new decltype(a[i]*b[i]);
*p0=a[i]*b[i];
*p1=a[i]*b[i];
cout<<*p0<<endl;
Leave a comment: