Redian新闻
>
考纽约 BAR 的一点体会
avatar
考纽约 BAR 的一点体会# Law - 律师事务所
h*r
1
Medical Imaging Research Scientist with Siemens Corporate Technology China
Location: Beijing, China
Job Type: Full Time
Company Description
Siemens Corporate Technology (CT) China is one of several global Siemens
Corporate Technology R&D centers. With over 350 top-quality scientist and
engineers, we stay in the forefront of first-class technical innovation, and
deliver solutions to the Siemens global family of operating companies. CT
China has proximity to the Chinese market, strong connections to the western
world, and acute awareness of new technologies. We are therefore in a
unique position to conduct advanced technical innovation to address the
needs of the Chinese market, and eventually bring technical and business
disruption to the global market.
Job Description
We are looking for colleagues with passion for innovation, which is the most
valuable trait in our team. The ideal candidate for this position should
have a doctoral degree in computer science, electrical engineering, or
biomedical engineering. In-depth R&D experience in the past may be
considered as equivalent to a Ph.D. Candidates with problem solving skills
and desire and ability to learn new technologies and apply them to
challenging problems will find a stimulating and rewarding career at Siemens
Corporate Technology China.
Responsibilities
- Conduct leading-edge research and the development of relevant biomedical
imaging applications. Most important topics include validation of biomedical
image processing and analysis algorithms, statistical modeling and data
analysis, prototyping and implementation of image and data processing
algorithms.
- Work with customers to understand data and algorithm requirements.
Skills & Qualifications
- Ph.D. in Computer Science, Electrical/Computer Engineering, or Biomedical
Engineering, with strong R&D experience in the fields of image processing,
computer vision, machine learning or data mining.
- Well versed in C\C++ and experienced in software analysis, data structure
and algorithm design and development.
- Proven record in research, innovative thinking, real world problem solving
and a hands-on, can-do mentality.
- Solid background in statistical data analysis and validation experiment
design is desirable
- Working experience in developing medical imaging applications is highly
desirable (segmentation, registration, PACS, etc.).
- Research experience in healthcare solutions is a strong plus to the
position.
- Fluent in both Chinese and English.
Candidates need to have strong interpersonal skills, be able to work
independently on problems, be an effective team player and be willing to
accept challenges and responsibility.
Contact
Please send your resume to s*******[email protected] or x********[email protected]
avatar
d*d
2
【 以下文字转载自 Military 讨论区 】
发信人: CMNIU (阿牛), 信区: Military
标 题: 丰乳肥臀是美女永远的标准
发信站: BBS 未名空间站 (Thu Jan 26 14:07:55 2012, 美东)
几千年前就这样,几千年后还是这样.为什么呢?因为一好看,哪个角度都养眼;二实
用,大人小孩都喜欢。
avatar
g*s
3
The following code has compilation errors if "-DDEBUG" is not specified.
In function `StripePainter::init_tab(std::basic_stringstd::char_traits, std::allocator >)':
inclass_static.cpp:(.text+0xb): undefined reference to
`StripePainter::colorset'
inclass_static.cpp:(.text+0x1b): undefined reference to
`StripePainter::orig_color'
inclass_static.cpp:(.text+0x23): undefined reference to
`StripePainter::colorset'
inclass_static.cpp:(.text+0x58): undefined reference to
`StripePainter::colorset'
collect2: ld returned 1 exit status
My question is why the static const int colorset_sz has no problem while
static const char orig_color and static set colorset must be
declared
again outside the class definition?
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
class StripePainter {
public:
int minStrokes(string stripes);
private:
static const char orig_color = 'A' - 1;
static const int colorset_sz = 'Z' - 'A' + 1;
static void init_tab(string stripes);
static vector > > tab;
static set colorset;
static void print_tab();
static int ch2idx(char ch) { return ch - orig_color;}
static char idx2ch(int idx) { return orig_color + idx;}
};
vector > > StripePainter::tab;
#ifdef DEBUG
set StripePainter::colorset;
const char StripePainter::orig_color;
#endif
void StripePainter::init_tab(string stripes) {
colorset.clear();
colorset.insert(orig_color);
for ( int i = 0; i < stripes.size(); ++ i ) {
colorset.insert(stripes[i]);
}
if ( !tab.empty() ) {
for ( int i = 0; i < tab.size(); ++ i ) {
for ( int j = 0; j < tab[i].size(); ++ j ) {
tab[i][j].clear();
}
}
}
tab.resize(stripes.size() + 1);
for ( int i = 0; i < tab.size(); ++ i ) {
tab[i].resize(stripes.size());
for ( int j = 0; j < tab[i].size(); ++ j ) {
tab[i][j].resize(colorset_sz, INT_MAX);
}
}
}
int main (int argc, const char* argv[]) {
if ( argc != 2 ) {
return -1;
}
}
avatar
c*e
4
那位好心帅哥美女可以share一下吗。
正在做本科学校的credential evaluation, NCEES要求简单的英文课程描述。学校不
提供,只好到这看看大家有没有做过类似的。先谢谢啦
avatar
o*s
5
写了这么些,才终于说到 BAR EXAM 最重要的部分,MBE。MBE是200道选择题,考试时
间6小时,所以平均每道题需时大约100秒。 这其中有不少题很长,几乎半页纸。要在
100来秒时间里,读题干及备选答案,思考并作出判断,确实是相当不容易。再加上题
总体来说比较偏,更增加了难度。从科目来讲,MBE涵盖了六门课:Tort, Contract,
Constitutional Law, Criminal Law and Procedure, Evidence, 和 Property。为什
么说MBE是最重要的部分呢?因为这六门课,NY TEST 也是要考的。所以精细准备了MBE
, 实际 NY TEST 也准备了1/3。另外,MBE是全国统考,在一定的限制之下,是可以用
在不同州的总分里的。比如我在今年七月,周二考 NY TEST 和MPT,周三考 MBE, 周
四考 NEW JERSEY TEST,最后算总分时,MBE在纽约占40%, 在新泽西占50%,被用了两
次。有时甚至以前考的MBE可以再次使用,比如我有一位朋友两年前考了南方某州的律
师资格,后来需要纽约的执照,他就只须参加 NY TEST 和 MPT 即可,MBE的成绩可以
直接用上次的。而实际上这位朋友只准备了两个星期的 NY TEST, 就通过了纽约的BAR
EXAM。
MBE这六门课,和大多数法学院一年级的必修课有很大的重合,一般来说,Contract,
Tort, ConLaw, Property, CrimLaw 都是一年级必修的。在我们学校, Evidence 是二
年级必修,我倒是从没在法学院学过CrimPro。 总体来说,对拿到JD的人来说,MBE的
很多内容实际是已经学过的。但是首先是许多都忘掉了,其次是MBE 和法学院的偏重及
涵盖很不一样。比如说我法学院PROPERTY课就完全没讲 Rule Against Perpetuity,到
了MBE时间,我几乎没让这个RAP折腾昏过去。
对于正在准备考试的同学,我建议要争取在第一次复习的时候就把比较难的知识点搞清
楚,即使没记住,也先弄明白了。 过些日子做些题,就可以针对自己的弱点加强记忆
。有些东西确实比较麻烦,比如RAP, 比如CONTRACT里的MAILBOX RULE,在比如
EVIDENCE里的HEARSAY。 对这些,最好自己专门总结一下。对于正在上法学院的同学,
建议先建立起一个战略上的藐视,BAR EXAM 其实不过尔尔。也没必要事先担心事先准
备,也没必要为了 BAR EXAM 专门在选课上为难自己,不管这个科目在法学院学没学,
准备 BAR的时候都要费一些力气,只是略多略少的区别而已。考完最后的期末考试,先
放松一两周也不迟。要是真想笨鸟先飞,就找点BARBRI MBE 的录音,或者是一年级课
程的录音来听听,恢复一下记忆,真正准备起来是可以轻松一点。
avatar
j*a
6
说你瘦你还不信

【在 d********d 的大作中提到】
: 【 以下文字转载自 Military 讨论区 】
: 发信人: CMNIU (阿牛), 信区: Military
: 标 题: 丰乳肥臀是美女永远的标准
: 发信站: BBS 未名空间站 (Thu Jan 26 14:07:55 2012, 美东)
: 几千年前就这样,几千年后还是这样.为什么呢?因为一好看,哪个角度都养眼;二实
: 用,大人小孩都喜欢。

avatar
X*r
7
9.4.2 Static data members
2 The declaration of a static data member in its class
definition is not a definition and may be of an incomplete
type other than cv-qualified void. A definition shall be
provided for the static data member if it is used in the
program.
...
4 If a static data member is of const integral or const
enumeration type, its declaration in the class definition
can specify a constant-initializer which shall be an
integral constant expression. In that case, the member
can appear in integral constant expressions within its
scope. The member shall still be defined in a namespace
scope if it is used in the program and the namespace scope
definition shall not contain an initializer.

specified.

【在 g*********s 的大作中提到】
: The following code has compilation errors if "-DDEBUG" is not specified.
: In function `StripePainter::init_tab(std::basic_string: std::char_traits, std::allocator >)':
: inclass_static.cpp:(.text+0xb): undefined reference to
: `StripePainter::colorset'
: inclass_static.cpp:(.text+0x1b): undefined reference to
: `StripePainter::orig_color'
: inclass_static.cpp:(.text+0x23): undefined reference to
: `StripePainter::colorset'
: inclass_static.cpp:(.text+0x58): undefined reference to

avatar
h*o
8
同问,有学校不提供的怎么办。我的本科学校已经明确告诉我不提供了。
avatar
M*e
9
哼!

【在 j*a 的大作中提到】
: 说你瘦你还不信
avatar
g*s
10
so const char is not considered as const integral type?

【在 X****r 的大作中提到】
: 9.4.2 Static data members
: 2 The declaration of a static data member in its class
: definition is not a definition and may be of an incomplete
: type other than cv-qualified void. A definition shall be
: provided for the static data member if it is used in the
: program.
: ...
: 4 If a static data member is of const integral or const
: enumeration type, its declaration in the class definition
: can specify a constant-initializer which shall be an

avatar
b*a
11
自己写啊,大部分课程网上都有中文简介的

【在 h****o 的大作中提到】
: 同问,有学校不提供的怎么办。我的本科学校已经明确告诉我不提供了。
avatar
d*r
12
自私的基因一书里说了
基因的本能就是延续下一代
丰乳肥臀都带表了女人的生殖能力,所以被男人看好
至于什么是美丽男人的标准,看丫头最看重的是什么就知道了。
avatar
e*d
13
what kind of compiler do you use? static const char should be
able to define in class.

【在 g*********s 的大作中提到】
: so const char is not considered as const integral type?
avatar
h*o
14
這個需要蓋章嗎?只有成績單蓋章可以嗎?

【在 b********a 的大作中提到】
: 自己写啊,大部分课程网上都有中文简介的
avatar
s*q
15
美女,没有样子怎么叫美。俺对样子最感兴趣

【在 d********d 的大作中提到】
: 【 以下文字转载自 Military 讨论区 】
: 发信人: CMNIU (阿牛), 信区: Military
: 标 题: 丰乳肥臀是美女永远的标准
: 发信站: BBS 未名空间站 (Thu Jan 26 14:07:55 2012, 美东)
: 几千年前就这样,几千年后还是这样.为什么呢?因为一好看,哪个角度都养眼;二实
: 用,大人小孩都喜欢。

avatar
b*e
16
const char is not const integral type in g++

【在 e****d 的大作中提到】
: what kind of compiler do you use? static const char should be
: able to define in class.

avatar
j*4
17
也在苦恼当中,不知道有没有好人提供下
avatar
G*U
18
人品性格最关键了。
除非是看照片。

【在 d********d 的大作中提到】
: 【 以下文字转载自 Military 讨论区 】
: 发信人: CMNIU (阿牛), 信区: Military
: 标 题: 丰乳肥臀是美女永远的标准
: 发信站: BBS 未名空间站 (Thu Jan 26 14:07:55 2012, 美东)
: 几千年前就这样,几千年后还是这样.为什么呢?因为一好看,哪个角度都养眼;二实
: 用,大人小孩都喜欢。

avatar
g*s
19
yes i'm using g++ 4.4.3.
so "static const char orig_char = '@'" in the class definition is not a
definition but a declaration, according to 2nd floor's comments?
if so what is the definition and what is the declaration for variables?
isn't the one with the initializer a definition?
totally confused here.

【在 b*****e 的大作中提到】
: const char is not const integral type in g++
avatar
h*o
20
网上搜到不少英文课程描述,不知道拷贝会不会被NCEES查。
avatar
Y*2
21
有人就喜欢瘦子

【在 d********d 的大作中提到】
: 【 以下文字转载自 Military 讨论区 】
: 发信人: CMNIU (阿牛), 信区: Military
: 标 题: 丰乳肥臀是美女永远的标准
: 发信站: BBS 未名空间站 (Thu Jan 26 14:07:55 2012, 美东)
: 几千年前就这样,几千年后还是这样.为什么呢?因为一好看,哪个角度都养眼;二实
: 用,大人小孩都喜欢。

avatar
g*s
22
in addition, why static const integral type needs such a special
treatment? it is really challenging to remember all of these special
cases.

【在 g*********s 的大作中提到】
: yes i'm using g++ 4.4.3.
: so "static const char orig_char = '@'" in the class definition is not a
: definition but a declaration, according to 2nd floor's comments?
: if so what is the definition and what is the declaration for variables?
: isn't the one with the initializer a definition?
: totally confused here.

avatar
h*o
23
NCEES要课程简介的目的是什么?如果课程名称和课时(学分)数都满足要求,难道如
果课程简介的内容不够,还要打折扣吗?
avatar
Y*2
24
我最看重什么?

【在 d**********r 的大作中提到】
: 自私的基因一书里说了
: 基因的本能就是延续下一代
: 丰乳肥臀都带表了女人的生殖能力,所以被男人看好
: 至于什么是美丽男人的标准,看丫头最看重的是什么就知道了。

avatar
e*d
25
My gcc 4.4.5 doesn't have any problem to define static const char variable
in class.

【在 b*****e 的大作中提到】
: const char is not const integral type in g++
avatar
M*e
26
good in bed?

【在 Y*****2 的大作中提到】
: 我最看重什么?
avatar
b*e
27
strange. I am using gcc/g++ 4.4.1 and the problem is still there.

【在 e****d 的大作中提到】
: My gcc 4.4.5 doesn't have any problem to define static const char variable
: in class.

avatar
Y*2
28
哦算是吧

【在 M**e 的大作中提到】
: good in bed?
avatar
e*d
29
You can always define static class data members outside the class.
This specifical case just gives you some convinience.

【在 g*********s 的大作中提到】
: in addition, why static const integral type needs such a special
: treatment? it is really challenging to remember all of these special
: cases.

avatar
M*e
30
actually that's not enough though
you will not marry a male prostitute, will you?

【在 Y*****2 的大作中提到】
: 哦算是吧
avatar
g*s
31
why it is "defined" out of the class while "declared" in the class?
i thought the outside one was declared, while the inside one is defined.
how do we distinguish "declared" and "defined" variables through some rule
of thumb?
for function it's very clear. but for variables, i'm totally lost now.

【在 e****d 的大作中提到】
: You can always define static class data members outside the class.
: This specifical case just gives you some convinience.

avatar
Y*2
32


【在 M**e 的大作中提到】
: actually that's not enough though
: you will not marry a male prostitute, will you?

avatar
e*d
33
Declaration allows name lookup to find the entity.
Definition defines the entity.
A definition can also be a declaration.
You declare a static data member in a class and define it outside the class.
One definition rule doesn't allow you define a static data member
in a class becuase multiple includes will violate the ODR.

【在 g*********s 的大作中提到】
: why it is "defined" out of the class while "declared" in the class?
: i thought the outside one was declared, while the inside one is defined.
: how do we distinguish "declared" and "defined" variables through some rule
: of thumb?
: for function it's very clear. but for variables, i'm totally lost now.

avatar
x*o
34
你让人家怎么答?

【在 M**e 的大作中提到】
: actually that's not enough though
: you will not marry a male prostitute, will you?

avatar
g*s
35
sorry, i'm more confused.
1. the initializer should go with declaration or definition, or it
doesn't matter?
it's ok to have:
a.cpp: int x = 0; // definition.
b.cpp: extern int x; // declaration.
but is it ok to have the following?
a.cpp: int x; // definition.
b.cpp: extern int x = 0; // declaration.
2. why definition of a static variable in a class violates the ODR?
because we can define a static integral variable in a class, it seems
not a problem to allow any static variable to be defined in the class,
doesn't it?
4. why it's OK to have a definition of a function in a class? b/c
function definitions are "static" in the nature, aka, the code is shared
by all objects of this class?

class.

【在 e****d 的大作中提到】
: Declaration allows name lookup to find the entity.
: Definition defines the entity.
: A definition can also be a declaration.
: You declare a static data member in a class and define it outside the class.
: One definition rule doesn't allow you define a static data member
: in a class becuase multiple includes will violate the ODR.

avatar
e*d
36
extern int x = 0 is a definition.
Initializer means definition.
When you define a function inside a class, it's inline, which
doesn't violate the ODR.
If there are two translation units and each of them include
the class with a static data member defined in the class,
there will be two instances of this static data member in
the program, which violates ODR. const integral data member
is a special case, by which the compiler might just put the
member inside the class definition.

【在 g*********s 的大作中提到】
: sorry, i'm more confused.
: 1. the initializer should go with declaration or definition, or it
: doesn't matter?
: it's ok to have:
: a.cpp: int x = 0; // definition.
: b.cpp: extern int x; // declaration.
: but is it ok to have the following?
: a.cpp: int x; // definition.
: b.cpp: extern int x = 0; // declaration.
: 2. why definition of a static variable in a class violates the ODR?

avatar
t*t
37
actually, most things in c++ are definitions (thus also declarations).
the several cases that are declarations ONLY are:
* extern, without initializer
* function w/o body
* class/struct forward declaration
* typedef
* using
* static data member inside a class (this is where are you confused)

【在 g*********s 的大作中提到】
: sorry, i'm more confused.
: 1. the initializer should go with declaration or definition, or it
: doesn't matter?
: it's ok to have:
: a.cpp: int x = 0; // definition.
: b.cpp: extern int x; // declaration.
: but is it ok to have the following?
: a.cpp: int x; // definition.
: b.cpp: extern int x = 0; // declaration.
: 2. why definition of a static variable in a class violates the ODR?

avatar
N*m
38
最怕记这些东西了,头疼!

【在 t****t 的大作中提到】
: actually, most things in c++ are definitions (thus also declarations).
: the several cases that are declarations ONLY are:
: * extern, without initializer
: * function w/o body
: * class/struct forward declaration
: * typedef
: * using
: * static data member inside a class (this is where are you confused)

avatar
P*e
39
你记它做什么

【在 N***m 的大作中提到】
: 最怕记这些东西了,头疼!
avatar
N*m
40
得熟练阿,而且面试的时候也可能会问到。
唉,我也真够无聊的。

【在 P********e 的大作中提到】
: 你记它做什么
avatar
t*t
41
people often found that c++ has a lot of things to remember. but in fact, if
you know the reason behind them, there is actually very little to "remember
".
For example, in this case, there is only one thing to remember, which is "
one definition rule".
* extern: if you declare it extern, you most probably have definition
elsewhere. so the one with extern is not definition. however if there is
initializer, then this must be the definition, since only one initializer is
allowed.
* function w/o body: this is obvious. you must have body "defined" somewhere
else.
* forward declaration: same as function header.
* typedef: this only introduce an alias.
* using: same, alias
* static data member: class definition is meant to be included in multiple
files. if static data member is definition, then one definition rule is
violated. therefore you must defined it ("again") somewhere else.
In fact, if you know how the linker (link editor) works, then one definition
rule is a natural corollary. You don't even have to remember that.

【在 N***m 的大作中提到】
: 最怕记这些东西了,头疼!
avatar
b*e
42
这一段:
* static data member: class definition is meant to be included in multiple
files. if static data member is definition, then one definition rule is
violated. therefore you must defined it ("again") somewhere else.
- 这个 #include 不是问题吧, 用 #ifndef 。。。 #define 。。。#endif
保证了只一次的

if
remember
is
somewhere

【在 t****t 的大作中提到】
: people often found that c++ has a lot of things to remember. but in fact, if
: you know the reason behind them, there is actually very little to "remember
: ".
: For example, in this case, there is only one thing to remember, which is "
: one definition rule".
: * extern: if you declare it extern, you most probably have definition
: elsewhere. so the one with extern is not definition. however if there is
: initializer, then this must be the definition, since only one initializer is
: allowed.
: * function w/o body: this is obvious. you must have body "defined" somewhere

avatar
t*t
43
one definition rule means you define only once in MULTIPLE compilation units
.
#ifdef guard let you include a file only once in ONE compilation unit.
why a lot of people mix them? they are totally unrelated.

【在 b*****e 的大作中提到】
: 这一段:
: * static data member: class definition is meant to be included in multiple
: files. if static data member is definition, then one definition rule is
: violated. therefore you must defined it ("again") somewhere else.
: - 这个 #include 不是问题吧, 用 #ifndef 。。。 #define 。。。#endif
: 保证了只一次的
:
: if
: remember
: is

avatar
g*s
44
so if i define a class w/ static variable members in foo.h, i'll have to
create a foo.cpp file to keep the definitions of these static variables,
instead of put these definitions in foo.h?

fact, if
"remember
is "
is
initializer is
somewhere

【在 t****t 的大作中提到】
: people often found that c++ has a lot of things to remember. but in fact, if
: you know the reason behind them, there is actually very little to "remember
: ".
: For example, in this case, there is only one thing to remember, which is "
: one definition rule".
: * extern: if you declare it extern, you most probably have definition
: elsewhere. so the one with extern is not definition. however if there is
: initializer, then this must be the definition, since only one initializer is
: allowed.
: * function w/o body: this is obvious. you must have body "defined" somewhere

avatar
t*t
45
of course. any c++ textbook will mention this.

【在 g*********s 的大作中提到】
: so if i define a class w/ static variable members in foo.h, i'll have to
: create a foo.cpp file to keep the definitions of these static variables,
: instead of put these definitions in foo.h?
:
: fact, if
: "remember
: is "
: is
: initializer is
: somewhere

avatar
g*s
46
haha, never read through a c++ textbook, as the thickness always scares
me...

【在 t****t 的大作中提到】
: of course. any c++ textbook will mention this.
avatar
e*d
47
How about static data member of templates?
Isn't it defined during implicit/explicit instantiation?
Which compilation unit is responsible for it if
multiple compilation units are using it?

units

【在 t****t 的大作中提到】
: one definition rule means you define only once in MULTIPLE compilation units
: .
: #ifdef guard let you include a file only once in ONE compilation unit.
: why a lot of people mix them? they are totally unrelated.

avatar
b*e
48
But, for integral types, you can put static definitions there.
I think that's why LZ asked about the exception. That's something
in addition to the one definition rule.

【在 t****t 的大作中提到】
: of course. any c++ textbook will mention this.
avatar
t*t
49
didn't you read xentar's post? even you can write initializer to const
integral static data member, it doesn't mean you don't have to write
separate definitons.
however, in most cases, const static integral will be optimized out as
constant, and there will be no references to the symbol anymore in the link
stage. and in compilation stage, "no diagnostic required" (9.4.2 clause 5),
so in most cases you can get through without any errors. BUT, i can easily
construct a counter-example:
#include
class A {
public:
static const int a=5;
};
int main()
{
std::cout<}
By referencing the address of A::a, I force the compiler to allocate an
address for symbol A::a (i.e. I force the existence of symbol), thus
requires the definition of A::a. constant integral static data member is not
an exception of ODR.

【在 b*****e 的大作中提到】
: But, for integral types, you can put static definitions there.
: I think that's why LZ asked about the exception. That's something
: in addition to the one definition rule.

avatar
t*t
50
template is really the "exception" of ODR. Because template is basically
macro of c++ version (i.e. you have to follow c++ syntax and semantics), it
requires a "full definition" wherever you want to instantiate it; on the
other hand, ODR requires only one definition across multiple files. so in
the real world, template requires the special support of link editor to trim
down the extra copies of the same function in multiple files. for example,
GNU ld for ELF target uses "weak symbol" for template functions, and
multiple weak symbols are not considered multiple definition. other models
exists, too.

【在 e****d 的大作中提到】
: How about static data member of templates?
: Isn't it defined during implicit/explicit instantiation?
: Which compilation unit is responsible for it if
: multiple compilation units are using it?
:
: units

avatar
b*e
51
You are right & your example is great. Thanks.
But I was referring to the fact that, given:
class A {
public:
const static int a = 1;
const static char c = 'A';
};
You definitely need to define const char A::c; in your code,
but you don't need to write const int A::a; (there is danger
of not writing this, as you have pointed out).
In other words, it seems that const static int typically will be optimized
out, but const static char does not get this treatment.
ODR notwithstanding, I see there is a difference. I think your point
is, just write the definition ALWAYS.

link
,

【在 t****t 的大作中提到】
: didn't you read xentar's post? even you can write initializer to const
: integral static data member, it doesn't mean you don't have to write
: separate definitons.
: however, in most cases, const static integral will be optimized out as
: constant, and there will be no references to the symbol anymore in the link
: stage. and in compilation stage, "no diagnostic required" (9.4.2 clause 5),
: so in most cases you can get through without any errors. BUT, i can easily
: construct a counter-example:
: #include
: class A {

avatar
t*t
52
not sure what version you use, but in g++ 4.4.4 they are the same.

【在 b*****e 的大作中提到】
: You are right & your example is great. Thanks.
: But I was referring to the fact that, given:
: class A {
: public:
: const static int a = 1;
: const static char c = 'A';
: };
: You definitely need to define const char A::c; in your code,
: but you don't need to write const int A::a; (there is danger
: of not writing this, as you have pointed out).

avatar
g*s
53
4.4.3 not the same. so a bug fixed in 4.4.4?
it is said 4.4.5 ok too but 4.4.1 not.

【在 t****t 的大作中提到】
: not sure what version you use, but in g++ 4.4.4 they are the same.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。