Q: storing boost::recursive_variant_ type in boost::unordered_map fails I'm facing an issue when trying to store a boost::recursive_variant_type object in a boost::unordered_map.
Let's suppose following code and assume all necessary header files are included:
header.h
// [...]
namespace example_namespace 
{

using my_custom_class_t = boost::make_recursive_variant<
        bool,
        double,
        std::string,
        std::vector<boost::recursive_variant_>,
        boost::unordered_map<std::string, boost::recursive_variant_>
    >::type;

using my_custom_map = boost::unordered_map<std::string, my_custom_class_t>;

std::vector<my_custom_map> stack_;

}

source.cpp
// [...]
namespace example_namespace 
{

std::pair<std::string, my_custom_class_t> my_pair { "hi", my_custom_class_t(true) };

std::string s = my_pair.first;
my_custom_class_t t = my_pair.second;

// here comes the bad part
my_custom_map my_map;
my_map.emplace(s, t); // <- this is where compilation aborts

stack_.emplace_back(my_map);

}

The code compiles just fine as long as I'm not using the boost::unordered_map<std::string, my_custom_class_t> class (everything above the "here comes the bad part" line), but once I want to store my recursive variant type in a map (e.g. my_map) the compiler throws the following errors:
1>c:\...\include\xhash(31): error C2440: 'type cast': cannot convert from 'const _Kty' to 'size_t'
1>        with
1>        [
1>            _Kty=std::string
1>        ]
1>c:\...\include\xhash(31): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>d:\...\boost\container_hash\extensions.hpp(358): note: see reference to function template instantiation 'size_t stdext::hash_value<T>(const _Kty &)' being compiled
1>        with
1>        [
1>            T=std::string,
1>            _Kty=std::string
1>        ]
1>d:\...\boost\container_hash\extensions.hpp(357): note: while compiling class template member function 'size_t boost::hash<K>::operator ()(const T &) const'
1>        with
1>        [
1>            K=std::string,
1>            T=std::string
1>        ]
1>d:\...\boost\unordered\detail\implementation.hpp(2623): note: see reference to function template instantiation 'size_t boost::hash<K>::operator ()(const T &) const' being compiled
1>        with
1>        [
1>            K=std::string,
1>            T=std::string
1>        ]
1>d:\...\boost\type_traits\is_nothrow_move_assignable.hpp(29): note: see reference to class template instantiation 'boost::hash<K>' being compiled
1>        with
1>        [
1>            K=std::string
1>        ]
1>d:\...\boost\unordered\detail\implementation.hpp(2739): note: see reference to class template instantiation 'boost::is_nothrow_move_assignable<H>' being compiled
1>        with
1>        [
1>            H=boost::hash<std::string>
1>        ]
1>d:\...\boost\unordered\detail\implementation.hpp(2902): note: see reference to class template instantiation 'boost::unordered::detail::functions<boost::hash<K>,std::equal_to<K>>' being compiled
1>        with
1>        [
1>            K=std::string
1>        ]
1>d:\...\boost\unordered\unordered_map.hpp(60): note: see reference to class template instantiation 'boost::unordered::detail::table<boost::unordered::detail::map<A,K,T,H,P>>' being compiled
1>        with
1>        [
1>            A=std::allocator<std::pair<const std::string,example_namespace::my_custom_class_t>>,
1>            K=std::string,
1>            T=example_namespace::my_custom_class_t,
1>            H=boost::hash<std::string>,
1>            P=std::equal_to<std::string>
1>        ]
1>d:\...\my_model.cpp(47): note: see reference to class template instantiation 'boost::unordered::unordered_map<std::string,example_namespace::my_custom_class_t,boost::hash<K>,std::equal_to<K>,std::allocator<std::pair<const K,T>>>' being compiled
1>        with
1>        [
1>            K=std::string,
1>            T=example_namespace::my_custom_class_t
1>        ]

Is it possible that for some reason recursive variants (e.g. in terms of memory allocation) cannot be stored in boost::unordered_maps?
