I want to have a std::unordered_map<std::string,MyClass*()>
variable. But - when I try instantiating that, I get an error message, deep inside, which is essentially:
/usr/include/c++/4.9/bits/stl_pair.h(102): error: a function type is not allowed here
detected during:
instantiation of class "std::pair<_T1, _T2> [with _T1=const std::string, _T2=MyClass *()]"
I'm pretty sure this isn't due to a bug of mine. I've browsed around the site and noticed a link to LWG issue 2051
making std::pair
too restrictive. Is that really what I'm seeing? If so, what should I do to work around it? Use a wrapper class no data and operator()
maybe? std::function
?