skip to main
|
skip to sidebar
davide
Wednesday, April 09, 2008
convert std::iterator to int index
#include <vector> ;
#include <algorithm> ;
std::vector<double> a;
a.push_back(3.); a.push_back(5.); a.push_back(9.);
std::vector
::iterator it = std::find(a.begin(),a.end(),9.);
int index = it - a.begin();
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2010
(3)
►
November
(1)
►
July
(1)
►
March
(1)
►
2009
(13)
►
November
(1)
►
July
(1)
►
June
(1)
►
April
(1)
►
March
(6)
►
February
(1)
►
January
(2)
▼
2008
(18)
►
December
(1)
►
November
(1)
►
October
(6)
►
August
(1)
►
May
(2)
▼
April
(3)
connect to fnal from SLC4 laptop
convert std::iterator to int index
funny behavior TTree with vectors
►
March
(1)
►
February
(2)
►
January
(1)
►
2007
(24)
►
October
(1)
►
September
(4)
►
July
(5)
►
June
(5)
►
May
(2)
►
April
(3)
►
March
(4)
►
2006
(7)
►
May
(2)
►
April
(4)
►
March
(1)
►
2005
(1)
►
December
(1)
Contributors
davide
davide
No comments:
Post a Comment