title: Weird C++ syntax: type definition before a function call
body: <p>I was reading NodeJS and V8 source, particulary <code>node_contextify.cc</code> file, and I could not understand the following line:</p>
  
  <pre><code>Context::Scope context_scope(debug_context);
  </code></pre>
  
  <p>I don't understand what is that <code>Context::Scope</code> before what seems to be a function call. I don't think it is a declaration because it is a function code, together with an <code>if</code> and other calls.</p>
  
  <p>Complete relevant code:</p>
  
  <pre><code>...
      if (debug_context.IsEmpty()) {
          // [... lines removed for brevity ...]
      }
      Context::Scope context_scope(debug_context);
      MaybeLocal&lt;Script&gt; script = Script::Compile(debug_context, script_source);
      if (script.IsEmpty())
          return;  // Exception pending.
      args.GetReturnValue().Set(script.ToLocalChecked()-&gt;Run());
  }
  ...
  </code></pre>
  
  <p><strong>What is the meaning of that <code>Context::Scope</code>?</strong></p>
  
  <hr>
  
  <p>Further information:</p>
  
  <p>File: <a href="https://github.com/nodejs/node/blob/f7842ad1698984e978bc414bc359cb5268b953d9/src/node_contextify.cc#L268" rel="nofollow noreferrer">node/node_contextify.cc</a> (the line 268 is highlighted).</p>
  
  <p>While I understand it is a basic question about syntax, I don't even know how to call it, so I was not able to find any result in Google, StackOverflow or C++ reference.</p>
  
  <p>The question title is one of my attempts when searching for it.</p>