I work on a large computational project that heavily use boost::mpl
and boost:fusion
on C++11.
Sometimes, in order to get some translation units to compile, I have to define the following BOOST macros:
FUSION_MAX_VECTOR_SIZE=40
FUSION_MAX_MAP_SIZE=40
BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
BOOST_FUSION_INVOKE_MAX_ARITY=40
BOOST_RESULT_OF_NUM_ARGS=40
BOOST_MPL_LIMIT_VECTOR_SIZE=40
BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS=1
And yes, these definitions add significantly to the compile time. That's why I consider setting those variables on per-translation-unit basis.
Now the question arises, will translation units built with different settings of those variables be linkable with each other?
Someone in my organization suggests that, it would lead to the undefined behavior. My intuition tells me otherwise - after all, boost::mpl
and boost::fusion
are header-only, so anything that links, should be just a mangled plain C function, and if there are any incompatibilities, those will be necessary caught during the linking phase. But I may be wrong.