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