jweinst1
9/2/2016 - 5:28 PM

template practice in c++

template practice in c++

#include <iostream>

//stack implementation using template generics and linked nodes

template <class T>
class stack {
	public:
	T item;
	stack(T elem){
		item = elem;
	}
	//returns the top level item
	T peek() const {
		return item;
	}
	private:
	stack * next;
};

int main() {
    std::cout << "Hello World!\n";
}