liuis / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

The documentation's example for Comparator is buggy #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey!

I tried following the documentation for creating comparators and the line:

virtual const char* Name() { return "TwoPartComparator"; }

is wrong. It has to be:

virtual const char* Name() const { return "TwoPartComparator"; } 

instead (with a _const_ after Name()).

Thinking the documentation is perfect, I spent a long time trying to figure out 
what was wrong and figured at the end that the code was wrong to begin with. 
It's minor but I guess it would help fixing it.

Many thanks for open sourcing leveldb!
Amir

Original issue reported on code.google.com by amirhki...@gmail.com on 10 Aug 2011 at 7:37

GoogleCodeExporter commented 9 years ago
Thanks Amir!

Original comment by ga...@google.com on 10 Aug 2011 at 9:10

GoogleCodeExporter commented 9 years ago
This is fixed in r42. Please verify.

Original comment by ga...@google.com on 16 Aug 2011 at 1:46

GoogleCodeExporter commented 9 years ago
LGTM

Original comment by amirhki...@gmail.com on 16 Aug 2011 at 1:50