Guest User

Untitled

a guest
Mar 6th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.46 KB | None | 0 0
  1. #ifndef LIST_HPP
  2. #define LIST_HPP
  3.  
  4. #include <iostream>
  5. #include <exception>
  6. #include <cstdlib>
  7.  
  8. #define EXIT 1
  9.  
  10. namespace LinkedList{
  11.  
  12.  
  13. template<class T>
  14. class List;
  15. template<class T>
  16. class ListIterator;
  17.  
  18. /******************************************************************************************************
  19. * *
  20. * Exceptions *
  21. * *
  22. ******************************************************************************************************/
  23.  
  24.  
  25. class excp1:std::exception
  26. {
  27. public:
  28. virtual const char* what() const throw()
  29. {
  30. return "Must be two lists, or two list nodes !";
  31. }
  32. };
  33.  
  34. class excp2:std::exception
  35. {
  36. public:
  37. virtual const char* what() const throw()
  38. {
  39. return "Index out of list bounds !";
  40. }
  41. };
  42.  
  43. class excp3:std::exception
  44. {
  45. public:
  46. virtual const char* what() const throw()
  47. {
  48. return "Cannot resize the list to a negative size !";
  49. }
  50. };
  51.  
  52. class excp4:std::exception
  53. {
  54. public:
  55. virtual const char* what() const throw()
  56. {
  57. return "This object is not a list !";
  58. }
  59. };
  60.  
  61. class excp5:std::exception
  62. {
  63. public:
  64. virtual const char* what() const throw()
  65. {
  66. return "This is a list, not a single object !";
  67. }
  68. };
  69.  
  70. class excp6:std::exception
  71. {
  72. public:
  73. virtual const char* what() const throw()
  74. {
  75. return "The iterator has not been assigned yet !";
  76. }
  77. };
  78.  
  79. class excp7:std::exception
  80. {
  81. public:
  82. virtual const char* what() const throw()
  83. {
  84. return "The iterator has reached the end !";
  85. }
  86. };
  87.  
  88. /********************************************************************************************************
  89. * *
  90. * List *
  91. * *
  92. ********************************************************************************************************/
  93.  
  94.  
  95. template <class T>
  96. class List
  97. {
  98. public:
  99. List();
  100. List (const T& info);
  101. List (const List<T>& item);
  102. ~List();
  103. int size();
  104. void resize(int length) throw();
  105. void add(T info,int i) throw();
  106. void push_back(T info);
  107. void push_front(T info);
  108. void remove(int i);
  109. void swap(int i,int j) throw();
  110. void swap(List<T>& a, List<T>& b) throw();
  111. bool in(T info);
  112. T pop_back();
  113. T pop_front();
  114. bool empty();
  115. T& get(int i) throw();
  116. T& get() throw();
  117. void set(T info);
  118. template <class T1>
  119. friend std::ostream& operator<< (std::ostream& out, List<T1>& l);
  120. template<class T1>
  121. friend std::istream& operator>> (std::istream& in, List<T1>& l);
  122. template <class T1>
  123. friend List<T1>& operator+(List<T1>& l1, List<T1>& l2);
  124. template <class T1>
  125. friend List<T1>& operator&(List<T1>& l1, List<T1>& l2) throw();
  126. template<class T1>
  127. friend List<T1>& operator| (List<T1>& l1, List<T1>& l2) throw();
  128. List<T>& operator[] (int i) throw();
  129. List<T>& operator=(List<T>& l) throw();
  130. List<T>& operator=(const T& info);
  131. List<T>& operator+= (List<T>& l);
  132. bool operator== (List<T>& l) throw();
  133. bool operator!= (List<T>&l);
  134. bool operator< (List<T>&l) throw();
  135. bool operator>= (List<T>&l);
  136. bool operator > (List<T>&l) throw();
  137. bool operator <= (List<T>& l);
  138. typedef ListIterator<T> iterator;
  139. template<class T1>
  140. friend class ListIterator;
  141. ListIterator<T>& front() throw();
  142. ListIterator<T>& back() throw();
  143. ListIterator<T>& ending() throw();
  144. protected:
  145. static ListIterator<T> iter;
  146. T info;
  147. bool end;
  148. int length;
  149. List<T>* next;
  150. List<T>* prev;
  151. };
  152.  
  153. template<class T>
  154. ListIterator<T> List<T>::iter;
  155.  
  156.  
  157. template <class T>
  158. List<T>::List()
  159. {
  160. end=true;
  161. length=0;
  162. next=prev=this;
  163. }
  164.  
  165. template <class T>
  166. List<T>::List(const T& info)
  167. {
  168. end=false;
  169. next=prev=this;
  170. this->info=info;
  171. }
  172.  
  173. template<class T>
  174. List<T>::List(const List<T>& item)
  175. {
  176. List<T>* ptr;
  177. ptr=item.next;
  178. prev=next=this;
  179. end=true;
  180. length=0;
  181. for(int i=0;i<item.length;i++)
  182. {
  183. push_back(ptr->info);
  184. ptr=ptr->next;
  185. }
  186. }
  187.  
  188. template<class T>
  189. List<T>::~List()
  190. {
  191. List<T>* ptr,*temp;
  192. ptr=next;
  193. if(end)
  194. {
  195. while(!ptr->end)
  196. {
  197. temp=ptr->next;
  198. delete ptr;
  199. ptr=temp;
  200. }
  201. }
  202. }
  203.  
  204. template<class T>
  205. int List<T>::size()
  206. {
  207. return length;
  208. }
  209.  
  210. template<class T>
  211. void List<T>::resize(int length) throw()
  212. {
  213. T obj;
  214. try
  215. {
  216. if(length<0)
  217. throw excp3();
  218. }
  219. catch (excp3& e)
  220. {
  221. std::cerr << "Exception: " << e.what() << std::endl;
  222. exit(EXIT);
  223. }
  224. for(int i=this->length;i<length;i++)
  225. push_back(obj);
  226. for(int i=this->length;i>length;i--)
  227. pop_back();
  228. }
  229.  
  230.  
  231. template <class T>
  232. T& List<T>::get(int i) throw()
  233. {
  234. try
  235. {
  236. if(!end)
  237. throw excp4();
  238. }
  239. catch(excp4& e)
  240. {
  241. std::cerr << "Exception: " << e.what() << std::endl;
  242. exit(EXIT);
  243. }
  244. return (*this)[i].info;
  245. }
  246.  
  247. template<class T>
  248. T& List<T>::get() throw()
  249. {
  250. try
  251. {
  252. if(end)
  253. throw excp5();
  254. }
  255. catch(excp5& e)
  256. {
  257. std::cerr << "Exception: " << e.what() << std::endl;
  258. exit(EXIT);
  259. }
  260. return this->info;
  261. }
  262.  
  263. template<class T>
  264. void List<T>::set(T info)
  265. {
  266. List<T>* ptr;
  267. ptr=next;
  268. if(end)
  269. {
  270. while(!ptr->end)
  271. {
  272. ptr->set(info);
  273. ptr=ptr->next;
  274. }
  275. }
  276. else
  277. {
  278. this->info=info;
  279. }
  280. }
  281.  
  282.  
  283. template<class T>
  284. void List<T>::add(T info,int i) throw()
  285. {
  286. List<T>* p1,*p2,*temp;
  287. temp=new List<T>(info);
  288. try
  289. {
  290. if(i>length)
  291. throw excp2();
  292. }
  293. catch (excp2& e)
  294. {
  295. std::cerr << "Exception: " << e.what() << std::endl;
  296. exit(EXIT);
  297. }
  298. p2=this->next;
  299. for(int j=0;j<i;j++)
  300. p2=p2->next;
  301. p1=p2->prev;
  302. p1->next=temp;
  303. temp->prev=p1;
  304. p2->prev=temp;
  305. temp->next=p2;
  306. length++;
  307. }
  308.  
  309. template<class T>
  310. void List<T>::push_back(T info)
  311. {
  312. add(info,length);
  313. }
  314.  
  315. template<class T>
  316. void List<T>::push_front(T info)
  317. {
  318. add(info,0);
  319. }
  320.  
  321. template<class T>
  322. void List<T>::remove(int i)
  323. {
  324. List<T>* temp,*p1,*p2;
  325. temp=&(*this)[i];
  326. p1=temp->prev;
  327. p2=temp->next;
  328. delete temp;
  329. p1->next=p2;
  330. p2->prev=p1;
  331. length--;
  332. }
  333.  
  334. template<class T>
  335. void List<T>::swap(int i,int j) throw()
  336. {
  337. List<T>* ptr=next,*pi=NULL,*pj=NULL;
  338. T temp;
  339. try
  340. {
  341. if(i>=length || j>=length)
  342. throw excp2();
  343. }
  344. catch(excp2& e)
  345. {
  346. std::cerr << "Exception: " << e.what() << std::endl;
  347. exit(EXIT);
  348. }
  349. for(int k=0; k<length && (pi==NULL || pj==NULL) && i!=j; k++)
  350. {
  351. if(i==k)
  352. pi=ptr;
  353. else if(j==k)
  354. pj=ptr;
  355. ptr=ptr->next;
  356. }
  357. temp=pi->info;
  358. pi->info=pj->info;
  359. pj->info=temp;
  360. }
  361.  
  362. template<class T>
  363. void List<T>::swap(List<T>& a, List<T>& b) throw()
  364. {
  365. List<T> *temp;
  366. T temp_value;
  367. try
  368. {
  369. if(a.end ^ b.end)
  370. throw excp1();
  371. }
  372. catch(excp1& e)
  373. {
  374. std::cerr << "Exception: " << e.what() << std::endl;
  375. exit(EXIT);
  376. }
  377. if(a.end)
  378. {
  379. temp=new List<T> (a);
  380. a=b;
  381. b=*temp;
  382. delete temp;
  383. }
  384. else
  385. {
  386. temp_value=a.info;
  387. a.info=b.info;
  388. b.info=temp_value;
  389. }
  390. }
  391.  
  392.  
  393. template <class T>
  394. bool List<T>::in(T info)
  395. {
  396. List<T>* ptr;
  397. bool result=false;
  398. ptr=next;
  399. if(end)
  400. {
  401. while(!ptr->end && !result)
  402. {
  403. result=(ptr->info == info);
  404. ptr=ptr->next;
  405. }
  406. }
  407. else
  408. {
  409. result=(this->info==info);
  410. }
  411. return result;
  412. }
  413.  
  414. template<class T>
  415. T List<T>::pop_back()
  416. {
  417. T info=(*this)[length-1].info;
  418. remove(length-1);
  419. return info;
  420. }
  421.  
  422. template<class T>
  423. T List<T>::pop_front()
  424. {
  425. T info=(*this)[0].info;
  426. remove(0);
  427. return info;
  428. }
  429.  
  430. template<class T>
  431. bool List<T>::empty()
  432. {
  433. return (length==0);
  434. }
  435.  
  436.  
  437. template<class T>
  438. std::ostream& operator<< (std::ostream& out, List<T>& l)
  439. {
  440. List<T>* ptr;
  441. if(l.end)
  442. {
  443. ptr=l.next;
  444. while(!ptr->end)
  445. {
  446. out << ptr->info<<"\t";
  447. ptr=ptr->next;
  448. }
  449. }
  450. else
  451. {
  452. ptr=&l;
  453. out << ptr->info;
  454. }
  455. return out;
  456. }
  457.  
  458. template<class T>
  459. std::istream& operator>> (std::istream& in, List<T>& l)
  460. {
  461. List<T>* ptr=l.next;
  462. if(l.end)
  463. {
  464. while(!ptr->end)
  465. {
  466. in >> ptr->info;
  467. ptr=ptr->next;
  468. }
  469. }
  470. else
  471. {
  472. in>>l.info;
  473. }
  474. return in;
  475. }
  476.  
  477. template <class T>
  478. List<T>& operator+ (List<T>& l1, List<T>& l2)
  479. {
  480. List<T>* temp=new List<T>(l1);
  481. (*temp)+=l2;
  482. return (*temp);
  483. }
  484.  
  485. template <class T>
  486. List<T>& operator& (List<T>& l1, List<T>& l2) throw()
  487. {
  488. List<T>* temp,*ptr=l1.next;
  489. temp=new List<T>();
  490. try
  491. {
  492. if( (l1.end)^(l2.end) )
  493. throw excp1();
  494. }
  495. catch (excp1& e)
  496. {
  497. std::cerr << "Exception: " << e.what() << std::endl;
  498. exit(EXIT);
  499. }
  500. if(l1.end)
  501. {
  502. while(!ptr->end)
  503. {
  504. if(l2.in(ptr->info))
  505. temp->push_back(ptr->info);
  506. ptr=ptr->next;
  507. }
  508. }
  509. else
  510. {
  511. if(l1.info==l2.info)
  512. temp->push_back(l1.info);
  513. }
  514. return *temp;
  515. }
  516.  
  517. template<class T>
  518. List<T>& operator| (List<T>& l1, List<T>& l2) throw()
  519. {
  520. List<T>* temp,*ptr;
  521. ptr=l2.next;
  522. try
  523. {
  524. if( (l1.end)^(l2.end) )
  525. throw excp1();
  526. }
  527. catch(excp1& e)
  528. {
  529. std::cerr << e.what() << std::endl;
  530. exit(EXIT);
  531. }
  532. if(l1.end)
  533. {
  534. temp=new List<T> (l1);
  535. for(int i=0;i<l2.length;i++)
  536. {
  537. if(!l1.in(ptr->info))
  538. temp->add(ptr->info,i);
  539. ptr=ptr->next;
  540. }
  541. }
  542. else
  543. {
  544. temp->push_back(l1.info);
  545. if(l1.info!=l2.info)
  546. temp->push_back(l2.info);
  547. }
  548. return *temp;
  549. }
  550.  
  551. template<class T>
  552. List<T>& List<T>::operator[] (int i) throw()
  553. {
  554. List<T>* ptr;
  555. try
  556. {
  557. if(!end)
  558. throw excp4();
  559. else if(i>=length || -i>=length)
  560. throw excp2();
  561. }
  562. catch(excp4& e)
  563. {
  564. std::cerr << "Exception: " << e.what() << std::endl;
  565. exit(EXIT);
  566. }
  567. catch (excp2& e)
  568. {
  569. std::cerr << "Exception: "<< e.what() <<std::endl;
  570. exit(EXIT);
  571. }
  572. ptr=this->next;
  573. if(i>0)
  574. {
  575. for(int j=0;j<i;j++)
  576. ptr=ptr->next;
  577. }
  578. else
  579. {
  580. for(int j=0;j<-i;j++)
  581. ptr=ptr->prev;
  582. }
  583. return *ptr;
  584. }
  585.  
  586.  
  587.  
  588. template<class T>
  589. List<T>& List<T>::operator= (List<T>& l) throw()
  590. {
  591. List<T>* ptr=l.next;
  592. try
  593. {
  594. if( (end)^(l.end) )
  595. throw excp1();
  596. }
  597. catch(excp1& e)
  598. {
  599. std::cerr <<"Exception: "<< e.what() <<std::endl;
  600. exit(EXIT);
  601. }
  602. if(this!=&l)
  603. {
  604. if(end)
  605. {
  606. resize(0);
  607. while(!ptr->end)
  608. {
  609. push_back(ptr->info);
  610. ptr=ptr->next;
  611. }
  612. }
  613. else
  614. {
  615. info=l.info;
  616. }
  617. }
  618. return *this;
  619. }
  620.  
  621. template <class T>
  622. List<T>& List<T>::operator=(const T& info)
  623. {
  624. List<T>* ptr;
  625. ptr=next;
  626. if(end)
  627. {
  628. while(!ptr->end)
  629. {
  630. ptr->info=info;
  631. ptr=ptr->next;
  632. }
  633. }
  634. else
  635. {
  636. this->info=info;
  637. }
  638. return *this;
  639. }
  640.  
  641. template <class T>
  642. List<T>& List<T>::operator+= (List<T>& l)
  643. {
  644. int length=l.length;
  645. List<T>* ptr=l.next;
  646. try
  647. {
  648. if ( (end)^(l.end) )
  649. throw excp1();
  650. }
  651. catch(excp1 e)
  652. {
  653. std::cerr << "Exception: " << e.what() << std::endl;
  654. exit(EXIT);
  655. }
  656. if(end)
  657. {
  658. for(int i=0;i<length;i++)
  659. {
  660. push_back(ptr->info);
  661. ptr=ptr->next;
  662. }
  663. }
  664. else
  665. {
  666. info+=l.info;
  667. }
  668. return *this;
  669. }
  670.  
  671. template <class T>
  672. bool List<T>::operator== (List<T>& l) throw ()
  673. {
  674. bool result=true;
  675. List<T>* p1,*p2;
  676. p1=next;
  677. p2=l.next;
  678. try
  679. {
  680. if( (end)^(l.end) )
  681. throw excp1();
  682. }
  683. catch (excp1& e)
  684. {
  685. std::cerr << "Exception: " << e.what() << std::endl;
  686. exit(EXIT);
  687. }
  688. if(this!=&l)
  689. {
  690. if(l.end)
  691. {
  692. result=(length==l.length);
  693. while(!p1->end && result)
  694. {
  695. result=(p1->info == p2->info);
  696. p1=p1->next;
  697. p2=p2->next;
  698. }
  699. }
  700. else
  701. {
  702. result=(p1->info == p2->info);
  703. }
  704. }
  705. return result;
  706. }
  707.  
  708. template<class T>
  709. bool List<T>::operator!= (List<T>& l)
  710. {
  711. return (!(*this == l));
  712. }
  713.  
  714. template<class T>
  715. bool List<T>::operator< (List<T>& l) throw()
  716. {
  717. List<T>* p1,*p2;
  718. p1=this->next;
  719. p2=l.next;
  720. bool result=true;
  721. try
  722. {
  723. if( (end)^(l.end) )
  724. throw excp1();
  725. }
  726. catch(excp1& e)
  727. {
  728. std::cerr << "Exception: " << e.what() << std::endl;
  729. exit(EXIT);
  730. }
  731. if(!this->end)
  732. {
  733. result=(this->info < l.info);
  734. }
  735. else
  736. {
  737. while(result && !p1->end && !p2->end)
  738. {
  739. result=(p1->info < p2->info);
  740. p1=p1->next;
  741. p2=p2->next;
  742. }
  743. }
  744. return result;
  745. }
  746.  
  747. template <class T>
  748. bool List<T>::operator>=(List<T>& l)
  749. {
  750. return !((*this)<(l));
  751. }
  752.  
  753. template<class T>
  754. bool List<T>::operator> (List<T>& l) throw()
  755. {
  756. List<T>* p1,*p2;
  757. p1=this->next;
  758. p2=l.next;
  759. bool result=true;
  760. try
  761. {
  762. if( (end)^(l.end) )
  763. throw excp1();
  764. }
  765. catch(excp1& e)
  766. {
  767. std::cerr << "Exception: " << e.what() << std::endl;
  768. exit(EXIT);
  769. }
  770. if(!this->end)
  771. {
  772. result=(this->info > l.info);
  773. }
  774. else
  775. {
  776. while(result && !p1->end && !p2->end)
  777. {
  778. result=(p1->info > p2->info);
  779. p1=p1->next;
  780. p2=p2->next;
  781. }
  782. }
  783. return result;
  784. }
  785.  
  786. template<class T>
  787. bool List<T>::operator<=(List<T>& l)
  788. {
  789. return !( (*this)>l );
  790. }
  791.  
  792. template<class T>
  793. ListIterator<T>& List<T>:: front() throw()
  794. {
  795. try
  796. {
  797. if(!end)
  798. throw excp2();
  799. }
  800. catch(excp2& e)
  801. {
  802. std::cerr << "Exception: " << e.what() << std::endl;
  803. exit(EXIT);
  804. }
  805. if(length==0)
  806. iter.ptr=this;
  807. else
  808. iter.ptr= &(*this)[0];
  809. return iter;
  810. }
  811.  
  812. template<class T>
  813. ListIterator<T>& List<T>:: back() throw()
  814. {
  815. try
  816. {
  817. if(!end)
  818. throw excp2();
  819. }
  820. catch(excp2& e)
  821. {
  822. std::cerr << "Exception: " << e.what() << std::endl;
  823. exit(EXIT);
  824. }
  825. if(length==0)
  826. iter.ptr=this;
  827. else
  828. iter.ptr= this->prev;
  829. return iter;
  830. }
  831.  
  832. template<class T>
  833. ListIterator<T>& List<T>:: ending() throw()
  834. {
  835. try
  836. {
  837. if(!end)
  838. throw excp2();
  839. }
  840. catch(excp2& e)
  841. {
  842. std::cerr << "Exception: " << e.what() << std::endl;
  843. exit(EXIT);
  844. }
  845. iter.ptr=this;
  846. return iter;
  847. }
  848.  
  849. /***********************************************************************************************************
  850. * *
  851. * Iterator *
  852. * *
  853. ***********************************************************************************************************/
  854.  
  855.  
  856. template<class T>
  857. class ListIterator
  858. {
  859. public:
  860. ListIterator();
  861. ListIterator(const ListIterator<T>& i);
  862. ListIterator<T>& operator= (const List<T>& l);
  863. ListIterator<T>& operator= (const ListIterator<T>& i);
  864. ListIterator<T>& operator++ (int) throw();
  865. ListIterator<T>& operator-- (int) throw();
  866. ListIterator<T>& operator++ ();
  867. ListIterator<T>& operator-- ();
  868. bool operator== (ListIterator<T>& i);
  869. bool operator!= (ListIterator<T>& i);
  870. List<T>& operator* () throw();
  871. template<class T1>
  872. friend class List;
  873. protected:
  874. List<T>* ptr;
  875. };
  876.  
  877. template<class T>
  878. ListIterator<T>::ListIterator ()
  879. {
  880. ptr=NULL;
  881. }
  882.  
  883. template<class T>
  884. ListIterator<T>::ListIterator (const ListIterator<T>& i)
  885. {
  886. ptr=i.ptr;
  887. }
  888.  
  889. template<class T>
  890. ListIterator<T>& ListIterator<T>:: operator= (const List<T>& l)
  891. {
  892. ptr=&l;
  893. }
  894.  
  895. template<class T>
  896. ListIterator<T>& ListIterator<T>:: operator= (const ListIterator<T>& i)
  897. {
  898. ptr=i.ptr;
  899. return *this;
  900. }
  901.  
  902.  
  903. template<class T>
  904. ListIterator<T>& ListIterator<T>:: operator++ (int) throw()
  905. {
  906. try
  907. {
  908. if(ptr==NULL)
  909. throw excp6();
  910. else if(ptr->end)
  911. throw excp7();
  912. }
  913. catch(excp6& e)
  914. {
  915. std::cerr << "Exception: " << e.what() << std::endl;
  916. exit(EXIT);
  917. }
  918. catch(excp7& e)
  919. {
  920. std::cerr << "Exception: " << e.what() << std::endl;
  921. exit(EXIT);
  922. }
  923. ptr=ptr->next;
  924. return *this;
  925. }
  926.  
  927. template<class T>
  928. ListIterator<T>& ListIterator<T>:: operator-- (int) throw()
  929. {
  930. try
  931. {
  932. if(ptr==NULL)
  933. throw excp6();
  934. else if(ptr->end)
  935. throw excp7();
  936. }
  937. catch(excp6& e)
  938. {
  939. std::cerr << "Exception: " << e.what() << std::endl;
  940. exit(EXIT);
  941. }
  942. catch(excp7& e)
  943. {
  944. std::cerr << "Exception: " << e.what() << std::endl;
  945. exit(EXIT);
  946. }
  947. ptr=ptr->prev;
  948. return *this;
  949. }
  950.  
  951. template<class T>
  952. ListIterator<T>& ListIterator<T>:: operator++ ()
  953. {
  954. return *this++;
  955. }
  956.  
  957. template<class T>
  958. ListIterator<T>& ListIterator<T>:: operator-- ()
  959. {
  960. return *this--;
  961. }
  962.  
  963.  
  964. template<class T>
  965. List<T>& ListIterator<T>::operator* () throw()
  966. {
  967. try
  968. {
  969. if(ptr==NULL)
  970. throw excp6();
  971. else if(ptr->end)
  972. throw excp7();
  973. }
  974. catch(excp6& e)
  975. {
  976. std::cerr << "Exception: " << e.what() << std::endl;
  977. exit(EXIT);
  978. }
  979. catch(excp7& e)
  980. {
  981. std::cerr << "Exception: " << e.what() << std::endl;
  982. exit(EXIT);
  983. }
  984. return *ptr;
  985. }
  986.  
  987. template<class T>
  988. bool ListIterator<T>:: operator== (ListIterator<T>& i)
  989. {
  990. return ptr==i.ptr;
  991. }
  992.  
  993. template<class T>
  994. bool ListIterator<T>:: operator!= (ListIterator<T>& i)
  995. {
  996. return ptr!=i.ptr;
  997. }
  998.  
  999. }
  1000.  
  1001.  
  1002. #endif
Advertisement
Add Comment
Please, Sign In to add comment