flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.22k stars 647 forks source link

error: no member named 'random_shuffle' in namespace 'std' #465

Closed yurivict closed 4 years ago

yurivict commented 4 years ago

Missing #include <algotithm> in these headers:

/usr/local/include/flann/util/random.h:120:14: error: no member named 'random_shuffle' in namespace 'std'
        std::random_shuffle(vals_.begin(), vals_.end(), generator);
        ~~~~~^
In file included from /usr/ports/misc/dartsim/work/dart-6.9.3/dart/planning/RRT.cpp:49:
In file included from /usr/local/include/flann/flann.hpp:45:
In file included from /usr/local/include/flann/algorithms/all_indices.h:36:
/usr/local/include/flann/algorithms/kdtree_index.h:268:18: error: no member named 'random_shuffle' in namespace 'std'
            std::random_shuffle(ind.begin(), ind.end());
            ~~~~~^
In file included from /usr/ports/misc/dartsim/work/dart-6.9.3/dart/planning/RRT.cpp:49:
In file included from /usr/local/include/flann/flann.hpp:45:
In file included from /usr/local/include/flann/algorithms/all_indices.h:42:
In file included from /usr/local/include/flann/algorithms/lsh_index.h:49:
/usr/local/include/flann/util/lsh_table.h:366:10: error: no member named 'random_shuffle' in namespace 'std'
    std::random_shuffle(indices.begin(), indices.end());
    ~~~~~^
yurivict commented 4 years ago

This is fixed in the latest revision.