-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinstate MP11 support for ArgumentPacks #70
Conversation
Argument packs qualify as Boost.MP11-style maps as well as MPL sequences. These maps store the keyword tag types as their keys.
I'll ask @pdimov to review this first. |
This looks good from a cursory look. I see that you want to support both MPL and mp11 use at the same time, in which case making the mp11-style flat_arg_list inherit from the MPL-style non-flat one is reasonable. This makes me wonder if a separate parameter11 library wouldn't be better though. If MPL is dropped and everything is rewritten using parameter packs and mp11, the implementation ought to become simpler. Having the mp11 support optional and behind a macro makes it tricky to rely upon from another library's interface. Suppose you want to use Parameter in mp11 mode, what do you do? #define the macro in your headers? But what if the user includes another library's header first, one that also uses Parameter, but doesn't define the macro. Yes, optional behind a macro is correct in the sense that it's least likely to create backward compatibility issues, but it's less useful this way. |
I agree that MP11 can simplify the parameter pack implementation. (As an aside, in fact, this and the possible future direction of phasing out MPL were the main reasons I introduced those extraneous metafunctions.) But I don't think a separate Parameter11 implementation should be necessary. Although MP11 support is available only for sufficiently advanced compilers, this 'mp11 mode' is on for those compilers by default unless the user explicitly disables it by #defining If we are planning to phase out MPL some time in the future, I could, later on, introduce two more configuration macros, |
I hadn't noticed that mp11 mode is on by default, yes. The advantage of having a separate Parameter11 is that it doesn't affect existing users of Parameter, doesn't have to maintain backward compatibility, and allows a library (header) using Parameter and a library (header) using Parameter11 to coexist in the same translation unit. |
Okay, I see what you're saying regarding the use case of including another library's header first, one that uses Boost.Parameter but #defines |
I don't think that this would be necessary. My remark was made when I thought that mp11 mode was off by default. It would (hopefully!) be rare for libraries to want to explicitly disable it. |
I wouldn't mind implementing a separate lean-and-mean Parameter11 or even Parameter20, but other users might want to see additional (or fewer!) features. For example, I know @Lastique wants In the meantime, I await the results of your further investigation. |
@CromwellEnage Any config macros won't be helpful for Boost.Log since a library cannot define config macros for other libraries. It is the user's choice as to which features of each library he wants. As for |
OTOH, using |
I didn't make this clear in my previous post, but I also introduced the Regarding |
Ok, thank you. Compile performance is important for Boost.Log, so I will have a look at these utilities. |
Argument packs qualify as Boost.MP11-style maps as well as MPL sequences. These maps store the keyword tag types as their keys.