metaprogrammingnim-langtypelist

Declaring, iterating, searching typelists at compile time


How can we work with the equivalent of boost's mpl::vector in nim ?

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

Solution

  • Here's a lib that should help: https://github.com/yglukhov/typelists. Feel free to contribute in case you need anything more specific ;)