@@ -405,6 +405,9 @@ $(P Visibility is an attribute that is one of $(D private), $(D package),
405
405
`protected`, $(D public), or $(D export). They may be referred to as protection
406
406
attributes in documents predating $(LINK2 http://wiki.dlang.org/DIP22, DIP22).)
407
407
408
+ $(P Visibility participates in $(DDSUBLINK spec/module, name_lookup, symbol name lookup).
409
+ )
410
+
408
411
$(P Symbols with $(D private) visibility can only be accessed from
409
412
within the same module.
410
413
Private member functions are implicitly $(DDSUBLINK spec/function, final, `final`)
@@ -436,12 +439,26 @@ attributes in documents predating $(LINK2 http://wiki.dlang.org/DIP22, DIP22).)
436
439
It is the default visibility attribute.
437
440
)
438
441
439
- $(P $(D export) means that any code outside the executable can access the
440
- member. $(D export) is analogous to exporting definitions from a DLL.
441
- )
442
+ $(H3 $(LNAME2 export, $(D export) Attribute))
442
443
443
- $(P Visibility participates in $(DDSUBLINK spec/module, name_lookup, symbol name lookup).
444
- )
444
+ $(P $(D export) means that a symbol can be accessed from outside the executable,
445
+ shared library, or DLL. The symbol is said to be exported from where it is defined
446
+ in an executable, shared library, or DLL, and imported by another executable, shared library,
447
+ or DLL.)
448
+
449
+ $(P $(D export) applied to the definition of a symbol will export it. $(D export) applied to
450
+ a declaration of a symbol will import it.)
451
+
452
+ ---
453
+ export int x = 3; // definition, exporting `x`
454
+ export int y; // definition, exporting `y`
455
+ export extern int z; // declaration, importing `z`
456
+ export void f() { } // definition, exporting `f`
457
+ export void g(); // declaration, importing `g`
458
+ ---
459
+
460
+ $(P In Windows terminology, $(I dllexport) means exporting a symbol from a DLL, and $(I dllimport) means
461
+ a DLL or executable is importing a symbol from a DLL.)
445
462
446
463
447
464
$(H2 $(LNAME2 const, $(D const) Attribute))
0 commit comments