1 int __exchange_and_add_dispatch(int * __mem);
3 template < typename _Tp > class new_allocator {
5 typedef _Tp & reference;
9 template < typename _CharT > struct char_traits;
15 template < typename _Tp > class allocator:public new_allocator < _Tp >
17 public:template < typename _Tp1 > struct rebind {
18 typedef allocator < _Tp1 > other;
21 template < typename _CharT, typename _Traits =
22 char_traits < _CharT >, typename _Alloc =
23 allocator < _CharT > >class basic_string;
24 typedef basic_string < char >string;
25 template < typename _CharT, typename _Traits,
26 typename _Alloc > class basic_string {
27 typedef typename _Alloc::template rebind <
28 _CharT >::other _CharT_alloc_type;
29 typedef _Alloc allocator_type;
30 typedef typename _CharT_alloc_type::reference reference;
31 private:struct _Rep_base {
34 struct _Rep:_Rep_base {
35 _CharT *_M_refdata() throw() {
38 void _M_dispose(const _Alloc & __a) {
39 if (this != &_S_empty_rep())
41 if ( __exchange_and_add_dispatch(&this-> _M_refcount))
47 void _M_destroy(const _Alloc &) throw();
49 struct _Alloc_hider:_Alloc {
50 _Alloc_hider(_CharT * __dat,
51 const _Alloc & __a):_Alloc(__a),
56 private:mutable _Alloc_hider _M_dataplus;
57 _Rep *_M_rep() const {
58 } static _Rep & _S_empty_rep() {
60 public: basic_string():
61 _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
63 _M_rep()->_M_dispose(this->get_allocator());
65 basic_string & erase() {}
66 allocator_type get_allocator() const {
68 template < typename _Tp, typename _Ref, typename _Ptr > struct _Deque_iterator {
70 template < typename _Tp, typename _Alloc > class _Deque_base {
71 public:typedef _Alloc allocator_type;
72 typedef _Deque_iterator < _Tp, _Tp &, _Tp * >iterator;
73 _Deque_base():_M_impl() {
76 typedef typename _Alloc::template rebind <
77 _Tp >::other _Tp_alloc_type;
78 struct _Deque_impl:public _Tp_alloc_type {
80 long unsigned int _M_map_size;
83 _Deque_impl():_Tp_alloc_type(), _M_map(0),
84 _M_map_size(0), _M_start(), _M_finish() {
86 protected:void _M_initialize_map(long unsigned int);
89 template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class deque:protected _Deque_base < _Tp,
94 class bad_numeric_cast:
95 public std::bad_cast { };
96 class negative_overflow:
97 public bad_numeric_cast {
98 void operator() (int) { throw negative_overflow(); }
104 template < class T > class scoped_ptr {
106 public:typedef T element_type;
107 explicit scoped_ptr(T * p = 0):px(p) {
109 template < class T > class intrusive_ptr {
110 private:typedef intrusive_ptr this_type;
111 public:typedef T element_type;
112 intrusive_ptr():px(0) {
114 intrusive_ptr(T * p, bool add_ref = true):px(p) {
117 intrusive_ptr_release(px);
119 T *operator->() const {
121 } typedef T *this_type::*unspecified_bool_type;
122 operator unspecified_bool_type() const {
126 template < typename T > struct intrusive_base {
127 intrusive_base():ref_count_(0) {
128 } ~intrusive_base() {
130 friend void intrusive_ptr_release(T * ptr) {
139 0, numbered, generated, generated_heading,
140 generated_section, generated_doc, explicit_id,
141 explicit_section_id, explicit_anchor_id
145 struct id_placeholder;
149 boost::intrusive_ptr < file_info > current_file;
150 std::deque < id_placeholder > placeholders;
151 private:id_placeholder * add_id_to_section(std::string const &id,
152 id_category category,
153 boost::intrusive_ptr <
159 private:boost::scoped_ptr < id_state > state;
161 struct file_info:intrusive_base < file_info > {
162 boost::intrusive_ptr < file_info > parent;
163 boost::intrusive_ptr < doc_info > document;
165 unsigned compatibility_version;
166 boost::intrusive_ptr < section_info > switched_section;
167 id_placeholder *original_placeholder;
168 file_info(boost::intrusive_ptr < file_info > const &parent,
169 unsigned compatibility_version):parent(parent),
170 document(parent->document), document_root(false),
171 compatibility_version(compatibility_version),
172 switched_section(), original_placeholder() {
174 struct doc_info:intrusive_base < doc_info > {
175 boost::intrusive_ptr < section_info > current_section;
177 struct section_info:intrusive_base < section_info > {
178 boost::intrusive_ptr < section_info > parent;
179 unsigned compatibility_version;
182 id_placeholder *placeholder_1_6;
183 section_info(boost::intrusive_ptr < section_info >
184 const &parent, unsigned compatibility_version,
185 std::string const &id):parent(parent),
186 compatibility_version(compatibility_version),
189 placeholder_1_6(0) {}
191 id_manager::id_manager():state() { }
193 std::string normalize_id(
200 id_placeholder *id_state::add_id_to_section(std::string const &id,
201 id_category category,
202 boost::intrusive_ptr <
205 std::string id_part = id;
207 boost::intrusive_ptr < section_info > parent;