[unordered] 1.41.0 unordered_map doesn't allow declaration with incomplete type.

The new version of the unordered library doesn't allow you to declare an unordered map with an incomplete type. The following code would compile with the old version but not the new: struct a; struct b { boost::unordered_map<int, a> c; }; Or the more useful: struct d { boost::unordered_map<int, d> e; }; As far as I know these constructs are allowed with the other standard containers. The problem show up in "boost/unordered/detail/fwd.hpp" with the the declaration of value_base, which requires that the value_type of the map not be incomplete at declaration time. Jon.

2009/11/19 Jon Spencer <dev@jackson-spencer.ca>:
The new version of the unordered library doesn't allow you to declare an unordered map with an incomplete type. The following code would compile with the old version but not the new:
Sorry, about the slow reply. Support in the old version wasn't intentional, I think it was just a result of the restricted templates use in order to support older compilers. I think it's fixed in trunk now, although I need to do more testing to make sure. It should be fixed in the next release. Daniel
participants (2)
-
Daniel James
-
Jon Spencer