I'm primarily an R programmer, and I'm using Rcpp to run a hash map implementation by Malte Skarupke called ska::flat_hash_map on Windows 10 through RStudio (Microsoft OpenR). The C++ compiler is g++ run with c11 flags.
With no changes to his .hpp file, I am unable to get it running, as it produces the error
Line 276 no type named 'hash_policy' in 'struct std::hash<char>'
The offending line in flat_hash_map.hpp is
template<typename T>
struct HashPolicySelector<T, void_t<typename T::hash_policy>>
{
typedef typename T::hash_policy type;
};
I've found a few benchmark libraries on github that seem to include the library with no problems, and access it like std::unordered_map, so I don't understand why I am having problems getting it to run.
I've also tried providing different types instead of char, sticking to the ones that std::hash should be able to handle automatically, such as int, and std::string.
My source file is really simple, as I'm literally just trying to get a hash map created, for example, my last run was using this:
#include <Rcpp.h>
#include "flat_hash_map.hpp"
using namespace Rcpp;
// [[Rcpp::plugins(cpp11)]]
// [[Rcpp::export]]
void run_test()
{
ska::flat_hash_map<char,char> test_map;
}
I'm hoping someone with more C++ experience than myself could shed some light on the problem, or try running the library themselves if the issue is reproducible.
Thanks for the help! This is also my first post on StackOverflow, please let me know if there is something I can do to improve my question.
Aucun commentaire:
Enregistrer un commentaire