Boost logo

Boost :

From: Gary Powell (powellg_at_[hidden])
Date: 2002-01-18 14:46:09


>>
 vector<int> a; vector<double> b; vector<string> c;

 tuple< vector<int>, vector<double>, vector<string> > t( a,b,c );
   // Is it the same as vector< tuple<int, double, string> >?
   // Close to? Or completely different?

 t[0] = tuple<int, double, string>( 42, 3.14, "foo" );<<
Different. Think of it as "C"
  int a[N] double b[N]; string c[N];
vs
  struct T { int a; double b; string c; };

  T t[N];

  a[j]; b[j]; c[j];

  vs
  t[j].a;
  t[j].b;
  t[j].c;

  Efficiency in time and space depends on what you want to know, and your
machine architecture. (padding etc.)
>>

  Yours,
  -gary-


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk