gpt4 book ai didi

c++ - 有没有办法将 cpp 11 中的别名 std::make_pair 函数键入到 abc::make_pair?

转载 作者:行者123 更新时间:2023-11-27 23:38:57 25 4
gpt4 key购买 nike

我正在尝试键入别名 std::make_pair 函数以将其用作 abc::make_pair 函数。

auto(*make_pair)() = std::make_pair<T1, T2>;

namespace abc
{
template<class T, std::size_t N>
using array = std::array<T, N>;

template<class T1, class T2>
auto(*make_pair)() = std::make_pair<T1, T2>;
}

错误:

variable templates only available with -std=c++14 or -std=gnu++14 [-Werror]

最佳答案

namespace abc
{
using std::make_pair;
}

Demo

关于c++ - 有没有办法将 cpp 11 中的别名 std::make_pair 函数键入到 abc::make_pair?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57104244/

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