Jump to content

  • Log In with Google      Sign In   
  • Create Account

D Bits



D Tip: Use Scope Statements in Proper Scope

Posted by Aldacron, in D 03 November 2013 · 1,228 views
d language
One D construct I often use is the scope guard statement . This allows you to write code that executes when a scope exits under one of three circumstances: an exception is thrown, no exception is thrown, or always. Example:void main() { import std.stdio; scope( failure ) { writeln( "I only execute when the scope exits due to an exception bein...





November 2013 »

S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930

Recent Entries

Recent Comments

PARTNERS