Re: source-highlight on solaris?

Lorenzo Bettini <[email protected]> Wed, 21 Apr 2010 10:12:13 +0200
Newsgroups gmane.comp.gnu.source-highlight.general
Message-ID <[email protected]>
On 04/21/2010 09:21 AM, Stefan Palm wrote:
>>   it looks like that
>>
>> std::set::insert which takes two iterators is standard in stl:
>>
>> http://www.cplusplus.com/reference/stl/set/insert/
>>
>> can it be that your sparc compiler stl implementation is not standard or
>> too old?
>>
>> At the above link there's an example using insert, could you please try
>> to compile it with your sparc compiler and see whether that works?
>
> Works fine.
>
> adebld1z:/tmp>  /opt/sunstudio12.1/bin/CC example.cpp -o example.bin
> adebld1z:/tmp>  ./example.bin
> myset contains: 5 10 15 20 24 25 26 30 40 50
>
> Stefan

Stefan

please try with this other example which should mimic the same types of 
the code which generates the compiler error, and let me know

cheers
	Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net

_______________________________________________
Help-source-highlight mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-source-highlight
setexample.cpp (text/x-c++src, 841 B)
// set::insert
#include <iostream>
#include <string>
#include <set>
#include <list>
using namespace std;

typedef std::list<std::string> StringList;
typedef set<std::string> StringSet;

int main ()
{
  StringList strings;
  StringSet myset;

  strings.push_back("this");
  strings.push_back("is");
  strings.push_back("a");
  strings.push_back("test");

  cout << "strings contains:";
  for (StringList::const_iterator it=strings.begin(); it!=strings.end(); it++)
    cout << " " << *it;
  cout << endl;

  StringList *strings_p = &strings;
  StringList::const_iterator first = strings_p->begin();
  StringList::const_iterator last = strings_p->end();

  myset.insert(first, last);

  cout << "myset contains:";
  for (StringSet::const_iterator it=myset.begin(); it!=myset.end(); it++)
    cout << " " << *it;
  cout << endl;

  return 0;
}