Source code of Windows XP (NT5)
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.

614 lines
18 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 _A::size_type size_type;
  19. typedef _A::difference_type difference_type;
  20. typedef _A::pointer _Tptr;
  21. typedef _A::const_pointer _Ctptr;
  22. typedef _A::reference reference;
  23. typedef _A::const_reference const_reference;
  24. typedef _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 (_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 (_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. class vector<_Bool, _Bool_allocator> {
  244. public:
  245. typedef _Bool_allocator _A;
  246. typedef _Bool _Ty;
  247. typedef vector<_Ty, _A> _Myt;
  248. typedef vector<_Vbase, _A> _Vbtype;
  249. typedef _A allocator_type;
  250. typedef _A::size_type size_type;
  251. typedef _A::difference_type difference_type;
  252. // CLASS reference
  253. class reference {
  254. public:
  255. reference()
  256. : _Mask(0), _Ptr(0) {}
  257. reference(size_t _O, _Vbase *_P)
  258. : _Mask((_Vbase)1 << _O), _Ptr(_P) {}
  259. reference& operator=(const reference& _X)
  260. {return (*this = bool(_X)); }
  261. reference& operator=(bool _V)
  262. {if (_V)
  263. *_Ptr |= _Mask;
  264. else
  265. *_Ptr &= ~_Mask;
  266. return (*this); }
  267. void flip()
  268. {*_Ptr ^= _Mask; }
  269. bool operator~() const
  270. {return (!bool(*this)); }
  271. operator bool() const
  272. {return ((*_Ptr & _Mask) != 0); }
  273. protected:
  274. _Vbase _Mask, *_Ptr;
  275. };
  276. typedef const reference const_reference;
  277. typedef bool value_type;
  278. // CLASS iterator
  279. class iterator : public _Ranit<_Bool, difference_type> {
  280. public:
  281. iterator()
  282. : _Off(0), _Ptr(0) {}
  283. iterator(size_t _O, _Vbase *_P)
  284. : _Off(_O), _Ptr(_P) {}
  285. reference operator*() const
  286. {return (reference(_Off, _Ptr)); }
  287. iterator& operator++()
  288. {_Inc();
  289. return (*this); }
  290. iterator operator++(int)
  291. {iterator _Tmp = *this;
  292. _Inc();
  293. return (_Tmp); }
  294. iterator& operator--()
  295. {_Dec();
  296. return (*this); }
  297. iterator operator--(int)
  298. {iterator _Tmp = *this;
  299. _Dec();
  300. return (_Tmp); }
  301. iterator& operator+=(difference_type _N)
  302. {_Off += (size_t) _N;
  303. _Ptr += _Off / _VBITS;
  304. _Off %= _VBITS;
  305. return (*this); }
  306. iterator& operator-=(difference_type _N)
  307. {return (*this += -_N); }
  308. iterator operator+(difference_type _N) const
  309. {iterator _Tmp = *this;
  310. return (_Tmp += _N); }
  311. iterator operator-(difference_type _N) const
  312. {iterator _Tmp = *this;
  313. return (_Tmp -= _N); }
  314. difference_type operator-(const iterator _X) const
  315. {return (_VBITS * (_Ptr - _X._Ptr)
  316. + (difference_type)_Off
  317. - (difference_type)_X._Off); }
  318. reference operator[](difference_type _N) const
  319. {return (*(*this + _N)); }
  320. bool operator==(const iterator& _X) const
  321. {return (_Ptr == _X._Ptr && _Off == _X._Off); }
  322. bool operator!=(const iterator& _X) const
  323. {return (!(*this == _X)); }
  324. bool operator<(const iterator& _X) const
  325. {return (_Ptr < _X._Ptr
  326. || _Ptr == _X._Ptr && _Off < _X._Off); }
  327. bool operator>(const iterator& _X) const
  328. {return (_X < *this); }
  329. bool operator<=(const iterator& _X) const
  330. {return (!(_X < *this)); }
  331. bool operator>=(const iterator& _X) const
  332. {return (!(*this < _X)); }
  333. protected:
  334. void _Dec()
  335. {if (_Off != 0)
  336. --_Off;
  337. else
  338. _Off = _VBITS - 1, --_Ptr; }
  339. void _Inc()
  340. {if (_Off < _VBITS - 1)
  341. ++_Off;
  342. else
  343. _Off = 0, ++_Ptr; }
  344. size_t _Off;
  345. _Vbase *_Ptr;
  346. };
  347. // CLASS const_iterator
  348. class const_iterator : public iterator {
  349. public:
  350. const_iterator()
  351. : iterator() {}
  352. const_iterator(size_t _O, const _Vbase *_P)
  353. : iterator(_O, (_Vbase *)_P) {}
  354. const_iterator(const iterator& _X)
  355. : iterator(_X) {}
  356. const_reference operator*() const
  357. {return (reference(_Off, _Ptr)); }
  358. const_iterator& operator++()
  359. {_Inc();
  360. return (*this); }
  361. const_iterator operator++(int)
  362. {const_iterator _Tmp = *this;
  363. _Inc();
  364. return (_Tmp); }
  365. const_iterator& operator--()
  366. {_Dec();
  367. return (*this); }
  368. const_iterator operator--(int)
  369. {const_iterator _Tmp = *this;
  370. _Dec();
  371. return (_Tmp); }
  372. const_iterator& operator+=(difference_type _N)
  373. {_Off += (size_t) _N;
  374. _Ptr += _Off / _VBITS;
  375. _Off %= _VBITS;
  376. return (*this); }
  377. const_iterator& operator-=(difference_type _N)
  378. {return (*this += -_N); }
  379. const_iterator operator+(difference_type _N) const
  380. {const_iterator _Tmp = *this;
  381. return (_Tmp += _N); }
  382. const_iterator operator-(difference_type _N) const
  383. {const_iterator _Tmp = *this;
  384. return (_Tmp -= _N); }
  385. difference_type operator-(const const_iterator _X) const
  386. {return (_VBITS * (_Ptr - _X._Ptr)
  387. + (difference_type)_Off
  388. - (difference_type)_X._Off); }
  389. const_reference operator[](difference_type _N) const
  390. {return (*(*this + _N)); }
  391. bool operator==(const const_iterator& _X) const
  392. {return (_Ptr == _X._Ptr && _Off == _X._Off); }
  393. bool operator!=(const const_iterator& _X) const
  394. {return (!(*this == _X)); }
  395. bool operator<(const const_iterator& _X) const
  396. {return (_Ptr < _X._Ptr
  397. || _Ptr == _X._Ptr && _Off < _X._Off); }
  398. bool operator>(const const_iterator& _X) const
  399. {return (_X < *this); }
  400. bool operator<=(const const_iterator& _X) const
  401. {return (!(_X < *this)); }
  402. bool operator>=(const const_iterator& _X) const
  403. {return (!(*this < _X)); }
  404. };
  405. typedef reverse_iterator<const_iterator, value_type,
  406. const_reference, const_reference *, difference_type>
  407. const_reverse_iterator;
  408. typedef reverse_iterator<iterator, value_type,
  409. reference, reference *, difference_type>
  410. reverse_iterator;
  411. explicit vector(const _A& _Al = _A())
  412. : _Size(0), _Vec(_Al) {}
  413. explicit vector(size_type _N, const bool _V = false,
  414. const _A& _Al = _A())
  415. : _Vec(_Nw(_N), _V ? -1 : 0, _Al) {_Trim(_N); }
  416. typedef const_iterator _It;
  417. vector(_It _F, _It _L, const _A& _Al = _A())
  418. : _Size(0), _Vec(_Al)
  419. {insert(begin(), _F, _L); }
  420. ~vector()
  421. {_Size = 0; }
  422. void reserve(size_type _N)
  423. {_Vec.reserve(_Nw(_N)); }
  424. size_type capacity() const
  425. {return (_Vec.capacity() * _VBITS); }
  426. iterator begin()
  427. {return (iterator(0, _Vec.begin())); }
  428. const_iterator begin() const
  429. {return (const_iterator(0, _Vec.begin())); }
  430. iterator end()
  431. {iterator _Tmp = begin();
  432. if (0 < _Size)
  433. _Tmp += _Size;
  434. return (_Tmp); }
  435. const_iterator end() const
  436. {const_iterator _Tmp = begin();
  437. if (0 < _Size)
  438. _Tmp += _Size;
  439. return (_Tmp); }
  440. reverse_iterator rbegin()
  441. {return (reverse_iterator(end())); }
  442. const_reverse_iterator rbegin() const
  443. {return (const_reverse_iterator(end())); }
  444. reverse_iterator rend()
  445. {return (reverse_iterator(begin())); }
  446. const_reverse_iterator rend() const
  447. {return (const_reverse_iterator(begin())); }
  448. void resize(size_type _N, bool _X = false)
  449. {if (size() < _N)
  450. insert(end(), _N - size(), _X);
  451. else if (_N < size())
  452. erase(begin() + _N, end()); }
  453. size_type size() const
  454. {return (_Size); }
  455. size_type max_size() const
  456. {return (_Vec.max_size() * _VBITS); }
  457. bool empty() const
  458. {return (size() == 0); }
  459. _A get_allocator() const
  460. {return (_Vec.get_allocator()); }
  461. const_reference at(size_type _P) const
  462. {if (size() <= _P)
  463. _Xran();
  464. return (*(begin() + _P)); }
  465. reference at(size_type _P)
  466. {if (size() <= _P)
  467. _Xran();
  468. return (*(begin() + _P)); }
  469. const_reference operator[](size_type _P) const
  470. {return (*(begin() + _P)); }
  471. reference operator[](size_type _P)
  472. {return (*(begin() + _P)); }
  473. reference front()
  474. {return (*begin()); }
  475. const_reference front() const
  476. {return (*begin()); }
  477. reference back()
  478. {return (*(end() - 1)); }
  479. const_reference back() const
  480. {return (*(end() - 1)); }
  481. void push_back(const bool _X)
  482. {insert(end(), _X); }
  483. void pop_back()
  484. {erase(end() - 1); }
  485. void assign(_It _F, _It _L)
  486. {erase(begin(), end());
  487. insert(begin(), _F, _L); }
  488. void assign(size_type _N, const bool _X = false)
  489. {erase(begin(), end());
  490. insert(begin(), _N, _X); }
  491. iterator insert(iterator _P, const bool _X = false)
  492. {size_type _O = _P - begin();
  493. insert(_P, 1, _X);
  494. return (begin() + _O); }
  495. void insert(iterator _P, size_type _M, const bool _X)
  496. {if (0 < _M)
  497. {if (capacity() - size() < _M)
  498. {size_type _O = _P - begin();
  499. _Vec.resize(_Nw(size() + _M), 0);
  500. _P = begin() + _O; }
  501. copy_backward(_P, end(), end() + _M);
  502. fill(_P, _P + _M, _X);
  503. _Size += _M; }}
  504. void insert(iterator _P, _It _F, _It _L)
  505. {size_type _M = 0;
  506. _Distance(_F, _L, _M);
  507. if (0 < _M)
  508. {if (capacity() - size() < _M)
  509. {size_type _O = _P - begin();
  510. _Vec.resize(_Nw(size() + _M), 0);
  511. _P = begin() + _O; }
  512. copy_backward(_P, end(), end() + _M);
  513. copy(_F, _L, _P);
  514. _Size += _M; }}
  515. iterator erase(iterator _P)
  516. {copy(_P + 1, end(), _P);
  517. _Trim(_Size - 1);
  518. return (_P); }
  519. iterator erase(iterator _F, iterator _L)
  520. {iterator _S = copy(_L, end(), _F);
  521. _Trim(_S - begin());
  522. return (_F); }
  523. void clear()
  524. {erase(begin(), end()); }
  525. void flip()
  526. {for (_Vbtype::iterator _S = _Vec.begin();
  527. _S != _Vec.end(); ++_S)
  528. *_S = ~*_S;
  529. _Trim(_Size); }
  530. bool _Eq(const _Myt& _X) const
  531. {return (_Size == _X._Size && _Vec._Eq(_X._Vec)); }
  532. bool _Lt(const _Myt& _X) const
  533. {return (_Size < _X._Size
  534. || _Size == _X._Size && _Vec._Lt(_X._Vec)); }
  535. void swap(_Myt& _X)
  536. {std::swap(_Size, _X._Size);
  537. _Vec.swap(_X._Vec); }
  538. friend void swap(_Myt& _X, _Myt& _Y)
  539. {_X.swap(_Y); }
  540. static void swap(reference _X, reference _Y)
  541. {bool _V = _X;
  542. _X = _Y;
  543. _Y = _V; }
  544. protected:
  545. static size_type _Nw(size_type _N)
  546. {return ((_N + _VBITS - 1) / _VBITS); }
  547. void _Trim(size_type _N)
  548. {size_type _M = _Nw(_N);
  549. if (_M < _Vec.size())
  550. _Vec.erase(_Vec.begin() + _M, _Vec.end());
  551. _Size = _N;
  552. _N %= _VBITS;
  553. if (0 < _N)
  554. _Vec[_M - 1] &= ((_Vbase)1 << _N) - 1; }
  555. void _Xran() const
  556. {_THROW(out_of_range, "invalid vector<bool> subscript"); }
  557. size_type _Size;
  558. _Vbtype _Vec;
  559. };
  560. typedef vector<_Bool, _Bool_allocator> _Bvector;
  561. // vector TEMPLATE OPERATORS
  562. template<class _Ty, class _A> inline
  563. bool operator==(const vector<_Ty, _A>& _X,
  564. const vector<_Ty, _A>& _Y)
  565. {return (_X._Eq(_Y)); }
  566. template<class _Ty, class _A> inline
  567. bool operator!=(const vector<_Ty, _A>& _X,
  568. const vector<_Ty, _A>& _Y)
  569. {return (!(_X == _Y)); }
  570. template<class _Ty, class _A> inline
  571. bool operator<(const vector<_Ty, _A>& _X,
  572. const vector<_Ty, _A>& _Y)
  573. {return (_X._Lt(_Y)); }
  574. template<class _Ty, class _A> inline
  575. bool operator>(const vector<_Ty, _A>& _X,
  576. const vector<_Ty, _A>& _Y)
  577. {return (_Y < _X); }
  578. template<class _Ty, class _A> inline
  579. bool operator<=(const vector<_Ty, _A>& _X,
  580. const vector<_Ty, _A>& _Y)
  581. {return (!(_Y < _X)); }
  582. template<class _Ty, class _A> inline
  583. bool operator>=(const vector<_Ty, _A>& _X,
  584. const vector<_Ty, _A>& _Y)
  585. {return (!(_X < _Y)); }
  586. _STD_END
  587. #ifdef _MSC_VER
  588. #pragma pack(pop)
  589. #endif /* _MSC_VER */
  590. #endif /* _VECTOR_ */
  591. /*
  592. * Copyright (c) 1995 by P.J. Plauger. ALL RIGHTS RESERVED.
  593. * Consult your license regarding permissions and restrictions.
  594. */
  595. /*
  596. * This file is derived from software bearing the following
  597. * restrictions:
  598. *
  599. * Copyright (c) 1994
  600. * Hewlett-Packard Company
  601. *
  602. * Permission to use, copy, modify, distribute and sell this
  603. * software and its documentation for any purpose is hereby
  604. * granted without fee, provided that the above copyright notice
  605. * appear in all copies and that both that copyright notice and
  606. * this permission notice appear in supporting documentation.
  607. * Hewlett-Packard Company makes no representations about the
  608. * suitability of this software for any purpose. It is provided
  609. * "as is" without express or implied warranty.
  610. */