The definition can be written as multiset<Sales_data, bool (*)(const Sales_data &, const Sales_data &>::iterator it = bookstore.begin(); Note that iterators for sets are always const.