[C++0x] More config macros needed

GCC 4.3 and even more so 4.4 have implemented significant portions of the C++0x core language, and provide lots of C++0x standard library components too. Microsoft 2010 beta 1 will ship "real soon", and it too will have some major C++0x core language features, and also some C++0x standard library components. Thus we need more config macros, particularly those aimed at the standard library. A possible approach: BOOST_NO_CONCEPTS // needed to tell if headers have been conceptized BOOST_NO_*_HDR // for each new C++0x header; * is name of header For example, BOOST_NO_CHRONO_HDR is defined unless header <chrono> is present. I'm proposing we not try to identify whether or no the header is complete. If BOOST_NO_CONCEPTS is defined, the header obviously hasn't been conceptized. Ditto anything else that depends on any other new core language feature that hasn't been implemented. Other incomplete aspects will have to be dealt with by testing the library version. We don't want feature macros to proliferate unduly; they are more work to create and maintain than you might think, and if there are a lot of them it gets very confusing. Comments? --Beman

Beman Dawes wrote: On Monday, May 11, 2009 10:15 PM
GCC 4.3 and even more so 4.4 have implemented significant portions of the C++0x core language, and provide lots of C++0x standard library components too.
Microsoft 2010 beta 1 will ship "real soon", and it too will have some major C++0x core language features, and also some C++0x standard library components.
Thus we need more config macros, particularly those aimed at the standard library. A possible approach:
BOOST_NO_CONCEPTS // needed to tell if headers have been conceptized
BOOST_NO_*_HDR // for each new C++0x header; * is name of header
For example, BOOST_NO_CHRONO_HDR is defined unless header <chrono> is present.
I noticed the need for such macros, too, at BoostCon. I was thinking we need one for each feature. BOOST_NO_AUTO BOOST_NO_DECLTYPE BOOST_NO_REFREF BOOST_NO_VARIADICS etc. The only reason I can think of to provide one for each header is so that Boost headers can include standard headers rather than compatibility code. Is that what you had in mind? If so, then the header macros should only be undefined when the corresponding header is complete. _____ Rob Stewart robert.stewart@sig.com Software Engineer, Core Software using std::disclaimer; Susquehanna International Group, LLP http://www.sig.com IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

On Tue, May 12, 2009 at 5:11 PM, Stewart, Robert <Robert.Stewart@sig.com> wrote:
Beman Dawes wrote: On Monday, May 11, 2009 10:15 PM
GCC 4.3 and even more so 4.4 have implemented significant portions of the C++0x core language, and provide lots of C++0x standard library components too.
Microsoft 2010 beta 1 will ship "real soon", and it too will have some major C++0x core language features, and also some C++0x standard library components.
Thus we need more config macros, particularly those aimed at the standard library. A possible approach:
BOOST_NO_CONCEPTS // needed to tell if headers have been conceptized
BOOST_NO_*_HDR // for each new C++0x header; * is name of header
For example, BOOST_NO_CHRONO_HDR is defined unless header <chrono> is present.
I noticed the need for such macros, too, at BoostCon. I was thinking we need one for each feature.
BOOST_NO_AUTO BOOST_NO_DECLTYPE BOOST_NO_REFREF BOOST_NO_VARIADICS etc.
We've already got these: BOOST_NO_AUTO_DECLARATIONS BOOST_NO_AUTO_MULTIDECLARATIONS BOOST_NO_CHAR16_T BOOST_NO_CHAR32_T BOOST_NO_CONSTEXPR BOOST_NO_DECLTYPE BOOST_NO_DEFAULTED_FUNCTIONS BOOST_NO_DELETED_FUNCTIONS BOOST_NO_EXPLICIT_CONVERSION_OPERATORS BOOST_NO_EXTERN_TEMPLATE BOOST_NO_LONG_LONG BOOST_NO_RAW_LITERALS BOOST_NO_RVALUE_REFERENCES BOOST_NO_SCOPED_ENUMS BOOST_NO_STATIC_ASSERT BOOST_NO_UNICODE_LITERALS BOOST_NO_VARIADIC_TEMPLATES So we are filling in some of the missing pieces rather than starting from scratch.
The only reason I can think of to provide one for each header is so that Boost headers can include standard headers rather than compatibility code. Is that what you had in mind?
Yes. Suppliers seem to be adding C++0x library components on a header by header basis, rather than waiting until they have a full set and then supplying them all at once. Thus the need to have macros for each header.
If so, then the header macros should only be undefined when the corresponding header is complete.
The problem with waiting for a header to be totally complete means waiting a long time. For example, several vendors are already, or will soon be, shipping a number of new C++0x headers. But their implementations aren't "complete" because they don't have concepts yet. The headers are perfectly usable, however, so there is no reason not to take advantage of them now. For some of these compilers we many have to wait several years before concepts become available, and the headers become "complete". At least that's my thinking. --Beman

Beman Dawes wrote: On Tuesday, May 12, 2009 9:16 PM
On Tue, May 12, 2009 at 5:11 PM, Stewart, Robert <Robert.Stewart@sig.com> wrote:
Beman Dawes wrote: On Monday, May 11, 2009 10:15 PM
Thus we need more config macros, particularly those aimed at the standard library. A possible approach:
BOOST_NO_CONCEPTS // needed to tell if headers have been conceptized
BOOST_NO_*_HDR // for each new C++0x header; * is name of header
For example, BOOST_NO_CHRONO_HDR is defined unless header <chrono> is present.
I noticed the need for such macros, too, at BoostCon. I was thinking we need one for each feature.
We've already got these:
BOOST_NO_AUTO_DECLARATIONS [snip] BOOST_NO_VARIADIC_TEMPLATES
So we are filling in some of the missing pieces rather than starting from scratch.
I never got far enough to look for the config macros you listed; I just noticed that they'd be needed. I'm glad those are available.
The only reason I can think of to provide one for each header is so that Boost headers can include standard headers rather than compatibility code. Is that what you had in mind?
Yes. Suppliers seem to be adding C++0x library components on a header by header basis, rather than waiting until they have a full set and then supplying them all at once. Thus the need to have macros for each header.
If so, then the header macros should only be undefined when the corresponding header is complete.
The problem with waiting for a header to be totally complete means waiting a long time. For example, several vendors are already, or will soon be, shipping a number of new C++0x headers. But their implementations aren't "complete" because they don't have concepts yet. The headers are perfectly usable, however, so there is no reason not to take advantage of them now. For some of these compilers we many have to wait several years before concepts become available, and the headers become "complete".
Yes, concepts are unique in coming very late to the party. I agree with your idea, so long as the header macros don't indicate a header is present with any other deficiency or the logic to determine if needed functionality is present will get complicated. _____ Rob Stewart robert.stewart@sig.com Software Engineer, Core Software using std::disclaimer; Susquehanna International Group, LLP http://www.sig.com IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

On Wed, May 13, 2009 at 8:49 AM, Stewart, Robert <Robert.Stewart@sig.com> wrote:
Beman Dawes wrote:
...
The problem with waiting for a header to be totally complete means waiting a long time. For example, several vendors are already, or will soon be, shipping a number of new C++0x headers. But their implementations aren't "complete" because they don't have concepts yet. The headers are perfectly usable, however, so there is no reason not to take advantage of them now. For some of these compilers we many have to wait several years before concepts become available, and the headers become "complete".
Yes, concepts are unique in coming very late to the party. I agree with your idea, so long as the header macros don't indicate a header is present with any other deficiency or the logic to determine if needed functionality is present will get complicated.
We are definitely feeling our way here. Also, it isn't an easy task to determine if a header has other deficiencies. Unless someone objects strenuously, I'll go ahead and add the proposed header macros knowing full well that still others with finer granularity may be needed. Also, some features go in existing headers, so the macro might have to be something like BOOST_NO_CPP0X_UTILITY_HDR. I'll try to add appropriate macros for at least a few of the more critical of those. --Beman

On Wed, May 13, 2009 at 12:49 PM, Beman Dawes <bdawes@acm.org> wrote:
... Unless someone objects strenuously, I'll go ahead and add the proposed header macros knowing full well that still others with finer granularity may be needed.
OK, I've just committed a bunch of macros. The libstdc++ checks for what version added a given header are suspect. I've posted a message to their developers list to try to get some guidance, but no reply yet.
Also, some features go in existing headers, so the macro might have to be something like BOOST_NO_CPP0X_UTILITY_HDR. I'll try to add appropriate macros for at least a few of the more critical of those.
That just got to be too tedious for now. Unless someone else volunteers, it will have to wait for another day. --Beman

GCC 4.3 and even more so 4.4 have implemented significant portions of the C++0x core language, and provide lots of C++0x standard library components too.
Microsoft 2010 beta 1 will ship "real soon", and it too will have some major C++0x core language features, and also some C++0x standard library components.
Thus we need more config macros, particularly those aimed at the standard library. A possible approach:
BOOST_NO_CONCEPTS // needed to tell if headers have been conceptized
BOOST_NO_*_HDR // for each new C++0x header; * is name of header
For example, BOOST_NO_CHRONO_HDR is defined unless header <chrono> is present.
I'm proposing we not try to identify whether or no the header is complete. If BOOST_NO_CONCEPTS is defined, the header obviously hasn't been conceptized. Ditto anything else that depends on any other new core language feature that hasn't been implemented. Other incomplete aspects will have to be dealt with by testing the library version. We don't want feature macros to proliferate unduly; they are more work to create and maintain than you might think, and if there are a lot of them it gets very confusing.
Sounds reasonable to me, especially if someone other than me gets to do them :-) John.
participants (3)
-
Beman Dawes
-
John Maddock
-
Stewart, Robert