亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stl_deque.h

?? TSP問題的一個類庫 有源代碼和stl
?? H
?? 第 1 頁 / 共 4 頁
字號:
/*
 *
 * Copyright (c) 1994
 * Hewlett-Packard Company
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Hewlett-Packard Company makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 *
 *
 * Copyright (c) 1997
 * Silicon Graphics Computer Systems, Inc.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Silicon Graphics makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 */

/* NOTE: This is an internal header file, included by other STL headers.
 *   You should not attempt to use it directly.
 */

#ifndef __SGI_STL_INTERNAL_DEQUE_H
#define __SGI_STL_INTERNAL_DEQUE_H

/* Class invariants:
 *  For any nonsingular iterator i:
 *    i.node is the address of an element in the map array.  The
 *      contents of i.node is a pointer to the beginning of a node.
 *    i.first == *(i.node) 
 *    i.last  == i.first + node_size
 *    i.cur is a pointer in the range [i.first, i.last).  NOTE:
 *      the implication of this is that i.cur is always a dereferenceable
 *      pointer, even if i is a past-the-end iterator.
 *  Start and Finish are always nonsingular iterators.  NOTE: this means
 *    that an empty deque must have one node, and that a deque
 *    with N elements, where N is the buffer size, must have two nodes.
 *  For every node other than start.node and finish.node, every element
 *    in the node is an initialized object.  If start.node == finish.node,
 *    then [start.cur, finish.cur) are initialized objects, and
 *    the elements outside that range are uninitialized storage.  Otherwise,
 *    [start.cur, start.last) and [finish.first, finish.cur) are initialized
 *    objects, and [start.first, start.cur) and [finish.cur, finish.last)
 *    are uninitialized storage.
 *  [map, map + map_size) is a valid, non-empty range.  
 *  [start.node, finish.node] is a valid range contained within 
 *    [map, map + map_size).  
 *  A pointer in the range [map, map + map_size) points to an allocated node
 *    if and only if the pointer is in the range [start.node, finish.node].
 */


/*
 * In previous versions of deque, node_size was fixed by the 
 * implementation.  In this version, however, users can select
 * the node size.  Deque has three template parameters; the third,
 * a number of type size_t, is the number of elements per node.
 * If the third template parameter is 0 (which is the default), 
 * then deque will use a default node size.
 *
 * The only reason for using an alternate node size is if your application
 * requires a different performance tradeoff than the default.  If,
 * for example, your program contains many deques each of which contains
 * only a few elements, then you might want to save memory (possibly
 * by sacrificing some speed) by using smaller nodes.
 *
 * Unfortunately, some compilers have trouble with non-type template 
 * parameters; stl_config.h defines __STL_NON_TYPE_TMPL_PARAM_BUG if
 * that is the case.  If your compiler is one of them, then you will
 * not be able to use alternate node sizes; you will have to use the
 * default value.
 */

__STL_BEGIN_NAMESPACE 

#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif

// Note: this function is simply a kludge to work around several compilers'
//  bugs in handling constant expressions.
inline size_t
__deque_buf_size(size_t __n, size_t __size)
{
  return __n != 0 ? __n : (__size < 512 ? size_t(512 / __size) : size_t(1));
}

#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG
template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
struct _Deque_iterator {
  typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz>             iterator;
  typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*,__bufsiz> const_iterator;
  static size_t 
    _S_buffer_size() { return __deque_buf_size(__bufsiz, sizeof(_Tp)); }
#else /* __STL_NON_TYPE_TMPL_PARAM_BUG */
template <class _Tp, class _Ref, class _Ptr>
struct _Deque_iterator {
  typedef _Deque_iterator<_Tp, _Tp&, _Tp*>             iterator;
  typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
  static size_t 
    _S_buffer_size() { return __deque_buf_size(0, sizeof(_Tp)); }
#endif

  typedef random_access_iterator_tag iterator_category;
  typedef _Tp value_type;
  typedef _Ptr pointer;
  typedef _Ref reference;
  typedef size_t size_type;
  typedef ptrdiff_t difference_type;
  typedef _Tp** _Map_pointer;

  typedef _Deque_iterator _Self;

  _Tp* _M_cur;
  _Tp* _M_first;
  _Tp* _M_last;
  _Map_pointer _M_node;

  _Deque_iterator(_Tp* __x, _Map_pointer __y) 
    : _M_cur(__x), _M_first(*__y),
      _M_last(*__y + _S_buffer_size()), _M_node(__y) {}
  _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
  _Deque_iterator(const iterator& __x)
    : _M_cur(__x._M_cur), _M_first(__x._M_first), 
      _M_last(__x._M_last), _M_node(__x._M_node) {}

  reference operator*() const { return *_M_cur; }
#ifndef __SGI_STL_NO_ARROW_OPERATOR
  pointer operator->() const { return _M_cur; }
#endif /* __SGI_STL_NO_ARROW_OPERATOR */

  difference_type operator-(const _Self& __x) const {
    return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
      (_M_cur - _M_first) + (__x._M_last - __x._M_cur);
  }

  _Self& operator++() {
    ++_M_cur;
    if (_M_cur == _M_last) {
      _M_set_node(_M_node + 1);
      _M_cur = _M_first;
    }
    return *this; 
  }
  _Self operator++(int)  {
    _Self __tmp = *this;
    ++*this;
    return __tmp;
  }

  _Self& operator--() {
    if (_M_cur == _M_first) {
      _M_set_node(_M_node - 1);
      _M_cur = _M_last;
    }
    --_M_cur;
    return *this;
  }
  _Self operator--(int) {
    _Self __tmp = *this;
    --*this;
    return __tmp;
  }

  _Self& operator+=(difference_type __n)
  {
    difference_type __offset = __n + (_M_cur - _M_first);
    if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
      _M_cur += __n;
    else {
      difference_type __node_offset =
        __offset > 0 ? __offset / difference_type(_S_buffer_size())
                   : -difference_type((-__offset - 1) / _S_buffer_size()) - 1;
      _M_set_node(_M_node + __node_offset);
      _M_cur = _M_first + 
        (__offset - __node_offset * difference_type(_S_buffer_size()));
    }
    return *this;
  }

  _Self operator+(difference_type __n) const
  {
    _Self __tmp = *this;
    return __tmp += __n;
  }

  _Self& operator-=(difference_type __n) { return *this += -__n; }
 
  _Self operator-(difference_type __n) const {
    _Self __tmp = *this;
    return __tmp -= __n;
  }

  reference operator[](difference_type __n) const { return *(*this + __n); }

  bool operator==(const _Self& __x) const { return _M_cur == __x._M_cur; }
  bool operator!=(const _Self& __x) const { return !(*this == __x); }
  bool operator<(const _Self& __x) const {
    return (_M_node == __x._M_node) ? 
      (_M_cur < __x._M_cur) : (_M_node < __x._M_node);
  }
  bool operator>(const _Self& __x) const  { return __x < *this; }
  bool operator<=(const _Self& __x) const { return !(__x < *this); }
  bool operator>=(const _Self& __x) const { return !(*this < __x); }

  void _M_set_node(_Map_pointer __new_node) {
    _M_node = __new_node;
    _M_first = *__new_node;
    _M_last = _M_first + difference_type(_S_buffer_size());
  }
};

#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION

#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG

template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
inline random_access_iterator_tag
iterator_category(const _Deque_iterator<_Tp,_Ref,_Ptr,__bufsiz>&) {
  return random_access_iterator_tag();
}

template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
inline _Tp*
value_type(const _Deque_iterator<_Tp,_Ref,_Ptr,__bufsiz>&) {
  return 0;
}

template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
inline ptrdiff_t*
distance_type(const _Deque_iterator<_Tp,_Ref,_Ptr,__bufsiz>&) {
  return 0;
}

#else /* __STL_NON_TYPE_TMPL_PARAM_BUG */

template <class _Tp, class _Ref, class _Ptr>
inline random_access_iterator_tag
iterator_category(const _Deque_iterator<_Tp,_Ref,_Ptr>&)
{
  return random_access_iterator_tag();
}

template <class _Tp, class _Ref, class _Ptr>
inline _Tp*
value_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) { return 0; }

template <class _Tp, class _Ref, class _Ptr>
inline ptrdiff_t*
distance_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) {
  return 0;
}

#endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */

#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */

// Deque base class.  It has two purposes.  First, its constructor
//  and destructor allocate (but don't initialize) storage.  This makes
//  exception safety easier.  Second, the base class encapsulates all of
//  the differences between SGI-style allocators and standard-conforming
//  allocators.

