【问题标题】:In a template method, Is there a way to check whether the current type is int-variant or float-variant?在模板方法中,有没有办法检查当前类型是 int-variant 还是 float-variant?
【发布时间】:2015-12-12 23:05:43
【问题描述】:

我想为变量实现一个模板方法。

但是根据输入是否为 int-variant(char, short, int),我想处理它与输入为 float-variant (float, double, long double) 的情况有所不同。

有没有办法做到这一点?

【问题讨论】:

    标签: c++ templates


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-07-08
      • 1970-01-01
      • 2011-02-10
      • 2010-09-06
      • 2012-01-10
      • 2022-10-24
      • 2011-05-31
      相关资源
      最近更新 更多