【问题标题】:Declaring, iterating, searching typelists at compile time在编译时声明、迭代、搜索类型列表
【发布时间】:2018-03-28 17:08:12
【问题描述】:

我们如何在 nim 中使用相当于 boost 的 mpl::vector

const mytl = [int, float, char]
template t[T](): =
  when T in mytl:
    stuff

【问题讨论】:

    标签: metaprogramming nim-lang typelist


    【解决方案1】:

    这是一个应该有帮助的库:https://github.com/yglukhov/typelists。如果您需要更具体的内容,请随时贡献;)

    【讨论】:

    • 看起来很不错。下一步将是有一个宏来从类型列表中声明变体类型。
    猜你喜欢
    • 2011-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-09
    • 1970-01-01
    • 2018-12-09
    • 2011-04-01
    • 1970-01-01
    相关资源
    最近更新 更多