Problem with Berkeley DB and C++
问题 I'm trying to write a simple C++ program that uses Berkeley DB for storage. The key of the database is of type time_t and the data is an integer . I need to take the difference between two adjacent data in a between two key. I open a cursor with the flag DB_SET_RANGE and then i use DB_NEXT to iterate. My problem is that the cursor returns unsorted data. Is there a way to specify a custom sorter function for the cursor? 回答1: Some of the reasons why you may want to provide a custom sorting