Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

615 lines
19 KiB

  1. // vector standard header
  2. #ifndef _VECTOR_
  3. #define _VECTOR_
  4. #include <climits>
  5. #include <memory>
  6. #include <stdexcept>
  7. #include <xutility>
  8. #ifdef _MSC_VER
  9. #pragma pack(push,8)
  10. #endif /* _MSC_VER */
  11. _STD_BEGIN
  12. // TEMPLATE CLASS vector
  13. template<class _Ty, class _A = allocator<_Ty> >
  14. class vector {
  15. public:
  16. typedef vector<_Ty, _A> _Myt;
  17. typedef _A allocator_type;
  18. typedef typename _A::size_type size_type;
  19. typedef typename _A::difference_type difference_type;
  20. typedef typename _A::pointer _Tptr;
  21. typedef typename _A::const_pointer _Ctptr;
  22. typedef typename _A::reference reference;
  23. typedef typename _A::const_reference const_reference;
  24. typedef typename _A::value_type value_type;
  25. typedef _Tptr iterator;
  26. typedef _Ctptr const_iterator;
  27. typedef reverse_iterator<const_iterator, value_type,
  28. const_reference, _Ctptr, difference_type>
  29. const_reverse_iterator;
  30. typedef reverse_iterator<iterator, value_type,
  31. reference, _Tptr, difference_type>
  32. reverse_iterator;
  33. explicit vector(const _A& _Al = _A())
  34. : allocator(_Al), _First(0), _Last(0), _End(0) {}
  35. explicit vector(size_type _N, const _Ty& _V = _Ty(),
  36. const _A& _Al = _A())
  37. : allocator(_Al)
  38. {_First = allocator.allocate(_N, (void *)0);
  39. _Ufill(_First, _N, _V);
  40. _Last = _First + _N;
  41. _End = _Last; }
  42. vector(const _Myt& _X)
  43. : allocator(_X.allocator)
  44. {_First = allocator.allocate(_X.size(), (void *)0);
  45. _Last = _Ucopy(_X.begin(), _X.end(), _First);
  46. _End = _Last; }
  47. typedef const_iterator _It;
  48. vector(_It _F, _It _L, const _A& _Al = _A())
  49. : allocator(_Al), _First(0), _Last(0), _End(0)
  50. {insert(begin(), _F, _L); }
  51. ~vector()
  52. {_Destroy(_First, _Last);
  53. allocator.deallocate(_First, _End - _First);
  54. _First = 0, _Last = 0, _End = 0; }
  55. _Myt& operator=(const _Myt& _X)
  56. {if (this == &_X)
  57. ;
  58. else if (_X.size() <= size())
  59. {iterator _S = copy(_X.begin(), _X.end(), _First);
  60. _Destroy(_S, _Last);
  61. _Last = _First + _X.size(); }
  62. else if (_X.size() <= capacity())
  63. {const_iterator _S = _X.begin() + size();
  64. copy(_X.begin(), _S, _First);
  65. _Ucopy(_S, _X.end(), _Last);
  66. _Last = _First + _X.size(); }
  67. else
  68. {_Destroy(_First, _Last);
  69. allocator.deallocate(_First, _End - _First);
  70. _First = allocator.allocate(_X.size(), (void *)0);
  71. _Last = _Ucopy(_X.begin(), _X.end(),
  72. _First);
  73. _End = _Last; }
  74. return (*this); }
  75. void reserve(size_type _N)
  76. {if (capacity() < _N)
  77. {iterator _S = allocator.allocate(_N, (void *)0);
  78. _Ucopy(_First, _Last, _S);
  79. _Destroy(_First, _Last);
  80. allocator.deallocate(_First, _End - _First);
  81. _End = _S + _N;
  82. _Last = _S + size();
  83. _First = _S; }}
  84. size_type capacity() const
  85. {return (_First == 0 ? 0 : _End - _First); }
  86. iterator begin()
  87. {return (_First); }
  88. const_iterator begin() const
  89. {return ((const_iterator)_First); }
  90. iterator end()
  91. {return (_Last); }
  92. const_iterator end() const
  93. {return ((const_iterator)_Last); }
  94. reverse_iterator rbegin()
  95. {return (reverse_iterator(end())); }
  96. const_reverse_iterator rbegin() const
  97. {return (const_reverse_iterator(end())); }
  98. reverse_iterator rend()
  99. {return (reverse_iterator(begin())); }
  100. const_reverse_iterator rend() const
  101. {return (const_reverse_iterator(begin())); }
  102. void resize(size_type _N, const _Ty& _X = _Ty())
  103. {if (size() < _N)
  104. insert(end(), _N - size(), _X);
  105. else if (_N < size())
  106. erase(begin() + _N, end()); }
  107. size_type size() const
  108. {return (_First == 0 ? 0 : _Last - _First); }
  109. size_type max_size() const
  110. {return (allocator.max_size()); }
  111. bool empty() const
  112. {return (size() == 0); }
  113. _A get_allocator() const
  114. {return (allocator); }
  115. const_reference at(size_type _P) const
  116. {if (size() <= _P)
  117. _Xran();
  118. return (*(begin() + _P)); }
  119. reference at(size_type _P)
  120. {if (size() <= _P)
  121. _Xran();
  122. return (*(begin() + _P)); }
  123. const_reference operator[](size_type _P) const
  124. {return (*(begin() + _P)); }
  125. reference operator[](size_type _P)
  126. {return (*(begin() + _P)); }
  127. reference front()
  128. {return (*begin()); }
  129. const_reference front() const
  130. {return (*begin()); }
  131. reference back()
  132. {return (*(end() - 1)); }
  133. const_reference back() const
  134. {return (*(end() - 1)); }
  135. void push_back(const _Ty& _X)
  136. {insert(end(), _X); }
  137. void pop_back()
  138. {erase(end() - 1); }
  139. void assign(_It _F, _It _L)
  140. {erase(begin(), end());
  141. insert(begin(), _F, _L); }
  142. void assign(size_type _N, const _Ty& _X = _Ty())
  143. {erase(begin(), end());
  144. insert(begin(), _N, _X); }
  145. iterator insert(iterator _P, const _Ty& _X = _Ty())
  146. {size_type _O = _P - begin();
  147. insert(_P, 1, _X);
  148. return (begin() + _O); }
  149. void insert(iterator _P, size_type _M, const _Ty& _X)
  150. {if ((size_type)(_End - _Last) < _M)
  151. {size_type _N = size() + (_M < size() ? size() : _M);
  152. iterator _S = allocator.allocate(_N, (void *)0);
  153. iterator _Q = _Ucopy(_First, _P, _S);
  154. _Ufill(_Q, _M, _X);
  155. _Ucopy(_P, _Last, _Q + _M);
  156. _Destroy(_First, _Last);
  157. allocator.deallocate(_First, _End - _First);
  158. _End = _S + _N;
  159. _Last = _S + size() + _M;
  160. _First = _S; }
  161. else if ((size_type)(_Last - _P) < _M)
  162. {_Ucopy(_P, _Last, _P + _M);
  163. _Ufill(_Last, _M - (_Last - _P), _X);
  164. fill(_P, _Last, _X);
  165. _Last += _M; }
  166. else if (0 < _M)
  167. {_Ucopy(_Last - _M, _Last, _Last);
  168. copy_backward(_P, _Last - _M, _Last);
  169. fill(_P, _P + _M, _X);
  170. _Last += _M; }}
  171. void insert(iterator _P, _It _F, _It _L)
  172. {size_type _M = 0;
  173. _Distance(_F, _L, _M);
  174. if (_End - _Last < _M)
  175. {size_type _N = size() + (_M < size() ? size() : _M);
  176. iterator _S = allocator.allocate(_N, (void *)0);
  177. iterator _Q = _Ucopy(_First, _P, _S);
  178. _Q = _Ucopy(_F, _L, _Q);
  179. _Ucopy(_P, _Last, _Q);
  180. _Destroy(_First, _Last);
  181. allocator.deallocate(_First, _End - _First);
  182. _End = _S + _N;
  183. _Last = _S + size() + _M;
  184. _First = _S; }
  185. else if (_Last - _P < _M)
  186. {_Ucopy(_P, _Last, _P + _M);
  187. _Ucopy(_F + (_Last - _P), _L, _Last);
  188. copy(_F, _F + (_Last - _P), _P);
  189. _Last += _M; }
  190. else if (0 < _M)
  191. {_Ucopy(_Last - _M, _Last, _Last);
  192. copy_backward(_P, _Last - _M, _Last);
  193. copy(_F, _L, _P);
  194. _Last += _M; }}
  195. iterator erase(iterator _P)
  196. {copy(_P + 1, end(), _P);
  197. _Destroy(_Last - 1, _Last);
  198. --_Last;
  199. return (_P); }
  200. iterator erase(iterator _F, iterator _L)
  201. {iterator _S = copy(_L, end(), _F);
  202. _Destroy(_S, end());
  203. _Last = _S;
  204. return (_F); }
  205. void clear()
  206. {erase(begin(), end()); }
  207. bool _Eq(const _Myt& _X) const
  208. {return (size() == _X.size()
  209. && equal(begin(), end(), _X.begin())); }
  210. bool _Lt(const _Myt& _X) const
  211. {return (lexicographical_compare(begin(), end(),
  212. _X.begin(), _X.end())); }
  213. void swap(_Myt& _X)
  214. {if (allocator == _X.allocator)
  215. {std::swap(_First, _X._First);
  216. std::swap(_Last, _X._Last);
  217. std::swap(_End, _X._End); }
  218. else
  219. {_Myt _Ts = *this; *this = _X, _X = _Ts; }}
  220. friend void swap(_Myt& _X, _Myt& _Y)
  221. {_X.swap(_Y); }
  222. protected:
  223. void _Destroy(iterator _F, iterator _L)
  224. {for (; _F != _L; ++_F)
  225. allocator.destroy(_F); }
  226. iterator _Ucopy(const_iterator _F, const_iterator _L,
  227. iterator _P)
  228. {for (; _F != _L; ++_P, ++_F)
  229. allocator.construct(_P, *_F);
  230. return (_P); }
  231. void _Ufill(iterator _F, size_type _N, const _Ty &_X)
  232. {for (; 0 < _N; --_N, ++_F)
  233. allocator.construct(_F, _X); }
  234. void _Xran() const
  235. {_THROW(out_of_range, "invalid vector<T> subscript"); }
  236. _A allocator;
  237. iterator _First, _Last, _End;
  238. };
  239. // CLASS vector<_Bool, allocator>
  240. typedef unsigned int _Vbase;
  241. const int _VBITS = CHAR_BIT * sizeof (_Vbase);
  242. typedef allocator<_Vbase> _Bool_allocator;
  243. template <>
  244. class vector<_Bool, _Bool_allocator> {
  245. public:
  246. typedef _Bool_allocator _A;
  247. typedef _Bool _Ty;
  248. typedef vector<_Ty, _A> _Myt;
  249. typedef vector<_Vbase, _A> _Vbtype;
  250. typedef _A allocator_type;
  251. typedef _A::size_type size_type;
  252. typedef _A::difference_type difference_type;
  253. // CLASS reference
  254. class reference {
  255. public:
  256. reference()
  257. : _Mask(0), _Ptr(0) {}
  258. reference(size_t _O, _Vbase *_P)
  259. : _Mask((_Vbase)(1 << _O)), _Ptr(_P) {}
  260. reference& operator=(const reference& _X)
  261. {return (*this = bool(_X)); }
  262. reference& operator=(bool _V)
  263. {if (_V)
  264. *_Ptr |= _Mask;
  265. else
  266. *_Ptr &= ~_Mask;
  267. return (*this); }
  268. void flip()
  269. {*_Ptr ^= _Mask; }
  270. bool operator~() const
  271. {return (!bool(*this)); }
  272. operator bool() const
  273. {return ((*_Ptr & _Mask) != 0); }
  274. protected:
  275. _Vbase _Mask, *_Ptr;
  276. };
  277. typedef const reference const_reference;
  278. typedef bool value_type;
  279. // CLASS iterator
  280. class iterator : public _Ranit<_Bool, difference_type> {
  281. public:
  282. iterator()
  283. : _Off(0), _Ptr(0) {}
  284. iterator(size_t _O, _Vbase *_P)
  285. : _Off(_O), _Ptr(_P) {}
  286. reference operator*() const
  287. {return (reference(_Off, _Ptr)); }
  288. iterator& operator++()
  289. {_Inc();
  290. return (*this); }
  291. iterator operator++(int)
  292. {iterator _Tmp = *this;
  293. _Inc();
  294. return (_Tmp); }
  295. iterator& operator--()
  296. {_Dec();
  297. return (*this); }
  298. iterator operator--(int)
  299. {iterator _Tmp = *this;
  300. _Dec();
  301. return (_Tmp); }
  302. iterator& operator+=(difference_type _N)
  303. {_Off += (size_t) _N;
  304. _Ptr += _Off / _VBITS;
  305. _Off %= _VBITS;
  306. return (*this); }
  307. iterator& operator-=(difference_type _N)
  308. {return (*this += -_N); }
  309. iterator operator+(difference_type _N) const
  310. {iterator _Tmp = *this;
  311. return (_Tmp += _N); }
  312. iterator operator-(difference_type _N) const
  313. {iterator _Tmp = *this;
  314. return (_Tmp -= _N); }
  315. difference_type operator-(const iterator _X) const
  316. {return (_VBITS * (_Ptr - _X._Ptr)
  317. + (difference_type)_Off
  318. - (difference_type)_X._Off); }
  319. reference operator[](difference_type _N) const
  320. {return (*(*this + _N)); }
  321. bool operator==(const iterator& _X) const
  322. {return (_Ptr == _X._Ptr && _Off == _X._Off); }
  323. bool operator!=(const iterator& _X) const
  324. {return (!(*this == _X)); }
  325. bool operator<(const iterator& _X) const
  326. {return (_Ptr < _X._Ptr
  327. || _Ptr == _X._Ptr && _Off < _X._Off); }
  328. bool operator>(const iterator& _X) const
  329. {return (_X < *this); }
  330. bool operator<=(const iterator& _X) const
  331. {return (!(_X < *this)); }
  332. bool operator>=(const iterator& _X) const
  333. {return (!(*this < _X)); }
  334. protected:
  335. void _Dec()
  336. {if (_Off != 0)
  337. --_Off;
  338. else
  339. _Off = _VBITS - 1, --_Ptr; }
  340. void _Inc()
  341. {if (_Off < _VBITS - 1)
  342. ++_Off;
  343. else
  344. _Off = 0, ++_Ptr; }
  345. size_t _Off;
  346. _Vbase *_Ptr;
  347. };
  348. // CLASS const_iterator
  349. class const_iterator : public iterator {
  350. public:
  351. const_iterator()
  352. : iterator() {}
  353. const_iterator(size_t _O, const _Vbase *_P)
  354. : iterator(_O, (_Vbase *)_P) {}
  355. const_iterator(const iterator& _X)
  356. : iterator(_X) {}
  357. const_reference operator*() const
  358. {return (reference(_Off, _Ptr)); }
  359. const_iterator& operator++()
  360. {_Inc();
  361. return (*this); }
  362. const_iterator operator++(int)
  363. {const_iterator _Tmp = *this;
  364. _Inc();
  365. return (_Tmp); }
  366. const_iterator& operator--()
  367. {_Dec();
  368. return (*this); }
  369. const_iterator operator--(int)
  370. {const_iterator _Tmp = *this;
  371. _Dec();
  372. return (_Tmp); }
  373. const_iterator& operator+=(difference_type _N)
  374. {_Off += (size_t) _N;
  375. _Ptr += _Off / _VBITS;
  376. _Off %= _VBITS;
  377. return (*this); }
  378. const_iterator& operator-=(difference_type _N)
  379. {return (*this += -_N); }
  380. const_iterator operator+(difference_type _N) const
  381. {const_iterator _Tmp = *this;
  382. return (_Tmp += _N); }
  383. const_iterator operator-(difference_type _N) const
  384. {const_iterator _Tmp = *this;
  385. return (_Tmp -= _N); }
  386. difference_type operator-(const const_iterator _X) const
  387. {return (_VBITS * (_Ptr - _X._Ptr)
  388. + (difference_type)_Off
  389. - (difference_type)_X._Off); }
  390. const_reference operator[](difference_type _N) const
  391. {return (*(*this + _N)); }
  392. bool operator==(const const_iterator& _X) const
  393. {return (_Ptr == _X._Ptr && _Off == _X._Off); }
  394. bool operator!=(const const_iterator& _X) const
  395. {return (!(*this == _X)); }
  396. bool operator<(const const_iterator& _X) const
  397. {return (_Ptr < _X._Ptr
  398. || _Ptr == _X._Ptr && _Off < _X._Off); }
  399. bool operator>(const const_iterator& _X) const
  400. {return (_X < *this); }
  401. bool operator<=(const const_iterator& _X) const
  402. {return (!(_X < *this)); }
  403. bool operator>=(const const_iterator& _X) const
  404. {return (!(*this < _X)); }
  405. };
  406. typedef reverse_iterator<const_iterator, value_type,
  407. const_reference, const_reference *, difference_type>
  408. const_reverse_iterator;
  409. typedef reverse_iterator<iterator, value_type,
  410. reference, reference *, difference_type>
  411. reverse_iterator;
  412. explicit vector(const _A& _Al = _A())
  413. : _Size(0), _Vec(_Al) {}
  414. explicit vector(size_type _N, const bool _V = false,
  415. const _A& _Al = _A())
  416. : _Vec(_Nw(_N), _V ? -1 : 0, _Al) {_Trim(_N); }
  417. typedef const_iterator _It;
  418. vector(_It _F, _It _L, const _A& _Al = _A())
  419. : _Size(0), _Vec(_Al)
  420. {insert(begin(), _F, _L); }
  421. ~vector()
  422. {_Size = 0; }
  423. void reserve(size_type _N)
  424. {_Vec.reserve(_Nw(_N)); }
  425. size_type capacity() const
  426. {return (_Vec.capacity() * _VBITS); }
  427. iterator begin()
  428. {return (iterator(0, _Vec.begin())); }
  429. const_iterator begin() const
  430. {return (const_iterator(0, _Vec.begin())); }
  431. iterator end()
  432. {iterator _Tmp = begin();
  433. if (0 < _Size)
  434. _Tmp += _Size;
  435. return (_Tmp); }
  436. const_iterator end() const
  437. {const_iterator _Tmp = begin();
  438. if (0 < _Size)
  439. _Tmp += _Size;
  440. return (_Tmp); }
  441. reverse_iterator rbegin()
  442. {return (reverse_iterator(end())); }
  443. const_reverse_iterator rbegin() const
  444. {return (const_reverse_iterator(end())); }
  445. reverse_iterator rend()
  446. {return (reverse_iterator(begin())); }
  447. const_reverse_iterator rend() const
  448. {return (const_reverse_iterator(begin())); }
  449. void resize(size_type _N, bool _X = false)
  450. {if (size() < _N)
  451. insert(end(), _N - size(), _X);
  452. else if (_N < size())
  453. erase(begin() + _N, end()); }
  454. size_type size() const
  455. {return (_Size); }
  456. size_type max_size() const
  457. {return (_Vec.max_size() * _VBITS); }
  458. bool empty() const
  459. {return (size() == 0); }
  460. _A get_allocator() const
  461. {return (_Vec.get_allocator()); }
  462. const_reference at(size_type _P) const
  463. {if (size() <= _P)
  464. _Xran();
  465. return (*(begin() + _P)); }
  466. reference at(size_type _P)
  467. {if (size() <= _P)
  468. _Xran();
  469. return (*(begin() + _P)); }
  470. const_reference operator[](size_type _P) const
  471. {return (*(begin() + _P)); }
  472. reference operator[](size_type _P)
  473. {return (*(begin() + _P)); }
  474. reference front()
  475. {return (*begin()); }
  476. const_reference front() const
  477. {return (*begin()); }
  478. reference back()
  479. {return (*(end() - 1)); }
  480. const_reference back() const
  481. {return (*(end() - 1)); }
  482. void push_back(const bool _X)
  483. {insert(end(), _X); }
  484. void pop_back()
  485. {erase(end() - 1); }
  486. void assign(_It _F, _It _L)
  487. {erase(begin(), end());
  488. insert(begin(), _F, _L); }
  489. void assign(size_type _N, const bool _X = false)
  490. {erase(begin(), end());
  491. insert(begin(), _N, _X); }
  492. iterator insert(iterator _P, const bool _X = false)
  493. {size_type _O = _P - begin();
  494. insert(_P, 1, _X);
  495. return (begin() + _O); }
  496. void insert(iterator _P, size_type _M, const bool _X)
  497. {if (0 < _M)
  498. {if (capacity() - size() < _M)
  499. {size_type _O = _P - begin();
  500. _Vec.resize(_Nw(size() + _M), 0);
  501. _P = begin() + _O; }
  502. copy_backward(_P, end(), end() + _M);
  503. fill(_P, _P + _M, _X);
  504. _Size += _M; }}
  505. void insert(iterator _P, _It _F, _It _L)
  506. {size_type _M = 0;
  507. _Distance(_F, _L, _M);
  508. if (0 < _M)
  509. {if (capacity() - size() < _M)
  510. {size_type _O = _P - begin();
  511. _Vec.resize(_Nw(size() + _M), 0);
  512. _P = begin() + _O; }
  513. copy_backward(_P, end(), end() + _M);
  514. copy(_F, _L, _P);
  515. _Size += _M; }}
  516. iterator erase(iterator _P)
  517. {copy(_P + 1, end(), _P);
  518. _Trim(_Size - 1);
  519. return (_P); }
  520. iterator erase(iterator _F, iterator _L)
  521. {iterator _S = copy(_L, end(), _F);
  522. _Trim(_S - begin());
  523. return (_F); }
  524. void clear()
  525. {erase(begin(), end()); }
  526. void flip()
  527. {for (_Vbtype::iterator _S = _Vec.begin();
  528. _S != _Vec.end(); ++_S)
  529. *_S = ~*_S;
  530. _Trim(_Size); }
  531. bool _Eq(const _Myt& _X) const
  532. {return (_Size == _X._Size && _Vec._Eq(_X._Vec)); }
  533. bool _Lt(const _Myt& _X) const
  534. {return (_Size < _X._Size
  535. || _Size == _X._Size && _Vec._Lt(_X._Vec)); }
  536. void swap(_Myt& _X)
  537. {std::swap(_Size, _X._Size);
  538. _Vec.swap(_X._Vec); }
  539. friend void swap(_Myt& _X, _Myt& _Y)
  540. {_X.swap(_Y); }
  541. static void swap(reference _X, reference _Y)
  542. {bool _V = _X;
  543. _X = _Y;
  544. _Y = _V; }
  545. protected:
  546. static size_type _Nw(size_type _N)
  547. {return ((_N + _VBITS - 1) / _VBITS); }
  548. void _Trim(size_type _N)
  549. {size_type _M = _Nw(_N);
  550. if (_M < _Vec.size())
  551. _Vec.erase(_Vec.begin() + _M, _Vec.end());
  552. _Size = _N;
  553. _N %= _VBITS;
  554. if (0 < _N)
  555. _Vec[_M - 1] &= ((_Vbase)1 << _N) - 1; }
  556. void _Xran() const
  557. {_THROW(out_of_range, "invalid vector<bool> subscript"); }
  558. size_type _Size;
  559. _Vbtype _Vec;
  560. };
  561. typedef vector<_Bool, _Bool_allocator> _Bvector;
  562. // vector TEMPLATE OPERATORS
  563. template<class _Ty, class _A> inline
  564. bool operator==(const vector<_Ty, _A>& _X,
  565. const vector<_Ty, _A>& _Y)
  566. {return (_X._Eq(_Y)); }
  567. template<class _Ty, class _A> inline
  568. bool operator!=(const vector<_Ty, _A>& _X,
  569. const vector<_Ty, _A>& _Y)
  570. {return (!(_X == _Y)); }
  571. template<class _Ty, class _A> inline
  572. bool operator<(const vector<_Ty, _A>& _X,
  573. const vector<_Ty, _A>& _Y)
  574. {return (_X._Lt(_Y)); }
  575. template<class _Ty, class _A> inline
  576. bool operator>(const vector<_Ty, _A>& _X,
  577. const vector<_Ty, _A>& _Y)
  578. {return (_Y < _X); }
  579. template<class _Ty, class _A> inline
  580. bool operator<=(const vector<_Ty, _A>& _X,
  581. const vector<_Ty, _A>& _Y)
  582. {return (!(_Y < _X)); }
  583. template<class _Ty, class _A> inline
  584. bool operator>=(const vector<_Ty, _A>& _X,
  585. const vector<_Ty, _A>& _Y)
  586. {return (!(_X < _Y)); }
  587. _STD_END
  588. #ifdef _MSC_VER
  589. #pragma pack(pop)
  590. #endif /* _MSC_VER */
  591. #endif /* _VECTOR_ */
  592. /*
  593. * Copyright (c) 1995 by P.J. Plauger. ALL RIGHTS RESERVED.
  594. * Consult your license regarding permissions and restrictions.
  595. */
  596. /*
  597. * This file is derived from software bearing the following
  598. * restrictions:
  599. *
  600. * Copyright (c) 1994
  601. * Hewlett-Packard Company
  602. *
  603. * Permission to use, copy, modify, distribute and sell this
  604. * software and its documentation for any purpose is hereby
  605. * granted without fee, provided that the above copyright notice
  606. * appear in all copies and that both that copyright notice and
  607. * this permission notice appear in supporting documentation.
  608. * Hewlett-Packard Company makes no representations about the
  609. * suitability of this software for any purpose. It is provided
  610. * "as is" without express or implied warranty.
  611. */