Boost config macros for 'override' and 'final'?
I don't find in Boost 1.57 any Boost macros to mediate use of the 'override' or 'final' C++11 specifiers. Would that be a reasonable addition?
On Mon, Nov 17, 2014 at 10:45 AM, Nat Goodspeed
I don't find in Boost 1.57 any Boost macros to mediate use of the 'override' or 'final' C++11 specifiers. Would that be a reasonable addition?
Okay, my question was badly phrased. I do see BOOST_NO_CXX11_FINAL. What I meant was: should there be (e.g.) BOOST_FINAL that conditionally expands to 'final' and BOOST_OVERRIDE that conditionally expands to 'override'?
On Mon, Nov 17, 2014 at 10:51 AM, Nat Goodspeed
On Mon, Nov 17, 2014 at 10:45 AM, Nat Goodspeed
wrote: I don't find in Boost 1.57 any Boost macros to mediate use of the 'override' or 'final' C++11 specifiers. Would that be a reasonable addition?
Okay, my question was badly phrased. I do see BOOST_NO_CXX11_FINAL.
What I meant was: should there be (e.g.) BOOST_FINAL that conditionally expands to 'final' and BOOST_OVERRIDE that conditionally expands to 'override'?
We usually add config macros only if a boost library developer actually needs them. In other words, we don't add a macro just on speculation. I suppose we might add a macro even if no one has asked for it if it was something we wanted to encourage boost developers to use. On the other hand, maybe we should give more consideration to the general usefulness of a proposed macro by boost users. In those cases maybe we could hold mini-votes. Something like if it gets 5 plus votes and no minus votes, we will accept a pull request assuming it is complete and ready to merge. John, any thoughts on something like that? --Beman
Beman Dawes wrote
We usually add config macros only if a boost library developer actually needs them. In other words, we don't add a macro just on speculation. I suppose we might add a macro even if no one has asked for it if it was something we wanted to encourage boost developers to use.
Might we consider adding a set of macros each time a new C++ version is released which includes all the new features? Take the serialization library - there is value in keeping it C++03 compatible and I would like to have macros available to keep it that way even as C++ evolves. On the other hand, I have no problem with my experiment safe numerics library using the latest/greatest C++ features as the library hasn't been "released". So I can just have it fail to compile if C++ version is less than 11. In fact, maybe all we need is a macro - if we don't already have it - C++ version. BOOST_CPP_VERSION. The feature by feature macros are useful, but less critical than before when we had a lot more variation between compilers. Robert Ramey -- View this message in context: http://boost.2283326.n4.nabble.com/Boost-config-macros-for-override-and-fina... Sent from the Boost - Dev mailing list archive at Nabble.com.
On Mon, Nov 17, 2014 at 11:06 AM, Robert Ramey
In fact, maybe all we need is a macro - if we don't already have it - C++ version. BOOST_CPP_VERSION. The feature by feature macros are useful, but less critical than before when we had a lot more variation between compilers.
Assuming the compiler/runtime defines the standard macro correctly you can use the Predef version macro BOOST_LANG_STDCPP: < http://www.boost.org/doc/libs/1_57_0/libs/predef/doc/html/predef/reference/b...
(Reminds me that I should update that table to list 2013 standard document number) -- -- Rene Rivera -- Grafik - Don't Assume Anything -- Robot Dreams - http://robot-dreams.net -- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail
Might we consider adding a set of macros each time a new C++ version is released which includes all the new features?
We've more or less done this I think for C++11 and C++14 - there are probably a few missing from the darker corners of the language, but given that it takes time to devise tests etc those can wait until some lib actually really needs them. John.
Robert Ramey wrote:
In fact, maybe all we need is a macro - if we don't already have it - C++ version. BOOST_CPP_VERSION.
What value would you set this macro to for a compiler which does not support the constexpr feature, but does support override and final? (Hint: this is a well-trodden path: http://thread.gmane.org/gmane.comp.lib.boost.devel/251820/focus=251967 ) Thanks, Steve.
On the other hand, maybe we should give more consideration to the general usefulness of a proposed macro by boost users. In those cases maybe we could hold mini-votes. Something like if it gets 5 plus votes and no minus votes, we will accept a pull request assuming it is complete and ready to merge.
John, any thoughts on something like that?
I think an informal straw poll is a fine idea - actually we quite often have asked for feedback before adding new macros. John.
participants (6)
-
Beman Dawes
-
John Maddock
-
Nat Goodspeed
-
Rene Rivera
-
Robert Ramey
-
Stephen Kelly