avatar
s*n
1
他的意思是假设是operator重载
++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
设编译无优化)
大家看有道理吗?
I did a real test on arm compiler turn off optimization:
the O0 code is exactly the same, except that post operator++()(int dummy)
has an extra dummy parameter which is required by c++ to identify the
difference of prefix and postfix.
2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
printf("%d \n", 10+ (abc++).value);
sub r3, fp, #8
mov r0, r3
mov r1, #0 --> the dummy parameter of postfix
bl _ZN4TestppEi --> call the overload function
mov r3, r0
ldr r3, [r3, #0]
add r3, r3, #10
ldr r0, .L12
mov r1, r3
bl printf
printf("%d \n", 20+ (++abc).value);
sub r3, fp, #8
mov r0, r3
bl _ZN4TestppEv --> call the overload function
mov r3, r0
ldr r3, [r3, #0]
add r3, r3, #20
ldr r0, .L12
mov r1, r3
bl printf
c++ source code
#include
class Test {
public:
Test(int v):value(v){};
Test():value(0){};
int value;
int operator()();
Test& operator++();
Test& operator++(int postVersion);
};
Test& Test::operator++(){
value++;
return *this;
}
Test& Test::operator++(int postVersion){
value++;
return *this;
}
int Test::operator()() {
return value;
}
int main(int argc, char** argv)
{
Test abc(100);
printf("%d \n", 10+ (abc++).value);
printf("%d \n", 20+ (++abc).value);
}
avatar
t*g
2
dbl ebucks咋来的?
看了几个refurb. 3008wfp,一个也没有呀,还是2%.
avatar
h*y
3
这是基本常识。
avatar
a*a
4
显示器大,gamut宽,看着是爽
最近在2410上重新看5D以前的原片,tmd震撼了

【在 t****g 的大作中提到】
: dbl ebucks咋来的?
: 看了几个refurb. 3008wfp,一个也没有呀,还是2%.

avatar
h*l
5
。。。。
sure yes

【在 s******n 的大作中提到】
: 他的意思是假设是operator重载
: ++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
: 设编译无优化)
: 大家看有道理吗?
: I did a real test on arm compiler turn off optimization:
: the O0 code is exactly the same, except that post operator++()(int dummy)
: has an extra dummy parameter which is required by c++ to identify the
: difference of prefix and postfix.
: 2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
: printf("%d \n", 10+ (abc++).value);

avatar
t*g
6
我深刻的觉得现在有必要一次到位来个30"的。
显示器比起主机来还是保值,而且钱也花得值。

【在 a***a 的大作中提到】
: 显示器大,gamut宽,看着是爽
: 最近在2410上重新看5D以前的原片,tmd震撼了

avatar
s*n
7
具体展开一下,大致汇编代码是怎么样的,两种情况下?

【在 h**********y 的大作中提到】
: 这是基本常识。
avatar
s*s
8
那是,我这台24"从05年用到现在宝刀不老...

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
h*l
9
你不是自己都说了吗?
基本类型也是一样的

【在 s******n 的大作中提到】
: 具体展开一下,大致汇编代码是怎么样的,两种情况下?
avatar
a*a
10
这个商榷,30我觉得还是太大了,不过你不打游戏可能还好
我现在24的不少游戏都是强制4:3,两边黑道遮,不然晕

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
H*e
11
G?
他们不问这种的吧?

【在 s******n 的大作中提到】
: 他的意思是假设是operator重载
: ++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
: 设编译无优化)
: 大家看有道理吗?
: I did a real test on arm compiler turn off optimization:
: the O0 code is exactly the same, except that post operator++()(int dummy)
: has an extra dummy parameter which is required by c++ to identify the
: difference of prefix and postfix.
: 2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
: printf("%d \n", 10+ (abc++).value);

avatar
a*a
12
我19从05年用到现在烂刀不老。。。

【在 s**********s 的大作中提到】
: 那是,我这台24"从05年用到现在宝刀不老...
avatar
s*n
13
不是G

【在 H***e 的大作中提到】
: G?
: 他们不问这种的吧?

avatar
b*e
14
30"的显示器,在正常距离使用,几秒钟之内我就能觉得它的热量了,这还是在空调房
内。

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
m*n
15
hehe ,简单的i++和++i 区别不大,但如果是对象operator重载,区别很大,呵呵
avatar
k*t
16
彼此彼此吧.
当初俺的19" SAMSUNG 近$900...

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
l*i
17
give me an example that i++ is better. In general i++ needs to save i in a
temp variable and then incr i because you need to return that temp value. My
understanding is that ++i is always better than i++.
avatar
a*a
18
bso嫩

