Language: C++

//dlang template---{{{
import std.stdio;
import std.conv;
import std.string;
import std.array;
import std.algorithm;

// MIT-License https://github.com/kurokoji/nephele
class Scanner
{
  import std.stdio : File, stdin;
  import std.conv : to;
  import std.array : split;
  import std.string;
  import std.traits : isSomeString;

  private File file;
  private char[][] str;
  private size_t idx;

  this(File file = stdin)
  {
    this.file = file;
    this.idx = 0;
  }

  this(StrType)(StrType s, File file = stdin) if (isSomeString!(StrType))
  {
    this.file = file;
    this.idx = 0;
    fromString(s);
  }

  private char[] next()
  {
    if (idx < str.length)
    {
      return str[idx++];
    }

    char[] s;
    while (s.length == 0)
    {
      s = file.readln.strip.to!(char[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)()
  {
    return next.to!(T);
  }

  T[] nextArray(T)(size_t len)
  {
    T[] ret = new T[len];

    foreach (ref c; ret)
    {
      c = next!(T);
    }

    return ret;
  }

  void scan()()
  {
  }

  void scan(T, S...)(ref T x, ref S args)
  {
    x = next!(T);
    scan(args);
  }

  void fromString(StrType)(StrType s) if (isSomeString!(StrType))
  {
    str ~= s.to!(char[]).strip.split;
  }
}
//}}}

void main() {
  Scanner sc = new Scanner;
  int N;
  sc.scan(N);
  if (N == 1) {
    writeln("Hello World");
  } else if (N == 2) {
    int A, B;
    sc.scan(A, B);

    writeln(A + B);
  }
}


Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import std.stdio;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.conv;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import std.string;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import std.array;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import std.algorithm;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:3: error: 'import' does not name a type
   11 |   import std.stdio : File, stdin;
      |   ^~~~~~
a.cc:11:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:3: error: 'import' does not name a type
   12 |   import std.conv : to;
      |   ^~~~~~
a.cc:12:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:13:3: error: 'import' does not name a type
   13 |   import std.array : split;
      |   ^~~~~~
a.cc:13:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:14:3: error: 'import' does not name a type
   14 |   import std.string;
      |   ^~~~~~
a.cc:14:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:3: error: 'import' does not name a type
   15 |   import std.traits : isSomeString;
      |   ^~~~~~
a.cc:15:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:17:10: error: expected ':' before 'File'
   17 |   private File file;
      |          ^~~~~
      |          :
a.cc:17:11: error: 'File' does not name a type
   17 |   private File file;
      |           ^~~~
a.cc:18:10: error: expected ':' before 'char'
   18 |   private char[][] str;
      |          ^~~~~
      |          :
a.cc:18:15: error: expected unqualified-id before '[' token
   18 |   private char[][] str;
      |               ^
a.cc:19:10: error: expected ':' before 'size_t'
   19 |   private size_t idx;
      |          ^~~~~~~
      |          :
a.cc:19:11: error: 'size_t' does not name a type
   19 |   private size_t idx;
      |           ^~~~~~
a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | //dlang template---{{{
a.cc:21:3: error: expected unqualified-id before 'this'
   21 |   this(File file = stdin)
      |   ^~~~
a.cc:27:3: error: expected unqualified-id before 'this'
   27 |   this(StrType)(StrType s, File file = stdin) if (isSomeString!(StrType))
      |   ^~~~
a.cc:34:10: error: expected ':' before 'char'
   34 |   private char[] next()
      |          ^~~~~
      |          :
a.cc:34:15: error: expected unqualified-id before '[' token
   34 |   private char[] next()
      |               ^
a.cc:53:3: error: 'T' does not name a type
   53 |   T next(T)()
      |   ^
a.cc:58:3: error: 'T' does not name a type
   58 |   T[] nextArray(T)(size_t len)
      |   ^
a.cc:70:3: error: 'scan' declared as function returning a function
   70 |   void scan()()
      |   ^~~~
a.cc:74:13: error: 'T' has not been declared
   74 |   void scan(T, S...)(ref T x, ref S args)
      |             ^
a.cc:74:16: error: 'S' has not been declared
   74 |   void scan(T, S...)(ref T x, ref S args)
      |                ^
a.cc:74:22: error: 'ref' has not been declared
   74 |   void scan(T, S...)(ref T x, ref S args)
      |                      ^~~
a.cc:74:28: error: expected ',' or '...' before 'x'
   74 |   void scan(T, S...)(ref T x, ref S args)
      |                            ^
a.cc:74:3: error: 'scan' declared as function returning a function
   74 |   void scan(T, S...)(ref T x, ref S args)
      |   ^~~~
a.cc:80:19: error: 'StrType' has not been declared
   80 |   void fromString(StrType)(StrType s) if (isSomeString!(StrType))
      |                   ^~~~~~~
a.cc:80:28: error: 'StrType' has not been declared
   80 |   void fromString(StrType)(StrType s) if (isSomeString!(StrType))
      |                            ^~~~~~~
a.cc:80:3: error: 'fromString' declared as function returning a function
   80 |   void fromString(StrType)(StrType s) if (isSomeString!(StrType))
      |   ^~~~
a.cc:80:37: error: expected ';' at end of member declaration
   80 |   void fromString(StrType)(StrType s) if (isSomeString!(StrType))
      |                                     ^
      |                                      ;
a.cc:80:39: error: expected unqualified-id before 'if'
   80 |   void fromString(StrType)(StrType s) if (isSomeString!(StrType))
      |                                       ^~
a.cc:84:2: error: expected ';' after class definition
   84 | }
      |  ^
      |  ;
a.cc:87:1: error: '::main' must return 'int'
   87 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:88:16: error: conversion from 'Scanner*' to non-scalar type 'Scanner' requested
   88 |   Scanner sc = new Scanner;
      |                ^~~~~~~~~~~
a.cc:90:6: error: 'class Scanner' has no member named 'scan'
   90 |   sc.scan(N);
      |      ^~~~
a.cc:92:5: error: 'writeln' was not declared in this scope
   92 |     writeln("Hello World");
      |     ^~~~~~~
a.cc:95:8: error: 'class Scanner' has no member named 'scan'
   95 |     sc.scan(A, B);
      |        ^~~~
a.cc:97:5: error: 'writeln' was not declared in this scope
   97 |     writeln(A + B);
      |     ^~~~~~~