mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
27 lines
395 B
C++
27 lines
395 B
C++
struct BoolBox {
|
|
bool value;
|
|
|
|
operator bool() const { return value; }
|
|
};
|
|
|
|
struct NonConstBoolBox {
|
|
bool value;
|
|
|
|
operator bool() { return value; }
|
|
};
|
|
|
|
struct DualOverloadBoolBox {
|
|
bool value;
|
|
|
|
operator bool() const { return value; }
|
|
operator bool() { return value; }
|
|
};
|
|
|
|
struct ExplicitBoolBox {
|
|
private:
|
|
bool value;
|
|
|
|
public:
|
|
explicit operator bool() const { return value; }
|
|
};
|