nim-stew/stew/shims/typetraits.nim
Etan Kissling 7b4c9407f2
add enumStyle helper macro (#189)
For serialization and parsing, distinguishing enums with numeric values
from enums with associated strings for each value is useful. This adds
foundational helpers to allow such distinction.
2023-05-26 15:41:13 +03:00

16 lines
439 B
Nim

import std/typetraits
export typetraits
when (NimMajor, NimMinor) < (1, 6): # Copy from `std/typetraits`
#
#
# Nim's Runtime Library
# (c) Copyright 2012 Nim Contributors
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
type HoleyEnum* = (not Ordinal) and enum ## Enum with holes.
type OrdinalEnum* = Ordinal and enum ## Enum without holes.