mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If the C++ type of a function parameter defines a custom copy constructor, assume that it is safe to use from Swift. This matches the heuristic that we use to detect if a C++ method is safe based on the return type. rdar://121391798
9 lines
226 B
C++
9 lines
226 B
C++
#include <string>
|
|
|
|
struct HasMethodThatReturnsString {
|
|
int value = 111;
|
|
std::string getString() const { return std::to_string(value); }
|
|
};
|
|
|
|
inline std::string takesStringWithDefaultArg(std::string s = "abc") { return s; }
|