How can I specialize an algorithm for iterators that point to complex values?
问题 I am trying to write an algorithm that works on iterators (similar to the STL algorithms) however I need to write a specialization of the algorithm to act differently when the iterators point to complex values vs regular double values. Here is a basic example: #include <complex> #include <iostream> #include <vector> using namespace std; template <typename InputIt> void DoSomething(InputIt first, InputIt last) { cout << "Regular Double" << endl; for (; first != last; ++first) { cout << *first