#ifndef BOOST_COMPUTE_FUNCTIONAL_FIELD_HPP
#define BOOST_COMPUTE_FUNCTIONAL_FIELD_HPP
#include <string>
namespace boost {
namespace compute {
namespace detail {
template<class T, class Arg>
struct invoked_field
{
typedef T result_type;
invoked_field(const Arg &arg, const std::string &field)
: m_arg(arg),
m_field(field)
{
}
Arg m_arg;
std::string m_field;
};
}
template<class T>
class field
{
public:
typedef T result_type;
field(const std::string &field)
: m_field(field)
{
}
template<class Arg>
detail::invoked_field<T, Arg> operator()(const Arg &arg) const
{
return detail::invoked_field<T, Arg>(arg, m_field);
}
private:
std::string m_field;
};
} }
#endif