Peter Barker escribió:
Both of the your solutions work in VC++ 2003 (7.1). I can understand your code above - you're going through the index to get at erase(). The previous example I'm having a bit of trouble understanding though!:
template
typename Container::size_type container_erase(Container& c,const Key& k) { return c.erase(k); } int main() { RecordsContainer::size_type (*erase)(RecordsContainer&,const unsigned int&) = &container_erase; }
I've never seen a function template instantiated like this before. It appears to be deducing the template parameters based on the type it's assigning to. It looks very new to me and would like to understand a bit more.
The technique works exactly as you have described: if f