|
Boost : |
Subject: Re: [boost] MPL and MPL core
From: Bruno Dutra (brunocodutra_at_[hidden])
Date: 2015-03-31 23:45:21
2015-04-01 0:00 GMT-03:00 Eric Niebler <eniebler_at_[hidden]>:
> On 3/31/2015 7:43 PM, Peter Dimov wrote:
> > Eric Niebler wrote:
> >> On 3/31/2015 4:26 PM, Robert Ramey wrote:
> >> ...
> >>> But don't we already have MPL1 for that? If one has to make MPL2
> >>> more complex to support MPL1 - wouldn't that defeat the whole
> >>> point of the project?
> >>
> >> Which is exactly why I don't see the point in writing an MPL clone.
> >
> > There isn't much point in writing a C++11 MPL clone, because the
> > idiomatic way to do metaprogramming in C++11 is different.
>
> If there is an idiomatic way to do metaprogramming in C++11, I'm sure I
> don't know what it is. But yeah, it's probably not the MPL.
>
I was about to say the very same thing. I keep being told MPL is old
fashioned, but, to be honest, so far I've failed to see what the "C++11
way" of metaprogramming is.
2015-04-01 0:16 GMT-03:00 Peter Dimov <lists_at_[hidden]>:
> Eric Niebler wrote:
>
> Robert's question stands though. What is the point of a drop-in MPL
>> replacement implemented for C++03 compilers? We already have that.
>>
>
> What we have is unmaintained and, dare I say, unmaintainable, because it
> targets not C++03, but C++95.
Exactly, that is precisely the main motivation behind my efforts on MPL2, I
find it unbearable that such a core library as MPL be left unmaintaned.
At the beginning I was in favor of some serious overhauling of it and even
started a thread on this matter about a month ago, but that was only till I
dug deeper into it and realized how impracticable that was. That's when I
decided to start from scratch, focus on modern compilers and ultimately
provide a drop in replacement for MPL. I was then convinced backwards
compatibility to C++98 could be easily maintained within reasonable use of
macros and without too much impairment to code maintainability. To be
honest, I still think it is fairly doable, C++98 is nothing compared to the
advanced black magic MPL currently ships to target "C++95" as Peter says,
but Robert managed to convince me there's little to gain from it. See,
whenever C++03 is required, MPL is still there and does the job, period.
For modern usage, MPL2 sure would come handy, it would be guaranteed to be
maintained and most certainly would be able provide much more advanced
features than good old MPL could ever be dreamed to provide.
Now please bear in mind I said that there's "little" gain from backwards
compatibility to C++98, I didn't say there's none. Sure there's plenty of
setups out there that would do great use of MPL2 on a C++03 environment,
and I'm glad I'm not the only one who believes so, but I'm just not so
convinced anymore it is worth spending too much effort on it while there's
still a much more important matter to be addressed, which is MPL's current
maintainability status. I haven't given up on backwards compatibility to
older standards, I've just postponed it to a more convenient time.
*Bruno C. O. Dutra*
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk