cdef extern from "folly/Range.h" namespace "folly":
    cdef cppclass Range[T]:
        Range()
        Range(T, int)
        T data()
        T begin()
        T end()
        int size()

ctypedef Range[const char*] StringPiece
ctypedef Range[const unsigned char*] ByteRange

ctypedef fused R:
    StringPiece
    ByteRange

# Conversion Helpers
cdef inline bytes to_bytes(R range):
    return <bytes>range.data()[:range.size()]

cdef extern from "folly/Range.h" namespace "folly":
    cdef cppclass Range[T]:
        Range()
        Range(T, int)
        T data()
        int size()

ctypedef Range[const char*] StringPiece
ctypedef Range[const unsigned char*] ByteRange

ctypedef fused R:
    StringPiece
    ByteRange

# Conversion Helpers
cdef inline bytes to_bytes(R range):
    return <bytes>range.data()[:range.size()]

Revert D22499183: refactor Enum code generation
Revert D22499183: refactor Enum code generation

Differential Revision:
D22499183 (https://github.com/facebook/folly/commit/24364356023d04f966a0ef6fc7536363932bdc82)

Original commit changeset: b2af8d94024c

fbshipit-source-id: a6bd56cdb4d4b73618a9374528371c5b18a0df10
