void time_test(const S1& s1, const S2& s2, S3& s3, Op op, size_t n, size_t m) {
  typedef typename S1::iterator I;
  timer t;
  t.start();
  for (int i = 0; i < m; ++i)
    std::transform(s1.begin(), s1.end(), s2.begin(), s3.begin(), op);
  double time = t.stop()/(double(n) * m);
  std::cout << std::setw(6) << std::fixed << std::setprecision(2) << time << "\t";
}
Пример #2
0
static inline void set_difference(const S1 &src1, const S2 &src2, D &dst) {
	std::set_difference(
		src1.begin(), src1.end(), src2.begin(), src2.end(),
		std::inserter(dst, dst.begin()));
}