boost::combine

boost::combine() packs a group of variables.

#include <vector>
#include <boost/range/combine.hpp>

int main(int argc, char** argv) 
{ 
    // The ranges mush have the same size
    std::vector<int> ids = {1, 2, 3, 4};
    std::vector<std::string> names = { "A", "B", "C", "D" };
    std::vector<float> heights = { 1.71, 1.65, 1.80, 1.75 };    

    for( const auto &zipped : boost::combine(ids, names, heights) ) {
      {
        // tie()
        int id;
        std::string name;
        float height;
        boost::tie(id, name, height) = zipped;

        std::cout << id << "," << name << "," << height << std::endl;
      }
      
      {      
        // get<>()
        int id = boost::get<0>( zipped );
        std::string name = boost::get<1>( zipped );
        float height = boost::get<2>( zipped );

        std::cout << id << "," << name << "," << height << std::endl;
      }    
    }
}

Output:

1,A,1.71
1,A,1.71
2,B,1.65
2,B,1.65
3,C,1.8
3,C,1.8
4,D,1.75
4,D,1.75

Note, the boost version used in this example is 1.71.

boost::endian

Boost introduced a new library endian in version 1.58: Types and conversion functions for correct byte ordering and more regardless of processor endianness.

#include <boost/endian/conversion.hpp>

int32_t x;

... read into x from a file ...

boost::endian::big_to_native_inplace(x);

for (int32_t i = 0; i < 1000000; ++i)
  x += i;

boost::endian::native_to_big_inplace(x);

... write x to a file ...