Files
swift-mirror/test/Interop/Cxx/class/Inputs/mutable-members.h
2024-03-08 20:13:27 +00:00

31 lines
606 B
C++

#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_MUTABLE_MEMBERS_H
#define TEST_INTEROP_CXX_CLASS_INPUTS_MUTABLE_MEMBERS_H
#ifdef USE_MUTATING
// Note: in actuality, this will be included
// as <swift/bridging>, but in this test we include
// it directly.
#include "swift/bridging"
#else
#define SWIFT_MUTATING
#endif
struct HasPublicMutableMember {
mutable int a = 0;
int foo() const SWIFT_MUTATING {
a++;
return a;
}
};
struct HasPrivateMutableMember {
private:
mutable int a = 0;
public:
void bar() const SWIFT_MUTATING { a++; }
};
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_MUTABLE_MEMBERS_H