用了urlrewrite之后别的过滤器不管用了

用了urlrewrite之后别的过滤器不管用了,是因为urlrewrite默认是forward形式转变url,

而filter一般是不过滤forward请求的,所以需要在url-pattern之后加上 FORWARD这一行

友元函数怎么不管用了

11-08

我想写输入输出流>>,<rnusing namespace std;rnrnclass Rationalrnpublic:rn Rational();rn Rational(long numerator, long denominator);rn long getNumerator();rn long getDenominator();rn Rational add(Rational &secondRational);rn Rational subtract(Rational &secondRational);rn Rational multiply(Rational &secondRational);rn Rational divide(Rational &secondRational);rn int compareTo(Rational &secondRational);rn bool equals(Rational &secondRational);rn int intValue();rn double doubleValue();rn string toString();rnrn // Define function operators for relational operatorsrn bool operator<(Rational &secondRational);rn bool operator<=(Rational &secondRational);rn bool operator>(Rational &secondRational);rn bool operator>=(Rational &secondRational);rn bool operator!=(Rational &secondRational);rn bool operator==(Rational &secondRational);rnrn // Define function operators for arithmetic operatorsrn Rational operator+(Rational &secondRational);rn Rational operator-(Rational &secondRational);rn Rational operator*(Rational &secnodRational);rn Rational operator/(Rational &secondRational);rnrn // Define function operators for shorthand operatorsrn Rational operator+=(Rational &secondRational);rn Rational operator-=(Rational &secondRational);rn Rational operator*=(Rational &secondRational);rn Rational operator/=(Rational &secondRational);rnrn // Define fucntion operator[]rn long& operator[](const int &index);rnrn // Define function operators for prefix++ and --rn Rational operator++();rn Rational operator--();rnrn // Define function operators for postfix ++ and --rn Rational operator++(int dummy);rn Rational operator--(int dummy);rnrn // Define function operators for unary + and -rn Rational operator+();rn Rational operator-();rnrn // Define the output and input operatorrn friend ostream &operator<<(ostream &stream, Rational &rational); // 重载输出流的友元函数rn friend istream &operator>>(istream &stream, Rational &rational); // 重载输入流的友元函数rnrn // Define function operator for conversionrn operator double();rnrnprivate:rn long numerator;rn long denominator;rn static long gcd(long n, long d);rn;rnrn#endif[/code]rn我的友元函数实现如下:rn[code=c]// Define the output and input operatorrnostream &operator<<(ostream &str, const Rational &rational)rn str << rational.numerator << " / " << rational.denominator; // 编译的时候显示这里不能获取private 成员rn return str;rnrnrnistream &operator>>(istream &str, Rational &rational)rn cout << "Enter numerator: ";rn str >> rational.numerator;rnrn cout << "Enter denominator: ";rn str >> rational[1];rn return str;rn[/code]rn但是编译的时候显示str << rational.numerator << " / " << rational.denominator; // 编译的时候显示这里不能获取private 成员

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试