You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
786 B

  1. #include "BoostWorkaround/boost/tuple/tuple.hpp"
  2. struct another
  3. {int dummy;};
  4. boost::tuple<unsigned,unsigned,unsigned> first;
  5. boost::tuple<int,float,double,bool,another> second;
  6. boost::tuple<> third;
  7. boost::tuple<float,float,float> last;
  8. void test () {
  9. // Implicit conversion
  10. first = boost::make_tuple(4,4,4);
  11. // FIXME: Explicit conversion not really required yet
  12. last = (boost::tuple<float,float,float>)boost::make_tuple(4.,4.,4.);
  13. // Non-const access
  14. first.get<0>() = 1;
  15. first.get<1>() = 2;
  16. first.get<2>() = 3;
  17. float f = last.get<2>();
  18. bool b = second.get<3>();
  19. // Const cases
  20. const boost::tuple<unsigned,unsigned,unsigned> constant = boost::make_tuple(4,4,4);
  21. first.get<0>() = constant.get<0>();
  22. // Direct assignment w. explicit conversion
  23. last = first;
  24. }