由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - c++ class default functions?
相关主题
C++面试问题,高人请进啊~~~One C++ question
还是基础题新Qualcomm面经
One C++ question包子呼唤大牛--问关于C++Destructor的问题 (转载)
BB phone interview question问个C++重新编译的问题
Please help on Effective C++ Item 11请教1个工作面试题
C++ Q47: protected constructor (C39)为什么C++的constructor出错可以抛出异常,而destructor出错
C++ online Test 一题面经: bloomberg 电面
问个C++题C++ Q65: recompiling (IB)
相关话题的讨论汇总
话题: default话题: operator话题: c++话题: copy
进入JobHunting版参与讨论
1 (共1页)
l********y
发帖数: 1327
1
i think there are 4, cons, destructor,copy cons, assignment operator.
but someone says there are more, like & , someone is a guy senior tech title
from IB. is this true? really confused.
r********g
发帖数: 1351
2
i agree with u...

title

【在 l********y 的大作中提到】
: i think there are 4, cons, destructor,copy cons, assignment operator.
: but someone says there are more, like & , someone is a guy senior tech title
: from IB. is this true? really confused.

l********y
发帖数: 1327
3
the IB interviewer did not agree with me...
i say 4 is 4 couldn't be more, but he said what do u think about ampersand(&
) ? i said wtf.., no I said what? can & be a default function provided by c+
+ for u to overwritten? he then said ok then we move on...

【在 r********g 的大作中提到】
: i agree with u...
:
: title

e*****e
发帖数: 1275
4

In C++03 there are 4:
*
Default constructor: Declared only if no user-defined constructor is
declared. Defined when used
*
Copy constructor - declared only if the user hasn't declared one.
Defined if used
*
Copy-assignment operator same as above
*
Destructor same as above
In C++0x there are two more:
* Move constructor
* Move-assignment operator
放狗查的,我记得也就那前面4个。
我记得有人argue过copy constructor 不算default function.
b****y
发帖数: 1867
5
there are 5.
d****2
发帖数: 6250
6

(&
c+
丫的意思是operator overload也算?IB的水平确实差。

【在 l********y 的大作中提到】
: the IB interviewer did not agree with me...
: i say 4 is 4 couldn't be more, but he said what do u think about ampersand(&
: ) ? i said wtf.., no I said what? can & be a default function provided by c+
: + for u to overwritten? he then said ok then we move on...

x***y
发帖数: 633
7
& is given too, as the address operator.
l********y
发帖数: 1327
8
那其它的operator比如>,<不都算是given的了吗?

【在 x***y 的大作中提到】
: & is given too, as the address operator.
d*****d
发帖数: 46
9
no, somebody need implement those operators, but not the address of...

【在 l********y 的大作中提到】
: 那其它的operator比如>,<不都算是given的了吗?
d*****d
发帖数: 46
10
the pairs of address-of operators are given by default as default Ctor if
you don't have one.

【在 d****2 的大作中提到】
:
: (&
: c+
: 丫的意思是operator overload也算?IB的水平确实差。

l********y
发帖数: 1327
11
really? I can use "a > b" clause in my class function without overload ">"
operator, so as "&". so what is the difference between "&" and ">" here?
they are all given by default.

【在 d*****d 的大作中提到】
: no, somebody need implement those operators, but not the address of...
1 (共1页)
进入JobHunting版参与讨论
相关主题
C++ Q65: recompiling (IB)Please help on Effective C++ Item 11
C++相关的面经C++ Q47: protected constructor (C39)
C++ online Test 一题C++ online Test 一题
小公司web server面经问个C++题
C++面试问题,高人请进啊~~~One C++ question
还是基础题新Qualcomm面经
One C++ question包子呼唤大牛--问关于C++Destructor的问题 (转载)
BB phone interview question问个C++重新编译的问题
相关话题的讨论汇总
话题: default话题: operator话题: c++话题: copy