⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boost_concept_check.h

📁 俄罗斯高人Mamaich的Pocket gcc编译器(运行在PocketPC上)的全部源代码。
💻 H
📖 第 1 页 / 共 2 页
字号:
    }    _Tp __i;  };  template <class _Tp>  struct _Mutable_ForwardIteratorConcept  {    void __constraints() {      __function_requires< _ForwardIteratorConcept<_Tp> >();      *__i++ = *__i;                    // require postincrement and assignment    }    _Tp __i;  };  template <class _Tp>  struct _BidirectionalIteratorConcept  {    void __constraints() {      __function_requires< _ForwardIteratorConcept<_Tp> >();      __function_requires< _ConvertibleConcept<        typename std::iterator_traits<_Tp>::iterator_category,        std::bidirectional_iterator_tag> >();      --__i;                            // require predecrement operator      __i--;                            // require postdecrement operator    }    _Tp __i;  };  template <class _Tp>  struct _Mutable_BidirectionalIteratorConcept  {    void __constraints() {      __function_requires< _BidirectionalIteratorConcept<_Tp> >();      __function_requires< _Mutable_ForwardIteratorConcept<_Tp> >();      *__i-- = *__i;                    // require postdecrement and assignment    }    _Tp __i;  };  template <class _Tp>  struct _RandomAccessIteratorConcept  {    void __constraints() {      __function_requires< _BidirectionalIteratorConcept<_Tp> >();      __function_requires< _ComparableConcept<_Tp> >();      __function_requires< _ConvertibleConcept<        typename std::iterator_traits<_Tp>::iterator_category,        std::random_access_iterator_tag> >();      // ??? We don't use _R, are we just checking for "referenceability"?      typedef typename std::iterator_traits<_Tp>::reference _R;      __i += __n;                       // require assignment addition operator      __i = __i + __n; __i = __n + __i; // require addition with difference type      __i -= __n;                       // require assignment subtraction op      __i = __i - __n;                  // require subtraction with                                        //            difference type      __n = __i - __j;                  // require difference operator      (void)__i[__n];                   // require element access operator    }    _Tp __a, __b;    _Tp __i, __j;    typename std::iterator_traits<_Tp>::difference_type __n;  };  template <class _Tp>  struct _Mutable_RandomAccessIteratorConcept  {    void __constraints() {      __function_requires< _RandomAccessIteratorConcept<_Tp> >();      __function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >();      __i[__n] = *__i;                  // require element access and assignment    }    _Tp __i;    typename std::iterator_traits<_Tp>::difference_type __n;  };  //===========================================================================  // Container Concepts  template <class _Container>  struct _ContainerConcept  {    typedef typename _Container::value_type _Value_type;    typedef typename _Container::difference_type _Difference_type;    typedef typename _Container::size_type _Size_type;    typedef typename _Container::const_reference _Const_reference;    typedef typename _Container::const_pointer _Const_pointer;    typedef typename _Container::const_iterator _Const_iterator;    void __constraints() {      __function_requires< _InputIteratorConcept<_Const_iterator> >();      __function_requires< _AssignableConcept<_Container> >();      const _Container __c;      __i = __c.begin();      __i = __c.end();      __n = __c.size();      __n = __c.max_size();      __b = __c.empty();    }    bool __b;    _Const_iterator __i;    _Size_type __n;  };  template <class _Container>  struct _Mutable_ContainerConcept  {    typedef typename _Container::value_type _Value_type;    typedef typename _Container::reference _Reference;    typedef typename _Container::iterator _Iterator;    typedef typename _Container::pointer _Pointer;        void __constraints() {      __function_requires< _ContainerConcept<_Container> >();      __function_requires< _AssignableConcept<_Value_type> >();      __function_requires< _InputIteratorConcept<_Iterator> >();      __i = __c.begin();      __i = __c.end();      __c.swap(__c2);    }    _Iterator __i;    _Container __c, __c2;  };  template <class _ForwardContainer>  struct _ForwardContainerConcept  {    void __constraints() {      __function_requires< _ContainerConcept<_ForwardContainer> >();      typedef typename _ForwardContainer::const_iterator _Const_iterator;      __function_requires< _ForwardIteratorConcept<_Const_iterator> >();    }  };    template <class _ForwardContainer>  struct _Mutable_ForwardContainerConcept  {    void __constraints() {      __function_requires< _ForwardContainerConcept<_ForwardContainer> >();      __function_requires< _Mutable_ContainerConcept<_ForwardContainer> >();      typedef typename _ForwardContainer::iterator _Iterator;      __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();    }  };    template <class _ReversibleContainer>  struct _ReversibleContainerConcept  {    typedef typename _ReversibleContainer::const_iterator _Const_iterator;    typedef typename _ReversibleContainer::const_reverse_iterator      _Const_reverse_iterator;    void __constraints() {      __function_requires< _ForwardContainerConcept<_ReversibleContainer> >();      __function_requires< _BidirectionalIteratorConcept<_Const_iterator> >();      __function_requires<        _BidirectionalIteratorConcept<_Const_reverse_iterator> >();      const _ReversibleContainer __c;      _Const_reverse_iterator __i = __c.rbegin();      __i = __c.rend();    }  };  template <class _ReversibleContainer>  struct _Mutable_ReversibleContainerConcept  {    typedef typename _ReversibleContainer::iterator _Iterator;    typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator;    void __constraints() {      __function_requires<_ReversibleContainerConcept<_ReversibleContainer> >();      __function_requires<        _Mutable_ForwardContainerConcept<_ReversibleContainer> >();      __function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >();      __function_requires<        _Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >();      _Reverse_iterator __i = __c.rbegin();      __i = __c.rend();    }    _ReversibleContainer __c;  };  template <class _RandomAccessContainer>  struct _RandomAccessContainerConcept  {    typedef typename _RandomAccessContainer::size_type _Size_type;    typedef typename _RandomAccessContainer::const_reference _Const_reference;    typedef typename _RandomAccessContainer::const_iterator _Const_iterator;    typedef typename _RandomAccessContainer::const_reverse_iterator      _Const_reverse_iterator;    void __constraints() {      __function_requires<        _ReversibleContainerConcept<_RandomAccessContainer> >();      __function_requires< _RandomAccessIteratorConcept<_Const_iterator> >();      __function_requires<        _RandomAccessIteratorConcept<_Const_reverse_iterator> >();      const _RandomAccessContainer __c;      _Const_reference __r _IsUnused = __c[__n];    }    _Size_type __n;  };  template <class _RandomAccessContainer>  struct _Mutable_RandomAccessContainerConcept  {    typedef typename _RandomAccessContainer::size_type _Size_type;    typedef typename _RandomAccessContainer::reference _Reference;    typedef typename _RandomAccessContainer::iterator _Iterator;    typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator;    void __constraints() {      __function_requires<        _RandomAccessContainerConcept<_RandomAccessContainer> >();      __function_requires<        _Mutable_ReversibleContainerConcept<_RandomAccessContainer> >();      __function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >();      __function_requires<        _Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >();      _Reference __r _IsUnused = __c[__i];    }    _Size_type __i;    _RandomAccessContainer __c;  };  // A Sequence is inherently mutable  template <class _Sequence>  struct _SequenceConcept  {    typedef typename _Sequence::reference _Reference;    typedef typename _Sequence::const_reference _Const_reference;    void __constraints() {      // Matt Austern's book puts DefaultConstructible here, the C++      // standard places it in Container      //    function_requires< DefaultConstructible<Sequence> >();      __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();      __function_requires< _DefaultConstructibleConcept<_Sequence> >();      _Sequence         __c(__n) _IsUnused,        __c2(__n, __t) _IsUnused,        __c3(__first, __last) _IsUnused;      __c.insert(__p, __t);      __c.insert(__p, __n, __t);      __c.insert(__p, __first, __last);      __c.erase(__p);      __c.erase(__p, __q);      _Reference __r _IsUnused = __c.front();      __const_constraints(__c);    }    void __const_constraints(const _Sequence& __c) {      _Const_reference __r _IsUnused = __c.front();    }    typename _Sequence::value_type __t;    typename _Sequence::size_type __n;    typename _Sequence::value_type *__first, *__last;    typename _Sequence::iterator __p, __q;  };  template <class _FrontInsertionSequence>  struct _FrontInsertionSequenceConcept  {    void __constraints() {      __function_requires< _SequenceConcept<_FrontInsertionSequence> >();      __c.push_front(__t);      __c.pop_front();    }    _FrontInsertionSequence __c;    typename _FrontInsertionSequence::value_type __t;  };  template <class _BackInsertionSequence>  struct _BackInsertionSequenceConcept  {    typedef typename _BackInsertionSequence::reference _Reference;    typedef typename _BackInsertionSequence::const_reference _Const_reference;    void __constraints() {      __function_requires< _SequenceConcept<_BackInsertionSequence> >();      __c.push_back(__t);      __c.pop_back();      _Reference __r _IsUnused = __c.back();    }    void __const_constraints(const _BackInsertionSequence& __c) {      _Const_reference __r _IsUnused = __c.back();    };    _BackInsertionSequence __c;    typename _BackInsertionSequence::value_type __t;  };  template <class _AssociativeContainer>  struct _AssociativeContainerConcept  {    void __constraints() {      __function_requires< _ForwardContainerConcept<_AssociativeContainer> >();      __function_requires<        _DefaultConstructibleConcept<_AssociativeContainer> >();          __i = __c.find(__k);      __r = __c.equal_range(__k);      __c.erase(__k);      __c.erase(__i);      __c.erase(__r.first, __r.second);      __const_constraints(__c);    }    void __const_constraints(const _AssociativeContainer& __c) {      __ci = __c.find(__k);      __n = __c.count(__k);      __cr = __c.equal_range(__k);    }    typedef typename _AssociativeContainer::iterator _Iterator;    typedef typename _AssociativeContainer::const_iterator _Const_iterator;    _AssociativeContainer __c;    _Iterator __i;    std::pair<_Iterator,_Iterator> __r;    _Const_iterator __ci;    std::pair<_Const_iterator,_Const_iterator> __cr;    typename _AssociativeContainer::key_type __k;    typename _AssociativeContainer::size_type __n;  };  template <class _UniqueAssociativeContainer>  struct _UniqueAssociativeContainerConcept  {    void __constraints() {      __function_requires<        _AssociativeContainerConcept<_UniqueAssociativeContainer> >();          _UniqueAssociativeContainer __c(__first, __last);            __pos_flag = __c.insert(__t);      __c.insert(__first, __last);    }    std::pair<typename _UniqueAssociativeContainer::iterator, bool> __pos_flag;    typename _UniqueAssociativeContainer::value_type __t;    typename _UniqueAssociativeContainer::value_type *__first, *__last;  };  template <class _MultipleAssociativeContainer>  struct _MultipleAssociativeContainerConcept  {    void __constraints() {      __function_requires<        _AssociativeContainerConcept<_MultipleAssociativeContainer> >();      _MultipleAssociativeContainer __c(__first, __last);            __pos = __c.insert(__t);      __c.insert(__first, __last);    }    typename _MultipleAssociativeContainer::iterator __pos _IsUnused;    typename _MultipleAssociativeContainer::value_type __t;    typename _MultipleAssociativeContainer::value_type *__first, *__last;  };  template <class _SimpleAssociativeContainer>  struct _SimpleAssociativeContainerConcept  {    void __constraints() {      __function_requires<        _AssociativeContainerConcept<_SimpleAssociativeContainer> >();      typedef typename _SimpleAssociativeContainer::key_type _Key_type;      typedef typename _SimpleAssociativeContainer::value_type _Value_type;      typedef typename _Aux_require_same<_Key_type, _Value_type>::_Type        _Requqired;    }  };  template <class _SimpleAssociativeContainer>  struct _PairAssociativeContainerConcept  {    void __constraints() {      __function_requires<        _AssociativeContainerConcept<_SimpleAssociativeContainer> >();      typedef typename _SimpleAssociativeContainer::key_type _Key_type;      typedef typename _SimpleAssociativeContainer::value_type _Value_type;      typedef typename _SimpleAssociativeContainer::mapped_type _Mapped_type;      typedef std::pair<const _Key_type, _Mapped_type> _Required_value_type;      typedef typename _Aux_require_same<_Value_type,        _Required_value_type>::_Type _Required;    }  };  template <class _SortedAssociativeContainer>  struct _SortedAssociativeContainerConcept  {    void __constraints() {      __function_requires<        _AssociativeContainerConcept<_SortedAssociativeContainer> >();      __function_requires<        _ReversibleContainerConcept<_SortedAssociativeContainer> >();      _SortedAssociativeContainer         __c(__kc) _IsUnused,        __c2(__first, __last) _IsUnused,        __c3(__first, __last, __kc) _IsUnused;      __p = __c.upper_bound(__k);      __p = __c.lower_bound(__k);      __r = __c.equal_range(__k);            __c.insert(__p, __t);    }    void __const_constraints(const _SortedAssociativeContainer& __c) {      __kc = __c.key_comp();      __vc = __c.value_comp();      __cp = __c.upper_bound(__k);      __cp = __c.lower_bound(__k);      __cr = __c.equal_range(__k);    }    typename _SortedAssociativeContainer::key_compare __kc;    typename _SortedAssociativeContainer::value_compare __vc;    typename _SortedAssociativeContainer::value_type __t;    typename _SortedAssociativeContainer::key_type __k;    typedef typename _SortedAssociativeContainer::iterator _Iterator;    typedef typename _SortedAssociativeContainer::const_iterator      _Const_iterator;    _Iterator __p;    _Const_iterator __cp;    std::pair<_Iterator,_Iterator> __r;    std::pair<_Const_iterator,_Const_iterator> __cr;    typename _SortedAssociativeContainer::value_type *__first, *__last;  };  // HashedAssociativeContainer} // namespace __gnu_cxx#undef _IsUnused#endif // _GLIBCPP_BOOST_CONCEPT_CHECK

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -