2 ms·
Nice idea! You might want to make emojize a template which could handle string, wstring, string_view, etc. A fun extension would be to add a flag to istream a
by gumby 8y ago
Nice idea!
You might want to make emojize a template which could handle string, wstring, string_view, etc.
A fun extension would be to add a flag to istream and ostream that told it to emojify/demojify output. I.e. use case would be:
std::cout << emojicpp::emojify << "here is a string. :smile: !" << std::endl;
std::cin >> emojicpp::demojify >> some_string;
Your stream inserter/extractors could be template functions that take references to constant string-like objects -- then you wouldn't have to copy the string and could just output the appropriate data (though you'd need a lookahead buffer for stuff like these:characters).