Call ctor in place of function argument
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I have this line of code :
TargetList.push_back(CSTREAMS(*(SrcList[i])));
where
CSTREAMS
is a userdefined class and TargetList is avector
. So i'm just calling the constructor without thenew
keyword. I think this creates a temporary object, wich is copied by thevector
and then destroeyd, so no memoryleak. Is this correct ? -
I have this line of code :
TargetList.push_back(CSTREAMS(*(SrcList[i])));
where
CSTREAMS
is a userdefined class and TargetList is avector
. So i'm just calling the constructor without thenew
keyword. I think this creates a temporary object, wich is copied by thevector
and then destroeyd, so no memoryleak. Is this correct ?