"David Abrahams" wrote
"Andy Little" wrote
"David Abrahams" writes
The result of the transform is only required to be "concept-identical" to the result you're looking for.
IMO that behaviour is sloppy. I see no reason why (at least)
boost::is_same < plus< int_<1> ,int_<1> >::type, int_<2> > shouldnt be true.
Patches welcome, and all that. If you can figure out how to do it without greatly complicating the library, I'm sure Aleksey would be glad to adopt your code. Until then, I'll thank you not to sling words like "sloppy" around so blithely.
What can I say? I acknowledge that mpl is a monumental piece of work .
Wonderful... but far from perfect.
In this case it looks trivial to change the int_ plus behaviour...
#include
mpl models itself on runtime C++ but in this case it deviates from following runtime behaviour for no real benefit. Note also that tightening the behaviour wouldnt break any conforming code ;-)
In the user's case, the real benefit is that it drastically reduces the number of lines of implementation code in the library, which has a real impact on the library's usability.
All I can say is that I was *a user*. It certainly had an effect on useability of my pqs library. It had a huge effect on compile times because large complicated templates **representing the same sequence** kept being differently represented. There was a jump in compilation times from typically 4 seconds to 30 or so, as well as getting Fatal error messages from the compiler on relatively small code samples that the compiler had run out of keys. The use of mpl turned the pqs library from something enjoyable to use to something unusable. I am much happier now that I have all but eliminated use of mpl in my physical quantities library . Having submitted pqs into the review queue I am sure this question of why I am not using mpl is going to come up and may cause the library to be blindly rejected, so I am going to start fighting back now!
vector
, int_<2> > vector
, integral_c > vector_c
are all different types, and they always will be. There's nothing we can do about that, period.
That shouldnt stop discussion of whether it is the best design. Arranging it so that you always get the
exact type you expect would require a great deal more code than we're using now, and may not even be possible.
I shall continue to question whether it is the best design. I dont know whether there are plans to C++ standardise any of mpl , but I would certainly like to raise that and some other issues in that case. regards Andy Little