#ifdef __STL_USE_STD_ALLOCATORS

// Base class for ordinary allocators.
template <class _Tp, class _Alloc, size_t __bufsiz, bool __is_static>
class _Deque_alloc_base {
public:
  typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
  allocator_type get_allocator() const { return _M_node_allocator; }

  _Deque_alloc_base(const allocator_type& __a)
    : _M_node_allocator(__a), _M_map_allocator(__a),
      _M_map(0), _M_map_size(0)
  {}
  
protected:
  typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type
          _Map_allocator_type;

  allocator_type      _M_node_allocator;
  _Map_allocator_type _M_map_allocator;

  _Tp* _M_allocate_node() {
    return _M_node_allocator.allocate(__deque_buf_size(__bufsiz,sizeof(_Tp)));
  }
  void _M_deallocate_node(_Tp* __p) {
    _M_node_allocator.deallocate(__p, __deque_buf_size(__bufsiz,sizeof(_Tp)));
  }
  _Tp** _M_allocate_map(size_t __n) 
    { return _M_map_allocator.allocate(__n); }
  void _M_deallocate_map(_Tp** __p, size_t __n) 
    { _M_map_allocator.deallocate(__p, __n); }

  _Tp** _M_map;
  size_t _M_map_size;
};

// Specialization for instanceless allocators.
template <class _Tp, class _Alloc, size_t __bufsiz>
class _Deque_alloc_base<_Tp, _Alloc, __bufsiz, true>
{
public:
  typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
  allocator_type get_allocator() const { return allocator_type(); }

  _Deque_alloc_base(const allocator_type&) : _M_map(0), _M_map_size(0) {}
  
protected:
  typedef typename _Alloc_traits<_Tp, _Alloc>::_Alloc_type _Node_alloc_type;
  typedef typename _Alloc_traits<_Tp*, _Alloc>::_Alloc_type _Map_alloc_type;

  _Tp* _M_allocate_node() {
    return _Node_alloc_type::allocate(__deque_buf_size(__bufsiz,
                                                       sizeof(_Tp)));
  }
  void _M_deallocate_node(_Tp* __p) {
    _Node_alloc_type::deallocate(__p, __deque_buf_size(__bufsiz, 
                                                       sizeof(_Tp)));
  }
  _Tp** _M_allocate_map(size_t __n) 
    { return _Map_alloc_type::allocate(__n); }
  void _M_deallocate_map(_Tp** __p, size_t __n) 
    { _Map_alloc_type::deallocate(__p, __n); }

  _Tp** _M_map;
  size_t _M_map_size;
};

template <class _Tp, class _Alloc, size_t __bufsiz>
class _Deque_base
  : public _Deque_alloc_base<_Tp,_Alloc,__bufsiz, 
                              _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
public:
  typedef _Deque_alloc_base<_Tp,_Alloc,__bufsiz,
                             _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
          _Base;
  typedef typename _Base::allocator_type allocator_type;
  typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz>              iterator;
  typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*, __bufsiz> const_iterator;

  _Deque_base(const allocator_type& __a, size_t __num_elements)
    : _Base(__a), _M_start(), _M_finish()
    { _M_initialize_map(__num_elements); }
  _Deque_base(const allocator_type& __a) 
    : _Base(__a), _M_start(), _M_finish() {}
  ~_Deque_base();    

protected:
  void _M_initialize_map(size_t);
  void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
  void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
  enum { _S_initial_map_size = 8 };

protected:
  iterator _M_start;
  iterator _M_finish;
};

#else /* __STL_USE_STD_ALLOCATORS */

template <class _Tp, class _Alloc, size_t __bufsiz>
class _Deque_base {
public:
#ifndef __STL_NON_TYPE_TMPL_PARAM_BUG
  typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz>              iterator;
  typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*, __bufsiz> const_iterator;
#else /* __STL_NON_TYPE_TMPL_PARAM_BUG */
  typedef _Deque_iterator<_Tp,_Tp&,_Tp*>                       iterator;
  typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*>           const_iterator;
#endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */

  typedef _Alloc allocator_type;
  allocator_type get_allocator() const { return allocator_type(); }

  _Deque_base(const allocator_type&, size_t __num_elements)
    : _M_map(0), _M_map_size(0),  _M_start(), _M_finish() {
    _M_initialize_map(__num_elements);
  }
  _Deque_base(const allocator_type&)
    : _M_map(0), _M_map_size(0),  _M_start(), _M_finish() {}
  ~_Deque_base();    

protected:
  void _M_initialize_map(size_t);
  void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
  void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
  enum { _S_initial_map_size = 8 };

protected:
  _Tp** _M_map;
  size_t _M_map_size;  
  iterator _M_start;
  iterator _M_finish;

  typedef simple_alloc<_Tp, _Alloc>  _Node_alloc_type;
  typedef simple_alloc<_Tp*, _Alloc> _Map_alloc_type;

  _Tp* _M_allocate_node()
    { return _Node_alloc_type::allocate(__deque_buf_size(__bufsiz, 
                                                         sizeof(_Tp))); }
  void _M_deallocate_node(_Tp* __p)
    { _Node_alloc_type::deallocate(__p, __deque_buf_size(__bufsiz, 
                                                         sizeof(_Tp))); }
  _Tp** _M_allocate_map(size_t __n) 
    { return _Map_alloc_type::allocate(__n); }
  void _M_deallocate_map(_Tp** __p, size_t __n) 
    { _Map_alloc_type::deallocate(__p, __n); }
};

#endif /* __STL_USE_STD_ALLOCATORS */

// Non-inline member functions from _Deque_base.

template <class _Tp, class _Alloc, size_t __bufsiz>
_Deque_base<_Tp,_Alloc,__bufsiz>::~_Deque_base() {
  if (_M_map) {
    _M_destroy_nodes(_M_start._M_node, _M_finish._M_node + 1);
    _M_deallocate_map(_M_map, _M_map_size);
  }
}

