Given Fortran 2003 code to do something like:
In[1]:
use IntStack_mod, only : IntStack
type(IntStack) :: stack
stack = IntStack(10)
call stack % display()
Out[1]:
IntStack::Display
(empty)
And subsequently:
In[2]:
call stack % push(2)
call stack % push(15)
call stack % display()
Out[2]:
IntStack::Display
2, 15
Can IntStack be implemented and managed within C++, with simple wrappers being exposed in Fortran?
Answer: YES
The code here is a demonstration of that.