mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-29 08:15:14 +00:00
30 lines
535 B
C
30 lines
535 B
C
#ifndef TCPP_DEFAULT_CTOR_ASSIGNMENT_H
|
|
#define TCPP_DEFAULT_CTOR_ASSIGNMENT_H
|
|
|
|
struct AmbiguousAssign {
|
|
int x;
|
|
const char* y;
|
|
|
|
AmbiguousAssign(): x(0), y(nullptr) {}
|
|
AmbiguousAssign(int x, const char* y): x(x), y(y) {}
|
|
|
|
AmbiguousAssign& operator=(int v) {
|
|
x = v;
|
|
y = nullptr;
|
|
return *this;
|
|
}
|
|
|
|
AmbiguousAssign& operator=(const char* s) {
|
|
x = 0;
|
|
y = s;
|
|
return *this;
|
|
}
|
|
|
|
AmbiguousAssign& operator=(const AmbiguousAssign& other) {
|
|
x = other.x;
|
|
y = other.y;
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
#endif |