mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-06 08:46:42 +08:00
664 B
664 B
Hello, World!
Download <a $download>enum.h, then compile this program:
#include <iostream>
<em>#include "enum.h"</em>
<em>BETTER_ENUM</em>(<em>Word</em>, <em>int</em>, <em>Hello</em>, <em>World</em>)
int main()
{
std::cout << <em>(+Word::Hello)._to_string()</em> << ", "
<< <em>(+Word::World)._to_string()</em> << "!"
<< std::endl;
return 0;
}
Run it, and you should see the output "Hello, World!"
Congratulations, you have just created your first Better Enum!
%% description = Introductory Better Enums tutorial - a simple, but complete, Hello World program.