flann serialize unordered_map compilation error (#126): modified define name to avoid conflicts with the one defined in OpenCV

This commit is contained in:
matlabbe
2016-11-23 17:36:38 -05:00
parent 23bb5d5147
commit 2a43a95ddd

View File

@@ -40,7 +40,7 @@
#include <iomanip>
#include <limits.h>
// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP
#if USE_UNORDERED_MAP
#if RTFLANN_USE_UNORDERED_MAP
#include <unordered_map>
#else
#include <map>
@@ -127,7 +127,7 @@ class LshTable
public:
/** A container of all the feature indices. Optimized for space
*/
#if USE_UNORDERED_MAP
#if RTFLANN_USE_UNORDERED_MAP
typedef std::unordered_map<BucketKey, Bucket> BucketsSpace;
#else
typedef std::map<BucketKey, Bucket> BucketsSpace;
@@ -187,7 +187,7 @@ public:
*/
void add(const std::vector< std::pair<size_t, ElementType*> >& features)
{
#if USE_UNORDERED_MAP
#if RTFLANN_USE_UNORDERED_MAP
buckets_space_.rehash((buckets_space_.size() + features.size()) * 1.2);
#endif
// Add the features to the table