Re: FFI enums are now always boxed

  • From: Dimiter 'malkia' Stanev <malkia@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 19 Jul 2012 18:58:06 -0700

On 7/19/2012 6:30 PM, Vadim Peretokin wrote:
What do you propose be done instead? This is a niche only available to the enums only right now, and it offers more useful potential... so it could be just a quirk to be aware of when working with them (so it should be properly documented, so that users are aware of this).

Probably switching to const size_t, or const int might give you back some of the old behaviour


typedef const size_t some_enum_t;
some_enum_t ENUM_1 = 1;

instead of

typedef enum some_enum_t {
  ENUM_1 = 1,
} some_enum_t;

Other related posts: