[ create a new paste ] login | about

Link: http://codepad.org/SyLoUb14    [ raw code | output | fork ]

C++, pasted on Apr 27:
#include <iostream>
#include <deque>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
  deque<double> radians, sines;
  double n;
  unsigned int i;

  radians.push_back(0.1);
  radians.push_back(0.2);
  radians.push_back(0.3);
  radians.push_back(0.4);
  radians.push_back(0.5);

  sines.resize(radians.size());
  transform(radians.begin(), radians.end(), sines.begin(), sin);
  for (i = 0; i < sines.size(); i++)
    cout << radians[i] << ":" << sines[i] << endl;
  return 0;
}
/* end */


Output:
1
2
3
In function 'int main()':
Line 19: error: no matching function for call to 'transform(__gnu_debug::_Safe_iterator<__gnu_norm::_Deque_iterator<double, double&, double*>, __gnu_debug_def::deque<double, std::allocator<double> > >, __gnu_debug::_Safe_iterator<__gnu_norm::_Deque_iterator<double, double&, double*>, __gnu_debug_def::deque<double, std::allocator<double> > >, __gnu_debug::_Safe_iterator<__gnu_norm::_Deque_iterator<double, double&, double*>, __gnu_debug_def::deque<double, std::allocator<double> > >, <unresolved overloaded function type>)'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: