Subject: Re: [boost] An alternative approach to TypeErasure
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-06-24 11:13:28
on Sun Jun 24 2012, Pyry Jahkola <pyry.jahkola-AT-iki.fi> wrote:
> Comments are welcome!
After a quick skim:
Very cool! Reminds me a bit of something I did, entirely in the static
http://article.gmane.org/gmane.comp.lib.boost.devel/120408... But I
guess your work is fundamentally different from what I was doing.
One thing I didn't see you mention there is that since your generic
functions are first-class objects, they can be passed and returned,
thereby supporting higher-order functional programming.
> * * *
> I am aware that Steven Watanabe has put some astonishing work on his
> proposed Boost.TypeErasure. I'm open for discussion whether and how
> his or mine is a better approach, or if we could combine these into an
> eventual Boost.Interface library or such!
Very interesting. Does either approach support operator overloading?
> PS. Like I mention in my GitHub page, this kind of type erasure is
> common in functional languages like Haskell or Clojure. The problem
> they are solving there is known as the Expression Problem.
Is that different in essence from the Binary Method Problem?
> IMO it makes very much sense to have the corresponding construct in
> C++ too, as we're moving towards a more and more functional style with
> parallelism and such.
Well, it's not as though we can't already do functional programming in
C++... I think you might be conflating issues here. Isn't this really
about a way to do runtime polymorphism with value semantics?
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk