// Debugging deque implementation -*- C++ -*-

// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

/** @file debug/deque
 *  This file is a GNU debug extension to the Standard C++ Library.
 */

#ifndef _GLIBCXX_DEBUG_DEQUE
#define _GLIBCXX_DEBUG_DEQUE 1

#include <deque>
#include <debug/safe_sequence.h>
#include <debug/safe_iterator.h>

namespace std
{
namespace __debug
{
  template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
    class deque
    : public _GLIBCXX_STD_D::deque<_Tp, _Allocator>,
      public __gnu_debug::_Safe_sequence<deque<_Tp, _Allocator> >
    {
      typedef  _GLIBCXX_STD_D::deque<_Tp, _Allocator> _Base;
      typedef __gnu_debug::_Safe_sequence<deque> _Safe_base;

    public:
      typedef typename _Base::reference             reference;
      typedef typename _Base::const_reference       const_reference;

      typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,deque>
						    iterator;
      typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,deque>
						     const_iterator;

      typedef typename _Base::size_type             size_type;
      typedef typename _Base::difference_type       difference_type;

      typedef _Tp				    value_type;
      typedef _Allocator			    allocator_type;
      typedef typename _Base::pointer               pointer;
      typedef typename _Base::const_pointer         const_pointer;
      typedef std::reverse_iterator<iterator>       reverse_iterator;
      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;

      // 23.2.1.1 construct/copy/destroy:
      explicit deque(const _Allocator& __a = _Allocator())
      : _Base(__a) { }

      explicit deque(size_type __n, const _Tp& __value = _Tp(),
		     const _Allocator& __a = _Allocator())
      : _Base(__n, __value, __a) { }

      template<class _InputIterator>
        deque(_InputIterator __first, _InputIterator __last,
	      const _Allocator& __a = _Allocator())
	: _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
        { }

      deque(const deque& __x)
      : _Base(__x), _Safe_base() { }

      deque(const _Base& __x)
      : _Base(__x), _Safe_base() { }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      deque(deque&& __x)
      : _Base(std::forward<deque>(__x)), _Safe_base()
      { this->_M_swap(__x); }
#endif

      ~deque() { }

      deque&
      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu      operator=(const deque& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
_M_indent = 4 } ;
    mu     