Code View

// SPDX-License-Identifier: MIT
#include <exception>
#include <iostream>
#include <locale>
#include <string>

// With NOHEADER there is no header to include: declare what is used.
std::string HelloStr( char const *who );
[[noreturn]] void ThrowHello( char const *who, std::locale const &loc );

int main( )
{
  std::cout << HelloStr( "single file" ) << '\n';

  try
  {
    ThrowHello( "exception", std::locale::classic( ) );
  }
  catch ( std::exception const &e )
  {
    std::cout << e.what( ) << '\n';
  }
}