【在 b*****e 的大作中提到】
: 30"的显示器,在正常距离使用,几秒钟之内我就能觉得它的热量了,这还是在空调房
: 内。

avatar
d*o
19
这个除了优化些, 而且避免中断产生的race problem,因为前者是atom 操作。
avatar
m*n
20
没搞错吧 我用了多年了 从来没这个问题。。

【在 b*****e 的大作中提到】
: 30"的显示器,在正常距离使用,几秒钟之内我就能觉得它的热量了,这还是在空调房
: 内。

avatar
p*i
21
If i is an integer or something, i++ is merely a single instruction on intel
architectures.

My

【在 l***i 的大作中提到】
: give me an example that i++ is better. In general i++ needs to save i in a
: temp variable and then incr i because you need to return that temp value. My
: understanding is that ++i is always better than i++.

avatar
t*e
22
这个 double ebucks 这次又是 by invitation only, 不是都有,我希望用的一个帐号
就没有。
早就说过,所谓家用电脑 “大屏幕”直接从 27" 起跳,27" 以下都是开玩笑。

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
s*n
23
the O0 code is exactly the same, except that post operator++()(int dummy)
has an extra dummy parameter which is required by c++ to identify the
difference of prefix and postfix.
2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
printf("%d \n", 10+ (abc++).value);
sub r3, fp, #8
mov r0, r3
mov r1, #0 --> the dummy parameter of postfix
bl _ZN4TestppEi
mov r3, r0
ldr r3, [r3, #0]
add r3, r3, #10
ldr r0, .L12
mov r1, r3
bl printf
printf("%d \n", 20+ (++abc).value);
sub r3, fp, #8
mov r0, r3
bl _ZN4TestppEv
mov r3, r0
ldr r3, [r3, #0]
add r3, r3, #20
ldr r0, .L12
mov r1, r3
bl printf
c++ source code
#include
class Test {
public:
Test(int v):value(v){};
Test():value(0){};
int value;
int operator()();
Test& operator++();
Test& operator++(int postVersion);
};
Test& Test::operator++(){
value++;
return *this;
}
Test& Test::operator++(int postVersion){
value++;
return *this;
}
int Test::operator()() {
return value;
}
int main(int argc, char** argv)
{
Test abc(100);
printf("%d \n", 10+ (abc++).value);
printf("%d \n", 20+ (++abc).value);
}
avatar
a*a
24
我们皮太厚

【在 m*****n 的大作中提到】
: 没搞错吧 我用了多年了 从来没这个问题。。
avatar
d*z
25
....yes

【在 s******n 的大作中提到】
: 他的意思是假设是operator重载
: ++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
: 设编译无优化)
: 大家看有道理吗?
: I did a real test on arm compiler turn off optimization:
: the O0 code is exactly the same, except that post operator++()(int dummy)
: has an extra dummy parameter which is required by c++ to identify the
: difference of prefix and postfix.
: 2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
: printf("%d \n", 10+ (abc++).value);

avatar
n*s
26
2711?

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
s*o
27
c++ FAQ 13.15
http://www.parashift.com/c++-faq-lite/operator-overloading.html
"++i is sometimes faster than, and is never slower than, i++"

still generates the same code.

【在 s******n 的大作中提到】
: 他的意思是假设是operator重载
: ++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
: 设编译无优化)
: 大家看有道理吗?
: I did a real test on arm compiler turn off optimization:
: the O0 code is exactly the same, except that post operator++()(int dummy)
: has an extra dummy parameter which is required by c++ to identify the
: difference of prefix and postfix.
: 2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
: printf("%d \n", 10+ (abc++).value);

avatar
t*e
28
蓝老大半夜讲笑话?

【在 b*****e 的大作中提到】
: 30"的显示器,在正常距离使用,几秒钟之内我就能觉得它的热量了,这还是在空调房
: 内。

avatar
a*l
29
都已经假设编译器无优化了,还谈什么效率?这种问题真是可笑。有优化的条件下,这种
问题是蔑视编译器设计者的智商。

still generates the same code.

