Anything like quote?

Jean-Louis Leroy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 12 08:56:00 PDT 2017


I want to create a string while making sure it qualifies as an 
identifier. Like this:

struct quote
{
   static @property string opDispatch(string str)() { return str; }
}

unittest
{
   assert(quote.foo == "foo");
}

Does it already exist somewhere in the language or the library?

J-L



More information about the Digitalmars-d-learn mailing list