Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) boost::tuples::tie

 

Tiers are tuples, where all elements are of non-const reference types. boost::tuples::tie is like a std::make_pair for tuples.

 

#include <cassert>
#include <string>
#include <boost/tuple/tuple.hpp>

int main()
{
  int i = 0;
  double d = 0.0;
  std::string s;
  boost::tuples::tie(i,d,s) = boost::tuples::make_tuple(1,1.1,"x");
  assert(i == 1);
  assert(d == 1.1);
  assert(s == "x");
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict