Raised This Month: $32 Target: $400
 8% 

Size of enum in sm 1.11+


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oplkill
Member
Join Date: Aug 2015
Old 11-27-2022 , 12:46   Size of enum in sm 1.11+
Reply With Quote #1

I have simple enum

PHP Code:
enum ITEM_HEALS
{
    
ITEM_HEAL_SMALL,
    
ITEM_HEAL_MEDIUM,
    
ITEM_HEAL_FULL

And i wanted to know size of that enum.
Previously those codes was worked:
PHP Code:
int l_medkitHeal[ITEM_HEALS];

or

int l_medkitHeal[sizeof(ITEM_HEALS)];

or

int l_medkitHeal[view_as<int>(ITEM_HEALS)]; 
but now, the only working method is - add last element to enum... Is it bug or supposed to be? Why those methods were removed, without any good replace? (Or there is new replace?)
oplkill is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-27-2022 , 13:21   Re: Size of enum in sm 1.11+
Reply With Quote #2

just add last element aka MAX
Bacardi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode