ma740988 wrote in message
struct tp { int bytes_xferred; int offset; };
typedef std::pair<int, tp > int_tp_pair;
typedef std::vector< int_tp_pair > vec_int_tp_pair;
???
// ----------------------------------------------
#ifndef VECTTMP_H
#define VECTTMP_H
template <class T> class VecT{ // template basic 3D vector
public: // ------------------------------ public
VecT():x(0),y(0),z(0){}
VecT(T tx, T ty, T tz):x(tx),y(ty),z(tz){}
virtual ~VecT(){}
// ----------------------------------------
T x; T y; T z; // note: intentionally public
};
#endif //#ifndef VECTTMP_H
// ----------------------------------------------
std::vector<VecT<int> > IntVec(43);
for(size_t i(0); i < IntVec.size(); ++i){
IntVec.at( i ).x = i+1;
if( i < 7 ){ IntVec.at( i ).z = 50;}
else{ IntVec.at( i ).z = 100;}
} // for(i) // all .y == 0
// ----------------------------------------------
std::vector<VecT<double> > DbleVec(5, VecT<double>(1.5, 0.01, 7.7));
for(size_t i(0); i < DbleVec.size(); ++i){
cout <<"DbleVec.at(" << i << ") x="
<<DbleVec.at(i).x <<" y="<<DbleVec.at(i).y
<<" z="<<DbleVec.at(i).z <<std::endl;
}
//// DbleVec.at( /* [0-4] */ ) x=1.500000 y=0.010000 z=7.700000
// ----------------------------------------------
--
Bob R
POVrookie