gpt4 book ai didi

c++ - 标准 select1st 和 select2nd

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:10:37 25 4
gpt4 key购买 nike

C++11 中是否有任何标准的 select1stselect2st 等价物?
这些似乎只在 GNU CPP 中定义过.

最佳答案

对于 get 定义的所有事物:

template <std::size_t N>
constexpr auto select = [] (auto&& x) noexcept -> decltype(auto) {
return std::get<N>(std::forward<decltype(x)>(x));
};

关于c++ - 标准 select1st 和 select2nd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26196053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com