
AMDG alfC wrote:
result is a template, so you just need to specialize it or use some kind of metaprogramming (for instance Boost.Typeof).
Do you mean that I should do something like (not tested):: template<class R> struct norm_impl{ template <typename Arg> struct result{ typedef R type; }; template <typename Arg> typename result<Arg>::type operator()(Arg ar1) const{ return std::norm(ar1); } }; template<class R> struct norm{ static(???) phoenix::function
func; }; and use norm<double>::func (instead of norm_); How Boost.TypeOf fits in this or other approach?
No. I meant something like this:
struct norm_impl {
template<typename Arg>
struct result {
typedef Arg type;
};
template<typename T>
struct result
2) I may be asking for too much sugar but is there a way to name the function "std::norm" and not have conflicts with the standard "std::norm<T>(std::complex<T> const& c)", the best I could do was to call it std::norm_;
You're not allowed to put it in namespace std at all.
Obviously there is a mapping between standard functions and lazy functions (in Phoenix for example), Is there a way to express this mapping in their names?
Just put them in your own namespace. The ones defined by phoenix are in namespace boost::phoenix for instance. In Christ, Steven Watanabe