
29 Sep
2006
29 Sep
'06
3:58 p.m.
Joel de Guzman <joel@boost-consulting.com> writes:
Here's another problem:
std::map<int*, int*> m;
generic code that treats pair<int* int*> as an iterator_range will treat m's data type incorrectly.
No, generic code doesn't look at types and say, "which of two concepts with no refinement relationship does this type fulfill?" and then take different actions based on the answer. The only such type-based dispatching in generic code comes through algorithm specialization: "this type fulfills concept X, but also concept Y which is a refinement of X, so I'll use that information to do whatever I was going to do more efficiently." -- Dave Abrahams Boost Consulting www.boost-consulting.com