Advertisement
Guest User

C++, can not copy 2 vectors to vector of pair

a guest
Jan 19th, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <vector>
  2. #include <map>
  3. #include <algorithm>
  4.  
  5.  
  6. struct Item { double a, b; Item (double a_, double b_): a(a_), b(b_){}};
  7. typedef std::pair <double, Item> TPair;
  8. typedef std::vector <TPair> TData;
  9.  
  10.  
  11. int main(int argc, char* argv[])
  12. {
  13.     std::vector <double> t1;
  14.     std::vector <Item> t2;
  15.  
  16.     TData data;
  17.  
  18.     //Error
  19.     std::transform (t1.begin(), t1.end(), data.begin(),
  20.          std::bind2nd( std::ptr_fun( std::make_pair <double,Item > ), Item(0,0) ) );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement