mirror of
https://github.com/status-im/nim-stew.git
synced 2025-02-19 23:38:18 +00:00
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.
16 lines
439 B
Nim
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.
|