Boost logo

Boost Users :

From: Joel de Guzman (joel_at_[hidden])
Date: 2008-07-22 04:04:45


Zeljko Vrba wrote:

> And now, the last sentence brings us back to square one: me trying to
> understand what MPL and fusion are / could be good for and with you jumping
> right into the middle of my discussion with Istvan, and you becoming (seemingly
> at least) frustrated with trying to help me when I never even explicitly asked
> for help -- it was a question about real-world usage!

Sorry for jumping in the middle of your discussion with Istvan.
Pardon me if I seemed frustrated.

> Anyway, Dave has already recommended Stepanov's slides. Can you please (yes,
> *now* I'm asking for help :-)) recommend something else that explains generic
> programming in C++ [*] and which is not so verbose that it uses several pages
> and examples to explain why does an adaptable unary function need the
> "result_type" typedef. (This was just an example, and *not* a reference to
> Stepanov's slides.. just to give you an idea about what kind of text I'm
> after.) There's a bunch of papers at Stepanov's site, but what to read and
> in which order to read it?
>
> [*] My basic mistake is, I guess, drawing parallels with ML. Generic
> programming in C++ is (obviously?) sufficiently different / harder that
> analogies do not work well.

IMO, there's nothing hard in GP. It's just a different way of doing
things. C++ is multiparadigm. You can do FP, OOP, GP all at the same
time.

The Stepanov site is a goldmine of information about the subject.
Just be patient. There's a good reason why the examples need to explain
"result_type". I reckon you can skip the part if you are already
familiar with it. Alas, I don't know which to recommend reading first.
The papers are listed by date, more or less giving you a historical
perspective.

I'd also recommend Doug Gregor's "An Introduction to Generic Programming"

     http://www.generic-programming.org/about/intro/

and his talk on Concept C++:

     http://video.google.com/videoplay?docid=-1790714981047186825

If you like patterns as I do, I find this one enjoyable:

     http://www.coldewey.com/europlop2000/papers/geraud+duret.zip

and of course:

     http://www.boost.org/community/generic_programming.html

well, those are just a few. HTH, FWIW.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net