std::vector::insert (...) with reverse iterator on SunStudio RW STL

std::vector::insert (...) in SunStudio's RW STL, does not support reverse iterator, a workaround is to use std::copy (...) and back_inserter (...) instead, as following,

-    dest.insert (dest.end(), src.rbegin(), src.rend());
+    std::copy (src.rbegin(),src.rend(),back_inserter(dest));

4 thoughts on “std::vector::insert (...) with reverse iterator on SunStudio RW STL

  1. Hi Yong Sun,
    you don't need that hack, just compile your C++ code with "-library=stlport4"

  2. ah pity, IHMO that roguewaves stuff should go away (or at least be made optional, with stlport4 as the new default), it's dog slow (see Solaris Application Programming by Darryl Gove, chapter 7.3.5 STLport4) and well, as you already noticed, incomplete

  3. I hate Rogues Wave, why does Sun still keep this old slow thing?
    For the simplest "cout << xxx << endl;", you can truss it to see how many unnecessary syscalls it generate...

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha