Language: C++

     template <typename T, unsigned N>
    class stack {
    public:
        stack() : _data{new T[N]}, _top(0) {}
        ~stack() {delete[] _data;}
        T top() const {
            return _data[_top];
        }
        bool isEmpty() const {
            return _top == 0;
        }
        T pop() {
            assert(_top != 0);
            T data = this->top();
            _data[_top] = 0;
            --_top;
            return data;
        }
        void push(const T& x) {
            assert(_top < N);
            ++_top;
            _data[_top] = x;
        }
        bool isFull() const {
            return _top > N - 1;
        }
    private:
        T* _data;
        unsigned _top;
    };

  int evaluate(const std::vector<std::string>& vec)
    {
        stack<int, 3> stack;
        for (std::string v : vec) {
            if (v == "+") {
               stack.push(stack.pop() + stack.pop());
            }
            else if (v == "-") {
                stack.push(stack.pop() - stack.pop());
            }
            else if (v == "*") {
                stack.push(stack.pop() * stack.pop());
            }
            else {
                int i;
                std::istringstream ss(v);
                ss >> i;
                stack.push(i);
            }
            std::cout << "top is ";
            std::cout << stack.top() << std::endl;
            std::cout << " stack size is full ?"  << stack.isFull() << std::endl;
            std::cout << "stac size is " << stack.top() << std::endl;
        }
        return stack.pop();
    }

  std::string input;
   std::getline(std::cin, input);
   std::stringstream ss(input);
   std::vector<std::string> vec;
   std::copy(std::istream_iterator<std::string>(ss),
             {}, std::back_inserter(vec));

   int result = evaluate(vec);

Compiler output:
a.cc: In member function 'T stack<T, N>::pop()':
a.cc:13:13: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive]
   13 |             assert(_top != 0);
      |             ^~~~~~
a.cc:13:13: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
a.cc: In member function 'void stack<T, N>::push(const T&)':
a.cc:20:13: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive]
   20 |             assert(_top < N);
      |             ^~~~~~
a.cc: At global scope:
a.cc:32:27: error: 'vector' in namespace 'std' does not name a template type
   32 |   int evaluate(const std::vector<std::string>& vec)
      |                           ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 |      template <typename T, unsigned N>
a.cc:32:33: error: expected ',' or '...' before '<' token
   32 |   int evaluate(const std::vector<std::string>& vec)
      |                                 ^
a.cc: In function 'int evaluate(int)':
a.cc:35:19: error: 'string' is not a member of 'std'
   35 |         for (std::string v : vec) {
      |                   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 |      template <typename T, unsigned N>
a.cc:56:9: error: expected primary-expression before 'return'
   56 |         return stack.pop();
      |         ^~~~~~
a.cc:55:10: error: expected ';' before 'return'
   55 |         }
      |          ^
      |          ;
   56 |         return stack.pop();
      |         ~~~~~~
a.cc:56:9: error: expected primary-expression before 'return'
   56 |         return stack.pop();
      |         ^~~~~~
a.cc:55:10: error: expected ')' before 'return'
   55 |         }
      |          ^
      |          )
   56 |         return stack.pop();
      |         ~~~~~~
a.cc:35:13: note: to match this '('
   35 |         for (std::string v : vec) {
      |             ^
a.cc: At global scope:
a.cc:59:8: error: 'string' in namespace 'std' does not name a type
   59 |   std::string input;
      |        ^~~~~~
a.cc:59:3: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
   59 |   std::string input;
      |   ^~~
a.cc:60:16: error: expected constructor, destructor, or type conversion before '(' token
   60 |    std::getline(std::cin, input);
      |                ^
a.cc:61:9: error: 'stringstream' in namespace 'std' does not name a type
   61 |    std::stringstream ss(input);
      |         ^~~~~~~~~~~~
a.cc:1:1: note: 'std::stringstream' is defined in header '<sstream>'; this is probably fixable by adding '#include <sstream>'
  +++ |+#include <sstream>
    1 |      template <typename T, unsigned N>
a.cc:62:9: error: 'vector' in namespace 'std' does not name a template type
   62 |    std::vector<std::string> vec;
      |         ^~~~~~
a.cc:62:4: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
   62 |    std::vector<std::string> vec;
      |    ^~~
a.cc:63:13: error: expected constructor, destructor, or type conversion before '(' token
   63 |    std::copy(std::istream_iterator<std::string>(ss),
      |             ^
a.cc:64:16: error: expected unqualified-id before ',' token
   64 |              {}, std::back_inserter(vec));
      |                ^
a.cc:64:36: error: expected constructor, destructor, or type conversion before '(' token
   64 |              {}, std::back_inserter(vec));
      |                                    ^
a.cc:66:26: error: 'vec' was not declared in this scope
   66 |    int result = evaluate(vec);
      |                          ^~~
a.cc: In instantiation of 'T stack<T, N>::pop() [with T = int; unsigned int N = 3]':
a.cc:56:25:   required from here
   56 |         return stack.pop();
      |                ~~~~~~~~~^~
a.cc:13:19: error: 'assert' was not declared in this scope
   13 |             assert(_top != 0);
      |             ~~~~~~^~~~~~~~~~~
a.cc:1:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
  +++ |+#include <cassert>
    1 |      template <typename T, unsigned N>
a.cc: In function 'int evaluate(int)':
a.cc:57:5: warning: control reaches end of non-void function [-Wreturn-type]
   57 |     }
      |     ^