OvenをGCC 4.5で使用するためのパッチ

Oven + GCC 4.5がコンパイル通らなくて長いこと悩んでいましたが、
昨日、 @okomok さんから連絡いただいて一発で解決しました。

http://twitter.com/okomok/status/21908794344


作者の力は偉大です・・・。
この修正は最初に試していたのですが、あの頃はBoost 1.42.0のMPLバグで動かなかったのでそれ以降試してませんでした。


以下に、この修正のパッチを置いておきます。
pstade/egg/detail/as_mpl_lambda.hpp
に適用してください。


as_mpl_lambda.patch


pstade/egg/detail/as_mpl_lambda.hpp

#ifndef PSTADE_EGG_DETAIL_AS_MPL_LAMBDA_HPP
#define PSTADE_EGG_DETAIL_AS_MPL_LAMBDA_HPP
#include "./prefix.hpp"


// PStade.Egg
//
// Copyright Shunsuke Sogame 2007.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)


// What:
//
// Works around a VC8 bug that 'mpl::apply<PlaceholderExpression,..>'
// occasionally fails in the instantiation process of 'boost::result_of'.
//
// These workarounds are known:
//   1. Don't use 'mpl::apply' when possible.
//   2. Hide PlaceholderExpression by using inheritance like <boost/numeric/functional.hpp>.
//      -- this way may require nullary result_of specialization to be reworked, though.
//   3. Call 'mpl::lambda' in non-deduced context like the following macro. 
//
// If a PlaceholderExpression doesn't have a dependent nested 'type',
// in other words, if it is not a Metafunction with placeholder, 'mpl::apply' seems *not* to fail.


#include <pstade/boost_workaround.hpp>
#include <pstade/unparenthesize.hpp>
#include <boost/mpl/aux_/config/gcc.hpp>


#if BOOST_WORKAROUND(BOOST_MSVC, == 1400) || BOOST_WORKAROUND(BOOST_MSVC, == 1500) || \
    BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, >= 0x0405)

    #include <boost/mpl/lambda.hpp>

    #define PSTADE_EGG_AS_MPL_LAMBDA(PlaceholderExpr) \
        boost::mpl::lambda< PSTADE_UNPARENTHESIZE(PlaceholderExpr) >::type \
    /**/

#else

    #define PSTADE_EGG_AS_MPL_LAMBDA \
        PSTADE_UNPARENTHESIZE \
    /**/

#endif


#endif