Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C++ strings

Name: Anonymous 2012-11-20 15:55

Why do i want to pass strings by reference in c++?

As i understand it, a string object is just an object
that has one or several pointers to the heap.

So if i pass a string by value, it won't copy the entire string, just this handle object.
It's that cool?

Name: Anonymous 2012-11-20 16:01

Depends on said std::string implementation. Passing by const-ref ensures no expensive copy/allocation.

Name: Anonymous 2012-11-20 16:01

>>1
That's not how the std::string copy constructor is defined.

Name: Anonymous 2012-11-20 16:29

Sorry, i was retarded...

/OP

Name: Anonymous 2012-11-20 17:32

was?

Name: Anonymous 2012-11-20 17:53

>>5
I is retarded?

Name: Anonymous 2012-11-20 18:22

>>5`
>2012 not being a former retard

LOL le /backseat bop/ ``faggot''

Name: Anonymous 2012-11-20 18:36

>>7
EPIC GREENTEXT

LE

FUCKING

EPIN XDDDDDDDDD

Don't change these.
Name: Email:
Entire Thread Thread List