mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This prevents a name conflict between a Swift `protocol CxxOptional` and a C++ `using CxxOptional`.
13 lines
358 B
C++
13 lines
358 B
C++
#ifndef TEST_INTEROP_CXX_STDLIB_INPUTS_STD_OPTIONAL_H
|
|
#define TEST_INTEROP_CXX_STDLIB_INPUTS_STD_OPTIONAL_H
|
|
|
|
#include <optional>
|
|
|
|
using StdOptionalInt = std::optional<int>;
|
|
|
|
inline StdOptionalInt getNonNilOptional() { return {123}; }
|
|
|
|
inline StdOptionalInt getNilOptional() { return {std::nullopt}; }
|
|
|
|
#endif // TEST_INTEROP_CXX_STDLIB_INPUTS_STD_OPTIONAL_H
|