Reserved Namespace for POSIX

Document numberN2667=08-0177
SupercedesN2542=08-0052
Date2008-06-12
ProjectProgramming Language C++
ReferenceISO/IEC IS 14882:2003(E)
AuthorsBenjamin Kosnik
Red Hat
bkoz@redhat.com
Nick Stoughton
USENIX Association
nick@usenix.org

Introduction

The POSIX liasion report to the LWG at the Bellevue meeting requested the reservation of possible namespaces for future standardization work. Two namespaces were mentioned as candidates: std::posix and ::posix.

The LWG wasn't planning on using either of these namepaces. However, during the Sophia Antipolis meeting, it was believed that there may be issues with regard to std::posix, so it it was suggested to formalize simply the request for ::posix in the working draft.

Proposed Wording

Make the following changes to 17.4.3 [constraints]:

This subclause describes restrictions on C++ programs that use the facilities of the C++ Standard Library. The following subclauses specify constraints on the program's use of namespaces (17.4.3.1) the namespace std (17.4.3.1), its use of various reserved names (17.4.3.2), its use of headers (17.4.3.3), its use of standard library classes as base classes (17.4.3.4), its definitions of replacement functions (17.4.3.5), and its installation of handler functions during execution (17.4.3.6).
Change 17.4.3.1 [namespace.std] as follows:
17.4.3.1 Namespace Use [namespace.constraints]

17.4.3.1.1Namespace std [namespace.std]

The behavior of a C++ program is undefined if it adds declarations or definitions to namespace std or to a namespace within namespace std unless otherwise specified.

Add the following new subclause to the new 17.4.3.1 [namespace.constraints]:
17.4.3.1.2 Namespace posix [namespace.posix]

The behavior of a C++ program is undefined if it adds declarations or definitions to namespace posix or to a namespace within namespace posix unless otherwise specified. The namespace posix is reserved for use by ISO/IEC 9945 and other POSIX standards.