Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-11-11 16:20:34

On Monday 11 November 2002 11:45 am, Alexander Nasonov wrote:
> This functionality can be usefull but not quite often. I think it's better
> to keep 'call' member function for simple use and introduce different name
> (call_ex?) for advanced use. So, you can use one of:
> // 1)
> template<typename Arg>
> bool call(const Arg & a, const Arg & b) const;
> // 2
> template<typename Arg>
> bool call_ex(const Arg & a, const std::type_info & ta,
> const Arg & b, const std::type_info & tb) const;
> Implementation can first try to call 'call_ex' and if it throws internal
> exception (default behavoir) then revert to 'call' member-function.

I'm assuming you aren't referring to an actual C++ exception. I would assume
that the default behavior of call_ex would be to call the call function in
the derived class (assuming you are still planning to use the curiously
recurring template pattern).

> Current algorithm takes first argument a1 (which holds value v1 of type T1)
> and tries to extract T1 & from a2 ... aN. If all extractions are ok then
> invoke the foo:

This seems like the best approach to me.


Boost list run by bdawes at, gregod at, cpdaniel at, john at