avatar
NY AUD也出来了!# Accounting - 会计审计
h*s
1
需要copy并notorize护照的那些页呢?首页加所有出入境页?我需要在file 2009 tax
return的时候才能满足183天测试,但父母现在就要回国,是不是应该先把他们的护照c
opy并公证了,等明年交税时再用?
avatar
b*9
2
青藻如烟锁龙殿
澹海苍茫涤金垣
千帆度尽不足羡
且倚白云戏碧鸳
avatar
w*m
3
both works fine. Thank lipid for the igo maps.
Maybe it's time to create my favorite skin.
avatar
g*s
4
多少行的函数就没必要inline了?
在改一个程序。.h里的inline函数太多,稍微改动一下就要重新编译半天,很烦。想直
接全挪到.cpp
里去。
avatar
s*d
5
大家去查吧,祝你们好运!
avatar
c*7
6
公证首页就够了。
avatar
s*t
7
加一个积分

【在 b*********9 的大作中提到】
: 青藻如烟锁龙殿
: 澹海苍茫涤金垣
: 千帆度尽不足羡
: 且倚白云戏碧鸳

avatar
c*x
8
呵呵,好skin不好找啊。
avatar
P*e
9
要看使用频率吧.
也没省多少.exe还变大.

【在 g*********s 的大作中提到】
: 多少行的函数就没必要inline了?
: 在改一个程序。.h里的inline函数太多,稍微改动一下就要重新编译半天,很烦。想直
: 接全挪到.cpp
: 里去。

avatar
V*r
10
求LZ AUD经验
avatar
w*m
11
skin的主要功能是什么呀?除了launch gps software外是不是还要加些media player
这类的?

【在 c**x 的大作中提到】
: 呵呵,好skin不好找啊。
avatar
M*u
12
不一定省时间

【在 g*********s 的大作中提到】
: 多少行的函数就没必要inline了?
: 在改一个程序。.h里的inline函数太多,稍微改动一下就要重新编译半天,很烦。想直
: 接全挪到.cpp
: 里去。

avatar
K*Q
13
怎么样安装tomtom? 能分享一下那个版本吗?我的痛哦明天哦买提示找不到地图。谢
avatar
S*I
14
这个问题compiler说了算。

【在 g*********s 的大作中提到】
: 多少行的函数就没必要inline了?
: 在改一个程序。.h里的inline函数太多,稍微改动一下就要重新编译半天,很烦。想直
: 接全挪到.cpp
: 里去。

avatar
K*Q
15
怎么样安装tomtom? 能分享一下那个版本吗?我的痛哦明天哦买提示找不到地图。谢
avatar
g*s
16
compiler的准则是啥?

【在 S**I 的大作中提到】
: 这个问题compiler说了算。
avatar
S*I
17
这你得去看compiler的文档。

【在 g*********s 的大作中提到】
: compiler的准则是啥?
avatar
g*s
18
i don't care about the implementation details.
there should just be some principles, i guess. do you know?
in addition, i don't think compiler can change an in-class defined method
to be non-inline.

【在 S**I 的大作中提到】
: 这你得去看compiler的文档。
avatar
M*u
19
read C++ faq

【在 g*********s 的大作中提到】
: i don't care about the implementation details.
: there should just be some principles, i guess. do you know?
: in addition, i don't think compiler can change an in-class defined method
: to be non-inline.

avatar
t*t
20
keyword "inline" is like keyword "register". they are HINT, not restriction.

【在 g*********s 的大作中提到】
: i don't care about the implementation details.
: there should just be some principles, i guess. do you know?
: in addition, i don't think compiler can change an in-class defined method
: to be non-inline.

avatar
p*p
21
现在64位的编译器非常aggressive,不管你要不要,所以不用多想了。
avatar
g*s
22
but if you put the method in .h with inline, it is always honored, isn't
it?

restriction.

【在 t****t 的大作中提到】
: keyword "inline" is like keyword "register". they are HINT, not restriction.
avatar
S*I
23
of course not

【在 g*********s 的大作中提到】
: but if you put the method in .h with inline, it is always honored, isn't
: it?
:
: restriction.

avatar
t*t
24
i said it's a hint.

【在 g*********s 的大作中提到】
: but if you put the method in .h with inline, it is always honored, isn't
: it?
:
: restriction.

avatar
g*s
25
so if you put the following in class_x.h that is included by a couple of
.cpp, the compiler possibly treats X::f() as non-inline? Isn't that an ODR
violation?
// class_x.h
class X {
public:
void f();
}
inline
void X::f(){}

【在 t****t 的大作中提到】
: i said it's a hint.
avatar
t*t
26
that's not your concern.

【在 g*********s 的大作中提到】
: so if you put the following in class_x.h that is included by a couple of
: .cpp, the compiler possibly treats X::f() as non-inline? Isn't that an ODR
: violation?
: // class_x.h
: class X {
: public:
: void f();
: }
: inline
: void X::f(){}

avatar
g*s
27
more confused now.
so inline keyword is a message from the coder to the compiler about two
things: 1) code expansion, which is a suggestion. the compiler can
either honor it or not; 2) external linkage, which is a requirement.
otherwise odr is violated.
but if the compiler doesn't honor 1), how could it meet 2)?
the following article says inline functions by default have external
linkage. is it possible to use another type of linkage? how?
http://stackoverflow.com/questions/4193639/inline-function-link
When the function in the header is not inline, then multiple definitions
of this function (e.g. in multiple translation units) is a violation of
ODR rules.
Inline functions by default have external linkage. Hence, as a
consequence of ODR rules (given below), such multiple definitions (e.g.
in multiple translation units) are Okay:
$3.2/5- "There can be more than one definition of a class type (Clause
9), enumeration type (7.2), inline function with external linkage
(7.1.2), class template (Clause 14), non-static function template
(14.5.6), static data member of a class template (14.5.1.3), member
function of a class template (14.5.1.1), or template specialization for
which some template parameters are not specified (14.7, 14.5.5) in a
program provided that each definition appears in a different translation
unit, and provided the definitions satisfy the following requirements.
Given such an entity named D defined in more than one translation unit,
then each definition of D shall consist of the same sequence of tokens;
and [...]
How the linker treats inline functions is a pretty much implementation
level detail. Suffice it to know that the implementation accepts such
mulitple defintions within the limitations of ODR rules
Note that if the function declaration in header is changed to 'static
inline....', then the inline function explicitly has internal linkage
and each translation unit has it's own copy of the static inline
function.

of
ODR

【在 g*********s 的大作中提到】
: so if you put the following in class_x.h that is included by a couple of
: .cpp, the compiler possibly treats X::f() as non-inline? Isn't that an ODR
: violation?
: // class_x.h
: class X {
: public:
: void f();
: }
: inline
: void X::f(){}

avatar
g*s
28
my concerns are:
1) is inline always a hint, or in some situation a requirement.
2) how much time could it save if the hint is honored.

【在 t****t 的大作中提到】
: that's not your concern.
avatar
t*t
29
inline is a property of function. that is fixed.
whether the compiler actually do expand the function body or not is solely
the decision of compiler.
as for "external" requirement, it doesn't mean the compiler has to export a
function. external solely means the name can be referred within other
translation units. any implementation satisfying that is ok.

【在 g*********s 的大作中提到】
: my concerns are:
: 1) is inline always a hint, or in some situation a requirement.
: 2) how much time could it save if the hint is honored.

avatar
y*d
30

C++的compiler比你想象的神奇得多
in class defined照样可以给你搞成不inline
所有90年代以后的C++ compiler (准确的说是linker)都能处理一个函数在多个
compiling unit里出现多个版本的问题(为了支持template)。in class的function搞成非
inline,一点难度都没有

【在 g*********s 的大作中提到】
: i don't care about the implementation details.
: there should just be some principles, i guess. do you know?
: in addition, i don't think compiler can change an in-class defined method
: to be non-inline.

avatar
y*d
31

a
前半段勉强说得通
后半段不对
extern和export是两码事
extern是说declare不define/implement一个variable
whether a symbol can be referred from another compiling unit在C语言里是由
static决
定的,by default所有东西都是全局可见,加了static只在当前unit可见。
你的"external"我没听说过,VC里有个叫export的东西,跟你说的有点像,是控制dll
的符号在外面能
不能看见

【在 t****t 的大作中提到】
: inline is a property of function. that is fixed.
: whether the compiler actually do expand the function body or not is solely
: the decision of compiler.
: as for "external" requirement, it doesn't mean the compiler has to export a
: function. external solely means the name can be referred within other
: translation units. any implementation satisfying that is ok.

avatar
y*d
32

ODR是说你不能乱来,不是说compiler不能
举个例子
template
T add(const T& a, const T& b)
{
return a+b;
}
这个函数你放在.h里,有十个cpp里用过add()
那就有十个.o或者.obj都含有add
但是link的时候,会把多余的干掉
80年代的template实现要把所有的function都inline,还不吃static variable
但是90年代以后编译器就已经灰墙强悍了
ODR是为了帮你检查错误,怕你写了两个不同的define
对编译器自己,没这么多规矩
再举个例子,有虚函数的class都有个vtable
override和rtti都靠这个
请问这个vtable是在哪个.o里?
答案是每个.o里都有一个。因为编译器编译这个文件的时候,不知道别的.o里是否已经
有了,所以只能
是先放进去一个再说
然后呢?
link的时候,编译器会删掉多余的,只留一个

【在 g*********s 的大作中提到】
: so if you put the following in class_x.h that is included by a couple of
: .cpp, the compiler possibly treats X::f() as non-inline? Isn't that an ODR
: violation?
: // class_x.h
: class X {
: public:
: void f();
: }
: inline
: void X::f(){}

avatar
y*d
33

省多少时间,取决于你的编译器和你具体的程序,难说得很
有时候是dramatic的,多数情况下意思不大

【在 g*********s 的大作中提到】
: 多少行的函数就没必要inline了?
: 在改一个程序。.h里的inline函数太多,稍微改动一下就要重新编译半天,很烦。想直
: 接全挪到.cpp
: 里去。

avatar
t*t
34
i didn't mean extern-> export, OP implied that. by "external" i (and OP)
meant external linkage. by contrast, function/object with static keyword is
internal linkage, auto objects has no linkage.
for C, mostly that's the case. but for c++, linkage rules are more
complicated, since you have const, inline, anonymous namespace, etc.
the "export" my previous post is not VC export. it's merely some
implementation term. as for you said "extern是说declare不define/implement一
个variable", that's of course not correct. you may say "extern int i=1;",
which is a declaration AND a definition.

dll

【在 y*d 的大作中提到】
:
: 省多少时间,取决于你的编译器和你具体的程序,难说得很
: 有时候是dramatic的,多数情况下意思不大

avatar
y*d
35

g++ says:
warning: 'i' initialized and declared 'extern'
你用的啥诡异compiler

【在 t****t 的大作中提到】
: i didn't mean extern-> export, OP implied that. by "external" i (and OP)
: meant external linkage. by contrast, function/object with static keyword is
: internal linkage, auto objects has no linkage.
: for C, mostly that's the case. but for c++, linkage rules are more
: complicated, since you have const, inline, anonymous namespace, etc.
: the "export" my previous post is not VC export. it's merely some
: implementation term. as for you said "extern是说declare不define/implement一
: 个variable", that's of course not correct. you may say "extern int i=1;",
: which is a declaration AND a definition.
:

avatar
t*t
36
that's not a good practice, i am just showing an example. you may try "
extern const int = 1; ".

【在 y*d 的大作中提到】
:
: g++ says:
: warning: 'i' initialized and declared 'extern'
: 你用的啥诡异compiler

avatar
g*e
37
只有测试才可以告诉你。

【在 g*********s 的大作中提到】
: 多少行的函数就没必要inline了?
: 在改一个程序。.h里的inline函数太多,稍微改动一下就要重新编译半天,很烦。想直
: 接全挪到.cpp
: 里去。

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