Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-01-17 08:30:37


On 01/16/2005 03:11 PM, Larry Evans wrote:
[snip]
> > Second of all, by itself, of course the **result of invoking
> > inherit_linearly** shown on that page is less capable than tuple,
> > because there's no convenient access function like get<> provided.
>
> Yes, but since the difficulty of element access is mentioned, and no
> easy solution provided, and since the book is about solution's
> provided by mpl, and since other book sections pose problems and then
> provide solutions, it's only natural for the reader to assume a
> solution is either impossible or very difficult; yet,
> get_ith_head_test.cpp demonstrates that it's neither. The only change
> involves using inherit_head_tail instead of inherit and defining
> get_ith_tail, which, as you say, is not particularly original; hence,
> the method used by get_ith_tail should be at least mentioned as a
> solution to the problem.

I apologize for that last sentence. It sounds imperative. I just should
have said, "the reader would have expected a solution such as...".

I should also admit that maybe my impressions were influenced by what
I had been doing at the time, which involved the indexed_type's library.
It provides a similar get element member function but uses a more
direct method because the supertypes are all the same except for
the index. I couldn't figure out a different method and when I read
p. 191 I just got the impression that it wasn't possible, which
obviously is not what the page says.

I apologize for my tone and thanks to Aleksey and you for a great
book.

Regards,
Larry


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk