C++ Logo

SG10

Advanced search

Subject: Re: [SG10] __cpp_noexcept feature-test macro
From: Ed Smith-Rowland (3dw4rd_at_[hidden])
Date: 2015-01-17 12:45:01


On 01/17/2015 12:04 PM, Jonathan Wakely wrote:
> Is there any feature-test macro that can be used for the C++11
> noexcept keyword as either an operator or in an
> exception-specification?
>
> The libc++ testsuite makes heavy use of Clang's
> __has_feature(cxx_noexcept) and I don't see an SD-6 equivalent that
> could be used instead.
> _______________________________________________
> Features mailing list
> Features_at_[hidden]
> http://www.open-std.org/mailman/listinfo/features
>
No.
I was going to look at any C++11 features that lack a macro
1. That are useful now
2. That might future proof SD-6 by giving us something we can bump dates on

So obviously
N3050 - Allowing Move Constructors to Throw (Rev. 1) __cpp_noexcept
201003

Rationale:
int foo()
#if __cpp_noexcept
   noexcept
#else
   throw()
#endif

(Or define a macro if you want to.)

I don't think anything in C99 is worth it.

The only thing I can think of in Concurrency might be
__cpp_thread_local. Iffy utility to me - no portable replacement.

Ones we don't have macros for (ignoring DRs) I'm not proposing we do
all these by a long shot. This is just to start a discussion:

N2657 - Local and unnamed types as template arguments

N2544 - Unrestricted unions

N2535 - Inline namespaces

N2253 - Extending sizeof
No real replacement.

N1791 - Extended friend declarations

N2346 - Defaulted and deleted functions
You could roll back to the old private def trick. You could implement
yourself.

N2342 - Standard Layout Types
No.

N2170 - Universal character name literals
No.

N2437 - Explicit conversion operators

N2341 - Alignment support
You could roll back to non-portable extensions.

N2764 - Forward declarations for enums
I could see using this.
#if __cpp_forward_decl_enum >= yyyym
enum foo;
#else
#include "foo_enum_def.h"
#endif
In the implementation the opposite logic would be used.

N2347 - Strongly-typed enums

N2431 - Null pointer constant
Implementations probably already do this one way or another.
It might be nice to offer a portable way to do it.

N1987 - Extern templates

N1757 - Right angle brackets
No. ;-)

N3276 - decltype and call expression
Have __cpp_decltype 200707. I wouldn't bother even bumping date.

N2541 - New function declarator syntax
In cases where this is required to build return types from template
parms say there is no real replacement.
Otherwise it's just window dressing.
Does anyone see C++17 hitting this?

N2546 - Removal of auto as a storage-class specifier
N1984 - auto-typed variables

N2555 - Extending variadic template template parameters
Have __cpp_variadic_templates 200704. I wouldn't bother even bumping date.

N1610 - Initialization of class objects by rvalues
Obviated by __cpp_rvalue_references 200610.


SG10 list run by herb.sutter at gmail.com