#include "fixed_stack.h"
#include <iostream>
int main()
{
	
	M3D::fixed_stack<int> stack(10);
	stack.push( 1 );
	stack.push( 2 );
	stack.push( 3 );
	stack.push( 4 );
	stack.push( 5 );
	stack.push( 6 );
	stack.push( 7 );
	stack.push( 8 );
	stack.push( 9 );
	stack.push( 10 );
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	
	stack.push( 1 );
	stack.push( 2 );
	stack.push( 3 );
	stack.push( 4 );
	stack.push( 5 );
	stack.push( 6 );
	stack.push( 7 );
	stack.push( 8 );
	stack.push( 9 );
	stack.push( 10 );
	try{
		stack.push( 11 );
	}catch (int a)
	{
		std::cerr<<"failed insert. OK"<<std::endl;
	}
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	std::cout<<stack.pop()<<std::endl;
	
	stack.push( 1 );
	try{
		std::cout<<stack.pop()<<std::endl;
		std::cout<<stack.pop()<<std::endl;
	}catch (int a)
	{
		std::cerr<<"failed read. OK"<<std::endl;
	}
}

