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 2424#include < initializer_list>
2525
2626namespace 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 {
2734
2835// / The class template \c OptionSet captures a set of options stored as the
2936// / bits in an unsigned integral value.
@@ -151,7 +158,8 @@ class OptionSet {
151158 Flags>::value,
152159 " operator| should produce an OptionSet" );
153160};
154-
161+ } // end namespace optionset
162+ using namespace optionset ;
155163} // end namespace swift
156164
157165#endif // SWIFT_BASIC_OPTIONSET_H
You can’t perform that action at this time.
0 commit comments