小编kin*_*lar的帖子

C++11:boost::make_tuple 与 std::make_tuple 有何不同?

http://en.cppreference.com/w/cpp/utility/tuple/make_tuple (为了方便起见,粘贴了代码)

#include <iostream>
#include <tuple>
#include <functional>

std::tuple<int, int> f() // this function returns multiple values
{
    int x = 5;
    return std::make_tuple(x, 7); // return {x,7}; in C++17
}

int main()
{
    // heterogeneous tuple construction
    int n = 1;
    auto t = std::make_tuple(10, "Test", 3.14, std::ref(n), n);
    n = 7;
    std::cout << "The value of t is "  << "("
              << std::get<0>(t) << ", " << std::get<1>(t) << ", "
              << std::get<2>(t) << ", " << std::get<3>(t) …
Run Code Online (Sandbox Code Playgroud)

c++ boost c++11

2
推荐指数
1
解决办法
2012
查看次数

标签 统计

boost ×1

c++ ×1

c++11 ×1