template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_initialize_map(size_t __num_elements)
{
  size_t __num_nodes = 
    __num_elements / __deque_buf_size(__bufsiz, sizeof(_Tp)) + 1;

  _M_map_size = max((size_t) _S_initial_map_size, __num_nodes + 2);
  _M_map = _M_allocate_map(_M_map_size);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美腿丝袜在线亚洲一区 | 天堂资源在线中文精品| 欧美激情一区二区三区全黄| 欧美一级夜夜爽| 在线不卡免费欧美| 欧美另类z0zxhd电影| 欧美日韩国产成人在线免费| 欧美三级中文字| 欧美电影在哪看比较好| 欧美福利视频导航| 精品美女被调教视频大全网站| 91麻豆精品国产无毒不卡在线观看| 欧美一级片在线看| 精品精品国产高清一毛片一天堂| 91精品蜜臀在线一区尤物| 欧美精品精品一区| 2024国产精品| 中文字幕 久热精品 视频在线| 国产精品久久久久久久裸模| 综合激情网...| 亚洲电影一级片| 麻豆一区二区三| 国产精品中文有码| 99久久国产免费看| 欧美日韩一级片在线观看| 7777精品伊人久久久大香线蕉的| 欧美一级免费观看| 日本一区二区三区在线观看| 国产精品天天摸av网| 亚洲国产婷婷综合在线精品| 日本不卡在线视频| 不卡一二三区首页| 欧洲av在线精品| 精品女同一区二区| 国产精品国产自产拍在线| 一区二区三区四区蜜桃| 免费的国产精品| 91麻豆国产福利精品| 日韩午夜三级在线| 国产精品久久久久久久久久久免费看 | 18涩涩午夜精品.www| 日本视频在线一区| 91在线视频免费91| 久久伊99综合婷婷久久伊| 一二三四社区欧美黄| 国产尤物一区二区| 欧美日韩aaa| 亚洲视频一区二区免费在线观看| 日韩精品一区第一页| 色爱区综合激月婷婷| 2021中文字幕一区亚洲| 亚洲电影一区二区| 岛国av在线一区| 精品成人一区二区三区四区| 一片黄亚洲嫩模| 成人黄色a**站在线观看| 7777精品久久久大香线蕉| 亚洲男同1069视频| 成人精品gif动图一区| 欧美va在线播放| 青娱乐精品在线视频| 欧美三级日韩三级国产三级| 中文字幕av免费专区久久| 国产乱码精品1区2区3区| 91麻豆精品国产自产在线观看一区 | 国产99久久久国产精品免费看 | 亚洲精品免费在线播放| 国产精品99久久久久久似苏梦涵| 91精品欧美久久久久久动漫 | 欧美系列日韩一区| 自拍偷拍亚洲欧美日韩| 国产成人免费视频网站| 久久综合九色欧美综合狠狠| 免费在线观看视频一区| 在线电影国产精品| 日本大胆欧美人术艺术动态| 欧美日韩精品一区二区三区四区| 亚洲午夜av在线| 欧美日韩一区二区三区在线| 亚洲自拍欧美精品| 欧美性生活影院| 日韩**一区毛片| 日韩欧美国产电影| 蜜臀va亚洲va欧美va天堂| 欧美精品乱码久久久久久按摩 | 日韩精品最新网址| 久久国产精品区| 精品久久久久久久人人人人传媒| 青青草精品视频| 91精品国产一区二区| 美女高潮久久久| 精品国产3级a| 94-欧美-setu| 日韩高清一级片| 久久综合久久99| 波多野结衣在线一区| 一区二区三区在线影院| 欧美精品第1页| 国产精品一区在线| 亚洲欧洲综合另类| 欧美精品乱码久久久久久按摩| 精品一区二区综合| 国产精品三级在线观看| 欧美视频在线观看一区| 久久精品国产一区二区三区免费看| 精品久久久久久久久久久院品网| 成人三级伦理片| 天天综合日日夜夜精品| 久久新电视剧免费观看| av在线不卡免费看| 日本中文字幕不卡| 亚洲欧洲性图库| 欧美一级欧美一级在线播放| 成人少妇影院yyyy| 青青青伊人色综合久久| 综合欧美一区二区三区| 欧美变态口味重另类| 色综合中文字幕| 国产在线观看一区二区| 亚洲激情成人在线| 久久夜色精品国产噜噜av| 一本色道久久综合精品竹菊| 久久99精品久久久久久| 一区二区在线观看视频| 精品久久国产字幕高潮| 欧美日韩一区二区三区视频| 国产成人精品综合在线观看| 蜜臀久久99精品久久久画质超高清| 亚洲品质自拍视频| 久久精品人人做人人爽人人| 欧美日韩国产综合一区二区| 成人av动漫网站| 国产在线麻豆精品观看| 婷婷久久综合九色综合伊人色| 中文av一区二区| 日本一区二区三区免费乱视频 | 亚洲免费观看高清完整版在线观看 | 91啪亚洲精品| 国模一区二区三区白浆| 日韩中文字幕区一区有砖一区| 伊人性伊人情综合网| 国产精品三级电影| 国产欧美日韩亚州综合| 久久精品免费在线观看| 久久精品日产第一区二区三区高清版| 欧美顶级少妇做爰| 9191精品国产综合久久久久久| 91精彩视频在线观看| av激情综合网| 91欧美一区二区| 欧洲国内综合视频| 欧美日韩美女一区二区| 欧美日韩一区二区三区视频 | 国产日产欧美一区二区视频| 精品污污网站免费看| 欧美做爰猛烈大尺度电影无法无天| 国产精品夜夜爽| 精品一区中文字幕| 国产成人啪午夜精品网站男同| 日韩二区在线观看| 亚洲一区二区视频在线| 中文字幕欧美一区| 夜色激情一区二区| 亚洲三级免费电影| 亚洲品质自拍视频| 亚洲精品国产a| 亚洲综合一区在线| 一区二区不卡在线视频 午夜欧美不卡在 | 色综合一区二区| 一本大道久久精品懂色aⅴ| 成人黄色在线视频| 国产成人高清视频| 福利电影一区二区| 国产真实乱子伦精品视频| 成人免费av网站| av一区二区三区四区| aaa国产一区| 欧美日韩综合不卡| 欧美精品在线观看一区二区| 欧美精品自拍偷拍动漫精品| 欧美一区二区精品在线| 日本一区二区三区四区在线视频| 久久精品人人做| 综合自拍亚洲综合图不卡区| 中文字幕字幕中文在线中不卡视频| 亚洲一区影音先锋| 日本成人中文字幕在线视频| 久久99热狠狠色一区二区| 91视频在线观看| 欧美福利视频一区| 久久精品男人天堂av| 国产精品麻豆网站| 久久国产乱子精品免费女| 懂色一区二区三区免费观看| 成人动漫一区二区三区| 欧美一级日韩不卡播放免费| 久久毛片高清国产| 日韩美女视频一区| 日韩二区三区四区| 在线免费观看一区|