[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
g++ numerics accumulate
From: |
Dale Gerdemann |
Subject: |
g++ numerics accumulate |
Date: |
Fri, 16 Mar 2001 13:13:00 +0100 (MET) |
Hello,
Here's a little program that compiled fine at:
http://www.comeaucomputing.com/tryitout/
With g++ 2.59.2 it produces a long incomprehensible error message:
---------------------------------------------------------------------
#include <iostream>
#include <string>
#include <map>
#include <numeric>
using namespace std;
int
get_second(int val, map<string,int>::const_iterator& iter) {
return val + iter->second;
}
int
main() {
map<string,int> a;
a["foo"] = 4;
a["bar"] = 5;
a["baz"] = 6;
double d = accumulate(a.begin(), a.end(), 0, get_second);
cout << d << endl;
}
---------------------------------------------------------------------
Dale Gerdemann address@hidden
Dept. of Linguistics +49 7071-29-74967 office
Section for Computational Linguistics +49 7472-442298 home
University of Tuebingen Fax: +49 7071-551335
Kl. Wilhelmstr. 113
D-72074 Tuebingen, Germany
---------------------------------------------------------------------
- g++ numerics accumulate,
Dale Gerdemann <=