Files
gpr/examples/gprbuild/ada_cpp/src1/cpp_routine.cpp
Jerome Lambourg 76c10c296d Add the examples from the gprbuild repository
Adjust the project files to properly install them in share/doc

For eng/gpr/gpr-issues#548
2025-03-10 16:16:29 +00:00

37 lines
541 B
C++

#include <iostream>
#include "cpp_routine.h"
using namespace std;
void recurse_then_raise (int n);
void cpp_routine ()
{
cout << " In cpp_routine" << endl;
cout << " Calling recurse_then_raise" << endl;
try
{
recurse_then_raise (10);
}
catch (int except)
{
cout << " caught an exception: " << except << endl;
}
cout << " returning from cpp_routine." << endl;
}
void recurse_then_raise (int n)
{
if (n > 0)
{
recurse_then_raise (n - 1);
}
else
{
throw 1;
}
}