emojicpp icon indicating copy to clipboard operation
emojicpp copied to clipboard

A different approach for compile time emoji replacement

Open mdhvg opened this issue 4 months ago • 0 comments

We can write preprocessor macros to define emojis like in this example

#include <iostream>
#define _admission_tickets_ u8"\\U0001F39F"

int main() {
  const char *test = "Admission Tickets: " _admission_tickets_;
  std::cout << test << std::endl;
  return 0;
}

And on compilation, it expands to:

Admission Tickets: 🎟

mdhvg avatar Oct 19 '24 22:10 mdhvg