Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > b9ba69a436161613d8fb030c8c726a8e > files > 378

spirit-1.5.1-2mdk.noarch.rpm

#include <vector>
#include <algorithm>
#include <iostream>
#include "boost/phoenix/operators.hpp"
#include "boost/phoenix/primitives.hpp"

using namespace std;
using namespace phoenix;

//////////////////////////////////
template <int N>
struct static_int {

    template <typename TupleT>
    struct result { typedef int type; };

    template <typename TupleT>
    int eval(TupleT const&) const { return N; }
};

//////////////////////////////////
template <int N>
phoenix::actor<static_int<N> >
int_const()
{
    return static_int<N>();
}

//////////////////////////////////
int
main()
{
    cout << (int_const<5>() + int_const<6>())() << endl;
    return 0;
}