Lines Matching refs:std

34 **std-primary**: ISO C library functions are declared inside `namespace std {}`.
35 The global namespace (`::`) is then populated via `using std::func` declarations.
38 `extern "C" {}`. The `std::` namespace is then populated via `using ::func`
43 namespace, and gives a clear rule for what may be exposed in `namespace std`.
46 std-primary layout let `using std::log` pull the float, double, and long double
53 ## Standards Basis: What Belongs in `::` vs. `namespace std`
58 - populate `namespace std` only with names the C++ standard requires
59 - keep extension names in `::`, not in `namespace std`
81 names that `<cmath>` places in `namespace std`. But the same paragraph makes
85 > namespace scope of the namespace `std` and are then injected into the global
92 - `namespace std` is populated explicitly, by `using ::func` and by C++-only
99 C-standard form. `using ::func` in `namespace std` then brings all overloads
106 ### Pattern B: type variant overloads in `namespace std` only argument
111 - `namespace std` gets that form via `using ::log`, plus the float and long
112 double overloads as C++-only inlines defined directly in `namespace std`.
116 On GCC, the integer-covering support lives inside `namespace std`, not in `::`.
122 header to have already provided the type variant overloads in `namespace std`
137 `std::__math` namespace. It does not rely on illumos-style system header
145 overloads in `namespace std`, and on Solaris or illumos it uses
160 `namespace std` is populated exclusively with names the C++ standard requires.
165 ## Why Change from std-primary to global-primary?
173 is what `extern "C"` means. The std-primary model placed them in
174 `namespace std` as a primary residence, which is non-standard. Global-primary
176 (`namespace std` contains what `<cname>` is required to provide).
180 responsible for populating `namespace std`. illumos being different causes
183 3. **Extension pollution of `namespace std`.** In the std-primary model it is
185 or `_XOPEN_SOURCE`) inside `namespace std`. The global-primary model makes
186 the boundary explicit: extensions go in `::` only, and `namespace std` is
189 4. **Bugs from over-population of `::`.** The outer headers use `using std::func`
190 to pull names from `namespace std` into `::`. When `namespace std` contains
204 The **global namespace is primary**. `std::` is secondary, populated only
208 std-primary model. See [Status by header](#status-by-header) for the current
229 The outer header (`<math.h>`) needs no `using std::log` lines; `::log` is
235 Extension symbols (`__EXTENSIONS__`) are **not** aliased into `namespace std`.
255 **Section 4: C++ overloaded inlines (C++ global namespace or `namespace std`).**
257 (see [Standards Basis](#standards-basis-what-belongs-in--vs-namespace-std)):
261 in Section 6 brings all overloads into `namespace std` at once. Safe only
264 `namespace std` in Section 6. Required for math functions (`log`, `sin`,
291 **Section 6: `namespace std`** (same `extern "C++"` block). Populated with
293 are defined here inside `namespace std`:
296 namespace std {
319 * inside extern "C" {}. The C++ standard namespace (std::) is then
321 * symbols inside "namespace std {}".
327 * - Brought into std:: in Section 6
332 * "using ::func" in namespace std then brings all type variant
333 * overloads into std:: in one declaration. Use this when the
336 * Pattern B: inlines in namespace std only.
338 * into std::. Type variant inlines are defined directly in
339 * namespace std. Use this for functions that may be called with
371 * Some of these may be aliased into std:: in Section 6.
415 * and define them directly inside namespace std in Section 6.
442 * Section 6: namespace std population.
444 * Only declarations codified by C++ standards are aliased into std::.
449 * Pattern A: "using ::" brings all type variant overloads into std::
454 * std to avoid ambiguity when called with integer args.
456 namespace std {
465 } /* namespace std */