Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-10-19 08:17:42


As previously described in my former posting
(http://lists.boost.org/boost-users/2006/10/22961.php) I am trying to instantiate a mpl::map with
150 types.

Defining macros as stated in the documentation did not help. After taking a look in to the
boost/mpl/map.hpp include file I assume that previously described error resides because compiler
tries to include some pre-generated files:

----------------map.hpp excerpt-----------------

#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/map.hpp>
# include <boost/mpl/aux_/na.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>

# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>

#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_MAP_HEADER \
    BOOST_PP_CAT(map, BOOST_MPL_LIMIT_MAP_SIZE).hpp \
    /**/
#else
# define AUX778076_MAP_HEADER \
    BOOST_PP_CAT(map, BOOST_MPL_LIMIT_MAP_SIZE)##.hpp \
    /**/
#endif

# include BOOST_PP_STRINGIZE(boost/mpl/map/AUX778076_MAP_HEADER)
# undef AUX778076_MAP_HEADER
#endif

#include <boost/mpl/aux_/config/use_preprocessed.hpp>

#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
    && !defined(BOOST_MPL_PREPROCESSING_MODE)

# define BOOST_MPL_PREPROCESSED_HEADER map.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>

#else

# include <boost/mpl/limits/map.hpp>

# define AUX778076_SEQUENCE_NAME map
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_MAP_SIZE
# include <boost/mpl/aux_/sequence_wrapper.hpp>

#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_MAP_HPP_INCLUDED

-------------end of map.hpp excerpt-------------

As described in the documentation this file can not generate anything in a preprocessor mode until
the macro BOOST_MPL_PREPROCESSING_MODE was defined. After the definition of this macro I got new
errors. This errors were referring to some unknown types but the fact of preprossor execution was
obvious at this time.

The new errors are:

c:\boost\include\boost-1_33_1\boost\mpl\aux_\sequence_wrapper.hpp(246) : error C2065: 'na' :
undeclared identifier

c:\boost\include\boost-1_33_1\boost\mpl\aux_\sequence_wrapper.hpp(254) : error C2913: explicit
specialization; 'boost::mpl::map' is not a specialization of a class template

c:\boost\include\boost-1_33_1\boost\mpl\aux_\sequence_wrapper.hpp(254) : error C2976:
'boost::mpl::map' : too few template arguments
        c:\boost\include\boost-1_33_1\boost\mpl\aux_\sequence_wrapper.hpp(254) : see declaration
of 'boost::mpl::map'

To be honest I do not know what would be the right solution, but the documentation insisted way
does not work.

Attached is my cpp file containing the defintions. I try to compile it using Visual C++ 2005
Express Edition. Should I run some generator scripts to create map60.hpp ... map150.hpp? Or is
there any other solution?

Would really appreciate any help!

With Kind Regards,

Ovanes Markarian



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net