【在 s******n 的大作中提到】
: 他的意思是假设是operator重载
: ++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
: 设编译无优化)
: 大家看有道理吗?
: I did a real test on arm compiler turn off optimization:
: the O0 code is exactly the same, except that post operator++()(int dummy)
: has an extra dummy parameter which is required by c++ to identify the
: difference of prefix and postfix.
: 2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
: printf("%d \n", 10+ (abc++).value);

avatar
b*e
30
主观感觉,哪天拿个温度计测一下。

【在 t****e 的大作中提到】
: 蓝老大半夜讲笑话?
avatar
S*I
31
Of course you get the same assembly: you overloaded both ++ operators in the
exact same way. Post-increment operator should be overloaded as following:
Test Test::operator++(int postVersion){
Test temp (*this);
value++;
return temp;
}


still generates the same code.
postfix

【在 s******n 的大作中提到】
: the O0 code is exactly the same, except that post operator++()(int dummy)
: has an extra dummy parameter which is required by c++ to identify the
: difference of prefix and postfix.
: 2nd, even I change the Test& operator++() into Test operator++(), it still generates the same code.
: printf("%d \n", 10+ (abc++).value);
: sub r3, fp, #8
: mov r0, r3
: mov r1, #0 --> the dummy parameter of postfix
: bl _ZN4TestppEi
: mov r3, r0

avatar
a*a
32
兰老肤如凝脂

【在 b*****e 的大作中提到】
: 主观感觉,哪天拿个温度计测一下。
avatar
s*n
33
这个是正解了!

the

【在 S**I 的大作中提到】
: Of course you get the same assembly: you overloaded both ++ operators in the
: exact same way. Post-increment operator should be overloaded as following:
: Test Test::operator++(int postVersion){
: Test temp (*this);
: value++;
: return temp;
: }
:
:
: still generates the same code.

avatar
m*n
34
屏幕上有没有火热内容?

【在 b*****e 的大作中提到】
: 主观感觉,哪天拿个温度计测一下。
avatar
a*m
35
恩。lz代码错了。。。。

the

【在 S**I 的大作中提到】
: Of course you get the same assembly: you overloaded both ++ operators in the
: exact same way. Post-increment operator should be overloaded as following:
: Test Test::operator++(int postVersion){
: Test temp (*this);
: value++;
: return temp;
: }
:
:
: still generates the same code.

avatar
k*t
36
没注意到兰老ID里有ICE? 比较SENSITIVE 把

【在 t****e 的大作中提到】
: 蓝老大半夜讲笑话?
avatar
h*e
37
LZ代码完全写错了嘛。。。。i++肯定会有一份多余的拷贝的。。
avatar
b*e
38
测量界面主要都是白色。感觉跟画面没啥关系,这么大一坨东西都在发热。

【在 m*****n 的大作中提到】
: 屏幕上有没有火热内容?
avatar
t*g
39
对着我的24"比了一下27"的大小,发现要效果明显还是得30"。何况ebay refurb的话价
钱差不多。

【在 n*****s 的大作中提到】
: 2711?
avatar
t*g
40
typical 163W而已,面前放两个灯泡你舜间觉得热?

【在 b*****e 的大作中提到】
: 测量界面主要都是白色。感觉跟画面没啥关系,这么大一坨东西都在发热。
avatar
s*s
41
30"色彩比较好的都太贵

【在 t****g 的大作中提到】
: 对着我的24"比了一下27"的大小,发现要效果明显还是得30"。何况ebay refurb的话价
: 钱差不多。

avatar
t*g
42
3008wfp算可以了吧,ebay refurb after bcb/ebucks $800,还算affordable。
不过我下半年估计也要搬家,不想太折腾。

【在 s**********s 的大作中提到】
: 30"色彩比较好的都太贵
avatar
b*e
43
163W都不觉得热啊?而且这是一直开着,你从远处环境温度走到两大灯泡前,肯定能感
觉出来。

【在 t****g 的大作中提到】
: typical 163W而已,面前放两个灯泡你舜间觉得热?
avatar
a*a
44
到底这个好?还是弄俩2408好?

【在 t****g 的大作中提到】
: 3008wfp算可以了吧,ebay refurb after bcb/ebucks $800,还算affordable。
: 不过我下半年估计也要搬家,不想太折腾。

avatar
t*g
45
两个灯泡是因为有IR radiation.
你把两个灯泡装铁皮盒子里再试试。

