From feec4b0614c1fd64fa59634af8774a992c7a5646 Mon Sep 17 00:00:00 2001
From: Andrew Kelley
- {#syntax#}usingnamespace{#endsyntax#} is a declaration that imports all the public declarations of
- the operand, which must be a {#link|struct#}, {#link|union#}, or {#link|enum#}, into the current scope:
+ {#syntax#}usingnamespace{#endsyntax#} is a declaration that mixes all the public
+ declarations of the operand, which must be a {#link|struct#}, {#link|union#}, {#link|enum#},
+ or {#link|opaque#}, into the namespace:
- {#syntax#}usingnamespace{#endsyntax#} can also be used in containers:
-
- Instead of the above pattern, it is generally recommended to explicitly alias individual declarations.
- However, {#syntax#}usingnamespace{#endsyntax#} has an important use case when organizing the public
+ {#syntax#}usingnamespace{#endsyntax#} has an important use case when organizing the public
API of a file or package. For example, one might have c.zig with all of the
{#link|C imports|Import from C Header File#}:
Zig places importance on the concept of whether an expression is known at compile-time.