[unordered] error: template argument required for ‘struct set_extractor’

Hi, I'm experiencing strange problem with unordered_map.hpp file. I'm using Boost 1.44 with GCC 4.2.1 from XCode on Mac OS X. Compiling simple test: $ cat foo.cpp #include <boost/unordered_map.hpp> int main() {} $ g++ -o foo.o foo.cpp In file included from /usr/local/include/boost/unordered/detail/equivalent.hpp:11, from /usr/local/include/boost/unordered/unordered_map.hpp:19, from /usr/local/include/boost/unordered_map.hpp:16, from foo.cpp:1: /usr/local/include/boost/unordered/detail/extract_key.hpp:31: error: template argument required for ‘struct set_extractor’ /usr/local/include/boost/unordered/detail/extract_key.hpp:77: error: template argument required for ‘struct map_extractor’ I've looked at the preprocessed file and there is something that disturbs me - templates of set_extractor and map_extractor are getting "changed". Comparing preprocessed file against source from boost/unordered/detail/extract_key.hpp I see 1) set_extractor a) original code template <class ValueType> struct set_extractor { typedef ValueType value_type; typedef ValueType key_type; b) preprocessed output struct set_extractor { template <class ValueType> struct apply { typedef ValueType value_type; typedef ValueType key_type; 2) map_extractor a) original code template <class Key, class ValueType> struct map_extractor { typedef ValueType value_type; typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Key>::type key_type; b) preprocessed output struct map_extractor { template <class ValueType> struct apply { typedef ValueType value_type; typedef typename remove_const<typename ValueType::first_type>::type key_type; As you can see, the set_exctractor and map_exctractor templates have lost template parameters declarations and some extra nested struct has been generated: template <class ValueType> struct apply Folks on #boost at IRC suggested it may be caused by MPL magic. I haven't noticed any such problem with GCC 4.4 on Linux with Boost 1.43 There has been similar issue reported, but the problem was ALLOC macro defined by RICE library, what rather is not my case: http://lists.boost.org/boost-users/2010/05/59340.php Does anyone have an idea what's happening? Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.org

On 6 October 2010 16:00, Mateusz Loskot <mateusz@loskot.net> wrote:
1) set_extractor
a) original code
template <class ValueType> struct set_extractor { typedef ValueType value_type; typedef ValueType key_type;
b) preprocessed output
struct set_extractor { template <class ValueType> struct apply { typedef ValueType value_type; typedef ValueType key_type;
It looks like you've got Boost 1.41 installed at /usr/local/, and are somehow mixing up headers from different versions of boost: http://svn.boost.org/svn/boost/tags/release/Boost_1_41_0/boost/unordered/det... http://svn.boost.org/svn/boost/tags/release/Boost_1_44_0/boost/unordered/det... Daniel

On 06/10/10 16:10, Daniel James wrote:
On 6 October 2010 16:00, Mateusz Loskot <mateusz@loskot.net> wrote:
1) set_extractor
a) original code
template <class ValueType> struct set_extractor { typedef ValueType value_type; typedef ValueType key_type;
b) preprocessed output
struct set_extractor { template <class ValueType> struct apply { typedef ValueType value_type; typedef ValueType key_type;
It looks like you've got Boost 1.41 installed at /usr/local/, and are somehow mixing up headers from different versions of boost:
http://svn.boost.org/svn/boost/tags/release/Boost_1_41_0/boost/unordered/det... http://svn.boost.org/svn/boost/tags/release/Boost_1_44_0/boost/unordered/det...
Thanks for pointing me to this difference. It looks it may be a mess in the environment we use indeed. I haven't confirmed yet, but I will once I get connected with that machine again. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.org

On 08/10/10 00:42, Mateusz Loskot wrote:
On 06/10/10 16:10, Daniel James wrote:
On 6 October 2010 16:00, Mateusz Loskot <mateusz@loskot.net> wrote:
1) set_extractor
a) original code
template <class ValueType> struct set_extractor { typedef ValueType value_type; typedef ValueType key_type;
b) preprocessed output
struct set_extractor { template <class ValueType> struct apply { typedef ValueType value_type; typedef ValueType key_type;
It looks like you've got Boost 1.41 installed at /usr/local/, and are somehow mixing up headers from different versions of boost:
http://svn.boost.org/svn/boost/tags/release/Boost_1_41_0/boost/unordered/det... http://svn.boost.org/svn/boost/tags/release/Boost_1_44_0/boost/unordered/det...
Thanks for pointing me to this difference. It looks it may be a mess in the environment we use indeed.
I haven't confirmed yet, but I will once I get connected with that machine again.
Daniel, Indeed, the files/versions mismatch was the root of the problem. Thank you once again. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.org
participants (2)
-
Daniel James
-
Mateusz Loskot