Skip to Main Content
The D Programming Language
book

The D Programming Language

by Andrei Alexandrescu
June 2010
Intermediate to advanced content levelIntermediate to advanced
456 pages
14h 48m
English
Addison-Wesley Professional
Content preview from The D Programming Language

Chapter 3. Statements

This chapter contains the obligatory definitions for all statements that D defines. D builds on the C family’s look and feel—there’s if, while, for, and others. However, there are a few new, interesting statements and tweaks on the existing statements. In case you are likely to get bored by the inevitable litany describing each statement in detail, here are some “deltas”—interesting bits original to D.

If you want to conditionally compile code, static if3.4 on page 68) may be of interest. Its usefulness goes well beyond simple flag-directed customizations; if you use generic code in any capacity, static if is an enormous boon. The switch statement (§ 3.5 on page 71) looks and acts much like its C counterpart but works ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced UNIX Programming, Second Edition

Advanced UNIX Programming, Second Edition

Marc J. Rochkind
Learn LLVM 12

Learn LLVM 12

Kai Nacke

Publisher Resources

ISBN: 9780321659538Purchase book