How to define a multiset using a function pointer?
问题 I'm stuck when doing an exercise from C++ Primer 5th Edition ,which goes like Exercise 11.11: Redefine bookstore without using decltype. Below is the relevant codes in this book: multiset<Sales_data, decltype(compareIsbn)*> bookstore(compareIsbn); The code for class Sales_data is a little bit verbose to post here,so I wrote a simpler one and defined the multiset in the same style, as shown below. It compiled without any error. class A { int lenth; public: int getLenth() const {return lenth;}