【在 b*****e 的大作中提到】
: 163W都不觉得热啊?而且这是一直开着,你从远处环境温度走到两大灯泡前,肯定能感
: 觉出来。

avatar
b*e
46
这铁皮盒子后面还有散热系统把热量弄出来。
我们治疗台显示器后面就没啥空间了,热量直接就从显示器上下反射到前面来。

【在 t****g 的大作中提到】
: 两个灯泡是因为有IR radiation.
: 你把两个灯泡装铁皮盒子里再试试。

avatar
t*e
47
我是已经习惯了两个 20" 4:3 的,觉得比一个宽屏幕的用起来方便。

【在 a***a 的大作中提到】
: 到底这个好?还是弄俩2408好?
avatar
t*g
48
那就是你们治疗台的问题了。另外你sure不是别的仪器发热或者你发烧了?

【在 b*****e 的大作中提到】
: 这铁皮盒子后面还有散热系统把热量弄出来。
: 我们治疗台显示器后面就没啥空间了,热量直接就从显示器上下反射到前面来。

avatar
t*g
49
看你自己了,我不喜欢画面中间有阻断。

【在 a***a 的大作中提到】
: 到底这个好?还是弄俩2408好?
avatar
b*e
50
我也不能一到那里就发烧吧。别的显示器都有段距离,应该不会。
治疗台上的显示器离脸部距离很短,比我一般用电脑距离还短,初步估计可能也就40cm
左右,所以觉得热浪习习。

【在 t****g 的大作中提到】
: 那就是你们治疗台的问题了。另外你sure不是别的仪器发热或者你发烧了?
avatar
t*g
51
ft, 40cm看30"的,i 服了 u。
我的24"都是隔着1米用,所以才觉得不够大,换成30"就有望能把脚丫子翘到桌上灌水
了。刚刚试了试凑上去大概40cm左右,确实能感觉到热。

40cm

【在 b*****e 的大作中提到】
: 我也不能一到那里就发烧吧。别的显示器都有段距离,应该不会。
: 治疗台上的显示器离脸部距离很短,比我一般用电脑距离还短,初步估计可能也就40cm
: 左右,所以觉得热浪习习。

avatar
b*e
52
这治疗台的确窄了点,这么大显示器我看得晕,好在我不需要一天到晚面对之。

【在 t****g 的大作中提到】
: ft, 40cm看30"的,i 服了 u。
: 我的24"都是隔着1米用,所以才觉得不够大,换成30"就有望能把脚丫子翘到桌上灌水
: 了。刚刚试了试凑上去大概40cm左右,确实能感觉到热。
:
: 40cm

avatar
a*a
53
肯定不是一个窗口extend啊
比如双屏操作的LR(LR专门为此设计)
或者一个LR,一个PS

【在 t****g 的大作中提到】
: 看你自己了,我不喜欢画面中间有阻断。
avatar
t*g
54
嗯,这个是双屏好,不过更多的时候还是需要一个大屏。

【在 a***a 的大作中提到】
: 肯定不是一个窗口extend啊
: 比如双屏操作的LR(LR专门为此设计)
: 或者一个LR,一个PS

avatar
v*a
55
你老又长草大屏了

【在 t****g 的大作中提到】
: 嗯,这个是双屏好,不过更多的时候还是需要一个大屏。
avatar
x5
56
那可不,再烤就成bluewater了

【在 a***a 的大作中提到】
: bso嫩
avatar
t*g
57
最近比较憋屈,总想烧点啥。无奈手上就那么点钱,不能乱烧,算来算去不知道烧啥好。

【在 v***a 的大作中提到】
: 你老又长草大屏了
avatar
v*a
58
换国车

好。

【在 t****g 的大作中提到】
: 最近比较憋屈,总想烧点啥。无奈手上就那么点钱,不能乱烧,算来算去不知道烧啥好。
avatar
t*g
59
没预算呀,就打算3位数烧烧。
算了,还是等网板吧。

【在 v***a 的大作中提到】
: 换国车
:
: 好。

avatar
M*n
60
俺对俺的2407HC挺满意的

【在 t****g 的大作中提到】
: 我深刻的觉得现在有必要一次到位来个30"的。
: 显示器比起主机来还是保值,而且钱也花得值。

avatar
M*n
61
如果要正儿八经测gamut,该怎么办?

【在 a***a 的大作中提到】
: 显示器大,gamut宽,看着是爽
: 最近在2410上重新看5D以前的原片,tmd震撼了

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。