File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 24
24
#include < initializer_list>
25
25
26
26
namespace swift {
27
+ // / The Swift standard library also has an `OptionSet` type that is imported
28
+ // / when using C++ to Swift interop within the compiler.
29
+ // / Since the Swift stdlib is also imported in the `swift` namespace, the two
30
+ // / types would conflict. Move the compiler's OptionSet into a sub-namespace
31
+ // / to avoid collisions. Below we do `using namespace optionset`, which makes
32
+ // / the C++ `OptionSet` type available everywhere the `swift` namespace is used.
33
+ namespace optionset {
27
34
28
35
// / The class template \c OptionSet captures a set of options stored as the
29
36
// / bits in an unsigned integral value.
@@ -151,7 +158,8 @@ class OptionSet {
151
158
Flags>::value,
152
159
" operator| should produce an OptionSet" );
153
160
};
154
-
161
+ } // end namespace optionset
162
+ using namespace optionset ;
155
163
} // end namespace swift
156
164
157
165
#endif // SWIFT_BASIC_OPTIONSET_H
You can’t perform that action at this time.
0 commit comments