gpt4 book ai didi

c++ - 模板模板参数的部分实例化

转载 作者:太空狗 更新时间:2023-10-29 21:37:26 25 4
gpt4 key购买 nike

假设我构建了一个带有模板参数的类模板:

template<template<typename> class A> class B;

现在我想进行实例化,例如 A作为采用 int 的函数(例如,对于像 template<class T> void f(int) 这样的参数)。有什么办法吗?

最佳答案

没有。 Template template arguments不能与函数模板一起使用。

A template argument for a template template parameter must be an id-expression which names a class template or a template alias.

关于c++ - 模板模板参数的部分实例化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37699627/

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