cannot find cashback on ebay on live.com anymore. anyone still see it?
p*o
2 楼
i have a question on operators in c++. /* header file */ class A; class B { public: operator A*(); double& operator [](unsigned int); }; /* cpp file */ B b; b[3] = 2.2; the compiler will complain about the "b[3]=2.2" line b/c there are two possible ways to interpret the code: 1. b.operator[](unsigned) -- my desired operation 2. b.operator A*.operator[] -- which is build-in. the above code can be compiled and run well under linux, but now i am using g++ under windows. i just realize suc
【在 a**u 的大作中提到】 : cannot find cashback on ebay on live.com anymore. anyone still see it?
p*o
5 楼
It's in 13.3, though I didn't read it ...
【在 p****o 的大作中提到】 : i have a question on operators in c++. : /* header file */ : class A; : class B : { : public: : operator A*(); : double& operator [](unsigned int); : }; : /* cpp file */
g*y
6 楼
this is based on the limitation of your algorithm, I think. means several different solutions can give similar suboptimal value 限. I don't think so. Why you want to prevent a big change of solution? It may allow you reach the optimal value faster.
yes, the strictness of the compiler can expose many un-imaginable problems in the code. it actually takes me quite some time to figure out the error message because the real code is much more complicated than the sample given.
【在 p***o 的大作中提到】 : It's in 13.3, though I didn't read it ...
f*a
9 楼
When you apply 10% to limit the change, i think, to the max of my understanding, it is some sort of regularization. You my consider apply regularization to the cost function, i.e. Tikhonov regularizztion. This would have the effect of reducing the variation of x, at the price of increasing the cost at the solution.
【在 g****y 的大作中提到】 : : this is based on the limitation of your algorithm, I think. : means several different solutions can give similar suboptimal value : 限. : I don't think so. Why you want to prevent a big change of solution? It may : allow you reach the optimal value faster.
j*p
10 楼
有 cashback stall里面找
【在 b***8 的大作中提到】 : 嗯,好像是没了。还好这几天没啥货要进。
p*o
11 楼
Oh, yes. But implementing operator T* for [] is strange enough.
given.
【在 p****o 的大作中提到】 : yes, the strictness of the compiler can expose many un-imaginable problems : in the code. it actually takes me quite some time to figure out the error : message because the real code is much more complicated than the sample given.
shouldn't g++ pick "operator []"? the other path requires more "effort".
j*p
15 楼
cashback stores
【在 a**u 的大作中提到】 : 哪里??、 : link? : what is cashback stall?
p*o
16 楼
in my code, T* is an abstract opaque pointer due to the system design. while [] is an operator for accessing the real data. so they both make sense somehow. now the problem is solved. i declare the operator [] as double& operator [] (int); originally i used "unsigned int" for the most strict type checking. but in practice, the compiler treated all constants like 5 as int but not unsigned. so there is a conversion from int to unsigned. that's why the compiler does not know which decoding path to
【在 p***o 的大作中提到】 : Oh, yes. But implementing operator T* for [] is strange enough. : : given.
j*1
17 楼
come back again
i*h
18 楼
[] by default is pointer reference I think this way is more elegant than overloading []. [] overloading can be used for more complicated index operation.
【在 p***o 的大作中提到】 : Oh, yes. But implementing operator T* for [] is strange enough. : : given.