Boost logo

Boost :

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 <> wrote:

> Comments are welcome!

After a quick skim:

Very cool! Reminds me a bit of something I did, entirely in the static
polymorphism space: 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

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