Title
Empty tag types should be constexpr literals
Status
c++11
Section
[thread.mutex]
Submitter
Alisdair Meredith

Created on 2009-03-12.00:00:00 last changed 154 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the synopsis in [thread.mutex]:

struct defer_lock_t {};
struct try_to_lock_t {};
struct adopt_lock_t {};

extern constexpr defer_lock_t defer_lock {};
extern constexpr try_to_lock_t try_to_lock {};
extern constexpr adopt_lock_t adopt_lock {};
Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to Tentatively Ready.

Date: 2010-10-21.18:28:33

[ Summit: ]

Move to review. The current specification is a "hack", and the proposed specification is a better "hack".

Date: 2012-10-21.13:19:07

Addresses UK 325 [CD1]

We believe constexpr literal values should be a more natural expression of empty tag types than extern objects as it should improve the compiler's ability to optimize the empty object away completely.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg467
2010-10-21 18:28:33adminsetmessages: + msg466
2010-10-21 18:28:33adminsetmessages: + msg465
2009-03-12 00:00:00admincreate