/vendor/boost/boost/concept_archetype.hpp

https://bitbucket.org/genericcontainer/goblin-camp/ · C++ Header · 669 lines · 572 code · 54 blank · 43 comment · 0 complexity · f1e80022877e48ac1f21dd1d359a57f4 MD5 · raw file

  1. //
  2. // (C) Copyright Jeremy Siek 2000.
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Revision History:
  8. //
  9. // 17 July 2001: Added const to some member functions. (Jeremy Siek)
  10. // 05 May 2001: Removed static dummy_cons object. (Jeremy Siek)
  11. // See http://www.boost.org/libs/concept_check for documentation.
  12. #ifndef BOOST_CONCEPT_ARCHETYPES_HPP
  13. #define BOOST_CONCEPT_ARCHETYPES_HPP
  14. #include <boost/config.hpp>
  15. #include <boost/iterator.hpp>
  16. #include <boost/mpl/identity.hpp>
  17. #include <functional>
  18. namespace boost {
  19. //===========================================================================
  20. // Basic Archetype Classes
  21. namespace detail {
  22. class dummy_constructor { };
  23. }
  24. // A type that models no concept. The template parameter
  25. // is only there so that null_archetype types can be created
  26. // that have different type.
  27. template <class T = int>
  28. class null_archetype {
  29. private:
  30. null_archetype() { }
  31. null_archetype(const null_archetype&) { }
  32. null_archetype& operator=(const null_archetype&) { return *this; }
  33. public:
  34. null_archetype(detail::dummy_constructor) { }
  35. #ifndef __MWERKS__
  36. template <class TT>
  37. friend void dummy_friend(); // just to avoid warnings
  38. #endif
  39. };
  40. // This is a helper class that provides a way to get a reference to
  41. // an object. The get() function will never be called at run-time
  42. // (nothing in this file will) so this seemingly very bad function
  43. // is really quite innocent. The name of this class needs to be
  44. // changed.
  45. template <class T>
  46. class static_object
  47. {
  48. public:
  49. static T& get()
  50. {
  51. #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  52. return *reinterpret_cast<T*>(0);
  53. #else
  54. static char d[sizeof(T)];
  55. return *reinterpret_cast<T*>(d);
  56. #endif
  57. }
  58. };
  59. template <class Base = null_archetype<> >
  60. class default_constructible_archetype : public Base {
  61. public:
  62. default_constructible_archetype()
  63. : Base(static_object<detail::dummy_constructor>::get()) { }
  64. default_constructible_archetype(detail::dummy_constructor x) : Base(x) { }
  65. };
  66. template <class Base = null_archetype<> >
  67. class assignable_archetype : public Base {
  68. assignable_archetype() { }
  69. assignable_archetype(const assignable_archetype&) { }
  70. public:
  71. assignable_archetype& operator=(const assignable_archetype&) {
  72. return *this;
  73. }
  74. assignable_archetype(detail::dummy_constructor x) : Base(x) { }
  75. };
  76. template <class Base = null_archetype<> >
  77. class copy_constructible_archetype : public Base {
  78. public:
  79. copy_constructible_archetype()
  80. : Base(static_object<detail::dummy_constructor>::get()) { }
  81. copy_constructible_archetype(const copy_constructible_archetype&)
  82. : Base(static_object<detail::dummy_constructor>::get()) { }
  83. copy_constructible_archetype(detail::dummy_constructor x) : Base(x) { }
  84. };
  85. template <class Base = null_archetype<> >
  86. class sgi_assignable_archetype : public Base {
  87. public:
  88. sgi_assignable_archetype(const sgi_assignable_archetype&)
  89. : Base(static_object<detail::dummy_constructor>::get()) { }
  90. sgi_assignable_archetype& operator=(const sgi_assignable_archetype&) {
  91. return *this;
  92. }
  93. sgi_assignable_archetype(const detail::dummy_constructor& x) : Base(x) { }
  94. };
  95. struct default_archetype_base {
  96. default_archetype_base(detail::dummy_constructor) { }
  97. };
  98. // Careful, don't use same type for T and Base. That results in the
  99. // conversion operator being invalid. Since T is often
  100. // null_archetype, can't use null_archetype for Base.
  101. template <class T, class Base = default_archetype_base>
  102. class convertible_to_archetype : public Base {
  103. private:
  104. convertible_to_archetype() { }
  105. convertible_to_archetype(const convertible_to_archetype& ) { }
  106. convertible_to_archetype& operator=(const convertible_to_archetype&)
  107. { return *this; }
  108. public:
  109. convertible_to_archetype(detail::dummy_constructor x) : Base(x) { }
  110. operator const T&() const { return static_object<T>::get(); }
  111. };
  112. template <class T, class Base = default_archetype_base>
  113. class convertible_from_archetype : public Base {
  114. private:
  115. convertible_from_archetype() { }
  116. convertible_from_archetype(const convertible_from_archetype& ) { }
  117. convertible_from_archetype& operator=(const convertible_from_archetype&)
  118. { return *this; }
  119. public:
  120. convertible_from_archetype(detail::dummy_constructor x) : Base(x) { }
  121. convertible_from_archetype(const T&) { }
  122. convertible_from_archetype& operator=(const T&)
  123. { return *this; }
  124. };
  125. class boolean_archetype {
  126. public:
  127. boolean_archetype(const boolean_archetype&) { }
  128. operator bool() const { return true; }
  129. boolean_archetype(detail::dummy_constructor) { }
  130. private:
  131. boolean_archetype() { }
  132. boolean_archetype& operator=(const boolean_archetype&) { return *this; }
  133. };
  134. template <class Base = null_archetype<> >
  135. class equality_comparable_archetype : public Base {
  136. public:
  137. equality_comparable_archetype(detail::dummy_constructor x) : Base(x) { }
  138. };
  139. template <class Base>
  140. boolean_archetype
  141. operator==(const equality_comparable_archetype<Base>&,
  142. const equality_comparable_archetype<Base>&)
  143. {
  144. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  145. }
  146. template <class Base>
  147. boolean_archetype
  148. operator!=(const equality_comparable_archetype<Base>&,
  149. const equality_comparable_archetype<Base>&)
  150. {
  151. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  152. }
  153. template <class Base = null_archetype<> >
  154. class equality_comparable2_first_archetype : public Base {
  155. public:
  156. equality_comparable2_first_archetype(detail::dummy_constructor x)
  157. : Base(x) { }
  158. };
  159. template <class Base = null_archetype<> >
  160. class equality_comparable2_second_archetype : public Base {
  161. public:
  162. equality_comparable2_second_archetype(detail::dummy_constructor x)
  163. : Base(x) { }
  164. };
  165. template <class Base1, class Base2>
  166. boolean_archetype
  167. operator==(const equality_comparable2_first_archetype<Base1>&,
  168. const equality_comparable2_second_archetype<Base2>&)
  169. {
  170. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  171. }
  172. template <class Base1, class Base2>
  173. boolean_archetype
  174. operator!=(const equality_comparable2_first_archetype<Base1>&,
  175. const equality_comparable2_second_archetype<Base2>&)
  176. {
  177. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  178. }
  179. template <class Base = null_archetype<> >
  180. class less_than_comparable_archetype : public Base {
  181. public:
  182. less_than_comparable_archetype(detail::dummy_constructor x) : Base(x) { }
  183. };
  184. template <class Base>
  185. boolean_archetype
  186. operator<(const less_than_comparable_archetype<Base>&,
  187. const less_than_comparable_archetype<Base>&)
  188. {
  189. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  190. }
  191. template <class Base = null_archetype<> >
  192. class comparable_archetype : public Base {
  193. public:
  194. comparable_archetype(detail::dummy_constructor x) : Base(x) { }
  195. };
  196. template <class Base>
  197. boolean_archetype
  198. operator<(const comparable_archetype<Base>&,
  199. const comparable_archetype<Base>&)
  200. {
  201. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  202. }
  203. template <class Base>
  204. boolean_archetype
  205. operator<=(const comparable_archetype<Base>&,
  206. const comparable_archetype<Base>&)
  207. {
  208. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  209. }
  210. template <class Base>
  211. boolean_archetype
  212. operator>(const comparable_archetype<Base>&,
  213. const comparable_archetype<Base>&)
  214. {
  215. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  216. }
  217. template <class Base>
  218. boolean_archetype
  219. operator>=(const comparable_archetype<Base>&,
  220. const comparable_archetype<Base>&)
  221. {
  222. return boolean_archetype(static_object<detail::dummy_constructor>::get());
  223. }
  224. // The purpose of the optags is so that one can specify
  225. // exactly which types the operator< is defined between.
  226. // This is useful for allowing the operations:
  227. //
  228. // A a; B b;
  229. // a < b
  230. // b < a
  231. //
  232. // without also allowing the combinations:
  233. //
  234. // a < a
  235. // b < b
  236. //
  237. struct optag1 { };
  238. struct optag2 { };
  239. struct optag3 { };
  240. #define BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(OP, NAME) \
  241. template <class Base = null_archetype<>, class Tag = optag1 > \
  242. class NAME##_first_archetype : public Base { \
  243. public: \
  244. NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
  245. }; \
  246. \
  247. template <class Base = null_archetype<>, class Tag = optag1 > \
  248. class NAME##_second_archetype : public Base { \
  249. public: \
  250. NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
  251. }; \
  252. \
  253. template <class BaseFirst, class BaseSecond, class Tag> \
  254. boolean_archetype \
  255. operator OP (const NAME##_first_archetype<BaseFirst, Tag>&, \
  256. const NAME##_second_archetype<BaseSecond, Tag>&) \
  257. { \
  258. return boolean_archetype(static_object<detail::dummy_constructor>::get()); \
  259. }
  260. BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(==, equal_op)
  261. BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(!=, not_equal_op)
  262. BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(<, less_than_op)
  263. BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(<=, less_equal_op)
  264. BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(>, greater_than_op)
  265. BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(>=, greater_equal_op)
  266. #define BOOST_DEFINE_OPERATOR_ARCHETYPE(OP, NAME) \
  267. template <class Base = null_archetype<> > \
  268. class NAME##_archetype : public Base { \
  269. public: \
  270. NAME##_archetype(detail::dummy_constructor x) : Base(x) { } \
  271. NAME##_archetype(const NAME##_archetype&) \
  272. : Base(static_object<detail::dummy_constructor>::get()) { } \
  273. NAME##_archetype& operator=(const NAME##_archetype&) { return *this; } \
  274. }; \
  275. template <class Base> \
  276. NAME##_archetype<Base> \
  277. operator OP (const NAME##_archetype<Base>&,\
  278. const NAME##_archetype<Base>&) \
  279. { \
  280. return \
  281. NAME##_archetype<Base>(static_object<detail::dummy_constructor>::get()); \
  282. }
  283. BOOST_DEFINE_OPERATOR_ARCHETYPE(+, addable)
  284. BOOST_DEFINE_OPERATOR_ARCHETYPE(-, subtractable)
  285. BOOST_DEFINE_OPERATOR_ARCHETYPE(*, multipliable)
  286. BOOST_DEFINE_OPERATOR_ARCHETYPE(/, dividable)
  287. BOOST_DEFINE_OPERATOR_ARCHETYPE(%, modable)
  288. // As is, these are useless because of the return type.
  289. // Need to invent a better way...
  290. #define BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(OP, NAME) \
  291. template <class Return, class Base = null_archetype<> > \
  292. class NAME##_first_archetype : public Base { \
  293. public: \
  294. NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
  295. }; \
  296. \
  297. template <class Return, class Base = null_archetype<> > \
  298. class NAME##_second_archetype : public Base { \
  299. public: \
  300. NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
  301. }; \
  302. \
  303. template <class Return, class BaseFirst, class BaseSecond> \
  304. Return \
  305. operator OP (const NAME##_first_archetype<Return, BaseFirst>&, \
  306. const NAME##_second_archetype<Return, BaseSecond>&) \
  307. { \
  308. return Return(static_object<detail::dummy_constructor>::get()); \
  309. }
  310. BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(+, plus_op)
  311. BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(*, time_op)
  312. BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(/, divide_op)
  313. BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(-, subtract_op)
  314. BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(%, mod_op)
  315. //===========================================================================
  316. // Function Object Archetype Classes
  317. template <class Return>
  318. class generator_archetype {
  319. public:
  320. const Return& operator()() {
  321. return static_object<Return>::get();
  322. }
  323. };
  324. class void_generator_archetype {
  325. public:
  326. void operator()() { }
  327. };
  328. template <class Arg, class Return>
  329. class unary_function_archetype {
  330. private:
  331. unary_function_archetype() { }
  332. public:
  333. unary_function_archetype(detail::dummy_constructor) { }
  334. const Return& operator()(const Arg&) const {
  335. return static_object<Return>::get();
  336. }
  337. };
  338. template <class Arg1, class Arg2, class Return>
  339. class binary_function_archetype {
  340. private:
  341. binary_function_archetype() { }
  342. public:
  343. binary_function_archetype(detail::dummy_constructor) { }
  344. const Return& operator()(const Arg1&, const Arg2&) const {
  345. return static_object<Return>::get();
  346. }
  347. };
  348. template <class Arg>
  349. class unary_predicate_archetype {
  350. typedef boolean_archetype Return;
  351. unary_predicate_archetype() { }
  352. public:
  353. unary_predicate_archetype(detail::dummy_constructor) { }
  354. const Return& operator()(const Arg&) const {
  355. return static_object<Return>::get();
  356. }
  357. };
  358. template <class Arg1, class Arg2, class Base = null_archetype<> >
  359. class binary_predicate_archetype {
  360. typedef boolean_archetype Return;
  361. binary_predicate_archetype() { }
  362. public:
  363. binary_predicate_archetype(detail::dummy_constructor) { }
  364. const Return& operator()(const Arg1&, const Arg2&) const {
  365. return static_object<Return>::get();
  366. }
  367. };
  368. //===========================================================================
  369. // Iterator Archetype Classes
  370. template <class T, int I = 0>
  371. class input_iterator_archetype
  372. {
  373. private:
  374. typedef input_iterator_archetype self;
  375. public:
  376. typedef std::input_iterator_tag iterator_category;
  377. typedef T value_type;
  378. struct reference {
  379. operator const value_type&() const { return static_object<T>::get(); }
  380. };
  381. typedef const T* pointer;
  382. typedef std::ptrdiff_t difference_type;
  383. self& operator=(const self&) { return *this; }
  384. bool operator==(const self&) const { return true; }
  385. bool operator!=(const self&) const { return true; }
  386. reference operator*() const { return reference(); }
  387. self& operator++() { return *this; }
  388. self operator++(int) { return *this; }
  389. };
  390. template <class T>
  391. class input_iterator_archetype_no_proxy
  392. {
  393. private:
  394. typedef input_iterator_archetype_no_proxy self;
  395. public:
  396. typedef std::input_iterator_tag iterator_category;
  397. typedef T value_type;
  398. typedef const T& reference;
  399. typedef const T* pointer;
  400. typedef std::ptrdiff_t difference_type;
  401. self& operator=(const self&) { return *this; }
  402. bool operator==(const self&) const { return true; }
  403. bool operator!=(const self&) const { return true; }
  404. reference operator*() const { return static_object<T>::get(); }
  405. self& operator++() { return *this; }
  406. self operator++(int) { return *this; }
  407. };
  408. template <class T>
  409. struct output_proxy {
  410. output_proxy& operator=(const T&) { return *this; }
  411. };
  412. template <class T>
  413. class output_iterator_archetype
  414. {
  415. public:
  416. typedef output_iterator_archetype self;
  417. public:
  418. typedef std::output_iterator_tag iterator_category;
  419. typedef output_proxy<T> value_type;
  420. typedef output_proxy<T> reference;
  421. typedef void pointer;
  422. typedef void difference_type;
  423. output_iterator_archetype(detail::dummy_constructor) { }
  424. output_iterator_archetype(const self&) { }
  425. self& operator=(const self&) { return *this; }
  426. bool operator==(const self&) const { return true; }
  427. bool operator!=(const self&) const { return true; }
  428. reference operator*() const { return output_proxy<T>(); }
  429. self& operator++() { return *this; }
  430. self operator++(int) { return *this; }
  431. private:
  432. output_iterator_archetype() { }
  433. };
  434. template <class T>
  435. class input_output_iterator_archetype
  436. {
  437. private:
  438. typedef input_output_iterator_archetype self;
  439. struct in_out_tag : public std::input_iterator_tag, public std::output_iterator_tag { };
  440. public:
  441. typedef in_out_tag iterator_category;
  442. typedef T value_type;
  443. struct reference {
  444. reference& operator=(const T&) { return *this; }
  445. operator value_type() { return static_object<T>::get(); }
  446. };
  447. typedef const T* pointer;
  448. typedef std::ptrdiff_t difference_type;
  449. input_output_iterator_archetype() { }
  450. self& operator=(const self&) { return *this; }
  451. bool operator==(const self&) const { return true; }
  452. bool operator!=(const self&) const { return true; }
  453. reference operator*() const { return reference(); }
  454. self& operator++() { return *this; }
  455. self operator++(int) { return *this; }
  456. };
  457. template <class T>
  458. class forward_iterator_archetype
  459. {
  460. public:
  461. typedef forward_iterator_archetype self;
  462. public:
  463. typedef std::forward_iterator_tag iterator_category;
  464. typedef T value_type;
  465. typedef const T& reference;
  466. typedef T const* pointer;
  467. typedef std::ptrdiff_t difference_type;
  468. forward_iterator_archetype() { }
  469. self& operator=(const self&) { return *this; }
  470. bool operator==(const self&) const { return true; }
  471. bool operator!=(const self&) const { return true; }
  472. reference operator*() const { return static_object<T>::get(); }
  473. self& operator++() { return *this; }
  474. self operator++(int) { return *this; }
  475. };
  476. template <class T>
  477. class mutable_forward_iterator_archetype
  478. {
  479. public:
  480. typedef mutable_forward_iterator_archetype self;
  481. public:
  482. typedef std::forward_iterator_tag iterator_category;
  483. typedef T value_type;
  484. typedef T& reference;
  485. typedef T* pointer;
  486. typedef std::ptrdiff_t difference_type;
  487. mutable_forward_iterator_archetype() { }
  488. self& operator=(const self&) { return *this; }
  489. bool operator==(const self&) const { return true; }
  490. bool operator!=(const self&) const { return true; }
  491. reference operator*() const { return static_object<T>::get(); }
  492. self& operator++() { return *this; }
  493. self operator++(int) { return *this; }
  494. };
  495. template <class T>
  496. class bidirectional_iterator_archetype
  497. {
  498. public:
  499. typedef bidirectional_iterator_archetype self;
  500. public:
  501. typedef std::bidirectional_iterator_tag iterator_category;
  502. typedef T value_type;
  503. typedef const T& reference;
  504. typedef T* pointer;
  505. typedef std::ptrdiff_t difference_type;
  506. bidirectional_iterator_archetype() { }
  507. self& operator=(const self&) { return *this; }
  508. bool operator==(const self&) const { return true; }
  509. bool operator!=(const self&) const { return true; }
  510. reference operator*() const { return static_object<T>::get(); }
  511. self& operator++() { return *this; }
  512. self operator++(int) { return *this; }
  513. self& operator--() { return *this; }
  514. self operator--(int) { return *this; }
  515. };
  516. template <class T>
  517. class mutable_bidirectional_iterator_archetype
  518. {
  519. public:
  520. typedef mutable_bidirectional_iterator_archetype self;
  521. public:
  522. typedef std::bidirectional_iterator_tag iterator_category;
  523. typedef T value_type;
  524. typedef T& reference;
  525. typedef T* pointer;
  526. typedef std::ptrdiff_t difference_type;
  527. mutable_bidirectional_iterator_archetype() { }
  528. self& operator=(const self&) { return *this; }
  529. bool operator==(const self&) const { return true; }
  530. bool operator!=(const self&) const { return true; }
  531. reference operator*() const { return static_object<T>::get(); }
  532. self& operator++() { return *this; }
  533. self operator++(int) { return *this; }
  534. self& operator--() { return *this; }
  535. self operator--(int) { return *this; }
  536. };
  537. template <class T>
  538. class random_access_iterator_archetype
  539. {
  540. public:
  541. typedef random_access_iterator_archetype self;
  542. public:
  543. typedef std::random_access_iterator_tag iterator_category;
  544. typedef T value_type;
  545. typedef const T& reference;
  546. typedef T* pointer;
  547. typedef std::ptrdiff_t difference_type;
  548. random_access_iterator_archetype() { }
  549. self& operator=(const self&) { return *this; }
  550. bool operator==(const self&) const { return true; }
  551. bool operator!=(const self&) const { return true; }
  552. reference operator*() const { return static_object<T>::get(); }
  553. self& operator++() { return *this; }
  554. self operator++(int) { return *this; }
  555. self& operator--() { return *this; }
  556. self operator--(int) { return *this; }
  557. reference operator[](difference_type) const
  558. { return static_object<T>::get(); }
  559. self& operator+=(difference_type) { return *this; }
  560. self& operator-=(difference_type) { return *this; }
  561. difference_type operator-(const self&) const
  562. { return difference_type(); }
  563. self operator+(difference_type) const { return *this; }
  564. self operator-(difference_type) const { return *this; }
  565. bool operator<(const self&) const { return true; }
  566. bool operator<=(const self&) const { return true; }
  567. bool operator>(const self&) const { return true; }
  568. bool operator>=(const self&) const { return true; }
  569. };
  570. template <class T>
  571. random_access_iterator_archetype<T>
  572. operator+(typename random_access_iterator_archetype<T>::difference_type,
  573. const random_access_iterator_archetype<T>& x)
  574. { return x; }
  575. template <class T>
  576. class mutable_random_access_iterator_archetype
  577. {
  578. public:
  579. typedef mutable_random_access_iterator_archetype self;
  580. public:
  581. typedef std::random_access_iterator_tag iterator_category;
  582. typedef T value_type;
  583. typedef T& reference;
  584. typedef T* pointer;
  585. typedef std::ptrdiff_t difference_type;
  586. mutable_random_access_iterator_archetype() { }
  587. self& operator=(const self&) { return *this; }
  588. bool operator==(const self&) const { return true; }
  589. bool operator!=(const self&) const { return true; }
  590. reference operator*() const { return static_object<T>::get(); }
  591. self& operator++() { return *this; }
  592. self operator++(int) { return *this; }
  593. self& operator--() { return *this; }
  594. self operator--(int) { return *this; }
  595. reference operator[](difference_type) const
  596. { return static_object<T>::get(); }
  597. self& operator+=(difference_type) { return *this; }
  598. self& operator-=(difference_type) { return *this; }
  599. difference_type operator-(const self&) const
  600. { return difference_type(); }
  601. self operator+(difference_type) const { return *this; }
  602. self operator-(difference_type) const { return *this; }
  603. bool operator<(const self&) const { return true; }
  604. bool operator<=(const self&) const { return true; }
  605. bool operator>(const self&) const { return true; }
  606. bool operator>=(const self&) const { return true; }
  607. };
  608. template <class T>
  609. mutable_random_access_iterator_archetype<T>
  610. operator+
  611. (typename mutable_random_access_iterator_archetype<T>::difference_type,
  612. const mutable_random_access_iterator_archetype<T>& x)
  613. { return x; }
  614. } // namespace boost
  615. #endif // BOOST_CONCEPT_ARCHETYPES_H