blob: e124408cfae0a890ccd865a48a7ec3da265d6372 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
/// \file null_eval.hpp
/// Contains specializations of the null_eval\<\> class template.
//
// Copyright 2008 Eric Niebler. 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)
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 1>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 2>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 3>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 4>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 5>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 6>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 7>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 8>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 9>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); proto::eval(proto::child_c< 8>(expr), ctx);
}
};
template<typename Expr, typename Context>
struct null_eval<Expr, Context, 10>
{
typedef void result_type;
void operator ()(Expr &expr, Context &ctx) const
{
proto::eval(proto::child_c< 0>(expr), ctx); proto::eval(proto::child_c< 1>(expr), ctx); proto::eval(proto::child_c< 2>(expr), ctx); proto::eval(proto::child_c< 3>(expr), ctx); proto::eval(proto::child_c< 4>(expr), ctx); proto::eval(proto::child_c< 5>(expr), ctx); proto::eval(proto::child_c< 6>(expr), ctx); proto::eval(proto::child_c< 7>(expr), ctx); proto::eval(proto::child_c< 8>(expr), ctx); proto::eval(proto::child_c< 9>(expr), ctx);
}
};