#ifndef _NTPM_AI_CAST_H
#define _NTPM_AI_CAST_H

#include <arithmetic_iterators/ai_unary.h>

namespace NTPMai {

template <class T_from, class T_to>
struct cast_function : public unary_function<T_from, T_to>
{
    T_to operator()(const T_from &x) { return static_cast<T_to>(x); }
};


template <class T_PROMISE, class T_ELT>
inline typename UNOP_Deffer<T_PROMISE,
                     NTPMai::cast_function<typename T_PROMISE::value_type,
                                           T_ELT> >::V
cast(T_ELT, const T_PROMISE &p)
{
    return make_unary_op_promise(p,
				 NTPMai::cast_function<typename
				 T_PROMISE::value_type, T_ELT>());
}

}

#endif // _NTPM_AI_CONST_H
