|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-10-02 12:57:23
Jeremy Siek <jeremy.siek_at_[hidden]> writes:
> It's early in the morning, but I'll do my best...
>
> In this outer scope, the type 'r' models Sequence<int>, so
> the call to f type checks.
>
> Inside of function f, 'S1' models Sequence<int> and 'r' models
> Sequence<int*>.
Cool, that's the key thing.
Now, it's great that you can get there by using two scopes. You could
imagine wanting to do the same thing from within a single function,
but I don't think that's so easy.
> The call to transform will not type check because the requirement
> Sequence<int*> S1 is not satisfied.
Because I got the requirements on transform backwards. Shoulda been:
template <class T, Sequence<T> S2, Sequence<T*> S1,
UnaryFunction<T,T*> F>
void transform(S1 const& src, S2& dst, F f)
I fear we're OT for Boost, now, though. Maybe we should take this private.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk