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 | |
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...
|