Skip to content

do unsafe, while (...) unsafe, and else unsafe, and more... #8493

Answered by huoyaoyuan
Roshaless asked this question in General
Discussion options

You must be logged in to vote

It's actually brace-less blocks with nested unsafe. You can mix many of brace-less constructs like this:

if (...) using (...)
    {

    }
if (...) unchecked
   {

   }

and the "standard" format should be putting the inner block on new line like this:

if (...)
    unsafe
    {

    }

There is a convention to cancel the indentation if the inner and outer blocks are both usings. But for usual cases, every nesting level will increase the level of indentation.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Roshaless
Comment options

@HaloFour
Comment options

@Roshaless
Comment options

Answer selected by Roshaless
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants