Logo , 14292 bajtów, złamane przez Garetha McCaughana
make 'clean [template <class _Container>
class back_insert_iterator (
protected:
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit back_insert_iterator(_Container& __x) : container(&__x) ()
back_insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) (
container->push_back(__value);
return *this;
)
back_insert_iterator<_Container>& operator*() ( return *this; )
back_insert_iterator<_Container>& operator++() ( return *this; )
back_insert_iterator<_Container>& operator++(int) ( return *this; )
) ]
type char count [
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Container>
inline output_iterator_tag
iterator_category(const back_insert_iterator<_Container>&)
(
return output_iterator_tag();
)
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _Container>
inline back_insert_iterator<_Container> back_inserter(_Container& __x) (
return back_insert_iterator<_Container>(__x);
)
template <class _Container>
class front_insert_iterator (
protected:
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit front_insert_iterator(_Container& __x) : container(&__x) ()
front_insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) (
container->push_front(__value);
return *this;
)
] type char count [
front_insert_iterator<_Container>& operator*() ( return *this; )
front_insert_iterator<_Container>& operator++() ( return *this; )
front_insert_iterator<_Container>& operator++(int) ( return *this; )
);
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Container>
inline output_iterator_tag
iterator_category(const front_insert_iterator<_Container>&)
(
return output_iterator_tag();
)
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _Container>
inline front_insert_iterator<_Container> front_inserter(_Container& __x) (
return front_insert_iterator<_Container>(__x);
)
template <class _Container>
class insert_iterator (
protected:
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x), iter(__i) ()
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) (
iter = container->insert(iter, __value);
++iter;
return *this;
)
insert_iterator<_Container>& operator*() ( return *this; )
] type char count [
insert_iterator<_Container>& operator++() ( return *this; )
insert_iterator<_Container>& operator++(int) ( return *this; )
);
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Container>
inline output_iterator_tag
iterator_category(const insert_iterator<_Container>&)
(
return output_iterator_tag();
)
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _Container>
inline front_insert_iterator<_Container> front_inserter(_Container& __x) (
return front_insert_iterator<_Container>(__x);
)
template <class _Container>
class insert_iterator (
protected:
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x, typename _Container::iterator __i)
:container(&__x), iter(__i) ()
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) (
iter = container->insert(iter, __value);
++iter;
return *this;
)
insert_iterator<_Container>& operator*() ( return *this; )
insert_iterator<_Container>& operator++() ( return *this; )
insert_iterator<_Container>& operator++(int) ( return *this; )
);
] type char count [
#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
template <class _BidirectionalIterator, class _Tp, class _Reference = _Tp&,
class _Distance = ptrdiff_t>
#else
template <class _BidirectionalIterator, class _Tp, class _Reference,
class _Distance>
#endif
class reverse_bidirectional_iterator (
typedef reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
_Reference, _Distance> _Self;
protected:
_BidirectionalIterator current;
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Reference reference;
reverse_bidirectional_iterator() ()
explicit reverse_bidirectional_iterator(_BidirectionalIterator __x)
: current(__x) ()
_BidirectionalIterator base() const ( return current; )
_Reference operator*() const (
_BidirectionalIterator __tmp = current;
return *--__tmp;
)
#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const ( return &(operator*()); )
#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() (
--current;
return *this;
)
_Self operator++(int) (
_Self __tmp= *this;
--current;
return __tmp;
)
] type char count [
_Self& operator--() (
++current;
return *this;
)
_Self operator--(int) (
_Self __tmp = *this;
++current;
return __tmp;
)
);
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _BidirectionalIterator, class _Tp, class _Reference,
class _Distance>
inline bidirectional_iterator_tag
iterator_category(const reverse_bidirectional_iterator<_BidirectionalIterator,
_Tp, _Reference,
_Distance>&)
(
return bidirectional_iterator_tag();
)
template <class _BidirectionalIterator, class _Tp, class _Reference,
class _Distance>
inline _Tp*
value_type(const reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
_Reference, _Distance>&)
(
return (_Tp*) 0;
)
template <class _BidirectionalIterator, class _Tp, class _Reference,
class _Distance>
inline _Distance*
distance_type(const reverse_bidirectional_iterator<_BidirectionalIterator,
_Tp,
_Reference, _Distance>&)
(
return (_Distance*) 0;
)
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _BiIter, class _Tp, class _Ref, class _Distance>
inline bool operator==(
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
(
return __x.base() == __y.base();
)
] type char count [
#endif /*__STL_CLASS_PARTIAL_SPECIALIZATION*/
template <class _BiIter , class _Tp , class _Ref , class _Distance>
inline bool operator ==(
const reverse_bidirectional_iterator <_BiIter , _Tp, _Ref , _Distance>& __x,
const reverse_bidirectional_iterator <_BiIter , _Tp, _Ref , _Distance>& __y)
(
return __x.base() == __y.base();
)
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
] type char count [
template <class _BiIter, class _Tp, class _Ref, class _Distance>
inline bool operator!=(
const reverse_bidirectional_iterator<_BiIter, _Tp,_Ref, _Distance>& __x,
const reverse_bidirectional_iterator<_BiIter, _Tp,_Ref, _Distance>& __y)
(
return !(__x== __y);
)
inline bool operator!=(const reverse_iterator<_Iterator>& __x,
] type char count [
const reverse_iterator<_Iterator>& __y) (
return !(__x == __y);
)
template <class _Iterator>
inline bool operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) (
return __y < __x;
)
template <class _Iterator>
inline bool operator<=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) (
return !(__y < __x);
)
template <class _Iterator>
inline bool operator>=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) (
return !(__x < __y);
)
#endif /*__STL_FUNCTION_TMPL_PARTIAL_ORDER */
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
// This is the new version of reverse_iterator, as defined in the
// draft C++ standard. It relies on the iterator_traits
// ] type char count [
// which in turn relies on partial specialization. The class
// reverse_bidirectional_iterator is no longer part of the draft
// standard, but it is retained for backward compatibility.
template <class _Iterator>
class reverse_iterator
(
protected:
_Iterator current;
public:
typedef typename iterator_traits<_Iterator>::iterator_category
iterator_category;
typedef typename iterator_traits<_Iterator>::value_type
value_type;
typedef typename iterator_traits<_Iterator>::difference_type
difference_type;
typedef typename iterator_traits<_Iterator>::pointer
pointer;
typedef typename iterator_traits<_Iterator>::reference
reference;
typedef _Iterator iterator_type;
typedef reverse_iterator<_Iterator> _Self;
public:
reverse_iterator() ()
explicit reverse_iterator(iterator_type __x) : current(__x) ()
template <class _Iterator>
inline bool operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) (
return __y < __x;
)
template <class _Iterator>
inline bool operator<= ( const reverse_iterator<_Iterator> & __x,
const reverse_iterator<_Iterator> & __y) (
return !(__y < __x);
)
] type char count [
// This is the old version of reverse_iterator, as found in the original
// HP STL. It does not use partial specialization.
#ifndef __STL_LIMITED_DEFAULT_TEMPLATES
template <class _RandomAccessIterator, class _Tp, class _Reference = _Tp&,
class _Distance = ptrdiff_t>
#else
template <class _RandomAccessIterator, class _Tp, class _Reference,
class _Distance>
#endif
class reverse_iterator (
typedef reverse_iterator<_RandomAccessIterator, _Tp, _Reference, _Distance>
_Self;
protected:
_RandomAccessIterator current;
public:
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Reference reference;
reverse_iterator() ()
explicit reverse_iterator(_RandomAccessIterator __x) : current(__x) ()
_RandomAccessIterator base() const ( return current; )
_Reference operator*() const ( return *(current - 1); )
#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->()const(return &(operator*());)
#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() (
--current;
return *this;
)
] type char count [
_Self operator++(int) (
_Self __tmp = *this;
--current;
return __tmp;
)
_Self& operator--() (
++current;
return *this;
)
_Self operator--(int) (
_Self __tmp = *this;
++current;
return __tmp;
)
_Self operator+(_Distance __n) const (
return _Self(current - __n);
)
_Self& operator+=(_Distance __n) (
current -= __n;
return *this;
)
_Self operator- (_Distance __n) const (
return _Self(current + __n);
)
_Self& operator-=(_Distance __n) (
current += __n;
return *this;
)
_Reference operator[] (_Distance __n ) const ( return * ( * this + __n); )
);
template <class _RandomAccessIterator , class _Tp,
class _Reference , class _Distance>
inline random_access_iterator_tag
iterator_category(const reverse_iterator<_RandomAccessIterator, _Tp,
_Reference, _Distance>&)
(
return random_access_iterator_tag();
)
] type char count [
template <class _RandomAccessIterator, class _Tp,
class _Reference, class _Distance>
inline bool
operator>(const reverse_iterator<_RandomAccessIterator, _Tp,
_Reference, _Distance>& __x,
const reverse_iterator<_RandomAccessIterator, _Tp,
_Reference, _Distance>& __y) (
return __y < __x;
)
template <class _RandomAccessIterator, class _Tp ,
class _Reference, class _Distance >
inline bool
operator<=(const reverse_iterator<_RandomAccessIterator, _Tp,
_Reference, _Distance>& __x,
const reverse_iterator<_RandomAccessIterator, _Tp,
_Reference, _Distance>& __y) (
return !(__y < __x) ;
)
template <class _RandomAccessIterator, class _Tp,
class _Reference, class _Distance>
inline bool
operator >= (const reverse_iterator <_RandomAccessIterator, _Tp,
_Reference , _Distance>& __x,
const reverse_iterator <_RandomAccessIterator, _Tp,
_Reference , _Distance>& __y) (
return ! (__x < __y) ;
)
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
] type char count [
template <class _Tp,
class _CharT =char, class _Traits= char_traits<_CharT> >
class ostream_iterator (
public:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef basic_ostream<_CharT, _Traits> ostream_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
]
Wyjaśnienie:
make
przypisuje wartość do zmiennej. W tym przypadku make 'clean
jest to po prostu zaciemnianie, przypisywanie zmiennej kwadratowej w nawiasach kwadratowych, clean
a następnie nic z tym nie robić.
type char count
służy do wydrukowania znaku na podstawie liczby elementów na poniższej liście w nawiasach kwadratowych. type
wypisuje wartość, char
zwraca znak oparty na wartości ASCII i count
zwraca liczbę elementów na liście. Na przykład type char count [ a b c d e f g h i j ]
wydrukuje znak nowej linii (wartość ASCII 10).
Wypróbuj online tutaj (wymagane wycięcie i wklejenie źródła)