fork(2) download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <algorithm>
  4.  
  5. namespace std
  6. {
  7. struct magic { int a, b; } m = {44, 11};
  8. inline magic & operator ++ (magic &m) { return ++m.a, ++m.b, m; }
  9. inline double operator * (const magic &m) { return (double)m.a / m.b; }
  10.  
  11. template <> struct iterator_traits<magic> : iterator_traits<istream_iterator<double> > {};
  12.  
  13. int z = (copy_n(m, 100, ostream_iterator<double>(std::cout, "\n")), 0);
  14. }
  15.  
  16. int main() {}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:13:66: error: 'copy_n' was not declared in this scope
 int z = (copy_n(m, 100, ostream_iterator<double>(std::cout, "\n")), 0);
                                                                  ^
stdout
Standard output is empty