String Mixins

You’ll learn about string mixins in this lesson.

Another powerful feature of D the ability to insert code as string as long as that string is known at compile time. The syntax of string mixins requires the use of parentheses:

mixin (compile_time_generated_string)

For example, the hello world program can also be written with a mixin:

Get hands-on with 1400+ tech skills courses.