[PATCH] Move constructors and move assignment operators when compiled in C++11 mode

195 views
Skip to first unread message

Tudor Bosman

unread,
Aug 18, 2012, 8:38:37 PM8/18/12
to google-s...@googlegroups.com
I am using google-sparsehash in a project that uses gcc 4.7 and could benefit from move semantics.  I'm attaching a patch that implements this functionality; tested with gcc 4.7.0 on Fedora release 17 (Beefy Miracle).  Also included is a m4 autoconf macro to detect rvalue reference support.

Most of the diff lines come from rerunning aclocal, automake, autoconf, etc (via autoreconf -if) likely with a different version.

Thanks,
-Tudor.

0001-Add-move-constructors-move-assignment-operators.patch.bz2

labob...@gmail.com

unread,
Dec 28, 2012, 9:02:21 PM12/28/12
to google-s...@googlegroups.com
Have you done anymore work on C++11 support ?

For instance the insert function still makes unnecessary copies.

Tudor Bosman

unread,
Dec 28, 2012, 9:07:35 PM12/28/12
to google-s...@googlegroups.com
No. I would do more, but I'd like my move constructors / move assignment patch to get committed first :)

The repository hasn't had any commits since 2/23/2012, I don't know if this project is still being actively maintained any more.

-Tudor.


--
You received this message because you are subscribed to the Google Groups "google-sparsehash" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-sparsehash/-/ysA_JMKuImAJ.
To post to this group, send email to google-s...@googlegroups.com.
To unsubscribe from this group, send email to google-sparseh...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-sparsehash?hl=en.

Donovan Hide

unread,
Dec 29, 2012, 6:38:40 AM12/29/12
to google-sparsehash
Hi,

apologies for not responding at the time of the original posting! The project is definitely being supported, it's just had somewhat of a dormant period :-) 

I had a look at your patch at the time and obviously it's a bit painful to pull out the non-autotools changes. Might be worth breaking it into two patches: one for the autotools upgrade and one for the actual move to C++11. It does seem like a good point to batch together C++11 improvements, so if anyone else has some patches, please submit!

Does anyone have an opinion on using a standard macro check for C++11, rather than testing for individual features:


Also, is it possible to receive benchmark output for each change, just to confirm that the alteration does actually improve performance. 

Cheers,
Donovan.

1971 powerChina

unread,
May 7, 2015, 1:52:03 AM5/7/15
to google-s...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages