", ?"
, !+ () . .
, , [_A-Za-z][_A-Za-z0-9]* regex 1.
++ draft section
16
...
:
...
# define - new-line
# define lparen identifier-listopt) new-line -
# define lparen...) new-line-list-list
# define lparen identifier-list,...) new-line-list-list
UPDATE:
, , #define 'd , ++.
, ( ) , , . , , :
class Foo {
enum OpState { None , PlusState , NotState };
public:
Foo& operator+() {
cout << "operator+()" << endl;
opState = PlusState;
return *this;
}
Foo& operator!() {
cout << "operator!()" << endl;
switch(opState) {
case PlusState:
operatorexclamativeplus();
break;
default:
opState = NotState;
break;
}
return *this;
}
private:
Foo& operatorexclamativeplus() {
cout << "operatorexclamativeplus()" << endl;
opState = None;
return *this;
}
Foo& operatorexclamativeplus(const Foo& rhs) {
cout << "operatorexclamativeplus(const Foo& rhs)" << endl;
opState = None;
return *this;
}
OpState opState;
};
int main() {
Foo x;
Foo z = !+x;
return 0;
}
operator+()
operator!()
operatorexclamativeplus()
. .
- (! , +), , , -, :
class Foo {
public:
friend Foo& operator+(Foo& lhs, const Foo& rhs) {
cout << "operator+(Foo& lhs, const Foo& rhs)" << endl;
if(lhs.opState == NotState) {
return lhs.operatorexclamativeplus(rhs);
}
return lhs;
}
};
int main() {
Foo x;
Foo y;
Foo z = y !+ x;
return 0;
}
.
:
______________________________________________________________________________________
1)
(_, __) , , , .