1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_CONTAINER_STACK_HPP
12 #define BOOST_COMPUTE_CONTAINER_STACK_HPP
14 #include <boost/compute/container/vector.hpp>
23 typedef vector<T> container_type;
24 typedef typename container_type::size_type size_type;
25 typedef typename container_type::value_type value_type;
31 stack(const stack<T> &other)
32 : m_vector(other.m_vector)
36 stack<T>& operator=(const stack<T> &other)
39 m_vector = other.m_vector;
51 return m_vector.empty();
54 size_type size() const
56 return m_vector.size();
59 value_type top() const
61 return m_vector.back();
64 void push(const T &value)
66 m_vector.push_back(value);
75 container_type m_vector;
78 } // end compute namespace
79 } // end boost namespace
81 #endif // BOOST_COMPUTE_CONTAINER_STACK_HPP