]> git.wh0rd.org - ICEs.git/blob - 321197/pyside.ii.1
more
[ICEs.git] / 321197 / pyside.ii.1
1 typedef long int ptrdiff_t;
2 typedef long unsigned int size_t;
3 typedef signed char qint8;
4 typedef unsigned char quint8;
5 typedef short qint16;
6 typedef unsigned short quint16;
7 typedef int qint32;
8 typedef unsigned int quint32;
9 typedef long long qint64;
10 typedef unsigned long long quint64;
11 typedef qint64 qlonglong;
12 typedef quint64 qulonglong;
13 template <int> struct QIntegerForSize;
14 template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; };
15 template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
16 template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
17 template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };
18 template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { };
19 typedef QIntegerForSizeof<void*>::Unsigned quintptr;
20 typedef QIntegerForSizeof<void*>::Signed qptrdiff;
21 typedef unsigned char uchar;
22 typedef unsigned short ushort;
23 typedef unsigned int uint;
24 typedef unsigned long ulong;
25 typedef int QNoImplicitBoolCast;
26 typedef double qreal;
27 template <typename T>
28 inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
29 inline int qRound(qreal d)
30 { return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
31 inline qint64 qRound64(qreal d)
32 { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); }
33 template <typename T>
34 inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
35 template <typename T>
36 inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }
37 template <typename T>
38 inline const T &qBound(const T &min, const T &val, const T &max)
39 { return qMax(min, qMin(max, val)); }
40 class QDataStream;
41 inline void qt_noop() {}
42 class QString;
43 class QSysInfo {
44 public:
45 enum Sizes {
46 WordSize = (sizeof(void *)<<3)
47 };
48 enum Endian {
49 BigEndian,
50 LittleEndian
51 , ByteOrder = LittleEndian
52 };
53 };
54 const char *qVersion();
55 bool qSharedBuild();
56 void qDebug(const char *, ...)
57 __attribute__ ((format (printf, 1, 2)))
58 ;
59 void qWarning(const char *, ...)
60 __attribute__ ((format (printf, 1, 2)))
61 ;
62 class QString;
63 QString qt_error_string(int errorCode = -1);
64 void qCritical(const char *, ...)
65 __attribute__ ((format (printf, 1, 2)))
66 ;
67 void qFatal(const char *, ...)
68 __attribute__ ((format (printf, 1, 2)))
69 ;
70 void qErrnoWarning(int code, const char *msg, ...);
71 void qErrnoWarning(const char *msg, ...);
72 class QDebug;
73 class QNoDebug;
74 inline QDebug qDebug();
75 inline QDebug qWarning();
76 inline QDebug qCritical();
77 void qt_assert(const char *assertion, const char *file, int line);
78 void qt_assert_x(const char *where, const char *what, const char *file, int line);
79 void qt_check_pointer(const char *, int);
80 void qBadAlloc();
81 template <typename T>
82 inline T *q_check_ptr(T *p) { do { if (!(p)) qBadAlloc(); } while (0); return p; }
83 enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
84 void qt_message_output(QtMsgType, const char *buf);
85 typedef void (*QtMsgHandler)(QtMsgType, const char *);
86 QtMsgHandler qInstallMsgHandler(QtMsgHandler);
87 template <typename T> class QBasicAtomicPointer;
88 template <typename T>
89 class QGlobalStatic
90 {
91 public:
92 QBasicAtomicPointer<T> pointer;
93 bool destroyed;
94 };
95 template <typename T>
96 class QGlobalStaticDeleter
97 {
98 public:
99 QGlobalStatic<T> &globalStatic;
100 QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
101 : globalStatic(_globalStatic)
102 { }
103 inline ~QGlobalStaticDeleter()
104 {
105 delete globalStatic.pointer;
106 globalStatic.pointer = 0;
107 globalStatic.destroyed = true;
108 }
109 };
110 class QBool
111 {
112 bool b;
113 public:
114 inline explicit QBool(bool B) : b(B) {}
115 inline operator const void *() const
116 { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
117 };
118 inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; }
119 inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; }
120 inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; }
121 inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; }
122 inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; }
123 inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; }
124 static inline bool qFuzzyCompare(double p1, double p2)
125 {
126 return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
127 }
128 static inline bool qFuzzyCompare(float p1, float p2)
129 {
130 return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
131 }
132 static inline bool qFuzzyIsNull(double d)
133 {
134 return qAbs(d) <= 0.000000000001;
135 }
136 static inline bool qFuzzyIsNull(float f)
137 {
138 return qAbs(f) <= 0.00001f;
139 }
140 static inline bool qIsNull(double d)
141 {
142 union U {
143 double d;
144 quint64 u;
145 };
146 U val;
147 val.d = d;
148 return val.u == quint64(0);
149 }
150 static inline bool qIsNull(float f)
151 {
152 union U {
153 float f;
154 quint32 u;
155 };
156 U val;
157 val.f = f;
158 return val.u == 0u;
159 }
160 template <typename T> inline bool qIsDetached(T &) { return true; }
161 template <typename T>
162 class QTypeInfo
163 {
164 public:
165 enum {
166 isPointer = false,
167 isComplex = true,
168 isStatic = true,
169 isLarge = (sizeof(T)>sizeof(void*)),
170 isDummy = false
171 };
172 };
173 template <typename T>
174 class QTypeInfo<T*>
175 {
176 public:
177 enum {
178 isPointer = true,
179 isComplex = false,
180 isStatic = false,
181 isLarge = false,
182 isDummy = false
183 };
184 };
185 enum {
186 Q_COMPLEX_TYPE = 0,
187 Q_PRIMITIVE_TYPE = 0x1,
188 Q_STATIC_TYPE = 0,
189 Q_MOVABLE_TYPE = 0x2,
190 Q_DUMMY_TYPE = 0x4
191 };
192 template <typename T>
193 inline void qSwap(T &value1, T &value2)
194 {
195 const T t = value1;
196 value1 = value2;
197 value2 = t;
198 }
199 template <> class QTypeInfo<bool > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(bool)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "bool"; } };
200 template <> class QTypeInfo<char > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(char)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "char"; } };
201 template <> class QTypeInfo<signed char > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(signed char)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "signed char"; } };
202 template <> class QTypeInfo<uchar > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(uchar)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "uchar"; } };
203 template <> class QTypeInfo<short > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(short)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "short"; } };
204 template <> class QTypeInfo<ushort > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(ushort)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "ushort"; } };
205 template <> class QTypeInfo<int > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(int)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "int"; } };
206 template <> class QTypeInfo<uint > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(uint)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "uint"; } };
207 template <> class QTypeInfo<long > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(long)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "long"; } };
208 template <> class QTypeInfo<ulong > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(ulong)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "ulong"; } };
209 template <> class QTypeInfo<qint64 > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(qint64)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "qint64"; } };
210 template <> class QTypeInfo<quint64 > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(quint64)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "quint64"; } };
211 template <> class QTypeInfo<float > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(float)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "float"; } };
212 template <> class QTypeInfo<double > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(double)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "double"; } };
213 template <> class QTypeInfo<long double > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(long double)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "long double"; } };
214 void *qMalloc(size_t size);
215 void qFree(void *ptr);
216 void *qRealloc(void *ptr, size_t size);
217 void *qMallocAligned(size_t size, size_t alignment);
218 void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment);
219 void qFreeAligned(void *ptr);
220 void *qMemCopy(void *dest, const void *src, size_t n);
221 void *qMemSet(void *dest, int c, size_t n);
222 class QFlag
223 {
224 int i;
225 public:
226 inline QFlag(int i);
227 inline operator int() const { return i; }
228 };
229 inline QFlag::QFlag(int ai) : i(ai) {}
230 class QIncompatibleFlag
231 {
232 int i;
233 public:
234 inline explicit QIncompatibleFlag(int i);
235 inline operator int() const { return i; }
236 };
237 inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {}
238 template<typename Enum>
239 class QFlags
240 {
241 typedef void **Zero;
242 int i;
243 public:
244 typedef Enum enum_type;
245 inline QFlags(const QFlags &f) : i(f.i) {}
246 inline QFlags(Enum f) : i(f) {}
247 inline QFlags(Zero = 0) : i(0) {}
248 inline QFlags(QFlag f) : i(f) {}
249 inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
250 inline QFlags &operator&=(int mask) { i &= mask; return *this; }
251 inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
252 inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
253 inline QFlags &operator|=(Enum f) { i |= f; return *this; }
254 inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
255 inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
256 inline operator int() const { return i; }
257 inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; }
258 inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; }
259 inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; }
260 inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; }
261 inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; }
262 inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; }
263 inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; }
264 inline QFlags operator~() const { QFlags g; g.i = ~i; return g; }
265 inline bool operator!() const { return !i; }
266 inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); }
267 };
268 template <typename T>
269 class QForeachContainer {
270 public:
271 inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
272 const T c;
273 int brk;
274 typename T::const_iterator i, e;
275 };
276 template <typename T> static inline T *qGetPtrHelper(T *ptr) { return ptr; }
277 template <typename Wrapper> static inline typename Wrapper::pointer qGetPtrHelper(const Wrapper &p) { return p.data(); }
278 QString qtTrId(const char *id, int n = -1);
279 class QByteArray;
280 QByteArray qgetenv(const char *varName);
281 bool qputenv(const char *varName, const QByteArray& value);
282 inline int qIntCast(double f) { return int(f); }
283 inline int qIntCast(float f) { return int(f); }
284 void qsrand(uint seed);
285 int qrand();
286 enum QtValidLicenseForCoreModule { LicensedCore = true };
287 enum QtValidLicenseForGuiModule { LicensedGui = true };
288 enum QtValidLicenseForNetworkModule { LicensedNetwork = true };
289 enum QtValidLicenseForOpenGLModule { LicensedOpenGL = true };
290 enum QtValidLicenseForOpenVGModule { LicensedOpenVG = true };
291 enum QtValidLicenseForSqlModule { LicensedSql = true };
292 enum QtValidLicenseForMultimediaModule { LicensedMultimedia = true };
293 enum QtValidLicenseForXmlModule { LicensedXml = true };
294 enum QtValidLicenseForXmlPatternsModule { LicensedXmlPatterns = true };
295 enum QtValidLicenseForHelpModule { LicensedHelp = true };
296 enum QtValidLicenseForScriptModule { LicensedScript = true };
297 enum QtValidLicenseForScriptToolsModule { LicensedScriptTools = true };
298 enum QtValidLicenseForQt3SupportLightModule { LicensedQt3SupportLight = true };
299 enum QtValidLicenseForQt3SupportModule { LicensedQt3Support = true };
300 enum QtValidLicenseForSvgModule { LicensedSvg = true };
301 enum QtValidLicenseForDeclarativeModule { LicensedDeclarative = true };
302 enum QtValidLicenseForActiveQtModule { LicensedActiveQt = true };
303 enum QtValidLicenseForTestModule { LicensedTest = true };
304 enum QtValidLicenseForDBusModule { LicensedDBus = true };
305 typedef QtValidLicenseForCoreModule QtCoreModule;
306 class QString;
307 struct QLatin1Char
308 {
309 public:
310 inline explicit QLatin1Char(char c) : ch(c) {}
311 inline char toLatin1() const { return ch; }
312 inline ushort unicode() const { return ushort(uchar(ch)); }
313 private:
314 char ch;
315 };
316 class QChar {
317 public:
318 QChar();
319 QChar(char c);
320 QChar(uchar c);
321 QChar(QLatin1Char ch);
322 QChar(uchar c, uchar r);
323 inline QChar(ushort rc) : ucs(rc){}
324 QChar(short rc);
325 QChar(uint rc);
326 QChar(int rc);
327 enum SpecialCharacter {
328 Null = 0x0000,
329 Nbsp = 0x00a0,
330 ReplacementCharacter = 0xfffd,
331 ObjectReplacementCharacter = 0xfffc,
332 ByteOrderMark = 0xfeff,
333 ByteOrderSwapped = 0xfffe,
334 ParagraphSeparator = 0x2029,
335 LineSeparator = 0x2028
336 };
337 QChar(SpecialCharacter sc);
338 enum Category
339 {
340 NoCategory,
341 Mark_NonSpacing,
342 Mark_SpacingCombining,
343 Mark_Enclosing,
344 Number_DecimalDigit,
345 Number_Letter,
346 Number_Other,
347 Separator_Space,
348 Separator_Line,
349 Separator_Paragraph,
350 Other_Control,
351 Other_Format,
352 Other_Surrogate,
353 Other_PrivateUse,
354 Other_NotAssigned,
355 Letter_Uppercase,
356 Letter_Lowercase,
357 Letter_Titlecase,
358 Letter_Modifier,
359 Letter_Other,
360 Punctuation_Connector,
361 Punctuation_Dash,
362 Punctuation_Open,
363 Punctuation_Close,
364 Punctuation_InitialQuote,
365 Punctuation_FinalQuote,
366 Punctuation_Other,
367 Symbol_Math,
368 Symbol_Currency,
369 Symbol_Modifier,
370 Symbol_Other,
371 Punctuation_Dask = Punctuation_Dash
372 };
373 enum Direction
374 {
375 DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
376 DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
377 };
378 enum Decomposition
379 {
380 NoDecomposition,
381 Canonical,
382 Font,
383 NoBreak,
384 Initial,
385 Medial,
386 Final,
387 Isolated,
388 Circle,
389 Super,
390 Sub,
391 Vertical,
392 Wide,
393 Narrow,
394 Small,
395 Square,
396 Compat,
397 Fraction
398 };
399 enum Joining
400 {
401 OtherJoining, Dual, Right, Center
402 };
403 enum CombiningClass
404 {
405 Combining_BelowLeftAttached = 200,
406 Combining_BelowAttached = 202,
407 Combining_BelowRightAttached = 204,
408 Combining_LeftAttached = 208,
409 Combining_RightAttached = 210,
410 Combining_AboveLeftAttached = 212,
411 Combining_AboveAttached = 214,
412 Combining_AboveRightAttached = 216,
413 Combining_BelowLeft = 218,
414 Combining_Below = 220,
415 Combining_BelowRight = 222,
416 Combining_Left = 224,
417 Combining_Right = 226,
418 Combining_AboveLeft = 228,
419 Combining_Above = 230,
420 Combining_AboveRight = 232,
421 Combining_DoubleBelow = 233,
422 Combining_DoubleAbove = 234,
423 Combining_IotaSubscript = 240
424 };
425 enum UnicodeVersion {
426 Unicode_Unassigned,
427 Unicode_1_1,
428 Unicode_2_0,
429 Unicode_2_1_2,
430 Unicode_3_0,
431 Unicode_3_1,
432 Unicode_3_2,
433 Unicode_4_0,
434 Unicode_4_1,
435 Unicode_5_0
436 };
437 Category category() const;
438 Direction direction() const;
439 Joining joining() const;
440 bool hasMirrored() const;
441 unsigned char combiningClass() const;
442 QChar mirroredChar() const;
443 QString decomposition() const;
444 Decomposition decompositionTag() const;
445 int digitValue() const;
446 QChar toLower() const;
447 QChar toUpper() const;
448 QChar toTitleCase() const;
449 QChar toCaseFolded() const;
450 UnicodeVersion unicodeVersion() const;
451 char toAscii() const;
452 inline char toLatin1() const;
453 inline ushort unicode() const { return ucs; }
454 inline ushort &unicode() { return const_cast<ushort&>(ucs); }
455 static QChar fromAscii(char c);
456 static QChar fromLatin1(char c);
457 inline bool isNull() const { return ucs == 0; }
458 bool isPrint() const;
459 bool isPunct() const;
460 bool isSpace() const;
461 bool isMark() const;
462 bool isLetter() const;
463 bool isNumber() const;
464 bool isLetterOrNumber() const;
465 bool isDigit() const;
466 bool isSymbol() const;
467 inline bool isLower() const { return category() == Letter_Lowercase; }
468 inline bool isUpper() const { return category() == Letter_Uppercase; }
469 inline bool isTitleCase() const { return category() == Letter_Titlecase; }
470 inline bool isHighSurrogate() const {
471 return ((ucs & 0xfc00) == 0xd800);
472 }
473 inline bool isLowSurrogate() const {
474 return ((ucs & 0xfc00) == 0xdc00);
475 }
476 inline uchar cell() const { return uchar(ucs & 0xff); }
477 inline uchar row() const { return uchar((ucs>>8)&0xff); }
478 inline void setCell(uchar cell);
479 inline void setRow(uchar row);
480 static inline uint surrogateToUcs4(ushort high, ushort low) {
481 return (uint(high)<<10) + low - 0x35fdc00;
482 }
483 static inline uint surrogateToUcs4(QChar high, QChar low) {
484 return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
485 }
486 static inline ushort highSurrogate(uint ucs4) {
487 return ushort((ucs4>>10) + 0xd7c0);
488 }
489 static inline ushort lowSurrogate(uint ucs4) {
490 return ushort(ucs4%0x400 + 0xdc00);
491 }
492 static Category category(uint ucs4);
493 static Category category(ushort ucs2);
494 static Direction direction(uint ucs4);
495 static Direction direction(ushort ucs2);
496 static Joining joining(uint ucs4);
497 static Joining joining(ushort ucs2);
498 static unsigned char combiningClass(uint ucs4);
499 static unsigned char combiningClass(ushort ucs2);
500 static uint mirroredChar(uint ucs4);
501 static ushort mirroredChar(ushort ucs2);
502 static Decomposition decompositionTag(uint ucs4);
503 static int digitValue(uint ucs4);
504 static int digitValue(ushort ucs2);
505 static uint toLower(uint ucs4);
506 static ushort toLower(ushort ucs2);
507 static uint toUpper(uint ucs4);
508 static ushort toUpper(ushort ucs2);
509 static uint toTitleCase(uint ucs4);
510 static ushort toTitleCase(ushort ucs2);
511 static uint toCaseFolded(uint ucs4);
512 static ushort toCaseFolded(ushort ucs2);
513 static UnicodeVersion unicodeVersion(uint ucs4);
514 static UnicodeVersion unicodeVersion(ushort ucs2);
515 static QString decomposition(uint ucs4);
516 private:
517 ushort ucs;
518 }
519 ;
520 template <> class QTypeInfo<QChar > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QChar)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QChar"; } };
521 inline QChar::QChar() : ucs(0) {}
522 inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
523 inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
524 inline QChar::QChar(uchar c, uchar r) : ucs(ushort((r << 8) | c)){}
525 inline QChar::QChar(short rc) : ucs(ushort(rc)){}
526 inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
527 inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){}
528 inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {}
529 inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {}
530 inline void QChar::setCell(uchar acell)
531 { ucs = ushort((ucs & 0xff00) + acell); }
532 inline void QChar::setRow(uchar arow)
533 { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
534 inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); }
535 inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); }
536 inline bool operator<=(QChar c1, QChar c2) { return c1.unicode() <= c2.unicode(); }
537 inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); }
538 inline bool operator<(QChar c1, QChar c2) { return c1.unicode() < c2.unicode(); }
539 inline bool operator>(QChar c1, QChar c2) { return c1.unicode() > c2.unicode(); }
540 QDataStream &operator<<(QDataStream &, const QChar &);
541 QDataStream &operator>>(QDataStream &, QChar &);
542 typedef QtValidLicenseForCoreModule QtCoreModule;
543 class QBasicAtomicInt
544 {
545 public:
546 volatile int _q_value;
547 inline bool operator==(int value) const
548 {
549 return _q_value == value;
550 }
551 inline bool operator!=(int value) const
552 {
553 return _q_value != value;
554 }
555 inline bool operator!() const
556 {
557 return _q_value == 0;
558 }
559 inline operator int() const
560 {
561 return _q_value;
562 }
563 inline QBasicAtomicInt &operator=(int value)
564 {
565 _q_value = value;
566 return *this;
567 }
568 static bool isReferenceCountingNative();
569 static bool isReferenceCountingWaitFree();
570 bool ref();
571 bool deref();
572 static bool isTestAndSetNative();
573 static bool isTestAndSetWaitFree();
574 bool testAndSetRelaxed(int expectedValue, int newValue);
575 bool testAndSetAcquire(int expectedValue, int newValue);
576 bool testAndSetRelease(int expectedValue, int newValue);
577 bool testAndSetOrdered(int expectedValue, int newValue);
578 static bool isFetchAndStoreNative();
579 static bool isFetchAndStoreWaitFree();
580 int fetchAndStoreRelaxed(int newValue);
581 int fetchAndStoreAcquire(int newValue);
582 int fetchAndStoreRelease(int newValue);
583 int fetchAndStoreOrdered(int newValue);
584 static bool isFetchAndAddNative();
585 static bool isFetchAndAddWaitFree();
586 int fetchAndAddRelaxed(int valueToAdd);
587 int fetchAndAddAcquire(int valueToAdd);
588 int fetchAndAddRelease(int valueToAdd);
589 int fetchAndAddOrdered(int valueToAdd);
590 };
591 template <typename T>
592 class QBasicAtomicPointer
593 {
594 public:
595 T * volatile _q_value;
596 inline bool operator==(T *value) const
597 {
598 return _q_value == value;
599 }
600 inline bool operator!=(T *value) const
601 {
602 return !operator==(value);
603 }
604 inline bool operator!() const
605 {
606 return operator==(0);
607 }
608 inline operator T *() const
609 {
610 return _q_value;
611 }
612 inline T *operator->() const
613 {
614 return _q_value;
615 }
616 inline QBasicAtomicPointer<T> &operator=(T *value)
617 {
618 _q_value = value;
619 return *this;
620 }
621 static bool isTestAndSetNative();
622 static bool isTestAndSetWaitFree();
623 bool testAndSetRelaxed(T *expectedValue, T *newValue);
624 bool testAndSetAcquire(T *expectedValue, T *newValue);
625 bool testAndSetRelease(T *expectedValue, T *newValue);
626 bool testAndSetOrdered(T *expectedValue, T *newValue);
627 static bool isFetchAndStoreNative();
628 static bool isFetchAndStoreWaitFree();
629 T *fetchAndStoreRelaxed(T *newValue);
630 T *fetchAndStoreAcquire(T *newValue);
631 T *fetchAndStoreRelease(T *newValue);
632 T *fetchAndStoreOrdered(T *newValue);
633 static bool isFetchAndAddNative();
634 static bool isFetchAndAddWaitFree();
635 T *fetchAndAddRelaxed(qptrdiff valueToAdd);
636 T *fetchAndAddAcquire(qptrdiff valueToAdd);
637 T *fetchAndAddRelease(qptrdiff valueToAdd);
638 T *fetchAndAddOrdered(qptrdiff valueToAdd);
639 };
640 inline bool QBasicAtomicInt::isReferenceCountingNative()
641 { return true; }
642 inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
643 { return true; }
644 inline bool QBasicAtomicInt::isTestAndSetNative()
645 { return true; }
646 inline bool QBasicAtomicInt::isTestAndSetWaitFree()
647 { return true; }
648 inline bool QBasicAtomicInt::isFetchAndStoreNative()
649 { return true; }
650 inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
651 { return true; }
652 inline bool QBasicAtomicInt::isFetchAndAddNative()
653 { return true; }
654 inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
655 { return true; }
656 template <typename T>
657 inline bool QBasicAtomicPointer<T>::isTestAndSetNative()
658 { return true; }
659 template <typename T>
660 inline bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
661 { return true; }
662 template <typename T>
663 inline bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
664 { return true; }
665 template <typename T>
666 inline bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
667 { return true; }
668 template <typename T>
669 inline bool QBasicAtomicPointer<T>::isFetchAndAddNative()
670 { return true; }
671 template <typename T>
672 inline bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
673 { return true; }
674 inline bool QBasicAtomicInt::ref()
675 {
676 unsigned char ret;
677 asm volatile("lock\n"
678 "incl %0\n"
679 "setne %1"
680 : "=m" (_q_value), "=qm" (ret)
681 : "m" (_q_value)
682 : "memory");
683 return ret != 0;
684 }
685 inline bool QBasicAtomicInt::deref()
686 {
687 unsigned char ret;
688 asm volatile("lock\n"
689 "decl %0\n"
690 "setne %1"
691 : "=m" (_q_value), "=qm" (ret)
692 : "m" (_q_value)
693 : "memory");
694 return ret != 0;
695 }
696 inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
697 {
698 unsigned char ret;
699 asm volatile("lock\n"
700 "cmpxchgl %3,%2\n"
701 "sete %1\n"
702 : "=a" (newValue), "=qm" (ret), "+m" (_q_value)
703 : "r" (newValue), "0" (expectedValue)
704 : "memory");
705 return ret != 0;
706 }
707 inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
708 {
709 asm volatile("xchgl %0,%1"
710 : "=r" (newValue), "+m" (_q_value)
711 : "0" (newValue)
712 : "memory");
713 return newValue;
714 }
715 inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
716 {
717 asm volatile("lock\n"
718 "xaddl %0,%1"
719 : "=r" (valueToAdd), "+m" (_q_value)
720 : "0" (valueToAdd)
721 : "memory");
722 return valueToAdd;
723 }
724 template <typename T>
725 inline bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
726 {
727 unsigned char ret;
728 asm volatile("lock\n"
729 "cmpxchgq %3,%2\n"
730 "sete %1\n"
731 : "=a" (newValue), "=qm" (ret), "+m" (_q_value)
732 : "r" (newValue), "0" (expectedValue)
733 : "memory");
734 return ret != 0;
735 }
736 template <typename T>
737 inline T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
738 {
739 asm volatile("xchgq %0,%1"
740 : "=r" (newValue), "+m" (_q_value)
741 : "0" (newValue)
742 : "memory");
743 return newValue;
744 }
745 template <typename T>
746 inline T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
747 {
748 asm volatile("lock\n"
749 "xaddq %0,%1"
750 : "=r" (valueToAdd), "+m" (_q_value)
751 : "0" (valueToAdd * sizeof(T))
752 : "memory");
753 return reinterpret_cast<T *>(valueToAdd);
754 }
755 inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
756 {
757 return testAndSetOrdered(expectedValue, newValue);
758 }
759 inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
760 {
761 return testAndSetOrdered(expectedValue, newValue);
762 }
763 inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
764 {
765 return testAndSetOrdered(expectedValue, newValue);
766 }
767 inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
768 {
769 return fetchAndStoreOrdered(newValue);
770 }
771 inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
772 {
773 return fetchAndStoreOrdered(newValue);
774 }
775 inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
776 {
777 return fetchAndStoreOrdered(newValue);
778 }
779 inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
780 {
781 return fetchAndAddOrdered(valueToAdd);
782 }
783 inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
784 {
785 return fetchAndAddOrdered(valueToAdd);
786 }
787 inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
788 {
789 return fetchAndAddOrdered(valueToAdd);
790 }
791 template <typename T>
792 inline bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
793 {
794 return testAndSetOrdered(expectedValue, newValue);
795 }
796 template <typename T>
797 inline bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
798 {
799 return testAndSetOrdered(expectedValue, newValue);
800 }
801 template <typename T>
802 inline bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
803 {
804 return testAndSetOrdered(expectedValue, newValue);
805 }
806 template <typename T>
807 inline T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
808 {
809 return fetchAndStoreOrdered(newValue);
810 }
811 template <typename T>
812 inline T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
813 {
814 return fetchAndStoreOrdered(newValue);
815 }
816 template <typename T>
817 inline T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
818 {
819 return fetchAndStoreOrdered(newValue);
820 }
821 template <typename T>
822 inline T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
823 {
824 return fetchAndAddOrdered(valueToAdd);
825 }
826 template <typename T>
827 inline T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
828 {
829 return fetchAndAddOrdered(valueToAdd);
830 }
831 template <typename T>
832 inline T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
833 {
834 return fetchAndAddOrdered(valueToAdd);
835 }
836 typedef QtValidLicenseForCoreModule QtCoreModule;
837 class QAtomicInt : public QBasicAtomicInt
838 {
839 public:
840 inline QAtomicInt(int value = 0)
841 {
842 _q_value = value;
843 }
844 inline QAtomicInt(const QAtomicInt &other)
845 {
846 _q_value = other._q_value;
847 }
848 inline QAtomicInt &operator=(int value)
849 {
850 (void) QBasicAtomicInt::operator=(value);
851 return *this;
852 }
853 inline QAtomicInt &operator=(const QAtomicInt &other)
854 {
855 (void) QBasicAtomicInt::operator=(other);
856 return *this;
857 }
858 };
859 template <typename T>
860 class QAtomicPointer : public QBasicAtomicPointer<T>
861 {
862 public:
863 inline QAtomicPointer(T *value = 0)
864 {
865 QBasicAtomicPointer<T>::_q_value = value;
866 }
867 inline QAtomicPointer(const QAtomicPointer<T> &other)
868 {
869 QBasicAtomicPointer<T>::_q_value = other._q_value;
870 }
871 inline QAtomicPointer<T> &operator=(T *value)
872 {
873 (void) QBasicAtomicPointer<T>::operator=(value);
874 return *this;
875 }
876 inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other)
877 {
878 (void) QBasicAtomicPointer<T>::operator=(other);
879 return *this;
880 }
881 };
882 template <typename T>
883 inline void qAtomicAssign(T *&d, T *x)
884 {
885 if (d == x)
886 return;
887 x->ref.ref();
888 if (!d->ref.deref())
889 delete d;
890 d = x;
891 }
892 template <typename T>
893 inline void qAtomicDetach(T *&d)
894 {
895 if (d->ref == 1)
896 return;
897 T *x = d;
898 d = new T(*d);
899 if (!x->ref.deref())
900 delete x;
901 }
902 typedef QtValidLicenseForCoreModule QtCoreModule;
903 namespace
904 Qt {
905 enum GlobalColor {
906 color0,
907 color1,
908 black,
909 white,
910 darkGray,
911 gray,
912 lightGray,
913 red,
914 green,
915 blue,
916 cyan,
917 magenta,
918 yellow,
919 darkRed,
920 darkGreen,
921 darkBlue,
922 darkCyan,
923 darkMagenta,
924 darkYellow,
925 transparent
926 };
927 enum KeyboardModifier {
928 NoModifier = 0x00000000,
929 ShiftModifier = 0x02000000,
930 ControlModifier = 0x04000000,
931 AltModifier = 0x08000000,
932 MetaModifier = 0x10000000,
933 KeypadModifier = 0x20000000,
934 GroupSwitchModifier = 0x40000000,
935 KeyboardModifierMask = 0xfe000000
936 };
937 typedef QFlags<KeyboardModifier> KeyboardModifiers;
938 enum Modifier {
939 META = Qt::MetaModifier,
940 SHIFT = Qt::ShiftModifier,
941 CTRL = Qt::ControlModifier,
942 ALT = Qt::AltModifier,
943 MODIFIER_MASK = KeyboardModifierMask,
944 UNICODE_ACCEL = 0x00000000
945 };
946 enum MouseButton {
947 NoButton = 0x00000000,
948 LeftButton = 0x00000001,
949 RightButton = 0x00000002,
950 MidButton = 0x00000004,
951 XButton1 = 0x00000008,
952 XButton2 = 0x00000010,
953 MouseButtonMask = 0x000000ff
954 };
955 typedef QFlags<MouseButton> MouseButtons;
956 enum Orientation {
957 Horizontal = 0x1,
958 Vertical = 0x2
959 };
960 typedef QFlags<Orientation> Orientations;
961 enum FocusPolicy {
962 NoFocus = 0,
963 TabFocus = 0x1,
964 ClickFocus = 0x2,
965 StrongFocus = TabFocus | ClickFocus | 0x8,
966 WheelFocus = StrongFocus | 0x4
967 };
968 enum SortOrder {
969 AscendingOrder,
970 DescendingOrder
971 };
972 enum TileRule {
973 StretchTile,
974 RepeatTile,
975 RoundTile
976 };
977 enum AlignmentFlag {
978 AlignLeft = 0x0001,
979 AlignLeading = AlignLeft,
980 AlignRight = 0x0002,
981 AlignTrailing = AlignRight,
982 AlignHCenter = 0x0004,
983 AlignJustify = 0x0008,
984 AlignAbsolute = 0x0010,
985 AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify | AlignAbsolute,
986 AlignTop = 0x0020,
987 AlignBottom = 0x0040,
988 AlignVCenter = 0x0080,
989 AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter,
990 AlignCenter = AlignVCenter | AlignHCenter
991 };
992 typedef QFlags<AlignmentFlag> Alignment;
993 enum TextFlag {
994 TextSingleLine = 0x0100,
995 TextDontClip = 0x0200,
996 TextExpandTabs = 0x0400,
997 TextShowMnemonic = 0x0800,
998 TextWordWrap = 0x1000,
999 TextWrapAnywhere = 0x2000,
1000 TextDontPrint = 0x4000,
1001 TextIncludeTrailingSpaces = 0x08000000,
1002 TextHideMnemonic = 0x8000,
1003 TextJustificationForced = 0x10000,
1004 TextForceLeftToRight = 0x20000,
1005 TextForceRightToLeft = 0x40000,
1006 TextLongestVariant = 0x80000
1007 };
1008 enum TextElideMode {
1009 ElideLeft,
1010 ElideRight,
1011 ElideMiddle,
1012 ElideNone
1013 };
1014 enum WindowType {
1015 Widget = 0x00000000,
1016 Window = 0x00000001,
1017 Dialog = 0x00000002 | Window,
1018 Sheet = 0x00000004 | Window,
1019 Drawer = 0x00000006 | Window,
1020 Popup = 0x00000008 | Window,
1021 Tool = 0x0000000a | Window,
1022 ToolTip = 0x0000000c | Window,
1023 SplashScreen = 0x0000000e | Window,
1024 Desktop = 0x00000010 | Window,
1025 SubWindow = 0x00000012,
1026 WindowType_Mask = 0x000000ff,
1027 MSWindowsFixedSizeDialogHint = 0x00000100,
1028 MSWindowsOwnDC = 0x00000200,
1029 X11BypassWindowManagerHint = 0x00000400,
1030 FramelessWindowHint = 0x00000800,
1031 WindowTitleHint = 0x00001000,
1032 WindowSystemMenuHint = 0x00002000,
1033 WindowMinimizeButtonHint = 0x00004000,
1034 WindowMaximizeButtonHint = 0x00008000,
1035 WindowMinMaxButtonsHint = WindowMinimizeButtonHint | WindowMaximizeButtonHint,
1036 WindowContextHelpButtonHint = 0x00010000,
1037 WindowShadeButtonHint = 0x00020000,
1038 WindowStaysOnTopHint = 0x00040000,
1039 CustomizeWindowHint = 0x02000000,
1040 WindowStaysOnBottomHint = 0x04000000,
1041 WindowCloseButtonHint = 0x08000000,
1042 MacWindowToolBarButtonHint = 0x10000000,
1043 BypassGraphicsProxyWidget = 0x20000000,
1044 WindowOkButtonHint = 0x00080000,
1045 WindowCancelButtonHint = 0x00100000
1046 };
1047 typedef QFlags<WindowType> WindowFlags;
1048 enum WindowState {
1049 WindowNoState = 0x00000000,
1050 WindowMinimized = 0x00000001,
1051 WindowMaximized = 0x00000002,
1052 WindowFullScreen = 0x00000004,
1053 WindowActive = 0x00000008
1054 };
1055 typedef QFlags<WindowState> WindowStates;
1056 enum WidgetAttribute {
1057 WA_Disabled = 0,
1058 WA_UnderMouse = 1,
1059 WA_MouseTracking = 2,
1060 WA_ContentsPropagated = 3,
1061 WA_OpaquePaintEvent = 4,
1062 WA_NoBackground = WA_OpaquePaintEvent,
1063 WA_StaticContents = 5,
1064 WA_LaidOut = 7,
1065 WA_PaintOnScreen = 8,
1066 WA_NoSystemBackground = 9,
1067 WA_UpdatesDisabled = 10,
1068 WA_Mapped = 11,
1069 WA_MacNoClickThrough = 12,
1070 WA_PaintOutsidePaintEvent = 13,
1071 WA_InputMethodEnabled = 14,
1072 WA_WState_Visible = 15,
1073 WA_WState_Hidden = 16,
1074 WA_ForceDisabled = 32,
1075 WA_KeyCompression = 33,
1076 WA_PendingMoveEvent = 34,
1077 WA_PendingResizeEvent = 35,
1078 WA_SetPalette = 36,
1079 WA_SetFont = 37,
1080 WA_SetCursor = 38,
1081 WA_NoChildEventsFromChildren = 39,
1082 WA_WindowModified = 41,
1083 WA_Resized = 42,
1084 WA_Moved = 43,
1085 WA_PendingUpdate = 44,
1086 WA_InvalidSize = 45,
1087 WA_MacBrushedMetal = 46,
1088 WA_MacMetalStyle = WA_MacBrushedMetal,
1089 WA_CustomWhatsThis = 47,
1090 WA_LayoutOnEntireRect = 48,
1091 WA_OutsideWSRange = 49,
1092 WA_GrabbedShortcut = 50,
1093 WA_TransparentForMouseEvents = 51,
1094 WA_PaintUnclipped = 52,
1095 WA_SetWindowIcon = 53,
1096 WA_NoMouseReplay = 54,
1097 WA_DeleteOnClose = 55,
1098 WA_RightToLeft = 56,
1099 WA_SetLayoutDirection = 57,
1100 WA_NoChildEventsForParent = 58,
1101 WA_ForceUpdatesDisabled = 59,
1102 WA_WState_Created = 60,
1103 WA_WState_CompressKeys = 61,
1104 WA_WState_InPaintEvent = 62,
1105 WA_WState_Reparented = 63,
1106 WA_WState_ConfigPending = 64,
1107 WA_WState_Polished = 66,
1108 WA_WState_DND = 67,
1109 WA_WState_OwnSizePolicy = 68,
1110 WA_WState_ExplicitShowHide = 69,
1111 WA_ShowModal = 70,
1112 WA_MouseNoMask = 71,
1113 WA_GroupLeader = 72,
1114 WA_NoMousePropagation = 73,
1115 WA_Hover = 74,
1116 WA_InputMethodTransparent = 75,
1117 WA_QuitOnClose = 76,
1118 WA_KeyboardFocusChange = 77,
1119 WA_AcceptDrops = 78,
1120 WA_DropSiteRegistered = 79,
1121 WA_ForceAcceptDrops = WA_DropSiteRegistered,
1122 WA_WindowPropagation = 80,
1123 WA_NoX11EventCompression = 81,
1124 WA_TintedBackground = 82,
1125 WA_X11OpenGLOverlay = 83,
1126 WA_AlwaysShowToolTips = 84,
1127 WA_MacOpaqueSizeGrip = 85,
1128 WA_SetStyle = 86,
1129 WA_SetLocale = 87,
1130 WA_MacShowFocusRect = 88,
1131 WA_MacNormalSize = 89,
1132 WA_MacSmallSize = 90,
1133 WA_MacMiniSize = 91,
1134 WA_LayoutUsesWidgetRect = 92,
1135 WA_StyledBackground = 93,
1136 WA_MSWindowsUseDirect3D = 94,
1137 WA_CanHostQMdiSubWindowTitleBar = 95,
1138 WA_MacAlwaysShowToolWindow = 96,
1139 WA_StyleSheet = 97,
1140 WA_ShowWithoutActivating = 98,
1141 WA_X11BypassTransientForHint = 99,
1142 WA_NativeWindow = 100,
1143 WA_DontCreateNativeAncestors = 101,
1144 WA_MacVariableSize = 102,
1145 WA_DontShowOnScreen = 103,
1146 WA_X11NetWmWindowTypeDesktop = 104,
1147 WA_X11NetWmWindowTypeDock = 105,
1148 WA_X11NetWmWindowTypeToolBar = 106,
1149 WA_X11NetWmWindowTypeMenu = 107,
1150 WA_X11NetWmWindowTypeUtility = 108,
1151 WA_X11NetWmWindowTypeSplash = 109,
1152 WA_X11NetWmWindowTypeDialog = 110,
1153 WA_X11NetWmWindowTypeDropDownMenu = 111,
1154 WA_X11NetWmWindowTypePopupMenu = 112,
1155 WA_X11NetWmWindowTypeToolTip = 113,
1156 WA_X11NetWmWindowTypeNotification = 114,
1157 WA_X11NetWmWindowTypeCombo = 115,
1158 WA_X11NetWmWindowTypeDND = 116,
1159 WA_MacFrameworkScaled = 117,
1160 WA_SetWindowModality = 118,
1161 WA_WState_WindowOpacitySet = 119,
1162 WA_TranslucentBackground = 120,
1163 WA_AcceptTouchEvents = 121,
1164 WA_WState_AcceptedTouchBeginEvent = 122,
1165 WA_TouchPadAcceptSingleTouchEvents = 123,
1166 WA_MergeSoftkeys = 124,
1167 WA_MergeSoftkeysRecursively = 125,
1168 WA_AttributeCount
1169 };
1170 enum ApplicationAttribute
1171 {
1172 AA_ImmediateWidgetCreation = 0,
1173 AA_MSWindowsUseDirect3DByDefault = 1,
1174 AA_DontShowIconsInMenus = 2,
1175 AA_NativeWindows = 3,
1176 AA_DontCreateNativeWidgetSiblings = 4,
1177 AA_MacPluginApplication = 5,
1178 AA_DontUseNativeMenuBar = 6,
1179 AA_MacDontSwapCtrlAndMeta = 7,
1180 AA_S60DontConstructApplicationPanes = 8,
1181 AA_AttributeCount
1182 };
1183 enum ImageConversionFlag {
1184 ColorMode_Mask = 0x00000003,
1185 AutoColor = 0x00000000,
1186 ColorOnly = 0x00000003,
1187 MonoOnly = 0x00000002,
1188 AlphaDither_Mask = 0x0000000c,
1189 ThresholdAlphaDither = 0x00000000,
1190 OrderedAlphaDither = 0x00000004,
1191 DiffuseAlphaDither = 0x00000008,
1192 NoAlpha = 0x0000000c,
1193 Dither_Mask = 0x00000030,
1194 DiffuseDither = 0x00000000,
1195 OrderedDither = 0x00000010,
1196 ThresholdDither = 0x00000020,
1197 DitherMode_Mask = 0x000000c0,
1198 AutoDither = 0x00000000,
1199 PreferDither = 0x00000040,
1200 AvoidDither = 0x00000080,
1201 NoOpaqueDetection = 0x00000100
1202 };
1203 typedef QFlags<ImageConversionFlag> ImageConversionFlags;
1204 enum BGMode {
1205 TransparentMode,
1206 OpaqueMode
1207 };
1208 enum Key {
1209 Key_Escape = 0x01000000,
1210 Key_Tab = 0x01000001,
1211 Key_Backtab = 0x01000002,
1212 Key_Backspace = 0x01000003,
1213 Key_Return = 0x01000004,
1214 Key_Enter = 0x01000005,
1215 Key_Insert = 0x01000006,
1216 Key_Delete = 0x01000007,
1217 Key_Pause = 0x01000008,
1218 Key_Print = 0x01000009,
1219 Key_SysReq = 0x0100000a,
1220 Key_Clear = 0x0100000b,
1221 Key_Home = 0x01000010,
1222 Key_End = 0x01000011,
1223 Key_Left = 0x01000012,
1224 Key_Up = 0x01000013,
1225 Key_Right = 0x01000014,
1226 Key_Down = 0x01000015,
1227 Key_PageUp = 0x01000016,
1228 Key_PageDown = 0x01000017,
1229 Key_Shift = 0x01000020,
1230 Key_Control = 0x01000021,
1231 Key_Meta = 0x01000022,
1232 Key_Alt = 0x01000023,
1233 Key_CapsLock = 0x01000024,
1234 Key_NumLock = 0x01000025,
1235 Key_ScrollLock = 0x01000026,
1236 Key_F1 = 0x01000030,
1237 Key_F2 = 0x01000031,
1238 Key_F3 = 0x01000032,
1239 Key_F4 = 0x01000033,
1240 Key_F5 = 0x01000034,
1241 Key_F6 = 0x01000035,
1242 Key_F7 = 0x01000036,
1243 Key_F8 = 0x01000037,
1244 Key_F9 = 0x01000038,
1245 Key_F10 = 0x01000039,
1246 Key_F11 = 0x0100003a,
1247 Key_F12 = 0x0100003b,
1248 Key_F13 = 0x0100003c,
1249 Key_F14 = 0x0100003d,
1250 Key_F15 = 0x0100003e,
1251 Key_F16 = 0x0100003f,
1252 Key_F17 = 0x01000040,
1253 Key_F18 = 0x01000041,
1254 Key_F19 = 0x01000042,
1255 Key_F20 = 0x01000043,
1256 Key_F21 = 0x01000044,
1257 Key_F22 = 0x01000045,
1258 Key_F23 = 0x01000046,
1259 Key_F24 = 0x01000047,
1260 Key_F25 = 0x01000048,
1261 Key_F26 = 0x01000049,
1262 Key_F27 = 0x0100004a,
1263 Key_F28 = 0x0100004b,
1264 Key_F29 = 0x0100004c,
1265 Key_F30 = 0x0100004d,
1266 Key_F31 = 0x0100004e,
1267 Key_F32 = 0x0100004f,
1268 Key_F33 = 0x01000050,
1269 Key_F34 = 0x01000051,
1270 Key_F35 = 0x01000052,
1271 Key_Super_L = 0x01000053,
1272 Key_Super_R = 0x01000054,
1273 Key_Menu = 0x01000055,
1274 Key_Hyper_L = 0x01000056,
1275 Key_Hyper_R = 0x01000057,
1276 Key_Help = 0x01000058,
1277 Key_Direction_L = 0x01000059,
1278 Key_Direction_R = 0x01000060,
1279 Key_Space = 0x20,
1280 Key_Any = Key_Space,
1281 Key_Exclam = 0x21,
1282 Key_QuoteDbl = 0x22,
1283 Key_NumberSign = 0x23,
1284 Key_Dollar = 0x24,
1285 Key_Percent = 0x25,
1286 Key_Ampersand = 0x26,
1287 Key_Apostrophe = 0x27,
1288 Key_ParenLeft = 0x28,
1289 Key_ParenRight = 0x29,
1290 Key_Asterisk = 0x2a,
1291 Key_Plus = 0x2b,
1292 Key_Comma = 0x2c,
1293 Key_Minus = 0x2d,
1294 Key_Period = 0x2e,
1295 Key_Slash = 0x2f,
1296 Key_0 = 0x30,
1297 Key_1 = 0x31,
1298 Key_2 = 0x32,
1299 Key_3 = 0x33,
1300 Key_4 = 0x34,
1301 Key_5 = 0x35,
1302 Key_6 = 0x36,
1303 Key_7 = 0x37,
1304 Key_8 = 0x38,
1305 Key_9 = 0x39,
1306 Key_Colon = 0x3a,
1307 Key_Semicolon = 0x3b,
1308 Key_Less = 0x3c,
1309 Key_Equal = 0x3d,
1310 Key_Greater = 0x3e,
1311 Key_Question = 0x3f,
1312 Key_At = 0x40,
1313 Key_A = 0x41,
1314 Key_B = 0x42,
1315 Key_C = 0x43,
1316 Key_D = 0x44,
1317 Key_E = 0x45,
1318 Key_F = 0x46,
1319 Key_G = 0x47,
1320 Key_H = 0x48,
1321 Key_I = 0x49,
1322 Key_J = 0x4a,
1323 Key_K = 0x4b,
1324 Key_L = 0x4c,
1325 Key_M = 0x4d,
1326 Key_N = 0x4e,
1327 Key_O = 0x4f,
1328 Key_P = 0x50,
1329 Key_Q = 0x51,
1330 Key_R = 0x52,
1331 Key_S = 0x53,
1332 Key_T = 0x54,
1333 Key_U = 0x55,
1334 Key_V = 0x56,
1335 Key_W = 0x57,
1336 Key_X = 0x58,
1337 Key_Y = 0x59,
1338 Key_Z = 0x5a,
1339 Key_BracketLeft = 0x5b,
1340 Key_Backslash = 0x5c,
1341 Key_BracketRight = 0x5d,
1342 Key_AsciiCircum = 0x5e,
1343 Key_Underscore = 0x5f,
1344 Key_QuoteLeft = 0x60,
1345 Key_BraceLeft = 0x7b,
1346 Key_Bar = 0x7c,
1347 Key_BraceRight = 0x7d,
1348 Key_AsciiTilde = 0x7e,
1349 Key_nobreakspace = 0x0a0,
1350 Key_exclamdown = 0x0a1,
1351 Key_cent = 0x0a2,
1352 Key_sterling = 0x0a3,
1353 Key_currency = 0x0a4,
1354 Key_yen = 0x0a5,
1355 Key_brokenbar = 0x0a6,
1356 Key_section = 0x0a7,
1357 Key_diaeresis = 0x0a8,
1358 Key_copyright = 0x0a9,
1359 Key_ordfeminine = 0x0aa,
1360 Key_guillemotleft = 0x0ab,
1361 Key_notsign = 0x0ac,
1362 Key_hyphen = 0x0ad,
1363 Key_registered = 0x0ae,
1364 Key_macron = 0x0af,
1365 Key_degree = 0x0b0,
1366 Key_plusminus = 0x0b1,
1367 Key_twosuperior = 0x0b2,
1368 Key_threesuperior = 0x0b3,
1369 Key_acute = 0x0b4,
1370 Key_mu = 0x0b5,
1371 Key_paragraph = 0x0b6,
1372 Key_periodcentered = 0x0b7,
1373 Key_cedilla = 0x0b8,
1374 Key_onesuperior = 0x0b9,
1375 Key_masculine = 0x0ba,
1376 Key_guillemotright = 0x0bb,
1377 Key_onequarter = 0x0bc,
1378 Key_onehalf = 0x0bd,
1379 Key_threequarters = 0x0be,
1380 Key_questiondown = 0x0bf,
1381 Key_Agrave = 0x0c0,
1382 Key_Aacute = 0x0c1,
1383 Key_Acircumflex = 0x0c2,
1384 Key_Atilde = 0x0c3,
1385 Key_Adiaeresis = 0x0c4,
1386 Key_Aring = 0x0c5,
1387 Key_AE = 0x0c6,
1388 Key_Ccedilla = 0x0c7,
1389 Key_Egrave = 0x0c8,
1390 Key_Eacute = 0x0c9,
1391 Key_Ecircumflex = 0x0ca,
1392 Key_Ediaeresis = 0x0cb,
1393 Key_Igrave = 0x0cc,
1394 Key_Iacute = 0x0cd,
1395 Key_Icircumflex = 0x0ce,
1396 Key_Idiaeresis = 0x0cf,
1397 Key_ETH = 0x0d0,
1398 Key_Ntilde = 0x0d1,
1399 Key_Ograve = 0x0d2,
1400 Key_Oacute = 0x0d3,
1401 Key_Ocircumflex = 0x0d4,
1402 Key_Otilde = 0x0d5,
1403 Key_Odiaeresis = 0x0d6,
1404 Key_multiply = 0x0d7,
1405 Key_Ooblique = 0x0d8,
1406 Key_Ugrave = 0x0d9,
1407 Key_Uacute = 0x0da,
1408 Key_Ucircumflex = 0x0db,
1409 Key_Udiaeresis = 0x0dc,
1410 Key_Yacute = 0x0dd,
1411 Key_THORN = 0x0de,
1412 Key_ssharp = 0x0df,
1413 Key_division = 0x0f7,
1414 Key_ydiaeresis = 0x0ff,
1415 Key_AltGr = 0x01001103,
1416 Key_Multi_key = 0x01001120,
1417 Key_Codeinput = 0x01001137,
1418 Key_SingleCandidate = 0x0100113c,
1419 Key_MultipleCandidate = 0x0100113d,
1420 Key_PreviousCandidate = 0x0100113e,
1421 Key_Mode_switch = 0x0100117e,
1422 Key_Kanji = 0x01001121,
1423 Key_Muhenkan = 0x01001122,
1424 Key_Henkan = 0x01001123,
1425 Key_Romaji = 0x01001124,
1426 Key_Hiragana = 0x01001125,
1427 Key_Katakana = 0x01001126,
1428 Key_Hiragana_Katakana = 0x01001127,
1429 Key_Zenkaku = 0x01001128,
1430 Key_Hankaku = 0x01001129,
1431 Key_Zenkaku_Hankaku = 0x0100112a,
1432 Key_Touroku = 0x0100112b,
1433 Key_Massyo = 0x0100112c,
1434 Key_Kana_Lock = 0x0100112d,
1435 Key_Kana_Shift = 0x0100112e,
1436 Key_Eisu_Shift = 0x0100112f,
1437 Key_Eisu_toggle = 0x01001130,
1438 Key_Hangul = 0x01001131,
1439 Key_Hangul_Start = 0x01001132,
1440 Key_Hangul_End = 0x01001133,
1441 Key_Hangul_Hanja = 0x01001134,
1442 Key_Hangul_Jamo = 0x01001135,
1443 Key_Hangul_Romaja = 0x01001136,
1444 Key_Hangul_Jeonja = 0x01001138,
1445 Key_Hangul_Banja = 0x01001139,
1446 Key_Hangul_PreHanja = 0x0100113a,
1447 Key_Hangul_PostHanja = 0x0100113b,
1448 Key_Hangul_Special = 0x0100113f,
1449 Key_Dead_Grave = 0x01001250,
1450 Key_Dead_Acute = 0x01001251,
1451 Key_Dead_Circumflex = 0x01001252,
1452 Key_Dead_Tilde = 0x01001253,
1453 Key_Dead_Macron = 0x01001254,
1454 Key_Dead_Breve = 0x01001255,
1455 Key_Dead_Abovedot = 0x01001256,
1456 Key_Dead_Diaeresis = 0x01001257,
1457 Key_Dead_Abovering = 0x01001258,
1458 Key_Dead_Doubleacute = 0x01001259,
1459 Key_Dead_Caron = 0x0100125a,
1460 Key_Dead_Cedilla = 0x0100125b,
1461 Key_Dead_Ogonek = 0x0100125c,
1462 Key_Dead_Iota = 0x0100125d,
1463 Key_Dead_Voiced_Sound = 0x0100125e,
1464 Key_Dead_Semivoiced_Sound = 0x0100125f,
1465 Key_Dead_Belowdot = 0x01001260,
1466 Key_Dead_Hook = 0x01001261,
1467 Key_Dead_Horn = 0x01001262,
1468 Key_Back = 0x01000061,
1469 Key_Forward = 0x01000062,
1470 Key_Stop = 0x01000063,
1471 Key_Refresh = 0x01000064,
1472 Key_VolumeDown = 0x01000070,
1473 Key_VolumeMute = 0x01000071,
1474 Key_VolumeUp = 0x01000072,
1475 Key_BassBoost = 0x01000073,
1476 Key_BassUp = 0x01000074,
1477 Key_BassDown = 0x01000075,
1478 Key_TrebleUp = 0x01000076,
1479 Key_TrebleDown = 0x01000077,
1480 Key_MediaPlay = 0x01000080,
1481 Key_MediaStop = 0x01000081,
1482 Key_MediaPrevious = 0x01000082,
1483 Key_MediaNext = 0x01000083,
1484 Key_MediaRecord = 0x01000084,
1485 Key_HomePage = 0x01000090,
1486 Key_Favorites = 0x01000091,
1487 Key_Search = 0x01000092,
1488 Key_Standby = 0x01000093,
1489 Key_OpenUrl = 0x01000094,
1490 Key_LaunchMail = 0x010000a0,
1491 Key_LaunchMedia = 0x010000a1,
1492 Key_Launch0 = 0x010000a2,
1493 Key_Launch1 = 0x010000a3,
1494 Key_Launch2 = 0x010000a4,
1495 Key_Launch3 = 0x010000a5,
1496 Key_Launch4 = 0x010000a6,
1497 Key_Launch5 = 0x010000a7,
1498 Key_Launch6 = 0x010000a8,
1499 Key_Launch7 = 0x010000a9,
1500 Key_Launch8 = 0x010000aa,
1501 Key_Launch9 = 0x010000ab,
1502 Key_LaunchA = 0x010000ac,
1503 Key_LaunchB = 0x010000ad,
1504 Key_LaunchC = 0x010000ae,
1505 Key_LaunchD = 0x010000af,
1506 Key_LaunchE = 0x010000b0,
1507 Key_LaunchF = 0x010000b1,
1508 Key_MonBrightnessUp = 0x010000b2,
1509 Key_MonBrightnessDown = 0x010000b3,
1510 Key_KeyboardLightOnOff = 0x010000b4,
1511 Key_KeyboardBrightnessUp = 0x010000b5,
1512 Key_KeyboardBrightnessDown = 0x010000b6,
1513 Key_PowerOff = 0x010000b7,
1514 Key_WakeUp = 0x010000b8,
1515 Key_Eject = 0x010000b9,
1516 Key_ScreenSaver = 0x010000ba,
1517 Key_WWW = 0x010000bb,
1518 Key_Memo = 0x010000bc,
1519 Key_LightBulb = 0x010000bd,
1520 Key_Shop = 0x010000be,
1521 Key_History = 0x010000bf,
1522 Key_AddFavorite = 0x010000c0,
1523 Key_HotLinks = 0x010000c1,
1524 Key_BrightnessAdjust = 0x010000c2,
1525 Key_Finance = 0x010000c3,
1526 Key_Community = 0x010000c4,
1527 Key_AudioRewind = 0x010000c5,
1528 Key_BackForward = 0x010000c6,
1529 Key_ApplicationLeft = 0x010000c7,
1530 Key_ApplicationRight = 0x010000c8,
1531 Key_Book = 0x010000c9,
1532 Key_CD = 0x010000ca,
1533 Key_Calculator = 0x010000cb,
1534 Key_ToDoList = 0x010000cc,
1535 Key_ClearGrab = 0x010000cd,
1536 Key_Close = 0x010000ce,
1537 Key_Copy = 0x010000cf,
1538 Key_Cut = 0x010000d0,
1539 Key_Display = 0x010000d1,
1540 Key_DOS = 0x010000d2,
1541 Key_Documents = 0x010000d3,
1542 Key_Excel = 0x010000d4,
1543 Key_Explorer = 0x010000d5,
1544 Key_Game = 0x010000d6,
1545 Key_Go = 0x010000d7,
1546 Key_iTouch = 0x010000d8,
1547 Key_LogOff = 0x010000d9,
1548 Key_Market = 0x010000da,
1549 Key_Meeting = 0x010000db,
1550 Key_MenuKB = 0x010000dc,
1551 Key_MenuPB = 0x010000dd,
1552 Key_MySites = 0x010000de,
1553 Key_News = 0x010000df,
1554 Key_OfficeHome = 0x010000e0,
1555 Key_Option = 0x010000e1,
1556 Key_Paste = 0x010000e2,
1557 Key_Phone = 0x010000e3,
1558 Key_Calendar = 0x010000e4,
1559 Key_Reply = 0x010000e5,
1560 Key_Reload = 0x010000e6,
1561 Key_RotateWindows = 0x010000e7,
1562 Key_RotationPB = 0x010000e8,
1563 Key_RotationKB = 0x010000e9,
1564 Key_Save = 0x010000ea,
1565 Key_Send = 0x010000eb,
1566 Key_Spell = 0x010000ec,
1567 Key_SplitScreen = 0x010000ed,
1568 Key_Support = 0x010000ee,
1569 Key_TaskPane = 0x010000ef,
1570 Key_Terminal = 0x010000f0,
1571 Key_Tools = 0x010000f1,
1572 Key_Travel = 0x010000f2,
1573 Key_Video = 0x010000f3,
1574 Key_Word = 0x010000f4,
1575 Key_Xfer = 0x010000f5,
1576 Key_ZoomIn = 0x010000f6,
1577 Key_ZoomOut = 0x010000f7,
1578 Key_Away = 0x010000f8,
1579 Key_Messenger = 0x010000f9,
1580 Key_WebCam = 0x010000fa,
1581 Key_MailForward = 0x010000fb,
1582 Key_Pictures = 0x010000fc,
1583 Key_Music = 0x010000fd,
1584 Key_Battery = 0x010000fe,
1585 Key_Bluetooth = 0x010000ff,
1586 Key_WLAN = 0x01000100,
1587 Key_UWB = 0x01000101,
1588 Key_AudioForward = 0x01000102,
1589 Key_AudioRepeat = 0x01000103,
1590 Key_AudioRandomPlay = 0x01000104,
1591 Key_Subtitle = 0x01000105,
1592 Key_AudioCycleTrack = 0x01000106,
1593 Key_Time = 0x01000107,
1594 Key_Hibernate = 0x01000108,
1595 Key_View = 0x01000109,
1596 Key_TopMenu = 0x0100010a,
1597 Key_PowerDown = 0x0100010b,
1598 Key_Suspend = 0x0100010c,
1599 Key_ContrastAdjust = 0x0100010d,
1600 Key_MediaLast = 0x0100ffff,
1601 Key_Select = 0x01010000,
1602 Key_Yes = 0x01010001,
1603 Key_No = 0x01010002,
1604 Key_Cancel = 0x01020001,
1605 Key_Printer = 0x01020002,
1606 Key_Execute = 0x01020003,
1607 Key_Sleep = 0x01020004,
1608 Key_Play = 0x01020005,
1609 Key_Zoom = 0x01020006,
1610 Key_Context1 = 0x01100000,
1611 Key_Context2 = 0x01100001,
1612 Key_Context3 = 0x01100002,
1613 Key_Context4 = 0x01100003,
1614 Key_Call = 0x01100004,
1615 Key_Hangup = 0x01100005,
1616 Key_Flip = 0x01100006,
1617 Key_unknown = 0x01ffffff
1618 };
1619 enum ArrowType {
1620 NoArrow,
1621 UpArrow,
1622 DownArrow,
1623 LeftArrow,
1624 RightArrow
1625 };
1626 enum PenStyle {
1627 NoPen,
1628 SolidLine,
1629 DashLine,
1630 DotLine,
1631 DashDotLine,
1632 DashDotDotLine,
1633 CustomDashLine
1634 , MPenStyle = 0x0f
1635 };
1636 enum PenCapStyle {
1637 FlatCap = 0x00,
1638 SquareCap = 0x10,
1639 RoundCap = 0x20,
1640 MPenCapStyle = 0x30
1641 };
1642 enum PenJoinStyle {
1643 MiterJoin = 0x00,
1644 BevelJoin = 0x40,
1645 RoundJoin = 0x80,
1646 SvgMiterJoin = 0x100,
1647 MPenJoinStyle = 0x1c0
1648 };
1649 enum BrushStyle {
1650 NoBrush,
1651 SolidPattern,
1652 Dense1Pattern,
1653 Dense2Pattern,
1654 Dense3Pattern,
1655 Dense4Pattern,
1656 Dense5Pattern,
1657 Dense6Pattern,
1658 Dense7Pattern,
1659 HorPattern,
1660 VerPattern,
1661 CrossPattern,
1662 BDiagPattern,
1663 FDiagPattern,
1664 DiagCrossPattern,
1665 LinearGradientPattern,
1666 RadialGradientPattern,
1667 ConicalGradientPattern,
1668 TexturePattern = 24
1669 };
1670 enum SizeMode {
1671 AbsoluteSize,
1672 RelativeSize
1673 };
1674 enum UIEffect {
1675 UI_General,
1676 UI_AnimateMenu,
1677 UI_FadeMenu,
1678 UI_AnimateCombo,
1679 UI_AnimateTooltip,
1680 UI_FadeTooltip,
1681 UI_AnimateToolBox
1682 };
1683 enum CursorShape {
1684 ArrowCursor,
1685 UpArrowCursor,
1686 CrossCursor,
1687 WaitCursor,
1688 IBeamCursor,
1689 SizeVerCursor,
1690 SizeHorCursor,
1691 SizeBDiagCursor,
1692 SizeFDiagCursor,
1693 SizeAllCursor,
1694 BlankCursor,
1695 SplitVCursor,
1696 SplitHCursor,
1697 PointingHandCursor,
1698 ForbiddenCursor,
1699 WhatsThisCursor,
1700 BusyCursor,
1701 OpenHandCursor,
1702 ClosedHandCursor,
1703 LastCursor = ClosedHandCursor,
1704 BitmapCursor = 24,
1705 CustomCursor = 25
1706 };
1707 enum TextFormat {
1708 PlainText,
1709 RichText,
1710 AutoText,
1711 LogText
1712 };
1713 enum AspectRatioMode {
1714 IgnoreAspectRatio,
1715 KeepAspectRatio,
1716 KeepAspectRatioByExpanding
1717 };
1718 enum AnchorAttribute {
1719 AnchorName,
1720 AnchorHref
1721 };
1722 enum DockWidgetArea {
1723 LeftDockWidgetArea = 0x1,
1724 RightDockWidgetArea = 0x2,
1725 TopDockWidgetArea = 0x4,
1726 BottomDockWidgetArea = 0x8,
1727 DockWidgetArea_Mask = 0xf,
1728 AllDockWidgetAreas = DockWidgetArea_Mask,
1729 NoDockWidgetArea = 0
1730 };
1731 enum DockWidgetAreaSizes {
1732 NDockWidgetAreas = 4
1733 };
1734 typedef QFlags<DockWidgetArea> DockWidgetAreas;
1735 enum ToolBarArea {
1736 LeftToolBarArea = 0x1,
1737 RightToolBarArea = 0x2,
1738 TopToolBarArea = 0x4,
1739 BottomToolBarArea = 0x8,
1740 ToolBarArea_Mask = 0xf,
1741 AllToolBarAreas = ToolBarArea_Mask,
1742 NoToolBarArea = 0
1743 };
1744 enum ToolBarAreaSizes {
1745 NToolBarAreas = 4
1746 };
1747 typedef QFlags<ToolBarArea> ToolBarAreas;
1748 enum DateFormat {
1749 TextDate,
1750 ISODate,
1751 SystemLocaleDate,
1752 LocalDate = SystemLocaleDate,
1753 LocaleDate,
1754 SystemLocaleShortDate,
1755 SystemLocaleLongDate,
1756 DefaultLocaleShortDate,
1757 DefaultLocaleLongDate
1758 };
1759 enum TimeSpec {
1760 LocalTime,
1761 UTC,
1762 OffsetFromUTC
1763 };
1764 enum DayOfWeek {
1765 Monday = 1,
1766 Tuesday = 2,
1767 Wednesday = 3,
1768 Thursday = 4,
1769 Friday = 5,
1770 Saturday = 6,
1771 Sunday = 7
1772 };
1773 enum ScrollBarPolicy {
1774 ScrollBarAsNeeded,
1775 ScrollBarAlwaysOff,
1776 ScrollBarAlwaysOn
1777 };
1778 enum CaseSensitivity {
1779 CaseInsensitive,
1780 CaseSensitive
1781 };
1782 enum Corner {
1783 TopLeftCorner = 0x00000,
1784 TopRightCorner = 0x00001,
1785 BottomLeftCorner = 0x00002,
1786 BottomRightCorner = 0x00003
1787 };
1788 enum ConnectionType {
1789 AutoConnection,
1790 DirectConnection,
1791 QueuedConnection,
1792 AutoCompatConnection,
1793 BlockingQueuedConnection,
1794 UniqueConnection = 0x80
1795 };
1796 enum ShortcutContext {
1797 WidgetShortcut,
1798 WindowShortcut,
1799 ApplicationShortcut,
1800 WidgetWithChildrenShortcut
1801 };
1802 enum FillRule {
1803 OddEvenFill,
1804 WindingFill
1805 };
1806 enum MaskMode {
1807 MaskInColor,
1808 MaskOutColor
1809 };
1810 enum ClipOperation {
1811 NoClip,
1812 ReplaceClip,
1813 IntersectClip,
1814 UniteClip
1815 };
1816 enum ItemSelectionMode {
1817 ContainsItemShape = 0x0,
1818 IntersectsItemShape = 0x1,
1819 ContainsItemBoundingRect = 0x2,
1820 IntersectsItemBoundingRect = 0x3
1821 };
1822 enum TransformationMode {
1823 FastTransformation,
1824 SmoothTransformation
1825 };
1826 enum Axis {
1827 XAxis,
1828 YAxis,
1829 ZAxis
1830 };
1831 enum FocusReason {
1832 MouseFocusReason,
1833 TabFocusReason,
1834 BacktabFocusReason,
1835 ActiveWindowFocusReason,
1836 PopupFocusReason,
1837 ShortcutFocusReason,
1838 MenuBarFocusReason,
1839 OtherFocusReason,
1840 NoFocusReason
1841 };
1842 enum ContextMenuPolicy {
1843 NoContextMenu,
1844 DefaultContextMenu,
1845 ActionsContextMenu,
1846 CustomContextMenu,
1847 PreventContextMenu
1848 };
1849 enum InputMethodQuery {
1850 ImMicroFocus,
1851 ImFont,
1852 ImCursorPosition,
1853 ImSurroundingText,
1854 ImCurrentSelection,
1855 ImMaximumTextLength,
1856 ImAnchorPosition
1857 };
1858 enum InputMethodHint {
1859 ImhNone = 0x0,
1860 ImhHiddenText = 0x1,
1861 ImhNoAutoUppercase = 0x2,
1862 ImhPreferNumbers = 0x4,
1863 ImhPreferUppercase = 0x8,
1864 ImhPreferLowercase = 0x10,
1865 ImhNoPredictiveText = 0x20,
1866 ImhDigitsOnly = 0x10000,
1867 ImhFormattedNumbersOnly = 0x20000,
1868 ImhUppercaseOnly = 0x40000,
1869 ImhLowercaseOnly = 0x80000,
1870 ImhDialableCharactersOnly = 0x100000,
1871 ImhEmailCharactersOnly = 0x200000,
1872 ImhUrlCharactersOnly = 0x400000,
1873 ImhExclusiveInputMask = 0xffff0000
1874 };
1875 typedef QFlags<InputMethodHint> InputMethodHints;
1876 enum ToolButtonStyle {
1877 ToolButtonIconOnly,
1878 ToolButtonTextOnly,
1879 ToolButtonTextBesideIcon,
1880 ToolButtonTextUnderIcon,
1881 ToolButtonFollowStyle
1882 };
1883 enum LayoutDirection {
1884 LeftToRight,
1885 RightToLeft
1886 };
1887 enum AnchorPoint {
1888 AnchorLeft = 0,
1889 AnchorHorizontalCenter,
1890 AnchorRight,
1891 AnchorTop,
1892 AnchorVerticalCenter,
1893 AnchorBottom
1894 };
1895 enum DropAction {
1896 CopyAction = 0x1,
1897 MoveAction = 0x2,
1898 LinkAction = 0x4,
1899 ActionMask = 0xff,
1900 TargetMoveAction = 0x8002,
1901 IgnoreAction = 0x0
1902 };
1903 typedef QFlags<DropAction> DropActions;
1904 enum CheckState {
1905 Unchecked,
1906 PartiallyChecked,
1907 Checked
1908 };
1909 enum ItemDataRole {
1910 DisplayRole = 0,
1911 DecorationRole = 1,
1912 EditRole = 2,
1913 ToolTipRole = 3,
1914 StatusTipRole = 4,
1915 WhatsThisRole = 5,
1916 FontRole = 6,
1917 TextAlignmentRole = 7,
1918 BackgroundColorRole = 8,
1919 BackgroundRole = 8,
1920 TextColorRole = 9,
1921 ForegroundRole = 9,
1922 CheckStateRole = 10,
1923 AccessibleTextRole = 11,
1924 AccessibleDescriptionRole = 12,
1925 SizeHintRole = 13,
1926 DisplayPropertyRole = 27,
1927 DecorationPropertyRole = 28,
1928 ToolTipPropertyRole = 29,
1929 StatusTipPropertyRole = 30,
1930 WhatsThisPropertyRole = 31,
1931 UserRole = 32
1932 };
1933 enum ItemFlag {
1934 NoItemFlags = 0,
1935 ItemIsSelectable = 1,
1936 ItemIsEditable = 2,
1937 ItemIsDragEnabled = 4,
1938 ItemIsDropEnabled = 8,
1939 ItemIsUserCheckable = 16,
1940 ItemIsEnabled = 32,
1941 ItemIsTristate = 64
1942 };
1943 typedef QFlags<ItemFlag> ItemFlags;
1944 enum MatchFlag {
1945 MatchExactly = 0,
1946 MatchContains = 1,
1947 MatchStartsWith = 2,
1948 MatchEndsWith = 3,
1949 MatchRegExp = 4,
1950 MatchWildcard = 5,
1951 MatchFixedString = 8,
1952 MatchCaseSensitive = 16,
1953 MatchWrap = 32,
1954 MatchRecursive = 64
1955 };
1956 typedef QFlags<MatchFlag> MatchFlags;
1957 typedef unsigned long HANDLE;
1958 typedef WindowFlags WFlags;
1959 enum WindowModality {
1960 NonModal,
1961 WindowModal,
1962 ApplicationModal
1963 };
1964 enum TextInteractionFlag {
1965 NoTextInteraction = 0,
1966 TextSelectableByMouse = 1,
1967 TextSelectableByKeyboard = 2,
1968 LinksAccessibleByMouse = 4,
1969 LinksAccessibleByKeyboard = 8,
1970 TextEditable = 16,
1971 TextEditorInteraction = TextSelectableByMouse | TextSelectableByKeyboard | TextEditable,
1972 TextBrowserInteraction = TextSelectableByMouse | LinksAccessibleByMouse | LinksAccessibleByKeyboard
1973 };
1974 typedef QFlags<TextInteractionFlag> TextInteractionFlags;
1975 enum EventPriority {
1976 HighEventPriority = 1,
1977 NormalEventPriority = 0,
1978 LowEventPriority = -1
1979 };
1980 enum SizeHint {
1981 MinimumSize,
1982 PreferredSize,
1983 MaximumSize,
1984 MinimumDescent,
1985 NSizeHints
1986 };
1987 enum WindowFrameSection {
1988 NoSection,
1989 LeftSection,
1990 TopLeftSection,
1991 TopSection,
1992 TopRightSection,
1993 RightSection,
1994 BottomRightSection,
1995 BottomSection,
1996 BottomLeftSection,
1997 TitleBarArea
1998 };
1999 enum Initialization {
2000 Uninitialized
2001 };
2002 enum CoordinateSystem {
2003 DeviceCoordinates,
2004 LogicalCoordinates
2005 };
2006 enum TouchPointState {
2007 TouchPointPressed = 0x01,
2008 TouchPointMoved = 0x02,
2009 TouchPointStationary = 0x04,
2010 TouchPointReleased = 0x08,
2011 TouchPointStateMask = 0x0f,
2012 TouchPointPrimary = 0x10
2013 };
2014 typedef QFlags<TouchPointState> TouchPointStates;
2015 enum GestureState
2016 {
2017 NoGesture,
2018 GestureStarted = 1,
2019 GestureUpdated = 2,
2020 GestureFinished = 3,
2021 GestureCanceled = 4
2022 };
2023 enum GestureType
2024 {
2025 TapGesture = 1,
2026 TapAndHoldGesture = 2,
2027 PanGesture = 3,
2028 PinchGesture = 4,
2029 SwipeGesture = 5,
2030 CustomGesture = 0x0100,
2031 LastGestureType = ~0u
2032 };
2033 enum GestureFlag
2034 {
2035 DontStartGestureOnChildren = 0x01,
2036 ReceivePartialGestures = 0x02
2037 };
2038 typedef QFlags<GestureFlag> GestureFlags;
2039 enum NavigationMode
2040 {
2041 NavigationModeNone,
2042 NavigationModeKeypadTabOrder,
2043 NavigationModeKeypadDirectional,
2044 NavigationModeCursorAuto,
2045 NavigationModeCursorForceVisible
2046 };
2047 }
2048 inline QFlags<Qt::MouseButtons::enum_type> operator|(Qt::MouseButtons::enum_type f1, Qt::MouseButtons::enum_type f2) { return QFlags<Qt::MouseButtons::enum_type>(f1) | f2; } inline QFlags<Qt::MouseButtons::enum_type> operator|(Qt::MouseButtons::enum_type f1, QFlags<Qt::MouseButtons::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::MouseButtons::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2049 inline QFlags<Qt::Orientations::enum_type> operator|(Qt::Orientations::enum_type f1, Qt::Orientations::enum_type f2) { return QFlags<Qt::Orientations::enum_type>(f1) | f2; } inline QFlags<Qt::Orientations::enum_type> operator|(Qt::Orientations::enum_type f1, QFlags<Qt::Orientations::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::Orientations::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2050 inline QFlags<Qt::KeyboardModifiers::enum_type> operator|(Qt::KeyboardModifiers::enum_type f1, Qt::KeyboardModifiers::enum_type f2) { return QFlags<Qt::KeyboardModifiers::enum_type>(f1) | f2; } inline QFlags<Qt::KeyboardModifiers::enum_type> operator|(Qt::KeyboardModifiers::enum_type f1, QFlags<Qt::KeyboardModifiers::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::KeyboardModifiers::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2051 inline QFlags<Qt::WindowFlags::enum_type> operator|(Qt::WindowFlags::enum_type f1, Qt::WindowFlags::enum_type f2) { return QFlags<Qt::WindowFlags::enum_type>(f1) | f2; } inline QFlags<Qt::WindowFlags::enum_type> operator|(Qt::WindowFlags::enum_type f1, QFlags<Qt::WindowFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::WindowFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2052 inline QFlags<Qt::Alignment::enum_type> operator|(Qt::Alignment::enum_type f1, Qt::Alignment::enum_type f2) { return QFlags<Qt::Alignment::enum_type>(f1) | f2; } inline QFlags<Qt::Alignment::enum_type> operator|(Qt::Alignment::enum_type f1, QFlags<Qt::Alignment::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::Alignment::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2053 inline QFlags<Qt::ImageConversionFlags::enum_type> operator|(Qt::ImageConversionFlags::enum_type f1, Qt::ImageConversionFlags::enum_type f2) { return QFlags<Qt::ImageConversionFlags::enum_type>(f1) | f2; } inline QFlags<Qt::ImageConversionFlags::enum_type> operator|(Qt::ImageConversionFlags::enum_type f1, QFlags<Qt::ImageConversionFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::ImageConversionFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2054 inline QFlags<Qt::DockWidgetAreas::enum_type> operator|(Qt::DockWidgetAreas::enum_type f1, Qt::DockWidgetAreas::enum_type f2) { return QFlags<Qt::DockWidgetAreas::enum_type>(f1) | f2; } inline QFlags<Qt::DockWidgetAreas::enum_type> operator|(Qt::DockWidgetAreas::enum_type f1, QFlags<Qt::DockWidgetAreas::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::DockWidgetAreas::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2055 inline QFlags<Qt::ToolBarAreas::enum_type> operator|(Qt::ToolBarAreas::enum_type f1, Qt::ToolBarAreas::enum_type f2) { return QFlags<Qt::ToolBarAreas::enum_type>(f1) | f2; } inline QFlags<Qt::ToolBarAreas::enum_type> operator|(Qt::ToolBarAreas::enum_type f1, QFlags<Qt::ToolBarAreas::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::ToolBarAreas::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2056 inline QFlags<Qt::WindowStates::enum_type> operator|(Qt::WindowStates::enum_type f1, Qt::WindowStates::enum_type f2) { return QFlags<Qt::WindowStates::enum_type>(f1) | f2; } inline QFlags<Qt::WindowStates::enum_type> operator|(Qt::WindowStates::enum_type f1, QFlags<Qt::WindowStates::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::WindowStates::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2057 inline QFlags<Qt::DropActions::enum_type> operator|(Qt::DropActions::enum_type f1, Qt::DropActions::enum_type f2) { return QFlags<Qt::DropActions::enum_type>(f1) | f2; } inline QFlags<Qt::DropActions::enum_type> operator|(Qt::DropActions::enum_type f1, QFlags<Qt::DropActions::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::DropActions::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2058 inline QFlags<Qt::ItemFlags::enum_type> operator|(Qt::ItemFlags::enum_type f1, Qt::ItemFlags::enum_type f2) { return QFlags<Qt::ItemFlags::enum_type>(f1) | f2; } inline QFlags<Qt::ItemFlags::enum_type> operator|(Qt::ItemFlags::enum_type f1, QFlags<Qt::ItemFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::ItemFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2059 inline QFlags<Qt::MatchFlags::enum_type> operator|(Qt::MatchFlags::enum_type f1, Qt::MatchFlags::enum_type f2) { return QFlags<Qt::MatchFlags::enum_type>(f1) | f2; } inline QFlags<Qt::MatchFlags::enum_type> operator|(Qt::MatchFlags::enum_type f1, QFlags<Qt::MatchFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::MatchFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2060 inline QFlags<Qt::TextInteractionFlags::enum_type> operator|(Qt::TextInteractionFlags::enum_type f1, Qt::TextInteractionFlags::enum_type f2) { return QFlags<Qt::TextInteractionFlags::enum_type>(f1) | f2; } inline QFlags<Qt::TextInteractionFlags::enum_type> operator|(Qt::TextInteractionFlags::enum_type f1, QFlags<Qt::TextInteractionFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::TextInteractionFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2061 inline QFlags<Qt::InputMethodHints::enum_type> operator|(Qt::InputMethodHints::enum_type f1, Qt::InputMethodHints::enum_type f2) { return QFlags<Qt::InputMethodHints::enum_type>(f1) | f2; } inline QFlags<Qt::InputMethodHints::enum_type> operator|(Qt::InputMethodHints::enum_type f1, QFlags<Qt::InputMethodHints::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::InputMethodHints::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2062 inline QFlags<Qt::TouchPointStates::enum_type> operator|(Qt::TouchPointStates::enum_type f1, Qt::TouchPointStates::enum_type f2) { return QFlags<Qt::TouchPointStates::enum_type>(f1) | f2; } inline QFlags<Qt::TouchPointStates::enum_type> operator|(Qt::TouchPointStates::enum_type f1, QFlags<Qt::TouchPointStates::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::TouchPointStates::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2063 inline QFlags<Qt::GestureFlags::enum_type> operator|(Qt::GestureFlags::enum_type f1, Qt::GestureFlags::enum_type f2) { return QFlags<Qt::GestureFlags::enum_type>(f1) | f2; } inline QFlags<Qt::GestureFlags::enum_type> operator|(Qt::GestureFlags::enum_type f1, QFlags<Qt::GestureFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(Qt::GestureFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
2064 typedef bool (*qInternalCallback)(void **);
2065 class QInternal {
2066 public:
2067 enum PaintDeviceFlags {
2068 UnknownDevice = 0x00,
2069 Widget = 0x01,
2070 Pixmap = 0x02,
2071 Image = 0x03,
2072 Printer = 0x04,
2073 Picture = 0x05,
2074 Pbuffer = 0x06,
2075 FramebufferObject = 0x07,
2076 CustomRaster = 0x08,
2077 MacQuartz = 0x09,
2078 PaintBuffer = 0x0a,
2079 OpenGL = 0x0b
2080 };
2081 enum RelayoutType {
2082 RelayoutNormal,
2083 RelayoutDragging,
2084 RelayoutDropped
2085 };
2086 enum Callback {
2087 ConnectCallback,
2088 DisconnectCallback,
2089 AdoptCurrentThread,
2090 EventNotifyCallback,
2091 LastCallback
2092 };
2093 enum InternalFunction {
2094 CreateThreadForAdoption,
2095 RefAdoptedThread,
2096 DerefAdoptedThread,
2097 SetCurrentThreadToMainThread,
2098 SetQObjectSender,
2099 GetQObjectSender,
2100 ResetQObjectSender,
2101 LastInternalFunction
2102 };
2103 enum DockPosition {
2104 LeftDock,
2105 RightDock,
2106 TopDock,
2107 BottomDock,
2108 DockCount
2109 };
2110 static bool registerCallback(Callback, qInternalCallback);
2111 static bool unregisterCallback(Callback, qInternalCallback);
2112 static bool activateCallbacks(Callback, void **);
2113 static bool callFunction(InternalFunction func, void **);
2114 };
2115 extern "C" {
2116 extern void *memcpy (void *__restrict __dest,
2117 __const void *__restrict __src, size_t __n)
2118 throw () __attribute__ ((__nonnull__ (1, 2)));
2119 extern void *memmove (void *__dest, __const void *__src, size_t __n)
2120 throw () __attribute__ ((__nonnull__ (1, 2)));
2121 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
2122 int __c, size_t __n)
2123 throw () __attribute__ ((__nonnull__ (1, 2)));
2124 extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
2125 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
2126 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2127 extern "C++"
2128 {
2129 extern void *memchr (void *__s, int __c, size_t __n)
2130 throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2131 extern __const void *memchr (__const void *__s, int __c, size_t __n)
2132 throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2133 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
2134 memchr (void *__s, int __c, size_t __n) throw ()
2135 {
2136 return __builtin_memchr (__s, __c, __n);
2137 }
2138 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const void *
2139 memchr (__const void *__s, int __c, size_t __n) throw ()
2140 {
2141 return __builtin_memchr (__s, __c, __n);
2142 }
2143 }
2144 extern "C++" void *rawmemchr (void *__s, int __c)
2145 throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2146 extern "C++" __const void *rawmemchr (__const void *__s, int __c)
2147 throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2148 extern "C++" void *memrchr (void *__s, int __c, size_t __n)
2149 throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2150 extern "C++" __const void *memrchr (__const void *__s, int __c, size_t __n)
2151 throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2152 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
2153 throw () __attribute__ ((__nonnull__ (1, 2)));
2154 extern char *strncpy (char *__restrict __dest,
2155 __const char *__restrict __src, size_t __n)
2156 throw () __attribute__ ((__nonnull__ (1, 2)));
2157 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
2158 throw () __attribute__ ((__nonnull__ (1, 2)));
2159 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
2160 size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
2161 extern int strcmp (__const char *__s1, __const char *__s2)
2162 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2163 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
2164 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2165 extern int strcoll (__const char *__s1, __const char *__s2)
2166 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2167 extern size_t strxfrm (char *__restrict __dest,
2168 __const char *__restrict __src, size_t __n)
2169 throw () __attribute__ ((__nonnull__ (2)));
2170 typedef struct __locale_struct
2171 {
2172 struct locale_data *__locales[13];
2173 const unsigned short int *__ctype_b;
2174 const int *__ctype_tolower;
2175 const int *__ctype_toupper;
2176 const char *__names[13];
2177 } *__locale_t;
2178 typedef __locale_t locale_t;
2179 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
2180 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
2181 extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
2182 __locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4)));
2183 extern char *strdup (__const char *__s)
2184 throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
2185 extern char *strndup (__const char *__string, size_t __n)
2186 throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
2187 extern "C++"
2188 {
2189 extern char *strchr (char *__s, int __c)
2190 throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2191 extern __const char *strchr (__const char *__s, int __c)
2192 throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2193 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2194 strchr (char *__s, int __c) throw ()
2195 {
2196 return __builtin_strchr (__s, __c);
2197 }
2198 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
2199 strchr (__const char *__s, int __c) throw ()
2200 {
2201 return __builtin_strchr (__s, __c);
2202 }
2203 }
2204 extern "C++"
2205 {
2206 extern char *strrchr (char *__s, int __c)
2207 throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2208 extern __const char *strrchr (__const char *__s, int __c)
2209 throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2210 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2211 strrchr (char *__s, int __c) throw ()
2212 {
2213 return __builtin_strrchr (__s, __c);
2214 }
2215 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
2216 strrchr (__const char *__s, int __c) throw ()
2217 {
2218 return __builtin_strrchr (__s, __c);
2219 }
2220 }
2221 extern "C++" char *strchrnul (char *__s, int __c)
2222 throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2223 extern "C++" __const char *strchrnul (__const char *__s, int __c)
2224 throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2225 extern size_t strcspn (__const char *__s, __const char *__reject)
2226 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2227 extern size_t strspn (__const char *__s, __const char *__accept)
2228 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2229 extern "C++"
2230 {
2231 extern char *strpbrk (char *__s, __const char *__accept)
2232 throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2233 extern __const char *strpbrk (__const char *__s, __const char *__accept)
2234 throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2235 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2236 strpbrk (char *__s, __const char *__accept) throw ()
2237 {
2238 return __builtin_strpbrk (__s, __accept);
2239 }
2240 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
2241 strpbrk (__const char *__s, __const char *__accept) throw ()
2242 {
2243 return __builtin_strpbrk (__s, __accept);
2244 }
2245 }
2246 extern "C++"
2247 {
2248 extern char *strstr (char *__haystack, __const char *__needle)
2249 throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2250 extern __const char *strstr (__const char *__haystack,
2251 __const char *__needle)
2252 throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2253 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2254 strstr (char *__haystack, __const char *__needle) throw ()
2255 {
2256 return __builtin_strstr (__haystack, __needle);
2257 }
2258 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
2259 strstr (__const char *__haystack, __const char *__needle) throw ()
2260 {
2261 return __builtin_strstr (__haystack, __needle);
2262 }
2263 }
2264 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
2265 throw () __attribute__ ((__nonnull__ (2)));
2266 extern char *__strtok_r (char *__restrict __s,
2267 __const char *__restrict __delim,
2268 char **__restrict __save_ptr)
2269 throw () __attribute__ ((__nonnull__ (2, 3)));
2270 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
2271 char **__restrict __save_ptr)
2272 throw () __attribute__ ((__nonnull__ (2, 3)));
2273 extern "C++" char *strcasestr (char *__haystack, __const char *__needle)
2274 throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2275 extern "C++" __const char *strcasestr (__const char *__haystack,
2276 __const char *__needle)
2277 throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2278 extern void *memmem (__const void *__haystack, size_t __haystacklen,
2279 __const void *__needle, size_t __needlelen)
2280 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
2281 extern void *__mempcpy (void *__restrict __dest,
2282 __const void *__restrict __src, size_t __n)
2283 throw () __attribute__ ((__nonnull__ (1, 2)));
2284 extern void *mempcpy (void *__restrict __dest,
2285 __const void *__restrict __src, size_t __n)
2286 throw () __attribute__ ((__nonnull__ (1, 2)));
2287 extern size_t strlen (__const char *__s)
2288 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2289 extern size_t strnlen (__const char *__string, size_t __maxlen)
2290 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2291 extern char *strerror (int __errnum) throw ();
2292 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
2293 throw () __attribute__ ((__nonnull__ (2)));
2294 extern char *strerror_l (int __errnum, __locale_t __l) throw ();
2295 extern void __bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
2296 extern void bcopy (__const void *__src, void *__dest, size_t __n)
2297 throw () __attribute__ ((__nonnull__ (1, 2)));
2298 extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
2299 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
2300 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2301 extern "C++"
2302 {
2303 extern char *index (char *__s, int __c)
2304 throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2305 extern __const char *index (__const char *__s, int __c)
2306 throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2307 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2308 index (char *__s, int __c) throw ()
2309 {
2310 return __builtin_index (__s, __c);
2311 }
2312 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
2313 index (__const char *__s, int __c) throw ()
2314 {
2315 return __builtin_index (__s, __c);
2316 }
2317 }
2318 extern "C++"
2319 {
2320 extern char *rindex (char *__s, int __c)
2321 throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2322 extern __const char *rindex (__const char *__s, int __c)
2323 throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2324 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2325 rindex (char *__s, int __c) throw ()
2326 {
2327 return __builtin_rindex (__s, __c);
2328 }
2329 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
2330 rindex (__const char *__s, int __c) throw ()
2331 {
2332 return __builtin_rindex (__s, __c);
2333 }
2334 }
2335 extern int ffs (int __i) throw () __attribute__ ((__const__));
2336 extern int ffsl (long int __l) throw () __attribute__ ((__const__));
2337 __extension__ extern int ffsll (long long int __ll)
2338 throw () __attribute__ ((__const__));
2339 extern int strcasecmp (__const char *__s1, __const char *__s2)
2340 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2341 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
2342 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2343 extern int strcasecmp_l (__const char *__s1, __const char *__s2,
2344 __locale_t __loc)
2345 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
2346 extern int strncasecmp_l (__const char *__s1, __const char *__s2,
2347 size_t __n, __locale_t __loc)
2348 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
2349 extern char *strsep (char **__restrict __stringp,
2350 __const char *__restrict __delim)
2351 throw () __attribute__ ((__nonnull__ (1, 2)));
2352 extern char *strsignal (int __sig) throw ();
2353 extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
2354 throw () __attribute__ ((__nonnull__ (1, 2)));
2355 extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
2356 throw () __attribute__ ((__nonnull__ (1, 2)));
2357 extern char *__stpncpy (char *__restrict __dest,
2358 __const char *__restrict __src, size_t __n)
2359 throw () __attribute__ ((__nonnull__ (1, 2)));
2360 extern char *stpncpy (char *__restrict __dest,
2361 __const char *__restrict __src, size_t __n)
2362 throw () __attribute__ ((__nonnull__ (1, 2)));
2363 extern int strverscmp (__const char *__s1, __const char *__s2)
2364 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2365 extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1)));
2366 extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
2367 extern "C++" char *basename (char *__filename)
2368 throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
2369 extern "C++" __const char *basename (__const char *__filename)
2370 throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
2371 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters")))
2372 ;
2373 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
2374 memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw ()
2375 {
2376 return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
2377 }
2378 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
2379 memmove (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw ()
2380 {
2381 return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
2382 }
2383 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
2384 mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw ()
2385 {
2386 return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
2387 }
2388 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
2389 memset (void *__dest, int __ch, size_t __len) throw ()
2390 {
2391 if (__builtin_constant_p (__len) && __len == 0
2392 && (!__builtin_constant_p (__ch) || __ch != 0))
2393 {
2394 __warn_memset_zero_len ();
2395 return __dest;
2396 }
2397 return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0));
2398 }
2399 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void
2400 bcopy (__const void *__restrict __src, void *__restrict __dest, size_t __len) throw ()
2401 {
2402 (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
2403 }
2404 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void
2405 bzero (void *__dest, size_t __len) throw ()
2406 {
2407 (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0));
2408 }
2409 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2410 strcpy (char *__restrict __dest, __const char *__restrict __src) throw ()
2411 {
2412 return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
2413 }
2414 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2415 stpcpy (char *__restrict __dest, __const char *__restrict __src) throw ()
2416 {
2417 return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
2418 }
2419 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2420 strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __len) throw ()
2421 {
2422 return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
2423 }
2424 extern char *__stpncpy_chk (char *__dest, __const char *__src, size_t __n,
2425 size_t __destlen) throw ();
2426 extern char *__stpncpy_alias (char *__dest, __const char *__src, size_t __n) throw () __asm__ ("" "stpncpy")
2427 ;
2428 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2429 stpncpy (char *__dest, __const char *__src, size_t __n) throw ()
2430 {
2431 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
2432 && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1)))
2433 return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
2434 return __stpncpy_alias (__dest, __src, __n);
2435 }
2436 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2437 strcat (char *__restrict __dest, __const char *__restrict __src) throw ()
2438 {
2439 return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
2440 }
2441 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
2442 strncat (char *__restrict __dest, __const char *__restrict __src, size_t __len) throw ()
2443 {
2444 return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
2445 }
2446 }
2447 typedef __builtin_va_list __gnuc_va_list;
2448 typedef __gnuc_va_list va_list;
2449 typedef QtValidLicenseForCoreModule QtCoreModule;
2450 char *qstrdup(const char *);
2451 inline uint qstrlen(const char *str)
2452 { return str ? uint(strlen(str)) : 0; }
2453 inline uint qstrnlen(const char *str, uint maxlen)
2454 {
2455 uint length = 0;
2456 if (str) {
2457 while (length < maxlen && *str++)
2458 length++;
2459 }
2460 return length;
2461 }
2462 char *qstrcpy(char *dst, const char *src);
2463 char *qstrncpy(char *dst, const char *src, uint len);
2464 int qstrcmp(const char *str1, const char *str2);
2465 int qstrcmp(const QByteArray &str1, const QByteArray &str2);
2466 int qstrcmp(const QByteArray &str1, const char *str2);
2467 static inline int qstrcmp(const char *str1, const QByteArray &str2)
2468 { return -qstrcmp(str2, str1); }
2469 inline int qstrncmp(const char *str1, const char *str2, uint len)
2470 {
2471 return (str1 && str2) ? strncmp(str1, str2, len)
2472 : (str1 ? 1 : (str2 ? -1 : 0));
2473 }
2474 int qstricmp(const char *, const char *);
2475 int qstrnicmp(const char *, const char *, uint len);
2476 int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
2477 int qsnprintf(char *str, size_t n, const char *fmt, ...);
2478 quint16 qChecksum(const char *s, uint len);
2479 class QByteRef;
2480 class QString;
2481 class QDataStream;
2482 template <typename T> class QList;
2483 class QByteArray
2484 {
2485 private:
2486 struct Data {
2487 QBasicAtomicInt ref;
2488 int alloc, size;
2489 char *data;
2490 char array[1];
2491 };
2492 public:
2493 inline QByteArray();
2494 QByteArray(const char *);
2495 QByteArray(const char *, int size);
2496 QByteArray(int size, char c);
2497 QByteArray(int size, Qt::Initialization);
2498 inline QByteArray(const QByteArray &);
2499 inline ~QByteArray();
2500 QByteArray &operator=(const QByteArray &);
2501 QByteArray &operator=(const char *str);
2502 inline int size() const;
2503 bool isEmpty() const;
2504 void resize(int size);
2505 QByteArray &fill(char c, int size = -1);
2506 int capacity() const;
2507 void reserve(int size);
2508 void squeeze();
2509 operator const char *() const;
2510 operator const void *() const;
2511 char *data();
2512 const char *data() const;
2513 inline const char *constData() const;
2514 inline void detach();
2515 bool isDetached() const;
2516 void clear();
2517 char at(int i) const;
2518 char operator[](int i) const;
2519 char operator[](uint i) const;
2520 QByteRef operator[](int i);
2521 QByteRef operator[](uint i);
2522 int indexOf(char c, int from = 0) const;
2523 int indexOf(const char *c, int from = 0) const;
2524 int indexOf(const QByteArray &a, int from = 0) const;
2525 int lastIndexOf(char c, int from = -1) const;
2526 int lastIndexOf(const char *c, int from = -1) const;
2527 int lastIndexOf(const QByteArray &a, int from = -1) const;
2528 QBool contains(char c) const;
2529 QBool contains(const char *a) const;
2530 QBool contains(const QByteArray &a) const;
2531 int count(char c) const;
2532 int count(const char *a) const;
2533 int count(const QByteArray &a) const;
2534 QByteArray left(int len) const;
2535 QByteArray right(int len) const;
2536 QByteArray mid(int index, int len = -1) const;
2537 bool startsWith(const QByteArray &a) const;
2538 bool startsWith(char c) const;
2539 bool startsWith(const char *c) const;
2540 bool endsWith(const QByteArray &a) const;
2541 bool endsWith(char c) const;
2542 bool endsWith(const char *c) const;
2543 void truncate(int pos);
2544 void chop(int n);
2545 QByteArray toLower() const;
2546 QByteArray toUpper() const;
2547 QByteArray trimmed() const;
2548 QByteArray simplified() const;
2549 QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
2550 QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
2551 QByteArray &prepend(char c);
2552 QByteArray &prepend(const char *s);
2553 QByteArray &prepend(const char *s, int len);
2554 QByteArray &prepend(const QByteArray &a);
2555 QByteArray &append(char c);
2556 QByteArray &append(const char *s);
2557 QByteArray &append(const char *s, int len);
2558 QByteArray &append(const QByteArray &a);
2559 QByteArray &insert(int i, char c);
2560 QByteArray &insert(int i, const char *s);
2561 QByteArray &insert(int i, const char *s, int len);
2562 QByteArray &insert(int i, const QByteArray &a);
2563 QByteArray &remove(int index, int len);
2564 QByteArray &replace(int index, int len, const char *s);
2565 QByteArray &replace(int index, int len, const QByteArray &s);
2566 QByteArray &replace(char before, const char *after);
2567 QByteArray &replace(char before, const QByteArray &after);
2568 QByteArray &replace(const char *before, const char *after);
2569 QByteArray &replace(const char *before, int bsize, const char *after, int asize);
2570 QByteArray &replace(const QByteArray &before, const QByteArray &after);
2571 QByteArray &replace(const QByteArray &before, const char *after);
2572 QByteArray &replace(const char *before, const QByteArray &after);
2573 QByteArray &replace(char before, char after);
2574 QByteArray &operator+=(char c);
2575 QByteArray &operator+=(const char *s);
2576 QByteArray &operator+=(const QByteArray &a);
2577 QList<QByteArray> split(char sep) const;
2578 QByteArray repeated(int times) const;
2579 QByteArray &append(const QString &s);
2580 QByteArray &insert(int i, const QString &s);
2581 QByteArray &replace(const QString &before, const char *after);
2582 QByteArray &replace(char c, const QString &after);
2583 QByteArray &replace(const QString &before, const QByteArray &after);
2584 QByteArray &operator+=(const QString &s);
2585 int indexOf(const QString &s, int from = 0) const;
2586 int lastIndexOf(const QString &s, int from = -1) const;
2587 inline bool operator==(const QString &s2) const;
2588 inline bool operator!=(const QString &s2) const;
2589 inline bool operator<(const QString &s2) const;
2590 inline bool operator>(const QString &s2) const;
2591 inline bool operator<=(const QString &s2) const;
2592 inline bool operator>=(const QString &s2) const;
2593 short toShort(bool *ok = 0, int base = 10) const;
2594 ushort toUShort(bool *ok = 0, int base = 10) const;
2595 int toInt(bool *ok = 0, int base = 10) const;
2596 uint toUInt(bool *ok = 0, int base = 10) const;
2597 long toLong(bool *ok = 0, int base = 10) const;
2598 ulong toULong(bool *ok = 0, int base = 10) const;
2599 qlonglong toLongLong(bool *ok = 0, int base = 10) const;
2600 qulonglong toULongLong(bool *ok = 0, int base = 10) const;
2601 float toFloat(bool *ok = 0) const;
2602 double toDouble(bool *ok = 0) const;
2603 QByteArray toBase64() const;
2604 QByteArray toHex() const;
2605 QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
2606 const QByteArray &include = QByteArray(),
2607 char percent = '%') const;
2608 QByteArray &setNum(short, int base = 10);
2609 QByteArray &setNum(ushort, int base = 10);
2610 QByteArray &setNum(int, int base = 10);
2611 QByteArray &setNum(uint, int base = 10);
2612 QByteArray &setNum(qlonglong, int base = 10);
2613 QByteArray &setNum(qulonglong, int base = 10);
2614 QByteArray &setNum(float, char f = 'g', int prec = 6);
2615 QByteArray &setNum(double, char f = 'g', int prec = 6);
2616 static QByteArray number(int, int base = 10);
2617 static QByteArray number(uint, int base = 10);
2618 static QByteArray number(qlonglong, int base = 10);
2619 static QByteArray number(qulonglong, int base = 10);
2620 static QByteArray number(double, char f = 'g', int prec = 6);
2621 static QByteArray fromRawData(const char *, int size);
2622 static QByteArray fromBase64(const QByteArray &base64);
2623 static QByteArray fromHex(const QByteArray &hexEncoded);
2624 static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
2625 typedef char *iterator;
2626 typedef const char *const_iterator;
2627 typedef iterator Iterator;
2628 typedef const_iterator ConstIterator;
2629 iterator begin();
2630 const_iterator begin() const;
2631 const_iterator constBegin() const;
2632 iterator end();
2633 const_iterator end() const;
2634 const_iterator constEnd() const;
2635 typedef const char & const_reference;
2636 typedef char & reference;
2637 typedef char value_type;
2638 void push_back(char c);
2639 void push_back(const char *c);
2640 void push_back(const QByteArray &a);
2641 void push_front(char c);
2642 void push_front(const char *c);
2643 void push_front(const QByteArray &a);
2644 inline int count() const { return d->size; }
2645 int length() const { return d->size; }
2646 bool isNull() const;
2647 private:
2648 operator QNoImplicitBoolCast() const;
2649 static Data shared_null;
2650 static Data shared_empty;
2651 Data *d;
2652 QByteArray(Data *dd, int , int ) : d(dd) {}
2653 void realloc(int alloc);
2654 void expand(int i);
2655 QByteArray nulTerminated() const;
2656 friend class QByteRef;
2657 friend class QString;
2658 friend QByteArray qUncompress(const uchar *data, int nbytes);
2659 public:
2660 typedef Data * DataPtr;
2661 inline DataPtr &data_ptr() { return d; }
2662 };
2663 inline QByteArray::QByteArray(): d(&shared_null) { d->ref.ref(); }
2664 inline QByteArray::~QByteArray() { if (!d->ref.deref()) qFree(d); }
2665 inline int QByteArray::size() const
2666 { return d->size; }
2667 inline char QByteArray::at(int i) const
2668 { ((!(i >= 0 && i < size())) ? qt_assert("i >= 0 && i < size()","/usr/include/qt4/QtCore/qbytearray.h",395) : qt_noop()); return d->data[i]; }
2669 inline char QByteArray::operator[](int i) const
2670 { ((!(i >= 0 && i < size())) ? qt_assert("i >= 0 && i < size()","/usr/include/qt4/QtCore/qbytearray.h",397) : qt_noop()); return d->data[i]; }
2671 inline char QByteArray::operator[](uint i) const
2672 { ((!(i < uint(size()))) ? qt_assert("i < uint(size())","/usr/include/qt4/QtCore/qbytearray.h",399) : qt_noop()); return d->data[i]; }
2673 inline bool QByteArray::isEmpty() const
2674 { return d->size == 0; }
2675 inline QByteArray::operator const char *() const
2676 { return d->data; }
2677 inline QByteArray::operator const void *() const
2678 { return d->data; }
2679 inline char *QByteArray::data()
2680 { detach(); return d->data; }
2681 inline const char *QByteArray::data() const
2682 { return d->data; }
2683 inline const char *QByteArray::constData() const
2684 { return d->data; }
2685 inline void QByteArray::detach()
2686 { if (d->ref != 1 || d->data != d->array) realloc(d->size); }
2687 inline bool QByteArray::isDetached() const
2688 { return d->ref == 1; }
2689 inline QByteArray::QByteArray(const QByteArray &a) : d(a.d)
2690 { d->ref.ref(); }
2691 inline int QByteArray::capacity() const
2692 { return d->alloc; }
2693 inline void QByteArray::reserve(int asize)
2694 { if (d->ref != 1 || asize > d->alloc) realloc(asize); }
2695 inline void QByteArray::squeeze()
2696 { if (d->size < d->alloc) realloc(d->size); }
2697 class QByteRef {
2698 QByteArray &a;
2699 int i;
2700 inline QByteRef(QByteArray &array, int idx)
2701 : a(array),i(idx) {}
2702 friend class QByteArray;
2703 public:
2704 inline operator char() const
2705 { return i < a.d->size ? a.d->data[i] : char(0); }
2706 inline QByteRef &operator=(char c)
2707 { if (i >= a.d->size) a.expand(i); else a.detach();
2708 a.d->data[i] = c; return *this; }
2709 inline QByteRef &operator=(const QByteRef &c)
2710 { if (i >= a.d->size) a.expand(i); else a.detach();
2711 a.d->data[i] = c.a.d->data[c.i]; return *this; }
2712 inline bool operator==(char c) const
2713 { return a.d->data[i] == c; }
2714 inline bool operator!=(char c) const
2715 { return a.d->data[i] != c; }
2716 inline bool operator>(char c) const
2717 { return a.d->data[i] > c; }
2718 inline bool operator>=(char c) const
2719 { return a.d->data[i] >= c; }
2720 inline bool operator<(char c) const
2721 { return a.d->data[i] < c; }
2722 inline bool operator<=(char c) const
2723 { return a.d->data[i] <= c; }
2724 };
2725 inline QByteRef QByteArray::operator[](int i)
2726 { ((!(i >= 0)) ? qt_assert("i >= 0","/usr/include/qt4/QtCore/qbytearray.h",471) : qt_noop()); return QByteRef(*this, i); }
2727 inline QByteRef QByteArray::operator[](uint i)
2728 { return QByteRef(*this, i); }
2729 inline QByteArray::iterator QByteArray::begin()
2730 { detach(); return d->data; }
2731 inline QByteArray::const_iterator QByteArray::begin() const
2732 { return d->data; }
2733 inline QByteArray::const_iterator QByteArray::constBegin() const
2734 { return d->data; }
2735 inline QByteArray::iterator QByteArray::end()
2736 { detach(); return d->data + d->size; }
2737 inline QByteArray::const_iterator QByteArray::end() const
2738 { return d->data + d->size; }
2739 inline QByteArray::const_iterator QByteArray::constEnd() const
2740 { return d->data + d->size; }
2741 inline QByteArray &QByteArray::operator+=(char c)
2742 { return append(c); }
2743 inline QByteArray &QByteArray::operator+=(const char *s)
2744 { return append(s); }
2745 inline QByteArray &QByteArray::operator+=(const QByteArray &a)
2746 { return append(a); }
2747 inline void QByteArray::push_back(char c)
2748 { append(c); }
2749 inline void QByteArray::push_back(const char *c)
2750 { append(c); }
2751 inline void QByteArray::push_back(const QByteArray &a)
2752 { append(a); }
2753 inline void QByteArray::push_front(char c)
2754 { prepend(c); }
2755 inline void QByteArray::push_front(const char *c)
2756 { prepend(c); }
2757 inline void QByteArray::push_front(const QByteArray &a)
2758 { prepend(a); }
2759 inline QBool QByteArray::contains(const QByteArray &a) const
2760 { return QBool(indexOf(a) != -1); }
2761 inline QBool QByteArray::contains(char c) const
2762 { return QBool(indexOf(c) != -1); }
2763 inline bool operator==(const QByteArray &a1, const QByteArray &a2)
2764 { return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
2765 inline bool operator==(const QByteArray &a1, const char *a2)
2766 { return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
2767 inline bool operator==(const char *a1, const QByteArray &a2)
2768 { return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
2769 inline bool operator!=(const QByteArray &a1, const QByteArray &a2)
2770 { return !(a1==a2); }
2771 inline bool operator!=(const QByteArray &a1, const char *a2)
2772 { return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
2773 inline bool operator!=(const char *a1, const QByteArray &a2)
2774 { return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
2775 inline bool operator<(const QByteArray &a1, const QByteArray &a2)
2776 { return qstrcmp(a1, a2) < 0; }
2777 inline bool operator<(const QByteArray &a1, const char *a2)
2778 { return qstrcmp(a1, a2) < 0; }
2779 inline bool operator<(const char *a1, const QByteArray &a2)
2780 { return qstrcmp(a1, a2) < 0; }
2781 inline bool operator<=(const QByteArray &a1, const QByteArray &a2)
2782 { return qstrcmp(a1, a2) <= 0; }
2783 inline bool operator<=(const QByteArray &a1, const char *a2)
2784 { return qstrcmp(a1, a2) <= 0; }
2785 inline bool operator<=(const char *a1, const QByteArray &a2)
2786 { return qstrcmp(a1, a2) <= 0; }
2787 inline bool operator>(const QByteArray &a1, const QByteArray &a2)
2788 { return qstrcmp(a1, a2) > 0; }
2789 inline bool operator>(const QByteArray &a1, const char *a2)
2790 { return qstrcmp(a1, a2) > 0; }
2791 inline bool operator>(const char *a1, const QByteArray &a2)
2792 { return qstrcmp(a1, a2) > 0; }
2793 inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
2794 { return qstrcmp(a1, a2) >= 0; }
2795 inline bool operator>=(const QByteArray &a1, const char *a2)
2796 { return qstrcmp(a1, a2) >= 0; }
2797 inline bool operator>=(const char *a1, const QByteArray &a2)
2798 { return qstrcmp(a1, a2) >= 0; }
2799 inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
2800 { return QByteArray(a1) += a2; }
2801 inline const QByteArray operator+(const QByteArray &a1, const char *a2)
2802 { return QByteArray(a1) += a2; }
2803 inline const QByteArray operator+(const QByteArray &a1, char a2)
2804 { return QByteArray(a1) += a2; }
2805 inline const QByteArray operator+(const char *a1, const QByteArray &a2)
2806 { return QByteArray(a1) += a2; }
2807 inline const QByteArray operator+(char a1, const QByteArray &a2)
2808 { return QByteArray(&a1, 1) += a2; }
2809 inline QBool QByteArray::contains(const char *c) const
2810 { return QBool(indexOf(c) != -1); }
2811 inline QByteArray &QByteArray::replace(char before, const char *c)
2812 { return replace(&before, 1, c, qstrlen(c)); }
2813 inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c)
2814 { return replace(before.constData(), before.size(), c, qstrlen(c)); }
2815 inline QByteArray &QByteArray::replace(const char *before, const char *after)
2816 { return replace(before, qstrlen(before), after, qstrlen(after)); }
2817 inline QByteArray &QByteArray::setNum(short n, int base)
2818 { return setNum(qlonglong(n), base); }
2819 inline QByteArray &QByteArray::setNum(ushort n, int base)
2820 { return setNum(qulonglong(n), base); }
2821 inline QByteArray &QByteArray::setNum(int n, int base)
2822 { return setNum(qlonglong(n), base); }
2823 inline QByteArray &QByteArray::setNum(uint n, int base)
2824 { return setNum(qulonglong(n), base); }
2825 inline QByteArray &QByteArray::setNum(float n, char f, int prec)
2826 { return setNum(double(n),f,prec); }
2827 QDataStream &operator<<(QDataStream &, const QByteArray &);
2828 QDataStream &operator>>(QDataStream &, QByteArray &);
2829 QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
2830 QByteArray qUncompress(const uchar* data, int nbytes);
2831 inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
2832 { return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
2833 inline QByteArray qUncompress(const QByteArray& data)
2834 { return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
2835 template <> class QTypeInfo<QByteArray > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QByteArray)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QByteArray"; } };
2836 template <> inline bool qIsDetached<QByteArray>(QByteArray &t) { return t.isDetached(); } template <> inline void qSwap<QByteArray>(QByteArray &value1, QByteArray &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
2837
2838
2839 namespace std __attribute__ ((__visibility__ ("default"))) {
2840 template<typename _Alloc>
2841 class allocator;
2842 template<class _CharT>
2843 struct char_traits;
2844 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2845 typename _Alloc = allocator<_CharT> >
2846 class basic_string;
2847 template<> struct char_traits<char>;
2848 typedef basic_string<char> string;
2849 template<> struct char_traits<wchar_t>;
2850 typedef basic_string<wchar_t> wstring;
2851 }
2852
2853
2854 namespace std __attribute__ ((__visibility__ ("default"))) {
2855 using ::ptrdiff_t;
2856 using ::size_t;
2857 }
2858 namespace std __attribute__ ((__visibility__ ("default"))) {
2859 void
2860 __throw_bad_exception(void) __attribute__((__noreturn__));
2861 void
2862 __throw_bad_alloc(void) __attribute__((__noreturn__));
2863 void
2864 __throw_bad_cast(void) __attribute__((__noreturn__));
2865 void
2866 __throw_bad_typeid(void) __attribute__((__noreturn__));
2867 void
2868 __throw_logic_error(const char*) __attribute__((__noreturn__));
2869 void
2870 __throw_domain_error(const char*) __attribute__((__noreturn__));
2871 void
2872 __throw_invalid_argument(const char*) __attribute__((__noreturn__));
2873 void
2874 __throw_length_error(const char*) __attribute__((__noreturn__));
2875 void
2876 __throw_out_of_range(const char*) __attribute__((__noreturn__));
2877 void
2878 __throw_runtime_error(const char*) __attribute__((__noreturn__));
2879 void
2880 __throw_range_error(const char*) __attribute__((__noreturn__));
2881 void
2882 __throw_overflow_error(const char*) __attribute__((__noreturn__));
2883 void
2884 __throw_underflow_error(const char*) __attribute__((__noreturn__));
2885 void
2886 __throw_ios_failure(const char*) __attribute__((__noreturn__));
2887 void
2888 __throw_system_error(int) __attribute__((__noreturn__));
2889 void
2890 __throw_future_error(int) __attribute__((__noreturn__));
2891 void
2892 __throw_bad_function_call() __attribute__((__noreturn__));
2893 }
2894
2895 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
2896 template<typename _Iterator, typename _Container>
2897 class __normal_iterator;
2898 }
2899 namespace std __attribute__ ((__visibility__ ("default"))) {
2900 struct __true_type { };
2901 struct __false_type { };
2902 template<bool>
2903 struct __truth_type
2904 { typedef __false_type __type; };
2905 template<>
2906 struct __truth_type<true>
2907 { typedef __true_type __type; };
2908 template<class _Sp, class _Tp>
2909 struct __traitor
2910 {
2911 enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
2912 typedef typename __truth_type<__value>::__type __type;
2913 };
2914 template<typename, typename>
2915 struct __are_same
2916 {
2917 enum { __value = 0 };
2918 typedef __false_type __type;
2919 };
2920 template<typename _Tp>
2921 struct __are_same<_Tp, _Tp>
2922 {
2923 enum { __value = 1 };
2924 typedef __true_type __type;
2925 };
2926 template<typename _Tp>
2927 struct __is_void
2928 {
2929 enum { __value = 0 };
2930 typedef __false_type __type;
2931 };
2932 template<>
2933 struct __is_void<void>
2934 {
2935 enum { __value = 1 };
2936 typedef __true_type __type;
2937 };
2938 template<typename _Tp>
2939 struct __is_integer
2940 {
2941 enum { __value = 0 };
2942 typedef __false_type __type;
2943 };
2944 template<>
2945 struct __is_integer<bool>
2946 {
2947 enum { __value = 1 };
2948 typedef __true_type __type;
2949 };
2950 template<>
2951 struct __is_integer<char>
2952 {
2953 enum { __value = 1 };
2954 typedef __true_type __type;
2955 };
2956 template<>
2957 struct __is_integer<signed char>
2958 {
2959 enum { __value = 1 };
2960 typedef __true_type __type;
2961 };
2962 template<>
2963 struct __is_integer<unsigned char>
2964 {
2965 enum { __value = 1 };
2966 typedef __true_type __type;
2967 };
2968 template<>
2969 struct __is_integer<wchar_t>
2970 {
2971 enum { __value = 1 };
2972 typedef __true_type __type;
2973 };
2974 template<>
2975 struct __is_integer<short>
2976 {
2977 enum { __value = 1 };
2978 typedef __true_type __type;
2979 };
2980 template<>
2981 struct __is_integer<unsigned short>
2982 {
2983 enum { __value = 1 };
2984 typedef __true_type __type;
2985 };
2986 template<>
2987 struct __is_integer<int>
2988 {
2989 enum { __value = 1 };
2990 typedef __true_type __type;
2991 };
2992 template<>
2993 struct __is_integer<unsigned int>
2994 {
2995 enum { __value = 1 };
2996 typedef __true_type __type;
2997 };
2998 template<>
2999 struct __is_integer<long>
3000 {
3001 enum { __value = 1 };
3002 typedef __true_type __type;
3003 };
3004 template<>
3005 struct __is_integer<unsigned long>
3006 {
3007 enum { __value = 1 };
3008 typedef __true_type __type;
3009 };
3010 template<>
3011 struct __is_integer<long long>
3012 {
3013 enum { __value = 1 };
3014 typedef __true_type __type;
3015 };
3016 template<>
3017 struct __is_integer<unsigned long long>
3018 {
3019 enum { __value = 1 };
3020 typedef __true_type __type;
3021 };
3022 template<typename _Tp>
3023 struct __is_floating
3024 {
3025 enum { __value = 0 };
3026 typedef __false_type __type;
3027 };
3028 template<>
3029 struct __is_floating<float>
3030 {
3031 enum { __value = 1 };
3032 typedef __true_type __type;
3033 };
3034 template<>
3035 struct __is_floating<double>
3036 {
3037 enum { __value = 1 };
3038 typedef __true_type __type;
3039 };
3040 template<>
3041 struct __is_floating<long double>
3042 {
3043 enum { __value = 1 };
3044 typedef __true_type __type;
3045 };
3046 template<typename _Tp>
3047 struct __is_pointer
3048 {
3049 enum { __value = 0 };
3050 typedef __false_type __type;
3051 };
3052 template<typename _Tp>
3053 struct __is_pointer<_Tp*>
3054 {
3055 enum { __value = 1 };
3056 typedef __true_type __type;
3057 };
3058 template<typename _Tp>
3059 struct __is_normal_iterator
3060 {
3061 enum { __value = 0 };
3062 typedef __false_type __type;
3063 };
3064 template<typename _Iterator, typename _Container>
3065 struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
3066 _Container> >
3067 {
3068 enum { __value = 1 };
3069 typedef __true_type __type;
3070 };
3071 template<typename _Tp>
3072 struct __is_arithmetic
3073 : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
3074 { };
3075 template<typename _Tp>
3076 struct __is_fundamental
3077 : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
3078 { };
3079 template<typename _Tp>
3080 struct __is_scalar
3081 : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
3082 { };
3083 template<typename _Tp>
3084 struct __is_char
3085 {
3086 enum { __value = 0 };
3087 typedef __false_type __type;
3088 };
3089 template<>
3090 struct __is_char<char>
3091 {
3092 enum { __value = 1 };
3093 typedef __true_type __type;
3094 };
3095 template<>
3096 struct __is_char<wchar_t>
3097 {
3098 enum { __value = 1 };
3099 typedef __true_type __type;
3100 };
3101 template<typename _Tp>
3102 struct __is_byte
3103 {
3104 enum { __value = 0 };
3105 typedef __false_type __type;
3106 };
3107 template<>
3108 struct __is_byte<char>
3109 {
3110 enum { __value = 1 };
3111 typedef __true_type __type;
3112 };
3113 template<>
3114 struct __is_byte<signed char>
3115 {
3116 enum { __value = 1 };
3117 typedef __true_type __type;
3118 };
3119 template<>
3120 struct __is_byte<unsigned char>
3121 {
3122 enum { __value = 1 };
3123 typedef __true_type __type;
3124 };
3125 template<typename _Tp>
3126 struct __is_move_iterator
3127 {
3128 enum { __value = 0 };
3129 typedef __false_type __type;
3130 };
3131 }
3132
3133 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
3134 template<bool, typename>
3135 struct __enable_if
3136 { };
3137 template<typename _Tp>
3138 struct __enable_if<true, _Tp>
3139 { typedef _Tp __type; };
3140 template<bool _Cond, typename _Iftrue, typename _Iffalse>
3141 struct __conditional_type
3142 { typedef _Iftrue __type; };
3143 template<typename _Iftrue, typename _Iffalse>
3144 struct __conditional_type<false, _Iftrue, _Iffalse>
3145 { typedef _Iffalse __type; };
3146 template<typename _Tp>
3147 struct __add_unsigned
3148 {
3149 private:
3150 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
3151 public:
3152 typedef typename __if_type::__type __type;
3153 };
3154 template<>
3155 struct __add_unsigned<char>
3156 { typedef unsigned char __type; };
3157 template<>
3158 struct __add_unsigned<signed char>
3159 { typedef unsigned char __type; };
3160 template<>
3161 struct __add_unsigned<short>
3162 { typedef unsigned short __type; };
3163 template<>
3164 struct __add_unsigned<int>
3165 { typedef unsigned int __type; };
3166 template<>
3167 struct __add_unsigned<long>
3168 { typedef unsigned long __type; };
3169 template<>
3170 struct __add_unsigned<long long>
3171 { typedef unsigned long long __type; };
3172 template<>
3173 struct __add_unsigned<bool>;
3174 template<>
3175 struct __add_unsigned<wchar_t>;
3176 template<typename _Tp>
3177 struct __remove_unsigned
3178 {
3179 private:
3180 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
3181 public:
3182 typedef typename __if_type::__type __type;
3183 };
3184 template<>
3185 struct __remove_unsigned<char>
3186 { typedef signed char __type; };
3187 template<>
3188 struct __remove_unsigned<unsigned char>
3189 { typedef signed char __type; };
3190 template<>
3191 struct __remove_unsigned<unsigned short>
3192 { typedef short __type; };
3193 template<>
3194 struct __remove_unsigned<unsigned int>
3195 { typedef int __type; };
3196 template<>
3197 struct __remove_unsigned<unsigned long>
3198 { typedef long __type; };
3199 template<>
3200 struct __remove_unsigned<unsigned long long>
3201 { typedef long long __type; };
3202 template<>
3203 struct __remove_unsigned<bool>;
3204 template<>
3205 struct __remove_unsigned<wchar_t>;
3206 template<typename _Type>
3207 inline bool
3208 __is_null_pointer(_Type* __ptr)
3209 { return __ptr == 0; }
3210 template<typename _Type>
3211 inline bool
3212 __is_null_pointer(_Type)
3213 { return false; }
3214 template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
3215 struct __promote
3216 { typedef double __type; };
3217 template<typename _Tp>
3218 struct __promote<_Tp, false>
3219 { typedef _Tp __type; };
3220 template<typename _Tp, typename _Up>
3221 struct __promote_2
3222 {
3223 private:
3224 typedef typename __promote<_Tp>::__type __type1;
3225 typedef typename __promote<_Up>::__type __type2;
3226 public:
3227 typedef __typeof__(__type1() + __type2()) __type;
3228 };
3229 template<typename _Tp, typename _Up, typename _Vp>
3230 struct __promote_3
3231 {
3232 private:
3233 typedef typename __promote<_Tp>::__type __type1;
3234 typedef typename __promote<_Up>::__type __type2;
3235 typedef typename __promote<_Vp>::__type __type3;
3236 public:
3237 typedef __typeof__(__type1() + __type2() + __type3()) __type;
3238 };
3239 template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
3240 struct __promote_4
3241 {
3242 private:
3243 typedef typename __promote<_Tp>::__type __type1;
3244 typedef typename __promote<_Up>::__type __type2;
3245 typedef typename __promote<_Vp>::__type __type3;
3246 typedef typename __promote<_Wp>::__type __type4;
3247 public:
3248 typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
3249 };
3250 }
3251
3252 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
3253 template<typename _Value>
3254 struct __numeric_traits_integer
3255 {
3256 static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
3257 static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
3258 static const bool __is_signed = ((_Value)(-1) < 0);
3259 static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
3260 };
3261 template<typename _Value>
3262 const _Value __numeric_traits_integer<_Value>::__min;
3263 template<typename _Value>
3264 const _Value __numeric_traits_integer<_Value>::__max;
3265 template<typename _Value>
3266 const bool __numeric_traits_integer<_Value>::__is_signed;
3267 template<typename _Value>
3268 const int __numeric_traits_integer<_Value>::__digits;
3269 template<typename _Value>
3270 struct __numeric_traits_floating
3271 {
3272 static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 64) * 3010 / 10000);
3273 static const bool __is_signed = true;
3274 static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 18);
3275 static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 4932);
3276 };
3277 template<typename _Value>
3278 const int __numeric_traits_floating<_Value>::__max_digits10;
3279 template<typename _Value>
3280 const bool __numeric_traits_floating<_Value>::__is_signed;
3281 template<typename _Value>
3282 const int __numeric_traits_floating<_Value>::__digits10;
3283 template<typename _Value>
3284 const int __numeric_traits_floating<_Value>::__max_exponent10;
3285 template<typename _Value>
3286 struct __numeric_traits
3287 : public __conditional_type<std::__is_integer<_Value>::__value,
3288 __numeric_traits_integer<_Value>,
3289 __numeric_traits_floating<_Value> >::__type
3290 { };
3291 }
3292
3293
3294 namespace std __attribute__ ((__visibility__ ("default"))) {
3295 template<typename _Tp>
3296 inline void
3297 swap(_Tp& __a, _Tp& __b)
3298 {
3299
3300 _Tp __tmp = (__a);
3301 __a = (__b);
3302 __b = (__tmp);
3303 }
3304 template<typename _Tp, size_t _Nm>
3305 inline void
3306 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
3307 {
3308 for (size_t __n = 0; __n < _Nm; ++__n)
3309 swap(__a[__n], __b[__n]);
3310 }
3311 }
3312 namespace std __attribute__ ((__visibility__ ("default"))) {
3313 template<class _T1, class _T2>
3314 struct pair
3315 {
3316 typedef _T1 first_type;
3317 typedef _T2 second_type;
3318 _T1 first;
3319 _T2 second;
3320 pair()
3321 : first(), second() { }
3322 pair(const _T1& __a, const _T2& __b)
3323 : first(__a), second(__b) { }
3324 template<class _U1, class _U2>
3325 pair(const pair<_U1, _U2>& __p)
3326 : first(__p.first),
3327 second(__p.second) { }
3328 };
3329 template<class _T1, class _T2>
3330 inline bool
3331 operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
3332 { return __x.first == __y.first && __x.second == __y.second; }
3333 template<class _T1, class _T2>
3334 inline bool
3335 operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
3336 { return __x.first < __y.first
3337 || (!(__y.first < __x.first) && __x.second < __y.second); }
3338 template<class _T1, class _T2>
3339 inline bool
3340 operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
3341 { return !(__x == __y); }
3342 template<class _T1, class _T2>
3343 inline bool
3344 operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
3345 { return __y < __x; }
3346 template<class _T1, class _T2>
3347 inline bool
3348 operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
3349 { return !(__y < __x); }
3350 template<class _T1, class _T2>
3351 inline bool
3352 operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
3353 { return !(__x < __y); }
3354 template<class _T1, class _T2>
3355 inline pair<_T1, _T2>
3356 make_pair(_T1 __x, _T2 __y)
3357 { return pair<_T1, _T2>(__x, __y); }
3358 }
3359
3360
3361 namespace std __attribute__ ((__visibility__ ("default"))) {
3362 struct input_iterator_tag { };
3363 struct output_iterator_tag { };
3364 struct forward_iterator_tag : public input_iterator_tag { };
3365 struct bidirectional_iterator_tag : public forward_iterator_tag { };
3366 struct random_access_iterator_tag : public bidirectional_iterator_tag { };
3367 template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
3368 typename _Pointer = _Tp*, typename _Reference = _Tp&>
3369 struct iterator
3370 {
3371 typedef _Category iterator_category;
3372 typedef _Tp value_type;
3373 typedef _Distance difference_type;
3374 typedef _Pointer pointer;
3375 typedef _Reference reference;
3376 };
3377 template<typename _Iterator>
3378 struct iterator_traits
3379 {
3380 typedef typename _Iterator::iterator_category iterator_category;
3381 typedef typename _Iterator::value_type value_type;
3382 typedef typename _Iterator::difference_type difference_type;
3383 typedef typename _Iterator::pointer pointer;
3384 typedef typename _Iterator::reference reference;
3385 };
3386 template<typename _Tp>
3387 struct iterator_traits<_Tp*>
3388 {
3389 typedef random_access_iterator_tag iterator_category;
3390 typedef _Tp value_type;
3391 typedef ptrdiff_t difference_type;
3392 typedef _Tp* pointer;
3393 typedef _Tp& reference;
3394 };
3395 template<typename _Tp>
3396 struct iterator_traits<const _Tp*>
3397 {
3398 typedef random_access_iterator_tag iterator_category;
3399 typedef _Tp value_type;
3400 typedef ptrdiff_t difference_type;
3401 typedef const _Tp* pointer;
3402 typedef const _Tp& reference;
3403 };
3404 template<typename _Iter>
3405 inline typename iterator_traits<_Iter>::iterator_category
3406 __iterator_category(const _Iter&)
3407 { return typename iterator_traits<_Iter>::iterator_category(); }
3408 }
3409
3410 namespace std __attribute__ ((__visibility__ ("default"))) {
3411 template<typename _InputIterator>
3412 inline typename iterator_traits<_InputIterator>::difference_type
3413 __distance(_InputIterator __first, _InputIterator __last,
3414 input_iterator_tag)
3415 {
3416
3417 typename iterator_traits<_InputIterator>::difference_type __n = 0;
3418 while (__first != __last)
3419 {
3420 ++__first;
3421 ++__n;
3422 }
3423 return __n;
3424 }
3425 template<typename _RandomAccessIterator>
3426 inline typename iterator_traits<_RandomAccessIterator>::difference_type
3427 __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
3428 random_access_iterator_tag)
3429 {
3430
3431 return __last - __first;
3432 }
3433 template<typename _InputIterator>
3434 inline typename iterator_traits<_InputIterator>::difference_type
3435 distance(_InputIterator __first, _InputIterator __last)
3436 {
3437 return std::__distance(__first, __last,
3438 std::__iterator_category(__first));
3439 }
3440 template<typename _InputIterator, typename _Distance>
3441 inline void
3442 __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
3443 {
3444
3445 while (__n--)
3446 ++__i;
3447 }
3448 template<typename _BidirectionalIterator, typename _Distance>
3449 inline void
3450 __advance(_BidirectionalIterator& __i, _Distance __n,
3451 bidirectional_iterator_tag)
3452 {
3453
3454 if (__n > 0)
3455 while (__n--)
3456 ++__i;
3457 else
3458 while (__n++)
3459 --__i;
3460 }
3461 template<typename _RandomAccessIterator, typename _Distance>
3462 inline void
3463 __advance(_RandomAccessIterator& __i, _Distance __n,
3464 random_access_iterator_tag)
3465 {
3466
3467 __i += __n;
3468 }
3469 template<typename _InputIterator, typename _Distance>
3470 inline void
3471 advance(_InputIterator& __i, _Distance __n)
3472 {
3473 typename iterator_traits<_InputIterator>::difference_type __d = __n;
3474 std::__advance(__i, __d, std::__iterator_category(__i));
3475 }
3476 }
3477 namespace std __attribute__ ((__visibility__ ("default"))) {
3478 template<typename _Iterator>
3479 class reverse_iterator
3480 : public iterator<typename iterator_traits<_Iterator>::iterator_category,
3481 typename iterator_traits<_Iterator>::value_type,
3482 typename iterator_traits<_Iterator>::difference_type,
3483 typename iterator_traits<_Iterator>::pointer,
3484 typename iterator_traits<_Iterator>::reference>
3485 {
3486 public:
3487 _Iterator current;
3488 typedef iterator_traits<_Iterator> __traits_type;
3489 public:
3490 typedef _Iterator iterator_type;
3491 typedef typename __traits_type::difference_type difference_type;
3492 typedef typename __traits_type::pointer pointer;
3493 typedef typename __traits_type::reference reference;
3494 reverse_iterator() : current() { }
3495 explicit
3496 reverse_iterator(iterator_type __x) : current(__x) { }
3497 reverse_iterator(const reverse_iterator& __x)
3498 : current(__x.current) { }
3499 template<typename _Iter>
3500 reverse_iterator(const reverse_iterator<_Iter>& __x)
3501 : current(__x.base()) { }
3502 iterator_type
3503 base() const
3504 { return current; }
3505 reference
3506 operator*() const
3507 {
3508 _Iterator __tmp = current;
3509 return *--__tmp;
3510 }
3511 pointer
3512 operator->() const
3513 { return &(operator*()); }
3514 reverse_iterator&
3515 operator++()
3516 {
3517 --current;
3518 return *this;
3519 }
3520 reverse_iterator
3521 operator++(int)
3522 {
3523 reverse_iterator __tmp = *this;
3524 --current;
3525 return __tmp;
3526 }
3527 reverse_iterator&
3528 operator--()
3529 {
3530 ++current;
3531 return *this;
3532 }
3533 reverse_iterator
3534 operator--(int)
3535 {
3536 reverse_iterator __tmp = *this;
3537 ++current;
3538 return __tmp;
3539 }
3540 reverse_iterator
3541 operator+(difference_type __n) const
3542 { return reverse_iterator(current - __n); }
3543 reverse_iterator&
3544 operator+=(difference_type __n)
3545 {
3546 current -= __n;
3547 return *this;
3548 }
3549 reverse_iterator
3550 operator-(difference_type __n) const
3551 { return reverse_iterator(current + __n); }
3552 reverse_iterator&
3553 operator-=(difference_type __n)
3554 {
3555 current += __n;
3556 return *this;
3557 }
3558 reference
3559 operator[](difference_type __n) const
3560 { return *(*this + __n); }
3561 };
3562 template<typename _Iterator>
3563 inline bool
3564 operator==(const reverse_iterator<_Iterator>& __x,
3565 const reverse_iterator<_Iterator>& __y)
3566 { return __x.base() == __y.base(); }
3567 template<typename _Iterator>
3568 inline bool
3569 operator<(const reverse_iterator<_Iterator>& __x,
3570 const reverse_iterator<_Iterator>& __y)
3571 { return __y.base() < __x.base(); }
3572 template<typename _Iterator>
3573 inline bool
3574 operator!=(const reverse_iterator<_Iterator>& __x,
3575 const reverse_iterator<_Iterator>& __y)
3576 { return !(__x == __y); }
3577 template<typename _Iterator>
3578 inline bool
3579 operator>(const reverse_iterator<_Iterator>& __x,
3580 const reverse_iterator<_Iterator>& __y)
3581 { return __y < __x; }
3582 template<typename _Iterator>
3583 inline bool
3584 operator<=(const reverse_iterator<_Iterator>& __x,
3585 const reverse_iterator<_Iterator>& __y)
3586 { return !(__y < __x); }
3587 template<typename _Iterator>
3588 inline bool
3589 operator>=(const reverse_iterator<_Iterator>& __x,
3590 const reverse_iterator<_Iterator>& __y)
3591 { return !(__x < __y); }
3592 template<typename _Iterator>
3593 inline typename reverse_iterator<_Iterator>::difference_type
3594 operator-(const reverse_iterator<_Iterator>& __x,
3595 const reverse_iterator<_Iterator>& __y)
3596 { return __y.base() - __x.base(); }
3597 template<typename _Iterator>
3598 inline reverse_iterator<_Iterator>
3599 operator+(typename reverse_iterator<_Iterator>::difference_type __n,
3600 const reverse_iterator<_Iterator>& __x)
3601 { return reverse_iterator<_Iterator>(__x.base() - __n); }
3602 template<typename _IteratorL, typename _IteratorR>
3603 inline bool
3604 operator==(const reverse_iterator<_IteratorL>& __x,
3605 const reverse_iterator<_IteratorR>& __y)
3606 { return __x.base() == __y.base(); }
3607 template<typename _IteratorL, typename _IteratorR>
3608 inline bool
3609 operator<(const reverse_iterator<_IteratorL>& __x,
3610 const reverse_iterator<_IteratorR>& __y)
3611 { return __y.base() < __x.base(); }
3612 template<typename _IteratorL, typename _IteratorR>
3613 inline bool
3614 operator!=(const reverse_iterator<_IteratorL>& __x,
3615 const reverse_iterator<_IteratorR>& __y)
3616 { return !(__x == __y); }
3617 template<typename _IteratorL, typename _IteratorR>
3618 inline bool
3619 operator>(const reverse_iterator<_IteratorL>& __x,
3620 const reverse_iterator<_IteratorR>& __y)
3621 { return __y < __x; }
3622 template<typename _IteratorL, typename _IteratorR>
3623 inline bool
3624 operator<=(const reverse_iterator<_IteratorL>& __x,
3625 const reverse_iterator<_IteratorR>& __y)
3626 { return !(__y < __x); }
3627 template<typename _IteratorL, typename _IteratorR>
3628 inline bool
3629 operator>=(const reverse_iterator<_IteratorL>& __x,
3630 const reverse_iterator<_IteratorR>& __y)
3631 { return !(__x < __y); }
3632 template<typename _IteratorL, typename _IteratorR>
3633 inline typename reverse_iterator<_IteratorL>::difference_type
3634 operator-(const reverse_iterator<_IteratorL>& __x,
3635 const reverse_iterator<_IteratorR>& __y)
3636 { return __y.base() - __x.base(); }
3637 template<typename _Container>
3638 class back_insert_iterator
3639 : public iterator<output_iterator_tag, void, void, void, void>
3640 {
3641 public:
3642 _Container* container;
3643 public:
3644 typedef _Container container_type;
3645 explicit
3646 back_insert_iterator(_Container& __x) : container(&__x) { }
3647 back_insert_iterator&
3648 operator=(typename _Container::const_reference __value)
3649 {
3650 container->push_back(__value);
3651 return *this;
3652 }
3653 back_insert_iterator&
3654 operator*()
3655 { return *this; }
3656 back_insert_iterator&
3657 operator++()
3658 { return *this; }
3659 back_insert_iterator
3660 operator++(int)
3661 { return *this; }
3662 };
3663 template<typename _Container>
3664 inline back_insert_iterator<_Container>
3665 back_inserter(_Container& __x)
3666 { return back_insert_iterator<_Container>(__x); }
3667 template<typename _Container>
3668 class front_insert_iterator
3669 : public iterator<output_iterator_tag, void, void, void, void>
3670 {
3671 public:
3672 _Container* container;
3673 public:
3674 typedef _Container container_type;
3675 explicit front_insert_iterator(_Container& __x) : container(&__x) { }
3676 front_insert_iterator&
3677 operator=(typename _Container::const_reference __value)
3678 {
3679 container->push_front(__value);
3680 return *this;
3681 }
3682 front_insert_iterator&
3683 operator*()
3684 { return *this; }
3685 front_insert_iterator&
3686 operator++()
3687 { return *this; }
3688 front_insert_iterator
3689 operator++(int)
3690 { return *this; }
3691 };
3692 template<typename _Container>
3693 inline front_insert_iterator<_Container>
3694 front_inserter(_Container& __x)
3695 { return front_insert_iterator<_Container>(__x); }
3696 template<typename _Container>
3697 class insert_iterator
3698 : public iterator<output_iterator_tag, void, void, void, void>
3699 {
3700 public:
3701 _Container* container;
3702 typename _Container::iterator iter;
3703 public:
3704 typedef _Container container_type;
3705 insert_iterator(_Container& __x, typename _Container::iterator __i)
3706 : container(&__x), iter(__i) {}
3707 insert_iterator&
3708 operator=(typename _Container::const_reference __value)
3709 {
3710 iter = container->insert(iter, __value);
3711 ++iter;
3712 return *this;
3713 }
3714 insert_iterator&
3715 operator*()
3716 { return *this; }
3717 insert_iterator&
3718 operator++()
3719 { return *this; }
3720 insert_iterator&
3721 operator++(int)
3722 { return *this; }
3723 };
3724 template<typename _Container, typename _Iterator>
3725 inline insert_iterator<_Container>
3726 inserter(_Container& __x, _Iterator __i)
3727 {
3728 return insert_iterator<_Container>(__x,
3729 typename _Container::iterator(__i));
3730 }
3731 }
3732 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
3733 using std::iterator_traits;
3734 using std::iterator;
3735 template<typename _Iterator, typename _Container>
3736 class __normal_iterator
3737 {
3738 public:
3739 _Iterator _M_current;
3740 typedef iterator_traits<_Iterator> __traits_type;
3741 public:
3742 typedef _Iterator iterator_type;
3743 typedef typename __traits_type::iterator_category iterator_category;
3744 typedef typename __traits_type::value_type value_type;
3745 typedef typename __traits_type::difference_type difference_type;
3746 typedef typename __traits_type::reference reference;
3747 typedef typename __traits_type::pointer pointer;
3748 __normal_iterator() : _M_current(_Iterator()) { }
3749 explicit
3750 __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
3751 template<typename _Iter>
3752 __normal_iterator(const __normal_iterator<_Iter,
3753 typename __enable_if<
3754 (std::__are_same<_Iter, typename _Container::pointer>::__value),
3755 _Container>::__type>& __i)
3756 : _M_current(__i.base()) { }
3757 reference
3758 operator*() const
3759 { return *_M_current; }
3760 pointer
3761 operator->() const
3762 { return _M_current; }
3763 __normal_iterator&
3764 operator++()
3765 {
3766 ++_M_current;
3767 return *this;
3768 }
3769 __normal_iterator
3770 operator++(int)
3771 { return __normal_iterator(_M_current++); }
3772 __normal_iterator&
3773 operator--()
3774 {
3775 --_M_current;
3776 return *this;
3777 }
3778 __normal_iterator
3779 operator--(int)
3780 { return __normal_iterator(_M_current--); }
3781 reference
3782 operator[](const difference_type& __n) const
3783 { return _M_current[__n]; }
3784 __normal_iterator&
3785 operator+=(const difference_type& __n)
3786 { _M_current += __n; return *this; }
3787 __normal_iterator
3788 operator+(const difference_type& __n) const
3789 { return __normal_iterator(_M_current + __n); }
3790 __normal_iterator&
3791 operator-=(const difference_type& __n)
3792 { _M_current -= __n; return *this; }
3793 __normal_iterator
3794 operator-(const difference_type& __n) const
3795 { return __normal_iterator(_M_current - __n); }
3796 const _Iterator&
3797 base() const
3798 { return _M_current; }
3799 };
3800 template<typename _IteratorL, typename _IteratorR, typename _Container>
3801 inline bool
3802 operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
3803 const __normal_iterator<_IteratorR, _Container>& __rhs)
3804 { return __lhs.base() == __rhs.base(); }
3805 template<typename _Iterator, typename _Container>
3806 inline bool
3807 operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
3808 const __normal_iterator<_Iterator, _Container>& __rhs)
3809 { return __lhs.base() == __rhs.base(); }
3810 template<typename _IteratorL, typename _IteratorR, typename _Container>
3811 inline bool
3812 operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
3813 const __normal_iterator<_IteratorR, _Container>& __rhs)
3814 { return __lhs.base() != __rhs.base(); }
3815 template<typename _Iterator, typename _Container>
3816 inline bool
3817 operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
3818 const __normal_iterator<_Iterator, _Container>& __rhs)
3819 { return __lhs.base() != __rhs.base(); }
3820 template<typename _IteratorL, typename _IteratorR, typename _Container>
3821 inline bool
3822 operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
3823 const __normal_iterator<_IteratorR, _Container>& __rhs)
3824 { return __lhs.base() < __rhs.base(); }
3825 template<typename _Iterator, typename _Container>
3826 inline bool
3827 operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
3828 const __normal_iterator<_Iterator, _Container>& __rhs)
3829 { return __lhs.base() < __rhs.base(); }
3830 template<typename _IteratorL, typename _IteratorR, typename _Container>
3831 inline bool
3832 operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
3833 const __normal_iterator<_IteratorR, _Container>& __rhs)
3834 { return __lhs.base() > __rhs.base(); }
3835 template<typename _Iterator, typename _Container>
3836 inline bool
3837 operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
3838 const __normal_iterator<_Iterator, _Container>& __rhs)
3839 { return __lhs.base() > __rhs.base(); }
3840 template<typename _IteratorL, typename _IteratorR, typename _Container>
3841 inline bool
3842 operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
3843 const __normal_iterator<_IteratorR, _Container>& __rhs)
3844 { return __lhs.base() <= __rhs.base(); }
3845 template<typename _Iterator, typename _Container>
3846 inline bool
3847 operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
3848 const __normal_iterator<_Iterator, _Container>& __rhs)
3849 { return __lhs.base() <= __rhs.base(); }
3850 template<typename _IteratorL, typename _IteratorR, typename _Container>
3851 inline bool
3852 operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
3853 const __normal_iterator<_IteratorR, _Container>& __rhs)
3854 { return __lhs.base() >= __rhs.base(); }
3855 template<typename _Iterator, typename _Container>
3856 inline bool
3857 operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
3858 const __normal_iterator<_Iterator, _Container>& __rhs)
3859 { return __lhs.base() >= __rhs.base(); }
3860 template<typename _IteratorL, typename _IteratorR, typename _Container>
3861 inline typename __normal_iterator<_IteratorL, _Container>::difference_type
3862 operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
3863 const __normal_iterator<_IteratorR, _Container>& __rhs)
3864 { return __lhs.base() - __rhs.base(); }
3865 template<typename _Iterator, typename _Container>
3866 inline typename __normal_iterator<_Iterator, _Container>::difference_type
3867 operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
3868 const __normal_iterator<_Iterator, _Container>& __rhs)
3869 { return __lhs.base() - __rhs.base(); }
3870 template<typename _Iterator, typename _Container>
3871 inline __normal_iterator<_Iterator, _Container>
3872 operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
3873 __n, const __normal_iterator<_Iterator, _Container>& __i)
3874 { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
3875 }
3876 namespace std
3877 {
3878 namespace __debug { }
3879 }
3880 namespace __gnu_debug
3881 {
3882 using namespace std::__debug;
3883 }
3884 namespace std __attribute__ ((__visibility__ ("default"))) {
3885 template<bool _BoolType>
3886 struct __iter_swap
3887 {
3888 template<typename _ForwardIterator1, typename _ForwardIterator2>
3889 static void
3890 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
3891 {
3892 typedef typename iterator_traits<_ForwardIterator1>::value_type
3893 _ValueType1;
3894 _ValueType1 __tmp = (*__a);
3895 *__a = (*__b);
3896 *__b = (__tmp);
3897 }
3898 };
3899 template<>
3900 struct __iter_swap<true>
3901 {
3902 template<typename _ForwardIterator1, typename _ForwardIterator2>
3903 static void
3904 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
3905 {
3906 swap(*__a, *__b);
3907 }
3908 };
3909 template<typename _ForwardIterator1, typename _ForwardIterator2>
3910 inline void
3911 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
3912 {
3913 typedef typename iterator_traits<_ForwardIterator1>::value_type
3914 _ValueType1;
3915 typedef typename iterator_traits<_ForwardIterator2>::value_type
3916 _ValueType2;
3917
3918
3919
3920
3921 typedef typename iterator_traits<_ForwardIterator1>::reference
3922 _ReferenceType1;
3923 typedef typename iterator_traits<_ForwardIterator2>::reference
3924 _ReferenceType2;
3925 std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
3926 && __are_same<_ValueType1&, _ReferenceType1>::__value
3927 && __are_same<_ValueType2&, _ReferenceType2>::__value>::
3928 iter_swap(__a, __b);
3929 }
3930 template<typename _ForwardIterator1, typename _ForwardIterator2>
3931 _ForwardIterator2
3932 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
3933 _ForwardIterator2 __first2)
3934 {
3935
3936
3937 ;
3938 for (; __first1 != __last1; ++__first1, ++__first2)
3939 std::iter_swap(__first1, __first2);
3940 return __first2;
3941 }
3942 template<typename _Tp>
3943 inline const _Tp&
3944 min(const _Tp& __a, const _Tp& __b)
3945 {
3946
3947 if (__b < __a)
3948 return __b;
3949 return __a;
3950 }
3951 template<typename _Tp>
3952 inline const _Tp&
3953 max(const _Tp& __a, const _Tp& __b)
3954 {
3955
3956 if (__a < __b)
3957 return __b;
3958 return __a;
3959 }
3960 template<typename _Tp, typename _Compare>
3961 inline const _Tp&
3962 min(const _Tp& __a, const _Tp& __b, _Compare __comp)
3963 {
3964 if (__comp(__b, __a))
3965 return __b;
3966 return __a;
3967 }
3968 template<typename _Tp, typename _Compare>
3969 inline const _Tp&
3970 max(const _Tp& __a, const _Tp& __b, _Compare __comp)
3971 {
3972 if (__comp(__a, __b))
3973 return __b;
3974 return __a;
3975 }
3976 template<typename _Iterator, bool _HasBase>
3977 struct _Iter_base
3978 {
3979 typedef _Iterator iterator_type;
3980 static iterator_type
3981 _S_base(_Iterator __it)
3982 { return __it; }
3983 };
3984 template<typename _Iterator>
3985 struct _Iter_base<_Iterator, true>
3986 {
3987 typedef typename _Iterator::iterator_type iterator_type;
3988 static iterator_type
3989 _S_base(_Iterator __it)
3990 { return __it.base(); }
3991 };
3992 template<typename _Iterator>
3993 struct _Niter_base
3994 : _Iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value>
3995 { };
3996 template<typename _Iterator>
3997 inline typename _Niter_base<_Iterator>::iterator_type
3998 __niter_base(_Iterator __it)
3999 { return std::_Niter_base<_Iterator>::_S_base(__it); }
4000 template<typename _Iterator>
4001 struct _Miter_base
4002 : _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
4003 { };
4004 template<typename _Iterator>
4005 inline typename _Miter_base<_Iterator>::iterator_type
4006 __miter_base(_Iterator __it)
4007 { return std::_Miter_base<_Iterator>::_S_base(__it); }
4008 template<bool, bool, typename>
4009 struct __copy_move
4010 {
4011 template<typename _II, typename _OI>
4012 static _OI
4013 __copy_m(_II __first, _II __last, _OI __result)
4014 {
4015 for (; __first != __last; ++__result, ++__first)
4016 *__result = *__first;
4017 return __result;
4018 }
4019 };
4020 template<>
4021 struct __copy_move<false, false, random_access_iterator_tag>
4022 {
4023 template<typename _II, typename _OI>
4024 static _OI
4025 __copy_m(_II __first, _II __last, _OI __result)
4026 {
4027 typedef typename iterator_traits<_II>::difference_type _Distance;
4028 for(_Distance __n = __last - __first; __n > 0; --__n)
4029 {
4030 *__result = *__first;
4031 ++__first;
4032 ++__result;
4033 }
4034 return __result;
4035 }
4036 };
4037 template<bool _IsMove>
4038 struct __copy_move<_IsMove, true, random_access_iterator_tag>
4039 {
4040 template<typename _Tp>
4041 static _Tp*
4042 __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
4043 {
4044 const ptrdiff_t _Num = __last - __first;
4045 if (_Num)
4046 __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
4047 return __result + _Num;
4048 }
4049 };
4050 template<bool _IsMove, typename _II, typename _OI>
4051 inline _OI
4052 __copy_move_a(_II __first, _II __last, _OI __result)
4053 {
4054 typedef typename iterator_traits<_II>::value_type _ValueTypeI;
4055 typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
4056 typedef typename iterator_traits<_II>::iterator_category _Category;
4057 const bool __simple = (__is_pod(_ValueTypeI)
4058 && __is_pointer<_II>::__value
4059 && __is_pointer<_OI>::__value
4060 && __are_same<_ValueTypeI, _ValueTypeO>::__value);
4061 return std::__copy_move<_IsMove, __simple,
4062 _Category>::__copy_m(__first, __last, __result);
4063 }
4064 template<typename _CharT>
4065 struct char_traits;
4066 template<typename _CharT, typename _Traits>
4067 class istreambuf_iterator;
4068 template<typename _CharT, typename _Traits>
4069 class ostreambuf_iterator;
4070 template<bool _IsMove, typename _CharT>
4071 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
4072 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
4073 __copy_move_a2(_CharT*, _CharT*,
4074 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
4075 template<bool _IsMove, typename _CharT>
4076 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
4077 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
4078 __copy_move_a2(const _CharT*, const _CharT*,
4079 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
4080 template<bool _IsMove, typename _CharT>
4081 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
4082 _CharT*>::__type
4083 __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
4084 istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
4085 template<bool _IsMove, typename _II, typename _OI>
4086 inline _OI
4087 __copy_move_a2(_II __first, _II __last, _OI __result)
4088 {
4089 return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first),
4090 std::__niter_base(__last),
4091 std::__niter_base(__result)));
4092 }
4093 template<typename _II, typename _OI>
4094 inline _OI
4095 copy(_II __first, _II __last, _OI __result)
4096 {
4097
4098
4099 ;
4100 return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
4101 (std::__miter_base(__first), std::__miter_base(__last),
4102 __result));
4103 }
4104 template<bool, bool, typename>
4105 struct __copy_move_backward
4106 {
4107 template<typename _BI1, typename _BI2>
4108 static _BI2
4109 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
4110 {
4111 while (__first != __last)
4112 *--__result = *--__last;
4113 return __result;
4114 }
4115 };
4116 template<>
4117 struct __copy_move_backward<false, false, random_access_iterator_tag>
4118 {
4119 template<typename _BI1, typename _BI2>
4120 static _BI2
4121 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
4122 {
4123 typename iterator_traits<_BI1>::difference_type __n;
4124 for (__n = __last - __first; __n > 0; --__n)
4125 *--__result = *--__last;
4126 return __result;
4127 }
4128 };
4129 template<bool _IsMove>
4130 struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
4131 {
4132 template<typename _Tp>
4133 static _Tp*
4134 __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
4135 {
4136 const ptrdiff_t _Num = __last - __first;
4137 if (_Num)
4138 __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
4139 return __result - _Num;
4140 }
4141 };
4142 template<bool _IsMove, typename _BI1, typename _BI2>
4143 inline _BI2
4144 __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
4145 {
4146 typedef typename iterator_traits<_BI1>::value_type _ValueType1;
4147 typedef typename iterator_traits<_BI2>::value_type _ValueType2;
4148 typedef typename iterator_traits<_BI1>::iterator_category _Category;
4149 const bool __simple = (__is_pod(_ValueType1)
4150 && __is_pointer<_BI1>::__value
4151 && __is_pointer<_BI2>::__value
4152 && __are_same<_ValueType1, _ValueType2>::__value);
4153 return std::__copy_move_backward<_IsMove, __simple,
4154 _Category>::__copy_move_b(__first,
4155 __last,
4156 __result);
4157 }
4158 template<bool _IsMove, typename _BI1, typename _BI2>
4159 inline _BI2
4160 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
4161 {
4162 return _BI2(std::__copy_move_backward_a<_IsMove>
4163 (std::__niter_base(__first), std::__niter_base(__last),
4164 std::__niter_base(__result)));
4165 }
4166 template<typename _BI1, typename _BI2>
4167 inline _BI2
4168 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
4169 {
4170
4171
4172
4173 ;
4174 return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
4175 (std::__miter_base(__first), std::__miter_base(__last),
4176 __result));
4177 }
4178 template<typename _ForwardIterator, typename _Tp>
4179 inline typename
4180 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
4181 __fill_a(_ForwardIterator __first, _ForwardIterator __last,
4182 const _Tp& __value)
4183 {
4184 for (; __first != __last; ++__first)
4185 *__first = __value;
4186 }
4187 template<typename _ForwardIterator, typename _Tp>
4188 inline typename
4189 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
4190 __fill_a(_ForwardIterator __first, _ForwardIterator __last,
4191 const _Tp& __value)
4192 {
4193 const _Tp __tmp = __value;
4194 for (; __first != __last; ++__first)
4195 *__first = __tmp;
4196 }
4197 template<typename _Tp>
4198 inline typename
4199 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
4200 __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
4201 {
4202 const _Tp __tmp = __c;
4203 __builtin_memset(__first, static_cast<unsigned char>(__tmp),
4204 __last - __first);
4205 }
4206 template<typename _ForwardIterator, typename _Tp>
4207 inline void
4208 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
4209 {
4210
4211 ;
4212 std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),
4213 __value);
4214 }
4215 template<typename _OutputIterator, typename _Size, typename _Tp>
4216 inline typename
4217 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
4218 __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
4219 {
4220 for (; __n > 0; --__n, ++__first)
4221 *__first = __value;
4222 return __first;
4223 }
4224 template<typename _OutputIterator, typename _Size, typename _Tp>
4225 inline typename
4226 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
4227 __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
4228 {
4229 const _Tp __tmp = __value;
4230 for (; __n > 0; --__n, ++__first)
4231 *__first = __tmp;
4232 return __first;
4233 }
4234 template<typename _Size, typename _Tp>
4235 inline typename
4236 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
4237 __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
4238 {
4239 std::__fill_a(__first, __first + __n, __c);
4240 return __first + __n;
4241 }
4242 template<typename _OI, typename _Size, typename _Tp>
4243 inline _OI
4244 fill_n(_OI __first, _Size __n, const _Tp& __value)
4245 {
4246
4247 return _OI(std::__fill_n_a(std::__niter_base(__first), __n, __value));
4248 }
4249 template<bool _BoolType>
4250 struct __equal
4251 {
4252 template<typename _II1, typename _II2>
4253 static bool
4254 equal(_II1 __first1, _II1 __last1, _II2 __first2)
4255 {
4256 for (; __first1 != __last1; ++__first1, ++__first2)
4257 if (!(*__first1 == *__first2))
4258 return false;
4259 return true;
4260 }
4261 };
4262 template<>
4263 struct __equal<true>
4264 {
4265 template<typename _Tp>
4266 static bool
4267 equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
4268 {
4269 return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
4270 * (__last1 - __first1));
4271 }
4272 };
4273 template<typename _II1, typename _II2>
4274 inline bool
4275 __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
4276 {
4277 typedef typename iterator_traits<_II1>::value_type _ValueType1;
4278 typedef typename iterator_traits<_II2>::value_type _ValueType2;
4279 const bool __simple = (__is_integer<_ValueType1>::__value
4280 && __is_pointer<_II1>::__value
4281 && __is_pointer<_II2>::__value
4282 && __are_same<_ValueType1, _ValueType2>::__value);
4283 return std::__equal<__simple>::equal(__first1, __last1, __first2);
4284 }
4285 template<typename, typename>
4286 struct __lc_rai
4287 {
4288 template<typename _II1, typename _II2>
4289 static _II1
4290 __newlast1(_II1, _II1 __last1, _II2, _II2)
4291 { return __last1; }
4292 template<typename _II>
4293 static bool
4294 __cnd2(_II __first, _II __last)
4295 { return __first != __last; }
4296 };
4297 template<>
4298 struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
4299 {
4300 template<typename _RAI1, typename _RAI2>
4301 static _RAI1
4302 __newlast1(_RAI1 __first1, _RAI1 __last1,
4303 _RAI2 __first2, _RAI2 __last2)
4304 {
4305 const typename iterator_traits<_RAI1>::difference_type
4306 __diff1 = __last1 - __first1;
4307 const typename iterator_traits<_RAI2>::difference_type
4308 __diff2 = __last2 - __first2;
4309 return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
4310 }
4311 template<typename _RAI>
4312 static bool
4313 __cnd2(_RAI, _RAI)
4314 { return true; }
4315 };
4316 template<bool _BoolType>
4317 struct __lexicographical_compare
4318 {
4319 template<typename _II1, typename _II2>
4320 static bool __lc(_II1, _II1, _II2, _II2);
4321 };
4322 template<bool _BoolType>
4323 template<typename _II1, typename _II2>
4324 bool
4325 __lexicographical_compare<_BoolType>::
4326 __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
4327 {
4328 typedef typename iterator_traits<_II1>::iterator_category _Category1;
4329 typedef typename iterator_traits<_II2>::iterator_category _Category2;
4330 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
4331 __last1 = __rai_type::__newlast1(__first1, __last1,
4332 __first2, __last2);
4333 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
4334 ++__first1, ++__first2)
4335 {
4336 if (*__first1 < *__first2)
4337 return true;
4338 if (*__first2 < *__first1)
4339 return false;
4340 }
4341 return __first1 == __last1 && __first2 != __last2;
4342 }
4343 template<>
4344 struct __lexicographical_compare<true>
4345 {
4346 template<typename _Tp, typename _Up>
4347 static bool
4348 __lc(const _Tp* __first1, const _Tp* __last1,
4349 const _Up* __first2, const _Up* __last2)
4350 {
4351 const size_t __len1 = __last1 - __first1;
4352 const size_t __len2 = __last2 - __first2;
4353 const int __result = __builtin_memcmp(__first1, __first2,
4354 std::min(__len1, __len2));
4355 return __result != 0 ? __result < 0 : __len1 < __len2;
4356 }
4357 };
4358 template<typename _II1, typename _II2>
4359 inline bool
4360 __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
4361 _II2 __first2, _II2 __last2)
4362 {
4363 typedef typename iterator_traits<_II1>::value_type _ValueType1;
4364 typedef typename iterator_traits<_II2>::value_type _ValueType2;
4365 const bool __simple =
4366 (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
4367 && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
4368 && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
4369 && __is_pointer<_II1>::__value
4370 && __is_pointer<_II2>::__value);
4371 return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
4372 __first2, __last2);
4373 }
4374 template<typename _ForwardIterator, typename _Tp>
4375 _ForwardIterator
4376 lower_bound(_ForwardIterator __first, _ForwardIterator __last,
4377 const _Tp& __val)
4378 {
4379 typedef typename iterator_traits<_ForwardIterator>::value_type
4380 _ValueType;
4381 typedef typename iterator_traits<_ForwardIterator>::difference_type
4382 _DistanceType;
4383
4384
4385 ;
4386 _DistanceType __len = std::distance(__first, __last);
4387 _DistanceType __half;
4388 _ForwardIterator __middle;
4389 while (__len > 0)
4390 {
4391 __half = __len >> 1;
4392 __middle = __first;
4393 std::advance(__middle, __half);
4394 if (*__middle < __val)
4395 {
4396 __first = __middle;
4397 ++__first;
4398 __len = __len - __half - 1;
4399 }
4400 else
4401 __len = __half;
4402 }
4403 return __first;
4404 }
4405 template<typename _Size>
4406 inline _Size
4407 __lg(_Size __n)
4408 {
4409 _Size __k;
4410 for (__k = 0; __n != 0; __n >>= 1)
4411 ++__k;
4412 return __k - 1;
4413 }
4414 inline int
4415 __lg(int __n)
4416 { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
4417 inline long
4418 __lg(long __n)
4419 { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
4420 inline long long
4421 __lg(long long __n)
4422 { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
4423 }
4424 namespace std __attribute__ ((__visibility__ ("default"))) {
4425 template<typename _II1, typename _II2>
4426 inline bool
4427 equal(_II1 __first1, _II1 __last1, _II2 __first2)
4428 {
4429
4430
4431
4432 ;
4433 return std::__equal_aux(std::__niter_base(__first1),
4434 std::__niter_base(__last1),
4435 std::__niter_base(__first2));
4436 }
4437 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
4438 inline bool
4439 equal(_IIter1 __first1, _IIter1 __last1,
4440 _IIter2 __first2, _BinaryPredicate __binary_pred)
4441 {
4442
4443
4444 ;
4445 for (; __first1 != __last1; ++__first1, ++__first2)
4446 if (!bool(__binary_pred(*__first1, *__first2)))
4447 return false;
4448 return true;
4449 }
4450 template<typename _II1, typename _II2>
4451 inline bool
4452 lexicographical_compare(_II1 __first1, _II1 __last1,
4453 _II2 __first2, _II2 __last2)
4454 {
4455 typedef typename iterator_traits<_II1>::value_type _ValueType1;
4456 typedef typename iterator_traits<_II2>::value_type _ValueType2;
4457
4458
4459
4460
4461 ;
4462 ;
4463 return std::__lexicographical_compare_aux(std::__niter_base(__first1),
4464 std::__niter_base(__last1),
4465 std::__niter_base(__first2),
4466 std::__niter_base(__last2));
4467 }
4468 template<typename _II1, typename _II2, typename _Compare>
4469 bool
4470 lexicographical_compare(_II1 __first1, _II1 __last1,
4471 _II2 __first2, _II2 __last2, _Compare __comp)
4472 {
4473 typedef typename iterator_traits<_II1>::iterator_category _Category1;
4474 typedef typename iterator_traits<_II2>::iterator_category _Category2;
4475 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
4476
4477
4478 ;
4479 ;
4480 __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
4481 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
4482 ++__first1, ++__first2)
4483 {
4484 if (__comp(*__first1, *__first2))
4485 return true;
4486 if (__comp(*__first2, *__first1))
4487 return false;
4488 }
4489 return __first1 == __last1 && __first2 != __last2;
4490 }
4491 template<typename _InputIterator1, typename _InputIterator2>
4492 pair<_InputIterator1, _InputIterator2>
4493 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
4494 _InputIterator2 __first2)
4495 {
4496
4497
4498
4499 ;
4500 while (__first1 != __last1 && *__first1 == *__first2)
4501 {
4502 ++__first1;
4503 ++__first2;
4504 }
4505 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
4506 }
4507 template<typename _InputIterator1, typename _InputIterator2,
4508 typename _BinaryPredicate>
4509 pair<_InputIterator1, _InputIterator2>
4510 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
4511 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
4512 {
4513
4514
4515 ;
4516 while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
4517 {
4518 ++__first1;
4519 ++__first2;
4520 }
4521 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
4522 }
4523 }
4524
4525
4526
4527 struct _IO_FILE;
4528 typedef struct _IO_FILE FILE;
4529 typedef struct _IO_FILE __FILE;
4530 typedef unsigned int wint_t;
4531 typedef struct
4532 {
4533 int __count;
4534 union
4535 {
4536 unsigned int __wch;
4537 char __wchb[4];
4538 } __value;
4539 } __mbstate_t;
4540 typedef __mbstate_t mbstate_t;
4541 extern "C" {
4542 struct tm;
4543 extern wchar_t *wcscpy (wchar_t *__restrict __dest,
4544 __const wchar_t *__restrict __src) throw ();
4545 extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
4546 __const wchar_t *__restrict __src, size_t __n)
4547 throw ();
4548 extern wchar_t *wcscat (wchar_t *__restrict __dest,
4549 __const wchar_t *__restrict __src) throw ();
4550 extern wchar_t *wcsncat (wchar_t *__restrict __dest,
4551 __const wchar_t *__restrict __src, size_t __n)
4552 throw ();
4553 extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
4554 throw () __attribute__ ((__pure__));
4555 extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
4556 throw () __attribute__ ((__pure__));
4557 extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) throw ();
4558 extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
4559 size_t __n) throw ();
4560 extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
4561 __locale_t __loc) throw ();
4562 extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
4563 size_t __n, __locale_t __loc) throw ();
4564 extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) throw ();
4565 extern size_t wcsxfrm (wchar_t *__restrict __s1,
4566 __const wchar_t *__restrict __s2, size_t __n) throw ();
4567 extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
4568 __locale_t __loc) throw ();
4569 extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
4570 size_t __n, __locale_t __loc) throw ();
4571 extern wchar_t *wcsdup (__const wchar_t *__s) throw () __attribute__ ((__malloc__));
4572 extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
4573 throw () __asm ("wcschr") __attribute__ ((__pure__));
4574 extern "C++" __const wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
4575 throw () __asm ("wcschr") __attribute__ ((__pure__));
4576 extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
4577 throw () __asm ("wcsrchr") __attribute__ ((__pure__));
4578 extern "C++" __const wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
4579 throw () __asm ("wcsrchr") __attribute__ ((__pure__));
4580 extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
4581 throw () __attribute__ ((__pure__));
4582 extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
4583 throw () __attribute__ ((__pure__));
4584 extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
4585 throw () __attribute__ ((__pure__));
4586 extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, __const wchar_t *__accept)
4587 throw () __asm ("wcspbrk") __attribute__ ((__pure__));
4588 extern "C++" __const wchar_t *wcspbrk (__const wchar_t *__wcs,
4589 __const wchar_t *__accept)
4590 throw () __asm ("wcspbrk") __attribute__ ((__pure__));
4591 extern "C++" wchar_t *wcsstr (wchar_t *__haystack, __const wchar_t *__needle)
4592 throw () __asm ("wcsstr") __attribute__ ((__pure__));
4593 extern "C++" __const wchar_t *wcsstr (__const wchar_t *__haystack,
4594 __const wchar_t *__needle)
4595 throw () __asm ("wcsstr") __attribute__ ((__pure__));
4596 extern wchar_t *wcstok (wchar_t *__restrict __s,
4597 __const wchar_t *__restrict __delim,
4598 wchar_t **__restrict __ptr) throw ();
4599 extern size_t wcslen (__const wchar_t *__s) throw () __attribute__ ((__pure__));
4600 extern "C++" wchar_t *wcswcs (wchar_t *__haystack, __const wchar_t *__needle)
4601 throw () __asm ("wcswcs") __attribute__ ((__pure__));
4602 extern "C++" __const wchar_t *wcswcs (__const wchar_t *__haystack,
4603 __const wchar_t *__needle)
4604 throw () __asm ("wcswcs") __attribute__ ((__pure__));
4605 extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
4606 throw () __attribute__ ((__pure__));
4607 extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
4608 throw () __asm ("wmemchr") __attribute__ ((__pure__));
4609 extern "C++" __const wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c,
4610 size_t __n)
4611 throw () __asm ("wmemchr") __attribute__ ((__pure__));
4612 extern int wmemcmp (__const wchar_t *__restrict __s1,
4613 __const wchar_t *__restrict __s2, size_t __n)
4614 throw () __attribute__ ((__pure__));
4615 extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
4616 __const wchar_t *__restrict __s2, size_t __n) throw ();
4617 extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
4618 throw ();
4619 extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw ();
4620 extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
4621 __const wchar_t *__restrict __s2, size_t __n)
4622 throw ();
4623 extern wint_t btowc (int __c) throw ();
4624 extern int wctob (wint_t __c) throw ();
4625 extern int mbsinit (__const mbstate_t *__ps) throw () __attribute__ ((__pure__));
4626 extern size_t mbrtowc (wchar_t *__restrict __pwc,
4627 __const char *__restrict __s, size_t __n,
4628 mbstate_t *__p) throw ();
4629 extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
4630 mbstate_t *__restrict __ps) throw ();
4631 extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
4632 mbstate_t *__restrict __ps) throw ();
4633 extern size_t mbrlen (__const char *__restrict __s, size_t __n,
4634 mbstate_t *__restrict __ps) throw ();
4635 extern wint_t __btowc_alias (int __c) __asm ("btowc");
4636 extern __inline __attribute__ ((__gnu_inline__)) wint_t
4637 btowc (int __c) throw ()
4638 { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
4639 ? (wint_t) __c : __btowc_alias (__c)); }
4640 extern int __wctob_alias (wint_t __c) __asm ("wctob");
4641 extern __inline __attribute__ ((__gnu_inline__)) int
4642 wctob (wint_t __wc) throw ()
4643 { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
4644 ? (int) __wc : __wctob_alias (__wc)); }
4645 extern __inline __attribute__ ((__gnu_inline__)) size_t
4646 mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw ()
4647 { return (__ps != __null
4648 ? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); }
4649 extern size_t mbsrtowcs (wchar_t *__restrict __dst,
4650 __const char **__restrict __src, size_t __len,
4651 mbstate_t *__restrict __ps) throw ();
4652 extern size_t wcsrtombs (char *__restrict __dst,
4653 __const wchar_t **__restrict __src, size_t __len,
4654 mbstate_t *__restrict __ps) throw ();
4655 extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
4656 __const char **__restrict __src, size_t __nmc,
4657 size_t __len, mbstate_t *__restrict __ps) throw ();
4658 extern size_t wcsnrtombs (char *__restrict __dst,
4659 __const wchar_t **__restrict __src,
4660 size_t __nwc, size_t __len,
4661 mbstate_t *__restrict __ps) throw ();
4662 extern int wcwidth (wchar_t __c) throw ();
4663 extern int wcswidth (__const wchar_t *__s, size_t __n) throw ();
4664 extern double wcstod (__const wchar_t *__restrict __nptr,
4665 wchar_t **__restrict __endptr) throw ();
4666 extern float wcstof (__const wchar_t *__restrict __nptr,
4667 wchar_t **__restrict __endptr) throw ();
4668 extern long double wcstold (__const wchar_t *__restrict __nptr,
4669 wchar_t **__restrict __endptr) throw ();
4670 extern long int wcstol (__const wchar_t *__restrict __nptr,
4671 wchar_t **__restrict __endptr, int __base) throw ();
4672 extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
4673 wchar_t **__restrict __endptr, int __base)
4674 throw ();
4675 __extension__
4676 extern long long int wcstoll (__const wchar_t *__restrict __nptr,
4677 wchar_t **__restrict __endptr, int __base)
4678 throw ();
4679 __extension__
4680 extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
4681 wchar_t **__restrict __endptr,
4682 int __base) throw ();
4683 __extension__
4684 extern long long int wcstoq (__const wchar_t *__restrict __nptr,
4685 wchar_t **__restrict __endptr, int __base)
4686 throw ();
4687 __extension__
4688 extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
4689 wchar_t **__restrict __endptr,
4690 int __base) throw ();
4691 extern long int wcstol_l (__const wchar_t *__restrict __nptr,
4692 wchar_t **__restrict __endptr, int __base,
4693 __locale_t __loc) throw ();
4694 extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
4695 wchar_t **__restrict __endptr,
4696 int __base, __locale_t __loc) throw ();
4697 __extension__
4698 extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
4699 wchar_t **__restrict __endptr,
4700 int __base, __locale_t __loc) throw ();
4701 __extension__
4702 extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
4703 wchar_t **__restrict __endptr,
4704 int __base, __locale_t __loc)
4705 throw ();
4706 extern double wcstod_l (__const wchar_t *__restrict __nptr,
4707 wchar_t **__restrict __endptr, __locale_t __loc)
4708 throw ();
4709 extern float wcstof_l (__const wchar_t *__restrict __nptr,
4710 wchar_t **__restrict __endptr, __locale_t __loc)
4711 throw ();
4712 extern long double wcstold_l (__const wchar_t *__restrict __nptr,
4713 wchar_t **__restrict __endptr,
4714 __locale_t __loc) throw ();
4715 extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) throw ();
4716 extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
4717 throw ();
4718 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) throw ();
4719 extern int fwide (__FILE *__fp, int __mode) throw ();
4720 extern int fwprintf (__FILE *__restrict __stream,
4721 __const wchar_t *__restrict __format, ...)
4722 ;
4723 extern int wprintf (__const wchar_t *__restrict __format, ...)
4724 ;
4725 extern int swprintf (wchar_t *__restrict __s, size_t __n,
4726 __const wchar_t *__restrict __format, ...)
4727 throw () ;
4728 extern int vfwprintf (__FILE *__restrict __s,
4729 __const wchar_t *__restrict __format,
4730 __gnuc_va_list __arg)
4731 ;
4732 extern int vwprintf (__const wchar_t *__restrict __format,
4733 __gnuc_va_list __arg)
4734 ;
4735 extern int vswprintf (wchar_t *__restrict __s, size_t __n,
4736 __const wchar_t *__restrict __format,
4737 __gnuc_va_list __arg)
4738 throw () ;
4739 extern int fwscanf (__FILE *__restrict __stream,
4740 __const wchar_t *__restrict __format, ...)
4741 ;
4742 extern int wscanf (__const wchar_t *__restrict __format, ...)
4743 ;
4744 extern int swscanf (__const wchar_t *__restrict __s,
4745 __const wchar_t *__restrict __format, ...)
4746 throw () ;
4747 extern int vfwscanf (__FILE *__restrict __s,
4748 __const wchar_t *__restrict __format,
4749 __gnuc_va_list __arg)
4750 ;
4751 extern int vwscanf (__const wchar_t *__restrict __format,
4752 __gnuc_va_list __arg)
4753 ;
4754 extern int vswscanf (__const wchar_t *__restrict __s,
4755 __const wchar_t *__restrict __format,
4756 __gnuc_va_list __arg)
4757 throw () ;
4758 extern wint_t fgetwc (__FILE *__stream);
4759 extern wint_t getwc (__FILE *__stream);
4760 extern wint_t getwchar (void);
4761 extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
4762 extern wint_t putwc (wchar_t __wc, __FILE *__stream);
4763 extern wint_t putwchar (wchar_t __wc);
4764 extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
4765 __FILE *__restrict __stream);
4766 extern int fputws (__const wchar_t *__restrict __ws,
4767 __FILE *__restrict __stream);
4768 extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
4769 extern wint_t getwc_unlocked (__FILE *__stream);
4770 extern wint_t getwchar_unlocked (void);
4771 extern wint_t fgetwc_unlocked (__FILE *__stream);
4772 extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
4773 extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
4774 extern wint_t putwchar_unlocked (wchar_t __wc);
4775 extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
4776 __FILE *__restrict __stream);
4777 extern int fputws_unlocked (__const wchar_t *__restrict __ws,
4778 __FILE *__restrict __stream);
4779 extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
4780 __const wchar_t *__restrict __format,
4781 __const struct tm *__restrict __tp) throw ();
4782 extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
4783 __const wchar_t *__restrict __format,
4784 __const struct tm *__restrict __tp,
4785 __locale_t __loc) throw ();
4786 extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
4787 __const wchar_t *__restrict __s2, size_t __n,
4788 size_t __ns1) throw ();
4789 extern wchar_t *__wmemcpy_alias (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) throw () __asm__ ("" "wmemcpy")
4790 ;
4791 extern wchar_t *__wmemcpy_chk_warn (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n, size_t __ns1) throw () __asm__ ("" "__wmemcpy_chk")
4792 __attribute__((__warning__ ("wmemcpy called with length bigger than size of destination " "buffer")))
4793 ;
4794 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4795 wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) throw ()
4796 {
4797 if (__builtin_object_size (__s1, 0) != (size_t) -1)
4798 {
4799 if (!__builtin_constant_p (__n))
4800 return __wmemcpy_chk (__s1, __s2, __n,
4801 __builtin_object_size (__s1, 0) / sizeof (wchar_t));
4802 if (__n > __builtin_object_size (__s1, 0) / sizeof (wchar_t))
4803 return __wmemcpy_chk_warn (__s1, __s2, __n,
4804 __builtin_object_size (__s1, 0) / sizeof (wchar_t));
4805 }
4806 return __wmemcpy_alias (__s1, __s2, __n);
4807 }
4808 extern wchar_t *__wmemmove_chk (wchar_t *__s1, __const wchar_t *__s2,
4809 size_t __n, size_t __ns1) throw ();
4810 extern wchar_t *__wmemmove_alias (wchar_t *__s1, __const wchar_t *__s2, size_t __n) throw () __asm__ ("" "wmemmove")
4811 ;
4812 extern wchar_t *__wmemmove_chk_warn (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n, size_t __ns1) throw () __asm__ ("" "__wmemmove_chk")
4813 __attribute__((__warning__ ("wmemmove called with length bigger than size of destination " "buffer")))
4814 ;
4815 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4816 wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) throw ()
4817 {
4818 if (__builtin_object_size (__s1, 0) != (size_t) -1)
4819 {
4820 if (!__builtin_constant_p (__n))
4821 return __wmemmove_chk (__s1, __s2, __n,
4822 __builtin_object_size (__s1, 0) / sizeof (wchar_t));
4823 if (__n > __builtin_object_size (__s1, 0) / sizeof (wchar_t))
4824 return __wmemmove_chk_warn (__s1, __s2, __n,
4825 __builtin_object_size (__s1, 0) / sizeof (wchar_t));
4826 }
4827 return __wmemmove_alias (__s1, __s2, __n);
4828 }
4829 extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
4830 __const wchar_t *__restrict __s2, size_t __n,
4831 size_t __ns1) throw ();
4832 extern wchar_t *__wmempcpy_alias (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) throw () __asm__ ("" "wmempcpy")
4833 ;
4834 extern wchar_t *__wmempcpy_chk_warn (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n, size_t __ns1) throw () __asm__ ("" "__wmempcpy_chk")
4835 __attribute__((__warning__ ("wmempcpy called with length bigger than size of destination " "buffer")))
4836 ;
4837 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4838 wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) throw ()
4839 {
4840 if (__builtin_object_size (__s1, 0) != (size_t) -1)
4841 {
4842 if (!__builtin_constant_p (__n))
4843 return __wmempcpy_chk (__s1, __s2, __n,
4844 __builtin_object_size (__s1, 0) / sizeof (wchar_t));
4845 if (__n > __builtin_object_size (__s1, 0) / sizeof (wchar_t))
4846 return __wmempcpy_chk_warn (__s1, __s2, __n,
4847 __builtin_object_size (__s1, 0) / sizeof (wchar_t));
4848 }
4849 return __wmempcpy_alias (__s1, __s2, __n);
4850 }
4851 extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
4852 size_t __ns) throw ();
4853 extern wchar_t *__wmemset_alias (wchar_t *__s, wchar_t __c, size_t __n) throw () __asm__ ("" "wmemset")
4854 ;
4855 extern wchar_t *__wmemset_chk_warn (wchar_t *__s, wchar_t __c, size_t __n, size_t __ns) throw () __asm__ ("" "__wmemset_chk")
4856 __attribute__((__warning__ ("wmemset called with length bigger than size of destination " "buffer")))
4857 ;
4858 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4859 wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n) throw ()
4860 {
4861 if (__builtin_object_size (__s, 0) != (size_t) -1)
4862 {
4863 if (!__builtin_constant_p (__n))
4864 return __wmemset_chk (__s, __c, __n, __builtin_object_size (__s, 0) / sizeof (wchar_t));
4865 if (__n > __builtin_object_size (__s, 0) / sizeof (wchar_t))
4866 return __wmemset_chk_warn (__s, __c, __n,
4867 __builtin_object_size (__s, 0) / sizeof (wchar_t));
4868 }
4869 return __wmemset_alias (__s, __c, __n);
4870 }
4871 extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
4872 __const wchar_t *__restrict __src,
4873 size_t __n) throw ();
4874 extern wchar_t *__wcscpy_alias (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) throw () __asm__ ("" "wcscpy")
4875 ;
4876 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4877 wcscpy (wchar_t *__dest, __const wchar_t *__src) throw ()
4878 {
4879 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1)
4880 return __wcscpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4881 return __wcscpy_alias (__dest, __src);
4882 }
4883 extern wchar_t *__wcpcpy_chk (wchar_t *__dest, __const wchar_t *__src,
4884 size_t __destlen) throw ();
4885 extern wchar_t *__wcpcpy_alias (wchar_t *__dest, __const wchar_t *__src) throw () __asm__ ("" "wcpcpy")
4886 ;
4887 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4888 wcpcpy (wchar_t *__dest, __const wchar_t *__src) throw ()
4889 {
4890 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1)
4891 return __wcpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4892 return __wcpcpy_alias (__dest, __src);
4893 }
4894 extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
4895 __const wchar_t *__restrict __src, size_t __n,
4896 size_t __destlen) throw ();
4897 extern wchar_t *__wcsncpy_alias (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) throw () __asm__ ("" "wcsncpy")
4898 ;
4899 extern wchar_t *__wcsncpy_chk_warn (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n, size_t __destlen) throw () __asm__ ("" "__wcsncpy_chk")
4900 __attribute__((__warning__ ("wcsncpy called with length bigger than size of destination " "buffer")))
4901 ;
4902 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4903 wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n) throw ()
4904 {
4905 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1)
4906 {
4907 if (!__builtin_constant_p (__n))
4908 return __wcsncpy_chk (__dest, __src, __n,
4909 __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4910 if (__n > __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t))
4911 return __wcsncpy_chk_warn (__dest, __src, __n,
4912 __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4913 }
4914 return __wcsncpy_alias (__dest, __src, __n);
4915 }
4916 extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
4917 __const wchar_t *__restrict __src, size_t __n,
4918 size_t __destlen) throw ();
4919 extern wchar_t *__wcpncpy_alias (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) throw () __asm__ ("" "wcpncpy")
4920 ;
4921 extern wchar_t *__wcpncpy_chk_warn (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n, size_t __destlen) throw () __asm__ ("" "__wcpncpy_chk")
4922 __attribute__((__warning__ ("wcpncpy called with length bigger than size of destination " "buffer")))
4923 ;
4924 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4925 wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n) throw ()
4926 {
4927 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1)
4928 {
4929 if (!__builtin_constant_p (__n))
4930 return __wcpncpy_chk (__dest, __src, __n,
4931 __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4932 if (__n > __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t))
4933 return __wcpncpy_chk_warn (__dest, __src, __n,
4934 __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4935 }
4936 return __wcpncpy_alias (__dest, __src, __n);
4937 }
4938 extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
4939 __const wchar_t *__restrict __src,
4940 size_t __destlen) throw ();
4941 extern wchar_t *__wcscat_alias (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) throw () __asm__ ("" "wcscat")
4942 ;
4943 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4944 wcscat (wchar_t *__dest, __const wchar_t *__src) throw ()
4945 {
4946 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1)
4947 return __wcscat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4948 return __wcscat_alias (__dest, __src);
4949 }
4950 extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
4951 __const wchar_t *__restrict __src,
4952 size_t __n, size_t __destlen) throw ();
4953 extern wchar_t *__wcsncat_alias (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) throw () __asm__ ("" "wcsncat")
4954 ;
4955 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) wchar_t *
4956 wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n) throw ()
4957 {
4958 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1)
4959 return __wcsncat_chk (__dest, __src, __n,
4960 __builtin_object_size (__dest, 2 > 1) / sizeof (wchar_t));
4961 return __wcsncat_alias (__dest, __src, __n);
4962 }
4963 extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
4964 int __flag, size_t __s_len,
4965 __const wchar_t *__restrict __format, ...)
4966 throw () ;
4967 extern int __swprintf_alias (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __fmt, ...) throw () __asm__ ("" "swprintf")
4968 ;
4969 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4970 swprintf (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __fmt, ...) throw ()
4971 {
4972 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 || 2 > 1)
4973 return __swprintf_chk (__s, __n, 2 - 1,
4974 __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t),
4975 __fmt, __builtin_va_arg_pack ());
4976 return __swprintf_alias (__s, __n, __fmt, __builtin_va_arg_pack ());
4977 }
4978 extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
4979 int __flag, size_t __s_len,
4980 __const wchar_t *__restrict __format,
4981 __gnuc_va_list __arg)
4982 throw () ;
4983 extern int __vswprintf_alias (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __fmt, __gnuc_va_list __ap) throw () __asm__ ("" "vswprintf")
4984 ;
4985 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4986 vswprintf (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __fmt, __gnuc_va_list __ap) throw ()
4987 {
4988 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 || 2 > 1)
4989 return __vswprintf_chk (__s, __n, 2 - 1,
4990 __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t), __fmt, __ap);
4991 return __vswprintf_alias (__s, __n, __fmt, __ap);
4992 }
4993 extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
4994 __const wchar_t *__restrict __format, ...);
4995 extern int __wprintf_chk (int __flag, __const wchar_t *__restrict __format,
4996 ...);
4997 extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
4998 __const wchar_t *__restrict __format,
4999 __gnuc_va_list __ap);
5000 extern int __vwprintf_chk (int __flag, __const wchar_t *__restrict __format,
5001 __gnuc_va_list __ap);
5002 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
5003 wprintf (__const wchar_t *__restrict __fmt, ...)
5004 {
5005 return __wprintf_chk (2 - 1, __fmt, __builtin_va_arg_pack ());
5006 }
5007 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
5008 fwprintf (__FILE *__restrict __stream, __const wchar_t *__restrict __fmt, ...)
5009 {
5010 return __fwprintf_chk (__stream, 2 - 1, __fmt,
5011 __builtin_va_arg_pack ());
5012 }
5013 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
5014 vwprintf (__const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
5015 {
5016 return __vwprintf_chk (2 - 1, __fmt, __ap);
5017 }
5018 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
5019 vfwprintf (__FILE *__restrict __stream,
5020 __const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
5021 {
5022 return __vfwprintf_chk (__stream, 2 - 1, __fmt, __ap);
5023 }
5024 extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
5025 __FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
5026 extern wchar_t *__fgetws_alias (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) __asm__ ("" "fgetws")
5027 __attribute__ ((__warn_unused_result__));
5028 extern wchar_t *__fgetws_chk_warn (wchar_t *__restrict __s, size_t __size, int __n, __FILE *__restrict __stream) __asm__ ("" "__fgetws_chk")
5029 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgetws called with bigger size than length " "of destination buffer")))
5030 ;
5031 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) wchar_t *
5032 fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
5033 {
5034 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
5035 {
5036 if (!__builtin_constant_p (__n) || __n <= 0)
5037 return __fgetws_chk (__s, __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t),
5038 __n, __stream);
5039 if ((size_t) __n > __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t))
5040 return __fgetws_chk_warn (__s, __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t),
5041 __n, __stream);
5042 }
5043 return __fgetws_alias (__s, __n, __stream);
5044 }
5045 extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
5046 int __n, __FILE *__restrict __stream)
5047 __attribute__ ((__warn_unused_result__));
5048 extern wchar_t *__fgetws_unlocked_alias (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) __asm__ ("" "fgetws_unlocked")
5049 __attribute__ ((__warn_unused_result__));
5050 extern wchar_t *__fgetws_unlocked_chk_warn (wchar_t *__restrict __s, size_t __size, int __n, __FILE *__restrict __stream) __asm__ ("" "__fgetws_unlocked_chk")
5051 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgetws_unlocked called with bigger size than length " "of destination buffer")))
5052 ;
5053 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) wchar_t *
5054 fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
5055 {
5056 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
5057 {
5058 if (!__builtin_constant_p (__n) || __n <= 0)
5059 return __fgetws_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t),
5060 __n, __stream);
5061 if ((size_t) __n > __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t))
5062 return __fgetws_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1) / sizeof (wchar_t),
5063 __n, __stream);
5064 }
5065 return __fgetws_unlocked_alias (__s, __n, __stream);
5066 }
5067 extern size_t __wcrtomb_chk (char *__s, wchar_t __wchar, mbstate_t *__p,
5068 size_t __buflen) throw () __attribute__ ((__warn_unused_result__));
5069 extern size_t __wcrtomb_alias (char *__restrict __s, wchar_t __wchar, mbstate_t *__restrict __ps) throw () __asm__ ("" "wcrtomb")
5070 __attribute__ ((__warn_unused_result__));
5071 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
5072 wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps) throw ()
5073 {
5074 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1))
5075 return __wcrtomb_chk (__s, __wchar, __ps, __builtin_object_size (__s, 2 > 1));
5076 return __wcrtomb_alias (__s, __wchar, __ps);
5077 }
5078 extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
5079 __const char **__restrict __src,
5080 size_t __len, mbstate_t *__restrict __ps,
5081 size_t __dstlen) throw ();
5082 extern size_t __mbsrtowcs_alias (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) throw () __asm__ ("" "mbsrtowcs")
5083 ;
5084 extern size_t __mbsrtowcs_chk_warn (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) throw () __asm__ ("" "__mbsrtowcs_chk")
5085 __attribute__((__warning__ ("mbsrtowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
5086 ;
5087 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
5088 mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) throw ()
5089 {
5090 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
5091 {
5092 if (!__builtin_constant_p (__len))
5093 return __mbsrtowcs_chk (__dst, __src, __len, __ps,
5094 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
5095 if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
5096 return __mbsrtowcs_chk_warn (__dst, __src, __len, __ps,
5097 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
5098 }
5099 return __mbsrtowcs_alias (__dst, __src, __len, __ps);
5100 }
5101 extern size_t __wcsrtombs_chk (char *__restrict __dst,
5102 __const wchar_t **__restrict __src,
5103 size_t __len, mbstate_t *__restrict __ps,
5104 size_t __dstlen) throw ();
5105 extern size_t __wcsrtombs_alias (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) throw () __asm__ ("" "wcsrtombs")
5106 ;
5107 extern size_t __wcsrtombs_chk_warn (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) throw () __asm__ ("" "__wcsrtombs_chk")
5108 __attribute__((__warning__ ("wcsrtombs called with dst buffer smaller than len")));
5109 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
5110 wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) throw ()
5111 {
5112 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
5113 {
5114 if (!__builtin_constant_p (__len))
5115 return __wcsrtombs_chk (__dst, __src, __len, __ps, __builtin_object_size (__dst, 2 > 1));
5116 if (__len > __builtin_object_size (__dst, 2 > 1))
5117 return __wcsrtombs_chk_warn (__dst, __src, __len, __ps, __builtin_object_size (__dst, 2 > 1));
5118 }
5119 return __wcsrtombs_alias (__dst, __src, __len, __ps);
5120 }
5121 extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
5122 __const char **__restrict __src, size_t __nmc,
5123 size_t __len, mbstate_t *__restrict __ps,
5124 size_t __dstlen) throw ();
5125 extern size_t __mbsnrtowcs_alias (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) throw () __asm__ ("" "mbsnrtowcs")
5126 ;
5127 extern size_t __mbsnrtowcs_chk_warn (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) throw () __asm__ ("" "__mbsnrtowcs_chk")
5128 __attribute__((__warning__ ("mbsnrtowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
5129 ;
5130 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
5131 mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) throw ()
5132 {
5133 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
5134 {
5135 if (!__builtin_constant_p (__len))
5136 return __mbsnrtowcs_chk (__dst, __src, __nmc, __len, __ps,
5137 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
5138 if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
5139 return __mbsnrtowcs_chk_warn (__dst, __src, __nmc, __len, __ps,
5140 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
5141 }
5142 return __mbsnrtowcs_alias (__dst, __src, __nmc, __len, __ps);
5143 }
5144 extern size_t __wcsnrtombs_chk (char *__restrict __dst,
5145 __const wchar_t **__restrict __src,
5146 size_t __nwc, size_t __len,
5147 mbstate_t *__restrict __ps, size_t __dstlen)
5148 throw ();
5149 extern size_t __wcsnrtombs_alias (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) throw () __asm__ ("" "wcsnrtombs")
5150 ;
5151 extern size_t __wcsnrtombs_chk_warn (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) throw () __asm__ ("" "__wcsnrtombs_chk")
5152 __attribute__((__warning__ ("wcsnrtombs called with dst buffer smaller than len")));
5153 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
5154 wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) throw ()
5155 {
5156 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
5157 {
5158 if (!__builtin_constant_p (__len))
5159 return __wcsnrtombs_chk (__dst, __src, __nwc, __len, __ps,
5160 __builtin_object_size (__dst, 2 > 1));
5161 if (__len > __builtin_object_size (__dst, 2 > 1))
5162 return __wcsnrtombs_chk_warn (__dst, __src, __nwc, __len, __ps,
5163 __builtin_object_size (__dst, 2 > 1));
5164 }
5165 return __wcsnrtombs_alias (__dst, __src, __nwc, __len, __ps);
5166 }
5167 }
5168 namespace std __attribute__ ((__visibility__ ("default"))) {
5169 using ::mbstate_t;
5170 }
5171 namespace std __attribute__ ((__visibility__ ("default"))) {
5172 using ::wint_t;
5173 using ::btowc;
5174 using ::fgetwc;
5175 using ::fgetws;
5176 using ::fputwc;
5177 using ::fputws;
5178 using ::fwide;
5179 using ::fwprintf;
5180 using ::fwscanf;
5181 using ::getwc;
5182 using ::getwchar;
5183 using ::mbrlen;
5184 using ::mbrtowc;
5185 using ::mbsinit;
5186 using ::mbsrtowcs;
5187 using ::putwc;
5188 using ::putwchar;
5189 using ::swprintf;
5190 using ::swscanf;
5191 using ::ungetwc;
5192 using ::vfwprintf;
5193 using ::vfwscanf;
5194 using ::vswprintf;
5195 using ::vswscanf;
5196 using ::vwprintf;
5197 using ::vwscanf;
5198 using ::wcrtomb;
5199 using ::wcscat;
5200 using ::wcscmp;
5201 using ::wcscoll;
5202 using ::wcscpy;
5203 using ::wcscspn;
5204 using ::wcsftime;
5205 using ::wcslen;
5206 using ::wcsncat;
5207 using ::wcsncmp;
5208 using ::wcsncpy;
5209 using ::wcsrtombs;
5210 using ::wcsspn;
5211 using ::wcstod;
5212 using ::wcstof;
5213 using ::wcstok;
5214 using ::wcstol;
5215 using ::wcstoul;
5216 using ::wcsxfrm;
5217 using ::wctob;
5218 using ::wmemcmp;
5219 using ::wmemcpy;
5220 using ::wmemmove;
5221 using ::wmemset;
5222 using ::wprintf;
5223 using ::wscanf;
5224 using ::wcschr;
5225 using ::wcspbrk;
5226 using ::wcsrchr;
5227 using ::wcsstr;
5228 using ::wmemchr;
5229 }
5230 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
5231 using ::wcstold;
5232 using ::wcstoll;
5233 using ::wcstoull;
5234 }
5235 namespace std __attribute__ ((__visibility__ ("default"))) {
5236 using ::__gnu_cxx::wcstold;
5237 using ::__gnu_cxx::wcstoll;
5238 using ::__gnu_cxx::wcstoull;
5239 }
5240 namespace std __attribute__ ((__visibility__ ("default"))) {
5241 typedef long streamoff;
5242 typedef ptrdiff_t streamsize;
5243 template<typename _StateT>
5244 class fpos
5245 {
5246 private:
5247 streamoff _M_off;
5248 _StateT _M_state;
5249 public:
5250 fpos()
5251 : _M_off(0), _M_state() { }
5252 fpos(streamoff __off)
5253 : _M_off(__off), _M_state() { }
5254 operator streamoff() const { return _M_off; }
5255 void
5256 state(_StateT __st)
5257 { _M_state = __st; }
5258 _StateT
5259 state() const
5260 { return _M_state; }
5261 fpos&
5262 operator+=(streamoff __off)
5263 {
5264 _M_off += __off;
5265 return *this;
5266 }
5267 fpos&
5268 operator-=(streamoff __off)
5269 {
5270 _M_off -= __off;
5271 return *this;
5272 }
5273 fpos
5274 operator+(streamoff __off) const
5275 {
5276 fpos __pos(*this);
5277 __pos += __off;
5278 return __pos;
5279 }
5280 fpos
5281 operator-(streamoff __off) const
5282 {
5283 fpos __pos(*this);
5284 __pos -= __off;
5285 return __pos;
5286 }
5287 streamoff
5288 operator-(const fpos& __other) const
5289 { return _M_off - __other._M_off; }
5290 };
5291 template<typename _StateT>
5292 inline bool
5293 operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
5294 { return streamoff(__lhs) == streamoff(__rhs); }
5295 template<typename _StateT>
5296 inline bool
5297 operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
5298 { return streamoff(__lhs) != streamoff(__rhs); }
5299 typedef fpos<mbstate_t> streampos;
5300 typedef fpos<mbstate_t> wstreampos;
5301 }
5302
5303
5304 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
5305 template<typename _CharT>
5306 struct _Char_types
5307 {
5308 typedef unsigned long int_type;
5309 typedef std::streampos pos_type;
5310 typedef std::streamoff off_type;
5311 typedef std::mbstate_t state_type;
5312 };
5313 template<typename _CharT>
5314 struct char_traits
5315 {
5316 typedef _CharT char_type;
5317 typedef typename _Char_types<_CharT>::int_type int_type;
5318 typedef typename _Char_types<_CharT>::pos_type pos_type;
5319 typedef typename _Char_types<_CharT>::off_type off_type;
5320 typedef typename _Char_types<_CharT>::state_type state_type;
5321 static void
5322 assign(char_type& __c1, const char_type& __c2)
5323 { __c1 = __c2; }
5324 static bool
5325 eq(const char_type& __c1, const char_type& __c2)
5326 { return __c1 == __c2; }
5327 static bool
5328 lt(const char_type& __c1, const char_type& __c2)
5329 { return __c1 < __c2; }
5330 static int
5331 compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
5332 static std::size_t
5333 length(const char_type* __s);
5334 static const char_type*
5335 find(const char_type* __s, std::size_t __n, const char_type& __a);
5336 static char_type*
5337 move(char_type* __s1, const char_type* __s2, std::size_t __n);
5338 static char_type*
5339 copy(char_type* __s1, const char_type* __s2, std::size_t __n);
5340 static char_type*
5341 assign(char_type* __s, std::size_t __n, char_type __a);
5342 static char_type
5343 to_char_type(const int_type& __c)
5344 { return static_cast<char_type>(__c); }
5345 static int_type
5346 to_int_type(const char_type& __c)
5347 { return static_cast<int_type>(__c); }
5348 static bool
5349 eq_int_type(const int_type& __c1, const int_type& __c2)
5350 { return __c1 == __c2; }
5351 static int_type
5352 eof()
5353 { return static_cast<int_type>((-1)); }
5354 static int_type
5355 not_eof(const int_type& __c)
5356 { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
5357 };
5358 template<typename _CharT>
5359 int
5360 char_traits<_CharT>::
5361 compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
5362 {
5363 for (std::size_t __i = 0; __i < __n; ++__i)
5364 if (lt(__s1[__i], __s2[__i]))
5365 return -1;
5366 else if (lt(__s2[__i], __s1[__i]))
5367 return 1;
5368 return 0;
5369 }
5370 template<typename _CharT>
5371 std::size_t
5372 char_traits<_CharT>::
5373 length(const char_type* __p)
5374 {
5375 std::size_t __i = 0;
5376 while (!eq(__p[__i], char_type()))
5377 ++__i;
5378 return __i;
5379 }
5380 template<typename _CharT>
5381 const typename char_traits<_CharT>::char_type*
5382 char_traits<_CharT>::
5383 find(const char_type* __s, std::size_t __n, const char_type& __a)
5384 {
5385 for (std::size_t __i = 0; __i < __n; ++__i)
5386 if (eq(__s[__i], __a))
5387 return __s + __i;
5388 return 0;
5389 }
5390 template<typename _CharT>
5391 typename char_traits<_CharT>::char_type*
5392 char_traits<_CharT>::
5393 move(char_type* __s1, const char_type* __s2, std::size_t __n)
5394 {
5395 return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
5396 __n * sizeof(char_type)));
5397 }
5398 template<typename _CharT>
5399 typename char_traits<_CharT>::char_type*
5400 char_traits<_CharT>::
5401 copy(char_type* __s1, const char_type* __s2, std::size_t __n)
5402 {
5403 std::copy(__s2, __s2 + __n, __s1);
5404 return __s1;
5405 }
5406 template<typename _CharT>
5407 typename char_traits<_CharT>::char_type*
5408 char_traits<_CharT>::
5409 assign(char_type* __s, std::size_t __n, char_type __a)
5410 {
5411 std::fill_n(__s, __n, __a);
5412 return __s;
5413 }
5414 }
5415 namespace std __attribute__ ((__visibility__ ("default"))) {
5416 template<class _CharT>
5417 struct char_traits : public __gnu_cxx::char_traits<_CharT>
5418 { };
5419 template<>
5420 struct char_traits<char>
5421 {
5422 typedef char char_type;
5423 typedef int int_type;
5424 typedef streampos pos_type;
5425 typedef streamoff off_type;
5426 typedef mbstate_t state_type;
5427 static void
5428 assign(char_type& __c1, const char_type& __c2)
5429 { __c1 = __c2; }
5430 static bool
5431 eq(const char_type& __c1, const char_type& __c2)
5432 { return __c1 == __c2; }
5433 static bool
5434 lt(const char_type& __c1, const char_type& __c2)
5435 { return __c1 < __c2; }
5436 static int
5437 compare(const char_type* __s1, const char_type* __s2, size_t __n)
5438 { return __builtin_memcmp(__s1, __s2, __n); }
5439 static size_t
5440 length(const char_type* __s)
5441 { return __builtin_strlen(__s); }
5442 static const char_type*
5443 find(const char_type* __s, size_t __n, const char_type& __a)
5444 { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
5445 static char_type*
5446 move(char_type* __s1, const char_type* __s2, size_t __n)
5447 { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
5448 static char_type*
5449 copy(char_type* __s1, const char_type* __s2, size_t __n)
5450 { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
5451 static char_type*
5452 assign(char_type* __s, size_t __n, char_type __a)
5453 { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
5454 static char_type
5455 to_char_type(const int_type& __c)
5456 { return static_cast<char_type>(__c); }
5457 static int_type
5458 to_int_type(const char_type& __c)
5459 { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
5460 static bool
5461 eq_int_type(const int_type& __c1, const int_type& __c2)
5462 { return __c1 == __c2; }
5463 static int_type
5464 eof()
5465 { return static_cast<int_type>((-1)); }
5466 static int_type
5467 not_eof(const int_type& __c)
5468 { return (__c == eof()) ? 0 : __c; }
5469 };
5470 template<>
5471 struct char_traits<wchar_t>
5472 {
5473 typedef wchar_t char_type;
5474 typedef wint_t int_type;
5475 typedef streamoff off_type;
5476 typedef wstreampos pos_type;
5477 typedef mbstate_t state_type;
5478 static void
5479 assign(char_type& __c1, const char_type& __c2)
5480 { __c1 = __c2; }
5481 static bool
5482 eq(const char_type& __c1, const char_type& __c2)
5483 { return __c1 == __c2; }
5484 static bool
5485 lt(const char_type& __c1, const char_type& __c2)
5486 { return __c1 < __c2; }
5487 static int
5488 compare(const char_type* __s1, const char_type* __s2, size_t __n)
5489 { return wmemcmp(__s1, __s2, __n); }
5490 static size_t
5491 length(const char_type* __s)
5492 { return wcslen(__s); }
5493 static const char_type*
5494 find(const char_type* __s, size_t __n, const char_type& __a)
5495 { return wmemchr(__s, __a, __n); }
5496 static char_type*
5497 move(char_type* __s1, const char_type* __s2, size_t __n)
5498 { return wmemmove(__s1, __s2, __n); }
5499 static char_type*
5500 copy(char_type* __s1, const char_type* __s2, size_t __n)
5501 { return wmemcpy(__s1, __s2, __n); }
5502 static char_type*
5503 assign(char_type* __s, size_t __n, char_type __a)
5504 { return wmemset(__s, __a, __n); }
5505 static char_type
5506 to_char_type(const int_type& __c)
5507 { return char_type(__c); }
5508 static int_type
5509 to_int_type(const char_type& __c)
5510 { return int_type(__c); }
5511 static bool
5512 eq_int_type(const int_type& __c1, const int_type& __c2)
5513 { return __c1 == __c2; }
5514 static int_type
5515 eof()
5516 { return static_cast<int_type>((0xffffffffu)); }
5517 static int_type
5518 not_eof(const int_type& __c)
5519 { return eq_int_type(__c, eof()) ? 0 : __c; }
5520 };
5521 }
5522
5523
5524
5525 extern "C++" {
5526 namespace std
5527 {
5528 class exception
5529 {
5530 public:
5531 exception() throw() { }
5532 virtual ~exception() throw();
5533 virtual const char* what() const throw();
5534 };
5535 class bad_exception : public exception
5536 {
5537 public:
5538 bad_exception() throw() { }
5539 virtual ~bad_exception() throw();
5540 virtual const char* what() const throw();
5541 };
5542 typedef void (*terminate_handler) ();
5543 typedef void (*unexpected_handler) ();
5544 terminate_handler set_terminate(terminate_handler) throw();
5545 void terminate() throw() __attribute__ ((__noreturn__));
5546 unexpected_handler set_unexpected(unexpected_handler) throw();
5547 void unexpected() __attribute__ ((__noreturn__));
5548 bool uncaught_exception() throw() __attribute__ ((__pure__));
5549 }
5550 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
5551 void __verbose_terminate_handler();
5552 }
5553 }
5554 extern "C++" {
5555 namespace std
5556 {
5557 class bad_alloc : public exception
5558 {
5559 public:
5560 bad_alloc() throw() { }
5561 virtual ~bad_alloc() throw();
5562 virtual const char* what() const throw();
5563 };
5564 struct nothrow_t { };
5565 extern const nothrow_t nothrow;
5566 typedef void (*new_handler)();
5567 new_handler set_new_handler(new_handler) throw();
5568 }
5569 void* operator new(std::size_t) throw (std::bad_alloc);
5570 void* operator new[](std::size_t) throw (std::bad_alloc);
5571 void operator delete(void*) throw();
5572 void operator delete[](void*) throw();
5573 void* operator new(std::size_t, const std::nothrow_t&) throw();
5574 void* operator new[](std::size_t, const std::nothrow_t&) throw();
5575 void operator delete(void*, const std::nothrow_t&) throw();
5576 void operator delete[](void*, const std::nothrow_t&) throw();
5577 inline void* operator new(std::size_t, void* __p) throw() { return __p; }
5578 inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
5579 inline void operator delete (void*, void*) throw() { }
5580 inline void operator delete[](void*, void*) throw() { }
5581 }
5582 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
5583 using std::size_t;
5584 using std::ptrdiff_t;
5585 template<typename _Tp>
5586 class new_allocator
5587 {
5588 public:
5589 typedef size_t size_type;
5590 typedef ptrdiff_t difference_type;
5591 typedef _Tp* pointer;
5592 typedef const _Tp* const_pointer;
5593 typedef _Tp& reference;
5594 typedef const _Tp& const_reference;
5595 typedef _Tp value_type;
5596 template<typename _Tp1>
5597 struct rebind
5598 { typedef new_allocator<_Tp1> other; };
5599 new_allocator() throw() { }
5600 new_allocator(const new_allocator&) throw() { }
5601 template<typename _Tp1>
5602 new_allocator(const new_allocator<_Tp1>&) throw() { }
5603 ~new_allocator() throw() { }
5604 pointer
5605 address(reference __x) const { return &__x; }
5606 const_pointer
5607 address(const_reference __x) const { return &__x; }
5608 pointer
5609 allocate(size_type __n, const void* = 0)
5610 {
5611 if (__n > this->max_size())
5612 std::__throw_bad_alloc();
5613 return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
5614 }
5615 void
5616 deallocate(pointer __p, size_type)
5617 { ::operator delete(__p); }
5618 size_type
5619 max_size() const throw()
5620 { return size_t(-1) / sizeof(_Tp); }
5621 void
5622 construct(pointer __p, const _Tp& __val)
5623 { ::new((void *)__p) _Tp(__val); }
5624 void
5625 destroy(pointer __p) { __p->~_Tp(); }
5626 };
5627 template<typename _Tp>
5628 inline bool
5629 operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
5630 { return true; }
5631 template<typename _Tp>
5632 inline bool
5633 operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
5634 { return false; }
5635 }
5636 namespace std __attribute__ ((__visibility__ ("default"))) {
5637 template<typename _Tp>
5638 class allocator;
5639 template<>
5640 class allocator<void>
5641 {
5642 public:
5643 typedef size_t size_type;
5644 typedef ptrdiff_t difference_type;
5645 typedef void* pointer;
5646 typedef const void* const_pointer;
5647 typedef void value_type;
5648 template<typename _Tp1>
5649 struct rebind
5650 { typedef allocator<_Tp1> other; };
5651 };
5652 template<typename _Tp>
5653 class allocator: public __gnu_cxx::new_allocator<_Tp>
5654 {
5655 public:
5656 typedef size_t size_type;
5657 typedef ptrdiff_t difference_type;
5658 typedef _Tp* pointer;
5659 typedef const _Tp* const_pointer;
5660 typedef _Tp& reference;
5661 typedef const _Tp& const_reference;
5662 typedef _Tp value_type;
5663 template<typename _Tp1>
5664 struct rebind
5665 { typedef allocator<_Tp1> other; };
5666 allocator() throw() { }
5667 allocator(const allocator& __a) throw()
5668 : __gnu_cxx::new_allocator<_Tp>(__a) { }
5669 template<typename _Tp1>
5670 allocator(const allocator<_Tp1>&) throw() { }
5671 ~allocator() throw() { }
5672 };
5673 template<typename _T1, typename _T2>
5674 inline bool
5675 operator==(const allocator<_T1>&, const allocator<_T2>&)
5676 { return true; }
5677 template<typename _Tp>
5678 inline bool
5679 operator==(const allocator<_Tp>&, const allocator<_Tp>&)
5680 { return true; }
5681 template<typename _T1, typename _T2>
5682 inline bool
5683 operator!=(const allocator<_T1>&, const allocator<_T2>&)
5684 { return false; }
5685 template<typename _Tp>
5686 inline bool
5687 operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
5688 { return false; }
5689 extern template class allocator<char>;
5690 extern template class allocator<wchar_t>;
5691 template<typename _Alloc, bool = __is_empty(_Alloc)>
5692 struct __alloc_swap
5693 { static void _S_do_it(_Alloc&, _Alloc&) { } };
5694 template<typename _Alloc>
5695 struct __alloc_swap<_Alloc, false>
5696 {
5697 static void
5698 _S_do_it(_Alloc& __one, _Alloc& __two)
5699 {
5700 if (__one != __two)
5701 swap(__one, __two);
5702 }
5703 };
5704 template<typename _Alloc, bool = __is_empty(_Alloc)>
5705 struct __alloc_neq
5706 {
5707 static bool
5708 _S_do_it(const _Alloc&, const _Alloc&)
5709 { return false; }
5710 };
5711 template<typename _Alloc>
5712 struct __alloc_neq<_Alloc, false>
5713 {
5714 static bool
5715 _S_do_it(const _Alloc& __one, const _Alloc& __two)
5716 { return __one != __two; }
5717 };
5718 }
5719
5720
5721
5722 enum
5723 {
5724 __LC_CTYPE = 0,
5725 __LC_NUMERIC = 1,
5726 __LC_TIME = 2,
5727 __LC_COLLATE = 3,
5728 __LC_MONETARY = 4,
5729 __LC_MESSAGES = 5,
5730 __LC_ALL = 6,
5731 __LC_PAPER = 7,
5732 __LC_NAME = 8,
5733 __LC_ADDRESS = 9,
5734 __LC_TELEPHONE = 10,
5735 __LC_MEASUREMENT = 11,
5736 __LC_IDENTIFICATION = 12
5737 };
5738 extern "C" {
5739 struct lconv
5740 {
5741 char *decimal_point;
5742 char *thousands_sep;
5743 char *grouping;
5744 char *int_curr_symbol;
5745 char *currency_symbol;
5746 char *mon_decimal_point;
5747 char *mon_thousands_sep;
5748 char *mon_grouping;
5749 char *positive_sign;
5750 char *negative_sign;
5751 char int_frac_digits;
5752 char frac_digits;
5753 char p_cs_precedes;
5754 char p_sep_by_space;
5755 char n_cs_precedes;
5756 char n_sep_by_space;
5757 char p_sign_posn;
5758 char n_sign_posn;
5759 char int_p_cs_precedes;
5760 char int_p_sep_by_space;
5761 char int_n_cs_precedes;
5762 char int_n_sep_by_space;
5763 char int_p_sign_posn;
5764 char int_n_sign_posn;
5765 };
5766 extern char *setlocale (int __category, __const char *__locale) throw ();
5767 extern struct lconv *localeconv (void) throw ();
5768 extern __locale_t newlocale (int __category_mask, __const char *__locale,
5769 __locale_t __base) throw ();
5770 extern __locale_t duplocale (__locale_t __dataset) throw ();
5771 extern void freelocale (__locale_t __dataset) throw ();
5772 extern __locale_t uselocale (__locale_t __dataset) throw ();
5773 }
5774 namespace std __attribute__ ((__visibility__ ("default"))) {
5775 using ::lconv;
5776 using ::setlocale;
5777 using ::localeconv;
5778 }
5779
5780 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
5781 extern "C" __typeof(uselocale) __uselocale;
5782 }
5783 namespace std __attribute__ ((__visibility__ ("default"))) {
5784 typedef __locale_t __c_locale;
5785 inline int
5786 __convert_from_v(const __c_locale& __cloc __attribute__ ((__unused__)),
5787 char* __out,
5788 const int __size __attribute__ ((__unused__)),
5789 const char* __fmt, ...)
5790 {
5791 __c_locale __old = __gnu_cxx::__uselocale(__cloc);
5792 __builtin_va_list __args;
5793 __builtin_va_start(__args, __fmt);
5794 const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
5795 __builtin_va_end(__args);
5796 __gnu_cxx::__uselocale(__old);
5797 return __ret;
5798 }
5799 }
5800
5801 namespace std __attribute__ ((__visibility__ ("default"))) {
5802 class ios_base;
5803 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5804 class basic_ios;
5805 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5806 class basic_streambuf;
5807 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5808 class basic_istream;
5809 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5810 class basic_ostream;
5811 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5812 class basic_iostream;
5813 template<typename _CharT, typename _Traits = char_traits<_CharT>,
5814 typename _Alloc = allocator<_CharT> >
5815 class basic_stringbuf;
5816 template<typename _CharT, typename _Traits = char_traits<_CharT>,
5817 typename _Alloc = allocator<_CharT> >
5818 class basic_istringstream;
5819 template<typename _CharT, typename _Traits = char_traits<_CharT>,
5820 typename _Alloc = allocator<_CharT> >
5821 class basic_ostringstream;
5822 template<typename _CharT, typename _Traits = char_traits<_CharT>,
5823 typename _Alloc = allocator<_CharT> >
5824 class basic_stringstream;
5825 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5826 class basic_filebuf;
5827 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5828 class basic_ifstream;
5829 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5830 class basic_ofstream;
5831 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5832 class basic_fstream;
5833 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5834 class istreambuf_iterator;
5835 template<typename _CharT, typename _Traits = char_traits<_CharT> >
5836 class ostreambuf_iterator;
5837 typedef basic_ios<char> ios;
5838 typedef basic_streambuf<char> streambuf;
5839 typedef basic_istream<char> istream;
5840 typedef basic_ostream<char> ostream;
5841 typedef basic_iostream<char> iostream;
5842 typedef basic_stringbuf<char> stringbuf;
5843 typedef basic_istringstream<char> istringstream;
5844 typedef basic_ostringstream<char> ostringstream;
5845 typedef basic_stringstream<char> stringstream;
5846 typedef basic_filebuf<char> filebuf;
5847 typedef basic_ifstream<char> ifstream;
5848 typedef basic_ofstream<char> ofstream;
5849 typedef basic_fstream<char> fstream;
5850 typedef basic_ios<wchar_t> wios;
5851 typedef basic_streambuf<wchar_t> wstreambuf;
5852 typedef basic_istream<wchar_t> wistream;
5853 typedef basic_ostream<wchar_t> wostream;
5854 typedef basic_iostream<wchar_t> wiostream;
5855 typedef basic_stringbuf<wchar_t> wstringbuf;
5856 typedef basic_istringstream<wchar_t> wistringstream;
5857 typedef basic_ostringstream<wchar_t> wostringstream;
5858 typedef basic_stringstream<wchar_t> wstringstream;
5859 typedef basic_filebuf<wchar_t> wfilebuf;
5860 typedef basic_ifstream<wchar_t> wifstream;
5861 typedef basic_ofstream<wchar_t> wofstream;
5862 typedef basic_fstream<wchar_t> wfstream;
5863 }
5864
5865 typedef unsigned char __u_char;
5866 typedef unsigned short int __u_short;
5867 typedef unsigned int __u_int;
5868 typedef unsigned long int __u_long;
5869 typedef signed char __int8_t;
5870 typedef unsigned char __uint8_t;
5871 typedef signed short int __int16_t;
5872 typedef unsigned short int __uint16_t;
5873 typedef signed int __int32_t;
5874 typedef unsigned int __uint32_t;
5875 typedef signed long int __int64_t;
5876 typedef unsigned long int __uint64_t;
5877 typedef long int __quad_t;
5878 typedef unsigned long int __u_quad_t;
5879 typedef unsigned long int __dev_t;
5880 typedef unsigned int __uid_t;
5881 typedef unsigned int __gid_t;
5882 typedef unsigned long int __ino_t;
5883 typedef unsigned long int __ino64_t;
5884 typedef unsigned int __mode_t;
5885 typedef unsigned long int __nlink_t;
5886 typedef long int __off_t;
5887 typedef long int __off64_t;
5888 typedef int __pid_t;
5889 typedef struct { int __val[2]; } __fsid_t;
5890 typedef long int __clock_t;
5891 typedef unsigned long int __rlim_t;
5892 typedef unsigned long int __rlim64_t;
5893 typedef unsigned int __id_t;
5894 typedef long int __time_t;
5895 typedef unsigned int __useconds_t;
5896 typedef long int __suseconds_t;
5897 typedef int __daddr_t;
5898 typedef long int __swblk_t;
5899 typedef int __key_t;
5900 typedef int __clockid_t;
5901 typedef void * __timer_t;
5902 typedef long int __blksize_t;
5903 typedef long int __blkcnt_t;
5904 typedef long int __blkcnt64_t;
5905 typedef unsigned long int __fsblkcnt_t;
5906 typedef unsigned long int __fsblkcnt64_t;
5907 typedef unsigned long int __fsfilcnt_t;
5908 typedef unsigned long int __fsfilcnt64_t;
5909 typedef long int __ssize_t;
5910 typedef __off64_t __loff_t;
5911 typedef __quad_t *__qaddr_t;
5912 typedef char *__caddr_t;
5913 typedef long int __intptr_t;
5914 typedef unsigned int __socklen_t;
5915 extern "C" {
5916 enum
5917 {
5918 _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
5919 _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
5920 _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
5921 _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
5922 _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
5923 _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
5924 _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
5925 _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
5926 _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
5927 _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
5928 _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
5929 _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
5930 };
5931 extern __const unsigned short int **__ctype_b_loc (void)
5932 throw () __attribute__ ((__const));
5933 extern __const __int32_t **__ctype_tolower_loc (void)
5934 throw () __attribute__ ((__const));
5935 extern __const __int32_t **__ctype_toupper_loc (void)
5936 throw () __attribute__ ((__const));
5937 extern int isalnum (int) throw ();
5938 extern int isalpha (int) throw ();
5939 extern int iscntrl (int) throw ();
5940 extern int isdigit (int) throw ();
5941 extern int islower (int) throw ();
5942 extern int isgraph (int) throw ();
5943 extern int isprint (int) throw ();
5944 extern int ispunct (int) throw ();
5945 extern int isspace (int) throw ();
5946 extern int isupper (int) throw ();
5947 extern int isxdigit (int) throw ();
5948 extern int tolower (int __c) throw ();
5949 extern int toupper (int __c) throw ();
5950 extern int isblank (int) throw ();
5951 extern int isctype (int __c, int __mask) throw ();
5952 extern int isascii (int __c) throw ();
5953 extern int toascii (int __c) throw ();
5954 extern int _toupper (int) throw ();
5955 extern int _tolower (int) throw ();
5956 extern int isalnum_l (int, __locale_t) throw ();
5957 extern int isalpha_l (int, __locale_t) throw ();
5958 extern int iscntrl_l (int, __locale_t) throw ();
5959 extern int isdigit_l (int, __locale_t) throw ();
5960 extern int islower_l (int, __locale_t) throw ();
5961 extern int isgraph_l (int, __locale_t) throw ();
5962 extern int isprint_l (int, __locale_t) throw ();
5963 extern int ispunct_l (int, __locale_t) throw ();
5964 extern int isspace_l (int, __locale_t) throw ();
5965 extern int isupper_l (int, __locale_t) throw ();
5966 extern int isxdigit_l (int, __locale_t) throw ();
5967 extern int isblank_l (int, __locale_t) throw ();
5968 extern int __tolower_l (int __c, __locale_t __l) throw ();
5969 extern int tolower_l (int __c, __locale_t __l) throw ();
5970 extern int __toupper_l (int __c, __locale_t __l) throw ();
5971 extern int toupper_l (int __c, __locale_t __l) throw ();
5972 }
5973 namespace std __attribute__ ((__visibility__ ("default"))) {
5974 using ::isalnum;
5975 using ::isalpha;
5976 using ::iscntrl;
5977 using ::isdigit;
5978 using ::isgraph;
5979 using ::islower;
5980 using ::isprint;
5981 using ::ispunct;
5982 using ::isspace;
5983 using ::isupper;
5984 using ::isxdigit;
5985 using ::tolower;
5986 using ::toupper;
5987 }
5988 namespace std __attribute__ ((__visibility__ ("default"))) {
5989 class locale;
5990 template<typename _Facet>
5991 bool
5992 has_facet(const locale&) throw();
5993 template<typename _Facet>
5994 const _Facet&
5995 use_facet(const locale&);
5996 template<typename _CharT>
5997 bool
5998 isspace(_CharT, const locale&);
5999 template<typename _CharT>
6000 bool
6001 isprint(_CharT, const locale&);
6002 template<typename _CharT>
6003 bool
6004 iscntrl(_CharT, const locale&);
6005 template<typename _CharT>
6006 bool
6007 isupper(_CharT, const locale&);
6008 template<typename _CharT>
6009 bool
6010 islower(_CharT, const locale&);
6011 template<typename _CharT>
6012 bool
6013 isalpha(_CharT, const locale&);
6014 template<typename _CharT>
6015 bool
6016 isdigit(_CharT, const locale&);
6017 template<typename _CharT>
6018 bool
6019 ispunct(_CharT, const locale&);
6020 template<typename _CharT>
6021 bool
6022 isxdigit(_CharT, const locale&);
6023 template<typename _CharT>
6024 bool
6025 isalnum(_CharT, const locale&);
6026 template<typename _CharT>
6027 bool
6028 isgraph(_CharT, const locale&);
6029 template<typename _CharT>
6030 _CharT
6031 toupper(_CharT, const locale&);
6032 template<typename _CharT>
6033 _CharT
6034 tolower(_CharT, const locale&);
6035 class ctype_base;
6036 template<typename _CharT>
6037 class ctype;
6038 template<> class ctype<char>;
6039 template<> class ctype<wchar_t>;
6040 template<typename _CharT>
6041 class ctype_byname;
6042 class codecvt_base;
6043 template<typename _InternT, typename _ExternT, typename _StateT>
6044 class codecvt;
6045 template<> class codecvt<char, char, mbstate_t>;
6046 template<> class codecvt<wchar_t, char, mbstate_t>;
6047 template<typename _InternT, typename _ExternT, typename _StateT>
6048 class codecvt_byname;
6049 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
6050 class num_get;
6051 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
6052 class num_put;
6053 template<typename _CharT> class numpunct;
6054 template<typename _CharT> class numpunct_byname;
6055 template<typename _CharT>
6056 class collate;
6057 template<typename _CharT> class
6058 collate_byname;
6059 class time_base;
6060 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
6061 class time_get;
6062 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
6063 class time_get_byname;
6064 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
6065 class time_put;
6066 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
6067 class time_put_byname;
6068 class money_base;
6069 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
6070 class money_get;
6071 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
6072 class money_put;
6073 template<typename _CharT, bool _Intl = false>
6074 class moneypunct;
6075 template<typename _CharT, bool _Intl = false>
6076 class moneypunct_byname;
6077 class messages_base;
6078 template<typename _CharT>
6079 class messages;
6080 template<typename _CharT>
6081 class messages_byname;
6082 }
6083
6084
6085 namespace __cxxabiv1
6086 {
6087 class __forced_unwind
6088 {
6089 virtual ~__forced_unwind() throw();
6090 virtual void __pure_dummy() = 0;
6091 };
6092 }
6093 namespace std __attribute__ ((__visibility__ ("default"))) {
6094 template<typename _CharT, typename _Traits>
6095 inline void
6096 __ostream_write(basic_ostream<_CharT, _Traits>& __out,
6097 const _CharT* __s, streamsize __n)
6098 {
6099 typedef basic_ostream<_CharT, _Traits> __ostream_type;
6100 typedef typename __ostream_type::ios_base __ios_base;
6101 const streamsize __put = __out.rdbuf()->sputn(__s, __n);
6102 if (__put != __n)
6103 __out.setstate(__ios_base::badbit);
6104 }
6105 template<typename _CharT, typename _Traits>
6106 inline void
6107 __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
6108 {
6109 typedef basic_ostream<_CharT, _Traits> __ostream_type;
6110 typedef typename __ostream_type::ios_base __ios_base;
6111 const _CharT __c = __out.fill();
6112 for (; __n > 0; --__n)
6113 {
6114 const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
6115 if (_Traits::eq_int_type(__put, _Traits::eof()))
6116 {
6117 __out.setstate(__ios_base::badbit);
6118 break;
6119 }
6120 }
6121 }
6122 template<typename _CharT, typename _Traits>
6123 basic_ostream<_CharT, _Traits>&
6124 __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
6125 const _CharT* __s, streamsize __n)
6126 {
6127 typedef basic_ostream<_CharT, _Traits> __ostream_type;
6128 typedef typename __ostream_type::ios_base __ios_base;
6129 typename __ostream_type::sentry __cerb(__out);
6130 if (__cerb)
6131 {
6132 try
6133 {
6134 const streamsize __w = __out.width();
6135 if (__w > __n)
6136 {
6137 const bool __left = ((__out.flags()
6138 & __ios_base::adjustfield)
6139 == __ios_base::left);
6140 if (!__left)
6141 __ostream_fill(__out, __w - __n);
6142 if (__out.good())
6143 __ostream_write(__out, __s, __n);
6144 if (__left && __out.good())
6145 __ostream_fill(__out, __w - __n);
6146 }
6147 else
6148 __ostream_write(__out, __s, __n);
6149 __out.width(0);
6150 }
6151 catch(__cxxabiv1::__forced_unwind&)
6152 {
6153 __out._M_setstate(__ios_base::badbit);
6154 throw;
6155 }
6156 catch(...)
6157 { __out._M_setstate(__ios_base::badbit); }
6158 }
6159 return __out;
6160 }
6161 extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
6162 extern template wostream& __ostream_insert(wostream&, const wchar_t*,
6163 streamsize);
6164 }
6165 namespace std __attribute__ ((__visibility__ ("default"))) {
6166 template<typename _Arg, typename _Result>
6167 struct unary_function
6168 {
6169 typedef _Arg argument_type;
6170 typedef _Result result_type;
6171 };
6172 template<typename _Arg1, typename _Arg2, typename _Result>
6173 struct binary_function
6174 {
6175 typedef _Arg1 first_argument_type;
6176 typedef _Arg2 second_argument_type;
6177 typedef _Result result_type;
6178 };
6179 template<typename _Tp>
6180 struct plus : public binary_function<_Tp, _Tp, _Tp>
6181 {
6182 _Tp
6183 operator()(const _Tp& __x, const _Tp& __y) const
6184 { return __x + __y; }
6185 };
6186 template<typename _Tp>
6187 struct minus : public binary_function<_Tp, _Tp, _Tp>
6188 {
6189 _Tp
6190 operator()(const _Tp& __x, const _Tp& __y) const
6191 { return __x - __y; }
6192 };
6193 template<typename _Tp>
6194 struct multiplies : public binary_function<_Tp, _Tp, _Tp>
6195 {
6196 _Tp
6197 operator()(const _Tp& __x, const _Tp& __y) const
6198 { return __x * __y; }
6199 };
6200 template<typename _Tp>
6201 struct divides : public binary_function<_Tp, _Tp, _Tp>
6202 {
6203 _Tp
6204 operator()(const _Tp& __x, const _Tp& __y) const
6205 { return __x / __y; }
6206 };
6207 template<typename _Tp>
6208 struct modulus : public binary_function<_Tp, _Tp, _Tp>
6209 {
6210 _Tp
6211 operator()(const _Tp& __x, const _Tp& __y) const
6212 { return __x % __y; }
6213 };
6214 template<typename _Tp>
6215 struct negate : public unary_function<_Tp, _Tp>
6216 {
6217 _Tp
6218 operator()(const _Tp& __x) const
6219 { return -__x; }
6220 };
6221 template<typename _Tp>
6222 struct equal_to : public binary_function<_Tp, _Tp, bool>
6223 {
6224 bool
6225 operator()(const _Tp& __x, const _Tp& __y) const
6226 { return __x == __y; }
6227 };
6228 template<typename _Tp>
6229 struct not_equal_to : public binary_function<_Tp, _Tp, bool>
6230 {
6231 bool
6232 operator()(const _Tp& __x, const _Tp& __y) const
6233 { return __x != __y; }
6234 };
6235 template<typename _Tp>
6236 struct greater : public binary_function<_Tp, _Tp, bool>
6237 {
6238 bool
6239 operator()(const _Tp& __x, const _Tp& __y) const
6240 { return __x > __y; }
6241 };
6242 template<typename _Tp>
6243 struct less : public binary_function<_Tp, _Tp, bool>
6244 {
6245 bool
6246 operator()(const _Tp& __x, const _Tp& __y) const
6247 { return __x < __y; }
6248 };
6249 template<typename _Tp>
6250 struct greater_equal : public binary_function<_Tp, _Tp, bool>
6251 {
6252 bool
6253 operator()(const _Tp& __x, const _Tp& __y) const
6254 { return __x >= __y; }
6255 };
6256 template<typename _Tp>
6257 struct less_equal : public binary_function<_Tp, _Tp, bool>
6258 {
6259 bool
6260 operator()(const _Tp& __x, const _Tp& __y) const
6261 { return __x <= __y; }
6262 };
6263 template<typename _Tp>
6264 struct logical_and : public binary_function<_Tp, _Tp, bool>
6265 {
6266 bool
6267 operator()(const _Tp& __x, const _Tp& __y) const
6268 { return __x && __y; }
6269 };
6270 template<typename _Tp>
6271 struct logical_or : public binary_function<_Tp, _Tp, bool>
6272 {
6273 bool
6274 operator()(const _Tp& __x, const _Tp& __y) const
6275 { return __x || __y; }
6276 };
6277 template<typename _Tp>
6278 struct logical_not : public unary_function<_Tp, bool>
6279 {
6280 bool
6281 operator()(const _Tp& __x) const
6282 { return !__x; }
6283 };
6284 template<typename _Tp>
6285 struct bit_and : public binary_function<_Tp, _Tp, _Tp>
6286 {
6287 _Tp
6288 operator()(const _Tp& __x, const _Tp& __y) const
6289 { return __x & __y; }
6290 };
6291 template<typename _Tp>
6292 struct bit_or : public binary_function<_Tp, _Tp, _Tp>
6293 {
6294 _Tp
6295 operator()(const _Tp& __x, const _Tp& __y) const
6296 { return __x | __y; }
6297 };
6298 template<typename _Tp>
6299 struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
6300 {
6301 _Tp
6302 operator()(const _Tp& __x, const _Tp& __y) const
6303 { return __x ^ __y; }
6304 };
6305 template<typename _Predicate>
6306 class unary_negate
6307 : public unary_function<typename _Predicate::argument_type, bool>
6308 {
6309 public:
6310 _Predicate _M_pred;
6311 public:
6312 explicit
6313 unary_negate(const _Predicate& __x) : _M_pred(__x) { }
6314 bool
6315 operator()(const typename _Predicate::argument_type& __x) const
6316 { return !_M_pred(__x); }
6317 };
6318 template<typename _Predicate>
6319 inline unary_negate<_Predicate>
6320 not1(const _Predicate& __pred)
6321 { return unary_negate<_Predicate>(__pred); }
6322 template<typename _Predicate>
6323 class binary_negate
6324 : public binary_function<typename _Predicate::first_argument_type,
6325 typename _Predicate::second_argument_type, bool>
6326 {
6327 public:
6328 _Predicate _M_pred;
6329 public:
6330 explicit
6331 binary_negate(const _Predicate& __x) : _M_pred(__x) { }
6332 bool
6333 operator()(const typename _Predicate::first_argument_type& __x,
6334 const typename _Predicate::second_argument_type& __y) const
6335 { return !_M_pred(__x, __y); }
6336 };
6337 template<typename _Predicate>
6338 inline binary_negate<_Predicate>
6339 not2(const _Predicate& __pred)
6340 { return binary_negate<_Predicate>(__pred); }
6341 template<typename _Arg, typename _Result>
6342 class pointer_to_unary_function : public unary_function<_Arg, _Result>
6343 {
6344 public:
6345 _Result (*_M_ptr)(_Arg);
6346 public:
6347 pointer_to_unary_function() { }
6348 explicit
6349 pointer_to_unary_function(_Result (*__x)(_Arg))
6350 : _M_ptr(__x) { }
6351 _Result
6352 operator()(_Arg __x) const
6353 { return _M_ptr(__x); }
6354 };
6355 template<typename _Arg, typename _Result>
6356 inline pointer_to_unary_function<_Arg, _Result>
6357 ptr_fun(_Result (*__x)(_Arg))
6358 { return pointer_to_unary_function<_Arg, _Result>(__x); }
6359 template<typename _Arg1, typename _Arg2, typename _Result>
6360 class pointer_to_binary_function
6361 : public binary_function<_Arg1, _Arg2, _Result>
6362 {
6363 public:
6364 _Result (*_M_ptr)(_Arg1, _Arg2);
6365 public:
6366 pointer_to_binary_function() { }
6367 explicit
6368 pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
6369 : _M_ptr(__x) { }
6370 _Result
6371 operator()(_Arg1 __x, _Arg2 __y) const
6372 { return _M_ptr(__x, __y); }
6373 };
6374 template<typename _Arg1, typename _Arg2, typename _Result>
6375 inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
6376 ptr_fun(_Result (*__x)(_Arg1, _Arg2))
6377 { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
6378 template<typename _Tp>
6379 struct _Identity : public unary_function<_Tp,_Tp>
6380 {
6381 _Tp&
6382 operator()(_Tp& __x) const
6383 { return __x; }
6384 const _Tp&
6385 operator()(const _Tp& __x) const
6386 { return __x; }
6387 };
6388 template<typename _Pair>
6389 struct _Select1st : public unary_function<_Pair,
6390 typename _Pair::first_type>
6391 {
6392 typename _Pair::first_type&
6393 operator()(_Pair& __x) const
6394 { return __x.first; }
6395 const typename _Pair::first_type&
6396 operator()(const _Pair& __x) const
6397 { return __x.first; }
6398 };
6399 template<typename _Pair>
6400 struct _Select2nd : public unary_function<_Pair,
6401 typename _Pair::second_type>
6402 {
6403 typename _Pair::second_type&
6404 operator()(_Pair& __x) const
6405 { return __x.second; }
6406 const typename _Pair::second_type&
6407 operator()(const _Pair& __x) const
6408 { return __x.second; }
6409 };
6410 template<typename _Ret, typename _Tp>
6411 class mem_fun_t : public unary_function<_Tp*, _Ret>
6412 {
6413 public:
6414 explicit
6415 mem_fun_t(_Ret (_Tp::*__pf)())
6416 : _M_f(__pf) { }
6417 _Ret
6418 operator()(_Tp* __p) const
6419 { return (__p->*_M_f)(); }
6420 private:
6421 _Ret (_Tp::*_M_f)();
6422 };
6423 template<typename _Ret, typename _Tp>
6424 class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
6425 {
6426 public:
6427 explicit
6428 const_mem_fun_t(_Ret (_Tp::*__pf)() const)
6429 : _M_f(__pf) { }
6430 _Ret
6431 operator()(const _Tp* __p) const
6432 { return (__p->*_M_f)(); }
6433 private:
6434 _Ret (_Tp::*_M_f)() const;
6435 };
6436 template<typename _Ret, typename _Tp>
6437 class mem_fun_ref_t : public unary_function<_Tp, _Ret>
6438 {
6439 public:
6440 explicit
6441 mem_fun_ref_t(_Ret (_Tp::*__pf)())
6442 : _M_f(__pf) { }
6443 _Ret
6444 operator()(_Tp& __r) const
6445 { return (__r.*_M_f)(); }
6446 private:
6447 _Ret (_Tp::*_M_f)();
6448 };
6449 template<typename _Ret, typename _Tp>
6450 class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
6451 {
6452 public:
6453 explicit
6454 const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
6455 : _M_f(__pf) { }
6456 _Ret
6457 operator()(const _Tp& __r) const
6458 { return (__r.*_M_f)(); }
6459 private:
6460 _Ret (_Tp::*_M_f)() const;
6461 };
6462 template<typename _Ret, typename _Tp, typename _Arg>
6463 class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
6464 {
6465 public:
6466 explicit
6467 mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
6468 : _M_f(__pf) { }
6469 _Ret
6470 operator()(_Tp* __p, _Arg __x) const
6471 { return (__p->*_M_f)(__x); }
6472 private:
6473 _Ret (_Tp::*_M_f)(_Arg);
6474 };
6475 template<typename _Ret, typename _Tp, typename _Arg>
6476 class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
6477 {
6478 public:
6479 explicit
6480 const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
6481 : _M_f(__pf) { }
6482 _Ret
6483 operator()(const _Tp* __p, _Arg __x) const
6484 { return (__p->*_M_f)(__x); }
6485 private:
6486 _Ret (_Tp::*_M_f)(_Arg) const;
6487 };
6488 template<typename _Ret, typename _Tp, typename _Arg>
6489 class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
6490 {
6491 public:
6492 explicit
6493 mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
6494 : _M_f(__pf) { }
6495 _Ret
6496 operator()(_Tp& __r, _Arg __x) const
6497 { return (__r.*_M_f)(__x); }
6498 private:
6499 _Ret (_Tp::*_M_f)(_Arg);
6500 };
6501 template<typename _Ret, typename _Tp, typename _Arg>
6502 class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
6503 {
6504 public:
6505 explicit
6506 const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
6507 : _M_f(__pf) { }
6508 _Ret
6509 operator()(const _Tp& __r, _Arg __x) const
6510 { return (__r.*_M_f)(__x); }
6511 private:
6512 _Ret (_Tp::*_M_f)(_Arg) const;
6513 };
6514 template<typename _Ret, typename _Tp>
6515 inline mem_fun_t<_Ret, _Tp>
6516 mem_fun(_Ret (_Tp::*__f)())
6517 { return mem_fun_t<_Ret, _Tp>(__f); }
6518 template<typename _Ret, typename _Tp>
6519 inline const_mem_fun_t<_Ret, _Tp>
6520 mem_fun(_Ret (_Tp::*__f)() const)
6521 { return const_mem_fun_t<_Ret, _Tp>(__f); }
6522 template<typename _Ret, typename _Tp>
6523 inline mem_fun_ref_t<_Ret, _Tp>
6524 mem_fun_ref(_Ret (_Tp::*__f)())
6525 { return mem_fun_ref_t<_Ret, _Tp>(__f); }
6526 template<typename _Ret, typename _Tp>
6527 inline const_mem_fun_ref_t<_Ret, _Tp>
6528 mem_fun_ref(_Ret (_Tp::*__f)() const)
6529 { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
6530 template<typename _Ret, typename _Tp, typename _Arg>
6531 inline mem_fun1_t<_Ret, _Tp, _Arg>
6532 mem_fun(_Ret (_Tp::*__f)(_Arg))
6533 { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
6534 template<typename _Ret, typename _Tp, typename _Arg>
6535 inline const_mem_fun1_t<_Ret, _Tp, _Arg>
6536 mem_fun(_Ret (_Tp::*__f)(_Arg) const)
6537 { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
6538 template<typename _Ret, typename _Tp, typename _Arg>
6539 inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
6540 mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
6541 { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
6542 template<typename _Ret, typename _Tp, typename _Arg>
6543 inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
6544 mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
6545 { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
6546 }
6547 namespace std __attribute__ ((__visibility__ ("default"))) {
6548 template<typename _Operation>
6549 class binder1st
6550 : public unary_function<typename _Operation::second_argument_type,
6551 typename _Operation::result_type>
6552 {
6553 public:
6554 _Operation op;
6555 typename _Operation::first_argument_type value;
6556 public:
6557 binder1st(const _Operation& __x,
6558 const typename _Operation::first_argument_type& __y)
6559 : op(__x), value(__y) { }
6560 typename _Operation::result_type
6561 operator()(const typename _Operation::second_argument_type& __x) const
6562 { return op(value, __x); }
6563 typename _Operation::result_type
6564 operator()(typename _Operation::second_argument_type& __x) const
6565 { return op(value, __x); }
6566 } ;
6567 template<typename _Operation, typename _Tp>
6568 inline binder1st<_Operation>
6569 bind1st(const _Operation& __fn, const _Tp& __x)
6570 {
6571 typedef typename _Operation::first_argument_type _Arg1_type;
6572 return binder1st<_Operation>(__fn, _Arg1_type(__x));
6573 }
6574 template<typename _Operation>
6575 class binder2nd
6576 : public unary_function<typename _Operation::first_argument_type,
6577 typename _Operation::result_type>
6578 {
6579 public:
6580 _Operation op;
6581 typename _Operation::second_argument_type value;
6582 public:
6583 binder2nd(const _Operation& __x,
6584 const typename _Operation::second_argument_type& __y)
6585 : op(__x), value(__y) { }
6586 typename _Operation::result_type
6587 operator()(const typename _Operation::first_argument_type& __x) const
6588 { return op(__x, value); }
6589 typename _Operation::result_type
6590 operator()(typename _Operation::first_argument_type& __x) const
6591 { return op(__x, value); }
6592 } ;
6593 template<typename _Operation, typename _Tp>
6594 inline binder2nd<_Operation>
6595 bind2nd(const _Operation& __fn, const _Tp& __x)
6596 {
6597 typedef typename _Operation::second_argument_type _Arg2_type;
6598 return binder2nd<_Operation>(__fn, _Arg2_type(__x));
6599 }
6600 }
6601
6602 struct timespec
6603 {
6604 __time_t tv_sec;
6605 long int tv_nsec;
6606 };
6607 struct sched_param
6608 {
6609 int __sched_priority;
6610 };
6611 extern "C" {
6612 extern int clone (int (*__fn) (void *__arg), void *__child_stack,
6613 int __flags, void *__arg, ...) throw ();
6614 extern int unshare (int __flags) throw ();
6615 extern int sched_getcpu (void) throw ();
6616 }
6617 struct __sched_param
6618 {
6619 int __sched_priority;
6620 };
6621 typedef unsigned long int __cpu_mask;
6622 typedef struct
6623 {
6624 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
6625 } cpu_set_t;
6626 extern "C" {
6627 extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
6628 throw ();
6629 extern cpu_set_t *__sched_cpualloc (size_t __count) throw () __attribute__ ((__warn_unused_result__));
6630 extern void __sched_cpufree (cpu_set_t *__set) throw ();
6631 }
6632 extern "C" {
6633 extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
6634 throw ();
6635 extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
6636 extern int sched_setscheduler (__pid_t __pid, int __policy,
6637 __const struct sched_param *__param) throw ();
6638 extern int sched_getscheduler (__pid_t __pid) throw ();
6639 extern int sched_yield (void) throw ();
6640 extern int sched_get_priority_max (int __algorithm) throw ();
6641 extern int sched_get_priority_min (int __algorithm) throw ();
6642 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
6643 extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
6644 __const cpu_set_t *__cpuset) throw ();
6645 extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
6646 cpu_set_t *__cpuset) throw ();
6647 }
6648 extern "C" {
6649 typedef __clock_t clock_t;
6650 typedef __time_t time_t;
6651 typedef __clockid_t clockid_t;
6652 typedef __timer_t timer_t;
6653 struct tm
6654 {
6655 int tm_sec;
6656 int tm_min;
6657 int tm_hour;
6658 int tm_mday;
6659 int tm_mon;
6660 int tm_year;
6661 int tm_wday;
6662 int tm_yday;
6663 int tm_isdst;
6664 long int tm_gmtoff;
6665 __const char *tm_zone;
6666 };
6667 struct itimerspec
6668 {
6669 struct timespec it_interval;
6670 struct timespec it_value;
6671 };
6672 struct sigevent;
6673 typedef __pid_t pid_t;
6674 extern clock_t clock (void) throw ();
6675 extern time_t time (time_t *__timer) throw ();
6676 extern double difftime (time_t __time1, time_t __time0)
6677 throw () __attribute__ ((__const__));
6678 extern time_t mktime (struct tm *__tp) throw ();
6679 extern size_t strftime (char *__restrict __s, size_t __maxsize,
6680 __const char *__restrict __format,
6681 __const struct tm *__restrict __tp) throw ();
6682 extern char *strptime (__const char *__restrict __s,
6683 __const char *__restrict __fmt, struct tm *__tp)
6684 throw ();
6685 extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
6686 __const char *__restrict __format,
6687 __const struct tm *__restrict __tp,
6688 __locale_t __loc) throw ();
6689 extern char *strptime_l (__const char *__restrict __s,
6690 __const char *__restrict __fmt, struct tm *__tp,
6691 __locale_t __loc) throw ();
6692 extern struct tm *gmtime (__const time_t *__timer) throw ();
6693 extern struct tm *localtime (__const time_t *__timer) throw ();
6694 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
6695 struct tm *__restrict __tp) throw ();
6696 extern struct tm *localtime_r (__const time_t *__restrict __timer,
6697 struct tm *__restrict __tp) throw ();
6698 extern char *asctime (__const struct tm *__tp) throw ();
6699 extern char *ctime (__const time_t *__timer) throw ();
6700 extern char *asctime_r (__const struct tm *__restrict __tp,
6701 char *__restrict __buf) throw ();
6702 extern char *ctime_r (__const time_t *__restrict __timer,
6703 char *__restrict __buf) throw ();
6704 extern char *__tzname[2];
6705 extern int __daylight;
6706 extern long int __timezone;
6707 extern char *tzname[2];
6708 extern void tzset (void) throw ();
6709 extern int daylight;
6710 extern long int timezone;
6711 extern int stime (__const time_t *__when) throw ();
6712 extern time_t timegm (struct tm *__tp) throw ();
6713 extern time_t timelocal (struct tm *__tp) throw ();
6714 extern int dysize (int __year) throw () __attribute__ ((__const__));
6715 extern int nanosleep (__const struct timespec *__requested_time,
6716 struct timespec *__remaining);
6717 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
6718 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
6719 extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
6720 throw ();
6721 extern int clock_nanosleep (clockid_t __clock_id, int __flags,
6722 __const struct timespec *__req,
6723 struct timespec *__rem);
6724 extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
6725 extern int timer_create (clockid_t __clock_id,
6726 struct sigevent *__restrict __evp,
6727 timer_t *__restrict __timerid) throw ();
6728 extern int timer_delete (timer_t __timerid) throw ();
6729 extern int timer_settime (timer_t __timerid, int __flags,
6730 __const struct itimerspec *__restrict __value,
6731 struct itimerspec *__restrict __ovalue) throw ();
6732 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
6733 throw ();
6734 extern int timer_getoverrun (timer_t __timerid) throw ();
6735 extern int getdate_err;
6736 extern struct tm *getdate (__const char *__string);
6737 extern int getdate_r (__const char *__restrict __string,
6738 struct tm *__restrict __resbufp);
6739 }
6740 extern "C" {
6741 typedef int __sig_atomic_t;
6742 typedef struct
6743 {
6744 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
6745 } __sigset_t;
6746 typedef __sigset_t sigset_t;
6747 }
6748 typedef unsigned long int pthread_t;
6749 typedef union
6750 {
6751 char __size[56];
6752 long int __align;
6753 } pthread_attr_t;
6754 typedef struct __pthread_internal_list
6755 {
6756 struct __pthread_internal_list *__prev;
6757 struct __pthread_internal_list *__next;
6758 } __pthread_list_t;
6759 typedef union
6760 {
6761 struct __pthread_mutex_s
6762 {
6763 int __lock;
6764 unsigned int __count;
6765 int __owner;
6766 unsigned int __nusers;
6767 int __kind;
6768 int __spins;
6769 __pthread_list_t __list;
6770 } __data;
6771 char __size[40];
6772 long int __align;
6773 } pthread_mutex_t;
6774 typedef union
6775 {
6776 char __size[4];
6777 int __align;
6778 } pthread_mutexattr_t;
6779 typedef union
6780 {
6781 struct
6782 {
6783 int __lock;
6784 unsigned int __futex;
6785 __extension__ unsigned long long int __total_seq;
6786 __extension__ unsigned long long int __wakeup_seq;
6787 __extension__ unsigned long long int __woken_seq;
6788 void *__mutex;
6789 unsigned int __nwaiters;
6790 unsigned int __broadcast_seq;
6791 } __data;
6792 char __size[48];
6793 __extension__ long long int __align;
6794 } pthread_cond_t;
6795 typedef union
6796 {
6797 char __size[4];
6798 int __align;
6799 } pthread_condattr_t;
6800 typedef unsigned int pthread_key_t;
6801 typedef int pthread_once_t;
6802 typedef union
6803 {
6804 struct
6805 {
6806 int __lock;
6807 unsigned int __nr_readers;
6808 unsigned int __readers_wakeup;
6809 unsigned int __writer_wakeup;
6810 unsigned int __nr_readers_queued;
6811 unsigned int __nr_writers_queued;
6812 int __writer;
6813 int __shared;
6814 unsigned long int __pad1;
6815 unsigned long int __pad2;
6816 unsigned int __flags;
6817 } __data;
6818 char __size[56];
6819 long int __align;
6820 } pthread_rwlock_t;
6821 typedef union
6822 {
6823 char __size[8];
6824 long int __align;
6825 } pthread_rwlockattr_t;
6826 typedef volatile int pthread_spinlock_t;
6827 typedef union
6828 {
6829 char __size[32];
6830 long int __align;
6831 } pthread_barrier_t;
6832 typedef union
6833 {
6834 char __size[4];
6835 int __align;
6836 } pthread_barrierattr_t;
6837 typedef long int __jmp_buf[8];
6838 enum
6839 {
6840 PTHREAD_CREATE_JOINABLE,
6841 PTHREAD_CREATE_DETACHED
6842 };
6843 enum
6844 {
6845 PTHREAD_MUTEX_TIMED_NP,
6846 PTHREAD_MUTEX_RECURSIVE_NP,
6847 PTHREAD_MUTEX_ERRORCHECK_NP,
6848 PTHREAD_MUTEX_ADAPTIVE_NP
6849 ,
6850 PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
6851 PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
6852 PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
6853 PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
6854 , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
6855 };
6856 enum
6857 {
6858 PTHREAD_MUTEX_STALLED,
6859 PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
6860 PTHREAD_MUTEX_ROBUST,
6861 PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
6862 };
6863 enum
6864 {
6865 PTHREAD_PRIO_NONE,
6866 PTHREAD_PRIO_INHERIT,
6867 PTHREAD_PRIO_PROTECT
6868 };
6869 enum
6870 {
6871 PTHREAD_RWLOCK_PREFER_READER_NP,
6872 PTHREAD_RWLOCK_PREFER_WRITER_NP,
6873 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
6874 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
6875 };
6876 enum
6877 {
6878 PTHREAD_INHERIT_SCHED,
6879 PTHREAD_EXPLICIT_SCHED
6880 };
6881 enum
6882 {
6883 PTHREAD_SCOPE_SYSTEM,
6884 PTHREAD_SCOPE_PROCESS
6885 };
6886 enum
6887 {
6888 PTHREAD_PROCESS_PRIVATE,
6889 PTHREAD_PROCESS_SHARED
6890 };
6891 struct _pthread_cleanup_buffer
6892 {
6893 void (*__routine) (void *);
6894 void *__arg;
6895 int __canceltype;
6896 struct _pthread_cleanup_buffer *__prev;
6897 };
6898 enum
6899 {
6900 PTHREAD_CANCEL_ENABLE,
6901 PTHREAD_CANCEL_DISABLE
6902 };
6903 enum
6904 {
6905 PTHREAD_CANCEL_DEFERRED,
6906 PTHREAD_CANCEL_ASYNCHRONOUS
6907 };
6908 extern "C" {
6909 extern int pthread_create (pthread_t *__restrict __newthread,
6910 __const pthread_attr_t *__restrict __attr,
6911 void *(*__start_routine) (void *),
6912 void *__restrict __arg) throw () __attribute__ ((__nonnull__ (1, 3)));
6913 extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
6914 extern int pthread_join (pthread_t __th, void **__thread_return);
6915 extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) throw ();
6916 extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
6917 __const struct timespec *__abstime);
6918 extern int pthread_detach (pthread_t __th) throw ();
6919 extern pthread_t pthread_self (void) throw () __attribute__ ((__const__));
6920 extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();
6921 extern int pthread_attr_init (pthread_attr_t *__attr) throw () __attribute__ ((__nonnull__ (1)));
6922 extern int pthread_attr_destroy (pthread_attr_t *__attr)
6923 throw () __attribute__ ((__nonnull__ (1)));
6924 extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
6925 int *__detachstate)
6926 throw () __attribute__ ((__nonnull__ (1, 2)));
6927 extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
6928 int __detachstate)
6929 throw () __attribute__ ((__nonnull__ (1)));
6930 extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
6931 size_t *__guardsize)
6932 throw () __attribute__ ((__nonnull__ (1, 2)));
6933 extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
6934 size_t __guardsize)
6935 throw () __attribute__ ((__nonnull__ (1)));
6936 extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
6937 __attr,
6938 struct sched_param *__restrict __param)
6939 throw () __attribute__ ((__nonnull__ (1, 2)));
6940 extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
6941 __const struct sched_param *__restrict
6942 __param) throw () __attribute__ ((__nonnull__ (1, 2)));
6943 extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
6944 __attr, int *__restrict __policy)
6945 throw () __attribute__ ((__nonnull__ (1, 2)));
6946 extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
6947 throw () __attribute__ ((__nonnull__ (1)));
6948 extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
6949 __attr, int *__restrict __inherit)
6950 throw () __attribute__ ((__nonnull__ (1, 2)));
6951 extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
6952 int __inherit)
6953 throw () __attribute__ ((__nonnull__ (1)));
6954 extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
6955 int *__restrict __scope)
6956 throw () __attribute__ ((__nonnull__ (1, 2)));
6957 extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
6958 throw () __attribute__ ((__nonnull__ (1)));
6959 extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
6960 __attr, void **__restrict __stackaddr)
6961 throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
6962 extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
6963 void *__stackaddr)
6964 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
6965 extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
6966 __attr, size_t *__restrict __stacksize)
6967 throw () __attribute__ ((__nonnull__ (1, 2)));
6968 extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
6969 size_t __stacksize)
6970 throw () __attribute__ ((__nonnull__ (1)));
6971 extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
6972 void **__restrict __stackaddr,
6973 size_t *__restrict __stacksize)
6974 throw () __attribute__ ((__nonnull__ (1, 2, 3)));
6975 extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
6976 size_t __stacksize) throw () __attribute__ ((__nonnull__ (1)));
6977 extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
6978 size_t __cpusetsize,
6979 __const cpu_set_t *__cpuset)
6980 throw () __attribute__ ((__nonnull__ (1, 3)));
6981 extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
6982 size_t __cpusetsize,
6983 cpu_set_t *__cpuset)
6984 throw () __attribute__ ((__nonnull__ (1, 3)));
6985 extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
6986 throw () __attribute__ ((__nonnull__ (2)));
6987 extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
6988 __const struct sched_param *__param)
6989 throw () __attribute__ ((__nonnull__ (3)));
6990 extern int pthread_getschedparam (pthread_t __target_thread,
6991 int *__restrict __policy,
6992 struct sched_param *__restrict __param)
6993 throw () __attribute__ ((__nonnull__ (2, 3)));
6994 extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
6995 throw ();
6996 extern int pthread_getconcurrency (void) throw ();
6997 extern int pthread_setconcurrency (int __level) throw ();
6998 extern int pthread_yield (void) throw ();
6999 extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
7000 __const cpu_set_t *__cpuset)
7001 throw () __attribute__ ((__nonnull__ (3)));
7002 extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
7003 cpu_set_t *__cpuset)
7004 throw () __attribute__ ((__nonnull__ (3)));
7005 extern int pthread_once (pthread_once_t *__once_control,
7006 void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
7007 extern int pthread_setcancelstate (int __state, int *__oldstate);
7008 extern int pthread_setcanceltype (int __type, int *__oldtype);
7009 extern int pthread_cancel (pthread_t __th);
7010 extern void pthread_testcancel (void);
7011 typedef struct
7012 {
7013 struct
7014 {
7015 __jmp_buf __cancel_jmp_buf;
7016 int __mask_was_saved;
7017 } __cancel_jmp_buf[1];
7018 void *__pad[4];
7019 } __pthread_unwind_buf_t __attribute__ ((__aligned__));
7020 struct __pthread_cleanup_frame
7021 {
7022 void (*__cancel_routine) (void *);
7023 void *__cancel_arg;
7024 int __do_it;
7025 int __cancel_type;
7026 };
7027 class __pthread_cleanup_class
7028 {
7029 void (*__cancel_routine) (void *);
7030 void *__cancel_arg;
7031 int __do_it;
7032 int __cancel_type;
7033 public:
7034 __pthread_cleanup_class (void (*__fct) (void *), void *__arg)
7035 : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }
7036 ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }
7037 void __setdoit (int __newval) { __do_it = __newval; }
7038 void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,
7039 &__cancel_type); }
7040 void __restore () const { pthread_setcanceltype (__cancel_type, 0); }
7041 };
7042 struct __jmp_buf_tag;
7043 extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) throw ();
7044 extern int pthread_mutex_init (pthread_mutex_t *__mutex,
7045 __const pthread_mutexattr_t *__mutexattr)
7046 throw () __attribute__ ((__nonnull__ (1)));
7047 extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
7048 throw () __attribute__ ((__nonnull__ (1)));
7049 extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
7050 throw () __attribute__ ((__nonnull__ (1)));
7051 extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
7052 throw () __attribute__ ((__nonnull__ (1)));
7053 extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
7054 __const struct timespec *__restrict
7055 __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
7056 extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
7057 throw () __attribute__ ((__nonnull__ (1)));
7058 extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
7059 __restrict __mutex,
7060 int *__restrict __prioceiling)
7061 throw () __attribute__ ((__nonnull__ (1, 2)));
7062 extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
7063 int __prioceiling,
7064 int *__restrict __old_ceiling)
7065 throw () __attribute__ ((__nonnull__ (1, 3)));
7066 extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
7067 throw () __attribute__ ((__nonnull__ (1)));
7068 extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
7069 throw () __attribute__ ((__nonnull__ (1)));
7070 extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
7071 throw () __attribute__ ((__nonnull__ (1)));
7072 extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
7073 throw () __attribute__ ((__nonnull__ (1)));
7074 extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
7075 __restrict __attr,
7076 int *__restrict __pshared)
7077 throw () __attribute__ ((__nonnull__ (1, 2)));
7078 extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
7079 int __pshared)
7080 throw () __attribute__ ((__nonnull__ (1)));
7081 extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
7082 __attr, int *__restrict __kind)
7083 throw () __attribute__ ((__nonnull__ (1, 2)));
7084 extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
7085 throw () __attribute__ ((__nonnull__ (1)));
7086 extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
7087 __restrict __attr,
7088 int *__restrict __protocol)
7089 throw () __attribute__ ((__nonnull__ (1, 2)));
7090 extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
7091 int __protocol)
7092 throw () __attribute__ ((__nonnull__ (1)));
7093 extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
7094 __restrict __attr,
7095 int *__restrict __prioceiling)
7096 throw () __attribute__ ((__nonnull__ (1, 2)));
7097 extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
7098 int __prioceiling)
7099 throw () __attribute__ ((__nonnull__ (1)));
7100 extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
7101 int *__robustness)
7102 throw () __attribute__ ((__nonnull__ (1, 2)));
7103 extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
7104 int *__robustness)
7105 throw () __attribute__ ((__nonnull__ (1, 2)));
7106 extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
7107 int __robustness)
7108 throw () __attribute__ ((__nonnull__ (1)));
7109 extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
7110 int __robustness)
7111 throw () __attribute__ ((__nonnull__ (1)));
7112 extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
7113 __const pthread_rwlockattr_t *__restrict
7114 __attr) throw () __attribute__ ((__nonnull__ (1)));
7115 extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
7116 throw () __attribute__ ((__nonnull__ (1)));
7117 extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
7118 throw () __attribute__ ((__nonnull__ (1)));
7119 extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
7120 throw () __attribute__ ((__nonnull__ (1)));
7121 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
7122 __const struct timespec *__restrict
7123 __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
7124 extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
7125 throw () __attribute__ ((__nonnull__ (1)));
7126 extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
7127 throw () __attribute__ ((__nonnull__ (1)));
7128 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
7129 __const struct timespec *__restrict
7130 __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
7131 extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
7132 throw () __attribute__ ((__nonnull__ (1)));
7133 extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
7134 throw () __attribute__ ((__nonnull__ (1)));
7135 extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
7136 throw () __attribute__ ((__nonnull__ (1)));
7137 extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
7138 __restrict __attr,
7139 int *__restrict __pshared)
7140 throw () __attribute__ ((__nonnull__ (1, 2)));
7141 extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
7142 int __pshared)
7143 throw () __attribute__ ((__nonnull__ (1)));
7144 extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
7145 __restrict __attr,
7146 int *__restrict __pref)
7147 throw () __attribute__ ((__nonnull__ (1, 2)));
7148 extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
7149 int __pref) throw () __attribute__ ((__nonnull__ (1)));
7150 extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
7151 __const pthread_condattr_t *__restrict
7152 __cond_attr) throw () __attribute__ ((__nonnull__ (1)));
7153 extern int pthread_cond_destroy (pthread_cond_t *__cond)
7154 throw () __attribute__ ((__nonnull__ (1)));
7155 extern int pthread_cond_signal (pthread_cond_t *__cond)
7156 throw () __attribute__ ((__nonnull__ (1)));
7157 extern int pthread_cond_broadcast (pthread_cond_t *__cond)
7158 throw () __attribute__ ((__nonnull__ (1)));
7159 extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
7160 pthread_mutex_t *__restrict __mutex)
7161 __attribute__ ((__nonnull__ (1, 2)));
7162 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
7163 pthread_mutex_t *__restrict __mutex,
7164 __const struct timespec *__restrict
7165 __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
7166 extern int pthread_condattr_init (pthread_condattr_t *__attr)
7167 throw () __attribute__ ((__nonnull__ (1)));
7168 extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
7169 throw () __attribute__ ((__nonnull__ (1)));
7170 extern int pthread_condattr_getpshared (__const pthread_condattr_t *
7171 __restrict __attr,
7172 int *__restrict __pshared)
7173 throw () __attribute__ ((__nonnull__ (1, 2)));
7174 extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
7175 int __pshared) throw () __attribute__ ((__nonnull__ (1)));
7176 extern int pthread_condattr_getclock (__const pthread_condattr_t *
7177 __restrict __attr,
7178 __clockid_t *__restrict __clock_id)
7179 throw () __attribute__ ((__nonnull__ (1, 2)));
7180 extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
7181 __clockid_t __clock_id)
7182 throw () __attribute__ ((__nonnull__ (1)));
7183 extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
7184 throw () __attribute__ ((__nonnull__ (1)));
7185 extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
7186 throw () __attribute__ ((__nonnull__ (1)));
7187 extern int pthread_spin_lock (pthread_spinlock_t *__lock)
7188 throw () __attribute__ ((__nonnull__ (1)));
7189 extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
7190 throw () __attribute__ ((__nonnull__ (1)));
7191 extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
7192 throw () __attribute__ ((__nonnull__ (1)));
7193 extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
7194 __const pthread_barrierattr_t *__restrict
7195 __attr, unsigned int __count)
7196 throw () __attribute__ ((__nonnull__ (1)));
7197 extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
7198 throw () __attribute__ ((__nonnull__ (1)));
7199 extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
7200 throw () __attribute__ ((__nonnull__ (1)));
7201 extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
7202 throw () __attribute__ ((__nonnull__ (1)));
7203 extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
7204 throw () __attribute__ ((__nonnull__ (1)));
7205 extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
7206 __restrict __attr,
7207 int *__restrict __pshared)
7208 throw () __attribute__ ((__nonnull__ (1, 2)));
7209 extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
7210 int __pshared)
7211 throw () __attribute__ ((__nonnull__ (1)));
7212 extern int pthread_key_create (pthread_key_t *__key,
7213 void (*__destr_function) (void *))
7214 throw () __attribute__ ((__nonnull__ (1)));
7215 extern int pthread_key_delete (pthread_key_t __key) throw ();
7216 extern void *pthread_getspecific (pthread_key_t __key) throw ();
7217 extern int pthread_setspecific (pthread_key_t __key,
7218 __const void *__pointer) throw () ;
7219 extern int pthread_getcpuclockid (pthread_t __thread_id,
7220 __clockid_t *__clock_id)
7221 throw () __attribute__ ((__nonnull__ (2)));
7222 extern int pthread_atfork (void (*__prepare) (void),
7223 void (*__parent) (void),
7224 void (*__child) (void)) throw ();
7225 extern __inline __attribute__ ((__gnu_inline__)) int
7226 pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ()
7227 {
7228 return __thread1 == __thread2;
7229 }
7230 }
7231 extern "C" {
7232 typedef __ssize_t ssize_t;
7233 typedef __gid_t gid_t;
7234 typedef __uid_t uid_t;
7235 typedef __off_t off_t;
7236 typedef __off64_t off64_t;
7237 typedef __useconds_t useconds_t;
7238 typedef __intptr_t intptr_t;
7239 typedef __socklen_t socklen_t;
7240 extern int access (__const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1)));
7241 extern int euidaccess (__const char *__name, int __type)
7242 throw () __attribute__ ((__nonnull__ (1)));
7243 extern int eaccess (__const char *__name, int __type)
7244 throw () __attribute__ ((__nonnull__ (1)));
7245 extern int faccessat (int __fd, __const char *__file, int __type, int __flag)
7246 throw () __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
7247 extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
7248 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
7249 throw ();
7250 extern int close (int __fd);
7251 extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __attribute__ ((__warn_unused_result__));
7252 extern ssize_t write (int __fd, __const void *__buf, size_t __n) __attribute__ ((__warn_unused_result__));
7253 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
7254 __off_t __offset) __attribute__ ((__warn_unused_result__));
7255 extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
7256 __off_t __offset) __attribute__ ((__warn_unused_result__));
7257 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
7258 __off64_t __offset) __attribute__ ((__warn_unused_result__));
7259 extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
7260 __off64_t __offset) __attribute__ ((__warn_unused_result__));
7261 extern int pipe (int __pipedes[2]) throw () __attribute__ ((__warn_unused_result__));
7262 extern int pipe2 (int __pipedes[2], int __flags) throw () __attribute__ ((__warn_unused_result__));
7263 extern unsigned int alarm (unsigned int __seconds) throw ();
7264 extern unsigned int sleep (unsigned int __seconds);
7265 extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
7266 throw ();
7267 extern int usleep (__useconds_t __useconds);
7268 extern int pause (void);
7269 extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
7270 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7271 extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () __attribute__ ((__warn_unused_result__));
7272 extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
7273 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7274 extern int fchownat (int __fd, __const char *__file, __uid_t __owner,
7275 __gid_t __group, int __flag)
7276 throw () __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
7277 extern int chdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7278 extern int fchdir (int __fd) throw () __attribute__ ((__warn_unused_result__));
7279 extern char *getcwd (char *__buf, size_t __size) throw () __attribute__ ((__warn_unused_result__));
7280 extern char *get_current_dir_name (void) throw ();
7281 extern char *getwd (char *__buf)
7282 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) __attribute__ ((__warn_unused_result__));
7283 extern int dup (int __fd) throw () __attribute__ ((__warn_unused_result__));
7284 extern int dup2 (int __fd, int __fd2) throw ();
7285 extern int dup3 (int __fd, int __fd2, int __flags) throw ();
7286 extern char **__environ;
7287 extern char **environ;
7288 extern int execve (__const char *__path, char *__const __argv[],
7289 char *__const __envp[]) throw () __attribute__ ((__nonnull__ (1)));
7290 extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
7291 throw ();
7292 extern int execv (__const char *__path, char *__const __argv[])
7293 throw () __attribute__ ((__nonnull__ (1)));
7294 extern int execle (__const char *__path, __const char *__arg, ...)
7295 throw () __attribute__ ((__nonnull__ (1)));
7296 extern int execl (__const char *__path, __const char *__arg, ...)
7297 throw () __attribute__ ((__nonnull__ (1)));
7298 extern int execvp (__const char *__file, char *__const __argv[])
7299 throw () __attribute__ ((__nonnull__ (1)));
7300 extern int execlp (__const char *__file, __const char *__arg, ...)
7301 throw () __attribute__ ((__nonnull__ (1)));
7302 extern int execvpe (__const char *__file, char *__const __argv[],
7303 char *__const __envp[])
7304 throw () __attribute__ ((__nonnull__ (1)));
7305 extern int nice (int __inc) throw () __attribute__ ((__warn_unused_result__));
7306 extern void _exit (int __status) __attribute__ ((__noreturn__));
7307 enum
7308 {
7309 _PC_LINK_MAX,
7310 _PC_MAX_CANON,
7311 _PC_MAX_INPUT,
7312 _PC_NAME_MAX,
7313 _PC_PATH_MAX,
7314 _PC_PIPE_BUF,
7315 _PC_CHOWN_RESTRICTED,
7316 _PC_NO_TRUNC,
7317 _PC_VDISABLE,
7318 _PC_SYNC_IO,
7319 _PC_ASYNC_IO,
7320 _PC_PRIO_IO,
7321 _PC_SOCK_MAXBUF,
7322 _PC_FILESIZEBITS,
7323 _PC_REC_INCR_XFER_SIZE,
7324 _PC_REC_MAX_XFER_SIZE,
7325 _PC_REC_MIN_XFER_SIZE,
7326 _PC_REC_XFER_ALIGN,
7327 _PC_ALLOC_SIZE_MIN,
7328 _PC_SYMLINK_MAX,
7329 _PC_2_SYMLINKS
7330 };
7331 enum
7332 {
7333 _SC_ARG_MAX,
7334 _SC_CHILD_MAX,
7335 _SC_CLK_TCK,
7336 _SC_NGROUPS_MAX,
7337 _SC_OPEN_MAX,
7338 _SC_STREAM_MAX,
7339 _SC_TZNAME_MAX,
7340 _SC_JOB_CONTROL,
7341 _SC_SAVED_IDS,
7342 _SC_REALTIME_SIGNALS,
7343 _SC_PRIORITY_SCHEDULING,
7344 _SC_TIMERS,
7345 _SC_ASYNCHRONOUS_IO,
7346 _SC_PRIORITIZED_IO,
7347 _SC_SYNCHRONIZED_IO,
7348 _SC_FSYNC,
7349 _SC_MAPPED_FILES,
7350 _SC_MEMLOCK,
7351 _SC_MEMLOCK_RANGE,
7352 _SC_MEMORY_PROTECTION,
7353 _SC_MESSAGE_PASSING,
7354 _SC_SEMAPHORES,
7355 _SC_SHARED_MEMORY_OBJECTS,
7356 _SC_AIO_LISTIO_MAX,
7357 _SC_AIO_MAX,
7358 _SC_AIO_PRIO_DELTA_MAX,
7359 _SC_DELAYTIMER_MAX,
7360 _SC_MQ_OPEN_MAX,
7361 _SC_MQ_PRIO_MAX,
7362 _SC_VERSION,
7363 _SC_PAGESIZE,
7364 _SC_RTSIG_MAX,
7365 _SC_SEM_NSEMS_MAX,
7366 _SC_SEM_VALUE_MAX,
7367 _SC_SIGQUEUE_MAX,
7368 _SC_TIMER_MAX,
7369 _SC_BC_BASE_MAX,
7370 _SC_BC_DIM_MAX,
7371 _SC_BC_SCALE_MAX,
7372 _SC_BC_STRING_MAX,
7373 _SC_COLL_WEIGHTS_MAX,
7374 _SC_EQUIV_CLASS_MAX,
7375 _SC_EXPR_NEST_MAX,
7376 _SC_LINE_MAX,
7377 _SC_RE_DUP_MAX,
7378 _SC_CHARCLASS_NAME_MAX,
7379 _SC_2_VERSION,
7380 _SC_2_C_BIND,
7381 _SC_2_C_DEV,
7382 _SC_2_FORT_DEV,
7383 _SC_2_FORT_RUN,
7384 _SC_2_SW_DEV,
7385 _SC_2_LOCALEDEF,
7386 _SC_PII,
7387 _SC_PII_XTI,
7388 _SC_PII_SOCKET,
7389 _SC_PII_INTERNET,
7390 _SC_PII_OSI,
7391 _SC_POLL,
7392 _SC_SELECT,
7393 _SC_UIO_MAXIOV,
7394 _SC_IOV_MAX = _SC_UIO_MAXIOV,
7395 _SC_PII_INTERNET_STREAM,
7396 _SC_PII_INTERNET_DGRAM,
7397 _SC_PII_OSI_COTS,
7398 _SC_PII_OSI_CLTS,
7399 _SC_PII_OSI_M,
7400 _SC_T_IOV_MAX,
7401 _SC_THREADS,
7402 _SC_THREAD_SAFE_FUNCTIONS,
7403 _SC_GETGR_R_SIZE_MAX,
7404 _SC_GETPW_R_SIZE_MAX,
7405 _SC_LOGIN_NAME_MAX,
7406 _SC_TTY_NAME_MAX,
7407 _SC_THREAD_DESTRUCTOR_ITERATIONS,
7408 _SC_THREAD_KEYS_MAX,
7409 _SC_THREAD_STACK_MIN,
7410 _SC_THREAD_THREADS_MAX,
7411 _SC_THREAD_ATTR_STACKADDR,
7412 _SC_THREAD_ATTR_STACKSIZE,
7413 _SC_THREAD_PRIORITY_SCHEDULING,
7414 _SC_THREAD_PRIO_INHERIT,
7415 _SC_THREAD_PRIO_PROTECT,
7416 _SC_THREAD_PROCESS_SHARED,
7417 _SC_NPROCESSORS_CONF,
7418 _SC_NPROCESSORS_ONLN,
7419 _SC_PHYS_PAGES,
7420 _SC_AVPHYS_PAGES,
7421 _SC_ATEXIT_MAX,
7422 _SC_PASS_MAX,
7423 _SC_XOPEN_VERSION,
7424 _SC_XOPEN_XCU_VERSION,
7425 _SC_XOPEN_UNIX,
7426 _SC_XOPEN_CRYPT,
7427 _SC_XOPEN_ENH_I18N,
7428 _SC_XOPEN_SHM,
7429 _SC_2_CHAR_TERM,
7430 _SC_2_C_VERSION,
7431 _SC_2_UPE,
7432 _SC_XOPEN_XPG2,
7433 _SC_XOPEN_XPG3,
7434 _SC_XOPEN_XPG4,
7435 _SC_CHAR_BIT,
7436 _SC_CHAR_MAX,
7437 _SC_CHAR_MIN,
7438 _SC_INT_MAX,
7439 _SC_INT_MIN,
7440 _SC_LONG_BIT,
7441 _SC_WORD_BIT,
7442 _SC_MB_LEN_MAX,
7443 _SC_NZERO,
7444 _SC_SSIZE_MAX,
7445 _SC_SCHAR_MAX,
7446 _SC_SCHAR_MIN,
7447 _SC_SHRT_MAX,
7448 _SC_SHRT_MIN,
7449 _SC_UCHAR_MAX,
7450 _SC_UINT_MAX,
7451 _SC_ULONG_MAX,
7452 _SC_USHRT_MAX,
7453 _SC_NL_ARGMAX,
7454 _SC_NL_LANGMAX,
7455 _SC_NL_MSGMAX,
7456 _SC_NL_NMAX,
7457 _SC_NL_SETMAX,
7458 _SC_NL_TEXTMAX,
7459 _SC_XBS5_ILP32_OFF32,
7460 _SC_XBS5_ILP32_OFFBIG,
7461 _SC_XBS5_LP64_OFF64,
7462 _SC_XBS5_LPBIG_OFFBIG,
7463 _SC_XOPEN_LEGACY,
7464 _SC_XOPEN_REALTIME,
7465 _SC_XOPEN_REALTIME_THREADS,
7466 _SC_ADVISORY_INFO,
7467 _SC_BARRIERS,
7468 _SC_BASE,
7469 _SC_C_LANG_SUPPORT,
7470 _SC_C_LANG_SUPPORT_R,
7471 _SC_CLOCK_SELECTION,
7472 _SC_CPUTIME,
7473 _SC_THREAD_CPUTIME,
7474 _SC_DEVICE_IO,
7475 _SC_DEVICE_SPECIFIC,
7476 _SC_DEVICE_SPECIFIC_R,
7477 _SC_FD_MGMT,
7478 _SC_FIFO,
7479 _SC_PIPE,
7480 _SC_FILE_ATTRIBUTES,
7481 _SC_FILE_LOCKING,
7482 _SC_FILE_SYSTEM,
7483 _SC_MONOTONIC_CLOCK,
7484 _SC_MULTI_PROCESS,
7485 _SC_SINGLE_PROCESS,
7486 _SC_NETWORKING,
7487 _SC_READER_WRITER_LOCKS,
7488 _SC_SPIN_LOCKS,
7489 _SC_REGEXP,
7490 _SC_REGEX_VERSION,
7491 _SC_SHELL,
7492 _SC_SIGNALS,
7493 _SC_SPAWN,
7494 _SC_SPORADIC_SERVER,
7495 _SC_THREAD_SPORADIC_SERVER,
7496 _SC_SYSTEM_DATABASE,
7497 _SC_SYSTEM_DATABASE_R,
7498 _SC_TIMEOUTS,
7499 _SC_TYPED_MEMORY_OBJECTS,
7500 _SC_USER_GROUPS,
7501 _SC_USER_GROUPS_R,
7502 _SC_2_PBS,
7503 _SC_2_PBS_ACCOUNTING,
7504 _SC_2_PBS_LOCATE,
7505 _SC_2_PBS_MESSAGE,
7506 _SC_2_PBS_TRACK,
7507 _SC_SYMLOOP_MAX,
7508 _SC_STREAMS,
7509 _SC_2_PBS_CHECKPOINT,
7510 _SC_V6_ILP32_OFF32,
7511 _SC_V6_ILP32_OFFBIG,
7512 _SC_V6_LP64_OFF64,
7513 _SC_V6_LPBIG_OFFBIG,
7514 _SC_HOST_NAME_MAX,
7515 _SC_TRACE,
7516 _SC_TRACE_EVENT_FILTER,
7517 _SC_TRACE_INHERIT,
7518 _SC_TRACE_LOG,
7519 _SC_LEVEL1_ICACHE_SIZE,
7520 _SC_LEVEL1_ICACHE_ASSOC,
7521 _SC_LEVEL1_ICACHE_LINESIZE,
7522 _SC_LEVEL1_DCACHE_SIZE,
7523 _SC_LEVEL1_DCACHE_ASSOC,
7524 _SC_LEVEL1_DCACHE_LINESIZE,
7525 _SC_LEVEL2_CACHE_SIZE,
7526 _SC_LEVEL2_CACHE_ASSOC,
7527 _SC_LEVEL2_CACHE_LINESIZE,
7528 _SC_LEVEL3_CACHE_SIZE,
7529 _SC_LEVEL3_CACHE_ASSOC,
7530 _SC_LEVEL3_CACHE_LINESIZE,
7531 _SC_LEVEL4_CACHE_SIZE,
7532 _SC_LEVEL4_CACHE_ASSOC,
7533 _SC_LEVEL4_CACHE_LINESIZE,
7534 _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
7535 _SC_RAW_SOCKETS,
7536 _SC_V7_ILP32_OFF32,
7537 _SC_V7_ILP32_OFFBIG,
7538 _SC_V7_LP64_OFF64,
7539 _SC_V7_LPBIG_OFFBIG,
7540 _SC_SS_REPL_MAX,
7541 _SC_TRACE_EVENT_NAME_MAX,
7542 _SC_TRACE_NAME_MAX,
7543 _SC_TRACE_SYS_MAX,
7544 _SC_TRACE_USER_EVENT_MAX,
7545 _SC_XOPEN_STREAMS,
7546 _SC_THREAD_ROBUST_PRIO_INHERIT,
7547 _SC_THREAD_ROBUST_PRIO_PROTECT,
7548 };
7549 enum
7550 {
7551 _CS_PATH,
7552 _CS_V6_WIDTH_RESTRICTED_ENVS,
7553 _CS_GNU_LIBC_VERSION,
7554 _CS_GNU_LIBPTHREAD_VERSION,
7555 _CS_V5_WIDTH_RESTRICTED_ENVS,
7556 _CS_V7_WIDTH_RESTRICTED_ENVS,
7557 _CS_LFS_CFLAGS = 1000,
7558 _CS_LFS_LDFLAGS,
7559 _CS_LFS_LIBS,
7560 _CS_LFS_LINTFLAGS,
7561 _CS_LFS64_CFLAGS,
7562 _CS_LFS64_LDFLAGS,
7563 _CS_LFS64_LIBS,
7564 _CS_LFS64_LINTFLAGS,
7565 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
7566 _CS_XBS5_ILP32_OFF32_LDFLAGS,
7567 _CS_XBS5_ILP32_OFF32_LIBS,
7568 _CS_XBS5_ILP32_OFF32_LINTFLAGS,
7569 _CS_XBS5_ILP32_OFFBIG_CFLAGS,
7570 _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
7571 _CS_XBS5_ILP32_OFFBIG_LIBS,
7572 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
7573 _CS_XBS5_LP64_OFF64_CFLAGS,
7574 _CS_XBS5_LP64_OFF64_LDFLAGS,
7575 _CS_XBS5_LP64_OFF64_LIBS,
7576 _CS_XBS5_LP64_OFF64_LINTFLAGS,
7577 _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
7578 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
7579 _CS_XBS5_LPBIG_OFFBIG_LIBS,
7580 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
7581 _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
7582 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
7583 _CS_POSIX_V6_ILP32_OFF32_LIBS,
7584 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
7585 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
7586 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
7587 _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
7588 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
7589 _CS_POSIX_V6_LP64_OFF64_CFLAGS,
7590 _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
7591 _CS_POSIX_V6_LP64_OFF64_LIBS,
7592 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
7593 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
7594 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
7595 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
7596 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
7597 _CS_POSIX_V7_ILP32_OFF32_CFLAGS,
7598 _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
7599 _CS_POSIX_V7_ILP32_OFF32_LIBS,
7600 _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
7601 _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
7602 _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
7603 _CS_POSIX_V7_ILP32_OFFBIG_LIBS,
7604 _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
7605 _CS_POSIX_V7_LP64_OFF64_CFLAGS,
7606 _CS_POSIX_V7_LP64_OFF64_LDFLAGS,
7607 _CS_POSIX_V7_LP64_OFF64_LIBS,
7608 _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
7609 _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
7610 _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
7611 _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
7612 _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
7613 };
7614 extern long int pathconf (__const char *__path, int __name)
7615 throw () __attribute__ ((__nonnull__ (1)));
7616 extern long int fpathconf (int __fd, int __name) throw ();
7617 extern long int sysconf (int __name) throw ();
7618 extern size_t confstr (int __name, char *__buf, size_t __len) throw ();
7619 extern __pid_t getpid (void) throw ();
7620 extern __pid_t getppid (void) throw ();
7621 extern __pid_t getpgrp (void) throw ();
7622 extern __pid_t __getpgid (__pid_t __pid) throw ();
7623 extern __pid_t getpgid (__pid_t __pid) throw ();
7624 extern int setpgid (__pid_t __pid, __pid_t __pgid) throw ();
7625 extern int setpgrp (void) throw ();
7626 extern __pid_t setsid (void) throw ();
7627 extern __pid_t getsid (__pid_t __pid) throw ();
7628 extern __uid_t getuid (void) throw ();
7629 extern __uid_t geteuid (void) throw ();
7630 extern __gid_t getgid (void) throw ();
7631 extern __gid_t getegid (void) throw ();
7632 extern int getgroups (int __size, __gid_t __list[]) throw () __attribute__ ((__warn_unused_result__));
7633 extern int group_member (__gid_t __gid) throw ();
7634 extern int setuid (__uid_t __uid) throw ();
7635 extern int setreuid (__uid_t __ruid, __uid_t __euid) throw ();
7636 extern int seteuid (__uid_t __uid) throw ();
7637 extern int setgid (__gid_t __gid) throw ();
7638 extern int setregid (__gid_t __rgid, __gid_t __egid) throw ();
7639 extern int setegid (__gid_t __gid) throw ();
7640 extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
7641 throw ();
7642 extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
7643 throw ();
7644 extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
7645 throw ();
7646 extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
7647 throw ();
7648 extern __pid_t fork (void) throw ();
7649 extern __pid_t vfork (void) throw ();
7650 extern char *ttyname (int __fd) throw ();
7651 extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
7652 throw () __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
7653 extern int isatty (int __fd) throw ();
7654 extern int ttyslot (void) throw ();
7655 extern int link (__const char *__from, __const char *__to)
7656 throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
7657 extern int linkat (int __fromfd, __const char *__from, int __tofd,
7658 __const char *__to, int __flags)
7659 throw () __attribute__ ((__nonnull__ (2, 4))) __attribute__ ((__warn_unused_result__));
7660 extern int symlink (__const char *__from, __const char *__to)
7661 throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
7662 extern ssize_t readlink (__const char *__restrict __path,
7663 char *__restrict __buf, size_t __len)
7664 throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
7665 extern int symlinkat (__const char *__from, int __tofd,
7666 __const char *__to) throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
7667 extern ssize_t readlinkat (int __fd, __const char *__restrict __path,
7668 char *__restrict __buf, size_t __len)
7669 throw () __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__));
7670 extern int unlink (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
7671 extern int unlinkat (int __fd, __const char *__name, int __flag)
7672 throw () __attribute__ ((__nonnull__ (2)));
7673 extern int rmdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1)));
7674 extern __pid_t tcgetpgrp (int __fd) throw ();
7675 extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw ();
7676 extern char *getlogin (void);
7677 extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
7678 extern int setlogin (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
7679 extern "C" {
7680 extern char *optarg;
7681 extern int optind;
7682 extern int opterr;
7683 extern int optopt;
7684 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
7685 throw ();
7686 }
7687 extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1)));
7688 extern int sethostname (__const char *__name, size_t __len)
7689 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7690 extern int sethostid (long int __id) throw () __attribute__ ((__warn_unused_result__));
7691 extern int getdomainname (char *__name, size_t __len)
7692 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7693 extern int setdomainname (__const char *__name, size_t __len)
7694 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7695 extern int vhangup (void) throw ();
7696 extern int revoke (__const char *__file) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7697 extern int profil (unsigned short int *__sample_buffer, size_t __size,
7698 size_t __offset, unsigned int __scale)
7699 throw () __attribute__ ((__nonnull__ (1)));
7700 extern int acct (__const char *__name) throw ();
7701 extern char *getusershell (void) throw ();
7702 extern void endusershell (void) throw ();
7703 extern void setusershell (void) throw ();
7704 extern int daemon (int __nochdir, int __noclose) throw () __attribute__ ((__warn_unused_result__));
7705 extern int chroot (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7706 extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1)));
7707 extern int fsync (int __fd);
7708 extern long int gethostid (void);
7709 extern void sync (void) throw ();
7710 extern int getpagesize (void) throw () __attribute__ ((__const__));
7711 extern int getdtablesize (void) throw ();
7712 extern int truncate (__const char *__file, __off_t __length)
7713 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7714 extern int truncate64 (__const char *__file, __off64_t __length)
7715 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7716 extern int ftruncate (int __fd, __off_t __length) throw () __attribute__ ((__warn_unused_result__));
7717 extern int ftruncate64 (int __fd, __off64_t __length) throw () __attribute__ ((__warn_unused_result__));
7718 extern int brk (void *__addr) throw () __attribute__ ((__warn_unused_result__));
7719 extern void *sbrk (intptr_t __delta) throw ();
7720 extern long int syscall (long int __sysno, ...) throw ();
7721 extern int lockf (int __fd, int __cmd, __off_t __len) __attribute__ ((__warn_unused_result__));
7722 extern int lockf64 (int __fd, int __cmd, __off64_t __len) __attribute__ ((__warn_unused_result__));
7723 extern int fdatasync (int __fildes);
7724 extern char *crypt (__const char *__key, __const char *__salt)
7725 throw () __attribute__ ((__nonnull__ (1, 2)));
7726 extern void encrypt (char *__block, int __edflag) throw () __attribute__ ((__nonnull__ (1)));
7727 extern void swab (__const void *__restrict __from, void *__restrict __to,
7728 ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
7729 extern char *ctermid (char *__s) throw ();
7730 extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes,
7731 size_t __buflen) __attribute__ ((__warn_unused_result__));
7732 extern ssize_t __read_alias (int __fd, void *__buf, size_t __nbytes) __asm__ ("" "read")
7733 __attribute__ ((__warn_unused_result__));
7734 extern ssize_t __read_chk_warn (int __fd, void *__buf, size_t __nbytes, size_t __buflen) __asm__ ("" "__read_chk")
7735 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("read called with bigger length than size of " "the destination buffer")))
7736 ;
7737 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t
7738 read (int __fd, void *__buf, size_t __nbytes)
7739 {
7740 if (__builtin_object_size (__buf, 0) != (size_t) -1)
7741 {
7742 if (!__builtin_constant_p (__nbytes))
7743 return __read_chk (__fd, __buf, __nbytes, __builtin_object_size (__buf, 0));
7744 if (__nbytes > __builtin_object_size (__buf, 0))
7745 return __read_chk_warn (__fd, __buf, __nbytes, __builtin_object_size (__buf, 0));
7746 }
7747 return __read_alias (__fd, __buf, __nbytes);
7748 }
7749 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes,
7750 __off_t __offset, size_t __bufsize) __attribute__ ((__warn_unused_result__));
7751 extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes,
7752 __off64_t __offset, size_t __bufsize) __attribute__ ((__warn_unused_result__));
7753 extern ssize_t __pread_alias (int __fd, void *__buf, size_t __nbytes, __off_t __offset) __asm__ ("" "pread")
7754 __attribute__ ((__warn_unused_result__));
7755 extern ssize_t __pread64_alias (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __asm__ ("" "pread64")
7756 __attribute__ ((__warn_unused_result__));
7757 extern ssize_t __pread_chk_warn (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize) __asm__ ("" "__pread_chk")
7758 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("pread called with bigger length than size of " "the destination buffer")))
7759 ;
7760 extern ssize_t __pread64_chk_warn (int __fd, void *__buf, size_t __nbytes, __off64_t __offset, size_t __bufsize) __asm__ ("" "__pread64_chk")
7761 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("pread64 called with bigger length than size of " "the destination buffer")))
7762 ;
7763 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t
7764 pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
7765 {
7766 if (__builtin_object_size (__buf, 0) != (size_t) -1)
7767 {
7768 if (!__builtin_constant_p (__nbytes))
7769 return __pread_chk (__fd, __buf, __nbytes, __offset, __builtin_object_size (__buf, 0));
7770 if ( __nbytes > __builtin_object_size (__buf, 0))
7771 return __pread_chk_warn (__fd, __buf, __nbytes, __offset,
7772 __builtin_object_size (__buf, 0));
7773 }
7774 return __pread_alias (__fd, __buf, __nbytes, __offset);
7775 }
7776 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) ssize_t
7777 pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
7778 {
7779 if (__builtin_object_size (__buf, 0) != (size_t) -1)
7780 {
7781 if (!__builtin_constant_p (__nbytes))
7782 return __pread64_chk (__fd, __buf, __nbytes, __offset, __builtin_object_size (__buf, 0));
7783 if ( __nbytes > __builtin_object_size (__buf, 0))
7784 return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
7785 __builtin_object_size (__buf, 0));
7786 }
7787 return __pread64_alias (__fd, __buf, __nbytes, __offset);
7788 }
7789 extern ssize_t __readlink_chk (__const char *__restrict __path,
7790 char *__restrict __buf, size_t __len,
7791 size_t __buflen)
7792 throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
7793 extern ssize_t __readlink_alias (__const char *__restrict __path, char *__restrict __buf, size_t __len) throw () __asm__ ("" "readlink")
7794 __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__));
7795 extern ssize_t __readlink_chk_warn (__const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) throw () __asm__ ("" "__readlink_chk")
7796 __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("readlink called with bigger length " "than size of destination buffer")))
7797 ;
7798 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__warn_unused_result__)) ssize_t
7799 readlink (__const char *__restrict __path, char *__restrict __buf, size_t __len) throw ()
7800 {
7801 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7802 {
7803 if (!__builtin_constant_p (__len))
7804 return __readlink_chk (__path, __buf, __len, __builtin_object_size (__buf, 2 > 1));
7805 if ( __len > __builtin_object_size (__buf, 2 > 1))
7806 return __readlink_chk_warn (__path, __buf, __len, __builtin_object_size (__buf, 2 > 1));
7807 }
7808 return __readlink_alias (__path, __buf, __len);
7809 }
7810 extern ssize_t __readlinkat_chk (int __fd, __const char *__restrict __path,
7811 char *__restrict __buf, size_t __len,
7812 size_t __buflen)
7813 throw () __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__));
7814 extern ssize_t __readlinkat_alias (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) throw () __asm__ ("" "readlinkat")
7815 __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__));
7816 extern ssize_t __readlinkat_chk_warn (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) throw () __asm__ ("" "__readlinkat_chk")
7817 __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("readlinkat called with bigger " "length than size of destination " "buffer")))
7818 ;
7819 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__nonnull__ (2, 3))) __attribute__ ((__warn_unused_result__)) ssize_t
7820 readlinkat (int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) throw ()
7821 {
7822 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7823 {
7824 if (!__builtin_constant_p (__len))
7825 return __readlinkat_chk (__fd, __path, __buf, __len, __builtin_object_size (__buf, 2 > 1));
7826 if (__len > __builtin_object_size (__buf, 2 > 1))
7827 return __readlinkat_chk_warn (__fd, __path, __buf, __len,
7828 __builtin_object_size (__buf, 2 > 1));
7829 }
7830 return __readlinkat_alias (__fd, __path, __buf, __len);
7831 }
7832 extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen)
7833 throw () __attribute__ ((__warn_unused_result__));
7834 extern char *__getcwd_alias (char *__buf, size_t __size) throw () __asm__ ("" "getcwd")
7835 __attribute__ ((__warn_unused_result__));
7836 extern char *__getcwd_chk_warn (char *__buf, size_t __size, size_t __buflen) throw () __asm__ ("" "__getcwd_chk")
7837 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getcwd caller with bigger length than size of " "destination buffer")))
7838 ;
7839 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
7840 getcwd (char *__buf, size_t __size) throw ()
7841 {
7842 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7843 {
7844 if (!__builtin_constant_p (__size))
7845 return __getcwd_chk (__buf, __size, __builtin_object_size (__buf, 2 > 1));
7846 if (__size > __builtin_object_size (__buf, 2 > 1))
7847 return __getcwd_chk_warn (__buf, __size, __builtin_object_size (__buf, 2 > 1));
7848 }
7849 return __getcwd_alias (__buf, __size);
7850 }
7851 extern char *__getwd_chk (char *__buf, size_t buflen)
7852 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7853 extern char *__getwd_warn (char *__buf) throw () __asm__ ("" "getwd")
7854 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use getcwd instead, as getwd " "doesn't specify buffer size")))
7855 ;
7856 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) __attribute__ ((__warn_unused_result__)) char *
7857 getwd (char *__buf) throw ()
7858 {
7859 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7860 return __getwd_chk (__buf, __builtin_object_size (__buf, 2 > 1));
7861 return __getwd_warn (__buf);
7862 }
7863 extern size_t __confstr_chk (int __name, char *__buf, size_t __len,
7864 size_t __buflen) throw ();
7865 extern size_t __confstr_alias (int __name, char *__buf, size_t __len) throw () __asm__ ("" "confstr")
7866 ;
7867 extern size_t __confstr_chk_warn (int __name, char *__buf, size_t __len, size_t __buflen) throw () __asm__ ("" "__confstr_chk")
7868 __attribute__((__warning__ ("confstr called with bigger length than size of destination " "buffer")))
7869 ;
7870 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
7871 confstr (int __name, char *__buf, size_t __len) throw ()
7872 {
7873 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7874 {
7875 if (!__builtin_constant_p (__len))
7876 return __confstr_chk (__name, __buf, __len, __builtin_object_size (__buf, 2 > 1));
7877 if (__builtin_object_size (__buf, 2 > 1) < __len)
7878 return __confstr_chk_warn (__name, __buf, __len, __builtin_object_size (__buf, 2 > 1));
7879 }
7880 return __confstr_alias (__name, __buf, __len);
7881 }
7882 extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen)
7883 throw () __attribute__ ((__warn_unused_result__));
7884 extern int __getgroups_alias (int __size, __gid_t __list[]) throw () __asm__ ("" "getgroups")
7885 __attribute__ ((__warn_unused_result__));
7886 extern int __getgroups_chk_warn (int __size, __gid_t __list[], size_t __listlen) throw () __asm__ ("" "__getgroups_chk")
7887 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getgroups called with bigger group count than what " "can fit into destination buffer")))
7888 ;
7889 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
7890 getgroups (int __size, __gid_t __list[]) throw ()
7891 {
7892 if (__builtin_object_size (__list, 2 > 1) != (size_t) -1)
7893 {
7894 if (!__builtin_constant_p (__size) || __size < 0)
7895 return __getgroups_chk (__size, __list, __builtin_object_size (__list, 2 > 1));
7896 if (__size * sizeof (__gid_t) > __builtin_object_size (__list, 2 > 1))
7897 return __getgroups_chk_warn (__size, __list, __builtin_object_size (__list, 2 > 1));
7898 }
7899 return __getgroups_alias (__size, __list);
7900 }
7901 extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen,
7902 size_t __nreal) throw () __attribute__ ((__nonnull__ (2)));
7903 extern int __ttyname_r_alias (int __fd, char *__buf, size_t __buflen) throw () __asm__ ("" "ttyname_r")
7904 __attribute__ ((__nonnull__ (2)));
7905 extern int __ttyname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) throw () __asm__ ("" "__ttyname_r_chk")
7906 __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ttyname_r called with bigger buflen than " "size of destination buffer")))
7907 ;
7908 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
7909 ttyname_r (int __fd, char *__buf, size_t __buflen) throw ()
7910 {
7911 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7912 {
7913 if (!__builtin_constant_p (__buflen))
7914 return __ttyname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7915 if (__buflen > __builtin_object_size (__buf, 2 > 1))
7916 return __ttyname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7917 }
7918 return __ttyname_r_alias (__fd, __buf, __buflen);
7919 }
7920 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal)
7921 __attribute__ ((__nonnull__ (1)));
7922 extern int __getlogin_r_alias (char *__buf, size_t __buflen) __asm__ ("" "getlogin_r")
7923 __attribute__ ((__nonnull__ (1)));
7924 extern int __getlogin_r_chk_warn (char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__getlogin_r_chk")
7925 __attribute__ ((__nonnull__ (1))) __attribute__((__warning__ ("getlogin_r called with bigger buflen than " "size of destination buffer")))
7926 ;
7927 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
7928 getlogin_r (char *__buf, size_t __buflen)
7929 {
7930 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7931 {
7932 if (!__builtin_constant_p (__buflen))
7933 return __getlogin_r_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7934 if (__buflen > __builtin_object_size (__buf, 2 > 1))
7935 return __getlogin_r_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7936 }
7937 return __getlogin_r_alias (__buf, __buflen);
7938 }
7939 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal)
7940 throw () __attribute__ ((__nonnull__ (1)));
7941 extern int __gethostname_alias (char *__buf, size_t __buflen) throw () __asm__ ("" "gethostname")
7942 __attribute__ ((__nonnull__ (1)));
7943 extern int __gethostname_chk_warn (char *__buf, size_t __buflen, size_t __nreal) throw () __asm__ ("" "__gethostname_chk")
7944 __attribute__ ((__nonnull__ (1))) __attribute__((__warning__ ("gethostname called with bigger buflen than " "size of destination buffer")))
7945 ;
7946 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
7947 gethostname (char *__buf, size_t __buflen) throw ()
7948 {
7949 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7950 {
7951 if (!__builtin_constant_p (__buflen))
7952 return __gethostname_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7953 if (__buflen > __builtin_object_size (__buf, 2 > 1))
7954 return __gethostname_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7955 }
7956 return __gethostname_alias (__buf, __buflen);
7957 }
7958 extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal)
7959 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7960 extern int __getdomainname_alias (char *__buf, size_t __buflen) throw () __asm__ ("" "getdomainname")
7961 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
7962 extern int __getdomainname_chk_warn (char *__buf, size_t __buflen, size_t __nreal) throw () __asm__ ("" "__getdomainname_chk")
7963 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("getdomainname called with bigger " "buflen than size of destination " "buffer")))
7964 ;
7965 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
7966 getdomainname (char *__buf, size_t __buflen) throw ()
7967 {
7968 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
7969 {
7970 if (!__builtin_constant_p (__buflen))
7971 return __getdomainname_chk (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7972 if (__buflen > __builtin_object_size (__buf, 2 > 1))
7973 return __getdomainname_chk_warn (__buf, __buflen, __builtin_object_size (__buf, 2 > 1));
7974 }
7975 return __getdomainname_alias (__buf, __buflen);
7976 }
7977 }
7978 typedef pthread_t __gthread_t;
7979 typedef pthread_key_t __gthread_key_t;
7980 typedef pthread_once_t __gthread_once_t;
7981 typedef pthread_mutex_t __gthread_mutex_t;
7982 typedef pthread_mutex_t __gthread_recursive_mutex_t;
7983 typedef pthread_cond_t __gthread_cond_t;
7984 typedef struct timespec __gthread_time_t;
7985 static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
7986 static __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
7987 static __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
7988 static __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));
7989 static __typeof(pthread_join) __gthrw_pthread_join __attribute__ ((__weakref__("pthread_join")));
7990 static __typeof(pthread_equal) __gthrw_pthread_equal __attribute__ ((__weakref__("pthread_equal")));
7991 static __typeof(pthread_self) __gthrw_pthread_self __attribute__ ((__weakref__("pthread_self")));
7992 static __typeof(pthread_detach) __gthrw_pthread_detach __attribute__ ((__weakref__("pthread_detach")));
7993 static __typeof(pthread_cancel) __gthrw_pthread_cancel __attribute__ ((__weakref__("pthread_cancel")));
7994 static __typeof(sched_yield) __gthrw_sched_yield __attribute__ ((__weakref__("sched_yield")));
7995 static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
7996 static __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
7997 static __typeof(pthread_mutex_timedlock) __gthrw_pthread_mutex_timedlock __attribute__ ((__weakref__("pthread_mutex_timedlock")));
7998 static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
7999 static __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
8000 static __typeof(pthread_mutex_destroy) __gthrw_pthread_mutex_destroy __attribute__ ((__weakref__("pthread_mutex_destroy")));
8001 static __typeof(pthread_cond_broadcast) __gthrw_pthread_cond_broadcast __attribute__ ((__weakref__("pthread_cond_broadcast")));
8002 static __typeof(pthread_cond_signal) __gthrw_pthread_cond_signal __attribute__ ((__weakref__("pthread_cond_signal")));
8003 static __typeof(pthread_cond_wait) __gthrw_pthread_cond_wait __attribute__ ((__weakref__("pthread_cond_wait")));
8004 static __typeof(pthread_cond_timedwait) __gthrw_pthread_cond_timedwait __attribute__ ((__weakref__("pthread_cond_timedwait")));
8005 static __typeof(pthread_cond_destroy) __gthrw_pthread_cond_destroy __attribute__ ((__weakref__("pthread_cond_destroy")));
8006 static __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
8007 static __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
8008 static __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
8009 static __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
8010 static __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));
8011 static inline int
8012 __gthread_active_p (void)
8013 {
8014 static void *const __gthread_active_ptr
8015 = __extension__ (void *) &__gthrw_pthread_cancel;
8016 return __gthread_active_ptr != 0;
8017 }
8018 static inline int
8019 __gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
8020 void *__args)
8021 {
8022 return __gthrw_pthread_create (__threadid, __null, __func, __args);
8023 }
8024 static inline int
8025 __gthread_join (__gthread_t __threadid, void **__value_ptr)
8026 {
8027 return __gthrw_pthread_join (__threadid, __value_ptr);
8028 }
8029 static inline int
8030 __gthread_detach (__gthread_t __threadid)
8031 {
8032 return __gthrw_pthread_detach (__threadid);
8033 }
8034 static inline int
8035 __gthread_equal (__gthread_t __t1, __gthread_t __t2)
8036 {
8037 return __gthrw_pthread_equal (__t1, __t2);
8038 }
8039 static inline __gthread_t
8040 __gthread_self (void)
8041 {
8042 return __gthrw_pthread_self ();
8043 }
8044 static inline int
8045 __gthread_yield (void)
8046 {
8047 return __gthrw_sched_yield ();
8048 }
8049 static inline int
8050 __gthread_once (__gthread_once_t *__once, void (*__func) (void))
8051 {
8052 if (__gthread_active_p ())
8053 return __gthrw_pthread_once (__once, __func);
8054 else
8055 return -1;
8056 }
8057 static inline int
8058 __gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
8059 {
8060 return __gthrw_pthread_key_create (__key, __dtor);
8061 }
8062 static inline int
8063 __gthread_key_delete (__gthread_key_t __key)
8064 {
8065 return __gthrw_pthread_key_delete (__key);
8066 }
8067 static inline void *
8068 __gthread_getspecific (__gthread_key_t __key)
8069 {
8070 return __gthrw_pthread_getspecific (__key);
8071 }
8072 static inline int
8073 __gthread_setspecific (__gthread_key_t __key, const void *__ptr)
8074 {
8075 return __gthrw_pthread_setspecific (__key, __ptr);
8076 }
8077 static inline int
8078 __gthread_mutex_destroy (__gthread_mutex_t *__mutex)
8079 {
8080 if (__gthread_active_p ())
8081 return __gthrw_pthread_mutex_destroy (__mutex);
8082 else
8083 return 0;
8084 }
8085 static inline int
8086 __gthread_mutex_lock (__gthread_mutex_t *__mutex)
8087 {
8088 if (__gthread_active_p ())
8089 return __gthrw_pthread_mutex_lock (__mutex);
8090 else
8091 return 0;
8092 }
8093 static inline int
8094 __gthread_mutex_trylock (__gthread_mutex_t *__mutex)
8095 {
8096 if (__gthread_active_p ())
8097 return __gthrw_pthread_mutex_trylock (__mutex);
8098 else
8099 return 0;
8100 }
8101 static inline int
8102 __gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
8103 const __gthread_time_t *__abs_timeout)
8104 {
8105 if (__gthread_active_p ())
8106 return __gthrw_pthread_mutex_timedlock (__mutex, __abs_timeout);
8107 else
8108 return 0;
8109 }
8110 static inline int
8111 __gthread_mutex_unlock (__gthread_mutex_t *__mutex)
8112 {
8113 if (__gthread_active_p ())
8114 return __gthrw_pthread_mutex_unlock (__mutex);
8115 else
8116 return 0;
8117 }
8118 static inline int
8119 __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
8120 {
8121 return __gthread_mutex_lock (__mutex);
8122 }
8123 static inline int
8124 __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
8125 {
8126 return __gthread_mutex_trylock (__mutex);
8127 }
8128 static inline int
8129 __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
8130 const __gthread_time_t *__abs_timeout)
8131 {
8132 return __gthread_mutex_timedlock (__mutex, __abs_timeout);
8133 }
8134 static inline int
8135 __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
8136 {
8137 return __gthread_mutex_unlock (__mutex);
8138 }
8139 static inline int
8140 __gthread_cond_broadcast (__gthread_cond_t *__cond)
8141 {
8142 return __gthrw_pthread_cond_broadcast (__cond);
8143 }
8144 static inline int
8145 __gthread_cond_signal (__gthread_cond_t *__cond)
8146 {
8147 return __gthrw_pthread_cond_signal (__cond);
8148 }
8149 static inline int
8150 __gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
8151 {
8152 return __gthrw_pthread_cond_wait (__cond, __mutex);
8153 }
8154 static inline int
8155 __gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
8156 const __gthread_time_t *__abs_timeout)
8157 {
8158 return __gthrw_pthread_cond_timedwait (__cond, __mutex, __abs_timeout);
8159 }
8160 static inline int
8161 __gthread_cond_wait_recursive (__gthread_cond_t *__cond,
8162 __gthread_recursive_mutex_t *__mutex)
8163 {
8164 return __gthread_cond_wait (__cond, __mutex);
8165 }
8166 static inline int
8167 __gthread_cond_timedwait_recursive (__gthread_cond_t *__cond,
8168 __gthread_recursive_mutex_t *__mutex,
8169 const __gthread_time_t *__abs_timeout)
8170 {
8171 return __gthread_cond_timedwait (__cond, __mutex, __abs_timeout);
8172 }
8173 static inline int
8174 __gthread_cond_destroy (__gthread_cond_t* __cond)
8175 {
8176 return __gthrw_pthread_cond_destroy (__cond);
8177 }
8178 typedef int _Atomic_word;
8179 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
8180 static inline _Atomic_word
8181 __exchange_and_add(volatile _Atomic_word* __mem, int __val)
8182 { return __sync_fetch_and_add(__mem, __val); }
8183 static inline void
8184 __atomic_add(volatile _Atomic_word* __mem, int __val)
8185 { __sync_fetch_and_add(__mem, __val); }
8186 static inline _Atomic_word
8187 __exchange_and_add_single(_Atomic_word* __mem, int __val)
8188 {
8189 _Atomic_word __result = *__mem;
8190 *__mem += __val;
8191 return __result;
8192 }
8193 static inline void
8194 __atomic_add_single(_Atomic_word* __mem, int __val)
8195 { *__mem += __val; }
8196 static inline _Atomic_word
8197 __attribute__ ((__unused__))
8198 __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
8199 {
8200 if (__gthread_active_p())
8201 return __exchange_and_add(__mem, __val);
8202 else
8203 return __exchange_and_add_single(__mem, __val);
8204 }
8205 static inline void
8206 __attribute__ ((__unused__))
8207 __atomic_add_dispatch(_Atomic_word* __mem, int __val)
8208 {
8209 if (__gthread_active_p())
8210 __atomic_add(__mem, __val);
8211 else
8212 __atomic_add_single(__mem, __val);
8213 }
8214 }
8215
8216 namespace std __attribute__ ((__visibility__ ("default"))) {
8217 template<typename _CharT, typename _Traits, typename _Alloc>
8218 class basic_string
8219 {
8220 typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
8221 public:
8222 typedef _Traits traits_type;
8223 typedef typename _Traits::char_type value_type;
8224 typedef _Alloc allocator_type;
8225 typedef typename _CharT_alloc_type::size_type size_type;
8226 typedef typename _CharT_alloc_type::difference_type difference_type;
8227 typedef typename _CharT_alloc_type::reference reference;
8228 typedef typename _CharT_alloc_type::const_reference const_reference;
8229 typedef typename _CharT_alloc_type::pointer pointer;
8230 typedef typename _CharT_alloc_type::const_pointer const_pointer;
8231 typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
8232 typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
8233 const_iterator;
8234 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
8235 typedef std::reverse_iterator<iterator> reverse_iterator;
8236 private:
8237 struct _Rep_base
8238 {
8239 size_type _M_length;
8240 size_type _M_capacity;
8241 _Atomic_word _M_refcount;
8242 };
8243 struct _Rep : _Rep_base
8244 {
8245 typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
8246 static const size_type _S_max_size;
8247 static const _CharT _S_terminal;
8248 static size_type _S_empty_rep_storage[];
8249 static _Rep&
8250 _S_empty_rep()
8251 {
8252 void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
8253 return *reinterpret_cast<_Rep*>(__p);
8254 }
8255 bool
8256 _M_is_leaked() const
8257 { return this->_M_refcount < 0; }
8258 bool
8259 _M_is_shared() const
8260 { return this->_M_refcount > 0; }
8261 void
8262 _M_set_leaked()
8263 { this->_M_refcount = -1; }
8264 void
8265 _M_set_sharable()
8266 { this->_M_refcount = 0; }
8267 void
8268 _M_set_length_and_sharable(size_type __n)
8269 {
8270 if (__builtin_expect(this != &_S_empty_rep(), false))
8271 {
8272 this->_M_set_sharable();
8273 this->_M_length = __n;
8274 traits_type::assign(this->_M_refdata()[__n], _S_terminal);
8275 }
8276 }
8277 _CharT*
8278 _M_refdata() throw()
8279 { return reinterpret_cast<_CharT*>(this + 1); }
8280 _CharT*
8281 _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
8282 {
8283 return (!_M_is_leaked() && __alloc1 == __alloc2)
8284 ? _M_refcopy() : _M_clone(__alloc1);
8285 }
8286 static _Rep*
8287 _S_create(size_type, size_type, const _Alloc&);
8288 void
8289 _M_dispose(const _Alloc& __a)
8290 {
8291 if (__builtin_expect(this != &_S_empty_rep(), false))
8292 if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
8293 -1) <= 0)
8294 _M_destroy(__a);
8295 }
8296 void
8297 _M_destroy(const _Alloc&) throw();
8298 _CharT*
8299 _M_refcopy() throw()
8300 {
8301 if (__builtin_expect(this != &_S_empty_rep(), false))
8302 __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
8303 return _M_refdata();
8304 }
8305 _CharT*
8306 _M_clone(const _Alloc&, size_type __res = 0);
8307 };
8308 struct _Alloc_hider : _Alloc
8309 {
8310 _Alloc_hider(_CharT* __dat, const _Alloc& __a)
8311 : _Alloc(__a), _M_p(__dat) { }
8312 _CharT* _M_p;
8313 };
8314 public:
8315 static const size_type npos = static_cast<size_type>(-1);
8316 private:
8317 mutable _Alloc_hider _M_dataplus;
8318 _CharT*
8319 _M_data() const
8320 { return _M_dataplus._M_p; }
8321 _CharT*
8322 _M_data(_CharT* __p)
8323 { return (_M_dataplus._M_p = __p); }
8324 _Rep*
8325 _M_rep() const
8326 { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
8327 iterator
8328 _M_ibegin() const
8329 { return iterator(_M_data()); }
8330 iterator
8331 _M_iend() const
8332 { return iterator(_M_data() + this->size()); }
8333 void
8334 _M_leak()
8335 {
8336 if (!_M_rep()->_M_is_leaked())
8337 _M_leak_hard();
8338 }
8339 size_type
8340 _M_check(size_type __pos, const char* __s) const
8341 {
8342 if (__pos > this->size())
8343 __throw_out_of_range((__s));
8344 return __pos;
8345 }
8346 void
8347 _M_check_length(size_type __n1, size_type __n2, const char* __s) const
8348 {
8349 if (this->max_size() - (this->size() - __n1) < __n2)
8350 __throw_length_error((__s));
8351 }
8352 size_type
8353 _M_limit(size_type __pos, size_type __off) const
8354 {
8355 const bool __testoff = __off < this->size() - __pos;
8356 return __testoff ? __off : this->size() - __pos;
8357 }
8358 bool
8359 _M_disjunct(const _CharT* __s) const
8360 {
8361 return (less<const _CharT*>()(__s, _M_data())
8362 || less<const _CharT*>()(_M_data() + this->size(), __s));
8363 }
8364 static void
8365 _M_copy(_CharT* __d, const _CharT* __s, size_type __n)
8366 {
8367 if (__n == 1)
8368 traits_type::assign(*__d, *__s);
8369 else
8370 traits_type::copy(__d, __s, __n);
8371 }
8372 static void
8373 _M_move(_CharT* __d, const _CharT* __s, size_type __n)
8374 {
8375 if (__n == 1)
8376 traits_type::assign(*__d, *__s);
8377 else
8378 traits_type::move(__d, __s, __n);
8379 }
8380 static void
8381 _M_assign(_CharT* __d, size_type __n, _CharT __c)
8382 {
8383 if (__n == 1)
8384 traits_type::assign(*__d, __c);
8385 else
8386 traits_type::assign(__d, __n, __c);
8387 }
8388 template<class _Iterator>
8389 static void
8390 _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
8391 {
8392 for (; __k1 != __k2; ++__k1, ++__p)
8393 traits_type::assign(*__p, *__k1);
8394 }
8395 static void
8396 _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
8397 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
8398 static void
8399 _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
8400 { _S_copy_chars(__p, __k1.base(), __k2.base()); }
8401 static void
8402 _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
8403 { _M_copy(__p, __k1, __k2 - __k1); }
8404 static void
8405 _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
8406 { _M_copy(__p, __k1, __k2 - __k1); }
8407 static int
8408 _S_compare(size_type __n1, size_type __n2)
8409 {
8410 const difference_type __d = difference_type(__n1 - __n2);
8411 if (__d > __gnu_cxx::__numeric_traits<int>::__max)
8412 return __gnu_cxx::__numeric_traits<int>::__max;
8413 else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
8414 return __gnu_cxx::__numeric_traits<int>::__min;
8415 else
8416 return int(__d);
8417 }
8418 void
8419 _M_mutate(size_type __pos, size_type __len1, size_type __len2);
8420 void
8421 _M_leak_hard();
8422 static _Rep&
8423 _S_empty_rep()
8424 { return _Rep::_S_empty_rep(); }
8425 public:
8426 basic_string()
8427 : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
8428 explicit
8429 basic_string(const _Alloc& __a);
8430 basic_string(const basic_string& __str);
8431 basic_string(const basic_string& __str, size_type __pos,
8432 size_type __n = npos);
8433 basic_string(const basic_string& __str, size_type __pos,
8434 size_type __n, const _Alloc& __a);
8435 basic_string(const _CharT* __s, size_type __n,
8436 const _Alloc& __a = _Alloc());
8437 basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
8438 basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
8439 template<class _InputIterator>
8440 basic_string(_InputIterator __beg, _InputIterator __end,
8441 const _Alloc& __a = _Alloc());
8442 ~basic_string()
8443 { _M_rep()->_M_dispose(this->get_allocator()); }
8444 basic_string&
8445 operator=(const basic_string& __str)
8446 { return this->assign(__str); }
8447 basic_string&
8448 operator=(const _CharT* __s)
8449 { return this->assign(__s); }
8450 basic_string&
8451 operator=(_CharT __c)
8452 {
8453 this->assign(1, __c);
8454 return *this;
8455 }
8456 iterator
8457 begin()
8458 {
8459 _M_leak();
8460 return iterator(_M_data());
8461 }
8462 const_iterator
8463 begin() const
8464 { return const_iterator(_M_data()); }
8465 iterator
8466 end()
8467 {
8468 _M_leak();
8469 return iterator(_M_data() + this->size());
8470 }
8471 const_iterator
8472 end() const
8473 { return const_iterator(_M_data() + this->size()); }
8474 reverse_iterator
8475 rbegin()
8476 { return reverse_iterator(this->end()); }
8477 const_reverse_iterator
8478 rbegin() const
8479 { return const_reverse_iterator(this->end()); }
8480 reverse_iterator
8481 rend()
8482 { return reverse_iterator(this->begin()); }
8483 const_reverse_iterator
8484 rend() const
8485 { return const_reverse_iterator(this->begin()); }
8486 public:
8487 size_type
8488 size() const
8489 { return _M_rep()->_M_length; }
8490 size_type
8491 length() const
8492 { return _M_rep()->_M_length; }
8493 size_type
8494 max_size() const
8495 { return _Rep::_S_max_size; }
8496 void
8497 resize(size_type __n, _CharT __c);
8498 void
8499 resize(size_type __n)
8500 { this->resize(__n, _CharT()); }
8501 size_type
8502 capacity() const
8503 { return _M_rep()->_M_capacity; }
8504 void
8505 reserve(size_type __res_arg = 0);
8506 void
8507 clear()
8508 { _M_mutate(0, this->size(), 0); }
8509 bool
8510 empty() const
8511 { return this->size() == 0; }
8512 const_reference
8513 operator[] (size_type __pos) const
8514 {
8515 ;
8516 return _M_data()[__pos];
8517 }
8518 reference
8519 operator[](size_type __pos)
8520 {
8521 ;
8522 ;
8523 _M_leak();
8524 return _M_data()[__pos];
8525 }
8526 const_reference
8527 at(size_type __n) const
8528 {
8529 if (__n >= this->size())
8530 __throw_out_of_range(("basic_string::at"));
8531 return _M_data()[__n];
8532 }
8533 reference
8534 at(size_type __n)
8535 {
8536 if (__n >= size())
8537 __throw_out_of_range(("basic_string::at"));
8538 _M_leak();
8539 return _M_data()[__n];
8540 }
8541 basic_string&
8542 operator+=(const basic_string& __str)
8543 { return this->append(__str); }
8544 basic_string&
8545 operator+=(const _CharT* __s)
8546 { return this->append(__s); }
8547 basic_string&
8548 operator+=(_CharT __c)
8549 {
8550 this->push_back(__c);
8551 return *this;
8552 }
8553 basic_string&
8554 append(const basic_string& __str);
8555 basic_string&
8556 append(const basic_string& __str, size_type __pos, size_type __n);
8557 basic_string&
8558 append(const _CharT* __s, size_type __n);
8559 basic_string&
8560 append(const _CharT* __s)
8561 {
8562 ;
8563 return this->append(__s, traits_type::length(__s));
8564 }
8565 basic_string&
8566 append(size_type __n, _CharT __c);
8567 template<class _InputIterator>
8568 basic_string&
8569 append(_InputIterator __first, _InputIterator __last)
8570 { return this->replace(_M_iend(), _M_iend(), __first, __last); }
8571 void
8572 push_back(_CharT __c)
8573 {
8574 const size_type __len = 1 + this->size();
8575 if (__len > this->capacity() || _M_rep()->_M_is_shared())
8576 this->reserve(__len);
8577 traits_type::assign(_M_data()[this->size()], __c);
8578 _M_rep()->_M_set_length_and_sharable(__len);
8579 }
8580 basic_string&
8581 assign(const basic_string& __str);
8582 basic_string&
8583 assign(const basic_string& __str, size_type __pos, size_type __n)
8584 { return this->assign(__str._M_data()
8585 + __str._M_check(__pos, "basic_string::assign"),
8586 __str._M_limit(__pos, __n)); }
8587 basic_string&
8588 assign(const _CharT* __s, size_type __n);
8589 basic_string&
8590 assign(const _CharT* __s)
8591 {
8592 ;
8593 return this->assign(__s, traits_type::length(__s));
8594 }
8595 basic_string&
8596 assign(size_type __n, _CharT __c)
8597 { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
8598 template<class _InputIterator>
8599 basic_string&
8600 assign(_InputIterator __first, _InputIterator __last)
8601 { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
8602 void
8603 insert(iterator __p, size_type __n, _CharT __c)
8604 { this->replace(__p, __p, __n, __c); }
8605 template<class _InputIterator>
8606 void
8607 insert(iterator __p, _InputIterator __beg, _InputIterator __end)
8608 { this->replace(__p, __p, __beg, __end); }
8609 basic_string&
8610 insert(size_type __pos1, const basic_string& __str)
8611 { return this->insert(__pos1, __str, size_type(0), __str.size()); }
8612 basic_string&
8613 insert(size_type __pos1, const basic_string& __str,
8614 size_type __pos2, size_type __n)
8615 { return this->insert(__pos1, __str._M_data()
8616 + __str._M_check(__pos2, "basic_string::insert"),
8617 __str._M_limit(__pos2, __n)); }
8618 basic_string&
8619 insert(size_type __pos, const _CharT* __s, size_type __n);
8620 basic_string&
8621 insert(size_type __pos, const _CharT* __s)
8622 {
8623 ;
8624 return this->insert(__pos, __s, traits_type::length(__s));
8625 }
8626 basic_string&
8627 insert(size_type __pos, size_type __n, _CharT __c)
8628 { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
8629 size_type(0), __n, __c); }
8630 iterator
8631 insert(iterator __p, _CharT __c)
8632 {
8633 ;
8634 const size_type __pos = __p - _M_ibegin();
8635 _M_replace_aux(__pos, size_type(0), size_type(1), __c);
8636 _M_rep()->_M_set_leaked();
8637 return iterator(_M_data() + __pos);
8638 }
8639 basic_string&
8640 erase(size_type __pos = 0, size_type __n = npos)
8641 {
8642 _M_mutate(_M_check(__pos, "basic_string::erase"),
8643 _M_limit(__pos, __n), size_type(0));
8644 return *this;
8645 }
8646 iterator
8647 erase(iterator __position)
8648 {
8649 ;
8650 const size_type __pos = __position - _M_ibegin();
8651 _M_mutate(__pos, size_type(1), size_type(0));
8652 _M_rep()->_M_set_leaked();
8653 return iterator(_M_data() + __pos);
8654 }
8655 iterator
8656 erase(iterator __first, iterator __last);
8657 basic_string&
8658 replace(size_type __pos, size_type __n, const basic_string& __str)
8659 { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
8660 basic_string&
8661 replace(size_type __pos1, size_type __n1, const basic_string& __str,
8662 size_type __pos2, size_type __n2)
8663 { return this->replace(__pos1, __n1, __str._M_data()
8664 + __str._M_check(__pos2, "basic_string::replace"),
8665 __str._M_limit(__pos2, __n2)); }
8666 basic_string&
8667 replace(size_type __pos, size_type __n1, const _CharT* __s,
8668 size_type __n2);
8669 basic_string&
8670 replace(size_type __pos, size_type __n1, const _CharT* __s)
8671 {
8672 ;
8673 return this->replace(__pos, __n1, __s, traits_type::length(__s));
8674 }
8675 basic_string&
8676 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
8677 { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
8678 _M_limit(__pos, __n1), __n2, __c); }
8679 basic_string&
8680 replace(iterator __i1, iterator __i2, const basic_string& __str)
8681 { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
8682 basic_string&
8683 replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
8684 {
8685 ;
8686 return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
8687 }
8688 basic_string&
8689 replace(iterator __i1, iterator __i2, const _CharT* __s)
8690 {
8691 ;
8692 return this->replace(__i1, __i2, __s, traits_type::length(__s));
8693 }
8694 basic_string&
8695 replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
8696 {
8697 ;
8698 return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
8699 }
8700 template<class _InputIterator>
8701 basic_string&
8702 replace(iterator __i1, iterator __i2,
8703 _InputIterator __k1, _InputIterator __k2)
8704 {
8705
8706 ;
8707 ;
8708 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
8709 return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
8710 }
8711 basic_string&
8712 replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
8713 {
8714 ;
8715 ;
8716 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
8717 __k1, __k2 - __k1);
8718 }
8719 basic_string&
8720 replace(iterator __i1, iterator __i2,
8721 const _CharT* __k1, const _CharT* __k2)
8722 {
8723 ;
8724 ;
8725 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
8726 __k1, __k2 - __k1);
8727 }
8728 basic_string&
8729 replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
8730 {
8731 ;
8732 ;
8733 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
8734 __k1.base(), __k2 - __k1);
8735 }
8736 basic_string&
8737 replace(iterator __i1, iterator __i2,
8738 const_iterator __k1, const_iterator __k2)
8739 {
8740 ;
8741 ;
8742 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
8743 __k1.base(), __k2 - __k1);
8744 }
8745 private:
8746 template<class _Integer>
8747 basic_string&
8748 _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
8749 _Integer __val, __true_type)
8750 { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
8751 template<class _InputIterator>
8752 basic_string&
8753 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
8754 _InputIterator __k2, __false_type);
8755 basic_string&
8756 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
8757 _CharT __c);
8758 basic_string&
8759 _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
8760 size_type __n2);
8761 template<class _InIterator>
8762 static _CharT*
8763 _S_construct_aux(_InIterator __beg, _InIterator __end,
8764 const _Alloc& __a, __false_type)
8765 {
8766 typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
8767 return _S_construct(__beg, __end, __a, _Tag());
8768 }
8769 template<class _Integer>
8770 static _CharT*
8771 _S_construct_aux(_Integer __beg, _Integer __end,
8772 const _Alloc& __a, __true_type)
8773 { return _S_construct_aux_2(static_cast<size_type>(__beg),
8774 __end, __a); }
8775 static _CharT*
8776 _S_construct_aux_2(size_type __req, _CharT __c, const _Alloc& __a)
8777 { return _S_construct(__req, __c, __a); }
8778 template<class _InIterator>
8779 static _CharT*
8780 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
8781 {
8782 typedef typename std::__is_integer<_InIterator>::__type _Integral;
8783 return _S_construct_aux(__beg, __end, __a, _Integral());
8784 }
8785 template<class _InIterator>
8786 static _CharT*
8787 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
8788 input_iterator_tag);
8789 template<class _FwdIterator>
8790 static _CharT*
8791 _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
8792 forward_iterator_tag);
8793 static _CharT*
8794 _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
8795 public:
8796 size_type
8797 copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
8798 void
8799 swap(basic_string& __s);
8800 const _CharT*
8801 c_str() const
8802 { return _M_data(); }
8803 const _CharT*
8804 data() const
8805 { return _M_data(); }
8806 allocator_type
8807 get_allocator() const
8808 { return _M_dataplus; }
8809 size_type
8810 find(const _CharT* __s, size_type __pos, size_type __n) const;
8811 size_type
8812 find(const basic_string& __str, size_type __pos = 0) const
8813 { return this->find(__str.data(), __pos, __str.size()); }
8814 size_type
8815 find(const _CharT* __s, size_type __pos = 0) const
8816 {
8817 ;
8818 return this->find(__s, __pos, traits_type::length(__s));
8819 }
8820 size_type
8821 find(_CharT __c, size_type __pos = 0) const;
8822 size_type
8823 rfind(const basic_string& __str, size_type __pos = npos) const
8824 { return this->rfind(__str.data(), __pos, __str.size()); }
8825 size_type
8826 rfind(const _CharT* __s, size_type __pos, size_type __n) const;
8827 size_type
8828 rfind(const _CharT* __s, size_type __pos = npos) const
8829 {
8830 ;
8831 return this->rfind(__s, __pos, traits_type::length(__s));
8832 }
8833 size_type
8834 rfind(_CharT __c, size_type __pos = npos) const;
8835 size_type
8836 find_first_of(const basic_string& __str, size_type __pos = 0) const
8837 { return this->find_first_of(__str.data(), __pos, __str.size()); }
8838 size_type
8839 find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
8840 size_type
8841 find_first_of(const _CharT* __s, size_type __pos = 0) const
8842 {
8843 ;
8844 return this->find_first_of(__s, __pos, traits_type::length(__s));
8845 }
8846 size_type
8847 find_first_of(_CharT __c, size_type __pos = 0) const
8848 { return this->find(__c, __pos); }
8849 size_type
8850 find_last_of(const basic_string& __str, size_type __pos = npos) const
8851 { return this->find_last_of(__str.data(), __pos, __str.size()); }
8852 size_type
8853 find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
8854 size_type
8855 find_last_of(const _CharT* __s, size_type __pos = npos) const
8856 {
8857 ;
8858 return this->find_last_of(__s, __pos, traits_type::length(__s));
8859 }
8860 size_type
8861 find_last_of(_CharT __c, size_type __pos = npos) const
8862 { return this->rfind(__c, __pos); }
8863 size_type
8864 find_first_not_of(const basic_string& __str, size_type __pos = 0) const
8865 { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
8866 size_type
8867 find_first_not_of(const _CharT* __s, size_type __pos,
8868 size_type __n) const;
8869 size_type
8870 find_first_not_of(const _CharT* __s, size_type __pos = 0) const
8871 {
8872 ;
8873 return this->find_first_not_of(__s, __pos, traits_type::length(__s));
8874 }
8875 size_type
8876 find_first_not_of(_CharT __c, size_type __pos = 0) const;
8877 size_type
8878 find_last_not_of(const basic_string& __str, size_type __pos = npos) const
8879 { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
8880 size_type
8881 find_last_not_of(const _CharT* __s, size_type __pos,
8882 size_type __n) const;
8883 size_type
8884 find_last_not_of(const _CharT* __s, size_type __pos = npos) const
8885 {
8886 ;
8887 return this->find_last_not_of(__s, __pos, traits_type::length(__s));
8888 }
8889 size_type
8890 find_last_not_of(_CharT __c, size_type __pos = npos) const;
8891 basic_string
8892 substr(size_type __pos = 0, size_type __n = npos) const
8893 { return basic_string(*this,
8894 _M_check(__pos, "basic_string::substr"), __n); }
8895 int
8896 compare(const basic_string& __str) const
8897 {
8898 const size_type __size = this->size();
8899 const size_type __osize = __str.size();
8900 const size_type __len = std::min(__size, __osize);
8901 int __r = traits_type::compare(_M_data(), __str.data(), __len);
8902 if (!__r)
8903 __r = _S_compare(__size, __osize);
8904 return __r;
8905 }
8906 int
8907 compare(size_type __pos, size_type __n, const basic_string& __str) const;
8908 int
8909 compare(size_type __pos1, size_type __n1, const basic_string& __str,
8910 size_type __pos2, size_type __n2) const;
8911 int
8912 compare(const _CharT* __s) const;
8913 int
8914 compare(size_type __pos, size_type __n1, const _CharT* __s) const;
8915 int
8916 compare(size_type __pos, size_type __n1, const _CharT* __s,
8917 size_type __n2) const;
8918 };
8919 template<typename _CharT, typename _Traits, typename _Alloc>
8920 basic_string<_CharT, _Traits, _Alloc>
8921 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8922 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
8923 {
8924 basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
8925 __str.append(__rhs);
8926 return __str;
8927 }
8928 template<typename _CharT, typename _Traits, typename _Alloc>
8929 basic_string<_CharT,_Traits,_Alloc>
8930 operator+(const _CharT* __lhs,
8931 const basic_string<_CharT,_Traits,_Alloc>& __rhs);
8932 template<typename _CharT, typename _Traits, typename _Alloc>
8933 basic_string<_CharT,_Traits,_Alloc>
8934 operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
8935 template<typename _CharT, typename _Traits, typename _Alloc>
8936 inline basic_string<_CharT, _Traits, _Alloc>
8937 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8938 const _CharT* __rhs)
8939 {
8940 basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
8941 __str.append(__rhs);
8942 return __str;
8943 }
8944 template<typename _CharT, typename _Traits, typename _Alloc>
8945 inline basic_string<_CharT, _Traits, _Alloc>
8946 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
8947 {
8948 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
8949 typedef typename __string_type::size_type __size_type;
8950 __string_type __str(__lhs);
8951 __str.append(__size_type(1), __rhs);
8952 return __str;
8953 }
8954 template<typename _CharT, typename _Traits, typename _Alloc>
8955 inline bool
8956 operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8957 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
8958 { return __lhs.compare(__rhs) == 0; }
8959 template<typename _CharT>
8960 inline
8961 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
8962 operator==(const basic_string<_CharT>& __lhs,
8963 const basic_string<_CharT>& __rhs)
8964 { return (__lhs.size() == __rhs.size()
8965 && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
8966 __lhs.size())); }
8967 template<typename _CharT, typename _Traits, typename _Alloc>
8968 inline bool
8969 operator==(const _CharT* __lhs,
8970 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
8971 { return __rhs.compare(__lhs) == 0; }
8972 template<typename _CharT, typename _Traits, typename _Alloc>
8973 inline bool
8974 operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8975 const _CharT* __rhs)
8976 { return __lhs.compare(__rhs) == 0; }
8977 template<typename _CharT, typename _Traits, typename _Alloc>
8978 inline bool
8979 operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8980 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
8981 { return !(__lhs == __rhs); }
8982 template<typename _CharT, typename _Traits, typename _Alloc>
8983 inline bool
8984 operator!=(const _CharT* __lhs,
8985 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
8986 { return !(__lhs == __rhs); }
8987 template<typename _CharT, typename _Traits, typename _Alloc>
8988 inline bool
8989 operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8990 const _CharT* __rhs)
8991 { return !(__lhs == __rhs); }
8992 template<typename _CharT, typename _Traits, typename _Alloc>
8993 inline bool
8994 operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
8995 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
8996 { return __lhs.compare(__rhs) < 0; }
8997 template<typename _CharT, typename _Traits, typename _Alloc>
8998 inline bool
8999 operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9000 const _CharT* __rhs)
9001 { return __lhs.compare(__rhs) < 0; }
9002 template<typename _CharT, typename _Traits, typename _Alloc>
9003 inline bool
9004 operator<(const _CharT* __lhs,
9005 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9006 { return __rhs.compare(__lhs) > 0; }
9007 template<typename _CharT, typename _Traits, typename _Alloc>
9008 inline bool
9009 operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9010 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9011 { return __lhs.compare(__rhs) > 0; }
9012 template<typename _CharT, typename _Traits, typename _Alloc>
9013 inline bool
9014 operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9015 const _CharT* __rhs)
9016 { return __lhs.compare(__rhs) > 0; }
9017 template<typename _CharT, typename _Traits, typename _Alloc>
9018 inline bool
9019 operator>(const _CharT* __lhs,
9020 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9021 { return __rhs.compare(__lhs) < 0; }
9022 template<typename _CharT, typename _Traits, typename _Alloc>
9023 inline bool
9024 operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9025 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9026 { return __lhs.compare(__rhs) <= 0; }
9027 template<typename _CharT, typename _Traits, typename _Alloc>
9028 inline bool
9029 operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9030 const _CharT* __rhs)
9031 { return __lhs.compare(__rhs) <= 0; }
9032 template<typename _CharT, typename _Traits, typename _Alloc>
9033 inline bool
9034 operator<=(const _CharT* __lhs,
9035 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9036 { return __rhs.compare(__lhs) >= 0; }
9037 template<typename _CharT, typename _Traits, typename _Alloc>
9038 inline bool
9039 operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9040 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9041 { return __lhs.compare(__rhs) >= 0; }
9042 template<typename _CharT, typename _Traits, typename _Alloc>
9043 inline bool
9044 operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
9045 const _CharT* __rhs)
9046 { return __lhs.compare(__rhs) >= 0; }
9047 template<typename _CharT, typename _Traits, typename _Alloc>
9048 inline bool
9049 operator>=(const _CharT* __lhs,
9050 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9051 { return __rhs.compare(__lhs) <= 0; }
9052 template<typename _CharT, typename _Traits, typename _Alloc>
9053 inline void
9054 swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
9055 basic_string<_CharT, _Traits, _Alloc>& __rhs)
9056 { __lhs.swap(__rhs); }
9057 template<typename _CharT, typename _Traits, typename _Alloc>
9058 basic_istream<_CharT, _Traits>&
9059 operator>>(basic_istream<_CharT, _Traits>& __is,
9060 basic_string<_CharT, _Traits, _Alloc>& __str);
9061 template<>
9062 basic_istream<char>&
9063 operator>>(basic_istream<char>& __is, basic_string<char>& __str);
9064 template<typename _CharT, typename _Traits, typename _Alloc>
9065 inline basic_ostream<_CharT, _Traits>&
9066 operator<<(basic_ostream<_CharT, _Traits>& __os,
9067 const basic_string<_CharT, _Traits, _Alloc>& __str)
9068 {
9069 return __ostream_insert(__os, __str.data(), __str.size());
9070 }
9071 template<typename _CharT, typename _Traits, typename _Alloc>
9072 basic_istream<_CharT, _Traits>&
9073 getline(basic_istream<_CharT, _Traits>& __is,
9074 basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
9075 template<typename _CharT, typename _Traits, typename _Alloc>
9076 inline basic_istream<_CharT, _Traits>&
9077 getline(basic_istream<_CharT, _Traits>& __is,
9078 basic_string<_CharT, _Traits, _Alloc>& __str)
9079 { return getline(__is, __str, __is.widen('\n')); }
9080 template<>
9081 basic_istream<char>&
9082 getline(basic_istream<char>& __in, basic_string<char>& __str,
9083 char __delim);
9084 template<>
9085 basic_istream<wchar_t>&
9086 getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
9087 wchar_t __delim);
9088 }
9089
9090 namespace std __attribute__ ((__visibility__ ("default"))) {
9091 template<typename _CharT, typename _Traits, typename _Alloc>
9092 const typename basic_string<_CharT, _Traits, _Alloc>::size_type
9093 basic_string<_CharT, _Traits, _Alloc>::
9094 _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
9095 template<typename _CharT, typename _Traits, typename _Alloc>
9096 const _CharT
9097 basic_string<_CharT, _Traits, _Alloc>::
9098 _Rep::_S_terminal = _CharT();
9099 template<typename _CharT, typename _Traits, typename _Alloc>
9100 const typename basic_string<_CharT, _Traits, _Alloc>::size_type
9101 basic_string<_CharT, _Traits, _Alloc>::npos;
9102 template<typename _CharT, typename _Traits, typename _Alloc>
9103 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9104 basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
9105 (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
9106 sizeof(size_type)];
9107 template<typename _CharT, typename _Traits, typename _Alloc>
9108 template<typename _InIterator>
9109 _CharT*
9110 basic_string<_CharT, _Traits, _Alloc>::
9111 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
9112 input_iterator_tag)
9113 {
9114 if (__beg == __end && __a == _Alloc())
9115 return _S_empty_rep()._M_refdata();
9116 _CharT __buf[128];
9117 size_type __len = 0;
9118 while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
9119 {
9120 __buf[__len++] = *__beg;
9121 ++__beg;
9122 }
9123 _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
9124 _M_copy(__r->_M_refdata(), __buf, __len);
9125 try
9126 {
9127 while (__beg != __end)
9128 {
9129 if (__len == __r->_M_capacity)
9130 {
9131 _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
9132 _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
9133 __r->_M_destroy(__a);
9134 __r = __another;
9135 }
9136 __r->_M_refdata()[__len++] = *__beg;
9137 ++__beg;
9138 }
9139 }
9140 catch(...)
9141 {
9142 __r->_M_destroy(__a);
9143 throw;
9144 }
9145 __r->_M_set_length_and_sharable(__len);
9146 return __r->_M_refdata();
9147 }
9148 template<typename _CharT, typename _Traits, typename _Alloc>
9149 template <typename _InIterator>
9150 _CharT*
9151 basic_string<_CharT, _Traits, _Alloc>::
9152 _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
9153 forward_iterator_tag)
9154 {
9155 if (__beg == __end && __a == _Alloc())
9156 return _S_empty_rep()._M_refdata();
9157 if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
9158 __throw_logic_error(("basic_string::_S_construct NULL not valid"));
9159 const size_type __dnew = static_cast<size_type>(std::distance(__beg,
9160 __end));
9161 _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
9162 try
9163 { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
9164 catch(...)
9165 {
9166 __r->_M_destroy(__a);
9167 throw;
9168 }
9169 __r->_M_set_length_and_sharable(__dnew);
9170 return __r->_M_refdata();
9171 }
9172 template<typename _CharT, typename _Traits, typename _Alloc>
9173 _CharT*
9174 basic_string<_CharT, _Traits, _Alloc>::
9175 _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
9176 {
9177 if (__n == 0 && __a == _Alloc())
9178 return _S_empty_rep()._M_refdata();
9179 _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
9180 if (__n)
9181 _M_assign(__r->_M_refdata(), __n, __c);
9182 __r->_M_set_length_and_sharable(__n);
9183 return __r->_M_refdata();
9184 }
9185 template<typename _CharT, typename _Traits, typename _Alloc>
9186 basic_string<_CharT, _Traits, _Alloc>::
9187 basic_string(const basic_string& __str)
9188 : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
9189 __str.get_allocator()),
9190 __str.get_allocator())
9191 { }
9192 template<typename _CharT, typename _Traits, typename _Alloc>
9193 basic_string<_CharT, _Traits, _Alloc>::
9194 basic_string(const _Alloc& __a)
9195 : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
9196 { }
9197 template<typename _CharT, typename _Traits, typename _Alloc>
9198 basic_string<_CharT, _Traits, _Alloc>::
9199 basic_string(const basic_string& __str, size_type __pos, size_type __n)
9200 : _M_dataplus(_S_construct(__str._M_data()
9201 + __str._M_check(__pos,
9202 "basic_string::basic_string"),
9203 __str._M_data() + __str._M_limit(__pos, __n)
9204 + __pos, _Alloc()), _Alloc())
9205 { }
9206 template<typename _CharT, typename _Traits, typename _Alloc>
9207 basic_string<_CharT, _Traits, _Alloc>::
9208 basic_string(const basic_string& __str, size_type __pos,
9209 size_type __n, const _Alloc& __a)
9210 : _M_dataplus(_S_construct(__str._M_data()
9211 + __str._M_check(__pos,
9212 "basic_string::basic_string"),
9213 __str._M_data() + __str._M_limit(__pos, __n)
9214 + __pos, __a), __a)
9215 { }
9216 template<typename _CharT, typename _Traits, typename _Alloc>
9217 basic_string<_CharT, _Traits, _Alloc>::
9218 basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
9219 : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
9220 { }
9221 template<typename _CharT, typename _Traits, typename _Alloc>
9222 basic_string<_CharT, _Traits, _Alloc>::
9223 basic_string(const _CharT* __s, const _Alloc& __a)
9224 : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
9225 __s + npos, __a), __a)
9226 { }
9227 template<typename _CharT, typename _Traits, typename _Alloc>
9228 basic_string<_CharT, _Traits, _Alloc>::
9229 basic_string(size_type __n, _CharT __c, const _Alloc& __a)
9230 : _M_dataplus(_S_construct(__n, __c, __a), __a)
9231 { }
9232 template<typename _CharT, typename _Traits, typename _Alloc>
9233 template<typename _InputIterator>
9234 basic_string<_CharT, _Traits, _Alloc>::
9235 basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
9236 : _M_dataplus(_S_construct(__beg, __end, __a), __a)
9237 { }
9238 template<typename _CharT, typename _Traits, typename _Alloc>
9239 basic_string<_CharT, _Traits, _Alloc>&
9240 basic_string<_CharT, _Traits, _Alloc>::
9241 assign(const basic_string& __str)
9242 {
9243 if (_M_rep() != __str._M_rep())
9244 {
9245 const allocator_type __a = this->get_allocator();
9246 _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
9247 _M_rep()->_M_dispose(__a);
9248 _M_data(__tmp);
9249 }
9250 return *this;
9251 }
9252 template<typename _CharT, typename _Traits, typename _Alloc>
9253 basic_string<_CharT, _Traits, _Alloc>&
9254 basic_string<_CharT, _Traits, _Alloc>::
9255 assign(const _CharT* __s, size_type __n)
9256 {
9257 ;
9258 _M_check_length(this->size(), __n, "basic_string::assign");
9259 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
9260 return _M_replace_safe(size_type(0), this->size(), __s, __n);
9261 else
9262 {
9263 const size_type __pos = __s - _M_data();
9264 if (__pos >= __n)
9265 _M_copy(_M_data(), __s, __n);
9266 else if (__pos)
9267 _M_move(_M_data(), __s, __n);
9268 _M_rep()->_M_set_length_and_sharable(__n);
9269 return *this;
9270 }
9271 }
9272 template<typename _CharT, typename _Traits, typename _Alloc>
9273 basic_string<_CharT, _Traits, _Alloc>&
9274 basic_string<_CharT, _Traits, _Alloc>::
9275 append(size_type __n, _CharT __c)
9276 {
9277 if (__n)
9278 {
9279 _M_check_length(size_type(0), __n, "basic_string::append");
9280 const size_type __len = __n + this->size();
9281 if (__len > this->capacity() || _M_rep()->_M_is_shared())
9282 this->reserve(__len);
9283 _M_assign(_M_data() + this->size(), __n, __c);
9284 _M_rep()->_M_set_length_and_sharable(__len);
9285 }
9286 return *this;
9287 }
9288 template<typename _CharT, typename _Traits, typename _Alloc>
9289 basic_string<_CharT, _Traits, _Alloc>&
9290 basic_string<_CharT, _Traits, _Alloc>::
9291 append(const _CharT* __s, size_type __n)
9292 {
9293 ;
9294 if (__n)
9295 {
9296 _M_check_length(size_type(0), __n, "basic_string::append");
9297 const size_type __len = __n + this->size();
9298 if (__len > this->capacity() || _M_rep()->_M_is_shared())
9299 {
9300 if (_M_disjunct(__s))
9301 this->reserve(__len);
9302 else
9303 {
9304 const size_type __off = __s - _M_data();
9305 this->reserve(__len);
9306 __s = _M_data() + __off;
9307 }
9308 }
9309 _M_copy(_M_data() + this->size(), __s, __n);
9310 _M_rep()->_M_set_length_and_sharable(__len);
9311 }
9312 return *this;
9313 }
9314 template<typename _CharT, typename _Traits, typename _Alloc>
9315 basic_string<_CharT, _Traits, _Alloc>&
9316 basic_string<_CharT, _Traits, _Alloc>::
9317 append(const basic_string& __str)
9318 {
9319 const size_type __size = __str.size();
9320 if (__size)
9321 {
9322 const size_type __len = __size + this->size();
9323 if (__len > this->capacity() || _M_rep()->_M_is_shared())
9324 this->reserve(__len);
9325 _M_copy(_M_data() + this->size(), __str._M_data(), __size);
9326 _M_rep()->_M_set_length_and_sharable(__len);
9327 }
9328 return *this;
9329 }
9330 template<typename _CharT, typename _Traits, typename _Alloc>
9331 basic_string<_CharT, _Traits, _Alloc>&
9332 basic_string<_CharT, _Traits, _Alloc>::
9333 append(const basic_string& __str, size_type __pos, size_type __n)
9334 {
9335 __str._M_check(__pos, "basic_string::append");
9336 __n = __str._M_limit(__pos, __n);
9337 if (__n)
9338 {
9339 const size_type __len = __n + this->size();
9340 if (__len > this->capacity() || _M_rep()->_M_is_shared())
9341 this->reserve(__len);
9342 _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
9343 _M_rep()->_M_set_length_and_sharable(__len);
9344 }
9345 return *this;
9346 }
9347 template<typename _CharT, typename _Traits, typename _Alloc>
9348 basic_string<_CharT, _Traits, _Alloc>&
9349 basic_string<_CharT, _Traits, _Alloc>::
9350 insert(size_type __pos, const _CharT* __s, size_type __n)
9351 {
9352 ;
9353 _M_check(__pos, "basic_string::insert");
9354 _M_check_length(size_type(0), __n, "basic_string::insert");
9355 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
9356 return _M_replace_safe(__pos, size_type(0), __s, __n);
9357 else
9358 {
9359 const size_type __off = __s - _M_data();
9360 _M_mutate(__pos, 0, __n);
9361 __s = _M_data() + __off;
9362 _CharT* __p = _M_data() + __pos;
9363 if (__s + __n <= __p)
9364 _M_copy(__p, __s, __n);
9365 else if (__s >= __p)
9366 _M_copy(__p, __s + __n, __n);
9367 else
9368 {
9369 const size_type __nleft = __p - __s;
9370 _M_copy(__p, __s, __nleft);
9371 _M_copy(__p + __nleft, __p + __n, __n - __nleft);
9372 }
9373 return *this;
9374 }
9375 }
9376 template<typename _CharT, typename _Traits, typename _Alloc>
9377 typename basic_string<_CharT, _Traits, _Alloc>::iterator
9378 basic_string<_CharT, _Traits, _Alloc>::
9379 erase(iterator __first, iterator __last)
9380 {
9381
9382 ;
9383 const size_type __size = __last - __first;
9384 if (__size)
9385 {
9386 const size_type __pos = __first - _M_ibegin();
9387 _M_mutate(__pos, __size, size_type(0));
9388 _M_rep()->_M_set_leaked();
9389 return iterator(_M_data() + __pos);
9390 }
9391 else
9392 return __first;
9393 }
9394 template<typename _CharT, typename _Traits, typename _Alloc>
9395 basic_string<_CharT, _Traits, _Alloc>&
9396 basic_string<_CharT, _Traits, _Alloc>::
9397 replace(size_type __pos, size_type __n1, const _CharT* __s,
9398 size_type __n2)
9399 {
9400 ;
9401 _M_check(__pos, "basic_string::replace");
9402 __n1 = _M_limit(__pos, __n1);
9403 _M_check_length(__n1, __n2, "basic_string::replace");
9404 bool __left;
9405 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
9406 return _M_replace_safe(__pos, __n1, __s, __n2);
9407 else if ((__left = __s + __n2 <= _M_data() + __pos)
9408 || _M_data() + __pos + __n1 <= __s)
9409 {
9410 size_type __off = __s - _M_data();
9411 __left ? __off : (__off += __n2 - __n1);
9412 _M_mutate(__pos, __n1, __n2);
9413 _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
9414 return *this;
9415 }
9416 else
9417 {
9418 const basic_string __tmp(__s, __n2);
9419 return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
9420 }
9421 }
9422 template<typename _CharT, typename _Traits, typename _Alloc>
9423 void
9424 basic_string<_CharT, _Traits, _Alloc>::_Rep::
9425 _M_destroy(const _Alloc& __a) throw ()
9426 {
9427 const size_type __size = sizeof(_Rep_base) +
9428 (this->_M_capacity + 1) * sizeof(_CharT);
9429 _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
9430 }
9431 template<typename _CharT, typename _Traits, typename _Alloc>
9432 void
9433 basic_string<_CharT, _Traits, _Alloc>::
9434 _M_leak_hard()
9435 {
9436 if (_M_rep() == &_S_empty_rep())
9437 return;
9438 if (_M_rep()->_M_is_shared())
9439 _M_mutate(0, 0, 0);
9440 _M_rep()->_M_set_leaked();
9441 }
9442 template<typename _CharT, typename _Traits, typename _Alloc>
9443 void
9444 basic_string<_CharT, _Traits, _Alloc>::
9445 _M_mutate(size_type __pos, size_type __len1, size_type __len2)
9446 {
9447 const size_type __old_size = this->size();
9448 const size_type __new_size = __old_size + __len2 - __len1;
9449 const size_type __how_much = __old_size - __pos - __len1;
9450 if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
9451 {
9452 const allocator_type __a = get_allocator();
9453 _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
9454 if (__pos)
9455 _M_copy(__r->_M_refdata(), _M_data(), __pos);
9456 if (__how_much)
9457 _M_copy(__r->_M_refdata() + __pos + __len2,
9458 _M_data() + __pos + __len1, __how_much);
9459 _M_rep()->_M_dispose(__a);
9460 _M_data(__r->_M_refdata());
9461 }
9462 else if (__how_much && __len1 != __len2)
9463 {
9464 _M_move(_M_data() + __pos + __len2,
9465 _M_data() + __pos + __len1, __how_much);
9466 }
9467 _M_rep()->_M_set_length_and_sharable(__new_size);
9468 }
9469 template<typename _CharT, typename _Traits, typename _Alloc>
9470 void
9471 basic_string<_CharT, _Traits, _Alloc>::
9472 reserve(size_type __res)
9473 {
9474 if (__res != this->capacity() || _M_rep()->_M_is_shared())
9475 {
9476 if (__res < this->size())
9477 __res = this->size();
9478 const allocator_type __a = get_allocator();
9479 _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
9480 _M_rep()->_M_dispose(__a);
9481 _M_data(__tmp);
9482 }
9483 }
9484 template<typename _CharT, typename _Traits, typename _Alloc>
9485 void
9486 basic_string<_CharT, _Traits, _Alloc>::
9487 swap(basic_string& __s)
9488 {
9489 if (_M_rep()->_M_is_leaked())
9490 _M_rep()->_M_set_sharable();
9491 if (__s._M_rep()->_M_is_leaked())
9492 __s._M_rep()->_M_set_sharable();
9493 if (this->get_allocator() == __s.get_allocator())
9494 {
9495 _CharT* __tmp = _M_data();
9496 _M_data(__s._M_data());
9497 __s._M_data(__tmp);
9498 }
9499 else
9500 {
9501 const basic_string __tmp1(_M_ibegin(), _M_iend(),
9502 __s.get_allocator());
9503 const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
9504 this->get_allocator());
9505 *this = __tmp2;
9506 __s = __tmp1;
9507 }
9508 }
9509 template<typename _CharT, typename _Traits, typename _Alloc>
9510 typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
9511 basic_string<_CharT, _Traits, _Alloc>::_Rep::
9512 _S_create(size_type __capacity, size_type __old_capacity,
9513 const _Alloc& __alloc)
9514 {
9515 if (__capacity > _S_max_size)
9516 __throw_length_error(("basic_string::_S_create"));
9517 const size_type __pagesize = 4096;
9518 const size_type __malloc_header_size = 4 * sizeof(void*);
9519 if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
9520 __capacity = 2 * __old_capacity;
9521 size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
9522 const size_type __adj_size = __size + __malloc_header_size;
9523 if (__adj_size > __pagesize && __capacity > __old_capacity)
9524 {
9525 const size_type __extra = __pagesize - __adj_size % __pagesize;
9526 __capacity += __extra / sizeof(_CharT);
9527 if (__capacity > _S_max_size)
9528 __capacity = _S_max_size;
9529 __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
9530 }
9531 void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
9532 _Rep *__p = new (__place) _Rep;
9533 __p->_M_capacity = __capacity;
9534 __p->_M_set_sharable();
9535 return __p;
9536 }
9537 template<typename _CharT, typename _Traits, typename _Alloc>
9538 _CharT*
9539 basic_string<_CharT, _Traits, _Alloc>::_Rep::
9540 _M_clone(const _Alloc& __alloc, size_type __res)
9541 {
9542 const size_type __requested_cap = this->_M_length + __res;
9543 _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
9544 __alloc);
9545 if (this->_M_length)
9546 _M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
9547 __r->_M_set_length_and_sharable(this->_M_length);
9548 return __r->_M_refdata();
9549 }
9550 template<typename _CharT, typename _Traits, typename _Alloc>
9551 void
9552 basic_string<_CharT, _Traits, _Alloc>::
9553 resize(size_type __n, _CharT __c)
9554 {
9555 const size_type __size = this->size();
9556 _M_check_length(__size, __n, "basic_string::resize");
9557 if (__size < __n)
9558 this->append(__n - __size, __c);
9559 else if (__n < __size)
9560 this->erase(__n);
9561 }
9562 template<typename _CharT, typename _Traits, typename _Alloc>
9563 template<typename _InputIterator>
9564 basic_string<_CharT, _Traits, _Alloc>&
9565 basic_string<_CharT, _Traits, _Alloc>::
9566 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
9567 _InputIterator __k2, __false_type)
9568 {
9569 const basic_string __s(__k1, __k2);
9570 const size_type __n1 = __i2 - __i1;
9571 _M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
9572 return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
9573 __s.size());
9574 }
9575 template<typename _CharT, typename _Traits, typename _Alloc>
9576 basic_string<_CharT, _Traits, _Alloc>&
9577 basic_string<_CharT, _Traits, _Alloc>::
9578 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
9579 _CharT __c)
9580 {
9581 _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
9582 _M_mutate(__pos1, __n1, __n2);
9583 if (__n2)
9584 _M_assign(_M_data() + __pos1, __n2, __c);
9585 return *this;
9586 }
9587 template<typename _CharT, typename _Traits, typename _Alloc>
9588 basic_string<_CharT, _Traits, _Alloc>&
9589 basic_string<_CharT, _Traits, _Alloc>::
9590 _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
9591 size_type __n2)
9592 {
9593 _M_mutate(__pos1, __n1, __n2);
9594 if (__n2)
9595 _M_copy(_M_data() + __pos1, __s, __n2);
9596 return *this;
9597 }
9598 template<typename _CharT, typename _Traits, typename _Alloc>
9599 basic_string<_CharT, _Traits, _Alloc>
9600 operator+(const _CharT* __lhs,
9601 const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9602 {
9603 ;
9604 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
9605 typedef typename __string_type::size_type __size_type;
9606 const __size_type __len = _Traits::length(__lhs);
9607 __string_type __str;
9608 __str.reserve(__len + __rhs.size());
9609 __str.append(__lhs, __len);
9610 __str.append(__rhs);
9611 return __str;
9612 }
9613 template<typename _CharT, typename _Traits, typename _Alloc>
9614 basic_string<_CharT, _Traits, _Alloc>
9615 operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
9616 {
9617 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
9618 typedef typename __string_type::size_type __size_type;
9619 __string_type __str;
9620 const __size_type __len = __rhs.size();
9621 __str.reserve(__len + 1);
9622 __str.append(__size_type(1), __lhs);
9623 __str.append(__rhs);
9624 return __str;
9625 }
9626 template<typename _CharT, typename _Traits, typename _Alloc>
9627 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9628 basic_string<_CharT, _Traits, _Alloc>::
9629 copy(_CharT* __s, size_type __n, size_type __pos) const
9630 {
9631 _M_check(__pos, "basic_string::copy");
9632 __n = _M_limit(__pos, __n);
9633 ;
9634 if (__n)
9635 _M_copy(__s, _M_data() + __pos, __n);
9636 return __n;
9637 }
9638 template<typename _CharT, typename _Traits, typename _Alloc>
9639 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9640 basic_string<_CharT, _Traits, _Alloc>::
9641 find(const _CharT* __s, size_type __pos, size_type __n) const
9642 {
9643 ;
9644 const size_type __size = this->size();
9645 const _CharT* __data = _M_data();
9646 if (__n == 0)
9647 return __pos <= __size ? __pos : npos;
9648 if (__n <= __size)
9649 {
9650 for (; __pos <= __size - __n; ++__pos)
9651 if (traits_type::eq(__data[__pos], __s[0])
9652 && traits_type::compare(__data + __pos + 1,
9653 __s + 1, __n - 1) == 0)
9654 return __pos;
9655 }
9656 return npos;
9657 }
9658 template<typename _CharT, typename _Traits, typename _Alloc>
9659 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9660 basic_string<_CharT, _Traits, _Alloc>::
9661 find(_CharT __c, size_type __pos) const
9662 {
9663 size_type __ret = npos;
9664 const size_type __size = this->size();
9665 if (__pos < __size)
9666 {
9667 const _CharT* __data = _M_data();
9668 const size_type __n = __size - __pos;
9669 const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
9670 if (__p)
9671 __ret = __p - __data;
9672 }
9673 return __ret;
9674 }
9675 template<typename _CharT, typename _Traits, typename _Alloc>
9676 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9677 basic_string<_CharT, _Traits, _Alloc>::
9678 rfind(const _CharT* __s, size_type __pos, size_type __n) const
9679 {
9680 ;
9681 const size_type __size = this->size();
9682 if (__n <= __size)
9683 {
9684 __pos = std::min(size_type(__size - __n), __pos);
9685 const _CharT* __data = _M_data();
9686 do
9687 {
9688 if (traits_type::compare(__data + __pos, __s, __n) == 0)
9689 return __pos;
9690 }
9691 while (__pos-- > 0);
9692 }
9693 return npos;
9694 }
9695 template<typename _CharT, typename _Traits, typename _Alloc>
9696 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9697 basic_string<_CharT, _Traits, _Alloc>::
9698 rfind(_CharT __c, size_type __pos) const
9699 {
9700 size_type __size = this->size();
9701 if (__size)
9702 {
9703 if (--__size > __pos)
9704 __size = __pos;
9705 for (++__size; __size-- > 0; )
9706 if (traits_type::eq(_M_data()[__size], __c))
9707 return __size;
9708 }
9709 return npos;
9710 }
9711 template<typename _CharT, typename _Traits, typename _Alloc>
9712 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9713 basic_string<_CharT, _Traits, _Alloc>::
9714 find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
9715 {
9716 ;
9717 for (; __n && __pos < this->size(); ++__pos)
9718 {
9719 const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
9720 if (__p)
9721 return __pos;
9722 }
9723 return npos;
9724 }
9725 template<typename _CharT, typename _Traits, typename _Alloc>
9726 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9727 basic_string<_CharT, _Traits, _Alloc>::
9728 find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
9729 {
9730 ;
9731 size_type __size = this->size();
9732 if (__size && __n)
9733 {
9734 if (--__size > __pos)
9735 __size = __pos;
9736 do
9737 {
9738 if (traits_type::find(__s, __n, _M_data()[__size]))
9739 return __size;
9740 }
9741 while (__size-- != 0);
9742 }
9743 return npos;
9744 }
9745 template<typename _CharT, typename _Traits, typename _Alloc>
9746 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9747 basic_string<_CharT, _Traits, _Alloc>::
9748 find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
9749 {
9750 ;
9751 for (; __pos < this->size(); ++__pos)
9752 if (!traits_type::find(__s, __n, _M_data()[__pos]))
9753 return __pos;
9754 return npos;
9755 }
9756 template<typename _CharT, typename _Traits, typename _Alloc>
9757 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9758 basic_string<_CharT, _Traits, _Alloc>::
9759 find_first_not_of(_CharT __c, size_type __pos) const
9760 {
9761 for (; __pos < this->size(); ++__pos)
9762 if (!traits_type::eq(_M_data()[__pos], __c))
9763 return __pos;
9764 return npos;
9765 }
9766 template<typename _CharT, typename _Traits, typename _Alloc>
9767 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9768 basic_string<_CharT, _Traits, _Alloc>::
9769 find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
9770 {
9771 ;
9772 size_type __size = this->size();
9773 if (__size)
9774 {
9775 if (--__size > __pos)
9776 __size = __pos;
9777 do
9778 {
9779 if (!traits_type::find(__s, __n, _M_data()[__size]))
9780 return __size;
9781 }
9782 while (__size--);
9783 }
9784 return npos;
9785 }
9786 template<typename _CharT, typename _Traits, typename _Alloc>
9787 typename basic_string<_CharT, _Traits, _Alloc>::size_type
9788 basic_string<_CharT, _Traits, _Alloc>::
9789 find_last_not_of(_CharT __c, size_type __pos) const
9790 {
9791 size_type __size = this->size();
9792 if (__size)
9793 {
9794 if (--__size > __pos)
9795 __size = __pos;
9796 do
9797 {
9798 if (!traits_type::eq(_M_data()[__size], __c))
9799 return __size;
9800 }
9801 while (__size--);
9802 }
9803 return npos;
9804 }
9805 template<typename _CharT, typename _Traits, typename _Alloc>
9806 int
9807 basic_string<_CharT, _Traits, _Alloc>::
9808 compare(size_type __pos, size_type __n, const basic_string& __str) const
9809 {
9810 _M_check(__pos, "basic_string::compare");
9811 __n = _M_limit(__pos, __n);
9812 const size_type __osize = __str.size();
9813 const size_type __len = std::min(__n, __osize);
9814 int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
9815 if (!__r)
9816 __r = _S_compare(__n, __osize);
9817 return __r;
9818 }
9819 template<typename _CharT, typename _Traits, typename _Alloc>
9820 int
9821 basic_string<_CharT, _Traits, _Alloc>::
9822 compare(size_type __pos1, size_type __n1, const basic_string& __str,
9823 size_type __pos2, size_type __n2) const
9824 {
9825 _M_check(__pos1, "basic_string::compare");
9826 __str._M_check(__pos2, "basic_string::compare");
9827 __n1 = _M_limit(__pos1, __n1);
9828 __n2 = __str._M_limit(__pos2, __n2);
9829 const size_type __len = std::min(__n1, __n2);
9830 int __r = traits_type::compare(_M_data() + __pos1,
9831 __str.data() + __pos2, __len);
9832 if (!__r)
9833 __r = _S_compare(__n1, __n2);
9834 return __r;
9835 }
9836 template<typename _CharT, typename _Traits, typename _Alloc>
9837 int
9838 basic_string<_CharT, _Traits, _Alloc>::
9839 compare(const _CharT* __s) const
9840 {
9841 ;
9842 const size_type __size = this->size();
9843 const size_type __osize = traits_type::length(__s);
9844 const size_type __len = std::min(__size, __osize);
9845 int __r = traits_type::compare(_M_data(), __s, __len);
9846 if (!__r)
9847 __r = _S_compare(__size, __osize);
9848 return __r;
9849 }
9850 template<typename _CharT, typename _Traits, typename _Alloc>
9851 int
9852 basic_string <_CharT, _Traits, _Alloc>::
9853 compare(size_type __pos, size_type __n1, const _CharT* __s) const
9854 {
9855 ;
9856 _M_check(__pos, "basic_string::compare");
9857 __n1 = _M_limit(__pos, __n1);
9858 const size_type __osize = traits_type::length(__s);
9859 const size_type __len = std::min(__n1, __osize);
9860 int __r = traits_type::compare(_M_data() + __pos, __s, __len);
9861 if (!__r)
9862 __r = _S_compare(__n1, __osize);
9863 return __r;
9864 }
9865 template<typename _CharT, typename _Traits, typename _Alloc>
9866 int
9867 basic_string <_CharT, _Traits, _Alloc>::
9868 compare(size_type __pos, size_type __n1, const _CharT* __s,
9869 size_type __n2) const
9870 {
9871 ;
9872 _M_check(__pos, "basic_string::compare");
9873 __n1 = _M_limit(__pos, __n1);
9874 const size_type __len = std::min(__n1, __n2);
9875 int __r = traits_type::compare(_M_data() + __pos, __s, __len);
9876 if (!__r)
9877 __r = _S_compare(__n1, __n2);
9878 return __r;
9879 }
9880 template<typename _CharT, typename _Traits, typename _Alloc>
9881 basic_istream<_CharT, _Traits>&
9882 operator>>(basic_istream<_CharT, _Traits>& __in,
9883 basic_string<_CharT, _Traits, _Alloc>& __str)
9884 {
9885 typedef basic_istream<_CharT, _Traits> __istream_type;
9886 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
9887 typedef typename __istream_type::ios_base __ios_base;
9888 typedef typename __istream_type::int_type __int_type;
9889 typedef typename __string_type::size_type __size_type;
9890 typedef ctype<_CharT> __ctype_type;
9891 typedef typename __ctype_type::ctype_base __ctype_base;
9892 __size_type __extracted = 0;
9893 typename __ios_base::iostate __err = __ios_base::goodbit;
9894 typename __istream_type::sentry __cerb(__in, false);
9895 if (__cerb)
9896 {
9897 try
9898 {
9899 __str.erase();
9900 _CharT __buf[128];
9901 __size_type __len = 0;
9902 const streamsize __w = __in.width();
9903 const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
9904 : __str.max_size();
9905 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
9906 const __int_type __eof = _Traits::eof();
9907 __int_type __c = __in.rdbuf()->sgetc();
9908 while (__extracted < __n
9909 && !_Traits::eq_int_type(__c, __eof)
9910 && !__ct.is(__ctype_base::space,
9911 _Traits::to_char_type(__c)))
9912 {
9913 if (__len == sizeof(__buf) / sizeof(_CharT))
9914 {
9915 __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
9916 __len = 0;
9917 }
9918 __buf[__len++] = _Traits::to_char_type(__c);
9919 ++__extracted;
9920 __c = __in.rdbuf()->snextc();
9921 }
9922 __str.append(__buf, __len);
9923 if (_Traits::eq_int_type(__c, __eof))
9924 __err |= __ios_base::eofbit;
9925 __in.width(0);
9926 }
9927 catch(__cxxabiv1::__forced_unwind&)
9928 {
9929 __in._M_setstate(__ios_base::badbit);
9930 throw;
9931 }
9932 catch(...)
9933 {
9934 __in._M_setstate(__ios_base::badbit);
9935 }
9936 }
9937 if (!__extracted)
9938 __err |= __ios_base::failbit;
9939 if (__err)
9940 __in.setstate(__err);
9941 return __in;
9942 }
9943 template<typename _CharT, typename _Traits, typename _Alloc>
9944 basic_istream<_CharT, _Traits>&
9945 getline(basic_istream<_CharT, _Traits>& __in,
9946 basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
9947 {
9948 typedef basic_istream<_CharT, _Traits> __istream_type;
9949 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
9950 typedef typename __istream_type::ios_base __ios_base;
9951 typedef typename __istream_type::int_type __int_type;
9952 typedef typename __string_type::size_type __size_type;
9953 __size_type __extracted = 0;
9954 const __size_type __n = __str.max_size();
9955 typename __ios_base::iostate __err = __ios_base::goodbit;
9956 typename __istream_type::sentry __cerb(__in, true);
9957 if (__cerb)
9958 {
9959 try
9960 {
9961 __str.erase();
9962 const __int_type __idelim = _Traits::to_int_type(__delim);
9963 const __int_type __eof = _Traits::eof();
9964 __int_type __c = __in.rdbuf()->sgetc();
9965 while (__extracted < __n
9966 && !_Traits::eq_int_type(__c, __eof)
9967 && !_Traits::eq_int_type(__c, __idelim))
9968 {
9969 __str += _Traits::to_char_type(__c);
9970 ++__extracted;
9971 __c = __in.rdbuf()->snextc();
9972 }
9973 if (_Traits::eq_int_type(__c, __eof))
9974 __err |= __ios_base::eofbit;
9975 else if (_Traits::eq_int_type(__c, __idelim))
9976 {
9977 ++__extracted;
9978 __in.rdbuf()->sbumpc();
9979 }
9980 else
9981 __err |= __ios_base::failbit;
9982 }
9983 catch(__cxxabiv1::__forced_unwind&)
9984 {
9985 __in._M_setstate(__ios_base::badbit);
9986 throw;
9987 }
9988 catch(...)
9989 {
9990 __in._M_setstate(__ios_base::badbit);
9991 }
9992 }
9993 if (!__extracted)
9994 __err |= __ios_base::failbit;
9995 if (__err)
9996 __in.setstate(__err);
9997 return __in;
9998 }
9999 extern template class basic_string<char>;
10000 extern template
10001 basic_istream<char>&
10002 operator>>(basic_istream<char>&, string&);
10003 extern template
10004 basic_ostream<char>&
10005 operator<<(basic_ostream<char>&, const string&);
10006 extern template
10007 basic_istream<char>&
10008 getline(basic_istream<char>&, string&, char);
10009 extern template
10010 basic_istream<char>&
10011 getline(basic_istream<char>&, string&);
10012 extern template class basic_string<wchar_t>;
10013 extern template
10014 basic_istream<wchar_t>&
10015 operator>>(basic_istream<wchar_t>&, wstring&);
10016 extern template
10017 basic_ostream<wchar_t>&
10018 operator<<(basic_ostream<wchar_t>&, const wstring&);
10019 extern template
10020 basic_istream<wchar_t>&
10021 getline(basic_istream<wchar_t>&, wstring&, wchar_t);
10022 extern template
10023 basic_istream<wchar_t>&
10024 getline(basic_istream<wchar_t>&, wstring&);
10025 }
10026 typedef std::basic_string<wchar_t> QStdWString;
10027 typedef QtValidLicenseForCoreModule QtCoreModule;
10028 class QCharRef;
10029 class QRegExp;
10030 class QStringList;
10031 class QTextCodec;
10032 class QLatin1String;
10033 class QStringRef;
10034 template <typename T> class QVector;
10035 class QString
10036 {
10037 public:
10038 inline QString();
10039 QString(const QChar *unicode, int size);
10040 QString(QChar c);
10041 QString(int size, QChar c);
10042 inline QString(const QLatin1String &latin1);
10043 inline QString(const QString &);
10044 inline ~QString();
10045 QString &operator=(QChar c);
10046 QString &operator=(const QString &);
10047 inline QString &operator=(const QLatin1String &);
10048 inline int size() const { return d->size; }
10049 inline int count() const { return d->size; }
10050 inline int length() const;
10051 inline bool isEmpty() const;
10052 void resize(int size);
10053 QString &fill(QChar c, int size = -1);
10054 void truncate(int pos);
10055 void chop(int n);
10056 int capacity() const;
10057 inline void reserve(int size);
10058 inline void squeeze() { if (d->size < d->alloc || d->ref != 1) realloc(); d->capacity = 0;}
10059 inline const QChar *unicode() const;
10060 inline QChar *data();
10061 inline const QChar *data() const;
10062 inline const QChar *constData() const;
10063 inline void detach();
10064 inline bool isDetached() const;
10065 void clear();
10066 inline const QChar at(int i) const;
10067 const QChar operator[](int i) const;
10068 QCharRef operator[](int i);
10069 const QChar operator[](uint i) const;
10070 QCharRef operator[](uint i);
10071 QString arg(qlonglong a, int fieldwidth=0, int base=10,
10072 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10073 QString arg(qulonglong a, int fieldwidth=0, int base=10,
10074 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10075 QString arg(long a, int fieldwidth=0, int base=10,
10076 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10077 QString arg(ulong a, int fieldwidth=0, int base=10,
10078 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10079 QString arg(int a, int fieldWidth = 0, int base = 10,
10080 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10081 QString arg(uint a, int fieldWidth = 0, int base = 10,
10082 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10083 QString arg(short a, int fieldWidth = 0, int base = 10,
10084 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10085 QString arg(ushort a, int fieldWidth = 0, int base = 10,
10086 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10087 QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
10088 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10089 QString arg(char a, int fieldWidth = 0,
10090 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10091 QString arg(QChar a, int fieldWidth = 0,
10092 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10093 QString arg(const QString &a, int fieldWidth = 0,
10094 const QChar &fillChar = QLatin1Char(' ')) const __attribute__ ((warn_unused_result));
10095 QString arg(const QString &a1, const QString &a2) const __attribute__ ((warn_unused_result));
10096 QString arg(const QString &a1, const QString &a2, const QString &a3) const __attribute__ ((warn_unused_result));
10097 QString arg(const QString &a1, const QString &a2, const QString &a3,
10098 const QString &a4) const __attribute__ ((warn_unused_result));
10099 QString arg(const QString &a1, const QString &a2, const QString &a3,
10100 const QString &a4, const QString &a5) const __attribute__ ((warn_unused_result));
10101 QString arg(const QString &a1, const QString &a2, const QString &a3,
10102 const QString &a4, const QString &a5, const QString &a6) const __attribute__ ((warn_unused_result));
10103 QString arg(const QString &a1, const QString &a2, const QString &a3,
10104 const QString &a4, const QString &a5, const QString &a6,
10105 const QString &a7) const __attribute__ ((warn_unused_result));
10106 QString arg(const QString &a1, const QString &a2, const QString &a3,
10107 const QString &a4, const QString &a5, const QString &a6,
10108 const QString &a7, const QString &a8) const __attribute__ ((warn_unused_result));
10109 QString arg(const QString &a1, const QString &a2, const QString &a3,
10110 const QString &a4, const QString &a5, const QString &a6,
10111 const QString &a7, const QString &a8, const QString &a9) const __attribute__ ((warn_unused_result));
10112 QString &vsprintf(const char *format, va_list ap)
10113 __attribute__ ((format (printf, 2, 0)))
10114 ;
10115 QString &sprintf(const char *format, ...)
10116 __attribute__ ((format (printf, 2, 3)))
10117 ;
10118 int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10119 int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10120 int indexOf(const QLatin1String &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10121 int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10122 int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10123 int lastIndexOf(const QLatin1String &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10124 inline QBool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10125 inline QBool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10126 int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10127 int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10128 int indexOf(const QRegExp &, int from = 0) const;
10129 int lastIndexOf(const QRegExp &, int from = -1) const;
10130 inline QBool contains(const QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
10131 int count(const QRegExp &) const;
10132 int indexOf(QRegExp &, int from = 0) const;
10133 int lastIndexOf(QRegExp &, int from = -1) const;
10134 inline QBool contains(QRegExp &rx) const { return QBool(indexOf(rx) != -1); }
10135 enum SectionFlag {
10136 SectionDefault = 0x00,
10137 SectionSkipEmpty = 0x01,
10138 SectionIncludeLeadingSep = 0x02,
10139 SectionIncludeTrailingSep = 0x04,
10140 SectionCaseInsensitiveSeps = 0x08
10141 };
10142 typedef QFlags<SectionFlag> SectionFlags;
10143 QString section(QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
10144 QString section(const QString &in_sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
10145 QString section(const QRegExp &reg, int start, int end = -1, SectionFlags flags = SectionDefault) const;
10146 QString left(int n) const __attribute__ ((warn_unused_result));
10147 QString right(int n) const __attribute__ ((warn_unused_result));
10148 QString mid(int position, int n = -1) const __attribute__ ((warn_unused_result));
10149 QStringRef leftRef(int n) const __attribute__ ((warn_unused_result));
10150 QStringRef rightRef(int n) const __attribute__ ((warn_unused_result));
10151 QStringRef midRef(int position, int n = -1) const __attribute__ ((warn_unused_result));
10152 bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10153 bool startsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10154 bool startsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10155 bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10156 bool endsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10157 bool endsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10158 QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const __attribute__ ((warn_unused_result));
10159 QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const __attribute__ ((warn_unused_result));
10160 QString toLower() const __attribute__ ((warn_unused_result));
10161 QString toUpper() const __attribute__ ((warn_unused_result));
10162 QString toCaseFolded() const __attribute__ ((warn_unused_result));
10163 QString trimmed() const __attribute__ ((warn_unused_result));
10164 QString simplified() const __attribute__ ((warn_unused_result));
10165 QString &insert(int i, QChar c);
10166 QString &insert(int i, const QChar *uc, int len);
10167 inline QString &insert(int i, const QString &s) { return insert(i, s.constData(), s.length()); }
10168 QString &insert(int i, const QLatin1String &s);
10169 QString &append(QChar c);
10170 QString &append(const QString &s);
10171 QString &append(const QStringRef &s);
10172 QString &append(const QLatin1String &s);
10173 inline QString &prepend(QChar c) { return insert(0, c); }
10174 inline QString &prepend(const QString &s) { return insert(0, s); }
10175 inline QString &prepend(const QLatin1String &s) { return insert(0, s); }
10176 inline QString &operator+=(QChar c) {
10177 if (d->ref != 1 || d->size + 1 > d->alloc)
10178 realloc(grow(d->size + 1));
10179 d->data[d->size++] = c.unicode();
10180 d->data[d->size] = '\0';
10181 return *this;
10182 }
10183 inline QString &operator+=(QChar::SpecialCharacter c) { return append(QChar(c)); }
10184 inline QString &operator+=(const QString &s) { return append(s); }
10185 inline QString &operator+=(const QStringRef &s) { return append(s); }
10186 inline QString &operator+=(const QLatin1String &s) { return append(s); }
10187 QString &remove(int i, int len);
10188 QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10189 QString &remove(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10190 QString &replace(int i, int len, QChar after);
10191 QString &replace(int i, int len, const QChar *s, int slen);
10192 QString &replace(int i, int len, const QString &after);
10193 QString &replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10194 QString &replace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10195 QString &replace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10196 QString &replace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10197 QString &replace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10198 QString &replace(const QString &before, const QString &after,
10199 Qt::CaseSensitivity cs = Qt::CaseSensitive);
10200 QString &replace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10201 QString &replace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
10202 QString &replace(const QRegExp &rx, const QString &after);
10203 inline QString &remove(const QRegExp &rx)
10204 { return replace(rx, QString()); }
10205 enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
10206 QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
10207 Qt::CaseSensitivity cs = Qt::CaseSensitive) const __attribute__ ((warn_unused_result));
10208 QStringList split(const QChar &sep, SplitBehavior behavior = KeepEmptyParts,
10209 Qt::CaseSensitivity cs = Qt::CaseSensitive) const __attribute__ ((warn_unused_result));
10210 QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const __attribute__ ((warn_unused_result));
10211 enum NormalizationForm {
10212 NormalizationForm_D,
10213 NormalizationForm_C,
10214 NormalizationForm_KD,
10215 NormalizationForm_KC
10216 };
10217 QString normalized(NormalizationForm mode) const __attribute__ ((warn_unused_result));
10218 QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const __attribute__ ((warn_unused_result));
10219 QString repeated(int times) const;
10220 const ushort *utf16() const;
10221 QByteArray toAscii() const __attribute__ ((warn_unused_result));
10222 QByteArray toLatin1() const __attribute__ ((warn_unused_result));
10223 QByteArray toUtf8() const __attribute__ ((warn_unused_result));
10224 QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
10225 QVector<uint> toUcs4() const __attribute__ ((warn_unused_result));
10226 static QString fromAscii(const char *, int size = -1);
10227 static QString fromLatin1(const char *, int size = -1);
10228 static QString fromUtf8(const char *, int size = -1);
10229 static QString fromLocal8Bit(const char *, int size = -1);
10230 static QString fromUtf16(const ushort *, int size = -1);
10231 static QString fromUcs4(const uint *, int size = -1);
10232 static QString fromRawData(const QChar *, int size);
10233 int toWCharArray(wchar_t *array) const;
10234 static QString fromWCharArray(const wchar_t *, int size = -1);
10235 QString &setUnicode(const QChar *unicode, int size);
10236 inline QString &setUtf16(const ushort *utf16, int size);
10237 int compare(const QString &s) const;
10238 int compare(const QString &s, Qt::CaseSensitivity cs) const;
10239 int compare(const QLatin1String &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10240 static inline int compare(const QString &s1, const QString &s2)
10241 { return s1.compare(s2); }
10242 static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
10243 { return s1.compare(s2, cs); }
10244 static inline int compare(const QString& s1, const QLatin1String &s2,
10245 Qt::CaseSensitivity cs = Qt::CaseSensitive)
10246 { return s1.compare(s2, cs); }
10247 static inline int compare(const QLatin1String& s1, const QString &s2,
10248 Qt::CaseSensitivity cs = Qt::CaseSensitive)
10249 { return -s2.compare(s1, cs); }
10250 int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10251 static int compare(const QString &s1, const QStringRef &s2,
10252 Qt::CaseSensitivity = Qt::CaseSensitive);
10253 int localeAwareCompare(const QString& s) const;
10254 static int localeAwareCompare(const QString& s1, const QString& s2)
10255 { return s1.localeAwareCompare(s2); }
10256 int localeAwareCompare(const QStringRef &s) const;
10257 static int localeAwareCompare(const QString& s1, const QStringRef& s2);
10258 short toShort(bool *ok=0, int base=10) const;
10259 ushort toUShort(bool *ok=0, int base=10) const;
10260 int toInt(bool *ok=0, int base=10) const;
10261 uint toUInt(bool *ok=0, int base=10) const;
10262 long toLong(bool *ok=0, int base=10) const;
10263 ulong toULong(bool *ok=0, int base=10) const;
10264 qlonglong toLongLong(bool *ok=0, int base=10) const;
10265 qulonglong toULongLong(bool *ok=0, int base=10) const;
10266 float toFloat(bool *ok=0) const;
10267 double toDouble(bool *ok=0) const;
10268 QString &setNum(short, int base=10);
10269 QString &setNum(ushort, int base=10);
10270 QString &setNum(int, int base=10);
10271 QString &setNum(uint, int base=10);
10272 QString &setNum(long, int base=10);
10273 QString &setNum(ulong, int base=10);
10274 QString &setNum(qlonglong, int base=10);
10275 QString &setNum(qulonglong, int base=10);
10276 QString &setNum(float, char f='g', int prec=6);
10277 QString &setNum(double, char f='g', int prec=6);
10278 static QString number(int, int base=10);
10279 static QString number(uint, int base=10);
10280 static QString number(long, int base=10);
10281 static QString number(ulong, int base=10);
10282 static QString number(qlonglong, int base=10);
10283 static QString number(qulonglong, int base=10);
10284 static QString number(double, char f='g', int prec=6);
10285 bool operator==(const QString &s) const;
10286 bool operator<(const QString &s) const;
10287 inline bool operator>(const QString &s) const { return s < *this; }
10288 inline bool operator!=(const QString &s) const { return !operator==(s); }
10289 inline bool operator<=(const QString &s) const { return !operator>(s); }
10290 inline bool operator>=(const QString &s) const { return !operator<(s); }
10291 bool operator==(const QLatin1String &s) const;
10292 bool operator<(const QLatin1String &s) const;
10293 bool operator>(const QLatin1String &s) const;
10294 inline bool operator!=(const QLatin1String &s) const { return !operator==(s); }
10295 inline bool operator<=(const QLatin1String &s) const { return !operator>(s); }
10296 inline bool operator>=(const QLatin1String &s) const { return !operator<(s); }
10297 inline QString(const char *ch) : d(fromAscii_helper(ch))
10298 {}
10299 inline QString(const QByteArray &a)
10300 : d(fromAscii_helper(a.constData(), qstrnlen(a.constData(), a.size())))
10301 {}
10302 inline QString &operator=(const char *ch)
10303 { return (*this = fromAscii(ch)); }
10304 inline QString &operator=(const QByteArray &a)
10305 { return (*this = fromAscii(a.constData(), qstrnlen(a.constData(), a.size()))); }
10306 inline QString &operator=(char c)
10307 { return (*this = QChar::fromAscii(c)); }
10308 inline QString &prepend(const char *s)
10309 { return prepend(QString::fromAscii(s)); }
10310 inline QString &prepend(const QByteArray &s)
10311 { return prepend(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
10312 inline QString &append(const char *s)
10313 { return append(QString::fromAscii(s)); }
10314 inline QString &append(const QByteArray &s)
10315 { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
10316 inline QString &operator+=(const char *s)
10317 { return append(QString::fromAscii(s)); }
10318 inline QString &operator+=(const QByteArray &s)
10319 { return append(QString::fromAscii(s.constData(), qstrnlen(s.constData(), s.size()))); }
10320 inline QString &operator+=(char c)
10321 { return append(QChar::fromAscii(c)); }
10322 inline bool operator==(const char *s) const;
10323 inline bool operator!=(const char *s) const;
10324 inline bool operator<(const char *s) const;
10325 inline bool operator<=(const char *s2) const;
10326 inline bool operator>(const char *s2) const;
10327 inline bool operator>=(const char *s2) const;
10328 inline bool operator==(const QByteArray &s) const;
10329 inline bool operator!=(const QByteArray &s) const;
10330 inline bool operator<(const QByteArray &s) const
10331 { return *this < QString::fromAscii(s.constData(), s.size()); }
10332 inline bool operator>(const QByteArray &s) const
10333 { return *this > QString::fromAscii(s.constData(), s.size()); }
10334 inline bool operator<=(const QByteArray &s) const
10335 { return *this <= QString::fromAscii(s.constData(), s.size()); }
10336 inline bool operator>=(const QByteArray &s) const
10337 { return *this >= QString::fromAscii(s.constData(), s.size()); }
10338 typedef QChar *iterator;
10339 typedef const QChar *const_iterator;
10340 typedef iterator Iterator;
10341 typedef const_iterator ConstIterator;
10342 iterator begin();
10343 const_iterator begin() const;
10344 const_iterator constBegin() const;
10345 iterator end();
10346 const_iterator end() const;
10347 const_iterator constEnd() const;
10348 inline void push_back(QChar c) { append(c); }
10349 inline void push_back(const QString &s) { append(s); }
10350 inline void push_front(QChar c) { prepend(c); }
10351 inline void push_front(const QString &s) { prepend(s); }
10352 static inline QString fromStdString(const std::string &s);
10353 inline std::string toStdString() const;
10354 static inline QString fromStdWString(const QStdWString &s);
10355 inline QStdWString toStdWString() const;
10356 struct Null { };
10357 static const Null null;
10358 inline QString(const Null &): d(&shared_null) { d->ref.ref(); }
10359 inline QString &operator=(const Null &) { *this = QString(); return *this; }
10360 inline bool isNull() const { return d == &shared_null; }
10361 bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
10362 bool isRightToLeft() const { if (!d->clean) updateProperties(); return d->righttoleft; }
10363 QString(int size, Qt::Initialization);
10364 private:
10365 struct Data {
10366 QBasicAtomicInt ref;
10367 int alloc, size;
10368 ushort *data;
10369 ushort clean : 1;
10370 ushort simpletext : 1;
10371 ushort righttoleft : 1;
10372 ushort asciiCache : 1;
10373 ushort capacity : 1;
10374 ushort reserved : 11;
10375 ushort array[1];
10376 };
10377 static Data shared_null;
10378 static Data shared_empty;
10379 Data *d;
10380 QString(Data *dd, int ) : d(dd) {}
10381 static QTextCodec *codecForCStrings;
10382 static int grow(int);
10383 static void free(Data *);
10384 void realloc();
10385 void realloc(int alloc);
10386 void expand(int i);
10387 void updateProperties() const;
10388 QString multiArg(int numArgs, const QString **args) const;
10389 static int compare_helper(const QChar *data1, int length1,
10390 const QChar *data2, int length2,
10391 Qt::CaseSensitivity cs = Qt::CaseSensitive);
10392 static int compare_helper(const QChar *data1, int length1,
10393 QLatin1String s2,
10394 Qt::CaseSensitivity cs = Qt::CaseSensitive);
10395 static int localeAwareCompare_helper(const QChar *data1, int length1,
10396 const QChar *data2, int length2);
10397 static Data *fromLatin1_helper(const char *str, int size = -1);
10398 static Data *fromAscii_helper(const char *str, int size = -1);
10399 void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen);
10400 friend class QCharRef;
10401 friend class QTextCodec;
10402 friend class QStringRef;
10403 friend struct QAbstractConcatenable;
10404 friend inline bool qStringComparisonHelper(const QString &s1, const char *s2);
10405 friend inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2);
10406 public:
10407 typedef Data * DataPtr;
10408 inline DataPtr &data_ptr() { return d; }
10409 };
10410 class QLatin1String
10411 {
10412 public:
10413 inline explicit QLatin1String(const char *s) : chars(s) {}
10414 inline QLatin1String &operator=(const QLatin1String &other)
10415 { chars = other.chars; return *this; }
10416 inline const char *latin1() const { return chars; }
10417 inline bool operator==(const QString &s) const
10418 { return s == *this; }
10419 inline bool operator!=(const QString &s) const
10420 { return s != *this; }
10421 inline bool operator>(const QString &s) const
10422 { return s < *this; }
10423 inline bool operator<(const QString &s) const
10424 { return s > *this; }
10425 inline bool operator>=(const QString &s) const
10426 { return s <= *this; }
10427 inline bool operator<=(const QString &s) const
10428 { return s >= *this; }
10429 inline bool operator==(const char *s) const
10430 { return QString::fromAscii(s) == *this; }
10431 inline bool operator!=(const char *s) const
10432 { return QString::fromAscii(s) != *this; }
10433 inline bool operator<(const char *s) const
10434 { return QString::fromAscii(s) > *this; }
10435 inline bool operator>(const char *s) const
10436 { return QString::fromAscii(s) < *this; }
10437 inline bool operator<=(const char *s) const
10438 { return QString::fromAscii(s) >= *this; }
10439 inline bool operator>=(const char *s) const
10440 { return QString::fromAscii(s) <= *this; }
10441 private:
10442 const char *chars;
10443 };
10444 inline QString::QString(const QLatin1String &aLatin1) : d(fromLatin1_helper(aLatin1.latin1()))
10445 { }
10446 inline int QString::length() const
10447 { return d->size; }
10448 inline const QChar QString::at(int i) const
10449 { ((!(i >= 0 && i < size())) ? qt_assert("i >= 0 && i < size()","/usr/include/qt4/QtCore/qstring.h",688) : qt_noop()); return d->data[i]; }
10450 inline const QChar QString::operator[](int i) const
10451 { ((!(i >= 0 && i < size())) ? qt_assert("i >= 0 && i < size()","/usr/include/qt4/QtCore/qstring.h",690) : qt_noop()); return d->data[i]; }
10452 inline const QChar QString::operator[](uint i) const
10453 { ((!(i < uint(size()))) ? qt_assert("i < uint(size())","/usr/include/qt4/QtCore/qstring.h",692) : qt_noop()); return d->data[i]; }
10454 inline bool QString::isEmpty() const
10455 { return d->size == 0; }
10456 inline const QChar *QString::unicode() const
10457 { return reinterpret_cast<const QChar*>(d->data); }
10458 inline const QChar *QString::data() const
10459 { return reinterpret_cast<const QChar*>(d->data); }
10460 inline QChar *QString::data()
10461 { detach(); return reinterpret_cast<QChar*>(d->data); }
10462 inline const QChar *QString::constData() const
10463 { return reinterpret_cast<const QChar*>(d->data); }
10464 inline void QString::detach()
10465 { if (d->ref != 1 || d->data != d->array) realloc(); }
10466 inline bool QString::isDetached() const
10467 { return d->ref == 1; }
10468 inline QString &QString::operator=(const QLatin1String &s)
10469 {
10470 *this = fromLatin1(s.latin1());
10471 return *this;
10472 }
10473 inline void QString::clear()
10474 { if (!isNull()) *this = QString(); }
10475 inline QString::QString(const QString &other) : d(other.d)
10476 { ((!(&other != this)) ? qt_assert("&other != this","/usr/include/qt4/QtCore/qstring.h",715) : qt_noop()); d->ref.ref(); }
10477 inline int QString::capacity() const
10478 { return d->alloc; }
10479 inline QString &QString::setNum(short n, int base)
10480 { return setNum(qlonglong(n), base); }
10481 inline QString &QString::setNum(ushort n, int base)
10482 { return setNum(qulonglong(n), base); }
10483 inline QString &QString::setNum(int n, int base)
10484 { return setNum(qlonglong(n), base); }
10485 inline QString &QString::setNum(uint n, int base)
10486 { return setNum(qulonglong(n), base); }
10487 inline QString &QString::setNum(long n, int base)
10488 { return setNum(qlonglong(n), base); }
10489 inline QString &QString::setNum(ulong n, int base)
10490 { return setNum(qulonglong(n), base); }
10491 inline QString &QString::setNum(float n, char f, int prec)
10492 { return setNum(double(n),f,prec); }
10493 inline QString QString::arg(int a, int fieldWidth, int base, const QChar &fillChar) const
10494 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
10495 inline QString QString::arg(uint a, int fieldWidth, int base, const QChar &fillChar) const
10496 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
10497 inline QString QString::arg(long a, int fieldWidth, int base, const QChar &fillChar) const
10498 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
10499 inline QString QString::arg(ulong a, int fieldWidth, int base, const QChar &fillChar) const
10500 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
10501 inline QString QString::arg(short a, int fieldWidth, int base, const QChar &fillChar) const
10502 { return arg(qlonglong(a), fieldWidth, base, fillChar); }
10503 inline QString QString::arg(ushort a, int fieldWidth, int base, const QChar &fillChar) const
10504 { return arg(qulonglong(a), fieldWidth, base, fillChar); }
10505 inline QString QString::arg(const QString &a1, const QString &a2) const
10506 { const QString *args[2] = { &a1, &a2 }; return multiArg(2, args); }
10507 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3) const
10508 { const QString *args[3] = { &a1, &a2, &a3 }; return multiArg(3, args); }
10509 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
10510 const QString &a4) const
10511 { const QString *args[4] = { &a1, &a2, &a3, &a4 }; return multiArg(4, args); }
10512 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
10513 const QString &a4, const QString &a5) const
10514 { const QString *args[5] = { &a1, &a2, &a3, &a4, &a5 }; return multiArg(5, args); }
10515 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
10516 const QString &a4, const QString &a5, const QString &a6) const
10517 { const QString *args[6] = { &a1, &a2, &a3, &a4, &a5, &a6 }; return multiArg(6, args); }
10518 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
10519 const QString &a4, const QString &a5, const QString &a6,
10520 const QString &a7) const
10521 { const QString *args[7] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7 }; return multiArg(7, args); }
10522 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
10523 const QString &a4, const QString &a5, const QString &a6,
10524 const QString &a7, const QString &a8) const
10525 { const QString *args[8] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8 }; return multiArg(8, args); }
10526 inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
10527 const QString &a4, const QString &a5, const QString &a6,
10528 const QString &a7, const QString &a8, const QString &a9) const
10529 { const QString *args[9] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9 }; return multiArg(9, args); }
10530 inline QString QString::section(QChar asep, int astart, int aend, SectionFlags aflags) const
10531 { return section(QString(asep), astart, aend, aflags); }
10532 class QCharRef {
10533 QString &s;
10534 int i;
10535 inline QCharRef(QString &str, int idx)
10536 : s(str),i(idx) {}
10537 friend class QString;
10538 public:
10539 inline operator QChar() const
10540 { return i < s.d->size ? s.d->data[i] : 0; }
10541 inline QCharRef &operator=(const QChar &c)
10542 { if (i >= s.d->size) s.expand(i); else s.detach();
10543 s.d->data[i] = c.unicode(); return *this; }
10544 inline QCharRef &operator=(char c)
10545 { return operator=(QChar::fromAscii(c)); }
10546 inline QCharRef &operator=(uchar c)
10547 { return operator=(QChar::fromAscii(c)); }
10548 inline QCharRef &operator=(const QCharRef &c) { return operator=(QChar(c)); }
10549 inline QCharRef &operator=(ushort rc) { return operator=(QChar(rc)); }
10550 inline QCharRef &operator=(short rc) { return operator=(QChar(rc)); }
10551 inline QCharRef &operator=(uint rc) { return operator=(QChar(rc)); }
10552 inline QCharRef &operator=(int rc) { return operator=(QChar(rc)); }
10553 inline bool isNull() const { return QChar(*this).isNull(); }
10554 inline bool isPrint() const { return QChar(*this).isPrint(); }
10555 inline bool isPunct() const { return QChar(*this).isPunct(); }
10556 inline bool isSpace() const { return QChar(*this).isSpace(); }
10557 inline bool isMark() const { return QChar(*this).isMark(); }
10558 inline bool isLetter() const { return QChar(*this).isLetter(); }
10559 inline bool isNumber() const { return QChar(*this).isNumber(); }
10560 inline bool isLetterOrNumber() { return QChar(*this).isLetterOrNumber(); }
10561 inline bool isDigit() const { return QChar(*this).isDigit(); }
10562 inline bool isLower() const { return QChar(*this).isLower(); }
10563 inline bool isUpper() const { return QChar(*this).isUpper(); }
10564 inline bool isTitleCase() const { return QChar(*this).isTitleCase(); }
10565 inline int digitValue() const { return QChar(*this).digitValue(); }
10566 QChar toLower() const { return QChar(*this).toLower(); }
10567 QChar toUpper() const { return QChar(*this).toUpper(); }
10568 QChar toTitleCase () const { return QChar(*this).toTitleCase(); }
10569 QChar::Category category() const { return QChar(*this).category(); }
10570 QChar::Direction direction() const { return QChar(*this).direction(); }
10571 QChar::Joining joining() const { return QChar(*this).joining(); }
10572 bool hasMirrored() const { return QChar(*this).hasMirrored(); }
10573 QChar mirroredChar() const { return QChar(*this).mirroredChar(); }
10574 QString decomposition() const { return QChar(*this).decomposition(); }
10575 QChar::Decomposition decompositionTag() const { return QChar(*this).decompositionTag(); }
10576 uchar combiningClass() const { return QChar(*this).combiningClass(); }
10577 QChar::UnicodeVersion unicodeVersion() const { return QChar(*this).unicodeVersion(); }
10578 inline uchar cell() const { return QChar(*this).cell(); }
10579 inline uchar row() const { return QChar(*this).row(); }
10580 inline void setCell(uchar cell);
10581 inline void setRow(uchar row);
10582 char toAscii() const { return QChar(*this).toAscii(); }
10583 char toLatin1() const { return QChar(*this).toLatin1(); }
10584 ushort unicode() const { return QChar(*this).unicode(); }
10585 ushort& unicode() { return s.data()[i].unicode(); }
10586 };
10587 inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
10588 inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
10589 inline QString::QString() : d(&shared_null) { d->ref.ref(); }
10590 inline QString::~QString() { if (!d->ref.deref()) free(d); }
10591 inline void QString::reserve(int asize) { if (d->ref != 1 || asize > d->alloc) realloc(asize); d->capacity = 1;}
10592 inline QString &QString::setUtf16(const ushort *autf16, int asize)
10593 { return setUnicode(reinterpret_cast<const QChar *>(autf16), asize); }
10594 inline QCharRef QString::operator[](int i)
10595 { ((!(i >= 0)) ? qt_assert("i >= 0","/usr/include/qt4/QtCore/qstring.h",874) : qt_noop()); return QCharRef(*this, i); }
10596 inline QCharRef QString::operator[](uint i)
10597 { return QCharRef(*this, i); }
10598 inline QString::iterator QString::begin()
10599 { detach(); return reinterpret_cast<QChar*>(d->data); }
10600 inline QString::const_iterator QString::begin() const
10601 { return reinterpret_cast<const QChar*>(d->data); }
10602 inline QString::const_iterator QString::constBegin() const
10603 { return reinterpret_cast<const QChar*>(d->data); }
10604 inline QString::iterator QString::end()
10605 { detach(); return reinterpret_cast<QChar*>(d->data + d->size); }
10606 inline QString::const_iterator QString::end() const
10607 { return reinterpret_cast<const QChar*>(d->data + d->size); }
10608 inline QString::const_iterator QString::constEnd() const
10609 { return reinterpret_cast<const QChar*>(d->data + d->size); }
10610 inline QBool QString::contains(const QString &s, Qt::CaseSensitivity cs) const
10611 { return QBool(indexOf(s, 0, cs) != -1); }
10612 inline QBool QString::contains(QChar c, Qt::CaseSensitivity cs) const
10613 { return QBool(indexOf(c, 0, cs) != -1); }
10614 inline bool operator==(QString::Null, QString::Null) { return true; }
10615 inline bool operator==(QString::Null, const QString &s) { return s.isNull(); }
10616 inline bool operator==(const QString &s, QString::Null) { return s.isNull(); }
10617 inline bool operator!=(QString::Null, QString::Null) { return false; }
10618 inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); }
10619 inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
10620 inline bool qStringComparisonHelper(const QString &s1, const char *s2)
10621 {
10622 if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
10623 return (s1 == QLatin1String(s2));
10624 }
10625 inline bool QString::operator==(const char *s) const
10626 { return qStringComparisonHelper(*this, s); }
10627 inline bool QString::operator!=(const char *s) const
10628 { return !qStringComparisonHelper(*this, s); }
10629 inline bool QString::operator<(const char *s) const
10630 { return *this < QString::fromAscii(s); }
10631 inline bool QString::operator>(const char *s) const
10632 { return *this > QString::fromAscii(s); }
10633 inline bool QString::operator<=(const char *s) const
10634 { return *this <= QString::fromAscii(s); }
10635 inline bool QString::operator>=(const char *s) const
10636 { return *this >= QString::fromAscii(s); }
10637 inline bool operator==(const char *s1, const QString &s2)
10638 { return qStringComparisonHelper(s2, s1); }
10639 inline bool operator!=(const char *s1, const QString &s2)
10640 { return !qStringComparisonHelper(s2, s1); }
10641 inline bool operator<(const char *s1, const QString &s2)
10642 { return (QString::fromAscii(s1) < s2); }
10643 inline bool operator>(const char *s1, const QString &s2)
10644 { return (QString::fromAscii(s1) > s2); }
10645 inline bool operator<=(const char *s1, const QString &s2)
10646 { return (QString::fromAscii(s1) <= s2); }
10647 inline bool operator>=(const char *s1, const QString &s2)
10648 { return (QString::fromAscii(s1) >= s2); }
10649 inline bool operator==(const char *s1, const QLatin1String &s2)
10650 { return QString::fromAscii(s1) == s2; }
10651 inline bool operator!=(const char *s1, const QLatin1String &s2)
10652 { return QString::fromAscii(s1) != s2; }
10653 inline bool operator<(const char *s1, const QLatin1String &s2)
10654 { return (QString::fromAscii(s1) < s2); }
10655 inline bool operator>(const char *s1, const QLatin1String &s2)
10656 { return (QString::fromAscii(s1) > s2); }
10657 inline bool operator<=(const char *s1, const QLatin1String &s2)
10658 { return (QString::fromAscii(s1) <= s2); }
10659 inline bool operator>=(const char *s1, const QLatin1String &s2)
10660 { return (QString::fromAscii(s1) >= s2); }
10661 inline bool operator==(const QLatin1String &s1, const QLatin1String &s2)
10662 { return (qstrcmp(s1.latin1(), s2.latin1()) == 0); }
10663 inline bool operator!=(const QLatin1String &s1, const QLatin1String &s2)
10664 { return (qstrcmp(s1.latin1(), s2.latin1()) != 0); }
10665 inline bool operator<(const QLatin1String &s1, const QLatin1String &s2)
10666 { return (qstrcmp(s1.latin1(), s2.latin1()) < 0); }
10667 inline bool operator<=(const QLatin1String &s1, const QLatin1String &s2)
10668 { return (qstrcmp(s1.latin1(), s2.latin1()) <= 0); }
10669 inline bool operator>(const QLatin1String &s1, const QLatin1String &s2)
10670 { return (qstrcmp(s1.latin1(), s2.latin1()) > 0); }
10671 inline bool operator>=(const QLatin1String &s1, const QLatin1String &s2)
10672 { return (qstrcmp(s1.latin1(), s2.latin1()) >= 0); }
10673 inline bool QString::operator==(const QByteArray &s) const
10674 { return qStringComparisonHelper(*this, s.constData()); }
10675 inline bool QString::operator!=(const QByteArray &s) const
10676 { return !qStringComparisonHelper(*this, s.constData()); }
10677 inline bool QByteArray::operator==(const QString &s) const
10678 { return qStringComparisonHelper(s, constData()); }
10679 inline bool QByteArray::operator!=(const QString &s) const
10680 { return !qStringComparisonHelper(s, constData()); }
10681 inline bool QByteArray::operator<(const QString &s) const
10682 { return QString::fromAscii(constData(), size()) < s; }
10683 inline bool QByteArray::operator>(const QString &s) const
10684 { return QString::fromAscii(constData(), size()) > s; }
10685 inline bool QByteArray::operator<=(const QString &s) const
10686 { return QString::fromAscii(constData(), size()) <= s; }
10687 inline bool QByteArray::operator>=(const QString &s) const
10688 { return QString::fromAscii(constData(), size()) >= s; }
10689 inline QByteArray &QByteArray::append(const QString &s)
10690 { return append(s.toAscii()); }
10691 inline QByteArray &QByteArray::insert(int i, const QString &s)
10692 { return insert(i, s.toAscii()); }
10693 inline QByteArray &QByteArray::replace(char c, const QString &after)
10694 { return replace(c, after.toAscii()); }
10695 inline QByteArray &QByteArray::replace(const QString &before, const char *after)
10696 { return replace(before.toAscii(), after); }
10697 inline QByteArray &QByteArray::replace(const QString &before, const QByteArray &after)
10698 { return replace(before.toAscii(), after); }
10699 inline QByteArray &QByteArray::operator+=(const QString &s)
10700 { return operator+=(s.toAscii()); }
10701 inline int QByteArray::indexOf(const QString &s, int from) const
10702 { return indexOf(s.toAscii(), from); }
10703 inline int QByteArray::lastIndexOf(const QString &s, int from) const
10704 { return lastIndexOf(s.toAscii(), from); }
10705 inline const QString operator+(const QString &s1, const QString &s2)
10706 { QString t(s1); t += s2; return t; }
10707 inline const QString operator+(const QString &s1, QChar s2)
10708 { QString t(s1); t += s2; return t; }
10709 inline const QString operator+(QChar s1, const QString &s2)
10710 { QString t(s1); t += s2; return t; }
10711 inline const QString operator+(const QString &s1, const char *s2)
10712 { QString t(s1); t += QString::fromAscii(s2); return t; }
10713 inline const QString operator+(const char *s1, const QString &s2)
10714 { QString t = QString::fromAscii(s1); t += s2; return t; }
10715 inline const QString operator+(char c, const QString &s)
10716 { QString t = s; t.prepend(QChar::fromAscii(c)); return t; }
10717 inline const QString operator+(const QString &s, char c)
10718 { QString t = s; t += QChar::fromAscii(c); return t; }
10719 inline const QString operator+(const QByteArray &ba, const QString &s)
10720 { QString t = QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); t += s; return t; }
10721 inline const QString operator+(const QString &s, const QByteArray &ba)
10722 { QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }
10723 inline std::string QString::toStdString() const
10724 { const QByteArray asc = toAscii(); return std::string(asc.constData(), asc.length()); }
10725 inline QString QString::fromStdString(const std::string &s)
10726 { return fromAscii(s.data(), int(s.size())); }
10727 inline QStdWString QString::toStdWString() const
10728 {
10729 QStdWString str;
10730 str.resize(length());
10731 str.resize(toWCharArray(&(*str.begin())));
10732 return str;
10733 }
10734 inline QString QString::fromStdWString(const QStdWString &s)
10735 { return fromWCharArray(s.data(), int(s.size())); }
10736 QDataStream &operator<<(QDataStream &, const QString &);
10737 QDataStream &operator>>(QDataStream &, QString &);
10738 template <> class QTypeInfo<QString > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QString)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QString"; } };
10739 template <> inline bool qIsDetached<QString>(QString &t) { return t.isDetached(); } template <> inline void qSwap<QString>(QString &value1, QString &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
10740 inline QFlags<QString::SectionFlags::enum_type> operator|(QString::SectionFlags::enum_type f1, QString::SectionFlags::enum_type f2) { return QFlags<QString::SectionFlags::enum_type>(f1) | f2; } inline QFlags<QString::SectionFlags::enum_type> operator|(QString::SectionFlags::enum_type f1, QFlags<QString::SectionFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QString::SectionFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
10741 class QStringRef {
10742 const QString *m_string;
10743 int m_position;
10744 int m_size;
10745 public:
10746 inline QStringRef():m_string(0), m_position(0), m_size(0){}
10747 inline QStringRef(const QString *string, int position, int size);
10748 inline QStringRef(const QString *string);
10749 inline QStringRef(const QStringRef &other)
10750 :m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
10751 {}
10752 inline ~QStringRef(){}
10753 inline const QString *string() const { return m_string; }
10754 inline int position() const { return m_position; }
10755 inline int size() const { return m_size; }
10756 inline int count() const { return m_size; }
10757 inline int length() const { return m_size; }
10758 inline QStringRef &operator=(const QStringRef &other) {
10759 m_string = other.m_string; m_position = other.m_position;
10760 m_size = other.m_size; return *this;
10761 }
10762 inline QStringRef &operator=(const QString *string);
10763 inline const QChar *unicode() const {
10764 if (!m_string)
10765 return reinterpret_cast<const QChar *>(QString::shared_null.data);
10766 return m_string->unicode() + m_position;
10767 }
10768 inline const QChar *data() const { return unicode(); }
10769 inline const QChar *constData() const { return unicode(); }
10770 inline void clear() { m_string = 0; m_position = m_size = 0; }
10771 QString toString() const;
10772 inline bool isEmpty() const { return m_size == 0; }
10773 inline bool isNull() const { return m_string == 0 || m_string->isNull(); }
10774 QStringRef appendTo(QString *string) const;
10775 inline const QChar at(int i) const
10776 { ((!(i >= 0 && i < size())) ? qt_assert("i >= 0 && i < size()","/usr/include/qt4/QtCore/qstring.h",1136) : qt_noop()); return m_string->at(i + m_position); }
10777 int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10778 int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10779 int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
10780 static int compare(const QStringRef &s1, const QString &s2,
10781 Qt::CaseSensitivity = Qt::CaseSensitive);
10782 static int compare(const QStringRef &s1, const QStringRef &s2,
10783 Qt::CaseSensitivity = Qt::CaseSensitive);
10784 static int compare(const QStringRef &s1, QLatin1String s2,
10785 Qt::CaseSensitivity cs = Qt::CaseSensitive);
10786 int localeAwareCompare(const QString &s) const;
10787 int localeAwareCompare(const QStringRef &s) const;
10788 static int localeAwareCompare(const QStringRef &s1, const QString &s2);
10789 static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
10790 };
10791 inline QStringRef &QStringRef::operator=(const QString *aString)
10792 { m_string = aString; m_position = 0; m_size = aString?aString->size():0; return *this; }
10793 inline QStringRef::QStringRef(const QString *aString, int aPosition, int aSize)
10794 :m_string(aString), m_position(aPosition), m_size(aSize){}
10795 inline QStringRef::QStringRef(const QString *aString)
10796 :m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
10797 bool operator==(const QStringRef &s1,const QStringRef &s2);
10798 inline bool operator!=(const QStringRef &s1,const QStringRef &s2)
10799 { return !(s1 == s2); }
10800 bool operator==(const QString &s1,const QStringRef &s2);
10801 inline bool operator!=(const QString &s1,const QStringRef &s2)
10802 { return !(s1 == s2); }
10803 inline bool operator==(const QStringRef &s1,const QString &s2)
10804 { return s2 == s1; }
10805 inline bool operator!=(const QStringRef &s1,const QString &s2)
10806 { return s2 != s1; }
10807 bool operator==(const QLatin1String &s1, const QStringRef &s2);
10808 inline bool operator!=(const QLatin1String &s1,const QStringRef &s2)
10809 { return !(s1 == s2); }
10810 inline bool operator==(const QStringRef &s1,const QLatin1String &s2)
10811 { return s2 == s1; }
10812 inline bool operator!=(const QStringRef &s1,const QLatin1String &s2)
10813 { return s2 != s1; }
10814 bool operator<(const QStringRef &s1,const QStringRef &s2);
10815 inline bool operator>(const QStringRef &s1, const QStringRef &s2)
10816 { return s2 < s1; }
10817 inline bool operator<=(const QStringRef &s1, const QStringRef &s2)
10818 { return !(s1 > s2); }
10819 inline bool operator>=(const QStringRef &s1, const QStringRef &s2)
10820 { return !(s1 < s2); }
10821 inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
10822 {
10823 if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2));
10824 return (s1 == QLatin1String(s2));
10825 }
10826 inline bool operator==(const char *s1, const QStringRef &s2)
10827 { return qStringComparisonHelper(s2, s1); }
10828 inline bool operator==(const QStringRef &s1, const char *s2)
10829 { return qStringComparisonHelper(s1, s2); }
10830 inline bool operator!=(const char *s1, const QStringRef &s2)
10831 { return !qStringComparisonHelper(s2, s1); }
10832 inline bool operator!=(const QStringRef &s1, const char *s2)
10833 { return !qStringComparisonHelper(s1, s2); }
10834 inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
10835 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
10836 inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
10837 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
10838 inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const
10839 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
10840 inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const
10841 { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
10842 inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const
10843 { return QString::compare_helper(constData(), length(), s, cs); }
10844 inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs)
10845 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
10846 inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs)
10847 { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
10848 inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs)
10849 { return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
10850 inline int QString::localeAwareCompare(const QStringRef &s) const
10851 { return localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
10852 inline int QString::localeAwareCompare(const QString& s1, const QStringRef& s2)
10853 { return localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
10854 inline int QStringRef::localeAwareCompare(const QString &s) const
10855 { return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
10856 inline int QStringRef::localeAwareCompare(const QStringRef &s) const
10857 { return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
10858 inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s2)
10859 { return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
10860 inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
10861 { return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
10862 typedef QtValidLicenseForCoreModule QtCoreModule;
10863 class QByteArray;
10864 class QString;
10865 template <typename T>
10866 inline int qYouForgotTheQ_OBJECT_Macro(T, T) { return 0; }
10867 template <typename T1, typename T2>
10868 inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
10869 const char *qFlagLocation(const char *method);
10870 class QObject;
10871 class QMetaMethod;
10872 class QMetaEnum;
10873 class QMetaProperty;
10874 class QMetaClassInfo;
10875 class QGenericArgument
10876 {
10877 public:
10878 inline QGenericArgument(const char *aName = 0, const void *aData = 0)
10879 : _data(aData), _name(aName) {}
10880 inline void *data() const { return const_cast<void *>(_data); }
10881 inline const char *name() const { return _name; }
10882 private:
10883 const void *_data;
10884 const char *_name;
10885 };
10886 class QGenericReturnArgument: public QGenericArgument
10887 {
10888 public:
10889 inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)
10890 : QGenericArgument(aName, aData)
10891 {}
10892 };
10893 template <class T>
10894 class QArgument: public QGenericArgument
10895 {
10896 public:
10897 inline QArgument(const char *aName, const T &aData)
10898 : QGenericArgument(aName, static_cast<const void *>(&aData))
10899 {}
10900 };
10901 template <typename T>
10902 class QReturnArgument: public QGenericReturnArgument
10903 {
10904 public:
10905 inline QReturnArgument(const char *aName, T &aData)
10906 : QGenericReturnArgument(aName, static_cast<void *>(&aData))
10907 {}
10908 };
10909 struct QMetaObject
10910 {
10911 const char *className() const;
10912 const QMetaObject *superClass() const;
10913 QObject *cast(QObject *obj) const;
10914 QString tr(const char *s, const char *c) const;
10915 QString trUtf8(const char *s, const char *c) const;
10916 QString tr(const char *s, const char *c, int n) const;
10917 QString trUtf8(const char *s, const char *c, int n) const;
10918 int methodOffset() const;
10919 int enumeratorOffset() const;
10920 int propertyOffset() const;
10921 int classInfoOffset() const;
10922 int constructorCount() const;
10923 int methodCount() const;
10924 int enumeratorCount() const;
10925 int propertyCount() const;
10926 int classInfoCount() const;
10927 int indexOfConstructor(const char *constructor) const;
10928 int indexOfMethod(const char *method) const;
10929 int indexOfSignal(const char *signal) const;
10930 int indexOfSlot(const char *slot) const;
10931 int indexOfEnumerator(const char *name) const;
10932 int indexOfProperty(const char *name) const;
10933 int indexOfClassInfo(const char *name) const;
10934 QMetaMethod constructor(int index) const;
10935 QMetaMethod method(int index) const;
10936 QMetaEnum enumerator(int index) const;
10937 QMetaProperty property(int index) const;
10938 QMetaClassInfo classInfo(int index) const;
10939 QMetaProperty userProperty() const;
10940 static bool checkConnectArgs(const char *signal, const char *method);
10941 static QByteArray normalizedSignature(const char *method);
10942 static QByteArray normalizedType(const char *type);
10943 static bool connect(const QObject *sender, int signal_index,
10944 const QObject *receiver, int method_index,
10945 int type = 0, int *types = 0);
10946 static bool disconnect(const QObject *sender, int signal_index,
10947 const QObject *receiver, int method_index);
10948 static bool disconnectOne(const QObject *sender, int signal_index,
10949 const QObject *receiver, int method_index);
10950 static void connectSlotsByName(QObject *o);
10951 static void activate(QObject *sender, int signal_index, void **argv);
10952 static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv);
10953 static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
10954 static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv);
10955 static void addGuard(QObject **ptr);
10956 static void removeGuard(QObject **ptr);
10957 static void changeGuard(QObject **ptr, QObject *o);
10958 static bool invokeMethod(QObject *obj, const char *member,
10959 Qt::ConnectionType,
10960 QGenericReturnArgument ret,
10961 QGenericArgument val0 = QGenericArgument(0),
10962 QGenericArgument val1 = QGenericArgument(),
10963 QGenericArgument val2 = QGenericArgument(),
10964 QGenericArgument val3 = QGenericArgument(),
10965 QGenericArgument val4 = QGenericArgument(),
10966 QGenericArgument val5 = QGenericArgument(),
10967 QGenericArgument val6 = QGenericArgument(),
10968 QGenericArgument val7 = QGenericArgument(),
10969 QGenericArgument val8 = QGenericArgument(),
10970 QGenericArgument val9 = QGenericArgument());
10971 static inline bool invokeMethod(QObject *obj, const char *member,
10972 QGenericReturnArgument ret,
10973 QGenericArgument val0 = QGenericArgument(0),
10974 QGenericArgument val1 = QGenericArgument(),
10975 QGenericArgument val2 = QGenericArgument(),
10976 QGenericArgument val3 = QGenericArgument(),
10977 QGenericArgument val4 = QGenericArgument(),
10978 QGenericArgument val5 = QGenericArgument(),
10979 QGenericArgument val6 = QGenericArgument(),
10980 QGenericArgument val7 = QGenericArgument(),
10981 QGenericArgument val8 = QGenericArgument(),
10982 QGenericArgument val9 = QGenericArgument())
10983 {
10984 return invokeMethod(obj, member, Qt::AutoConnection, ret, val0, val1, val2, val3,
10985 val4, val5, val6, val7, val8, val9);
10986 }
10987 static inline bool invokeMethod(QObject *obj, const char *member,
10988 Qt::ConnectionType type,
10989 QGenericArgument val0 = QGenericArgument(0),
10990 QGenericArgument val1 = QGenericArgument(),
10991 QGenericArgument val2 = QGenericArgument(),
10992 QGenericArgument val3 = QGenericArgument(),
10993 QGenericArgument val4 = QGenericArgument(),
10994 QGenericArgument val5 = QGenericArgument(),
10995 QGenericArgument val6 = QGenericArgument(),
10996 QGenericArgument val7 = QGenericArgument(),
10997 QGenericArgument val8 = QGenericArgument(),
10998 QGenericArgument val9 = QGenericArgument())
10999 {
11000 return invokeMethod(obj, member, type, QGenericReturnArgument(), val0, val1, val2,
11001 val3, val4, val5, val6, val7, val8, val9);
11002 }
11003 static inline bool invokeMethod(QObject *obj, const char *member,
11004 QGenericArgument val0 = QGenericArgument(0),
11005 QGenericArgument val1 = QGenericArgument(),
11006 QGenericArgument val2 = QGenericArgument(),
11007 QGenericArgument val3 = QGenericArgument(),
11008 QGenericArgument val4 = QGenericArgument(),
11009 QGenericArgument val5 = QGenericArgument(),
11010 QGenericArgument val6 = QGenericArgument(),
11011 QGenericArgument val7 = QGenericArgument(),
11012 QGenericArgument val8 = QGenericArgument(),
11013 QGenericArgument val9 = QGenericArgument())
11014 {
11015 return invokeMethod(obj, member, Qt::AutoConnection, QGenericReturnArgument(), val0,
11016 val1, val2, val3, val4, val5, val6, val7, val8, val9);
11017 }
11018 QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),
11019 QGenericArgument val1 = QGenericArgument(),
11020 QGenericArgument val2 = QGenericArgument(),
11021 QGenericArgument val3 = QGenericArgument(),
11022 QGenericArgument val4 = QGenericArgument(),
11023 QGenericArgument val5 = QGenericArgument(),
11024 QGenericArgument val6 = QGenericArgument(),
11025 QGenericArgument val7 = QGenericArgument(),
11026 QGenericArgument val8 = QGenericArgument(),
11027 QGenericArgument val9 = QGenericArgument()) const;
11028 enum Call {
11029 InvokeMetaMethod,
11030 ReadProperty,
11031 WriteProperty,
11032 ResetProperty,
11033 QueryPropertyDesignable,
11034 QueryPropertyScriptable,
11035 QueryPropertyStored,
11036 QueryPropertyEditable,
11037 QueryPropertyUser,
11038 CreateInstance
11039 };
11040 int static_metacall(Call, int, void **) const;
11041 static int metacall(QObject *, Call, int, void **);
11042 struct {
11043 const QMetaObject *superdata;
11044 const char *stringdata;
11045 const uint *data;
11046 const void *extradata;
11047 } d;
11048 };
11049 typedef const QMetaObject& (*QMetaObjectAccessor)();
11050 struct QMetaObjectExtraData
11051 {
11052 const QMetaObject **objects;
11053 int (*static_metacall)(QMetaObject::Call, int, void **);
11054 };
11055 inline const char *QMetaObject::className() const
11056 { return d.stringdata; }
11057 inline const QMetaObject *QMetaObject::superClass() const
11058 { return d.superdata; }
11059 typedef QtValidLicenseForGuiModule QtGuiModule;
11060 class QPaintDevice;
11061 class QWidget;
11062 class QDialog;
11063 class QColor;
11064 class QPalette;
11065 class QCursor;
11066 class QPoint;
11067 class QSize;
11068 class QRect;
11069 class QPolygon;
11070 class QPainter;
11071 class QRegion;
11072 class QFont;
11073 class QFontMetrics;
11074 class QFontInfo;
11075 class QPen;
11076 class QBrush;
11077 class QMatrix;
11078 class QPixmap;
11079 class QBitmap;
11080 class QMovie;
11081 class QImage;
11082 class QPicture;
11083 class QPrinter;
11084 class QTimer;
11085 class QTime;
11086 class QClipboard;
11087 class QString;
11088 class QByteArray;
11089 class QApplication;
11090 template<typename T> class QList;
11091 typedef QList<QWidget *> QWidgetList;
11092 typedef struct _XDisplay Display;
11093 typedef union _XEvent XEvent;
11094 typedef struct _XGC *GC;
11095 typedef struct _XRegion *Region;
11096 typedef unsigned long WId;
11097 template<class K, class V> class QHash;
11098 typedef QHash<WId, QWidget *> QWidgetMapper;
11099 template<class V> class QSet;
11100 typedef QSet<QWidget *> QWidgetSet;
11101 typedef QtValidLicenseForCoreModule QtCoreModule;
11102 class QSize
11103 {
11104 public:
11105 QSize();
11106 QSize(int w, int h);
11107 bool isNull() const;
11108 bool isEmpty() const;
11109 bool isValid() const;
11110 int width() const;
11111 int height() const;
11112 void setWidth(int w);
11113 void setHeight(int h);
11114 void transpose();
11115 void scale(int w, int h, Qt::AspectRatioMode mode);
11116 void scale(const QSize &s, Qt::AspectRatioMode mode);
11117 QSize expandedTo(const QSize &) const;
11118 QSize boundedTo(const QSize &) const;
11119 int &rwidth();
11120 int &rheight();
11121 QSize &operator+=(const QSize &);
11122 QSize &operator-=(const QSize &);
11123 QSize &operator*=(qreal c);
11124 QSize &operator/=(qreal c);
11125 friend inline bool operator==(const QSize &, const QSize &);
11126 friend inline bool operator!=(const QSize &, const QSize &);
11127 friend inline const QSize operator+(const QSize &, const QSize &);
11128 friend inline const QSize operator-(const QSize &, const QSize &);
11129 friend inline const QSize operator*(const QSize &, qreal);
11130 friend inline const QSize operator*(qreal, const QSize &);
11131 friend inline const QSize operator/(const QSize &, qreal);
11132 private:
11133 int wd;
11134 int ht;
11135 };
11136 template <> class QTypeInfo<QSize > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QSize)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QSize"; } };
11137 QDataStream &operator<<(QDataStream &, const QSize &);
11138 QDataStream &operator>>(QDataStream &, QSize &);
11139 inline QSize::QSize()
11140 { wd = ht = -1; }
11141 inline QSize::QSize(int w, int h)
11142 { wd = w; ht = h; }
11143 inline bool QSize::isNull() const
11144 { return wd==0 && ht==0; }
11145 inline bool QSize::isEmpty() const
11146 { return wd<1 || ht<1; }
11147 inline bool QSize::isValid() const
11148 { return wd>=0 && ht>=0; }
11149 inline int QSize::width() const
11150 { return wd; }
11151 inline int QSize::height() const
11152 { return ht; }
11153 inline void QSize::setWidth(int w)
11154 { wd = w; }
11155 inline void QSize::setHeight(int h)
11156 { ht = h; }
11157 inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode)
11158 { scale(QSize(w, h), mode); }
11159 inline int &QSize::rwidth()
11160 { return wd; }
11161 inline int &QSize::rheight()
11162 { return ht; }
11163 inline QSize &QSize::operator+=(const QSize &s)
11164 { wd+=s.wd; ht+=s.ht; return *this; }
11165 inline QSize &QSize::operator-=(const QSize &s)
11166 { wd-=s.wd; ht-=s.ht; return *this; }
11167 inline QSize &QSize::operator*=(qreal c)
11168 { wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
11169 inline bool operator==(const QSize &s1, const QSize &s2)
11170 { return s1.wd == s2.wd && s1.ht == s2.ht; }
11171 inline bool operator!=(const QSize &s1, const QSize &s2)
11172 { return s1.wd != s2.wd || s1.ht != s2.ht; }
11173 inline const QSize operator+(const QSize & s1, const QSize & s2)
11174 { return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
11175 inline const QSize operator-(const QSize &s1, const QSize &s2)
11176 { return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
11177 inline const QSize operator*(const QSize &s, qreal c)
11178 { return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
11179 inline const QSize operator*(qreal c, const QSize &s)
11180 { return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
11181 inline QSize &QSize::operator/=(qreal c)
11182 {
11183 ((!(!qFuzzyIsNull(c))) ? qt_assert("!qFuzzyIsNull(c)","/usr/include/qt4/QtCore/qsize.h",176) : qt_noop());
11184 wd = qRound(wd/c); ht = qRound(ht/c);
11185 return *this;
11186 }
11187 inline const QSize operator/(const QSize &s, qreal c)
11188 {
11189 ((!(!qFuzzyIsNull(c))) ? qt_assert("!qFuzzyIsNull(c)","/usr/include/qt4/QtCore/qsize.h",183) : qt_noop());
11190 return QSize(qRound(s.wd/c), qRound(s.ht/c));
11191 }
11192 inline QSize QSize::expandedTo(const QSize & otherSize) const
11193 {
11194 return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
11195 }
11196 inline QSize QSize::boundedTo(const QSize & otherSize) const
11197 {
11198 return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
11199 }
11200 QDebug operator<<(QDebug, const QSize &);
11201 class QSizeF
11202 {
11203 public:
11204 QSizeF();
11205 QSizeF(const QSize &sz);
11206 QSizeF(qreal w, qreal h);
11207 bool isNull() const;
11208 bool isEmpty() const;
11209 bool isValid() const;
11210 qreal width() const;
11211 qreal height() const;
11212 void setWidth(qreal w);
11213 void setHeight(qreal h);
11214 void transpose();
11215 void scale(qreal w, qreal h, Qt::AspectRatioMode mode);
11216 void scale(const QSizeF &s, Qt::AspectRatioMode mode);
11217 QSizeF expandedTo(const QSizeF &) const;
11218 QSizeF boundedTo(const QSizeF &) const;
11219 qreal &rwidth();
11220 qreal &rheight();
11221 QSizeF &operator+=(const QSizeF &);
11222 QSizeF &operator-=(const QSizeF &);
11223 QSizeF &operator*=(qreal c);
11224 QSizeF &operator/=(qreal c);
11225 friend inline bool operator==(const QSizeF &, const QSizeF &);
11226 friend inline bool operator!=(const QSizeF &, const QSizeF &);
11227 friend inline const QSizeF operator+(const QSizeF &, const QSizeF &);
11228 friend inline const QSizeF operator-(const QSizeF &, const QSizeF &);
11229 friend inline const QSizeF operator*(const QSizeF &, qreal);
11230 friend inline const QSizeF operator*(qreal, const QSizeF &);
11231 friend inline const QSizeF operator/(const QSizeF &, qreal);
11232 inline QSize toSize() const;
11233 private:
11234 qreal wd;
11235 qreal ht;
11236 };
11237 template <> class QTypeInfo<QSizeF > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QSizeF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QSizeF"; } };
11238 QDataStream &operator<<(QDataStream &, const QSizeF &);
11239 QDataStream &operator>>(QDataStream &, QSizeF &);
11240 inline QSizeF::QSizeF()
11241 { wd = ht = -1.; }
11242 inline QSizeF::QSizeF(const QSize &sz)
11243 : wd(sz.width()), ht(sz.height())
11244 {
11245 }
11246 inline QSizeF::QSizeF(qreal w, qreal h)
11247 { wd = w; ht = h; }
11248 inline bool QSizeF::isNull() const
11249 { return qIsNull(wd) && qIsNull(ht); }
11250 inline bool QSizeF::isEmpty() const
11251 { return wd <= 0. || ht <= 0.; }
11252 inline bool QSizeF::isValid() const
11253 { return wd >= 0. && ht >= 0.; }
11254 inline qreal QSizeF::width() const
11255 { return wd; }
11256 inline qreal QSizeF::height() const
11257 { return ht; }
11258 inline void QSizeF::setWidth(qreal w)
11259 { wd = w; }
11260 inline void QSizeF::setHeight(qreal h)
11261 { ht = h; }
11262 inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode)
11263 { scale(QSizeF(w, h), mode); }
11264 inline qreal &QSizeF::rwidth()
11265 { return wd; }
11266 inline qreal &QSizeF::rheight()
11267 { return ht; }
11268 inline QSizeF &QSizeF::operator+=(const QSizeF &s)
11269 { wd += s.wd; ht += s.ht; return *this; }
11270 inline QSizeF &QSizeF::operator-=(const QSizeF &s)
11271 { wd -= s.wd; ht -= s.ht; return *this; }
11272 inline QSizeF &QSizeF::operator*=(qreal c)
11273 { wd *= c; ht *= c; return *this; }
11274 inline bool operator==(const QSizeF &s1, const QSizeF &s2)
11275 { return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
11276 inline bool operator!=(const QSizeF &s1, const QSizeF &s2)
11277 { return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
11278 inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2)
11279 { return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
11280 inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2)
11281 { return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
11282 inline const QSizeF operator*(const QSizeF &s, qreal c)
11283 { return QSizeF(s.wd*c, s.ht*c); }
11284 inline const QSizeF operator*(qreal c, const QSizeF &s)
11285 { return QSizeF(s.wd*c, s.ht*c); }
11286 inline QSizeF &QSizeF::operator/=(qreal c)
11287 {
11288 ((!(!qFuzzyIsNull(c))) ? qt_assert("!qFuzzyIsNull(c)","/usr/include/qt4/QtCore/qsize.h",334) : qt_noop());
11289 wd = wd/c; ht = ht/c;
11290 return *this;
11291 }
11292 inline const QSizeF operator/(const QSizeF &s, qreal c)
11293 {
11294 ((!(!qFuzzyIsNull(c))) ? qt_assert("!qFuzzyIsNull(c)","/usr/include/qt4/QtCore/qsize.h",341) : qt_noop());
11295 return QSizeF(s.wd/c, s.ht/c);
11296 }
11297 inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const
11298 {
11299 return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
11300 }
11301 inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const
11302 {
11303 return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
11304 }
11305 inline QSize QSizeF::toSize() const
11306 {
11307 return QSize(qRound(wd), qRound(ht));
11308 }
11309 QDebug operator<<(QDebug, const QSizeF &);
11310 typedef QtValidLicenseForCoreModule QtCoreModule;
11311 class QPoint
11312 {
11313 public:
11314 QPoint();
11315 QPoint(int xpos, int ypos);
11316 bool isNull() const;
11317 int x() const;
11318 int y() const;
11319 void setX(int x);
11320 void setY(int y);
11321 int manhattanLength() const;
11322 int &rx();
11323 int &ry();
11324 QPoint &operator+=(const QPoint &p);
11325 QPoint &operator-=(const QPoint &p);
11326 QPoint &operator*=(qreal c);
11327 QPoint &operator/=(qreal c);
11328 friend inline bool operator==(const QPoint &, const QPoint &);
11329 friend inline bool operator!=(const QPoint &, const QPoint &);
11330 friend inline const QPoint operator+(const QPoint &, const QPoint &);
11331 friend inline const QPoint operator-(const QPoint &, const QPoint &);
11332 friend inline const QPoint operator*(const QPoint &, qreal);
11333 friend inline const QPoint operator*(qreal, const QPoint &);
11334 friend inline const QPoint operator-(const QPoint &);
11335 friend inline const QPoint operator/(const QPoint &, qreal);
11336 private:
11337 friend class QTransform;
11338 int xp;
11339 int yp;
11340 };
11341 template <> class QTypeInfo<QPoint > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPoint)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPoint"; } };
11342 QDataStream &operator<<(QDataStream &, const QPoint &);
11343 QDataStream &operator>>(QDataStream &, QPoint &);
11344 inline QPoint::QPoint()
11345 { xp=0; yp=0; }
11346 inline QPoint::QPoint(int xpos, int ypos)
11347 { xp = xpos; yp = ypos; }
11348 inline bool QPoint::isNull() const
11349 { return xp == 0 && yp == 0; }
11350 inline int QPoint::x() const
11351 { return xp; }
11352 inline int QPoint::y() const
11353 { return yp; }
11354 inline void QPoint::setX(int xpos)
11355 { xp = xpos; }
11356 inline void QPoint::setY(int ypos)
11357 { yp = ypos; }
11358 inline int &QPoint::rx()
11359 { return xp; }
11360 inline int &QPoint::ry()
11361 { return yp; }
11362 inline QPoint &QPoint::operator+=(const QPoint &p)
11363 { xp+=p.xp; yp+=p.yp; return *this; }
11364 inline QPoint &QPoint::operator-=(const QPoint &p)
11365 { xp-=p.xp; yp-=p.yp; return *this; }
11366 inline QPoint &QPoint::operator*=(qreal c)
11367 { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
11368 inline bool operator==(const QPoint &p1, const QPoint &p2)
11369 { return p1.xp == p2.xp && p1.yp == p2.yp; }
11370 inline bool operator!=(const QPoint &p1, const QPoint &p2)
11371 { return p1.xp != p2.xp || p1.yp != p2.yp; }
11372 inline const QPoint operator+(const QPoint &p1, const QPoint &p2)
11373 { return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
11374 inline const QPoint operator-(const QPoint &p1, const QPoint &p2)
11375 { return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
11376 inline const QPoint operator*(const QPoint &p, qreal c)
11377 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
11378 inline const QPoint operator*(qreal c, const QPoint &p)
11379 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
11380 inline const QPoint operator-(const QPoint &p)
11381 { return QPoint(-p.xp, -p.yp); }
11382 inline QPoint &QPoint::operator/=(qreal c)
11383 {
11384 xp = qRound(xp/c);
11385 yp = qRound(yp/c);
11386 return *this;
11387 }
11388 inline const QPoint operator/(const QPoint &p, qreal c)
11389 {
11390 return QPoint(qRound(p.xp/c), qRound(p.yp/c));
11391 }
11392 QDebug operator<<(QDebug, const QPoint &);
11393 class QPointF
11394 {
11395 public:
11396 QPointF();
11397 QPointF(const QPoint &p);
11398 QPointF(qreal xpos, qreal ypos);
11399 qreal manhattanLength() const;
11400 bool isNull() const;
11401 qreal x() const;
11402 qreal y() const;
11403 void setX(qreal x);
11404 void setY(qreal y);
11405 qreal &rx();
11406 qreal &ry();
11407 QPointF &operator+=(const QPointF &p);
11408 QPointF &operator-=(const QPointF &p);
11409 QPointF &operator*=(qreal c);
11410 QPointF &operator/=(qreal c);
11411 friend inline bool operator==(const QPointF &, const QPointF &);
11412 friend inline bool operator!=(const QPointF &, const QPointF &);
11413 friend inline const QPointF operator+(const QPointF &, const QPointF &);
11414 friend inline const QPointF operator-(const QPointF &, const QPointF &);
11415 friend inline const QPointF operator*(qreal, const QPointF &);
11416 friend inline const QPointF operator*(const QPointF &, qreal);
11417 friend inline const QPointF operator-(const QPointF &);
11418 friend inline const QPointF operator/(const QPointF &, qreal);
11419 QPoint toPoint() const;
11420 private:
11421 friend class QMatrix;
11422 friend class QTransform;
11423 qreal xp;
11424 qreal yp;
11425 };
11426 template <> class QTypeInfo<QPointF > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPointF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPointF"; } };
11427 QDataStream &operator<<(QDataStream &, const QPointF &);
11428 QDataStream &operator>>(QDataStream &, QPointF &);
11429 inline QPointF::QPointF() : xp(0), yp(0) { }
11430 inline QPointF::QPointF(qreal xpos, qreal ypos) : xp(xpos), yp(ypos) { }
11431 inline QPointF::QPointF(const QPoint &p) : xp(p.x()), yp(p.y()) { }
11432 inline bool QPointF::isNull() const
11433 {
11434 return qIsNull(xp) && qIsNull(yp);
11435 }
11436 inline qreal QPointF::x() const
11437 {
11438 return xp;
11439 }
11440 inline qreal QPointF::y() const
11441 {
11442 return yp;
11443 }
11444 inline void QPointF::setX(qreal xpos)
11445 {
11446 xp = xpos;
11447 }
11448 inline void QPointF::setY(qreal ypos)
11449 {
11450 yp = ypos;
11451 }
11452 inline qreal &QPointF::rx()
11453 {
11454 return xp;
11455 }
11456 inline qreal &QPointF::ry()
11457 {
11458 return yp;
11459 }
11460 inline QPointF &QPointF::operator+=(const QPointF &p)
11461 {
11462 xp+=p.xp;
11463 yp+=p.yp;
11464 return *this;
11465 }
11466 inline QPointF &QPointF::operator-=(const QPointF &p)
11467 {
11468 xp-=p.xp; yp-=p.yp; return *this;
11469 }
11470 inline QPointF &QPointF::operator*=(qreal c)
11471 {
11472 xp*=c; yp*=c; return *this;
11473 }
11474 inline bool operator==(const QPointF &p1, const QPointF &p2)
11475 {
11476 return qFuzzyIsNull(p1.xp - p2.xp) && qFuzzyIsNull(p1.yp - p2.yp);
11477 }
11478 inline bool operator!=(const QPointF &p1, const QPointF &p2)
11479 {
11480 return !qFuzzyIsNull(p1.xp - p2.xp) || !qFuzzyIsNull(p1.yp - p2.yp);
11481 }
11482 inline const QPointF operator+(const QPointF &p1, const QPointF &p2)
11483 {
11484 return QPointF(p1.xp+p2.xp, p1.yp+p2.yp);
11485 }
11486 inline const QPointF operator-(const QPointF &p1, const QPointF &p2)
11487 {
11488 return QPointF(p1.xp-p2.xp, p1.yp-p2.yp);
11489 }
11490 inline const QPointF operator*(const QPointF &p, qreal c)
11491 {
11492 return QPointF(p.xp*c, p.yp*c);
11493 }
11494 inline const QPointF operator*(qreal c, const QPointF &p)
11495 {
11496 return QPointF(p.xp*c, p.yp*c);
11497 }
11498 inline const QPointF operator-(const QPointF &p)
11499 {
11500 return QPointF(-p.xp, -p.yp);
11501 }
11502 inline QPointF &QPointF::operator/=(qreal c)
11503 {
11504 xp/=c;
11505 yp/=c;
11506 return *this;
11507 }
11508 inline const QPointF operator/(const QPointF &p, qreal c)
11509 {
11510 return QPointF(p.xp/c, p.yp/c);
11511 }
11512 inline QPoint QPointF::toPoint() const
11513 {
11514 return QPoint(qRound(xp), qRound(yp));
11515 }
11516 QDebug operator<<(QDebug d, const QPointF &p);
11517 typedef QtValidLicenseForCoreModule QtCoreModule;
11518 class QRect
11519 {
11520 public:
11521 QRect() { x1 = y1 = 0; x2 = y2 = -1; }
11522 QRect(const QPoint &topleft, const QPoint &bottomright);
11523 QRect(const QPoint &topleft, const QSize &size);
11524 QRect(int left, int top, int width, int height);
11525 bool isNull() const;
11526 bool isEmpty() const;
11527 bool isValid() const;
11528 int left() const;
11529 int top() const;
11530 int right() const;
11531 int bottom() const;
11532 QRect normalized() const;
11533 int x() const;
11534 int y() const;
11535 void setLeft(int pos);
11536 void setTop(int pos);
11537 void setRight(int pos);
11538 void setBottom(int pos);
11539 void setX(int x);
11540 void setY(int y);
11541 void setTopLeft(const QPoint &p);
11542 void setBottomRight(const QPoint &p);
11543 void setTopRight(const QPoint &p);
11544 void setBottomLeft(const QPoint &p);
11545 QPoint topLeft() const;
11546 QPoint bottomRight() const;
11547 QPoint topRight() const;
11548 QPoint bottomLeft() const;
11549 QPoint center() const;
11550 void moveLeft(int pos);
11551 void moveTop(int pos);
11552 void moveRight(int pos);
11553 void moveBottom(int pos);
11554 void moveTopLeft(const QPoint &p);
11555 void moveBottomRight(const QPoint &p);
11556 void moveTopRight(const QPoint &p);
11557 void moveBottomLeft(const QPoint &p);
11558 void moveCenter(const QPoint &p);
11559 inline void translate(int dx, int dy);
11560 inline void translate(const QPoint &p);
11561 inline QRect translated(int dx, int dy) const;
11562 inline QRect translated(const QPoint &p) const;
11563 void moveTo(int x, int t);
11564 void moveTo(const QPoint &p);
11565 void setRect(int x, int y, int w, int h);
11566 inline void getRect(int *x, int *y, int *w, int *h) const;
11567 void setCoords(int x1, int y1, int x2, int y2);
11568 inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
11569 inline void adjust(int x1, int y1, int x2, int y2);
11570 inline QRect adjusted(int x1, int y1, int x2, int y2) const;
11571 QSize size() const;
11572 int width() const;
11573 int height() const;
11574 void setWidth(int w);
11575 void setHeight(int h);
11576 void setSize(const QSize &s);
11577 QRect operator|(const QRect &r) const;
11578 QRect operator&(const QRect &r) const;
11579 QRect& operator|=(const QRect &r);
11580 QRect& operator&=(const QRect &r);
11581 bool contains(const QPoint &p, bool proper=false) const;
11582 bool contains(int x, int y) const;
11583 bool contains(int x, int y, bool proper) const;
11584 bool contains(const QRect &r, bool proper = false) const;
11585 QRect unite(const QRect &r) const;
11586 QRect united(const QRect &other) const;
11587 QRect intersect(const QRect &r) const;
11588 QRect intersected(const QRect &other) const;
11589 bool intersects(const QRect &r) const;
11590 friend inline bool operator==(const QRect &, const QRect &);
11591 friend inline bool operator!=(const QRect &, const QRect &);
11592 private:
11593 friend void qt_setCoords(QRect *r, int xp1, int yp1, int xp2, int yp2);
11594 int x1;
11595 int y1;
11596 int x2;
11597 int y2;
11598 };
11599 template <> class QTypeInfo<QRect > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QRect)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QRect"; } };
11600 inline bool operator==(const QRect &, const QRect &);
11601 inline bool operator!=(const QRect &, const QRect &);
11602 QDataStream &operator<<(QDataStream &, const QRect &);
11603 QDataStream &operator>>(QDataStream &, QRect &);
11604 inline QRect::QRect(int aleft, int atop, int awidth, int aheight)
11605 {
11606 x1 = aleft;
11607 y1 = atop;
11608 x2 = (aleft + awidth - 1);
11609 y2 = (atop + aheight - 1);
11610 }
11611 inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight)
11612 {
11613 x1 = atopLeft.x();
11614 y1 = atopLeft.y();
11615 x2 = abottomRight.x();
11616 y2 = abottomRight.y();
11617 }
11618 inline QRect::QRect(const QPoint &atopLeft, const QSize &asize)
11619 {
11620 x1 = atopLeft.x();
11621 y1 = atopLeft.y();
11622 x2 = (x1+asize.width() - 1);
11623 y2 = (y1+asize.height() - 1);
11624 }
11625 inline bool QRect::isNull() const
11626 { return x2 == x1 - 1 && y2 == y1 - 1; }
11627 inline bool QRect::isEmpty() const
11628 { return x1 > x2 || y1 > y2; }
11629 inline bool QRect::isValid() const
11630 { return x1 <= x2 && y1 <= y2; }
11631 inline int QRect::left() const
11632 { return x1; }
11633 inline int QRect::top() const
11634 { return y1; }
11635 inline int QRect::right() const
11636 { return x2; }
11637 inline int QRect::bottom() const
11638 { return y2; }
11639 inline int QRect::x() const
11640 { return x1; }
11641 inline int QRect::y() const
11642 { return y1; }
11643 inline void QRect::setLeft(int pos)
11644 { x1 = pos; }
11645 inline void QRect::setTop(int pos)
11646 { y1 = pos; }
11647 inline void QRect::setRight(int pos)
11648 { x2 = pos; }
11649 inline void QRect::setBottom(int pos)
11650 { y2 = pos; }
11651 inline void QRect::setTopLeft(const QPoint &p)
11652 { x1 = p.x(); y1 = p.y(); }
11653 inline void QRect::setBottomRight(const QPoint &p)
11654 { x2 = p.x(); y2 = p.y(); }
11655 inline void QRect::setTopRight(const QPoint &p)
11656 { x2 = p.x(); y1 = p.y(); }
11657 inline void QRect::setBottomLeft(const QPoint &p)
11658 { x1 = p.x(); y2 = p.y(); }
11659 inline void QRect::setX(int ax)
11660 { x1 = ax; }
11661 inline void QRect::setY(int ay)
11662 { y1 = ay; }
11663 inline QPoint QRect::topLeft() const
11664 { return QPoint(x1, y1); }
11665 inline QPoint QRect::bottomRight() const
11666 { return QPoint(x2, y2); }
11667 inline QPoint QRect::topRight() const
11668 { return QPoint(x2, y1); }
11669 inline QPoint QRect::bottomLeft() const
11670 { return QPoint(x1, y2); }
11671 inline QPoint QRect::center() const
11672 { return QPoint((x1+x2)/2, (y1+y2)/2); }
11673 inline int QRect::width() const
11674 { return x2 - x1 + 1; }
11675 inline int QRect::height() const
11676 { return y2 - y1 + 1; }
11677 inline QSize QRect::size() const
11678 { return QSize(width(), height()); }
11679 inline void QRect::translate(int dx, int dy)
11680 {
11681 x1 += dx;
11682 y1 += dy;
11683 x2 += dx;
11684 y2 += dy;
11685 }
11686 inline void QRect::translate(const QPoint &p)
11687 {
11688 x1 += p.x();
11689 y1 += p.y();
11690 x2 += p.x();
11691 y2 += p.y();
11692 }
11693 inline QRect QRect::translated(int dx, int dy) const
11694 { return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
11695 inline QRect QRect::translated(const QPoint &p) const
11696 { return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
11697 inline void QRect::moveTo(int ax, int ay)
11698 {
11699 x2 += ax - x1;
11700 y2 += ay - y1;
11701 x1 = ax;
11702 y1 = ay;
11703 }
11704 inline void QRect::moveTo(const QPoint &p)
11705 {
11706 x2 += p.x() - x1;
11707 y2 += p.y() - y1;
11708 x1 = p.x();
11709 y1 = p.y();
11710 }
11711 inline void QRect::moveLeft(int pos)
11712 { x2 += (pos - x1); x1 = pos; }
11713 inline void QRect::moveTop(int pos)
11714 { y2 += (pos - y1); y1 = pos; }
11715 inline void QRect::moveRight(int pos)
11716 {
11717 x1 += (pos - x2);
11718 x2 = pos;
11719 }
11720 inline void QRect::moveBottom(int pos)
11721 {
11722 y1 += (pos - y2);
11723 y2 = pos;
11724 }
11725 inline void QRect::moveTopLeft(const QPoint &p)
11726 {
11727 moveLeft(p.x());
11728 moveTop(p.y());
11729 }
11730 inline void QRect::moveBottomRight(const QPoint &p)
11731 {
11732 moveRight(p.x());
11733 moveBottom(p.y());
11734 }
11735 inline void QRect::moveTopRight(const QPoint &p)
11736 {
11737 moveRight(p.x());
11738 moveTop(p.y());
11739 }
11740 inline void QRect::moveBottomLeft(const QPoint &p)
11741 {
11742 moveLeft(p.x());
11743 moveBottom(p.y());
11744 }
11745 inline void QRect::getRect(int *ax, int *ay, int *aw, int *ah) const
11746 {
11747 *ax = x1;
11748 *ay = y1;
11749 *aw = x2 - x1 + 1;
11750 *ah = y2 - y1 + 1;
11751 }
11752 inline void QRect::setRect(int ax, int ay, int aw, int ah)
11753 {
11754 x1 = ax;
11755 y1 = ay;
11756 x2 = (ax + aw - 1);
11757 y2 = (ay + ah - 1);
11758 }
11759 inline void QRect::getCoords(int *xp1, int *yp1, int *xp2, int *yp2) const
11760 {
11761 *xp1 = x1;
11762 *yp1 = y1;
11763 *xp2 = x2;
11764 *yp2 = y2;
11765 }
11766 inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2)
11767 {
11768 x1 = xp1;
11769 y1 = yp1;
11770 x2 = xp2;
11771 y2 = yp2;
11772 }
11773 inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const
11774 { return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
11775 inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2)
11776 {
11777 x1 += dx1;
11778 y1 += dy1;
11779 x2 += dx2;
11780 y2 += dy2;
11781 }
11782 inline void QRect::setWidth(int w)
11783 { x2 = (x1 + w - 1); }
11784 inline void QRect::setHeight(int h)
11785 { y2 = (y1 + h - 1); }
11786 inline void QRect::setSize(const QSize &s)
11787 {
11788 x2 = (s.width() + x1 - 1);
11789 y2 = (s.height() + y1 - 1);
11790 }
11791 inline bool QRect::contains(int ax, int ay, bool aproper) const
11792 {
11793 return contains(QPoint(ax, ay), aproper);
11794 }
11795 inline bool QRect::contains(int ax, int ay) const
11796 {
11797 return contains(QPoint(ax, ay), false);
11798 }
11799 inline QRect& QRect::operator|=(const QRect &r)
11800 {
11801 *this = *this | r;
11802 return *this;
11803 }
11804 inline QRect& QRect::operator&=(const QRect &r)
11805 {
11806 *this = *this & r;
11807 return *this;
11808 }
11809 inline QRect QRect::intersect(const QRect &r) const
11810 {
11811 return *this & r;
11812 }
11813 inline QRect QRect::intersected(const QRect &other) const
11814 {
11815 return intersect(other);
11816 }
11817 inline QRect QRect::unite(const QRect &r) const
11818 {
11819 return *this | r;
11820 }
11821 inline QRect QRect::united(const QRect &r) const
11822 {
11823 return unite(r);
11824 }
11825 inline bool operator==(const QRect &r1, const QRect &r2)
11826 {
11827 return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
11828 }
11829 inline bool operator!=(const QRect &r1, const QRect &r2)
11830 {
11831 return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
11832 }
11833 QDebug operator<<(QDebug, const QRect &);
11834 class QRectF
11835 {
11836 public:
11837 QRectF() { xp = yp = 0.; w = h = 0.; }
11838 QRectF(const QPointF &topleft, const QSizeF &size);
11839 QRectF(const QPointF &topleft, const QPointF &bottomRight);
11840 QRectF(qreal left, qreal top, qreal width, qreal height);
11841 QRectF(const QRect &rect);
11842 bool isNull() const;
11843 bool isEmpty() const;
11844 bool isValid() const;
11845 QRectF normalized() const;
11846 inline qreal left() const { return xp; }
11847 inline qreal top() const { return yp; }
11848 inline qreal right() const { return xp + w; }
11849 inline qreal bottom() const { return yp + h; }
11850 inline qreal x() const;
11851 inline qreal y() const;
11852 inline void setLeft(qreal pos);
11853 inline void setTop(qreal pos);
11854 inline void setRight(qreal pos);
11855 inline void setBottom(qreal pos);
11856 inline void setX(qreal pos) { setLeft(pos); }
11857 inline void setY(qreal pos) { setTop(pos); }
11858 inline QPointF topLeft() const { return QPointF(xp, yp); }
11859 inline QPointF bottomRight() const { return QPointF(xp+w, yp+h); }
11860 inline QPointF topRight() const { return QPointF(xp+w, yp); }
11861 inline QPointF bottomLeft() const { return QPointF(xp, yp+h); }
11862 inline QPointF center() const;
11863 void setTopLeft(const QPointF &p);
11864 void setBottomRight(const QPointF &p);
11865 void setTopRight(const QPointF &p);
11866 void setBottomLeft(const QPointF &p);
11867 void moveLeft(qreal pos);
11868 void moveTop(qreal pos);
11869 void moveRight(qreal pos);
11870 void moveBottom(qreal pos);
11871 void moveTopLeft(const QPointF &p);
11872 void moveBottomRight(const QPointF &p);
11873 void moveTopRight(const QPointF &p);
11874 void moveBottomLeft(const QPointF &p);
11875 void moveCenter(const QPointF &p);
11876 void translate(qreal dx, qreal dy);
11877 void translate(const QPointF &p);
11878 QRectF translated(qreal dx, qreal dy) const;
11879 QRectF translated(const QPointF &p) const;
11880 void moveTo(qreal x, qreal t);
11881 void moveTo(const QPointF &p);
11882 void setRect(qreal x, qreal y, qreal w, qreal h);
11883 void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const;
11884 void setCoords(qreal x1, qreal y1, qreal x2, qreal y2);
11885 void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
11886 inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2);
11887 inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const;
11888 QSizeF size() const;
11889 qreal width() const;
11890 qreal height() const;
11891 void setWidth(qreal w);
11892 void setHeight(qreal h);
11893 void setSize(const QSizeF &s);
11894 QRectF operator|(const QRectF &r) const;
11895 QRectF operator&(const QRectF &r) const;
11896 QRectF& operator|=(const QRectF &r);
11897 QRectF& operator&=(const QRectF &r);
11898 bool contains(const QPointF &p) const;
11899 bool contains(qreal x, qreal y) const;
11900 bool contains(const QRectF &r) const;
11901 QRectF unite(const QRectF &r) const;
11902 QRectF united(const QRectF &other) const;
11903 QRectF intersect(const QRectF &r) const;
11904 QRectF intersected(const QRectF &other) const;
11905 bool intersects(const QRectF &r) const;
11906 friend inline bool operator==(const QRectF &, const QRectF &);
11907 friend inline bool operator!=(const QRectF &, const QRectF &);
11908 QRect toRect() const;
11909 QRect toAlignedRect() const;
11910 private:
11911 qreal xp;
11912 qreal yp;
11913 qreal w;
11914 qreal h;
11915 };
11916 template <> class QTypeInfo<QRectF > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QRectF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QRectF"; } };
11917 inline bool operator==(const QRectF &, const QRectF &);
11918 inline bool operator!=(const QRectF &, const QRectF &);
11919 QDataStream &operator<<(QDataStream &, const QRectF &);
11920 QDataStream &operator>>(QDataStream &, QRectF &);
11921 inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight)
11922 : xp(aleft), yp(atop), w(awidth), h(aheight)
11923 {
11924 }
11925 inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize)
11926 {
11927 xp = atopLeft.x();
11928 yp = atopLeft.y();
11929 w = asize.width();
11930 h = asize.height();
11931 }
11932 inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight)
11933 {
11934 xp = atopLeft.x();
11935 yp = atopLeft.y();
11936 w = abottomRight.x() - xp;
11937 h = abottomRight.y() - yp;
11938 }
11939 inline QRectF::QRectF(const QRect &r)
11940 : xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
11941 {
11942 }
11943 inline bool QRectF::isNull() const
11944 { return w == 0. && h == 0.; }
11945 inline bool QRectF::isEmpty() const
11946 { return w <= 0. || h <= 0.; }
11947 inline bool QRectF::isValid() const
11948 { return w > 0. && h > 0.; }
11949 inline qreal QRectF::x() const
11950 { return xp; }
11951 inline qreal QRectF::y() const
11952 { return yp; }
11953 inline void QRectF::setLeft(qreal pos) { qreal diff = pos - xp; xp += diff; w -= diff; }
11954 inline void QRectF::setRight(qreal pos) { w = pos - xp; }
11955 inline void QRectF::setTop(qreal pos) { qreal diff = pos - yp; yp += diff; h -= diff; }
11956 inline void QRectF::setBottom(qreal pos) { h = pos - yp; }
11957 inline void QRectF::setTopLeft(const QPointF &p) { setLeft(p.x()); setTop(p.y()); }
11958 inline void QRectF::setTopRight(const QPointF &p) { setRight(p.x()); setTop(p.y()); }
11959 inline void QRectF::setBottomLeft(const QPointF &p) { setLeft(p.x()); setBottom(p.y()); }
11960 inline void QRectF::setBottomRight(const QPointF &p) { setRight(p.x()); setBottom(p.y()); }
11961 inline QPointF QRectF::center() const
11962 { return QPointF(xp + w/2, yp + h/2); }
11963 inline void QRectF::moveLeft(qreal pos) { xp = pos; }
11964 inline void QRectF::moveTop(qreal pos) { yp = pos; }
11965 inline void QRectF::moveRight(qreal pos) { xp = pos - w; }
11966 inline void QRectF::moveBottom(qreal pos) { yp = pos - h; }
11967 inline void QRectF::moveTopLeft(const QPointF &p) { moveLeft(p.x()); moveTop(p.y()); }
11968 inline void QRectF::moveTopRight(const QPointF &p) { moveRight(p.x()); moveTop(p.y()); }
11969 inline void QRectF::moveBottomLeft(const QPointF &p) { moveLeft(p.x()); moveBottom(p.y()); }
11970 inline void QRectF::moveBottomRight(const QPointF &p) { moveRight(p.x()); moveBottom(p.y()); }
11971 inline void QRectF::moveCenter(const QPointF &p) { xp = p.x() - w/2; yp = p.y() - h/2; }
11972 inline qreal QRectF::width() const
11973 { return w; }
11974 inline qreal QRectF::height() const
11975 { return h; }
11976 inline QSizeF QRectF::size() const
11977 { return QSizeF(w, h); }
11978 inline void QRectF::translate(qreal dx, qreal dy)
11979 {
11980 xp += dx;
11981 yp += dy;
11982 }
11983 inline void QRectF::translate(const QPointF &p)
11984 {
11985 xp += p.x();
11986 yp += p.y();
11987 }
11988 inline void QRectF::moveTo(qreal ax, qreal ay)
11989 {
11990 xp = ax;
11991 yp = ay;
11992 }
11993 inline void QRectF::moveTo(const QPointF &p)
11994 {
11995 xp = p.x();
11996 yp = p.y();
11997 }
11998 inline QRectF QRectF::translated(qreal dx, qreal dy) const
11999 { return QRectF(xp + dx, yp + dy, w, h); }
12000 inline QRectF QRectF::translated(const QPointF &p) const
12001 { return QRectF(xp + p.x(), yp + p.y(), w, h); }
12002 inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
12003 {
12004 *ax = this->xp;
12005 *ay = this->yp;
12006 *aaw = this->w;
12007 *aah = this->h;
12008 }
12009 inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah)
12010 {
12011 this->xp = ax;
12012 this->yp = ay;
12013 this->w = aaw;
12014 this->h = aah;
12015 }
12016 inline void QRectF::getCoords(qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2) const
12017 {
12018 *xp1 = xp;
12019 *yp1 = yp;
12020 *xp2 = xp + w;
12021 *yp2 = yp + h;
12022 }
12023 inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
12024 {
12025 xp = xp1;
12026 yp = yp1;
12027 w = xp2 - xp1;
12028 h = yp2 - yp1;
12029 }
12030 inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
12031 { xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
12032 inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const
12033 { return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
12034 inline void QRectF::setWidth(qreal aw)
12035 { this->w = aw; }
12036 inline void QRectF::setHeight(qreal ah)
12037 { this->h = ah; }
12038 inline void QRectF::setSize(const QSizeF &s)
12039 {
12040 w = s.width();
12041 h = s.height();
12042 }
12043 inline bool QRectF::contains(qreal ax, qreal ay) const
12044 {
12045 return contains(QPointF(ax, ay));
12046 }
12047 inline QRectF& QRectF::operator|=(const QRectF &r)
12048 {
12049 *this = *this | r;
12050 return *this;
12051 }
12052 inline QRectF& QRectF::operator&=(const QRectF &r)
12053 {
12054 *this = *this & r;
12055 return *this;
12056 }
12057 inline QRectF QRectF::intersect(const QRectF &r) const
12058 {
12059 return *this & r;
12060 }
12061 inline QRectF QRectF::intersected(const QRectF &r) const
12062 {
12063 return intersect(r);
12064 }
12065 inline QRectF QRectF::unite(const QRectF &r) const
12066 {
12067 return *this | r;
12068 }
12069 inline QRectF QRectF::united(const QRectF &r) const
12070 {
12071 return unite(r);
12072 }
12073 inline bool operator==(const QRectF &r1, const QRectF &r2)
12074 {
12075 return qFuzzyCompare(r1.xp, r2.xp) && qFuzzyCompare(r1.yp, r2.yp)
12076 && qFuzzyCompare(r1.w, r2.w) && qFuzzyCompare(r1.h, r2.h);
12077 }
12078 inline bool operator!=(const QRectF &r1, const QRectF &r2)
12079 {
12080 return !qFuzzyCompare(r1.xp, r2.xp) || !qFuzzyCompare(r1.yp, r2.yp)
12081 || !qFuzzyCompare(r1.w, r2.w) || !qFuzzyCompare(r1.h, r2.h);
12082 }
12083 inline QRect QRectF::toRect() const
12084 {
12085 return QRect(qRound(xp), qRound(yp), qRound(w), qRound(h));
12086 }
12087 QDebug operator<<(QDebug, const QRectF &);
12088 typedef QtValidLicenseForGuiModule QtGuiModule;
12089 class QPaintEngine;
12090 class QPaintDevice
12091 {
12092 public:
12093 enum PaintDeviceMetric {
12094 PdmWidth = 1,
12095 PdmHeight,
12096 PdmWidthMM,
12097 PdmHeightMM,
12098 PdmNumColors,
12099 PdmDepth,
12100 PdmDpiX,
12101 PdmDpiY,
12102 PdmPhysicalDpiX,
12103 PdmPhysicalDpiY
12104 };
12105 virtual ~QPaintDevice();
12106 virtual int devType() const;
12107 bool paintingActive() const;
12108 virtual QPaintEngine *paintEngine() const = 0;
12109 int width() const { return metric(PdmWidth); }
12110 int height() const { return metric(PdmHeight); }
12111 int widthMM() const { return metric(PdmWidthMM); }
12112 int heightMM() const { return metric(PdmHeightMM); }
12113 int logicalDpiX() const { return metric(PdmDpiX); }
12114 int logicalDpiY() const { return metric(PdmDpiY); }
12115 int physicalDpiX() const { return metric(PdmPhysicalDpiX); }
12116 int physicalDpiY() const { return metric(PdmPhysicalDpiY); }
12117 int numColors() const { return metric(PdmNumColors); }
12118 int colorCount() const { return metric(PdmNumColors); }
12119 int depth() const { return metric(PdmDepth); }
12120 public:
12121 QPaintDevice();
12122 virtual int metric(PaintDeviceMetric metric) const;
12123 ushort painters;
12124 private:
12125 QPaintDevice(const QPaintDevice &); QPaintDevice &operator=(const QPaintDevice &);
12126 friend class QPainter;
12127 friend class QFontEngineMac;
12128 friend class QX11PaintEngine;
12129 friend int qt_paint_device_metric(const QPaintDevice *device, PaintDeviceMetric metric);
12130 };
12131 inline int QPaintDevice::devType() const
12132 { return QInternal::UnknownDevice; }
12133 inline bool QPaintDevice::paintingActive() const
12134 { return painters != 0; }
12135 typedef QtValidLicenseForGuiModule QtGuiModule;
12136 typedef unsigned int QRgb;
12137 const QRgb RGB_MASK = 0x00ffffff;
12138 inline int qRed(QRgb rgb)
12139 { return ((rgb >> 16) & 0xff); }
12140 inline int qGreen(QRgb rgb)
12141 { return ((rgb >> 8) & 0xff); }
12142 inline int qBlue(QRgb rgb)
12143 { return (rgb & 0xff); }
12144 inline int qAlpha(QRgb rgb)
12145 { return ((rgb >> 24) & 0xff); }
12146 inline QRgb qRgb(int r, int g, int b)
12147 { return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
12148 inline QRgb qRgba(int r, int g, int b, int a)
12149 { return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
12150 inline int qGray(int r, int g, int b)
12151 { return (r*11+g*16+b*5)/32; }
12152 inline int qGray(QRgb rgb)
12153 { return qGray(qRed(rgb), qGreen(rgb), qBlue(rgb)); }
12154 inline bool qIsGray(QRgb rgb)
12155 { return qRed(rgb) == qGreen(rgb) && qRed(rgb) == qBlue(rgb); }
12156 typedef QtValidLicenseForCoreModule QtCoreModule;
12157 namespace QAlgorithmsPrivate {
12158 template <typename RandomAccessIterator, typename T, typename LessThan>
12159 void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
12160 template <typename RandomAccessIterator, typename T>
12161 inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy);
12162 template <typename RandomAccessIterator, typename T, typename LessThan>
12163 void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
12164 template <typename RandomAccessIterator, typename T>
12165 inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &);
12166 template <typename RandomAccessIterator, typename T, typename LessThan>
12167 RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
12168 template <typename RandomAccessIterator, typename T, typename LessThan>
12169 RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
12170 template <typename RandomAccessIterator, typename T, typename LessThan>
12171 RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
12172 }
12173 template <typename InputIterator, typename OutputIterator>
12174 inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
12175 {
12176 while (begin != end)
12177 *dest++ = *begin++;
12178 return dest;
12179 }
12180 template <typename BiIterator1, typename BiIterator2>
12181 inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest)
12182 {
12183 while (begin != end)
12184 *--dest = *--end;
12185 return dest;
12186 }
12187 template <typename InputIterator1, typename InputIterator2>
12188 inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
12189 {
12190 for (; first1 != last1; ++first1, ++first2)
12191 if (!(*first1 == *first2))
12192 return false;
12193 return true;
12194 }
12195 template <typename ForwardIterator, typename T>
12196 inline void qFill(ForwardIterator first, ForwardIterator last, const T &val)
12197 {
12198 for (; first != last; ++first)
12199 *first = val;
12200 }
12201 template <typename Container, typename T>
12202 inline void qFill(Container &container, const T &val)
12203 {
12204 qFill(container.begin(), container.end(), val);
12205 }
12206 template <typename InputIterator, typename T>
12207 inline InputIterator qFind(InputIterator first, InputIterator last, const T &val)
12208 {
12209 while (first != last && !(*first == val))
12210 ++first;
12211 return first;
12212 }
12213 template <typename Container, typename T>
12214 inline typename Container::const_iterator qFind(const Container &container, const T &val)
12215 {
12216 return qFind(container.constBegin(), container.constEnd(), val);
12217 }
12218 template <typename InputIterator, typename T, typename Size>
12219 inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n)
12220 {
12221 for (; first != last; ++first)
12222 if (*first == value)
12223 ++n;
12224 }
12225 template <typename Container, typename T, typename Size>
12226 inline void qCount(const Container &container, const T &value, Size &n)
12227 {
12228 qCount(container.constBegin(), container.constEnd(), value, n);
12229 }
12230 template <typename T>
12231 class qLess
12232 {
12233 public:
12234 inline bool operator()(const T &t1, const T &t2) const
12235 {
12236 return (t1 < t2);
12237 }
12238 };
12239 template <typename T>
12240 class qGreater
12241 {
12242 public:
12243 inline bool operator()(const T &t1, const T &t2) const
12244 {
12245 return (t2 < t1);
12246 }
12247 };
12248 template <typename RandomAccessIterator>
12249 inline void qSort(RandomAccessIterator start, RandomAccessIterator end)
12250 {
12251 if (start != end)
12252 QAlgorithmsPrivate::qSortHelper(start, end, *start);
12253 }
12254 template <typename RandomAccessIterator, typename LessThan>
12255 inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
12256 {
12257 if (start != end)
12258 QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan);
12259 }
12260 template<typename Container>
12261 inline void qSort(Container &c)
12262 {
12263 if (!c.empty())
12264 QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin());
12265 }
12266 template <typename RandomAccessIterator>
12267 inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
12268 {
12269 if (start != end)
12270 QAlgorithmsPrivate::qStableSortHelper(start, end, *start);
12271 }
12272 template <typename RandomAccessIterator, typename LessThan>
12273 inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
12274 {
12275 if (start != end)
12276 QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan);
12277 }
12278 template<typename Container>
12279 inline void qStableSort(Container &c)
12280 {
12281 if (!c.empty())
12282 QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin());
12283 }
12284 template <typename RandomAccessIterator, typename T>
12285 RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
12286 {
12287 RandomAccessIterator middle;
12288 int n = end - begin;
12289 int half;
12290 while (n > 0) {
12291 half = n >> 1;
12292 middle = begin + half;
12293 if (*middle < value) {
12294 begin = middle + 1;
12295 n -= half + 1;
12296 } else {
12297 n = half;
12298 }
12299 }
12300 return begin;
12301 }
12302 template <typename RandomAccessIterator, typename T, typename LessThan>
12303 RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
12304 {
12305 return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan);
12306 }
12307 template <typename Container, typename T>
12308 typename Container::const_iterator qLowerBound(const Container &container, const T &value)
12309 {
12310 return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
12311 }
12312 template <typename RandomAccessIterator, typename T>
12313 RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
12314 {
12315 RandomAccessIterator middle;
12316 int n = end - begin;
12317 int half;
12318 while (n > 0) {
12319 half = n >> 1;
12320 middle = begin + half;
12321 if (value < *middle) {
12322 n = half;
12323 } else {
12324 begin = middle + 1;
12325 n -= half + 1;
12326 }
12327 }
12328 return begin;
12329 }
12330 template <typename RandomAccessIterator, typename T, typename LessThan>
12331 RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
12332 {
12333 return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan);
12334 }
12335 template <typename Container, typename T>
12336 typename Container::const_iterator qUpperBound(const Container &container, const T &value)
12337 {
12338 return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
12339 }
12340 template <typename RandomAccessIterator, typename T>
12341 RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
12342 {
12343 RandomAccessIterator it = qLowerBound(begin, end, value);
12344 if (it == end || value < *it)
12345 return end;
12346 return it;
12347 }
12348 template <typename RandomAccessIterator, typename T, typename LessThan>
12349 RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
12350 {
12351 return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan);
12352 }
12353 template <typename Container, typename T>
12354 typename Container::const_iterator qBinaryFind(const Container &container, const T &value)
12355 {
12356 return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
12357 }
12358 template <typename ForwardIterator>
12359 void qDeleteAll(ForwardIterator begin, ForwardIterator end)
12360 {
12361 while (begin != end) {
12362 delete *begin;
12363 ++begin;
12364 }
12365 }
12366 template <typename Container>
12367 inline void qDeleteAll(const Container &c)
12368 {
12369 qDeleteAll(c.begin(), c.end());
12370 }
12371 namespace QAlgorithmsPrivate {
12372 template <typename RandomAccessIterator, typename T, typename LessThan>
12373 void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
12374 {
12375 top:
12376 int span = int(end - start);
12377 if (span < 2)
12378 return;
12379 --end;
12380 RandomAccessIterator low = start, high = end - 1;
12381 RandomAccessIterator pivot = start + span / 2;
12382 if (lessThan(*end, *start))
12383 qSwap(*end, *start);
12384 if (span == 2)
12385 return;
12386 if (lessThan(*pivot, *start))
12387 qSwap(*pivot, *start);
12388 if (lessThan(*end, *pivot))
12389 qSwap(*end, *pivot);
12390 if (span == 3)
12391 return;
12392 qSwap(*pivot, *end);
12393 while (low < high) {
12394 while (low < high && lessThan(*low, *end))
12395 ++low;
12396 while (high > low && lessThan(*end, *high))
12397 --high;
12398 if (low < high) {
12399 qSwap(*low, *high);
12400 ++low;
12401 --high;
12402 } else {
12403 break;
12404 }
12405 }
12406 if (lessThan(*low, *end))
12407 ++low;
12408 qSwap(*end, *low);
12409 qSortHelper(start, low, t, lessThan);
12410 start = low + 1;
12411 ++end;
12412 goto top;
12413 }
12414 template <typename RandomAccessIterator, typename T>
12415 inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
12416 {
12417 qSortHelper(begin, end, dummy, qLess<T>());
12418 }
12419 template <typename RandomAccessIterator>
12420 void qReverse(RandomAccessIterator begin, RandomAccessIterator end)
12421 {
12422 --end;
12423 while (begin < end)
12424 qSwap(*begin++, *end--);
12425 }
12426 template <typename RandomAccessIterator>
12427 void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end)
12428 {
12429 qReverse(begin, middle);
12430 qReverse(middle, end);
12431 qReverse(begin, end);
12432 }
12433 template <typename RandomAccessIterator, typename T, typename LessThan>
12434 void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan)
12435 {
12436 const int len1 = pivot - begin;
12437 const int len2 = end - pivot;
12438 if (len1 == 0 || len2 == 0)
12439 return;
12440 if (len1 + len2 == 2) {
12441 if (lessThan(*(begin + 1), *(begin)))
12442 qSwap(*begin, *(begin + 1));
12443 return;
12444 }
12445 RandomAccessIterator firstCut;
12446 RandomAccessIterator secondCut;
12447 int len2Half;
12448 if (len1 > len2) {
12449 const int len1Half = len1 / 2;
12450 firstCut = begin + len1Half;
12451 secondCut = qLowerBound(pivot, end, *firstCut, lessThan);
12452 len2Half = secondCut - pivot;
12453 } else {
12454 len2Half = len2 / 2;
12455 secondCut = pivot + len2Half;
12456 firstCut = qUpperBound(begin, pivot, *secondCut, lessThan);
12457 }
12458 qRotate(firstCut, pivot, secondCut);
12459 const RandomAccessIterator newPivot = firstCut + len2Half;
12460 qMerge(begin, firstCut, newPivot, t, lessThan);
12461 qMerge(newPivot, secondCut, end, t, lessThan);
12462 }
12463 template <typename RandomAccessIterator, typename T, typename LessThan>
12464 void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan)
12465 {
12466 const int span = end - begin;
12467 if (span < 2)
12468 return;
12469 const RandomAccessIterator middle = begin + span / 2;
12470 qStableSortHelper(begin, middle, t, lessThan);
12471 qStableSortHelper(middle, end, t, lessThan);
12472 qMerge(begin, middle, end, t, lessThan);
12473 }
12474 template <typename RandomAccessIterator, typename T>
12475 inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
12476 {
12477 qStableSortHelper(begin, end, dummy, qLess<T>());
12478 }
12479 template <typename RandomAccessIterator, typename T, typename LessThan>
12480 RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
12481 {
12482 RandomAccessIterator middle;
12483 int n = int(end - begin);
12484 int half;
12485 while (n > 0) {
12486 half = n >> 1;
12487 middle = begin + half;
12488 if (lessThan(*middle, value)) {
12489 begin = middle + 1;
12490 n -= half + 1;
12491 } else {
12492 n = half;
12493 }
12494 }
12495 return begin;
12496 }
12497 template <typename RandomAccessIterator, typename T, typename LessThan>
12498 RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
12499 {
12500 RandomAccessIterator middle;
12501 int n = end - begin;
12502 int half;
12503 while (n > 0) {
12504 half = n >> 1;
12505 middle = begin + half;
12506 if (lessThan(value, *middle)) {
12507 n = half;
12508 } else {
12509 begin = middle + 1;
12510 n -= half + 1;
12511 }
12512 }
12513 return begin;
12514 }
12515 template <typename RandomAccessIterator, typename T, typename LessThan>
12516 RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
12517 {
12518 RandomAccessIterator it = qLowerBoundHelper(begin, end, value, lessThan);
12519 if (it == end || lessThan(value, *it))
12520 return end;
12521 return it;
12522 }
12523 }
12524 typedef QtValidLicenseForCoreModule QtCoreModule;
12525 template <typename T>
12526 struct QScopedPointerDeleter
12527 {
12528 static inline void cleanup(T *pointer)
12529 {
12530 typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
12531 (void) sizeof(IsIncompleteType);
12532 delete pointer;
12533 }
12534 };
12535 template <typename T>
12536 struct QScopedPointerArrayDeleter
12537 {
12538 static inline void cleanup(T *pointer)
12539 {
12540 typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
12541 (void) sizeof(IsIncompleteType);
12542 delete [] pointer;
12543 }
12544 };
12545 struct QScopedPointerPodDeleter
12546 {
12547 static inline void cleanup(void *pointer) { if (pointer) qFree(pointer); }
12548 };
12549 template <typename T, typename Cleanup = QScopedPointerDeleter<T> >
12550 class QScopedPointer
12551 {
12552 typedef T *QScopedPointer:: *RestrictedBool;
12553 public:
12554 explicit inline QScopedPointer(T *p = 0) : d(p)
12555 {
12556 }
12557 inline ~QScopedPointer()
12558 {
12559 T *oldD = this->d;
12560 Cleanup::cleanup(oldD);
12561 this->d = 0;
12562 }
12563 inline T &operator*() const
12564 {
12565 ((!(d)) ? qt_assert("d","/usr/include/qt4/QtCore/qscopedpointer.h",106) : qt_noop());
12566 return *d;
12567 }
12568 inline T *operator->() const
12569 {
12570 ((!(d)) ? qt_assert("d","/usr/include/qt4/QtCore/qscopedpointer.h",112) : qt_noop());
12571 return d;
12572 }
12573 inline bool operator!() const
12574 {
12575 return !d;
12576 }
12577 inline operator RestrictedBool() const
12578 {
12579 return isNull() ? 0 : &QScopedPointer::d;
12580 }
12581 inline T *data() const
12582 {
12583 return d;
12584 }
12585 inline bool isNull() const
12586 {
12587 return !d;
12588 }
12589 inline void reset(T *other = 0)
12590 {
12591 if (d == other)
12592 return;
12593 T *oldD = d;
12594 d = other;
12595 Cleanup::cleanup(oldD);
12596 }
12597 inline T *take()
12598 {
12599 T *oldD = d;
12600 d = 0;
12601 return oldD;
12602 }
12603 inline void swap(QScopedPointer<T, Cleanup> &other)
12604 {
12605 qSwap(d, other.d);
12606 }
12607 typedef T *pointer;
12608 public:
12609 T *d;
12610 private:
12611 QScopedPointer(const QScopedPointer &); QScopedPointer &operator=(const QScopedPointer &);
12612 };
12613 template <class T, class Cleanup>
12614 inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs)
12615 {
12616 return lhs.data() == rhs.data();
12617 }
12618 template <class T, class Cleanup>
12619 inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs)
12620 {
12621 return lhs.data() != rhs.data();
12622 }
12623 template <class T, class Cleanup>
12624 inline void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2)
12625 { p1.swap(p2); }
12626 template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
12627 class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
12628 {
12629 public:
12630 explicit inline QScopedArrayPointer(T *p = 0)
12631 : QScopedPointer<T, Cleanup>(p)
12632 {
12633 }
12634 inline T &operator[](int i)
12635 {
12636 return this->d[i];
12637 }
12638 inline const T &operator[](int i) const
12639 {
12640 return this->d[i];
12641 }
12642 private:
12643 QScopedArrayPointer(const QScopedArrayPointer &); QScopedArrayPointer &operator=(const QScopedArrayPointer &);
12644 };
12645 namespace std {
12646 struct bidirectional_iterator_tag;
12647 struct random_access_iterator_tag;
12648 }
12649 typedef QtValidLicenseForCoreModule QtCoreModule;
12650
12651
12652
12653
12654
12655
12656 namespace std __attribute__ ((__visibility__ ("default"))) {
12657 class locale
12658 {
12659 public:
12660 typedef int category;
12661 class facet;
12662 class id;
12663 class _Impl;
12664 friend class facet;
12665 friend class _Impl;
12666 template<typename _Facet>
12667 friend bool
12668 has_facet(const locale&) throw();
12669 template<typename _Facet>
12670 friend const _Facet&
12671 use_facet(const locale&);
12672 template<typename _Cache>
12673 friend struct __use_cache;
12674 static const category none = 0;
12675 static const category ctype = 1L << 0;
12676 static const category numeric = 1L << 1;
12677 static const category collate = 1L << 2;
12678 static const category time = 1L << 3;
12679 static const category monetary = 1L << 4;
12680 static const category messages = 1L << 5;
12681 static const category all = (ctype | numeric | collate |
12682 time | monetary | messages);
12683 locale() throw();
12684 locale(const locale& __other) throw();
12685 explicit
12686 locale(const char* __s);
12687 locale(const locale& __base, const char* __s, category __cat);
12688 locale(const locale& __base, const locale& __add, category __cat);
12689 template<typename _Facet>
12690 locale(const locale& __other, _Facet* __f);
12691 ~locale() throw();
12692 const locale&
12693 operator=(const locale& __other) throw();
12694 template<typename _Facet>
12695 locale
12696 combine(const locale& __other) const;
12697 string
12698 name() const;
12699 bool
12700 operator==(const locale& __other) const throw();
12701 bool
12702 operator!=(const locale& __other) const throw()
12703 { return !(this->operator==(__other)); }
12704 template<typename _Char, typename _Traits, typename _Alloc>
12705 bool
12706 operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
12707 const basic_string<_Char, _Traits, _Alloc>& __s2) const;
12708 static locale
12709 global(const locale&);
12710 static const locale&
12711 classic();
12712 private:
12713 _Impl* _M_impl;
12714 static _Impl* _S_classic;
12715 static _Impl* _S_global;
12716 static const char* const* const _S_categories;
12717 enum { _S_categories_size = 6 + 6 };
12718 static __gthread_once_t _S_once;
12719 explicit
12720 locale(_Impl*) throw();
12721 static void
12722 _S_initialize();
12723 static void
12724 _S_initialize_once() throw();
12725 static category
12726 _S_normalize_category(category);
12727 void
12728 _M_coalesce(const locale& __base, const locale& __add, category __cat);
12729 };
12730 class locale::facet
12731 {
12732 private:
12733 friend class locale;
12734 friend class locale::_Impl;
12735 mutable _Atomic_word _M_refcount;
12736 static __c_locale _S_c_locale;
12737 static const char _S_c_name[2];
12738 static __gthread_once_t _S_once;
12739 static void
12740 _S_initialize_once();
12741 public:
12742 explicit
12743 facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
12744 { }
12745 virtual
12746 ~facet();
12747 static void
12748 _S_create_c_locale(__c_locale& __cloc, const char* __s,
12749 __c_locale __old = 0);
12750 static __c_locale
12751 _S_clone_c_locale(__c_locale& __cloc) throw();
12752 static void
12753 _S_destroy_c_locale(__c_locale& __cloc);
12754 static __c_locale
12755 _S_lc_ctype_c_locale(__c_locale __cloc, const char* __s);
12756 static __c_locale
12757 _S_get_c_locale();
12758 __attribute__ ((__const__)) static const char*
12759 _S_get_c_name() throw();
12760 private:
12761 void
12762 _M_add_reference() const throw()
12763 { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
12764 void
12765 _M_remove_reference() const throw()
12766 {
12767 if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
12768 {
12769 try
12770 { delete this; }
12771 catch(...)
12772 { }
12773 }
12774 }
12775 facet(const facet&);
12776 facet&
12777 operator=(const facet&);
12778 };
12779 class locale::id
12780 {
12781 private:
12782 friend class locale;
12783 friend class locale::_Impl;
12784 template<typename _Facet>
12785 friend const _Facet&
12786 use_facet(const locale&);
12787 template<typename _Facet>
12788 friend bool
12789 has_facet(const locale&) throw();
12790 mutable size_t _M_index;
12791 static _Atomic_word _S_refcount;
12792 void
12793 operator=(const id&);
12794 id(const id&);
12795 public:
12796 id() { }
12797 size_t
12798 _M_id() const throw();
12799 };
12800 class locale::_Impl
12801 {
12802 public:
12803 friend class locale;
12804 friend class locale::facet;
12805 template<typename _Facet>
12806 friend bool
12807 has_facet(const locale&) throw();
12808 template<typename _Facet>
12809 friend const _Facet&
12810 use_facet(const locale&);
12811 template<typename _Cache>
12812 friend struct __use_cache;
12813 private:
12814 _Atomic_word _M_refcount;
12815 const facet** _M_facets;
12816 size_t _M_facets_size;
12817 const facet** _M_caches;
12818 char** _M_names;
12819 static const locale::id* const _S_id_ctype[];
12820 static const locale::id* const _S_id_numeric[];
12821 static const locale::id* const _S_id_collate[];
12822 static const locale::id* const _S_id_time[];
12823 static const locale::id* const _S_id_monetary[];
12824 static const locale::id* const _S_id_messages[];
12825 static const locale::id* const* const _S_facet_categories[];
12826 void
12827 _M_add_reference() throw()
12828 { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
12829 void
12830 _M_remove_reference() throw()
12831 {
12832 if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
12833 {
12834 try
12835 { delete this; }
12836 catch(...)
12837 { }
12838 }
12839 }
12840 _Impl(const _Impl&, size_t);
12841 _Impl(const char*, size_t);
12842 _Impl(size_t) throw();
12843 ~_Impl() throw();
12844 _Impl(const _Impl&);
12845 void
12846 operator=(const _Impl&);
12847 bool
12848 _M_check_same_name()
12849 {
12850 bool __ret = true;
12851 if (_M_names[1])
12852 for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
12853 __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
12854 return __ret;
12855 }
12856 void
12857 _M_replace_categories(const _Impl*, category);
12858 void
12859 _M_replace_category(const _Impl*, const locale::id* const*);
12860 void
12861 _M_replace_facet(const _Impl*, const locale::id*);
12862 void
12863 _M_install_facet(const locale::id*, const facet*);
12864 template<typename _Facet>
12865 void
12866 _M_init_facet(_Facet* __facet)
12867 { _M_install_facet(&_Facet::id, __facet); }
12868 void
12869 _M_install_cache(const facet*, size_t);
12870 };
12871 template<typename _Facet>
12872 bool
12873 has_facet(const locale& __loc) throw();
12874 template<typename _Facet>
12875 const _Facet&
12876 use_facet(const locale& __loc);
12877 template<typename _CharT>
12878 class collate : public locale::facet
12879 {
12880 public:
12881 typedef _CharT char_type;
12882 typedef basic_string<_CharT> string_type;
12883 public:
12884 __c_locale _M_c_locale_collate;
12885 public:
12886 static locale::id id;
12887 explicit
12888 collate(size_t __refs = 0)
12889 : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
12890 { }
12891 explicit
12892 collate(__c_locale __cloc, size_t __refs = 0)
12893 : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
12894 { }
12895 int
12896 compare(const _CharT* __lo1, const _CharT* __hi1,
12897 const _CharT* __lo2, const _CharT* __hi2) const
12898 { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
12899 string_type
12900 transform(const _CharT* __lo, const _CharT* __hi) const
12901 { return this->do_transform(__lo, __hi); }
12902 long
12903 hash(const _CharT* __lo, const _CharT* __hi) const
12904 { return this->do_hash(__lo, __hi); }
12905 int
12906 _M_compare(const _CharT*, const _CharT*) const throw();
12907 size_t
12908 _M_transform(_CharT*, const _CharT*, size_t) const throw();
12909 public:
12910 virtual
12911 ~collate()
12912 { _S_destroy_c_locale(_M_c_locale_collate); }
12913 virtual int
12914 do_compare(const _CharT* __lo1, const _CharT* __hi1,
12915 const _CharT* __lo2, const _CharT* __hi2) const;
12916 virtual string_type
12917 do_transform(const _CharT* __lo, const _CharT* __hi) const;
12918 virtual long
12919 do_hash(const _CharT* __lo, const _CharT* __hi) const;
12920 };
12921 template<typename _CharT>
12922 locale::id collate<_CharT>::id;
12923 template<>
12924 int
12925 collate<char>::_M_compare(const char*, const char*) const throw();
12926 template<>
12927 size_t
12928 collate<char>::_M_transform(char*, const char*, size_t) const throw();
12929 template<>
12930 int
12931 collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const throw();
12932 template<>
12933 size_t
12934 collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const throw();
12935 template<typename _CharT>
12936 class collate_byname : public collate<_CharT>
12937 {
12938 public:
12939 typedef _CharT char_type;
12940 typedef basic_string<_CharT> string_type;
12941 explicit
12942 collate_byname(const char* __s, size_t __refs = 0)
12943 : collate<_CharT>(__refs)
12944 {
12945 if (__builtin_strcmp(__s, "C") != 0
12946 && __builtin_strcmp(__s, "POSIX") != 0)
12947 {
12948 this->_S_destroy_c_locale(this->_M_c_locale_collate);
12949 this->_S_create_c_locale(this->_M_c_locale_collate, __s);
12950 }
12951 }
12952 public:
12953 virtual
12954 ~collate_byname() { }
12955 };
12956 }
12957
12958 namespace std __attribute__ ((__visibility__ ("default"))) {
12959 template<typename _Facet>
12960 locale::
12961 locale(const locale& __other, _Facet* __f)
12962 {
12963 _M_impl = new _Impl(*__other._M_impl, 1);
12964 try
12965 { _M_impl->_M_install_facet(&_Facet::id, __f); }
12966 catch(...)
12967 {
12968 _M_impl->_M_remove_reference();
12969 throw;
12970 }
12971 delete [] _M_impl->_M_names[0];
12972 _M_impl->_M_names[0] = 0;
12973 }
12974 template<typename _Facet>
12975 locale
12976 locale::
12977 combine(const locale& __other) const
12978 {
12979 _Impl* __tmp = new _Impl(*_M_impl, 1);
12980 try
12981 {
12982 __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
12983 }
12984 catch(...)
12985 {
12986 __tmp->_M_remove_reference();
12987 throw;
12988 }
12989 return locale(__tmp);
12990 }
12991 template<typename _CharT, typename _Traits, typename _Alloc>
12992 bool
12993 locale::
12994 operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
12995 const basic_string<_CharT, _Traits, _Alloc>& __s2) const
12996 {
12997 typedef std::collate<_CharT> __collate_type;
12998 const __collate_type& __collate = use_facet<__collate_type>(*this);
12999 return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
13000 __s2.data(), __s2.data() + __s2.length()) < 0);
13001 }
13002 template<typename _Facet>
13003 bool
13004 has_facet(const locale& __loc) throw()
13005 {
13006 const size_t __i = _Facet::id._M_id();
13007 const locale::facet** __facets = __loc._M_impl->_M_facets;
13008 return (__i < __loc._M_impl->_M_facets_size
13009 && dynamic_cast<const _Facet*>(__facets[__i]));
13010 }
13011 template<typename _Facet>
13012 const _Facet&
13013 use_facet(const locale& __loc)
13014 {
13015 const size_t __i = _Facet::id._M_id();
13016 const locale::facet** __facets = __loc._M_impl->_M_facets;
13017 if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
13018 __throw_bad_cast();
13019 return dynamic_cast<const _Facet&>(*__facets[__i]);
13020 }
13021 template<typename _CharT>
13022 int
13023 collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const throw ()
13024 { return 0; }
13025 template<typename _CharT>
13026 size_t
13027 collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const throw ()
13028 { return 0; }
13029 template<typename _CharT>
13030 int
13031 collate<_CharT>::
13032 do_compare(const _CharT* __lo1, const _CharT* __hi1,
13033 const _CharT* __lo2, const _CharT* __hi2) const
13034 {
13035 const string_type __one(__lo1, __hi1);
13036 const string_type __two(__lo2, __hi2);
13037 const _CharT* __p = __one.c_str();
13038 const _CharT* __pend = __one.data() + __one.length();
13039 const _CharT* __q = __two.c_str();
13040 const _CharT* __qend = __two.data() + __two.length();
13041 for (;;)
13042 {
13043 const int __res = _M_compare(__p, __q);
13044 if (__res)
13045 return __res;
13046 __p += char_traits<_CharT>::length(__p);
13047 __q += char_traits<_CharT>::length(__q);
13048 if (__p == __pend && __q == __qend)
13049 return 0;
13050 else if (__p == __pend)
13051 return -1;
13052 else if (__q == __qend)
13053 return 1;
13054 __p++;
13055 __q++;
13056 }
13057 }
13058 template<typename _CharT>
13059 typename collate<_CharT>::string_type
13060 collate<_CharT>::
13061 do_transform(const _CharT* __lo, const _CharT* __hi) const
13062 {
13063 string_type __ret;
13064 const string_type __str(__lo, __hi);
13065 const _CharT* __p = __str.c_str();
13066 const _CharT* __pend = __str.data() + __str.length();
13067 size_t __len = (__hi - __lo) * 2;
13068 _CharT* __c = new _CharT[__len];
13069 try
13070 {
13071 for (;;)
13072 {
13073 size_t __res = _M_transform(__c, __p, __len);
13074 if (__res >= __len)
13075 {
13076 __len = __res + 1;
13077 delete [] __c, __c = 0;
13078 __c = new _CharT[__len];
13079 __res = _M_transform(__c, __p, __len);
13080 }
13081 __ret.append(__c, __res);
13082 __p += char_traits<_CharT>::length(__p);
13083 if (__p == __pend)
13084 break;
13085 __p++;
13086 __ret.push_back(_CharT());
13087 }
13088 }
13089 catch(...)
13090 {
13091 delete [] __c;
13092 throw;
13093 }
13094 delete [] __c;
13095 return __ret;
13096 }
13097 template<typename _CharT>
13098 long
13099 collate<_CharT>::
13100 do_hash(const _CharT* __lo, const _CharT* __hi) const
13101 {
13102 unsigned long __val = 0;
13103 for (; __lo < __hi; ++__lo)
13104 __val =
13105 *__lo + ((__val << 7)
13106 | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
13107 __digits - 7)));
13108 return static_cast<long>(__val);
13109 }
13110 extern template class collate<char>;
13111 extern template class collate_byname<char>;
13112 extern template
13113 const collate<char>&
13114 use_facet<collate<char> >(const locale&);
13115 extern template
13116 bool
13117 has_facet<collate<char> >(const locale&);
13118 extern template class collate<wchar_t>;
13119 extern template class collate_byname<wchar_t>;
13120 extern template
13121 const collate<wchar_t>&
13122 use_facet<collate<wchar_t> >(const locale&);
13123 extern template
13124 bool
13125 has_facet<collate<wchar_t> >(const locale&);
13126 }
13127 namespace std __attribute__ ((__visibility__ ("default"))) {
13128 enum _Ios_Fmtflags
13129 {
13130 _S_boolalpha = 1L << 0,
13131 _S_dec = 1L << 1,
13132 _S_fixed = 1L << 2,
13133 _S_hex = 1L << 3,
13134 _S_internal = 1L << 4,
13135 _S_left = 1L << 5,
13136 _S_oct = 1L << 6,
13137 _S_right = 1L << 7,
13138 _S_scientific = 1L << 8,
13139 _S_showbase = 1L << 9,
13140 _S_showpoint = 1L << 10,
13141 _S_showpos = 1L << 11,
13142 _S_skipws = 1L << 12,
13143 _S_unitbuf = 1L << 13,
13144 _S_uppercase = 1L << 14,
13145 _S_adjustfield = _S_left | _S_right | _S_internal,
13146 _S_basefield = _S_dec | _S_oct | _S_hex,
13147 _S_floatfield = _S_scientific | _S_fixed,
13148 _S_ios_fmtflags_end = 1L << 16
13149 };
13150 inline _Ios_Fmtflags
13151 operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
13152 { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
13153 inline _Ios_Fmtflags
13154 operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
13155 { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
13156 inline _Ios_Fmtflags
13157 operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
13158 { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
13159 inline _Ios_Fmtflags&
13160 operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
13161 { return __a = __a | __b; }
13162 inline _Ios_Fmtflags&
13163 operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
13164 { return __a = __a & __b; }
13165 inline _Ios_Fmtflags&
13166 operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
13167 { return __a = __a ^ __b; }
13168 inline _Ios_Fmtflags
13169 operator~(_Ios_Fmtflags __a)
13170 { return _Ios_Fmtflags(~static_cast<int>(__a)); }
13171 enum _Ios_Openmode
13172 {
13173 _S_app = 1L << 0,
13174 _S_ate = 1L << 1,
13175 _S_bin = 1L << 2,
13176 _S_in = 1L << 3,
13177 _S_out = 1L << 4,
13178 _S_trunc = 1L << 5,
13179 _S_ios_openmode_end = 1L << 16
13180 };
13181 inline _Ios_Openmode
13182 operator&(_Ios_Openmode __a, _Ios_Openmode __b)
13183 { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
13184 inline _Ios_Openmode
13185 operator|(_Ios_Openmode __a, _Ios_Openmode __b)
13186 { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
13187 inline _Ios_Openmode
13188 operator^(_Ios_Openmode __a, _Ios_Openmode __b)
13189 { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
13190 inline _Ios_Openmode&
13191 operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
13192 { return __a = __a | __b; }
13193 inline _Ios_Openmode&
13194 operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
13195 { return __a = __a & __b; }
13196 inline _Ios_Openmode&
13197 operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
13198 { return __a = __a ^ __b; }
13199 inline _Ios_Openmode
13200 operator~(_Ios_Openmode __a)
13201 { return _Ios_Openmode(~static_cast<int>(__a)); }
13202 enum _Ios_Iostate
13203 {
13204 _S_goodbit = 0,
13205 _S_badbit = 1L << 0,
13206 _S_eofbit = 1L << 1,
13207 _S_failbit = 1L << 2,
13208 _S_ios_iostate_end = 1L << 16
13209 };
13210 inline _Ios_Iostate
13211 operator&(_Ios_Iostate __a, _Ios_Iostate __b)
13212 { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
13213 inline _Ios_Iostate
13214 operator|(_Ios_Iostate __a, _Ios_Iostate __b)
13215 { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
13216 inline _Ios_Iostate
13217 operator^(_Ios_Iostate __a, _Ios_Iostate __b)
13218 { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
13219 inline _Ios_Iostate&
13220 operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
13221 { return __a = __a | __b; }
13222 inline _Ios_Iostate&
13223 operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
13224 { return __a = __a & __b; }
13225 inline _Ios_Iostate&
13226 operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
13227 { return __a = __a ^ __b; }
13228 inline _Ios_Iostate
13229 operator~(_Ios_Iostate __a)
13230 { return _Ios_Iostate(~static_cast<int>(__a)); }
13231 enum _Ios_Seekdir
13232 {
13233 _S_beg = 0,
13234 _S_cur = 1,
13235 _S_end = 2,
13236 _S_ios_seekdir_end = 1L << 16
13237 };
13238 class ios_base
13239 {
13240 public:
13241 class failure : public exception
13242 {
13243 public:
13244 explicit
13245 failure(const string& __str) throw();
13246 virtual
13247 ~failure() throw();
13248 virtual const char*
13249 what() const throw();
13250 private:
13251 string _M_msg;
13252 };
13253 typedef _Ios_Fmtflags fmtflags;
13254 static const fmtflags boolalpha = _S_boolalpha;
13255 static const fmtflags dec = _S_dec;
13256 static const fmtflags fixed = _S_fixed;
13257 static const fmtflags hex = _S_hex;
13258 static const fmtflags internal = _S_internal;
13259 static const fmtflags left = _S_left;
13260 static const fmtflags oct = _S_oct;
13261 static const fmtflags right = _S_right;
13262 static const fmtflags scientific = _S_scientific;
13263 static const fmtflags showbase = _S_showbase;
13264 static const fmtflags showpoint = _S_showpoint;
13265 static const fmtflags showpos = _S_showpos;
13266 static const fmtflags skipws = _S_skipws;
13267 static const fmtflags unitbuf = _S_unitbuf;
13268 static const fmtflags uppercase = _S_uppercase;
13269 static const fmtflags adjustfield = _S_adjustfield;
13270 static const fmtflags basefield = _S_basefield;
13271 static const fmtflags floatfield = _S_floatfield;
13272 typedef _Ios_Iostate iostate;
13273 static const iostate badbit = _S_badbit;
13274 static const iostate eofbit = _S_eofbit;
13275 static const iostate failbit = _S_failbit;
13276 static const iostate goodbit = _S_goodbit;
13277 typedef _Ios_Openmode openmode;
13278 static const openmode app = _S_app;
13279 static const openmode ate = _S_ate;
13280 static const openmode binary = _S_bin;
13281 static const openmode in = _S_in;
13282 static const openmode out = _S_out;
13283 static const openmode trunc = _S_trunc;
13284 typedef _Ios_Seekdir seekdir;
13285 static const seekdir beg = _S_beg;
13286 static const seekdir cur = _S_cur;
13287 static const seekdir end = _S_end;
13288 typedef int io_state;
13289 typedef int open_mode;
13290 typedef int seek_dir;
13291 typedef std::streampos streampos;
13292 typedef std::streamoff streamoff;
13293 enum event
13294 {
13295 erase_event,
13296 imbue_event,
13297 copyfmt_event
13298 };
13299 typedef void (*event_callback) (event, ios_base&, int);
13300 void
13301 register_callback(event_callback __fn, int __index);
13302 public:
13303 streamsize _M_precision;
13304 streamsize _M_width;
13305 fmtflags _M_flags;
13306 iostate _M_exception;
13307 iostate _M_streambuf_state;
13308 struct _Callback_list
13309 {
13310 _Callback_list* _M_next;
13311 ios_base::event_callback _M_fn;
13312 int _M_index;
13313 _Atomic_word _M_refcount;
13314 _Callback_list(ios_base::event_callback __fn, int __index,
13315 _Callback_list* __cb)
13316 : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
13317 void
13318 _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
13319 int
13320 _M_remove_reference()
13321 { return __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); }
13322 };
13323 _Callback_list* _M_callbacks;
13324 void
13325 _M_call_callbacks(event __ev) throw();
13326 void
13327 _M_dispose_callbacks(void) throw();
13328 struct _Words
13329 {
13330 void* _M_pword;
13331 long _M_iword;
13332 _Words() : _M_pword(0), _M_iword(0) { }
13333 };
13334 _Words _M_word_zero;
13335 enum { _S_local_word_size = 8 };
13336 _Words _M_local_word[_S_local_word_size];
13337 int _M_word_size;
13338 _Words* _M_word;
13339 _Words&
13340 _M_grow_words(int __index, bool __iword);
13341 locale _M_ios_locale;
13342 void
13343 _M_init() throw();
13344 public:
13345 class Init
13346 {
13347 friend class ios_base;
13348 public:
13349 Init();
13350 ~Init();
13351 private:
13352 static _Atomic_word _S_refcount;
13353 static bool _S_synced_with_stdio;
13354 };
13355 fmtflags
13356 flags() const
13357 { return _M_flags; }
13358 fmtflags
13359 flags(fmtflags __fmtfl)
13360 {
13361 fmtflags __old = _M_flags;
13362 _M_flags = __fmtfl;
13363 return __old;
13364 }
13365 fmtflags
13366 setf(fmtflags __fmtfl)
13367 {
13368 fmtflags __old = _M_flags;
13369 _M_flags |= __fmtfl;
13370 return __old;
13371 }
13372 fmtflags
13373 setf(fmtflags __fmtfl, fmtflags __mask)
13374 {
13375 fmtflags __old = _M_flags;
13376 _M_flags &= ~__mask;
13377 _M_flags |= (__fmtfl & __mask);
13378 return __old;
13379 }
13380 void
13381 unsetf(fmtflags __mask)
13382 { _M_flags &= ~__mask; }
13383 streamsize
13384 precision() const
13385 { return _M_precision; }
13386 streamsize
13387 precision(streamsize __prec)
13388 {
13389 streamsize __old = _M_precision;
13390 _M_precision = __prec;
13391 return __old;
13392 }
13393 streamsize
13394 width() const
13395 { return _M_width; }
13396 streamsize
13397 width(streamsize __wide)
13398 {
13399 streamsize __old = _M_width;
13400 _M_width = __wide;
13401 return __old;
13402 }
13403 static bool
13404 sync_with_stdio(bool __sync = true);
13405 locale
13406 imbue(const locale& __loc) throw();
13407 locale
13408 getloc() const
13409 { return _M_ios_locale; }
13410 const locale&
13411 _M_getloc() const
13412 { return _M_ios_locale; }
13413 static int
13414 xalloc() throw();
13415 long&
13416 iword(int __ix)
13417 {
13418 _Words& __word = (__ix < _M_word_size)
13419 ? _M_word[__ix] : _M_grow_words(__ix, true);
13420 return __word._M_iword;
13421 }
13422 void*&
13423 pword(int __ix)
13424 {
13425 _Words& __word = (__ix < _M_word_size)
13426 ? _M_word[__ix] : _M_grow_words(__ix, false);
13427 return __word._M_pword;
13428 }
13429 virtual ~ios_base();
13430 public:
13431 ios_base() throw ();
13432 private:
13433 ios_base(const ios_base&);
13434 ios_base&
13435 operator=(const ios_base&);
13436 };
13437 inline ios_base&
13438 boolalpha(ios_base& __base)
13439 {
13440 __base.setf(ios_base::boolalpha);
13441 return __base;
13442 }
13443 inline ios_base&
13444 noboolalpha(ios_base& __base)
13445 {
13446 __base.unsetf(ios_base::boolalpha);
13447 return __base;
13448 }
13449 inline ios_base&
13450 showbase(ios_base& __base)
13451 {
13452 __base.setf(ios_base::showbase);
13453 return __base;
13454 }
13455 inline ios_base&
13456 noshowbase(ios_base& __base)
13457 {
13458 __base.unsetf(ios_base::showbase);
13459 return __base;
13460 }
13461 inline ios_base&
13462 showpoint(ios_base& __base)
13463 {
13464 __base.setf(ios_base::showpoint);
13465 return __base;
13466 }
13467 inline ios_base&
13468 noshowpoint(ios_base& __base)
13469 {
13470 __base.unsetf(ios_base::showpoint);
13471 return __base;
13472 }
13473 inline ios_base&
13474 showpos(ios_base& __base)
13475 {
13476 __base.setf(ios_base::showpos);
13477 return __base;
13478 }
13479 inline ios_base&
13480 noshowpos(ios_base& __base)
13481 {
13482 __base.unsetf(ios_base::showpos);
13483 return __base;
13484 }
13485 inline ios_base&
13486 skipws(ios_base& __base)
13487 {
13488 __base.setf(ios_base::skipws);
13489 return __base;
13490 }
13491 inline ios_base&
13492 noskipws(ios_base& __base)
13493 {
13494 __base.unsetf(ios_base::skipws);
13495 return __base;
13496 }
13497 inline ios_base&
13498 uppercase(ios_base& __base)
13499 {
13500 __base.setf(ios_base::uppercase);
13501 return __base;
13502 }
13503 inline ios_base&
13504 nouppercase(ios_base& __base)
13505 {
13506 __base.unsetf(ios_base::uppercase);
13507 return __base;
13508 }
13509 inline ios_base&
13510 unitbuf(ios_base& __base)
13511 {
13512 __base.setf(ios_base::unitbuf);
13513 return __base;
13514 }
13515 inline ios_base&
13516 nounitbuf(ios_base& __base)
13517 {
13518 __base.unsetf(ios_base::unitbuf);
13519 return __base;
13520 }
13521 inline ios_base&
13522 internal(ios_base& __base)
13523 {
13524 __base.setf(ios_base::internal, ios_base::adjustfield);
13525 return __base;
13526 }
13527 inline ios_base&
13528 left(ios_base& __base)
13529 {
13530 __base.setf(ios_base::left, ios_base::adjustfield);
13531 return __base;
13532 }
13533 inline ios_base&
13534 right(ios_base& __base)
13535 {
13536 __base.setf(ios_base::right, ios_base::adjustfield);
13537 return __base;
13538 }
13539 inline ios_base&
13540 dec(ios_base& __base)
13541 {
13542 __base.setf(ios_base::dec, ios_base::basefield);
13543 return __base;
13544 }
13545 inline ios_base&
13546 hex(ios_base& __base)
13547 {
13548 __base.setf(ios_base::hex, ios_base::basefield);
13549 return __base;
13550 }
13551 inline ios_base&
13552 oct(ios_base& __base)
13553 {
13554 __base.setf(ios_base::oct, ios_base::basefield);
13555 return __base;
13556 }
13557 inline ios_base&
13558 fixed(ios_base& __base)
13559 {
13560 __base.setf(ios_base::fixed, ios_base::floatfield);
13561 return __base;
13562 }
13563 inline ios_base&
13564 scientific(ios_base& __base)
13565 {
13566 __base.setf(ios_base::scientific, ios_base::floatfield);
13567 return __base;
13568 }
13569 }
13570
13571 namespace std __attribute__ ((__visibility__ ("default"))) {
13572 template<typename _CharT, typename _Traits>
13573 streamsize
13574 __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
13575 basic_streambuf<_CharT, _Traits>*, bool&);
13576 template<typename _CharT, typename _Traits>
13577 class basic_streambuf
13578 {
13579 public:
13580 typedef _CharT char_type;
13581 typedef _Traits traits_type;
13582 typedef typename traits_type::int_type int_type;
13583 typedef typename traits_type::pos_type pos_type;
13584 typedef typename traits_type::off_type off_type;
13585 typedef basic_streambuf<char_type, traits_type> __streambuf_type;
13586 friend class basic_ios<char_type, traits_type>;
13587 friend class basic_istream<char_type, traits_type>;
13588 friend class basic_ostream<char_type, traits_type>;
13589 friend class istreambuf_iterator<char_type, traits_type>;
13590 friend class ostreambuf_iterator<char_type, traits_type>;
13591 friend streamsize
13592 __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*, bool&);
13593 template<bool _IsMove, typename _CharT2>
13594 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
13595 _CharT2*>::__type
13596 __copy_move_a2(istreambuf_iterator<_CharT2>,
13597 istreambuf_iterator<_CharT2>, _CharT2*);
13598 template<typename _CharT2>
13599 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
13600 istreambuf_iterator<_CharT2> >::__type
13601 find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
13602 const _CharT2&);
13603 template<typename _CharT2, typename _Traits2>
13604 friend basic_istream<_CharT2, _Traits2>&
13605 operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
13606 template<typename _CharT2, typename _Traits2, typename _Alloc>
13607 friend basic_istream<_CharT2, _Traits2>&
13608 operator>>(basic_istream<_CharT2, _Traits2>&,
13609 basic_string<_CharT2, _Traits2, _Alloc>&);
13610 template<typename _CharT2, typename _Traits2, typename _Alloc>
13611 friend basic_istream<_CharT2, _Traits2>&
13612 getline(basic_istream<_CharT2, _Traits2>&,
13613 basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
13614 public:
13615 char_type* _M_in_beg;
13616 char_type* _M_in_cur;
13617 char_type* _M_in_end;
13618 char_type* _M_out_beg;
13619 char_type* _M_out_cur;
13620 char_type* _M_out_end;
13621 locale _M_buf_locale;
13622 public:
13623 virtual
13624 ~basic_streambuf()
13625 { }
13626 locale
13627 pubimbue(const locale &__loc)
13628 {
13629 locale __tmp(this->getloc());
13630 this->imbue(__loc);
13631 _M_buf_locale = __loc;
13632 return __tmp;
13633 }
13634 locale
13635 getloc() const
13636 { return _M_buf_locale; }
13637 __streambuf_type*
13638 pubsetbuf(char_type* __s, streamsize __n)
13639 { return this->setbuf(__s, __n); }
13640 pos_type
13641 pubseekoff(off_type __off, ios_base::seekdir __way,
13642 ios_base::openmode __mode = ios_base::in | ios_base::out)
13643 { return this->seekoff(__off, __way, __mode); }
13644 pos_type
13645 pubseekpos(pos_type __sp,
13646 ios_base::openmode __mode = ios_base::in | ios_base::out)
13647 { return this->seekpos(__sp, __mode); }
13648 int
13649 pubsync() { return this->sync(); }
13650 streamsize
13651 in_avail()
13652 {
13653 const streamsize __ret = this->egptr() - this->gptr();
13654 return __ret ? __ret : this->showmanyc();
13655 }
13656 int_type
13657 snextc()
13658 {
13659 int_type __ret = traits_type::eof();
13660 if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
13661 __ret), true))
13662 __ret = this->sgetc();
13663 return __ret;
13664 }
13665 int_type
13666 sbumpc()
13667 {
13668 int_type __ret;
13669 if (__builtin_expect(this->gptr() < this->egptr(), true))
13670 {
13671 __ret = traits_type::to_int_type(*this->gptr());
13672 this->gbump(1);
13673 }
13674 else
13675 __ret = this->uflow();
13676 return __ret;
13677 }
13678 int_type
13679 sgetc()
13680 {
13681 int_type __ret;
13682 if (__builtin_expect(this->gptr() < this->egptr(), true))
13683 __ret = traits_type::to_int_type(*this->gptr());
13684 else
13685 __ret = this->underflow();
13686 return __ret;
13687 }
13688 streamsize
13689 sgetn(char_type* __s, streamsize __n)
13690 { return this->xsgetn(__s, __n); }
13691 int_type
13692 sputbackc(char_type __c)
13693 {
13694 int_type __ret;
13695 const bool __testpos = this->eback() < this->gptr();
13696 if (__builtin_expect(!__testpos ||
13697 !traits_type::eq(__c, this->gptr()[-1]), false))
13698 __ret = this->pbackfail(traits_type::to_int_type(__c));
13699 else
13700 {
13701 this->gbump(-1);
13702 __ret = traits_type::to_int_type(*this->gptr());
13703 }
13704 return __ret;
13705 }
13706 int_type
13707 sungetc()
13708 {
13709 int_type __ret;
13710 if (__builtin_expect(this->eback() < this->gptr(), true))
13711 {
13712 this->gbump(-1);
13713 __ret = traits_type::to_int_type(*this->gptr());
13714 }
13715 else
13716 __ret = this->pbackfail();
13717 return __ret;
13718 }
13719 int_type
13720 sputc(char_type __c)
13721 {
13722 int_type __ret;
13723 if (__builtin_expect(this->pptr() < this->epptr(), true))
13724 {
13725 *this->pptr() = __c;
13726 this->pbump(1);
13727 __ret = traits_type::to_int_type(__c);
13728 }
13729 else
13730 __ret = this->overflow(traits_type::to_int_type(__c));
13731 return __ret;
13732 }
13733 streamsize
13734 sputn(const char_type* __s, streamsize __n)
13735 { return this->xsputn(__s, __n); }
13736 public:
13737 basic_streambuf()
13738 : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
13739 _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
13740 _M_buf_locale(locale())
13741 { }
13742 char_type*
13743 eback() const { return _M_in_beg; }
13744 char_type*
13745 gptr() const { return _M_in_cur; }
13746 char_type*
13747 egptr() const { return _M_in_end; }
13748 void
13749 gbump(int __n) { _M_in_cur += __n; }
13750 void
13751 setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
13752 {
13753 _M_in_beg = __gbeg;
13754 _M_in_cur = __gnext;
13755 _M_in_end = __gend;
13756 }
13757 char_type*
13758 pbase() const { return _M_out_beg; }
13759 char_type*
13760 pptr() const { return _M_out_cur; }
13761 char_type*
13762 epptr() const { return _M_out_end; }
13763 void
13764 pbump(int __n) { _M_out_cur += __n; }
13765 void
13766 setp(char_type* __pbeg, char_type* __pend)
13767 {
13768 _M_out_beg = _M_out_cur = __pbeg;
13769 _M_out_end = __pend;
13770 }
13771 virtual void
13772 imbue(const locale&)
13773 { }
13774 virtual basic_streambuf<char_type,_Traits>*
13775 setbuf(char_type*, streamsize)
13776 { return this; }
13777 virtual pos_type
13778 seekoff(off_type, ios_base::seekdir,
13779 ios_base::openmode = ios_base::in | ios_base::out)
13780 { return pos_type(off_type(-1)); }
13781 virtual pos_type
13782 seekpos(pos_type,
13783 ios_base::openmode = ios_base::in | ios_base::out)
13784 { return pos_type(off_type(-1)); }
13785 virtual int
13786 sync() { return 0; }
13787 virtual streamsize
13788 showmanyc() { return 0; }
13789 virtual streamsize
13790 xsgetn(char_type* __s, streamsize __n);
13791 virtual int_type
13792 underflow()
13793 { return traits_type::eof(); }
13794 virtual int_type
13795 uflow()
13796 {
13797 int_type __ret = traits_type::eof();
13798 const bool __testeof = traits_type::eq_int_type(this->underflow(),
13799 __ret);
13800 if (!__testeof)
13801 {
13802 __ret = traits_type::to_int_type(*this->gptr());
13803 this->gbump(1);
13804 }
13805 return __ret;
13806 }
13807 virtual int_type
13808 pbackfail(int_type = traits_type::eof())
13809 { return traits_type::eof(); }
13810 virtual streamsize
13811 xsputn(const char_type* __s, streamsize __n);
13812 virtual int_type
13813 overflow(int_type = traits_type::eof())
13814 { return traits_type::eof(); }
13815 public:
13816 void
13817 stossc()
13818 {
13819 if (this->gptr() < this->egptr())
13820 this->gbump(1);
13821 else
13822 this->uflow();
13823 }
13824 private:
13825 basic_streambuf(const __streambuf_type& __sb)
13826 : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
13827 _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
13828 _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
13829 _M_buf_locale(__sb._M_buf_locale)
13830 { }
13831 __streambuf_type&
13832 operator=(const __streambuf_type&) { return *this; };
13833 };
13834 template<>
13835 streamsize
13836 __copy_streambufs_eof(basic_streambuf<char>* __sbin,
13837 basic_streambuf<char>* __sbout, bool& __ineof);
13838 template<>
13839 streamsize
13840 __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
13841 basic_streambuf<wchar_t>* __sbout, bool& __ineof);
13842 }
13843
13844 namespace std __attribute__ ((__visibility__ ("default"))) {
13845 template<typename _CharT, typename _Traits>
13846 streamsize
13847 basic_streambuf<_CharT, _Traits>::
13848 xsgetn(char_type* __s, streamsize __n)
13849 {
13850 streamsize __ret = 0;
13851 while (__ret < __n)
13852 {
13853 const streamsize __buf_len = this->egptr() - this->gptr();
13854 if (__buf_len)
13855 {
13856 const streamsize __remaining = __n - __ret;
13857 const streamsize __len = std::min(__buf_len, __remaining);
13858 traits_type::copy(__s, this->gptr(), __len);
13859 __ret += __len;
13860 __s += __len;
13861 this->gbump(__len);
13862 }
13863 if (__ret < __n)
13864 {
13865 const int_type __c = this->uflow();
13866 if (!traits_type::eq_int_type(__c, traits_type::eof()))
13867 {
13868 traits_type::assign(*__s++, traits_type::to_char_type(__c));
13869 ++__ret;
13870 }
13871 else
13872 break;
13873 }
13874 }
13875 return __ret;
13876 }
13877 template<typename _CharT, typename _Traits>
13878 streamsize
13879 basic_streambuf<_CharT, _Traits>::
13880 xsputn(const char_type* __s, streamsize __n)
13881 {
13882 streamsize __ret = 0;
13883 while (__ret < __n)
13884 {
13885 const streamsize __buf_len = this->epptr() - this->pptr();
13886 if (__buf_len)
13887 {
13888 const streamsize __remaining = __n - __ret;
13889 const streamsize __len = std::min(__buf_len, __remaining);
13890 traits_type::copy(this->pptr(), __s, __len);
13891 __ret += __len;
13892 __s += __len;
13893 this->pbump(__len);
13894 }
13895 if (__ret < __n)
13896 {
13897 int_type __c = this->overflow(traits_type::to_int_type(*__s));
13898 if (!traits_type::eq_int_type(__c, traits_type::eof()))
13899 {
13900 ++__ret;
13901 ++__s;
13902 }
13903 else
13904 break;
13905 }
13906 }
13907 return __ret;
13908 }
13909 template<typename _CharT, typename _Traits>
13910 streamsize
13911 __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
13912 basic_streambuf<_CharT, _Traits>* __sbout,
13913 bool& __ineof)
13914 {
13915 streamsize __ret = 0;
13916 __ineof = true;
13917 typename _Traits::int_type __c = __sbin->sgetc();
13918 while (!_Traits::eq_int_type(__c, _Traits::eof()))
13919 {
13920 __c = __sbout->sputc(_Traits::to_char_type(__c));
13921 if (_Traits::eq_int_type(__c, _Traits::eof()))
13922 {
13923 __ineof = false;
13924 break;
13925 }
13926 ++__ret;
13927 __c = __sbin->snextc();
13928 }
13929 return __ret;
13930 }
13931 template<typename _CharT, typename _Traits>
13932 inline streamsize
13933 __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
13934 basic_streambuf<_CharT, _Traits>* __sbout)
13935 {
13936 bool __ineof;
13937 return __copy_streambufs_eof(__sbin, __sbout, __ineof);
13938 }
13939 extern template class basic_streambuf<char>;
13940 extern template
13941 streamsize
13942 __copy_streambufs(basic_streambuf<char>*,
13943 basic_streambuf<char>*);
13944 extern template
13945 streamsize
13946 __copy_streambufs_eof(basic_streambuf<char>*,
13947 basic_streambuf<char>*, bool&);
13948 extern template class basic_streambuf<wchar_t>;
13949 extern template
13950 streamsize
13951 __copy_streambufs(basic_streambuf<wchar_t>*,
13952 basic_streambuf<wchar_t>*);
13953 extern template
13954 streamsize
13955 __copy_streambufs_eof(basic_streambuf<wchar_t>*,
13956 basic_streambuf<wchar_t>*, bool&);
13957 }
13958
13959
13960
13961 typedef unsigned long int wctype_t;
13962 enum
13963 {
13964 __ISwupper = 0,
13965 __ISwlower = 1,
13966 __ISwalpha = 2,
13967 __ISwdigit = 3,
13968 __ISwxdigit = 4,
13969 __ISwspace = 5,
13970 __ISwprint = 6,
13971 __ISwgraph = 7,
13972 __ISwblank = 8,
13973 __ISwcntrl = 9,
13974 __ISwpunct = 10,
13975 __ISwalnum = 11,
13976 _ISwupper = ((__ISwupper) < 8 ? (int) ((1UL << (__ISwupper)) << 24) : ((__ISwupper) < 16 ? (int) ((1UL << (__ISwupper)) << 8) : ((__ISwupper) < 24 ? (int) ((1UL << (__ISwupper)) >> 8) : (int) ((1UL << (__ISwupper)) >> 24)))),
13977 _ISwlower = ((__ISwlower) < 8 ? (int) ((1UL << (__ISwlower)) << 24) : ((__ISwlower) < 16 ? (int) ((1UL << (__ISwlower)) << 8) : ((__ISwlower) < 24 ? (int) ((1UL << (__ISwlower)) >> 8) : (int) ((1UL << (__ISwlower)) >> 24)))),
13978 _ISwalpha = ((__ISwalpha) < 8 ? (int) ((1UL << (__ISwalpha)) << 24) : ((__ISwalpha) < 16 ? (int) ((1UL << (__ISwalpha)) << 8) : ((__ISwalpha) < 24 ? (int) ((1UL << (__ISwalpha)) >> 8) : (int) ((1UL << (__ISwalpha)) >> 24)))),
13979 _ISwdigit = ((__ISwdigit) < 8 ? (int) ((1UL << (__ISwdigit)) << 24) : ((__ISwdigit) < 16 ? (int) ((1UL << (__ISwdigit)) << 8) : ((__ISwdigit) < 24 ? (int) ((1UL << (__ISwdigit)) >> 8) : (int) ((1UL << (__ISwdigit)) >> 24)))),
13980 _ISwxdigit = ((__ISwxdigit) < 8 ? (int) ((1UL << (__ISwxdigit)) << 24) : ((__ISwxdigit) < 16 ? (int) ((1UL << (__ISwxdigit)) << 8) : ((__ISwxdigit) < 24 ? (int) ((1UL << (__ISwxdigit)) >> 8) : (int) ((1UL << (__ISwxdigit)) >> 24)))),
13981 _ISwspace = ((__ISwspace) < 8 ? (int) ((1UL << (__ISwspace)) << 24) : ((__ISwspace) < 16 ? (int) ((1UL << (__ISwspace)) << 8) : ((__ISwspace) < 24 ? (int) ((1UL << (__ISwspace)) >> 8) : (int) ((1UL << (__ISwspace)) >> 24)))),
13982 _ISwprint = ((__ISwprint) < 8 ? (int) ((1UL << (__ISwprint)) << 24) : ((__ISwprint) < 16 ? (int) ((1UL << (__ISwprint)) << 8) : ((__ISwprint) < 24 ? (int) ((1UL << (__ISwprint)) >> 8) : (int) ((1UL << (__ISwprint)) >> 24)))),
13983 _ISwgraph = ((__ISwgraph) < 8 ? (int) ((1UL << (__ISwgraph)) << 24) : ((__ISwgraph) < 16 ? (int) ((1UL << (__ISwgraph)) << 8) : ((__ISwgraph) < 24 ? (int) ((1UL << (__ISwgraph)) >> 8) : (int) ((1UL << (__ISwgraph)) >> 24)))),
13984 _ISwblank = ((__ISwblank) < 8 ? (int) ((1UL << (__ISwblank)) << 24) : ((__ISwblank) < 16 ? (int) ((1UL << (__ISwblank)) << 8) : ((__ISwblank) < 24 ? (int) ((1UL << (__ISwblank)) >> 8) : (int) ((1UL << (__ISwblank)) >> 24)))),
13985 _ISwcntrl = ((__ISwcntrl) < 8 ? (int) ((1UL << (__ISwcntrl)) << 24) : ((__ISwcntrl) < 16 ? (int) ((1UL << (__ISwcntrl)) << 8) : ((__ISwcntrl) < 24 ? (int) ((1UL << (__ISwcntrl)) >> 8) : (int) ((1UL << (__ISwcntrl)) >> 24)))),
13986 _ISwpunct = ((__ISwpunct) < 8 ? (int) ((1UL << (__ISwpunct)) << 24) : ((__ISwpunct) < 16 ? (int) ((1UL << (__ISwpunct)) << 8) : ((__ISwpunct) < 24 ? (int) ((1UL << (__ISwpunct)) >> 8) : (int) ((1UL << (__ISwpunct)) >> 24)))),
13987 _ISwalnum = ((__ISwalnum) < 8 ? (int) ((1UL << (__ISwalnum)) << 24) : ((__ISwalnum) < 16 ? (int) ((1UL << (__ISwalnum)) << 8) : ((__ISwalnum) < 24 ? (int) ((1UL << (__ISwalnum)) >> 8) : (int) ((1UL << (__ISwalnum)) >> 24))))
13988 };
13989 extern "C" {
13990 extern int iswalnum (wint_t __wc) throw ();
13991 extern int iswalpha (wint_t __wc) throw ();
13992 extern int iswcntrl (wint_t __wc) throw ();
13993 extern int iswdigit (wint_t __wc) throw ();
13994 extern int iswgraph (wint_t __wc) throw ();
13995 extern int iswlower (wint_t __wc) throw ();
13996 extern int iswprint (wint_t __wc) throw ();
13997 extern int iswpunct (wint_t __wc) throw ();
13998 extern int iswspace (wint_t __wc) throw ();
13999 extern int iswupper (wint_t __wc) throw ();
14000 extern int iswxdigit (wint_t __wc) throw ();
14001 extern int iswblank (wint_t __wc) throw ();
14002 extern wctype_t wctype (__const char *__property) throw ();
14003 extern int iswctype (wint_t __wc, wctype_t __desc) throw ();
14004 typedef __const __int32_t *wctrans_t;
14005 extern wint_t towlower (wint_t __wc) throw ();
14006 extern wint_t towupper (wint_t __wc) throw ();
14007 }
14008 extern "C" {
14009 extern wctrans_t wctrans (__const char *__property) throw ();
14010 extern wint_t towctrans (wint_t __wc, wctrans_t __desc) throw ();
14011 extern int iswalnum_l (wint_t __wc, __locale_t __locale) throw ();
14012 extern int iswalpha_l (wint_t __wc, __locale_t __locale) throw ();
14013 extern int iswcntrl_l (wint_t __wc, __locale_t __locale) throw ();
14014 extern int iswdigit_l (wint_t __wc, __locale_t __locale) throw ();
14015 extern int iswgraph_l (wint_t __wc, __locale_t __locale) throw ();
14016 extern int iswlower_l (wint_t __wc, __locale_t __locale) throw ();
14017 extern int iswprint_l (wint_t __wc, __locale_t __locale) throw ();
14018 extern int iswpunct_l (wint_t __wc, __locale_t __locale) throw ();
14019 extern int iswspace_l (wint_t __wc, __locale_t __locale) throw ();
14020 extern int iswupper_l (wint_t __wc, __locale_t __locale) throw ();
14021 extern int iswxdigit_l (wint_t __wc, __locale_t __locale) throw ();
14022 extern int iswblank_l (wint_t __wc, __locale_t __locale) throw ();
14023 extern wctype_t wctype_l (__const char *__property, __locale_t __locale)
14024 throw ();
14025 extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
14026 throw ();
14027 extern wint_t towlower_l (wint_t __wc, __locale_t __locale) throw ();
14028 extern wint_t towupper_l (wint_t __wc, __locale_t __locale) throw ();
14029 extern wctrans_t wctrans_l (__const char *__property, __locale_t __locale)
14030 throw ();
14031 extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc,
14032 __locale_t __locale) throw ();
14033 }
14034 namespace std __attribute__ ((__visibility__ ("default"))) {
14035 using ::wctrans_t;
14036 using ::wctype_t;
14037 using ::wint_t;
14038 using ::iswalnum;
14039 using ::iswalpha;
14040 using ::iswblank;
14041 using ::iswcntrl;
14042 using ::iswctype;
14043 using ::iswdigit;
14044 using ::iswgraph;
14045 using ::iswlower;
14046 using ::iswprint;
14047 using ::iswpunct;
14048 using ::iswspace;
14049 using ::iswupper;
14050 using ::iswxdigit;
14051 using ::towctrans;
14052 using ::towlower;
14053 using ::towupper;
14054 using ::wctrans;
14055 using ::wctype;
14056 }
14057
14058 namespace std __attribute__ ((__visibility__ ("default"))) {
14059 struct ctype_base
14060 {
14061 typedef const int* __to_type;
14062 typedef unsigned short mask;
14063 static const mask upper = _ISupper;
14064 static const mask lower = _ISlower;
14065 static const mask alpha = _ISalpha;
14066 static const mask digit = _ISdigit;
14067 static const mask xdigit = _ISxdigit;
14068 static const mask space = _ISspace;
14069 static const mask print = _ISprint;
14070 static const mask graph = _ISalpha | _ISdigit | _ISpunct;
14071 static const mask cntrl = _IScntrl;
14072 static const mask punct = _ISpunct;
14073 static const mask alnum = _ISalpha | _ISdigit;
14074 };
14075 }
14076
14077 namespace std __attribute__ ((__visibility__ ("default"))) {
14078 template<typename _CharT, typename _Traits>
14079 class istreambuf_iterator
14080 : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
14081 _CharT*, _CharT&>
14082 {
14083 public:
14084 typedef _CharT char_type;
14085 typedef _Traits traits_type;
14086 typedef typename _Traits::int_type int_type;
14087 typedef basic_streambuf<_CharT, _Traits> streambuf_type;
14088 typedef basic_istream<_CharT, _Traits> istream_type;
14089 template<typename _CharT2>
14090 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
14091 ostreambuf_iterator<_CharT2> >::__type
14092 copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
14093 ostreambuf_iterator<_CharT2>);
14094 template<bool _IsMove, typename _CharT2>
14095 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
14096 _CharT2*>::__type
14097 __copy_move_a2(istreambuf_iterator<_CharT2>,
14098 istreambuf_iterator<_CharT2>, _CharT2*);
14099 template<typename _CharT2>
14100 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
14101 istreambuf_iterator<_CharT2> >::__type
14102 find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
14103 const _CharT2&);
14104 private:
14105 mutable streambuf_type* _M_sbuf;
14106 mutable int_type _M_c;
14107 public:
14108 istreambuf_iterator() throw()
14109 : _M_sbuf(0), _M_c(traits_type::eof()) { }
14110 istreambuf_iterator(istream_type& __s) throw()
14111 : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
14112 istreambuf_iterator(streambuf_type* __s) throw()
14113 : _M_sbuf(__s), _M_c(traits_type::eof()) { }
14114 char_type
14115 operator*() const
14116 {
14117 return traits_type::to_char_type(_M_get());
14118 }
14119 istreambuf_iterator&
14120 operator++()
14121 {
14122 ;
14123 if (_M_sbuf)
14124 {
14125 _M_sbuf->sbumpc();
14126 _M_c = traits_type::eof();
14127 }
14128 return *this;
14129 }
14130 istreambuf_iterator
14131 operator++(int)
14132 {
14133 ;
14134 istreambuf_iterator __old = *this;
14135 if (_M_sbuf)
14136 {
14137 __old._M_c = _M_sbuf->sbumpc();
14138 _M_c = traits_type::eof();
14139 }
14140 return __old;
14141 }
14142 bool
14143 equal(const istreambuf_iterator& __b) const
14144 { return _M_at_eof() == __b._M_at_eof(); }
14145 private:
14146 int_type
14147 _M_get() const
14148 {
14149 const int_type __eof = traits_type::eof();
14150 int_type __ret = __eof;
14151 if (_M_sbuf)
14152 {
14153 if (!traits_type::eq_int_type(_M_c, __eof))
14154 __ret = _M_c;
14155 else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
14156 __eof))
14157 _M_c = __ret;
14158 else
14159 _M_sbuf = 0;
14160 }
14161 return __ret;
14162 }
14163 bool
14164 _M_at_eof() const
14165 {
14166 const int_type __eof = traits_type::eof();
14167 return traits_type::eq_int_type(_M_get(), __eof);
14168 }
14169 };
14170 template<typename _CharT, typename _Traits>
14171 inline bool
14172 operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
14173 const istreambuf_iterator<_CharT, _Traits>& __b)
14174 { return __a.equal(__b); }
14175 template<typename _CharT, typename _Traits>
14176 inline bool
14177 operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
14178 const istreambuf_iterator<_CharT, _Traits>& __b)
14179 { return !__a.equal(__b); }
14180 template<typename _CharT, typename _Traits>
14181 class ostreambuf_iterator
14182 : public iterator<output_iterator_tag, void, void, void, void>
14183 {
14184 public:
14185 typedef _CharT char_type;
14186 typedef _Traits traits_type;
14187 typedef basic_streambuf<_CharT, _Traits> streambuf_type;
14188 typedef basic_ostream<_CharT, _Traits> ostream_type;
14189 template<typename _CharT2>
14190 friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
14191 ostreambuf_iterator<_CharT2> >::__type
14192 copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
14193 ostreambuf_iterator<_CharT2>);
14194 private:
14195 streambuf_type* _M_sbuf;
14196 bool _M_failed;
14197 public:
14198 ostreambuf_iterator(ostream_type& __s) throw ()
14199 : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
14200 ostreambuf_iterator(streambuf_type* __s) throw ()
14201 : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
14202 ostreambuf_iterator&
14203 operator=(_CharT __c)
14204 {
14205 if (!_M_failed &&
14206 _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
14207 _M_failed = true;
14208 return *this;
14209 }
14210 ostreambuf_iterator&
14211 operator*()
14212 { return *this; }
14213 ostreambuf_iterator&
14214 operator++(int)
14215 { return *this; }
14216 ostreambuf_iterator&
14217 operator++()
14218 { return *this; }
14219 bool
14220 failed() const throw()
14221 { return _M_failed; }
14222 ostreambuf_iterator&
14223 _M_put(const _CharT* __ws, streamsize __len)
14224 {
14225 if (__builtin_expect(!_M_failed, true)
14226 && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
14227 false))
14228 _M_failed = true;
14229 return *this;
14230 }
14231 };
14232 template<typename _CharT>
14233 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
14234 ostreambuf_iterator<_CharT> >::__type
14235 copy(istreambuf_iterator<_CharT> __first,
14236 istreambuf_iterator<_CharT> __last,
14237 ostreambuf_iterator<_CharT> __result)
14238 {
14239 if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
14240 {
14241 bool __ineof;
14242 __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
14243 if (!__ineof)
14244 __result._M_failed = true;
14245 }
14246 return __result;
14247 }
14248 template<bool _IsMove, typename _CharT>
14249 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
14250 ostreambuf_iterator<_CharT> >::__type
14251 __copy_move_a2(_CharT* __first, _CharT* __last,
14252 ostreambuf_iterator<_CharT> __result)
14253 {
14254 const streamsize __num = __last - __first;
14255 if (__num > 0)
14256 __result._M_put(__first, __num);
14257 return __result;
14258 }
14259 template<bool _IsMove, typename _CharT>
14260 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
14261 ostreambuf_iterator<_CharT> >::__type
14262 __copy_move_a2(const _CharT* __first, const _CharT* __last,
14263 ostreambuf_iterator<_CharT> __result)
14264 {
14265 const streamsize __num = __last - __first;
14266 if (__num > 0)
14267 __result._M_put(__first, __num);
14268 return __result;
14269 }
14270 template<bool _IsMove, typename _CharT>
14271 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
14272 _CharT*>::__type
14273 __copy_move_a2(istreambuf_iterator<_CharT> __first,
14274 istreambuf_iterator<_CharT> __last, _CharT* __result)
14275 {
14276 typedef istreambuf_iterator<_CharT> __is_iterator_type;
14277 typedef typename __is_iterator_type::traits_type traits_type;
14278 typedef typename __is_iterator_type::streambuf_type streambuf_type;
14279 typedef typename traits_type::int_type int_type;
14280 if (__first._M_sbuf && !__last._M_sbuf)
14281 {
14282 streambuf_type* __sb = __first._M_sbuf;
14283 int_type __c = __sb->sgetc();
14284 while (!traits_type::eq_int_type(__c, traits_type::eof()))
14285 {
14286 const streamsize __n = __sb->egptr() - __sb->gptr();
14287 if (__n > 1)
14288 {
14289 traits_type::copy(__result, __sb->gptr(), __n);
14290 __sb->gbump(__n);
14291 __result += __n;
14292 __c = __sb->underflow();
14293 }
14294 else
14295 {
14296 *__result++ = traits_type::to_char_type(__c);
14297 __c = __sb->snextc();
14298 }
14299 }
14300 }
14301 return __result;
14302 }
14303 template<typename _CharT>
14304 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
14305 istreambuf_iterator<_CharT> >::__type
14306 find(istreambuf_iterator<_CharT> __first,
14307 istreambuf_iterator<_CharT> __last, const _CharT& __val)
14308 {
14309 typedef istreambuf_iterator<_CharT> __is_iterator_type;
14310 typedef typename __is_iterator_type::traits_type traits_type;
14311 typedef typename __is_iterator_type::streambuf_type streambuf_type;
14312 typedef typename traits_type::int_type int_type;
14313 if (__first._M_sbuf && !__last._M_sbuf)
14314 {
14315 const int_type __ival = traits_type::to_int_type(__val);
14316 streambuf_type* __sb = __first._M_sbuf;
14317 int_type __c = __sb->sgetc();
14318 while (!traits_type::eq_int_type(__c, traits_type::eof())
14319 && !traits_type::eq_int_type(__c, __ival))
14320 {
14321 streamsize __n = __sb->egptr() - __sb->gptr();
14322 if (__n > 1)
14323 {
14324 const _CharT* __p = traits_type::find(__sb->gptr(),
14325 __n, __val);
14326 if (__p)
14327 __n = __p - __sb->gptr();
14328 __sb->gbump(__n);
14329 __c = __sb->sgetc();
14330 }
14331 else
14332 __c = __sb->snextc();
14333 }
14334 if (!traits_type::eq_int_type(__c, traits_type::eof()))
14335 __first._M_c = __c;
14336 else
14337 __first._M_sbuf = 0;
14338 }
14339 return __first;
14340 }
14341 }
14342 namespace std __attribute__ ((__visibility__ ("default"))) {
14343 template<typename _Tp>
14344 void
14345 __convert_to_v(const char*, _Tp&, ios_base::iostate&,
14346 const __c_locale&) throw();
14347 template<>
14348 void
14349 __convert_to_v(const char*, float&, ios_base::iostate&,
14350 const __c_locale&) throw();
14351 template<>
14352 void
14353 __convert_to_v(const char*, double&, ios_base::iostate&,
14354 const __c_locale&) throw();
14355 template<>
14356 void
14357 __convert_to_v(const char*, long double&, ios_base::iostate&,
14358 const __c_locale&) throw();
14359 template<typename _CharT, typename _Traits>
14360 struct __pad
14361 {
14362 static void
14363 _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
14364 const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
14365 };
14366 template<typename _CharT>
14367 _CharT*
14368 __add_grouping(_CharT* __s, _CharT __sep,
14369 const char* __gbeg, size_t __gsize,
14370 const _CharT* __first, const _CharT* __last);
14371 template<typename _CharT>
14372 inline
14373 ostreambuf_iterator<_CharT>
14374 __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
14375 {
14376 __s._M_put(__ws, __len);
14377 return __s;
14378 }
14379 template<typename _CharT, typename _OutIter>
14380 inline
14381 _OutIter
14382 __write(_OutIter __s, const _CharT* __ws, int __len)
14383 {
14384 for (int __j = 0; __j < __len; __j++, ++__s)
14385 *__s = __ws[__j];
14386 return __s;
14387 }
14388 template<typename _CharT>
14389 class __ctype_abstract_base : public locale::facet, public ctype_base
14390 {
14391 public:
14392 typedef _CharT char_type;
14393 bool
14394 is(mask __m, char_type __c) const
14395 { return this->do_is(__m, __c); }
14396 const char_type*
14397 is(const char_type *__lo, const char_type *__hi, mask *__vec) const
14398 { return this->do_is(__lo, __hi, __vec); }
14399 const char_type*
14400 scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
14401 { return this->do_scan_is(__m, __lo, __hi); }
14402 const char_type*
14403 scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
14404 { return this->do_scan_not(__m, __lo, __hi); }
14405 char_type
14406 toupper(char_type __c) const
14407 { return this->do_toupper(__c); }
14408 const char_type*
14409 toupper(char_type *__lo, const char_type* __hi) const
14410 { return this->do_toupper(__lo, __hi); }
14411 char_type
14412 tolower(char_type __c) const
14413 { return this->do_tolower(__c); }
14414 const char_type*
14415 tolower(char_type* __lo, const char_type* __hi) const
14416 { return this->do_tolower(__lo, __hi); }
14417 char_type
14418 widen(char __c) const
14419 { return this->do_widen(__c); }
14420 const char*
14421 widen(const char* __lo, const char* __hi, char_type* __to) const
14422 { return this->do_widen(__lo, __hi, __to); }
14423 char
14424 narrow(char_type __c, char __dfault) const
14425 { return this->do_narrow(__c, __dfault); }
14426 const char_type*
14427 narrow(const char_type* __lo, const char_type* __hi,
14428 char __dfault, char *__to) const
14429 { return this->do_narrow(__lo, __hi, __dfault, __to); }
14430 public:
14431 explicit
14432 __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
14433 virtual
14434 ~__ctype_abstract_base() { }
14435 virtual bool
14436 do_is(mask __m, char_type __c) const = 0;
14437 virtual const char_type*
14438 do_is(const char_type* __lo, const char_type* __hi,
14439 mask* __vec) const = 0;
14440 virtual const char_type*
14441 do_scan_is(mask __m, const char_type* __lo,
14442 const char_type* __hi) const = 0;
14443 virtual const char_type*
14444 do_scan_not(mask __m, const char_type* __lo,
14445 const char_type* __hi) const = 0;
14446 virtual char_type
14447 do_toupper(char_type) const = 0;
14448 virtual const char_type*
14449 do_toupper(char_type* __lo, const char_type* __hi) const = 0;
14450 virtual char_type
14451 do_tolower(char_type) const = 0;
14452 virtual const char_type*
14453 do_tolower(char_type* __lo, const char_type* __hi) const = 0;
14454 virtual char_type
14455 do_widen(char) const = 0;
14456 virtual const char*
14457 do_widen(const char* __lo, const char* __hi,
14458 char_type* __dest) const = 0;
14459 virtual char
14460 do_narrow(char_type, char __dfault) const = 0;
14461 virtual const char_type*
14462 do_narrow(const char_type* __lo, const char_type* __hi,
14463 char __dfault, char* __dest) const = 0;
14464 };
14465 template<typename _CharT>
14466 class ctype : public __ctype_abstract_base<_CharT>
14467 {
14468 public:
14469 typedef _CharT char_type;
14470 typedef typename __ctype_abstract_base<_CharT>::mask mask;
14471 static locale::id id;
14472 explicit
14473 ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
14474 public:
14475 virtual
14476 ~ctype();
14477 virtual bool
14478 do_is(mask __m, char_type __c) const;
14479 virtual const char_type*
14480 do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
14481 virtual const char_type*
14482 do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
14483 virtual const char_type*
14484 do_scan_not(mask __m, const char_type* __lo,
14485 const char_type* __hi) const;
14486 virtual char_type
14487 do_toupper(char_type __c) const;
14488 virtual const char_type*
14489 do_toupper(char_type* __lo, const char_type* __hi) const;
14490 virtual char_type
14491 do_tolower(char_type __c) const;
14492 virtual const char_type*
14493 do_tolower(char_type* __lo, const char_type* __hi) const;
14494 virtual char_type
14495 do_widen(char __c) const;
14496 virtual const char*
14497 do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
14498 virtual char
14499 do_narrow(char_type, char __dfault) const;
14500 virtual const char_type*
14501 do_narrow(const char_type* __lo, const char_type* __hi,
14502 char __dfault, char* __dest) const;
14503 };
14504 template<typename _CharT>
14505 locale::id ctype<_CharT>::id;
14506 template<>
14507 class ctype<char> : public locale::facet, public ctype_base
14508 {
14509 public:
14510 typedef char char_type;
14511 public:
14512 __c_locale _M_c_locale_ctype;
14513 bool _M_del;
14514 __to_type _M_toupper;
14515 __to_type _M_tolower;
14516 const mask* _M_table;
14517 mutable char _M_widen_ok;
14518 mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
14519 mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
14520 mutable char _M_narrow_ok;
14521 public:
14522 static locale::id id;
14523 static const size_t table_size = 1 + static_cast<unsigned char>(-1);
14524 explicit
14525 ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
14526 explicit
14527 ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
14528 size_t __refs = 0);
14529 inline bool
14530 is(mask __m, char __c) const;
14531 inline const char*
14532 is(const char* __lo, const char* __hi, mask* __vec) const;
14533 inline const char*
14534 scan_is(mask __m, const char* __lo, const char* __hi) const;
14535 inline const char*
14536 scan_not(mask __m, const char* __lo, const char* __hi) const;
14537 char_type
14538 toupper(char_type __c) const
14539 { return this->do_toupper(__c); }
14540 const char_type*
14541 toupper(char_type *__lo, const char_type* __hi) const
14542 { return this->do_toupper(__lo, __hi); }
14543 char_type
14544 tolower(char_type __c) const
14545 { return this->do_tolower(__c); }
14546 const char_type*
14547 tolower(char_type* __lo, const char_type* __hi) const
14548 { return this->do_tolower(__lo, __hi); }
14549 char_type
14550 widen(char __c) const
14551 {
14552 if (_M_widen_ok)
14553 return _M_widen[static_cast<unsigned char>(__c)];
14554 this->_M_widen_init();
14555 return this->do_widen(__c);
14556 }
14557 const char*
14558 widen(const char* __lo, const char* __hi, char_type* __to) const
14559 {
14560 if (_M_widen_ok == 1)
14561 {
14562 __builtin_memcpy(__to, __lo, __hi - __lo);
14563 return __hi;
14564 }
14565 if (!_M_widen_ok)
14566 _M_widen_init();
14567 return this->do_widen(__lo, __hi, __to);
14568 }
14569 char
14570 narrow(char_type __c, char __dfault) const
14571 {
14572 if (_M_narrow[static_cast<unsigned char>(__c)])
14573 return _M_narrow[static_cast<unsigned char>(__c)];
14574 const char __t = do_narrow(__c, __dfault);
14575 if (__t != __dfault)
14576 _M_narrow[static_cast<unsigned char>(__c)] = __t;
14577 return __t;
14578 }
14579 const char_type*
14580 narrow(const char_type* __lo, const char_type* __hi,
14581 char __dfault, char *__to) const
14582 {
14583 if (__builtin_expect(_M_narrow_ok == 1, true))
14584 {
14585 __builtin_memcpy(__to, __lo, __hi - __lo);
14586 return __hi;
14587 }
14588 if (!_M_narrow_ok)
14589 _M_narrow_init();
14590 return this->do_narrow(__lo, __hi, __dfault, __to);
14591 }
14592 const mask*
14593 table() const throw()
14594 { return _M_table; }
14595 static const mask*
14596 classic_table() throw();
14597 public:
14598 virtual
14599 ~ctype();
14600 virtual char_type
14601 do_toupper(char_type) const;
14602 virtual const char_type*
14603 do_toupper(char_type* __lo, const char_type* __hi) const;
14604 virtual char_type
14605 do_tolower(char_type) const;
14606 virtual const char_type*
14607 do_tolower(char_type* __lo, const char_type* __hi) const;
14608 virtual char_type
14609 do_widen(char __c) const
14610 { return __c; }
14611 virtual const char*
14612 do_widen(const char* __lo, const char* __hi, char_type* __dest) const
14613 {
14614 __builtin_memcpy(__dest, __lo, __hi - __lo);
14615 return __hi;
14616 }
14617 virtual char
14618 do_narrow(char_type __c, char) const
14619 { return __c; }
14620 virtual const char_type*
14621 do_narrow(const char_type* __lo, const char_type* __hi,
14622 char, char* __dest) const
14623 {
14624 __builtin_memcpy(__dest, __lo, __hi - __lo);
14625 return __hi;
14626 }
14627 private:
14628 void _M_narrow_init() const;
14629 void _M_widen_init() const;
14630 };
14631 template<>
14632 class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
14633 {
14634 public:
14635 typedef wchar_t char_type;
14636 typedef wctype_t __wmask_type;
14637 public:
14638 __c_locale _M_c_locale_ctype;
14639 bool _M_narrow_ok;
14640 char _M_narrow[128];
14641 wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
14642 mask _M_bit[16];
14643 __wmask_type _M_wmask[16];
14644 public:
14645 static locale::id id;
14646 explicit
14647 ctype(size_t __refs = 0);
14648 explicit
14649 ctype(__c_locale __cloc, size_t __refs = 0);
14650 public:
14651 __wmask_type
14652 _M_convert_to_wmask(const mask __m) const throw();
14653 virtual
14654 ~ctype();
14655 virtual bool
14656 do_is(mask __m, char_type __c) const;
14657 virtual const char_type*
14658 do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
14659 virtual const char_type*
14660 do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
14661 virtual const char_type*
14662 do_scan_not(mask __m, const char_type* __lo,
14663 const char_type* __hi) const;
14664 virtual char_type
14665 do_toupper(char_type) const;
14666 virtual const char_type*
14667 do_toupper(char_type* __lo, const char_type* __hi) const;
14668 virtual char_type
14669 do_tolower(char_type) const;
14670 virtual const char_type*
14671 do_tolower(char_type* __lo, const char_type* __hi) const;
14672 virtual char_type
14673 do_widen(char) const;
14674 virtual const char*
14675 do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
14676 virtual char
14677 do_narrow(char_type, char __dfault) const;
14678 virtual const char_type*
14679 do_narrow(const char_type* __lo, const char_type* __hi,
14680 char __dfault, char* __dest) const;
14681 void
14682 _M_initialize_ctype() throw();
14683 };
14684 template<typename _CharT>
14685 class ctype_byname : public ctype<_CharT>
14686 {
14687 public:
14688 typedef typename ctype<_CharT>::mask mask;
14689 explicit
14690 ctype_byname(const char* __s, size_t __refs = 0);
14691 public:
14692 virtual
14693 ~ctype_byname() { };
14694 };
14695 template<>
14696 class ctype_byname<char> : public ctype<char>
14697 {
14698 public:
14699 explicit
14700 ctype_byname(const char* __s, size_t __refs = 0);
14701 public:
14702 virtual
14703 ~ctype_byname();
14704 };
14705 template<>
14706 class ctype_byname<wchar_t> : public ctype<wchar_t>
14707 {
14708 public:
14709 explicit
14710 ctype_byname(const char* __s, size_t __refs = 0);
14711 public:
14712 virtual
14713 ~ctype_byname();
14714 };
14715 }
14716 namespace std __attribute__ ((__visibility__ ("default"))) {
14717 bool
14718 ctype<char>::
14719 is(mask __m, char __c) const
14720 { return _M_table[static_cast<unsigned char>(__c)] & __m; }
14721 const char*
14722 ctype<char>::
14723 is(const char* __low, const char* __high, mask* __vec) const
14724 {
14725 while (__low < __high)
14726 *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
14727 return __high;
14728 }
14729 const char*
14730 ctype<char>::
14731 scan_is(mask __m, const char* __low, const char* __high) const
14732 {
14733 while (__low < __high
14734 && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
14735 ++__low;
14736 return __low;
14737 }
14738 const char*
14739 ctype<char>::
14740 scan_not(mask __m, const char* __low, const char* __high) const
14741 {
14742 while (__low < __high
14743 && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
14744 ++__low;
14745 return __low;
14746 }
14747 }
14748 namespace std __attribute__ ((__visibility__ ("default"))) {
14749 class __num_base
14750 {
14751 public:
14752 enum
14753 {
14754 _S_ominus,
14755 _S_oplus,
14756 _S_ox,
14757 _S_oX,
14758 _S_odigits,
14759 _S_odigits_end = _S_odigits + 16,
14760 _S_oudigits = _S_odigits_end,
14761 _S_oudigits_end = _S_oudigits + 16,
14762 _S_oe = _S_odigits + 14,
14763 _S_oE = _S_oudigits + 14,
14764 _S_oend = _S_oudigits_end
14765 };
14766 static const char* _S_atoms_out;
14767 static const char* _S_atoms_in;
14768 enum
14769 {
14770 _S_iminus,
14771 _S_iplus,
14772 _S_ix,
14773 _S_iX,
14774 _S_izero,
14775 _S_ie = _S_izero + 14,
14776 _S_iE = _S_izero + 20,
14777 _S_iend = 26
14778 };
14779 static void
14780 _S_format_float(const ios_base& __io, char* __fptr, char __mod) throw();
14781 };
14782 template<typename _CharT>
14783 struct __numpunct_cache : public locale::facet
14784 {
14785 const char* _M_grouping;
14786 size_t _M_grouping_size;
14787 bool _M_use_grouping;
14788 const _CharT* _M_truename;
14789 size_t _M_truename_size;
14790 const _CharT* _M_falsename;
14791 size_t _M_falsename_size;
14792 _CharT _M_decimal_point;
14793 _CharT _M_thousands_sep;
14794 _CharT _M_atoms_out[__num_base::_S_oend];
14795 _CharT _M_atoms_in[__num_base::_S_iend];
14796 bool _M_allocated;
14797 __numpunct_cache(size_t __refs = 0) : facet(__refs),
14798 _M_grouping(__null), _M_grouping_size(0), _M_use_grouping(false),
14799 _M_truename(__null), _M_truename_size(0), _M_falsename(__null),
14800 _M_falsename_size(0), _M_decimal_point(_CharT()),
14801 _M_thousands_sep(_CharT()), _M_allocated(false)
14802 { }
14803 ~__numpunct_cache();
14804 void
14805 _M_cache(const locale& __loc);
14806 private:
14807 __numpunct_cache&
14808 operator=(const __numpunct_cache&);
14809 explicit
14810 __numpunct_cache(const __numpunct_cache&);
14811 };
14812 template<typename _CharT>
14813 __numpunct_cache<_CharT>::~__numpunct_cache()
14814 {
14815 if (_M_allocated)
14816 {
14817 delete [] _M_grouping;
14818 delete [] _M_truename;
14819 delete [] _M_falsename;
14820 }
14821 }
14822 template<typename _CharT>
14823 class numpunct : public locale::facet
14824 {
14825 public:
14826 typedef _CharT char_type;
14827 typedef basic_string<_CharT> string_type;
14828 typedef __numpunct_cache<_CharT> __cache_type;
14829 public:
14830 __cache_type* _M_data;
14831 public:
14832 static locale::id id;
14833 explicit
14834 numpunct(size_t __refs = 0) : facet(__refs), _M_data(__null)
14835 { _M_initialize_numpunct(); }
14836 explicit
14837 numpunct(__cache_type* __cache, size_t __refs = 0)
14838 : facet(__refs), _M_data(__cache)
14839 { _M_initialize_numpunct(); }
14840 explicit
14841 numpunct(__c_locale __cloc, size_t __refs = 0)
14842 : facet(__refs), _M_data(__null)
14843 { _M_initialize_numpunct(__cloc); }
14844 char_type
14845 decimal_point() const
14846 { return this->do_decimal_point(); }
14847 char_type
14848 thousands_sep() const
14849 { return this->do_thousands_sep(); }
14850 string
14851 grouping() const
14852 { return this->do_grouping(); }
14853 string_type
14854 truename() const
14855 { return this->do_truename(); }
14856 string_type
14857 falsename() const
14858 { return this->do_falsename(); }
14859 public:
14860 virtual
14861 ~numpunct();
14862 virtual char_type
14863 do_decimal_point() const
14864 { return _M_data->_M_decimal_point; }
14865 virtual char_type
14866 do_thousands_sep() const
14867 { return _M_data->_M_thousands_sep; }
14868 virtual string
14869 do_grouping() const
14870 { return _M_data->_M_grouping; }
14871 virtual string_type
14872 do_truename() const
14873 { return _M_data->_M_truename; }
14874 virtual string_type
14875 do_falsename() const
14876 { return _M_data->_M_falsename; }
14877 void
14878 _M_initialize_numpunct(__c_locale __cloc = __null);
14879 };
14880 template<typename _CharT>
14881 locale::id numpunct<_CharT>::id;
14882 template<>
14883 numpunct<char>::~numpunct();
14884 template<>
14885 void
14886 numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
14887 template<>
14888 numpunct<wchar_t>::~numpunct();
14889 template<>
14890 void
14891 numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
14892 template<typename _CharT>
14893 class numpunct_byname : public numpunct<_CharT>
14894 {
14895 public:
14896 typedef _CharT char_type;
14897 typedef basic_string<_CharT> string_type;
14898 explicit
14899 numpunct_byname(const char* __s, size_t __refs = 0)
14900 : numpunct<_CharT>(__refs)
14901 {
14902 if (__builtin_strcmp(__s, "C") != 0
14903 && __builtin_strcmp(__s, "POSIX") != 0)
14904 {
14905 __c_locale __tmp;
14906 this->_S_create_c_locale(__tmp, __s);
14907 this->_M_initialize_numpunct(__tmp);
14908 this->_S_destroy_c_locale(__tmp);
14909 }
14910 }
14911 public:
14912 virtual
14913 ~numpunct_byname() { }
14914 };
14915 template<typename _CharT, typename _InIter>
14916 class num_get : public locale::facet
14917 {
14918 public:
14919 typedef _CharT char_type;
14920 typedef _InIter iter_type;
14921 static locale::id id;
14922 explicit
14923 num_get(size_t __refs = 0) : facet(__refs) { }
14924 iter_type
14925 get(iter_type __in, iter_type __end, ios_base& __io,
14926 ios_base::iostate& __err, bool& __v) const
14927 { return this->do_get(__in, __end, __io, __err, __v); }
14928 iter_type
14929 get(iter_type __in, iter_type __end, ios_base& __io,
14930 ios_base::iostate& __err, long& __v) const
14931 { return this->do_get(__in, __end, __io, __err, __v); }
14932 iter_type
14933 get(iter_type __in, iter_type __end, ios_base& __io,
14934 ios_base::iostate& __err, unsigned short& __v) const
14935 { return this->do_get(__in, __end, __io, __err, __v); }
14936 iter_type
14937 get(iter_type __in, iter_type __end, ios_base& __io,
14938 ios_base::iostate& __err, unsigned int& __v) const
14939 { return this->do_get(__in, __end, __io, __err, __v); }
14940 iter_type
14941 get(iter_type __in, iter_type __end, ios_base& __io,
14942 ios_base::iostate& __err, unsigned long& __v) const
14943 { return this->do_get(__in, __end, __io, __err, __v); }
14944 iter_type
14945 get(iter_type __in, iter_type __end, ios_base& __io,
14946 ios_base::iostate& __err, long long& __v) const
14947 { return this->do_get(__in, __end, __io, __err, __v); }
14948 iter_type
14949 get(iter_type __in, iter_type __end, ios_base& __io,
14950 ios_base::iostate& __err, unsigned long long& __v) const
14951 { return this->do_get(__in, __end, __io, __err, __v); }
14952 iter_type
14953 get(iter_type __in, iter_type __end, ios_base& __io,
14954 ios_base::iostate& __err, float& __v) const
14955 { return this->do_get(__in, __end, __io, __err, __v); }
14956 iter_type
14957 get(iter_type __in, iter_type __end, ios_base& __io,
14958 ios_base::iostate& __err, double& __v) const
14959 { return this->do_get(__in, __end, __io, __err, __v); }
14960 iter_type
14961 get(iter_type __in, iter_type __end, ios_base& __io,
14962 ios_base::iostate& __err, long double& __v) const
14963 { return this->do_get(__in, __end, __io, __err, __v); }
14964 iter_type
14965 get(iter_type __in, iter_type __end, ios_base& __io,
14966 ios_base::iostate& __err, void*& __v) const
14967 { return this->do_get(__in, __end, __io, __err, __v); }
14968 public:
14969 virtual ~num_get() { }
14970 iter_type
14971 _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
14972 string&) const;
14973 template<typename _ValueT>
14974 iter_type
14975 _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
14976 _ValueT&) const;
14977 template<typename _CharT2>
14978 typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
14979 _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
14980 {
14981 int __ret = -1;
14982 if (__len <= 10)
14983 {
14984 if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
14985 __ret = __c - _CharT2('0');
14986 }
14987 else
14988 {
14989 if (__c >= _CharT2('0') && __c <= _CharT2('9'))
14990 __ret = __c - _CharT2('0');
14991 else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
14992 __ret = 10 + (__c - _CharT2('a'));
14993 else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
14994 __ret = 10 + (__c - _CharT2('A'));
14995 }
14996 return __ret;
14997 }
14998 template<typename _CharT2>
14999 typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
15000 int>::__type
15001 _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
15002 {
15003 int __ret = -1;
15004 const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
15005 if (__q)
15006 {
15007 __ret = __q - __zero;
15008 if (__ret > 15)
15009 __ret -= 6;
15010 }
15011 return __ret;
15012 }
15013 virtual iter_type
15014 do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
15015 virtual iter_type
15016 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15017 ios_base::iostate& __err, long& __v) const
15018 { return _M_extract_int(__beg, __end, __io, __err, __v); }
15019 virtual iter_type
15020 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15021 ios_base::iostate& __err, unsigned short& __v) const
15022 { return _M_extract_int(__beg, __end, __io, __err, __v); }
15023 virtual iter_type
15024 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15025 ios_base::iostate& __err, unsigned int& __v) const
15026 { return _M_extract_int(__beg, __end, __io, __err, __v); }
15027 virtual iter_type
15028 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15029 ios_base::iostate& __err, unsigned long& __v) const
15030 { return _M_extract_int(__beg, __end, __io, __err, __v); }
15031 virtual iter_type
15032 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15033 ios_base::iostate& __err, long long& __v) const
15034 { return _M_extract_int(__beg, __end, __io, __err, __v); }
15035 virtual iter_type
15036 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15037 ios_base::iostate& __err, unsigned long long& __v) const
15038 { return _M_extract_int(__beg, __end, __io, __err, __v); }
15039 virtual iter_type
15040 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
15041 float&) const;
15042 virtual iter_type
15043 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
15044 double&) const;
15045 virtual iter_type
15046 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
15047 long double&) const;
15048 virtual iter_type
15049 do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
15050 void*&) const;
15051 };
15052 template<typename _CharT, typename _InIter>
15053 locale::id num_get<_CharT, _InIter>::id;
15054 template<typename _CharT, typename _OutIter>
15055 class num_put : public locale::facet
15056 {
15057 public:
15058 typedef _CharT char_type;
15059 typedef _OutIter iter_type;
15060 static locale::id id;
15061 explicit
15062 num_put(size_t __refs = 0) : facet(__refs) { }
15063 iter_type
15064 put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
15065 { return this->do_put(__s, __f, __fill, __v); }
15066 iter_type
15067 put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
15068 { return this->do_put(__s, __f, __fill, __v); }
15069 iter_type
15070 put(iter_type __s, ios_base& __f, char_type __fill,
15071 unsigned long __v) const
15072 { return this->do_put(__s, __f, __fill, __v); }
15073 iter_type
15074 put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
15075 { return this->do_put(__s, __f, __fill, __v); }
15076 iter_type
15077 put(iter_type __s, ios_base& __f, char_type __fill,
15078 unsigned long long __v) const
15079 { return this->do_put(__s, __f, __fill, __v); }
15080 iter_type
15081 put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
15082 { return this->do_put(__s, __f, __fill, __v); }
15083 iter_type
15084 put(iter_type __s, ios_base& __f, char_type __fill,
15085 long double __v) const
15086 { return this->do_put(__s, __f, __fill, __v); }
15087 iter_type
15088 put(iter_type __s, ios_base& __f, char_type __fill,
15089 const void* __v) const
15090 { return this->do_put(__s, __f, __fill, __v); }
15091 public:
15092 template<typename _ValueT>
15093 iter_type
15094 _M_insert_float(iter_type, ios_base& __io, char_type __fill,
15095 char __mod, _ValueT __v) const;
15096 void
15097 _M_group_float(const char* __grouping, size_t __grouping_size,
15098 char_type __sep, const char_type* __p, char_type* __new,
15099 char_type* __cs, int& __len) const;
15100 template<typename _ValueT>
15101 iter_type
15102 _M_insert_int(iter_type, ios_base& __io, char_type __fill,
15103 _ValueT __v) const;
15104 void
15105 _M_group_int(const char* __grouping, size_t __grouping_size,
15106 char_type __sep, ios_base& __io, char_type* __new,
15107 char_type* __cs, int& __len) const;
15108 void
15109 _M_pad(char_type __fill, streamsize __w, ios_base& __io,
15110 char_type* __new, const char_type* __cs, int& __len) const;
15111 virtual
15112 ~num_put() { };
15113 virtual iter_type
15114 do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
15115 virtual iter_type
15116 do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
15117 { return _M_insert_int(__s, __io, __fill, __v); }
15118 virtual iter_type
15119 do_put(iter_type __s, ios_base& __io, char_type __fill,
15120 unsigned long __v) const
15121 { return _M_insert_int(__s, __io, __fill, __v); }
15122 virtual iter_type
15123 do_put(iter_type __s, ios_base& __io, char_type __fill,
15124 long long __v) const
15125 { return _M_insert_int(__s, __io, __fill, __v); }
15126 virtual iter_type
15127 do_put(iter_type __s, ios_base& __io, char_type __fill,
15128 unsigned long long __v) const
15129 { return _M_insert_int(__s, __io, __fill, __v); }
15130 virtual iter_type
15131 do_put(iter_type, ios_base&, char_type __fill, double __v) const;
15132 virtual iter_type
15133 do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
15134 virtual iter_type
15135 do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
15136 };
15137 template <typename _CharT, typename _OutIter>
15138 locale::id num_put<_CharT, _OutIter>::id;
15139 template<typename _CharT>
15140 inline bool
15141 isspace(_CharT __c, const locale& __loc)
15142 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
15143 template<typename _CharT>
15144 inline bool
15145 isprint(_CharT __c, const locale& __loc)
15146 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
15147 template<typename _CharT>
15148 inline bool
15149 iscntrl(_CharT __c, const locale& __loc)
15150 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
15151 template<typename _CharT>
15152 inline bool
15153 isupper(_CharT __c, const locale& __loc)
15154 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
15155 template<typename _CharT>
15156 inline bool
15157 islower(_CharT __c, const locale& __loc)
15158 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
15159 template<typename _CharT>
15160 inline bool
15161 isalpha(_CharT __c, const locale& __loc)
15162 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
15163 template<typename _CharT>
15164 inline bool
15165 isdigit(_CharT __c, const locale& __loc)
15166 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
15167 template<typename _CharT>
15168 inline bool
15169 ispunct(_CharT __c, const locale& __loc)
15170 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
15171 template<typename _CharT>
15172 inline bool
15173 isxdigit(_CharT __c, const locale& __loc)
15174 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
15175 template<typename _CharT>
15176 inline bool
15177 isalnum(_CharT __c, const locale& __loc)
15178 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
15179 template<typename _CharT>
15180 inline bool
15181 isgraph(_CharT __c, const locale& __loc)
15182 { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
15183 template<typename _CharT>
15184 inline _CharT
15185 toupper(_CharT __c, const locale& __loc)
15186 { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
15187 template<typename _CharT>
15188 inline _CharT
15189 tolower(_CharT __c, const locale& __loc)
15190 { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
15191 }
15192
15193 namespace std __attribute__ ((__visibility__ ("default"))) {
15194 template<typename _Facet>
15195 struct __use_cache
15196 {
15197 const _Facet*
15198 operator() (const locale& __loc) const;
15199 };
15200 template<typename _CharT>
15201 struct __use_cache<__numpunct_cache<_CharT> >
15202 {
15203 const __numpunct_cache<_CharT>*
15204 operator() (const locale& __loc) const
15205 {
15206 const size_t __i = numpunct<_CharT>::id._M_id();
15207 const locale::facet** __caches = __loc._M_impl->_M_caches;
15208 if (!__caches[__i])
15209 {
15210 __numpunct_cache<_CharT>* __tmp = __null;
15211 try
15212 {
15213 __tmp = new __numpunct_cache<_CharT>;
15214 __tmp->_M_cache(__loc);
15215 }
15216 catch(...)
15217 {
15218 delete __tmp;
15219 throw;
15220 }
15221 __loc._M_impl->_M_install_cache(__tmp, __i);
15222 }
15223 return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
15224 }
15225 };
15226 template<typename _CharT>
15227 void
15228 __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
15229 {
15230 _M_allocated = true;
15231 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
15232 char* __grouping = 0;
15233 _CharT* __truename = 0;
15234 _CharT* __falsename = 0;
15235 try
15236 {
15237 _M_grouping_size = __np.grouping().size();
15238 __grouping = new char[_M_grouping_size];
15239 __np.grouping().copy(__grouping, _M_grouping_size);
15240 _M_grouping = __grouping;
15241 _M_use_grouping = (_M_grouping_size
15242 && static_cast<signed char>(_M_grouping[0]) > 0
15243 && (_M_grouping[0]
15244 != __gnu_cxx::__numeric_traits<char>::__max));
15245 _M_truename_size = __np.truename().size();
15246 __truename = new _CharT[_M_truename_size];
15247 __np.truename().copy(__truename, _M_truename_size);
15248 _M_truename = __truename;
15249 _M_falsename_size = __np.falsename().size();
15250 __falsename = new _CharT[_M_falsename_size];
15251 __np.falsename().copy(__falsename, _M_falsename_size);
15252 _M_falsename = __falsename;
15253 _M_decimal_point = __np.decimal_point();
15254 _M_thousands_sep = __np.thousands_sep();
15255 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
15256 __ct.widen(__num_base::_S_atoms_out,
15257 __num_base::_S_atoms_out
15258 + __num_base::_S_oend, _M_atoms_out);
15259 __ct.widen(__num_base::_S_atoms_in,
15260 __num_base::_S_atoms_in
15261 + __num_base::_S_iend, _M_atoms_in);
15262 }
15263 catch(...)
15264 {
15265 delete [] __grouping;
15266 delete [] __truename;
15267 delete [] __falsename;
15268 throw;
15269 }
15270 }
15271 __attribute__ ((__pure__)) bool
15272 __verify_grouping(const char* __grouping, size_t __grouping_size,
15273 const string& __grouping_tmp) throw ();
15274 template<typename _CharT, typename _InIter>
15275 _InIter
15276 num_get<_CharT, _InIter>::
15277 _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
15278 ios_base::iostate& __err, string& __xtrc) const
15279 {
15280 typedef char_traits<_CharT> __traits_type;
15281 typedef __numpunct_cache<_CharT> __cache_type;
15282 __use_cache<__cache_type> __uc;
15283 const locale& __loc = __io._M_getloc();
15284 const __cache_type* __lc = __uc(__loc);
15285 const _CharT* __lit = __lc->_M_atoms_in;
15286 char_type __c = char_type();
15287 bool __testeof = __beg == __end;
15288 if (!__testeof)
15289 {
15290 __c = *__beg;
15291 const bool __plus = __c == __lit[__num_base::_S_iplus];
15292 if ((__plus || __c == __lit[__num_base::_S_iminus])
15293 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
15294 && !(__c == __lc->_M_decimal_point))
15295 {
15296 __xtrc += __plus ? '+' : '-';
15297 if (++__beg != __end)
15298 __c = *__beg;
15299 else
15300 __testeof = true;
15301 }
15302 }
15303 bool __found_mantissa = false;
15304 int __sep_pos = 0;
15305 while (!__testeof)
15306 {
15307 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
15308 || __c == __lc->_M_decimal_point)
15309 break;
15310 else if (__c == __lit[__num_base::_S_izero])
15311 {
15312 if (!__found_mantissa)
15313 {
15314 __xtrc += '0';
15315 __found_mantissa = true;
15316 }
15317 ++__sep_pos;
15318 if (++__beg != __end)
15319 __c = *__beg;
15320 else
15321 __testeof = true;
15322 }
15323 else
15324 break;
15325 }
15326 bool __found_dec = false;
15327 bool __found_sci = false;
15328 string __found_grouping;
15329 if (__lc->_M_use_grouping)
15330 __found_grouping.reserve(32);
15331 const char_type* __lit_zero = __lit + __num_base::_S_izero;
15332 if (!__lc->_M_allocated)
15333 while (!__testeof)
15334 {
15335 const int __digit = _M_find(__lit_zero, 10, __c);
15336 if (__digit != -1)
15337 {
15338 __xtrc += '0' + __digit;
15339 __found_mantissa = true;
15340 }
15341 else if (__c == __lc->_M_decimal_point
15342 && !__found_dec && !__found_sci)
15343 {
15344 __xtrc += '.';
15345 __found_dec = true;
15346 }
15347 else if ((__c == __lit[__num_base::_S_ie]
15348 || __c == __lit[__num_base::_S_iE])
15349 && !__found_sci && __found_mantissa)
15350 {
15351 __xtrc += 'e';
15352 __found_sci = true;
15353 if (++__beg != __end)
15354 {
15355 __c = *__beg;
15356 const bool __plus = __c == __lit[__num_base::_S_iplus];
15357 if (__plus || __c == __lit[__num_base::_S_iminus])
15358 __xtrc += __plus ? '+' : '-';
15359 else
15360 continue;
15361 }
15362 else
15363 {
15364 __testeof = true;
15365 break;
15366 }
15367 }
15368 else
15369 break;
15370 if (++__beg != __end)
15371 __c = *__beg;
15372 else
15373 __testeof = true;
15374 }
15375 else
15376 while (!__testeof)
15377 {
15378 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
15379 {
15380 if (!__found_dec && !__found_sci)
15381 {
15382 if (__sep_pos)
15383 {
15384 __found_grouping += static_cast<char>(__sep_pos);
15385 __sep_pos = 0;
15386 }
15387 else
15388 {
15389 __xtrc.clear();
15390 break;
15391 }
15392 }
15393 else
15394 break;
15395 }
15396 else if (__c == __lc->_M_decimal_point)
15397 {
15398 if (!__found_dec && !__found_sci)
15399 {
15400 if (__found_grouping.size())
15401 __found_grouping += static_cast<char>(__sep_pos);
15402 __xtrc += '.';
15403 __found_dec = true;
15404 }
15405 else
15406 break;
15407 }
15408 else
15409 {
15410 const char_type* __q =
15411 __traits_type::find(__lit_zero, 10, __c);
15412 if (__q)
15413 {
15414 __xtrc += '0' + (__q - __lit_zero);
15415 __found_mantissa = true;
15416 ++__sep_pos;
15417 }
15418 else if ((__c == __lit[__num_base::_S_ie]
15419 || __c == __lit[__num_base::_S_iE])
15420 && !__found_sci && __found_mantissa)
15421 {
15422 if (__found_grouping.size() && !__found_dec)
15423 __found_grouping += static_cast<char>(__sep_pos);
15424 __xtrc += 'e';
15425 __found_sci = true;
15426 if (++__beg != __end)
15427 {
15428 __c = *__beg;
15429 const bool __plus = __c == __lit[__num_base::_S_iplus];
15430 if ((__plus || __c == __lit[__num_base::_S_iminus])
15431 && !(__lc->_M_use_grouping
15432 && __c == __lc->_M_thousands_sep)
15433 && !(__c == __lc->_M_decimal_point))
15434 __xtrc += __plus ? '+' : '-';
15435 else
15436 continue;
15437 }
15438 else
15439 {
15440 __testeof = true;
15441 break;
15442 }
15443 }
15444 else
15445 break;
15446 }
15447 if (++__beg != __end)
15448 __c = *__beg;
15449 else
15450 __testeof = true;
15451 }
15452 if (__found_grouping.size())
15453 {
15454 if (!__found_dec && !__found_sci)
15455 __found_grouping += static_cast<char>(__sep_pos);
15456 if (!std::__verify_grouping(__lc->_M_grouping,
15457 __lc->_M_grouping_size,
15458 __found_grouping))
15459 __err = ios_base::failbit;
15460 }
15461 return __beg;
15462 }
15463 template<typename _CharT, typename _InIter>
15464 template<typename _ValueT>
15465 _InIter
15466 num_get<_CharT, _InIter>::
15467 _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
15468 ios_base::iostate& __err, _ValueT& __v) const
15469 {
15470 typedef char_traits<_CharT> __traits_type;
15471 using __gnu_cxx::__add_unsigned;
15472 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
15473 typedef __numpunct_cache<_CharT> __cache_type;
15474 __use_cache<__cache_type> __uc;
15475 const locale& __loc = __io._M_getloc();
15476 const __cache_type* __lc = __uc(__loc);
15477 const _CharT* __lit = __lc->_M_atoms_in;
15478 char_type __c = char_type();
15479 const ios_base::fmtflags __basefield = __io.flags()
15480 & ios_base::basefield;
15481 const bool __oct = __basefield == ios_base::oct;
15482 int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
15483 bool __testeof = __beg == __end;
15484 bool __negative = false;
15485 if (!__testeof)
15486 {
15487 __c = *__beg;
15488 __negative = __c == __lit[__num_base::_S_iminus];
15489 if ((__negative || __c == __lit[__num_base::_S_iplus])
15490 && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
15491 && !(__c == __lc->_M_decimal_point))
15492 {
15493 if (++__beg != __end)
15494 __c = *__beg;
15495 else
15496 __testeof = true;
15497 }
15498 }
15499 bool __found_zero = false;
15500 int __sep_pos = 0;
15501 while (!__testeof)
15502 {
15503 if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
15504 || __c == __lc->_M_decimal_point)
15505 break;
15506 else if (__c == __lit[__num_base::_S_izero]
15507 && (!__found_zero || __base == 10))
15508 {
15509 __found_zero = true;
15510 ++__sep_pos;
15511 if (__basefield == 0)
15512 __base = 8;
15513 if (__base == 8)
15514 __sep_pos = 0;
15515 }
15516 else if (__found_zero
15517 && (__c == __lit[__num_base::_S_ix]
15518 || __c == __lit[__num_base::_S_iX]))
15519 {
15520 if (__basefield == 0)
15521 __base = 16;
15522 if (__base == 16)
15523 {
15524 __found_zero = false;
15525 __sep_pos = 0;
15526 }
15527 else
15528 break;
15529 }
15530 else
15531 break;
15532 if (++__beg != __end)
15533 {
15534 __c = *__beg;
15535 if (!__found_zero)
15536 break;
15537 }
15538 else
15539 __testeof = true;
15540 }
15541 const size_t __len = (__base == 16 ? __num_base::_S_iend
15542 - __num_base::_S_izero : __base);
15543 string __found_grouping;
15544 if (__lc->_M_use_grouping)
15545 __found_grouping.reserve(32);
15546 bool __testfail = false;
15547 bool __testoverflow = false;
15548 const __unsigned_type __max =
15549 (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
15550 ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
15551 : __gnu_cxx::__numeric_traits<_ValueT>::__max;
15552 const __unsigned_type __smax = __max / __base;
15553 __unsigned_type __result = 0;
15554 int __digit = 0;
15555 const char_type* __lit_zero = __lit + __num_base::_S_izero;
15556 if (!__lc->_M_allocated)
15557 while (!__testeof)
15558 {
15559 __digit = _M_find(__lit_zero, __len, __c);
15560 if (__digit == -1)
15561 break;
15562 if (__result > __smax)
15563 __testoverflow = true;
15564 else
15565 {
15566 __result *= __base;
15567 __testoverflow |= __result > __max - __digit;
15568 __result += __digit;
15569 ++__sep_pos;
15570 }
15571 if (++__beg != __end)
15572 __c = *__beg;
15573 else
15574 __testeof = true;
15575 }
15576 else
15577 while (!__testeof)
15578 {
15579 if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
15580 {
15581 if (__sep_pos)
15582 {
15583 __found_grouping += static_cast<char>(__sep_pos);
15584 __sep_pos = 0;
15585 }
15586 else
15587 {
15588 __testfail = true;
15589 break;
15590 }
15591 }
15592 else if (__c == __lc->_M_decimal_point)
15593 break;
15594 else
15595 {
15596 const char_type* __q =
15597 __traits_type::find(__lit_zero, __len, __c);
15598 if (!__q)
15599 break;
15600 __digit = __q - __lit_zero;
15601 if (__digit > 15)
15602 __digit -= 6;
15603 if (__result > __smax)
15604 __testoverflow = true;
15605 else
15606 {
15607 __result *= __base;
15608 __testoverflow |= __result > __max - __digit;
15609 __result += __digit;
15610 ++__sep_pos;
15611 }
15612 }
15613 if (++__beg != __end)
15614 __c = *__beg;
15615 else
15616 __testeof = true;
15617 }
15618 if (__found_grouping.size())
15619 {
15620 __found_grouping += static_cast<char>(__sep_pos);
15621 if (!std::__verify_grouping(__lc->_M_grouping,
15622 __lc->_M_grouping_size,
15623 __found_grouping))
15624 __err = ios_base::failbit;
15625 }
15626 if ((!__sep_pos && !__found_zero && !__found_grouping.size())
15627 || __testfail)
15628 {
15629 __v = 0;
15630 __err = ios_base::failbit;
15631 }
15632 else if (__testoverflow)
15633 {
15634 if (__negative
15635 && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
15636 __v = __gnu_cxx::__numeric_traits<_ValueT>::__min;
15637 else
15638 __v = __gnu_cxx::__numeric_traits<_ValueT>::__max;
15639 __err = ios_base::failbit;
15640 }
15641 else
15642 __v = __negative ? -__result : __result;
15643 if (__testeof)
15644 __err |= ios_base::eofbit;
15645 return __beg;
15646 }
15647 template<typename _CharT, typename _InIter>
15648 _InIter
15649 num_get<_CharT, _InIter>::
15650 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15651 ios_base::iostate& __err, bool& __v) const
15652 {
15653 if (!(__io.flags() & ios_base::boolalpha))
15654 {
15655 long __l = -1;
15656 __beg = _M_extract_int(__beg, __end, __io, __err, __l);
15657 if (__l == 0 || __l == 1)
15658 __v = bool(__l);
15659 else
15660 {
15661 __v = true;
15662 __err = ios_base::failbit;
15663 if (__beg == __end)
15664 __err |= ios_base::eofbit;
15665 }
15666 }
15667 else
15668 {
15669 typedef __numpunct_cache<_CharT> __cache_type;
15670 __use_cache<__cache_type> __uc;
15671 const locale& __loc = __io._M_getloc();
15672 const __cache_type* __lc = __uc(__loc);
15673 bool __testf = true;
15674 bool __testt = true;
15675 bool __donef = __lc->_M_falsename_size == 0;
15676 bool __donet = __lc->_M_truename_size == 0;
15677 bool __testeof = false;
15678 size_t __n = 0;
15679 while (!__donef || !__donet)
15680 {
15681 if (__beg == __end)
15682 {
15683 __testeof = true;
15684 break;
15685 }
15686 const char_type __c = *__beg;
15687 if (!__donef)
15688 __testf = __c == __lc->_M_falsename[__n];
15689 if (!__testf && __donet)
15690 break;
15691 if (!__donet)
15692 __testt = __c == __lc->_M_truename[__n];
15693 if (!__testt && __donef)
15694 break;
15695 if (!__testt && !__testf)
15696 break;
15697 ++__n;
15698 ++__beg;
15699 __donef = !__testf || __n >= __lc->_M_falsename_size;
15700 __donet = !__testt || __n >= __lc->_M_truename_size;
15701 }
15702 if (__testf && __n == __lc->_M_falsename_size && __n)
15703 {
15704 __v = false;
15705 if (__testt && __n == __lc->_M_truename_size)
15706 __err = ios_base::failbit;
15707 else
15708 __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
15709 }
15710 else if (__testt && __n == __lc->_M_truename_size && __n)
15711 {
15712 __v = true;
15713 __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
15714 }
15715 else
15716 {
15717 __v = false;
15718 __err = ios_base::failbit;
15719 if (__testeof)
15720 __err |= ios_base::eofbit;
15721 }
15722 }
15723 return __beg;
15724 }
15725 template<typename _CharT, typename _InIter>
15726 _InIter
15727 num_get<_CharT, _InIter>::
15728 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15729 ios_base::iostate& __err, float& __v) const
15730 {
15731 string __xtrc;
15732 __xtrc.reserve(32);
15733 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
15734 std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
15735 if (__beg == __end)
15736 __err |= ios_base::eofbit;
15737 return __beg;
15738 }
15739 template<typename _CharT, typename _InIter>
15740 _InIter
15741 num_get<_CharT, _InIter>::
15742 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15743 ios_base::iostate& __err, double& __v) const
15744 {
15745 string __xtrc;
15746 __xtrc.reserve(32);
15747 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
15748 std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
15749 if (__beg == __end)
15750 __err |= ios_base::eofbit;
15751 return __beg;
15752 }
15753 template<typename _CharT, typename _InIter>
15754 _InIter
15755 num_get<_CharT, _InIter>::
15756 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15757 ios_base::iostate& __err, long double& __v) const
15758 {
15759 string __xtrc;
15760 __xtrc.reserve(32);
15761 __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
15762 std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
15763 if (__beg == __end)
15764 __err |= ios_base::eofbit;
15765 return __beg;
15766 }
15767 template<typename _CharT, typename _InIter>
15768 _InIter
15769 num_get<_CharT, _InIter>::
15770 do_get(iter_type __beg, iter_type __end, ios_base& __io,
15771 ios_base::iostate& __err, void*& __v) const
15772 {
15773 typedef ios_base::fmtflags fmtflags;
15774 const fmtflags __fmt = __io.flags();
15775 __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
15776 typedef __gnu_cxx::__conditional_type<(sizeof(void*)
15777 <= sizeof(unsigned long)),
15778 unsigned long, unsigned long long>::__type _UIntPtrType;
15779 _UIntPtrType __ul;
15780 __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
15781 __io.flags(__fmt);
15782 __v = reinterpret_cast<void*>(__ul);
15783 return __beg;
15784 }
15785 template<typename _CharT, typename _OutIter>
15786 void
15787 num_put<_CharT, _OutIter>::
15788 _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
15789 _CharT* __new, const _CharT* __cs, int& __len) const
15790 {
15791 __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
15792 __cs, __w, __len);
15793 __len = static_cast<int>(__w);
15794 }
15795 template<typename _CharT, typename _ValueT>
15796 int
15797 __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
15798 ios_base::fmtflags __flags, bool __dec)
15799 {
15800 _CharT* __buf = __bufend;
15801 if (__builtin_expect(__dec, true))
15802 {
15803 do
15804 {
15805 *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
15806 __v /= 10;
15807 }
15808 while (__v != 0);
15809 }
15810 else if ((__flags & ios_base::basefield) == ios_base::oct)
15811 {
15812 do
15813 {
15814 *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
15815 __v >>= 3;
15816 }
15817 while (__v != 0);
15818 }
15819 else
15820 {
15821 const bool __uppercase = __flags & ios_base::uppercase;
15822 const int __case_offset = __uppercase ? __num_base::_S_oudigits
15823 : __num_base::_S_odigits;
15824 do
15825 {
15826 *--__buf = __lit[(__v & 0xf) + __case_offset];
15827 __v >>= 4;
15828 }
15829 while (__v != 0);
15830 }
15831 return __bufend - __buf;
15832 }
15833 template<typename _CharT, typename _OutIter>
15834 void
15835 num_put<_CharT, _OutIter>::
15836 _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
15837 ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
15838 {
15839 _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
15840 __grouping_size, __cs, __cs + __len);
15841 __len = __p - __new;
15842 }
15843 template<typename _CharT, typename _OutIter>
15844 template<typename _ValueT>
15845 _OutIter
15846 num_put<_CharT, _OutIter>::
15847 _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
15848 _ValueT __v) const
15849 {
15850 using __gnu_cxx::__add_unsigned;
15851 typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
15852 typedef __numpunct_cache<_CharT> __cache_type;
15853 __use_cache<__cache_type> __uc;
15854 const locale& __loc = __io._M_getloc();
15855 const __cache_type* __lc = __uc(__loc);
15856 const _CharT* __lit = __lc->_M_atoms_out;
15857 const ios_base::fmtflags __flags = __io.flags();
15858 const int __ilen = 5 * sizeof(_ValueT);
15859 _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
15860 * __ilen));
15861 const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
15862 const bool __dec = (__basefield != ios_base::oct
15863 && __basefield != ios_base::hex);
15864 const __unsigned_type __u = ((__v > 0 || !__dec)
15865 ? __unsigned_type(__v)
15866 : -__unsigned_type(__v));
15867 int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
15868 __cs += __ilen - __len;
15869 if (__lc->_M_use_grouping)
15870 {
15871 _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
15872 * (__len + 1)
15873 * 2));
15874 _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
15875 __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
15876 __cs = __cs2 + 2;
15877 }
15878 if (__builtin_expect(__dec, true))
15879 {
15880 if (__v >= 0)
15881 {
15882 if (bool(__flags & ios_base::showpos)
15883 && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
15884 *--__cs = __lit[__num_base::_S_oplus], ++__len;
15885 }
15886 else
15887 *--__cs = __lit[__num_base::_S_ominus], ++__len;
15888 }
15889 else if (bool(__flags & ios_base::showbase) && __v)
15890 {
15891 if (__basefield == ios_base::oct)
15892 *--__cs = __lit[__num_base::_S_odigits], ++__len;
15893 else
15894 {
15895 const bool __uppercase = __flags & ios_base::uppercase;
15896 *--__cs = __lit[__num_base::_S_ox + __uppercase];
15897 *--__cs = __lit[__num_base::_S_odigits];
15898 __len += 2;
15899 }
15900 }
15901 const streamsize __w = __io.width();
15902 if (__w > static_cast<streamsize>(__len))
15903 {
15904 _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
15905 * __w));
15906 _M_pad(__fill, __w, __io, __cs3, __cs, __len);
15907 __cs = __cs3;
15908 }
15909 __io.width(0);
15910 return std::__write(__s, __cs, __len);
15911 }
15912 template<typename _CharT, typename _OutIter>
15913 void
15914 num_put<_CharT, _OutIter>::
15915 _M_group_float(const char* __grouping, size_t __grouping_size,
15916 _CharT __sep, const _CharT* __p, _CharT* __new,
15917 _CharT* __cs, int& __len) const
15918 {
15919 const int __declen = __p ? __p - __cs : __len;
15920 _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
15921 __grouping_size,
15922 __cs, __cs + __declen);
15923 int __newlen = __p2 - __new;
15924 if (__p)
15925 {
15926 char_traits<_CharT>::copy(__p2, __p, __len - __declen);
15927 __newlen += __len - __declen;
15928 }
15929 __len = __newlen;
15930 }
15931 template<typename _CharT, typename _OutIter>
15932 template<typename _ValueT>
15933 _OutIter
15934 num_put<_CharT, _OutIter>::
15935 _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
15936 _ValueT __v) const
15937 {
15938 typedef __numpunct_cache<_CharT> __cache_type;
15939 __use_cache<__cache_type> __uc;
15940 const locale& __loc = __io._M_getloc();
15941 const __cache_type* __lc = __uc(__loc);
15942 const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
15943 const int __max_digits =
15944 __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
15945 int __len;
15946 char __fbuf[16];
15947 __num_base::_S_format_float(__io, __fbuf, __mod);
15948 int __cs_size = __max_digits * 3;
15949 char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
15950 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
15951 __fbuf, __prec, __v);
15952 if (__len >= __cs_size)
15953 {
15954 __cs_size = __len + 1;
15955 __cs = static_cast<char*>(__builtin_alloca(__cs_size));
15956 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
15957 __fbuf, __prec, __v);
15958 }
15959 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
15960 _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
15961 * __len));
15962 __ctype.widen(__cs, __cs + __len, __ws);
15963 _CharT* __wp = 0;
15964 const char* __p = char_traits<char>::find(__cs, __len, '.');
15965 if (__p)
15966 {
15967 __wp = __ws + (__p - __cs);
15968 *__wp = __lc->_M_decimal_point;
15969 }
15970 if (__lc->_M_use_grouping
15971 && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
15972 && __cs[1] >= '0' && __cs[2] >= '0')))
15973 {
15974 _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
15975 * __len * 2));
15976 streamsize __off = 0;
15977 if (__cs[0] == '-' || __cs[0] == '+')
15978 {
15979 __off = 1;
15980 __ws2[0] = __ws[0];
15981 __len -= 1;
15982 }
15983 _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
15984 __lc->_M_thousands_sep, __wp, __ws2 + __off,
15985 __ws + __off, __len);
15986 __len += __off;
15987 __ws = __ws2;
15988 }
15989 const streamsize __w = __io.width();
15990 if (__w > static_cast<streamsize>(__len))
15991 {
15992 _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
15993 * __w));
15994 _M_pad(__fill, __w, __io, __ws3, __ws, __len);
15995 __ws = __ws3;
15996 }
15997 __io.width(0);
15998 return std::__write(__s, __ws, __len);
15999 }
16000 template<typename _CharT, typename _OutIter>
16001 _OutIter
16002 num_put<_CharT, _OutIter>::
16003 do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
16004 {
16005 const ios_base::fmtflags __flags = __io.flags();
16006 if ((__flags & ios_base::boolalpha) == 0)
16007 {
16008 const long __l = __v;
16009 __s = _M_insert_int(__s, __io, __fill, __l);
16010 }
16011 else
16012 {
16013 typedef __numpunct_cache<_CharT> __cache_type;
16014 __use_cache<__cache_type> __uc;
16015 const locale& __loc = __io._M_getloc();
16016 const __cache_type* __lc = __uc(__loc);
16017 const _CharT* __name = __v ? __lc->_M_truename
16018 : __lc->_M_falsename;
16019 int __len = __v ? __lc->_M_truename_size
16020 : __lc->_M_falsename_size;
16021 const streamsize __w = __io.width();
16022 if (__w > static_cast<streamsize>(__len))
16023 {
16024 const streamsize __plen = __w - __len;
16025 _CharT* __ps
16026 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
16027 * __plen));
16028 char_traits<_CharT>::assign(__ps, __plen, __fill);
16029 __io.width(0);
16030 if ((__flags & ios_base::adjustfield) == ios_base::left)
16031 {
16032 __s = std::__write(__s, __name, __len);
16033 __s = std::__write(__s, __ps, __plen);
16034 }
16035 else
16036 {
16037 __s = std::__write(__s, __ps, __plen);
16038 __s = std::__write(__s, __name, __len);
16039 }
16040 return __s;
16041 }
16042 __io.width(0);
16043 __s = std::__write(__s, __name, __len);
16044 }
16045 return __s;
16046 }
16047 template<typename _CharT, typename _OutIter>
16048 _OutIter
16049 num_put<_CharT, _OutIter>::
16050 do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
16051 { return _M_insert_float(__s, __io, __fill, char(), __v); }
16052 template<typename _CharT, typename _OutIter>
16053 _OutIter
16054 num_put<_CharT, _OutIter>::
16055 do_put(iter_type __s, ios_base& __io, char_type __fill,
16056 long double __v) const
16057 { return _M_insert_float(__s, __io, __fill, 'L', __v); }
16058 template<typename _CharT, typename _OutIter>
16059 _OutIter
16060 num_put<_CharT, _OutIter>::
16061 do_put(iter_type __s, ios_base& __io, char_type __fill,
16062 const void* __v) const
16063 {
16064 const ios_base::fmtflags __flags = __io.flags();
16065 const ios_base::fmtflags __fmt = ~(ios_base::basefield
16066 | ios_base::uppercase);
16067 __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
16068 typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
16069 <= sizeof(unsigned long)),
16070 unsigned long, unsigned long long>::__type _UIntPtrType;
16071 __s = _M_insert_int(__s, __io, __fill,
16072 reinterpret_cast<_UIntPtrType>(__v));
16073 __io.flags(__flags);
16074 return __s;
16075 }
16076 template<typename _CharT, typename _Traits>
16077 void
16078 __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
16079 _CharT* __news, const _CharT* __olds,
16080 streamsize __newlen, streamsize __oldlen)
16081 {
16082 const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
16083 const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
16084 if (__adjust == ios_base::left)
16085 {
16086 _Traits::copy(__news, __olds, __oldlen);
16087 _Traits::assign(__news + __oldlen, __plen, __fill);
16088 return;
16089 }
16090 size_t __mod = 0;
16091 if (__adjust == ios_base::internal)
16092 {
16093 const locale& __loc = __io._M_getloc();
16094 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
16095 if (__ctype.widen('-') == __olds[0]
16096 || __ctype.widen('+') == __olds[0])
16097 {
16098 __news[0] = __olds[0];
16099 __mod = 1;
16100 ++__news;
16101 }
16102 else if (__ctype.widen('0') == __olds[0]
16103 && __oldlen > 1
16104 && (__ctype.widen('x') == __olds[1]
16105 || __ctype.widen('X') == __olds[1]))
16106 {
16107 __news[0] = __olds[0];
16108 __news[1] = __olds[1];
16109 __mod = 2;
16110 __news += 2;
16111 }
16112 }
16113 _Traits::assign(__news, __plen, __fill);
16114 _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
16115 }
16116 template<typename _CharT>
16117 _CharT*
16118 __add_grouping(_CharT* __s, _CharT __sep,
16119 const char* __gbeg, size_t __gsize,
16120 const _CharT* __first, const _CharT* __last)
16121 {
16122 size_t __idx = 0;
16123 size_t __ctr = 0;
16124 while (__last - __first > __gbeg[__idx]
16125 && static_cast<signed char>(__gbeg[__idx]) > 0
16126 && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
16127 {
16128 __last -= __gbeg[__idx];
16129 __idx < __gsize - 1 ? ++__idx : ++__ctr;
16130 }
16131 while (__first != __last)
16132 *__s++ = *__first++;
16133 while (__ctr--)
16134 {
16135 *__s++ = __sep;
16136 for (char __i = __gbeg[__idx]; __i > 0; --__i)
16137 *__s++ = *__first++;
16138 }
16139 while (__idx--)
16140 {
16141 *__s++ = __sep;
16142 for (char __i = __gbeg[__idx]; __i > 0; --__i)
16143 *__s++ = *__first++;
16144 }
16145 return __s;
16146 }
16147 extern template class numpunct<char>;
16148 extern template class numpunct_byname<char>;
16149 extern template class num_get<char>;
16150 extern template class num_put<char>;
16151 extern template class ctype_byname<char>;
16152 extern template
16153 const ctype<char>&
16154 use_facet<ctype<char> >(const locale&);
16155 extern template
16156 const numpunct<char>&
16157 use_facet<numpunct<char> >(const locale&);
16158 extern template
16159 const num_put<char>&
16160 use_facet<num_put<char> >(const locale&);
16161 extern template
16162 const num_get<char>&
16163 use_facet<num_get<char> >(const locale&);
16164 extern template
16165 bool
16166 has_facet<ctype<char> >(const locale&);
16167 extern template
16168 bool
16169 has_facet<numpunct<char> >(const locale&);
16170 extern template
16171 bool
16172 has_facet<num_put<char> >(const locale&);
16173 extern template
16174 bool
16175 has_facet<num_get<char> >(const locale&);
16176 extern template class numpunct<wchar_t>;
16177 extern template class numpunct_byname<wchar_t>;
16178 extern template class num_get<wchar_t>;
16179 extern template class num_put<wchar_t>;
16180 extern template class ctype_byname<wchar_t>;
16181 extern template
16182 const ctype<wchar_t>&
16183 use_facet<ctype<wchar_t> >(const locale&);
16184 extern template
16185 const numpunct<wchar_t>&
16186 use_facet<numpunct<wchar_t> >(const locale&);
16187 extern template
16188 const num_put<wchar_t>&
16189 use_facet<num_put<wchar_t> >(const locale&);
16190 extern template
16191 const num_get<wchar_t>&
16192 use_facet<num_get<wchar_t> >(const locale&);
16193 extern template
16194 bool
16195 has_facet<ctype<wchar_t> >(const locale&);
16196 extern template
16197 bool
16198 has_facet<numpunct<wchar_t> >(const locale&);
16199 extern template
16200 bool
16201 has_facet<num_put<wchar_t> >(const locale&);
16202 extern template
16203 bool
16204 has_facet<num_get<wchar_t> >(const locale&);
16205 }
16206 namespace std __attribute__ ((__visibility__ ("default"))) {
16207 template<typename _Facet>
16208 inline const _Facet&
16209 __check_facet(const _Facet* __f)
16210 {
16211 if (!__f)
16212 __throw_bad_cast();
16213 return *__f;
16214 }
16215 template<typename _CharT, typename _Traits>
16216 class basic_ios : public ios_base
16217 {
16218 public:
16219 typedef _CharT char_type;
16220 typedef typename _Traits::int_type int_type;
16221 typedef typename _Traits::pos_type pos_type;
16222 typedef typename _Traits::off_type off_type;
16223 typedef _Traits traits_type;
16224 typedef ctype<_CharT> __ctype_type;
16225 typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
16226 __num_put_type;
16227 typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
16228 __num_get_type;
16229 public:
16230 basic_ostream<_CharT, _Traits>* _M_tie;
16231 mutable char_type _M_fill;
16232 mutable bool _M_fill_init;
16233 basic_streambuf<_CharT, _Traits>* _M_streambuf;
16234 const __ctype_type* _M_ctype;
16235 const __num_put_type* _M_num_put;
16236 const __num_get_type* _M_num_get;
16237 public:
16238 operator void*() const
16239 { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
16240 bool
16241 operator!() const
16242 { return this->fail(); }
16243 iostate
16244 rdstate() const
16245 { return _M_streambuf_state; }
16246 void
16247 clear(iostate __state = goodbit);
16248 void
16249 setstate(iostate __state)
16250 { this->clear(this->rdstate() | __state); }
16251 void
16252 _M_setstate(iostate __state)
16253 {
16254 _M_streambuf_state |= __state;
16255 if (this->exceptions() & __state)
16256 throw;
16257 }
16258 bool
16259 good() const
16260 { return this->rdstate() == 0; }
16261 bool
16262 eof() const
16263 { return (this->rdstate() & eofbit) != 0; }
16264 bool
16265 fail() const
16266 { return (this->rdstate() & (badbit | failbit)) != 0; }
16267 bool
16268 bad() const
16269 { return (this->rdstate() & badbit) != 0; }
16270 iostate
16271 exceptions() const
16272 { return _M_exception; }
16273 void
16274 exceptions(iostate __except)
16275 {
16276 _M_exception = __except;
16277 this->clear(_M_streambuf_state);
16278 }
16279 explicit
16280 basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
16281 : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
16282 _M_ctype(0), _M_num_put(0), _M_num_get(0)
16283 { this->init(__sb); }
16284 virtual
16285 ~basic_ios() { }
16286 basic_ostream<_CharT, _Traits>*
16287 tie() const
16288 { return _M_tie; }
16289 basic_ostream<_CharT, _Traits>*
16290 tie(basic_ostream<_CharT, _Traits>* __tiestr)
16291 {
16292 basic_ostream<_CharT, _Traits>* __old = _M_tie;
16293 _M_tie = __tiestr;
16294 return __old;
16295 }
16296 basic_streambuf<_CharT, _Traits>*
16297 rdbuf() const
16298 { return _M_streambuf; }
16299 basic_streambuf<_CharT, _Traits>*
16300 rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
16301 basic_ios&
16302 copyfmt(const basic_ios& __rhs);
16303 char_type
16304 fill() const
16305 {
16306 if (!_M_fill_init)
16307 {
16308 _M_fill = this->widen(' ');
16309 _M_fill_init = true;
16310 }
16311 return _M_fill;
16312 }
16313 char_type
16314 fill(char_type __ch)
16315 {
16316 char_type __old = this->fill();
16317 _M_fill = __ch;
16318 return __old;
16319 }
16320 locale
16321 imbue(const locale& __loc);
16322 char
16323 narrow(char_type __c, char __dfault) const
16324 { return __check_facet(_M_ctype).narrow(__c, __dfault); }
16325 char_type
16326 widen(char __c) const
16327 { return __check_facet(_M_ctype).widen(__c); }
16328 public:
16329 basic_ios()
16330 : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
16331 _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
16332 { }
16333 void
16334 init(basic_streambuf<_CharT, _Traits>* __sb);
16335 void
16336 _M_cache_locale(const locale& __loc);
16337 };
16338 }
16339
16340 namespace std __attribute__ ((__visibility__ ("default"))) {
16341 template<typename _CharT, typename _Traits>
16342 void
16343 basic_ios<_CharT, _Traits>::clear(iostate __state)
16344 {
16345 if (this->rdbuf())
16346 _M_streambuf_state = __state;
16347 else
16348 _M_streambuf_state = __state | badbit;
16349 if (this->exceptions() & this->rdstate())
16350 __throw_ios_failure(("basic_ios::clear"));
16351 }
16352 template<typename _CharT, typename _Traits>
16353 basic_streambuf<_CharT, _Traits>*
16354 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
16355 {
16356 basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
16357 _M_streambuf = __sb;
16358 this->clear();
16359 return __old;
16360 }
16361 template<typename _CharT, typename _Traits>
16362 basic_ios<_CharT, _Traits>&
16363 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
16364 {
16365 if (this != &__rhs)
16366 {
16367 _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
16368 _M_local_word : new _Words[__rhs._M_word_size];
16369 _Callback_list* __cb = __rhs._M_callbacks;
16370 if (__cb)
16371 __cb->_M_add_reference();
16372 _M_call_callbacks(erase_event);
16373 if (_M_word != _M_local_word)
16374 {
16375 delete [] _M_word;
16376 _M_word = 0;
16377 }
16378 _M_dispose_callbacks();
16379 _M_callbacks = __cb;
16380 for (int __i = 0; __i < __rhs._M_word_size; ++__i)
16381 __words[__i] = __rhs._M_word[__i];
16382 _M_word = __words;
16383 _M_word_size = __rhs._M_word_size;
16384 this->flags(__rhs.flags());
16385 this->width(__rhs.width());
16386 this->precision(__rhs.precision());
16387 this->tie(__rhs.tie());
16388 this->fill(__rhs.fill());
16389 _M_ios_locale = __rhs.getloc();
16390 _M_cache_locale(_M_ios_locale);
16391 _M_call_callbacks(copyfmt_event);
16392 this->exceptions(__rhs.exceptions());
16393 }
16394 return *this;
16395 }
16396 template<typename _CharT, typename _Traits>
16397 locale
16398 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
16399 {
16400 locale __old(this->getloc());
16401 ios_base::imbue(__loc);
16402 _M_cache_locale(__loc);
16403 if (this->rdbuf() != 0)
16404 this->rdbuf()->pubimbue(__loc);
16405 return __old;
16406 }
16407 template<typename _CharT, typename _Traits>
16408 void
16409 basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
16410 {
16411 ios_base::_M_init();
16412 _M_cache_locale(_M_ios_locale);
16413 _M_fill = _CharT();
16414 _M_fill_init = false;
16415 _M_tie = 0;
16416 _M_exception = goodbit;
16417 _M_streambuf = __sb;
16418 _M_streambuf_state = __sb ? goodbit : badbit;
16419 }
16420 template<typename _CharT, typename _Traits>
16421 void
16422 basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
16423 {
16424 if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
16425 _M_ctype = &use_facet<__ctype_type>(__loc);
16426 else
16427 _M_ctype = 0;
16428 if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
16429 _M_num_put = &use_facet<__num_put_type>(__loc);
16430 else
16431 _M_num_put = 0;
16432 if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
16433 _M_num_get = &use_facet<__num_get_type>(__loc);
16434 else
16435 _M_num_get = 0;
16436 }
16437 extern template class basic_ios<char>;
16438 extern template class basic_ios<wchar_t>;
16439 }
16440 namespace std __attribute__ ((__visibility__ ("default"))) {
16441 template<typename _CharT, typename _Traits>
16442 class basic_ostream : virtual public basic_ios<_CharT, _Traits>
16443 {
16444 public:
16445 typedef _CharT char_type;
16446 typedef typename _Traits::int_type int_type;
16447 typedef typename _Traits::pos_type pos_type;
16448 typedef typename _Traits::off_type off_type;
16449 typedef _Traits traits_type;
16450 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
16451 typedef basic_ios<_CharT, _Traits> __ios_type;
16452 typedef basic_ostream<_CharT, _Traits> __ostream_type;
16453 typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
16454 __num_put_type;
16455 typedef ctype<_CharT> __ctype_type;
16456 explicit
16457 basic_ostream(__streambuf_type* __sb)
16458 { this->init(__sb); }
16459 virtual
16460 ~basic_ostream() { }
16461 class sentry;
16462 friend class sentry;
16463 __ostream_type&
16464 operator<<(__ostream_type& (*__pf)(__ostream_type&))
16465 {
16466 return __pf(*this);
16467 }
16468 __ostream_type&
16469 operator<<(__ios_type& (*__pf)(__ios_type&))
16470 {
16471 __pf(*this);
16472 return *this;
16473 }
16474 __ostream_type&
16475 operator<<(ios_base& (*__pf) (ios_base&))
16476 {
16477 __pf(*this);
16478 return *this;
16479 }
16480 __ostream_type&
16481 operator<<(long __n)
16482 { return _M_insert(__n); }
16483 __ostream_type&
16484 operator<<(unsigned long __n)
16485 { return _M_insert(__n); }
16486 __ostream_type&
16487 operator<<(bool __n)
16488 { return _M_insert(__n); }
16489 __ostream_type&
16490 operator<<(short __n);
16491 __ostream_type&
16492 operator<<(unsigned short __n)
16493 {
16494 return _M_insert(static_cast<unsigned long>(__n));
16495 }
16496 __ostream_type&
16497 operator<<(int __n);
16498 __ostream_type&
16499 operator<<(unsigned int __n)
16500 {
16501 return _M_insert(static_cast<unsigned long>(__n));
16502 }
16503 __ostream_type&
16504 operator<<(long long __n)
16505 { return _M_insert(__n); }
16506 __ostream_type&
16507 operator<<(unsigned long long __n)
16508 { return _M_insert(__n); }
16509 __ostream_type&
16510 operator<<(double __f)
16511 { return _M_insert(__f); }
16512 __ostream_type&
16513 operator<<(float __f)
16514 {
16515 return _M_insert(static_cast<double>(__f));
16516 }
16517 __ostream_type&
16518 operator<<(long double __f)
16519 { return _M_insert(__f); }
16520 __ostream_type&
16521 operator<<(const void* __p)
16522 { return _M_insert(__p); }
16523 __ostream_type&
16524 operator<<(__streambuf_type* __sb);
16525 __ostream_type&
16526 put(char_type __c);
16527 void
16528 _M_write(const char_type* __s, streamsize __n)
16529 {
16530 const streamsize __put = this->rdbuf()->sputn(__s, __n);
16531 if (__put != __n)
16532 this->setstate(ios_base::badbit);
16533 }
16534 __ostream_type&
16535 write(const char_type* __s, streamsize __n);
16536 __ostream_type&
16537 flush();
16538 pos_type
16539 tellp();
16540 __ostream_type&
16541 seekp(pos_type);
16542 __ostream_type&
16543 seekp(off_type, ios_base::seekdir);
16544 public:
16545 basic_ostream()
16546 { this->init(0); }
16547 template<typename _ValueT>
16548 __ostream_type&
16549 _M_insert(_ValueT __v);
16550 };
16551 template <typename _CharT, typename _Traits>
16552 class basic_ostream<_CharT, _Traits>::sentry
16553 {
16554 bool _M_ok;
16555 basic_ostream<_CharT, _Traits>& _M_os;
16556 public:
16557 explicit
16558 sentry(basic_ostream<_CharT, _Traits>& __os);
16559 ~sentry()
16560 {
16561 if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
16562 {
16563 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
16564 _M_os.setstate(ios_base::badbit);
16565 }
16566 }
16567 operator bool() const
16568 { return _M_ok; }
16569 };
16570 template<typename _CharT, typename _Traits>
16571 inline basic_ostream<_CharT, _Traits>&
16572 operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
16573 { return __ostream_insert(__out, &__c, 1); }
16574 template<typename _CharT, typename _Traits>
16575 inline basic_ostream<_CharT, _Traits>&
16576 operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
16577 { return (__out << __out.widen(__c)); }
16578 template <class _Traits>
16579 inline basic_ostream<char, _Traits>&
16580 operator<<(basic_ostream<char, _Traits>& __out, char __c)
16581 { return __ostream_insert(__out, &__c, 1); }
16582 template<class _Traits>
16583 inline basic_ostream<char, _Traits>&
16584 operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
16585 { return (__out << static_cast<char>(__c)); }
16586 template<class _Traits>
16587 inline basic_ostream<char, _Traits>&
16588 operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
16589 { return (__out << static_cast<char>(__c)); }
16590 template<typename _CharT, typename _Traits>
16591 inline basic_ostream<_CharT, _Traits>&
16592 operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
16593 {
16594 if (!__s)
16595 __out.setstate(ios_base::badbit);
16596 else
16597 __ostream_insert(__out, __s,
16598 static_cast<streamsize>(_Traits::length(__s)));
16599 return __out;
16600 }
16601 template<typename _CharT, typename _Traits>
16602 basic_ostream<_CharT, _Traits> &
16603 operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
16604 template<class _Traits>
16605 inline basic_ostream<char, _Traits>&
16606 operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
16607 {
16608 if (!__s)
16609 __out.setstate(ios_base::badbit);
16610 else
16611 __ostream_insert(__out, __s,
16612 static_cast<streamsize>(_Traits::length(__s)));
16613 return __out;
16614 }
16615 template<class _Traits>
16616 inline basic_ostream<char, _Traits>&
16617 operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
16618 { return (__out << reinterpret_cast<const char*>(__s)); }
16619 template<class _Traits>
16620 inline basic_ostream<char, _Traits> &
16621 operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
16622 { return (__out << reinterpret_cast<const char*>(__s)); }
16623 template<typename _CharT, typename _Traits>
16624 inline basic_ostream<_CharT, _Traits>&
16625 endl(basic_ostream<_CharT, _Traits>& __os)
16626 { return flush(__os.put(__os.widen('\n'))); }
16627 template<typename _CharT, typename _Traits>
16628 inline basic_ostream<_CharT, _Traits>&
16629 ends(basic_ostream<_CharT, _Traits>& __os)
16630 { return __os.put(_CharT()); }
16631 template<typename _CharT, typename _Traits>
16632 inline basic_ostream<_CharT, _Traits>&
16633 flush(basic_ostream<_CharT, _Traits>& __os)
16634 { return __os.flush(); }
16635 }
16636
16637 namespace std __attribute__ ((__visibility__ ("default"))) {
16638 template<typename _CharT, typename _Traits>
16639 basic_ostream<_CharT, _Traits>::sentry::
16640 sentry(basic_ostream<_CharT, _Traits>& __os)
16641 : _M_ok(false), _M_os(__os)
16642 {
16643 if (__os.tie() && __os.good())
16644 __os.tie()->flush();
16645 if (__os.good())
16646 _M_ok = true;
16647 else
16648 __os.setstate(ios_base::failbit);
16649 }
16650 template<typename _CharT, typename _Traits>
16651 template<typename _ValueT>
16652 basic_ostream<_CharT, _Traits>&
16653 basic_ostream<_CharT, _Traits>::
16654 _M_insert(_ValueT __v)
16655 {
16656 sentry __cerb(*this);
16657 if (__cerb)
16658 {
16659 ios_base::iostate __err = ios_base::goodbit;
16660 try
16661 {
16662 const __num_put_type& __np = __check_facet(this->_M_num_put);
16663 if (__np.put(*this, *this, this->fill(), __v).failed())
16664 __err |= ios_base::badbit;
16665 }
16666 catch(__cxxabiv1::__forced_unwind&)
16667 {
16668 this->_M_setstate(ios_base::badbit);
16669 throw;
16670 }
16671 catch(...)
16672 { this->_M_setstate(ios_base::badbit); }
16673 if (__err)
16674 this->setstate(__err);
16675 }
16676 return *this;
16677 }
16678 template<typename _CharT, typename _Traits>
16679 basic_ostream<_CharT, _Traits>&
16680 basic_ostream<_CharT, _Traits>::
16681 operator<<(short __n)
16682 {
16683 const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
16684 if (__fmt == ios_base::oct || __fmt == ios_base::hex)
16685 return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
16686 else
16687 return _M_insert(static_cast<long>(__n));
16688 }
16689 template<typename _CharT, typename _Traits>
16690 basic_ostream<_CharT, _Traits>&
16691 basic_ostream<_CharT, _Traits>::
16692 operator<<(int __n)
16693 {
16694 const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
16695 if (__fmt == ios_base::oct || __fmt == ios_base::hex)
16696 return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
16697 else
16698 return _M_insert(static_cast<long>(__n));
16699 }
16700 template<typename _CharT, typename _Traits>
16701 basic_ostream<_CharT, _Traits>&
16702 basic_ostream<_CharT, _Traits>::
16703 operator<<(__streambuf_type* __sbin)
16704 {
16705 ios_base::iostate __err = ios_base::goodbit;
16706 sentry __cerb(*this);
16707 if (__cerb && __sbin)
16708 {
16709 try
16710 {
16711 if (!__copy_streambufs(__sbin, this->rdbuf()))
16712 __err |= ios_base::failbit;
16713 }
16714 catch(__cxxabiv1::__forced_unwind&)
16715 {
16716 this->_M_setstate(ios_base::badbit);
16717 throw;
16718 }
16719 catch(...)
16720 { this->_M_setstate(ios_base::failbit); }
16721 }
16722 else if (!__sbin)
16723 __err |= ios_base::badbit;
16724 if (__err)
16725 this->setstate(__err);
16726 return *this;
16727 }
16728 template<typename _CharT, typename _Traits>
16729 basic_ostream<_CharT, _Traits>&
16730 basic_ostream<_CharT, _Traits>::
16731 put(char_type __c)
16732 {
16733 sentry __cerb(*this);
16734 if (__cerb)
16735 {
16736 ios_base::iostate __err = ios_base::goodbit;
16737 try
16738 {
16739 const int_type __put = this->rdbuf()->sputc(__c);
16740 if (traits_type::eq_int_type(__put, traits_type::eof()))
16741 __err |= ios_base::badbit;
16742 }
16743 catch(__cxxabiv1::__forced_unwind&)
16744 {
16745 this->_M_setstate(ios_base::badbit);
16746 throw;
16747 }
16748 catch(...)
16749 { this->_M_setstate(ios_base::badbit); }
16750 if (__err)
16751 this->setstate(__err);
16752 }
16753 return *this;
16754 }
16755 template<typename _CharT, typename _Traits>
16756 basic_ostream<_CharT, _Traits>&
16757 basic_ostream<_CharT, _Traits>::
16758 write(const _CharT* __s, streamsize __n)
16759 {
16760 sentry __cerb(*this);
16761 if (__cerb)
16762 {
16763 try
16764 { _M_write(__s, __n); }
16765 catch(__cxxabiv1::__forced_unwind&)
16766 {
16767 this->_M_setstate(ios_base::badbit);
16768 throw;
16769 }
16770 catch(...)
16771 { this->_M_setstate(ios_base::badbit); }
16772 }
16773 return *this;
16774 }
16775 template<typename _CharT, typename _Traits>
16776 basic_ostream<_CharT, _Traits>&
16777 basic_ostream<_CharT, _Traits>::
16778 flush()
16779 {
16780 ios_base::iostate __err = ios_base::goodbit;
16781 try
16782 {
16783 if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
16784 __err |= ios_base::badbit;
16785 }
16786 catch(__cxxabiv1::__forced_unwind&)
16787 {
16788 this->_M_setstate(ios_base::badbit);
16789 throw;
16790 }
16791 catch(...)
16792 { this->_M_setstate(ios_base::badbit); }
16793 if (__err)
16794 this->setstate(__err);
16795 return *this;
16796 }
16797 template<typename _CharT, typename _Traits>
16798 typename basic_ostream<_CharT, _Traits>::pos_type
16799 basic_ostream<_CharT, _Traits>::
16800 tellp()
16801 {
16802 pos_type __ret = pos_type(-1);
16803 try
16804 {
16805 if (!this->fail())
16806 __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
16807 }
16808 catch(__cxxabiv1::__forced_unwind&)
16809 {
16810 this->_M_setstate(ios_base::badbit);
16811 throw;
16812 }
16813 catch(...)
16814 { this->_M_setstate(ios_base::badbit); }
16815 return __ret;
16816 }
16817 template<typename _CharT, typename _Traits>
16818 basic_ostream<_CharT, _Traits>&
16819 basic_ostream<_CharT, _Traits>::
16820 seekp(pos_type __pos)
16821 {
16822 ios_base::iostate __err = ios_base::goodbit;
16823 try
16824 {
16825 if (!this->fail())
16826 {
16827 const pos_type __p = this->rdbuf()->pubseekpos(__pos,
16828 ios_base::out);
16829 if (__p == pos_type(off_type(-1)))
16830 __err |= ios_base::failbit;
16831 }
16832 }
16833 catch(__cxxabiv1::__forced_unwind&)
16834 {
16835 this->_M_setstate(ios_base::badbit);
16836 throw;
16837 }
16838 catch(...)
16839 { this->_M_setstate(ios_base::badbit); }
16840 if (__err)
16841 this->setstate(__err);
16842 return *this;
16843 }
16844 template<typename _CharT, typename _Traits>
16845 basic_ostream<_CharT, _Traits>&
16846 basic_ostream<_CharT, _Traits>::
16847 seekp(off_type __off, ios_base::seekdir __dir)
16848 {
16849 ios_base::iostate __err = ios_base::goodbit;
16850 try
16851 {
16852 if (!this->fail())
16853 {
16854 const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
16855 ios_base::out);
16856 if (__p == pos_type(off_type(-1)))
16857 __err |= ios_base::failbit;
16858 }
16859 }
16860 catch(__cxxabiv1::__forced_unwind&)
16861 {
16862 this->_M_setstate(ios_base::badbit);
16863 throw;
16864 }
16865 catch(...)
16866 { this->_M_setstate(ios_base::badbit); }
16867 if (__err)
16868 this->setstate(__err);
16869 return *this;
16870 }
16871 template<typename _CharT, typename _Traits>
16872 basic_ostream<_CharT, _Traits>&
16873 operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
16874 {
16875 if (!__s)
16876 __out.setstate(ios_base::badbit);
16877 else
16878 {
16879 const size_t __clen = char_traits<char>::length(__s);
16880 try
16881 {
16882 struct __ptr_guard
16883 {
16884 _CharT *__p;
16885 __ptr_guard (_CharT *__ip): __p(__ip) { }
16886 ~__ptr_guard() { delete[] __p; }
16887 _CharT* __get() { return __p; }
16888 } __pg (new _CharT[__clen]);
16889 _CharT *__ws = __pg.__get();
16890 for (size_t __i = 0; __i < __clen; ++__i)
16891 __ws[__i] = __out.widen(__s[__i]);
16892 __ostream_insert(__out, __ws, __clen);
16893 }
16894 catch(__cxxabiv1::__forced_unwind&)
16895 {
16896 __out._M_setstate(ios_base::badbit);
16897 throw;
16898 }
16899 catch(...)
16900 { __out._M_setstate(ios_base::badbit); }
16901 }
16902 return __out;
16903 }
16904 extern template class basic_ostream<char>;
16905 extern template ostream& endl(ostream&);
16906 extern template ostream& ends(ostream&);
16907 extern template ostream& flush(ostream&);
16908 extern template ostream& operator<<(ostream&, char);
16909 extern template ostream& operator<<(ostream&, unsigned char);
16910 extern template ostream& operator<<(ostream&, signed char);
16911 extern template ostream& operator<<(ostream&, const char*);
16912 extern template ostream& operator<<(ostream&, const unsigned char*);
16913 extern template ostream& operator<<(ostream&, const signed char*);
16914 extern template ostream& ostream::_M_insert(long);
16915 extern template ostream& ostream::_M_insert(unsigned long);
16916 extern template ostream& ostream::_M_insert(bool);
16917 extern template ostream& ostream::_M_insert(long long);
16918 extern template ostream& ostream::_M_insert(unsigned long long);
16919 extern template ostream& ostream::_M_insert(double);
16920 extern template ostream& ostream::_M_insert(long double);
16921 extern template ostream& ostream::_M_insert(const void*);
16922 extern template class basic_ostream<wchar_t>;
16923 extern template wostream& endl(wostream&);
16924 extern template wostream& ends(wostream&);
16925 extern template wostream& flush(wostream&);
16926 extern template wostream& operator<<(wostream&, wchar_t);
16927 extern template wostream& operator<<(wostream&, char);
16928 extern template wostream& operator<<(wostream&, const wchar_t*);
16929 extern template wostream& operator<<(wostream&, const char*);
16930 extern template wostream& wostream::_M_insert(long);
16931 extern template wostream& wostream::_M_insert(unsigned long);
16932 extern template wostream& wostream::_M_insert(bool);
16933 extern template wostream& wostream::_M_insert(long long);
16934 extern template wostream& wostream::_M_insert(unsigned long long);
16935 extern template wostream& wostream::_M_insert(double);
16936 extern template wostream& wostream::_M_insert(long double);
16937 extern template wostream& wostream::_M_insert(const void*);
16938 }
16939
16940 namespace std __attribute__ ((__visibility__ ("default"))) {
16941 template<typename _CharT, typename _Traits>
16942 class basic_istream : virtual public basic_ios<_CharT, _Traits>
16943 {
16944 public:
16945 typedef _CharT char_type;
16946 typedef typename _Traits::int_type int_type;
16947 typedef typename _Traits::pos_type pos_type;
16948 typedef typename _Traits::off_type off_type;
16949 typedef _Traits traits_type;
16950 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
16951 typedef basic_ios<_CharT, _Traits> __ios_type;
16952 typedef basic_istream<_CharT, _Traits> __istream_type;
16953 typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
16954 __num_get_type;
16955 typedef ctype<_CharT> __ctype_type;
16956 public:
16957 streamsize _M_gcount;
16958 public:
16959 explicit
16960 basic_istream(__streambuf_type* __sb)
16961 : _M_gcount(streamsize(0))
16962 { this->init(__sb); }
16963 virtual
16964 ~basic_istream()
16965 { _M_gcount = streamsize(0); }
16966 class sentry;
16967 friend class sentry;
16968 __istream_type&
16969 operator>>(__istream_type& (*__pf)(__istream_type&))
16970 { return __pf(*this); }
16971 __istream_type&
16972 operator>>(__ios_type& (*__pf)(__ios_type&))
16973 {
16974 __pf(*this);
16975 return *this;
16976 }
16977 __istream_type&
16978 operator>>(ios_base& (*__pf)(ios_base&))
16979 {
16980 __pf(*this);
16981 return *this;
16982 }
16983 __istream_type&
16984 operator>>(bool& __n)
16985 { return _M_extract(__n); }
16986 __istream_type&
16987 operator>>(short& __n);
16988 __istream_type&
16989 operator>>(unsigned short& __n)
16990 { return _M_extract(__n); }
16991 __istream_type&
16992 operator>>(int& __n);
16993 __istream_type&
16994 operator>>(unsigned int& __n)
16995 { return _M_extract(__n); }
16996 __istream_type&
16997 operator>>(long& __n)
16998 { return _M_extract(__n); }
16999 __istream_type&
17000 operator>>(unsigned long& __n)
17001 { return _M_extract(__n); }
17002 __istream_type&
17003 operator>>(long long& __n)
17004 { return _M_extract(__n); }
17005 __istream_type&
17006 operator>>(unsigned long long& __n)
17007 { return _M_extract(__n); }
17008 __istream_type&
17009 operator>>(float& __f)
17010 { return _M_extract(__f); }
17011 __istream_type&
17012 operator>>(double& __f)
17013 { return _M_extract(__f); }
17014 __istream_type&
17015 operator>>(long double& __f)
17016 { return _M_extract(__f); }
17017 __istream_type&
17018 operator>>(void*& __p)
17019 { return _M_extract(__p); }
17020 __istream_type&
17021 operator>>(__streambuf_type* __sb);
17022 streamsize
17023 gcount() const
17024 { return _M_gcount; }
17025 int_type
17026 get();
17027 __istream_type&
17028 get(char_type& __c);
17029 __istream_type&
17030 get(char_type* __s, streamsize __n, char_type __delim);
17031 __istream_type&
17032 get(char_type* __s, streamsize __n)
17033 { return this->get(__s, __n, this->widen('\n')); }
17034 __istream_type&
17035 get(__streambuf_type& __sb, char_type __delim);
17036 __istream_type&
17037 get(__streambuf_type& __sb)
17038 { return this->get(__sb, this->widen('\n')); }
17039 __istream_type&
17040 getline(char_type* __s, streamsize __n, char_type __delim);
17041 __istream_type&
17042 getline(char_type* __s, streamsize __n)
17043 { return this->getline(__s, __n, this->widen('\n')); }
17044 __istream_type&
17045 ignore();
17046 __istream_type&
17047 ignore(streamsize __n);
17048 __istream_type&
17049 ignore(streamsize __n, int_type __delim);
17050 int_type
17051 peek();
17052 __istream_type&
17053 read(char_type* __s, streamsize __n);
17054 streamsize
17055 readsome(char_type* __s, streamsize __n);
17056 __istream_type&
17057 putback(char_type __c);
17058 __istream_type&
17059 unget();
17060 int
17061 sync();
17062 pos_type
17063 tellg();
17064 __istream_type&
17065 seekg(pos_type);
17066 __istream_type&
17067 seekg(off_type, ios_base::seekdir);
17068 public:
17069 basic_istream()
17070 : _M_gcount(streamsize(0))
17071 { this->init(0); }
17072 template<typename _ValueT>
17073 __istream_type&
17074 _M_extract(_ValueT& __v);
17075 };
17076 template<>
17077 basic_istream<char>&
17078 basic_istream<char>::
17079 getline(char_type* __s, streamsize __n, char_type __delim);
17080 template<>
17081 basic_istream<char>&
17082 basic_istream<char>::
17083 ignore(streamsize __n);
17084 template<>
17085 basic_istream<char>&
17086 basic_istream<char>::
17087 ignore(streamsize __n, int_type __delim);
17088 template<>
17089 basic_istream<wchar_t>&
17090 basic_istream<wchar_t>::
17091 getline(char_type* __s, streamsize __n, char_type __delim);
17092 template<>
17093 basic_istream<wchar_t>&
17094 basic_istream<wchar_t>::
17095 ignore(streamsize __n);
17096 template<>
17097 basic_istream<wchar_t>&
17098 basic_istream<wchar_t>::
17099 ignore(streamsize __n, int_type __delim);
17100 template<typename _CharT, typename _Traits>
17101 class basic_istream<_CharT, _Traits>::sentry
17102 {
17103 bool _M_ok;
17104 public:
17105 typedef _Traits traits_type;
17106 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
17107 typedef basic_istream<_CharT, _Traits> __istream_type;
17108 typedef typename __istream_type::__ctype_type __ctype_type;
17109 typedef typename _Traits::int_type __int_type;
17110 explicit
17111 sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
17112 operator bool() const
17113 { return _M_ok; }
17114 };
17115 template<typename _CharT, typename _Traits>
17116 basic_istream<_CharT, _Traits>&
17117 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
17118 template<class _Traits>
17119 inline basic_istream<char, _Traits>&
17120 operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
17121 { return (__in >> reinterpret_cast<char&>(__c)); }
17122 template<class _Traits>
17123 inline basic_istream<char, _Traits>&
17124 operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
17125 { return (__in >> reinterpret_cast<char&>(__c)); }
17126 template<typename _CharT, typename _Traits>
17127 basic_istream<_CharT, _Traits>&
17128 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
17129 template<>
17130 basic_istream<char>&
17131 operator>>(basic_istream<char>& __in, char* __s);
17132 template<class _Traits>
17133 inline basic_istream<char, _Traits>&
17134 operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
17135 { return (__in >> reinterpret_cast<char*>(__s)); }
17136 template<class _Traits>
17137 inline basic_istream<char, _Traits>&
17138 operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
17139 { return (__in >> reinterpret_cast<char*>(__s)); }
17140 template<typename _CharT, typename _Traits>
17141 class basic_iostream
17142 : public basic_istream<_CharT, _Traits>,
17143 public basic_ostream<_CharT, _Traits>
17144 {
17145 public:
17146 typedef _CharT char_type;
17147 typedef typename _Traits::int_type int_type;
17148 typedef typename _Traits::pos_type pos_type;
17149 typedef typename _Traits::off_type off_type;
17150 typedef _Traits traits_type;
17151 typedef basic_istream<_CharT, _Traits> __istream_type;
17152 typedef basic_ostream<_CharT, _Traits> __ostream_type;
17153 explicit
17154 basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
17155 : __istream_type(__sb), __ostream_type(__sb) { }
17156 virtual
17157 ~basic_iostream() { }
17158 public:
17159 basic_iostream()
17160 : __istream_type(), __ostream_type() { }
17161 };
17162 template<typename _CharT, typename _Traits>
17163 basic_istream<_CharT, _Traits>&
17164 ws(basic_istream<_CharT, _Traits>& __is);
17165 }
17166
17167 namespace std __attribute__ ((__visibility__ ("default"))) {
17168 template<typename _CharT, typename _Traits>
17169 basic_istream<_CharT, _Traits>::sentry::
17170 sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
17171 {
17172 ios_base::iostate __err = ios_base::goodbit;
17173 if (__in.good())
17174 {
17175 if (__in.tie())
17176 __in.tie()->flush();
17177 if (!__noskip && bool(__in.flags() & ios_base::skipws))
17178 {
17179 const __int_type __eof = traits_type::eof();
17180 __streambuf_type* __sb = __in.rdbuf();
17181 __int_type __c = __sb->sgetc();
17182 const __ctype_type& __ct = __check_facet(__in._M_ctype);
17183 while (!traits_type::eq_int_type(__c, __eof)
17184 && __ct.is(ctype_base::space,
17185 traits_type::to_char_type(__c)))
17186 __c = __sb->snextc();
17187 if (traits_type::eq_int_type(__c, __eof))
17188 __err |= ios_base::eofbit;
17189 }
17190 }
17191 if (__in.good() && __err == ios_base::goodbit)
17192 _M_ok = true;
17193 else
17194 {
17195 __err |= ios_base::failbit;
17196 __in.setstate(__err);
17197 }
17198 }
17199 template<typename _CharT, typename _Traits>
17200 template<typename _ValueT>
17201 basic_istream<_CharT, _Traits>&
17202 basic_istream<_CharT, _Traits>::
17203 _M_extract(_ValueT& __v)
17204 {
17205 sentry __cerb(*this, false);
17206 if (__cerb)
17207 {
17208 ios_base::iostate __err = ios_base::goodbit;
17209 try
17210 {
17211 const __num_get_type& __ng = __check_facet(this->_M_num_get);
17212 __ng.get(*this, 0, *this, __err, __v);
17213 }
17214 catch(__cxxabiv1::__forced_unwind&)
17215 {
17216 this->_M_setstate(ios_base::badbit);
17217 throw;
17218 }
17219 catch(...)
17220 { this->_M_setstate(ios_base::badbit); }
17221 if (__err)
17222 this->setstate(__err);
17223 }
17224 return *this;
17225 }
17226 template<typename _CharT, typename _Traits>
17227 basic_istream<_CharT, _Traits>&
17228 basic_istream<_CharT, _Traits>::
17229 operator>>(short& __n)
17230 {
17231 sentry __cerb(*this, false);
17232 if (__cerb)
17233 {
17234 ios_base::iostate __err = ios_base::goodbit;
17235 try
17236 {
17237 long __l;
17238 const __num_get_type& __ng = __check_facet(this->_M_num_get);
17239 __ng.get(*this, 0, *this, __err, __l);
17240 if (__l < __gnu_cxx::__numeric_traits<short>::__min)
17241 {
17242 __err |= ios_base::failbit;
17243 __n = __gnu_cxx::__numeric_traits<short>::__min;
17244 }
17245 else if (__l > __gnu_cxx::__numeric_traits<short>::__max)
17246 {
17247 __err |= ios_base::failbit;
17248 __n = __gnu_cxx::__numeric_traits<short>::__max;
17249 }
17250 else
17251 __n = short(__l);
17252 }
17253 catch(__cxxabiv1::__forced_unwind&)
17254 {
17255 this->_M_setstate(ios_base::badbit);
17256 throw;
17257 }
17258 catch(...)
17259 { this->_M_setstate(ios_base::badbit); }
17260 if (__err)
17261 this->setstate(__err);
17262 }
17263 return *this;
17264 }
17265 template<typename _CharT, typename _Traits>
17266 basic_istream<_CharT, _Traits>&
17267 basic_istream<_CharT, _Traits>::
17268 operator>>(int& __n)
17269 {
17270 sentry __cerb(*this, false);
17271 if (__cerb)
17272 {
17273 ios_base::iostate __err = ios_base::goodbit;
17274 try
17275 {
17276 long __l;
17277 const __num_get_type& __ng = __check_facet(this->_M_num_get);
17278 __ng.get(*this, 0, *this, __err, __l);
17279 if (__l < __gnu_cxx::__numeric_traits<int>::__min)
17280 {
17281 __err |= ios_base::failbit;
17282 __n = __gnu_cxx::__numeric_traits<int>::__min;
17283 }
17284 else if (__l > __gnu_cxx::__numeric_traits<int>::__max)
17285 {
17286 __err |= ios_base::failbit;
17287 __n = __gnu_cxx::__numeric_traits<int>::__max;
17288 }
17289 else
17290 __n = int(__l);
17291 }
17292 catch(__cxxabiv1::__forced_unwind&)
17293 {
17294 this->_M_setstate(ios_base::badbit);
17295 throw;
17296 }
17297 catch(...)
17298 { this->_M_setstate(ios_base::badbit); }
17299 if (__err)
17300 this->setstate(__err);
17301 }
17302 return *this;
17303 }
17304 template<typename _CharT, typename _Traits>
17305 basic_istream<_CharT, _Traits>&
17306 basic_istream<_CharT, _Traits>::
17307 operator>>(__streambuf_type* __sbout)
17308 {
17309 ios_base::iostate __err = ios_base::goodbit;
17310 sentry __cerb(*this, false);
17311 if (__cerb && __sbout)
17312 {
17313 try
17314 {
17315 bool __ineof;
17316 if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
17317 __err |= ios_base::failbit;
17318 if (__ineof)
17319 __err |= ios_base::eofbit;
17320 }
17321 catch(__cxxabiv1::__forced_unwind&)
17322 {
17323 this->_M_setstate(ios_base::failbit);
17324 throw;
17325 }
17326 catch(...)
17327 { this->_M_setstate(ios_base::failbit); }
17328 }
17329 else if (!__sbout)
17330 __err |= ios_base::failbit;
17331 if (__err)
17332 this->setstate(__err);
17333 return *this;
17334 }
17335 template<typename _CharT, typename _Traits>
17336 typename basic_istream<_CharT, _Traits>::int_type
17337 basic_istream<_CharT, _Traits>::
17338 get(void)
17339 {
17340 const int_type __eof = traits_type::eof();
17341 int_type __c = __eof;
17342 _M_gcount = 0;
17343 ios_base::iostate __err = ios_base::goodbit;
17344 sentry __cerb(*this, true);
17345 if (__cerb)
17346 {
17347 try
17348 {
17349 __c = this->rdbuf()->sbumpc();
17350 if (!traits_type::eq_int_type(__c, __eof))
17351 _M_gcount = 1;
17352 else
17353 __err |= ios_base::eofbit;
17354 }
17355 catch(__cxxabiv1::__forced_unwind&)
17356 {
17357 this->_M_setstate(ios_base::badbit);
17358 throw;
17359 }
17360 catch(...)
17361 { this->_M_setstate(ios_base::badbit); }
17362 }
17363 if (!_M_gcount)
17364 __err |= ios_base::failbit;
17365 if (__err)
17366 this->setstate(__err);
17367 return __c;
17368 }
17369 template<typename _CharT, typename _Traits>
17370 basic_istream<_CharT, _Traits>&
17371 basic_istream<_CharT, _Traits>::
17372 get(char_type& __c)
17373 {
17374 _M_gcount = 0;
17375 ios_base::iostate __err = ios_base::goodbit;
17376 sentry __cerb(*this, true);
17377 if (__cerb)
17378 {
17379 try
17380 {
17381 const int_type __cb = this->rdbuf()->sbumpc();
17382 if (!traits_type::eq_int_type(__cb, traits_type::eof()))
17383 {
17384 _M_gcount = 1;
17385 __c = traits_type::to_char_type(__cb);
17386 }
17387 else
17388 __err |= ios_base::eofbit;
17389 }
17390 catch(__cxxabiv1::__forced_unwind&)
17391 {
17392 this->_M_setstate(ios_base::badbit);
17393 throw;
17394 }
17395 catch(...)
17396 { this->_M_setstate(ios_base::badbit); }
17397 }
17398 if (!_M_gcount)
17399 __err |= ios_base::failbit;
17400 if (__err)
17401 this->setstate(__err);
17402 return *this;
17403 }
17404 template<typename _CharT, typename _Traits>
17405 basic_istream<_CharT, _Traits>&
17406 basic_istream<_CharT, _Traits>::
17407 get(char_type* __s, streamsize __n, char_type __delim)
17408 {
17409 _M_gcount = 0;
17410 ios_base::iostate __err = ios_base::goodbit;
17411 sentry __cerb(*this, true);
17412 if (__cerb)
17413 {
17414 try
17415 {
17416 const int_type __idelim = traits_type::to_int_type(__delim);
17417 const int_type __eof = traits_type::eof();
17418 __streambuf_type* __sb = this->rdbuf();
17419 int_type __c = __sb->sgetc();
17420 while (_M_gcount + 1 < __n
17421 && !traits_type::eq_int_type(__c, __eof)
17422 && !traits_type::eq_int_type(__c, __idelim))
17423 {
17424 *__s++ = traits_type::to_char_type(__c);
17425 ++_M_gcount;
17426 __c = __sb->snextc();
17427 }
17428 if (traits_type::eq_int_type(__c, __eof))
17429 __err |= ios_base::eofbit;
17430 }
17431 catch(__cxxabiv1::__forced_unwind&)
17432 {
17433 this->_M_setstate(ios_base::badbit);
17434 throw;
17435 }
17436 catch(...)
17437 { this->_M_setstate(ios_base::badbit); }
17438 }
17439 if (__n > 0)
17440 *__s = char_type();
17441 if (!_M_gcount)
17442 __err |= ios_base::failbit;
17443 if (__err)
17444 this->setstate(__err);
17445 return *this;
17446 }
17447 template<typename _CharT, typename _Traits>
17448 basic_istream<_CharT, _Traits>&
17449 basic_istream<_CharT, _Traits>::
17450 get(__streambuf_type& __sb, char_type __delim)
17451 {
17452 _M_gcount = 0;
17453 ios_base::iostate __err = ios_base::goodbit;
17454 sentry __cerb(*this, true);
17455 if (__cerb)
17456 {
17457 try
17458 {
17459 const int_type __idelim = traits_type::to_int_type(__delim);
17460 const int_type __eof = traits_type::eof();
17461 __streambuf_type* __this_sb = this->rdbuf();
17462 int_type __c = __this_sb->sgetc();
17463 char_type __c2 = traits_type::to_char_type(__c);
17464 while (!traits_type::eq_int_type(__c, __eof)
17465 && !traits_type::eq_int_type(__c, __idelim)
17466 && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
17467 {
17468 ++_M_gcount;
17469 __c = __this_sb->snextc();
17470 __c2 = traits_type::to_char_type(__c);
17471 }
17472 if (traits_type::eq_int_type(__c, __eof))
17473 __err |= ios_base::eofbit;
17474 }
17475 catch(__cxxabiv1::__forced_unwind&)
17476 {
17477 this->_M_setstate(ios_base::badbit);
17478 throw;
17479 }
17480 catch(...)
17481 { this->_M_setstate(ios_base::badbit); }
17482 }
17483 if (!_M_gcount)
17484 __err |= ios_base::failbit;
17485 if (__err)
17486 this->setstate(__err);
17487 return *this;
17488 }
17489 template<typename _CharT, typename _Traits>
17490 basic_istream<_CharT, _Traits>&
17491 basic_istream<_CharT, _Traits>::
17492 getline(char_type* __s, streamsize __n, char_type __delim)
17493 {
17494 _M_gcount = 0;
17495 ios_base::iostate __err = ios_base::goodbit;
17496 sentry __cerb(*this, true);
17497 if (__cerb)
17498 {
17499 try
17500 {
17501 const int_type __idelim = traits_type::to_int_type(__delim);
17502 const int_type __eof = traits_type::eof();
17503 __streambuf_type* __sb = this->rdbuf();
17504 int_type __c = __sb->sgetc();
17505 while (_M_gcount + 1 < __n
17506 && !traits_type::eq_int_type(__c, __eof)
17507 && !traits_type::eq_int_type(__c, __idelim))
17508 {
17509 *__s++ = traits_type::to_char_type(__c);
17510 __c = __sb->snextc();
17511 ++_M_gcount;
17512 }
17513 if (traits_type::eq_int_type(__c, __eof))
17514 __err |= ios_base::eofbit;
17515 else
17516 {
17517 if (traits_type::eq_int_type(__c, __idelim))
17518 {
17519 __sb->sbumpc();
17520 ++_M_gcount;
17521 }
17522 else
17523 __err |= ios_base::failbit;
17524 }
17525 }
17526 catch(__cxxabiv1::__forced_unwind&)
17527 {
17528 this->_M_setstate(ios_base::badbit);
17529 throw;
17530 }
17531 catch(...)
17532 { this->_M_setstate(ios_base::badbit); }
17533 }
17534 if (__n > 0)
17535 *__s = char_type();
17536 if (!_M_gcount)
17537 __err |= ios_base::failbit;
17538 if (__err)
17539 this->setstate(__err);
17540 return *this;
17541 }
17542 template<typename _CharT, typename _Traits>
17543 basic_istream<_CharT, _Traits>&
17544 basic_istream<_CharT, _Traits>::
17545 ignore(void)
17546 {
17547 _M_gcount = 0;
17548 sentry __cerb(*this, true);
17549 if (__cerb)
17550 {
17551 ios_base::iostate __err = ios_base::goodbit;
17552 try
17553 {
17554 const int_type __eof = traits_type::eof();
17555 __streambuf_type* __sb = this->rdbuf();
17556 if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
17557 __err |= ios_base::eofbit;
17558 else
17559 _M_gcount = 1;
17560 }
17561 catch(__cxxabiv1::__forced_unwind&)
17562 {
17563 this->_M_setstate(ios_base::badbit);
17564 throw;
17565 }
17566 catch(...)
17567 { this->_M_setstate(ios_base::badbit); }
17568 if (__err)
17569 this->setstate(__err);
17570 }
17571 return *this;
17572 }
17573 template<typename _CharT, typename _Traits>
17574 basic_istream<_CharT, _Traits>&
17575 basic_istream<_CharT, _Traits>::
17576 ignore(streamsize __n)
17577 {
17578 _M_gcount = 0;
17579 sentry __cerb(*this, true);
17580 if (__cerb && __n > 0)
17581 {
17582 ios_base::iostate __err = ios_base::goodbit;
17583 try
17584 {
17585 const int_type __eof = traits_type::eof();
17586 __streambuf_type* __sb = this->rdbuf();
17587 int_type __c = __sb->sgetc();
17588 bool __large_ignore = false;
17589 while (true)
17590 {
17591 while (_M_gcount < __n
17592 && !traits_type::eq_int_type(__c, __eof))
17593 {
17594 ++_M_gcount;
17595 __c = __sb->snextc();
17596 }
17597 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
17598 && !traits_type::eq_int_type(__c, __eof))
17599 {
17600 _M_gcount =
17601 __gnu_cxx::__numeric_traits<streamsize>::__min;
17602 __large_ignore = true;
17603 }
17604 else
17605 break;
17606 }
17607 if (__large_ignore)
17608 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
17609 if (traits_type::eq_int_type(__c, __eof))
17610 __err |= ios_base::eofbit;
17611 }
17612 catch(__cxxabiv1::__forced_unwind&)
17613 {
17614 this->_M_setstate(ios_base::badbit);
17615 throw;
17616 }
17617 catch(...)
17618 { this->_M_setstate(ios_base::badbit); }
17619 if (__err)
17620 this->setstate(__err);
17621 }
17622 return *this;
17623 }
17624 template<typename _CharT, typename _Traits>
17625 basic_istream<_CharT, _Traits>&
17626 basic_istream<_CharT, _Traits>::
17627 ignore(streamsize __n, int_type __delim)
17628 {
17629 _M_gcount = 0;
17630 sentry __cerb(*this, true);
17631 if (__cerb && __n > 0)
17632 {
17633 ios_base::iostate __err = ios_base::goodbit;
17634 try
17635 {
17636 const int_type __eof = traits_type::eof();
17637 __streambuf_type* __sb = this->rdbuf();
17638 int_type __c = __sb->sgetc();
17639 bool __large_ignore = false;
17640 while (true)
17641 {
17642 while (_M_gcount < __n
17643 && !traits_type::eq_int_type(__c, __eof)
17644 && !traits_type::eq_int_type(__c, __delim))
17645 {
17646 ++_M_gcount;
17647 __c = __sb->snextc();
17648 }
17649 if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
17650 && !traits_type::eq_int_type(__c, __eof)
17651 && !traits_type::eq_int_type(__c, __delim))
17652 {
17653 _M_gcount =
17654 __gnu_cxx::__numeric_traits<streamsize>::__min;
17655 __large_ignore = true;
17656 }
17657 else
17658 break;
17659 }
17660 if (__large_ignore)
17661 _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
17662 if (traits_type::eq_int_type(__c, __eof))
17663 __err |= ios_base::eofbit;
17664 else if (traits_type::eq_int_type(__c, __delim))
17665 {
17666 if (_M_gcount
17667 < __gnu_cxx::__numeric_traits<streamsize>::__max)
17668 ++_M_gcount;
17669 __sb->sbumpc();
17670 }
17671 }
17672 catch(__cxxabiv1::__forced_unwind&)
17673 {
17674 this->_M_setstate(ios_base::badbit);
17675 throw;
17676 }
17677 catch(...)
17678 { this->_M_setstate(ios_base::badbit); }
17679 if (__err)
17680 this->setstate(__err);
17681 }
17682 return *this;
17683 }
17684 template<typename _CharT, typename _Traits>
17685 typename basic_istream<_CharT, _Traits>::int_type
17686 basic_istream<_CharT, _Traits>::
17687 peek(void)
17688 {
17689 int_type __c = traits_type::eof();
17690 _M_gcount = 0;
17691 sentry __cerb(*this, true);
17692 if (__cerb)
17693 {
17694 ios_base::iostate __err = ios_base::goodbit;
17695 try
17696 {
17697 __c = this->rdbuf()->sgetc();
17698 if (traits_type::eq_int_type(__c, traits_type::eof()))
17699 __err |= ios_base::eofbit;
17700 }
17701 catch(__cxxabiv1::__forced_unwind&)
17702 {
17703 this->_M_setstate(ios_base::badbit);
17704 throw;
17705 }
17706 catch(...)
17707 { this->_M_setstate(ios_base::badbit); }
17708 if (__err)
17709 this->setstate(__err);
17710 }
17711 return __c;
17712 }
17713 template<typename _CharT, typename _Traits>
17714 basic_istream<_CharT, _Traits>&
17715 basic_istream<_CharT, _Traits>::
17716 read(char_type* __s, streamsize __n)
17717 {
17718 _M_gcount = 0;
17719 sentry __cerb(*this, true);
17720 if (__cerb)
17721 {
17722 ios_base::iostate __err = ios_base::goodbit;
17723 try
17724 {
17725 _M_gcount = this->rdbuf()->sgetn(__s, __n);
17726 if (_M_gcount != __n)
17727 __err |= (ios_base::eofbit | ios_base::failbit);
17728 }
17729 catch(__cxxabiv1::__forced_unwind&)
17730 {
17731 this->_M_setstate(ios_base::badbit);
17732 throw;
17733 }
17734 catch(...)
17735 { this->_M_setstate(ios_base::badbit); }
17736 if (__err)
17737 this->setstate(__err);
17738 }
17739 return *this;
17740 }
17741 template<typename _CharT, typename _Traits>
17742 streamsize
17743 basic_istream<_CharT, _Traits>::
17744 readsome(char_type* __s, streamsize __n)
17745 {
17746 _M_gcount = 0;
17747 sentry __cerb(*this, true);
17748 if (__cerb)
17749 {
17750 ios_base::iostate __err = ios_base::goodbit;
17751 try
17752 {
17753 const streamsize __num = this->rdbuf()->in_avail();
17754 if (__num > 0)
17755 _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
17756 else if (__num == -1)
17757 __err |= ios_base::eofbit;
17758 }
17759 catch(__cxxabiv1::__forced_unwind&)
17760 {
17761 this->_M_setstate(ios_base::badbit);
17762 throw;
17763 }
17764 catch(...)
17765 { this->_M_setstate(ios_base::badbit); }
17766 if (__err)
17767 this->setstate(__err);
17768 }
17769 return _M_gcount;
17770 }
17771 template<typename _CharT, typename _Traits>
17772 basic_istream<_CharT, _Traits>&
17773 basic_istream<_CharT, _Traits>::
17774 putback(char_type __c)
17775 {
17776 _M_gcount = 0;
17777 sentry __cerb(*this, true);
17778 if (__cerb)
17779 {
17780 ios_base::iostate __err = ios_base::goodbit;
17781 try
17782 {
17783 const int_type __eof = traits_type::eof();
17784 __streambuf_type* __sb = this->rdbuf();
17785 if (!__sb
17786 || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
17787 __err |= ios_base::badbit;
17788 }
17789 catch(__cxxabiv1::__forced_unwind&)
17790 {
17791 this->_M_setstate(ios_base::badbit);
17792 throw;
17793 }
17794 catch(...)
17795 { this->_M_setstate(ios_base::badbit); }
17796 if (__err)
17797 this->setstate(__err);
17798 }
17799 return *this;
17800 }
17801 template<typename _CharT, typename _Traits>
17802 basic_istream<_CharT, _Traits>&
17803 basic_istream<_CharT, _Traits>::
17804 unget(void)
17805 {
17806 _M_gcount = 0;
17807 sentry __cerb(*this, true);
17808 if (__cerb)
17809 {
17810 ios_base::iostate __err = ios_base::goodbit;
17811 try
17812 {
17813 const int_type __eof = traits_type::eof();
17814 __streambuf_type* __sb = this->rdbuf();
17815 if (!__sb
17816 || traits_type::eq_int_type(__sb->sungetc(), __eof))
17817 __err |= ios_base::badbit;
17818 }
17819 catch(__cxxabiv1::__forced_unwind&)
17820 {
17821 this->_M_setstate(ios_base::badbit);
17822 throw;
17823 }
17824 catch(...)
17825 { this->_M_setstate(ios_base::badbit); }
17826 if (__err)
17827 this->setstate(__err);
17828 }
17829 return *this;
17830 }
17831 template<typename _CharT, typename _Traits>
17832 int
17833 basic_istream<_CharT, _Traits>::
17834 sync(void)
17835 {
17836 int __ret = -1;
17837 sentry __cerb(*this, true);
17838 if (__cerb)
17839 {
17840 ios_base::iostate __err = ios_base::goodbit;
17841 try
17842 {
17843 __streambuf_type* __sb = this->rdbuf();
17844 if (__sb)
17845 {
17846 if (__sb->pubsync() == -1)
17847 __err |= ios_base::badbit;
17848 else
17849 __ret = 0;
17850 }
17851 }
17852 catch(__cxxabiv1::__forced_unwind&)
17853 {
17854 this->_M_setstate(ios_base::badbit);
17855 throw;
17856 }
17857 catch(...)
17858 { this->_M_setstate(ios_base::badbit); }
17859 if (__err)
17860 this->setstate(__err);
17861 }
17862 return __ret;
17863 }
17864 template<typename _CharT, typename _Traits>
17865 typename basic_istream<_CharT, _Traits>::pos_type
17866 basic_istream<_CharT, _Traits>::
17867 tellg(void)
17868 {
17869 pos_type __ret = pos_type(-1);
17870 try
17871 {
17872 if (!this->fail())
17873 __ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
17874 ios_base::in);
17875 }
17876 catch(__cxxabiv1::__forced_unwind&)
17877 {
17878 this->_M_setstate(ios_base::badbit);
17879 throw;
17880 }
17881 catch(...)
17882 { this->_M_setstate(ios_base::badbit); }
17883 return __ret;
17884 }
17885 template<typename _CharT, typename _Traits>
17886 basic_istream<_CharT, _Traits>&
17887 basic_istream<_CharT, _Traits>::
17888 seekg(pos_type __pos)
17889 {
17890 ios_base::iostate __err = ios_base::goodbit;
17891 try
17892 {
17893 if (!this->fail())
17894 {
17895 const pos_type __p = this->rdbuf()->pubseekpos(__pos,
17896 ios_base::in);
17897 if (__p == pos_type(off_type(-1)))
17898 __err |= ios_base::failbit;
17899 }
17900 }
17901 catch(__cxxabiv1::__forced_unwind&)
17902 {
17903 this->_M_setstate(ios_base::badbit);
17904 throw;
17905 }
17906 catch(...)
17907 { this->_M_setstate(ios_base::badbit); }
17908 if (__err)
17909 this->setstate(__err);
17910 return *this;
17911 }
17912 template<typename _CharT, typename _Traits>
17913 basic_istream<_CharT, _Traits>&
17914 basic_istream<_CharT, _Traits>::
17915 seekg(off_type __off, ios_base::seekdir __dir)
17916 {
17917 ios_base::iostate __err = ios_base::goodbit;
17918 try
17919 {
17920 if (!this->fail())
17921 {
17922 const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
17923 ios_base::in);
17924 if (__p == pos_type(off_type(-1)))
17925 __err |= ios_base::failbit;
17926 }
17927 }
17928 catch(__cxxabiv1::__forced_unwind&)
17929 {
17930 this->_M_setstate(ios_base::badbit);
17931 throw;
17932 }
17933 catch(...)
17934 { this->_M_setstate(ios_base::badbit); }
17935 if (__err)
17936 this->setstate(__err);
17937 return *this;
17938 }
17939 template<typename _CharT, typename _Traits>
17940 basic_istream<_CharT, _Traits>&
17941 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
17942 {
17943 typedef basic_istream<_CharT, _Traits> __istream_type;
17944 typedef typename __istream_type::int_type __int_type;
17945 typename __istream_type::sentry __cerb(__in, false);
17946 if (__cerb)
17947 {
17948 ios_base::iostate __err = ios_base::goodbit;
17949 try
17950 {
17951 const __int_type __cb = __in.rdbuf()->sbumpc();
17952 if (!_Traits::eq_int_type(__cb, _Traits::eof()))
17953 __c = _Traits::to_char_type(__cb);
17954 else
17955 __err |= (ios_base::eofbit | ios_base::failbit);
17956 }
17957 catch(__cxxabiv1::__forced_unwind&)
17958 {
17959 __in._M_setstate(ios_base::badbit);
17960 throw;
17961 }
17962 catch(...)
17963 { __in._M_setstate(ios_base::badbit); }
17964 if (__err)
17965 __in.setstate(__err);
17966 }
17967 return __in;
17968 }
17969 template<typename _CharT, typename _Traits>
17970 basic_istream<_CharT, _Traits>&
17971 operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
17972 {
17973 typedef basic_istream<_CharT, _Traits> __istream_type;
17974 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
17975 typedef typename _Traits::int_type int_type;
17976 typedef _CharT char_type;
17977 typedef ctype<_CharT> __ctype_type;
17978 streamsize __extracted = 0;
17979 ios_base::iostate __err = ios_base::goodbit;
17980 typename __istream_type::sentry __cerb(__in, false);
17981 if (__cerb)
17982 {
17983 try
17984 {
17985 streamsize __num = __in.width();
17986 if (__num <= 0)
17987 __num = __gnu_cxx::__numeric_traits<streamsize>::__max;
17988 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
17989 const int_type __eof = _Traits::eof();
17990 __streambuf_type* __sb = __in.rdbuf();
17991 int_type __c = __sb->sgetc();
17992 while (__extracted < __num - 1
17993 && !_Traits::eq_int_type(__c, __eof)
17994 && !__ct.is(ctype_base::space,
17995 _Traits::to_char_type(__c)))
17996 {
17997 *__s++ = _Traits::to_char_type(__c);
17998 ++__extracted;
17999 __c = __sb->snextc();
18000 }
18001 if (_Traits::eq_int_type(__c, __eof))
18002 __err |= ios_base::eofbit;
18003 *__s = char_type();
18004 __in.width(0);
18005 }
18006 catch(__cxxabiv1::__forced_unwind&)
18007 {
18008 __in._M_setstate(ios_base::badbit);
18009 throw;
18010 }
18011 catch(...)
18012 { __in._M_setstate(ios_base::badbit); }
18013 }
18014 if (!__extracted)
18015 __err |= ios_base::failbit;
18016 if (__err)
18017 __in.setstate(__err);
18018 return __in;
18019 }
18020 template<typename _CharT, typename _Traits>
18021 basic_istream<_CharT, _Traits>&
18022 ws(basic_istream<_CharT, _Traits>& __in)
18023 {
18024 typedef basic_istream<_CharT, _Traits> __istream_type;
18025 typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
18026 typedef typename __istream_type::int_type __int_type;
18027 typedef ctype<_CharT> __ctype_type;
18028 const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
18029 const __int_type __eof = _Traits::eof();
18030 __streambuf_type* __sb = __in.rdbuf();
18031 __int_type __c = __sb->sgetc();
18032 while (!_Traits::eq_int_type(__c, __eof)
18033 && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
18034 __c = __sb->snextc();
18035 if (_Traits::eq_int_type(__c, __eof))
18036 __in.setstate(ios_base::eofbit);
18037 return __in;
18038 }
18039 extern template class basic_istream<char>;
18040 extern template istream& ws(istream&);
18041 extern template istream& operator>>(istream&, char&);
18042 extern template istream& operator>>(istream&, char*);
18043 extern template istream& operator>>(istream&, unsigned char&);
18044 extern template istream& operator>>(istream&, signed char&);
18045 extern template istream& operator>>(istream&, unsigned char*);
18046 extern template istream& operator>>(istream&, signed char*);
18047 extern template istream& istream::_M_extract(unsigned short&);
18048 extern template istream& istream::_M_extract(unsigned int&);
18049 extern template istream& istream::_M_extract(long&);
18050 extern template istream& istream::_M_extract(unsigned long&);
18051 extern template istream& istream::_M_extract(bool&);
18052 extern template istream& istream::_M_extract(long long&);
18053 extern template istream& istream::_M_extract(unsigned long long&);
18054 extern template istream& istream::_M_extract(float&);
18055 extern template istream& istream::_M_extract(double&);
18056 extern template istream& istream::_M_extract(long double&);
18057 extern template istream& istream::_M_extract(void*&);
18058 extern template class basic_iostream<char>;
18059 extern template class basic_istream<wchar_t>;
18060 extern template wistream& ws(wistream&);
18061 extern template wistream& operator>>(wistream&, wchar_t&);
18062 extern template wistream& operator>>(wistream&, wchar_t*);
18063 extern template wistream& wistream::_M_extract(unsigned short&);
18064 extern template wistream& wistream::_M_extract(unsigned int&);
18065 extern template wistream& wistream::_M_extract(long&);
18066 extern template wistream& wistream::_M_extract(unsigned long&);
18067 extern template wistream& wistream::_M_extract(bool&);
18068 extern template wistream& wistream::_M_extract(long long&);
18069 extern template wistream& wistream::_M_extract(unsigned long long&);
18070 extern template wistream& wistream::_M_extract(float&);
18071 extern template wistream& wistream::_M_extract(double&);
18072 extern template wistream& wistream::_M_extract(long double&);
18073 extern template wistream& wistream::_M_extract(void*&);
18074 extern template class basic_iostream<wchar_t>;
18075 }
18076
18077 namespace std __attribute__ ((__visibility__ ("default"))) {
18078 template<typename _Tp, typename _CharT = char,
18079 typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
18080 class istream_iterator
18081 : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
18082 {
18083 public:
18084 typedef _CharT char_type;
18085 typedef _Traits traits_type;
18086 typedef basic_istream<_CharT, _Traits> istream_type;
18087 private:
18088 istream_type* _M_stream;
18089 _Tp _M_value;
18090 bool _M_ok;
18091 public:
18092 istream_iterator()
18093 : _M_stream(0), _M_value(), _M_ok(false) {}
18094 istream_iterator(istream_type& __s)
18095 : _M_stream(&__s)
18096 { _M_read(); }
18097 istream_iterator(const istream_iterator& __obj)
18098 : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
18099 _M_ok(__obj._M_ok)
18100 { }
18101 const _Tp&
18102 operator*() const
18103 {
18104 ;
18105 return _M_value;
18106 }
18107 const _Tp*
18108 operator->() const { return &(operator*()); }
18109 istream_iterator&
18110 operator++()
18111 {
18112 ;
18113 _M_read();
18114 return *this;
18115 }
18116 istream_iterator
18117 operator++(int)
18118 {
18119 ;
18120 istream_iterator __tmp = *this;
18121 _M_read();
18122 return __tmp;
18123 }
18124 bool
18125 _M_equal(const istream_iterator& __x) const
18126 { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
18127 private:
18128 void
18129 _M_read()
18130 {
18131 _M_ok = (_M_stream && *_M_stream) ? true : false;
18132 if (_M_ok)
18133 {
18134 *_M_stream >> _M_value;
18135 _M_ok = *_M_stream ? true : false;
18136 }
18137 }
18138 };
18139 template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
18140 inline bool
18141 operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
18142 const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
18143 { return __x._M_equal(__y); }
18144 template <class _Tp, class _CharT, class _Traits, class _Dist>
18145 inline bool
18146 operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
18147 const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
18148 { return !__x._M_equal(__y); }
18149 template<typename _Tp, typename _CharT = char,
18150 typename _Traits = char_traits<_CharT> >
18151 class ostream_iterator
18152 : public iterator<output_iterator_tag, void, void, void, void>
18153 {
18154 public:
18155 typedef _CharT char_type;
18156 typedef _Traits traits_type;
18157 typedef basic_ostream<_CharT, _Traits> ostream_type;
18158 private:
18159 ostream_type* _M_stream;
18160 const _CharT* _M_string;
18161 public:
18162 ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
18163 ostream_iterator(ostream_type& __s, const _CharT* __c)
18164 : _M_stream(&__s), _M_string(__c) { }
18165 ostream_iterator(const ostream_iterator& __obj)
18166 : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
18167 ostream_iterator&
18168 operator=(const _Tp& __value)
18169 {
18170 ;
18171 *_M_stream << __value;
18172 if (_M_string) *_M_stream << _M_string;
18173 return *this;
18174 }
18175 ostream_iterator&
18176 operator*()
18177 { return *this; }
18178 ostream_iterator&
18179 operator++()
18180 { return *this; }
18181 ostream_iterator&
18182 operator++(int)
18183 { return *this; }
18184 };
18185 }
18186
18187 namespace std __attribute__ ((__visibility__ ("default"))) {
18188 struct _List_node_base
18189 {
18190 _List_node_base* _M_next;
18191 _List_node_base* _M_prev;
18192 static void
18193 swap(_List_node_base& __x, _List_node_base& __y) throw ();
18194 void
18195 _M_transfer(_List_node_base * const __first,
18196 _List_node_base * const __last) throw ();
18197 void
18198 _M_reverse() throw ();
18199 void
18200 _M_hook(_List_node_base * const __position) throw ();
18201 void
18202 _M_unhook() throw ();
18203 };
18204 template<typename _Tp>
18205 struct _List_node : public _List_node_base
18206 {
18207 _Tp _M_data;
18208 };
18209 template<typename _Tp>
18210 struct _List_iterator
18211 {
18212 typedef _List_iterator<_Tp> _Self;
18213 typedef _List_node<_Tp> _Node;
18214 typedef ptrdiff_t difference_type;
18215 typedef std::bidirectional_iterator_tag iterator_category;
18216 typedef _Tp value_type;
18217 typedef _Tp* pointer;
18218 typedef _Tp& reference;
18219 _List_iterator()
18220 : _M_node() { }
18221 explicit
18222 _List_iterator(_List_node_base* __x)
18223 : _M_node(__x) { }
18224 reference
18225 operator*() const
18226 { return static_cast<_Node*>(_M_node)->_M_data; }
18227 pointer
18228 operator->() const
18229 { return &static_cast<_Node*>(_M_node)->_M_data; }
18230 _Self&
18231 operator++()
18232 {
18233 _M_node = _M_node->_M_next;
18234 return *this;
18235 }
18236 _Self
18237 operator++(int)
18238 {
18239 _Self __tmp = *this;
18240 _M_node = _M_node->_M_next;
18241 return __tmp;
18242 }
18243 _Self&
18244 operator--()
18245 {
18246 _M_node = _M_node->_M_prev;
18247 return *this;
18248 }
18249 _Self
18250 operator--(int)
18251 {
18252 _Self __tmp = *this;
18253 _M_node = _M_node->_M_prev;
18254 return __tmp;
18255 }
18256 bool
18257 operator==(const _Self& __x) const
18258 { return _M_node == __x._M_node; }
18259 bool
18260 operator!=(const _Self& __x) const
18261 { return _M_node != __x._M_node; }
18262 _List_node_base* _M_node;
18263 };
18264 template<typename _Tp>
18265 struct _List_const_iterator
18266 {
18267 typedef _List_const_iterator<_Tp> _Self;
18268 typedef const _List_node<_Tp> _Node;
18269 typedef _List_iterator<_Tp> iterator;
18270 typedef ptrdiff_t difference_type;
18271 typedef std::bidirectional_iterator_tag iterator_category;
18272 typedef _Tp value_type;
18273 typedef const _Tp* pointer;
18274 typedef const _Tp& reference;
18275 _List_const_iterator()
18276 : _M_node() { }
18277 explicit
18278 _List_const_iterator(const _List_node_base* __x)
18279 : _M_node(__x) { }
18280 _List_const_iterator(const iterator& __x)
18281 : _M_node(__x._M_node) { }
18282 reference
18283 operator*() const
18284 { return static_cast<_Node*>(_M_node)->_M_data; }
18285 pointer
18286 operator->() const
18287 { return &static_cast<_Node*>(_M_node)->_M_data; }
18288 _Self&
18289 operator++()
18290 {
18291 _M_node = _M_node->_M_next;
18292 return *this;
18293 }
18294 _Self
18295 operator++(int)
18296 {
18297 _Self __tmp = *this;
18298 _M_node = _M_node->_M_next;
18299 return __tmp;
18300 }
18301 _Self&
18302 operator--()
18303 {
18304 _M_node = _M_node->_M_prev;
18305 return *this;
18306 }
18307 _Self
18308 operator--(int)
18309 {
18310 _Self __tmp = *this;
18311 _M_node = _M_node->_M_prev;
18312 return __tmp;
18313 }
18314 bool
18315 operator==(const _Self& __x) const
18316 { return _M_node == __x._M_node; }
18317 bool
18318 operator!=(const _Self& __x) const
18319 { return _M_node != __x._M_node; }
18320 const _List_node_base* _M_node;
18321 };
18322 template<typename _Val>
18323 inline bool
18324 operator==(const _List_iterator<_Val>& __x,
18325 const _List_const_iterator<_Val>& __y)
18326 { return __x._M_node == __y._M_node; }
18327 template<typename _Val>
18328 inline bool
18329 operator!=(const _List_iterator<_Val>& __x,
18330 const _List_const_iterator<_Val>& __y)
18331 { return __x._M_node != __y._M_node; }
18332 template<typename _Tp, typename _Alloc>
18333 class _List_base
18334 {
18335 public:
18336 typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
18337 _Node_alloc_type;
18338 typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
18339 struct _List_impl
18340 : public _Node_alloc_type
18341 {
18342 _List_node_base _M_node;
18343 _List_impl()
18344 : _Node_alloc_type(), _M_node()
18345 { }
18346 _List_impl(const _Node_alloc_type& __a)
18347 : _Node_alloc_type(__a), _M_node()
18348 { }
18349 };
18350 _List_impl _M_impl;
18351 _List_node<_Tp>*
18352 _M_get_node()
18353 { return _M_impl._Node_alloc_type::allocate(1); }
18354 void
18355 _M_put_node(_List_node<_Tp>* __p)
18356 { _M_impl._Node_alloc_type::deallocate(__p, 1); }
18357 public:
18358 typedef _Alloc allocator_type;
18359 _Node_alloc_type&
18360 _M_get_Node_allocator()
18361 { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
18362 const _Node_alloc_type&
18363 _M_get_Node_allocator() const
18364 { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
18365 _Tp_alloc_type
18366 _M_get_Tp_allocator() const
18367 { return _Tp_alloc_type(_M_get_Node_allocator()); }
18368 allocator_type
18369 get_allocator() const
18370 { return allocator_type(_M_get_Node_allocator()); }
18371 _List_base()
18372 : _M_impl()
18373 { _M_init(); }
18374 _List_base(const allocator_type& __a)
18375 : _M_impl(__a)
18376 { _M_init(); }
18377 ~_List_base()
18378 { _M_clear(); }
18379 void
18380 _M_clear();
18381 void
18382 _M_init()
18383 {
18384 this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
18385 this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
18386 }
18387 };
18388 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
18389 class list : public _List_base<_Tp, _Alloc>
18390 {
18391 typedef typename _Alloc::value_type _Alloc_value_type;
18392
18393
18394 typedef _List_base<_Tp, _Alloc> _Base;
18395 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
18396 public:
18397 typedef _Tp value_type;
18398 typedef typename _Tp_alloc_type::pointer pointer;
18399 typedef typename _Tp_alloc_type::const_pointer const_pointer;
18400 typedef typename _Tp_alloc_type::reference reference;
18401 typedef typename _Tp_alloc_type::const_reference const_reference;
18402 typedef _List_iterator<_Tp> iterator;
18403 typedef _List_const_iterator<_Tp> const_iterator;
18404 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
18405 typedef std::reverse_iterator<iterator> reverse_iterator;
18406 typedef size_t size_type;
18407 typedef ptrdiff_t difference_type;
18408 typedef _Alloc allocator_type;
18409 public:
18410 typedef _List_node<_Tp> _Node;
18411 using _Base::_M_impl;
18412 using _Base::_M_put_node;
18413 using _Base::_M_get_node;
18414 using _Base::_M_get_Tp_allocator;
18415 using _Base::_M_get_Node_allocator;
18416 _Node*
18417 _M_create_node(const value_type& __x)
18418 {
18419 _Node* __p = this->_M_get_node();
18420 try
18421 {
18422 _M_get_Tp_allocator().construct(&__p->_M_data, __x);
18423 }
18424 catch(...)
18425 {
18426 _M_put_node(__p);
18427 throw;
18428 }
18429 return __p;
18430 }
18431 public:
18432 list()
18433 : _Base() { }
18434 explicit
18435 list(const allocator_type& __a)
18436 : _Base(__a) { }
18437 explicit
18438 list(size_type __n, const value_type& __value = value_type(),
18439 const allocator_type& __a = allocator_type())
18440 : _Base(__a)
18441 { _M_fill_initialize(__n, __value); }
18442 list(const list& __x)
18443 : _Base(__x._M_get_Node_allocator())
18444 { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
18445 template<typename _InputIterator>
18446 list(_InputIterator __first, _InputIterator __last,
18447 const allocator_type& __a = allocator_type())
18448 : _Base(__a)
18449 {
18450 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
18451 _M_initialize_dispatch(__first, __last, _Integral());
18452 }
18453 list&
18454 operator=(const list& __x);
18455 void
18456 assign(size_type __n, const value_type& __val)
18457 { _M_fill_assign(__n, __val); }
18458 template<typename _InputIterator>
18459 void
18460 assign(_InputIterator __first, _InputIterator __last)
18461 {
18462 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
18463 _M_assign_dispatch(__first, __last, _Integral());
18464 }
18465 allocator_type
18466 get_allocator() const
18467 { return _Base::get_allocator(); }
18468 iterator
18469 begin()
18470 { return iterator(this->_M_impl._M_node._M_next); }
18471 const_iterator
18472 begin() const
18473 { return const_iterator(this->_M_impl._M_node._M_next); }
18474 iterator
18475 end()
18476 { return iterator(&this->_M_impl._M_node); }
18477 const_iterator
18478 end() const
18479 { return const_iterator(&this->_M_impl._M_node); }
18480 reverse_iterator
18481 rbegin()
18482 { return reverse_iterator(end()); }
18483 const_reverse_iterator
18484 rbegin() const
18485 { return const_reverse_iterator(end()); }
18486 reverse_iterator
18487 rend()
18488 { return reverse_iterator(begin()); }
18489 const_reverse_iterator
18490 rend() const
18491 { return const_reverse_iterator(begin()); }
18492 bool
18493 empty() const
18494 { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
18495 size_type
18496 size() const
18497 { return std::distance(begin(), end()); }
18498 size_type
18499 max_size() const
18500 { return _M_get_Node_allocator().max_size(); }
18501 void
18502 resize(size_type __new_size, value_type __x = value_type());
18503 reference
18504 front()
18505 { return *begin(); }
18506 const_reference
18507 front() const
18508 { return *begin(); }
18509 reference
18510 back()
18511 {
18512 iterator __tmp = end();
18513 --__tmp;
18514 return *__tmp;
18515 }
18516 const_reference
18517 back() const
18518 {
18519 const_iterator __tmp = end();
18520 --__tmp;
18521 return *__tmp;
18522 }
18523 void
18524 push_front(const value_type& __x)
18525 { this->_M_insert(begin(), __x); }
18526 void
18527 pop_front()
18528 { this->_M_erase(begin()); }
18529 void
18530 push_back(const value_type& __x)
18531 { this->_M_insert(end(), __x); }
18532 void
18533 pop_back()
18534 { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
18535 iterator
18536 insert(iterator __position, const value_type& __x);
18537 void
18538 insert(iterator __position, size_type __n, const value_type& __x)
18539 {
18540 list __tmp(__n, __x, _M_get_Node_allocator());
18541 splice(__position, __tmp);
18542 }
18543 template<typename _InputIterator>
18544 void
18545 insert(iterator __position, _InputIterator __first,
18546 _InputIterator __last)
18547 {
18548 list __tmp(__first, __last, _M_get_Node_allocator());
18549 splice(__position, __tmp);
18550 }
18551 iterator
18552 erase(iterator __position);
18553 iterator
18554 erase(iterator __first, iterator __last)
18555 {
18556 while (__first != __last)
18557 __first = erase(__first);
18558 return __last;
18559 }
18560 void
18561 swap(list& __x)
18562 {
18563 _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
18564 std::__alloc_swap<typename _Base::_Node_alloc_type>::
18565 _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator());
18566 }
18567 void
18568 clear()
18569 {
18570 _Base::_M_clear();
18571 _Base::_M_init();
18572 }
18573 void
18574 splice(iterator __position, list& __x)
18575 {
18576 if (!__x.empty())
18577 {
18578 _M_check_equal_allocators(__x);
18579 this->_M_transfer(__position, __x.begin(), __x.end());
18580 }
18581 }
18582 void
18583 splice(iterator __position, list& __x, iterator __i)
18584 {
18585 iterator __j = __i;
18586 ++__j;
18587 if (__position == __i || __position == __j)
18588 return;
18589 if (this != &__x)
18590 _M_check_equal_allocators(__x);
18591 this->_M_transfer(__position, __i, __j);
18592 }
18593 void
18594 splice(iterator __position, list& __x, iterator __first,
18595 iterator __last)
18596 {
18597 if (__first != __last)
18598 {
18599 if (this != &__x)
18600 _M_check_equal_allocators(__x);
18601 this->_M_transfer(__position, __first, __last);
18602 }
18603 }
18604 void
18605 remove(const _Tp& __value);
18606 template<typename _Predicate>
18607 void
18608 remove_if(_Predicate);
18609 void
18610 unique();
18611 template<typename _BinaryPredicate>
18612 void
18613 unique(_BinaryPredicate);
18614 void
18615 merge(list& __x);
18616 template<typename _StrictWeakOrdering>
18617 void
18618 merge(list&, _StrictWeakOrdering);
18619 void
18620 reverse()
18621 { this->_M_impl._M_node._M_reverse(); }
18622 void
18623 sort();
18624 template<typename _StrictWeakOrdering>
18625 void
18626 sort(_StrictWeakOrdering);
18627 public:
18628 template<typename _Integer>
18629 void
18630 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
18631 { _M_fill_initialize(static_cast<size_type>(__n), __x); }
18632 template<typename _InputIterator>
18633 void
18634 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
18635 __false_type)
18636 {
18637 for (; __first != __last; ++__first)
18638 push_back(*__first);
18639 }
18640 void
18641 _M_fill_initialize(size_type __n, const value_type& __x)
18642 {
18643 for (; __n > 0; --__n)
18644 push_back(__x);
18645 }
18646 template<typename _Integer>
18647 void
18648 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
18649 { _M_fill_assign(__n, __val); }
18650 template<typename _InputIterator>
18651 void
18652 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
18653 __false_type);
18654 void
18655 _M_fill_assign(size_type __n, const value_type& __val);
18656 void
18657 _M_transfer(iterator __position, iterator __first, iterator __last)
18658 { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
18659 void
18660 _M_insert(iterator __position, const value_type& __x)
18661 {
18662 _Node* __tmp = _M_create_node(__x);
18663 __tmp->_M_hook(__position._M_node);
18664 }
18665 void
18666 _M_erase(iterator __position)
18667 {
18668 __position._M_node->_M_unhook();
18669 _Node* __n = static_cast<_Node*>(__position._M_node);
18670 _M_get_Tp_allocator().destroy(&__n->_M_data);
18671 _M_put_node(__n);
18672 }
18673 void
18674 _M_check_equal_allocators(list& __x)
18675 {
18676 if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
18677 _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
18678 __throw_runtime_error(("list::_M_check_equal_allocators"));
18679 }
18680 };
18681 template<typename _Tp, typename _Alloc>
18682 inline bool
18683 operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
18684 {
18685 typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
18686 const_iterator __end1 = __x.end();
18687 const_iterator __end2 = __y.end();
18688 const_iterator __i1 = __x.begin();
18689 const_iterator __i2 = __y.begin();
18690 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
18691 {
18692 ++__i1;
18693 ++__i2;
18694 }
18695 return __i1 == __end1 && __i2 == __end2;
18696 }
18697 template<typename _Tp, typename _Alloc>
18698 inline bool
18699 operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
18700 { return std::lexicographical_compare(__x.begin(), __x.end(),
18701 __y.begin(), __y.end()); }
18702 template<typename _Tp, typename _Alloc>
18703 inline bool
18704 operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
18705 { return !(__x == __y); }
18706 template<typename _Tp, typename _Alloc>
18707 inline bool
18708 operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
18709 { return __y < __x; }
18710 template<typename _Tp, typename _Alloc>
18711 inline bool
18712 operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
18713 { return !(__y < __x); }
18714 template<typename _Tp, typename _Alloc>
18715 inline bool
18716 operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
18717 { return !(__x < __y); }
18718 template<typename _Tp, typename _Alloc>
18719 inline void
18720 swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
18721 { __x.swap(__y); }
18722 }
18723 namespace std __attribute__ ((__visibility__ ("default"))) {
18724 template<typename _Tp, typename _Alloc>
18725 void
18726 _List_base<_Tp, _Alloc>::
18727 _M_clear()
18728 {
18729 typedef _List_node<_Tp> _Node;
18730 _Node* __cur = static_cast<_Node*>(this->_M_impl._M_node._M_next);
18731 while (__cur != &this->_M_impl._M_node)
18732 {
18733 _Node* __tmp = __cur;
18734 __cur = static_cast<_Node*>(__cur->_M_next);
18735 _M_get_Tp_allocator().destroy(&__tmp->_M_data);
18736 _M_put_node(__tmp);
18737 }
18738 }
18739 template<typename _Tp, typename _Alloc>
18740 typename list<_Tp, _Alloc>::iterator
18741 list<_Tp, _Alloc>::
18742 insert(iterator __position, const value_type& __x)
18743 {
18744 _Node* __tmp = _M_create_node(__x);
18745 __tmp->_M_hook(__position._M_node);
18746 return iterator(__tmp);
18747 }
18748 template<typename _Tp, typename _Alloc>
18749 typename list<_Tp, _Alloc>::iterator
18750 list<_Tp, _Alloc>::
18751 erase(iterator __position)
18752 {
18753 iterator __ret = iterator(__position._M_node->_M_next);
18754 _M_erase(__position);
18755 return __ret;
18756 }
18757 template<typename _Tp, typename _Alloc>
18758 void
18759 list<_Tp, _Alloc>::
18760 resize(size_type __new_size, value_type __x)
18761 {
18762 iterator __i = begin();
18763 size_type __len = 0;
18764 for (; __i != end() && __len < __new_size; ++__i, ++__len)
18765 ;
18766 if (__len == __new_size)
18767 erase(__i, end());
18768 else
18769 insert(end(), __new_size - __len, __x);
18770 }
18771 template<typename _Tp, typename _Alloc>
18772 list<_Tp, _Alloc>&
18773 list<_Tp, _Alloc>::
18774 operator=(const list& __x)
18775 {
18776 if (this != &__x)
18777 {
18778 iterator __first1 = begin();
18779 iterator __last1 = end();
18780 const_iterator __first2 = __x.begin();
18781 const_iterator __last2 = __x.end();
18782 for (; __first1 != __last1 && __first2 != __last2;
18783 ++__first1, ++__first2)
18784 *__first1 = *__first2;
18785 if (__first2 == __last2)
18786 erase(__first1, __last1);
18787 else
18788 insert(__last1, __first2, __last2);
18789 }
18790 return *this;
18791 }
18792 template<typename _Tp, typename _Alloc>
18793 void
18794 list<_Tp, _Alloc>::
18795 _M_fill_assign(size_type __n, const value_type& __val)
18796 {
18797 iterator __i = begin();
18798 for (; __i != end() && __n > 0; ++__i, --__n)
18799 *__i = __val;
18800 if (__n > 0)
18801 insert(end(), __n, __val);
18802 else
18803 erase(__i, end());
18804 }
18805 template<typename _Tp, typename _Alloc>
18806 template <typename _InputIterator>
18807 void
18808 list<_Tp, _Alloc>::
18809 _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
18810 __false_type)
18811 {
18812 iterator __first1 = begin();
18813 iterator __last1 = end();
18814 for (; __first1 != __last1 && __first2 != __last2;
18815 ++__first1, ++__first2)
18816 *__first1 = *__first2;
18817 if (__first2 == __last2)
18818 erase(__first1, __last1);
18819 else
18820 insert(__last1, __first2, __last2);
18821 }
18822 template<typename _Tp, typename _Alloc>
18823 void
18824 list<_Tp, _Alloc>::
18825 remove(const value_type& __value)
18826 {
18827 iterator __first = begin();
18828 iterator __last = end();
18829 iterator __extra = __last;
18830 while (__first != __last)
18831 {
18832 iterator __next = __first;
18833 ++__next;
18834 if (*__first == __value)
18835 {
18836 if (&*__first != &__value)
18837 _M_erase(__first);
18838 else
18839 __extra = __first;
18840 }
18841 __first = __next;
18842 }
18843 if (__extra != __last)
18844 _M_erase(__extra);
18845 }
18846 template<typename _Tp, typename _Alloc>
18847 void
18848 list<_Tp, _Alloc>::
18849 unique()
18850 {
18851 iterator __first = begin();
18852 iterator __last = end();
18853 if (__first == __last)
18854 return;
18855 iterator __next = __first;
18856 while (++__next != __last)
18857 {
18858 if (*__first == *__next)
18859 _M_erase(__next);
18860 else
18861 __first = __next;
18862 __next = __first;
18863 }
18864 }
18865 template<typename _Tp, typename _Alloc>
18866 void
18867 list<_Tp, _Alloc>::
18868 merge(list& __x)
18869 {
18870 if (this != &__x)
18871 {
18872 _M_check_equal_allocators(__x);
18873 iterator __first1 = begin();
18874 iterator __last1 = end();
18875 iterator __first2 = __x.begin();
18876 iterator __last2 = __x.end();
18877 while (__first1 != __last1 && __first2 != __last2)
18878 if (*__first2 < *__first1)
18879 {
18880 iterator __next = __first2;
18881 _M_transfer(__first1, __first2, ++__next);
18882 __first2 = __next;
18883 }
18884 else
18885 ++__first1;
18886 if (__first2 != __last2)
18887 _M_transfer(__last1, __first2, __last2);
18888 }
18889 }
18890 template<typename _Tp, typename _Alloc>
18891 template <typename _StrictWeakOrdering>
18892 void
18893 list<_Tp, _Alloc>::
18894 merge(list& __x, _StrictWeakOrdering __comp)
18895 {
18896 if (this != &__x)
18897 {
18898 _M_check_equal_allocators(__x);
18899 iterator __first1 = begin();
18900 iterator __last1 = end();
18901 iterator __first2 = __x.begin();
18902 iterator __last2 = __x.end();
18903 while (__first1 != __last1 && __first2 != __last2)
18904 if (__comp(*__first2, *__first1))
18905 {
18906 iterator __next = __first2;
18907 _M_transfer(__first1, __first2, ++__next);
18908 __first2 = __next;
18909 }
18910 else
18911 ++__first1;
18912 if (__first2 != __last2)
18913 _M_transfer(__last1, __first2, __last2);
18914 }
18915 }
18916 template<typename _Tp, typename _Alloc>
18917 void
18918 list<_Tp, _Alloc>::
18919 sort()
18920 {
18921 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
18922 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
18923 {
18924 list __carry;
18925 list __tmp[64];
18926 list * __fill = &__tmp[0];
18927 list * __counter;
18928 do
18929 {
18930 __carry.splice(__carry.begin(), *this, begin());
18931 for(__counter = &__tmp[0];
18932 __counter != __fill && !__counter->empty();
18933 ++__counter)
18934 {
18935 __counter->merge(__carry);
18936 __carry.swap(*__counter);
18937 }
18938 __carry.swap(*__counter);
18939 if (__counter == __fill)
18940 ++__fill;
18941 }
18942 while ( !empty() );
18943 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
18944 __counter->merge(*(__counter - 1));
18945 swap( *(__fill - 1) );
18946 }
18947 }
18948 template<typename _Tp, typename _Alloc>
18949 template <typename _Predicate>
18950 void
18951 list<_Tp, _Alloc>::
18952 remove_if(_Predicate __pred)
18953 {
18954 iterator __first = begin();
18955 iterator __last = end();
18956 while (__first != __last)
18957 {
18958 iterator __next = __first;
18959 ++__next;
18960 if (__pred(*__first))
18961 _M_erase(__first);
18962 __first = __next;
18963 }
18964 }
18965 template<typename _Tp, typename _Alloc>
18966 template <typename _BinaryPredicate>
18967 void
18968 list<_Tp, _Alloc>::
18969 unique(_BinaryPredicate __binary_pred)
18970 {
18971 iterator __first = begin();
18972 iterator __last = end();
18973 if (__first == __last)
18974 return;
18975 iterator __next = __first;
18976 while (++__next != __last)
18977 {
18978 if (__binary_pred(*__first, *__next))
18979 _M_erase(__next);
18980 else
18981 __first = __next;
18982 __next = __first;
18983 }
18984 }
18985 template<typename _Tp, typename _Alloc>
18986 template <typename _StrictWeakOrdering>
18987 void
18988 list<_Tp, _Alloc>::
18989 sort(_StrictWeakOrdering __comp)
18990 {
18991 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
18992 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
18993 {
18994 list __carry;
18995 list __tmp[64];
18996 list * __fill = &__tmp[0];
18997 list * __counter;
18998 do
18999 {
19000 __carry.splice(__carry.begin(), *this, begin());
19001 for(__counter = &__tmp[0];
19002 __counter != __fill && !__counter->empty();
19003 ++__counter)
19004 {
19005 __counter->merge(__carry, __comp);
19006 __carry.swap(*__counter);
19007 }
19008 __carry.swap(*__counter);
19009 if (__counter == __fill)
19010 ++__fill;
19011 }
19012 while ( !empty() );
19013 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
19014 __counter->merge(*(__counter - 1), __comp);
19015 swap(*(__fill - 1));
19016 }
19017 }
19018 }
19019 typedef QtValidLicenseForCoreModule QtCoreModule;
19020 template <typename T> class QVector;
19021 template <typename T> class QSet;
19022 struct QListData {
19023 struct Data {
19024 QBasicAtomicInt ref;
19025 int alloc, begin, end;
19026 uint sharable : 1;
19027 void *array[1];
19028 };
19029 enum { DataHeaderSize = sizeof(Data) - sizeof(void *) };
19030 Data *detach();
19031 Data *detach2();
19032 Data *detach3();
19033 void realloc(int alloc);
19034 static Data shared_null;
19035 Data *d;
19036 void **erase(void **xi);
19037 void **append();
19038 void **append(const QListData &l);
19039 void **append2(const QListData &l);
19040 void **prepend();
19041 void **insert(int i);
19042 void remove(int i);
19043 void remove(int i, int n);
19044 void move(int from, int to);
19045 inline int size() const { return d->end - d->begin; }
19046 inline bool isEmpty() const { return d->end == d->begin; }
19047 inline void **at(int i) const { return d->array + d->begin + i; }
19048 inline void **begin() const { return d->array + d->begin; }
19049 inline void **end() const { return d->array + d->end; }
19050 };
19051 template <typename T>
19052 class QList
19053 {
19054 struct Node { void *v;
19055 inline T &t()
19056 { return *reinterpret_cast<T*>(QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic
19057 ? v : this); }
19058 };
19059 union { QListData p; QListData::Data *d; };
19060 public:
19061 inline QList() : d(&QListData::shared_null) { d->ref.ref(); }
19062 inline QList(const QList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
19063 ~QList();
19064 QList<T> &operator=(const QList<T> &l);
19065 bool operator==(const QList<T> &l) const;
19066 inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
19067 inline int size() const { return p.size(); }
19068 inline void detach() { if (d->ref != 1) detach_helper(); }
19069 inline void detachShared()
19070 {
19071 if (d->ref != 1 && this->d != &QListData::shared_null)
19072 detach_helper();
19073 }
19074 inline bool isDetached() const { return d->ref == 1; }
19075 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
19076 inline bool isEmpty() const { return p.isEmpty(); }
19077 void clear();
19078 const T &at(int i) const;
19079 const T &operator[](int i) const;
19080 T &operator[](int i);
19081 void append(const T &t);
19082 void append(const QList<T> &t);
19083 void prepend(const T &t);
19084 void insert(int i, const T &t);
19085 void replace(int i, const T &t);
19086 void removeAt(int i);
19087 int removeAll(const T &t);
19088 bool removeOne(const T &t);
19089 T takeAt(int i);
19090 T takeFirst();
19091 T takeLast();
19092 void move(int from, int to);
19093 void swap(int i, int j);
19094 int indexOf(const T &t, int from = 0) const;
19095 int lastIndexOf(const T &t, int from = -1) const;
19096 QBool contains(const T &t) const;
19097 int count(const T &t) const;
19098 class const_iterator;
19099 class iterator {
19100 public:
19101 Node *i;
19102 typedef std::random_access_iterator_tag iterator_category;
19103 typedef ptrdiff_t difference_type;
19104 typedef T value_type;
19105 typedef T *pointer;
19106 typedef T &reference;
19107 inline iterator() : i(0) {}
19108 inline iterator(Node *n) : i(n) {}
19109 inline iterator(const iterator &o): i(o.i){}
19110 inline T &operator*() const { return i->t(); }
19111 inline T *operator->() const { return &i->t(); }
19112 inline T &operator[](int j) const { return i[j].t(); }
19113 inline bool operator==(const iterator &o) const { return i == o.i; }
19114 inline bool operator!=(const iterator &o) const { return i != o.i; }
19115 inline bool operator<(const iterator& other) const { return i < other.i; }
19116 inline bool operator<=(const iterator& other) const { return i <= other.i; }
19117 inline bool operator>(const iterator& other) const { return i > other.i; }
19118 inline bool operator>=(const iterator& other) const { return i >= other.i; }
19119 inline bool operator==(const const_iterator &o) const
19120 { return i == o.i; }
19121 inline bool operator!=(const const_iterator &o) const
19122 { return i != o.i; }
19123 inline bool operator<(const const_iterator& other) const
19124 { return i < other.i; }
19125 inline bool operator<=(const const_iterator& other) const
19126 { return i <= other.i; }
19127 inline bool operator>(const const_iterator& other) const
19128 { return i > other.i; }
19129 inline bool operator>=(const const_iterator& other) const
19130 { return i >= other.i; }
19131 inline iterator &operator++() { ++i; return *this; }
19132 inline iterator operator++(int) { Node *n = i; ++i; return n; }
19133 inline iterator &operator--() { i--; return *this; }
19134 inline iterator operator--(int) { Node *n = i; i--; return n; }
19135 inline iterator &operator+=(int j) { i+=j; return *this; }
19136 inline iterator &operator-=(int j) { i-=j; return *this; }
19137 inline iterator operator+(int j) const { return iterator(i+j); }
19138 inline iterator operator-(int j) const { return iterator(i-j); }
19139 inline int operator-(iterator j) const { return int(i - j.i); }
19140 };
19141 friend class iterator;
19142 class const_iterator {
19143 public:
19144 Node *i;
19145 typedef std::random_access_iterator_tag iterator_category;
19146 typedef ptrdiff_t difference_type;
19147 typedef T value_type;
19148 typedef const T *pointer;
19149 typedef const T &reference;
19150 inline const_iterator() : i(0) {}
19151 inline const_iterator(Node *n) : i(n) {}
19152 inline const_iterator(const const_iterator &o): i(o.i) {}
19153 inline const_iterator(const iterator &o): i(o.i) {}
19154 inline const T &operator*() const { return i->t(); }
19155 inline const T *operator->() const { return &i->t(); }
19156 inline const T &operator[](int j) const { return i[j].t(); }
19157 inline bool operator==(const const_iterator &o) const { return i == o.i; }
19158 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
19159 inline bool operator<(const const_iterator& other) const { return i < other.i; }
19160 inline bool operator<=(const const_iterator& other) const { return i <= other.i; }
19161 inline bool operator>(const const_iterator& other) const { return i > other.i; }
19162 inline bool operator>=(const const_iterator& other) const { return i >= other.i; }
19163 inline const_iterator &operator++() { ++i; return *this; }
19164 inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
19165 inline const_iterator &operator--() { i--; return *this; }
19166 inline const_iterator operator--(int) { Node *n = i; i--; return n; }
19167 inline const_iterator &operator+=(int j) { i+=j; return *this; }
19168 inline const_iterator &operator-=(int j) { i-=j; return *this; }
19169 inline const_iterator operator+(int j) const { return const_iterator(i+j); }
19170 inline const_iterator operator-(int j) const { return const_iterator(i-j); }
19171 inline int operator-(const_iterator j) const { return i - j.i; }
19172 };
19173 friend class const_iterator;
19174 inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
19175 inline const_iterator begin() const { return reinterpret_cast<Node *>(p.begin()); }
19176 inline const_iterator constBegin() const { return reinterpret_cast<Node *>(p.begin()); }
19177 inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
19178 inline const_iterator end() const { return reinterpret_cast<Node *>(p.end()); }
19179 inline const_iterator constEnd() const { return reinterpret_cast<Node *>(p.end()); }
19180 iterator insert(iterator before, const T &t);
19181 iterator erase(iterator pos);
19182 iterator erase(iterator first, iterator last);
19183 typedef iterator Iterator;
19184 typedef const_iterator ConstIterator;
19185 inline int count() const { return p.size(); }
19186 inline int length() const { return p.size(); }
19187 inline T& first() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qlist.h",263) : qt_noop()); return *begin(); }
19188 inline const T& first() const { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qlist.h",264) : qt_noop()); return *begin(); }
19189 T& last() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qlist.h",265) : qt_noop()); return *(--end()); }
19190 const T& last() const { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qlist.h",266) : qt_noop()); return *(--end()); }
19191 inline void removeFirst() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qlist.h",267) : qt_noop()); erase(begin()); }
19192 inline void removeLast() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qlist.h",268) : qt_noop()); erase(--end()); }
19193 inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
19194 inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
19195 QList<T> mid(int pos, int length = -1) const;
19196 T value(int i) const;
19197 T value(int i, const T &defaultValue) const;
19198 inline void push_back(const T &t) { append(t); }
19199 inline void push_front(const T &t) { prepend(t); }
19200 inline T& front() { return first(); }
19201 inline const T& front() const { return first(); }
19202 inline T& back() { return last(); }
19203 inline const T& back() const { return last(); }
19204 inline void pop_front() { removeFirst(); }
19205 inline void pop_back() { removeLast(); }
19206 inline bool empty() const { return isEmpty(); }
19207 typedef int size_type;
19208 typedef T value_type;
19209 typedef value_type *pointer;
19210 typedef const value_type *const_pointer;
19211 typedef value_type &reference;
19212 typedef const value_type &const_reference;
19213 typedef ptrdiff_t difference_type;
19214 QList<T> &operator+=(const QList<T> &l);
19215 inline QList<T> operator+(const QList<T> &l) const
19216 { QList n = *this; n += l; return n; }
19217 inline QList<T> &operator+=(const T &t)
19218 { append(t); return *this; }
19219 inline QList<T> &operator<< (const T &t)
19220 { append(t); return *this; }
19221 inline QList<T> &operator<<(const QList<T> &l)
19222 { *this += l; return *this; }
19223 QVector<T> toVector() const;
19224 QSet<T> toSet() const;
19225 static QList<T> fromVector(const QVector<T> &vector);
19226 static QList<T> fromSet(const QSet<T> &set);
19227 static inline QList<T> fromStdList(const std::list<T> &list)
19228 { QList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
19229 inline std::list<T> toStdList() const
19230 { std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
19231 private:
19232 void detach_helper();
19233 void free(QListData::Data *d);
19234 void node_construct(Node *n, const T &t);
19235 void node_destruct(Node *n);
19236 void node_copy(Node *from, Node *to, Node *src);
19237 void node_destruct(Node *from, Node *to);
19238 };
19239 template <typename T>
19240 inline void QList<T>::node_construct(Node *n, const T &t)
19241 {
19242 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) n->v = new T(t);
19243 else if (QTypeInfo<T>::isComplex) new (n) T(t);
19244 else *reinterpret_cast<T*>(n) = t;
19245 }
19246 template <typename T>
19247 inline void QList<T>::node_destruct(Node *n)
19248 {
19249 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) delete reinterpret_cast<T*>(n->v);
19250 else if (QTypeInfo<T>::isComplex) reinterpret_cast<T*>(n)->~T();
19251 }
19252 template <typename T>
19253 inline void QList<T>::node_copy(Node *from, Node *to, Node *src)
19254 {
19255 Node *current = from;
19256 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
19257 try {
19258 while(current != to) {
19259 current->v = new T(*reinterpret_cast<T*>(src->v));
19260 ++current;
19261 ++src;
19262 }
19263 } catch (...) {
19264 while (current-- != from)
19265 delete reinterpret_cast<T*>(current->v);
19266 throw;
19267 }
19268 } else if (QTypeInfo<T>::isComplex) {
19269 try {
19270 while(current != to) {
19271 new (current) T(*reinterpret_cast<T*>(src));
19272 ++current;
19273 ++src;
19274 }
19275 } catch (...) {
19276 while (current-- != from)
19277 (reinterpret_cast<T*>(current))->~T();
19278 throw;
19279 }
19280 } else {
19281 if (src != from && to - from > 0)
19282 memcpy(from, src, (to - from) * sizeof(Node *));
19283 }
19284 }
19285 template <typename T>
19286 inline void QList<T>::node_destruct(Node *from, Node *to)
19287 {
19288 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
19289 while(from != to) --to, delete reinterpret_cast<T*>(to->v);
19290 else if (QTypeInfo<T>::isComplex)
19291 while (from != to) --to, reinterpret_cast<T*>(to)->~T();
19292 }
19293 template <typename T>
19294 inline QList<T> &QList<T>::operator=(const QList<T> &l)
19295 {
19296 if (d != l.d) {
19297 l.d->ref.ref();
19298 if (!d->ref.deref())
19299 free(d);
19300 d = l.d;
19301 if (!d->sharable)
19302 detach_helper();
19303 }
19304 return *this;
19305 }
19306 template <typename T>
19307 inline typename QList<T>::iterator QList<T>::insert(iterator before, const T &t)
19308 {
19309 int iBefore = int(before.i - reinterpret_cast<Node *>(p.begin()));
19310 Node *n = reinterpret_cast<Node *>(p.insert(iBefore));
19311 try {
19312 node_construct(n, t);
19313 } catch (...) {
19314 p.remove(iBefore);
19315 throw;
19316 }
19317 return n;
19318 }
19319 template <typename T>
19320 inline typename QList<T>::iterator QList<T>::erase(iterator it)
19321 { node_destruct(it.i);
19322 return reinterpret_cast<Node *>(p.erase(reinterpret_cast<void**>(it.i))); }
19323 template <typename T>
19324 inline const T &QList<T>::at(int i) const
19325 { ((!(i >= 0 && i < p.size())) ? qt_assert_x("QList<T>::at", "index out of range","/usr/include/qt4/QtCore/qlist.h",439) : qt_noop());
19326 return reinterpret_cast<Node *>(p.at(i))->t(); }
19327 template <typename T>
19328 inline const T &QList<T>::operator[](int i) const
19329 { ((!(i >= 0 && i < p.size())) ? qt_assert_x("QList<T>::operator[]", "index out of range","/usr/include/qt4/QtCore/qlist.h",443) : qt_noop());
19330 return reinterpret_cast<Node *>(p.at(i))->t(); }
19331 template <typename T>
19332 inline T &QList<T>::operator[](int i)
19333 { ((!(i >= 0 && i < p.size())) ? qt_assert_x("QList<T>::operator[]", "index out of range","/usr/include/qt4/QtCore/qlist.h",447) : qt_noop());
19334 detach(); return reinterpret_cast<Node *>(p.at(i))->t(); }
19335 template <typename T>
19336 inline void QList<T>::removeAt(int i)
19337 { if(i >= 0 && i < p.size()) { detach();
19338 node_destruct(reinterpret_cast<Node *>(p.at(i))); p.remove(i); } }
19339 template <typename T>
19340 inline T QList<T>::takeAt(int i)
19341 { ((!(i >= 0 && i < p.size())) ? qt_assert_x("QList<T>::take", "index out of range","/usr/include/qt4/QtCore/qlist.h",455) : qt_noop());
19342 detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = n->t(); node_destruct(n);
19343 p.remove(i); return t; }
19344 template <typename T>
19345 inline T QList<T>::takeFirst()
19346 { T t = first(); removeFirst(); return t; }
19347 template <typename T>
19348 inline T QList<T>::takeLast()
19349 { T t = last(); removeLast(); return t; }
19350 template <typename T>
19351 void QList<T>::append(const T &t)
19352 {
19353 detach();
19354 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
19355 Node *n = reinterpret_cast<Node *>(p.append());
19356 try {
19357 node_construct(n, t);
19358 } catch (...) {
19359 --d->end;
19360 throw;
19361 }
19362 } else {
19363 const T cpy(t);
19364 Node *n = reinterpret_cast<Node *>(p.append());
19365 try {
19366 node_construct(n, cpy);
19367 } catch (...) {
19368 --d->end;
19369 throw;
19370 }
19371 }
19372 }
19373 template <typename T>
19374 inline void QList<T>::prepend(const T &t)
19375 {
19376 detach();
19377 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
19378 Node *n = reinterpret_cast<Node *>(p.prepend());
19379 try {
19380 node_construct(n, t);
19381 } catch (...) {
19382 ++d->begin;
19383 throw;
19384 }
19385 } else {
19386 const T cpy(t);
19387 Node *n = reinterpret_cast<Node *>(p.prepend());
19388 try {
19389 node_construct(n, cpy);
19390 } catch (...) {
19391 ++d->begin;
19392 throw;
19393 }
19394 }
19395 }
19396 template <typename T>
19397 inline void QList<T>::insert(int i, const T &t)
19398 {
19399 detach();
19400 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
19401 Node *n = reinterpret_cast<Node *>(p.insert(i));
19402 try {
19403 node_construct(n, t);
19404 } catch (...) {
19405 p.remove(i);
19406 throw;
19407 }
19408 } else {
19409 const T cpy(t);
19410 Node *n = reinterpret_cast<Node *>(p.insert(i));
19411 try {
19412 node_construct(n, cpy);
19413 } catch (...) {
19414 p.remove(i);
19415 throw;
19416 }
19417 }
19418 }
19419 template <typename T>
19420 inline void QList<T>::replace(int i, const T &t)
19421 {
19422 ((!(i >= 0 && i < p.size())) ? qt_assert_x("QList<T>::replace", "index out of range","/usr/include/qt4/QtCore/qlist.h",540) : qt_noop());
19423 detach();
19424 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
19425 reinterpret_cast<Node *>(p.at(i))->t() = t;
19426 } else {
19427 const T cpy(t);
19428 reinterpret_cast<Node *>(p.at(i))->t() = cpy;
19429 }
19430 }
19431 template <typename T>
19432 inline void QList<T>::swap(int i, int j)
19433 {
19434 ((!(i >= 0 && i < p.size() && j >= 0 && j < p.size())) ? qt_assert_x("QList<T>::swap", "index out of range",
19435 "/usr/include/qt4/QtCore/qlist.h"
19436 ,
19437 554
19438 ) : qt_noop())
19439 ;
19440 detach();
19441 void *t = d->array[d->begin + i];
19442 d->array[d->begin + i] = d->array[d->begin + j];
19443 d->array[d->begin + j] = t;
19444 }
19445 template <typename T>
19446 inline void QList<T>::move(int from, int to)
19447 {
19448 ((!(from >= 0 && from < p.size() && to >= 0 && to < p.size())) ? qt_assert_x("QList<T>::move", "index out of range",
19449 "/usr/include/qt4/QtCore/qlist.h"
19450 ,
19451 565
19452 ) : qt_noop())
19453 ;
19454 detach();
19455 p.move(from, to);
19456 }
19457 template<typename T>
19458 QList<T> QList<T>::mid(int pos, int alength) const
19459 {
19460 if (alength < 0)
19461 alength = size() - pos;
19462 if (pos == 0 && alength == size())
19463 return *this;
19464 QList<T> cpy;
19465 if (pos + alength > size())
19466 alength = size() - pos;
19467 for (int i = pos; i < pos + alength; ++i)
19468 cpy += at(i);
19469 return cpy;
19470 }
19471 template<typename T>
19472 T QList<T>::value(int i) const
19473 {
19474 if (i < 0 || i >= p.size()) {
19475 return T();
19476 }
19477 return reinterpret_cast<Node *>(p.at(i))->t();
19478 }
19479 template<typename T>
19480 T QList<T>::value(int i, const T& defaultValue) const
19481 {
19482 return ((i < 0 || i >= p.size()) ? defaultValue : reinterpret_cast<Node *>(p.at(i))->t());
19483 }
19484 template <typename T>
19485 void QList<T>::detach_helper()
19486 {
19487 Node *n = reinterpret_cast<Node *>(p.begin());
19488 QListData::Data *x = p.detach3();
19489 try {
19490 node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
19491 } catch (...) {
19492 qFree(d);
19493 d = x;
19494 throw;
19495 }
19496 if (!x->ref.deref())
19497 free(x);
19498 }
19499 template <typename T>
19500 QList<T>::~QList()
19501 {
19502 if (d && !d->ref.deref())
19503 free(d);
19504 }
19505 template <typename T>
19506 bool QList<T>::operator==(const QList<T> &l) const
19507 {
19508 if (p.size() != l.p.size())
19509 return false;
19510 if (d == l.d)
19511 return true;
19512 Node *i = reinterpret_cast<Node *>(p.end());
19513 Node *b = reinterpret_cast<Node *>(p.begin());
19514 Node *li = reinterpret_cast<Node *>(l.p.end());
19515 while (i != b) {
19516 --i; --li;
19517 if (!(i->t() == li->t()))
19518 return false;
19519 }
19520 return true;
19521 }
19522 template <typename T>
19523 void QList<T>::free(QListData::Data *data)
19524 {
19525 node_destruct(reinterpret_cast<Node *>(data->array + data->begin),
19526 reinterpret_cast<Node *>(data->array + data->end));
19527 if (data->ref == 0)
19528 qFree(data);
19529 }
19530 template <typename T>
19531 void QList<T>::clear()
19532 {
19533 *this = QList<T>();
19534 }
19535 template <typename T>
19536 int QList<T>::removeAll(const T &_t)
19537 {
19538 detachShared();
19539 const T t = _t;
19540 int removedCount=0, i=0;
19541 Node *n;
19542 while (i < p.size())
19543 if ((n = reinterpret_cast<Node *>(p.at(i)))->t() == t) {
19544 node_destruct(n);
19545 p.remove(i);
19546 ++removedCount;
19547 } else {
19548 ++i;
19549 }
19550 return removedCount;
19551 }
19552 template <typename T>
19553 bool QList<T>::removeOne(const T &_t)
19554 {
19555 detachShared();
19556 int index = indexOf(_t);
19557 if (index != -1) {
19558 removeAt(index);
19559 return true;
19560 }
19561 return false;
19562 }
19563 template <typename T>
19564 typename QList<T>::iterator QList<T>::erase(typename QList<T>::iterator afirst,
19565 typename QList<T>::iterator alast)
19566 {
19567 for (Node *n = afirst.i; n < alast.i; ++n)
19568 node_destruct(n);
19569 int idx = afirst - begin();
19570 p.remove(idx, alast - afirst);
19571 return begin() + idx;
19572 }
19573 template <typename T>
19574 QList<T> &QList<T>::operator+=(const QList<T> &l)
19575 {
19576 detach();
19577 Node *n = reinterpret_cast<Node *>(p.append2(l.p));
19578 try{
19579 node_copy(n, reinterpret_cast<Node *>(p.end()), reinterpret_cast<Node *>(l.p.begin()));
19580 } catch (...) {
19581 d->end -= int(reinterpret_cast<Node *>(p.end()) - n);
19582 throw;
19583 }
19584 return *this;
19585 }
19586 template <typename T>
19587 inline void QList<T>::append(const QList<T> &t)
19588 {
19589 *this += t;
19590 }
19591 template <typename T>
19592 int QList<T>::indexOf(const T &t, int from) const
19593 {
19594 if (from < 0)
19595 from = qMax(from + p.size(), 0);
19596 if (from < p.size()) {
19597 Node *n = reinterpret_cast<Node *>(p.at(from -1));
19598 Node *e = reinterpret_cast<Node *>(p.end());
19599 while (++n != e)
19600 if (n->t() == t)
19601 return int(n - reinterpret_cast<Node *>(p.begin()));
19602 }
19603 return -1;
19604 }
19605 template <typename T>
19606 int QList<T>::lastIndexOf(const T &t, int from) const
19607 {
19608 if (from < 0)
19609 from += p.size();
19610 else if (from >= p.size())
19611 from = p.size()-1;
19612 if (from >= 0) {
19613 Node *b = reinterpret_cast<Node *>(p.begin());
19614 Node *n = reinterpret_cast<Node *>(p.at(from + 1));
19615 while (n-- != b) {
19616 if (n->t() == t)
19617 return n - b;
19618 }
19619 }
19620 return -1;
19621 }
19622 template <typename T>
19623 QBool QList<T>::contains(const T &t) const
19624 {
19625 Node *b = reinterpret_cast<Node *>(p.begin());
19626 Node *i = reinterpret_cast<Node *>(p.end());
19627 while (i-- != b)
19628 if (i->t() == t)
19629 return QBool(true);
19630 return QBool(false);
19631 }
19632 template <typename T>
19633 int QList<T>::count(const T &t) const
19634 {
19635 int c = 0;
19636 Node *b = reinterpret_cast<Node *>(p.begin());
19637 Node *i = reinterpret_cast<Node *>(p.end());
19638 while (i-- != b)
19639 if (i->t() == t)
19640 ++c;
19641 return c;
19642 }
19643 template <class T> class QListIterator { typedef typename QList<T>::const_iterator const_iterator; QList<T> c; const_iterator i; public: inline QListIterator(const QList<T> &container) : c(container), i(c.constBegin()) {} inline QListIterator &operator=(const QList<T> &container) { c = container; i = c.constBegin(); return *this; } inline void toFront() { i = c.constBegin(); } inline void toBack() { i = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline const T &next() { return *i++; } inline const T &peekNext() const { return *i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline const T &previous() { return *--i; } inline const T &peekPrevious() const { const_iterator p = i; return *--p; } inline bool findNext(const T &t) { while (i != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(--i) == t) return true; return false; } };
19644 template <class T> class QMutableListIterator { typedef typename QList<T>::iterator iterator; typedef typename QList<T>::const_iterator const_iterator; QList<T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableListIterator(QList<T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableListIterator() { c->setSharable(true); } inline QMutableListIterator &operator=(QList<T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = i; } inline bool hasNext() const { return c->constEnd() != const_iterator(i); } inline T &next() { n = i++; return *n; } inline T &peekNext() const { return *i; } inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); } inline T &previous() { n = --i; return *n; } inline T &peekPrevious() const { iterator p = i; return *--p; } inline void remove() { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) const { if (c->constEnd() != const_iterator(n)) *n = t; } inline T &value() { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qlist.h",778) : qt_noop()); return *n; } inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qlist.h",778) : qt_noop()); return *n; } inline void insert(const T &t) { n = i = c->insert(i, t); ++i; } inline bool findNext(const T &t) { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true; n = c->end(); return false; } };
19645 typedef QtValidLicenseForCoreModule QtCoreModule;
19646 class QEvent;
19647 class QTimerEvent;
19648 class QChildEvent;
19649 struct QMetaObject;
19650 class QVariant;
19651 class QObjectPrivate;
19652 class QObject;
19653 class QThread;
19654 class QWidget;
19655 class QRegExp;
19656 class QObjectUserData;
19657 typedef QList<QObject*> QObjectList;
19658 template<typename T> inline T qFindChild(const QObject *, const QString & = QString());
19659 template<typename T> inline QList<T> qFindChildren(const QObject *, const QString & = QString());
19660 template<typename T> inline QList<T> qFindChildren(const QObject *, const QRegExp &);
19661 class
19662 QObjectData {
19663 public:
19664 virtual ~QObjectData() = 0;
19665 QObject *q_ptr;
19666 QObject *parent;
19667 QObjectList children;
19668 uint isWidget : 1;
19669 uint pendTimer : 1;
19670 uint blockSig : 1;
19671 uint wasDeleted : 1;
19672 uint ownObjectName : 1;
19673 uint sendChildEvents : 1;
19674 uint receiveChildEvents : 1;
19675 uint inEventHandler : 1;
19676 uint inThreadChangeEvent : 1;
19677 uint hasGuards : 1;
19678 uint unused : 22;
19679 int postedEvents;
19680 QMetaObject *metaObject;
19681 };
19682 class QObject
19683 {
19684 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
19685
19686 inline QObjectPrivate* d_func() { return reinterpret_cast<QObjectPrivate *>(qGetPtrHelper(d_ptr)); } inline const QObjectPrivate* d_func() const { return reinterpret_cast<const QObjectPrivate *>(qGetPtrHelper(d_ptr)); } friend class QObjectPrivate;
19687 public:
19688 explicit QObject(QObject *parent=0);
19689 virtual ~QObject();
19690 virtual bool event(QEvent *);
19691 virtual bool eventFilter(QObject *, QEvent *);
19692 QString objectName() const;
19693 void setObjectName(const QString &name);
19694 inline bool isWidgetType() const { return d_ptr->isWidget; }
19695 inline bool signalsBlocked() const { return d_ptr->blockSig; }
19696 bool blockSignals(bool b);
19697 QThread *thread() const;
19698 void moveToThread(QThread *thread);
19699 int startTimer(int interval);
19700 void killTimer(int id);
19701 template<typename T>
19702 inline T findChild(const QString &aName = QString()) const
19703 { return qFindChild<T>(this, aName); }
19704 template<typename T>
19705 inline QList<T> findChildren(const QString &aName = QString()) const
19706 { return qFindChildren<T>(this, aName); }
19707 template<typename T>
19708 inline QList<T> findChildren(const QRegExp &re) const
19709 { return qFindChildren<T>(this, re); }
19710 inline const QObjectList &children() const { return d_ptr->children; }
19711 void setParent(QObject *);
19712 void installEventFilter(QObject *);
19713 void removeEventFilter(QObject *);
19714 static bool connect(const QObject *sender, const char *signal,
19715 const QObject *receiver, const char *member, Qt::ConnectionType =
19716 Qt::AutoConnection
19717 );
19718 inline bool connect(const QObject *sender, const char *signal,
19719 const char *member, Qt::ConnectionType type =
19720 Qt::AutoConnection
19721 ) const;
19722 static bool disconnect(const QObject *sender, const char *signal,
19723 const QObject *receiver, const char *member);
19724 inline bool disconnect(const char *signal = 0,
19725 const QObject *receiver = 0, const char *member = 0)
19726 { return disconnect(this, signal, receiver, member); }
19727 inline bool disconnect(const QObject *receiver, const char *member = 0)
19728 { return disconnect(this, 0, receiver, member); }
19729 void dumpObjectTree();
19730 void dumpObjectInfo();
19731 bool setProperty(const char *name, const QVariant &value);
19732 QVariant property(const char *name) const;
19733 QList<QByteArray> dynamicPropertyNames() const;
19734 static uint registerUserData();
19735 void setUserData(uint id, QObjectUserData* data);
19736 QObjectUserData* userData(uint id) const;
19737 public:
19738 void destroyed(QObject * = 0);
19739 public:
19740 inline QObject *parent() const { return d_ptr->parent; }
19741 inline bool inherits(const char *classname) const
19742 { return const_cast<QObject *>(this)->qt_metacast(classname) != 0; }
19743 public :
19744 void deleteLater();
19745 public:
19746 QObject *sender() const;
19747 int receivers(const char* signal) const;
19748 virtual void timerEvent(QTimerEvent *);
19749 virtual void childEvent(QChildEvent *);
19750 virtual void customEvent(QEvent *);
19751 virtual void connectNotify(const char *signal);
19752 virtual void disconnectNotify(const char *signal);
19753 public:
19754 QObject(QObjectPrivate &dd, QObject *parent = 0);
19755 public:
19756 QScopedPointer<QObjectData> d_ptr;
19757 static const QMetaObject staticQtMetaObject;
19758 friend struct QMetaObject;
19759 friend class QApplication;
19760 friend class QApplicationPrivate;
19761 friend class QCoreApplication;
19762 friend class QCoreApplicationPrivate;
19763 friend class QWidget;
19764 friend class QThreadData;
19765 private:
19766 QObject(const QObject &); QObject &operator=(const QObject &);
19767
19768 };
19769 inline bool QObject::connect(const QObject *asender, const char *asignal,
19770 const char *amember, Qt::ConnectionType atype) const
19771 { return connect(asender, asignal, this, amember, atype); }
19772 class QObjectUserData {
19773 public:
19774 virtual ~QObjectUserData();
19775 };
19776 void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re,
19777 const QMetaObject &mo, QList<void *> *list);
19778 QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo);
19779 template<typename T>
19780 inline T qFindChild(const QObject *o, const QString &name)
19781 { return static_cast<T>(qt_qFindChild_helper(o, name, reinterpret_cast<T>(0)->staticMetaObject)); }
19782 template<typename T>
19783 inline QList<T> qFindChildren(const QObject *o, const QString &name)
19784 {
19785 QList<T> list;
19786 union {
19787 QList<T> *typedList;
19788 QList<void *> *voidList;
19789 } u;
19790 u.typedList = &list;
19791 qt_qFindChildren_helper(o, name, 0, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
19792 return list;
19793 }
19794 template<typename T>
19795 inline QList<T> qFindChildren(const QObject *o, const QRegExp &re)
19796 {
19797 QList<T> list;
19798 union {
19799 QList<T> *typedList;
19800 QList<void *> *voidList;
19801 } u;
19802 u.typedList = &list;
19803 qt_qFindChildren_helper(o, QString(), &re, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
19804 return list;
19805 }
19806 template <class T>
19807 inline T qobject_cast(QObject *object)
19808 {
19809 reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
19810 return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
19811 }
19812 template <class T>
19813 inline T qobject_cast(const QObject *object)
19814 {
19815 register T ptr = static_cast<T>(object);
19816 (void)ptr;;
19817 reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
19818 return static_cast<T>(const_cast<QObject *>(reinterpret_cast<T>(0)->staticMetaObject.cast(const_cast<QObject *>(object))));
19819 }
19820 template <class T> inline const char * qobject_interface_iid()
19821 { return 0; }
19822 QDebug operator<<(QDebug, const QObject *);
19823 typedef QtValidLicenseForCoreModule QtCoreModule;
19824 class QByteArray;
19825 class QIODevicePrivate;
19826 class QIODevice
19827 : public QObject
19828 {
19829 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
19830 public:
19831 enum OpenModeFlag {
19832 NotOpen = 0x0000,
19833 ReadOnly = 0x0001,
19834 WriteOnly = 0x0002,
19835 ReadWrite = ReadOnly | WriteOnly,
19836 Append = 0x0004,
19837 Truncate = 0x0008,
19838 Text = 0x0010,
19839 Unbuffered = 0x0020
19840 };
19841 typedef QFlags<OpenModeFlag> OpenMode;
19842 QIODevice();
19843 explicit QIODevice(QObject *parent);
19844 virtual ~QIODevice();
19845 OpenMode openMode() const;
19846 void setTextModeEnabled(bool enabled);
19847 bool isTextModeEnabled() const;
19848 bool isOpen() const;
19849 bool isReadable() const;
19850 bool isWritable() const;
19851 virtual bool isSequential() const;
19852 virtual bool open(OpenMode mode);
19853 virtual void close();
19854 virtual qint64 pos() const;
19855 virtual qint64 size() const;
19856 virtual bool seek(qint64 pos);
19857 virtual bool atEnd() const;
19858 virtual bool reset();
19859 virtual qint64 bytesAvailable() const;
19860 virtual qint64 bytesToWrite() const;
19861 qint64 read(char *data, qint64 maxlen);
19862 QByteArray read(qint64 maxlen);
19863 QByteArray readAll();
19864 qint64 readLine(char *data, qint64 maxlen);
19865 QByteArray readLine(qint64 maxlen = 0);
19866 virtual bool canReadLine() const;
19867 qint64 write(const char *data, qint64 len);
19868 qint64 write(const char *data);
19869 inline qint64 write(const QByteArray &data)
19870 { return write(data.constData(), data.size()); }
19871 qint64 peek(char *data, qint64 maxlen);
19872 QByteArray peek(qint64 maxlen);
19873 virtual bool waitForReadyRead(int msecs);
19874 virtual bool waitForBytesWritten(int msecs);
19875 void ungetChar(char c);
19876 bool putChar(char c);
19877 bool getChar(char *c);
19878 QString errorString() const;
19879 public:
19880 void readyRead();
19881 void bytesWritten(qint64 bytes);
19882 void aboutToClose();
19883 void readChannelFinished();
19884 public:
19885 QIODevice(QIODevicePrivate &dd, QObject *parent = 0);
19886 virtual qint64 readData(char *data, qint64 maxlen) = 0;
19887 virtual qint64 readLineData(char *data, qint64 maxlen);
19888 virtual qint64 writeData(const char *data, qint64 len) = 0;
19889 void setOpenMode(OpenMode openMode);
19890 void setErrorString(const QString &errorString);
19891 private:
19892 inline QIODevicePrivate* d_func() { return reinterpret_cast<QIODevicePrivate *>(qGetPtrHelper(d_ptr)); } inline const QIODevicePrivate* d_func() const { return reinterpret_cast<const QIODevicePrivate *>(qGetPtrHelper(d_ptr)); } friend class QIODevicePrivate;
19893 QIODevice(const QIODevice &); QIODevice &operator=(const QIODevice &);
19894 };
19895 inline QFlags<QIODevice::OpenMode::enum_type> operator|(QIODevice::OpenMode::enum_type f1, QIODevice::OpenMode::enum_type f2) { return QFlags<QIODevice::OpenMode::enum_type>(f1) | f2; } inline QFlags<QIODevice::OpenMode::enum_type> operator|(QIODevice::OpenMode::enum_type f1, QFlags<QIODevice::OpenMode::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QIODevice::OpenMode::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
19896 class QDebug;
19897 QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
19898 typedef QtValidLicenseForCoreModule QtCoreModule;
19899 class QByteArray;
19900 class QIODevice;
19901 template <typename T> class QList;
19902 template <typename T> class QLinkedList;
19903 template <typename T> class QVector;
19904 template <typename T> class QSet;
19905 template <class Key, class T> class QHash;
19906 template <class Key, class T> class QMap;
19907 class QDataStreamPrivate;
19908 class QDataStream
19909 {
19910 public:
19911 enum Version {
19912 Qt_1_0 = 1,
19913 Qt_2_0 = 2,
19914 Qt_2_1 = 3,
19915 Qt_3_0 = 4,
19916 Qt_3_1 = 5,
19917 Qt_3_3 = 6,
19918 Qt_4_0 = 7,
19919 Qt_4_1 = Qt_4_0,
19920 Qt_4_2 = 8,
19921 Qt_4_3 = 9,
19922 Qt_4_4 = 10,
19923 Qt_4_5 = 11,
19924 Qt_4_6 = 12
19925 };
19926 enum ByteOrder {
19927 BigEndian = QSysInfo::BigEndian,
19928 LittleEndian = QSysInfo::LittleEndian
19929 };
19930 enum Status {
19931 Ok,
19932 ReadPastEnd,
19933 ReadCorruptData
19934 };
19935 enum FloatingPointPrecision {
19936 SinglePrecision,
19937 DoublePrecision
19938 };
19939 QDataStream();
19940 explicit QDataStream(QIODevice *);
19941 QDataStream(QByteArray *, QIODevice::OpenMode flags);
19942 QDataStream(const QByteArray &);
19943 virtual ~QDataStream();
19944 QIODevice *device() const;
19945 void setDevice(QIODevice *);
19946 void unsetDevice();
19947 bool atEnd() const;
19948 Status status() const;
19949 void setStatus(Status status);
19950 void resetStatus();
19951 FloatingPointPrecision floatingPointPrecision() const;
19952 void setFloatingPointPrecision(FloatingPointPrecision precision);
19953 ByteOrder byteOrder() const;
19954 void setByteOrder(ByteOrder);
19955 int version() const;
19956 void setVersion(int);
19957 QDataStream &operator>>(qint8 &i);
19958 QDataStream &operator>>(quint8 &i);
19959 QDataStream &operator>>(qint16 &i);
19960 QDataStream &operator>>(quint16 &i);
19961 QDataStream &operator>>(qint32 &i);
19962 QDataStream &operator>>(quint32 &i);
19963 QDataStream &operator>>(qint64 &i);
19964 QDataStream &operator>>(quint64 &i);
19965 QDataStream &operator>>(bool &i);
19966 QDataStream &operator>>(float &f);
19967 QDataStream &operator>>(double &f);
19968 QDataStream &operator>>(char *&str);
19969 QDataStream &operator<<(qint8 i);
19970 QDataStream &operator<<(quint8 i);
19971 QDataStream &operator<<(qint16 i);
19972 QDataStream &operator<<(quint16 i);
19973 QDataStream &operator<<(qint32 i);
19974 QDataStream &operator<<(quint32 i);
19975 QDataStream &operator<<(qint64 i);
19976 QDataStream &operator<<(quint64 i);
19977 QDataStream &operator<<(bool i);
19978 QDataStream &operator<<(float f);
19979 QDataStream &operator<<(double f);
19980 QDataStream &operator<<(const char *str);
19981 QDataStream &readBytes(char *&, uint &len);
19982 int readRawData(char *, int len);
19983 QDataStream &writeBytes(const char *, uint len);
19984 int writeRawData(const char *, int len);
19985 int skipRawData(int len);
19986 private:
19987 QDataStream(const QDataStream &); QDataStream &operator=(const QDataStream &);
19988 QScopedPointer<QDataStreamPrivate> d;
19989 QIODevice *dev;
19990 bool owndev;
19991 bool noswap;
19992 ByteOrder byteorder;
19993 int ver;
19994 Status q_status;
19995 };
19996 inline QIODevice *QDataStream::device() const
19997 { return dev; }
19998 inline QDataStream::ByteOrder QDataStream::byteOrder() const
19999 { return byteorder; }
20000 inline int QDataStream::version() const
20001 { return ver; }
20002 inline void QDataStream::setVersion(int v)
20003 { ver = v; }
20004 inline QDataStream &QDataStream::operator>>(quint8 &i)
20005 { return *this >> reinterpret_cast<qint8&>(i); }
20006 inline QDataStream &QDataStream::operator>>(quint16 &i)
20007 { return *this >> reinterpret_cast<qint16&>(i); }
20008 inline QDataStream &QDataStream::operator>>(quint32 &i)
20009 { return *this >> reinterpret_cast<qint32&>(i); }
20010 inline QDataStream &QDataStream::operator>>(quint64 &i)
20011 { return *this >> reinterpret_cast<qint64&>(i); }
20012 inline QDataStream &QDataStream::operator<<(quint8 i)
20013 { return *this << qint8(i); }
20014 inline QDataStream &QDataStream::operator<<(quint16 i)
20015 { return *this << qint16(i); }
20016 inline QDataStream &QDataStream::operator<<(quint32 i)
20017 { return *this << qint32(i); }
20018 inline QDataStream &QDataStream::operator<<(quint64 i)
20019 { return *this << qint64(i); }
20020 template <typename T>
20021 QDataStream& operator>>(QDataStream& s, QList<T>& l)
20022 {
20023 l.clear();
20024 quint32 c;
20025 s >> c;
20026 for(quint32 i = 0; i < c; ++i)
20027 {
20028 T t;
20029 s >> t;
20030 l.append(t);
20031 if (s.atEnd())
20032 break;
20033 }
20034 return s;
20035 }
20036 template <typename T>
20037 QDataStream& operator<<(QDataStream& s, const QList<T>& l)
20038 {
20039 s << quint32(l.size());
20040 for (int i = 0; i < l.size(); ++i)
20041 s << l.at(i);
20042 return s;
20043 }
20044 template <typename T>
20045 QDataStream& operator>>(QDataStream& s, QLinkedList<T>& l)
20046 {
20047 l.clear();
20048 quint32 c;
20049 s >> c;
20050 for(quint32 i = 0; i < c; ++i)
20051 {
20052 T t;
20053 s >> t;
20054 l.append(t);
20055 if (s.atEnd())
20056 break;
20057 }
20058 return s;
20059 }
20060 template <typename T>
20061 QDataStream& operator<<(QDataStream& s, const QLinkedList<T>& l)
20062 {
20063 s << quint32(l.size());
20064 typename QLinkedList<T>::ConstIterator it = l.constBegin();
20065 for(; it != l.constEnd(); ++it)
20066 s << *it;
20067 return s;
20068 }
20069 template<typename T>
20070 QDataStream& operator>>(QDataStream& s, QVector<T>& v)
20071 {
20072 v.clear();
20073 quint32 c;
20074 s >> c;
20075 v.resize(c);
20076 for(quint32 i = 0; i < c; ++i) {
20077 T t;
20078 s >> t;
20079 v[i] = t;
20080 }
20081 return s;
20082 }
20083 template<typename T>
20084 QDataStream& operator<<(QDataStream& s, const QVector<T>& v)
20085 {
20086 s << quint32(v.size());
20087 for (typename QVector<T>::const_iterator it = v.begin(); it != v.end(); ++it)
20088 s << *it;
20089 return s;
20090 }
20091 template <typename T>
20092 QDataStream &operator>>(QDataStream &in, QSet<T> &set)
20093 {
20094 set.clear();
20095 quint32 c;
20096 in >> c;
20097 for (quint32 i = 0; i < c; ++i) {
20098 T t;
20099 in >> t;
20100 set << t;
20101 if (in.atEnd())
20102 break;
20103 }
20104 return in;
20105 }
20106 template <typename T>
20107 QDataStream& operator<<(QDataStream &out, const QSet<T> &set)
20108 {
20109 out << quint32(set.size());
20110 typename QSet<T>::const_iterator i = set.constBegin();
20111 while (i != set.constEnd()) {
20112 out << *i;
20113 ++i;
20114 }
20115 return out;
20116 }
20117 template <class Key, class T>
20118 QDataStream &operator>>(QDataStream &in, QHash<Key, T> &hash)
20119 {
20120 QDataStream::Status oldStatus = in.status();
20121 in.resetStatus();
20122 hash.clear();
20123 quint32 n;
20124 in >> n;
20125 for (quint32 i = 0; i < n; ++i) {
20126 if (in.status() != QDataStream::Ok)
20127 break;
20128 Key k;
20129 T t;
20130 in >> k >> t;
20131 hash.insertMulti(k, t);
20132 }
20133 if (in.status() != QDataStream::Ok)
20134 hash.clear();
20135 if (oldStatus != QDataStream::Ok)
20136 in.setStatus(oldStatus);
20137 return in;
20138 }
20139 template <class Key, class T>
20140 QDataStream &operator<<(QDataStream &out, const QHash<Key, T>& hash)
20141 {
20142 out << quint32(hash.size());
20143 typename QHash<Key, T>::ConstIterator it = hash.end();
20144 typename QHash<Key, T>::ConstIterator begin = hash.begin();
20145 while (it != begin) {
20146 --it;
20147 out << it.key() << it.value();
20148 }
20149 return out;
20150 }
20151 template <class aKey, class aT>
20152 QDataStream &operator>>(QDataStream &in, QMap<aKey, aT> &map)
20153 {
20154 QDataStream::Status oldStatus = in.status();
20155 in.resetStatus();
20156 map.clear();
20157 quint32 n;
20158 in >> n;
20159 map.detach();
20160 map.setInsertInOrder(true);
20161 for (quint32 i = 0; i < n; ++i) {
20162 if (in.status() != QDataStream::Ok)
20163 break;
20164 aKey key;
20165 aT value;
20166 in >> key >> value;
20167 map.insertMulti(key, value);
20168 }
20169 map.setInsertInOrder(false);
20170 if (in.status() != QDataStream::Ok)
20171 map.clear();
20172 if (oldStatus != QDataStream::Ok)
20173 in.setStatus(oldStatus);
20174 return in;
20175 }
20176 template <class Key, class T>
20177 QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
20178 {
20179 out << quint32(map.size());
20180 typename QMap<Key, T>::ConstIterator it = map.end();
20181 typename QMap<Key, T>::ConstIterator begin = map.begin();
20182 while (it != begin) {
20183 --it;
20184 out << it.key() << it.value();
20185 }
20186 return out;
20187 }
20188 typedef QtValidLicenseForCoreModule QtCoreModule;
20189 struct QRegExpPrivate;
20190 class QStringList;
20191 class QRegExp
20192 {
20193 public:
20194 enum PatternSyntax {
20195 RegExp,
20196 Wildcard,
20197 FixedString,
20198 RegExp2,
20199 WildcardUnix,
20200 W3CXmlSchema11 };
20201 enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
20202 QRegExp();
20203 explicit QRegExp(const QString &pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive,
20204 PatternSyntax syntax = RegExp);
20205 QRegExp(const QRegExp &rx);
20206 ~QRegExp();
20207 QRegExp &operator=(const QRegExp &rx);
20208 bool operator==(const QRegExp &rx) const;
20209 inline bool operator!=(const QRegExp &rx) const { return !operator==(rx); }
20210 bool isEmpty() const;
20211 bool isValid() const;
20212 QString pattern() const;
20213 void setPattern(const QString &pattern);
20214 Qt::CaseSensitivity caseSensitivity() const;
20215 void setCaseSensitivity(Qt::CaseSensitivity cs);
20216 PatternSyntax patternSyntax() const;
20217 void setPatternSyntax(PatternSyntax syntax);
20218 bool isMinimal() const;
20219 void setMinimal(bool minimal);
20220 bool exactMatch(const QString &str) const;
20221 int indexIn(const QString &str, int offset = 0, CaretMode caretMode = CaretAtZero) const;
20222 int lastIndexIn(const QString &str, int offset = -1, CaretMode caretMode = CaretAtZero) const;
20223 int matchedLength() const;
20224 int numCaptures() const;
20225 int captureCount() const;
20226 QStringList capturedTexts() const;
20227 QStringList capturedTexts();
20228 QString cap(int nth = 0) const;
20229 QString cap(int nth = 0);
20230 int pos(int nth = 0) const;
20231 int pos(int nth = 0);
20232 QString errorString() const;
20233 QString errorString();
20234 static QString escape(const QString &str);
20235 private:
20236 QRegExpPrivate *priv;
20237 };
20238 template <> class QTypeInfo<QRegExp > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QRegExp)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QRegExp"; } };
20239 QDataStream &operator<<(QDataStream &out, const QRegExp &regExp);
20240 QDataStream &operator>>(QDataStream &in, QRegExp &regExp);
20241 typedef QtValidLicenseForCoreModule QtCoreModule;
20242 class QStringMatcherPrivate;
20243 class QStringMatcher
20244 {
20245 public:
20246 QStringMatcher();
20247 QStringMatcher(const QString &pattern,
20248 Qt::CaseSensitivity cs = Qt::CaseSensitive);
20249 QStringMatcher(const QChar *uc, int len,
20250 Qt::CaseSensitivity cs = Qt::CaseSensitive);
20251 QStringMatcher(const QStringMatcher &other);
20252 ~QStringMatcher();
20253 QStringMatcher &operator=(const QStringMatcher &other);
20254 void setPattern(const QString &pattern);
20255 void setCaseSensitivity(Qt::CaseSensitivity cs);
20256 int indexIn(const QString &str, int from = 0) const;
20257 int indexIn(const QChar *str, int length, int from = 0) const;
20258 QString pattern() const;
20259 inline Qt::CaseSensitivity caseSensitivity() const { return q_cs; }
20260 private:
20261 QStringMatcherPrivate *d_ptr;
20262 QString q_pattern;
20263 Qt::CaseSensitivity q_cs;
20264 struct Data {
20265 uchar q_skiptable[256];
20266 const QChar *uc;
20267 int len;
20268 };
20269 union {
20270 uint q_data[256];
20271 Data p;
20272 };
20273 };
20274 typedef QtValidLicenseForCoreModule QtCoreModule;
20275 class QRegExp;
20276 typedef QListIterator<QString> QStringListIterator;
20277 typedef QMutableListIterator<QString> QMutableStringListIterator;
20278 class QStringList : public QList<QString>
20279 {
20280 public:
20281 inline QStringList() { }
20282 inline explicit QStringList(const QString &i) { append(i); }
20283 inline QStringList(const QStringList &l) : QList<QString>(l) { }
20284 inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
20285 inline void sort();
20286 inline int removeDuplicates();
20287 inline QString join(const QString &sep) const;
20288 inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
20289 inline QBool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
20290 inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
20291 inline QStringList operator+(const QStringList &other) const
20292 { QStringList n = *this; n += other; return n; }
20293 inline QStringList &operator<<(const QString &str)
20294 { append(str); return *this; }
20295 inline QStringList &operator<<(const QStringList &l)
20296 { *this += l; return *this; }
20297 inline QStringList filter(const QRegExp &rx) const;
20298 inline QStringList &replaceInStrings(const QRegExp &rx, const QString &after);
20299 inline int indexOf(const QRegExp &rx, int from = 0) const;
20300 inline int lastIndexOf(const QRegExp &rx, int from = -1) const;
20301 inline int indexOf(QRegExp &rx, int from = 0) const;
20302 inline int lastIndexOf(QRegExp &rx, int from = -1) const;
20303 using QList<QString>::indexOf;
20304 using QList<QString>::lastIndexOf;
20305 };
20306 namespace QtPrivate {
20307 void QStringList_sort(QStringList *that);
20308 int QStringList_removeDuplicates(QStringList *that);
20309 QString QStringList_join(const QStringList *that, const QString &sep);
20310 QStringList QStringList_filter(const QStringList *that, const QString &str,
20311 Qt::CaseSensitivity cs);
20312 QBool QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
20313 void QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
20314 Qt::CaseSensitivity cs);
20315 void QStringList_replaceInStrings(QStringList *that, const QRegExp &rx, const QString &after);
20316 QStringList QStringList_filter(const QStringList *that, const QRegExp &re);
20317 int QStringList_indexOf(const QStringList *that, const QRegExp &rx, int from);
20318 int QStringList_lastIndexOf(const QStringList *that, const QRegExp &rx, int from);
20319 int QStringList_indexOf(const QStringList *that, QRegExp &rx, int from);
20320 int QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int from);
20321 }
20322 inline void QStringList::sort()
20323 {
20324 QtPrivate::QStringList_sort(this);
20325 }
20326 inline int QStringList::removeDuplicates()
20327 {
20328 return QtPrivate::QStringList_removeDuplicates(this);
20329 }
20330 inline QString QStringList::join(const QString &sep) const
20331 {
20332 return QtPrivate::QStringList_join(this, sep);
20333 }
20334 inline QStringList QStringList::filter(const QString &str, Qt::CaseSensitivity cs) const
20335 {
20336 return QtPrivate::QStringList_filter(this, str, cs);
20337 }
20338 inline QBool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
20339 {
20340 return QtPrivate::QStringList_contains(this, str, cs);
20341 }
20342 inline QStringList &QStringList::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
20343 {
20344 QtPrivate::QStringList_replaceInStrings(this, before, after, cs);
20345 return *this;
20346 }
20347 inline QStringList &QStringList::replaceInStrings(const QRegExp &rx, const QString &after)
20348 {
20349 QtPrivate::QStringList_replaceInStrings(this, rx, after);
20350 return *this;
20351 }
20352 inline QStringList QStringList::filter(const QRegExp &rx) const
20353 {
20354 return QtPrivate::QStringList_filter(this, rx);
20355 }
20356 inline int QStringList::indexOf(const QRegExp &rx, int from) const
20357 {
20358 return QtPrivate::QStringList_indexOf(this, rx, from);
20359 }
20360 inline int QStringList::lastIndexOf(const QRegExp &rx, int from) const
20361 {
20362 return QtPrivate::QStringList_lastIndexOf(this, rx, from);
20363 }
20364 inline int QStringList::indexOf(QRegExp &rx, int from) const
20365 {
20366 return QtPrivate::QStringList_indexOf(this, rx, from);
20367 }
20368 inline int QStringList::lastIndexOf(QRegExp &rx, int from) const
20369 {
20370 return QtPrivate::QStringList_lastIndexOf(this, rx, from);
20371 }
20372 inline QDataStream &operator>>(QDataStream &in, QStringList &list)
20373 {
20374 return operator>>(in, static_cast<QList<QString> &>(list));
20375 }
20376 inline QDataStream &operator<<(QDataStream &out, const QStringList &list)
20377 {
20378 return operator<<(out, static_cast<const QList<QString> &>(list));
20379 }
20380 typedef QtValidLicenseForGuiModule QtGuiModule;
20381 class QColor;
20382 class QColormap;
20383 class QVariant;
20384 QDebug operator<<(QDebug, const QColor &);
20385 QDataStream &operator<<(QDataStream &, const QColor &);
20386 QDataStream &operator>>(QDataStream &, QColor &);
20387 class QColor
20388 {
20389 public:
20390 enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl };
20391 QColor();
20392 QColor(Qt::GlobalColor color);
20393 QColor(int r, int g, int b, int a = 255);
20394 QColor(QRgb rgb);
20395 QColor(const QString& name);
20396 QColor(const char *name);
20397 QColor(const QColor &color);
20398 QColor(Spec spec);
20399 bool isValid() const;
20400 QString name() const;
20401 void setNamedColor(const QString& name);
20402 static QStringList colorNames();
20403 inline Spec spec() const
20404 { return cspec; }
20405 int alpha() const;
20406 void setAlpha(int alpha);
20407 qreal alphaF() const;
20408 void setAlphaF(qreal alpha);
20409 int red() const;
20410 int green() const;
20411 int blue() const;
20412 void setRed(int red);
20413 void setGreen(int green);
20414 void setBlue(int blue);
20415 qreal redF() const;
20416 qreal greenF() const;
20417 qreal blueF() const;
20418 void setRedF(qreal red);
20419 void setGreenF(qreal green);
20420 void setBlueF(qreal blue);
20421 void getRgb(int *r, int *g, int *b, int *a = 0) const;
20422 void setRgb(int r, int g, int b, int a = 255);
20423 void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = 0) const;
20424 void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
20425 QRgb rgba() const;
20426 void setRgba(QRgb rgba);
20427 QRgb rgb() const;
20428 void setRgb(QRgb rgb);
20429 int hue() const;
20430 int saturation() const;
20431 int hsvHue() const;
20432 int hsvSaturation() const;
20433 int value() const;
20434 qreal hueF() const;
20435 qreal saturationF() const;
20436 qreal hsvHueF() const;
20437 qreal hsvSaturationF() const;
20438 qreal valueF() const;
20439 void getHsv(int *h, int *s, int *v, int *a = 0) const;
20440 void setHsv(int h, int s, int v, int a = 255);
20441 void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = 0) const;
20442 void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
20443 int cyan() const;
20444 int magenta() const;
20445 int yellow() const;
20446 int black() const;
20447 qreal cyanF() const;
20448 qreal magentaF() const;
20449 qreal yellowF() const;
20450 qreal blackF() const;
20451 void getCmyk(int *c, int *m, int *y, int *k, int *a = 0);
20452 void setCmyk(int c, int m, int y, int k, int a = 255);
20453 void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = 0);
20454 void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
20455 int hslHue() const;
20456 int hslSaturation() const;
20457 int lightness() const;
20458 qreal hslHueF() const;
20459 qreal hslSaturationF() const;
20460 qreal lightnessF() const;
20461 void getHsl(int *h, int *s, int *l, int *a = 0) const;
20462 void setHsl(int h, int s, int l, int a = 255);
20463 void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = 0) const;
20464 void setHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
20465 QColor toRgb() const;
20466 QColor toHsv() const;
20467 QColor toCmyk() const;
20468 QColor toHsl() const;
20469 QColor convertTo(Spec colorSpec) const;
20470 static QColor fromRgb(QRgb rgb);
20471 static QColor fromRgba(QRgb rgba);
20472 static QColor fromRgb(int r, int g, int b, int a = 255);
20473 static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
20474 static QColor fromHsv(int h, int s, int v, int a = 255);
20475 static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
20476 static QColor fromCmyk(int c, int m, int y, int k, int a = 255);
20477 static QColor fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
20478 static QColor fromHsl(int h, int s, int l, int a = 255);
20479 static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
20480 QColor light(int f = 150) const;
20481 QColor lighter(int f = 150) const;
20482 QColor dark(int f = 200) const;
20483 QColor darker(int f = 200) const;
20484 QColor &operator=(const QColor &);
20485 QColor &operator=(Qt::GlobalColor color);
20486 bool operator==(const QColor &c) const;
20487 bool operator!=(const QColor &c) const;
20488 operator QVariant() const;
20489 static bool allowX11ColorNames();
20490 static void setAllowX11ColorNames(bool enabled);
20491 private:
20492 QColor(int, int, int, Spec);
20493 void invalidate();
20494 Spec cspec;
20495 union {
20496 struct {
20497 ushort alpha;
20498 ushort red;
20499 ushort green;
20500 ushort blue;
20501 ushort pad;
20502 } argb;
20503 struct {
20504 ushort alpha;
20505 ushort hue;
20506 ushort saturation;
20507 ushort value;
20508 ushort pad;
20509 } ahsv;
20510 struct {
20511 ushort alpha;
20512 ushort cyan;
20513 ushort magenta;
20514 ushort yellow;
20515 ushort black;
20516 } acmyk;
20517 struct {
20518 ushort alpha;
20519 ushort hue;
20520 ushort saturation;
20521 ushort lightness;
20522 ushort pad;
20523 } ahsl;
20524 ushort array[5];
20525 } ct;
20526 friend class QColormap;
20527 friend QDataStream &operator<<(QDataStream &, const QColor &);
20528 friend QDataStream &operator>>(QDataStream &, QColor &);
20529 };
20530 inline QColor::QColor()
20531 { invalidate(); }
20532 inline QColor::QColor(int r, int g, int b, int a)
20533 { setRgb(r, g, b, a); }
20534 inline QColor::QColor(const char *aname)
20535 { setNamedColor(QLatin1String(aname)); }
20536 inline QColor::QColor(const QString& aname)
20537 { setNamedColor(aname); }
20538 inline QColor::QColor(const QColor &acolor)
20539 : cspec(acolor.cspec)
20540 { ct.argb = acolor.ct.argb; }
20541 inline bool QColor::isValid() const
20542 { return cspec != Invalid; }
20543 inline QColor QColor::lighter(int f) const
20544 { return light(f); }
20545 inline QColor QColor::darker(int f) const
20546 { return dark(f); }
20547 typedef QtValidLicenseForCoreModule QtCoreModule;
20548 template <class T> class QSharedDataPointer;
20549 class QSharedData
20550 {
20551 public:
20552 mutable QAtomicInt ref;
20553 inline QSharedData() : ref(0) { }
20554 inline QSharedData(const QSharedData &) : ref(0) { }
20555 private:
20556 QSharedData &operator=(const QSharedData &);
20557 };
20558 template <class T> class QSharedDataPointer
20559 {
20560 public:
20561 typedef T Type;
20562 typedef T *pointer;
20563 inline void detach() { if (d && d->ref != 1) detach_helper(); }
20564 inline T &operator*() { detach(); return *d; }
20565 inline const T &operator*() const { return *d; }
20566 inline T *operator->() { detach(); return d; }
20567 inline const T *operator->() const { return d; }
20568 inline operator T *() { detach(); return d; }
20569 inline operator const T *() const { return d; }
20570 inline T *data() { detach(); return d; }
20571 inline const T *data() const { return d; }
20572 inline const T *constData() const { return d; }
20573 inline bool operator==(const QSharedDataPointer<T> &other) const { return d == other.d; }
20574 inline bool operator!=(const QSharedDataPointer<T> &other) const { return d != other.d; }
20575 inline QSharedDataPointer() { d = 0; }
20576 inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
20577 explicit QSharedDataPointer(T *data);
20578 inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
20579 inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
20580 if (o.d != d) {
20581 if (o.d)
20582 o.d->ref.ref();
20583 if (d && !d->ref.deref())
20584 delete d;
20585 d = o.d;
20586 }
20587 return *this;
20588 }
20589 inline QSharedDataPointer &operator=(T *o) {
20590 if (o != d) {
20591 if (o)
20592 o->ref.ref();
20593 if (d && !d->ref.deref())
20594 delete d;
20595 d = o;
20596 }
20597 return *this;
20598 }
20599 inline bool operator!() const { return !d; }
20600 inline void swap(QSharedDataPointer &other)
20601 { qSwap(d, other.d); }
20602 public:
20603 T *clone();
20604 private:
20605 void detach_helper();
20606 T *d;
20607 };
20608 template <class T> class QExplicitlySharedDataPointer
20609 {
20610 public:
20611 typedef T Type;
20612 typedef T *pointer;
20613 inline T &operator*() const { return *d; }
20614 inline T *operator->() { return d; }
20615 inline T *operator->() const { return d; }
20616 inline T *data() const { return d; }
20617 inline const T *constData() const { return d; }
20618 inline void detach() { if (d && d->ref != 1) detach_helper(); }
20619 inline void reset()
20620 {
20621 if(d && !d->ref.deref())
20622 delete d;
20623 d = 0;
20624 }
20625 inline operator bool () const { return d != 0; }
20626 inline bool operator==(const QExplicitlySharedDataPointer<T> &other) const { return d == other.d; }
20627 inline bool operator!=(const QExplicitlySharedDataPointer<T> &other) const { return d != other.d; }
20628 inline bool operator==(const T *ptr) const { return d == ptr; }
20629 inline bool operator!=(const T *ptr) const { return d != ptr; }
20630 inline QExplicitlySharedDataPointer() { d = 0; }
20631 inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
20632 explicit QExplicitlySharedDataPointer(T *data);
20633 inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
20634 template<class X>
20635 inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<X> &o) : d(static_cast<T *>(o.data()))
20636 {
20637 if(d)
20638 d->ref.ref();
20639 }
20640 inline QExplicitlySharedDataPointer<T> & operator=(const QExplicitlySharedDataPointer<T> &o) {
20641 if (o.d != d) {
20642 if (o.d)
20643 o.d->ref.ref();
20644 if (d && !d->ref.deref())
20645 delete d;
20646 d = o.d;
20647 }
20648 return *this;
20649 }
20650 inline QExplicitlySharedDataPointer &operator=(T *o) {
20651 if (o != d) {
20652 if (o)
20653 o->ref.ref();
20654 if (d && !d->ref.deref())
20655 delete d;
20656 d = o;
20657 }
20658 return *this;
20659 }
20660 inline bool operator!() const { return !d; }
20661 inline void swap(QExplicitlySharedDataPointer &other)
20662 { qSwap(d, other.d); }
20663 public:
20664 T *clone();
20665 private:
20666 void detach_helper();
20667 T *d;
20668 };
20669 template <class T>
20670 inline QSharedDataPointer<T>::QSharedDataPointer(T *adata) : d(adata)
20671 { if (d) d->ref.ref(); }
20672 template <class T>
20673 inline T *QSharedDataPointer<T>::clone()
20674 {
20675 return new T(*d);
20676 }
20677 template <class T>
20678 void QSharedDataPointer<T>::detach_helper()
20679 {
20680 T *x = clone();
20681 x->ref.ref();
20682 if (!d->ref.deref())
20683 delete d;
20684 d = x;
20685 }
20686 template <class T>
20687 inline T *QExplicitlySharedDataPointer<T>::clone()
20688 {
20689 return new T(*d);
20690 }
20691 template <class T>
20692 void QExplicitlySharedDataPointer<T>::detach_helper()
20693 {
20694 T *x = clone();
20695 x->ref.ref();
20696 if (!d->ref.deref())
20697 delete d;
20698 d = x;
20699 }
20700 template <class T>
20701 inline QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) : d(adata)
20702 { if (d) d->ref.ref(); }
20703 template <class T>
20704 inline void qSwap(QSharedDataPointer<T> &p1, QSharedDataPointer<T> &p2)
20705 { p1.swap(p2); }
20706 template <class T>
20707 inline void qSwap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2)
20708 { p1.swap(p2); }
20709 typedef QtValidLicenseForCoreModule QtCoreModule;
20710 template<typename T> inline void qt_sharedpointer_cast_check(T *) { }
20711 template <class T> class QWeakPointer;
20712 template <class T> class QSharedPointer;
20713 template <class X, class T>
20714 QSharedPointer<X> qSharedPointerCast(const QSharedPointer<T> &ptr);
20715 template <class X, class T>
20716 QSharedPointer<X> qSharedPointerDynamicCast(const QSharedPointer<T> &ptr);
20717 template <class X, class T>
20718 QSharedPointer<X> qSharedPointerConstCast(const QSharedPointer<T> &ptr);
20719 template <class X, class T>
20720 QSharedPointer<X> qSharedPointerObjectCast(const QSharedPointer<T> &ptr);
20721 namespace QtSharedPointer {
20722 template <class T> class InternalRefCount;
20723 template <class T> class ExternalRefCount;
20724 template <class X, class Y> QSharedPointer<X> copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src);
20725 void internalSafetyCheckAdd2(const void *, const volatile void *);
20726 void internalSafetyCheckRemove2(const void *);
20727 template <class T, typename Klass, typename RetVal>
20728 inline void executeDeleter(T *t, RetVal (Klass:: *memberDeleter)())
20729 { (t->*memberDeleter)(); }
20730 template <class T, typename Deleter>
20731 inline void executeDeleter(T *t, Deleter d)
20732 { d(t); }
20733 template <class T> inline void normalDeleter(T *t) { delete t; }
20734 template <class T> struct RemovePointer;
20735 template <class T> struct RemovePointer<T *> { typedef T Type; };
20736 template <class T> struct RemovePointer<QSharedPointer<T> > { typedef T Type; };
20737 template <class T> struct RemovePointer<QWeakPointer<T> > { typedef T Type; };
20738 template <class T>
20739 class Basic
20740 {
20741 typedef T *Basic:: *RestrictedBool;
20742 public:
20743 typedef T Type;
20744 typedef T element_type;
20745 typedef T value_type;
20746 typedef value_type *pointer;
20747 typedef const value_type *const_pointer;
20748 typedef value_type &reference;
20749 typedef const value_type &const_reference;
20750 typedef ptrdiff_t difference_type;
20751 inline T *data() const { return value; }
20752 inline bool isNull() const { return !data(); }
20753 inline operator RestrictedBool() const { return isNull() ? 0 : &Basic::value; }
20754 inline bool operator !() const { return isNull(); }
20755 inline T &operator*() const { return *data(); }
20756 inline T *operator->() const { return data(); }
20757 public:
20758 inline Basic(T *ptr = 0) : value(ptr) { }
20759 inline Basic(Qt::Initialization) { }
20760 inline void internalConstruct(T *ptr)
20761 {
20762 value = ptr;
20763 }
20764 template <class X> friend class QWeakPointer;
20765 Type *value;
20766 };
20767 struct ExternalRefCountData
20768 {
20769 QBasicAtomicInt weakref;
20770 QBasicAtomicInt strongref;
20771 inline ExternalRefCountData()
20772 {
20773 strongref = 1;
20774 weakref = 1;
20775 }
20776 inline ExternalRefCountData(Qt::Initialization) { }
20777 virtual inline ~ExternalRefCountData() { ((!(!weakref)) ? qt_assert("!weakref","/usr/include/qt4/QtCore/qsharedpointer_impl.h",184) : qt_noop()); ((!(strongref <= 0)) ? qt_assert("strongref <= 0","/usr/include/qt4/QtCore/qsharedpointer_impl.h",184) : qt_noop()); }
20778 virtual inline bool destroy() { return false; }
20779 static ExternalRefCountData *getAndRef(const QObject *);
20780 void setQObjectShared(const QObject *, bool enable);
20781 inline void setQObjectShared(...) { }
20782 };
20783 struct ExternalRefCountWithDestroyFn: public ExternalRefCountData
20784 {
20785 typedef void (*DestroyerFn)(ExternalRefCountData *);
20786 DestroyerFn destroyer;
20787 inline ExternalRefCountWithDestroyFn(DestroyerFn d)
20788 : destroyer(d)
20789 { }
20790 inline bool destroy() { destroyer(this); return true; }
20791 inline void operator delete(void *ptr) { ::operator delete(ptr); }
20792 };
20793 template <class T, typename Deleter>
20794 struct ExternalRefCountWithCustomDeleter: public ExternalRefCountWithDestroyFn
20795 {
20796 typedef ExternalRefCountWithCustomDeleter Self;
20797 typedef ExternalRefCountWithDestroyFn BaseClass;
20798 struct CustomDeleter
20799 {
20800 Deleter deleter;
20801 T *ptr;
20802 inline CustomDeleter(T *p, Deleter d) : deleter(d), ptr(p) {}
20803 };
20804 CustomDeleter extra;
20805 static inline void deleter(ExternalRefCountData *self)
20806 {
20807 Self *realself = static_cast<Self *>(self);
20808 executeDeleter(realself->extra.ptr, realself->extra.deleter);
20809 realself->extra.~CustomDeleter();
20810 }
20811 static void safetyCheckDeleter(ExternalRefCountData *self)
20812 {
20813 internalSafetyCheckRemove2(self);
20814 deleter(self);
20815 }
20816 static inline Self *create(T *ptr, Deleter userDeleter)
20817 {
20818 DestroyerFn destroy = &deleter;
20819 Self *d = static_cast<Self *>(::operator new(sizeof(Self)));
20820 new (&d->extra) CustomDeleter(ptr, userDeleter);
20821 new (d) BaseClass(destroy);
20822 return d;
20823 }
20824 private:
20825 ExternalRefCountWithCustomDeleter();
20826 ~ExternalRefCountWithCustomDeleter();
20827 };
20828 template <class T>
20829 struct ExternalRefCountWithContiguousData: public ExternalRefCountWithDestroyFn
20830 {
20831 typedef ExternalRefCountWithDestroyFn Parent;
20832 T data;
20833 static void deleter(ExternalRefCountData *self)
20834 {
20835 ExternalRefCountWithContiguousData *that =
20836 static_cast<ExternalRefCountWithContiguousData *>(self);
20837 that->data.~T();
20838 }
20839 static void safetyCheckDeleter(ExternalRefCountData *self)
20840 {
20841 internalSafetyCheckRemove2(self);
20842 deleter(self);
20843 }
20844 static inline ExternalRefCountData *create(T **ptr)
20845 {
20846 DestroyerFn destroy = &deleter;
20847 ExternalRefCountWithContiguousData *d =
20848 static_cast<ExternalRefCountWithContiguousData *>(::operator new(sizeof(ExternalRefCountWithContiguousData)));
20849 new (d) Parent(destroy);
20850 *ptr = &d->data;
20851 return d;
20852 }
20853 private:
20854 ExternalRefCountWithContiguousData();
20855 ~ExternalRefCountWithContiguousData();
20856 };
20857 template <class T>
20858 class ExternalRefCount: public Basic<T>
20859 {
20860 public:
20861 typedef ExternalRefCountData Data;
20862 inline void ref() const { d->weakref.ref(); d->strongref.ref(); }
20863 inline bool deref()
20864 {
20865 if (!d->strongref.deref()) {
20866 internalDestroy();
20867 }
20868 return d->weakref.deref();
20869 }
20870 inline void internalConstruct(T *ptr)
20871 {
20872 if (ptr)
20873 d = new Data;
20874 else
20875 d = 0;
20876 internalFinishConstruction(ptr);
20877 }
20878 template <typename Deleter>
20879 inline void internalConstruct(T *ptr, Deleter deleter)
20880 {
20881 if (ptr)
20882 d = ExternalRefCountWithCustomDeleter<T, Deleter>::create(ptr, deleter);
20883 else
20884 d = 0;
20885 internalFinishConstruction(ptr);
20886 }
20887 inline void internalCreate()
20888 {
20889 T *ptr;
20890 d = ExternalRefCountWithContiguousData<T>::create(&ptr);
20891 Basic<T>::internalConstruct(ptr);
20892 }
20893 inline void internalFinishConstruction(T *ptr)
20894 {
20895 Basic<T>::internalConstruct(ptr);
20896 if (ptr) d->setQObjectShared(ptr, true);
20897 }
20898 inline ExternalRefCount() : d(0) { }
20899 inline ExternalRefCount(Qt::Initialization i) : Basic<T>(i) { }
20900 inline ExternalRefCount(const ExternalRefCount<T> &other) : Basic<T>(other), d(other.d)
20901 { if (d) ref(); }
20902 template <class X>
20903 inline ExternalRefCount(const ExternalRefCount<X> &other) : Basic<T>(other.value), d(other.d)
20904 { if (d) ref(); }
20905 inline ~ExternalRefCount() { if (d && !deref()) delete d; }
20906 template <class X>
20907 inline void internalCopy(const ExternalRefCount<X> &other)
20908 {
20909 internalSet(other.d, other.data());
20910 }
20911 inline void internalDestroy()
20912 {
20913 if (!d->destroy())
20914 delete this->value;
20915 }
20916 inline void internalSwap(ExternalRefCount &other)
20917 {
20918 qSwap(d, other.d);
20919 qSwap(this->value, other.value);
20920 }
20921 template <class X> friend class ExternalRefCount;
20922 template <class X> friend class QWeakPointer;
20923 template <class X, class Y> friend QSharedPointer<X> copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src);
20924 inline void internalSet(Data *o, T *actual)
20925 {
20926 if (o) {
20927 register int tmp = o->strongref;
20928 while (tmp > 0) {
20929 if (o->strongref.testAndSetRelaxed(tmp, tmp + 1))
20930 break;
20931 tmp = o->strongref;
20932 }
20933 if (tmp > 0)
20934 o->weakref.ref();
20935 else
20936 o = 0;
20937 }
20938 if (d && !deref())
20939 delete d;
20940 d = o;
20941 this->value = d && d->strongref ? actual : 0;
20942 }
20943 Data *d;
20944 private:
20945 template<class X> ExternalRefCount(const InternalRefCount<X> &);
20946 };
20947 }
20948 template <class T>
20949 class QSharedPointer: public QtSharedPointer::ExternalRefCount<T>
20950 {
20951 typedef typename QtSharedPointer::ExternalRefCount<T> BaseClass;
20952 public:
20953 inline QSharedPointer() { }
20954 inline explicit QSharedPointer(T *ptr) : BaseClass(Qt::Uninitialized)
20955 { BaseClass::internalConstruct(ptr); }
20956 template <typename Deleter>
20957 inline QSharedPointer(T *ptr, Deleter d) { BaseClass::internalConstruct(ptr, d); }
20958 inline QSharedPointer(const QSharedPointer<T> &other) : BaseClass(other) { }
20959 inline QSharedPointer<T> &operator=(const QSharedPointer<T> &other)
20960 {
20961 BaseClass::internalCopy(other);
20962 return *this;
20963 }
20964 template <class X>
20965 inline QSharedPointer(const QSharedPointer<X> &other) : BaseClass(other)
20966 { }
20967 template <class X>
20968 inline QSharedPointer<T> &operator=(const QSharedPointer<X> &other)
20969 {
20970 qt_sharedpointer_cast_check<T>(static_cast<X *>(0));
20971 BaseClass::internalCopy(other);
20972 return *this;
20973 }
20974 template <class X>
20975 inline QSharedPointer(const QWeakPointer<X> &other) : BaseClass(Qt::Uninitialized)
20976 { this->d = 0; *this = other; }
20977 template <class X>
20978 inline QSharedPointer<T> &operator=(const QWeakPointer<X> &other)
20979 { BaseClass::internalSet(other.d, other.value); return *this; }
20980 inline void swap(QSharedPointer &other)
20981 { QSharedPointer<T>::internalSwap(other); }
20982 template <class X>
20983 QSharedPointer<X> staticCast() const
20984 {
20985 return qSharedPointerCast<X, T>(*this);
20986 }
20987 template <class X>
20988 QSharedPointer<X> dynamicCast() const
20989 {
20990 return qSharedPointerDynamicCast<X, T>(*this);
20991 }
20992 template <class X>
20993 QSharedPointer<X> constCast() const
20994 {
20995 return qSharedPointerConstCast<X, T>(*this);
20996 }
20997 template <class X>
20998 QSharedPointer<X> objectCast() const
20999 {
21000 return qSharedPointerObjectCast<X, T>(*this);
21001 }
21002 inline void clear() { *this = QSharedPointer<T>(); }
21003 QWeakPointer<T> toWeakRef() const;
21004 public:
21005 inline explicit QSharedPointer(Qt::Initialization i) : BaseClass(i) {}
21006 public:
21007 static inline QSharedPointer<T> create()
21008 {
21009 QSharedPointer<T> result(Qt::Uninitialized);
21010 result.internalCreate();
21011 new (result.data()) T();
21012 result.internalFinishConstruction(result.data());
21013 return result;
21014 }
21015 };
21016 template <class T>
21017 class QWeakPointer
21018 {
21019 typedef T *QWeakPointer:: *RestrictedBool;
21020 typedef QtSharedPointer::ExternalRefCountData Data;
21021 public:
21022 typedef T element_type;
21023 typedef T value_type;
21024 typedef value_type *pointer;
21025 typedef const value_type *const_pointer;
21026 typedef value_type &reference;
21027 typedef const value_type &const_reference;
21028 typedef ptrdiff_t difference_type;
21029 inline bool isNull() const { return d == 0 || d->strongref == 0 || value == 0; }
21030 inline operator RestrictedBool() const { return isNull() ? 0 : &QWeakPointer::value; }
21031 inline bool operator !() const { return isNull(); }
21032 inline T *data() const { return d == 0 || d->strongref == 0 ? 0 : value; }
21033 inline QWeakPointer() : d(0), value(0) { }
21034 inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
21035 template <class X>
21036 inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr)
21037 { }
21038 template <class X>
21039 inline QWeakPointer &operator=(X *ptr)
21040 { return *this = QWeakPointer(ptr); }
21041 inline QWeakPointer(const QWeakPointer<T> &o) : d(o.d), value(o.value)
21042 { if (d) d->weakref.ref(); }
21043 inline QWeakPointer<T> &operator=(const QWeakPointer<T> &o)
21044 {
21045 internalSet(o.d, o.value);
21046 return *this;
21047 }
21048 inline QWeakPointer(const QSharedPointer<T> &o) : d(o.d), value(o.data())
21049 { if (d) d->weakref.ref();}
21050 inline QWeakPointer<T> &operator=(const QSharedPointer<T> &o)
21051 {
21052 internalSet(o.d, o.value);
21053 return *this;
21054 }
21055 template <class X>
21056 inline QWeakPointer(const QWeakPointer<X> &o) : d(0), value(0)
21057 { *this = o; }
21058 template <class X>
21059 inline QWeakPointer<T> &operator=(const QWeakPointer<X> &o)
21060 {
21061 *this = o.toStrongRef();
21062 return *this;
21063 }
21064 template <class X>
21065 inline bool operator==(const QWeakPointer<X> &o) const
21066 { return d == o.d && value == static_cast<const T *>(o.value); }
21067 template <class X>
21068 inline bool operator!=(const QWeakPointer<X> &o) const
21069 { return !(*this == o); }
21070 template <class X>
21071 inline QWeakPointer(const QSharedPointer<X> &o) : d(0), value(0)
21072 { *this = o; }
21073 template <class X>
21074 inline QWeakPointer<T> &operator=(const QSharedPointer<X> &o)
21075 {
21076 qt_sharedpointer_cast_check<T>(static_cast<X *>(0));
21077 internalSet(o.d, o.data());
21078 return *this;
21079 }
21080 template <class X>
21081 inline bool operator==(const QSharedPointer<X> &o) const
21082 { return d == o.d; }
21083 template <class X>
21084 inline bool operator!=(const QSharedPointer<X> &o) const
21085 { return !(*this == o); }
21086 inline void clear() { *this = QWeakPointer<T>(); }
21087 inline QSharedPointer<T> toStrongRef() const { return QSharedPointer<T>(*this); }
21088 private:
21089 template <class X> friend class QSharedPointer;
21090 inline void internalSet(Data *o, T *actual)
21091 {
21092 if (d == o) return;
21093 if (o)
21094 o->weakref.ref();
21095 if (d && !d->weakref.deref())
21096 delete d;
21097 d = o;
21098 value = actual;
21099 }
21100 Data *d;
21101 T *value;
21102 };
21103 template <class T, class X>
21104 bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2)
21105 {
21106 return ptr1.data() == ptr2.data();
21107 }
21108 template <class T, class X>
21109 bool operator!=(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2)
21110 {
21111 return ptr1.data() != ptr2.data();
21112 }
21113 template <class T, class X>
21114 bool operator==(const QSharedPointer<T> &ptr1, const X *ptr2)
21115 {
21116 return ptr1.data() == ptr2;
21117 }
21118 template <class T, class X>
21119 bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2)
21120 {
21121 return ptr1 == ptr2.data();
21122 }
21123 template <class T, class X>
21124 bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2)
21125 {
21126 return !(ptr1 == ptr2);
21127 }
21128 template <class T, class X>
21129 bool operator!=(const T *ptr1, const QSharedPointer<X> &ptr2)
21130 {
21131 return !(ptr2 == ptr1);
21132 }
21133 template <class T, class X>
21134 bool operator==(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2)
21135 {
21136 return ptr2 == ptr1;
21137 }
21138 template <class T, class X>
21139 bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2)
21140 {
21141 return ptr2 != ptr1;
21142 }
21143 template <class T, class X>
21144 inline typename T::difference_type operator-(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2)
21145 {
21146 return ptr1.data() - ptr2.data();
21147 }
21148 template <class T>
21149 inline QWeakPointer<T> QSharedPointer<T>::toWeakRef() const
21150 {
21151 return QWeakPointer<T>(*this);
21152 }
21153 template <class T>
21154 inline void qSwap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
21155 {
21156 p1.swap(p2);
21157 }
21158 namespace QtSharedPointer {
21159 template <class X, class T>
21160 inline QSharedPointer<X> copyAndSetPointer(X *ptr, const QSharedPointer<T> &src)
21161 {
21162 QSharedPointer<X> result;
21163 result.internalSet(src.d, ptr);
21164 return result;
21165 }
21166 }
21167 template <class X, class T>
21168 inline QSharedPointer<X> qSharedPointerCast(const QSharedPointer<T> &src)
21169 {
21170 register X *ptr = static_cast<X *>(src.data());
21171 return QtSharedPointer::copyAndSetPointer(ptr, src);
21172 }
21173 template <class X, class T>
21174 inline QSharedPointer<X> qSharedPointerCast(const QWeakPointer<T> &src)
21175 {
21176 return qSharedPointerCast<X, T>(src.toStrongRef());
21177 }
21178 template <class X, class T>
21179 inline QSharedPointer<X> qSharedPointerDynamicCast(const QSharedPointer<T> &src)
21180 {
21181 register X *ptr = dynamic_cast<X *>(src.data());
21182 return QtSharedPointer::copyAndSetPointer(ptr, src);
21183 }
21184 template <class X, class T>
21185 inline QSharedPointer<X> qSharedPointerDynamicCast(const QWeakPointer<T> &src)
21186 {
21187 return qSharedPointerDynamicCast<X, T>(src.toStrongRef());
21188 }
21189 template <class X, class T>
21190 inline QSharedPointer<X> qSharedPointerConstCast(const QSharedPointer<T> &src)
21191 {
21192 register X *ptr = const_cast<X *>(src.data());
21193 return QtSharedPointer::copyAndSetPointer(ptr, src);
21194 }
21195 template <class X, class T>
21196 inline QSharedPointer<X> qSharedPointerConstCast(const QWeakPointer<T> &src)
21197 {
21198 return qSharedPointerConstCast<X, T>(src.toStrongRef());
21199 }
21200 template <class X, class T>
21201 inline
21202 QWeakPointer<X> qWeakPointerCast(const QSharedPointer<T> &src)
21203 {
21204 return qSharedPointerCast<X, T>(src).toWeakRef();
21205 }
21206 template <class X, class T>
21207 inline QSharedPointer<X> qSharedPointerObjectCast(const QSharedPointer<T> &src)
21208 {
21209 register X *ptr = qobject_cast<X *>(src.data());
21210 return QtSharedPointer::copyAndSetPointer(ptr, src);
21211 }
21212 template <class X, class T>
21213 inline QSharedPointer<X> qSharedPointerObjectCast(const QWeakPointer<T> &src)
21214 {
21215 return qSharedPointerObjectCast<X>(src.toStrongRef());
21216 }
21217 template <class X, class T>
21218 inline QSharedPointer<typename QtSharedPointer::RemovePointer<X>::Type>
21219 qobject_cast(const QSharedPointer<T> &src)
21220 {
21221 return qSharedPointerObjectCast<typename QtSharedPointer::RemovePointer<X>::Type, T>(src);
21222 }
21223 template <class X, class T>
21224 inline QSharedPointer<typename QtSharedPointer::RemovePointer<X>::Type>
21225 qobject_cast(const QWeakPointer<T> &src)
21226 {
21227 return qSharedPointerObjectCast<typename QtSharedPointer::RemovePointer<X>::Type, T>(src);
21228 }
21229
21230 namespace std __attribute__ ((__visibility__ ("default"))) {
21231 template<typename _T1, typename _T2>
21232 inline void
21233 _Construct(_T1* __p, const _T2& __value)
21234 {
21235 ::new(static_cast<void*>(__p)) _T1((__value));
21236 }
21237 template<typename _Tp>
21238 inline void
21239 _Destroy(_Tp* __pointer)
21240 { __pointer->~_Tp(); }
21241 template<bool>
21242 struct _Destroy_aux
21243 {
21244 template<typename _ForwardIterator>
21245 static void
21246 __destroy(_ForwardIterator __first, _ForwardIterator __last)
21247 {
21248 for (; __first != __last; ++__first)
21249 std::_Destroy(&*__first);
21250 }
21251 };
21252 template<>
21253 struct _Destroy_aux<true>
21254 {
21255 template<typename _ForwardIterator>
21256 static void
21257 __destroy(_ForwardIterator, _ForwardIterator) { }
21258 };
21259 template<typename _ForwardIterator>
21260 inline void
21261 _Destroy(_ForwardIterator __first, _ForwardIterator __last)
21262 {
21263 typedef typename iterator_traits<_ForwardIterator>::value_type
21264 _Value_type;
21265 std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
21266 __destroy(__first, __last);
21267 }
21268 template <typename _Tp> class allocator;
21269 template<typename _ForwardIterator, typename _Allocator>
21270 void
21271 _Destroy(_ForwardIterator __first, _ForwardIterator __last,
21272 _Allocator& __alloc)
21273 {
21274 for (; __first != __last; ++__first)
21275 __alloc.destroy(&*__first);
21276 }
21277 template<typename _ForwardIterator, typename _Tp>
21278 inline void
21279 _Destroy(_ForwardIterator __first, _ForwardIterator __last,
21280 allocator<_Tp>&)
21281 {
21282 _Destroy(__first, __last);
21283 }
21284 }
21285 namespace std __attribute__ ((__visibility__ ("default"))) {
21286 template<bool>
21287 struct __uninitialized_copy
21288 {
21289 template<typename _InputIterator, typename _ForwardIterator>
21290 static _ForwardIterator
21291 uninitialized_copy(_InputIterator __first, _InputIterator __last,
21292 _ForwardIterator __result)
21293 {
21294 _ForwardIterator __cur = __result;
21295 try
21296 {
21297 for (; __first != __last; ++__first, ++__cur)
21298 std::_Construct(&*__cur, *__first);
21299 return __cur;
21300 }
21301 catch(...)
21302 {
21303 std::_Destroy(__result, __cur);
21304 throw;
21305 }
21306 }
21307 };
21308 template<>
21309 struct __uninitialized_copy<true>
21310 {
21311 template<typename _InputIterator, typename _ForwardIterator>
21312 static _ForwardIterator
21313 uninitialized_copy(_InputIterator __first, _InputIterator __last,
21314 _ForwardIterator __result)
21315 { return std::copy(__first, __last, __result); }
21316 };
21317 template<typename _InputIterator, typename _ForwardIterator>
21318 inline _ForwardIterator
21319 uninitialized_copy(_InputIterator __first, _InputIterator __last,
21320 _ForwardIterator __result)
21321 {
21322 typedef typename iterator_traits<_InputIterator>::value_type
21323 _ValueType1;
21324 typedef typename iterator_traits<_ForwardIterator>::value_type
21325 _ValueType2;
21326 return std::__uninitialized_copy<(__is_pod(_ValueType1)
21327 && __is_pod(_ValueType2))>::
21328 uninitialized_copy(__first, __last, __result);
21329 }
21330 template<bool>
21331 struct __uninitialized_fill
21332 {
21333 template<typename _ForwardIterator, typename _Tp>
21334 static void
21335 uninitialized_fill(_ForwardIterator __first,
21336 _ForwardIterator __last, const _Tp& __x)
21337 {
21338 _ForwardIterator __cur = __first;
21339 try
21340 {
21341 for (; __cur != __last; ++__cur)
21342 std::_Construct(&*__cur, __x);
21343 }
21344 catch(...)
21345 {
21346 std::_Destroy(__first, __cur);
21347 throw;
21348 }
21349 }
21350 };
21351 template<>
21352 struct __uninitialized_fill<true>
21353 {
21354 template<typename _ForwardIterator, typename _Tp>
21355 static void
21356 uninitialized_fill(_ForwardIterator __first,
21357 _ForwardIterator __last, const _Tp& __x)
21358 { std::fill(__first, __last, __x); }
21359 };
21360 template<typename _ForwardIterator, typename _Tp>
21361 inline void
21362 uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
21363 const _Tp& __x)
21364 {
21365 typedef typename iterator_traits<_ForwardIterator>::value_type
21366 _ValueType;
21367 std::__uninitialized_fill<__is_pod(_ValueType)>::
21368 uninitialized_fill(__first, __last, __x);
21369 }
21370 template<bool>
21371 struct __uninitialized_construct_range_dispatch
21372 {
21373 template<typename _ForwardIterator, typename _Tp>
21374 static void
21375 __ucr(_ForwardIterator __first, _ForwardIterator __last,
21376 _Tp& __value)
21377 {
21378 if(__first == __last)
21379 return;
21380 _ForwardIterator __cur = __first;
21381 try
21382 {
21383 std::_Construct(&*__first, (__value));
21384 _ForwardIterator __prev = __cur;
21385 ++__cur;
21386 for(; __cur != __last; ++__cur, ++__prev)
21387 std::_Construct(&*__cur, (*__prev));
21388 __value = (*__prev);
21389 }
21390 catch(...)
21391 {
21392 std::_Destroy(__first, __cur);
21393 throw;
21394 }
21395 }
21396 };
21397 template<>
21398 struct __uninitialized_construct_range_dispatch<true>
21399 {
21400 template<typename _ForwardIterator, typename _Tp>
21401 static void
21402 __ucr(_ForwardIterator, _ForwardIterator, _Tp&) { }
21403 };
21404 template<typename _ForwardIterator, typename _Tp>
21405 inline void
21406 __uninitialized_construct_range(_ForwardIterator __first,
21407 _ForwardIterator __last,
21408 _Tp& __value)
21409 {
21410 typedef typename std::iterator_traits<_ForwardIterator>::value_type
21411 _ValueType;
21412 std::__uninitialized_construct_range_dispatch<
21413 __has_trivial_constructor(_ValueType)>::
21414 __ucr(__first, __last, __value);
21415 }
21416 template<bool>
21417 struct __uninitialized_fill_n
21418 {
21419 template<typename _ForwardIterator, typename _Size, typename _Tp>
21420 static void
21421 uninitialized_fill_n(_ForwardIterator __first, _Size __n,
21422 const _Tp& __x)
21423 {
21424 _ForwardIterator __cur = __first;
21425 try
21426 {
21427 for (; __n > 0; --__n, ++__cur)
21428 std::_Construct(&*__cur, __x);
21429 }
21430 catch(...)
21431 {
21432 std::_Destroy(__first, __cur);
21433 throw;
21434 }
21435 }
21436 };
21437 template<>
21438 struct __uninitialized_fill_n<true>
21439 {
21440 template<typename _ForwardIterator, typename _Size, typename _Tp>
21441 static void
21442 uninitialized_fill_n(_ForwardIterator __first, _Size __n,
21443 const _Tp& __x)
21444 { std::fill_n(__first, __n, __x); }
21445 };
21446 template<typename _ForwardIterator, typename _Size, typename _Tp>
21447 inline void
21448 uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
21449 {
21450 typedef typename iterator_traits<_ForwardIterator>::value_type
21451 _ValueType;
21452 std::__uninitialized_fill_n<__is_pod(_ValueType)>::
21453 uninitialized_fill_n(__first, __n, __x);
21454 }
21455 template<typename _InputIterator, typename _ForwardIterator,
21456 typename _Allocator>
21457 _ForwardIterator
21458 __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
21459 _ForwardIterator __result, _Allocator& __alloc)
21460 {
21461 _ForwardIterator __cur = __result;
21462 try
21463 {
21464 for (; __first != __last; ++__first, ++__cur)
21465 __alloc.construct(&*__cur, *__first);
21466 return __cur;
21467 }
21468 catch(...)
21469 {
21470 std::_Destroy(__result, __cur, __alloc);
21471 throw;
21472 }
21473 }
21474 template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
21475 inline _ForwardIterator
21476 __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
21477 _ForwardIterator __result, allocator<_Tp>&)
21478 { return std::uninitialized_copy(__first, __last, __result); }
21479 template<typename _InputIterator, typename _ForwardIterator,
21480 typename _Allocator>
21481 inline _ForwardIterator
21482 __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
21483 _ForwardIterator __result, _Allocator& __alloc)
21484 {
21485 return std::__uninitialized_copy_a((__first),
21486 (__last),
21487 __result, __alloc);
21488 }
21489 template<typename _ForwardIterator, typename _Tp, typename _Allocator>
21490 void
21491 __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
21492 const _Tp& __x, _Allocator& __alloc)
21493 {
21494 _ForwardIterator __cur = __first;
21495 try
21496 {
21497 for (; __cur != __last; ++__cur)
21498 __alloc.construct(&*__cur, __x);
21499 }
21500 catch(...)
21501 {
21502 std::_Destroy(__first, __cur, __alloc);
21503 throw;
21504 }
21505 }
21506 template<typename _ForwardIterator, typename _Tp, typename _Tp2>
21507 inline void
21508 __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
21509 const _Tp& __x, allocator<_Tp2>&)
21510 { std::uninitialized_fill(__first, __last, __x); }
21511 template<typename _ForwardIterator, typename _Size, typename _Tp,
21512 typename _Allocator>
21513 void
21514 __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
21515 const _Tp& __x, _Allocator& __alloc)
21516 {
21517 _ForwardIterator __cur = __first;
21518 try
21519 {
21520 for (; __n > 0; --__n, ++__cur)
21521 __alloc.construct(&*__cur, __x);
21522 }
21523 catch(...)
21524 {
21525 std::_Destroy(__first, __cur, __alloc);
21526 throw;
21527 }
21528 }
21529 template<typename _ForwardIterator, typename _Size, typename _Tp,
21530 typename _Tp2>
21531 inline void
21532 __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
21533 const _Tp& __x, allocator<_Tp2>&)
21534 { std::uninitialized_fill_n(__first, __n, __x); }
21535 template<typename _InputIterator1, typename _InputIterator2,
21536 typename _ForwardIterator, typename _Allocator>
21537 inline _ForwardIterator
21538 __uninitialized_copy_move(_InputIterator1 __first1,
21539 _InputIterator1 __last1,
21540 _InputIterator2 __first2,
21541 _InputIterator2 __last2,
21542 _ForwardIterator __result,
21543 _Allocator& __alloc)
21544 {
21545 _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
21546 __result,
21547 __alloc);
21548 try
21549 {
21550 return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
21551 }
21552 catch(...)
21553 {
21554 std::_Destroy(__result, __mid, __alloc);
21555 throw;
21556 }
21557 }
21558 template<typename _InputIterator1, typename _InputIterator2,
21559 typename _ForwardIterator, typename _Allocator>
21560 inline _ForwardIterator
21561 __uninitialized_move_copy(_InputIterator1 __first1,
21562 _InputIterator1 __last1,
21563 _InputIterator2 __first2,
21564 _InputIterator2 __last2,
21565 _ForwardIterator __result,
21566 _Allocator& __alloc)
21567 {
21568 _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
21569 __result,
21570 __alloc);
21571 try
21572 {
21573 return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
21574 }
21575 catch(...)
21576 {
21577 std::_Destroy(__result, __mid, __alloc);
21578 throw;
21579 }
21580 }
21581 template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
21582 typename _Allocator>
21583 inline _ForwardIterator
21584 __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
21585 const _Tp& __x, _InputIterator __first,
21586 _InputIterator __last, _Allocator& __alloc)
21587 {
21588 std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
21589 try
21590 {
21591 return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
21592 }
21593 catch(...)
21594 {
21595 std::_Destroy(__result, __mid, __alloc);
21596 throw;
21597 }
21598 }
21599 template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
21600 typename _Allocator>
21601 inline void
21602 __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
21603 _ForwardIterator __first2,
21604 _ForwardIterator __last2, const _Tp& __x,
21605 _Allocator& __alloc)
21606 {
21607 _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
21608 __first2,
21609 __alloc);
21610 try
21611 {
21612 std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
21613 }
21614 catch(...)
21615 {
21616 std::_Destroy(__first2, __mid2, __alloc);
21617 throw;
21618 }
21619 }
21620 }
21621 namespace std __attribute__ ((__visibility__ ("default"))) {
21622 template<typename _Tp, typename _Alloc>
21623 struct _Vector_base
21624 {
21625 typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
21626 struct _Vector_impl
21627 : public _Tp_alloc_type
21628 {
21629 typename _Tp_alloc_type::pointer _M_start;
21630 typename _Tp_alloc_type::pointer _M_finish;
21631 typename _Tp_alloc_type::pointer _M_end_of_storage;
21632 _Vector_impl()
21633 : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
21634 { }
21635 _Vector_impl(_Tp_alloc_type const& __a)
21636 : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
21637 { }
21638 };
21639 public:
21640 typedef _Alloc allocator_type;
21641 _Tp_alloc_type&
21642 _M_get_Tp_allocator()
21643 { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
21644 const _Tp_alloc_type&
21645 _M_get_Tp_allocator() const
21646 { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
21647 allocator_type
21648 get_allocator() const
21649 { return allocator_type(_M_get_Tp_allocator()); }
21650 _Vector_base()
21651 : _M_impl() { }
21652 _Vector_base(const allocator_type& __a)
21653 : _M_impl(__a) { }
21654 _Vector_base(size_t __n, const allocator_type& __a)
21655 : _M_impl(__a)
21656 {
21657 this->_M_impl._M_start = this->_M_allocate(__n);
21658 this->_M_impl._M_finish = this->_M_impl._M_start;
21659 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
21660 }
21661 ~_Vector_base()
21662 { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
21663 - this->_M_impl._M_start); }
21664 public:
21665 _Vector_impl _M_impl;
21666 typename _Tp_alloc_type::pointer
21667 _M_allocate(size_t __n)
21668 { return __n != 0 ? _M_impl.allocate(__n) : 0; }
21669 void
21670 _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n)
21671 {
21672 if (__p)
21673 _M_impl.deallocate(__p, __n);
21674 }
21675 };
21676 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
21677 class vector : public _Vector_base<_Tp, _Alloc>
21678 {
21679 typedef typename _Alloc::value_type _Alloc_value_type;
21680
21681
21682 typedef _Vector_base<_Tp, _Alloc> _Base;
21683 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
21684 public:
21685 typedef _Tp value_type;
21686 typedef typename _Tp_alloc_type::pointer pointer;
21687 typedef typename _Tp_alloc_type::const_pointer const_pointer;
21688 typedef typename _Tp_alloc_type::reference reference;
21689 typedef typename _Tp_alloc_type::const_reference const_reference;
21690 typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
21691 typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
21692 const_iterator;
21693 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
21694 typedef std::reverse_iterator<iterator> reverse_iterator;
21695 typedef size_t size_type;
21696 typedef ptrdiff_t difference_type;
21697 typedef _Alloc allocator_type;
21698 public:
21699 using _Base::_M_allocate;
21700 using _Base::_M_deallocate;
21701 using _Base::_M_impl;
21702 using _Base::_M_get_Tp_allocator;
21703 public:
21704 vector()
21705 : _Base() { }
21706 explicit
21707 vector(const allocator_type& __a)
21708 : _Base(__a) { }
21709 explicit
21710 vector(size_type __n, const value_type& __value = value_type(),
21711 const allocator_type& __a = allocator_type())
21712 : _Base(__n, __a)
21713 { _M_fill_initialize(__n, __value); }
21714 vector(const vector& __x)
21715 : _Base(__x.size(), __x._M_get_Tp_allocator())
21716 { this->_M_impl._M_finish =
21717 std::__uninitialized_copy_a(__x.begin(), __x.end(),
21718 this->_M_impl._M_start,
21719 _M_get_Tp_allocator());
21720 }
21721 template<typename _InputIterator>
21722 vector(_InputIterator __first, _InputIterator __last,
21723 const allocator_type& __a = allocator_type())
21724 : _Base(__a)
21725 {
21726 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21727 _M_initialize_dispatch(__first, __last, _Integral());
21728 }
21729 ~vector()
21730 { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
21731 _M_get_Tp_allocator()); }
21732 vector&
21733 operator=(const vector& __x);
21734 void
21735 assign(size_type __n, const value_type& __val)
21736 { _M_fill_assign(__n, __val); }
21737 template<typename _InputIterator>
21738 void
21739 assign(_InputIterator __first, _InputIterator __last)
21740 {
21741 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21742 _M_assign_dispatch(__first, __last, _Integral());
21743 }
21744 using _Base::get_allocator;
21745 iterator
21746 begin()
21747 { return iterator(this->_M_impl._M_start); }
21748 const_iterator
21749 begin() const
21750 { return const_iterator(this->_M_impl._M_start); }
21751 iterator
21752 end()
21753 { return iterator(this->_M_impl._M_finish); }
21754 const_iterator
21755 end() const
21756 { return const_iterator(this->_M_impl._M_finish); }
21757 reverse_iterator
21758 rbegin()
21759 { return reverse_iterator(end()); }
21760 const_reverse_iterator
21761 rbegin() const
21762 { return const_reverse_iterator(end()); }
21763 reverse_iterator
21764 rend()
21765 { return reverse_iterator(begin()); }
21766 const_reverse_iterator
21767 rend() const
21768 { return const_reverse_iterator(begin()); }
21769 size_type
21770 size() const
21771 { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
21772 size_type
21773 max_size() const
21774 { return _M_get_Tp_allocator().max_size(); }
21775 void
21776 resize(size_type __new_size, value_type __x = value_type())
21777 {
21778 if (__new_size < size())
21779 _M_erase_at_end(this->_M_impl._M_start + __new_size);
21780 else
21781 insert(end(), __new_size - size(), __x);
21782 }
21783 size_type
21784 capacity() const
21785 { return size_type(this->_M_impl._M_end_of_storage
21786 - this->_M_impl._M_start); }
21787 bool
21788 empty() const
21789 { return begin() == end(); }
21790 void
21791 reserve(size_type __n);
21792 reference
21793 operator[](size_type __n)
21794 { return *(this->_M_impl._M_start + __n); }
21795 const_reference
21796 operator[](size_type __n) const
21797 { return *(this->_M_impl._M_start + __n); }
21798 public:
21799 void
21800 _M_range_check(size_type __n) const
21801 {
21802 if (__n >= this->size())
21803 __throw_out_of_range(("vector::_M_range_check"));
21804 }
21805 public:
21806 reference
21807 at(size_type __n)
21808 {
21809 _M_range_check(__n);
21810 return (*this)[__n];
21811 }
21812 const_reference
21813 at(size_type __n) const
21814 {
21815 _M_range_check(__n);
21816 return (*this)[__n];
21817 }
21818 reference
21819 front()
21820 { return *begin(); }
21821 const_reference
21822 front() const
21823 { return *begin(); }
21824 reference
21825 back()
21826 { return *(end() - 1); }
21827 const_reference
21828 back() const
21829 { return *(end() - 1); }
21830 pointer
21831 data()
21832 { return pointer(this->_M_impl._M_start); }
21833 const_pointer
21834 data() const
21835 { return const_pointer(this->_M_impl._M_start); }
21836 void
21837 push_back(const value_type& __x)
21838 {
21839 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
21840 {
21841 this->_M_impl.construct(this->_M_impl._M_finish, __x);
21842 ++this->_M_impl._M_finish;
21843 }
21844 else
21845 _M_insert_aux(end(), __x);
21846 }
21847 void
21848 pop_back()
21849 {
21850 --this->_M_impl._M_finish;
21851 this->_M_impl.destroy(this->_M_impl._M_finish);
21852 }
21853 iterator
21854 insert(iterator __position, const value_type& __x);
21855 void
21856 insert(iterator __position, size_type __n, const value_type& __x)
21857 { _M_fill_insert(__position, __n, __x); }
21858 template<typename _InputIterator>
21859 void
21860 insert(iterator __position, _InputIterator __first,
21861 _InputIterator __last)
21862 {
21863 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
21864 _M_insert_dispatch(__position, __first, __last, _Integral());
21865 }
21866 iterator
21867 erase(iterator __position);
21868 iterator
21869 erase(iterator __first, iterator __last);
21870 void
21871 swap(vector& __x)
21872 {
21873 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
21874 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
21875 std::swap(this->_M_impl._M_end_of_storage,
21876 __x._M_impl._M_end_of_storage);
21877 std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
21878 __x._M_get_Tp_allocator());
21879 }
21880 void
21881 clear()
21882 { _M_erase_at_end(this->_M_impl._M_start); }
21883 public:
21884 template<typename _ForwardIterator>
21885 pointer
21886 _M_allocate_and_copy(size_type __n,
21887 _ForwardIterator __first, _ForwardIterator __last)
21888 {
21889 pointer __result = this->_M_allocate(__n);
21890 try
21891 {
21892 std::__uninitialized_copy_a(__first, __last, __result,
21893 _M_get_Tp_allocator());
21894 return __result;
21895 }
21896 catch(...)
21897 {
21898 _M_deallocate(__result, __n);
21899 throw;
21900 }
21901 }
21902 template<typename _Integer>
21903 void
21904 _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
21905 {
21906 this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
21907 this->_M_impl._M_end_of_storage =
21908 this->_M_impl._M_start + static_cast<size_type>(__n);
21909 _M_fill_initialize(static_cast<size_type>(__n), __value);
21910 }
21911 template<typename _InputIterator>
21912 void
21913 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
21914 __false_type)
21915 {
21916 typedef typename std::iterator_traits<_InputIterator>::
21917 iterator_category _IterCategory;
21918 _M_range_initialize(__first, __last, _IterCategory());
21919 }
21920 template<typename _InputIterator>
21921 void
21922 _M_range_initialize(_InputIterator __first,
21923 _InputIterator __last, std::input_iterator_tag)
21924 {
21925 for (; __first != __last; ++__first)
21926 push_back(*__first);
21927 }
21928 template<typename _ForwardIterator>
21929 void
21930 _M_range_initialize(_ForwardIterator __first,
21931 _ForwardIterator __last, std::forward_iterator_tag)
21932 {
21933 const size_type __n = std::distance(__first, __last);
21934 this->_M_impl._M_start = this->_M_allocate(__n);
21935 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
21936 this->_M_impl._M_finish =
21937 std::__uninitialized_copy_a(__first, __last,
21938 this->_M_impl._M_start,
21939 _M_get_Tp_allocator());
21940 }
21941 void
21942 _M_fill_initialize(size_type __n, const value_type& __value)
21943 {
21944 std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
21945 _M_get_Tp_allocator());
21946 this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
21947 }
21948 template<typename _Integer>
21949 void
21950 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
21951 { _M_fill_assign(__n, __val); }
21952 template<typename _InputIterator>
21953 void
21954 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
21955 __false_type)
21956 {
21957 typedef typename std::iterator_traits<_InputIterator>::
21958 iterator_category _IterCategory;
21959 _M_assign_aux(__first, __last, _IterCategory());
21960 }
21961 template<typename _InputIterator>
21962 void
21963 _M_assign_aux(_InputIterator __first, _InputIterator __last,
21964 std::input_iterator_tag);
21965 template<typename _ForwardIterator>
21966 void
21967 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
21968 std::forward_iterator_tag);
21969 void
21970 _M_fill_assign(size_type __n, const value_type& __val);
21971 template<typename _Integer>
21972 void
21973 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
21974 __true_type)
21975 { _M_fill_insert(__pos, __n, __val); }
21976 template<typename _InputIterator>
21977 void
21978 _M_insert_dispatch(iterator __pos, _InputIterator __first,
21979 _InputIterator __last, __false_type)
21980 {
21981 typedef typename std::iterator_traits<_InputIterator>::
21982 iterator_category _IterCategory;
21983 _M_range_insert(__pos, __first, __last, _IterCategory());
21984 }
21985 template<typename _InputIterator>
21986 void
21987 _M_range_insert(iterator __pos, _InputIterator __first,
21988 _InputIterator __last, std::input_iterator_tag);
21989 template<typename _ForwardIterator>
21990 void
21991 _M_range_insert(iterator __pos, _ForwardIterator __first,
21992 _ForwardIterator __last, std::forward_iterator_tag);
21993 void
21994 _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
21995 void
21996 _M_insert_aux(iterator __position, const value_type& __x);
21997 size_type
21998 _M_check_len(size_type __n, const char* __s) const
21999 {
22000 if (max_size() - size() < __n)
22001 __throw_length_error((__s));
22002 const size_type __len = size() + std::max(size(), __n);
22003 return (__len < size() || __len > max_size()) ? max_size() : __len;
22004 }
22005 void
22006 _M_erase_at_end(pointer __pos)
22007 {
22008 std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
22009 this->_M_impl._M_finish = __pos;
22010 }
22011 };
22012 template<typename _Tp, typename _Alloc>
22013 inline bool
22014 operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
22015 { return (__x.size() == __y.size()
22016 && std::equal(__x.begin(), __x.end(), __y.begin())); }
22017 template<typename _Tp, typename _Alloc>
22018 inline bool
22019 operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
22020 { return std::lexicographical_compare(__x.begin(), __x.end(),
22021 __y.begin(), __y.end()); }
22022 template<typename _Tp, typename _Alloc>
22023 inline bool
22024 operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
22025 { return !(__x == __y); }
22026 template<typename _Tp, typename _Alloc>
22027 inline bool
22028 operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
22029 { return __y < __x; }
22030 template<typename _Tp, typename _Alloc>
22031 inline bool
22032 operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
22033 { return !(__y < __x); }
22034 template<typename _Tp, typename _Alloc>
22035 inline bool
22036 operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
22037 { return !(__x < __y); }
22038 template<typename _Tp, typename _Alloc>
22039 inline void
22040 swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
22041 { __x.swap(__y); }
22042 }
22043 namespace std __attribute__ ((__visibility__ ("default"))) {
22044 typedef unsigned long _Bit_type;
22045 enum { _S_word_bit = int(8 * sizeof(_Bit_type)) };
22046 struct _Bit_reference
22047 {
22048 _Bit_type * _M_p;
22049 _Bit_type _M_mask;
22050 _Bit_reference(_Bit_type * __x, _Bit_type __y)
22051 : _M_p(__x), _M_mask(__y) { }
22052 _Bit_reference() : _M_p(0), _M_mask(0) { }
22053 operator bool() const
22054 { return !!(*_M_p & _M_mask); }
22055 _Bit_reference&
22056 operator=(bool __x)
22057 {
22058 if (__x)
22059 *_M_p |= _M_mask;
22060 else
22061 *_M_p &= ~_M_mask;
22062 return *this;
22063 }
22064 _Bit_reference&
22065 operator=(const _Bit_reference& __x)
22066 { return *this = bool(__x); }
22067 bool
22068 operator==(const _Bit_reference& __x) const
22069 { return bool(*this) == bool(__x); }
22070 bool
22071 operator<(const _Bit_reference& __x) const
22072 { return !bool(*this) && bool(__x); }
22073 void
22074 flip()
22075 { *_M_p ^= _M_mask; }
22076 };
22077 struct _Bit_iterator_base
22078 : public std::iterator<std::random_access_iterator_tag, bool>
22079 {
22080 _Bit_type * _M_p;
22081 unsigned int _M_offset;
22082 _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
22083 : _M_p(__x), _M_offset(__y) { }
22084 void
22085 _M_bump_up()
22086 {
22087 if (_M_offset++ == int(_S_word_bit) - 1)
22088 {
22089 _M_offset = 0;
22090 ++_M_p;
22091 }
22092 }
22093 void
22094 _M_bump_down()
22095 {
22096 if (_M_offset-- == 0)
22097 {
22098 _M_offset = int(_S_word_bit) - 1;
22099 --_M_p;
22100 }
22101 }
22102 void
22103 _M_incr(ptrdiff_t __i)
22104 {
22105 difference_type __n = __i + _M_offset;
22106 _M_p += __n / int(_S_word_bit);
22107 __n = __n % int(_S_word_bit);
22108 if (__n < 0)
22109 {
22110 __n += int(_S_word_bit);
22111 --_M_p;
22112 }
22113 _M_offset = static_cast<unsigned int>(__n);
22114 }
22115 bool
22116 operator==(const _Bit_iterator_base& __i) const
22117 { return _M_p == __i._M_p && _M_offset == __i._M_offset; }
22118 bool
22119 operator<(const _Bit_iterator_base& __i) const
22120 {
22121 return _M_p < __i._M_p
22122 || (_M_p == __i._M_p && _M_offset < __i._M_offset);
22123 }
22124 bool
22125 operator!=(const _Bit_iterator_base& __i) const
22126 { return !(*this == __i); }
22127 bool
22128 operator>(const _Bit_iterator_base& __i) const
22129 { return __i < *this; }
22130 bool
22131 operator<=(const _Bit_iterator_base& __i) const
22132 { return !(__i < *this); }
22133 bool
22134 operator>=(const _Bit_iterator_base& __i) const
22135 { return !(*this < __i); }
22136 };
22137 inline ptrdiff_t
22138 operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
22139 {
22140 return (int(_S_word_bit) * (__x._M_p - __y._M_p)
22141 + __x._M_offset - __y._M_offset);
22142 }
22143 struct _Bit_iterator : public _Bit_iterator_base
22144 {
22145 typedef _Bit_reference reference;
22146 typedef _Bit_reference* pointer;
22147 typedef _Bit_iterator iterator;
22148 _Bit_iterator() : _Bit_iterator_base(0, 0) { }
22149 _Bit_iterator(_Bit_type * __x, unsigned int __y)
22150 : _Bit_iterator_base(__x, __y) { }
22151 reference
22152 operator*() const
22153 { return reference(_M_p, 1UL << _M_offset); }
22154 iterator&
22155 operator++()
22156 {
22157 _M_bump_up();
22158 return *this;
22159 }
22160 iterator
22161 operator++(int)
22162 {
22163 iterator __tmp = *this;
22164 _M_bump_up();
22165 return __tmp;
22166 }
22167 iterator&
22168 operator--()
22169 {
22170 _M_bump_down();
22171 return *this;
22172 }
22173 iterator
22174 operator--(int)
22175 {
22176 iterator __tmp = *this;
22177 _M_bump_down();
22178 return __tmp;
22179 }
22180 iterator&
22181 operator+=(difference_type __i)
22182 {
22183 _M_incr(__i);
22184 return *this;
22185 }
22186 iterator&
22187 operator-=(difference_type __i)
22188 {
22189 *this += -__i;
22190 return *this;
22191 }
22192 iterator
22193 operator+(difference_type __i) const
22194 {
22195 iterator __tmp = *this;
22196 return __tmp += __i;
22197 }
22198 iterator
22199 operator-(difference_type __i) const
22200 {
22201 iterator __tmp = *this;
22202 return __tmp -= __i;
22203 }
22204 reference
22205 operator[](difference_type __i) const
22206 { return *(*this + __i); }
22207 };
22208 inline _Bit_iterator
22209 operator+(ptrdiff_t __n, const _Bit_iterator& __x)
22210 { return __x + __n; }
22211 struct _Bit_const_iterator : public _Bit_iterator_base
22212 {
22213 typedef bool reference;
22214 typedef bool const_reference;
22215 typedef const bool* pointer;
22216 typedef _Bit_const_iterator const_iterator;
22217 _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
22218 _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
22219 : _Bit_iterator_base(__x, __y) { }
22220 _Bit_const_iterator(const _Bit_iterator& __x)
22221 : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
22222 const_reference
22223 operator*() const
22224 { return _Bit_reference(_M_p, 1UL << _M_offset); }
22225 const_iterator&
22226 operator++()
22227 {
22228 _M_bump_up();
22229 return *this;
22230 }
22231 const_iterator
22232 operator++(int)
22233 {
22234 const_iterator __tmp = *this;
22235 _M_bump_up();
22236 return __tmp;
22237 }
22238 const_iterator&
22239 operator--()
22240 {
22241 _M_bump_down();
22242 return *this;
22243 }
22244 const_iterator
22245 operator--(int)
22246 {
22247 const_iterator __tmp = *this;
22248 _M_bump_down();
22249 return __tmp;
22250 }
22251 const_iterator&
22252 operator+=(difference_type __i)
22253 {
22254 _M_incr(__i);
22255 return *this;
22256 }
22257 const_iterator&
22258 operator-=(difference_type __i)
22259 {
22260 *this += -__i;
22261 return *this;
22262 }
22263 const_iterator
22264 operator+(difference_type __i) const
22265 {
22266 const_iterator __tmp = *this;
22267 return __tmp += __i;
22268 }
22269 const_iterator
22270 operator-(difference_type __i) const
22271 {
22272 const_iterator __tmp = *this;
22273 return __tmp -= __i;
22274 }
22275 const_reference
22276 operator[](difference_type __i) const
22277 { return *(*this + __i); }
22278 };
22279 inline _Bit_const_iterator
22280 operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
22281 { return __x + __n; }
22282 inline void
22283 __fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x)
22284 {
22285 for (; __first != __last; ++__first)
22286 *__first = __x;
22287 }
22288 inline void
22289 fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
22290 {
22291 if (__first._M_p != __last._M_p)
22292 {
22293 std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
22294 __fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x);
22295 __fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x);
22296 }
22297 else
22298 __fill_bvector(__first, __last, __x);
22299 }
22300 template<typename _Alloc>
22301 struct _Bvector_base
22302 {
22303 typedef typename _Alloc::template rebind<_Bit_type>::other
22304 _Bit_alloc_type;
22305 struct _Bvector_impl
22306 : public _Bit_alloc_type
22307 {
22308 _Bit_iterator _M_start;
22309 _Bit_iterator _M_finish;
22310 _Bit_type* _M_end_of_storage;
22311 _Bvector_impl()
22312 : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
22313 { }
22314 _Bvector_impl(const _Bit_alloc_type& __a)
22315 : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
22316 { }
22317 };
22318 public:
22319 typedef _Alloc allocator_type;
22320 _Bit_alloc_type&
22321 _M_get_Bit_allocator()
22322 { return *static_cast<_Bit_alloc_type*>(&this->_M_impl); }
22323 const _Bit_alloc_type&
22324 _M_get_Bit_allocator() const
22325 { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }
22326 allocator_type
22327 get_allocator() const
22328 { return allocator_type(_M_get_Bit_allocator()); }
22329 _Bvector_base()
22330 : _M_impl() { }
22331 _Bvector_base(const allocator_type& __a)
22332 : _M_impl(__a) { }
22333 ~_Bvector_base()
22334 { this->_M_deallocate(); }
22335 public:
22336 _Bvector_impl _M_impl;
22337 _Bit_type*
22338 _M_allocate(size_t __n)
22339 { return _M_impl.allocate((__n + int(_S_word_bit) - 1)
22340 / int(_S_word_bit)); }
22341 void
22342 _M_deallocate()
22343 {
22344 if (_M_impl._M_start._M_p)
22345 _M_impl.deallocate(_M_impl._M_start._M_p,
22346 _M_impl._M_end_of_storage - _M_impl._M_start._M_p);
22347 }
22348 };
22349 }
22350 namespace std __attribute__ ((__visibility__ ("default"))) {
22351 template<typename _Alloc>
22352 class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
22353 {
22354 typedef _Bvector_base<_Alloc> _Base;
22355 public:
22356 typedef bool value_type;
22357 typedef size_t size_type;
22358 typedef ptrdiff_t difference_type;
22359 typedef _Bit_reference reference;
22360 typedef bool const_reference;
22361 typedef _Bit_reference* pointer;
22362 typedef const bool* const_pointer;
22363 typedef _Bit_iterator iterator;
22364 typedef _Bit_const_iterator const_iterator;
22365 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
22366 typedef std::reverse_iterator<iterator> reverse_iterator;
22367 typedef _Alloc allocator_type;
22368 allocator_type get_allocator() const
22369 { return _Base::get_allocator(); }
22370 public:
22371 using _Base::_M_allocate;
22372 using _Base::_M_deallocate;
22373 using _Base::_M_get_Bit_allocator;
22374 public:
22375 vector()
22376 : _Base() { }
22377 explicit
22378 vector(const allocator_type& __a)
22379 : _Base(__a) { }
22380 explicit
22381 vector(size_type __n, const bool& __value = bool(),
22382 const allocator_type& __a = allocator_type())
22383 : _Base(__a)
22384 {
22385 _M_initialize(__n);
22386 std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
22387 __value ? ~0 : 0);
22388 }
22389 vector(const vector& __x)
22390 : _Base(__x._M_get_Bit_allocator())
22391 {
22392 _M_initialize(__x.size());
22393 _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
22394 }
22395 template<typename _InputIterator>
22396 vector(_InputIterator __first, _InputIterator __last,
22397 const allocator_type& __a = allocator_type())
22398 : _Base(__a)
22399 {
22400 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
22401 _M_initialize_dispatch(__first, __last, _Integral());
22402 }
22403 ~vector() { }
22404 vector&
22405 operator=(const vector& __x)
22406 {
22407 if (&__x == this)
22408 return *this;
22409 if (__x.size() > capacity())
22410 {
22411 this->_M_deallocate();
22412 _M_initialize(__x.size());
22413 }
22414 this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
22415 begin());
22416 return *this;
22417 }
22418 void
22419 assign(size_type __n, const bool& __x)
22420 { _M_fill_assign(__n, __x); }
22421 template<typename _InputIterator>
22422 void
22423 assign(_InputIterator __first, _InputIterator __last)
22424 {
22425 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
22426 _M_assign_dispatch(__first, __last, _Integral());
22427 }
22428 iterator
22429 begin()
22430 { return this->_M_impl._M_start; }
22431 const_iterator
22432 begin() const
22433 { return this->_M_impl._M_start; }
22434 iterator
22435 end()
22436 { return this->_M_impl._M_finish; }
22437 const_iterator
22438 end() const
22439 { return this->_M_impl._M_finish; }
22440 reverse_iterator
22441 rbegin()
22442 { return reverse_iterator(end()); }
22443 const_reverse_iterator
22444 rbegin() const
22445 { return const_reverse_iterator(end()); }
22446 reverse_iterator
22447 rend()
22448 { return reverse_iterator(begin()); }
22449 const_reverse_iterator
22450 rend() const
22451 { return const_reverse_iterator(begin()); }
22452 size_type
22453 size() const
22454 { return size_type(end() - begin()); }
22455 size_type
22456 max_size() const
22457 {
22458 const size_type __isize =
22459 __gnu_cxx::__numeric_traits<difference_type>::__max
22460 - int(_S_word_bit) + 1;
22461 const size_type __asize = _M_get_Bit_allocator().max_size();
22462 return (__asize <= __isize / int(_S_word_bit)
22463 ? __asize * int(_S_word_bit) : __isize);
22464 }
22465 size_type
22466 capacity() const
22467 { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
22468 - begin()); }
22469 bool
22470 empty() const
22471 { return begin() == end(); }
22472 reference
22473 operator[](size_type __n)
22474 {
22475 return *iterator(this->_M_impl._M_start._M_p
22476 + __n / int(_S_word_bit), __n % int(_S_word_bit));
22477 }
22478 const_reference
22479 operator[](size_type __n) const
22480 {
22481 return *const_iterator(this->_M_impl._M_start._M_p
22482 + __n / int(_S_word_bit), __n % int(_S_word_bit));
22483 }
22484 public:
22485 void
22486 _M_range_check(size_type __n) const
22487 {
22488 if (__n >= this->size())
22489 __throw_out_of_range(("vector<bool>::_M_range_check"));
22490 }
22491 public:
22492 reference
22493 at(size_type __n)
22494 { _M_range_check(__n); return (*this)[__n]; }
22495 const_reference
22496 at(size_type __n) const
22497 { _M_range_check(__n); return (*this)[__n]; }
22498 void
22499 reserve(size_type __n);
22500 reference
22501 front()
22502 { return *begin(); }
22503 const_reference
22504 front() const
22505 { return *begin(); }
22506 reference
22507 back()
22508 { return *(end() - 1); }
22509 const_reference
22510 back() const
22511 { return *(end() - 1); }
22512 void
22513 data() { }
22514 void
22515 push_back(bool __x)
22516 {
22517 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
22518 *this->_M_impl._M_finish++ = __x;
22519 else
22520 _M_insert_aux(end(), __x);
22521 }
22522 void
22523 swap(vector& __x)
22524 {
22525 std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
22526 std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
22527 std::swap(this->_M_impl._M_end_of_storage,
22528 __x._M_impl._M_end_of_storage);
22529 std::__alloc_swap<typename _Base::_Bit_alloc_type>::
22530 _S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
22531 }
22532 static void
22533 swap(reference __x, reference __y)
22534 {
22535 bool __tmp = __x;
22536 __x = __y;
22537 __y = __tmp;
22538 }
22539 iterator
22540 insert(iterator __position, const bool& __x = bool())
22541 {
22542 const difference_type __n = __position - begin();
22543 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
22544 && __position == end())
22545 *this->_M_impl._M_finish++ = __x;
22546 else
22547 _M_insert_aux(__position, __x);
22548 return begin() + __n;
22549 }
22550 template<typename _InputIterator>
22551 void
22552 insert(iterator __position,
22553 _InputIterator __first, _InputIterator __last)
22554 {
22555 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
22556 _M_insert_dispatch(__position, __first, __last, _Integral());
22557 }
22558 void
22559 insert(iterator __position, size_type __n, const bool& __x)
22560 { _M_fill_insert(__position, __n, __x); }
22561 void
22562 pop_back()
22563 { --this->_M_impl._M_finish; }
22564 iterator
22565 erase(iterator __position)
22566 {
22567 if (__position + 1 != end())
22568 std::copy(__position + 1, end(), __position);
22569 --this->_M_impl._M_finish;
22570 return __position;
22571 }
22572 iterator
22573 erase(iterator __first, iterator __last)
22574 {
22575 _M_erase_at_end(std::copy(__last, end(), __first));
22576 return __first;
22577 }
22578 void
22579 resize(size_type __new_size, bool __x = bool())
22580 {
22581 if (__new_size < size())
22582 _M_erase_at_end(begin() + difference_type(__new_size));
22583 else
22584 insert(end(), __new_size - size(), __x);
22585 }
22586 void
22587 flip()
22588 {
22589 for (_Bit_type * __p = this->_M_impl._M_start._M_p;
22590 __p != this->_M_impl._M_end_of_storage; ++__p)
22591 *__p = ~*__p;
22592 }
22593 void
22594 clear()
22595 { _M_erase_at_end(begin()); }
22596 public:
22597 iterator
22598 _M_copy_aligned(const_iterator __first, const_iterator __last,
22599 iterator __result)
22600 {
22601 _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
22602 return std::copy(const_iterator(__last._M_p, 0), __last,
22603 iterator(__q, 0));
22604 }
22605 void
22606 _M_initialize(size_type __n)
22607 {
22608 _Bit_type* __q = this->_M_allocate(__n);
22609 this->_M_impl._M_end_of_storage = (__q
22610 + ((__n + int(_S_word_bit) - 1)
22611 / int(_S_word_bit)));
22612 this->_M_impl._M_start = iterator(__q, 0);
22613 this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
22614 }
22615 template<typename _Integer>
22616 void
22617 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
22618 {
22619 _M_initialize(static_cast<size_type>(__n));
22620 std::fill(this->_M_impl._M_start._M_p,
22621 this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
22622 }
22623 template<typename _InputIterator>
22624 void
22625 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
22626 __false_type)
22627 { _M_initialize_range(__first, __last,
22628 std::__iterator_category(__first)); }
22629 template<typename _InputIterator>
22630 void
22631 _M_initialize_range(_InputIterator __first, _InputIterator __last,
22632 std::input_iterator_tag)
22633 {
22634 for (; __first != __last; ++__first)
22635 push_back(*__first);
22636 }
22637 template<typename _ForwardIterator>
22638 void
22639 _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
22640 std::forward_iterator_tag)
22641 {
22642 const size_type __n = std::distance(__first, __last);
22643 _M_initialize(__n);
22644 std::copy(__first, __last, this->_M_impl._M_start);
22645 }
22646 template<typename _Integer>
22647 void
22648 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
22649 { _M_fill_assign(__n, __val); }
22650 template<class _InputIterator>
22651 void
22652 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
22653 __false_type)
22654 { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
22655 void
22656 _M_fill_assign(size_t __n, bool __x)
22657 {
22658 if (__n > size())
22659 {
22660 std::fill(this->_M_impl._M_start._M_p,
22661 this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
22662 insert(end(), __n - size(), __x);
22663 }
22664 else
22665 {
22666 _M_erase_at_end(begin() + __n);
22667 std::fill(this->_M_impl._M_start._M_p,
22668 this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
22669 }
22670 }
22671 template<typename _InputIterator>
22672 void
22673 _M_assign_aux(_InputIterator __first, _InputIterator __last,
22674 std::input_iterator_tag)
22675 {
22676 iterator __cur = begin();
22677 for (; __first != __last && __cur != end(); ++__cur, ++__first)
22678 *__cur = *__first;
22679 if (__first == __last)
22680 _M_erase_at_end(__cur);
22681 else
22682 insert(end(), __first, __last);
22683 }
22684 template<typename _ForwardIterator>
22685 void
22686 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
22687 std::forward_iterator_tag)
22688 {
22689 const size_type __len = std::distance(__first, __last);
22690 if (__len < size())
22691 _M_erase_at_end(std::copy(__first, __last, begin()));
22692 else
22693 {
22694 _ForwardIterator __mid = __first;
22695 std::advance(__mid, size());
22696 std::copy(__first, __mid, begin());
22697 insert(end(), __mid, __last);
22698 }
22699 }
22700 template<typename _Integer>
22701 void
22702 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
22703 __true_type)
22704 { _M_fill_insert(__pos, __n, __x); }
22705 template<typename _InputIterator>
22706 void
22707 _M_insert_dispatch(iterator __pos,
22708 _InputIterator __first, _InputIterator __last,
22709 __false_type)
22710 { _M_insert_range(__pos, __first, __last,
22711 std::__iterator_category(__first)); }
22712 void
22713 _M_fill_insert(iterator __position, size_type __n, bool __x);
22714 template<typename _InputIterator>
22715 void
22716 _M_insert_range(iterator __pos, _InputIterator __first,
22717 _InputIterator __last, std::input_iterator_tag)
22718 {
22719 for (; __first != __last; ++__first)
22720 {
22721 __pos = insert(__pos, *__first);
22722 ++__pos;
22723 }
22724 }
22725 template<typename _ForwardIterator>
22726 void
22727 _M_insert_range(iterator __position, _ForwardIterator __first,
22728 _ForwardIterator __last, std::forward_iterator_tag);
22729 void
22730 _M_insert_aux(iterator __position, bool __x);
22731 size_type
22732 _M_check_len(size_type __n, const char* __s) const
22733 {
22734 if (max_size() - size() < __n)
22735 __throw_length_error((__s));
22736 const size_type __len = size() + std::max(size(), __n);
22737 return (__len < size() || __len > max_size()) ? max_size() : __len;
22738 }
22739 void
22740 _M_erase_at_end(iterator __pos)
22741 { this->_M_impl._M_finish = __pos; }
22742 };
22743 }
22744 namespace std __attribute__ ((__visibility__ ("default"))) {
22745 template<typename _Tp, typename _Alloc>
22746 void
22747 vector<_Tp, _Alloc>::
22748 reserve(size_type __n)
22749 {
22750 if (__n > this->max_size())
22751 __throw_length_error(("vector::reserve"));
22752 if (this->capacity() < __n)
22753 {
22754 const size_type __old_size = size();
22755 pointer __tmp = _M_allocate_and_copy(__n,
22756 (this->_M_impl._M_start),
22757 (this->_M_impl._M_finish));
22758 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22759 _M_get_Tp_allocator());
22760 _M_deallocate(this->_M_impl._M_start,
22761 this->_M_impl._M_end_of_storage
22762 - this->_M_impl._M_start);
22763 this->_M_impl._M_start = __tmp;
22764 this->_M_impl._M_finish = __tmp + __old_size;
22765 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
22766 }
22767 }
22768 template<typename _Tp, typename _Alloc>
22769 typename vector<_Tp, _Alloc>::iterator
22770 vector<_Tp, _Alloc>::
22771 insert(iterator __position, const value_type& __x)
22772 {
22773 const size_type __n = __position - begin();
22774 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
22775 && __position == end())
22776 {
22777 this->_M_impl.construct(this->_M_impl._M_finish, __x);
22778 ++this->_M_impl._M_finish;
22779 }
22780 else
22781 {
22782 _M_insert_aux(__position, __x);
22783 }
22784 return iterator(this->_M_impl._M_start + __n);
22785 }
22786 template<typename _Tp, typename _Alloc>
22787 typename vector<_Tp, _Alloc>::iterator
22788 vector<_Tp, _Alloc>::
22789 erase(iterator __position)
22790 {
22791 if (__position + 1 != end())
22792 std::copy(__position + 1, end(), __position);
22793 --this->_M_impl._M_finish;
22794 this->_M_impl.destroy(this->_M_impl._M_finish);
22795 return __position;
22796 }
22797 template<typename _Tp, typename _Alloc>
22798 typename vector<_Tp, _Alloc>::iterator
22799 vector<_Tp, _Alloc>::
22800 erase(iterator __first, iterator __last)
22801 {
22802 if (__last != end())
22803 std::copy(__last, end(), __first);
22804 _M_erase_at_end(__first.base() + (end() - __last));
22805 return __first;
22806 }
22807 template<typename _Tp, typename _Alloc>
22808 vector<_Tp, _Alloc>&
22809 vector<_Tp, _Alloc>::
22810 operator=(const vector<_Tp, _Alloc>& __x)
22811 {
22812 if (&__x != this)
22813 {
22814 const size_type __xlen = __x.size();
22815 if (__xlen > capacity())
22816 {
22817 pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
22818 __x.end());
22819 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22820 _M_get_Tp_allocator());
22821 _M_deallocate(this->_M_impl._M_start,
22822 this->_M_impl._M_end_of_storage
22823 - this->_M_impl._M_start);
22824 this->_M_impl._M_start = __tmp;
22825 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
22826 }
22827 else if (size() >= __xlen)
22828 {
22829 std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
22830 end(), _M_get_Tp_allocator());
22831 }
22832 else
22833 {
22834 std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
22835 this->_M_impl._M_start);
22836 std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
22837 __x._M_impl._M_finish,
22838 this->_M_impl._M_finish,
22839 _M_get_Tp_allocator());
22840 }
22841 this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
22842 }
22843 return *this;
22844 }
22845 template<typename _Tp, typename _Alloc>
22846 void
22847 vector<_Tp, _Alloc>::
22848 _M_fill_assign(size_t __n, const value_type& __val)
22849 {
22850 if (__n > capacity())
22851 {
22852 vector __tmp(__n, __val, _M_get_Tp_allocator());
22853 __tmp.swap(*this);
22854 }
22855 else if (__n > size())
22856 {
22857 std::fill(begin(), end(), __val);
22858 std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
22859 __n - size(), __val,
22860 _M_get_Tp_allocator());
22861 this->_M_impl._M_finish += __n - size();
22862 }
22863 else
22864 _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
22865 }
22866 template<typename _Tp, typename _Alloc>
22867 template<typename _InputIterator>
22868 void
22869 vector<_Tp, _Alloc>::
22870 _M_assign_aux(_InputIterator __first, _InputIterator __last,
22871 std::input_iterator_tag)
22872 {
22873 pointer __cur(this->_M_impl._M_start);
22874 for (; __first != __last && __cur != this->_M_impl._M_finish;
22875 ++__cur, ++__first)
22876 *__cur = *__first;
22877 if (__first == __last)
22878 _M_erase_at_end(__cur);
22879 else
22880 insert(end(), __first, __last);
22881 }
22882 template<typename _Tp, typename _Alloc>
22883 template<typename _ForwardIterator>
22884 void
22885 vector<_Tp, _Alloc>::
22886 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
22887 std::forward_iterator_tag)
22888 {
22889 const size_type __len = std::distance(__first, __last);
22890 if (__len > capacity())
22891 {
22892 pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
22893 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22894 _M_get_Tp_allocator());
22895 _M_deallocate(this->_M_impl._M_start,
22896 this->_M_impl._M_end_of_storage
22897 - this->_M_impl._M_start);
22898 this->_M_impl._M_start = __tmp;
22899 this->_M_impl._M_finish = this->_M_impl._M_start + __len;
22900 this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
22901 }
22902 else if (size() >= __len)
22903 _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
22904 else
22905 {
22906 _ForwardIterator __mid = __first;
22907 std::advance(__mid, size());
22908 std::copy(__first, __mid, this->_M_impl._M_start);
22909 this->_M_impl._M_finish =
22910 std::__uninitialized_copy_a(__mid, __last,
22911 this->_M_impl._M_finish,
22912 _M_get_Tp_allocator());
22913 }
22914 }
22915 template<typename _Tp, typename _Alloc>
22916 void
22917 vector<_Tp, _Alloc>::
22918 _M_insert_aux(iterator __position, const _Tp& __x)
22919 {
22920 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
22921 {
22922 this->_M_impl.construct(this->_M_impl._M_finish,
22923 (*(this->_M_impl._M_finish - 1))
22924 );
22925 ++this->_M_impl._M_finish;
22926 _Tp __x_copy = __x;
22927 std::copy_backward(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1)
22928 ;
22929 *__position = __x_copy;
22930 }
22931 else
22932 {
22933 const size_type __len =
22934 _M_check_len(size_type(1), "vector::_M_insert_aux");
22935 const size_type __elems_before = __position - begin();
22936 pointer __new_start(this->_M_allocate(__len));
22937 pointer __new_finish(__new_start);
22938 try
22939 {
22940 this->_M_impl.construct(__new_start + __elems_before,
22941 __x);
22942 __new_finish = 0;
22943 __new_finish =
22944 std::__uninitialized_move_a(this->_M_impl._M_start,
22945 __position.base(), __new_start,
22946 _M_get_Tp_allocator());
22947 ++__new_finish;
22948 __new_finish =
22949 std::__uninitialized_move_a(__position.base(),
22950 this->_M_impl._M_finish,
22951 __new_finish,
22952 _M_get_Tp_allocator());
22953 }
22954 catch(...)
22955 {
22956 if (!__new_finish)
22957 this->_M_impl.destroy(__new_start + __elems_before);
22958 else
22959 std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
22960 _M_deallocate(__new_start, __len);
22961 throw;
22962 }
22963 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
22964 _M_get_Tp_allocator());
22965 _M_deallocate(this->_M_impl._M_start,
22966 this->_M_impl._M_end_of_storage
22967 - this->_M_impl._M_start);
22968 this->_M_impl._M_start = __new_start;
22969 this->_M_impl._M_finish = __new_finish;
22970 this->_M_impl._M_end_of_storage = __new_start + __len;
22971 }
22972 }
22973 template<typename _Tp, typename _Alloc>
22974 void
22975 vector<_Tp, _Alloc>::
22976 _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
22977 {
22978 if (__n != 0)
22979 {
22980 if (size_type(this->_M_impl._M_end_of_storage
22981 - this->_M_impl._M_finish) >= __n)
22982 {
22983 value_type __x_copy = __x;
22984 const size_type __elems_after = end() - __position;
22985 pointer __old_finish(this->_M_impl._M_finish);
22986 if (__elems_after > __n)
22987 {
22988 std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
22989 this->_M_impl._M_finish,
22990 this->_M_impl._M_finish,
22991 _M_get_Tp_allocator());
22992 this->_M_impl._M_finish += __n;
22993 std::copy_backward(__position.base(), __old_finish - __n, __old_finish)
22994 ;
22995 std::fill(__position.base(), __position.base() + __n,
22996 __x_copy);
22997 }
22998 else
22999 {
23000 std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
23001 __n - __elems_after,
23002 __x_copy,
23003 _M_get_Tp_allocator());
23004 this->_M_impl._M_finish += __n - __elems_after;
23005 std::__uninitialized_move_a(__position.base(), __old_finish,
23006 this->_M_impl._M_finish,
23007 _M_get_Tp_allocator());
23008 this->_M_impl._M_finish += __elems_after;
23009 std::fill(__position.base(), __old_finish, __x_copy);
23010 }
23011 }
23012 else
23013 {
23014 const size_type __len =
23015 _M_check_len(__n, "vector::_M_fill_insert");
23016 const size_type __elems_before = __position - begin();
23017 pointer __new_start(this->_M_allocate(__len));
23018 pointer __new_finish(__new_start);
23019 try
23020 {
23021 std::__uninitialized_fill_n_a(__new_start + __elems_before,
23022 __n, __x,
23023 _M_get_Tp_allocator());
23024 __new_finish = 0;
23025 __new_finish =
23026 std::__uninitialized_move_a(this->_M_impl._M_start,
23027 __position.base(),
23028 __new_start,
23029 _M_get_Tp_allocator());
23030 __new_finish += __n;
23031 __new_finish =
23032 std::__uninitialized_move_a(__position.base(),
23033 this->_M_impl._M_finish,
23034 __new_finish,
23035 _M_get_Tp_allocator());
23036 }
23037 catch(...)
23038 {
23039 if (!__new_finish)
23040 std::_Destroy(__new_start + __elems_before,
23041 __new_start + __elems_before + __n,
23042 _M_get_Tp_allocator());
23043 else
23044 std::_Destroy(__new_start, __new_finish,
23045 _M_get_Tp_allocator());
23046 _M_deallocate(__new_start, __len);
23047 throw;
23048 }
23049 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
23050 _M_get_Tp_allocator());
23051 _M_deallocate(this->_M_impl._M_start,
23052 this->_M_impl._M_end_of_storage
23053 - this->_M_impl._M_start);
23054 this->_M_impl._M_start = __new_start;
23055 this->_M_impl._M_finish = __new_finish;
23056 this->_M_impl._M_end_of_storage = __new_start + __len;
23057 }
23058 }
23059 }
23060 template<typename _Tp, typename _Alloc>
23061 template<typename _InputIterator>
23062 void
23063 vector<_Tp, _Alloc>::
23064 _M_range_insert(iterator __pos, _InputIterator __first,
23065 _InputIterator __last, std::input_iterator_tag)
23066 {
23067 for (; __first != __last; ++__first)
23068 {
23069 __pos = insert(__pos, *__first);
23070 ++__pos;
23071 }
23072 }
23073 template<typename _Tp, typename _Alloc>
23074 template<typename _ForwardIterator>
23075 void
23076 vector<_Tp, _Alloc>::
23077 _M_range_insert(iterator __position, _ForwardIterator __first,
23078 _ForwardIterator __last, std::forward_iterator_tag)
23079 {
23080 if (__first != __last)
23081 {
23082 const size_type __n = std::distance(__first, __last);
23083 if (size_type(this->_M_impl._M_end_of_storage
23084 - this->_M_impl._M_finish) >= __n)
23085 {
23086 const size_type __elems_after = end() - __position;
23087 pointer __old_finish(this->_M_impl._M_finish);
23088 if (__elems_after > __n)
23089 {
23090 std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
23091 this->_M_impl._M_finish,
23092 this->_M_impl._M_finish,
23093 _M_get_Tp_allocator());
23094 this->_M_impl._M_finish += __n;
23095 std::copy_backward(__position.base(), __old_finish - __n, __old_finish)
23096 ;
23097 std::copy(__first, __last, __position);
23098 }
23099 else
23100 {
23101 _ForwardIterator __mid = __first;
23102 std::advance(__mid, __elems_after);
23103 std::__uninitialized_copy_a(__mid, __last,
23104 this->_M_impl._M_finish,
23105 _M_get_Tp_allocator());
23106 this->_M_impl._M_finish += __n - __elems_after;
23107 std::__uninitialized_move_a(__position.base(),
23108 __old_finish,
23109 this->_M_impl._M_finish,
23110 _M_get_Tp_allocator());
23111 this->_M_impl._M_finish += __elems_after;
23112 std::copy(__first, __mid, __position);
23113 }
23114 }
23115 else
23116 {
23117 const size_type __len =
23118 _M_check_len(__n, "vector::_M_range_insert");
23119 pointer __new_start(this->_M_allocate(__len));
23120 pointer __new_finish(__new_start);
23121 try
23122 {
23123 __new_finish =
23124 std::__uninitialized_move_a(this->_M_impl._M_start,
23125 __position.base(),
23126 __new_start,
23127 _M_get_Tp_allocator());
23128 __new_finish =
23129 std::__uninitialized_copy_a(__first, __last,
23130 __new_finish,
23131 _M_get_Tp_allocator());
23132 __new_finish =
23133 std::__uninitialized_move_a(__position.base(),
23134 this->_M_impl._M_finish,
23135 __new_finish,
23136 _M_get_Tp_allocator());
23137 }
23138 catch(...)
23139 {
23140 std::_Destroy(__new_start, __new_finish,
23141 _M_get_Tp_allocator());
23142 _M_deallocate(__new_start, __len);
23143 throw;
23144 }
23145 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
23146 _M_get_Tp_allocator());
23147 _M_deallocate(this->_M_impl._M_start,
23148 this->_M_impl._M_end_of_storage
23149 - this->_M_impl._M_start);
23150 this->_M_impl._M_start = __new_start;
23151 this->_M_impl._M_finish = __new_finish;
23152 this->_M_impl._M_end_of_storage = __new_start + __len;
23153 }
23154 }
23155 }
23156 template<typename _Alloc>
23157 void
23158 vector<bool, _Alloc>::
23159 reserve(size_type __n)
23160 {
23161 if (__n > this->max_size())
23162 __throw_length_error(("vector::reserve"));
23163 if (this->capacity() < __n)
23164 {
23165 _Bit_type* __q = this->_M_allocate(__n);
23166 this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
23167 iterator(__q, 0));
23168 this->_M_deallocate();
23169 this->_M_impl._M_start = iterator(__q, 0);
23170 this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
23171 / int(_S_word_bit));
23172 }
23173 }
23174 template<typename _Alloc>
23175 void
23176 vector<bool, _Alloc>::
23177 _M_fill_insert(iterator __position, size_type __n, bool __x)
23178 {
23179 if (__n == 0)
23180 return;
23181 if (capacity() - size() >= __n)
23182 {
23183 std::copy_backward(__position, end(),
23184 this->_M_impl._M_finish + difference_type(__n));
23185 std::fill(__position, __position + difference_type(__n), __x);
23186 this->_M_impl._M_finish += difference_type(__n);
23187 }
23188 else
23189 {
23190 const size_type __len =
23191 _M_check_len(__n, "vector<bool>::_M_fill_insert");
23192 _Bit_type * __q = this->_M_allocate(__len);
23193 iterator __i = _M_copy_aligned(begin(), __position,
23194 iterator(__q, 0));
23195 std::fill(__i, __i + difference_type(__n), __x);
23196 this->_M_impl._M_finish = std::copy(__position, end(),
23197 __i + difference_type(__n));
23198 this->_M_deallocate();
23199 this->_M_impl._M_end_of_storage = (__q + ((__len
23200 + int(_S_word_bit) - 1)
23201 / int(_S_word_bit)));
23202 this->_M_impl._M_start = iterator(__q, 0);
23203 }
23204 }
23205 template<typename _Alloc>
23206 template<typename _ForwardIterator>
23207 void
23208 vector<bool, _Alloc>::
23209 _M_insert_range(iterator __position, _ForwardIterator __first,
23210 _ForwardIterator __last, std::forward_iterator_tag)
23211 {
23212 if (__first != __last)
23213 {
23214 size_type __n = std::distance(__first, __last);
23215 if (capacity() - size() >= __n)
23216 {
23217 std::copy_backward(__position, end(),
23218 this->_M_impl._M_finish
23219 + difference_type(__n));
23220 std::copy(__first, __last, __position);
23221 this->_M_impl._M_finish += difference_type(__n);
23222 }
23223 else
23224 {
23225 const size_type __len =
23226 _M_check_len(__n, "vector<bool>::_M_insert_range");
23227 _Bit_type * __q = this->_M_allocate(__len);
23228 iterator __i = _M_copy_aligned(begin(), __position,
23229 iterator(__q, 0));
23230 __i = std::copy(__first, __last, __i);
23231 this->_M_impl._M_finish = std::copy(__position, end(), __i);
23232 this->_M_deallocate();
23233 this->_M_impl._M_end_of_storage = (__q
23234 + ((__len
23235 + int(_S_word_bit) - 1)
23236 / int(_S_word_bit)));
23237 this->_M_impl._M_start = iterator(__q, 0);
23238 }
23239 }
23240 }
23241 template<typename _Alloc>
23242 void
23243 vector<bool, _Alloc>::
23244 _M_insert_aux(iterator __position, bool __x)
23245 {
23246 if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
23247 {
23248 std::copy_backward(__position, this->_M_impl._M_finish,
23249 this->_M_impl._M_finish + 1);
23250 *__position = __x;
23251 ++this->_M_impl._M_finish;
23252 }
23253 else
23254 {
23255 const size_type __len =
23256 _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
23257 _Bit_type * __q = this->_M_allocate(__len);
23258 iterator __i = _M_copy_aligned(begin(), __position,
23259 iterator(__q, 0));
23260 *__i++ = __x;
23261 this->_M_impl._M_finish = std::copy(__position, end(), __i);
23262 this->_M_deallocate();
23263 this->_M_impl._M_end_of_storage = (__q + ((__len
23264 + int(_S_word_bit) - 1)
23265 / int(_S_word_bit)));
23266 this->_M_impl._M_start = iterator(__q, 0);
23267 }
23268 }
23269 }
23270 extern "C" {
23271 union wait
23272 {
23273 int w_status;
23274 struct
23275 {
23276 unsigned int __w_termsig:7;
23277 unsigned int __w_coredump:1;
23278 unsigned int __w_retcode:8;
23279 unsigned int:16;
23280 } __wait_terminated;
23281 struct
23282 {
23283 unsigned int __w_stopval:8;
23284 unsigned int __w_stopsig:8;
23285 unsigned int:16;
23286 } __wait_stopped;
23287 };
23288 typedef struct
23289 {
23290 int quot;
23291 int rem;
23292 } div_t;
23293 typedef struct
23294 {
23295 long int quot;
23296 long int rem;
23297 } ldiv_t;
23298 __extension__ typedef struct
23299 {
23300 long long int quot;
23301 long long int rem;
23302 } lldiv_t;
23303 extern size_t __ctype_get_mb_cur_max (void) throw () __attribute__ ((__warn_unused_result__));
23304 extern double atof (__const char *__nptr)
23305 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23306 extern int atoi (__const char *__nptr)
23307 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23308 extern long int atol (__const char *__nptr)
23309 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23310 __extension__ extern long long int atoll (__const char *__nptr)
23311 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23312 extern double strtod (__const char *__restrict __nptr,
23313 char **__restrict __endptr)
23314 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23315 extern float strtof (__const char *__restrict __nptr,
23316 char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23317 extern long double strtold (__const char *__restrict __nptr,
23318 char **__restrict __endptr)
23319 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23320 extern long int strtol (__const char *__restrict __nptr,
23321 char **__restrict __endptr, int __base)
23322 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23323 extern unsigned long int strtoul (__const char *__restrict __nptr,
23324 char **__restrict __endptr, int __base)
23325 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23326 __extension__
23327 extern long long int strtoq (__const char *__restrict __nptr,
23328 char **__restrict __endptr, int __base)
23329 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23330 __extension__
23331 extern unsigned long long int strtouq (__const char *__restrict __nptr,
23332 char **__restrict __endptr, int __base)
23333 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23334 __extension__
23335 extern long long int strtoll (__const char *__restrict __nptr,
23336 char **__restrict __endptr, int __base)
23337 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23338 __extension__
23339 extern unsigned long long int strtoull (__const char *__restrict __nptr,
23340 char **__restrict __endptr, int __base)
23341 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23342 extern long int strtol_l (__const char *__restrict __nptr,
23343 char **__restrict __endptr, int __base,
23344 __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
23345 extern unsigned long int strtoul_l (__const char *__restrict __nptr,
23346 char **__restrict __endptr,
23347 int __base, __locale_t __loc)
23348 throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
23349 __extension__
23350 extern long long int strtoll_l (__const char *__restrict __nptr,
23351 char **__restrict __endptr, int __base,
23352 __locale_t __loc)
23353 throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
23354 __extension__
23355 extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
23356 char **__restrict __endptr,
23357 int __base, __locale_t __loc)
23358 throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
23359 extern double strtod_l (__const char *__restrict __nptr,
23360 char **__restrict __endptr, __locale_t __loc)
23361 throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
23362 extern float strtof_l (__const char *__restrict __nptr,
23363 char **__restrict __endptr, __locale_t __loc)
23364 throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
23365 extern long double strtold_l (__const char *__restrict __nptr,
23366 char **__restrict __endptr,
23367 __locale_t __loc)
23368 throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
23369 extern __inline __attribute__ ((__gnu_inline__)) double
23370 atof (__const char *__nptr) throw ()
23371 {
23372 return strtod (__nptr, (char **) __null);
23373 }
23374 extern __inline __attribute__ ((__gnu_inline__)) int
23375 atoi (__const char *__nptr) throw ()
23376 {
23377 return (int) strtol (__nptr, (char **) __null, 10);
23378 }
23379 extern __inline __attribute__ ((__gnu_inline__)) long int
23380 atol (__const char *__nptr) throw ()
23381 {
23382 return strtol (__nptr, (char **) __null, 10);
23383 }
23384 __extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
23385 atoll (__const char *__nptr) throw ()
23386 {
23387 return strtoll (__nptr, (char **) __null, 10);
23388 }
23389 extern char *l64a (long int __n) throw () __attribute__ ((__warn_unused_result__));
23390 extern long int a64l (__const char *__s)
23391 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23392 extern "C" {
23393 typedef __u_char u_char;
23394 typedef __u_short u_short;
23395 typedef __u_int u_int;
23396 typedef __u_long u_long;
23397 typedef __quad_t quad_t;
23398 typedef __u_quad_t u_quad_t;
23399 typedef __fsid_t fsid_t;
23400 typedef __loff_t loff_t;
23401 typedef __ino_t ino_t;
23402 typedef __ino64_t ino64_t;
23403 typedef __dev_t dev_t;
23404 typedef __mode_t mode_t;
23405 typedef __nlink_t nlink_t;
23406 typedef __id_t id_t;
23407 typedef __daddr_t daddr_t;
23408 typedef __caddr_t caddr_t;
23409 typedef __key_t key_t;
23410 typedef __suseconds_t suseconds_t;
23411 typedef unsigned long int ulong;
23412 typedef unsigned short int ushort;
23413 typedef unsigned int uint;
23414 typedef int int8_t __attribute__ ((__mode__ (__QI__)));
23415 typedef int int16_t __attribute__ ((__mode__ (__HI__)));
23416 typedef int int32_t __attribute__ ((__mode__ (__SI__)));
23417 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
23418 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
23419 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
23420 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
23421 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
23422 typedef int register_t __attribute__ ((__mode__ (__word__)));
23423 struct timeval
23424 {
23425 __time_t tv_sec;
23426 __suseconds_t tv_usec;
23427 };
23428 typedef long int __fd_mask;
23429 typedef struct
23430 {
23431 __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
23432 } fd_set;
23433 typedef __fd_mask fd_mask;
23434 extern "C" {
23435 extern int select (int __nfds, fd_set *__restrict __readfds,
23436 fd_set *__restrict __writefds,
23437 fd_set *__restrict __exceptfds,
23438 struct timeval *__restrict __timeout);
23439 extern int pselect (int __nfds, fd_set *__restrict __readfds,
23440 fd_set *__restrict __writefds,
23441 fd_set *__restrict __exceptfds,
23442 const struct timespec *__restrict __timeout,
23443 const __sigset_t *__restrict __sigmask);
23444 }
23445 __extension__
23446 extern unsigned int gnu_dev_major (unsigned long long int __dev)
23447 throw ();
23448 __extension__
23449 extern unsigned int gnu_dev_minor (unsigned long long int __dev)
23450 throw ();
23451 __extension__
23452 extern unsigned long long int gnu_dev_makedev (unsigned int __major,
23453 unsigned int __minor)
23454 throw ();
23455 __extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned int
23456 gnu_dev_major (unsigned long long int __dev) throw ()
23457 {
23458 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
23459 }
23460 __extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned int
23461 gnu_dev_minor (unsigned long long int __dev) throw ()
23462 {
23463 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
23464 }
23465 __extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned long long int
23466 gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
23467 {
23468 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
23469 | (((unsigned long long int) (__minor & ~0xff)) << 12)
23470 | (((unsigned long long int) (__major & ~0xfff)) << 32));
23471 }
23472 typedef __blksize_t blksize_t;
23473 typedef __blkcnt_t blkcnt_t;
23474 typedef __fsblkcnt_t fsblkcnt_t;
23475 typedef __fsfilcnt_t fsfilcnt_t;
23476 typedef __blkcnt64_t blkcnt64_t;
23477 typedef __fsblkcnt64_t fsblkcnt64_t;
23478 typedef __fsfilcnt64_t fsfilcnt64_t;
23479 }
23480 extern long int random (void) throw ();
23481 extern void srandom (unsigned int __seed) throw ();
23482 extern char *initstate (unsigned int __seed, char *__statebuf,
23483 size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
23484 extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
23485 struct random_data
23486 {
23487 int32_t *fptr;
23488 int32_t *rptr;
23489 int32_t *state;
23490 int rand_type;
23491 int rand_deg;
23492 int rand_sep;
23493 int32_t *end_ptr;
23494 };
23495 extern int random_r (struct random_data *__restrict __buf,
23496 int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
23497 extern int srandom_r (unsigned int __seed, struct random_data *__buf)
23498 throw () __attribute__ ((__nonnull__ (2)));
23499 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
23500 size_t __statelen,
23501 struct random_data *__restrict __buf)
23502 throw () __attribute__ ((__nonnull__ (2, 4)));
23503 extern int setstate_r (char *__restrict __statebuf,
23504 struct random_data *__restrict __buf)
23505 throw () __attribute__ ((__nonnull__ (1, 2)));
23506 extern int rand (void) throw ();
23507 extern void srand (unsigned int __seed) throw ();
23508 extern int rand_r (unsigned int *__seed) throw ();
23509 extern double drand48 (void) throw ();
23510 extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
23511 extern long int lrand48 (void) throw ();
23512 extern long int nrand48 (unsigned short int __xsubi[3])
23513 throw () __attribute__ ((__nonnull__ (1)));
23514 extern long int mrand48 (void) throw ();
23515 extern long int jrand48 (unsigned short int __xsubi[3])
23516 throw () __attribute__ ((__nonnull__ (1)));
23517 extern void srand48 (long int __seedval) throw ();
23518 extern unsigned short int *seed48 (unsigned short int __seed16v[3])
23519 throw () __attribute__ ((__nonnull__ (1)));
23520 extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
23521 struct drand48_data
23522 {
23523 unsigned short int __x[3];
23524 unsigned short int __old_x[3];
23525 unsigned short int __c;
23526 unsigned short int __init;
23527 unsigned long long int __a;
23528 };
23529 extern int drand48_r (struct drand48_data *__restrict __buffer,
23530 double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
23531 extern int erand48_r (unsigned short int __xsubi[3],
23532 struct drand48_data *__restrict __buffer,
23533 double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
23534 extern int lrand48_r (struct drand48_data *__restrict __buffer,
23535 long int *__restrict __result)
23536 throw () __attribute__ ((__nonnull__ (1, 2)));
23537 extern int nrand48_r (unsigned short int __xsubi[3],
23538 struct drand48_data *__restrict __buffer,
23539 long int *__restrict __result)
23540 throw () __attribute__ ((__nonnull__ (1, 2)));
23541 extern int mrand48_r (struct drand48_data *__restrict __buffer,
23542 long int *__restrict __result)
23543 throw () __attribute__ ((__nonnull__ (1, 2)));
23544 extern int jrand48_r (unsigned short int __xsubi[3],
23545 struct drand48_data *__restrict __buffer,
23546 long int *__restrict __result)
23547 throw () __attribute__ ((__nonnull__ (1, 2)));
23548 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
23549 throw () __attribute__ ((__nonnull__ (2)));
23550 extern int seed48_r (unsigned short int __seed16v[3],
23551 struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
23552 extern int lcong48_r (unsigned short int __param[7],
23553 struct drand48_data *__buffer)
23554 throw () __attribute__ ((__nonnull__ (1, 2)));
23555 extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
23556 extern void *calloc (size_t __nmemb, size_t __size)
23557 throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
23558 extern void *realloc (void *__ptr, size_t __size)
23559 throw () __attribute__ ((__warn_unused_result__));
23560 extern void free (void *__ptr) throw ();
23561 extern void cfree (void *__ptr) throw ();
23562 extern "C" {
23563 extern void *alloca (size_t __size) throw ();
23564 }
23565 extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
23566 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
23567 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23568 extern void abort (void) throw () __attribute__ ((__noreturn__));
23569 extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
23570 extern "C++" int at_quick_exit (void (*__func) (void))
23571 throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
23572 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
23573 throw () __attribute__ ((__nonnull__ (1)));
23574 extern void exit (int __status) throw () __attribute__ ((__noreturn__));
23575 extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
23576 extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
23577 extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23578 extern char *__secure_getenv (__const char *__name)
23579 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23580 extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
23581 extern int setenv (__const char *__name, __const char *__value, int __replace)
23582 throw () __attribute__ ((__nonnull__ (2)));
23583 extern int unsetenv (__const char *__name) throw ();
23584 extern int clearenv (void) throw ();
23585 extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23586 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23587 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23588 extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23589 extern int mkstemps64 (char *__template, int __suffixlen)
23590 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23591 extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23592 extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23593 extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23594 extern int mkostemps (char *__template, int __suffixlen, int __flags)
23595 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23596 extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
23597 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23598 extern int system (__const char *__command) __attribute__ ((__warn_unused_result__));
23599 extern char *canonicalize_file_name (__const char *__name)
23600 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23601 extern char *realpath (__const char *__restrict __name,
23602 char *__restrict __resolved) throw () __attribute__ ((__warn_unused_result__));
23603 typedef int (*__compar_fn_t) (__const void *, __const void *);
23604 typedef __compar_fn_t comparison_fn_t;
23605 typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *);
23606 extern void *bsearch (__const void *__key, __const void *__base,
23607 size_t __nmemb, size_t __size, __compar_fn_t __compar)
23608 __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__));
23609 extern void qsort (void *__base, size_t __nmemb, size_t __size,
23610 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
23611 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
23612 __compar_d_fn_t __compar, void *__arg)
23613 __attribute__ ((__nonnull__ (1, 4)));
23614 extern int abs (int __x) throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
23615 extern long int labs (long int __x) throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
23616 __extension__ extern long long int llabs (long long int __x)
23617 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
23618 extern div_t div (int __numer, int __denom)
23619 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
23620 extern ldiv_t ldiv (long int __numer, long int __denom)
23621 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
23622 __extension__ extern lldiv_t lldiv (long long int __numer,
23623 long long int __denom)
23624 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
23625 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
23626 int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
23627 extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
23628 int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
23629 extern char *gcvt (double __value, int __ndigit, char *__buf)
23630 throw () __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
23631 extern char *qecvt (long double __value, int __ndigit,
23632 int *__restrict __decpt, int *__restrict __sign)
23633 throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
23634 extern char *qfcvt (long double __value, int __ndigit,
23635 int *__restrict __decpt, int *__restrict __sign)
23636 throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
23637 extern char *qgcvt (long double __value, int __ndigit, char *__buf)
23638 throw () __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
23639 extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
23640 int *__restrict __sign, char *__restrict __buf,
23641 size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
23642 extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
23643 int *__restrict __sign, char *__restrict __buf,
23644 size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
23645 extern int qecvt_r (long double __value, int __ndigit,
23646 int *__restrict __decpt, int *__restrict __sign,
23647 char *__restrict __buf, size_t __len)
23648 throw () __attribute__ ((__nonnull__ (3, 4, 5)));
23649 extern int qfcvt_r (long double __value, int __ndigit,
23650 int *__restrict __decpt, int *__restrict __sign,
23651 char *__restrict __buf, size_t __len)
23652 throw () __attribute__ ((__nonnull__ (3, 4, 5)));
23653 extern int mblen (__const char *__s, size_t __n) throw () __attribute__ ((__warn_unused_result__));
23654 extern int mbtowc (wchar_t *__restrict __pwc,
23655 __const char *__restrict __s, size_t __n) throw () __attribute__ ((__warn_unused_result__));
23656 extern int wctomb (char *__s, wchar_t __wchar) throw () __attribute__ ((__warn_unused_result__));
23657 extern size_t mbstowcs (wchar_t *__restrict __pwcs,
23658 __const char *__restrict __s, size_t __n) throw ();
23659 extern size_t wcstombs (char *__restrict __s,
23660 __const wchar_t *__restrict __pwcs, size_t __n)
23661 throw ();
23662 extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
23663 extern int getsubopt (char **__restrict __optionp,
23664 char *__const *__restrict __tokens,
23665 char **__restrict __valuep)
23666 throw () __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__));
23667 extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1)));
23668 extern int posix_openpt (int __oflag) __attribute__ ((__warn_unused_result__));
23669 extern int grantpt (int __fd) throw ();
23670 extern int unlockpt (int __fd) throw ();
23671 extern char *ptsname (int __fd) throw () __attribute__ ((__warn_unused_result__));
23672 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
23673 throw () __attribute__ ((__nonnull__ (2)));
23674 extern int getpt (void);
23675 extern int getloadavg (double __loadavg[], int __nelem)
23676 throw () __attribute__ ((__nonnull__ (1)));
23677 extern char *__realpath_chk (__const char *__restrict __name,
23678 char *__restrict __resolved,
23679 size_t __resolvedlen) throw () __attribute__ ((__warn_unused_result__));
23680 extern char *__realpath_alias (__const char *__restrict __name, char *__restrict __resolved) throw () __asm__ ("" "realpath")
23681 __attribute__ ((__warn_unused_result__));
23682 extern char *__realpath_chk_warn (__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) throw () __asm__ ("" "__realpath_chk")
23683 __attribute__ ((__warn_unused_result__))
23684 __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer")))
23685 ;
23686 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
23687 realpath (__const char *__restrict __name, char *__restrict __resolved) throw ()
23688 {
23689 if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1)
23690 {
23691 return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1));
23692 }
23693 return __realpath_alias (__name, __resolved);
23694 }
23695 extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
23696 size_t __nreal) throw () __attribute__ ((__nonnull__ (2)));
23697 extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) throw () __asm__ ("" "ptsname_r")
23698 __attribute__ ((__nonnull__ (2)));
23699 extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) throw () __asm__ ("" "__ptsname_r_chk")
23700 __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf")))
23701 ;
23702 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
23703 ptsname_r (int __fd, char *__buf, size_t __buflen) throw ()
23704 {
23705 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
23706 {
23707 if (!__builtin_constant_p (__buflen))
23708 return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
23709 if (__buflen > __builtin_object_size (__buf, 2 > 1))
23710 return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
23711 }
23712 return __ptsname_r_alias (__fd, __buf, __buflen);
23713 }
23714 extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
23715 throw () __attribute__ ((__warn_unused_result__));
23716 extern int __wctomb_alias (char *__s, wchar_t __wchar) throw () __asm__ ("" "wctomb")
23717 __attribute__ ((__warn_unused_result__));
23718 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) int
23719 wctomb (char *__s, wchar_t __wchar) throw ()
23720 {
23721 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1))
23722 return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1));
23723 return __wctomb_alias (__s, __wchar);
23724 }
23725 extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
23726 __const char *__restrict __src,
23727 size_t __len, size_t __dstlen) throw ();
23728 extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) throw () __asm__ ("" "mbstowcs")
23729 ;
23730 extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) throw () __asm__ ("" "__mbstowcs_chk")
23731 __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
23732 ;
23733 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
23734 mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) throw ()
23735 {
23736 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
23737 {
23738 if (!__builtin_constant_p (__len))
23739 return __mbstowcs_chk (__dst, __src, __len,
23740 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
23741 if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
23742 return __mbstowcs_chk_warn (__dst, __src, __len,
23743 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
23744 }
23745 return __mbstowcs_alias (__dst, __src, __len);
23746 }
23747 extern size_t __wcstombs_chk (char *__restrict __dst,
23748 __const wchar_t *__restrict __src,
23749 size_t __len, size_t __dstlen) throw ();
23750 extern size_t __wcstombs_alias (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) throw () __asm__ ("" "wcstombs")
23751 ;
23752 extern size_t __wcstombs_chk_warn (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) throw () __asm__ ("" "__wcstombs_chk")
23753 __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len")));
23754 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
23755 wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) throw ()
23756 {
23757 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
23758 {
23759 if (!__builtin_constant_p (__len))
23760 return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
23761 if (__len > __builtin_object_size (__dst, 2 > 1))
23762 return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
23763 }
23764 return __wcstombs_alias (__dst, __src, __len);
23765 }
23766 }
23767 typedef QtValidLicenseForCoreModule QtCoreModule;
23768 struct QVectorData
23769 {
23770 QBasicAtomicInt ref;
23771 int alloc;
23772 int size;
23773 uint sharable : 1;
23774 uint capacity : 1;
23775 uint reserved : 30;
23776 static QVectorData shared_null;
23777 static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init);
23778 static QVectorData *allocate(int size, int alignment);
23779 static QVectorData *reallocate(QVectorData *old, int newsize, int oldsize, int alignment);
23780 static void free(QVectorData *data, int alignment);
23781 static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive);
23782 };
23783 template <typename T>
23784 struct QVectorTypedData : private QVectorData
23785 {
23786 T array[1];
23787 static inline void free(QVectorTypedData<T> *x, int alignment) { QVectorData::free(static_cast<QVectorData *>(x), alignment); }
23788 };
23789 class QRegion;
23790 template <typename T>
23791 class QVector
23792 {
23793 typedef QVectorTypedData<T> Data;
23794 union {
23795 QVectorData *d;
23796 Data *p;
23797 };
23798 public:
23799 inline QVector() : d(&QVectorData::shared_null) { d->ref.ref(); }
23800 explicit QVector(int size);
23801 QVector(int size, const T &t);
23802 inline QVector(const QVector<T> &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
23803 inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(p); }
23804 QVector<T> &operator=(const QVector<T> &v);
23805 bool operator==(const QVector<T> &v) const;
23806 inline bool operator!=(const QVector<T> &v) const { return !(*this == v); }
23807 inline int size() const { return d->size; }
23808 inline bool isEmpty() const { return d->size == 0; }
23809 void resize(int size);
23810 inline int capacity() const { return d->alloc; }
23811 void reserve(int size);
23812 inline void squeeze() { realloc(d->size, d->size); d->capacity = 0; }
23813 inline void detach() { if (d->ref != 1) detach_helper(); }
23814 inline bool isDetached() const { return d->ref == 1; }
23815 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
23816 inline T *data() { detach(); return p->array; }
23817 inline const T *data() const { return p->array; }
23818 inline const T *constData() const { return p->array; }
23819 void clear();
23820 const T &at(int i) const;
23821 T &operator[](int i);
23822 const T &operator[](int i) const;
23823 void append(const T &t);
23824 void prepend(const T &t);
23825 void insert(int i, const T &t);
23826 void insert(int i, int n, const T &t);
23827 void replace(int i, const T &t);
23828 void remove(int i);
23829 void remove(int i, int n);
23830 QVector<T> &fill(const T &t, int size = -1);
23831 int indexOf(const T &t, int from = 0) const;
23832 int lastIndexOf(const T &t, int from = -1) const;
23833 bool contains(const T &t) const;
23834 int count(const T &t) const;
23835 typedef T* iterator;
23836 typedef const T* const_iterator;
23837 inline iterator begin() { detach(); return p->array; }
23838 inline const_iterator begin() const { return p->array; }
23839 inline const_iterator constBegin() const { return p->array; }
23840 inline iterator end() { detach(); return p->array + d->size; }
23841 inline const_iterator end() const { return p->array + d->size; }
23842 inline const_iterator constEnd() const { return p->array + d->size; }
23843 iterator insert(iterator before, int n, const T &x);
23844 inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
23845 iterator erase(iterator begin, iterator end);
23846 inline iterator erase(iterator pos) { return erase(pos, pos+1); }
23847 inline int count() const { return d->size; }
23848 inline T& first() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qvector.h",246) : qt_noop()); return *begin(); }
23849 inline const T &first() const { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qvector.h",247) : qt_noop()); return *begin(); }
23850 inline T& last() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qvector.h",248) : qt_noop()); return *(end()-1); }
23851 inline const T &last() const { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qvector.h",249) : qt_noop()); return *(end()-1); }
23852 inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
23853 inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
23854 QVector<T> mid(int pos, int length = -1) const;
23855 T value(int i) const;
23856 T value(int i, const T &defaultValue) const;
23857 typedef T value_type;
23858 typedef value_type* pointer;
23859 typedef const value_type* const_pointer;
23860 typedef value_type& reference;
23861 typedef const value_type& const_reference;
23862 typedef ptrdiff_t difference_type;
23863 typedef iterator Iterator;
23864 typedef const_iterator ConstIterator;
23865 typedef int size_type;
23866 inline void push_back(const T &t) { append(t); }
23867 inline void push_front(const T &t) { prepend(t); }
23868 void pop_back() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qvector.h",269) : qt_noop()); erase(end()-1); }
23869 void pop_front() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qvector.h",270) : qt_noop()); erase(begin()); }
23870 inline bool empty() const
23871 { return d->size == 0; }
23872 inline T& front() { return first(); }
23873 inline const_reference front() const { return first(); }
23874 inline reference back() { return last(); }
23875 inline const_reference back() const { return last(); }
23876 QVector<T> &operator+=(const QVector<T> &l);
23877 inline QVector<T> operator+(const QVector<T> &l) const
23878 { QVector n = *this; n += l; return n; }
23879 inline QVector<T> &operator+=(const T &t)
23880 { append(t); return *this; }
23881 inline QVector<T> &operator<< (const T &t)
23882 { append(t); return *this; }
23883 inline QVector<T> &operator<<(const QVector<T> &l)
23884 { *this += l; return *this; }
23885 QList<T> toList() const;
23886 static QVector<T> fromList(const QList<T> &list);
23887 static inline QVector<T> fromStdVector(const std::vector<T> &vector)
23888 { QVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
23889 inline std::vector<T> toStdVector() const
23890 { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
23891 private:
23892 friend class QRegion;
23893 void detach_helper();
23894 QVectorData *malloc(int alloc);
23895 void realloc(int size, int alloc);
23896 void free(Data *d);
23897 int sizeOfTypedData() {
23898 return reinterpret_cast<const char *>(&(reinterpret_cast<const Data *>(this))->array[1]) - reinterpret_cast<const char *>(this);
23899 }
23900 inline int alignOfTypedData() const
23901 {
23902 return qMax<int>(sizeof(void*), __alignof__(Data));
23903 }
23904 };
23905 template <typename T>
23906 void QVector<T>::detach_helper()
23907 { realloc(d->size, d->alloc); }
23908 template <typename T>
23909 void QVector<T>::reserve(int asize)
23910 { if (asize > d->alloc) realloc(d->size, asize); if (d->ref == 1) d->capacity = 1; }
23911 template <typename T>
23912 void QVector<T>::resize(int asize)
23913 { realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ?
23914 QVectorData::grow(sizeOfTypedData(), asize, sizeof(T), QTypeInfo<T>::isStatic)
23915 : d->alloc); }
23916 template <typename T>
23917 inline void QVector<T>::clear()
23918 { *this = QVector<T>(); }
23919 template <typename T>
23920 inline const T &QVector<T>::at(int i) const
23921 { ((!(i >= 0 && i < d->size)) ? qt_assert_x("QVector<T>::at", "index out of range","/usr/include/qt4/QtCore/qvector.h",338) : qt_noop());
23922 return p->array[i]; }
23923 template <typename T>
23924 inline const T &QVector<T>::operator[](int i) const
23925 { ((!(i >= 0 && i < d->size)) ? qt_assert_x("QVector<T>::operator[]", "index out of range","/usr/include/qt4/QtCore/qvector.h",342) : qt_noop());
23926 return p->array[i]; }
23927 template <typename T>
23928 inline T &QVector<T>::operator[](int i)
23929 { ((!(i >= 0 && i < d->size)) ? qt_assert_x("QVector<T>::operator[]", "index out of range","/usr/include/qt4/QtCore/qvector.h",346) : qt_noop());
23930 return data()[i]; }
23931 template <typename T>
23932 inline void QVector<T>::insert(int i, const T &t)
23933 { ((!(i >= 0 && i <= d->size)) ? qt_assert_x("QVector<T>::insert", "index out of range","/usr/include/qt4/QtCore/qvector.h",350) : qt_noop());
23934 insert(begin() + i, 1, t); }
23935 template <typename T>
23936 inline void QVector<T>::insert(int i, int n, const T &t)
23937 { ((!(i >= 0 && i <= d->size)) ? qt_assert_x("QVector<T>::insert", "index out of range","/usr/include/qt4/QtCore/qvector.h",354) : qt_noop());
23938 insert(begin() + i, n, t); }
23939 template <typename T>
23940 inline void QVector<T>::remove(int i, int n)
23941 { ((!(i >= 0 && n >= 0 && i + n <= d->size)) ? qt_assert_x("QVector<T>::remove", "index out of range","/usr/include/qt4/QtCore/qvector.h",358) : qt_noop());
23942 erase(begin() + i, begin() + i + n); }
23943 template <typename T>
23944 inline void QVector<T>::remove(int i)
23945 { ((!(i >= 0 && i < d->size)) ? qt_assert_x("QVector<T>::remove", "index out of range","/usr/include/qt4/QtCore/qvector.h",362) : qt_noop());
23946 erase(begin() + i, begin() + i + 1); }
23947 template <typename T>
23948 inline void QVector<T>::prepend(const T &t)
23949 { insert(begin(), 1, t); }
23950 template <typename T>
23951 inline void QVector<T>::replace(int i, const T &t)
23952 {
23953 ((!(i >= 0 && i < d->size)) ? qt_assert_x("QVector<T>::replace", "index out of range","/usr/include/qt4/QtCore/qvector.h",371) : qt_noop());
23954 const T copy(t);
23955 data()[i] = copy;
23956 }
23957 template <typename T>
23958 QVector<T> &QVector<T>::operator=(const QVector<T> &v)
23959 {
23960 v.d->ref.ref();
23961 if (!d->ref.deref())
23962 free(p);
23963 d = v.d;
23964 if (!d->sharable)
23965 detach_helper();
23966 return *this;
23967 }
23968 template <typename T>
23969 inline QVectorData *QVector<T>::malloc(int aalloc)
23970 {
23971 QVectorData *vectordata = QVectorData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData());
23972 do { if (!(vectordata)) qBadAlloc(); } while (0);
23973 return vectordata;
23974 }
23975 template <typename T>
23976 QVector<T>::QVector(int asize)
23977 {
23978 d = malloc(asize);
23979 d->ref = 1;
23980 d->alloc = d->size = asize;
23981 d->sharable = true;
23982 d->capacity = false;
23983 if (QTypeInfo<T>::isComplex) {
23984 T* b = p->array;
23985 T* i = p->array + d->size;
23986 while (i != b)
23987 new (--i) T;
23988 } else {
23989 qMemSet(p->array, 0, asize * sizeof(T));
23990 }
23991 }
23992 template <typename T>
23993 QVector<T>::QVector(int asize, const T &t)
23994 {
23995 d = malloc(asize);
23996 d->ref = 1;
23997 d->alloc = d->size = asize;
23998 d->sharable = true;
23999 d->capacity = false;
24000 T* i = p->array + d->size;
24001 while (i != p->array)
24002 new (--i) T(t);
24003 }
24004 template <typename T>
24005 void QVector<T>::free(Data *x)
24006 {
24007 if (QTypeInfo<T>::isComplex) {
24008 T* b = x->array;
24009 union { QVectorData *d; Data *p; } u;
24010 u.p = x;
24011 T* i = b + u.d->size;
24012 while (i-- != b)
24013 i->~T();
24014 }
24015 x->free(x, alignOfTypedData());
24016 }
24017 template <typename T>
24018 void QVector<T>::realloc(int asize, int aalloc)
24019 {
24020 ((!(asize <= aalloc)) ? qt_assert("asize <= aalloc","/usr/include/qt4/QtCore/qvector.h",444) : qt_noop());
24021 T *pOld;
24022 T *pNew;
24023 union { QVectorData *d; Data *p; } x;
24024 x.d = d;
24025 if (QTypeInfo<T>::isComplex && asize < d->size && d->ref == 1 ) {
24026 pOld = p->array + d->size;
24027 pNew = p->array + asize;
24028 while (asize < d->size) {
24029 (--pOld)->~T();
24030 d->size--;
24031 }
24032 }
24033 if (aalloc != d->alloc || d->ref != 1) {
24034 if (QTypeInfo<T>::isStatic) {
24035 x.d = malloc(aalloc);
24036 do { if (!(x.p)) qBadAlloc(); } while (0);
24037 x.d->size = 0;
24038 } else if (d->ref != 1) {
24039 x.d = malloc(aalloc);
24040 do { if (!(x.p)) qBadAlloc(); } while (0);
24041 if (QTypeInfo<T>::isComplex) {
24042 x.d->size = 0;
24043 } else {
24044 ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, d->alloc) - 1) * sizeof(T));
24045 x.d->size = d->size;
24046 }
24047 } else {
24048 try {
24049 QVectorData *mem = QVectorData::reallocate(d, sizeOfTypedData() + (aalloc - 1) * sizeof(T),
24050 sizeOfTypedData() + (d->alloc - 1) * sizeof(T), alignOfTypedData());
24051 do { if (!(mem)) qBadAlloc(); } while (0);
24052 x.d = d = mem;
24053 x.d->size = d->size;
24054 } catch (const std::bad_alloc &) {
24055 if (aalloc > d->alloc)
24056 throw;
24057 }
24058 }
24059 x.d->ref = 1;
24060 x.d->alloc = aalloc;
24061 x.d->sharable = true;
24062 x.d->capacity = d->capacity;
24063 x.d->reserved = 0;
24064 }
24065 if (QTypeInfo<T>::isComplex) {
24066 try {
24067 pOld = p->array + x.d->size;
24068 pNew = x.p->array + x.d->size;
24069 const int toMove = qMin(asize, d->size);
24070 while (x.d->size < toMove) {
24071 new (pNew++) T(*pOld++);
24072 x.d->size++;
24073 }
24074 while (x.d->size < asize) {
24075 new (pNew++) T;
24076 x.d->size++;
24077 }
24078 } catch (...) {
24079 free(x.p);
24080 throw;
24081 }
24082 } else if (asize > x.d->size) {
24083 qMemSet(x.p->array + x.d->size, 0, (asize - x.d->size) * sizeof(T));
24084 }
24085 x.d->size = asize;
24086 if (d != x.d) {
24087 if (!d->ref.deref())
24088 free(p);
24089 d = x.d;
24090 }
24091 }
24092 template<typename T>
24093 T QVector<T>::value(int i) const
24094 {
24095 if (i < 0 || i >= d->size) {
24096 return T();
24097 }
24098 return p->array[i];
24099 }
24100 template<typename T>
24101 T QVector<T>::value(int i, const T &defaultValue) const
24102 {
24103 return ((i < 0 || i >= d->size) ? defaultValue : p->array[i]);
24104 }
24105 template <typename T>
24106 void QVector<T>::append(const T &t)
24107 {
24108 if (d->ref != 1 || d->size + 1 > d->alloc) {
24109 const T copy(t);
24110 realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + 1, sizeof(T),
24111 QTypeInfo<T>::isStatic));
24112 if (QTypeInfo<T>::isComplex)
24113 new (p->array + d->size) T(copy);
24114 else
24115 p->array[d->size] = copy;
24116 } else {
24117 if (QTypeInfo<T>::isComplex)
24118 new (p->array + d->size) T(t);
24119 else
24120 p->array[d->size] = t;
24121 }
24122 ++d->size;
24123 }
24124 template <typename T>
24125 typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
24126 {
24127 int offset = int(before - p->array);
24128 if (n != 0) {
24129 const T copy(t);
24130 if (d->ref != 1 || d->size + n > d->alloc)
24131 realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + n, sizeof(T),
24132 QTypeInfo<T>::isStatic));
24133 if (QTypeInfo<T>::isStatic) {
24134 T *b = p->array + d->size;
24135 T *i = p->array + d->size + n;
24136 while (i != b)
24137 new (--i) T;
24138 i = p->array + d->size;
24139 T *j = i + n;
24140 b = p->array + offset;
24141 while (i != b)
24142 *--j = *--i;
24143 i = b+n;
24144 while (i != b)
24145 *--i = copy;
24146 } else {
24147 T *b = p->array + offset;
24148 T *i = b + n;
24149 memmove(i, b, (d->size - offset) * sizeof(T));
24150 while (i != b)
24151 new (--i) T(copy);
24152 }
24153 d->size += n;
24154 }
24155 return p->array + offset;
24156 }
24157 template <typename T>
24158 typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
24159 {
24160 int f = int(abegin - p->array);
24161 int l = int(aend - p->array);
24162 int n = l - f;
24163 detach();
24164 if (QTypeInfo<T>::isComplex) {
24165 qCopy(p->array+l, p->array+d->size, p->array+f);
24166 T *i = p->array+d->size;
24167 T* b = p->array+d->size-n;
24168 while (i != b) {
24169 --i;
24170 i->~T();
24171 }
24172 } else {
24173 memmove(p->array + f, p->array + l, (d->size-l)*sizeof(T));
24174 }
24175 d->size -= n;
24176 return p->array + f;
24177 }
24178 template <typename T>
24179 bool QVector<T>::operator==(const QVector<T> &v) const
24180 {
24181 if (d->size != v.d->size)
24182 return false;
24183 if (d == v.d)
24184 return true;
24185 T* b = p->array;
24186 T* i = b + d->size;
24187 T* j = v.p->array + d->size;
24188 while (i != b)
24189 if (!(*--i == *--j))
24190 return false;
24191 return true;
24192 }
24193 template <typename T>
24194 QVector<T> &QVector<T>::fill(const T &from, int asize)
24195 {
24196 const T copy(from);
24197 resize(asize < 0 ? d->size : asize);
24198 if (d->size) {
24199 T *i = p->array + d->size;
24200 T *b = p->array;
24201 while (i != b)
24202 *--i = copy;
24203 }
24204 return *this;
24205 }
24206 template <typename T>
24207 QVector<T> &QVector<T>::operator+=(const QVector &l)
24208 {
24209 int newSize = d->size + l.d->size;
24210 realloc(d->size, newSize);
24211 T *w = p->array + newSize;
24212 T *i = l.p->array + l.d->size;
24213 T *b = l.p->array;
24214 while (i != b) {
24215 if (QTypeInfo<T>::isComplex)
24216 new (--w) T(*--i);
24217 else
24218 *--w = *--i;
24219 }
24220 d->size = newSize;
24221 return *this;
24222 }
24223 template <typename T>
24224 int QVector<T>::indexOf(const T &t, int from) const
24225 {
24226 if (from < 0)
24227 from = qMax(from + d->size, 0);
24228 if (from < d->size) {
24229 T* n = p->array + from - 1;
24230 T* e = p->array + d->size;
24231 while (++n != e)
24232 if (*n == t)
24233 return n - p->array;
24234 }
24235 return -1;
24236 }
24237 template <typename T>
24238 int QVector<T>::lastIndexOf(const T &t, int from) const
24239 {
24240 if (from < 0)
24241 from += d->size;
24242 else if (from >= d->size)
24243 from = d->size-1;
24244 if (from >= 0) {
24245 T* b = p->array;
24246 T* n = p->array + from + 1;
24247 while (n != b) {
24248 if (*--n == t)
24249 return n - b;
24250 }
24251 }
24252 return -1;
24253 }
24254 template <typename T>
24255 bool QVector<T>::contains(const T &t) const
24256 {
24257 T* b = p->array;
24258 T* i = p->array + d->size;
24259 while (i != b)
24260 if (*--i == t)
24261 return true;
24262 return false;
24263 }
24264 template <typename T>
24265 int QVector<T>::count(const T &t) const
24266 {
24267 int c = 0;
24268 T* b = p->array;
24269 T* i = p->array + d->size;
24270 while (i != b)
24271 if (*--i == t)
24272 ++c;
24273 return c;
24274 }
24275 template <typename T>
24276 QVector<T> QVector<T>::mid(int pos, int length) const
24277 {
24278 if (length < 0)
24279 length = size() - pos;
24280 if (pos == 0 && length == size())
24281 return *this;
24282 QVector<T> copy;
24283 if (pos + length > size())
24284 length = size() - pos;
24285 for (int i = pos; i < pos + length; ++i)
24286 copy += at(i);
24287 return copy;
24288 }
24289 template <typename T>
24290 QList<T> QVector<T>::toList() const
24291 {
24292 QList<T> result;
24293 for (int i = 0; i < size(); ++i)
24294 result.append(at(i));
24295 return result;
24296 }
24297 template <typename T>
24298 QVector<T> QList<T>::toVector() const
24299 {
24300 QVector<T> result(size());
24301 for (int i = 0; i < size(); ++i)
24302 result[i] = at(i);
24303 return result;
24304 }
24305 template <typename T>
24306 QVector<T> QVector<T>::fromList(const QList<T> &list)
24307 {
24308 return list.toVector();
24309 }
24310 template <typename T>
24311 QList<T> QList<T>::fromVector(const QVector<T> &vector)
24312 {
24313 return vector.toList();
24314 }
24315 template <class T> class QVectorIterator { typedef typename QVector<T>::const_iterator const_iterator; QVector<T> c; const_iterator i; public: inline QVectorIterator(const QVector<T> &container) : c(container), i(c.constBegin()) {} inline QVectorIterator &operator=(const QVector<T> &container) { c = container; i = c.constBegin(); return *this; } inline void toFront() { i = c.constBegin(); } inline void toBack() { i = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline const T &next() { return *i++; } inline const T &peekNext() const { return *i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline const T &previous() { return *--i; } inline const T &peekPrevious() const { const_iterator p = i; return *--p; } inline bool findNext(const T &t) { while (i != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(--i) == t) return true; return false; } };
24316 template <class T> class QMutableVectorIterator { typedef typename QVector<T>::iterator iterator; typedef typename QVector<T>::const_iterator const_iterator; QVector<T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableVectorIterator(QVector<T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableVectorIterator() { c->setSharable(true); } inline QMutableVectorIterator &operator=(QVector<T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = i; } inline bool hasNext() const { return c->constEnd() != const_iterator(i); } inline T &next() { n = i++; return *n; } inline T &peekNext() const { return *i; } inline bool hasPrevious() const { return c->constBegin() != const_iterator(i); } inline T &previous() { n = --i; return *n; } inline T &peekPrevious() const { iterator p = i; return *--p; } inline void remove() { if (c->constEnd() != const_iterator(n)) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) const { if (c->constEnd() != const_iterator(n)) *n = t; } inline T &value() { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qvector.h",769) : qt_noop()); return *n; } inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qvector.h",769) : qt_noop()); return *n; } inline void insert(const T &t) { n = i = c->insert(i, t); ++i; } inline bool findNext(const T &t) { while (c->constEnd() != const_iterator(n = i)) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (c->constBegin() != const_iterator(i)) if (*(n = --i) == t) return true; n = c->end(); return false; } };
24317 typedef QtValidLicenseForGuiModule QtGuiModule;
24318 class QMatrix;
24319 class QTransform;
24320 class QRect;
24321 class QVariant;
24322 class QPolygon : public QVector<QPoint>
24323 {
24324 public:
24325 inline QPolygon() {}
24326 inline ~QPolygon() {}
24327 inline QPolygon(int size);
24328 inline QPolygon(const QPolygon &a) : QVector<QPoint>(a) {}
24329 inline QPolygon(const QVector<QPoint> &v) : QVector<QPoint>(v) {}
24330 QPolygon(const QRect &r, bool closed=false);
24331 QPolygon(int nPoints, const int *points);
24332 operator QVariant() const;
24333 void translate(int dx, int dy);
24334 void translate(const QPoint &offset);
24335 QPolygon translated(int dx, int dy) const;
24336 inline QPolygon translated(const QPoint &offset) const;
24337 QRect boundingRect() const;
24338 void point(int i, int *x, int *y) const;
24339 QPoint point(int i) const;
24340 void setPoint(int index, int x, int y);
24341 void setPoint(int index, const QPoint &p);
24342 void setPoints(int nPoints, const int *points);
24343 void setPoints(int nPoints, int firstx, int firsty, ...);
24344 void putPoints(int index, int nPoints, const int *points);
24345 void putPoints(int index, int nPoints, int firstx, int firsty, ...);
24346 void putPoints(int index, int nPoints, const QPolygon & from, int fromIndex=0);
24347 bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
24348 QPolygon united(const QPolygon &r) const;
24349 QPolygon intersected(const QPolygon &r) const;
24350 QPolygon subtracted(const QPolygon &r) const;
24351 };
24352 inline QPolygon::QPolygon(int asize) : QVector<QPoint>(asize) {}
24353 QDebug operator<<(QDebug, const QPolygon &);
24354 QDataStream &operator<<(QDataStream &stream, const QPolygon &polygon);
24355 QDataStream &operator>>(QDataStream &stream, QPolygon &polygon);
24356 inline void QPolygon::setPoint(int index, const QPoint &pt)
24357 { (*this)[index] = pt; }
24358 inline void QPolygon::setPoint(int index, int x, int y)
24359 { (*this)[index] = QPoint(x, y); }
24360 inline QPoint QPolygon::point(int index) const
24361 { return at(index); }
24362 inline void QPolygon::translate(const QPoint &offset)
24363 { translate(offset.x(), offset.y()); }
24364 inline QPolygon QPolygon::translated(const QPoint &offset) const
24365 { return translated(offset.x(), offset.y()); }
24366 class QRectF;
24367 class QPolygonF : public QVector<QPointF>
24368 {
24369 public:
24370 inline QPolygonF() {}
24371 inline ~QPolygonF() {}
24372 inline QPolygonF(int size);
24373 inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
24374 inline QPolygonF(const QVector<QPointF> &v) : QVector<QPointF>(v) {}
24375 QPolygonF(const QRectF &r);
24376 QPolygonF(const QPolygon &a);
24377 inline void translate(qreal dx, qreal dy);
24378 void translate(const QPointF &offset);
24379 inline QPolygonF translated(qreal dx, qreal dy) const;
24380 QPolygonF translated(const QPointF &offset) const;
24381 QPolygon toPolygon() const;
24382 bool isClosed() const { return !isEmpty() && first() == last(); }
24383 QRectF boundingRect() const;
24384 bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
24385 QPolygonF united(const QPolygonF &r) const;
24386 QPolygonF intersected(const QPolygonF &r) const;
24387 QPolygonF subtracted(const QPolygonF &r) const;
24388 };
24389 inline QPolygonF::QPolygonF(int asize) : QVector<QPointF>(asize) {}
24390 QDebug operator<<(QDebug, const QPolygonF &);
24391 QDataStream &operator<<(QDataStream &stream, const QPolygonF &array);
24392 QDataStream &operator>>(QDataStream &stream, QPolygonF &array);
24393 inline void QPolygonF::translate(qreal dx, qreal dy)
24394 { translate(QPointF(dx, dy)); }
24395 inline QPolygonF QPolygonF::translated(qreal dx, qreal dy) const
24396 { return translated(QPointF(dx, dy)); }
24397 typedef QtValidLicenseForGuiModule QtGuiModule;
24398 template <class T> class QVector;
24399 class QVariant;
24400 struct QRegionPrivate;
24401 class QBitmap;
24402 class QRegion
24403 {
24404 public:
24405 enum RegionType { Rectangle, Ellipse };
24406 QRegion();
24407 QRegion(int x, int y, int w, int h, RegionType t = Rectangle);
24408 QRegion(const QRect &r, RegionType t = Rectangle);
24409 QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill);
24410 QRegion(const QRegion &region);
24411 QRegion(const QBitmap &bitmap);
24412 ~QRegion();
24413 QRegion &operator=(const QRegion &);
24414 bool isEmpty() const;
24415 bool contains(const QPoint &p) const;
24416 bool contains(const QRect &r) const;
24417 void translate(int dx, int dy);
24418 inline void translate(const QPoint &p) { translate(p.x(), p.y()); }
24419 QRegion translated(int dx, int dy) const;
24420 inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
24421 QRegion unite(const QRegion &r) const;
24422 QRegion unite(const QRect &r) const;
24423 QRegion intersect(const QRegion &r) const;
24424 QRegion intersect(const QRect &r) const;
24425 QRegion subtract(const QRegion &r) const;
24426 QRegion eor(const QRegion &r) const;
24427 inline QRegion united(const QRegion &r) const { return unite(r); }
24428 inline QRegion united(const QRect &r) const { return unite(r); }
24429 inline QRegion intersected(const QRegion &r) const { return intersect(r); }
24430 inline QRegion intersected(const QRect &r) const { return intersect(r); }
24431 inline QRegion subtracted(const QRegion &r) const { return subtract(r); }
24432 inline QRegion xored(const QRegion &r) const { return eor(r); }
24433 bool intersects(const QRegion &r) const;
24434 bool intersects(const QRect &r) const;
24435 QRect boundingRect() const;
24436 QVector<QRect> rects() const;
24437 void setRects(const QRect *rect, int num);
24438 int numRects() const;
24439 int rectCount() const;
24440 const QRegion operator|(const QRegion &r) const;
24441 const QRegion operator+(const QRegion &r) const;
24442 const QRegion operator+(const QRect &r) const;
24443 const QRegion operator&(const QRegion &r) const;
24444 const QRegion operator&(const QRect &r) const;
24445 const QRegion operator-(const QRegion &r) const;
24446 const QRegion operator^(const QRegion &r) const;
24447 QRegion& operator|=(const QRegion &r);
24448 QRegion& operator+=(const QRegion &r);
24449 QRegion& operator+=(const QRect &r);
24450 QRegion& operator&=(const QRegion &r);
24451 QRegion& operator&=(const QRect &r);
24452 QRegion& operator-=(const QRegion &r);
24453 QRegion& operator^=(const QRegion &r);
24454 bool operator==(const QRegion &r) const;
24455 inline bool operator!=(const QRegion &r) const { return !(operator==(r)); }
24456 operator QVariant() const;
24457 inline Region handle() const { if(!d->rgn) updateX11Region(); return d->rgn; }
24458 friend QDataStream &operator<<(QDataStream &, const QRegion &);
24459 friend QDataStream &operator>>(QDataStream &, QRegion &);
24460 private:
24461 QRegion copy() const;
24462 void detach();
24463 void updateX11Region() const;
24464 void *clipRectangles(int &num) const;
24465 friend void *qt_getClipRects(const QRegion &r, int &num);
24466 friend bool qt_region_strictContains(const QRegion &region,
24467 const QRect &rect);
24468 friend struct QRegionPrivate;
24469 void exec(const QByteArray &ba, int ver = 0, QDataStream::ByteOrder byteOrder = QDataStream::BigEndian);
24470 struct QRegionData {
24471 QBasicAtomicInt ref;
24472 Region rgn;
24473 void *xrectangles;
24474 QRegionPrivate *qt_rgn;
24475 };
24476 struct QRegionData *d;
24477 static struct QRegionData shared_empty;
24478 static void cleanUp(QRegionData *x);
24479 };
24480 QDataStream &operator<<(QDataStream &, const QRegion &);
24481 QDataStream &operator>>(QDataStream &, QRegion &);
24482 QDebug operator<<(QDebug, const QRegion &);
24483 typedef QtValidLicenseForCoreModule QtCoreModule;
24484 class QLine
24485 {
24486 public:
24487 inline QLine();
24488 inline QLine(const QPoint &pt1, const QPoint &pt2);
24489 inline QLine(int x1, int y1, int x2, int y2);
24490 inline bool isNull() const;
24491 inline QPoint p1() const;
24492 inline QPoint p2() const;
24493 inline int x1() const;
24494 inline int y1() const;
24495 inline int x2() const;
24496 inline int y2() const;
24497 inline int dx() const;
24498 inline int dy() const;
24499 inline void translate(const QPoint &p);
24500 inline void translate(int dx, int dy);
24501 inline QLine translated(const QPoint &p) const;
24502 inline QLine translated(int dx, int dy) const;
24503 inline void setP1(const QPoint &p1);
24504 inline void setP2(const QPoint &p2);
24505 inline void setPoints(const QPoint &p1, const QPoint &p2);
24506 inline void setLine(int x1, int y1, int x2, int y2);
24507 inline bool operator==(const QLine &d) const;
24508 inline bool operator!=(const QLine &d) const { return !(*this == d); }
24509 private:
24510 QPoint pt1, pt2;
24511 };
24512 template <> class QTypeInfo<QLine > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QLine)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QLine"; } };
24513 inline QLine::QLine() { }
24514 inline QLine::QLine(const QPoint &pt1_, const QPoint &pt2_) : pt1(pt1_), pt2(pt2_) { }
24515 inline QLine::QLine(int x1pos, int y1pos, int x2pos, int y2pos) : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }
24516 inline bool QLine::isNull() const
24517 {
24518 return pt1 == pt2;
24519 }
24520 inline int QLine::x1() const
24521 {
24522 return pt1.x();
24523 }
24524 inline int QLine::y1() const
24525 {
24526 return pt1.y();
24527 }
24528 inline int QLine::x2() const
24529 {
24530 return pt2.x();
24531 }
24532 inline int QLine::y2() const
24533 {
24534 return pt2.y();
24535 }
24536 inline QPoint QLine::p1() const
24537 {
24538 return pt1;
24539 }
24540 inline QPoint QLine::p2() const
24541 {
24542 return pt2;
24543 }
24544 inline int QLine::dx() const
24545 {
24546 return pt2.x() - pt1.x();
24547 }
24548 inline int QLine::dy() const
24549 {
24550 return pt2.y() - pt1.y();
24551 }
24552 inline void QLine::translate(const QPoint &point)
24553 {
24554 pt1 += point;
24555 pt2 += point;
24556 }
24557 inline void QLine::translate(int adx, int ady)
24558 {
24559 this->translate(QPoint(adx, ady));
24560 }
24561 inline QLine QLine::translated(const QPoint &p) const
24562 {
24563 return QLine(pt1 + p, pt2 + p);
24564 }
24565 inline QLine QLine::translated(int adx, int ady) const
24566 {
24567 return translated(QPoint(adx, ady));
24568 }
24569 inline void QLine::setP1(const QPoint &aP1)
24570 {
24571 pt1 = aP1;
24572 }
24573 inline void QLine::setP2(const QPoint &aP2)
24574 {
24575 pt2 = aP2;
24576 }
24577 inline void QLine::setPoints(const QPoint &aP1, const QPoint &aP2)
24578 {
24579 pt1 = aP1;
24580 pt2 = aP2;
24581 }
24582 inline void QLine::setLine(int aX1, int aY1, int aX2, int aY2)
24583 {
24584 pt1 = QPoint(aX1, aY1);
24585 pt2 = QPoint(aX2, aY2);
24586 }
24587 inline bool QLine::operator==(const QLine &d) const
24588 {
24589 return pt1 == d.pt1 && pt2 == d.pt2;
24590 }
24591 QDebug operator<<(QDebug d, const QLine &p);
24592 QDataStream &operator<<(QDataStream &, const QLine &);
24593 QDataStream &operator>>(QDataStream &, QLine &);
24594 class QLineF {
24595 public:
24596 enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
24597 inline QLineF();
24598 inline QLineF(const QPointF &pt1, const QPointF &pt2);
24599 inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
24600 inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
24601 static QLineF fromPolar(qreal length, qreal angle);
24602 bool isNull() const;
24603 inline QPointF p1() const;
24604 inline QPointF p2() const;
24605 inline qreal x1() const;
24606 inline qreal y1() const;
24607 inline qreal x2() const;
24608 inline qreal y2() const;
24609 inline qreal dx() const;
24610 inline qreal dy() const;
24611 qreal length() const;
24612 void setLength(qreal len);
24613 qreal angle() const;
24614 void setAngle(qreal angle);
24615 qreal angleTo(const QLineF &l) const;
24616 QLineF unitVector() const;
24617 QLineF normalVector() const;
24618 IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
24619 qreal angle(const QLineF &l) const;
24620 QPointF pointAt(qreal t) const;
24621 inline void translate(const QPointF &p);
24622 inline void translate(qreal dx, qreal dy);
24623 inline QLineF translated(const QPointF &p) const;
24624 inline QLineF translated(qreal dx, qreal dy) const;
24625 inline void setP1(const QPointF &p1);
24626 inline void setP2(const QPointF &p2);
24627 inline void setPoints(const QPointF &p1, const QPointF &p2);
24628 inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
24629 inline bool operator==(const QLineF &d) const;
24630 inline bool operator!=(const QLineF &d) const { return !(*this == d); }
24631 QLine toLine() const;
24632 private:
24633 QPointF pt1, pt2;
24634 };
24635 template <> class QTypeInfo<QLineF > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QLineF)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QLineF"; } };
24636 inline QLineF::QLineF()
24637 {
24638 }
24639 inline QLineF::QLineF(const QPointF &apt1, const QPointF &apt2)
24640 : pt1(apt1), pt2(apt2)
24641 {
24642 }
24643 inline QLineF::QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos)
24644 : pt1(x1pos, y1pos), pt2(x2pos, y2pos)
24645 {
24646 }
24647 inline qreal QLineF::x1() const
24648 {
24649 return pt1.x();
24650 }
24651 inline qreal QLineF::y1() const
24652 {
24653 return pt1.y();
24654 }
24655 inline qreal QLineF::x2() const
24656 {
24657 return pt2.x();
24658 }
24659 inline qreal QLineF::y2() const
24660 {
24661 return pt2.y();
24662 }
24663 inline QPointF QLineF::p1() const
24664 {
24665 return pt1;
24666 }
24667 inline QPointF QLineF::p2() const
24668 {
24669 return pt2;
24670 }
24671 inline qreal QLineF::dx() const
24672 {
24673 return pt2.x() - pt1.x();
24674 }
24675 inline qreal QLineF::dy() const
24676 {
24677 return pt2.y() - pt1.y();
24678 }
24679 inline QLineF QLineF::normalVector() const
24680 {
24681 return QLineF(p1(), p1() + QPointF(dy(), -dx()));
24682 }
24683 inline void QLineF::translate(const QPointF &point)
24684 {
24685 pt1 += point;
24686 pt2 += point;
24687 }
24688 inline void QLineF::translate(qreal adx, qreal ady)
24689 {
24690 this->translate(QPointF(adx, ady));
24691 }
24692 inline QLineF QLineF::translated(const QPointF &p) const
24693 {
24694 return QLineF(pt1 + p, pt2 + p);
24695 }
24696 inline QLineF QLineF::translated(qreal adx, qreal ady) const
24697 {
24698 return translated(QPointF(adx, ady));
24699 }
24700 inline void QLineF::setLength(qreal len)
24701 {
24702 if (isNull())
24703 return;
24704 QLineF v = unitVector();
24705 pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
24706 }
24707 inline QPointF QLineF::pointAt(qreal t) const
24708 {
24709 qreal vx = pt2.x() - pt1.x();
24710 qreal vy = pt2.y() - pt1.y();
24711 return QPointF(pt1.x() + vx * t, pt1.y() + vy * t);
24712 }
24713 inline QLine QLineF::toLine() const
24714 {
24715 return QLine(pt1.toPoint(), pt2.toPoint());
24716 }
24717 inline void QLineF::setP1(const QPointF &aP1)
24718 {
24719 pt1 = aP1;
24720 }
24721 inline void QLineF::setP2(const QPointF &aP2)
24722 {
24723 pt2 = aP2;
24724 }
24725 inline void QLineF::setPoints(const QPointF &aP1, const QPointF &aP2)
24726 {
24727 pt1 = aP1;
24728 pt2 = aP2;
24729 }
24730 inline void QLineF::setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2)
24731 {
24732 pt1 = QPointF(aX1, aY1);
24733 pt2 = QPointF(aX2, aY2);
24734 }
24735 inline bool QLineF::operator==(const QLineF &d) const
24736 {
24737 return pt1 == d.pt1 && pt2 == d.pt2;
24738 }
24739 QDebug operator<<(QDebug d, const QLineF &p);
24740 QDataStream &operator<<(QDataStream &, const QLineF &);
24741 QDataStream &operator>>(QDataStream &, QLineF &);
24742 typedef QtValidLicenseForGuiModule QtGuiModule;
24743 class QPainterPath;
24744 class QVariant;
24745 class QMatrix
24746 {
24747 public:
24748 inline explicit QMatrix(Qt::Initialization) {}
24749 QMatrix();
24750 QMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
24751 qreal dx, qreal dy);
24752 QMatrix(const QMatrix &matrix);
24753 void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
24754 qreal dx, qreal dy);
24755 qreal m11() const { return _m11; }
24756 qreal m12() const { return _m12; }
24757 qreal m21() const { return _m21; }
24758 qreal m22() const { return _m22; }
24759 qreal dx() const { return _dx; }
24760 qreal dy() const { return _dy; }
24761 void map(int x, int y, int *tx, int *ty) const;
24762 void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
24763 QRect mapRect(const QRect &) const;
24764 QRectF mapRect(const QRectF &) const;
24765 QPoint map(const QPoint &p) const;
24766 QPointF map(const QPointF&p) const;
24767 QLine map(const QLine &l) const;
24768 QLineF map(const QLineF &l) const;
24769 QPolygonF map(const QPolygonF &a) const;
24770 QPolygon map(const QPolygon &a) const;
24771 QRegion map(const QRegion &r) const;
24772 QPainterPath map(const QPainterPath &p) const;
24773 QPolygon mapToPolygon(const QRect &r) const;
24774 void reset();
24775 inline bool isIdentity() const;
24776 QMatrix &translate(qreal dx, qreal dy);
24777 QMatrix &scale(qreal sx, qreal sy);
24778 QMatrix &shear(qreal sh, qreal sv);
24779 QMatrix &rotate(qreal a);
24780 bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); }
24781 qreal determinant() const { return _m11*_m22 - _m12*_m21; }
24782 qreal det() const { return _m11*_m22 - _m12*_m21; }
24783 QMatrix inverted(bool *invertible = 0) const;
24784 bool operator==(const QMatrix &) const;
24785 bool operator!=(const QMatrix &) const;
24786 QMatrix &operator*=(const QMatrix &);
24787 QMatrix operator*(const QMatrix &o) const;
24788 QMatrix &operator=(const QMatrix &);
24789 operator QVariant() const;
24790 private:
24791 inline QMatrix(bool)
24792 : _m11(1.)
24793 , _m12(0.)
24794 , _m21(0.)
24795 , _m22(1.)
24796 , _dx(0.)
24797 , _dy(0.) {}
24798 inline QMatrix(qreal am11, qreal am12, qreal am21, qreal am22, qreal adx, qreal ady, bool)
24799 : _m11(am11)
24800 , _m12(am12)
24801 , _m21(am21)
24802 , _m22(am22)
24803 , _dx(adx)
24804 , _dy(ady) {}
24805 friend class QTransform;
24806 qreal _m11, _m12;
24807 qreal _m21, _m22;
24808 qreal _dx, _dy;
24809 };
24810 template <> class QTypeInfo<QMatrix > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QMatrix)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QMatrix"; } };
24811 inline QPoint operator*(const QPoint &p, const QMatrix &m)
24812 { return m.map(p); }
24813 inline QPointF operator*(const QPointF &p, const QMatrix &m)
24814 { return m.map(p); }
24815 inline QLineF operator*(const QLineF &l, const QMatrix &m)
24816 { return m.map(l); }
24817 inline QLine operator*(const QLine &l, const QMatrix &m)
24818 { return m.map(l); }
24819 inline QPolygon operator *(const QPolygon &a, const QMatrix &m)
24820 { return m.map(a); }
24821 inline QPolygonF operator *(const QPolygonF &a, const QMatrix &m)
24822 { return m.map(a); }
24823 inline QRegion operator *(const QRegion &r, const QMatrix &m)
24824 { return m.map(r); }
24825 QPainterPath operator *(const QPainterPath &p, const QMatrix &m);
24826 inline bool QMatrix::isIdentity() const
24827 {
24828 return qFuzzyIsNull(_m11 - 1) && qFuzzyIsNull(_m22 - 1) && qFuzzyIsNull(_m12)
24829 && qFuzzyIsNull(_m21) && qFuzzyIsNull(_dx) && qFuzzyIsNull(_dy);
24830 }
24831 inline bool qFuzzyCompare(const QMatrix& m1, const QMatrix& m2)
24832 {
24833 return qFuzzyCompare(m1.m11(), m2.m11())
24834 && qFuzzyCompare(m1.m12(), m2.m12())
24835 && qFuzzyCompare(m1.m21(), m2.m21())
24836 && qFuzzyCompare(m1.m22(), m2.m22())
24837 && qFuzzyCompare(m1.dx(), m2.dx())
24838 && qFuzzyCompare(m1.dy(), m2.dy());
24839 }
24840 QDataStream &operator<<(QDataStream &, const QMatrix &);
24841 QDataStream &operator>>(QDataStream &, QMatrix &);
24842 QDebug operator<<(QDebug, const QMatrix &);
24843 typedef QtValidLicenseForGuiModule QtGuiModule;
24844 class QFont;
24845 class QPainterPathPrivate;
24846 struct QPainterPathPrivateDeleter;
24847 class QPainterPathData;
24848 class QPainterPathStrokerPrivate;
24849 class QPolygonF;
24850 class QRegion;
24851 class QVectorPath;
24852 class QPainterPath
24853 {
24854 public:
24855 enum ElementType {
24856 MoveToElement,
24857 LineToElement,
24858 CurveToElement,
24859 CurveToDataElement
24860 };
24861 class Element {
24862 public:
24863 qreal x;
24864 qreal y;
24865 ElementType type;
24866 bool isMoveTo() const { return type == MoveToElement; }
24867 bool isLineTo() const { return type == LineToElement; }
24868 bool isCurveTo() const { return type == CurveToElement; }
24869 operator QPointF () const { return QPointF(x, y); }
24870 bool operator==(const Element &e) const { return qFuzzyCompare(x, e.x)
24871 && qFuzzyCompare(y, e.y) && type == e.type; }
24872 inline bool operator!=(const Element &e) const { return !operator==(e); }
24873 };
24874 QPainterPath();
24875 explicit QPainterPath(const QPointF &startPoint);
24876 QPainterPath(const QPainterPath &other);
24877 QPainterPath &operator=(const QPainterPath &other);
24878 ~QPainterPath();
24879 void closeSubpath();
24880 void moveTo(const QPointF &p);
24881 inline void moveTo(qreal x, qreal y);
24882 void lineTo(const QPointF &p);
24883 inline void lineTo(qreal x, qreal y);
24884 void arcMoveTo(const QRectF &rect, qreal angle);
24885 inline void arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle);
24886 void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength);
24887 inline void arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength);
24888 void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt);
24889 inline void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y,
24890 qreal endPtx, qreal endPty);
24891 void quadTo(const QPointF &ctrlPt, const QPointF &endPt);
24892 inline void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty);
24893 QPointF currentPosition() const;
24894 void addRect(const QRectF &rect);
24895 inline void addRect(qreal x, qreal y, qreal w, qreal h);
24896 void addEllipse(const QRectF &rect);
24897 inline void addEllipse(qreal x, qreal y, qreal w, qreal h);
24898 inline void addEllipse(const QPointF &center, qreal rx, qreal ry);
24899 void addPolygon(const QPolygonF &polygon);
24900 void addText(const QPointF &point, const QFont &f, const QString &text);
24901 inline void addText(qreal x, qreal y, const QFont &f, const QString &text);
24902 void addPath(const QPainterPath &path);
24903 void addRegion(const QRegion &region);
24904 void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,
24905 Qt::SizeMode mode = Qt::AbsoluteSize);
24906 inline void addRoundedRect(qreal x, qreal y, qreal w, qreal h,
24907 qreal xRadius, qreal yRadius,
24908 Qt::SizeMode mode = Qt::AbsoluteSize);
24909 void addRoundRect(const QRectF &rect, int xRnd, int yRnd);
24910 inline void addRoundRect(qreal x, qreal y, qreal w, qreal h,
24911 int xRnd, int yRnd);
24912 inline void addRoundRect(const QRectF &rect, int roundness);
24913 inline void addRoundRect(qreal x, qreal y, qreal w, qreal h,
24914 int roundness);
24915 void connectPath(const QPainterPath &path);
24916 bool contains(const QPointF &pt) const;
24917 bool contains(const QRectF &rect) const;
24918 bool intersects(const QRectF &rect) const;
24919 void translate(qreal dx, qreal dy);
24920 inline void translate(const QPointF &offset);
24921 QPainterPath translated(qreal dx, qreal dy) const;
24922 inline QPainterPath translated(const QPointF &offset) const;
24923 QRectF boundingRect() const;
24924 QRectF controlPointRect() const;
24925 Qt::FillRule fillRule() const;
24926 void setFillRule(Qt::FillRule fillRule);
24927 inline bool isEmpty() const;
24928 QPainterPath toReversed() const;
24929 QList<QPolygonF> toSubpathPolygons(const QMatrix &matrix = QMatrix()) const;
24930 QList<QPolygonF> toFillPolygons(const QMatrix &matrix = QMatrix()) const;
24931 QPolygonF toFillPolygon(const QMatrix &matrix = QMatrix()) const;
24932 QList<QPolygonF> toSubpathPolygons(const QTransform &matrix) const;
24933 QList<QPolygonF> toFillPolygons(const QTransform &matrix) const;
24934 QPolygonF toFillPolygon(const QTransform &matrix) const;
24935 inline int elementCount() const;
24936 inline const QPainterPath::Element &elementAt(int i) const;
24937 inline void setElementPositionAt(int i, qreal x, qreal y);
24938 qreal length() const;
24939 qreal percentAtLength(qreal t) const;
24940 QPointF pointAtPercent(qreal t) const;
24941 qreal angleAtPercent(qreal t) const;
24942 qreal slopeAtPercent(qreal t) const;
24943 bool intersects(const QPainterPath &p) const;
24944 bool contains(const QPainterPath &p) const;
24945 QPainterPath united(const QPainterPath &r) const;
24946 QPainterPath intersected(const QPainterPath &r) const;
24947 QPainterPath subtracted(const QPainterPath &r) const;
24948 QPainterPath subtractedInverted(const QPainterPath &r) const;
24949 QPainterPath simplified() const;
24950 bool operator==(const QPainterPath &other) const;
24951 bool operator!=(const QPainterPath &other) const;
24952 QPainterPath operator&(const QPainterPath &other) const;
24953 QPainterPath operator|(const QPainterPath &other) const;
24954 QPainterPath operator+(const QPainterPath &other) const;
24955 QPainterPath operator-(const QPainterPath &other) const;
24956 QPainterPath &operator&=(const QPainterPath &other);
24957 QPainterPath &operator|=(const QPainterPath &other);
24958 QPainterPath &operator+=(const QPainterPath &other);
24959 QPainterPath &operator-=(const QPainterPath &other);
24960 private:
24961 QScopedPointer<QPainterPathPrivate, QPainterPathPrivateDeleter> d_ptr;
24962 inline void ensureData() { if (!d_ptr) ensureData_helper(); }
24963 void ensureData_helper();
24964 inline void detach();
24965 void detach_helper();
24966 void setDirty(bool);
24967 void computeBoundingRect() const;
24968 void computeControlPointRect() const;
24969 QPainterPathData *d_func() const { return reinterpret_cast<QPainterPathData *>(d_ptr.data()); }
24970 friend class QPainterPathData;
24971 friend class QPainterPathStroker;
24972 friend class QPainterPathStrokerPrivate;
24973 friend class QMatrix;
24974 friend class QTransform;
24975 friend class QVectorPath;
24976 friend const QVectorPath &qtVectorPathForPath(const QPainterPath &);
24977 friend QDataStream &operator<<(QDataStream &, const QPainterPath &);
24978 friend QDataStream &operator>>(QDataStream &, QPainterPath &);
24979 };
24980 class QPainterPathPrivate
24981 {
24982 public:
24983 friend class QPainterPath;
24984 friend class QPainterPathData;
24985 friend class QPainterPathStroker;
24986 friend class QPainterPathStrokerPrivate;
24987 friend class QMatrix;
24988 friend class QTransform;
24989 friend class QVectorPath;
24990 friend struct QPainterPathPrivateDeleter;
24991 friend QDataStream &operator<<(QDataStream &, const QPainterPath &);
24992 friend QDataStream &operator>>(QDataStream &, QPainterPath &);
24993 private:
24994 QAtomicInt ref;
24995 QVector<QPainterPath::Element> elements;
24996 };
24997 template <> class QTypeInfo<QPainterPath::Element > { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QPainterPath::Element)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QPainterPath::Element"; } };
24998 QDataStream &operator<<(QDataStream &, const QPainterPath &);
24999 QDataStream &operator>>(QDataStream &, QPainterPath &);
25000 class QPainterPathStroker
25001 {
25002 inline QPainterPathStrokerPrivate* d_func() { return reinterpret_cast<QPainterPathStrokerPrivate *>(qGetPtrHelper(d_ptr)); } inline const QPainterPathStrokerPrivate* d_func() const { return reinterpret_cast<const QPainterPathStrokerPrivate *>(qGetPtrHelper(d_ptr)); } friend class QPainterPathStrokerPrivate;
25003 public:
25004 QPainterPathStroker();
25005 ~QPainterPathStroker();
25006 void setWidth(qreal width);
25007 qreal width() const;
25008 void setCapStyle(Qt::PenCapStyle style);
25009 Qt::PenCapStyle capStyle() const;
25010 void setJoinStyle(Qt::PenJoinStyle style);
25011 Qt::PenJoinStyle joinStyle() const;
25012 void setMiterLimit(qreal length);
25013 qreal miterLimit() const;
25014 void setCurveThreshold(qreal threshold);
25015 qreal curveThreshold() const;
25016 void setDashPattern(Qt::PenStyle);
25017 void setDashPattern(const QVector<qreal> &dashPattern);
25018 QVector<qreal> dashPattern() const;
25019 void setDashOffset(qreal offset);
25020 qreal dashOffset() const;
25021 QPainterPath createStroke(const QPainterPath &path) const;
25022 private:
25023 friend class QX11PaintEngine;
25024 QScopedPointer<QPainterPathStrokerPrivate> d_ptr;
25025 };
25026 inline void QPainterPath::moveTo(qreal x, qreal y)
25027 {
25028 moveTo(QPointF(x, y));
25029 }
25030 inline void QPainterPath::lineTo(qreal x, qreal y)
25031 {
25032 lineTo(QPointF(x, y));
25033 }
25034 inline void QPainterPath::arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength)
25035 {
25036 arcTo(QRectF(x, y, w, h), startAngle, arcLength);
25037 }
25038 inline void QPainterPath::arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle)
25039 {
25040 arcMoveTo(QRectF(x, y, w, h), angle);
25041 }
25042 inline void QPainterPath::cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y,
25043 qreal endPtx, qreal endPty)
25044 {
25045 cubicTo(QPointF(ctrlPt1x, ctrlPt1y), QPointF(ctrlPt2x, ctrlPt2y),
25046 QPointF(endPtx, endPty));
25047 }
25048 inline void QPainterPath::quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
25049 {
25050 quadTo(QPointF(ctrlPtx, ctrlPty), QPointF(endPtx, endPty));
25051 }
25052 inline void QPainterPath::addEllipse(qreal x, qreal y, qreal w, qreal h)
25053 {
25054 addEllipse(QRectF(x, y, w, h));
25055 }
25056 inline void QPainterPath::addEllipse(const QPointF &center, qreal rx, qreal ry)
25057 {
25058 addEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
25059 }
25060 inline void QPainterPath::addRect(qreal x, qreal y, qreal w, qreal h)
25061 {
25062 addRect(QRectF(x, y, w, h));
25063 }
25064 inline void QPainterPath::addRoundedRect(qreal x, qreal y, qreal w, qreal h,
25065 qreal xRadius, qreal yRadius,
25066 Qt::SizeMode mode)
25067 {
25068 addRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
25069 }
25070 inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h,
25071 int xRnd, int yRnd)
25072 {
25073 addRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
25074 }
25075 inline void QPainterPath::addRoundRect(const QRectF &rect,
25076 int roundness)
25077 {
25078 int xRnd = roundness;
25079 int yRnd = roundness;
25080 if (rect.width() > rect.height())
25081 xRnd = int(roundness * rect.height()/rect.width());
25082 else
25083 yRnd = int(roundness * rect.width()/rect.height());
25084 addRoundRect(rect, xRnd, yRnd);
25085 }
25086 inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h,
25087 int roundness)
25088 {
25089 addRoundRect(QRectF(x, y, w, h), roundness);
25090 }
25091 inline void QPainterPath::addText(qreal x, qreal y, const QFont &f, const QString &text)
25092 {
25093 addText(QPointF(x, y), f, text);
25094 }
25095 inline void QPainterPath::translate(const QPointF &offset)
25096 { translate(offset.x(), offset.y()); }
25097 inline QPainterPath QPainterPath::translated(const QPointF &offset) const
25098 { return translated(offset.x(), offset.y()); }
25099 inline bool QPainterPath::isEmpty() const
25100 {
25101 return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement);
25102 }
25103 inline int QPainterPath::elementCount() const
25104 {
25105 return d_ptr ? d_ptr->elements.size() : 0;
25106 }
25107 inline const QPainterPath::Element &QPainterPath::elementAt(int i) const
25108 {
25109 ((!(d_ptr)) ? qt_assert("d_ptr","/usr/include/qt4/QtGui/qpainterpath.h",397) : qt_noop());
25110 ((!(i >= 0 && i < elementCount())) ? qt_assert("i >= 0 && i < elementCount()","/usr/include/qt4/QtGui/qpainterpath.h",398) : qt_noop());
25111 return d_ptr->elements.at(i);
25112 }
25113 inline void QPainterPath::setElementPositionAt(int i, qreal x, qreal y)
25114 {
25115 ((!(d_ptr)) ? qt_assert("d_ptr","/usr/include/qt4/QtGui/qpainterpath.h",404) : qt_noop());
25116 ((!(i >= 0 && i < elementCount())) ? qt_assert("i >= 0 && i < elementCount()","/usr/include/qt4/QtGui/qpainterpath.h",405) : qt_noop());
25117 detach();
25118 QPainterPath::Element &e = d_ptr->elements[i];
25119 e.x = x;
25120 e.y = y;
25121 }
25122 inline void QPainterPath::detach()
25123 {
25124 if (d_ptr->ref != 1)
25125 detach_helper();
25126 setDirty(true);
25127 }
25128 QDebug operator<<(QDebug, const QPainterPath &);
25129 typedef QtValidLicenseForGuiModule QtGuiModule;
25130 class QVariant;
25131 class QTransform
25132 {
25133
25134 public:
25135 enum TransformationType {
25136 TxNone = 0x00,
25137 TxTranslate = 0x01,
25138 TxScale = 0x02,
25139 TxRotate = 0x04,
25140 TxShear = 0x08,
25141 TxProject = 0x10
25142 };
25143 inline explicit QTransform(Qt::Initialization) : affine(Qt::Uninitialized) {}
25144 QTransform();
25145 QTransform(qreal h11, qreal h12, qreal h13,
25146 qreal h21, qreal h22, qreal h23,
25147 qreal h31, qreal h32, qreal h33 = 1.0);
25148 QTransform(qreal h11, qreal h12, qreal h21,
25149 qreal h22, qreal dx, qreal dy);
25150 explicit QTransform(const QMatrix &mtx);
25151 bool isAffine() const;
25152 bool isIdentity() const;
25153 bool isInvertible() const;
25154 bool isScaling() const;
25155 bool isRotating() const;
25156 bool isTranslating() const;
25157 TransformationType type() const;
25158 inline qreal determinant() const;
25159 qreal det() const;
25160 qreal m11() const;
25161 qreal m12() const;
25162 qreal m13() const;
25163 qreal m21() const;
25164 qreal m22() const;
25165 qreal m23() const;
25166 qreal m31() const;
25167 qreal m32() const;
25168 qreal m33() const;
25169 qreal dx() const;
25170 qreal dy() const;
25171 void setMatrix(qreal m11, qreal m12, qreal m13,
25172 qreal m21, qreal m22, qreal m23,
25173 qreal m31, qreal m32, qreal m33);
25174 QTransform inverted(bool *invertible = 0) const;
25175 QTransform adjoint() const;
25176 QTransform transposed() const;
25177 QTransform &translate(qreal dx, qreal dy);
25178 QTransform &scale(qreal sx, qreal sy);
25179 QTransform &shear(qreal sh, qreal sv);
25180 QTransform &rotate(qreal a, Qt::Axis axis = Qt::ZAxis);
25181 QTransform &rotateRadians(qreal a, Qt::Axis axis = Qt::ZAxis);
25182 static bool squareToQuad(const QPolygonF &square, QTransform &result);
25183 static bool quadToSquare(const QPolygonF &quad, QTransform &result);
25184 static bool quadToQuad(const QPolygonF &one,
25185 const QPolygonF &two,
25186 QTransform &result);
25187 bool operator==(const QTransform &) const;
25188 bool operator!=(const QTransform &) const;
25189 QTransform &operator*=(const QTransform &);
25190 QTransform operator*(const QTransform &o) const;
25191 QTransform &operator=(const QTransform &);
25192 operator QVariant() const;
25193 void reset();
25194 QPoint map(const QPoint &p) const;
25195 QPointF map(const QPointF &p) const;
25196 QLine map(const QLine &l) const;
25197 QLineF map(const QLineF &l) const;
25198 QPolygonF map(const QPolygonF &a) const;
25199 QPolygon map(const QPolygon &a) const;
25200 QRegion map(const QRegion &r) const;
25201 QPainterPath map(const QPainterPath &p) const;
25202 QPolygon mapToPolygon(const QRect &r) const;
25203 QRect mapRect(const QRect &) const;
25204 QRectF mapRect(const QRectF &) const;
25205 void map(int x, int y, int *tx, int *ty) const;
25206 void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
25207 const QMatrix &toAffine() const;
25208 QTransform &operator*=(qreal div);
25209 QTransform &operator/=(qreal div);
25210 QTransform &operator+=(qreal div);
25211 QTransform &operator-=(qreal div);
25212 static QTransform fromTranslate(qreal dx, qreal dy);
25213 static QTransform fromScale(qreal dx, qreal dy);
25214 private:
25215 inline QTransform(qreal h11, qreal h12, qreal h13,
25216 qreal h21, qreal h22, qreal h23,
25217 qreal h31, qreal h32, qreal h33, bool)
25218 : affine(h11, h12, h21, h22, h31, h32, true)
25219 , m_13(h13), m_23(h23), m_33(h33)
25220 , m_type(TxNone)
25221 , m_dirty(TxProject) {}
25222 inline QTransform(bool)
25223 : affine(true)
25224 , m_13(0), m_23(0), m_33(1)
25225 , m_type(TxNone)
25226 , m_dirty(TxNone) {}
25227 inline TransformationType inline_type() const;
25228 QMatrix affine;
25229 qreal m_13;
25230 qreal m_23;
25231 qreal m_33;
25232 mutable uint m_type : 5;
25233 mutable uint m_dirty : 5;
25234 class Private;
25235 Private *d;
25236 };
25237 template <> class QTypeInfo<QTransform > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QTransform)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QTransform"; } };
25238 inline QTransform::TransformationType QTransform::inline_type() const
25239 {
25240 if (m_dirty == TxNone)
25241 return static_cast<TransformationType>(m_type);
25242 return type();
25243 }
25244 inline bool QTransform::isAffine() const
25245 {
25246 return inline_type() < TxProject;
25247 }
25248 inline bool QTransform::isIdentity() const
25249 {
25250 return inline_type() == TxNone;
25251 }
25252 inline bool QTransform::isInvertible() const
25253 {
25254 return !qFuzzyIsNull(determinant());
25255 }
25256 inline bool QTransform::isScaling() const
25257 {
25258 return type() >= TxScale;
25259 }
25260 inline bool QTransform::isRotating() const
25261 {
25262 return inline_type() >= TxRotate;
25263 }
25264 inline bool QTransform::isTranslating() const
25265 {
25266 return inline_type() >= TxTranslate;
25267 }
25268 inline qreal QTransform::determinant() const
25269 {
25270 return affine._m11*(m_33*affine._m22-affine._dy*m_23) -
25271 affine._m21*(m_33*affine._m12-affine._dy*m_13)+affine._dx*(m_23*affine._m12-affine._m22*m_13);
25272 }
25273 inline qreal QTransform::det() const
25274 {
25275 return determinant();
25276 }
25277 inline qreal QTransform::m11() const
25278 {
25279 return affine._m11;
25280 }
25281 inline qreal QTransform::m12() const
25282 {
25283 return affine._m12;
25284 }
25285 inline qreal QTransform::m13() const
25286 {
25287 return m_13;
25288 }
25289 inline qreal QTransform::m21() const
25290 {
25291 return affine._m21;
25292 }
25293 inline qreal QTransform::m22() const
25294 {
25295 return affine._m22;
25296 }
25297 inline qreal QTransform::m23() const
25298 {
25299 return m_23;
25300 }
25301 inline qreal QTransform::m31() const
25302 {
25303 return affine._dx;
25304 }
25305 inline qreal QTransform::m32() const
25306 {
25307 return affine._dy;
25308 }
25309 inline qreal QTransform::m33() const
25310 {
25311 return m_33;
25312 }
25313 inline qreal QTransform::dx() const
25314 {
25315 return affine._dx;
25316 }
25317 inline qreal QTransform::dy() const
25318 {
25319 return affine._dy;
25320 }
25321 inline QTransform &QTransform::operator*=(qreal num)
25322 {
25323 if (num == 1.)
25324 return *this;
25325 affine._m11 *= num;
25326 affine._m12 *= num;
25327 m_13 *= num;
25328 affine._m21 *= num;
25329 affine._m22 *= num;
25330 m_23 *= num;
25331 affine._dx *= num;
25332 affine._dy *= num;
25333 m_33 *= num;
25334 m_dirty |= TxScale;
25335 return *this;
25336 }
25337 inline QTransform &QTransform::operator/=(qreal div)
25338 {
25339 if (div == 0)
25340 return *this;
25341 div = 1/div;
25342 return operator*=(div);
25343 }
25344 inline QTransform &QTransform::operator+=(qreal num)
25345 {
25346 if (num == 0)
25347 return *this;
25348 affine._m11 += num;
25349 affine._m12 += num;
25350 m_13 += num;
25351 affine._m21 += num;
25352 affine._m22 += num;
25353 m_23 += num;
25354 affine._dx += num;
25355 affine._dy += num;
25356 m_33 += num;
25357 m_dirty |= TxProject;
25358 return *this;
25359 }
25360 inline QTransform &QTransform::operator-=(qreal num)
25361 {
25362 if (num == 0)
25363 return *this;
25364 affine._m11 -= num;
25365 affine._m12 -= num;
25366 m_13 -= num;
25367 affine._m21 -= num;
25368 affine._m22 -= num;
25369 m_23 -= num;
25370 affine._dx -= num;
25371 affine._dy -= num;
25372 m_33 -= num;
25373 m_dirty |= TxProject;
25374 return *this;
25375 }
25376 inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
25377 {
25378 return qFuzzyCompare(t1.m11(), t2.m11())
25379 && qFuzzyCompare(t1.m12(), t2.m12())
25380 && qFuzzyCompare(t1.m13(), t2.m13())
25381 && qFuzzyCompare(t1.m21(), t2.m21())
25382 && qFuzzyCompare(t1.m22(), t2.m22())
25383 && qFuzzyCompare(t1.m23(), t2.m23())
25384 && qFuzzyCompare(t1.m31(), t2.m31())
25385 && qFuzzyCompare(t1.m32(), t2.m32())
25386 && qFuzzyCompare(t1.m33(), t2.m33());
25387 }
25388 QDataStream &operator<<(QDataStream &, const QTransform &);
25389 QDataStream &operator>>(QDataStream &, QTransform &);
25390 QDebug operator<<(QDebug, const QTransform &);
25391 inline QPoint operator*(const QPoint &p, const QTransform &m)
25392 { return m.map(p); }
25393 inline QPointF operator*(const QPointF &p, const QTransform &m)
25394 { return m.map(p); }
25395 inline QLineF operator*(const QLineF &l, const QTransform &m)
25396 { return m.map(l); }
25397 inline QLine operator*(const QLine &l, const QTransform &m)
25398 { return m.map(l); }
25399 inline QPolygon operator *(const QPolygon &a, const QTransform &m)
25400 { return m.map(a); }
25401 inline QPolygonF operator *(const QPolygonF &a, const QTransform &m)
25402 { return m.map(a); }
25403 inline QRegion operator *(const QRegion &r, const QTransform &m)
25404 { return m.map(r); }
25405 inline QPainterPath operator *(const QPainterPath &p, const QTransform &m)
25406 { return m.map(p); }
25407 inline QTransform operator *(const QTransform &a, qreal n)
25408 { QTransform t(a); t *= n; return t; }
25409 inline QTransform operator /(const QTransform &a, qreal n)
25410 { QTransform t(a); t /= n; return t; }
25411 inline QTransform operator +(const QTransform &a, qreal n)
25412 { QTransform t(a); t += n; return t; }
25413 inline QTransform operator -(const QTransform &a, qreal n)
25414 { QTransform t(a); t -= n; return t; }
25415 typedef QtValidLicenseForGuiModule QtGuiModule;
25416 class QIODevice;
25417 class QStringList;
25418 class QMatrix;
25419 class QTransform;
25420 class QVariant;
25421 template <class T> class QList;
25422 template <class T> class QVector;
25423 struct QImageData;
25424 class QImageDataMisc;
25425 class QImageTextKeyLang {
25426 public:
25427 QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
25428 QImageTextKeyLang() { }
25429 QByteArray key;
25430 QByteArray lang;
25431 bool operator< (const QImageTextKeyLang& other) const
25432 { return key < other.key || (key==other.key && lang < other.lang); }
25433 bool operator== (const QImageTextKeyLang& other) const
25434 { return key==other.key && lang==other.lang; }
25435 inline bool operator!= (const QImageTextKeyLang &other) const
25436 { return !operator==(other); }
25437 };
25438 class QImage : public QPaintDevice
25439 {
25440 public:
25441 enum InvertMode { InvertRgb, InvertRgba };
25442 enum Format {
25443 Format_Invalid,
25444 Format_Mono,
25445 Format_MonoLSB,
25446 Format_Indexed8,
25447 Format_RGB32,
25448 Format_ARGB32,
25449 Format_ARGB32_Premultiplied,
25450 Format_RGB16,
25451 Format_ARGB8565_Premultiplied,
25452 Format_RGB666,
25453 Format_ARGB6666_Premultiplied,
25454 Format_RGB555,
25455 Format_ARGB8555_Premultiplied,
25456 Format_RGB888,
25457 Format_RGB444,
25458 Format_ARGB4444_Premultiplied,
25459 NImageFormats
25460 };
25461 QImage();
25462 QImage(const QSize &size, Format format);
25463 QImage(int width, int height, Format format);
25464 QImage(uchar *data, int width, int height, Format format);
25465 QImage(const uchar *data, int width, int height, Format format);
25466 QImage(uchar *data, int width, int height, int bytesPerLine, Format format);
25467 QImage(const uchar *data, int width, int height, int bytesPerLine, Format format);
25468 explicit QImage(const char * const xpm[]);
25469 explicit QImage(const QString &fileName, const char *format = 0);
25470 explicit QImage(const char *fileName, const char *format = 0);
25471 QImage(const QImage &);
25472 ~QImage();
25473 QImage &operator=(const QImage &);
25474 bool isNull() const;
25475 int devType() const;
25476 bool operator==(const QImage &) const;
25477 bool operator!=(const QImage &) const;
25478 operator QVariant() const;
25479 void detach();
25480 bool isDetached() const;
25481 QImage copy(const QRect &rect = QRect()) const;
25482 inline QImage copy(int x, int y, int w, int h) const
25483 { return copy(QRect(x, y, w, h)); }
25484 Format format() const;
25485 QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const __attribute__ ((warn_unused_result));
25486 QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const __attribute__ ((warn_unused_result));
25487 int width() const;
25488 int height() const;
25489 QSize size() const;
25490 QRect rect() const;
25491 int depth() const;
25492 int numColors() const;
25493 int colorCount() const;
25494 QRgb color(int i) const;
25495 void setColor(int i, QRgb c);
25496 void setNumColors(int);
25497 void setColorCount(int);
25498 bool allGray() const;
25499 bool isGrayscale() const;
25500 uchar *bits();
25501 const uchar *bits() const;
25502 int numBytes() const;
25503 int byteCount() const;
25504 uchar *scanLine(int);
25505 const uchar *scanLine(int) const;
25506 int bytesPerLine() const;
25507 bool valid(int x, int y) const;
25508 bool valid(const QPoint &pt) const;
25509 int pixelIndex(int x, int y) const;
25510 int pixelIndex(const QPoint &pt) const;
25511 QRgb pixel(int x, int y) const;
25512 QRgb pixel(const QPoint &pt) const;
25513 void setPixel(int x, int y, uint index_or_rgb);
25514 void setPixel(const QPoint &pt, uint index_or_rgb);
25515 QVector<QRgb> colorTable() const;
25516 void setColorTable(const QVector<QRgb> colors);
25517 void fill(uint pixel);
25518 bool hasAlphaChannel() const;
25519 void setAlphaChannel(const QImage &alphaChannel);
25520 QImage alphaChannel() const;
25521 QImage createAlphaMask(Qt::ImageConversionFlags flags = Qt::AutoColor) const;
25522 QImage createHeuristicMask(bool clipTight = true) const;
25523 QImage createMaskFromColor(QRgb color, Qt::MaskMode mode = Qt::MaskInColor) const;
25524 inline QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
25525 Qt::TransformationMode mode = Qt::FastTransformation) const
25526 { return scaled(QSize(w, h), aspectMode, mode); }
25527 QImage scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
25528 Qt::TransformationMode mode = Qt::FastTransformation) const;
25529 QImage scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
25530 QImage scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
25531 QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
25532 static QMatrix trueMatrix(const QMatrix &, int w, int h);
25533 QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
25534 static QTransform trueMatrix(const QTransform &, int w, int h);
25535 QImage mirrored(bool horizontally = false, bool vertically = true) const;
25536 QImage rgbSwapped() const;
25537 void invertPixels(InvertMode = InvertRgb);
25538 bool load(QIODevice *device, const char* format);
25539 bool load(const QString &fileName, const char* format=0);
25540 bool loadFromData(const uchar *buf, int len, const char *format = 0);
25541 inline bool loadFromData(const QByteArray &data, const char* aformat=0)
25542 { return loadFromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), aformat); }
25543 bool save(const QString &fileName, const char* format=0, int quality=-1) const;
25544 bool save(QIODevice *device, const char* format=0, int quality=-1) const;
25545 static QImage fromData(const uchar *data, int size, const char *format = 0);
25546 inline static QImage fromData(const QByteArray &data, const char *format = 0)
25547 { return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); }
25548 int serialNumber() const;
25549 qint64 cacheKey() const;
25550 QPaintEngine *paintEngine() const;
25551 int dotsPerMeterX() const;
25552 int dotsPerMeterY() const;
25553 void setDotsPerMeterX(int);
25554 void setDotsPerMeterY(int);
25555 QPoint offset() const;
25556 void setOffset(const QPoint&);
25557 QStringList textKeys() const;
25558 QString text(const QString &key = QString()) const;
25559 void setText(const QString &key, const QString &value);
25560 QString text(const char* key, const char* lang=0) const;
25561 QList<QImageTextKeyLang> textList() const;
25562 QStringList textLanguages() const;
25563 QString text(const QImageTextKeyLang&) const;
25564 void setText(const char* key, const char* lang, const QString&);
25565 public:
25566 virtual int metric(PaintDeviceMetric metric) const;
25567 private:
25568 friend class QWSOnScreenSurface;
25569 QImageData *d;
25570 friend class QRasterPixmapData;
25571 friend class QPixmapCacheEntry;
25572 friend qint64 qt_image_id(const QImage &image);
25573 friend const QVector<QRgb> *qt_image_colortable(const QImage &image);
25574 public:
25575 typedef QImageData * DataPtr;
25576 inline DataPtr &data_ptr() { return d; }
25577 };
25578 template <> inline bool qIsDetached<QImage>(QImage &t) { return t.isDetached(); } template <> inline void qSwap<QImage>(QImage &value1, QImage &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
25579 template <> class QTypeInfo<QImage > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QImage)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QImage"; } };
25580 inline bool QImage::valid(const QPoint &pt) const { return valid(pt.x(), pt.y()); }
25581 inline int QImage::pixelIndex(const QPoint &pt) const { return pixelIndex(pt.x(), pt.y());}
25582 inline QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y()); }
25583 inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); }
25584 QDataStream &operator<<(QDataStream &, const QImage &);
25585 QDataStream &operator>>(QDataStream &, QImage &);
25586 typedef QtValidLicenseForGuiModule QtGuiModule;
25587 class QImageWriter;
25588 class QColor;
25589 class QVariant;
25590 class QX11Info;
25591 class QPixmapData;
25592 class QPixmap : public QPaintDevice
25593 {
25594 public:
25595 QPixmap();
25596 explicit QPixmap(QPixmapData *data);
25597 QPixmap(int w, int h);
25598 QPixmap(const QSize &);
25599 QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
25600 QPixmap(const char * const xpm[]);
25601 QPixmap(const QPixmap &);
25602 ~QPixmap();
25603 QPixmap &operator=(const QPixmap &);
25604 operator QVariant() const;
25605 bool isNull() const;
25606 int devType() const;
25607 int width() const;
25608 int height() const;
25609 QSize size() const;
25610 QRect rect() const;
25611 int depth() const;
25612 static int defaultDepth();
25613 void fill(const QColor &fillColor = Qt::white);
25614 void fill(const QWidget *widget, const QPoint &ofs);
25615 inline void fill(const QWidget *widget, int xofs, int yofs) { fill(widget, QPoint(xofs, yofs)); }
25616 QBitmap mask() const;
25617 void setMask(const QBitmap &);
25618 QPixmap alphaChannel() const;
25619 void setAlphaChannel(const QPixmap &);
25620 bool hasAlpha() const;
25621 bool hasAlphaChannel() const;
25622 QBitmap createHeuristicMask(bool clipTight = true) const;
25623 QBitmap createMaskFromColor(const QColor &maskColor) const;
25624 QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode) const;
25625 static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1);
25626 static QPixmap grabWidget(QWidget *widget, const QRect &rect);
25627 static inline QPixmap grabWidget(QWidget *widget, int x=0, int y=0, int w=-1, int h=-1)
25628 { return grabWidget(widget, QRect(x, y, w, h)); }
25629 inline QPixmap scaled(int w, int h, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
25630 Qt::TransformationMode mode = Qt::FastTransformation) const
25631 { return scaled(QSize(w, h), aspectMode, mode); }
25632 QPixmap scaled(const QSize &s, Qt::AspectRatioMode aspectMode = Qt::IgnoreAspectRatio,
25633 Qt::TransformationMode mode = Qt::FastTransformation) const;
25634 QPixmap scaledToWidth(int w, Qt::TransformationMode mode = Qt::FastTransformation) const;
25635 QPixmap scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const;
25636 QPixmap transformed(const QMatrix &, Qt::TransformationMode mode = Qt::FastTransformation) const;
25637 static QMatrix trueMatrix(const QMatrix &m, int w, int h);
25638 QPixmap transformed(const QTransform &, Qt::TransformationMode mode = Qt::FastTransformation) const;
25639 static QTransform trueMatrix(const QTransform &m, int w, int h);
25640 QImage toImage() const;
25641 static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
25642 bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
25643 bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
25644 inline bool loadFromData(const QByteArray &data, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
25645 bool save(const QString& fileName, const char* format = 0, int quality = -1) const;
25646 bool save(QIODevice* device, const char* format = 0, int quality = -1) const;
25647 inline QPixmap copy(int x, int y, int width, int height) const;
25648 QPixmap copy(const QRect &rect = QRect()) const;
25649 inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = 0);
25650 void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = 0);
25651 int serialNumber() const;
25652 qint64 cacheKey() const;
25653 bool isDetached() const;
25654 void detach();
25655 bool isQBitmap() const;
25656 enum ShareMode { ImplicitlyShared, ExplicitlyShared };
25657 static QPixmap fromX11Pixmap(Qt::HANDLE pixmap, ShareMode mode = ImplicitlyShared);
25658 static int x11SetDefaultScreen(int screen);
25659 void x11SetScreen(int screen);
25660 const QX11Info &x11Info() const;
25661 Qt::HANDLE x11PictureHandle() const;
25662 Qt::HANDLE handle() const;
25663 QPaintEngine *paintEngine() const;
25664 inline bool operator!() const { return isNull(); }
25665 public:
25666 int metric(PaintDeviceMetric) const;
25667 private:
25668 QExplicitlySharedDataPointer<QPixmapData> data;
25669 bool doImageIO(QImageWriter *io, int quality) const;
25670 enum Type { PixmapType, BitmapType };
25671 QPixmap(const QSize &s, Type);
25672 void init(int, int, Type = PixmapType);
25673 QPixmap(const QSize &s, int type);
25674 void init(int, int, int);
25675 void deref();
25676
25677 friend class QPixmapData;
25678 friend class QX11PixmapData;
25679 friend class QMacPixmapData;
25680 friend class QS60PixmapData;
25681 friend class QBitmap;
25682 friend class QPaintDevice;
25683 friend class QPainter;
25684 friend class QGLWidget;
25685 friend class QX11PaintEngine;
25686 friend class QCoreGraphicsPaintEngine;
25687 friend class QWidgetPrivate;
25688 friend class QRasterPaintEngine;
25689 friend class QRasterBuffer;
25690 friend class QPixmapCacheEntry;
25691 friend QDataStream &operator>>(QDataStream &, QPixmap &);
25692 friend qint64 qt_pixmap_id(const QPixmap &pixmap);
25693 public:
25694 QPixmapData* pixmapData() const;
25695 public:
25696 typedef QExplicitlySharedDataPointer<QPixmapData> DataPtr;
25697 inline DataPtr &data_ptr() { return data; }
25698 };
25699 template <> inline bool qIsDetached<QPixmap>(QPixmap &t) { return t.isDetached(); } template <> inline void qSwap<QPixmap>(QPixmap &value1, QPixmap &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
25700 inline QPixmap QPixmap::copy(int ax, int ay, int awidth, int aheight) const
25701 {
25702 return copy(QRect(ax, ay, awidth, aheight));
25703 }
25704 inline void QPixmap::scroll(int dx, int dy, int ax, int ay, int awidth, int aheight, QRegion *exposed)
25705 {
25706 scroll(dx, dy, QRect(ax, ay, awidth, aheight), exposed);
25707 }
25708 inline bool QPixmap::loadFromData(const QByteArray &buf, const char *format,
25709 Qt::ImageConversionFlags flags)
25710 {
25711 return loadFromData(reinterpret_cast<const uchar *>(buf.constData()), buf.size(), format, flags);
25712 }
25713 QDataStream &operator<<(QDataStream &, const QPixmap &);
25714 QDataStream &operator>>(QDataStream &, QPixmap &);
25715 typedef QtValidLicenseForGuiModule QtGuiModule;
25716 class QIconPrivate;
25717 class QIconEngine;
25718 class QIconEngineV2;
25719 class QIcon
25720 {
25721 public:
25722 enum Mode { Normal, Disabled, Active, Selected };
25723 enum State { On, Off };
25724 QIcon();
25725 QIcon(const QPixmap &pixmap);
25726 QIcon(const QIcon &other);
25727 explicit QIcon(const QString &fileName);
25728 explicit QIcon(QIconEngine *engine);
25729 explicit QIcon(QIconEngineV2 *engine);
25730 ~QIcon();
25731 QIcon &operator=(const QIcon &other);
25732 operator QVariant() const;
25733 QPixmap pixmap(const QSize &size, Mode mode = Normal, State state = Off) const;
25734 inline QPixmap pixmap(int w, int h, Mode mode = Normal, State state = Off) const
25735 { return pixmap(QSize(w, h), mode, state); }
25736 inline QPixmap pixmap(int extent, Mode mode = Normal, State state = Off) const
25737 { return pixmap(QSize(extent, extent), mode, state); }
25738 QSize actualSize(const QSize &size, Mode mode = Normal, State state = Off) const;
25739 void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const;
25740 inline void paint(QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const
25741 { paint(painter, QRect(x, y, w, h), alignment, mode, state); }
25742 bool isNull() const;
25743 bool isDetached() const;
25744 void detach();
25745 int serialNumber() const;
25746 qint64 cacheKey() const;
25747 void addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off);
25748 void addFile(const QString &fileName, const QSize &size = QSize(), Mode mode = Normal, State state = Off);
25749 QList<QSize> availableSizes(Mode mode = Normal, State state = Off) const;
25750 static QIcon fromTheme(const QString &name, const QIcon &fallback = QIcon());
25751 static bool hasThemeIcon(const QString &name);
25752 static QStringList themeSearchPaths();
25753 static void setThemeSearchPaths(const QStringList &searchpath);
25754 static QString themeName();
25755 static void setThemeName(const QString &path);
25756
25757 private:
25758 QIconPrivate *d;
25759 friend QDataStream &operator<<(QDataStream &, const QIcon &);
25760 friend QDataStream &operator>>(QDataStream &, QIcon &);
25761 public:
25762 typedef QIconPrivate * DataPtr;
25763 inline DataPtr &data_ptr() { return d; }
25764 };
25765 template <> inline bool qIsDetached<QIcon>(QIcon &t) { return t.isDetached(); } template <> inline void qSwap<QIcon>(QIcon &value1, QIcon &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
25766 template <> class QTypeInfo<QIcon > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QIcon)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QIcon"; } };
25767 QDataStream &operator<<(QDataStream &, const QIcon &);
25768 QDataStream &operator>>(QDataStream &, QIcon &);
25769 namespace WebCore {
25770 class Settings;
25771 }
25772 class QWebPage;
25773 class QWebPluginDatabase;
25774 class QWebSettingsPrivate;
25775 class QUrl;
25776 class QWebSettings {
25777 public:
25778 enum FontFamily {
25779 StandardFont,
25780 FixedFont,
25781 SerifFont,
25782 SansSerifFont,
25783 CursiveFont,
25784 FantasyFont
25785 };
25786 enum WebAttribute {
25787 AutoLoadImages,
25788 JavascriptEnabled,
25789 JavaEnabled,
25790 PluginsEnabled,
25791 PrivateBrowsingEnabled,
25792 JavascriptCanOpenWindows,
25793 JavascriptCanAccessClipboard,
25794 DeveloperExtrasEnabled,
25795 LinksIncludedInFocusChain,
25796 ZoomTextOnly,
25797 PrintElementBackgrounds,
25798 OfflineStorageDatabaseEnabled,
25799 OfflineWebApplicationCacheEnabled,
25800 LocalStorageEnabled,
25801 LocalStorageDatabaseEnabled = LocalStorageEnabled,
25802 LocalContentCanAccessRemoteUrls,
25803 DnsPrefetchEnabled
25804 };
25805 enum WebGraphic {
25806 MissingImageGraphic,
25807 MissingPluginGraphic,
25808 DefaultFrameIconGraphic,
25809 TextAreaSizeGripCornerGraphic
25810 };
25811 enum FontSize {
25812 MinimumFontSize,
25813 MinimumLogicalFontSize,
25814 DefaultFontSize,
25815 DefaultFixedFontSize
25816 };
25817 static QWebSettings *globalSettings();
25818 void setFontFamily(FontFamily which, const QString &family);
25819 QString fontFamily(FontFamily which) const;
25820 void resetFontFamily(FontFamily which);
25821 void setFontSize(FontSize type, int size);
25822 int fontSize(FontSize type) const;
25823 void resetFontSize(FontSize type);
25824 void setAttribute(WebAttribute attr, bool on);
25825 bool testAttribute(WebAttribute attr) const;
25826 void resetAttribute(WebAttribute attr);
25827 void setUserStyleSheetUrl(const QUrl &location);
25828 QUrl userStyleSheetUrl() const;
25829 void setDefaultTextEncoding(const QString &encoding);
25830 QString defaultTextEncoding() const;
25831 static void setIconDatabasePath(const QString &location);
25832 static QString iconDatabasePath();
25833 static void clearIconDatabase();
25834 static QIcon iconForUrl(const QUrl &url);
25835 static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
25836 static QPixmap webGraphic(WebGraphic type);
25837 static void setMaximumPagesInCache(int pages);
25838 static int maximumPagesInCache();
25839 static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
25840 static void setOfflineStoragePath(const QString& path);
25841 static QString offlineStoragePath();
25842 static void setOfflineStorageDefaultQuota(qint64 maximumSize);
25843 static qint64 offlineStorageDefaultQuota();
25844 static void setOfflineWebApplicationCachePath(const QString& path);
25845 static QString offlineWebApplicationCachePath();
25846 static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
25847 static qint64 offlineWebApplicationCacheQuota();
25848 void setLocalStoragePath(const QString& path);
25849 QString localStoragePath() const;
25850 static void clearMemoryCaches();
25851 static void enablePersistentStorage(const QString& path = QString());
25852 inline QWebSettingsPrivate* handle() const { return d; }
25853 private:
25854 friend class QWebPagePrivate;
25855 friend class QWebSettingsPrivate;
25856 QWebSettings(const QWebSettings &); QWebSettings &operator=(const QWebSettings &);
25857 QWebSettings();
25858 QWebSettings(WebCore::Settings *settings);
25859 ~QWebSettings();
25860 QWebSettingsPrivate *d;
25861 };
25862 typedef QtValidLicenseForCoreModule QtCoreModule;
25863 template <class T1, class T2>
25864 struct QPair
25865 {
25866 typedef T1 first_type;
25867 typedef T2 second_type;
25868 QPair() : first(T1()), second(T2()) {}
25869 QPair(const T1 &t1, const T2 &t2) : first(t1), second(t2) {}
25870 QPair<T1, T2> &operator=(const QPair<T1, T2> &other)
25871 { first = other.first; second = other.second; return *this; }
25872 T1 first;
25873 T2 second;
25874 };
25875 template <class T1, class T2>
25876 inline bool operator==(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
25877 { return p1.first == p2.first && p1.second == p2.second; }
25878 template <class T1, class T2>
25879 inline bool operator!=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
25880 { return !(p1 == p2); }
25881 template <class T1, class T2>
25882 inline bool operator<(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
25883 {
25884 return p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second);
25885 }
25886 template <class T1, class T2>
25887 inline bool operator>(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
25888 {
25889 return p2 < p1;
25890 }
25891 template <class T1, class T2>
25892 inline bool operator<=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
25893 {
25894 return !(p2 < p1);
25895 }
25896 template <class T1, class T2>
25897 inline bool operator>=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
25898 {
25899 return !(p1 < p2);
25900 }
25901 template <class T1, class T2>
25902 QPair<T1, T2> qMakePair(const T1 &x, const T2 &y)
25903 {
25904 return QPair<T1, T2>(x, y);
25905 }
25906 template <class T1, class T2>
25907 inline QDataStream& operator>>(QDataStream& s, QPair<T1, T2>& p)
25908 {
25909 s >> p.first >> p.second;
25910 return s;
25911 }
25912 template <class T1, class T2>
25913 inline QDataStream& operator<<(QDataStream& s, const QPair<T1, T2>& p)
25914 {
25915 s << p.first << p.second;
25916 return s;
25917 }
25918 typedef QtValidLicenseForCoreModule QtCoreModule;
25919 class QUrlPrivate;
25920 class QDataStream;
25921 class QUrl
25922 {
25923 public:
25924 enum ParsingMode {
25925 TolerantMode,
25926 StrictMode
25927 };
25928 enum FormattingOption {
25929 None = 0x0,
25930 RemoveScheme = 0x1,
25931 RemovePassword = 0x2,
25932 RemoveUserInfo = RemovePassword | 0x4,
25933 RemovePort = 0x8,
25934 RemoveAuthority = RemoveUserInfo | RemovePort | 0x10,
25935 RemovePath = 0x20,
25936 RemoveQuery = 0x40,
25937 RemoveFragment = 0x80,
25938 StripTrailingSlash = 0x10000
25939 };
25940 typedef QFlags<FormattingOption> FormattingOptions;
25941 QUrl();
25942 QUrl(const QString &url);
25943 QUrl(const QString &url, ParsingMode mode);
25944 QUrl(const QUrl &copy);
25945 QUrl &operator =(const QUrl &copy);
25946 QUrl &operator =(const QString &url);
25947 ~QUrl();
25948 void setUrl(const QString &url);
25949 void setUrl(const QString &url, ParsingMode mode);
25950 void setEncodedUrl(const QByteArray &url);
25951 void setEncodedUrl(const QByteArray &url, ParsingMode mode);
25952 bool isValid() const;
25953 bool isEmpty() const;
25954 void clear();
25955 void setScheme(const QString &scheme);
25956 QString scheme() const;
25957 void setAuthority(const QString &authority);
25958 QString authority() const;
25959 void setUserInfo(const QString &userInfo);
25960 QString userInfo() const;
25961 void setUserName(const QString &userName);
25962 QString userName() const;
25963 void setEncodedUserName(const QByteArray &userName);
25964 QByteArray encodedUserName() const;
25965 void setPassword(const QString &password);
25966 QString password() const;
25967 void setEncodedPassword(const QByteArray &password);
25968 QByteArray encodedPassword() const;
25969 void setHost(const QString &host);
25970 QString host() const;
25971 void setEncodedHost(const QByteArray &host);
25972 QByteArray encodedHost() const;
25973 void setPort(int port);
25974 int port() const;
25975 int port(int defaultPort) const;
25976 void setPath(const QString &path);
25977 QString path() const;
25978 void setEncodedPath(const QByteArray &path);
25979 QByteArray encodedPath() const;
25980 bool hasQuery() const;
25981 void setEncodedQuery(const QByteArray &query);
25982 QByteArray encodedQuery() const;
25983 void setQueryDelimiters(char valueDelimiter, char pairDelimiter);
25984 char queryValueDelimiter() const;
25985 char queryPairDelimiter() const;
25986 void setQueryItems(const QList<QPair<QString, QString> > &query);
25987 void addQueryItem(const QString &key, const QString &value);
25988 QList<QPair<QString, QString> > queryItems() const;
25989 bool hasQueryItem(const QString &key) const;
25990 QString queryItemValue(const QString &key) const;
25991 QStringList allQueryItemValues(const QString &key) const;
25992 void removeQueryItem(const QString &key);
25993 void removeAllQueryItems(const QString &key);
25994 void setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &query);
25995 void addEncodedQueryItem(const QByteArray &key, const QByteArray &value);
25996 QList<QPair<QByteArray, QByteArray> > encodedQueryItems() const;
25997 bool hasEncodedQueryItem(const QByteArray &key) const;
25998 QByteArray encodedQueryItemValue(const QByteArray &key) const;
25999 QList<QByteArray> allEncodedQueryItemValues(const QByteArray &key) const;
26000 void removeEncodedQueryItem(const QByteArray &key);
26001 void removeAllEncodedQueryItems(const QByteArray &key);
26002 void setFragment(const QString &fragment);
26003 QString fragment() const;
26004 void setEncodedFragment(const QByteArray &fragment);
26005 QByteArray encodedFragment() const;
26006 bool hasFragment() const;
26007 QUrl resolved(const QUrl &relative) const;
26008 bool isRelative() const;
26009 bool isParentOf(const QUrl &url) const;
26010 static QUrl fromLocalFile(const QString &localfile);
26011 QString toLocalFile() const;
26012 QString toString(FormattingOptions options = None) const;
26013 QByteArray toEncoded(FormattingOptions options = None) const;
26014 static QUrl fromEncoded(const QByteArray &url);
26015 static QUrl fromEncoded(const QByteArray &url, ParsingMode mode);
26016 static QUrl fromUserInput(const QString &userInput);
26017 void detach();
26018 bool isDetached() const;
26019 bool operator <(const QUrl &url) const;
26020 bool operator ==(const QUrl &url) const;
26021 bool operator !=(const QUrl &url) const;
26022 static QString fromPercentEncoding(const QByteArray &);
26023 static QByteArray toPercentEncoding(const QString &,
26024 const QByteArray &exclude = QByteArray(),
26025 const QByteArray &include = QByteArray());
26026 static QString fromPunycode(const QByteArray &);
26027 static QByteArray toPunycode(const QString &);
26028 static QString fromAce(const QByteArray &);
26029 static QByteArray toAce(const QString &);
26030 static QStringList idnWhitelist();
26031 static void setIdnWhitelist(const QStringList &);
26032 QString errorString() const;
26033 public:
26034 private:
26035 QUrlPrivate *d;
26036 public:
26037 typedef QUrlPrivate * DataPtr;
26038 inline DataPtr &data_ptr() { return d; }
26039 };
26040 template <> class QTypeInfo<QUrl > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QUrl)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QUrl"; } };
26041 template <> inline bool qIsDetached<QUrl>(QUrl &t) { return t.isDetached(); } template <> inline void qSwap<QUrl>(QUrl &value1, QUrl &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
26042 inline QFlags<QUrl::FormattingOptions::enum_type> operator|(QUrl::FormattingOptions::enum_type f1, QUrl::FormattingOptions::enum_type f2) { return QFlags<QUrl::FormattingOptions::enum_type>(f1) | f2; } inline QFlags<QUrl::FormattingOptions::enum_type> operator|(QUrl::FormattingOptions::enum_type f1, QFlags<QUrl::FormattingOptions::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QUrl::FormattingOptions::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
26043 QDataStream &operator<<(QDataStream &, const QUrl &);
26044 QDataStream &operator>>(QDataStream &, QUrl &);
26045 QDebug operator<<(QDebug, const QUrl &);
26046 typedef QtValidLicenseForCoreModule QtCoreModule;
26047 class QMargins
26048 {
26049 public:
26050 QMargins();
26051 QMargins(int left, int top, int right, int bottom);
26052 bool isNull() const;
26053 int left() const;
26054 int top() const;
26055 int right() const;
26056 int bottom() const;
26057 void setLeft(int left);
26058 void setTop(int top);
26059 void setRight(int right);
26060 void setBottom(int bottom);
26061 private:
26062 int m_left;
26063 int m_top;
26064 int m_right;
26065 int m_bottom;
26066 friend inline bool operator==(const QMargins &, const QMargins &);
26067 friend inline bool operator!=(const QMargins &, const QMargins &);
26068 };
26069 template <> class QTypeInfo<QMargins > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QMargins)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QMargins"; } };
26070 inline QMargins::QMargins()
26071 { m_top = m_bottom = m_left = m_right = 0; }
26072 inline QMargins::QMargins(int aleft, int atop, int aright, int abottom)
26073 : m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
26074 inline bool QMargins::isNull() const
26075 { return m_left==0 && m_top==0 && m_right==0 && m_bottom==0; }
26076 inline int QMargins::left() const
26077 { return m_left; }
26078 inline int QMargins::top() const
26079 { return m_top; }
26080 inline int QMargins::right() const
26081 { return m_right; }
26082 inline int QMargins::bottom() const
26083 { return m_bottom; }
26084 inline void QMargins::setLeft(int aleft)
26085 { m_left = aleft; }
26086 inline void QMargins::setTop(int atop)
26087 { m_top = atop; }
26088 inline void QMargins::setRight(int aright)
26089 { m_right = aright; }
26090 inline void QMargins::setBottom(int abottom)
26091 { m_bottom = abottom; }
26092 inline bool operator==(const QMargins &m1, const QMargins &m2)
26093 {
26094 return
26095 m1.m_left == m2.m_left &&
26096 m1.m_top == m2.m_top &&
26097 m1.m_right == m2.m_right &&
26098 m1.m_bottom == m2.m_bottom;
26099 }
26100 inline bool operator!=(const QMargins &m1, const QMargins &m2)
26101 {
26102 return
26103 m1.m_left != m2.m_left ||
26104 m1.m_top != m2.m_top ||
26105 m1.m_right != m2.m_right ||
26106 m1.m_bottom != m2.m_bottom;
26107 }
26108 QDebug operator<<(QDebug, const QMargins &);
26109 typedef QtValidLicenseForGuiModule QtGuiModule;
26110 struct QBrushData;
26111 class QPixmap;
26112 class QGradient;
26113 class QVariant;
26114 struct QBrushDataPointerDeleter;
26115 class QBrush
26116 {
26117 public:
26118 QBrush();
26119 QBrush(Qt::BrushStyle bs);
26120 QBrush(const QColor &color, Qt::BrushStyle bs=Qt::SolidPattern);
26121 QBrush(Qt::GlobalColor color, Qt::BrushStyle bs=Qt::SolidPattern);
26122 QBrush(const QColor &color, const QPixmap &pixmap);
26123 QBrush(Qt::GlobalColor color, const QPixmap &pixmap);
26124 QBrush(const QPixmap &pixmap);
26125 QBrush(const QImage &image);
26126 QBrush(const QBrush &brush);
26127 QBrush(const QGradient &gradient);
26128 ~QBrush();
26129 QBrush &operator=(const QBrush &brush);
26130 operator QVariant() const;
26131 inline Qt::BrushStyle style() const;
26132 void setStyle(Qt::BrushStyle);
26133 inline const QMatrix &matrix() const;
26134 void setMatrix(const QMatrix &mat);
26135 inline QTransform transform() const;
26136 void setTransform(const QTransform &);
26137 QPixmap texture() const;
26138 void setTexture(const QPixmap &pixmap);
26139 QImage textureImage() const;
26140 void setTextureImage(const QImage &image);
26141 inline const QColor &color() const;
26142 void setColor(const QColor &color);
26143 inline void setColor(Qt::GlobalColor color);
26144 const QGradient *gradient() const;
26145 bool isOpaque() const;
26146 bool operator==(const QBrush &b) const;
26147 inline bool operator!=(const QBrush &b) const { return !(operator==(b)); }
26148 private:
26149 friend class QX11PaintEngine;
26150 friend class QRasterPaintEngine;
26151 friend class QRasterPaintEnginePrivate;
26152 friend struct QSpanData;
26153 friend class QPainter;
26154 friend bool qHasPixmapTexture(const QBrush& brush);
26155 void detach(Qt::BrushStyle newStyle);
26156 void init(const QColor &color, Qt::BrushStyle bs);
26157 QScopedPointer<QBrushData, QBrushDataPointerDeleter> d;
26158 void cleanUp(QBrushData *x);
26159 public:
26160 inline bool isDetached() const;
26161 typedef QScopedPointer<QBrushData, QBrushDataPointerDeleter> DataPtr;
26162 inline DataPtr &data_ptr() { return d; }
26163 };
26164 inline void QBrush::setColor(Qt::GlobalColor acolor)
26165 { setColor(QColor(acolor)); }
26166 template <> class QTypeInfo<QBrush > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QBrush)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QBrush"; } };
26167 template <> inline bool qIsDetached<QBrush>(QBrush &t) { return t.isDetached(); } template <> inline void qSwap<QBrush>(QBrush &value1, QBrush &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
26168 QDataStream &operator<<(QDataStream &, const QBrush &);
26169 QDataStream &operator>>(QDataStream &, QBrush &);
26170 QDebug operator<<(QDebug, const QBrush &);
26171 struct QBrushData
26172 {
26173 QAtomicInt ref;
26174 Qt::BrushStyle style;
26175 QColor color;
26176 QTransform transform;
26177 };
26178 inline Qt::BrushStyle QBrush::style() const { return d->style; }
26179 inline const QColor &QBrush::color() const { return d->color; }
26180 inline const QMatrix &QBrush::matrix() const { return d->transform.toAffine(); }
26181 inline QTransform QBrush::transform() const { return d->transform; }
26182 inline bool QBrush::isDetached() const { return d->ref == 1; }
26183 class QGradientPrivate;
26184 typedef QPair<qreal, QColor> QGradientStop;
26185 typedef QVector<QGradientStop> QGradientStops;
26186 class QGradient
26187 {
26188 public: static const QMetaObject staticMetaObject; private:
26189
26190 public:
26191 enum Type {
26192 LinearGradient,
26193 RadialGradient,
26194 ConicalGradient,
26195 NoGradient
26196 };
26197 enum Spread {
26198 PadSpread,
26199 ReflectSpread,
26200 RepeatSpread
26201 };
26202 enum CoordinateMode {
26203 LogicalMode,
26204 StretchToDeviceMode,
26205 ObjectBoundingMode
26206 };
26207 enum InterpolationMode {
26208 ColorInterpolation,
26209 ComponentInterpolation
26210 };
26211 QGradient();
26212 Type type() const { return m_type; }
26213 inline void setSpread(Spread spread);
26214 Spread spread() const { return m_spread; }
26215 void setColorAt(qreal pos, const QColor &color);
26216 void setStops(const QGradientStops &stops);
26217 QGradientStops stops() const;
26218 CoordinateMode coordinateMode() const;
26219 void setCoordinateMode(CoordinateMode mode);
26220 InterpolationMode interpolationMode() const;
26221 void setInterpolationMode(InterpolationMode mode);
26222 bool operator==(const QGradient &gradient) const;
26223 inline bool operator!=(const QGradient &other) const
26224 { return !operator==(other); }
26225 bool operator==(const QGradient &gradient);
26226 private:
26227 friend class QLinearGradient;
26228 friend class QRadialGradient;
26229 friend class QConicalGradient;
26230 Type m_type;
26231 Spread m_spread;
26232 QGradientStops m_stops;
26233 union {
26234 struct {
26235 qreal x1, y1, x2, y2;
26236 } linear;
26237 struct {
26238 qreal cx, cy, fx, fy, radius;
26239 } radial;
26240 struct {
26241 qreal cx, cy, angle;
26242 } conical;
26243 } m_data;
26244 void *dummy;
26245 };
26246 inline void QGradient::setSpread(Spread aspread)
26247 { m_spread = aspread; }
26248 class QLinearGradient : public QGradient
26249 {
26250 public:
26251 QLinearGradient();
26252 QLinearGradient(const QPointF &start, const QPointF &finalStop);
26253 QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop);
26254 QPointF start() const;
26255 void setStart(const QPointF &start);
26256 inline void setStart(qreal x, qreal y) { setStart(QPointF(x, y)); }
26257 QPointF finalStop() const;
26258 void setFinalStop(const QPointF &stop);
26259 inline void setFinalStop(qreal x, qreal y) { setFinalStop(QPointF(x, y)); }
26260 };
26261 class QRadialGradient : public QGradient
26262 {
26263 public:
26264 QRadialGradient();
26265 QRadialGradient(const QPointF &center, qreal radius, const QPointF &focalPoint);
26266 QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy);
26267 QRadialGradient(const QPointF &center, qreal radius);
26268 QRadialGradient(qreal cx, qreal cy, qreal radius);
26269 QPointF center() const;
26270 void setCenter(const QPointF &center);
26271 inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
26272 QPointF focalPoint() const;
26273 void setFocalPoint(const QPointF &focalPoint);
26274 inline void setFocalPoint(qreal x, qreal y) { setFocalPoint(QPointF(x, y)); }
26275 qreal radius() const;
26276 void setRadius(qreal radius);
26277 };
26278 class QConicalGradient : public QGradient
26279 {
26280 public:
26281 QConicalGradient();
26282 QConicalGradient(const QPointF &center, qreal startAngle);
26283 QConicalGradient(qreal cx, qreal cy, qreal startAngle);
26284 QPointF center() const;
26285 void setCenter(const QPointF &center);
26286 inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
26287 qreal angle() const;
26288 void setAngle(qreal angle);
26289 };
26290 typedef QtValidLicenseForGuiModule QtGuiModule;
26291 class QPalettePrivate;
26292 class QVariant;
26293 class QPalette
26294 {
26295 public: static const QMetaObject staticMetaObject; private:
26296
26297 public:
26298 QPalette();
26299 QPalette(const QColor &button);
26300 QPalette(Qt::GlobalColor button);
26301 QPalette(const QColor &button, const QColor &window);
26302 QPalette(const QBrush &windowText, const QBrush &button, const QBrush &light,
26303 const QBrush &dark, const QBrush &mid, const QBrush &text,
26304 const QBrush &bright_text, const QBrush &base, const QBrush &window);
26305 QPalette(const QColor &windowText, const QColor &window, const QColor &light,
26306 const QColor &dark, const QColor &mid, const QColor &text, const QColor &base);
26307 QPalette(const QPalette &palette);
26308 ~QPalette();
26309 QPalette &operator=(const QPalette &palette);
26310 operator QVariant() const;
26311 enum ColorGroup { Active, Disabled, Inactive, NColorGroups, Current, All, Normal = Active };
26312 enum ColorRole { WindowText, Button, Light, Midlight, Dark, Mid,
26313 Text, BrightText, ButtonText, Base, Window, Shadow,
26314 Highlight, HighlightedText,
26315 Link, LinkVisited,
26316 AlternateBase,
26317 NoRole,
26318 ToolTipBase, ToolTipText,
26319 NColorRoles = ToolTipText + 1,
26320 Foreground = WindowText, Background = Window
26321 };
26322 inline ColorGroup currentColorGroup() const { return static_cast<ColorGroup>(current_group); }
26323 inline void setCurrentColorGroup(ColorGroup cg) { current_group = cg; }
26324 inline const QColor &color(ColorGroup cg, ColorRole cr) const
26325 { return brush(cg, cr).color(); }
26326 const QBrush &brush(ColorGroup cg, ColorRole cr) const;
26327 inline void setColor(ColorGroup cg, ColorRole cr, const QColor &color);
26328 inline void setColor(ColorRole cr, const QColor &color);
26329 inline void setBrush(ColorRole cr, const QBrush &brush);
26330 bool isBrushSet(ColorGroup cg, ColorRole cr) const;
26331 void setBrush(ColorGroup cg, ColorRole cr, const QBrush &brush);
26332 void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
26333 const QBrush &light, const QBrush &dark, const QBrush &mid,
26334 const QBrush &text, const QBrush &bright_text, const QBrush &base,
26335 const QBrush &window);
26336 bool isEqual(ColorGroup cr1, ColorGroup cr2) const;
26337 inline const QColor &color(ColorRole cr) const { return color(Current, cr); }
26338 inline const QBrush &brush(ColorRole cr) const { return brush(Current, cr); }
26339 inline const QBrush &foreground() const { return brush(WindowText); }
26340 inline const QBrush &windowText() const { return brush(WindowText); }
26341 inline const QBrush &button() const { return brush(Button); }
26342 inline const QBrush &light() const { return brush(Light); }
26343 inline const QBrush &dark() const { return brush(Dark); }
26344 inline const QBrush &mid() const { return brush(Mid); }
26345 inline const QBrush &text() const { return brush(Text); }
26346 inline const QBrush &base() const { return brush(Base); }
26347 inline const QBrush &alternateBase() const { return brush(AlternateBase); }
26348 inline const QBrush &toolTipBase() const { return brush(ToolTipBase); }
26349 inline const QBrush &toolTipText() const { return brush(ToolTipText); }
26350 inline const QBrush &background() const { return brush(Window); }
26351 inline const QBrush &window() const { return brush(Window); }
26352 inline const QBrush &midlight() const { return brush(Midlight); }
26353 inline const QBrush &brightText() const { return brush(BrightText); }
26354 inline const QBrush &buttonText() const { return brush(ButtonText); }
26355 inline const QBrush &shadow() const { return brush(Shadow); }
26356 inline const QBrush &highlight() const { return brush(Highlight); }
26357 inline const QBrush &highlightedText() const { return brush(HighlightedText); }
26358 inline const QBrush &link() const { return brush(Link); }
26359 inline const QBrush &linkVisited() const { return brush(LinkVisited); }
26360 bool operator==(const QPalette &p) const;
26361 inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }
26362 bool isCopyOf(const QPalette &p) const;
26363 int serialNumber() const;
26364 qint64 cacheKey() const;
26365 QPalette resolve(const QPalette &) const;
26366 inline uint resolve() const { return resolve_mask; }
26367 inline void resolve(uint mask) { resolve_mask = mask; }
26368 private:
26369 void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
26370 const QBrush &light, const QBrush &dark, const QBrush &mid,
26371 const QBrush &text, const QBrush &bright_text,
26372 const QBrush &base, const QBrush &alternate_base,
26373 const QBrush &window, const QBrush &midlight,
26374 const QBrush &button_text, const QBrush &shadow,
26375 const QBrush &highlight, const QBrush &highlighted_text,
26376 const QBrush &link, const QBrush &link_visited);
26377 void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button,
26378 const QBrush &light, const QBrush &dark, const QBrush &mid,
26379 const QBrush &text, const QBrush &bright_text,
26380 const QBrush &base, const QBrush &alternate_base,
26381 const QBrush &window, const QBrush &midlight,
26382 const QBrush &button_text, const QBrush &shadow,
26383 const QBrush &highlight, const QBrush &highlighted_text,
26384 const QBrush &link, const QBrush &link_visited,
26385 const QBrush &toolTipBase, const QBrush &toolTipText);
26386 void init();
26387 void detach();
26388 QPalettePrivate *d;
26389 uint current_group : 4;
26390 uint resolve_mask : 28;
26391 friend QDataStream &operator<<(QDataStream &s, const QPalette &p);
26392 };
26393 inline void QPalette::setColor(ColorGroup acg, ColorRole acr,
26394 const QColor &acolor)
26395 { setBrush(acg, acr, QBrush(acolor)); }
26396 inline void QPalette::setColor(ColorRole acr, const QColor &acolor)
26397 { setColor(All, acr, acolor); }
26398 inline void QPalette::setBrush(ColorRole acr, const QBrush &abrush)
26399 { setBrush(All, acr, abrush); }
26400 QDataStream &operator<<(QDataStream &ds, const QPalette &p);
26401 QDataStream &operator>>(QDataStream &ds, QPalette &p);
26402 typedef struct FT_FaceRec_* FT_Face;
26403 typedef QtValidLicenseForGuiModule QtGuiModule;
26404 class QFontPrivate;
26405 class QStringList;
26406 class QVariant;
26407 class Q3TextFormatCollection;
26408 class QFont
26409 {
26410 public: static const QMetaObject staticMetaObject; private:
26411
26412 public:
26413 enum StyleHint {
26414 Helvetica, SansSerif = Helvetica,
26415 Times, Serif = Times,
26416 Courier, TypeWriter = Courier,
26417 OldEnglish, Decorative = OldEnglish,
26418 System,
26419 AnyStyle
26420 };
26421 enum StyleStrategy {
26422 PreferDefault = 0x0001,
26423 PreferBitmap = 0x0002,
26424 PreferDevice = 0x0004,
26425 PreferOutline = 0x0008,
26426 ForceOutline = 0x0010,
26427 PreferMatch = 0x0020,
26428 PreferQuality = 0x0040,
26429 PreferAntialias = 0x0080,
26430 NoAntialias = 0x0100,
26431 OpenGLCompatible = 0x0200,
26432 NoFontMerging = 0x8000
26433 };
26434 enum Weight {
26435 Light = 25,
26436 Normal = 50,
26437 DemiBold = 63,
26438 Bold = 75,
26439 Black = 87
26440 };
26441 enum Style {
26442 StyleNormal,
26443 StyleItalic,
26444 StyleOblique
26445 };
26446 enum Stretch {
26447 UltraCondensed = 50,
26448 ExtraCondensed = 62,
26449 Condensed = 75,
26450 SemiCondensed = 87,
26451 Unstretched = 100,
26452 SemiExpanded = 112,
26453 Expanded = 125,
26454 ExtraExpanded = 150,
26455 UltraExpanded = 200
26456 };
26457 enum Capitalization {
26458 MixedCase,
26459 AllUppercase,
26460 AllLowercase,
26461 SmallCaps,
26462 Capitalize
26463 };
26464 enum SpacingType {
26465 PercentageSpacing,
26466 AbsoluteSpacing
26467 };
26468 enum ResolveProperties {
26469 FamilyResolved = 0x0001,
26470 SizeResolved = 0x0002,
26471 StyleHintResolved = 0x0004,
26472 StyleStrategyResolved = 0x0008,
26473 WeightResolved = 0x0010,
26474 StyleResolved = 0x0020,
26475 UnderlineResolved = 0x0040,
26476 OverlineResolved = 0x0080,
26477 StrikeOutResolved = 0x0100,
26478 FixedPitchResolved = 0x0200,
26479 StretchResolved = 0x0400,
26480 KerningResolved = 0x0800,
26481 CapitalizationResolved = 0x1000,
26482 LetterSpacingResolved = 0x2000,
26483 WordSpacingResolved = 0x4000,
26484 AllPropertiesResolved = 0x7fff
26485 };
26486 QFont();
26487 QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
26488 QFont(const QFont &, QPaintDevice *pd);
26489 QFont(const QFont &);
26490 ~QFont();
26491 QString family() const;
26492 void setFamily(const QString &);
26493 int pointSize() const;
26494 void setPointSize(int);
26495 qreal pointSizeF() const;
26496 void setPointSizeF(qreal);
26497 int pixelSize() const;
26498 void setPixelSize(int);
26499 int weight() const;
26500 void setWeight(int);
26501 inline bool bold() const;
26502 inline void setBold(bool);
26503 void setStyle(Style style);
26504 Style style() const;
26505 inline bool italic() const;
26506 inline void setItalic(bool b);
26507 bool underline() const;
26508 void setUnderline(bool);
26509 bool overline() const;
26510 void setOverline(bool);
26511 bool strikeOut() const;
26512 void setStrikeOut(bool);
26513 bool fixedPitch() const;
26514 void setFixedPitch(bool);
26515 bool kerning() const;
26516 void setKerning(bool);
26517 StyleHint styleHint() const;
26518 StyleStrategy styleStrategy() const;
26519 void setStyleHint(StyleHint, StyleStrategy = PreferDefault);
26520 void setStyleStrategy(StyleStrategy s);
26521 int stretch() const;
26522 void setStretch(int);
26523 qreal letterSpacing() const;
26524 SpacingType letterSpacingType() const;
26525 void setLetterSpacing(SpacingType type, qreal spacing);
26526 qreal wordSpacing() const;
26527 void setWordSpacing(qreal spacing);
26528 void setCapitalization(Capitalization);
26529 Capitalization capitalization() const;
26530 bool rawMode() const;
26531 void setRawMode(bool);
26532 bool exactMatch() const;
26533 QFont &operator=(const QFont &);
26534 bool operator==(const QFont &) const;
26535 bool operator!=(const QFont &) const;
26536 bool operator<(const QFont &) const;
26537 operator QVariant() const;
26538 bool isCopyOf(const QFont &) const;
26539 Qt::HANDLE handle() const;
26540 FT_Face freetypeFace() const;
26541 void setRawName(const QString &);
26542 QString rawName() const;
26543 QString key() const;
26544 QString toString() const;
26545 bool fromString(const QString &);
26546 static QString substitute(const QString &);
26547 static QStringList substitutes(const QString &);
26548 static QStringList substitutions();
26549 static void insertSubstitution(const QString&, const QString &);
26550 static void insertSubstitutions(const QString&, const QStringList &);
26551 static void removeSubstitution(const QString &);
26552 static void initialize();
26553 static void cleanup();
26554 static void cacheStatistics();
26555 QString defaultFamily() const;
26556 QString lastResortFamily() const;
26557 QString lastResortFont() const;
26558 QFont resolve(const QFont &) const;
26559 inline uint resolve() const { return resolve_mask; }
26560 inline void resolve(uint mask) { resolve_mask = mask; }
26561 private:
26562 QFont(QFontPrivate *);
26563 void detach();
26564 void x11SetScreen(int screen = -1);
26565 int x11Screen() const;
26566 friend class QFontPrivate;
26567 friend class QFontDialogPrivate;
26568 friend class QFontMetrics;
26569 friend class QFontMetricsF;
26570 friend class QFontInfo;
26571 friend class QPainter;
26572 friend class QPSPrintEngineFont;
26573 friend class QApplication;
26574 friend class QWidget;
26575 friend class QWidgetPrivate;
26576 friend class Q3TextFormatCollection;
26577 friend class QTextLayout;
26578 friend class QTextEngine;
26579 friend class QStackTextEngine;
26580 friend class QTextLine;
26581 friend struct QScriptLine;
26582 friend class QGLContext;
26583 friend class QWin32PaintEngine;
26584 friend class QAlphaPaintEngine;
26585 friend class QPainterPath;
26586 friend class QTextItemInt;
26587 friend class QPicturePaintEngine;
26588 friend class QPainterReplayer;
26589 friend class QPaintBufferEngine;
26590 friend class QCommandLinkButtonPrivate;
26591 friend QDataStream &operator<<(QDataStream &, const QFont &);
26592 friend QDataStream &operator>>(QDataStream &, QFont &);
26593 QExplicitlySharedDataPointer<QFontPrivate> d;
26594 uint resolve_mask;
26595 };
26596 inline bool QFont::bold() const
26597 { return weight() > Normal; }
26598 inline void QFont::setBold(bool enable)
26599 { setWeight(enable ? Bold : Normal); }
26600 inline bool QFont::italic() const
26601 {
26602 return (style() != StyleNormal);
26603 }
26604 inline void QFont::setItalic(bool b) {
26605 setStyle(b ? StyleItalic : StyleNormal);
26606 }
26607 QDataStream &operator<<(QDataStream &, const QFont &);
26608 QDataStream &operator>>(QDataStream &, QFont &);
26609 QDebug operator<<(QDebug, const QFont &);
26610 typedef QtValidLicenseForGuiModule QtGuiModule;
26611 class QTextCodec;
26612 class QRect;
26613 class QFontMetrics
26614 {
26615 public:
26616 QFontMetrics(const QFont &);
26617 QFontMetrics(const QFont &, QPaintDevice *pd);
26618 QFontMetrics(const QFontMetrics &);
26619 ~QFontMetrics();
26620 QFontMetrics &operator=(const QFontMetrics &);
26621 int ascent() const;
26622 int descent() const;
26623 int height() const;
26624 int leading() const;
26625 int lineSpacing() const;
26626 int minLeftBearing() const;
26627 int minRightBearing() const;
26628 int maxWidth() const;
26629 int xHeight() const;
26630 int averageCharWidth() const;
26631 bool inFont(QChar) const;
26632 int leftBearing(QChar) const;
26633 int rightBearing(QChar) const;
26634 int width(const QString &, int len = -1) const;
26635 int width(QChar) const;
26636 int charWidth(const QString &str, int pos) const;
26637 QRect boundingRect(QChar) const;
26638 QRect boundingRect(const QString &text) const;
26639 QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops=0, int *tabarray=0) const;
26640 inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text,
26641 int tabstops=0, int *tabarray=0) const
26642 { return boundingRect(QRect(x, y, w, h), flags, text, tabstops, tabarray); }
26643 QSize size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
26644 QRect tightBoundingRect(const QString &text) const;
26645 QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags = 0) const;
26646 int underlinePos() const;
26647 int overlinePos() const;
26648 int strikeOutPos() const;
26649 int lineWidth() const;
26650 bool operator==(const QFontMetrics &other);
26651 bool operator==(const QFontMetrics &other) const;
26652 inline bool operator !=(const QFontMetrics &other) { return !operator==(other); }
26653 inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); }
26654 private:
26655 friend class QFontMetricsF;
26656 friend class QStackTextEngine;
26657 QExplicitlySharedDataPointer<QFontPrivate> d;
26658 };
26659 class QFontMetricsF
26660 {
26661 public:
26662 QFontMetricsF(const QFont &);
26663 QFontMetricsF(const QFont &, QPaintDevice *pd);
26664 QFontMetricsF(const QFontMetrics &);
26665 QFontMetricsF(const QFontMetricsF &);
26666 ~QFontMetricsF();
26667 QFontMetricsF &operator=(const QFontMetricsF &);
26668 QFontMetricsF &operator=(const QFontMetrics &);
26669 qreal ascent() const;
26670 qreal descent() const;
26671 qreal height() const;
26672 qreal leading() const;
26673 qreal lineSpacing() const;
26674 qreal minLeftBearing() const;
26675 qreal minRightBearing() const;
26676 qreal maxWidth() const;
26677 qreal xHeight() const;
26678 qreal averageCharWidth() const;
26679 bool inFont(QChar) const;
26680 qreal leftBearing(QChar) const;
26681 qreal rightBearing(QChar) const;
26682 qreal width(const QString &string) const;
26683 qreal width(QChar) const;
26684 QRectF boundingRect(const QString &string) const;
26685 QRectF boundingRect(QChar) const;
26686 QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops=0, int *tabarray=0) const;
26687 QSizeF size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
26688 QRectF tightBoundingRect(const QString &text) const;
26689 QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags = 0) const;
26690 qreal underlinePos() const;
26691 qreal overlinePos() const;
26692 qreal strikeOutPos() const;
26693 qreal lineWidth() const;
26694 bool operator==(const QFontMetricsF &other);
26695 bool operator==(const QFontMetricsF &other) const;
26696 inline bool operator !=(const QFontMetricsF &other) { return !operator==(other); }
26697 inline bool operator !=(const QFontMetricsF &other) const { return !operator==(other); }
26698 private:
26699 QExplicitlySharedDataPointer<QFontPrivate> d;
26700 };
26701 typedef QtValidLicenseForGuiModule QtGuiModule;
26702 class QFontInfo
26703 {
26704 public:
26705 QFontInfo(const QFont &);
26706 QFontInfo(const QFontInfo &);
26707 ~QFontInfo();
26708 QFontInfo &operator=(const QFontInfo &);
26709 QString family() const;
26710 int pixelSize() const;
26711 int pointSize() const;
26712 qreal pointSizeF() const;
26713 bool italic() const;
26714 QFont::Style style() const;
26715 int weight() const;
26716 inline bool bold() const { return weight() > QFont::Normal; }
26717 bool underline() const;
26718 bool overline() const;
26719 bool strikeOut() const;
26720 bool fixedPitch() const;
26721 QFont::StyleHint styleHint() const;
26722 bool rawMode() const;
26723 bool exactMatch() const;
26724 private:
26725 QExplicitlySharedDataPointer<QFontPrivate> d;
26726 };
26727 typedef QtValidLicenseForGuiModule QtGuiModule;
26728 class QVariant;
26729 class QSizePolicy
26730 {
26731 public: static const QMetaObject staticMetaObject; private:
26732
26733 private:
26734 enum SizePolicyMasks {
26735 HSize = 4,
26736 HMask = 0x0f,
26737 VMask = HMask << HSize,
26738 CTShift = 9,
26739 CTSize = 5,
26740 WFHShift = CTShift + CTSize,
26741 CTMask = ((0x1 << CTSize) - 1) << CTShift,
26742 UnusedShift = CTShift + CTSize,
26743 UnusedSize = 2
26744 };
26745 public:
26746 enum PolicyFlag {
26747 GrowFlag = 1,
26748 ExpandFlag = 2,
26749 ShrinkFlag = 4,
26750 IgnoreFlag = 8
26751 };
26752 enum Policy {
26753 Fixed = 0,
26754 Minimum = GrowFlag,
26755 Maximum = ShrinkFlag,
26756 Preferred = GrowFlag | ShrinkFlag,
26757 MinimumExpanding = GrowFlag | ExpandFlag,
26758 Expanding = GrowFlag | ShrinkFlag | ExpandFlag,
26759 Ignored = ShrinkFlag | GrowFlag | IgnoreFlag
26760 };
26761 enum ControlType {
26762 DefaultType = 0x00000001,
26763 ButtonBox = 0x00000002,
26764 CheckBox = 0x00000004,
26765 ComboBox = 0x00000008,
26766 Frame = 0x00000010,
26767 GroupBox = 0x00000020,
26768 Label = 0x00000040,
26769 Line = 0x00000080,
26770 LineEdit = 0x00000100,
26771 PushButton = 0x00000200,
26772 RadioButton = 0x00000400,
26773 Slider = 0x00000800,
26774 SpinBox = 0x00001000,
26775 TabWidget = 0x00002000,
26776 ToolButton = 0x00004000
26777 };
26778 typedef QFlags<ControlType> ControlTypes;
26779 QSizePolicy() : data(0) { }
26780 QSizePolicy(Policy horizontal, Policy vertical)
26781 : data(horizontal | (vertical << HSize)) { }
26782 QSizePolicy(Policy horizontal, Policy vertical, ControlType type)
26783 : data(horizontal | (vertical << HSize)) { setControlType(type); }
26784 Policy horizontalPolicy() const { return static_cast<Policy>(data & HMask); }
26785 Policy verticalPolicy() const { return static_cast<Policy>((data & VMask) >> HSize); }
26786 ControlType controlType() const;
26787 void setHorizontalPolicy(Policy d) { data = (data & ~HMask) | d; }
26788 void setVerticalPolicy(Policy d) { data = (data & ~(HMask << HSize)) | (d << HSize); }
26789 void setControlType(ControlType type);
26790 Qt::Orientations expandingDirections() const {
26791 Qt::Orientations result;
26792 if (verticalPolicy() & ExpandFlag)
26793 result |= Qt::Vertical;
26794 if (horizontalPolicy() & ExpandFlag)
26795 result |= Qt::Horizontal;
26796 return result;
26797 }
26798 void setHeightForWidth(bool b) { data = b ? (data | (1 << 2*HSize)) : (data & ~(1 << 2*HSize)); }
26799 bool hasHeightForWidth() const { return data & (1 << 2*HSize); }
26800 bool operator==(const QSizePolicy& s) const { return data == s.data; }
26801 bool operator!=(const QSizePolicy& s) const { return data != s.data; }
26802 operator QVariant() const;
26803 int horizontalStretch() const { return data >> 24; }
26804 int verticalStretch() const { return (data >> 16) & 0xff; }
26805 void setHorizontalStretch(uchar stretchFactor) { data = (data&0x00ffffff) | (uint(stretchFactor)<<24); }
26806 void setVerticalStretch(uchar stretchFactor) { data = (data&0xff00ffff) | (uint(stretchFactor)<<16); }
26807 void transpose();
26808 private:
26809 friend QDataStream &operator<<(QDataStream &, const QSizePolicy &);
26810 friend QDataStream &operator>>(QDataStream &, QSizePolicy &);
26811 QSizePolicy(int i) : data(i) { }
26812 quint32 data;
26813 };
26814 inline QFlags<QSizePolicy::ControlTypes::enum_type> operator|(QSizePolicy::ControlTypes::enum_type f1, QSizePolicy::ControlTypes::enum_type f2) { return QFlags<QSizePolicy::ControlTypes::enum_type>(f1) | f2; } inline QFlags<QSizePolicy::ControlTypes::enum_type> operator|(QSizePolicy::ControlTypes::enum_type f1, QFlags<QSizePolicy::ControlTypes::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QSizePolicy::ControlTypes::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
26815 QDataStream &operator<<(QDataStream &, const QSizePolicy &);
26816 QDataStream &operator>>(QDataStream &, QSizePolicy &);
26817 inline void QSizePolicy::transpose() {
26818 Policy hData = horizontalPolicy();
26819 Policy vData = verticalPolicy();
26820 uchar hStretch = uchar(horizontalStretch());
26821 uchar vStretch = uchar(verticalStretch());
26822 setHorizontalPolicy(vData);
26823 setVerticalPolicy(hData);
26824 setHorizontalStretch(vStretch);
26825 setVerticalStretch(hStretch);
26826 }
26827 typedef QtValidLicenseForGuiModule QtGuiModule;
26828 class QVariant;
26829 class QCursorData;
26830 class QBitmap;
26831 class QPixmap;
26832 class QCursor
26833 {
26834 public:
26835 QCursor();
26836 QCursor(Qt::CursorShape shape);
26837 QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX=-1, int hotY=-1);
26838 QCursor(const QPixmap &pixmap, int hotX=-1, int hotY=-1);
26839 QCursor(const QCursor &cursor);
26840 ~QCursor();
26841 QCursor &operator=(const QCursor &cursor);
26842 operator QVariant() const;
26843 Qt::CursorShape shape() const;
26844 void setShape(Qt::CursorShape newShape);
26845 const QBitmap *bitmap() const;
26846 const QBitmap *mask() const;
26847 QPixmap pixmap() const;
26848 QPoint hotSpot() const;
26849 static QPoint pos();
26850 static void setPos(int x, int y);
26851 inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
26852 Qt::HANDLE handle() const;
26853 QCursor(Qt::HANDLE cursor);
26854 static int x11Screen();
26855 private:
26856 QCursorData *d;
26857 };
26858 QDataStream &operator<<(QDataStream &outS, const QCursor &cursor);
26859 QDataStream &operator>>(QDataStream &inS, QCursor &cursor);
26860 typedef QtValidLicenseForGuiModule QtGuiModule;
26861 class QKeySequence;
26862 QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
26863 QDataStream &operator>>(QDataStream &out, QKeySequence &ks);
26864 class QVariant;
26865 class QKeySequencePrivate;
26866 class QKeySequence
26867 {
26868 public:
26869 enum StandardKey {
26870 UnknownKey,
26871 HelpContents,
26872 WhatsThis,
26873 Open,
26874 Close,
26875 Save,
26876 New,
26877 Delete,
26878 Cut,
26879 Copy,
26880 Paste,
26881 Undo,
26882 Redo,
26883 Back,
26884 Forward,
26885 Refresh,
26886 ZoomIn,
26887 ZoomOut,
26888 Print,
26889 AddTab,
26890 NextChild,
26891 PreviousChild,
26892 Find,
26893 FindNext,
26894 FindPrevious,
26895 Replace,
26896 SelectAll,
26897 Bold,
26898 Italic,
26899 Underline,
26900 MoveToNextChar,
26901 MoveToPreviousChar,
26902 MoveToNextWord,
26903 MoveToPreviousWord,
26904 MoveToNextLine,
26905 MoveToPreviousLine,
26906 MoveToNextPage,
26907 MoveToPreviousPage,
26908 MoveToStartOfLine,
26909 MoveToEndOfLine,
26910 MoveToStartOfBlock,
26911 MoveToEndOfBlock,
26912 MoveToStartOfDocument,
26913 MoveToEndOfDocument,
26914 SelectNextChar,
26915 SelectPreviousChar,
26916 SelectNextWord,
26917 SelectPreviousWord,
26918 SelectNextLine,
26919 SelectPreviousLine,
26920 SelectNextPage,
26921 SelectPreviousPage,
26922 SelectStartOfLine,
26923 SelectEndOfLine,
26924 SelectStartOfBlock,
26925 SelectEndOfBlock,
26926 SelectStartOfDocument,
26927 SelectEndOfDocument,
26928 DeleteStartOfWord,
26929 DeleteEndOfWord,
26930 DeleteEndOfLine,
26931 InsertParagraphSeparator,
26932 InsertLineSeparator,
26933 SaveAs,
26934 Preferences,
26935 Quit
26936 };
26937 QKeySequence();
26938 QKeySequence(const QString &key);
26939 QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0);
26940 QKeySequence(const QKeySequence &ks);
26941 QKeySequence(StandardKey key);
26942 ~QKeySequence();
26943 uint count() const;
26944 bool isEmpty() const;
26945 enum SequenceMatch {
26946 NoMatch,
26947 PartialMatch,
26948 ExactMatch
26949 };
26950 enum SequenceFormat {
26951 NativeText,
26952 PortableText
26953 };
26954 QString toString(SequenceFormat format = PortableText) const;
26955 static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText);
26956 SequenceMatch matches(const QKeySequence &seq) const;
26957 static QKeySequence mnemonic(const QString &text);
26958 static QList<QKeySequence> keyBindings(StandardKey key);
26959 operator QString() const;
26960 operator QVariant() const;
26961 operator int() const;
26962 int operator[](uint i) const;
26963 QKeySequence &operator=(const QKeySequence &other);
26964 bool operator==(const QKeySequence &other) const;
26965 inline bool operator!= (const QKeySequence &other) const
26966 { return !(*this == other); }
26967 bool operator< (const QKeySequence &ks) const;
26968 inline bool operator> (const QKeySequence &other) const
26969 { return other < *this; }
26970 inline bool operator<= (const QKeySequence &other) const
26971 { return !(other < *this); }
26972 inline bool operator>= (const QKeySequence &other) const
26973 { return !(*this < other); }
26974 bool isDetached() const;
26975 private:
26976 static int decodeString(const QString &ks);
26977 static QString encodeString(int key);
26978 int assign(const QString &str);
26979 void setKey(int key, int index);
26980 QKeySequencePrivate *d;
26981 friend QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
26982 friend QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
26983 friend class Q3AccelManager;
26984 friend class QShortcutMap;
26985 friend class QShortcut;
26986 public:
26987 typedef QKeySequencePrivate * DataPtr;
26988 inline DataPtr &data_ptr() { return d; }
26989 };
26990 template <> class QTypeInfo<QKeySequence > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QKeySequence)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QKeySequence"; } };
26991 template <> inline bool qIsDetached<QKeySequence>(QKeySequence &t) { return t.isDetached(); } template <> inline void qSwap<QKeySequence>(QKeySequence &value1, QKeySequence &value2) { qSwap(value1.data_ptr(), value2.data_ptr()); }
26992 QDebug operator<<(QDebug, const QKeySequence &);
26993 typedef QtValidLicenseForGuiModule QtGuiModule;
26994 class QLayout;
26995 class QWSRegionManager;
26996 class QStyle;
26997 class QAction;
26998 class QVariant;
26999 class QActionEvent;
27000 class QMouseEvent;
27001 class QWheelEvent;
27002 class QHoverEvent;
27003 class QKeyEvent;
27004 class QFocusEvent;
27005 class QPaintEvent;
27006 class QMoveEvent;
27007 class QResizeEvent;
27008 class QCloseEvent;
27009 class QContextMenuEvent;
27010 class QInputMethodEvent;
27011 class QTabletEvent;
27012 class QDragEnterEvent;
27013 class QDragMoveEvent;
27014 class QDragLeaveEvent;
27015 class QDropEvent;
27016 class QShowEvent;
27017 class QHideEvent;
27018 class QInputContext;
27019 class QIcon;
27020 class QWindowSurface;
27021 class QLocale;
27022 class QGraphicsProxyWidget;
27023 class QGraphicsEffect;
27024 class QX11Info;
27025 class QWidgetData
27026 {
27027 public:
27028 WId winid;
27029 uint widget_attributes;
27030 Qt::WindowFlags window_flags;
27031 uint window_state : 4;
27032 uint focus_policy : 4;
27033 uint sizehint_forced :1;
27034 uint is_closing :1;
27035 uint in_show : 1;
27036 uint in_set_window_state : 1;
27037 mutable uint fstrut_dirty : 1;
27038 uint context_menu_policy : 3;
27039 uint window_modality : 2;
27040 uint in_destructor : 1;
27041 uint unused : 13;
27042 QRect crect;
27043 mutable QPalette pal;
27044 QFont fnt;
27045 QRect wrect;
27046 };
27047 class QWidgetPrivate;
27048 class QWidget : public QObject, public QPaintDevice
27049 {
27050 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
27051 inline QWidgetPrivate* d_func() { return reinterpret_cast<QWidgetPrivate *>(qGetPtrHelper(d_ptr)); } inline const QWidgetPrivate* d_func() const { return reinterpret_cast<const QWidgetPrivate *>(qGetPtrHelper(d_ptr)); } friend class QWidgetPrivate;
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108 public:
27109 enum RenderFlag {
27110 DrawWindowBackground = 0x1,
27111 DrawChildren = 0x2,
27112 IgnoreMask = 0x4
27113 };
27114 typedef QFlags<RenderFlag> RenderFlags;
27115 explicit QWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
27116 ~QWidget();
27117 int devType() const;
27118 WId winId() const;
27119 void createWinId();
27120 inline WId internalWinId() const { return data->winid; }
27121 WId effectiveWinId() const;
27122 QStyle *style() const;
27123 void setStyle(QStyle *);
27124 bool isTopLevel() const;
27125 bool isWindow() const;
27126 bool isModal() const;
27127 Qt::WindowModality windowModality() const;
27128 void setWindowModality(Qt::WindowModality windowModality);
27129 bool isEnabled() const;
27130 bool isEnabledTo(QWidget*) const;
27131 bool isEnabledToTLW() const;
27132 public :
27133 void setEnabled(bool);
27134 void setDisabled(bool);
27135 void setWindowModified(bool);
27136 public:
27137 QRect frameGeometry() const;
27138 const QRect &geometry() const;
27139 QRect normalGeometry() const;
27140 int x() const;
27141 int y() const;
27142 QPoint pos() const;
27143 QSize frameSize() const;
27144 QSize size() const;
27145 inline int width() const;
27146 inline int height() const;
27147 inline QRect rect() const;
27148 QRect childrenRect() const;
27149 QRegion childrenRegion() const;
27150 QSize minimumSize() const;
27151 QSize maximumSize() const;
27152 int minimumWidth() const;
27153 int minimumHeight() const;
27154 int maximumWidth() const;
27155 int maximumHeight() const;
27156 void setMinimumSize(const QSize &);
27157 void setMinimumSize(int minw, int minh);
27158 void setMaximumSize(const QSize &);
27159 void setMaximumSize(int maxw, int maxh);
27160 void setMinimumWidth(int minw);
27161 void setMinimumHeight(int minh);
27162 void setMaximumWidth(int maxw);
27163 void setMaximumHeight(int maxh);
27164 QSize sizeIncrement() const;
27165 void setSizeIncrement(const QSize &);
27166 void setSizeIncrement(int w, int h);
27167 QSize baseSize() const;
27168 void setBaseSize(const QSize &);
27169 void setBaseSize(int basew, int baseh);
27170 void setFixedSize(const QSize &);
27171 void setFixedSize(int w, int h);
27172 void setFixedWidth(int w);
27173 void setFixedHeight(int h);
27174 QPoint mapToGlobal(const QPoint &) const;
27175 QPoint mapFromGlobal(const QPoint &) const;
27176 QPoint mapToParent(const QPoint &) const;
27177 QPoint mapFromParent(const QPoint &) const;
27178 QPoint mapTo(QWidget *, const QPoint &) const;
27179 QPoint mapFrom(QWidget *, const QPoint &) const;
27180 QWidget *window() const;
27181 QWidget *nativeParentWidget() const;
27182 inline QWidget *topLevelWidget() const { return window(); }
27183 const QPalette &palette() const;
27184 void setPalette(const QPalette &);
27185 void setBackgroundRole(QPalette::ColorRole);
27186 QPalette::ColorRole backgroundRole() const;
27187 void setForegroundRole(QPalette::ColorRole);
27188 QPalette::ColorRole foregroundRole() const;
27189 const QFont &font() const;
27190 void setFont(const QFont &);
27191 QFontMetrics fontMetrics() const;
27192 QFontInfo fontInfo() const;
27193 QCursor cursor() const;
27194 void setCursor(const QCursor &);
27195 void unsetCursor();
27196 void setMouseTracking(bool enable);
27197 bool hasMouseTracking() const;
27198 bool underMouse() const;
27199 void setMask(const QBitmap &);
27200 void setMask(const QRegion &);
27201 QRegion mask() const;
27202 void clearMask();
27203 void render(QPaintDevice *target, const QPoint &targetOffset = QPoint(),
27204 const QRegion &sourceRegion = QRegion(),
27205 RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren));
27206 void render(QPainter *painter, const QPoint &targetOffset = QPoint(),
27207 const QRegion &sourceRegion = QRegion(),
27208 RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren));
27209 QGraphicsEffect *graphicsEffect() const;
27210 void setGraphicsEffect(QGraphicsEffect *effect);
27211 void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
27212 void ungrabGesture(Qt::GestureType type);
27213 public :
27214 void setWindowTitle(const QString &);
27215 void setStyleSheet(const QString& styleSheet);
27216 public:
27217 QString styleSheet() const;
27218 QString windowTitle() const;
27219 void setWindowIcon(const QIcon &icon);
27220 QIcon windowIcon() const;
27221 void setWindowIconText(const QString &);
27222 QString windowIconText() const;
27223 void setWindowRole(const QString &);
27224 QString windowRole() const;
27225 void setWindowFilePath(const QString &filePath);
27226 QString windowFilePath() const;
27227 void setWindowOpacity(qreal level);
27228 qreal windowOpacity() const;
27229 bool isWindowModified() const;
27230 void setToolTip(const QString &);
27231 QString toolTip() const;
27232 void setStatusTip(const QString &);
27233 QString statusTip() const;
27234 void setWhatsThis(const QString &);
27235 QString whatsThis() const;
27236 void setLayoutDirection(Qt::LayoutDirection direction);
27237 Qt::LayoutDirection layoutDirection() const;
27238 void unsetLayoutDirection();
27239 void setLocale(const QLocale &locale);
27240 QLocale locale() const;
27241 void unsetLocale();
27242 inline bool isRightToLeft() const { return layoutDirection() == Qt::RightToLeft; }
27243 inline bool isLeftToRight() const { return layoutDirection() == Qt::LeftToRight; }
27244 public :
27245 inline void setFocus() { setFocus(Qt::OtherFocusReason); }
27246 public:
27247 bool isActiveWindow() const;
27248 void activateWindow();
27249 void clearFocus();
27250 void setFocus(Qt::FocusReason reason);
27251 Qt::FocusPolicy focusPolicy() const;
27252 void setFocusPolicy(Qt::FocusPolicy policy);
27253 bool hasFocus() const;
27254 static void setTabOrder(QWidget *, QWidget *);
27255 void setFocusProxy(QWidget *);
27256 QWidget *focusProxy() const;
27257 Qt::ContextMenuPolicy contextMenuPolicy() const;
27258 void setContextMenuPolicy(Qt::ContextMenuPolicy policy);
27259 void grabMouse();
27260 void grabMouse(const QCursor &);
27261 void releaseMouse();
27262 void grabKeyboard();
27263 void releaseKeyboard();
27264 int grabShortcut(const QKeySequence &key, Qt::ShortcutContext context = Qt::WindowShortcut);
27265 void releaseShortcut(int id);
27266 void setShortcutEnabled(int id, bool enable = true);
27267 void setShortcutAutoRepeat(int id, bool enable = true);
27268 static QWidget *mouseGrabber();
27269 static QWidget *keyboardGrabber();
27270 inline bool updatesEnabled() const;
27271 void setUpdatesEnabled(bool enable);
27272 QGraphicsProxyWidget *graphicsProxyWidget() const;
27273 public :
27274 void update();
27275 void repaint();
27276 public:
27277 inline void update(int x, int y, int w, int h);
27278 void update(const QRect&);
27279 void update(const QRegion&);
27280 void repaint(int x, int y, int w, int h);
27281 void repaint(const QRect &);
27282 void repaint(const QRegion &);
27283 public :
27284 virtual void setVisible(bool visible);
27285 inline void setHidden(bool hidden) { setVisible(!hidden); }
27286 inline void show() { setVisible(true); }
27287 inline void hide() { setVisible(false); }
27288 inline void setShown(bool shown) { setVisible(shown); }
27289 void showMinimized();
27290 void showMaximized();
27291 void showFullScreen();
27292 void showNormal();
27293 bool close();
27294 void raise();
27295 void lower();
27296 public:
27297 void stackUnder(QWidget*);
27298 void move(int x, int y);
27299 void move(const QPoint &);
27300 void resize(int w, int h);
27301 void resize(const QSize &);
27302 inline void setGeometry(int x, int y, int w, int h);
27303 void setGeometry(const QRect &);
27304 QByteArray saveGeometry() const;
27305 bool restoreGeometry(const QByteArray &geometry);
27306 void adjustSize();
27307 bool isVisible() const;
27308 bool isVisibleTo(QWidget*) const;
27309 inline bool isHidden() const;
27310 bool isMinimized() const;
27311 bool isMaximized() const;
27312 bool isFullScreen() const;
27313 Qt::WindowStates windowState() const;
27314 void setWindowState(Qt::WindowStates state);
27315 void overrideWindowState(Qt::WindowStates state);
27316 virtual QSize sizeHint() const;
27317 virtual QSize minimumSizeHint() const;
27318 QSizePolicy sizePolicy() const;
27319 void setSizePolicy(QSizePolicy);
27320 inline void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
27321 virtual int heightForWidth(int) const;
27322 QRegion visibleRegion() const;
27323 void setContentsMargins(int left, int top, int right, int bottom);
27324 void setContentsMargins(const QMargins &margins);
27325 void getContentsMargins(int *left, int *top, int *right, int *bottom) const;
27326 QMargins contentsMargins() const;
27327 QRect contentsRect() const;
27328 public:
27329 QLayout *layout() const;
27330 void setLayout(QLayout *);
27331 void updateGeometry();
27332 void setParent(QWidget *parent);
27333 void setParent(QWidget *parent, Qt::WindowFlags f);
27334 void scroll(int dx, int dy);
27335 void scroll(int dx, int dy, const QRect&);
27336 QWidget *focusWidget() const;
27337 QWidget *nextInFocusChain() const;
27338 QWidget *previousInFocusChain() const;
27339 bool acceptDrops() const;
27340 void setAcceptDrops(bool on);
27341 void addAction(QAction *action);
27342 void addActions(QList<QAction*> actions);
27343 void insertAction(QAction *before, QAction *action);
27344 void insertActions(QAction *before, QList<QAction*> actions);
27345 void removeAction(QAction *action);
27346 QList<QAction*> actions() const;
27347 QWidget *parentWidget() const;
27348 void setWindowFlags(Qt::WindowFlags type);
27349 inline Qt::WindowFlags windowFlags() const;
27350 void overrideWindowFlags(Qt::WindowFlags type);
27351 inline Qt::WindowType windowType() const;
27352 static QWidget *find(WId);
27353 inline QWidget *childAt(int x, int y) const;
27354 QWidget *childAt(const QPoint &p) const;
27355 const QX11Info &x11Info() const;
27356 Qt::HANDLE x11PictureHandle() const;
27357 Qt::HANDLE handle() const;
27358 void setAttribute(Qt::WidgetAttribute, bool on = true);
27359 inline bool testAttribute(Qt::WidgetAttribute) const;
27360 QPaintEngine *paintEngine() const;
27361 void ensurePolished() const;
27362 QInputContext *inputContext();
27363 void setInputContext(QInputContext *);
27364 bool isAncestorOf(const QWidget *child) const;
27365 bool autoFillBackground() const;
27366 void setAutoFillBackground(bool enabled);
27367 void setWindowSurface(QWindowSurface *surface);
27368 QWindowSurface *windowSurface() const;
27369 public:
27370 void customContextMenuRequested(const QPoint &pos);
27371 public:
27372 bool event(QEvent *);
27373 virtual void mousePressEvent(QMouseEvent *);
27374 virtual void mouseReleaseEvent(QMouseEvent *);
27375 virtual void mouseDoubleClickEvent(QMouseEvent *);
27376 virtual void mouseMoveEvent(QMouseEvent *);
27377 virtual void wheelEvent(QWheelEvent *);
27378 virtual void keyPressEvent(QKeyEvent *);
27379 virtual void keyReleaseEvent(QKeyEvent *);
27380 virtual void focusInEvent(QFocusEvent *);
27381 virtual void focusOutEvent(QFocusEvent *);
27382 virtual void enterEvent(QEvent *);
27383 virtual void leaveEvent(QEvent *);
27384 virtual void paintEvent(QPaintEvent *);
27385 virtual void moveEvent(QMoveEvent *);
27386 virtual void resizeEvent(QResizeEvent *);
27387 virtual void closeEvent(QCloseEvent *);
27388 virtual void contextMenuEvent(QContextMenuEvent *);
27389 virtual void tabletEvent(QTabletEvent *);
27390 virtual void actionEvent(QActionEvent *);
27391 virtual void dragEnterEvent(QDragEnterEvent *);
27392 virtual void dragMoveEvent(QDragMoveEvent *);
27393 virtual void dragLeaveEvent(QDragLeaveEvent *);
27394 virtual void dropEvent(QDropEvent *);
27395 virtual void showEvent(QShowEvent *);
27396 virtual void hideEvent(QHideEvent *);
27397 virtual bool x11Event(XEvent *);
27398 virtual void changeEvent(QEvent *);
27399 int metric(PaintDeviceMetric) const;
27400 virtual void inputMethodEvent(QInputMethodEvent *);
27401 public:
27402 virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const;
27403 Qt::InputMethodHints inputMethodHints() const;
27404 void setInputMethodHints(Qt::InputMethodHints hints);
27405 public:
27406 void resetInputContext();
27407 public :
27408 void updateMicroFocus();
27409 public:
27410 void create(WId = 0, bool initializeWindow = true,
27411 bool destroyOldWindow = true);
27412 void destroy(bool destroyWindow = true,
27413 bool destroySubWindows = true);
27414 virtual bool focusNextPrevChild(bool next);
27415 inline bool focusNextChild() { return focusNextPrevChild(true); }
27416 inline bool focusPreviousChild() { return focusNextPrevChild(false); }
27417 public:
27418 QWidget(QWidgetPrivate &d, QWidget* parent, Qt::WindowFlags f);
27419 private:
27420 bool testAttribute_helper(Qt::WidgetAttribute) const;
27421 QLayout *takeLayout();
27422 friend class QBackingStoreDevice;
27423 friend class QWidgetBackingStore;
27424 friend class QApplication;
27425 friend class QApplicationPrivate;
27426 friend class QBaseApplication;
27427 friend class QPainter;
27428 friend class QPainterPrivate;
27429 friend class QPixmap;
27430 friend class QFontMetrics;
27431 friend class QFontInfo;
27432 friend class QETWidget;
27433 friend class QLayout;
27434 friend class QWidgetItem;
27435 friend class QWidgetItemV2;
27436 friend class QGLContext;
27437 friend class QGLWidget;
27438 friend class QGLWindowSurface;
27439 friend class QX11PaintEngine;
27440 friend class QWin32PaintEngine;
27441 friend class QShortcutPrivate;
27442 friend class QShortcutMap;
27443 friend class QWindowSurface;
27444 friend class QGraphicsProxyWidget;
27445 friend class QGraphicsProxyWidgetPrivate;
27446 friend class QStyleSheetStyle;
27447 friend struct QWidgetExceptionCleaner;
27448 friend class QGestureManager;
27449 friend class QWinNativePanGestureRecognizer;
27450 friend class QWidgetEffectSourcePrivate;
27451 friend void qt_net_update_user_time(QWidget *tlw, unsigned long timestamp);
27452 friend void qt_net_remove_user_time(QWidget *tlw);
27453 friend QWidgetData *qt_qwidget_data(QWidget *widget);
27454 friend QWidgetPrivate *qt_widget_private(QWidget *widget);
27455 private:
27456 QWidget(const QWidget &); QWidget &operator=(const QWidget &);
27457
27458 QWidgetData *data;
27459 public:
27460 virtual void styleChange(QStyle&);
27461 virtual void enabledChange(bool);
27462 virtual void paletteChange(const QPalette &);
27463 virtual void fontChange(const QFont &);
27464 virtual void windowActivationChange(bool);
27465 virtual void languageChange();
27466 };
27467 inline QFlags<QWidget::RenderFlags::enum_type> operator|(QWidget::RenderFlags::enum_type f1, QWidget::RenderFlags::enum_type f2) { return QFlags<QWidget::RenderFlags::enum_type>(f1) | f2; } inline QFlags<QWidget::RenderFlags::enum_type> operator|(QWidget::RenderFlags::enum_type f1, QFlags<QWidget::RenderFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QWidget::RenderFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
27468 template <> inline QWidget *qobject_cast<QWidget*>(QObject *o)
27469 {
27470 if (!o || !o->isWidgetType()) return 0;
27471 return static_cast<QWidget*>(o);
27472 }
27473 template <> inline const QWidget *qobject_cast<const QWidget*>(const QObject *o)
27474 {
27475 if (!o || !o->isWidgetType()) return 0;
27476 return static_cast<const QWidget*>(o);
27477 }
27478 inline QWidget *QWidget::childAt(int ax, int ay) const
27479 { return childAt(QPoint(ax, ay)); }
27480 inline Qt::WindowType QWidget::windowType() const
27481 { return static_cast<Qt::WindowType>(int(data->window_flags & Qt::WindowType_Mask)); }
27482 inline Qt::WindowFlags QWidget::windowFlags() const
27483 { return data->window_flags; }
27484 inline bool QWidget::isTopLevel() const
27485 { return (windowType() & Qt::Window); }
27486 inline bool QWidget::isWindow() const
27487 { return (windowType() & Qt::Window); }
27488 inline bool QWidget::isEnabled() const
27489 { return !testAttribute(Qt::WA_Disabled); }
27490 inline bool QWidget::isModal() const
27491 { return data->window_modality != Qt::NonModal; }
27492 inline bool QWidget::isEnabledToTLW() const
27493 { return isEnabled(); }
27494 inline int QWidget::minimumWidth() const
27495 { return minimumSize().width(); }
27496 inline int QWidget::minimumHeight() const
27497 { return minimumSize().height(); }
27498 inline int QWidget::maximumWidth() const
27499 { return maximumSize().width(); }
27500 inline int QWidget::maximumHeight() const
27501 { return maximumSize().height(); }
27502 inline void QWidget::setMinimumSize(const QSize &s)
27503 { setMinimumSize(s.width(),s.height()); }
27504 inline void QWidget::setMaximumSize(const QSize &s)
27505 { setMaximumSize(s.width(),s.height()); }
27506 inline void QWidget::setSizeIncrement(const QSize &s)
27507 { setSizeIncrement(s.width(),s.height()); }
27508 inline void QWidget::setBaseSize(const QSize &s)
27509 { setBaseSize(s.width(),s.height()); }
27510 inline const QFont &QWidget::font() const
27511 { return data->fnt; }
27512 inline QFontMetrics QWidget::fontMetrics() const
27513 { return QFontMetrics(data->fnt); }
27514 inline QFontInfo QWidget::fontInfo() const
27515 { return QFontInfo(data->fnt); }
27516 inline void QWidget::setMouseTracking(bool enable)
27517 { setAttribute(Qt::WA_MouseTracking, enable); }
27518 inline bool QWidget::hasMouseTracking() const
27519 { return testAttribute(Qt::WA_MouseTracking); }
27520 inline bool QWidget::underMouse() const
27521 { return testAttribute(Qt::WA_UnderMouse); }
27522 inline bool QWidget::updatesEnabled() const
27523 { return !testAttribute(Qt::WA_UpdatesDisabled); }
27524 inline void QWidget::update(int ax, int ay, int aw, int ah)
27525 { update(QRect(ax, ay, aw, ah)); }
27526 inline bool QWidget::isVisible() const
27527 { return testAttribute(Qt::WA_WState_Visible); }
27528 inline bool QWidget::isHidden() const
27529 { return testAttribute(Qt::WA_WState_Hidden); }
27530 inline void QWidget::move(int ax, int ay)
27531 { move(QPoint(ax, ay)); }
27532 inline void QWidget::resize(int w, int h)
27533 { resize(QSize(w, h)); }
27534 inline void QWidget::setGeometry(int ax, int ay, int aw, int ah)
27535 { setGeometry(QRect(ax, ay, aw, ah)); }
27536 inline QRect QWidget::rect() const
27537 { return QRect(0,0,data->crect.width(),data->crect.height()); }
27538 inline const QRect &QWidget::geometry() const
27539 { return data->crect; }
27540 inline QSize QWidget::size() const
27541 { return data->crect.size(); }
27542 inline int QWidget::width() const
27543 { return data->crect.width(); }
27544 inline int QWidget::height() const
27545 { return data->crect.height(); }
27546 inline QWidget *QWidget::parentWidget() const
27547 { return static_cast<QWidget *>(QObject::parent()); }
27548 inline void QWidget::setSizePolicy(QSizePolicy::Policy hor, QSizePolicy::Policy ver)
27549 { setSizePolicy(QSizePolicy(hor, ver)); }
27550 inline bool QWidget::testAttribute(Qt::WidgetAttribute attribute) const
27551 {
27552 if (attribute < int(8*sizeof(uint)))
27553 return data->widget_attributes & (1<<attribute);
27554 return testAttribute_helper(attribute);
27555 }
27556 class QNetworkProxy;
27557 class QUndoStack;
27558 class QMenu;
27559 class QNetworkRequest;
27560 class QNetworkReply;
27561 class QNetworkAccessManager;
27562 class QWebElement;
27563 class QWebFrame;
27564 class QWebNetworkRequest;
27565 class QWebHistory;
27566 class QWebPagePrivate;
27567 class QWebFrameData;
27568 class QWebNetworkInterface;
27569 class QWebPluginFactory;
27570 class QWebHitTestResult;
27571 class QWebHistoryItem;
27572 namespace WebCore {
27573 class ChromeClientQt;
27574 class EditorClientQt;
27575 class FrameLoaderClientQt;
27576 class InspectorClientQt;
27577 class ResourceHandle;
27578 class HitTestResult;
27579 class QNetworkReplyHandler;
27580 struct FrameLoadRequest;
27581 }
27582 class QWebPage : public QObject {
27583 public: template <typename T> inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); static inline QString tr(const char *s, const char *c = 0) { return staticMetaObject.tr(s, c); } static inline QString trUtf8(const char *s, const char *c = 0) { return staticMetaObject.trUtf8(s, c); } static inline QString tr(const char *s, const char *c, int n) { return staticMetaObject.tr(s, c, n); } static inline QString trUtf8(const char *s, const char *c, int n) { return staticMetaObject.trUtf8(s, c, n); } virtual int qt_metacall(QMetaObject::Call, int, void **); private:
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593 public:
27594 enum NavigationType {
27595 NavigationTypeLinkClicked,
27596 NavigationTypeFormSubmitted,
27597 NavigationTypeBackOrForward,
27598 NavigationTypeReload,
27599 NavigationTypeFormResubmitted,
27600 NavigationTypeOther
27601 };
27602 enum WebAction {
27603 NoWebAction = - 1,
27604 OpenLink,
27605 OpenLinkInNewWindow,
27606 OpenFrameInNewWindow,
27607 DownloadLinkToDisk,
27608 CopyLinkToClipboard,
27609 OpenImageInNewWindow,
27610 DownloadImageToDisk,
27611 CopyImageToClipboard,
27612 Back,
27613 Forward,
27614 Stop,
27615 Reload,
27616 Cut,
27617 Copy,
27618 Paste,
27619 Undo,
27620 Redo,
27621 MoveToNextChar,
27622 MoveToPreviousChar,
27623 MoveToNextWord,
27624 MoveToPreviousWord,
27625 MoveToNextLine,
27626 MoveToPreviousLine,
27627 MoveToStartOfLine,
27628 MoveToEndOfLine,
27629 MoveToStartOfBlock,
27630 MoveToEndOfBlock,
27631 MoveToStartOfDocument,
27632 MoveToEndOfDocument,
27633 SelectNextChar,
27634 SelectPreviousChar,
27635 SelectNextWord,
27636 SelectPreviousWord,
27637 SelectNextLine,
27638 SelectPreviousLine,
27639 SelectStartOfLine,
27640 SelectEndOfLine,
27641 SelectStartOfBlock,
27642 SelectEndOfBlock,
27643 SelectStartOfDocument,
27644 SelectEndOfDocument,
27645 DeleteStartOfWord,
27646 DeleteEndOfWord,
27647 SetTextDirectionDefault,
27648 SetTextDirectionLeftToRight,
27649 SetTextDirectionRightToLeft,
27650 ToggleBold,
27651 ToggleItalic,
27652 ToggleUnderline,
27653 InspectElement,
27654 InsertParagraphSeparator,
27655 InsertLineSeparator,
27656 SelectAll,
27657 ReloadAndBypassCache,
27658 PasteAndMatchStyle,
27659 RemoveFormat,
27660 ToggleStrikethrough,
27661 ToggleSubscript,
27662 ToggleSuperscript,
27663 InsertUnorderedList,
27664 InsertOrderedList,
27665 Indent,
27666 Outdent,
27667 AlignCenter,
27668 AlignJustified,
27669 AlignLeft,
27670 AlignRight,
27671 WebActionCount
27672 };
27673 enum FindFlag {
27674 FindBackward = 1,
27675 FindCaseSensitively = 2,
27676 FindWrapsAroundDocument = 4,
27677 HighlightAllOccurrences = 8
27678 };
27679 typedef QFlags<FindFlag> FindFlags;
27680 enum LinkDelegationPolicy {
27681 DontDelegateLinks,
27682 DelegateExternalLinks,
27683 DelegateAllLinks
27684 };
27685 enum WebWindowType {
27686 WebBrowserWindow,
27687 WebModalDialog
27688 };
27689 explicit QWebPage(QObject *parent = 0);
27690 ~QWebPage();
27691 QWebFrame *mainFrame() const;
27692 QWebFrame *currentFrame() const;
27693 QWebFrame* frameAt(const QPoint& pos) const;
27694 QWebHistory *history() const;
27695 QWebSettings *settings() const;
27696 void setView(QWidget *view);
27697 QWidget *view() const;
27698 bool isModified() const;
27699 QUndoStack *undoStack() const;
27700 void setNetworkAccessManager(QNetworkAccessManager *manager);
27701 QNetworkAccessManager *networkAccessManager() const;
27702 void setPluginFactory(QWebPluginFactory *factory);
27703 QWebPluginFactory *pluginFactory() const;
27704 quint64 totalBytes() const;
27705 quint64 bytesReceived() const;
27706 QString selectedText() const;
27707 QAction *action(WebAction action) const;
27708 virtual void triggerAction(WebAction action, bool checked = false);
27709 QSize viewportSize() const;
27710 void setViewportSize(const QSize &size) const;
27711 QSize preferredContentsSize() const;
27712 void setPreferredContentsSize(const QSize &size) const;
27713 virtual bool event(QEvent*);
27714 bool focusNextPrevChild(bool next);
27715 QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
27716 bool findText(const QString &subString, FindFlags options = 0);
27717 void setForwardUnsupportedContent(bool forward);
27718 bool forwardUnsupportedContent() const;
27719 void setLinkDelegationPolicy(LinkDelegationPolicy policy);
27720 LinkDelegationPolicy linkDelegationPolicy() const;
27721 void setPalette(const QPalette &palette);
27722 QPalette palette() const;
27723 void setContentEditable(bool editable);
27724 bool isContentEditable() const;
27725 bool swallowContextMenuEvent(QContextMenuEvent *event);
27726 void updatePositionDependentActions(const QPoint &pos);
27727 QMenu *createStandardContextMenu();
27728 enum Extension {
27729 ChooseMultipleFilesExtension,
27730 ErrorPageExtension
27731 };
27732 class ExtensionOption
27733 {};
27734 class ExtensionReturn
27735 {};
27736 class ChooseMultipleFilesExtensionOption : public ExtensionOption {
27737 public:
27738 QWebFrame *parentFrame;
27739 QStringList suggestedFileNames;
27740 };
27741 class ChooseMultipleFilesExtensionReturn : public ExtensionReturn {
27742 public:
27743 QStringList fileNames;
27744 };
27745 enum ErrorDomain { QtNetwork, Http, WebKit };
27746 class ErrorPageExtensionOption : public ExtensionOption {
27747 public:
27748 QUrl url;
27749 QWebFrame* frame;
27750 ErrorDomain domain;
27751 int error;
27752 QString errorString;
27753 };
27754 class ErrorPageExtensionReturn : public ExtensionReturn {
27755 public:
27756 ErrorPageExtensionReturn() : contentType(QLatin1String("text/html")), encoding(QLatin1String("utf-8")) {};
27757 QString contentType;
27758 QString encoding;
27759 QUrl baseUrl;
27760 QByteArray content;
27761 };
27762 virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
27763 virtual bool supportsExtension(Extension extension) const;
27764 inline QWebPagePrivate* handle() const { return d; }
27765 public :
27766 bool shouldInterruptJavaScript();
27767 public:
27768 void loadStarted();
27769 void loadProgress(int progress);
27770 void loadFinished(bool ok);
27771 void linkHovered(const QString &link, const QString &title, const QString &textContent);
27772 void statusBarMessage(const QString& text);
27773 void selectionChanged();
27774 void frameCreated(QWebFrame *frame);
27775 void geometryChangeRequested(const QRect& geom);
27776 void repaintRequested(const QRect& dirtyRect);
27777 void scrollRequested(int dx, int dy, const QRect& scrollViewRect);
27778 void windowCloseRequested();
27779 void printRequested(QWebFrame *frame);
27780 void linkClicked(const QUrl &url);
27781 void toolBarVisibilityChangeRequested(bool visible);
27782 void statusBarVisibilityChangeRequested(bool visible);
27783 void menuBarVisibilityChangeRequested(bool visible);
27784 void unsupportedContent(QNetworkReply *reply);
27785 void downloadRequested(const QNetworkRequest &request);
27786 void microFocusChanged();
27787 void contentsChanged();
27788 void databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
27789 void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
27790 void restoreFrameStateRequested(QWebFrame* frame);
27791 public:
27792 virtual QWebPage *createWindow(WebWindowType type);
27793 virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
27794 virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type);
27795 virtual QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile);
27796 virtual void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg);
27797 virtual bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg);
27798 virtual bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result);
27799 virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID);
27800 virtual QString userAgentForUrl(const QUrl& url) const;
27801 private:
27802
27803
27804
27805 QWebPagePrivate *d;
27806 friend class QWebFrame;
27807 friend class QWebPagePrivate;
27808 friend class QWebView;
27809 friend class QGraphicsWebView;
27810 friend class QWebInspector;
27811 friend class WebCore::ChromeClientQt;
27812 friend class WebCore::EditorClientQt;
27813 friend class WebCore::FrameLoaderClientQt;
27814 friend class WebCore::InspectorClientQt;
27815 friend class WebCore::ResourceHandle;
27816 friend class WebCore::QNetworkReplyHandler;
27817 };
27818 inline QFlags<QWebPage::FindFlags::enum_type> operator|(QWebPage::FindFlags::enum_type f1, QWebPage::FindFlags::enum_type f2) { return QFlags<QWebPage::FindFlags::enum_type>(f1) | f2; } inline QFlags<QWebPage::FindFlags::enum_type> operator|(QWebPage::FindFlags::enum_type f1, QFlags<QWebPage::FindFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QWebPage::FindFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
27819 extern "C" {
27820 typedef struct
27821 {
27822 __off_t __pos;
27823 __mbstate_t __state;
27824 } _G_fpos_t;
27825 typedef struct
27826 {
27827 __off64_t __pos;
27828 __mbstate_t __state;
27829 } _G_fpos64_t;
27830 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
27831 typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
27832 typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
27833 typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
27834 struct _IO_jump_t; struct _IO_FILE;
27835 typedef void _IO_lock_t;
27836 struct _IO_marker {
27837 struct _IO_marker *_next;
27838 struct _IO_FILE *_sbuf;
27839 int _pos;
27840 };
27841 enum __codecvt_result
27842 {
27843 __codecvt_ok,
27844 __codecvt_partial,
27845 __codecvt_error,
27846 __codecvt_noconv
27847 };
27848 struct _IO_FILE {
27849 int _flags;
27850 char* _IO_read_ptr;
27851 char* _IO_read_end;
27852 char* _IO_read_base;
27853 char* _IO_write_base;
27854 char* _IO_write_ptr;
27855 char* _IO_write_end;
27856 char* _IO_buf_base;
27857 char* _IO_buf_end;
27858 char *_IO_save_base;
27859 char *_IO_backup_base;
27860 char *_IO_save_end;
27861 struct _IO_marker *_markers;
27862 struct _IO_FILE *_chain;
27863 int _fileno;
27864 int _flags2;
27865 __off_t _old_offset;
27866 unsigned short _cur_column;
27867 signed char _vtable_offset;
27868 char _shortbuf[1];
27869 _IO_lock_t *_lock;
27870 __off64_t _offset;
27871 void *__pad1;
27872 void *__pad2;
27873 void *__pad3;
27874 void *__pad4;
27875 size_t __pad5;
27876 int _mode;
27877 char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
27878 };
27879 struct _IO_FILE_plus;
27880 extern struct _IO_FILE_plus _IO_2_1_stdin_;
27881 extern struct _IO_FILE_plus _IO_2_1_stdout_;
27882 extern struct _IO_FILE_plus _IO_2_1_stderr_;
27883 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
27884 typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
27885 size_t __n);
27886 typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
27887 typedef int __io_close_fn (void *__cookie);
27888 typedef __io_read_fn cookie_read_function_t;
27889 typedef __io_write_fn cookie_write_function_t;
27890 typedef __io_seek_fn cookie_seek_function_t;
27891 typedef __io_close_fn cookie_close_function_t;
27892 typedef struct
27893 {
27894 __io_read_fn *read;
27895 __io_write_fn *write;
27896 __io_seek_fn *seek;
27897 __io_close_fn *close;
27898 } _IO_cookie_io_functions_t;
27899 typedef _IO_cookie_io_functions_t cookie_io_functions_t;
27900 struct _IO_cookie_file;
27901 extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
27902 void *__cookie, _IO_cookie_io_functions_t __fns);
27903 extern "C" {
27904 extern int __underflow (_IO_FILE *);
27905 extern int __uflow (_IO_FILE *);
27906 extern int __overflow (_IO_FILE *, int);
27907 extern int _IO_getc (_IO_FILE *__fp);
27908 extern int _IO_putc (int __c, _IO_FILE *__fp);
27909 extern int _IO_feof (_IO_FILE *__fp) throw ();
27910 extern int _IO_ferror (_IO_FILE *__fp) throw ();
27911 extern int _IO_peekc_locked (_IO_FILE *__fp);
27912 extern void _IO_flockfile (_IO_FILE *) throw ();
27913 extern void _IO_funlockfile (_IO_FILE *) throw ();
27914 extern int _IO_ftrylockfile (_IO_FILE *) throw ();
27915 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
27916 __gnuc_va_list, int *__restrict);
27917 extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
27918 __gnuc_va_list);
27919 extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
27920 extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
27921 extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
27922 extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
27923 extern void _IO_free_backup_area (_IO_FILE *) throw ();
27924 }
27925 typedef _G_fpos_t fpos_t;
27926 typedef _G_fpos64_t fpos64_t;
27927 extern struct _IO_FILE *stdin;
27928 extern struct _IO_FILE *stdout;
27929 extern struct _IO_FILE *stderr;
27930 extern int remove (__const char *__filename) throw ();
27931 extern int rename (__const char *__old, __const char *__new) throw ();
27932 extern int renameat (int __oldfd, __const char *__old, int __newfd,
27933 __const char *__new) throw ();
27934 extern FILE *tmpfile (void) __attribute__ ((__warn_unused_result__));
27935 extern FILE *tmpfile64 (void) __attribute__ ((__warn_unused_result__));
27936 extern char *tmpnam (char *__s) throw () __attribute__ ((__warn_unused_result__));
27937 extern char *tmpnam_r (char *__s) throw () __attribute__ ((__warn_unused_result__));
27938 extern char *tempnam (__const char *__dir, __const char *__pfx)
27939 throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
27940 extern int fclose (FILE *__stream);
27941 extern int fflush (FILE *__stream);
27942 extern int fflush_unlocked (FILE *__stream);
27943 extern int fcloseall (void);
27944 extern FILE *fopen (__const char *__restrict __filename,
27945 __const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
27946 extern FILE *freopen (__const char *__restrict __filename,
27947 __const char *__restrict __modes,
27948 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
27949 extern FILE *fopen64 (__const char *__restrict __filename,
27950 __const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
27951 extern FILE *freopen64 (__const char *__restrict __filename,
27952 __const char *__restrict __modes,
27953 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
27954 extern FILE *fdopen (int __fd, __const char *__modes) throw () __attribute__ ((__warn_unused_result__));
27955 extern FILE *fopencookie (void *__restrict __magic_cookie,
27956 __const char *__restrict __modes,
27957 _IO_cookie_io_functions_t __io_funcs) throw () __attribute__ ((__warn_unused_result__));
27958 extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
27959 throw () __attribute__ ((__warn_unused_result__));
27960 extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () __attribute__ ((__warn_unused_result__));
27961 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
27962 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
27963 int __modes, size_t __n) throw ();
27964 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
27965 size_t __size) throw ();
27966 extern void setlinebuf (FILE *__stream) throw ();
27967 extern int fprintf (FILE *__restrict __stream,
27968 __const char *__restrict __format, ...);
27969 extern int printf (__const char *__restrict __format, ...);
27970 extern int sprintf (char *__restrict __s,
27971 __const char *__restrict __format, ...) throw ();
27972 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
27973 __gnuc_va_list __arg);
27974 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
27975 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
27976 __gnuc_va_list __arg) throw ();
27977 extern int snprintf (char *__restrict __s, size_t __maxlen,
27978 __const char *__restrict __format, ...)
27979 throw () __attribute__ ((__format__ (__printf__, 3, 4)));
27980 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
27981 __const char *__restrict __format, __gnuc_va_list __arg)
27982 throw () __attribute__ ((__format__ (__printf__, 3, 0)));
27983 extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
27984 __gnuc_va_list __arg)
27985 throw () __attribute__ ((__format__ (__printf__, 2, 0))) __attribute__ ((__warn_unused_result__));
27986 extern int __asprintf (char **__restrict __ptr,
27987 __const char *__restrict __fmt, ...)
27988 throw () __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
27989 extern int asprintf (char **__restrict __ptr,
27990 __const char *__restrict __fmt, ...)
27991 throw () __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
27992 extern int vdprintf (int __fd, __const char *__restrict __fmt,
27993 __gnuc_va_list __arg)
27994 __attribute__ ((__format__ (__printf__, 2, 0)));
27995 extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
27996 __attribute__ ((__format__ (__printf__, 2, 3)));
27997 extern int fscanf (FILE *__restrict __stream,
27998 __const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
27999 extern int scanf (__const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
28000 extern int sscanf (__const char *__restrict __s,
28001 __const char *__restrict __format, ...) throw ();
28002 extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
28003 __gnuc_va_list __arg)
28004 __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__));
28005 extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
28006 __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__));
28007 extern int vsscanf (__const char *__restrict __s,
28008 __const char *__restrict __format, __gnuc_va_list __arg)
28009 throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
28010 extern int fgetc (FILE *__stream);
28011 extern int getc (FILE *__stream);
28012 extern int getchar (void);
28013 extern int getc_unlocked (FILE *__stream);
28014 extern int getchar_unlocked (void);
28015 extern int fgetc_unlocked (FILE *__stream);
28016 extern int fputc (int __c, FILE *__stream);
28017 extern int putc (int __c, FILE *__stream);
28018 extern int putchar (int __c);
28019 extern int fputc_unlocked (int __c, FILE *__stream);
28020 extern int putc_unlocked (int __c, FILE *__stream);
28021 extern int putchar_unlocked (int __c);
28022 extern int getw (FILE *__stream);
28023 extern int putw (int __w, FILE *__stream);
28024 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
28025 __attribute__ ((__warn_unused_result__));
28026 extern char *gets (char *__s) __attribute__ ((__warn_unused_result__));
28027 extern char *fgets_unlocked (char *__restrict __s, int __n,
28028 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28029 extern __ssize_t __getdelim (char **__restrict __lineptr,
28030 size_t *__restrict __n, int __delimiter,
28031 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28032 extern __ssize_t getdelim (char **__restrict __lineptr,
28033 size_t *__restrict __n, int __delimiter,
28034 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28035 extern __ssize_t getline (char **__restrict __lineptr,
28036 size_t *__restrict __n,
28037 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28038 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
28039 extern int puts (__const char *__s);
28040 extern int ungetc (int __c, FILE *__stream);
28041 extern size_t fread (void *__restrict __ptr, size_t __size,
28042 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28043 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
28044 size_t __n, FILE *__restrict __s) __attribute__ ((__warn_unused_result__));
28045 extern int fputs_unlocked (__const char *__restrict __s,
28046 FILE *__restrict __stream);
28047 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
28048 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28049 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
28050 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28051 extern int fseek (FILE *__stream, long int __off, int __whence);
28052 extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__));
28053 extern void rewind (FILE *__stream);
28054 extern int fseeko (FILE *__stream, __off_t __off, int __whence);
28055 extern __off_t ftello (FILE *__stream) __attribute__ ((__warn_unused_result__));
28056 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
28057 extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
28058 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
28059 extern __off64_t ftello64 (FILE *__stream) __attribute__ ((__warn_unused_result__));
28060 extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
28061 extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
28062 extern void clearerr (FILE *__stream) throw ();
28063 extern int feof (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28064 extern int ferror (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28065 extern void clearerr_unlocked (FILE *__stream) throw ();
28066 extern int feof_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28067 extern int ferror_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28068 extern void perror (__const char *__s);
28069 extern int sys_nerr;
28070 extern __const char *__const sys_errlist[];
28071 extern int _sys_nerr;
28072 extern __const char *__const _sys_errlist[];
28073 extern int fileno (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28074 extern int fileno_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28075 extern FILE *popen (__const char *__command, __const char *__modes) __attribute__ ((__warn_unused_result__));
28076 extern int pclose (FILE *__stream);
28077 extern char *ctermid (char *__s) throw ();
28078 extern char *cuserid (char *__s);
28079 struct obstack;
28080 extern int obstack_printf (struct obstack *__restrict __obstack,
28081 __const char *__restrict __format, ...)
28082 throw () __attribute__ ((__format__ (__printf__, 2, 3)));
28083 extern int obstack_vprintf (struct obstack *__restrict __obstack,
28084 __const char *__restrict __format,
28085 __gnuc_va_list __args)
28086 throw () __attribute__ ((__format__ (__printf__, 2, 0)));
28087 extern void flockfile (FILE *__stream) throw ();
28088 extern int ftrylockfile (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
28089 extern void funlockfile (FILE *__stream) throw ();
28090 extern __inline __attribute__ ((__gnu_inline__)) int
28091 getchar (void)
28092 {
28093 return _IO_getc (stdin);
28094 }
28095 extern __inline __attribute__ ((__gnu_inline__)) int
28096 fgetc_unlocked (FILE *__fp)
28097 {
28098 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
28099 }
28100 extern __inline __attribute__ ((__gnu_inline__)) int
28101 getc_unlocked (FILE *__fp)
28102 {
28103 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
28104 }
28105 extern __inline __attribute__ ((__gnu_inline__)) int
28106 getchar_unlocked (void)
28107 {
28108 return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
28109 }
28110 extern __inline __attribute__ ((__gnu_inline__)) int
28111 putchar (int __c)
28112 {
28113 return _IO_putc (__c, stdout);
28114 }
28115 extern __inline __attribute__ ((__gnu_inline__)) int
28116 fputc_unlocked (int __c, FILE *__stream)
28117 {
28118 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
28119 }
28120 extern __inline __attribute__ ((__gnu_inline__)) int
28121 putc_unlocked (int __c, FILE *__stream)
28122 {
28123 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
28124 }
28125 extern __inline __attribute__ ((__gnu_inline__)) int
28126 putchar_unlocked (int __c)
28127 {
28128 return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
28129 }
28130 extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
28131 getline (char **__lineptr, size_t *__n, FILE *__stream)
28132 {
28133 return __getdelim (__lineptr, __n, '\n', __stream);
28134 }
28135 extern __inline __attribute__ ((__gnu_inline__)) int
28136 feof_unlocked (FILE *__stream) throw ()
28137 {
28138 return (((__stream)->_flags & 0x10) != 0);
28139 }
28140 extern __inline __attribute__ ((__gnu_inline__)) int
28141 ferror_unlocked (FILE *__stream) throw ()
28142 {
28143 return (((__stream)->_flags & 0x20) != 0);
28144 }
28145 extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
28146 __const char *__restrict __format, ...) throw ();
28147 extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
28148 __const char *__restrict __format,
28149 __gnuc_va_list __ap) throw ();
28150 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28151 sprintf (char *__restrict __s, __const char *__restrict __fmt, ...) throw ()
28152 {
28153 return __builtin___sprintf_chk (__s, 2 - 1,
28154 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
28155 }
28156 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28157 vsprintf (char *__restrict __s, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
28158 {
28159 return __builtin___vsprintf_chk (__s, 2 - 1,
28160 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
28161 }
28162 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
28163 size_t __slen, __const char *__restrict __format,
28164 ...) throw ();
28165 extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
28166 size_t __slen, __const char *__restrict __format,
28167 __gnuc_va_list __ap) throw ();
28168 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28169 snprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...) throw ()
28170 {
28171 return __builtin___snprintf_chk (__s, __n, 2 - 1,
28172 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
28173 }
28174 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28175 vsnprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
28176 {
28177 return __builtin___vsnprintf_chk (__s, __n, 2 - 1,
28178 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
28179 }
28180 extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
28181 __const char *__restrict __format, ...);
28182 extern int __printf_chk (int __flag, __const char *__restrict __format, ...);
28183 extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
28184 __const char *__restrict __format, __gnuc_va_list __ap);
28185 extern int __vprintf_chk (int __flag, __const char *__restrict __format,
28186 __gnuc_va_list __ap);
28187 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28188 fprintf (FILE *__restrict __stream, __const char *__restrict __fmt, ...)
28189 {
28190 return __fprintf_chk (__stream, 2 - 1, __fmt,
28191 __builtin_va_arg_pack ());
28192 }
28193 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28194 printf (__const char *__restrict __fmt, ...)
28195 {
28196 return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ());
28197 }
28198 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28199 vprintf (__const char *__restrict __fmt, __gnuc_va_list __ap)
28200 {
28201 return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap);
28202 }
28203 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28204 vfprintf (FILE *__restrict __stream,
28205 __const char *__restrict __fmt, __gnuc_va_list __ap)
28206 {
28207 return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap);
28208 }
28209 extern int __asprintf_chk (char **__restrict __ptr, int __flag,
28210 __const char *__restrict __fmt, ...)
28211 throw () __attribute__ ((__format__ (__printf__, 3, 4))) __attribute__ ((__warn_unused_result__));
28212 extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
28213 __const char *__restrict __fmt, __gnuc_va_list __arg)
28214 throw () __attribute__ ((__format__ (__printf__, 3, 0))) __attribute__ ((__warn_unused_result__));
28215 extern int __dprintf_chk (int __fd, int __flag, __const char *__restrict __fmt,
28216 ...) __attribute__ ((__format__ (__printf__, 3, 4)));
28217 extern int __vdprintf_chk (int __fd, int __flag,
28218 __const char *__restrict __fmt, __gnuc_va_list __arg)
28219 __attribute__ ((__format__ (__printf__, 3, 0)));
28220 extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
28221 int __flag, __const char *__restrict __format,
28222 ...)
28223 throw () __attribute__ ((__format__ (__printf__, 3, 4)));
28224 extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
28225 int __flag,
28226 __const char *__restrict __format,
28227 __gnuc_va_list __args)
28228 throw () __attribute__ ((__format__ (__printf__, 3, 0)));
28229 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28230 asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) throw ()
28231 {
28232 return __asprintf_chk (__ptr, 2 - 1, __fmt,
28233 __builtin_va_arg_pack ());
28234 }
28235 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28236 __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) throw ()
28237 {
28238 return __asprintf_chk (__ptr, 2 - 1, __fmt,
28239 __builtin_va_arg_pack ());
28240 }
28241 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28242 dprintf (int __fd, __const char *__restrict __fmt, ...)
28243 {
28244 return __dprintf_chk (__fd, 2 - 1, __fmt,
28245 __builtin_va_arg_pack ());
28246 }
28247 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28248 obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, ...) throw ()
28249 {
28250 return __obstack_printf_chk (__obstack, 2 - 1, __fmt,
28251 __builtin_va_arg_pack ());
28252 }
28253 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28254 vasprintf (char **__restrict __ptr, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
28255 {
28256 return __vasprintf_chk (__ptr, 2 - 1, __fmt, __ap);
28257 }
28258 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28259 vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __ap)
28260 {
28261 return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap);
28262 }
28263 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
28264 obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
28265 {
28266 return __obstack_vprintf_chk (__obstack, 2 - 1, __fmt,
28267 __ap);
28268 }
28269 extern char *__gets_chk (char *__str, size_t) __attribute__ ((__warn_unused_result__));
28270 extern char *__gets_warn (char *__str) __asm__ ("" "gets")
28271 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use fgets or getline instead, gets can't " "specify buffer size")))
28272 ;
28273 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
28274 gets (char *__str)
28275 {
28276 if (__builtin_object_size (__str, 2 > 1) != (size_t) -1)
28277 return __gets_chk (__str, __builtin_object_size (__str, 2 > 1));
28278 return __gets_warn (__str);
28279 }
28280 extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
28281 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28282 extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets")
28283 __attribute__ ((__warn_unused_result__));
28284 extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk")
28285 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer")))
28286 ;
28287 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
28288 fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
28289 {
28290 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
28291 {
28292 if (!__builtin_constant_p (__n) || __n <= 0)
28293 return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
28294 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
28295 return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
28296 }
28297 return __fgets_alias (__s, __n, __stream);
28298 }
28299 extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
28300 size_t __size, size_t __n,
28301 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28302 extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread")
28303 __attribute__ ((__warn_unused_result__));
28304 extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk")
28305 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer")))
28306 ;
28307 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
28308 fread (void *__restrict __ptr, size_t __size, size_t __n,
28309 FILE *__restrict __stream)
28310 {
28311 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
28312 {
28313 if (!__builtin_constant_p (__size)
28314 || !__builtin_constant_p (__n)
28315 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
28316 return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
28317 if (__size * __n > __builtin_object_size (__ptr, 0))
28318 return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
28319 }
28320 return __fread_alias (__ptr, __size, __n, __stream);
28321 }
28322 extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
28323 int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28324 extern char *__fgets_unlocked_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets_unlocked")
28325 __attribute__ ((__warn_unused_result__));
28326 extern char *__fgets_unlocked_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_unlocked_chk")
28327 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets_unlocked called with bigger size than length " "of destination buffer")))
28328 ;
28329 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
28330 fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
28331 {
28332 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
28333 {
28334 if (!__builtin_constant_p (__n) || __n <= 0)
28335 return __fgets_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
28336 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
28337 return __fgets_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
28338 }
28339 return __fgets_unlocked_alias (__s, __n, __stream);
28340 }
28341 extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
28342 size_t __size, size_t __n,
28343 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
28344 extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked")
28345 __attribute__ ((__warn_unused_result__));
28346 extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk")
28347 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer")))
28348 ;
28349 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
28350 fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
28351 FILE *__restrict __stream)
28352 {
28353 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
28354 {
28355 if (!__builtin_constant_p (__size)
28356 || !__builtin_constant_p (__n)
28357 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
28358 return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
28359 __stream);
28360 if (__size * __n > __builtin_object_size (__ptr, 0))
28361 return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
28362 __stream);
28363 }
28364 if (__builtin_constant_p (__size)
28365 && __builtin_constant_p (__n)
28366 && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
28367 && __size * __n <= 8)
28368 {
28369 size_t __cnt = __size * __n;
28370 char *__cptr = (char *) __ptr;
28371 if (__cnt == 0)
28372 return 0;
28373 for (; __cnt > 0; --__cnt)
28374 {
28375 int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++);
28376 if (__c == (-1))
28377 break;
28378 *__cptr++ = __c;
28379 }
28380 return (__cptr - (char *) __ptr) / __size;
28381 }
28382 return __fread_unlocked_alias (__ptr, __size, __n, __stream);
28383 }
28384 }
28385 extern "C" {
28386 extern int *__errno_location (void) throw () __attribute__ ((__const__));
28387 extern char *program_invocation_name, *program_invocation_short_name;
28388 }
28389 typedef int error_t;
28390 typedef unsigned char uint8_t;
28391 typedef unsigned short int uint16_t;
28392 typedef unsigned int uint32_t;
28393 typedef unsigned long int uint64_t;
28394 typedef signed char int_least8_t;
28395 typedef short int int_least16_t;
28396 typedef int int_least32_t;
28397 typedef long int int_least64_t;
28398 typedef unsigned char uint_least8_t;
28399 typedef unsigned short int uint_least16_t;
28400 typedef unsigned int uint_least32_t;
28401 typedef unsigned long int uint_least64_t;
28402 typedef signed char int_fast8_t;
28403 typedef long int int_fast16_t;
28404 typedef long int int_fast32_t;
28405 typedef long int int_fast64_t;
28406 typedef unsigned char uint_fast8_t;
28407 typedef unsigned long int uint_fast16_t;
28408 typedef unsigned long int uint_fast32_t;
28409 typedef unsigned long int uint_fast64_t;
28410 typedef unsigned long int uintptr_t;
28411 typedef long int intmax_t;
28412 typedef unsigned long int uintmax_t;
28413 typedef uintptr_t Py_uintptr_t;
28414 typedef intptr_t Py_intptr_t;
28415 typedef ssize_t Py_ssize_t;
28416 extern "C" {
28417 typedef float float_t;
28418 typedef double double_t;
28419 extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
28420 extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
28421 extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
28422 extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
28423 extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
28424 extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
28425 extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
28426 extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
28427 extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
28428 extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
28429 extern void sincos (double __x, double *__sinx, double *__cosx) throw (); extern void __sincos (double __x, double *__sinx, double *__cosx) throw ()
28430 ;
28431 extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
28432 extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
28433 extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
28434 extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
28435 extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
28436 extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
28437 extern double log (double __x) throw (); extern double __log (double __x) throw ();
28438 extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
28439 extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ();
28440 extern double exp10 (double __x) throw (); extern double __exp10 (double __x) throw ();
28441 extern double pow10 (double __x) throw (); extern double __pow10 (double __x) throw ();
28442 extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
28443 extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
28444 extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
28445 extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
28446 extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
28447 extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
28448 extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
28449 extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
28450 extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
28451 extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
28452 extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
28453 extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
28454 extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
28455 extern int __isinf (double __value) throw () __attribute__ ((__const__));
28456 extern int __finite (double __value) throw () __attribute__ ((__const__));
28457 extern int isinf (double __value) throw () __attribute__ ((__const__));
28458 extern int finite (double __value) throw () __attribute__ ((__const__));
28459 extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
28460 extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
28461 extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
28462 extern double nan (__const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (__const char *__tagb) throw () __attribute__ ((__const__));
28463 extern int __isnan (double __value) throw () __attribute__ ((__const__));
28464 extern int isnan (double __value) throw () __attribute__ ((__const__));
28465 extern double j0 (double) throw (); extern double __j0 (double) throw ();
28466 extern double j1 (double) throw (); extern double __j1 (double) throw ();
28467 extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
28468 extern double y0 (double) throw (); extern double __y0 (double) throw ();
28469 extern double y1 (double) throw (); extern double __y1 (double) throw ();
28470 extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
28471 extern double erf (double) throw (); extern double __erf (double) throw ();
28472 extern double erfc (double) throw (); extern double __erfc (double) throw ();
28473 extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
28474 extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
28475 extern double gamma (double) throw (); extern double __gamma (double) throw ();
28476 extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
28477 extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
28478 extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
28479 extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
28480 extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
28481 extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
28482 extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
28483 extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
28484 extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
28485 extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
28486 extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
28487 extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
28488 extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
28489 extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
28490 extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
28491 extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
28492 extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
28493 extern double fmax (double __x, double __y) throw (); extern double __fmax (double __x, double __y) throw ();
28494 extern double fmin (double __x, double __y) throw (); extern double __fmin (double __x, double __y) throw ();
28495 extern int __fpclassify (double __value) throw ()
28496 __attribute__ ((__const__));
28497 extern int __signbit (double __value) throw ()
28498 __attribute__ ((__const__));
28499 extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
28500 extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
28501 extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
28502 extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
28503 extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
28504 extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
28505 extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
28506 extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
28507 extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
28508 extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
28509 extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
28510 extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
28511 extern void
28512 sincosf
28513 (float __x, float *__sinx, float *__cosx) throw (); extern void
28514 __sincosf
28515 (float __x, float *__sinx, float *__cosx) throw ()
28516 ;
28517 extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
28518 extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
28519 extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
28520 extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
28521 extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
28522 extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
28523 extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
28524 extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
28525 extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ();
28526 extern float exp10f (float __x) throw (); extern float __exp10f (float __x) throw ();
28527 extern float pow10f (float __x) throw (); extern float __pow10f (float __x) throw ();
28528 extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
28529 extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
28530 extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
28531 extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
28532 extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
28533 extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
28534 extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
28535 extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
28536 extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
28537 extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
28538 extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
28539 extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
28540 extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
28541 extern int __isinff (float __value) throw () __attribute__ ((__const__));
28542 extern int __finitef (float __value) throw () __attribute__ ((__const__));
28543 extern int isinff (float __value) throw () __attribute__ ((__const__));
28544 extern int finitef (float __value) throw () __attribute__ ((__const__));
28545 extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
28546 extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
28547 extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
28548 extern float nanf (__const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) throw () __attribute__ ((__const__));
28549 extern int __isnanf (float __value) throw () __attribute__ ((__const__));
28550 extern int isnanf (float __value) throw () __attribute__ ((__const__));
28551 extern float j0f (float) throw (); extern float __j0f (float) throw ();
28552 extern float j1f (float) throw (); extern float __j1f (float) throw ();
28553 extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
28554 extern float y0f (float) throw (); extern float __y0f (float) throw ();
28555 extern float y1f (float) throw (); extern float __y1f (float) throw ();
28556 extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
28557 extern float erff (float) throw (); extern float __erff (float) throw ();
28558 extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
28559 extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
28560 extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
28561 extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
28562 extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
28563 extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
28564 extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
28565 extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
28566 extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
28567 extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
28568 extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
28569 extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
28570 extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
28571 extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
28572 extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
28573 extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
28574 extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
28575 extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
28576 extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
28577 extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
28578 extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
28579 extern float fmaxf (float __x, float __y) throw (); extern float __fmaxf (float __x, float __y) throw ();
28580 extern float fminf (float __x, float __y) throw (); extern float __fminf (float __x, float __y) throw ();
28581 extern int __fpclassifyf (float __value) throw ()
28582 __attribute__ ((__const__));
28583 extern int __signbitf (float __value) throw ()
28584 __attribute__ ((__const__));
28585 extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
28586 extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
28587 extern long double acosl (long double __x) throw (); extern long double __acosl (long double __x) throw ();
28588 extern long double asinl (long double __x) throw (); extern long double __asinl (long double __x) throw ();
28589 extern long double atanl (long double __x) throw (); extern long double __atanl (long double __x) throw ();
28590 extern long double atan2l (long double __y, long double __x) throw (); extern long double __atan2l (long double __y, long double __x) throw ();
28591 extern long double cosl (long double __x) throw (); extern long double __cosl (long double __x) throw ();
28592 extern long double sinl (long double __x) throw (); extern long double __sinl (long double __x) throw ();
28593 extern long double tanl (long double __x) throw (); extern long double __tanl (long double __x) throw ();
28594 extern long double coshl (long double __x) throw (); extern long double __coshl (long double __x) throw ();
28595 extern long double sinhl (long double __x) throw (); extern long double __sinhl (long double __x) throw ();
28596 extern long double tanhl (long double __x) throw (); extern long double __tanhl (long double __x) throw ();
28597 extern void
28598 sincosl
28599 (long double __x, long double *__sinx, long double *__cosx) throw (); extern void
28600 __sincosl
28601 (long double __x, long double *__sinx, long double *__cosx) throw ()
28602 ;
28603 extern long double acoshl (long double __x) throw (); extern long double __acoshl (long double __x) throw ();
28604 extern long double asinhl (long double __x) throw (); extern long double __asinhl (long double __x) throw ();
28605 extern long double atanhl (long double __x) throw (); extern long double __atanhl (long double __x) throw ();
28606 extern long double expl (long double __x) throw (); extern long double __expl (long double __x) throw ();
28607 extern long double frexpl (long double __x, int *__exponent) throw (); extern long double __frexpl (long double __x, int *__exponent) throw ();
28608 extern long double ldexpl (long double __x, int __exponent) throw (); extern long double __ldexpl (long double __x, int __exponent) throw ();
28609 extern long double logl (long double __x) throw (); extern long double __logl (long double __x) throw ();
28610 extern long double log10l (long double __x) throw (); extern long double __log10l (long double __x) throw ();
28611 extern long double modfl (long double __x, long double *__iptr) throw (); extern long double __modfl (long double __x, long double *__iptr) throw ();
28612 extern long double exp10l (long double __x) throw (); extern long double __exp10l (long double __x) throw ();
28613 extern long double pow10l (long double __x) throw (); extern long double __pow10l (long double __x) throw ();
28614 extern long double expm1l (long double __x) throw (); extern long double __expm1l (long double __x) throw ();
28615 extern long double log1pl (long double __x) throw (); extern long double __log1pl (long double __x) throw ();
28616 extern long double logbl (long double __x) throw (); extern long double __logbl (long double __x) throw ();
28617 extern long double exp2l (long double __x) throw (); extern long double __exp2l (long double __x) throw ();
28618 extern long double log2l (long double __x) throw (); extern long double __log2l (long double __x) throw ();
28619 extern long double powl (long double __x, long double __y) throw (); extern long double __powl (long double __x, long double __y) throw ();
28620 extern long double sqrtl (long double __x) throw (); extern long double __sqrtl (long double __x) throw ();
28621 extern long double hypotl (long double __x, long double __y) throw (); extern long double __hypotl (long double __x, long double __y) throw ();
28622 extern long double cbrtl (long double __x) throw (); extern long double __cbrtl (long double __x) throw ();
28623 extern long double ceill (long double __x) throw () __attribute__ ((__const__)); extern long double __ceill (long double __x) throw () __attribute__ ((__const__));
28624 extern long double fabsl (long double __x) throw () __attribute__ ((__const__)); extern long double __fabsl (long double __x) throw () __attribute__ ((__const__));
28625 extern long double floorl (long double __x) throw () __attribute__ ((__const__)); extern long double __floorl (long double __x) throw () __attribute__ ((__const__));
28626 extern long double fmodl (long double __x, long double __y) throw (); extern long double __fmodl (long double __x, long double __y) throw ();
28627 extern int __isinfl (long double __value) throw () __attribute__ ((__const__));
28628 extern int __finitel (long double __value) throw () __attribute__ ((__const__));
28629 extern int isinfl (long double __value) throw () __attribute__ ((__const__));
28630 extern int finitel (long double __value) throw () __attribute__ ((__const__));
28631 extern long double dreml (long double __x, long double __y) throw (); extern long double __dreml (long double __x, long double __y) throw ();
28632 extern long double significandl (long double __x) throw (); extern long double __significandl (long double __x) throw ();
28633 extern long double copysignl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) throw () __attribute__ ((__const__));
28634 extern long double nanl (__const char *__tagb) throw () __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) throw () __attribute__ ((__const__));
28635 extern int __isnanl (long double __value) throw () __attribute__ ((__const__));
28636 extern int isnanl (long double __value) throw () __attribute__ ((__const__));
28637 extern long double j0l (long double) throw (); extern long double __j0l (long double) throw ();
28638 extern long double j1l (long double) throw (); extern long double __j1l (long double) throw ();
28639 extern long double jnl (int, long double) throw (); extern long double __jnl (int, long double) throw ();
28640 extern long double y0l (long double) throw (); extern long double __y0l (long double) throw ();
28641 extern long double y1l (long double) throw (); extern long double __y1l (long double) throw ();
28642 extern long double ynl (int, long double) throw (); extern long double __ynl (int, long double) throw ();
28643 extern long double erfl (long double) throw (); extern long double __erfl (long double) throw ();
28644 extern long double erfcl (long double) throw (); extern long double __erfcl (long double) throw ();
28645 extern long double lgammal (long double) throw (); extern long double __lgammal (long double) throw ();
28646 extern long double tgammal (long double) throw (); extern long double __tgammal (long double) throw ();
28647 extern long double gammal (long double) throw (); extern long double __gammal (long double) throw ();
28648 extern long double lgammal_r (long double, int *__signgamp) throw (); extern long double __lgammal_r (long double, int *__signgamp) throw ();
28649 extern long double rintl (long double __x) throw (); extern long double __rintl (long double __x) throw ();
28650 extern long double nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__));
28651 extern long double nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__));
28652 extern long double remainderl (long double __x, long double __y) throw (); extern long double __remainderl (long double __x, long double __y) throw ();
28653 extern long double scalbnl (long double __x, int __n) throw (); extern long double __scalbnl (long double __x, int __n) throw ();
28654 extern int ilogbl (long double __x) throw (); extern int __ilogbl (long double __x) throw ();
28655 extern long double scalblnl (long double __x, long int __n) throw (); extern long double __scalblnl (long double __x, long int __n) throw ();
28656 extern long double nearbyintl (long double __x) throw (); extern long double __nearbyintl (long double __x) throw ();
28657 extern long double roundl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundl (long double __x) throw () __attribute__ ((__const__));
28658 extern long double truncl (long double __x) throw () __attribute__ ((__const__)); extern long double __truncl (long double __x) throw () __attribute__ ((__const__));
28659 extern long double remquol (long double __x, long double __y, int *__quo) throw (); extern long double __remquol (long double __x, long double __y, int *__quo) throw ();
28660 extern long int lrintl (long double __x) throw (); extern long int __lrintl (long double __x) throw ();
28661 extern long long int llrintl (long double __x) throw (); extern long long int __llrintl (long double __x) throw ();
28662 extern long int lroundl (long double __x) throw (); extern long int __lroundl (long double __x) throw ();
28663 extern long long int llroundl (long double __x) throw (); extern long long int __llroundl (long double __x) throw ();
28664 extern long double fdiml (long double __x, long double __y) throw (); extern long double __fdiml (long double __x, long double __y) throw ();
28665 extern long double fmaxl (long double __x, long double __y) throw (); extern long double __fmaxl (long double __x, long double __y) throw ();
28666 extern long double fminl (long double __x, long double __y) throw (); extern long double __fminl (long double __x, long double __y) throw ();
28667 extern int __fpclassifyl (long double __value) throw ()
28668 __attribute__ ((__const__));
28669 extern int __signbitl (long double __value) throw ()
28670 __attribute__ ((__const__));
28671 extern long double fmal (long double __x, long double __y, long double __z) throw (); extern long double __fmal (long double __x, long double __y, long double __z) throw ();
28672 extern long double scalbl (long double __x, long double __n) throw (); extern long double __scalbl (long double __x, long double __n) throw ();
28673 extern int signgam;
28674 enum
28675 {
28676 FP_NAN,
28677 FP_INFINITE,
28678 FP_ZERO,
28679 FP_SUBNORMAL,
28680 FP_NORMAL
28681 };
28682 typedef enum
28683 {
28684 _IEEE_ = -1,
28685 _SVID_,
28686 _XOPEN_,
28687 _POSIX_,
28688 _ISOC_
28689 } _LIB_VERSION_TYPE;
28690 extern _LIB_VERSION_TYPE _LIB_VERSION;
28691 struct __exception
28692 {
28693 int type;
28694 char *name;
28695 double arg1;
28696 double arg2;
28697 double retval;
28698 };
28699 extern int matherr (struct __exception *__exc) throw ();
28700 extern __inline __attribute__ ((__gnu_inline__)) int
28701 __signbitf (float __x) throw ()
28702 {
28703 int __m;
28704 __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
28705 return __m & 0x8;
28706 }
28707 extern __inline __attribute__ ((__gnu_inline__)) int
28708 __signbit (double __x) throw ()
28709 {
28710 int __m;
28711 __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
28712 return __m & 0x80;
28713 }
28714 extern __inline __attribute__ ((__gnu_inline__)) int
28715 __signbitl (long double __x) throw ()
28716 {
28717 __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
28718 return (__u.__i[2] & 0x8000) != 0;
28719 }
28720 }
28721 extern "C" {
28722 struct timezone
28723 {
28724 int tz_minuteswest;
28725 int tz_dsttime;
28726 };
28727 typedef struct timezone *__restrict __timezone_ptr_t;
28728 extern int gettimeofday (struct timeval *__restrict __tv,
28729 __timezone_ptr_t __tz) throw () __attribute__ ((__nonnull__ (1)));
28730 extern int settimeofday (__const struct timeval *__tv,
28731 __const struct timezone *__tz)
28732 throw () __attribute__ ((__nonnull__ (1)));
28733 extern int adjtime (__const struct timeval *__delta,
28734 struct timeval *__olddelta) throw ();
28735 enum __itimer_which
28736 {
28737 ITIMER_REAL = 0,
28738 ITIMER_VIRTUAL = 1,
28739 ITIMER_PROF = 2
28740 };
28741 struct itimerval
28742 {
28743 struct timeval it_interval;
28744 struct timeval it_value;
28745 };
28746 typedef int __itimer_which_t;
28747 extern int getitimer (__itimer_which_t __which,
28748 struct itimerval *__value) throw ();
28749 extern int setitimer (__itimer_which_t __which,
28750 __const struct itimerval *__restrict __new,
28751 struct itimerval *__restrict __old) throw ();
28752 extern int utimes (__const char *__file, __const struct timeval __tvp[2])
28753 throw () __attribute__ ((__nonnull__ (1)));
28754 extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
28755 throw () __attribute__ ((__nonnull__ (1)));
28756 extern int futimes (int __fd, __const struct timeval __tvp[2]) throw ();
28757 extern int futimesat (int __fd, __const char *__file,
28758 __const struct timeval __tvp[2]) throw ();
28759 }
28760 extern "C" {
28761 struct stat
28762 {
28763 __dev_t st_dev;
28764 __ino_t st_ino;
28765 __nlink_t st_nlink;
28766 __mode_t st_mode;
28767 __uid_t st_uid;
28768 __gid_t st_gid;
28769 int __pad0;
28770 __dev_t st_rdev;
28771 __off_t st_size;
28772 __blksize_t st_blksize;
28773 __blkcnt_t st_blocks;
28774 struct timespec st_atim;
28775 struct timespec st_mtim;
28776 struct timespec st_ctim;
28777 long int __unused[3];
28778 };
28779 struct stat64
28780 {
28781 __dev_t st_dev;
28782 __ino64_t st_ino;
28783 __nlink_t st_nlink;
28784 __mode_t st_mode;
28785 __uid_t st_uid;
28786 __gid_t st_gid;
28787 int __pad0;
28788 __dev_t st_rdev;
28789 __off_t st_size;
28790 __blksize_t st_blksize;
28791 __blkcnt64_t st_blocks;
28792 struct timespec st_atim;
28793 struct timespec st_mtim;
28794 struct timespec st_ctim;
28795 long int __unused[3];
28796 };
28797 extern int stat (__const char *__restrict __file,
28798 struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2)));
28799 extern int fstat (int __fd, struct stat *__buf) throw () __attribute__ ((__nonnull__ (2)));
28800 extern int stat64 (__const char *__restrict __file,
28801 struct stat64 *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2)));
28802 extern int fstat64 (int __fd, struct stat64 *__buf) throw () __attribute__ ((__nonnull__ (2)));
28803 extern int fstatat (int __fd, __const char *__restrict __file,
28804 struct stat *__restrict __buf, int __flag)
28805 throw () __attribute__ ((__nonnull__ (2, 3)));
28806 extern int fstatat64 (int __fd, __const char *__restrict __file,
28807 struct stat64 *__restrict __buf, int __flag)
28808 throw () __attribute__ ((__nonnull__ (2, 3)));
28809 extern int lstat (__const char *__restrict __file,
28810 struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2)));
28811 extern int lstat64 (__const char *__restrict __file,
28812 struct stat64 *__restrict __buf)
28813 throw () __attribute__ ((__nonnull__ (1, 2)));
28814 extern int chmod (__const char *__file, __mode_t __mode)
28815 throw () __attribute__ ((__nonnull__ (1)));
28816 extern int lchmod (__const char *__file, __mode_t __mode)
28817 throw () __attribute__ ((__nonnull__ (1)));
28818 extern int fchmod (int __fd, __mode_t __mode) throw ();
28819 extern int fchmodat (int __fd, __const char *__file, __mode_t __mode,
28820 int __flag)
28821 throw () __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
28822 extern __mode_t umask (__mode_t __mask) throw ();
28823 extern __mode_t getumask (void) throw ();
28824 extern int mkdir (__const char *__path, __mode_t __mode)
28825 throw () __attribute__ ((__nonnull__ (1)));
28826 extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
28827 throw () __attribute__ ((__nonnull__ (2)));
28828 extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
28829 throw () __attribute__ ((__nonnull__ (1)));
28830 extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
28831 __dev_t __dev) throw () __attribute__ ((__nonnull__ (2)));
28832 extern int mkfifo (__const char *__path, __mode_t __mode)
28833 throw () __attribute__ ((__nonnull__ (1)));
28834 extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
28835 throw () __attribute__ ((__nonnull__ (2)));
28836 extern int utimensat (int __fd, __const char *__path,
28837 __const struct timespec __times[2],
28838 int __flags)
28839 throw () __attribute__ ((__nonnull__ (2)));
28840 extern int futimens (int __fd, __const struct timespec __times[2]) throw ();
28841 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
28842 throw () __attribute__ ((__nonnull__ (3)));
28843 extern int __xstat (int __ver, __const char *__filename,
28844 struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
28845 extern int __lxstat (int __ver, __const char *__filename,
28846 struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
28847 extern int __fxstatat (int __ver, int __fildes, __const char *__filename,
28848 struct stat *__stat_buf, int __flag)
28849 throw () __attribute__ ((__nonnull__ (3, 4)));
28850 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
28851 throw () __attribute__ ((__nonnull__ (3)));
28852 extern int __xstat64 (int __ver, __const char *__filename,
28853 struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
28854 extern int __lxstat64 (int __ver, __const char *__filename,
28855 struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3)));
28856 extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename,
28857 struct stat64 *__stat_buf, int __flag)
28858 throw () __attribute__ ((__nonnull__ (3, 4)));
28859 extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
28860 __dev_t *__dev) throw () __attribute__ ((__nonnull__ (2, 4)));
28861 extern int __xmknodat (int __ver, int __fd, __const char *__path,
28862 __mode_t __mode, __dev_t *__dev)
28863 throw () __attribute__ ((__nonnull__ (3, 5)));
28864 extern __inline __attribute__ ((__gnu_inline__)) int
28865 stat (__const char *__path, struct stat *__statbuf) throw ()
28866 {
28867 return __xstat (1, __path, __statbuf);
28868 }
28869 extern __inline __attribute__ ((__gnu_inline__)) int
28870 lstat (__const char *__path, struct stat *__statbuf) throw ()
28871 {
28872 return __lxstat (1, __path, __statbuf);
28873 }
28874 extern __inline __attribute__ ((__gnu_inline__)) int
28875 fstat (int __fd, struct stat *__statbuf) throw ()
28876 {
28877 return __fxstat (1, __fd, __statbuf);
28878 }
28879 extern __inline __attribute__ ((__gnu_inline__)) int
28880 fstatat (int __fd, __const char *__filename, struct stat *__statbuf, int __flag) throw ()
28881 {
28882 return __fxstatat (1, __fd, __filename, __statbuf, __flag);
28883 }
28884 extern __inline __attribute__ ((__gnu_inline__)) int
28885 mknod (__const char *__path, __mode_t __mode, __dev_t __dev) throw ()
28886 {
28887 return __xmknod (0, __path, __mode, &__dev);
28888 }
28889 extern __inline __attribute__ ((__gnu_inline__)) int
28890 mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev) throw ()
28891 {
28892 return __xmknodat (0, __fd, __path, __mode, &__dev);
28893 }
28894 extern __inline __attribute__ ((__gnu_inline__)) int
28895 stat64 (__const char *__path, struct stat64 *__statbuf) throw ()
28896 {
28897 return __xstat64 (1, __path, __statbuf);
28898 }
28899 extern __inline __attribute__ ((__gnu_inline__)) int
28900 lstat64 (__const char *__path, struct stat64 *__statbuf) throw ()
28901 {
28902 return __lxstat64 (1, __path, __statbuf);
28903 }
28904 extern __inline __attribute__ ((__gnu_inline__)) int
28905 fstat64 (int __fd, struct stat64 *__statbuf) throw ()
28906 {
28907 return __fxstat64 (1, __fd, __statbuf);
28908 }
28909 extern __inline __attribute__ ((__gnu_inline__)) int
28910 fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf, int __flag) throw ()
28911 {
28912 return __fxstatat64 (1, __fd, __filename, __statbuf, __flag);
28913 }
28914 }
28915 extern "C" {
28916 }
28917 extern "C" {
28918 void * PyMem_Malloc(size_t);
28919 void * PyMem_Realloc(void *, size_t);
28920 void PyMem_Free(void *);
28921 }
28922 extern "C" {
28923 typedef struct _object {
28924 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
28925 } PyObject;
28926 typedef struct {
28927 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
28928 } PyVarObject;
28929 typedef PyObject * (*unaryfunc)(PyObject *);
28930 typedef PyObject * (*binaryfunc)(PyObject *, PyObject *);
28931 typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *);
28932 typedef int (*inquiry)(PyObject *);
28933 typedef Py_ssize_t (*lenfunc)(PyObject *);
28934 typedef int (*coercion)(PyObject **, PyObject **);
28935 typedef PyObject *(*intargfunc)(PyObject *, int) __attribute__((__deprecated__));
28936 typedef PyObject *(*intintargfunc)(PyObject *, int, int) __attribute__((__deprecated__));
28937 typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
28938 typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
28939 typedef int(*intobjargproc)(PyObject *, int, PyObject *);
28940 typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *);
28941 typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
28942 typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
28943 typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
28944 typedef int (*getreadbufferproc)(PyObject *, int, void **);
28945 typedef int (*getwritebufferproc)(PyObject *, int, void **);
28946 typedef int (*getsegcountproc)(PyObject *, int *);
28947 typedef int (*getcharbufferproc)(PyObject *, int, char **);
28948 typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);
28949 typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);
28950 typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *);
28951 typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);
28952 typedef struct bufferinfo {
28953 void *buf;
28954 PyObject *obj;
28955 Py_ssize_t len;
28956 Py_ssize_t itemsize;
28957 int readonly;
28958 int ndim;
28959 char *format;
28960 Py_ssize_t *shape;
28961 Py_ssize_t *strides;
28962 Py_ssize_t *suboffsets;
28963 void *internal;
28964 } Py_buffer;
28965 typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
28966 typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
28967 typedef int (*objobjproc)(PyObject *, PyObject *);
28968 typedef int (*visitproc)(PyObject *, void *);
28969 typedef int (*traverseproc)(PyObject *, visitproc, void *);
28970 typedef struct {
28971 binaryfunc nb_add;
28972 binaryfunc nb_subtract;
28973 binaryfunc nb_multiply;
28974 binaryfunc nb_divide;
28975 binaryfunc nb_remainder;
28976 binaryfunc nb_divmod;
28977 ternaryfunc nb_power;
28978 unaryfunc nb_negative;
28979 unaryfunc nb_positive;
28980 unaryfunc nb_absolute;
28981 inquiry nb_nonzero;
28982 unaryfunc nb_invert;
28983 binaryfunc nb_lshift;
28984 binaryfunc nb_rshift;
28985 binaryfunc nb_and;
28986 binaryfunc nb_xor;
28987 binaryfunc nb_or;
28988 coercion nb_coerce;
28989 unaryfunc nb_int;
28990 unaryfunc nb_long;
28991 unaryfunc nb_float;
28992 unaryfunc nb_oct;
28993 unaryfunc nb_hex;
28994 binaryfunc nb_inplace_add;
28995 binaryfunc nb_inplace_subtract;
28996 binaryfunc nb_inplace_multiply;
28997 binaryfunc nb_inplace_divide;
28998 binaryfunc nb_inplace_remainder;
28999 ternaryfunc nb_inplace_power;
29000 binaryfunc nb_inplace_lshift;
29001 binaryfunc nb_inplace_rshift;
29002 binaryfunc nb_inplace_and;
29003 binaryfunc nb_inplace_xor;
29004 binaryfunc nb_inplace_or;
29005 binaryfunc nb_floor_divide;
29006 binaryfunc nb_true_divide;
29007 binaryfunc nb_inplace_floor_divide;
29008 binaryfunc nb_inplace_true_divide;
29009 unaryfunc nb_index;
29010 } PyNumberMethods;
29011 typedef struct {
29012 lenfunc sq_length;
29013 binaryfunc sq_concat;
29014 ssizeargfunc sq_repeat;
29015 ssizeargfunc sq_item;
29016 ssizessizeargfunc sq_slice;
29017 ssizeobjargproc sq_ass_item;
29018 ssizessizeobjargproc sq_ass_slice;
29019 objobjproc sq_contains;
29020 binaryfunc sq_inplace_concat;
29021 ssizeargfunc sq_inplace_repeat;
29022 } PySequenceMethods;
29023 typedef struct {
29024 lenfunc mp_length;
29025 binaryfunc mp_subscript;
29026 objobjargproc mp_ass_subscript;
29027 } PyMappingMethods;
29028 typedef struct {
29029 readbufferproc bf_getreadbuffer;
29030 writebufferproc bf_getwritebuffer;
29031 segcountproc bf_getsegcount;
29032 charbufferproc bf_getcharbuffer;
29033 getbufferproc bf_getbuffer;
29034 releasebufferproc bf_releasebuffer;
29035 } PyBufferProcs;
29036 typedef void (*freefunc)(void *);
29037 typedef void (*destructor)(PyObject *);
29038 typedef int (*printfunc)(PyObject *, FILE *, int);
29039 typedef PyObject *(*getattrfunc)(PyObject *, char *);
29040 typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
29041 typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
29042 typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
29043 typedef int (*cmpfunc)(PyObject *, PyObject *);
29044 typedef PyObject *(*reprfunc)(PyObject *);
29045 typedef long (*hashfunc)(PyObject *);
29046 typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int);
29047 typedef PyObject *(*getiterfunc) (PyObject *);
29048 typedef PyObject *(*iternextfunc) (PyObject *);
29049 typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *);
29050 typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *);
29051 typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
29052 typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);
29053 typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t);
29054 typedef struct _typeobject {
29055 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
29056 const char *tp_name;
29057 Py_ssize_t tp_basicsize, tp_itemsize;
29058 destructor tp_dealloc;
29059 printfunc tp_print;
29060 getattrfunc tp_getattr;
29061 setattrfunc tp_setattr;
29062 cmpfunc tp_compare;
29063 reprfunc tp_repr;
29064 PyNumberMethods *tp_as_number;
29065 PySequenceMethods *tp_as_sequence;
29066 PyMappingMethods *tp_as_mapping;
29067 hashfunc tp_hash;
29068 ternaryfunc tp_call;
29069 reprfunc tp_str;
29070 getattrofunc tp_getattro;
29071 setattrofunc tp_setattro;
29072 PyBufferProcs *tp_as_buffer;
29073 long tp_flags;
29074 const char *tp_doc;
29075 traverseproc tp_traverse;
29076 inquiry tp_clear;
29077 richcmpfunc tp_richcompare;
29078 Py_ssize_t tp_weaklistoffset;
29079 getiterfunc tp_iter;
29080 iternextfunc tp_iternext;
29081 struct PyMethodDef *tp_methods;
29082 struct PyMemberDef *tp_members;
29083 struct PyGetSetDef *tp_getset;
29084 struct _typeobject *tp_base;
29085 PyObject *tp_dict;
29086 descrgetfunc tp_descr_get;
29087 descrsetfunc tp_descr_set;
29088 Py_ssize_t tp_dictoffset;
29089 initproc tp_init;
29090 allocfunc tp_alloc;
29091 newfunc tp_new;
29092 freefunc tp_free;
29093 inquiry tp_is_gc;
29094 PyObject *tp_bases;
29095 PyObject *tp_mro;
29096 PyObject *tp_cache;
29097 PyObject *tp_subclasses;
29098 PyObject *tp_weaklist;
29099 destructor tp_del;
29100 unsigned int tp_version_tag;
29101 } PyTypeObject;
29102 typedef struct _heaptypeobject {
29103 PyTypeObject ht_type;
29104 PyNumberMethods as_number;
29105 PyMappingMethods as_mapping;
29106 PySequenceMethods as_sequence;
29107 PyBufferProcs as_buffer;
29108 PyObject *ht_name, *ht_slots;
29109 } PyHeapTypeObject;
29110 int PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
29111 extern PyTypeObject PyType_Type;
29112 extern PyTypeObject PyBaseObject_Type;
29113 extern PyTypeObject PySuper_Type;
29114 int PyType_Ready(PyTypeObject *);
29115 PyObject * PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
29116 PyObject * PyType_GenericNew(PyTypeObject *,
29117 PyObject *, PyObject *);
29118 PyObject * _PyType_Lookup(PyTypeObject *, PyObject *);
29119 unsigned int PyType_ClearCache(void);
29120 void PyType_Modified(PyTypeObject *);
29121 int PyObject_Print(PyObject *, FILE *, int);
29122 void _PyObject_Dump(PyObject *);
29123 PyObject * PyObject_Repr(PyObject *);
29124 PyObject * _PyObject_Str(PyObject *);
29125 PyObject * PyObject_Str(PyObject *);
29126 PyObject * PyObject_Unicode(PyObject *);
29127 int PyObject_Compare(PyObject *, PyObject *);
29128 PyObject * PyObject_RichCompare(PyObject *, PyObject *, int);
29129 int PyObject_RichCompareBool(PyObject *, PyObject *, int);
29130 PyObject * PyObject_GetAttrString(PyObject *, const char *);
29131 int PyObject_SetAttrString(PyObject *, const char *, PyObject *);
29132 int PyObject_HasAttrString(PyObject *, const char *);
29133 PyObject * PyObject_GetAttr(PyObject *, PyObject *);
29134 int PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
29135 int PyObject_HasAttr(PyObject *, PyObject *);
29136 PyObject ** _PyObject_GetDictPtr(PyObject *);
29137 PyObject * PyObject_SelfIter(PyObject *);
29138 PyObject * PyObject_GenericGetAttr(PyObject *, PyObject *);
29139 int PyObject_GenericSetAttr(PyObject *,
29140 PyObject *, PyObject *);
29141 long PyObject_Hash(PyObject *);
29142 long PyObject_HashNotImplemented(PyObject *);
29143 int PyObject_IsTrue(PyObject *);
29144 int PyObject_Not(PyObject *);
29145 int PyCallable_Check(PyObject *);
29146 int PyNumber_Coerce(PyObject **, PyObject **);
29147 int PyNumber_CoerceEx(PyObject **, PyObject **);
29148 void PyObject_ClearWeakRefs(PyObject *);
29149 extern int _PyObject_SlotCompare(PyObject *, PyObject *);
29150 PyObject * PyObject_Dir(PyObject *);
29151 int Py_ReprEnter(PyObject *);
29152 void Py_ReprLeave(PyObject *);
29153 long _Py_HashDouble(double);
29154 long _Py_HashPointer(void*);
29155 void Py_IncRef(PyObject *);
29156 void Py_DecRef(PyObject *);
29157 extern PyObject _Py_NoneStruct;
29158 extern PyObject _Py_NotImplementedStruct;
29159 extern int _Py_SwappedOp[];
29160 void _PyTrash_deposit_object(PyObject*);
29161 void _PyTrash_destroy_chain(void);
29162 extern int _PyTrash_delete_nesting;
29163 extern PyObject * _PyTrash_delete_later;
29164 }
29165 extern "C" {
29166 void * PyObject_Malloc(size_t);
29167 void * PyObject_Realloc(void *, size_t);
29168 void PyObject_Free(void *);
29169 PyObject * PyObject_Init(PyObject *, PyTypeObject *);
29170 PyVarObject * PyObject_InitVar(PyVarObject *,
29171 PyTypeObject *, Py_ssize_t);
29172 PyObject * _PyObject_New(PyTypeObject *);
29173 PyVarObject * _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
29174 Py_ssize_t PyGC_Collect(void);
29175 PyVarObject * _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
29176 typedef union _gc_head {
29177 struct {
29178 union _gc_head *gc_next;
29179 union _gc_head *gc_prev;
29180 Py_ssize_t gc_refs;
29181 } gc;
29182 long double dummy;
29183 } PyGC_Head;
29184 extern PyGC_Head *_PyGC_generation0;
29185 PyObject * _PyObject_GC_Malloc(size_t);
29186 PyObject * _PyObject_GC_New(PyTypeObject *);
29187 PyVarObject * _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t);
29188 void PyObject_GC_Track(void *);
29189 void PyObject_GC_UnTrack(void *);
29190 void PyObject_GC_Del(void *);
29191 }
29192 extern "C" {
29193 extern int Py_DebugFlag;
29194 extern int Py_VerboseFlag;
29195 extern int Py_InteractiveFlag;
29196 extern int Py_InspectFlag;
29197 extern int Py_OptimizeFlag;
29198 extern int Py_NoSiteFlag;
29199 extern int Py_BytesWarningFlag;
29200 extern int Py_UseClassExceptionsFlag;
29201 extern int Py_FrozenFlag;
29202 extern int Py_TabcheckFlag;
29203 extern int Py_UnicodeFlag;
29204 extern int Py_IgnoreEnvironmentFlag;
29205 extern int Py_DivisionWarningFlag;
29206 extern int Py_DontWriteBytecodeFlag;
29207 extern int Py_NoUserSiteDirectory;
29208 extern int _Py_QnewFlag;
29209 extern int Py_Py3kWarningFlag;
29210 void Py_FatalError(const char *message);
29211 }
29212 typedef unsigned int Py_UCS4;
29213 typedef Py_UCS4 Py_UNICODE;
29214 extern "C" {
29215 typedef struct {
29216 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29217 Py_ssize_t length;
29218 Py_UNICODE *str;
29219 long hash;
29220 PyObject *defenc;
29221 } PyUnicodeObject;
29222 extern PyTypeObject PyUnicode_Type;
29223 PyObject* PyUnicodeUCS4_FromUnicode(
29224 const Py_UNICODE *u,
29225 Py_ssize_t size
29226 );
29227 PyObject* PyUnicodeUCS4_FromStringAndSize(
29228 const char *u,
29229 Py_ssize_t size
29230 );
29231 PyObject* PyUnicodeUCS4_FromString(
29232 const char *u
29233 );
29234 Py_UNICODE * PyUnicodeUCS4_AsUnicode(
29235 PyObject *unicode
29236 );
29237 Py_ssize_t PyUnicodeUCS4_GetSize(
29238 PyObject *unicode
29239 );
29240 Py_UNICODE PyUnicodeUCS4_GetMax(void);
29241 int PyUnicodeUCS4_Resize(
29242 PyObject **unicode,
29243 Py_ssize_t length
29244 );
29245 PyObject* PyUnicodeUCS4_FromEncodedObject(
29246 register PyObject *obj,
29247 const char *encoding,
29248 const char *errors
29249 );
29250 PyObject* PyUnicodeUCS4_FromObject(
29251 register PyObject *obj
29252 );
29253 PyObject * PyUnicodeUCS4_FromFormatV(const char*, va_list);
29254 PyObject * PyUnicodeUCS4_FromFormat(const char*, ...);
29255 PyObject * _PyUnicode_FormatAdvanced(PyObject *obj,
29256 Py_UNICODE *format_spec,
29257 Py_ssize_t format_spec_len);
29258 PyObject* PyUnicodeUCS4_FromWideChar(
29259 register const wchar_t *w,
29260 Py_ssize_t size
29261 );
29262 Py_ssize_t PyUnicodeUCS4_AsWideChar(
29263 PyUnicodeObject *unicode,
29264 register wchar_t *w,
29265 Py_ssize_t size
29266 );
29267 PyObject* PyUnicodeUCS4_FromOrdinal(int ordinal);
29268 int PyUnicodeUCS4_ClearFreelist(void);
29269 PyObject * _PyUnicodeUCS4_AsDefaultEncodedString(
29270 PyObject *, const char *);
29271 const char* PyUnicodeUCS4_GetDefaultEncoding(void);
29272 int PyUnicodeUCS4_SetDefaultEncoding(
29273 const char *encoding
29274 );
29275 PyObject* PyUnicodeUCS4_Decode(
29276 const char *s,
29277 Py_ssize_t size,
29278 const char *encoding,
29279 const char *errors
29280 );
29281 PyObject* PyUnicodeUCS4_Encode(
29282 const Py_UNICODE *s,
29283 Py_ssize_t size,
29284 const char *encoding,
29285 const char *errors
29286 );
29287 PyObject* PyUnicodeUCS4_AsEncodedObject(
29288 PyObject *unicode,
29289 const char *encoding,
29290 const char *errors
29291 );
29292 PyObject* PyUnicodeUCS4_AsEncodedString(
29293 PyObject *unicode,
29294 const char *encoding,
29295 const char *errors
29296 );
29297 PyObject* PyUnicode_BuildEncodingMap(
29298 PyObject* string
29299 );
29300 PyObject* PyUnicode_DecodeUTF7(
29301 const char *string,
29302 Py_ssize_t length,
29303 const char *errors
29304 );
29305 PyObject* PyUnicode_DecodeUTF7Stateful(
29306 const char *string,
29307 Py_ssize_t length,
29308 const char *errors,
29309 Py_ssize_t *consumed
29310 );
29311 PyObject* PyUnicode_EncodeUTF7(
29312 const Py_UNICODE *data,
29313 Py_ssize_t length,
29314 int encodeSetO,
29315 int encodeWhiteSpace,
29316 const char *errors
29317 );
29318 PyObject* PyUnicodeUCS4_DecodeUTF8(
29319 const char *string,
29320 Py_ssize_t length,
29321 const char *errors
29322 );
29323 PyObject* PyUnicodeUCS4_DecodeUTF8Stateful(
29324 const char *string,
29325 Py_ssize_t length,
29326 const char *errors,
29327 Py_ssize_t *consumed
29328 );
29329 PyObject* PyUnicodeUCS4_AsUTF8String(
29330 PyObject *unicode
29331 );
29332 PyObject* PyUnicodeUCS4_EncodeUTF8(
29333 const Py_UNICODE *data,
29334 Py_ssize_t length,
29335 const char *errors
29336 );
29337 PyObject* PyUnicodeUCS4_DecodeUTF32(
29338 const char *string,
29339 Py_ssize_t length,
29340 const char *errors,
29341 int *byteorder
29342 );
29343 PyObject* PyUnicodeUCS4_DecodeUTF32Stateful(
29344 const char *string,
29345 Py_ssize_t length,
29346 const char *errors,
29347 int *byteorder,
29348 Py_ssize_t *consumed
29349 );
29350 PyObject* PyUnicodeUCS4_AsUTF32String(
29351 PyObject *unicode
29352 );
29353 PyObject* PyUnicodeUCS4_EncodeUTF32(
29354 const Py_UNICODE *data,
29355 Py_ssize_t length,
29356 const char *errors,
29357 int byteorder
29358 );
29359 PyObject* PyUnicodeUCS4_DecodeUTF16(
29360 const char *string,
29361 Py_ssize_t length,
29362 const char *errors,
29363 int *byteorder
29364 );
29365 PyObject* PyUnicodeUCS4_DecodeUTF16Stateful(
29366 const char *string,
29367 Py_ssize_t length,
29368 const char *errors,
29369 int *byteorder,
29370 Py_ssize_t *consumed
29371 );
29372 PyObject* PyUnicodeUCS4_AsUTF16String(
29373 PyObject *unicode
29374 );
29375 PyObject* PyUnicodeUCS4_EncodeUTF16(
29376 const Py_UNICODE *data,
29377 Py_ssize_t length,
29378 const char *errors,
29379 int byteorder
29380 );
29381 PyObject* PyUnicodeUCS4_DecodeUnicodeEscape(
29382 const char *string,
29383 Py_ssize_t length,
29384 const char *errors
29385 );
29386 PyObject* PyUnicodeUCS4_AsUnicodeEscapeString(
29387 PyObject *unicode
29388 );
29389 PyObject* PyUnicodeUCS4_EncodeUnicodeEscape(
29390 const Py_UNICODE *data,
29391 Py_ssize_t length
29392 );
29393 PyObject* PyUnicodeUCS4_DecodeRawUnicodeEscape(
29394 const char *string,
29395 Py_ssize_t length,
29396 const char *errors
29397 );
29398 PyObject* PyUnicodeUCS4_AsRawUnicodeEscapeString(
29399 PyObject *unicode
29400 );
29401 PyObject* PyUnicodeUCS4_EncodeRawUnicodeEscape(
29402 const Py_UNICODE *data,
29403 Py_ssize_t length
29404 );
29405 PyObject *_PyUnicode_DecodeUnicodeInternal(
29406 const char *string,
29407 Py_ssize_t length,
29408 const char *errors
29409 );
29410 PyObject* PyUnicodeUCS4_DecodeLatin1(
29411 const char *string,
29412 Py_ssize_t length,
29413 const char *errors
29414 );
29415 PyObject* PyUnicodeUCS4_AsLatin1String(
29416 PyObject *unicode
29417 );
29418 PyObject* PyUnicodeUCS4_EncodeLatin1(
29419 const Py_UNICODE *data,
29420 Py_ssize_t length,
29421 const char *errors
29422 );
29423 PyObject* PyUnicodeUCS4_DecodeASCII(
29424 const char *string,
29425 Py_ssize_t length,
29426 const char *errors
29427 );
29428 PyObject* PyUnicodeUCS4_AsASCIIString(
29429 PyObject *unicode
29430 );
29431 PyObject* PyUnicodeUCS4_EncodeASCII(
29432 const Py_UNICODE *data,
29433 Py_ssize_t length,
29434 const char *errors
29435 );
29436 PyObject* PyUnicodeUCS4_DecodeCharmap(
29437 const char *string,
29438 Py_ssize_t length,
29439 PyObject *mapping,
29440 const char *errors
29441 );
29442 PyObject* PyUnicodeUCS4_AsCharmapString(
29443 PyObject *unicode,
29444 PyObject *mapping
29445 );
29446 PyObject* PyUnicodeUCS4_EncodeCharmap(
29447 const Py_UNICODE *data,
29448 Py_ssize_t length,
29449 PyObject *mapping,
29450 const char *errors
29451 );
29452 PyObject * PyUnicodeUCS4_TranslateCharmap(
29453 const Py_UNICODE *data,
29454 Py_ssize_t length,
29455 PyObject *table,
29456 const char *errors
29457 );
29458 int PyUnicodeUCS4_EncodeDecimal(
29459 Py_UNICODE *s,
29460 Py_ssize_t length,
29461 char *output,
29462 const char *errors
29463 );
29464 PyObject* PyUnicodeUCS4_Concat(
29465 PyObject *left,
29466 PyObject *right
29467 );
29468 PyObject* PyUnicodeUCS4_Split(
29469 PyObject *s,
29470 PyObject *sep,
29471 Py_ssize_t maxsplit
29472 );
29473 PyObject* PyUnicodeUCS4_Splitlines(
29474 PyObject *s,
29475 int keepends
29476 );
29477 PyObject* PyUnicodeUCS4_Partition(
29478 PyObject *s,
29479 PyObject *sep
29480 );
29481 PyObject* PyUnicodeUCS4_RPartition(
29482 PyObject *s,
29483 PyObject *sep
29484 );
29485 PyObject* PyUnicodeUCS4_RSplit(
29486 PyObject *s,
29487 PyObject *sep,
29488 Py_ssize_t maxsplit
29489 );
29490 PyObject * PyUnicodeUCS4_Translate(
29491 PyObject *str,
29492 PyObject *table,
29493 const char *errors
29494 );
29495 PyObject* PyUnicodeUCS4_Join(
29496 PyObject *separator,
29497 PyObject *seq
29498 );
29499 Py_ssize_t PyUnicodeUCS4_Tailmatch(
29500 PyObject *str,
29501 PyObject *substr,
29502 Py_ssize_t start,
29503 Py_ssize_t end,
29504 int direction
29505 );
29506 Py_ssize_t PyUnicodeUCS4_Find(
29507 PyObject *str,
29508 PyObject *substr,
29509 Py_ssize_t start,
29510 Py_ssize_t end,
29511 int direction
29512 );
29513 Py_ssize_t PyUnicodeUCS4_Count(
29514 PyObject *str,
29515 PyObject *substr,
29516 Py_ssize_t start,
29517 Py_ssize_t end
29518 );
29519 PyObject * PyUnicodeUCS4_Replace(
29520 PyObject *str,
29521 PyObject *substr,
29522 PyObject *replstr,
29523 Py_ssize_t maxcount
29524 );
29525 int PyUnicodeUCS4_Compare(
29526 PyObject *left,
29527 PyObject *right
29528 );
29529 PyObject * PyUnicodeUCS4_RichCompare(
29530 PyObject *left,
29531 PyObject *right,
29532 int op
29533 );
29534 PyObject * PyUnicodeUCS4_Format(
29535 PyObject *format,
29536 PyObject *args
29537 );
29538 int PyUnicodeUCS4_Contains(
29539 PyObject *container,
29540 PyObject *element
29541 );
29542 PyObject * _PyUnicode_XStrip(
29543 PyUnicodeObject *self,
29544 int striptype,
29545 PyObject *sepobj
29546 );
29547 extern const unsigned char _Py_ascii_whitespace[];
29548 int _PyUnicodeUCS4_IsLowercase(
29549 Py_UNICODE ch
29550 );
29551 int _PyUnicodeUCS4_IsUppercase(
29552 Py_UNICODE ch
29553 );
29554 int _PyUnicodeUCS4_IsTitlecase(
29555 Py_UNICODE ch
29556 );
29557 int _PyUnicodeUCS4_IsWhitespace(
29558 const Py_UNICODE ch
29559 );
29560 int _PyUnicodeUCS4_IsLinebreak(
29561 const Py_UNICODE ch
29562 );
29563 Py_UNICODE _PyUnicodeUCS4_ToLowercase(
29564 Py_UNICODE ch
29565 );
29566 Py_UNICODE _PyUnicodeUCS4_ToUppercase(
29567 Py_UNICODE ch
29568 );
29569 Py_UNICODE _PyUnicodeUCS4_ToTitlecase(
29570 Py_UNICODE ch
29571 );
29572 int _PyUnicodeUCS4_ToDecimalDigit(
29573 Py_UNICODE ch
29574 );
29575 int _PyUnicodeUCS4_ToDigit(
29576 Py_UNICODE ch
29577 );
29578 double _PyUnicodeUCS4_ToNumeric(
29579 Py_UNICODE ch
29580 );
29581 int _PyUnicodeUCS4_IsDecimalDigit(
29582 Py_UNICODE ch
29583 );
29584 int _PyUnicodeUCS4_IsDigit(
29585 Py_UNICODE ch
29586 );
29587 int _PyUnicodeUCS4_IsNumeric(
29588 Py_UNICODE ch
29589 );
29590 int _PyUnicodeUCS4_IsAlpha(
29591 Py_UNICODE ch
29592 );
29593 }
29594 extern "C" {
29595 typedef struct {
29596 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29597 long ob_ival;
29598 } PyIntObject;
29599 extern PyTypeObject PyInt_Type;
29600 PyObject * PyInt_FromString(char*, char**, int);
29601 PyObject * PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
29602 PyObject * PyInt_FromLong(long);
29603 PyObject * PyInt_FromSize_t(size_t);
29604 PyObject * PyInt_FromSsize_t(Py_ssize_t);
29605 long PyInt_AsLong(PyObject *);
29606 Py_ssize_t PyInt_AsSsize_t(PyObject *);
29607 unsigned long PyInt_AsUnsignedLongMask(PyObject *);
29608 unsigned long long PyInt_AsUnsignedLongLongMask(PyObject *);
29609 long PyInt_GetMax(void);
29610 unsigned long PyOS_strtoul(char *, char **, int);
29611 long PyOS_strtol(char *, char **, int);
29612 int PyInt_ClearFreeList(void);
29613 PyObject* _PyInt_Format(PyIntObject* v, int base, int newstyle);
29614 PyObject * _PyInt_FormatAdvanced(PyObject *obj,
29615 char *format_spec,
29616 Py_ssize_t format_spec_len);
29617 }
29618 extern "C" {
29619 typedef PyIntObject PyBoolObject;
29620 extern PyTypeObject PyBool_Type;
29621 extern PyIntObject _Py_ZeroStruct, _Py_TrueStruct;
29622 PyObject * PyBool_FromLong(long);
29623 }
29624 extern "C" {
29625 typedef struct _longobject PyLongObject;
29626 extern PyTypeObject PyLong_Type;
29627 PyObject * PyLong_FromLong(long);
29628 PyObject * PyLong_FromUnsignedLong(unsigned long);
29629 PyObject * PyLong_FromDouble(double);
29630 PyObject * PyLong_FromSize_t(size_t);
29631 PyObject * PyLong_FromSsize_t(Py_ssize_t);
29632 long PyLong_AsLong(PyObject *);
29633 unsigned long PyLong_AsUnsignedLong(PyObject *);
29634 unsigned long PyLong_AsUnsignedLongMask(PyObject *);
29635 Py_ssize_t PyLong_AsSsize_t(PyObject *);
29636 extern int _PyLong_DigitValue[256];
29637 double _PyLong_AsScaledDouble(PyObject *vv, int *e);
29638 double PyLong_AsDouble(PyObject *);
29639 PyObject * PyLong_FromVoidPtr(void *);
29640 void * PyLong_AsVoidPtr(PyObject *);
29641 PyObject * PyLong_FromLongLong(long long);
29642 PyObject * PyLong_FromUnsignedLongLong(unsigned long long);
29643 long long PyLong_AsLongLong(PyObject *);
29644 unsigned long long PyLong_AsUnsignedLongLong(PyObject *);
29645 unsigned long long PyLong_AsUnsignedLongLongMask(PyObject *);
29646 PyObject * PyLong_FromString(char *, char **, int);
29647 PyObject * PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
29648 int _PyLong_Sign(PyObject *v);
29649 size_t _PyLong_NumBits(PyObject *v);
29650 PyObject * _PyLong_FromByteArray(
29651 const unsigned char* bytes, size_t n,
29652 int little_endian, int is_signed);
29653 int _PyLong_AsByteArray(PyLongObject* v,
29654 unsigned char* bytes, size_t n,
29655 int little_endian, int is_signed);
29656 PyObject * _PyLong_Format(PyObject *aa, int base, int addL, int newstyle);
29657 PyObject * _PyLong_FormatAdvanced(PyObject *obj,
29658 char *format_spec,
29659 Py_ssize_t format_spec_len);
29660 }
29661 extern "C" {
29662 typedef struct {
29663 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29664 double ob_fval;
29665 } PyFloatObject;
29666 extern PyTypeObject PyFloat_Type;
29667 double PyFloat_GetMax(void);
29668 double PyFloat_GetMin(void);
29669 PyObject * PyFloat_GetInfo(void);
29670 PyObject * PyFloat_FromString(PyObject*, char** junk);
29671 PyObject * PyFloat_FromDouble(double);
29672 double PyFloat_AsDouble(PyObject *);
29673 void PyFloat_AsReprString(char*, PyFloatObject *v);
29674 void PyFloat_AsString(char*, PyFloatObject *v);
29675 int _PyFloat_Pack4(double x, unsigned char *p, int le);
29676 int _PyFloat_Pack8(double x, unsigned char *p, int le);
29677 int _PyFloat_Digits(char *buf, double v, int *signum);
29678 void _PyFloat_DigitsInit(void);
29679 double _PyFloat_Unpack4(const unsigned char *p, int le);
29680 double _PyFloat_Unpack8(const unsigned char *p, int le);
29681 int PyFloat_ClearFreeList(void);
29682 PyObject * _PyFloat_FormatAdvanced(PyObject *obj,
29683 char *format_spec,
29684 Py_ssize_t format_spec_len);
29685 }
29686 extern "C" {
29687 typedef struct {
29688 double real;
29689 double imag;
29690 } Py_complex;
29691 Py_complex _Py_c_sum(Py_complex, Py_complex);
29692 Py_complex _Py_c_diff(Py_complex, Py_complex);
29693 Py_complex _Py_c_neg(Py_complex);
29694 Py_complex _Py_c_prod(Py_complex, Py_complex);
29695 Py_complex _Py_c_quot(Py_complex, Py_complex);
29696 Py_complex _Py_c_pow(Py_complex, Py_complex);
29697 double _Py_c_abs(Py_complex);
29698 typedef struct {
29699 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29700 Py_complex cval;
29701 } PyComplexObject;
29702 extern PyTypeObject PyComplex_Type;
29703 PyObject * PyComplex_FromCComplex(Py_complex);
29704 PyObject * PyComplex_FromDoubles(double real, double imag);
29705 double PyComplex_RealAsDouble(PyObject *op);
29706 double PyComplex_ImagAsDouble(PyObject *op);
29707 Py_complex PyComplex_AsCComplex(PyObject *op);
29708 }
29709 extern "C" {
29710 extern PyTypeObject PyRange_Type;
29711 }
29712 extern "C" {
29713 typedef struct {
29714 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
29715 long ob_shash;
29716 int ob_sstate;
29717 char ob_sval[1];
29718 } PyStringObject;
29719 extern PyTypeObject PyBaseString_Type;
29720 extern PyTypeObject PyString_Type;
29721 PyObject * PyString_FromStringAndSize(const char *, Py_ssize_t);
29722 PyObject * PyString_FromString(const char *);
29723 PyObject * PyString_FromFormatV(const char*, va_list)
29724 __attribute__((format(printf, 1, 0)));
29725 PyObject * PyString_FromFormat(const char*, ...)
29726 __attribute__((format(printf, 1, 2)));
29727 Py_ssize_t PyString_Size(PyObject *);
29728 char * PyString_AsString(PyObject *);
29729 PyObject * PyString_Repr(PyObject *, int);
29730 void PyString_Concat(PyObject **, PyObject *);
29731 void PyString_ConcatAndDel(PyObject **, PyObject *);
29732 int _PyString_Resize(PyObject **, Py_ssize_t);
29733 int _PyString_Eq(PyObject *, PyObject*);
29734 PyObject * PyString_Format(PyObject *, PyObject *);
29735 PyObject * _PyString_FormatLong(PyObject*, int, int,
29736 int, char**, int*);
29737 PyObject * PyString_DecodeEscape(const char *, Py_ssize_t,
29738 const char *, Py_ssize_t,
29739 const char *);
29740 void PyString_InternInPlace(PyObject **);
29741 void PyString_InternImmortal(PyObject **);
29742 PyObject * PyString_InternFromString(const char *);
29743 void _Py_ReleaseInternedStrings(void);
29744 PyObject * _PyString_Join(PyObject *sep, PyObject *x);
29745 PyObject* PyString_Decode(
29746 const char *s,
29747 Py_ssize_t size,
29748 const char *encoding,
29749 const char *errors
29750 );
29751 PyObject* PyString_Encode(
29752 const char *s,
29753 Py_ssize_t size,
29754 const char *encoding,
29755 const char *errors
29756 );
29757 PyObject* PyString_AsEncodedObject(
29758 PyObject *str,
29759 const char *encoding,
29760 const char *errors
29761 );
29762 PyObject* PyString_AsEncodedString(
29763 PyObject *str,
29764 const char *encoding,
29765 const char *errors
29766 );
29767 PyObject* PyString_AsDecodedObject(
29768 PyObject *str,
29769 const char *encoding,
29770 const char *errors
29771 );
29772 PyObject* PyString_AsDecodedString(
29773 PyObject *str,
29774 const char *encoding,
29775 const char *errors
29776 );
29777 int PyString_AsStringAndSize(
29778 register PyObject *obj,
29779 register char **s,
29780 register Py_ssize_t *len
29781 );
29782 int _PyString_InsertThousandsGrouping(char *buffer,
29783 Py_ssize_t n_buffer,
29784 Py_ssize_t n_digits,
29785 Py_ssize_t buf_size,
29786 Py_ssize_t *count,
29787 int append_zero_char);
29788 PyObject * _PyBytes_FormatAdvanced(PyObject *obj,
29789 char *format_spec,
29790 Py_ssize_t format_spec_len);
29791 }
29792 extern "C" {
29793 extern PyTypeObject PyBuffer_Type;
29794 PyObject * PyBuffer_FromObject(PyObject *base,
29795 Py_ssize_t offset, Py_ssize_t size);
29796 PyObject * PyBuffer_FromReadWriteObject(PyObject *base,
29797 Py_ssize_t offset,
29798 Py_ssize_t size);
29799 PyObject * PyBuffer_FromMemory(void *ptr, Py_ssize_t size);
29800 PyObject * PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size);
29801 PyObject * PyBuffer_New(Py_ssize_t size);
29802 }
29803 extern "C" {
29804 typedef struct {
29805 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
29806 int ob_exports;
29807 Py_ssize_t ob_alloc;
29808 char *ob_bytes;
29809 } PyByteArrayObject;
29810 extern PyTypeObject PyByteArray_Type;
29811 extern PyTypeObject PyByteArrayIter_Type;
29812 PyObject * PyByteArray_FromObject(PyObject *);
29813 PyObject * PyByteArray_Concat(PyObject *, PyObject *);
29814 PyObject * PyByteArray_FromStringAndSize(const char *, Py_ssize_t);
29815 Py_ssize_t PyByteArray_Size(PyObject *);
29816 char * PyByteArray_AsString(PyObject *);
29817 int PyByteArray_Resize(PyObject *, Py_ssize_t);
29818 extern char _PyByteArray_empty_string[];
29819 }
29820 extern "C" {
29821 typedef struct {
29822 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
29823 PyObject *ob_item[1];
29824 } PyTupleObject;
29825 extern PyTypeObject PyTuple_Type;
29826 PyObject * PyTuple_New(Py_ssize_t size);
29827 Py_ssize_t PyTuple_Size(PyObject *);
29828 PyObject * PyTuple_GetItem(PyObject *, Py_ssize_t);
29829 int PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
29830 PyObject * PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
29831 int _PyTuple_Resize(PyObject **, Py_ssize_t);
29832 PyObject * PyTuple_Pack(Py_ssize_t, ...);
29833 int PyTuple_ClearFreeList(void);
29834 }
29835 extern "C" {
29836 typedef struct {
29837 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
29838 PyObject **ob_item;
29839 Py_ssize_t allocated;
29840 } PyListObject;
29841 extern PyTypeObject PyList_Type;
29842 PyObject * PyList_New(Py_ssize_t size);
29843 Py_ssize_t PyList_Size(PyObject *);
29844 PyObject * PyList_GetItem(PyObject *, Py_ssize_t);
29845 int PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
29846 int PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
29847 int PyList_Append(PyObject *, PyObject *);
29848 PyObject * PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
29849 int PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
29850 int PyList_Sort(PyObject *);
29851 int PyList_Reverse(PyObject *);
29852 PyObject * PyList_AsTuple(PyObject *);
29853 PyObject * _PyList_Extend(PyListObject *, PyObject *);
29854 }
29855 extern "C" {
29856 typedef struct {
29857 Py_ssize_t me_hash;
29858 PyObject *me_key;
29859 PyObject *me_value;
29860 } PyDictEntry;
29861 typedef struct _dictobject PyDictObject;
29862 struct _dictobject {
29863 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29864 Py_ssize_t ma_fill;
29865 Py_ssize_t ma_used;
29866 Py_ssize_t ma_mask;
29867 PyDictEntry *ma_table;
29868 PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
29869 PyDictEntry ma_smalltable[8];
29870 };
29871 extern PyTypeObject PyDict_Type;
29872 PyObject * PyDict_New(void);
29873 PyObject * PyDict_GetItem(PyObject *mp, PyObject *key);
29874 int PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
29875 int PyDict_DelItem(PyObject *mp, PyObject *key);
29876 void PyDict_Clear(PyObject *mp);
29877 int PyDict_Next(
29878 PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
29879 int _PyDict_Next(
29880 PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, long *hash);
29881 PyObject * PyDict_Keys(PyObject *mp);
29882 PyObject * PyDict_Values(PyObject *mp);
29883 PyObject * PyDict_Items(PyObject *mp);
29884 Py_ssize_t PyDict_Size(PyObject *mp);
29885 PyObject * PyDict_Copy(PyObject *mp);
29886 int PyDict_Contains(PyObject *mp, PyObject *key);
29887 int _PyDict_Contains(PyObject *mp, PyObject *key, long hash);
29888 PyObject * _PyDict_NewPresized(Py_ssize_t minused);
29889 int PyDict_Update(PyObject *mp, PyObject *other);
29890 int PyDict_Merge(PyObject *mp,
29891 PyObject *other,
29892 int override);
29893 int PyDict_MergeFromSeq2(PyObject *d,
29894 PyObject *seq2,
29895 int override);
29896 PyObject * PyDict_GetItemString(PyObject *dp, const char *key);
29897 int PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
29898 int PyDict_DelItemString(PyObject *dp, const char *key);
29899 }
29900 extern "C" {
29901 extern PyTypeObject PyEnum_Type;
29902 extern PyTypeObject PyReversed_Type;
29903 }
29904 extern "C" {
29905 typedef struct {
29906 long hash;
29907 PyObject *key;
29908 } setentry;
29909 typedef struct _setobject PySetObject;
29910 struct _setobject {
29911 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29912 Py_ssize_t fill;
29913 Py_ssize_t used;
29914 Py_ssize_t mask;
29915 setentry *table;
29916 setentry *(*lookup)(PySetObject *so, PyObject *key, long hash);
29917 setentry smalltable[8];
29918 long hash;
29919 PyObject *weakreflist;
29920 };
29921 extern PyTypeObject PySet_Type;
29922 extern PyTypeObject PyFrozenSet_Type;
29923 PyObject * PySet_New(PyObject *);
29924 PyObject * PyFrozenSet_New(PyObject *);
29925 Py_ssize_t PySet_Size(PyObject *anyset);
29926 int PySet_Clear(PyObject *set);
29927 int PySet_Contains(PyObject *anyset, PyObject *key);
29928 int PySet_Discard(PyObject *set, PyObject *key);
29929 int PySet_Add(PyObject *set, PyObject *key);
29930 int _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key);
29931 int _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash);
29932 PyObject * PySet_Pop(PyObject *set);
29933 int _PySet_Update(PyObject *set, PyObject *iterable);
29934 }
29935 extern "C" {
29936 extern PyTypeObject PyCFunction_Type;
29937 typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
29938 typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
29939 PyObject *);
29940 typedef PyObject *(*PyNoArgsFunction)(PyObject *);
29941 PyCFunction PyCFunction_GetFunction(PyObject *);
29942 PyObject * PyCFunction_GetSelf(PyObject *);
29943 int PyCFunction_GetFlags(PyObject *);
29944 PyObject * PyCFunction_Call(PyObject *, PyObject *, PyObject *);
29945 struct PyMethodDef {
29946 const char *ml_name;
29947 PyCFunction ml_meth;
29948 int ml_flags;
29949 const char *ml_doc;
29950 };
29951 typedef struct PyMethodDef PyMethodDef;
29952 PyObject * Py_FindMethod(PyMethodDef[], PyObject *, const char *);
29953 PyObject * PyCFunction_NewEx(PyMethodDef *, PyObject *,
29954 PyObject *);
29955 typedef struct PyMethodChain {
29956 PyMethodDef *methods;
29957 struct PyMethodChain *link;
29958 } PyMethodChain;
29959 PyObject * Py_FindMethodInChain(PyMethodChain *, PyObject *,
29960 const char *);
29961 typedef struct {
29962 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29963 PyMethodDef *m_ml;
29964 PyObject *m_self;
29965 PyObject *m_module;
29966 } PyCFunctionObject;
29967 int PyCFunction_ClearFreeList(void);
29968 }
29969 extern "C" {
29970 extern PyTypeObject PyModule_Type;
29971 PyObject * PyModule_New(const char *);
29972 PyObject * PyModule_GetDict(PyObject *);
29973 char * PyModule_GetName(PyObject *);
29974 char * PyModule_GetFilename(PyObject *);
29975 void _PyModule_Clear(PyObject *);
29976 }
29977 extern "C" {
29978 typedef struct {
29979 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
29980 PyObject *func_code;
29981 PyObject *func_globals;
29982 PyObject *func_defaults;
29983 PyObject *func_closure;
29984 PyObject *func_doc;
29985 PyObject *func_name;
29986 PyObject *func_dict;
29987 PyObject *func_weakreflist;
29988 PyObject *func_module;
29989 } PyFunctionObject;
29990 extern PyTypeObject PyFunction_Type;
29991 PyObject * PyFunction_New(PyObject *, PyObject *);
29992 PyObject * PyFunction_GetCode(PyObject *);
29993 PyObject * PyFunction_GetGlobals(PyObject *);
29994 PyObject * PyFunction_GetModule(PyObject *);
29995 PyObject * PyFunction_GetDefaults(PyObject *);
29996 int PyFunction_SetDefaults(PyObject *, PyObject *);
29997 PyObject * PyFunction_GetClosure(PyObject *);
29998 int PyFunction_SetClosure(PyObject *, PyObject *);
29999 extern PyTypeObject PyClassMethod_Type;
30000 extern PyTypeObject PyStaticMethod_Type;
30001 PyObject * PyClassMethod_New(PyObject *);
30002 PyObject * PyStaticMethod_New(PyObject *);
30003 }
30004 extern "C" {
30005 typedef struct {
30006 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30007 PyObject *cl_bases;
30008 PyObject *cl_dict;
30009 PyObject *cl_name;
30010 PyObject *cl_getattr;
30011 PyObject *cl_setattr;
30012 PyObject *cl_delattr;
30013 } PyClassObject;
30014 typedef struct {
30015 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30016 PyClassObject *in_class;
30017 PyObject *in_dict;
30018 PyObject *in_weakreflist;
30019 } PyInstanceObject;
30020 typedef struct {
30021 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30022 PyObject *im_func;
30023 PyObject *im_self;
30024 PyObject *im_class;
30025 PyObject *im_weakreflist;
30026 } PyMethodObject;
30027 extern PyTypeObject PyClass_Type, PyInstance_Type, PyMethod_Type;
30028 PyObject * PyClass_New(PyObject *, PyObject *, PyObject *);
30029 PyObject * PyInstance_New(PyObject *, PyObject *,
30030 PyObject *);
30031 PyObject * PyInstance_NewRaw(PyObject *, PyObject *);
30032 PyObject * PyMethod_New(PyObject *, PyObject *, PyObject *);
30033 PyObject * PyMethod_Function(PyObject *);
30034 PyObject * PyMethod_Self(PyObject *);
30035 PyObject * PyMethod_Class(PyObject *);
30036 PyObject * _PyInstance_Lookup(PyObject *pinst, PyObject *name);
30037 int PyClass_IsSubclass(PyObject *, PyObject *);
30038 int PyMethod_ClearFreeList(void);
30039 }
30040 extern "C" {
30041 typedef struct {
30042 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30043 FILE *f_fp;
30044 PyObject *f_name;
30045 PyObject *f_mode;
30046 int (*f_close)(FILE *);
30047 int f_softspace;
30048 int f_binary;
30049 char* f_buf;
30050 char* f_bufend;
30051 char* f_bufptr;
30052 char *f_setbuf;
30053 int f_univ_newline;
30054 int f_newlinetypes;
30055 int f_skipnextlf;
30056 PyObject *f_encoding;
30057 PyObject *f_errors;
30058 PyObject *weakreflist;
30059 int unlocked_count;
30060 int readable;
30061 int writable;
30062 } PyFileObject;
30063 extern PyTypeObject PyFile_Type;
30064 PyObject * PyFile_FromString(char *, char *);
30065 void PyFile_SetBufSize(PyObject *, int);
30066 int PyFile_SetEncoding(PyObject *, const char *);
30067 int PyFile_SetEncodingAndErrors(PyObject *, const char *, char *errors);
30068 PyObject * PyFile_FromFile(FILE *, char *, char *,
30069 int (*)(FILE *));
30070 FILE * PyFile_AsFile(PyObject *);
30071 void PyFile_IncUseCount(PyFileObject *);
30072 void PyFile_DecUseCount(PyFileObject *);
30073 PyObject * PyFile_Name(PyObject *);
30074 PyObject * PyFile_GetLine(PyObject *, int);
30075 int PyFile_WriteObject(PyObject *, PyObject *, int);
30076 int PyFile_SoftSpace(PyObject *, int);
30077 int PyFile_WriteString(const char *, PyObject *);
30078 int PyObject_AsFileDescriptor(PyObject *);
30079 extern const char * Py_FileSystemDefaultEncoding;
30080 char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
30081 size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *);
30082 int _PyFile_SanitizeMode(char *mode);
30083 }
30084 extern "C" {
30085 extern PyTypeObject PyCObject_Type;
30086 PyObject * PyCObject_FromVoidPtr(
30087 void *cobj, void (*destruct)(void*));
30088 PyObject * PyCObject_FromVoidPtrAndDesc(
30089 void *cobj, void *desc, void (*destruct)(void*,void*));
30090 void * PyCObject_AsVoidPtr(PyObject *);
30091 void * PyCObject_GetDesc(PyObject *);
30092 void * PyCObject_Import(char *module_name, char *cobject_name);
30093 int PyCObject_SetVoidPtr(PyObject *self, void *cobj);
30094 typedef struct {
30095 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30096 void *cobject;
30097 void *desc;
30098 void (*destructor)(void *);
30099 } PyCObject;
30100 }
30101 extern "C" {
30102 struct _frame;
30103 typedef struct _traceback {
30104 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30105 struct _traceback *tb_next;
30106 struct _frame *tb_frame;
30107 int tb_lasti;
30108 int tb_lineno;
30109 } PyTracebackObject;
30110 int PyTraceBack_Here(struct _frame *);
30111 int PyTraceBack_Print(PyObject *, PyObject *);
30112 int _Py_DisplaySourceLine(PyObject *, const char *, int, int);
30113 extern PyTypeObject PyTraceBack_Type;
30114 }
30115 extern "C" {
30116 extern PyObject _Py_EllipsisObject;
30117 typedef struct {
30118 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30119 PyObject *start, *stop, *step;
30120 } PySliceObject;
30121 extern PyTypeObject PySlice_Type;
30122 extern PyTypeObject PyEllipsis_Type;
30123 PyObject * PySlice_New(PyObject* start, PyObject* stop,
30124 PyObject* step);
30125 PyObject * _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
30126 int PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
30127 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
30128 int PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
30129 Py_ssize_t *start, Py_ssize_t *stop,
30130 Py_ssize_t *step, Py_ssize_t *slicelength);
30131 }
30132 extern "C" {
30133 typedef struct {
30134 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30135 PyObject *ob_ref;
30136 } PyCellObject;
30137 extern PyTypeObject PyCell_Type;
30138 PyObject * PyCell_New(PyObject *);
30139 PyObject * PyCell_Get(PyObject *);
30140 int PyCell_Set(PyObject *, PyObject *);
30141 }
30142 extern "C" {
30143 extern PyTypeObject PySeqIter_Type;
30144 PyObject * PySeqIter_New(PyObject *);
30145 extern PyTypeObject PyCallIter_Type;
30146 PyObject * PyCallIter_New(PyObject *, PyObject *);
30147 }
30148 extern "C" {
30149 struct _frame;
30150 typedef struct {
30151 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30152 struct _frame *gi_frame;
30153 int gi_running;
30154 PyObject *gi_code;
30155 PyObject *gi_weakreflist;
30156 } PyGenObject;
30157 extern PyTypeObject PyGen_Type;
30158 PyObject * PyGen_New(struct _frame *);
30159 int PyGen_NeedsFinalizing(PyGenObject *);
30160 }
30161 extern "C" {
30162 typedef PyObject *(*getter)(PyObject *, void *);
30163 typedef int (*setter)(PyObject *, PyObject *, void *);
30164 typedef struct PyGetSetDef {
30165 char *name;
30166 getter get;
30167 setter set;
30168 char *doc;
30169 void *closure;
30170 } PyGetSetDef;
30171 typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
30172 void *wrapped);
30173 typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
30174 void *wrapped, PyObject *kwds);
30175 struct wrapperbase {
30176 char *name;
30177 int offset;
30178 void *function;
30179 wrapperfunc wrapper;
30180 char *doc;
30181 int flags;
30182 PyObject *name_strobj;
30183 };
30184 typedef struct {
30185 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name;
30186 } PyDescrObject;
30187 typedef struct {
30188 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name;
30189 PyMethodDef *d_method;
30190 } PyMethodDescrObject;
30191 typedef struct {
30192 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name;
30193 struct PyMemberDef *d_member;
30194 } PyMemberDescrObject;
30195 typedef struct {
30196 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name;
30197 PyGetSetDef *d_getset;
30198 } PyGetSetDescrObject;
30199 typedef struct {
30200 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; PyTypeObject *d_type; PyObject *d_name;
30201 struct wrapperbase *d_base;
30202 void *d_wrapped;
30203 } PyWrapperDescrObject;
30204 extern PyTypeObject PyWrapperDescr_Type;
30205 extern PyTypeObject PyDictProxy_Type;
30206 extern PyTypeObject PyGetSetDescr_Type;
30207 extern PyTypeObject PyMemberDescr_Type;
30208 PyObject * PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
30209 PyObject * PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
30210 PyObject * PyDescr_NewMember(PyTypeObject *,
30211 struct PyMemberDef *);
30212 PyObject * PyDescr_NewGetSet(PyTypeObject *,
30213 struct PyGetSetDef *);
30214 PyObject * PyDescr_NewWrapper(PyTypeObject *,
30215 struct wrapperbase *, void *);
30216 PyObject * PyDictProxy_New(PyObject *);
30217 PyObject * PyWrapper_New(PyObject *, PyObject *);
30218 extern PyTypeObject PyProperty_Type;
30219 }
30220 extern "C" {
30221 void _PyWarnings_Init(void);
30222 int PyErr_WarnEx(PyObject *, const char *, Py_ssize_t);
30223 int PyErr_WarnExplicit(PyObject *, const char *, const char *, int,
30224 const char *, PyObject *);
30225 }
30226 extern "C" {
30227 typedef struct _PyWeakReference PyWeakReference;
30228 struct _PyWeakReference {
30229 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30230 PyObject *wr_object;
30231 PyObject *wr_callback;
30232 long hash;
30233 PyWeakReference *wr_prev;
30234 PyWeakReference *wr_next;
30235 };
30236 extern PyTypeObject _PyWeakref_RefType;
30237 extern PyTypeObject _PyWeakref_ProxyType;
30238 extern PyTypeObject _PyWeakref_CallableProxyType;
30239 PyObject * PyWeakref_NewRef(PyObject *ob,
30240 PyObject *callback);
30241 PyObject * PyWeakref_NewProxy(PyObject *ob,
30242 PyObject *callback);
30243 PyObject * PyWeakref_GetObject(PyObject *ref);
30244 Py_ssize_t _PyWeakref_GetWeakrefCount(PyWeakReference *head);
30245 void _PyWeakref_ClearRef(PyWeakReference *self);
30246 }
30247 extern "C" {
30248 int PyCodec_Register(
30249 PyObject *search_function
30250 );
30251 PyObject * _PyCodec_Lookup(
30252 const char *encoding
30253 );
30254 PyObject * PyCodec_Encode(
30255 PyObject *object,
30256 const char *encoding,
30257 const char *errors
30258 );
30259 PyObject * PyCodec_Decode(
30260 PyObject *object,
30261 const char *encoding,
30262 const char *errors
30263 );
30264 PyObject * PyCodec_Encoder(
30265 const char *encoding
30266 );
30267 PyObject * PyCodec_Decoder(
30268 const char *encoding
30269 );
30270 PyObject * PyCodec_IncrementalEncoder(
30271 const char *encoding,
30272 const char *errors
30273 );
30274 PyObject * PyCodec_IncrementalDecoder(
30275 const char *encoding,
30276 const char *errors
30277 );
30278 PyObject * PyCodec_StreamReader(
30279 const char *encoding,
30280 PyObject *stream,
30281 const char *errors
30282 );
30283 PyObject * PyCodec_StreamWriter(
30284 const char *encoding,
30285 PyObject *stream,
30286 const char *errors
30287 );
30288 int PyCodec_RegisterError(const char *name, PyObject *error);
30289 PyObject * PyCodec_LookupError(const char *name);
30290 PyObject * PyCodec_StrictErrors(PyObject *exc);
30291 PyObject * PyCodec_IgnoreErrors(PyObject *exc);
30292 PyObject * PyCodec_ReplaceErrors(PyObject *exc);
30293 PyObject * PyCodec_XMLCharRefReplaceErrors(PyObject *exc);
30294 PyObject * PyCodec_BackslashReplaceErrors(PyObject *exc);
30295 }
30296 extern "C" {
30297 typedef struct {
30298 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30299 PyObject *dict;
30300 PyObject *args;
30301 PyObject *message;
30302 } PyBaseExceptionObject;
30303 typedef struct {
30304 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30305 PyObject *dict;
30306 PyObject *args;
30307 PyObject *message;
30308 PyObject *msg;
30309 PyObject *filename;
30310 PyObject *lineno;
30311 PyObject *offset;
30312 PyObject *text;
30313 PyObject *print_file_and_line;
30314 } PySyntaxErrorObject;
30315 typedef struct {
30316 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30317 PyObject *dict;
30318 PyObject *args;
30319 PyObject *message;
30320 PyObject *encoding;
30321 PyObject *object;
30322 Py_ssize_t start;
30323 Py_ssize_t end;
30324 PyObject *reason;
30325 } PyUnicodeErrorObject;
30326 typedef struct {
30327 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30328 PyObject *dict;
30329 PyObject *args;
30330 PyObject *message;
30331 PyObject *code;
30332 } PySystemExitObject;
30333 typedef struct {
30334 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30335 PyObject *dict;
30336 PyObject *args;
30337 PyObject *message;
30338 PyObject *myerrno;
30339 PyObject *strerror;
30340 PyObject *filename;
30341 } PyEnvironmentErrorObject;
30342 void PyErr_SetNone(PyObject *);
30343 void PyErr_SetObject(PyObject *, PyObject *);
30344 void PyErr_SetString(PyObject *, const char *);
30345 PyObject * PyErr_Occurred(void);
30346 void PyErr_Clear(void);
30347 void PyErr_Fetch(PyObject **, PyObject **, PyObject **);
30348 void PyErr_Restore(PyObject *, PyObject *, PyObject *);
30349 int PyErr_GivenExceptionMatches(PyObject *, PyObject *);
30350 int PyErr_ExceptionMatches(PyObject *);
30351 void PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
30352 extern PyObject * PyExc_BaseException;
30353 extern PyObject * PyExc_Exception;
30354 extern PyObject * PyExc_StopIteration;
30355 extern PyObject * PyExc_GeneratorExit;
30356 extern PyObject * PyExc_StandardError;
30357 extern PyObject * PyExc_ArithmeticError;
30358 extern PyObject * PyExc_LookupError;
30359 extern PyObject * PyExc_AssertionError;
30360 extern PyObject * PyExc_AttributeError;
30361 extern PyObject * PyExc_EOFError;
30362 extern PyObject * PyExc_FloatingPointError;
30363 extern PyObject * PyExc_EnvironmentError;
30364 extern PyObject * PyExc_IOError;
30365 extern PyObject * PyExc_OSError;
30366 extern PyObject * PyExc_ImportError;
30367 extern PyObject * PyExc_IndexError;
30368 extern PyObject * PyExc_KeyError;
30369 extern PyObject * PyExc_KeyboardInterrupt;
30370 extern PyObject * PyExc_MemoryError;
30371 extern PyObject * PyExc_NameError;
30372 extern PyObject * PyExc_OverflowError;
30373 extern PyObject * PyExc_RuntimeError;
30374 extern PyObject * PyExc_NotImplementedError;
30375 extern PyObject * PyExc_SyntaxError;
30376 extern PyObject * PyExc_IndentationError;
30377 extern PyObject * PyExc_TabError;
30378 extern PyObject * PyExc_ReferenceError;
30379 extern PyObject * PyExc_SystemError;
30380 extern PyObject * PyExc_SystemExit;
30381 extern PyObject * PyExc_TypeError;
30382 extern PyObject * PyExc_UnboundLocalError;
30383 extern PyObject * PyExc_UnicodeError;
30384 extern PyObject * PyExc_UnicodeEncodeError;
30385 extern PyObject * PyExc_UnicodeDecodeError;
30386 extern PyObject * PyExc_UnicodeTranslateError;
30387 extern PyObject * PyExc_ValueError;
30388 extern PyObject * PyExc_ZeroDivisionError;
30389 extern PyObject * PyExc_BufferError;
30390 extern PyObject * PyExc_MemoryErrorInst;
30391 extern PyObject * PyExc_RecursionErrorInst;
30392 extern PyObject * PyExc_Warning;
30393 extern PyObject * PyExc_UserWarning;
30394 extern PyObject * PyExc_DeprecationWarning;
30395 extern PyObject * PyExc_PendingDeprecationWarning;
30396 extern PyObject * PyExc_SyntaxWarning;
30397 extern PyObject * PyExc_RuntimeWarning;
30398 extern PyObject * PyExc_FutureWarning;
30399 extern PyObject * PyExc_ImportWarning;
30400 extern PyObject * PyExc_UnicodeWarning;
30401 extern PyObject * PyExc_BytesWarning;
30402 int PyErr_BadArgument(void);
30403 PyObject * PyErr_NoMemory(void);
30404 PyObject * PyErr_SetFromErrno(PyObject *);
30405 PyObject * PyErr_SetFromErrnoWithFilenameObject(
30406 PyObject *, PyObject *);
30407 PyObject * PyErr_SetFromErrnoWithFilename(PyObject *, char *);
30408 PyObject * PyErr_Format(PyObject *, const char *, ...)
30409 __attribute__((format(printf, 2, 3)));
30410 void PyErr_BadInternalCall(void);
30411 void _PyErr_BadInternalCall(char *filename, int lineno);
30412 PyObject * PyErr_NewException(char *name, PyObject *base,
30413 PyObject *dict);
30414 void PyErr_WriteUnraisable(PyObject *);
30415 int PyErr_CheckSignals(void);
30416 void PyErr_SetInterrupt(void);
30417 int PySignal_SetWakeupFd(int fd);
30418 void PyErr_SyntaxLocation(const char *, int);
30419 PyObject * PyErr_ProgramText(const char *, int);
30420 PyObject * PyUnicodeDecodeError_Create(
30421 const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
30422 PyObject * PyUnicodeEncodeError_Create(
30423 const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
30424 PyObject * PyUnicodeTranslateError_Create(
30425 const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
30426 PyObject * PyUnicodeEncodeError_GetEncoding(PyObject *);
30427 PyObject * PyUnicodeDecodeError_GetEncoding(PyObject *);
30428 PyObject * PyUnicodeEncodeError_GetObject(PyObject *);
30429 PyObject * PyUnicodeDecodeError_GetObject(PyObject *);
30430 PyObject * PyUnicodeTranslateError_GetObject(PyObject *);
30431 int PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *);
30432 int PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *);
30433 int PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *);
30434 int PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t);
30435 int PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t);
30436 int PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t);
30437 int PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *);
30438 int PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *);
30439 int PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *);
30440 int PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t);
30441 int PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t);
30442 int PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t);
30443 PyObject * PyUnicodeEncodeError_GetReason(PyObject *);
30444 PyObject * PyUnicodeDecodeError_GetReason(PyObject *);
30445 PyObject * PyUnicodeTranslateError_GetReason(PyObject *);
30446 int PyUnicodeEncodeError_SetReason(
30447 PyObject *, const char *);
30448 int PyUnicodeDecodeError_SetReason(
30449 PyObject *, const char *);
30450 int PyUnicodeTranslateError_SetReason(
30451 PyObject *, const char *);
30452 int PyOS_snprintf(char *str, size_t size, const char *format, ...)
30453 __attribute__((format(printf, 3, 4)));
30454 int PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
30455 __attribute__((format(printf, 3, 0)));
30456 }
30457 extern "C" {
30458 struct _ts;
30459 struct _is;
30460 typedef struct _is {
30461 struct _is *next;
30462 struct _ts *tstate_head;
30463 PyObject *modules;
30464 PyObject *sysdict;
30465 PyObject *builtins;
30466 PyObject *modules_reloading;
30467 PyObject *codec_search_path;
30468 PyObject *codec_search_cache;
30469 PyObject *codec_error_registry;
30470 int dlopenflags;
30471 } PyInterpreterState;
30472 struct _frame;
30473 typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
30474 typedef struct _ts {
30475 struct _ts *next;
30476 PyInterpreterState *interp;
30477 struct _frame *frame;
30478 int recursion_depth;
30479 int tracing;
30480 int use_tracing;
30481 Py_tracefunc c_profilefunc;
30482 Py_tracefunc c_tracefunc;
30483 PyObject *c_profileobj;
30484 PyObject *c_traceobj;
30485 PyObject *curexc_type;
30486 PyObject *curexc_value;
30487 PyObject *curexc_traceback;
30488 PyObject *exc_type;
30489 PyObject *exc_value;
30490 PyObject *exc_traceback;
30491 PyObject *dict;
30492 int tick_counter;
30493 int gilstate_counter;
30494 PyObject *async_exc;
30495 long thread_id;
30496 } PyThreadState;
30497 PyInterpreterState * PyInterpreterState_New(void);
30498 void PyInterpreterState_Clear(PyInterpreterState *);
30499 void PyInterpreterState_Delete(PyInterpreterState *);
30500 PyThreadState * PyThreadState_New(PyInterpreterState *);
30501 PyThreadState * _PyThreadState_Prealloc(PyInterpreterState *);
30502 void _PyThreadState_Init(PyThreadState *);
30503 void PyThreadState_Clear(PyThreadState *);
30504 void PyThreadState_Delete(PyThreadState *);
30505 void PyThreadState_DeleteCurrent(void);
30506 PyThreadState * PyThreadState_Get(void);
30507 PyThreadState * PyThreadState_Swap(PyThreadState *);
30508 PyObject * PyThreadState_GetDict(void);
30509 int PyThreadState_SetAsyncExc(long, PyObject *);
30510 extern PyThreadState * _PyThreadState_Current;
30511 typedef
30512 enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
30513 PyGILState_STATE;
30514 PyGILState_STATE PyGILState_Ensure(void);
30515 void PyGILState_Release(PyGILState_STATE);
30516 PyThreadState * PyGILState_GetThisThreadState(void);
30517 PyObject * _PyThread_CurrentFrames(void);
30518 PyInterpreterState * PyInterpreterState_Head(void);
30519 PyInterpreterState * PyInterpreterState_Next(PyInterpreterState *);
30520 PyThreadState * PyInterpreterState_ThreadHead(PyInterpreterState *);
30521 PyThreadState * PyThreadState_Next(PyThreadState *);
30522 typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
30523 extern PyThreadFrameGetter _PyThreadState_GetFrame;
30524 }
30525 extern "C" {
30526 typedef struct _arena PyArena;
30527 PyArena * PyArena_New(void);
30528 void PyArena_Free(PyArena *);
30529 void * PyArena_Malloc(PyArena *, size_t size);
30530 int PyArena_AddPyObject(PyArena *, PyObject *);
30531 }
30532 extern "C" {
30533 PyObject * _Py_VaBuildValue_SizeT(const char *, va_list);
30534 int PyArg_Parse(PyObject *, const char *, ...);
30535 int PyArg_ParseTuple(PyObject *, const char *, ...) ;
30536 int PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
30537 const char *, char **, ...);
30538 int PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
30539 PyObject * Py_BuildValue(const char *, ...);
30540 PyObject * _Py_BuildValue_SizeT(const char *, ...);
30541 int _PyArg_NoKeywords(const char *funcname, PyObject *kw);
30542 int PyArg_VaParse(PyObject *, const char *, va_list);
30543 int PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
30544 const char *, char **, va_list);
30545 PyObject * Py_VaBuildValue(const char *, va_list);
30546 int PyModule_AddObject(PyObject *, const char *, PyObject *);
30547 int PyModule_AddIntConstant(PyObject *, const char *, long);
30548 int PyModule_AddStringConstant(PyObject *, const char *, const char *);
30549 PyObject * Py_InitModule4_64(const char *name, PyMethodDef *methods,
30550 const char *doc, PyObject *self,
30551 int apiver);
30552 extern char * _Py_PackageContext;
30553 }
30554 extern "C" {
30555 typedef struct {
30556 int cf_flags;
30557 } PyCompilerFlags;
30558 void Py_SetProgramName(char *);
30559 char * Py_GetProgramName(void);
30560 void Py_SetPythonHome(char *);
30561 char * Py_GetPythonHome(void);
30562 void Py_Initialize(void);
30563 void Py_InitializeEx(int);
30564 void Py_Finalize(void);
30565 int Py_IsInitialized(void);
30566 PyThreadState * Py_NewInterpreter(void);
30567 void Py_EndInterpreter(PyThreadState *);
30568 int PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
30569 int PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
30570 int PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
30571 int PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
30572 int PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *);
30573 int PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *);
30574 struct _mod * PyParser_ASTFromString(const char *, const char *,
30575 int, PyCompilerFlags *flags,
30576 PyArena *);
30577 struct _mod * PyParser_ASTFromFile(FILE *, const char *, int,
30578 char *, char *,
30579 PyCompilerFlags *, int *,
30580 PyArena *);
30581 struct _node * PyParser_SimpleParseStringFlags(const char *, int,
30582 int);
30583 struct _node * PyParser_SimpleParseFileFlags(FILE *, const char *,
30584 int, int);
30585 PyObject * PyRun_StringFlags(const char *, int, PyObject *,
30586 PyObject *, PyCompilerFlags *);
30587 PyObject * PyRun_FileExFlags(FILE *, const char *, int,
30588 PyObject *, PyObject *, int,
30589 PyCompilerFlags *);
30590 PyObject * Py_CompileStringFlags(const char *, const char *, int,
30591 PyCompilerFlags *);
30592 struct symtable * Py_SymtableString(const char *, const char *, int);
30593 void PyErr_Print(void);
30594 void PyErr_PrintEx(int);
30595 void PyErr_Display(PyObject *, PyObject *, PyObject *);
30596 int Py_AtExit(void (*func)(void));
30597 void Py_Exit(int);
30598 int Py_FdIsInteractive(FILE *, const char *);
30599 int Py_Main(int argc, char **argv);
30600 char * Py_GetProgramFullPath(void);
30601 char * Py_GetPrefix(void);
30602 char * Py_GetExecPrefix(void);
30603 char * Py_GetPath(void);
30604 const char * Py_GetVersion(void);
30605 const char * Py_GetPlatform(void);
30606 const char * Py_GetCopyright(void);
30607 const char * Py_GetCompiler(void);
30608 const char * Py_GetBuildInfo(void);
30609 const char * _Py_svnversion(void);
30610 const char * Py_SubversionRevision(void);
30611 const char * Py_SubversionShortBranch(void);
30612 PyObject * _PyBuiltin_Init(void);
30613 PyObject * _PySys_Init(void);
30614 void _PyImport_Init(void);
30615 void _PyExc_Init(void);
30616 void _PyImportHooks_Init(void);
30617 int _PyFrame_Init(void);
30618 int _PyInt_Init(void);
30619 void _PyFloat_Init(void);
30620 int PyByteArray_Init(void);
30621 void _PyExc_Fini(void);
30622 void _PyImport_Fini(void);
30623 void PyMethod_Fini(void);
30624 void PyFrame_Fini(void);
30625 void PyCFunction_Fini(void);
30626 void PyDict_Fini(void);
30627 void PyTuple_Fini(void);
30628 void PyList_Fini(void);
30629 void PySet_Fini(void);
30630 void PyString_Fini(void);
30631 void PyInt_Fini(void);
30632 void PyFloat_Fini(void);
30633 void PyOS_FiniInterrupts(void);
30634 void PyByteArray_Fini(void);
30635 char * PyOS_Readline(FILE *, FILE *, char *);
30636 extern int (*PyOS_InputHook)(void);
30637 extern char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
30638 extern PyThreadState* _PyOS_ReadlineTState;
30639 typedef void (*PyOS_sighandler_t)(int);
30640 PyOS_sighandler_t PyOS_getsig(int);
30641 PyOS_sighandler_t PyOS_setsig(int, PyOS_sighandler_t);
30642 }
30643 extern "C" {
30644 PyObject * PyEval_CallObjectWithKeywords(
30645 PyObject *, PyObject *, PyObject *);
30646 PyObject * PyEval_CallObject(PyObject *, PyObject *);
30647 PyObject * PyEval_CallFunction(PyObject *obj,
30648 const char *format, ...);
30649 PyObject * PyEval_CallMethod(PyObject *obj,
30650 const char *methodname,
30651 const char *format, ...);
30652 void PyEval_SetProfile(Py_tracefunc, PyObject *);
30653 void PyEval_SetTrace(Py_tracefunc, PyObject *);
30654 struct _frame;
30655 PyObject * PyEval_GetBuiltins(void);
30656 PyObject * PyEval_GetGlobals(void);
30657 PyObject * PyEval_GetLocals(void);
30658 struct _frame * PyEval_GetFrame(void);
30659 int PyEval_GetRestricted(void);
30660 int PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
30661 int Py_FlushLine(void);
30662 int Py_AddPendingCall(int (*func)(void *), void *arg);
30663 int Py_MakePendingCalls(void);
30664 void Py_SetRecursionLimit(int);
30665 int Py_GetRecursionLimit(void);
30666 int _Py_CheckRecursiveCall(char *where);
30667 extern int _Py_CheckRecursionLimit;
30668 const char * PyEval_GetFuncName(PyObject *);
30669 const char * PyEval_GetFuncDesc(PyObject *);
30670 PyObject * PyEval_GetCallStats(PyObject *);
30671 PyObject * PyEval_EvalFrame(struct _frame *);
30672 PyObject * PyEval_EvalFrameEx(struct _frame *f, int exc);
30673 extern volatile int _Py_Ticker;
30674 extern int _Py_CheckInterval;
30675 PyThreadState * PyEval_SaveThread(void);
30676 void PyEval_RestoreThread(PyThreadState *);
30677 int PyEval_ThreadsInitialized(void);
30678 void PyEval_InitThreads(void);
30679 void PyEval_AcquireLock(void);
30680 void PyEval_ReleaseLock(void);
30681 void PyEval_AcquireThread(PyThreadState *tstate);
30682 void PyEval_ReleaseThread(PyThreadState *tstate);
30683 void PyEval_ReInitThreads(void);
30684 int _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
30685 }
30686 extern "C" {
30687 PyObject * PySys_GetObject(char *);
30688 int PySys_SetObject(char *, PyObject *);
30689 FILE * PySys_GetFile(char *, FILE *);
30690 void PySys_SetArgv(int, char **);
30691 void PySys_SetPath(char *);
30692 void PySys_WriteStdout(const char *format, ...)
30693 __attribute__((format(printf, 1, 2)));
30694 void PySys_WriteStderr(const char *format, ...)
30695 __attribute__((format(printf, 1, 2)));
30696 extern PyObject * _PySys_TraceFunc, *_PySys_ProfileFunc;
30697 extern int _PySys_CheckInterval;
30698 void PySys_ResetWarnOptions(void);
30699 void PySys_AddWarnOption(char *);
30700 int PySys_HasWarnOptions(void);
30701 }
30702 extern "C" {
30703 int PyOS_InterruptOccurred(void);
30704 void PyOS_InitInterrupts(void);
30705 void PyOS_AfterFork(void);
30706 }
30707 extern "C" {
30708 long PyImport_GetMagicNumber(void);
30709 PyObject * PyImport_ExecCodeModule(char *name, PyObject *co);
30710 PyObject * PyImport_ExecCodeModuleEx(
30711 char *name, PyObject *co, char *pathname);
30712 PyObject * PyImport_GetModuleDict(void);
30713 PyObject * PyImport_AddModule(const char *name);
30714 PyObject * PyImport_ImportModule(const char *name);
30715 PyObject * PyImport_ImportModuleNoBlock(const char *);
30716 PyObject * PyImport_ImportModuleLevel(char *name,
30717 PyObject *globals, PyObject *locals, PyObject *fromlist, int level);
30718 PyObject * PyImport_GetImporter(PyObject *path);
30719 PyObject * PyImport_Import(PyObject *name);
30720 PyObject * PyImport_ReloadModule(PyObject *m);
30721 void PyImport_Cleanup(void);
30722 int PyImport_ImportFrozenModule(char *);
30723 void _PyImport_AcquireLock(void);
30724 int _PyImport_ReleaseLock(void);
30725 struct filedescr * _PyImport_FindModule(
30726 const char *, PyObject *, char *, size_t, FILE **, PyObject **);
30727 int _PyImport_IsScript(struct filedescr *);
30728 void _PyImport_ReInitLock(void);
30729 PyObject *_PyImport_FindExtension(char *, char *);
30730 PyObject *_PyImport_FixupExtension(char *, char *);
30731 struct _inittab {
30732 char *name;
30733 void (*initfunc)(void);
30734 };
30735 extern PyTypeObject PyNullImporter_Type;
30736 extern struct _inittab * PyImport_Inittab;
30737 int PyImport_AppendInittab(char *name, void (*initfunc)(void));
30738 int PyImport_ExtendInittab(struct _inittab *newtab);
30739 struct _frozen {
30740 char *name;
30741 unsigned char *code;
30742 int size;
30743 };
30744 extern struct _frozen * PyImport_FrozenModules;
30745 }
30746 extern "C" {
30747 int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result);
30748 PyObject * PyObject_Call(PyObject *callable_object,
30749 PyObject *args, PyObject *kw);
30750 PyObject * PyObject_CallObject(PyObject *callable_object,
30751 PyObject *args);
30752 PyObject * PyObject_CallFunction(PyObject *callable_object,
30753 char *format, ...);
30754 PyObject * PyObject_CallMethod(PyObject *o, char *m,
30755 char *format, ...);
30756 PyObject * _PyObject_CallFunction_SizeT(PyObject *callable,
30757 char *format, ...);
30758 PyObject * _PyObject_CallMethod_SizeT(PyObject *o,
30759 char *name,
30760 char *format, ...);
30761 PyObject * PyObject_CallFunctionObjArgs(PyObject *callable,
30762 ...);
30763 PyObject * PyObject_CallMethodObjArgs(PyObject *o,
30764 PyObject *m, ...);
30765 PyObject * PyObject_Type(PyObject *o);
30766 Py_ssize_t PyObject_Size(PyObject *o);
30767 Py_ssize_t PyObject_Length(PyObject *o);
30768 Py_ssize_t _PyObject_LengthHint(PyObject *o, Py_ssize_t);
30769 PyObject * PyObject_GetItem(PyObject *o, PyObject *key);
30770 int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
30771 int PyObject_DelItemString(PyObject *o, char *key);
30772 int PyObject_DelItem(PyObject *o, PyObject *key);
30773 int PyObject_AsCharBuffer(PyObject *obj,
30774 const char **buffer,
30775 Py_ssize_t *buffer_len);
30776 int PyObject_CheckReadBuffer(PyObject *obj);
30777 int PyObject_AsReadBuffer(PyObject *obj,
30778 const void **buffer,
30779 Py_ssize_t *buffer_len);
30780 int PyObject_AsWriteBuffer(PyObject *obj,
30781 void **buffer,
30782 Py_ssize_t *buffer_len);
30783 int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
30784 int flags);
30785 void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
30786 int PyBuffer_SizeFromFormat(const char *);
30787 int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
30788 Py_ssize_t len, char fort);
30789 int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
30790 Py_ssize_t len, char fort);
30791 int PyObject_CopyData(PyObject *dest, PyObject *src);
30792 int PyBuffer_IsContiguous(Py_buffer *view, char fort);
30793 void PyBuffer_FillContiguousStrides(int ndims,
30794 Py_ssize_t *shape,
30795 Py_ssize_t *strides,
30796 int itemsize,
30797 char fort);
30798 int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
30799 Py_ssize_t len, int readonly,
30800 int flags);
30801 void PyBuffer_Release(Py_buffer *view);
30802 PyObject * PyObject_Format(PyObject* obj,
30803 PyObject *format_spec);
30804 PyObject * PyObject_GetIter(PyObject *);
30805 PyObject * PyIter_Next(PyObject *);
30806 int PyNumber_Check(PyObject *o);
30807 PyObject * PyNumber_Add(PyObject *o1, PyObject *o2);
30808 PyObject * PyNumber_Subtract(PyObject *o1, PyObject *o2);
30809 PyObject * PyNumber_Multiply(PyObject *o1, PyObject *o2);
30810 PyObject * PyNumber_Divide(PyObject *o1, PyObject *o2);
30811 PyObject * PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
30812 PyObject * PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
30813 PyObject * PyNumber_Remainder(PyObject *o1, PyObject *o2);
30814 PyObject * PyNumber_Divmod(PyObject *o1, PyObject *o2);
30815 PyObject * PyNumber_Power(PyObject *o1, PyObject *o2,
30816 PyObject *o3);
30817 PyObject * PyNumber_Negative(PyObject *o);
30818 PyObject * PyNumber_Positive(PyObject *o);
30819 PyObject * PyNumber_Absolute(PyObject *o);
30820 PyObject * PyNumber_Invert(PyObject *o);
30821 PyObject * PyNumber_Lshift(PyObject *o1, PyObject *o2);
30822 PyObject * PyNumber_Rshift(PyObject *o1, PyObject *o2);
30823 PyObject * PyNumber_And(PyObject *o1, PyObject *o2);
30824 PyObject * PyNumber_Xor(PyObject *o1, PyObject *o2);
30825 PyObject * PyNumber_Or(PyObject *o1, PyObject *o2);
30826 PyObject * PyNumber_Index(PyObject *o);
30827 Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc);
30828 PyObject * _PyNumber_ConvertIntegralToInt(
30829 PyObject *integral,
30830 const char* error_format);
30831 PyObject * PyNumber_Int(PyObject *o);
30832 PyObject * PyNumber_Long(PyObject *o);
30833 PyObject * PyNumber_Float(PyObject *o);
30834 PyObject * PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
30835 PyObject * PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
30836 PyObject * PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
30837 PyObject * PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2);
30838 PyObject * PyNumber_InPlaceFloorDivide(PyObject *o1,
30839 PyObject *o2);
30840 PyObject * PyNumber_InPlaceTrueDivide(PyObject *o1,
30841 PyObject *o2);
30842 PyObject * PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
30843 PyObject * PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
30844 PyObject *o3);
30845 PyObject * PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
30846 PyObject * PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
30847 PyObject * PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
30848 PyObject * PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
30849 PyObject * PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
30850 PyObject * PyNumber_ToBase(PyObject *n, int base);
30851 int PySequence_Check(PyObject *o);
30852 Py_ssize_t PySequence_Size(PyObject *o);
30853 Py_ssize_t PySequence_Length(PyObject *o);
30854 PyObject * PySequence_Concat(PyObject *o1, PyObject *o2);
30855 PyObject * PySequence_Repeat(PyObject *o, Py_ssize_t count);
30856 PyObject * PySequence_GetItem(PyObject *o, Py_ssize_t i);
30857 PyObject * PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
30858 int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
30859 int PySequence_DelItem(PyObject *o, Py_ssize_t i);
30860 int PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
30861 PyObject *v);
30862 int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
30863 PyObject * PySequence_Tuple(PyObject *o);
30864 PyObject * PySequence_List(PyObject *o);
30865 PyObject * PySequence_Fast(PyObject *o, const char* m);
30866 Py_ssize_t PySequence_Count(PyObject *o, PyObject *value);
30867 int PySequence_Contains(PyObject *seq, PyObject *ob);
30868 Py_ssize_t _PySequence_IterSearch(PyObject *seq,
30869 PyObject *obj, int operation);
30870 int PySequence_In(PyObject *o, PyObject *value);
30871 Py_ssize_t PySequence_Index(PyObject *o, PyObject *value);
30872 PyObject * PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
30873 PyObject * PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count);
30874 int PyMapping_Check(PyObject *o);
30875 Py_ssize_t PyMapping_Size(PyObject *o);
30876 Py_ssize_t PyMapping_Length(PyObject *o);
30877 int PyMapping_HasKeyString(PyObject *o, char *key);
30878 int PyMapping_HasKey(PyObject *o, PyObject *key);
30879 PyObject * PyMapping_GetItemString(PyObject *o, char *key);
30880 int PyMapping_SetItemString(PyObject *o, char *key,
30881 PyObject *value);
30882 int PyObject_IsInstance(PyObject *object, PyObject *typeorclass);
30883 int PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
30884 int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
30885 int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
30886 }
30887 extern "C" {
30888 typedef struct {
30889 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
30890 int co_argcount;
30891 int co_nlocals;
30892 int co_stacksize;
30893 int co_flags;
30894 PyObject *co_code;
30895 PyObject *co_consts;
30896 PyObject *co_names;
30897 PyObject *co_varnames;
30898 PyObject *co_freevars;
30899 PyObject *co_cellvars;
30900 PyObject *co_filename;
30901 PyObject *co_name;
30902 int co_firstlineno;
30903 PyObject *co_lnotab;
30904 void *co_zombieframe;
30905 } PyCodeObject;
30906 extern PyTypeObject PyCode_Type;
30907 PyCodeObject * PyCode_New(
30908 int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
30909 PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *);
30910 int PyCode_Addr2Line(PyCodeObject *, int);
30911 typedef struct _addr_pair {
30912 int ap_lower;
30913 int ap_upper;
30914 } PyAddrPair;
30915 int PyCode_CheckLineNumber(PyCodeObject* co,
30916 int lasti, PyAddrPair *bounds);
30917 PyObject* PyCode_Optimize(PyObject *code, PyObject* consts,
30918 PyObject *names, PyObject *lineno_obj);
30919 }
30920 extern "C" {
30921 struct _node;
30922 PyCodeObject * PyNode_Compile(struct _node *, const char *);
30923 typedef struct {
30924 int ff_features;
30925 int ff_lineno;
30926 } PyFutureFeatures;
30927 struct _mod;
30928 PyCodeObject * PyAST_Compile(struct _mod *, const char *,
30929 PyCompilerFlags *, PyArena *);
30930 PyFutureFeatures * PyFuture_FromAST(struct _mod *, const char *);
30931 }
30932 extern "C" {
30933 PyObject * PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *);
30934 PyObject * PyEval_EvalCodeEx(PyCodeObject *co,
30935 PyObject *globals,
30936 PyObject *locals,
30937 PyObject **args, int argc,
30938 PyObject **kwds, int kwdc,
30939 PyObject **defs, int defc,
30940 PyObject *closure);
30941 PyObject * _PyEval_CallTracing(PyObject *func, PyObject *args);
30942 }
30943 extern "C" {
30944 double PyOS_ascii_strtod(const char *str, char **ptr);
30945 double PyOS_ascii_atof(const char *str);
30946 char * PyOS_ascii_formatd(char *buffer, size_t buf_len, const char *format, double d);
30947 }
30948 extern "C" {
30949 int PyOS_mystrnicmp(const char *, const char *, Py_ssize_t);
30950 int PyOS_mystricmp(const char *, const char *);
30951 }
30952 PyObject* _Py_Mangle(PyObject *p, PyObject *name);
30953 extern "C" {
30954 extern "C" {
30955 extern int __sigismember (__const __sigset_t *, int);
30956 extern int __sigaddset (__sigset_t *, int);
30957 extern int __sigdelset (__sigset_t *, int);
30958 extern __inline __attribute__ ((__gnu_inline__)) int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; }
30959 extern __inline __attribute__ ((__gnu_inline__)) int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); }
30960 extern __inline __attribute__ ((__gnu_inline__)) int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); }
30961 typedef __sig_atomic_t sig_atomic_t;
30962 typedef union sigval
30963 {
30964 int sival_int;
30965 void *sival_ptr;
30966 } sigval_t;
30967 typedef struct siginfo
30968 {
30969 int si_signo;
30970 int si_errno;
30971 int si_code;
30972 union
30973 {
30974 int _pad[((128 / sizeof (int)) - 4)];
30975 struct
30976 {
30977 __pid_t si_pid;
30978 __uid_t si_uid;
30979 } _kill;
30980 struct
30981 {
30982 int si_tid;
30983 int si_overrun;
30984 sigval_t si_sigval;
30985 } _timer;
30986 struct
30987 {
30988 __pid_t si_pid;
30989 __uid_t si_uid;
30990 sigval_t si_sigval;
30991 } _rt;
30992 struct
30993 {
30994 __pid_t si_pid;
30995 __uid_t si_uid;
30996 int si_status;
30997 __clock_t si_utime;
30998 __clock_t si_stime;
30999 } _sigchld;
31000 struct
31001 {
31002 void *si_addr;
31003 } _sigfault;
31004 struct
31005 {
31006 long int si_band;
31007 int si_fd;
31008 } _sigpoll;
31009 } _sifields;
31010 } siginfo_t;
31011 enum
31012 {
31013 SI_ASYNCNL = -60,
31014 SI_TKILL = -6,
31015 SI_SIGIO,
31016 SI_ASYNCIO,
31017 SI_MESGQ,
31018 SI_TIMER,
31019 SI_QUEUE,
31020 SI_USER,
31021 SI_KERNEL = 0x80
31022 };
31023 enum
31024 {
31025 ILL_ILLOPC = 1,
31026 ILL_ILLOPN,
31027 ILL_ILLADR,
31028 ILL_ILLTRP,
31029 ILL_PRVOPC,
31030 ILL_PRVREG,
31031 ILL_COPROC,
31032 ILL_BADSTK
31033 };
31034 enum
31035 {
31036 FPE_INTDIV = 1,
31037 FPE_INTOVF,
31038 FPE_FLTDIV,
31039 FPE_FLTOVF,
31040 FPE_FLTUND,
31041 FPE_FLTRES,
31042 FPE_FLTINV,
31043 FPE_FLTSUB
31044 };
31045 enum
31046 {
31047 SEGV_MAPERR = 1,
31048 SEGV_ACCERR
31049 };
31050 enum
31051 {
31052 BUS_ADRALN = 1,
31053 BUS_ADRERR,
31054 BUS_OBJERR
31055 };
31056 enum
31057 {
31058 TRAP_BRKPT = 1,
31059 TRAP_TRACE
31060 };
31061 enum
31062 {
31063 CLD_EXITED = 1,
31064 CLD_KILLED,
31065 CLD_DUMPED,
31066 CLD_TRAPPED,
31067 CLD_STOPPED,
31068 CLD_CONTINUED
31069 };
31070 enum
31071 {
31072 POLL_IN = 1,
31073 POLL_OUT,
31074 POLL_MSG,
31075 POLL_ERR,
31076 POLL_PRI,
31077 POLL_HUP
31078 };
31079 typedef struct sigevent
31080 {
31081 sigval_t sigev_value;
31082 int sigev_signo;
31083 int sigev_notify;
31084 union
31085 {
31086 int _pad[((64 / sizeof (int)) - 4)];
31087 __pid_t _tid;
31088 struct
31089 {
31090 void (*_function) (sigval_t);
31091 void *_attribute;
31092 } _sigev_thread;
31093 } _sigev_un;
31094 } sigevent_t;
31095 enum
31096 {
31097 SIGEV_SIGNAL = 0,
31098 SIGEV_NONE,
31099 SIGEV_THREAD,
31100 SIGEV_THREAD_ID = 4
31101 };
31102 typedef void (*__sighandler_t) (int);
31103 extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
31104 throw ();
31105 extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
31106 throw ();
31107 extern __sighandler_t signal (int __sig, __sighandler_t __handler)
31108 throw ();
31109 extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
31110 throw ();
31111 extern int kill (__pid_t __pid, int __sig) throw ();
31112 extern int killpg (__pid_t __pgrp, int __sig) throw ();
31113 extern int raise (int __sig) throw ();
31114 extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
31115 throw ();
31116 extern int gsignal (int __sig) throw ();
31117 extern void psignal (int __sig, __const char *__s);
31118 extern void psiginfo (__const siginfo_t *__pinfo, __const char *__s);
31119 extern int __sigpause (int __sig_or_mask, int __is_sig);
31120 extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
31121 extern int sigblock (int __mask) throw () __attribute__ ((__deprecated__));
31122 extern int sigsetmask (int __mask) throw () __attribute__ ((__deprecated__));
31123 extern int siggetmask (void) throw () __attribute__ ((__deprecated__));
31124 typedef __sighandler_t sighandler_t;
31125 typedef __sighandler_t sig_t;
31126 extern int sigemptyset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
31127 extern int sigfillset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
31128 extern int sigaddset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));
31129 extern int sigdelset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));
31130 extern int sigismember (__const sigset_t *__set, int __signo)
31131 throw () __attribute__ ((__nonnull__ (1)));
31132 extern int sigisemptyset (__const sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
31133 extern int sigandset (sigset_t *__set, __const sigset_t *__left,
31134 __const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));
31135 extern int sigorset (sigset_t *__set, __const sigset_t *__left,
31136 __const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));
31137 struct sigaction
31138 {
31139 union
31140 {
31141 __sighandler_t sa_handler;
31142 void (*sa_sigaction) (int, siginfo_t *, void *);
31143 }
31144 __sigaction_handler;
31145 __sigset_t sa_mask;
31146 int sa_flags;
31147 void (*sa_restorer) (void);
31148 };
31149 extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
31150 sigset_t *__restrict __oset) throw ();
31151 extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
31152 extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
31153 struct sigaction *__restrict __oact) throw ();
31154 extern int sigpending (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
31155 extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
31156 __attribute__ ((__nonnull__ (1, 2)));
31157 extern int sigwaitinfo (__const sigset_t *__restrict __set,
31158 siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
31159 extern int sigtimedwait (__const sigset_t *__restrict __set,
31160 siginfo_t *__restrict __info,
31161 __const struct timespec *__restrict __timeout)
31162 __attribute__ ((__nonnull__ (1)));
31163 extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
31164 throw ();
31165 extern __const char *__const _sys_siglist[65];
31166 extern __const char *__const sys_siglist[65];
31167 struct sigvec
31168 {
31169 __sighandler_t sv_handler;
31170 int sv_mask;
31171 int sv_flags;
31172 };
31173 extern int sigvec (int __sig, __const struct sigvec *__vec,
31174 struct sigvec *__ovec) throw ();
31175 struct _fpreg
31176 {
31177 unsigned short significand[4];
31178 unsigned short exponent;
31179 };
31180 struct _fpxreg
31181 {
31182 unsigned short significand[4];
31183 unsigned short exponent;
31184 unsigned short padding[3];
31185 };
31186 struct _xmmreg
31187 {
31188 __uint32_t element[4];
31189 };
31190 struct _fpstate
31191 {
31192 __uint16_t cwd;
31193 __uint16_t swd;
31194 __uint16_t ftw;
31195 __uint16_t fop;
31196 __uint64_t rip;
31197 __uint64_t rdp;
31198 __uint32_t mxcsr;
31199 __uint32_t mxcr_mask;
31200 struct _fpxreg _st[8];
31201 struct _xmmreg _xmm[16];
31202 __uint32_t padding[24];
31203 };
31204 struct sigcontext
31205 {
31206 unsigned long r8;
31207 unsigned long r9;
31208 unsigned long r10;
31209 unsigned long r11;
31210 unsigned long r12;
31211 unsigned long r13;
31212 unsigned long r14;
31213 unsigned long r15;
31214 unsigned long rdi;
31215 unsigned long rsi;
31216 unsigned long rbp;
31217 unsigned long rbx;
31218 unsigned long rdx;
31219 unsigned long rax;
31220 unsigned long rcx;
31221 unsigned long rsp;
31222 unsigned long rip;
31223 unsigned long eflags;
31224 unsigned short cs;
31225 unsigned short gs;
31226 unsigned short fs;
31227 unsigned short __pad0;
31228 unsigned long err;
31229 unsigned long trapno;
31230 unsigned long oldmask;
31231 unsigned long cr2;
31232 struct _fpstate * fpstate;
31233 unsigned long __reserved1 [8];
31234 };
31235 extern int sigreturn (struct sigcontext *__scp) throw ();
31236 extern int siginterrupt (int __sig, int __interrupt) throw ();
31237 struct sigstack
31238 {
31239 void *ss_sp;
31240 int ss_onstack;
31241 };
31242 enum
31243 {
31244 SS_ONSTACK = 1,
31245 SS_DISABLE
31246 };
31247 typedef struct sigaltstack
31248 {
31249 void *ss_sp;
31250 int ss_flags;
31251 size_t ss_size;
31252 } stack_t;
31253 typedef long int greg_t;
31254 typedef greg_t gregset_t[23];
31255 enum
31256 {
31257 REG_R8 = 0,
31258 REG_R9,
31259 REG_R10,
31260 REG_R11,
31261 REG_R12,
31262 REG_R13,
31263 REG_R14,
31264 REG_R15,
31265 REG_RDI,
31266 REG_RSI,
31267 REG_RBP,
31268 REG_RBX,
31269 REG_RDX,
31270 REG_RAX,
31271 REG_RCX,
31272 REG_RSP,
31273 REG_RIP,
31274 REG_EFL,
31275 REG_CSGSFS,
31276 REG_ERR,
31277 REG_TRAPNO,
31278 REG_OLDMASK,
31279 REG_CR2
31280 };
31281 struct _libc_fpxreg
31282 {
31283 unsigned short int significand[4];
31284 unsigned short int exponent;
31285 unsigned short int padding[3];
31286 };
31287 struct _libc_xmmreg
31288 {
31289 __uint32_t element[4];
31290 };
31291 struct _libc_fpstate
31292 {
31293 __uint16_t cwd;
31294 __uint16_t swd;
31295 __uint16_t ftw;
31296 __uint16_t fop;
31297 __uint64_t rip;
31298 __uint64_t rdp;
31299 __uint32_t mxcsr;
31300 __uint32_t mxcr_mask;
31301 struct _libc_fpxreg _st[8];
31302 struct _libc_xmmreg _xmm[16];
31303 __uint32_t padding[24];
31304 };
31305 typedef struct _libc_fpstate *fpregset_t;
31306 typedef struct
31307 {
31308 gregset_t gregs;
31309 fpregset_t fpregs;
31310 unsigned long __reserved1 [8];
31311 } mcontext_t;
31312 typedef struct ucontext
31313 {
31314 unsigned long int uc_flags;
31315 struct ucontext *uc_link;
31316 stack_t uc_stack;
31317 mcontext_t uc_mcontext;
31318 __sigset_t uc_sigmask;
31319 struct _libc_fpstate __fpregs_mem;
31320 } ucontext_t;
31321 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
31322 throw () __attribute__ ((__deprecated__));
31323 extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
31324 struct sigaltstack *__restrict __oss) throw ();
31325 extern int sighold (int __sig) throw ();
31326 extern int sigrelse (int __sig) throw ();
31327 extern int sigignore (int __sig) throw ();
31328 extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw ();
31329 extern int pthread_sigmask (int __how,
31330 __const __sigset_t *__restrict __newmask,
31331 __sigset_t *__restrict __oldmask)throw ();
31332 extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
31333 extern int pthread_sigqueue (pthread_t __threadid, int __signo,
31334 const union sigval __value) throw ();
31335 extern int __libc_current_sigrtmin (void) throw ();
31336 extern int __libc_current_sigrtmax (void) throw ();
31337 }
31338 extern "C" {
31339 struct __jmp_buf_tag
31340 {
31341 __jmp_buf __jmpbuf;
31342 int __mask_was_saved;
31343 __sigset_t __saved_mask;
31344 };
31345 typedef struct __jmp_buf_tag jmp_buf[1];
31346 extern int setjmp (jmp_buf __env) throw ();
31347 extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) throw ();
31348 extern int _setjmp (struct __jmp_buf_tag __env[1]) throw ();
31349 extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
31350 throw () __attribute__ ((__noreturn__));
31351 extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
31352 throw () __attribute__ ((__noreturn__));
31353 typedef struct __jmp_buf_tag sigjmp_buf[1];
31354 extern void siglongjmp (sigjmp_buf __env, int __val)
31355 throw () __attribute__ ((__noreturn__));
31356 extern void longjmp (struct __jmp_buf_tag __env[1], int __val) throw () __asm__ ("" "__longjmp_chk")
31357 __attribute__ ((__noreturn__));
31358 extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) throw () __asm__ ("" "__longjmp_chk")
31359 __attribute__ ((__noreturn__));
31360 extern void siglongjmp (struct __jmp_buf_tag __env[1], int __val) throw () __asm__ ("" "__longjmp_chk")
31361 __attribute__ ((__noreturn__));
31362 }
31363 extern jmp_buf PyFPE_jbuf;
31364 extern int PyFPE_counter;
31365 extern double PyFPE_dummy(void *);
31366 }
31367
31368
31369 namespace std __attribute__ ((__visibility__ ("default"))) {
31370 namespace rel_ops
31371 {
31372 template <class _Tp>
31373 inline bool
31374 operator!=(const _Tp& __x, const _Tp& __y)
31375 { return !(__x == __y); }
31376 template <class _Tp>
31377 inline bool
31378 operator>(const _Tp& __x, const _Tp& __y)
31379 { return __y < __x; }
31380 template <class _Tp>
31381 inline bool
31382 operator<=(const _Tp& __x, const _Tp& __y)
31383 { return !(__y < __x); }
31384 template <class _Tp>
31385 inline bool
31386 operator>=(const _Tp& __x, const _Tp& __y)
31387 { return !(__x < __y); }
31388 }
31389 }
31390
31391
31392 namespace std __attribute__ ((__visibility__ ("default"))) {
31393 using ::div_t;
31394 using ::ldiv_t;
31395 using ::abort;
31396 using ::abs;
31397 using ::atexit;
31398 using ::atof;
31399 using ::atoi;
31400 using ::atol;
31401 using ::bsearch;
31402 using ::calloc;
31403 using ::div;
31404 using ::exit;
31405 using ::free;
31406 using ::getenv;
31407 using ::labs;
31408 using ::ldiv;
31409 using ::malloc;
31410 using ::mblen;
31411 using ::mbstowcs;
31412 using ::mbtowc;
31413 using ::qsort;
31414 using ::rand;
31415 using ::realloc;
31416 using ::srand;
31417 using ::strtod;
31418 using ::strtol;
31419 using ::strtoul;
31420 using ::system;
31421 using ::wcstombs;
31422 using ::wctomb;
31423 inline long
31424 abs(long __i) { return labs(__i); }
31425 inline ldiv_t
31426 div(long __i, long __j) { return ldiv(__i, __j); }
31427 }
31428 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
31429 using ::lldiv_t;
31430 using ::_Exit;
31431 inline long long
31432 abs(long long __x) { return __x >= 0 ? __x : -__x; }
31433 using ::llabs;
31434 inline lldiv_t
31435 div(long long __n, long long __d)
31436 { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
31437 using ::lldiv;
31438 using ::atoll;
31439 using ::strtoll;
31440 using ::strtoull;
31441 using ::strtof;
31442 using ::strtold;
31443 }
31444 namespace std __attribute__ ((__visibility__ ("default"))) {
31445 using ::__gnu_cxx::lldiv_t;
31446 using ::__gnu_cxx::_Exit;
31447 using ::__gnu_cxx::abs;
31448 using ::__gnu_cxx::llabs;
31449 using ::__gnu_cxx::div;
31450 using ::__gnu_cxx::lldiv;
31451 using ::__gnu_cxx::atoll;
31452 using ::__gnu_cxx::strtof;
31453 using ::__gnu_cxx::strtoll;
31454 using ::__gnu_cxx::strtoull;
31455 using ::__gnu_cxx::strtold;
31456 }
31457 namespace boost{
31458 __extension__ typedef long long long_long_type;
31459 __extension__ typedef unsigned long long ulong_long_type;
31460 }
31461 namespace mpl_ { namespace aux {} }
31462 namespace boost { namespace mpl { using namespace mpl_;
31463 namespace aux { using namespace mpl_::aux; }
31464 }}
31465 namespace mpl_ {
31466 template< int N > struct int_;
31467 }
31468 namespace boost { namespace mpl { using ::mpl_::int_; } }
31469 namespace mpl_ {
31470 struct integral_c_tag { static const int value = 0; };
31471 }
31472 namespace boost { namespace mpl { using ::mpl_::integral_c_tag; } }
31473 namespace mpl_ {
31474 template< int N >
31475 struct int_
31476 {
31477 static const int value = N;
31478 typedef int_ type;
31479 typedef int value_type;
31480 typedef integral_c_tag tag;
31481 typedef mpl_::int_< static_cast<int>((value + 1)) > next;
31482 typedef mpl_::int_< static_cast<int>((value - 1)) > prior;
31483 operator int() const { return static_cast<int>(this->value); }
31484 };
31485 template< int N >
31486 int const mpl_::int_< N >::value;
31487 }
31488 namespace boost { namespace mpl { namespace aux {
31489 template< typename F > struct template_arity;
31490 }}}
31491 namespace mpl_ {
31492 template< bool C_ > struct bool_;
31493 typedef bool_<true> true_;
31494 typedef bool_<false> false_;
31495 }
31496 namespace boost { namespace mpl { using ::mpl_::bool_; } }
31497 namespace boost { namespace mpl { using ::mpl_::true_; } }
31498 namespace boost { namespace mpl { using ::mpl_::false_; } }
31499 namespace mpl_ {
31500 template< bool C_ > struct bool_
31501 {
31502 static const bool value = C_;
31503 typedef integral_c_tag tag;
31504 typedef bool_ type;
31505 typedef bool value_type;
31506 operator bool() const { return this->value; }
31507 };
31508 template< bool C_ >
31509 bool const bool_<C_>::value;
31510 }
31511 namespace mpl_ {
31512 template< typename T, T N > struct integral_c;
31513 }
31514 namespace boost { namespace mpl { using ::mpl_::integral_c; } }
31515 namespace mpl_ {
31516 template< typename T, T N >
31517 struct integral_c
31518 {
31519 static const T value = N;
31520 typedef integral_c type;
31521 typedef T value_type;
31522 typedef integral_c_tag tag;
31523 typedef integral_c< T, static_cast<T>((value + 1)) > next;
31524 typedef integral_c< T, static_cast<T>((value - 1)) > prior;
31525 operator T() const { return static_cast<T>(this->value); }
31526 };
31527 template< typename T, T N >
31528 T const integral_c< T, N >::value;
31529 }
31530 namespace mpl_ {
31531 template< bool C >
31532 struct integral_c<bool, C>
31533 {
31534 static const bool value = C;
31535 typedef integral_c_tag tag;
31536 typedef integral_c type;
31537 typedef bool value_type;
31538 operator bool() const { return this->value; }
31539 };
31540 }
31541 namespace boost{
31542 template <class T, T val>
31543 struct integral_constant : public mpl::integral_c<T, val>
31544 {
31545 typedef integral_constant<T,val> type;
31546 };
31547 template<> struct integral_constant<bool,true> : public mpl::true_
31548 {
31549 typedef integral_constant<bool,true> type;
31550 };
31551 template<> struct integral_constant<bool,false> : public mpl::false_
31552 {
31553 typedef integral_constant<bool,false> type;
31554 };
31555 typedef integral_constant<bool,true> true_type;
31556 typedef integral_constant<bool,false> false_type;
31557 }
31558 namespace boost {
31559 template< typename T, typename U > struct is_same : ::boost::integral_constant<bool,false> { };
31560 template< typename T > struct is_same< T,T > : ::boost::integral_constant<bool,true> { };
31561 }
31562 namespace boost {
31563 template< typename T > struct add_const { typedef T const type; };
31564 template< typename T > struct add_const<T&> { typedef T& type; };
31565 }
31566 namespace boost {
31567 template< typename T > struct add_volatile { typedef T volatile type; };
31568 template< typename T > struct add_volatile<T&> { typedef T& type; };
31569 }
31570 namespace boost {
31571 template< typename T > struct add_cv { typedef T const volatile type; };
31572 template< typename T > struct add_cv<T&> { typedef T& type; };
31573 }
31574 namespace boost {
31575 namespace detail {
31576 template <typename T> struct cv_traits_imp {};
31577 template <typename T>
31578 struct cv_traits_imp<T*>
31579 {
31580 static const bool is_const = false;
31581 static const bool is_volatile = false;
31582 typedef T unqualified_type;
31583 };
31584 template <typename T>
31585 struct cv_traits_imp<const T*>
31586 {
31587 static const bool is_const = true;
31588 static const bool is_volatile = false;
31589 typedef T unqualified_type;
31590 };
31591 template <typename T>
31592 struct cv_traits_imp<volatile T*>
31593 {
31594 static const bool is_const = false;
31595 static const bool is_volatile = true;
31596 typedef T unqualified_type;
31597 };
31598 template <typename T>
31599 struct cv_traits_imp<const volatile T*>
31600 {
31601 static const bool is_const = true;
31602 static const bool is_volatile = true;
31603 typedef T unqualified_type;
31604 };
31605 }
31606 }
31607 namespace boost {
31608 template< typename T > struct is_reference : ::boost::integral_constant<bool,false> { };
31609 template< typename T > struct is_reference< T& > : ::boost::integral_constant<bool,true> { };
31610 }
31611 namespace boost {
31612 template< typename T > struct is_const : ::boost::integral_constant<bool,::boost::detail::cv_traits_imp<T*>::is_const> { };
31613 template< typename T > struct is_const< T& > : ::boost::integral_constant<bool,false> { };
31614 }
31615 namespace boost {
31616 template< typename T > struct is_volatile : ::boost::integral_constant<bool,::boost::detail::cv_traits_imp<T*>::is_volatile> { };
31617 template< typename T > struct is_volatile< T& > : ::boost::integral_constant<bool,false> { };
31618 }
31619
31620 namespace boost {
31621 namespace detail {
31622 template <typename T, bool is_vol>
31623 struct remove_const_helper
31624 {
31625 typedef T type;
31626 };
31627 template <typename T>
31628 struct remove_const_helper<T, true>
31629 {
31630 typedef T volatile type;
31631 };
31632 template <typename T>
31633 struct remove_const_impl
31634 {
31635 typedef typename remove_const_helper<
31636 typename cv_traits_imp<T*>::unqualified_type
31637 , ::boost::is_volatile<T>::value
31638 >::type type;
31639 };
31640 }
31641 template< typename T > struct remove_const { typedef typename boost::detail::remove_const_impl<T>::type type; };
31642 template< typename T > struct remove_const<T&> { typedef T& type; };
31643 template< typename T, std::size_t N > struct remove_const<T const[N]> { typedef T type[N]; };
31644 template< typename T, std::size_t N > struct remove_const<T const volatile[N]> { typedef T volatile type[N]; };
31645 }
31646
31647 namespace boost {
31648 namespace detail {
31649 template <typename T, bool is_const>
31650 struct remove_volatile_helper
31651 {
31652 typedef T type;
31653 };
31654 template <typename T>
31655 struct remove_volatile_helper<T,true>
31656 {
31657 typedef T const type;
31658 };
31659 template <typename T>
31660 struct remove_volatile_impl
31661 {
31662 typedef typename remove_volatile_helper<
31663 typename cv_traits_imp<T*>::unqualified_type
31664 , ::boost::is_const<T>::value
31665 >::type type;
31666 };
31667 }
31668 template< typename T > struct remove_volatile { typedef typename boost::detail::remove_volatile_impl<T>::type type; };
31669 template< typename T > struct remove_volatile<T&> { typedef T& type; };
31670 template< typename T, std::size_t N > struct remove_volatile<T volatile[N]> { typedef T type[N]; };
31671 template< typename T, std::size_t N > struct remove_volatile<T const volatile[N]> { typedef T const type[N]; };
31672 }
31673
31674 namespace boost {
31675 template< typename T > struct remove_cv { typedef typename boost::detail::cv_traits_imp<T*>::unqualified_type type; };
31676 template< typename T > struct remove_cv<T&> { typedef T& type; };
31677 template< typename T, std::size_t N > struct remove_cv<T const[N]> { typedef T type[N]; };
31678 template< typename T, std::size_t N > struct remove_cv<T volatile[N]> { typedef T type[N]; };
31679 template< typename T, std::size_t N > struct remove_cv<T const volatile[N]> { typedef T type[N]; };
31680 }
31681 namespace boost {
31682 template <class T>
31683 struct type {};
31684 }
31685 namespace boost { namespace python {
31686 namespace detail
31687 {
31688 struct unspecialized {};
31689 }
31690 template <class T> struct base_type_traits
31691 : detail::unspecialized
31692 {};
31693 template <>
31694 struct base_type_traits<PyObject>
31695 {
31696 typedef PyObject type;
31697 };
31698 template <>
31699 struct base_type_traits<PyTypeObject>
31700 {
31701 typedef PyObject type;
31702 };
31703 template <>
31704 struct base_type_traits<PyMethodObject>
31705 {
31706 typedef PyObject type;
31707 };
31708 }}
31709 namespace boost { namespace python { namespace detail {
31710 typedef char* yes_convertible;
31711 typedef int* no_convertible;
31712 template <class Target>
31713 struct convertible
31714 {
31715 static inline no_convertible check(...) { return 0; }
31716 static inline yes_convertible check(Target) { return 0; }
31717 };
31718 }}}
31719 namespace boost { namespace python {
31720 namespace detail
31721 {
31722 template <class Source, class Target> inline Target* upcast_impl(Source*, Target*);
31723 template <class Source, class Target>
31724 inline Target* upcast(Source* p, yes_convertible, no_convertible, Target*)
31725 {
31726 return p;
31727 }
31728 template <class Source, class Target>
31729 inline Target* upcast(Source* p, no_convertible, no_convertible, Target*)
31730 {
31731 typedef typename base_type_traits<Source>::type base;
31732 return detail::upcast_impl((base*)p, (Target*)0);
31733 }
31734 template <bool is_same = true>
31735 struct upcaster
31736 {
31737 template <class T>
31738 static inline T* execute(T* x, T*) { return x; }
31739 };
31740 template <>
31741 struct upcaster<false>
31742 {
31743 template <class Source, class Target>
31744 static inline Target* execute(Source* x, Target*)
31745 {
31746 return detail::upcast(
31747 x, detail::convertible<Target*>::check(x)
31748 , detail::convertible<Source*>::check((Target*)0)
31749 , (Target*)0);
31750 }
31751 };
31752 template <class Target, class Source>
31753 inline Target* downcast(Source* p, yes_convertible)
31754 {
31755 return static_cast<Target*>(p);
31756 }
31757 template <class Target, class Source>
31758 inline Target* downcast(Source* p, no_convertible, boost::type<Target>* = 0)
31759 {
31760 typedef typename base_type_traits<Source>::type base;
31761 return (Target*)detail::downcast<base>(p, convertible<Source*>::check((base*)0));
31762 }
31763 template <class T>
31764 inline void assert_castable(boost::type<T>* = 0)
31765 {
31766 typedef char must_be_a_complete_type[sizeof(T)];
31767 }
31768 template <class Source, class Target>
31769 inline Target* upcast_impl(Source* x, Target*)
31770 {
31771 typedef typename add_cv<Source>::type src_t;
31772 typedef typename add_cv<Target>::type target_t;
31773 bool const same = is_same<src_t,target_t>::value;
31774 return detail::upcaster<same>::execute(x, (Target*)0);
31775 }
31776 }
31777 template <class Target, class Source>
31778 inline Target* upcast(Source* x, Target* = 0)
31779 {
31780 detail::assert_castable<Source>();
31781 detail::assert_castable<Target>();
31782 return detail::upcast_impl(x, (Target*)0);
31783 }
31784 template <class Target, class Source>
31785 inline Target* downcast(Source* x, Target* = 0)
31786 {
31787 detail::assert_castable<Source>();
31788 detail::assert_castable<Target>();
31789 return detail::downcast<Target>(x, detail::convertible<Source*>::check((Target*)0));
31790 }
31791 }}
31792
31793
31794
31795
31796
31797 namespace std __attribute__ ((__visibility__ ("default"))) {
31798 template<typename _FIter, typename _Tp>
31799 bool
31800 binary_search(_FIter, _FIter, const _Tp&);
31801 template<typename _FIter, typename _Tp, typename _Compare>
31802 bool
31803 binary_search(_FIter, _FIter, const _Tp&, _Compare);
31804 template<typename _IIter, typename _OIter>
31805 _OIter
31806 copy(_IIter, _IIter, _OIter);
31807 template<typename _BIter1, typename _BIter2>
31808 _BIter2
31809 copy_backward(_BIter1, _BIter1, _BIter2);
31810 template<typename _FIter, typename _Tp>
31811 pair<_FIter, _FIter>
31812 equal_range(_FIter, _FIter, const _Tp&);
31813 template<typename _FIter, typename _Tp, typename _Compare>
31814 pair<_FIter, _FIter>
31815 equal_range(_FIter, _FIter, const _Tp&, _Compare);
31816 template<typename _FIter, typename _Tp>
31817 void
31818 fill(_FIter, _FIter, const _Tp&);
31819 template<typename _OIter, typename _Size, typename _Tp>
31820 _OIter
31821 fill_n(_OIter, _Size, const _Tp&);
31822 template<typename _FIter1, typename _FIter2>
31823 _FIter1
31824 find_end(_FIter1, _FIter1, _FIter2, _FIter2);
31825 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
31826 _FIter1
31827 find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
31828 template<typename _IIter1, typename _IIter2>
31829 bool
31830 includes(_IIter1, _IIter1, _IIter2, _IIter2);
31831 template<typename _IIter1, typename _IIter2, typename _Compare>
31832 bool
31833 includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
31834 template<typename _BIter>
31835 void
31836 inplace_merge(_BIter, _BIter, _BIter);
31837 template<typename _BIter, typename _Compare>
31838 void
31839 inplace_merge(_BIter, _BIter, _BIter, _Compare);
31840 template<typename _FIter1, typename _FIter2>
31841 void
31842 iter_swap(_FIter1, _FIter2);
31843 template<typename _FIter, typename _Tp>
31844 _FIter
31845 lower_bound(_FIter, _FIter, const _Tp&);
31846 template<typename _FIter, typename _Tp, typename _Compare>
31847 _FIter
31848 lower_bound(_FIter, _FIter, const _Tp&, _Compare);
31849 template<typename _RAIter>
31850 void
31851 make_heap(_RAIter, _RAIter);
31852 template<typename _RAIter, typename _Compare>
31853 void
31854 make_heap(_RAIter, _RAIter, _Compare);
31855 template<typename _Tp>
31856 const _Tp&
31857 max(const _Tp&, const _Tp&);
31858 template<typename _Tp, typename _Compare>
31859 const _Tp&
31860 max(const _Tp&, const _Tp&, _Compare);
31861 template<typename _Tp>
31862 const _Tp&
31863 min(const _Tp&, const _Tp&);
31864 template<typename _Tp, typename _Compare>
31865 const _Tp&
31866 min(const _Tp&, const _Tp&, _Compare);
31867 template<typename _BIter>
31868 bool
31869 next_permutation(_BIter, _BIter);
31870 template<typename _BIter, typename _Compare>
31871 bool
31872 next_permutation(_BIter, _BIter, _Compare);
31873 template<typename _IIter, typename _RAIter>
31874 _RAIter
31875 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
31876 template<typename _IIter, typename _RAIter, typename _Compare>
31877 _RAIter
31878 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
31879 template<typename _RAIter>
31880 void
31881 pop_heap(_RAIter, _RAIter);
31882 template<typename _RAIter, typename _Compare>
31883 void
31884 pop_heap(_RAIter, _RAIter, _Compare);
31885 template<typename _BIter>
31886 bool
31887 prev_permutation(_BIter, _BIter);
31888 template<typename _BIter, typename _Compare>
31889 bool
31890 prev_permutation(_BIter, _BIter, _Compare);
31891 template<typename _RAIter>
31892 void
31893 push_heap(_RAIter, _RAIter);
31894 template<typename _RAIter, typename _Compare>
31895 void
31896 push_heap(_RAIter, _RAIter, _Compare);
31897 template<typename _FIter, typename _Tp>
31898 _FIter
31899 remove(_FIter, _FIter, const _Tp&);
31900 template<typename _FIter, typename _Predicate>
31901 _FIter
31902 remove_if(_FIter, _FIter, _Predicate);
31903 template<typename _IIter, typename _OIter, typename _Tp>
31904 _OIter
31905 remove_copy(_IIter, _IIter, _OIter, const _Tp&);
31906 template<typename _IIter, typename _OIter, typename _Predicate>
31907 _OIter
31908 remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
31909 template<typename _IIter, typename _OIter, typename _Tp>
31910 _OIter
31911 replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
31912 template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
31913 _OIter
31914 replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
31915 template<typename _BIter>
31916 void
31917 reverse(_BIter, _BIter);
31918 template<typename _BIter, typename _OIter>
31919 _OIter
31920 reverse_copy(_BIter, _BIter, _OIter);
31921 template<typename _FIter>
31922 void
31923 rotate(_FIter, _FIter, _FIter);
31924 template<typename _FIter, typename _OIter>
31925 _OIter
31926 rotate_copy(_FIter, _FIter, _FIter, _OIter);
31927 template<typename _RAIter>
31928 void
31929 sort_heap(_RAIter, _RAIter);
31930 template<typename _RAIter, typename _Compare>
31931 void
31932 sort_heap(_RAIter, _RAIter, _Compare);
31933 template<typename _BIter, typename _Predicate>
31934 _BIter
31935 stable_partition(_BIter, _BIter, _Predicate);
31936 template<typename _Tp>
31937 void
31938 swap(_Tp&, _Tp&);
31939 template<typename _Tp, size_t _Nm>
31940 void
31941 swap(_Tp (&)[_Nm], _Tp (&)[_Nm]);
31942 template<typename _FIter1, typename _FIter2>
31943 _FIter2
31944 swap_ranges(_FIter1, _FIter1, _FIter2);
31945 template<typename _FIter>
31946 _FIter
31947 unique(_FIter, _FIter);
31948 template<typename _FIter, typename _BinaryPredicate>
31949 _FIter
31950 unique(_FIter, _FIter, _BinaryPredicate);
31951 template<typename _FIter, typename _Tp>
31952 _FIter
31953 upper_bound(_FIter, _FIter, const _Tp&);
31954 template<typename _FIter, typename _Tp, typename _Compare>
31955 _FIter
31956 upper_bound(_FIter, _FIter, const _Tp&, _Compare);
31957 }
31958 namespace std __attribute__ ((__visibility__ ("default"))) {
31959 template<typename _FIter>
31960 _FIter
31961 adjacent_find(_FIter, _FIter);
31962 template<typename _FIter, typename _BinaryPredicate>
31963 _FIter
31964 adjacent_find(_FIter, _FIter, _BinaryPredicate);
31965 template<typename _IIter, typename _Tp>
31966 typename iterator_traits<_IIter>::difference_type
31967 count(_IIter, _IIter, const _Tp&);
31968 template<typename _IIter, typename _Predicate>
31969 typename iterator_traits<_IIter>::difference_type
31970 count_if(_IIter, _IIter, _Predicate);
31971 template<typename _IIter1, typename _IIter2>
31972 bool
31973 equal(_IIter1, _IIter1, _IIter2);
31974 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
31975 bool
31976 equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
31977 template<typename _IIter, typename _Tp>
31978 _IIter
31979 find(_IIter, _IIter, const _Tp&);
31980 template<typename _FIter1, typename _FIter2>
31981 _FIter1
31982 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
31983 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
31984 _FIter1
31985 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
31986 template<typename _IIter, typename _Predicate>
31987 _IIter
31988 find_if(_IIter, _IIter, _Predicate);
31989 template<typename _IIter, typename _Funct>
31990 _Funct
31991 for_each(_IIter, _IIter, _Funct);
31992 template<typename _FIter, typename _Generator>
31993 void
31994 generate(_FIter, _FIter, _Generator);
31995 template<typename _OIter, typename _Size, typename _Generator>
31996 _OIter
31997 generate_n(_OIter, _Size, _Generator);
31998 template<typename _IIter1, typename _IIter2>
31999 bool
32000 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
32001 template<typename _IIter1, typename _IIter2, typename _Compare>
32002 bool
32003 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
32004 template<typename _FIter>
32005 _FIter
32006 max_element(_FIter, _FIter);
32007 template<typename _FIter, typename _Compare>
32008 _FIter
32009 max_element(_FIter, _FIter, _Compare);
32010 template<typename _IIter1, typename _IIter2, typename _OIter>
32011 _OIter
32012 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
32013 template<typename _IIter1, typename _IIter2, typename _OIter,
32014 typename _Compare>
32015 _OIter
32016 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
32017 template<typename _FIter>
32018 _FIter
32019 min_element(_FIter, _FIter);
32020 template<typename _FIter, typename _Compare>
32021 _FIter
32022 min_element(_FIter, _FIter, _Compare);
32023 template<typename _IIter1, typename _IIter2>
32024 pair<_IIter1, _IIter2>
32025 mismatch(_IIter1, _IIter1, _IIter2);
32026 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
32027 pair<_IIter1, _IIter2>
32028 mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
32029 template<typename _RAIter>
32030 void
32031 nth_element(_RAIter, _RAIter, _RAIter);
32032 template<typename _RAIter, typename _Compare>
32033 void
32034 nth_element(_RAIter, _RAIter, _RAIter, _Compare);
32035 template<typename _RAIter>
32036 void
32037 partial_sort(_RAIter, _RAIter, _RAIter);
32038 template<typename _RAIter, typename _Compare>
32039 void
32040 partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
32041 template<typename _BIter, typename _Predicate>
32042 _BIter
32043 partition(_BIter, _BIter, _Predicate);
32044 template<typename _RAIter>
32045 void
32046 random_shuffle(_RAIter, _RAIter);
32047 template<typename _RAIter, typename _Generator>
32048 void
32049 random_shuffle(_RAIter, _RAIter,
32050 _Generator&);
32051 template<typename _FIter, typename _Tp>
32052 void
32053 replace(_FIter, _FIter, const _Tp&, const _Tp&);
32054 template<typename _FIter, typename _Predicate, typename _Tp>
32055 void
32056 replace_if(_FIter, _FIter, _Predicate, const _Tp&);
32057 template<typename _FIter1, typename _FIter2>
32058 _FIter1
32059 search(_FIter1, _FIter1, _FIter2, _FIter2);
32060 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
32061 _FIter1
32062 search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
32063 template<typename _FIter, typename _Size, typename _Tp>
32064 _FIter
32065 search_n(_FIter, _FIter, _Size, const _Tp&);
32066 template<typename _FIter, typename _Size, typename _Tp,
32067 typename _BinaryPredicate>
32068 _FIter
32069 search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
32070 template<typename _IIter1, typename _IIter2, typename _OIter>
32071 _OIter
32072 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
32073 template<typename _IIter1, typename _IIter2, typename _OIter,
32074 typename _Compare>
32075 _OIter
32076 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
32077 template<typename _IIter1, typename _IIter2, typename _OIter>
32078 _OIter
32079 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
32080 template<typename _IIter1, typename _IIter2, typename _OIter,
32081 typename _Compare>
32082 _OIter
32083 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
32084 template<typename _IIter1, typename _IIter2, typename _OIter>
32085 _OIter
32086 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
32087 template<typename _IIter1, typename _IIter2, typename _OIter,
32088 typename _Compare>
32089 _OIter
32090 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
32091 _OIter, _Compare);
32092 template<typename _IIter1, typename _IIter2, typename _OIter>
32093 _OIter
32094 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
32095 template<typename _IIter1, typename _IIter2, typename _OIter,
32096 typename _Compare>
32097 _OIter
32098 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
32099 template<typename _RAIter>
32100 void
32101 sort(_RAIter, _RAIter);
32102 template<typename _RAIter, typename _Compare>
32103 void
32104 sort(_RAIter, _RAIter, _Compare);
32105 template<typename _RAIter>
32106 void
32107 stable_sort(_RAIter, _RAIter);
32108 template<typename _RAIter, typename _Compare>
32109 void
32110 stable_sort(_RAIter, _RAIter, _Compare);
32111 template<typename _IIter, typename _OIter, typename _UnaryOperation>
32112 _OIter
32113 transform(_IIter, _IIter, _OIter, _UnaryOperation);
32114 template<typename _IIter1, typename _IIter2, typename _OIter,
32115 typename _BinaryOperation>
32116 _OIter
32117 transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
32118 template<typename _IIter, typename _OIter>
32119 _OIter
32120 unique_copy(_IIter, _IIter, _OIter);
32121 template<typename _IIter, typename _OIter, typename _BinaryPredicate>
32122 _OIter
32123 unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
32124 }
32125 namespace std __attribute__ ((__visibility__ ("default"))) {
32126 template<typename _RandomAccessIterator, typename _Distance>
32127 _Distance
32128 __is_heap_until(_RandomAccessIterator __first, _Distance __n)
32129 {
32130 _Distance __parent = 0;
32131 for (_Distance __child = 1; __child < __n; ++__child)
32132 {
32133 if (__first[__parent] < __first[__child])
32134 return __child;
32135 if ((__child & 1) == 0)
32136 ++__parent;
32137 }
32138 return __n;
32139 }
32140 template<typename _RandomAccessIterator, typename _Distance,
32141 typename _Compare>
32142 _Distance
32143 __is_heap_until(_RandomAccessIterator __first, _Distance __n,
32144 _Compare __comp)
32145 {
32146 _Distance __parent = 0;
32147 for (_Distance __child = 1; __child < __n; ++__child)
32148 {
32149 if (__comp(__first[__parent], __first[__child]))
32150 return __child;
32151 if ((__child & 1) == 0)
32152 ++__parent;
32153 }
32154 return __n;
32155 }
32156 template<typename _RandomAccessIterator, typename _Distance>
32157 inline bool
32158 __is_heap(_RandomAccessIterator __first, _Distance __n)
32159 { return std::__is_heap_until(__first, __n) == __n; }
32160 template<typename _RandomAccessIterator, typename _Compare,
32161 typename _Distance>
32162 inline bool
32163 __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n)
32164 { return std::__is_heap_until(__first, __n, __comp) == __n; }
32165 template<typename _RandomAccessIterator>
32166 inline bool
32167 __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
32168 { return std::__is_heap(__first, std::distance(__first, __last)); }
32169 template<typename _RandomAccessIterator, typename _Compare>
32170 inline bool
32171 __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
32172 _Compare __comp)
32173 { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }
32174 template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
32175 void
32176 __push_heap(_RandomAccessIterator __first,
32177 _Distance __holeIndex, _Distance __topIndex, _Tp __value)
32178 {
32179 _Distance __parent = (__holeIndex - 1) / 2;
32180 while (__holeIndex > __topIndex && *(__first + __parent) < __value)
32181 {
32182 *(__first + __holeIndex) = (*(__first + __parent));
32183 __holeIndex = __parent;
32184 __parent = (__holeIndex - 1) / 2;
32185 }
32186 *(__first + __holeIndex) = (__value);
32187 }
32188 template<typename _RandomAccessIterator>
32189 inline void
32190 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
32191 {
32192 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32193 _ValueType;
32194 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
32195 _DistanceType;
32196
32197
32198 ;
32199 ;
32200 _ValueType __value = (*(__last - 1));
32201 std::__push_heap(__first, _DistanceType((__last - __first) - 1),
32202 _DistanceType(0), (__value));
32203 }
32204 template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
32205 typename _Compare>
32206 void
32207 __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
32208 _Distance __topIndex, _Tp __value, _Compare __comp)
32209 {
32210 _Distance __parent = (__holeIndex - 1) / 2;
32211 while (__holeIndex > __topIndex
32212 && __comp(*(__first + __parent), __value))
32213 {
32214 *(__first + __holeIndex) = (*(__first + __parent));
32215 __holeIndex = __parent;
32216 __parent = (__holeIndex - 1) / 2;
32217 }
32218 *(__first + __holeIndex) = (__value);
32219 }
32220 template<typename _RandomAccessIterator, typename _Compare>
32221 inline void
32222 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
32223 _Compare __comp)
32224 {
32225 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32226 _ValueType;
32227 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
32228 _DistanceType;
32229
32230 ;
32231 ;
32232 _ValueType __value = (*(__last - 1));
32233 std::__push_heap(__first, _DistanceType((__last - __first) - 1),
32234 _DistanceType(0), (__value), __comp);
32235 }
32236 template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
32237 void
32238 __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
32239 _Distance __len, _Tp __value)
32240 {
32241 const _Distance __topIndex = __holeIndex;
32242 _Distance __secondChild = __holeIndex;
32243 while (__secondChild < (__len - 1) / 2)
32244 {
32245 __secondChild = 2 * (__secondChild + 1);
32246 if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
32247 __secondChild--;
32248 *(__first + __holeIndex) = (*(__first + __secondChild));
32249 __holeIndex = __secondChild;
32250 }
32251 if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
32252 {
32253 __secondChild = 2 * (__secondChild + 1);
32254 *(__first + __holeIndex) = (*(__first + (__secondChild - 1)))
32255 ;
32256 __holeIndex = __secondChild - 1;
32257 }
32258 std::__push_heap(__first, __holeIndex, __topIndex,
32259 (__value));
32260 }
32261 template<typename _RandomAccessIterator>
32262 inline void
32263 __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
32264 _RandomAccessIterator __result)
32265 {
32266 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32267 _ValueType;
32268 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
32269 _DistanceType;
32270 _ValueType __value = (*__result);
32271 *__result = (*__first);
32272 std::__adjust_heap(__first, _DistanceType(0),
32273 _DistanceType(__last - __first),
32274 (__value));
32275 }
32276 template<typename _RandomAccessIterator>
32277 inline void
32278 pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
32279 {
32280 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32281 _ValueType;
32282
32283
32284 ;
32285 ;
32286 --__last;
32287 std::__pop_heap(__first, __last, __last);
32288 }
32289 template<typename _RandomAccessIterator, typename _Distance,
32290 typename _Tp, typename _Compare>
32291 void
32292 __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
32293 _Distance __len, _Tp __value, _Compare __comp)
32294 {
32295 const _Distance __topIndex = __holeIndex;
32296 _Distance __secondChild = __holeIndex;
32297 while (__secondChild < (__len - 1) / 2)
32298 {
32299 __secondChild = 2 * (__secondChild + 1);
32300 if (__comp(*(__first + __secondChild),
32301 *(__first + (__secondChild - 1))))
32302 __secondChild--;
32303 *(__first + __holeIndex) = (*(__first + __secondChild));
32304 __holeIndex = __secondChild;
32305 }
32306 if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
32307 {
32308 __secondChild = 2 * (__secondChild + 1);
32309 *(__first + __holeIndex) = (*(__first + (__secondChild - 1)))
32310 ;
32311 __holeIndex = __secondChild - 1;
32312 }
32313 std::__push_heap(__first, __holeIndex, __topIndex,
32314 (__value), __comp);
32315 }
32316 template<typename _RandomAccessIterator, typename _Compare>
32317 inline void
32318 __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
32319 _RandomAccessIterator __result, _Compare __comp)
32320 {
32321 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32322 _ValueType;
32323 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
32324 _DistanceType;
32325 _ValueType __value = (*__result);
32326 *__result = (*__first);
32327 std::__adjust_heap(__first, _DistanceType(0),
32328 _DistanceType(__last - __first),
32329 (__value), __comp);
32330 }
32331 template<typename _RandomAccessIterator, typename _Compare>
32332 inline void
32333 pop_heap(_RandomAccessIterator __first,
32334 _RandomAccessIterator __last, _Compare __comp)
32335 {
32336
32337 ;
32338 ;
32339 --__last;
32340 std::__pop_heap(__first, __last, __last, __comp);
32341 }
32342 template<typename _RandomAccessIterator>
32343 void
32344 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
32345 {
32346 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32347 _ValueType;
32348 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
32349 _DistanceType;
32350
32351
32352 ;
32353 if (__last - __first < 2)
32354 return;
32355 const _DistanceType __len = __last - __first;
32356 _DistanceType __parent = (__len - 2) / 2;
32357 while (true)
32358 {
32359 _ValueType __value = (*(__first + __parent));
32360 std::__adjust_heap(__first, __parent, __len, (__value));
32361 if (__parent == 0)
32362 return;
32363 __parent--;
32364 }
32365 }
32366 template<typename _RandomAccessIterator, typename _Compare>
32367 void
32368 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
32369 _Compare __comp)
32370 {
32371 typedef typename iterator_traits<_RandomAccessIterator>::value_type
32372 _ValueType;
32373 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
32374 _DistanceType;
32375
32376 ;
32377 if (__last - __first < 2)
32378 return;
32379 const _DistanceType __len = __last - __first;
32380 _DistanceType __parent = (__len - 2) / 2;
32381 while (true)
32382 {
32383 _ValueType __value = (*(__first + __parent));
32384 std::__adjust_heap(__first, __parent, __len, (__value),
32385 __comp);
32386 if (__parent == 0)
32387 return;
32388 __parent--;
32389 }
32390 }
32391 template<typename _RandomAccessIterator>
32392 void
32393 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
32394 {
32395
32396
32397 ;
32398 ;
32399 while (__last - __first > 1)
32400 {
32401 --__last;
32402 std::__pop_heap(__first, __last, __last);
32403 }
32404 }
32405 template<typename _RandomAccessIterator, typename _Compare>
32406 void
32407 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
32408 _Compare __comp)
32409 {
32410
32411 ;
32412 ;
32413 while (__last - __first > 1)
32414 {
32415 --__last;
32416 std::__pop_heap(__first, __last, __last, __comp);
32417 }
32418 }
32419 }
32420 namespace std __attribute__ ((__visibility__ ("default"))) {
32421 template<typename _Tp>
32422 pair<_Tp*, ptrdiff_t>
32423 get_temporary_buffer(ptrdiff_t __len)
32424 {
32425 const ptrdiff_t __max =
32426 __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
32427 if (__len > __max)
32428 __len = __max;
32429 while (__len > 0)
32430 {
32431 _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
32432 std::nothrow));
32433 if (__tmp != 0)
32434 return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
32435 __len /= 2;
32436 }
32437 return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
32438 }
32439 template<typename _Tp>
32440 inline void
32441 return_temporary_buffer(_Tp* __p)
32442 { ::operator delete(__p, std::nothrow); }
32443 template<typename _ForwardIterator, typename _Tp>
32444 class _Temporary_buffer
32445 {
32446
32447 public:
32448 typedef _Tp value_type;
32449 typedef value_type* pointer;
32450 typedef pointer iterator;
32451 typedef ptrdiff_t size_type;
32452 protected:
32453 size_type _M_original_len;
32454 size_type _M_len;
32455 pointer _M_buffer;
32456 public:
32457 size_type
32458 size() const
32459 { return _M_len; }
32460 size_type
32461 requested_size() const
32462 { return _M_original_len; }
32463 iterator
32464 begin()
32465 { return _M_buffer; }
32466 iterator
32467 end()
32468 { return _M_buffer + _M_len; }
32469 _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
32470 ~_Temporary_buffer()
32471 {
32472 std::_Destroy(_M_buffer, _M_buffer + _M_len);
32473 std::return_temporary_buffer(_M_buffer);
32474 }
32475 private:
32476 _Temporary_buffer(const _Temporary_buffer&);
32477 void
32478 operator=(const _Temporary_buffer&);
32479 };
32480 template<typename _ForwardIterator, typename _Tp>
32481 _Temporary_buffer<_ForwardIterator, _Tp>::
32482 _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
32483 : _M_original_len(std::distance(__first, __last)),
32484 _M_len(0), _M_buffer(0)
32485 {
32486 try
32487 {
32488 std::pair<pointer, size_type> __p(std::get_temporary_buffer<
32489 value_type>(_M_original_len));
32490 _M_buffer = __p.first;
32491 _M_len = __p.second;
32492 if(_M_buffer)
32493 std::__uninitialized_construct_range(_M_buffer, _M_buffer + _M_len,
32494 *__first);
32495 }
32496 catch(...)
32497 {
32498 std::return_temporary_buffer(_M_buffer);
32499 _M_buffer = 0;
32500 _M_len = 0;
32501 throw;
32502 }
32503 }
32504 }
32505 namespace std __attribute__ ((__visibility__ ("default"))) {
32506 template<typename _Iterator>
32507 void
32508 __move_median_first(_Iterator __a, _Iterator __b, _Iterator __c)
32509 {
32510
32511 if (*__a < *__b)
32512 {
32513 if (*__b < *__c)
32514 std::iter_swap(__a, __b);
32515 else if (*__a < *__c)
32516 std::iter_swap(__a, __c);
32517 }
32518 else if (*__a < *__c)
32519 return;
32520 else if (*__b < *__c)
32521 std::iter_swap(__a, __c);
32522 else
32523 std::iter_swap(__a, __b);
32524 }
32525 template<typename _Iterator, typename _Compare>
32526 void
32527 __move_median_first(_Iterator __a, _Iterator __b, _Iterator __c,
32528 _Compare __comp)
32529 {
32530
32531 if (__comp(*__a, *__b))
32532 {
32533 if (__comp(*__b, *__c))
32534 std::iter_swap(__a, __b);
32535 else if (__comp(*__a, *__c))
32536 std::iter_swap(__a, __c);
32537 }
32538 else if (__comp(*__a, *__c))
32539 return;
32540 else if (__comp(*__b, *__c))
32541 std::iter_swap(__a, __c);
32542 else
32543 std::iter_swap(__a, __b);
32544 }
32545 template<typename _InputIterator, typename _Tp>
32546 inline _InputIterator
32547 __find(_InputIterator __first, _InputIterator __last,
32548 const _Tp& __val, input_iterator_tag)
32549 {
32550 while (__first != __last && !(*__first == __val))
32551 ++__first;
32552 return __first;
32553 }
32554 template<typename _InputIterator, typename _Predicate>
32555 inline _InputIterator
32556 __find_if(_InputIterator __first, _InputIterator __last,
32557 _Predicate __pred, input_iterator_tag)
32558 {
32559 while (__first != __last && !bool(__pred(*__first)))
32560 ++__first;
32561 return __first;
32562 }
32563 template<typename _RandomAccessIterator, typename _Tp>
32564 _RandomAccessIterator
32565 __find(_RandomAccessIterator __first, _RandomAccessIterator __last,
32566 const _Tp& __val, random_access_iterator_tag)
32567 {
32568 typename iterator_traits<_RandomAccessIterator>::difference_type
32569 __trip_count = (__last - __first) >> 2;
32570 for (; __trip_count > 0; --__trip_count)
32571 {
32572 if (*__first == __val)
32573 return __first;
32574 ++__first;
32575 if (*__first == __val)
32576 return __first;
32577 ++__first;
32578 if (*__first == __val)
32579 return __first;
32580 ++__first;
32581 if (*__first == __val)
32582 return __first;
32583 ++__first;
32584 }
32585 switch (__last - __first)
32586 {
32587 case 3:
32588 if (*__first == __val)
32589 return __first;
32590 ++__first;
32591 case 2:
32592 if (*__first == __val)
32593 return __first;
32594 ++__first;
32595 case 1:
32596 if (*__first == __val)
32597 return __first;
32598 ++__first;
32599 case 0:
32600 default:
32601 return __last;
32602 }
32603 }
32604 template<typename _RandomAccessIterator, typename _Predicate>
32605 _RandomAccessIterator
32606 __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
32607 _Predicate __pred, random_access_iterator_tag)
32608 {
32609 typename iterator_traits<_RandomAccessIterator>::difference_type
32610 __trip_count = (__last - __first) >> 2;
32611 for (; __trip_count > 0; --__trip_count)
32612 {
32613 if (__pred(*__first))
32614 return __first;
32615 ++__first;
32616 if (__pred(*__first))
32617 return __first;
32618 ++__first;
32619 if (__pred(*__first))
32620 return __first;
32621 ++__first;
32622 if (__pred(*__first))
32623 return __first;
32624 ++__first;
32625 }
32626 switch (__last - __first)
32627 {
32628 case 3:
32629 if (__pred(*__first))
32630 return __first;
32631 ++__first;
32632 case 2:
32633 if (__pred(*__first))
32634 return __first;
32635 ++__first;
32636 case 1:
32637 if (__pred(*__first))
32638 return __first;
32639 ++__first;
32640 case 0:
32641 default:
32642 return __last;
32643 }
32644 }
32645 template<typename _ForwardIterator, typename _Integer, typename _Tp>
32646 _ForwardIterator
32647 __search_n(_ForwardIterator __first, _ForwardIterator __last,
32648 _Integer __count, const _Tp& __val,
32649 std::forward_iterator_tag)
32650 {
32651 __first = std::find(__first, __last, __val);
32652 while (__first != __last)
32653 {
32654 typename iterator_traits<_ForwardIterator>::difference_type
32655 __n = __count;
32656 _ForwardIterator __i = __first;
32657 ++__i;
32658 while (__i != __last && __n != 1 && *__i == __val)
32659 {
32660 ++__i;
32661 --__n;
32662 }
32663 if (__n == 1)
32664 return __first;
32665 if (__i == __last)
32666 return __last;
32667 __first = std::find(++__i, __last, __val);
32668 }
32669 return __last;
32670 }
32671 template<typename _RandomAccessIter, typename _Integer, typename _Tp>
32672 _RandomAccessIter
32673 __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
32674 _Integer __count, const _Tp& __val,
32675 std::random_access_iterator_tag)
32676 {
32677 typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
32678 _DistanceType;
32679 _DistanceType __tailSize = __last - __first;
32680 const _DistanceType __pattSize = __count;
32681 if (__tailSize < __pattSize)
32682 return __last;
32683 const _DistanceType __skipOffset = __pattSize - 1;
32684 _RandomAccessIter __lookAhead = __first + __skipOffset;
32685 __tailSize -= __pattSize;
32686 while (1)
32687 {
32688 while (!(*__lookAhead == __val))
32689 {
32690 if (__tailSize < __pattSize)
32691 return __last;
32692 __lookAhead += __pattSize;
32693 __tailSize -= __pattSize;
32694 }
32695 _DistanceType __remainder = __skipOffset;
32696 for (_RandomAccessIter __backTrack = __lookAhead - 1;
32697 *__backTrack == __val; --__backTrack)
32698 {
32699 if (--__remainder == 0)
32700 return (__lookAhead - __skipOffset);
32701 }
32702 if (__remainder > __tailSize)
32703 return __last;
32704 __lookAhead += __remainder;
32705 __tailSize -= __remainder;
32706 }
32707 }
32708 template<typename _ForwardIterator, typename _Integer, typename _Tp,
32709 typename _BinaryPredicate>
32710 _ForwardIterator
32711 __search_n(_ForwardIterator __first, _ForwardIterator __last,
32712 _Integer __count, const _Tp& __val,
32713 _BinaryPredicate __binary_pred, std::forward_iterator_tag)
32714 {
32715 while (__first != __last && !bool(__binary_pred(*__first, __val)))
32716 ++__first;
32717 while (__first != __last)
32718 {
32719 typename iterator_traits<_ForwardIterator>::difference_type
32720 __n = __count;
32721 _ForwardIterator __i = __first;
32722 ++__i;
32723 while (__i != __last && __n != 1 && bool(__binary_pred(*__i, __val)))
32724 {
32725 ++__i;
32726 --__n;
32727 }
32728 if (__n == 1)
32729 return __first;
32730 if (__i == __last)
32731 return __last;
32732 __first = ++__i;
32733 while (__first != __last
32734 && !bool(__binary_pred(*__first, __val)))
32735 ++__first;
32736 }
32737 return __last;
32738 }
32739 template<typename _RandomAccessIter, typename _Integer, typename _Tp,
32740 typename _BinaryPredicate>
32741 _RandomAccessIter
32742 __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
32743 _Integer __count, const _Tp& __val,
32744 _BinaryPredicate __binary_pred, std::random_access_iterator_tag)
32745 {
32746 typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
32747 _DistanceType;
32748 _DistanceType __tailSize = __last - __first;
32749 const _DistanceType __pattSize = __count;
32750 if (__tailSize < __pattSize)
32751 return __last;
32752 const _DistanceType __skipOffset = __pattSize - 1;
32753 _RandomAccessIter __lookAhead = __first + __skipOffset;
32754 __tailSize -= __pattSize;
32755 while (1)
32756 {
32757 while (!bool(__binary_pred(*__lookAhead, __val)))
32758 {
32759 if (__tailSize < __pattSize)
32760 return __last;
32761 __lookAhead += __pattSize;
32762 __tailSize -= __pattSize;
32763 }
32764 _DistanceType __remainder = __skipOffset;
32765 for (_RandomAccessIter __backTrack = __lookAhead - 1;
32766 __binary_pred(*__backTrack, __val); --__backTrack)
32767 {
32768 if (--__remainder == 0)
32769 return (__lookAhead - __skipOffset);
32770 }
32771 if (__remainder > __tailSize)
32772 return __last;
32773 __lookAhead += __remainder;
32774 __tailSize -= __remainder;
32775 }
32776 }
32777 template<typename _ForwardIterator1, typename _ForwardIterator2>
32778 _ForwardIterator1
32779 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
32780 _ForwardIterator2 __first2, _ForwardIterator2 __last2,
32781 forward_iterator_tag, forward_iterator_tag)
32782 {
32783 if (__first2 == __last2)
32784 return __last1;
32785 else
32786 {
32787 _ForwardIterator1 __result = __last1;
32788 while (1)
32789 {
32790 _ForwardIterator1 __new_result
32791 = std::search(__first1, __last1, __first2, __last2);
32792 if (__new_result == __last1)
32793 return __result;
32794 else
32795 {
32796 __result = __new_result;
32797 __first1 = __new_result;
32798 ++__first1;
32799 }
32800 }
32801 }
32802 }
32803 template<typename _ForwardIterator1, typename _ForwardIterator2,
32804 typename _BinaryPredicate>
32805 _ForwardIterator1
32806 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
32807 _ForwardIterator2 __first2, _ForwardIterator2 __last2,
32808 forward_iterator_tag, forward_iterator_tag,
32809 _BinaryPredicate __comp)
32810 {
32811 if (__first2 == __last2)
32812 return __last1;
32813 else
32814 {
32815 _ForwardIterator1 __result = __last1;
32816 while (1)
32817 {
32818 _ForwardIterator1 __new_result
32819 = std::search(__first1, __last1, __first2,
32820 __last2, __comp);
32821 if (__new_result == __last1)
32822 return __result;
32823 else
32824 {
32825 __result = __new_result;
32826 __first1 = __new_result;
32827 ++__first1;
32828 }
32829 }
32830 }
32831 }
32832 template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
32833 _BidirectionalIterator1
32834 __find_end(_BidirectionalIterator1 __first1,
32835 _BidirectionalIterator1 __last1,
32836 _BidirectionalIterator2 __first2,
32837 _BidirectionalIterator2 __last2,
32838 bidirectional_iterator_tag, bidirectional_iterator_tag)
32839 {
32840
32841
32842 typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
32843 typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
32844 _RevIterator1 __rlast1(__first1);
32845 _RevIterator2 __rlast2(__first2);
32846 _RevIterator1 __rresult = std::search(_RevIterator1(__last1),
32847 __rlast1,
32848 _RevIterator2(__last2),
32849 __rlast2);
32850 if (__rresult == __rlast1)
32851 return __last1;
32852 else
32853 {
32854 _BidirectionalIterator1 __result = __rresult.base();
32855 std::advance(__result, -std::distance(__first2, __last2));
32856 return __result;
32857 }
32858 }
32859 template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
32860 typename _BinaryPredicate>
32861 _BidirectionalIterator1
32862 __find_end(_BidirectionalIterator1 __first1,
32863 _BidirectionalIterator1 __last1,
32864 _BidirectionalIterator2 __first2,
32865 _BidirectionalIterator2 __last2,
32866 bidirectional_iterator_tag, bidirectional_iterator_tag,
32867 _BinaryPredicate __comp)
32868 {
32869
32870
32871 typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
32872 typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
32873 _RevIterator1 __rlast1(__first1);
32874 _RevIterator2 __rlast2(__first2);
32875 _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1,
32876 _RevIterator2(__last2), __rlast2,
32877 __comp);
32878 if (__rresult == __rlast1)
32879 return __last1;
32880 else
32881 {
32882 _BidirectionalIterator1 __result = __rresult.base();
32883 std::advance(__result, -std::distance(__first2, __last2));
32884 return __result;
32885 }
32886 }
32887 template<typename _ForwardIterator1, typename _ForwardIterator2>
32888 inline _ForwardIterator1
32889 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
32890 _ForwardIterator2 __first2, _ForwardIterator2 __last2)
32891 {
32892
32893
32894
32895 ;
32896 ;
32897 return std::__find_end(__first1, __last1, __first2, __last2,
32898 std::__iterator_category(__first1),
32899 std::__iterator_category(__first2));
32900 }
32901 template<typename _ForwardIterator1, typename _ForwardIterator2,
32902 typename _BinaryPredicate>
32903 inline _ForwardIterator1
32904 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
32905 _ForwardIterator2 __first2, _ForwardIterator2 __last2,
32906 _BinaryPredicate __comp)
32907 {
32908
32909
32910
32911 ;
32912 ;
32913 return std::__find_end(__first1, __last1, __first2, __last2,
32914 std::__iterator_category(__first1),
32915 std::__iterator_category(__first2),
32916 __comp);
32917 }
32918 template<typename _InputIterator, typename _OutputIterator, typename _Tp>
32919 _OutputIterator
32920 remove_copy(_InputIterator __first, _InputIterator __last,
32921 _OutputIterator __result, const _Tp& __value)
32922 {
32923
32924
32925
32926 ;
32927 for (; __first != __last; ++__first)
32928 if (!(*__first == __value))
32929 {
32930 *__result = *__first;
32931 ++__result;
32932 }
32933 return __result;
32934 }
32935 template<typename _InputIterator, typename _OutputIterator,
32936 typename _Predicate>
32937 _OutputIterator
32938 remove_copy_if(_InputIterator __first, _InputIterator __last,
32939 _OutputIterator __result, _Predicate __pred)
32940 {
32941
32942
32943
32944 ;
32945 for (; __first != __last; ++__first)
32946 if (!bool(__pred(*__first)))
32947 {
32948 *__result = *__first;
32949 ++__result;
32950 }
32951 return __result;
32952 }
32953 template<typename _ForwardIterator, typename _Tp>
32954 _ForwardIterator
32955 remove(_ForwardIterator __first, _ForwardIterator __last,
32956 const _Tp& __value)
32957 {
32958
32959
32960 ;
32961 __first = std::find(__first, __last, __value);
32962 if(__first == __last)
32963 return __first;
32964 _ForwardIterator __result = __first;
32965 ++__first;
32966 for(; __first != __last; ++__first)
32967 if(!(*__first == __value))
32968 {
32969 *__result = (*__first);
32970 ++__result;
32971 }
32972 return __result;
32973 }
32974 template<typename _ForwardIterator, typename _Predicate>
32975 _ForwardIterator
32976 remove_if(_ForwardIterator __first, _ForwardIterator __last,
32977 _Predicate __pred)
32978 {
32979
32980
32981 ;
32982 __first = std::find_if(__first, __last, __pred);
32983 if(__first == __last)
32984 return __first;
32985 _ForwardIterator __result = __first;
32986 ++__first;
32987 for(; __first != __last; ++__first)
32988 if(!bool(__pred(*__first)))
32989 {
32990 *__result = (*__first);
32991 ++__result;
32992 }
32993 return __result;
32994 }
32995 template<typename _ForwardIterator>
32996 _ForwardIterator
32997 unique(_ForwardIterator __first, _ForwardIterator __last)
32998 {
32999
33000
33001 ;
33002 __first = std::adjacent_find(__first, __last);
33003 if (__first == __last)
33004 return __last;
33005 _ForwardIterator __dest = __first;
33006 ++__first;
33007 while (++__first != __last)
33008 if (!(*__dest == *__first))
33009 *++__dest = (*__first);
33010 return ++__dest;
33011 }
33012 template<typename _ForwardIterator, typename _BinaryPredicate>
33013 _ForwardIterator
33014 unique(_ForwardIterator __first, _ForwardIterator __last,
33015 _BinaryPredicate __binary_pred)
33016 {
33017
33018
33019 ;
33020 __first = std::adjacent_find(__first, __last, __binary_pred);
33021 if (__first == __last)
33022 return __last;
33023 _ForwardIterator __dest = __first;
33024 ++__first;
33025 while (++__first != __last)
33026 if (!bool(__binary_pred(*__dest, *__first)))
33027 *++__dest = (*__first);
33028 return ++__dest;
33029 }
33030 template<typename _ForwardIterator, typename _OutputIterator>
33031 _OutputIterator
33032 __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
33033 _OutputIterator __result,
33034 forward_iterator_tag, output_iterator_tag)
33035 {
33036 _ForwardIterator __next = __first;
33037 *__result = *__first;
33038 while (++__next != __last)
33039 if (!(*__first == *__next))
33040 {
33041 __first = __next;
33042 *++__result = *__first;
33043 }
33044 return ++__result;
33045 }
33046 template<typename _InputIterator, typename _OutputIterator>
33047 _OutputIterator
33048 __unique_copy(_InputIterator __first, _InputIterator __last,
33049 _OutputIterator __result,
33050 input_iterator_tag, output_iterator_tag)
33051 {
33052 typename iterator_traits<_InputIterator>::value_type __value = *__first;
33053 *__result = __value;
33054 while (++__first != __last)
33055 if (!(__value == *__first))
33056 {
33057 __value = *__first;
33058 *++__result = __value;
33059 }
33060 return ++__result;
33061 }
33062 template<typename _InputIterator, typename _ForwardIterator>
33063 _ForwardIterator
33064 __unique_copy(_InputIterator __first, _InputIterator __last,
33065 _ForwardIterator __result,
33066 input_iterator_tag, forward_iterator_tag)
33067 {
33068 *__result = *__first;
33069 while (++__first != __last)
33070 if (!(*__result == *__first))
33071 *++__result = *__first;
33072 return ++__result;
33073 }
33074 template<typename _ForwardIterator, typename _OutputIterator,
33075 typename _BinaryPredicate>
33076 _OutputIterator
33077 __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
33078 _OutputIterator __result, _BinaryPredicate __binary_pred,
33079 forward_iterator_tag, output_iterator_tag)
33080 {
33081
33082 _ForwardIterator __next = __first;
33083 *__result = *__first;
33084 while (++__next != __last)
33085 if (!bool(__binary_pred(*__first, *__next)))
33086 {
33087 __first = __next;
33088 *++__result = *__first;
33089 }
33090 return ++__result;
33091 }
33092 template<typename _InputIterator, typename _OutputIterator,
33093 typename _BinaryPredicate>
33094 _OutputIterator
33095 __unique_copy(_InputIterator __first, _InputIterator __last,
33096 _OutputIterator __result, _BinaryPredicate __binary_pred,
33097 input_iterator_tag, output_iterator_tag)
33098 {
33099
33100 typename iterator_traits<_InputIterator>::value_type __value = *__first;
33101 *__result = __value;
33102 while (++__first != __last)
33103 if (!bool(__binary_pred(__value, *__first)))
33104 {
33105 __value = *__first;
33106 *++__result = __value;
33107 }
33108 return ++__result;
33109 }
33110 template<typename _InputIterator, typename _ForwardIterator,
33111 typename _BinaryPredicate>
33112 _ForwardIterator
33113 __unique_copy(_InputIterator __first, _InputIterator __last,
33114 _ForwardIterator __result, _BinaryPredicate __binary_pred,
33115 input_iterator_tag, forward_iterator_tag)
33116 {
33117
33118 *__result = *__first;
33119 while (++__first != __last)
33120 if (!bool(__binary_pred(*__result, *__first)))
33121 *++__result = *__first;
33122 return ++__result;
33123 }
33124 template<typename _BidirectionalIterator>
33125 void
33126 __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,
33127 bidirectional_iterator_tag)
33128 {
33129 while (true)
33130 if (__first == __last || __first == --__last)
33131 return;
33132 else
33133 {
33134 std::iter_swap(__first, __last);
33135 ++__first;
33136 }
33137 }
33138 template<typename _RandomAccessIterator>
33139 void
33140 __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,
33141 random_access_iterator_tag)
33142 {
33143 if (__first == __last)
33144 return;
33145 --__last;
33146 while (__first < __last)
33147 {
33148 std::iter_swap(__first, __last);
33149 ++__first;
33150 --__last;
33151 }
33152 }
33153 template<typename _BidirectionalIterator>
33154 inline void
33155 reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
33156 {
33157
33158 ;
33159 std::__reverse(__first, __last, std::__iterator_category(__first));
33160 }
33161 template<typename _BidirectionalIterator, typename _OutputIterator>
33162 _OutputIterator
33163 reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,
33164 _OutputIterator __result)
33165 {
33166
33167
33168 ;
33169 while (__first != __last)
33170 {
33171 --__last;
33172 *__result = *__last;
33173 ++__result;
33174 }
33175 return __result;
33176 }
33177 template<typename _EuclideanRingElement>
33178 _EuclideanRingElement
33179 __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
33180 {
33181 while (__n != 0)
33182 {
33183 _EuclideanRingElement __t = __m % __n;
33184 __m = __n;
33185 __n = __t;
33186 }
33187 return __m;
33188 }
33189 template<typename _ForwardIterator>
33190 void
33191 __rotate(_ForwardIterator __first,
33192 _ForwardIterator __middle,
33193 _ForwardIterator __last,
33194 forward_iterator_tag)
33195 {
33196 if (__first == __middle || __last == __middle)
33197 return;
33198 _ForwardIterator __first2 = __middle;
33199 do
33200 {
33201 std::iter_swap(__first, __first2);
33202 ++__first;
33203 ++__first2;
33204 if (__first == __middle)
33205 __middle = __first2;
33206 }
33207 while (__first2 != __last);
33208 __first2 = __middle;
33209 while (__first2 != __last)
33210 {
33211 std::iter_swap(__first, __first2);
33212 ++__first;
33213 ++__first2;
33214 if (__first == __middle)
33215 __middle = __first2;
33216 else if (__first2 == __last)
33217 __first2 = __middle;
33218 }
33219 }
33220 template<typename _BidirectionalIterator>
33221 void
33222 __rotate(_BidirectionalIterator __first,
33223 _BidirectionalIterator __middle,
33224 _BidirectionalIterator __last,
33225 bidirectional_iterator_tag)
33226 {
33227
33228 if (__first == __middle || __last == __middle)
33229 return;
33230 std::__reverse(__first, __middle, bidirectional_iterator_tag());
33231 std::__reverse(__middle, __last, bidirectional_iterator_tag());
33232 while (__first != __middle && __middle != __last)
33233 {
33234 std::iter_swap(__first, --__last);
33235 ++__first;
33236 }
33237 if (__first == __middle)
33238 std::__reverse(__middle, __last, bidirectional_iterator_tag());
33239 else
33240 std::__reverse(__first, __middle, bidirectional_iterator_tag());
33241 }
33242 template<typename _RandomAccessIterator>
33243 void
33244 __rotate(_RandomAccessIterator __first,
33245 _RandomAccessIterator __middle,
33246 _RandomAccessIterator __last,
33247 random_access_iterator_tag)
33248 {
33249
33250 if (__first == __middle || __last == __middle)
33251 return;
33252 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
33253 _Distance;
33254 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33255 _ValueType;
33256 _Distance __n = __last - __first;
33257 _Distance __k = __middle - __first;
33258 if (__k == __n - __k)
33259 {
33260 std::swap_ranges(__first, __middle, __middle);
33261 return;
33262 }
33263 _RandomAccessIterator __p = __first;
33264 for (;;)
33265 {
33266 if (__k < __n - __k)
33267 {
33268 if (__is_pod(_ValueType) && __k == 1)
33269 {
33270 _ValueType __t = (*__p);
33271 std::copy(__p + 1, __p + __n, __p);
33272 *(__p + __n - 1) = (__t);
33273 return;
33274 }
33275 _RandomAccessIterator __q = __p + __k;
33276 for (_Distance __i = 0; __i < __n - __k; ++ __i)
33277 {
33278 std::iter_swap(__p, __q);
33279 ++__p;
33280 ++__q;
33281 }
33282 __n %= __k;
33283 if (__n == 0)
33284 return;
33285 std::swap(__n, __k);
33286 __k = __n - __k;
33287 }
33288 else
33289 {
33290 __k = __n - __k;
33291 if (__is_pod(_ValueType) && __k == 1)
33292 {
33293 _ValueType __t = (*(__p + __n - 1));
33294 std::copy_backward(__p, __p + __n - 1, __p + __n);
33295 *__p = (__t);
33296 return;
33297 }
33298 _RandomAccessIterator __q = __p + __n;
33299 __p = __q - __k;
33300 for (_Distance __i = 0; __i < __n - __k; ++ __i)
33301 {
33302 --__p;
33303 --__q;
33304 std::iter_swap(__p, __q);
33305 }
33306 __n %= __k;
33307 if (__n == 0)
33308 return;
33309 std::swap(__n, __k);
33310 }
33311 }
33312 }
33313 template<typename _ForwardIterator>
33314 inline void
33315 rotate(_ForwardIterator __first, _ForwardIterator __middle,
33316 _ForwardIterator __last)
33317 {
33318
33319 ;
33320 ;
33321 typedef typename iterator_traits<_ForwardIterator>::iterator_category
33322 _IterType;
33323 std::__rotate(__first, __middle, __last, _IterType());
33324 }
33325 template<typename _ForwardIterator, typename _OutputIterator>
33326 _OutputIterator
33327 rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,
33328 _ForwardIterator __last, _OutputIterator __result)
33329 {
33330
33331
33332 ;
33333 ;
33334 return std::copy(__first, __middle,
33335 std::copy(__middle, __last, __result));
33336 }
33337 template<typename _ForwardIterator, typename _Predicate>
33338 _ForwardIterator
33339 __partition(_ForwardIterator __first, _ForwardIterator __last,
33340 _Predicate __pred, forward_iterator_tag)
33341 {
33342 if (__first == __last)
33343 return __first;
33344 while (__pred(*__first))
33345 if (++__first == __last)
33346 return __first;
33347 _ForwardIterator __next = __first;
33348 while (++__next != __last)
33349 if (__pred(*__next))
33350 {
33351 std::iter_swap(__first, __next);
33352 ++__first;
33353 }
33354 return __first;
33355 }
33356 template<typename _BidirectionalIterator, typename _Predicate>
33357 _BidirectionalIterator
33358 __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,
33359 _Predicate __pred, bidirectional_iterator_tag)
33360 {
33361 while (true)
33362 {
33363 while (true)
33364 if (__first == __last)
33365 return __first;
33366 else if (__pred(*__first))
33367 ++__first;
33368 else
33369 break;
33370 --__last;
33371 while (true)
33372 if (__first == __last)
33373 return __first;
33374 else if (!bool(__pred(*__last)))
33375 --__last;
33376 else
33377 break;
33378 std::iter_swap(__first, __last);
33379 ++__first;
33380 }
33381 }
33382 template<typename _ForwardIterator, typename _Predicate, typename _Distance>
33383 _ForwardIterator
33384 __inplace_stable_partition(_ForwardIterator __first,
33385 _ForwardIterator __last,
33386 _Predicate __pred, _Distance __len)
33387 {
33388 if (__len == 1)
33389 return __pred(*__first) ? __last : __first;
33390 _ForwardIterator __middle = __first;
33391 std::advance(__middle, __len / 2);
33392 _ForwardIterator __begin = std::__inplace_stable_partition(__first,
33393 __middle,
33394 __pred,
33395 __len / 2);
33396 _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last,
33397 __pred,
33398 __len
33399 - __len / 2);
33400 std::rotate(__begin, __middle, __end);
33401 std::advance(__begin, std::distance(__middle, __end));
33402 return __begin;
33403 }
33404 template<typename _ForwardIterator, typename _Pointer, typename _Predicate,
33405 typename _Distance>
33406 _ForwardIterator
33407 __stable_partition_adaptive(_ForwardIterator __first,
33408 _ForwardIterator __last,
33409 _Predicate __pred, _Distance __len,
33410 _Pointer __buffer,
33411 _Distance __buffer_size)
33412 {
33413 if (__len <= __buffer_size)
33414 {
33415 _ForwardIterator __result1 = __first;
33416 _Pointer __result2 = __buffer;
33417 for (; __first != __last; ++__first)
33418 if (__pred(*__first))
33419 {
33420 *__result1 = (*__first);
33421 ++__result1;
33422 }
33423 else
33424 {
33425 *__result2 = (*__first);
33426 ++__result2;
33427 }
33428 std::copy(__buffer, __result2, __result1);
33429 return __result1;
33430 }
33431 else
33432 {
33433 _ForwardIterator __middle = __first;
33434 std::advance(__middle, __len / 2);
33435 _ForwardIterator __begin =
33436 std::__stable_partition_adaptive(__first, __middle, __pred,
33437 __len / 2, __buffer,
33438 __buffer_size);
33439 _ForwardIterator __end =
33440 std::__stable_partition_adaptive(__middle, __last, __pred,
33441 __len - __len / 2,
33442 __buffer, __buffer_size);
33443 std::rotate(__begin, __middle, __end);
33444 std::advance(__begin, std::distance(__middle, __end));
33445 return __begin;
33446 }
33447 }
33448 template<typename _ForwardIterator, typename _Predicate>
33449 _ForwardIterator
33450 stable_partition(_ForwardIterator __first, _ForwardIterator __last,
33451 _Predicate __pred)
33452 {
33453
33454
33455 ;
33456 if (__first == __last)
33457 return __first;
33458 else
33459 {
33460 typedef typename iterator_traits<_ForwardIterator>::value_type
33461 _ValueType;
33462 typedef typename iterator_traits<_ForwardIterator>::difference_type
33463 _DistanceType;
33464 _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first,
33465 __last);
33466 if (__buf.size() > 0)
33467 return
33468 std::__stable_partition_adaptive(__first, __last, __pred,
33469 _DistanceType(__buf.requested_size()),
33470 __buf.begin(),
33471 _DistanceType(__buf.size()));
33472 else
33473 return
33474 std::__inplace_stable_partition(__first, __last, __pred,
33475 _DistanceType(__buf.requested_size()));
33476 }
33477 }
33478 template<typename _RandomAccessIterator>
33479 void
33480 __heap_select(_RandomAccessIterator __first,
33481 _RandomAccessIterator __middle,
33482 _RandomAccessIterator __last)
33483 {
33484 std::make_heap(__first, __middle);
33485 for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
33486 if (*__i < *__first)
33487 std::__pop_heap(__first, __middle, __i);
33488 }
33489 template<typename _RandomAccessIterator, typename _Compare>
33490 void
33491 __heap_select(_RandomAccessIterator __first,
33492 _RandomAccessIterator __middle,
33493 _RandomAccessIterator __last, _Compare __comp)
33494 {
33495 std::make_heap(__first, __middle, __comp);
33496 for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
33497 if (__comp(*__i, *__first))
33498 std::__pop_heap(__first, __middle, __i, __comp);
33499 }
33500 template<typename _InputIterator, typename _RandomAccessIterator>
33501 _RandomAccessIterator
33502 partial_sort_copy(_InputIterator __first, _InputIterator __last,
33503 _RandomAccessIterator __result_first,
33504 _RandomAccessIterator __result_last)
33505 {
33506 typedef typename iterator_traits<_InputIterator>::value_type
33507 _InputValueType;
33508 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33509 _OutputValueType;
33510 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
33511 _DistanceType;
33512
33513
33514
33515
33516 ;
33517 ;
33518 if (__result_first == __result_last)
33519 return __result_last;
33520 _RandomAccessIterator __result_real_last = __result_first;
33521 while(__first != __last && __result_real_last != __result_last)
33522 {
33523 *__result_real_last = *__first;
33524 ++__result_real_last;
33525 ++__first;
33526 }
33527 std::make_heap(__result_first, __result_real_last);
33528 while (__first != __last)
33529 {
33530 if (*__first < *__result_first)
33531 std::__adjust_heap(__result_first, _DistanceType(0),
33532 _DistanceType(__result_real_last
33533 - __result_first),
33534 _InputValueType(*__first));
33535 ++__first;
33536 }
33537 std::sort_heap(__result_first, __result_real_last);
33538 return __result_real_last;
33539 }
33540 template<typename _InputIterator, typename _RandomAccessIterator, typename _Compare>
33541 _RandomAccessIterator
33542 partial_sort_copy(_InputIterator __first, _InputIterator __last,
33543 _RandomAccessIterator __result_first,
33544 _RandomAccessIterator __result_last,
33545 _Compare __comp)
33546 {
33547 typedef typename iterator_traits<_InputIterator>::value_type
33548 _InputValueType;
33549 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33550 _OutputValueType;
33551 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
33552 _DistanceType;
33553
33554
33555
33556
33557
33558 ;
33559 ;
33560 if (__result_first == __result_last)
33561 return __result_last;
33562 _RandomAccessIterator __result_real_last = __result_first;
33563 while(__first != __last && __result_real_last != __result_last)
33564 {
33565 *__result_real_last = *__first;
33566 ++__result_real_last;
33567 ++__first;
33568 }
33569 std::make_heap(__result_first, __result_real_last, __comp);
33570 while (__first != __last)
33571 {
33572 if (__comp(*__first, *__result_first))
33573 std::__adjust_heap(__result_first, _DistanceType(0),
33574 _DistanceType(__result_real_last
33575 - __result_first),
33576 _InputValueType(*__first),
33577 __comp);
33578 ++__first;
33579 }
33580 std::sort_heap(__result_first, __result_real_last, __comp);
33581 return __result_real_last;
33582 }
33583 template<typename _RandomAccessIterator>
33584 void
33585 __unguarded_linear_insert(_RandomAccessIterator __last)
33586 {
33587 typename iterator_traits<_RandomAccessIterator>::value_type
33588 __val = (*__last);
33589 _RandomAccessIterator __next = __last;
33590 --__next;
33591 while (__val < *__next)
33592 {
33593 *__last = (*__next);
33594 __last = __next;
33595 --__next;
33596 }
33597 *__last = (__val);
33598 }
33599 template<typename _RandomAccessIterator, typename _Compare>
33600 void
33601 __unguarded_linear_insert(_RandomAccessIterator __last,
33602 _Compare __comp)
33603 {
33604 typename iterator_traits<_RandomAccessIterator>::value_type
33605 __val = (*__last);
33606 _RandomAccessIterator __next = __last;
33607 --__next;
33608 while (__comp(__val, *__next))
33609 {
33610 *__last = (*__next);
33611 __last = __next;
33612 --__next;
33613 }
33614 *__last = (__val);
33615 }
33616 template<typename _RandomAccessIterator>
33617 void
33618 __insertion_sort(_RandomAccessIterator __first,
33619 _RandomAccessIterator __last)
33620 {
33621 if (__first == __last)
33622 return;
33623 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
33624 {
33625 if (*__i < *__first)
33626 {
33627 typename iterator_traits<_RandomAccessIterator>::value_type
33628 __val = (*__i);
33629 std::copy_backward(__first, __i, __i + 1);
33630 *__first = (__val);
33631 }
33632 else
33633 std::__unguarded_linear_insert(__i);
33634 }
33635 }
33636 template<typename _RandomAccessIterator, typename _Compare>
33637 void
33638 __insertion_sort(_RandomAccessIterator __first,
33639 _RandomAccessIterator __last, _Compare __comp)
33640 {
33641 if (__first == __last) return;
33642 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
33643 {
33644 if (__comp(*__i, *__first))
33645 {
33646 typename iterator_traits<_RandomAccessIterator>::value_type
33647 __val = (*__i);
33648 std::copy_backward(__first, __i, __i + 1);
33649 *__first = (__val);
33650 }
33651 else
33652 std::__unguarded_linear_insert(__i, __comp);
33653 }
33654 }
33655 template<typename _RandomAccessIterator>
33656 inline void
33657 __unguarded_insertion_sort(_RandomAccessIterator __first,
33658 _RandomAccessIterator __last)
33659 {
33660 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33661 _ValueType;
33662 for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
33663 std::__unguarded_linear_insert(__i);
33664 }
33665 template<typename _RandomAccessIterator, typename _Compare>
33666 inline void
33667 __unguarded_insertion_sort(_RandomAccessIterator __first,
33668 _RandomAccessIterator __last, _Compare __comp)
33669 {
33670 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33671 _ValueType;
33672 for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
33673 std::__unguarded_linear_insert(__i, __comp);
33674 }
33675 enum { _S_threshold = 16 };
33676 template<typename _RandomAccessIterator>
33677 void
33678 __final_insertion_sort(_RandomAccessIterator __first,
33679 _RandomAccessIterator __last)
33680 {
33681 if (__last - __first > int(_S_threshold))
33682 {
33683 std::__insertion_sort(__first, __first + int(_S_threshold));
33684 std::__unguarded_insertion_sort(__first + int(_S_threshold), __last);
33685 }
33686 else
33687 std::__insertion_sort(__first, __last);
33688 }
33689 template<typename _RandomAccessIterator, typename _Compare>
33690 void
33691 __final_insertion_sort(_RandomAccessIterator __first,
33692 _RandomAccessIterator __last, _Compare __comp)
33693 {
33694 if (__last - __first > int(_S_threshold))
33695 {
33696 std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
33697 std::__unguarded_insertion_sort(__first + int(_S_threshold), __last,
33698 __comp);
33699 }
33700 else
33701 std::__insertion_sort(__first, __last, __comp);
33702 }
33703 template<typename _RandomAccessIterator, typename _Tp>
33704 _RandomAccessIterator
33705 __unguarded_partition(_RandomAccessIterator __first,
33706 _RandomAccessIterator __last, const _Tp& __pivot)
33707 {
33708 while (true)
33709 {
33710 while (*__first < __pivot)
33711 ++__first;
33712 --__last;
33713 while (__pivot < *__last)
33714 --__last;
33715 if (!(__first < __last))
33716 return __first;
33717 std::iter_swap(__first, __last);
33718 ++__first;
33719 }
33720 }
33721 template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
33722 _RandomAccessIterator
33723 __unguarded_partition(_RandomAccessIterator __first,
33724 _RandomAccessIterator __last,
33725 const _Tp& __pivot, _Compare __comp)
33726 {
33727 while (true)
33728 {
33729 while (__comp(*__first, __pivot))
33730 ++__first;
33731 --__last;
33732 while (__comp(__pivot, *__last))
33733 --__last;
33734 if (!(__first < __last))
33735 return __first;
33736 std::iter_swap(__first, __last);
33737 ++__first;
33738 }
33739 }
33740 template<typename _RandomAccessIterator>
33741 inline _RandomAccessIterator
33742 __unguarded_partition_pivot(_RandomAccessIterator __first,
33743 _RandomAccessIterator __last)
33744 {
33745 _RandomAccessIterator __mid = __first + (__last - __first) / 2;
33746 std::__move_median_first(__first, __mid, (__last - 1));
33747 return std::__unguarded_partition(__first + 1, __last, *__first);
33748 }
33749 template<typename _RandomAccessIterator, typename _Compare>
33750 inline _RandomAccessIterator
33751 __unguarded_partition_pivot(_RandomAccessIterator __first,
33752 _RandomAccessIterator __last, _Compare __comp)
33753 {
33754 _RandomAccessIterator __mid = __first + (__last - __first) / 2;
33755 std::__move_median_first(__first, __mid, (__last - 1), __comp);
33756 return std::__unguarded_partition(__first + 1, __last, *__first, __comp);
33757 }
33758 template<typename _RandomAccessIterator, typename _Size>
33759 void
33760 __introsort_loop(_RandomAccessIterator __first,
33761 _RandomAccessIterator __last,
33762 _Size __depth_limit)
33763 {
33764 while (__last - __first > int(_S_threshold))
33765 {
33766 if (__depth_limit == 0)
33767 {
33768 std::partial_sort(__first, __last, __last);
33769 return;
33770 }
33771 --__depth_limit;
33772 _RandomAccessIterator __cut =
33773 std::__unguarded_partition_pivot(__first, __last);
33774 std::__introsort_loop(__cut, __last, __depth_limit);
33775 __last = __cut;
33776 }
33777 }
33778 template<typename _RandomAccessIterator, typename _Size, typename _Compare>
33779 void
33780 __introsort_loop(_RandomAccessIterator __first,
33781 _RandomAccessIterator __last,
33782 _Size __depth_limit, _Compare __comp)
33783 {
33784 while (__last - __first > int(_S_threshold))
33785 {
33786 if (__depth_limit == 0)
33787 {
33788 std::partial_sort(__first, __last, __last, __comp);
33789 return;
33790 }
33791 --__depth_limit;
33792 _RandomAccessIterator __cut =
33793 std::__unguarded_partition_pivot(__first, __last, __comp);
33794 std::__introsort_loop(__cut, __last, __depth_limit, __comp);
33795 __last = __cut;
33796 }
33797 }
33798 template<typename _RandomAccessIterator, typename _Size>
33799 void
33800 __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
33801 _RandomAccessIterator __last, _Size __depth_limit)
33802 {
33803 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33804 _ValueType;
33805 while (__last - __first > 3)
33806 {
33807 if (__depth_limit == 0)
33808 {
33809 std::__heap_select(__first, __nth + 1, __last);
33810 std::iter_swap(__first, __nth);
33811 return;
33812 }
33813 --__depth_limit;
33814 _RandomAccessIterator __cut =
33815 std::__unguarded_partition_pivot(__first, __last);
33816 if (__cut <= __nth)
33817 __first = __cut;
33818 else
33819 __last = __cut;
33820 }
33821 std::__insertion_sort(__first, __last);
33822 }
33823 template<typename _RandomAccessIterator, typename _Size, typename _Compare>
33824 void
33825 __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
33826 _RandomAccessIterator __last, _Size __depth_limit,
33827 _Compare __comp)
33828 {
33829 typedef typename iterator_traits<_RandomAccessIterator>::value_type
33830 _ValueType;
33831 while (__last - __first > 3)
33832 {
33833 if (__depth_limit == 0)
33834 {
33835 std::__heap_select(__first, __nth + 1, __last, __comp);
33836 std::iter_swap(__first, __nth);
33837 return;
33838 }
33839 --__depth_limit;
33840 _RandomAccessIterator __cut =
33841 std::__unguarded_partition_pivot(__first, __last, __comp);
33842 if (__cut <= __nth)
33843 __first = __cut;
33844 else
33845 __last = __cut;
33846 }
33847 std::__insertion_sort(__first, __last, __comp);
33848 }
33849 template<typename _ForwardIterator, typename _Tp, typename _Compare>
33850 _ForwardIterator
33851 lower_bound(_ForwardIterator __first, _ForwardIterator __last,
33852 const _Tp& __val, _Compare __comp)
33853 {
33854 typedef typename iterator_traits<_ForwardIterator>::value_type
33855 _ValueType;
33856 typedef typename iterator_traits<_ForwardIterator>::difference_type
33857 _DistanceType;
33858
33859
33860
33861 ;
33862 _DistanceType __len = std::distance(__first, __last);
33863 _DistanceType __half;
33864 _ForwardIterator __middle;
33865 while (__len > 0)
33866 {
33867 __half = __len >> 1;
33868 __middle = __first;
33869 std::advance(__middle, __half);
33870 if (__comp(*__middle, __val))
33871 {
33872 __first = __middle;
33873 ++__first;
33874 __len = __len - __half - 1;
33875 }
33876 else
33877 __len = __half;
33878 }
33879 return __first;
33880 }
33881 template<typename _ForwardIterator, typename _Tp>
33882 _ForwardIterator
33883 upper_bound(_ForwardIterator __first, _ForwardIterator __last,
33884 const _Tp& __val)
33885 {
33886 typedef typename iterator_traits<_ForwardIterator>::value_type
33887 _ValueType;
33888 typedef typename iterator_traits<_ForwardIterator>::difference_type
33889 _DistanceType;
33890
33891
33892 ;
33893 _DistanceType __len = std::distance(__first, __last);
33894 _DistanceType __half;
33895 _ForwardIterator __middle;
33896 while (__len > 0)
33897 {
33898 __half = __len >> 1;
33899 __middle = __first;
33900 std::advance(__middle, __half);
33901 if (__val < *__middle)
33902 __len = __half;
33903 else
33904 {
33905 __first = __middle;
33906 ++__first;
33907 __len = __len - __half - 1;
33908 }
33909 }
33910 return __first;
33911 }
33912 template<typename _ForwardIterator, typename _Tp, typename _Compare>
33913 _ForwardIterator
33914 upper_bound(_ForwardIterator __first, _ForwardIterator __last,
33915 const _Tp& __val, _Compare __comp)
33916 {
33917 typedef typename iterator_traits<_ForwardIterator>::value_type
33918 _ValueType;
33919 typedef typename iterator_traits<_ForwardIterator>::difference_type
33920 _DistanceType;
33921
33922
33923
33924 ;
33925 _DistanceType __len = std::distance(__first, __last);
33926 _DistanceType __half;
33927 _ForwardIterator __middle;
33928 while (__len > 0)
33929 {
33930 __half = __len >> 1;
33931 __middle = __first;
33932 std::advance(__middle, __half);
33933 if (__comp(__val, *__middle))
33934 __len = __half;
33935 else
33936 {
33937 __first = __middle;
33938 ++__first;
33939 __len = __len - __half - 1;
33940 }
33941 }
33942 return __first;
33943 }
33944 template<typename _ForwardIterator, typename _Tp>
33945 pair<_ForwardIterator, _ForwardIterator>
33946 equal_range(_ForwardIterator __first, _ForwardIterator __last,
33947 const _Tp& __val)
33948 {
33949 typedef typename iterator_traits<_ForwardIterator>::value_type
33950 _ValueType;
33951 typedef typename iterator_traits<_ForwardIterator>::difference_type
33952 _DistanceType;
33953
33954
33955
33956 ;
33957 ;
33958 _DistanceType __len = std::distance(__first, __last);
33959 _DistanceType __half;
33960 _ForwardIterator __middle, __left, __right;
33961 while (__len > 0)
33962 {
33963 __half = __len >> 1;
33964 __middle = __first;
33965 std::advance(__middle, __half);
33966 if (*__middle < __val)
33967 {
33968 __first = __middle;
33969 ++__first;
33970 __len = __len - __half - 1;
33971 }
33972 else if (__val < *__middle)
33973 __len = __half;
33974 else
33975 {
33976 __left = std::lower_bound(__first, __middle, __val);
33977 std::advance(__first, __len);
33978 __right = std::upper_bound(++__middle, __first, __val);
33979 return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
33980 }
33981 }
33982 return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
33983 }
33984 template<typename _ForwardIterator, typename _Tp, typename _Compare>
33985 pair<_ForwardIterator, _ForwardIterator>
33986 equal_range(_ForwardIterator __first, _ForwardIterator __last,
33987 const _Tp& __val,
33988 _Compare __comp)
33989 {
33990 typedef typename iterator_traits<_ForwardIterator>::value_type
33991 _ValueType;
33992 typedef typename iterator_traits<_ForwardIterator>::difference_type
33993 _DistanceType;
33994
33995
33996
33997
33998 ;
33999
34000 ;
34001 _DistanceType __len = std::distance(__first, __last);
34002 _DistanceType __half;
34003 _ForwardIterator __middle, __left, __right;
34004 while (__len > 0)
34005 {
34006 __half = __len >> 1;
34007 __middle = __first;
34008 std::advance(__middle, __half);
34009 if (__comp(*__middle, __val))
34010 {
34011 __first = __middle;
34012 ++__first;
34013 __len = __len - __half - 1;
34014 }
34015 else if (__comp(__val, *__middle))
34016 __len = __half;
34017 else
34018 {
34019 __left = std::lower_bound(__first, __middle, __val, __comp);
34020 std::advance(__first, __len);
34021 __right = std::upper_bound(++__middle, __first, __val, __comp);
34022 return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
34023 }
34024 }
34025 return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
34026 }
34027 template<typename _ForwardIterator, typename _Tp>
34028 bool
34029 binary_search(_ForwardIterator __first, _ForwardIterator __last,
34030 const _Tp& __val)
34031 {
34032 typedef typename iterator_traits<_ForwardIterator>::value_type
34033 _ValueType;
34034
34035
34036 ;
34037 ;
34038 _ForwardIterator __i = std::lower_bound(__first, __last, __val);
34039 return __i != __last && !(__val < *__i);
34040 }
34041 template<typename _ForwardIterator, typename _Tp, typename _Compare>
34042 bool
34043 binary_search(_ForwardIterator __first, _ForwardIterator __last,
34044 const _Tp& __val, _Compare __comp)
34045 {
34046 typedef typename iterator_traits<_ForwardIterator>::value_type
34047 _ValueType;
34048
34049
34050
34051 ;
34052
34053 ;
34054 _ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp);
34055 return __i != __last && !bool(__comp(__val, *__i));
34056 }
34057 template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
34058 typename _BidirectionalIterator3>
34059 _BidirectionalIterator3
34060 __merge_backward(_BidirectionalIterator1 __first1,
34061 _BidirectionalIterator1 __last1,
34062 _BidirectionalIterator2 __first2,
34063 _BidirectionalIterator2 __last2,
34064 _BidirectionalIterator3 __result)
34065 {
34066 if (__first1 == __last1)
34067 return std::copy_backward(__first2, __last2, __result);
34068 if (__first2 == __last2)
34069 return std::copy_backward(__first1, __last1, __result);
34070 --__last1;
34071 --__last2;
34072 while (true)
34073 {
34074 if (*__last2 < *__last1)
34075 {
34076 *--__result = *__last1;
34077 if (__first1 == __last1)
34078 return std::copy_backward(__first2, ++__last2, __result);
34079 --__last1;
34080 }
34081 else
34082 {
34083 *--__result = *__last2;
34084 if (__first2 == __last2)
34085 return std::copy_backward(__first1, ++__last1, __result);
34086 --__last2;
34087 }
34088 }
34089 }
34090 template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
34091 typename _BidirectionalIterator3, typename _Compare>
34092 _BidirectionalIterator3
34093 __merge_backward(_BidirectionalIterator1 __first1,
34094 _BidirectionalIterator1 __last1,
34095 _BidirectionalIterator2 __first2,
34096 _BidirectionalIterator2 __last2,
34097 _BidirectionalIterator3 __result,
34098 _Compare __comp)
34099 {
34100 if (__first1 == __last1)
34101 return std::copy_backward(__first2, __last2, __result);
34102 if (__first2 == __last2)
34103 return std::copy_backward(__first1, __last1, __result);
34104 --__last1;
34105 --__last2;
34106 while (true)
34107 {
34108 if (__comp(*__last2, *__last1))
34109 {
34110 *--__result = *__last1;
34111 if (__first1 == __last1)
34112 return std::copy_backward(__first2, ++__last2, __result);
34113 --__last1;
34114 }
34115 else
34116 {
34117 *--__result = *__last2;
34118 if (__first2 == __last2)
34119 return std::copy_backward(__first1, ++__last1, __result);
34120 --__last2;
34121 }
34122 }
34123 }
34124 template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
34125 typename _Distance>
34126 _BidirectionalIterator1
34127 __rotate_adaptive(_BidirectionalIterator1 __first,
34128 _BidirectionalIterator1 __middle,
34129 _BidirectionalIterator1 __last,
34130 _Distance __len1, _Distance __len2,
34131 _BidirectionalIterator2 __buffer,
34132 _Distance __buffer_size)
34133 {
34134 _BidirectionalIterator2 __buffer_end;
34135 if (__len1 > __len2 && __len2 <= __buffer_size)
34136 {
34137 __buffer_end = std::copy(__middle, __last, __buffer);
34138 std::copy_backward(__first, __middle, __last);
34139 return std::copy(__buffer, __buffer_end, __first);
34140 }
34141 else if (__len1 <= __buffer_size)
34142 {
34143 __buffer_end = std::copy(__first, __middle, __buffer);
34144 std::copy(__middle, __last, __first);
34145 return std::copy_backward(__buffer, __buffer_end, __last);
34146 }
34147 else
34148 {
34149 std::rotate(__first, __middle, __last);
34150 std::advance(__first, std::distance(__middle, __last));
34151 return __first;
34152 }
34153 }
34154 template<typename _BidirectionalIterator, typename _Distance,
34155 typename _Pointer>
34156 void
34157 __merge_adaptive(_BidirectionalIterator __first,
34158 _BidirectionalIterator __middle,
34159 _BidirectionalIterator __last,
34160 _Distance __len1, _Distance __len2,
34161 _Pointer __buffer, _Distance __buffer_size)
34162 {
34163 if (__len1 <= __len2 && __len1 <= __buffer_size)
34164 {
34165 _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
34166 std::merge((__buffer),
34167 (__buffer_end),
34168 (__middle),
34169 (__last),
34170 __first);
34171 }
34172 else if (__len2 <= __buffer_size)
34173 {
34174 _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
34175 std::__merge_backward((__first),
34176 (__middle),
34177 (__buffer),
34178 (__buffer_end),
34179 __last);
34180 }
34181 else
34182 {
34183 _BidirectionalIterator __first_cut = __first;
34184 _BidirectionalIterator __second_cut = __middle;
34185 _Distance __len11 = 0;
34186 _Distance __len22 = 0;
34187 if (__len1 > __len2)
34188 {
34189 __len11 = __len1 / 2;
34190 std::advance(__first_cut, __len11);
34191 __second_cut = std::lower_bound(__middle, __last,
34192 *__first_cut);
34193 __len22 = std::distance(__middle, __second_cut);
34194 }
34195 else
34196 {
34197 __len22 = __len2 / 2;
34198 std::advance(__second_cut, __len22);
34199 __first_cut = std::upper_bound(__first, __middle,
34200 *__second_cut);
34201 __len11 = std::distance(__first, __first_cut);
34202 }
34203 _BidirectionalIterator __new_middle =
34204 std::__rotate_adaptive(__first_cut, __middle, __second_cut,
34205 __len1 - __len11, __len22, __buffer,
34206 __buffer_size);
34207 std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
34208 __len22, __buffer, __buffer_size);
34209 std::__merge_adaptive(__new_middle, __second_cut, __last,
34210 __len1 - __len11,
34211 __len2 - __len22, __buffer, __buffer_size);
34212 }
34213 }
34214 template<typename _BidirectionalIterator, typename _Distance,
34215 typename _Pointer, typename _Compare>
34216 void
34217 __merge_adaptive(_BidirectionalIterator __first,
34218 _BidirectionalIterator __middle,
34219 _BidirectionalIterator __last,
34220 _Distance __len1, _Distance __len2,
34221 _Pointer __buffer, _Distance __buffer_size,
34222 _Compare __comp)
34223 {
34224 if (__len1 <= __len2 && __len1 <= __buffer_size)
34225 {
34226 _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
34227 std::merge((__buffer),
34228 (__buffer_end),
34229 (__middle),
34230 (__last),
34231 __first, __comp);
34232 }
34233 else if (__len2 <= __buffer_size)
34234 {
34235 _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
34236 std::__merge_backward((__first),
34237 (__middle),
34238 (__buffer),
34239 (__buffer_end),
34240 __last,__comp);
34241 }
34242 else
34243 {
34244 _BidirectionalIterator __first_cut = __first;
34245 _BidirectionalIterator __second_cut = __middle;
34246 _Distance __len11 = 0;
34247 _Distance __len22 = 0;
34248 if (__len1 > __len2)
34249 {
34250 __len11 = __len1 / 2;
34251 std::advance(__first_cut, __len11);
34252 __second_cut = std::lower_bound(__middle, __last, *__first_cut,
34253 __comp);
34254 __len22 = std::distance(__middle, __second_cut);
34255 }
34256 else
34257 {
34258 __len22 = __len2 / 2;
34259 std::advance(__second_cut, __len22);
34260 __first_cut = std::upper_bound(__first, __middle, *__second_cut,
34261 __comp);
34262 __len11 = std::distance(__first, __first_cut);
34263 }
34264 _BidirectionalIterator __new_middle =
34265 std::__rotate_adaptive(__first_cut, __middle, __second_cut,
34266 __len1 - __len11, __len22, __buffer,
34267 __buffer_size);
34268 std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
34269 __len22, __buffer, __buffer_size, __comp);
34270 std::__merge_adaptive(__new_middle, __second_cut, __last,
34271 __len1 - __len11,
34272 __len2 - __len22, __buffer,
34273 __buffer_size, __comp);
34274 }
34275 }
34276 template<typename _BidirectionalIterator, typename _Distance>
34277 void
34278 __merge_without_buffer(_BidirectionalIterator __first,
34279 _BidirectionalIterator __middle,
34280 _BidirectionalIterator __last,
34281 _Distance __len1, _Distance __len2)
34282 {
34283 if (__len1 == 0 || __len2 == 0)
34284 return;
34285 if (__len1 + __len2 == 2)
34286 {
34287 if (*__middle < *__first)
34288 std::iter_swap(__first, __middle);
34289 return;
34290 }
34291 _BidirectionalIterator __first_cut = __first;
34292 _BidirectionalIterator __second_cut = __middle;
34293 _Distance __len11 = 0;
34294 _Distance __len22 = 0;
34295 if (__len1 > __len2)
34296 {
34297 __len11 = __len1 / 2;
34298 std::advance(__first_cut, __len11);
34299 __second_cut = std::lower_bound(__middle, __last, *__first_cut);
34300 __len22 = std::distance(__middle, __second_cut);
34301 }
34302 else
34303 {
34304 __len22 = __len2 / 2;
34305 std::advance(__second_cut, __len22);
34306 __first_cut = std::upper_bound(__first, __middle, *__second_cut);
34307 __len11 = std::distance(__first, __first_cut);
34308 }
34309 std::rotate(__first_cut, __middle, __second_cut);
34310 _BidirectionalIterator __new_middle = __first_cut;
34311 std::advance(__new_middle, std::distance(__middle, __second_cut));
34312 std::__merge_without_buffer(__first, __first_cut, __new_middle,
34313 __len11, __len22);
34314 std::__merge_without_buffer(__new_middle, __second_cut, __last,
34315 __len1 - __len11, __len2 - __len22);
34316 }
34317 template<typename _BidirectionalIterator, typename _Distance,
34318 typename _Compare>
34319 void
34320 __merge_without_buffer(_BidirectionalIterator __first,
34321 _BidirectionalIterator __middle,
34322 _BidirectionalIterator __last,
34323 _Distance __len1, _Distance __len2,
34324 _Compare __comp)
34325 {
34326 if (__len1 == 0 || __len2 == 0)
34327 return;
34328 if (__len1 + __len2 == 2)
34329 {
34330 if (__comp(*__middle, *__first))
34331 std::iter_swap(__first, __middle);
34332 return;
34333 }
34334 _BidirectionalIterator __first_cut = __first;
34335 _BidirectionalIterator __second_cut = __middle;
34336 _Distance __len11 = 0;
34337 _Distance __len22 = 0;
34338 if (__len1 > __len2)
34339 {
34340 __len11 = __len1 / 2;
34341 std::advance(__first_cut, __len11);
34342 __second_cut = std::lower_bound(__middle, __last, *__first_cut,
34343 __comp);
34344 __len22 = std::distance(__middle, __second_cut);
34345 }
34346 else
34347 {
34348 __len22 = __len2 / 2;
34349 std::advance(__second_cut, __len22);
34350 __first_cut = std::upper_bound(__first, __middle, *__second_cut,
34351 __comp);
34352 __len11 = std::distance(__first, __first_cut);
34353 }
34354 std::rotate(__first_cut, __middle, __second_cut);
34355 _BidirectionalIterator __new_middle = __first_cut;
34356 std::advance(__new_middle, std::distance(__middle, __second_cut));
34357 std::__merge_without_buffer(__first, __first_cut, __new_middle,
34358 __len11, __len22, __comp);
34359 std::__merge_without_buffer(__new_middle, __second_cut, __last,
34360 __len1 - __len11, __len2 - __len22, __comp);
34361 }
34362 template<typename _BidirectionalIterator>
34363 void
34364 inplace_merge(_BidirectionalIterator __first,
34365 _BidirectionalIterator __middle,
34366 _BidirectionalIterator __last)
34367 {
34368 typedef typename iterator_traits<_BidirectionalIterator>::value_type
34369 _ValueType;
34370 typedef typename iterator_traits<_BidirectionalIterator>::difference_type
34371 _DistanceType;
34372
34373
34374 ;
34375 ;
34376 if (__first == __middle || __middle == __last)
34377 return;
34378 _DistanceType __len1 = std::distance(__first, __middle);
34379 _DistanceType __len2 = std::distance(__middle, __last);
34380 _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
34381 __last);
34382 if (__buf.begin() == 0)
34383 std::__merge_without_buffer(__first, __middle, __last, __len1, __len2);
34384 else
34385 std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
34386 __buf.begin(), _DistanceType(__buf.size()));
34387 }
34388 template<typename _BidirectionalIterator, typename _Compare>
34389 void
34390 inplace_merge(_BidirectionalIterator __first,
34391 _BidirectionalIterator __middle,
34392 _BidirectionalIterator __last,
34393 _Compare __comp)
34394 {
34395 typedef typename iterator_traits<_BidirectionalIterator>::value_type
34396 _ValueType;
34397 typedef typename iterator_traits<_BidirectionalIterator>::difference_type
34398 _DistanceType;
34399
34400
34401 ;
34402 ;
34403 if (__first == __middle || __middle == __last)
34404 return;
34405 const _DistanceType __len1 = std::distance(__first, __middle);
34406 const _DistanceType __len2 = std::distance(__middle, __last);
34407 _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
34408 __last);
34409 if (__buf.begin() == 0)
34410 std::__merge_without_buffer(__first, __middle, __last, __len1,
34411 __len2, __comp);
34412 else
34413 std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
34414 __buf.begin(), _DistanceType(__buf.size()),
34415 __comp);
34416 }
34417 template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
34418 typename _Distance>
34419 void
34420 __merge_sort_loop(_RandomAccessIterator1 __first,
34421 _RandomAccessIterator1 __last,
34422 _RandomAccessIterator2 __result,
34423 _Distance __step_size)
34424 {
34425 const _Distance __two_step = 2 * __step_size;
34426 while (__last - __first >= __two_step)
34427 {
34428 __result = std::merge(
34429 (__first),
34430 (__first + __step_size),
34431 (__first + __step_size),
34432 (__first + __two_step),
34433 __result);
34434 __first += __two_step;
34435 }
34436 __step_size = std::min(_Distance(__last - __first), __step_size);
34437 std::merge((__first),
34438 (__first + __step_size)
34439 ,
34440 (__first + __step_size)
34441 ,
34442 (__last),
34443 __result);
34444 }
34445 template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
34446 typename _Distance, typename _Compare>
34447 void
34448 __merge_sort_loop(_RandomAccessIterator1 __first,
34449 _RandomAccessIterator1 __last,
34450 _RandomAccessIterator2 __result, _Distance __step_size,
34451 _Compare __comp)
34452 {
34453 const _Distance __two_step = 2 * __step_size;
34454 while (__last - __first >= __two_step)
34455 {
34456 __result = std::merge(
34457 (__first),
34458 (__first + __step_size),
34459 (__first + __step_size),
34460 (__first + __two_step),
34461 __result, __comp);
34462 __first += __two_step;
34463 }
34464 __step_size = std::min(_Distance(__last - __first), __step_size);
34465 std::merge((__first),
34466 (__first + __step_size)
34467 ,
34468 (__first + __step_size)
34469 ,
34470 (__last),
34471 __result, __comp);
34472 }
34473 template<typename _RandomAccessIterator, typename _Distance>
34474 void
34475 __chunk_insertion_sort(_RandomAccessIterator __first,
34476 _RandomAccessIterator __last,
34477 _Distance __chunk_size)
34478 {
34479 while (__last - __first >= __chunk_size)
34480 {
34481 std::__insertion_sort(__first, __first + __chunk_size);
34482 __first += __chunk_size;
34483 }
34484 std::__insertion_sort(__first, __last);
34485 }
34486 template<typename _RandomAccessIterator, typename _Distance,
34487 typename _Compare>
34488 void
34489 __chunk_insertion_sort(_RandomAccessIterator __first,
34490 _RandomAccessIterator __last,
34491 _Distance __chunk_size, _Compare __comp)
34492 {
34493 while (__last - __first >= __chunk_size)
34494 {
34495 std::__insertion_sort(__first, __first + __chunk_size, __comp);
34496 __first += __chunk_size;
34497 }
34498 std::__insertion_sort(__first, __last, __comp);
34499 }
34500 enum { _S_chunk_size = 7 };
34501 template<typename _RandomAccessIterator, typename _Pointer>
34502 void
34503 __merge_sort_with_buffer(_RandomAccessIterator __first,
34504 _RandomAccessIterator __last,
34505 _Pointer __buffer)
34506 {
34507 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
34508 _Distance;
34509 const _Distance __len = __last - __first;
34510 const _Pointer __buffer_last = __buffer + __len;
34511 _Distance __step_size = _S_chunk_size;
34512 std::__chunk_insertion_sort(__first, __last, __step_size);
34513 while (__step_size < __len)
34514 {
34515 std::__merge_sort_loop(__first, __last, __buffer, __step_size);
34516 __step_size *= 2;
34517 std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size);
34518 __step_size *= 2;
34519 }
34520 }
34521 template<typename _RandomAccessIterator, typename _Pointer, typename _Compare>
34522 void
34523 __merge_sort_with_buffer(_RandomAccessIterator __first,
34524 _RandomAccessIterator __last,
34525 _Pointer __buffer, _Compare __comp)
34526 {
34527 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
34528 _Distance;
34529 const _Distance __len = __last - __first;
34530 const _Pointer __buffer_last = __buffer + __len;
34531 _Distance __step_size = _S_chunk_size;
34532 std::__chunk_insertion_sort(__first, __last, __step_size, __comp);
34533 while (__step_size < __len)
34534 {
34535 std::__merge_sort_loop(__first, __last, __buffer,
34536 __step_size, __comp);
34537 __step_size *= 2;
34538 std::__merge_sort_loop(__buffer, __buffer_last, __first,
34539 __step_size, __comp);
34540 __step_size *= 2;
34541 }
34542 }
34543 template<typename _RandomAccessIterator, typename _Pointer,
34544 typename _Distance>
34545 void
34546 __stable_sort_adaptive(_RandomAccessIterator __first,
34547 _RandomAccessIterator __last,
34548 _Pointer __buffer, _Distance __buffer_size)
34549 {
34550 const _Distance __len = (__last - __first + 1) / 2;
34551 const _RandomAccessIterator __middle = __first + __len;
34552 if (__len > __buffer_size)
34553 {
34554 std::__stable_sort_adaptive(__first, __middle,
34555 __buffer, __buffer_size);
34556 std::__stable_sort_adaptive(__middle, __last,
34557 __buffer, __buffer_size);
34558 }
34559 else
34560 {
34561 std::__merge_sort_with_buffer(__first, __middle, __buffer);
34562 std::__merge_sort_with_buffer(__middle, __last, __buffer);
34563 }
34564 std::__merge_adaptive(__first, __middle, __last,
34565 _Distance(__middle - __first),
34566 _Distance(__last - __middle),
34567 __buffer, __buffer_size);
34568 }
34569 template<typename _RandomAccessIterator, typename _Pointer,
34570 typename _Distance, typename _Compare>
34571 void
34572 __stable_sort_adaptive(_RandomAccessIterator __first,
34573 _RandomAccessIterator __last,
34574 _Pointer __buffer, _Distance __buffer_size,
34575 _Compare __comp)
34576 {
34577 const _Distance __len = (__last - __first + 1) / 2;
34578 const _RandomAccessIterator __middle = __first + __len;
34579 if (__len > __buffer_size)
34580 {
34581 std::__stable_sort_adaptive(__first, __middle, __buffer,
34582 __buffer_size, __comp);
34583 std::__stable_sort_adaptive(__middle, __last, __buffer,
34584 __buffer_size, __comp);
34585 }
34586 else
34587 {
34588 std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp);
34589 std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp);
34590 }
34591 std::__merge_adaptive(__first, __middle, __last,
34592 _Distance(__middle - __first),
34593 _Distance(__last - __middle),
34594 __buffer, __buffer_size,
34595 __comp);
34596 }
34597 template<typename _RandomAccessIterator>
34598 void
34599 __inplace_stable_sort(_RandomAccessIterator __first,
34600 _RandomAccessIterator __last)
34601 {
34602 if (__last - __first < 15)
34603 {
34604 std::__insertion_sort(__first, __last);
34605 return;
34606 }
34607 _RandomAccessIterator __middle = __first + (__last - __first) / 2;
34608 std::__inplace_stable_sort(__first, __middle);
34609 std::__inplace_stable_sort(__middle, __last);
34610 std::__merge_without_buffer(__first, __middle, __last,
34611 __middle - __first,
34612 __last - __middle);
34613 }
34614 template<typename _RandomAccessIterator, typename _Compare>
34615 void
34616 __inplace_stable_sort(_RandomAccessIterator __first,
34617 _RandomAccessIterator __last, _Compare __comp)
34618 {
34619 if (__last - __first < 15)
34620 {
34621 std::__insertion_sort(__first, __last, __comp);
34622 return;
34623 }
34624 _RandomAccessIterator __middle = __first + (__last - __first) / 2;
34625 std::__inplace_stable_sort(__first, __middle, __comp);
34626 std::__inplace_stable_sort(__middle, __last, __comp);
34627 std::__merge_without_buffer(__first, __middle, __last,
34628 __middle - __first,
34629 __last - __middle,
34630 __comp);
34631 }
34632 template<typename _InputIterator1, typename _InputIterator2>
34633 bool
34634 includes(_InputIterator1 __first1, _InputIterator1 __last1,
34635 _InputIterator2 __first2, _InputIterator2 __last2)
34636 {
34637 typedef typename iterator_traits<_InputIterator1>::value_type
34638 _ValueType1;
34639 typedef typename iterator_traits<_InputIterator2>::value_type
34640 _ValueType2;
34641
34642
34643
34644
34645 ;
34646 ;
34647 while (__first1 != __last1 && __first2 != __last2)
34648 if (*__first2 < *__first1)
34649 return false;
34650 else if(*__first1 < *__first2)
34651 ++__first1;
34652 else
34653 ++__first1, ++__first2;
34654 return __first2 == __last2;
34655 }
34656 template<typename _InputIterator1, typename _InputIterator2,
34657 typename _Compare>
34658 bool
34659 includes(_InputIterator1 __first1, _InputIterator1 __last1,
34660 _InputIterator2 __first2, _InputIterator2 __last2,
34661 _Compare __comp)
34662 {
34663 typedef typename iterator_traits<_InputIterator1>::value_type
34664 _ValueType1;
34665 typedef typename iterator_traits<_InputIterator2>::value_type
34666 _ValueType2;
34667
34668
34669
34670
34671 ;
34672 ;
34673 while (__first1 != __last1 && __first2 != __last2)
34674 if (__comp(*__first2, *__first1))
34675 return false;
34676 else if(__comp(*__first1, *__first2))
34677 ++__first1;
34678 else
34679 ++__first1, ++__first2;
34680 return __first2 == __last2;
34681 }
34682 template<typename _BidirectionalIterator>
34683 bool
34684 next_permutation(_BidirectionalIterator __first,
34685 _BidirectionalIterator __last)
34686 {
34687
34688
34689 ;
34690 if (__first == __last)
34691 return false;
34692 _BidirectionalIterator __i = __first;
34693 ++__i;
34694 if (__i == __last)
34695 return false;
34696 __i = __last;
34697 --__i;
34698 for(;;)
34699 {
34700 _BidirectionalIterator __ii = __i;
34701 --__i;
34702 if (*__i < *__ii)
34703 {
34704 _BidirectionalIterator __j = __last;
34705 while (!(*__i < *--__j))
34706 {}
34707 std::iter_swap(__i, __j);
34708 std::reverse(__ii, __last);
34709 return true;
34710 }
34711 if (__i == __first)
34712 {
34713 std::reverse(__first, __last);
34714 return false;
34715 }
34716 }
34717 }
34718 template<typename _BidirectionalIterator, typename _Compare>
34719 bool
34720 next_permutation(_BidirectionalIterator __first,
34721 _BidirectionalIterator __last, _Compare __comp)
34722 {
34723
34724
34725 ;
34726 if (__first == __last)
34727 return false;
34728 _BidirectionalIterator __i = __first;
34729 ++__i;
34730 if (__i == __last)
34731 return false;
34732 __i = __last;
34733 --__i;
34734 for(;;)
34735 {
34736 _BidirectionalIterator __ii = __i;
34737 --__i;
34738 if (__comp(*__i, *__ii))
34739 {
34740 _BidirectionalIterator __j = __last;
34741 while (!bool(__comp(*__i, *--__j)))
34742 {}
34743 std::iter_swap(__i, __j);
34744 std::reverse(__ii, __last);
34745 return true;
34746 }
34747 if (__i == __first)
34748 {
34749 std::reverse(__first, __last);
34750 return false;
34751 }
34752 }
34753 }
34754 template<typename _BidirectionalIterator>
34755 bool
34756 prev_permutation(_BidirectionalIterator __first,
34757 _BidirectionalIterator __last)
34758 {
34759
34760
34761 ;
34762 if (__first == __last)
34763 return false;
34764 _BidirectionalIterator __i = __first;
34765 ++__i;
34766 if (__i == __last)
34767 return false;
34768 __i = __last;
34769 --__i;
34770 for(;;)
34771 {
34772 _BidirectionalIterator __ii = __i;
34773 --__i;
34774 if (*__ii < *__i)
34775 {
34776 _BidirectionalIterator __j = __last;
34777 while (!(*--__j < *__i))
34778 {}
34779 std::iter_swap(__i, __j);
34780 std::reverse(__ii, __last);
34781 return true;
34782 }
34783 if (__i == __first)
34784 {
34785 std::reverse(__first, __last);
34786 return false;
34787 }
34788 }
34789 }
34790 template<typename _BidirectionalIterator, typename _Compare>
34791 bool
34792 prev_permutation(_BidirectionalIterator __first,
34793 _BidirectionalIterator __last, _Compare __comp)
34794 {
34795
34796
34797 ;
34798 if (__first == __last)
34799 return false;
34800 _BidirectionalIterator __i = __first;
34801 ++__i;
34802 if (__i == __last)
34803 return false;
34804 __i = __last;
34805 --__i;
34806 for(;;)
34807 {
34808 _BidirectionalIterator __ii = __i;
34809 --__i;
34810 if (__comp(*__ii, *__i))
34811 {
34812 _BidirectionalIterator __j = __last;
34813 while (!bool(__comp(*--__j, *__i)))
34814 {}
34815 std::iter_swap(__i, __j);
34816 std::reverse(__ii, __last);
34817 return true;
34818 }
34819 if (__i == __first)
34820 {
34821 std::reverse(__first, __last);
34822 return false;
34823 }
34824 }
34825 }
34826 template<typename _InputIterator, typename _OutputIterator, typename _Tp>
34827 _OutputIterator
34828 replace_copy(_InputIterator __first, _InputIterator __last,
34829 _OutputIterator __result,
34830 const _Tp& __old_value, const _Tp& __new_value)
34831 {
34832
34833
34834
34835 ;
34836 for (; __first != __last; ++__first, ++__result)
34837 if (*__first == __old_value)
34838 *__result = __new_value;
34839 else
34840 *__result = *__first;
34841 return __result;
34842 }
34843 template<typename _InputIterator, typename _OutputIterator,
34844 typename _Predicate, typename _Tp>
34845 _OutputIterator
34846 replace_copy_if(_InputIterator __first, _InputIterator __last,
34847 _OutputIterator __result,
34848 _Predicate __pred, const _Tp& __new_value)
34849 {
34850
34851
34852
34853 ;
34854 for (; __first != __last; ++__first, ++__result)
34855 if (__pred(*__first))
34856 *__result = __new_value;
34857 else
34858 *__result = *__first;
34859 return __result;
34860 }
34861 }
34862 namespace std __attribute__ ((__visibility__ ("default"))) {
34863 template<typename _InputIterator, typename _Function>
34864 _Function
34865 for_each(_InputIterator __first, _InputIterator __last, _Function __f)
34866 {
34867
34868 ;
34869 for (; __first != __last; ++__first)
34870 __f(*__first);
34871 return (__f);
34872 }
34873 template<typename _InputIterator, typename _Tp>
34874 inline _InputIterator
34875 find(_InputIterator __first, _InputIterator __last,
34876 const _Tp& __val)
34877 {
34878
34879
34880 ;
34881 return std::__find(__first, __last, __val,
34882 std::__iterator_category(__first));
34883 }
34884 template<typename _InputIterator, typename _Predicate>
34885 inline _InputIterator
34886 find_if(_InputIterator __first, _InputIterator __last,
34887 _Predicate __pred)
34888 {
34889
34890
34891 ;
34892 return std::__find_if(__first, __last, __pred,
34893 std::__iterator_category(__first));
34894 }
34895 template<typename _InputIterator, typename _ForwardIterator>
34896 _InputIterator
34897 find_first_of(_InputIterator __first1, _InputIterator __last1,
34898 _ForwardIterator __first2, _ForwardIterator __last2)
34899 {
34900
34901
34902
34903 ;
34904 ;
34905 for (; __first1 != __last1; ++__first1)
34906 for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
34907 if (*__first1 == *__iter)
34908 return __first1;
34909 return __last1;
34910 }
34911 template<typename _InputIterator, typename _ForwardIterator,
34912 typename _BinaryPredicate>
34913 _InputIterator
34914 find_first_of(_InputIterator __first1, _InputIterator __last1,
34915 _ForwardIterator __first2, _ForwardIterator __last2,
34916 _BinaryPredicate __comp)
34917 {
34918
34919
34920
34921 ;
34922 ;
34923 for (; __first1 != __last1; ++__first1)
34924 for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
34925 if (__comp(*__first1, *__iter))
34926 return __first1;
34927 return __last1;
34928 }
34929 template<typename _ForwardIterator>
34930 _ForwardIterator
34931 adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
34932 {
34933
34934
34935 ;
34936 if (__first == __last)
34937 return __last;
34938 _ForwardIterator __next = __first;
34939 while(++__next != __last)
34940 {
34941 if (*__first == *__next)
34942 return __first;
34943 __first = __next;
34944 }
34945 return __last;
34946 }
34947 template<typename _ForwardIterator, typename _BinaryPredicate>
34948 _ForwardIterator
34949 adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
34950 _BinaryPredicate __binary_pred)
34951 {
34952
34953
34954 ;
34955 if (__first == __last)
34956 return __last;
34957 _ForwardIterator __next = __first;
34958 while(++__next != __last)
34959 {
34960 if (__binary_pred(*__first, *__next))
34961 return __first;
34962 __first = __next;
34963 }
34964 return __last;
34965 }
34966 template<typename _InputIterator, typename _Tp>
34967 typename iterator_traits<_InputIterator>::difference_type
34968 count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
34969 {
34970
34971
34972 ;
34973 typename iterator_traits<_InputIterator>::difference_type __n = 0;
34974 for (; __first != __last; ++__first)
34975 if (*__first == __value)
34976 ++__n;
34977 return __n;
34978 }
34979 template<typename _InputIterator, typename _Predicate>
34980 typename iterator_traits<_InputIterator>::difference_type
34981 count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
34982 {
34983
34984
34985 ;
34986 typename iterator_traits<_InputIterator>::difference_type __n = 0;
34987 for (; __first != __last; ++__first)
34988 if (__pred(*__first))
34989 ++__n;
34990 return __n;
34991 }
34992 template<typename _ForwardIterator1, typename _ForwardIterator2>
34993 _ForwardIterator1
34994 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
34995 _ForwardIterator2 __first2, _ForwardIterator2 __last2)
34996 {
34997
34998
34999
35000 ;
35001 ;
35002 if (__first1 == __last1 || __first2 == __last2)
35003 return __first1;
35004 _ForwardIterator2 __p1(__first2);
35005 if (++__p1 == __last2)
35006 return std::find(__first1, __last1, *__first2);
35007 _ForwardIterator2 __p;
35008 _ForwardIterator1 __current = __first1;
35009 for (;;)
35010 {
35011 __first1 = std::find(__first1, __last1, *__first2);
35012 if (__first1 == __last1)
35013 return __last1;
35014 __p = __p1;
35015 __current = __first1;
35016 if (++__current == __last1)
35017 return __last1;
35018 while (*__current == *__p)
35019 {
35020 if (++__p == __last2)
35021 return __first1;
35022 if (++__current == __last1)
35023 return __last1;
35024 }
35025 ++__first1;
35026 }
35027 return __first1;
35028 }
35029 template<typename _ForwardIterator1, typename _ForwardIterator2,
35030 typename _BinaryPredicate>
35031 _ForwardIterator1
35032 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
35033 _ForwardIterator2 __first2, _ForwardIterator2 __last2,
35034 _BinaryPredicate __predicate)
35035 {
35036
35037
35038
35039 ;
35040 ;
35041 if (__first1 == __last1 || __first2 == __last2)
35042 return __first1;
35043 _ForwardIterator2 __p1(__first2);
35044 if (++__p1 == __last2)
35045 {
35046 while (__first1 != __last1
35047 && !bool(__predicate(*__first1, *__first2)))
35048 ++__first1;
35049 return __first1;
35050 }
35051 _ForwardIterator2 __p;
35052 _ForwardIterator1 __current = __first1;
35053 for (;;)
35054 {
35055 while (__first1 != __last1
35056 && !bool(__predicate(*__first1, *__first2)))
35057 ++__first1;
35058 if (__first1 == __last1)
35059 return __last1;
35060 __p = __p1;
35061 __current = __first1;
35062 if (++__current == __last1)
35063 return __last1;
35064 while (__predicate(*__current, *__p))
35065 {
35066 if (++__p == __last2)
35067 return __first1;
35068 if (++__current == __last1)
35069 return __last1;
35070 }
35071 ++__first1;
35072 }
35073 return __first1;
35074 }
35075 template<typename _ForwardIterator, typename _Integer, typename _Tp>
35076 _ForwardIterator
35077 search_n(_ForwardIterator __first, _ForwardIterator __last,
35078 _Integer __count, const _Tp& __val)
35079 {
35080
35081
35082 ;
35083 if (__count <= 0)
35084 return __first;
35085 if (__count == 1)
35086 return std::find(__first, __last, __val);
35087 return std::__search_n(__first, __last, __count, __val,
35088 std::__iterator_category(__first));
35089 }
35090 template<typename _ForwardIterator, typename _Integer, typename _Tp,
35091 typename _BinaryPredicate>
35092 _ForwardIterator
35093 search_n(_ForwardIterator __first, _ForwardIterator __last,
35094 _Integer __count, const _Tp& __val,
35095 _BinaryPredicate __binary_pred)
35096 {
35097
35098
35099 ;
35100 if (__count <= 0)
35101 return __first;
35102 if (__count == 1)
35103 {
35104 while (__first != __last && !bool(__binary_pred(*__first, __val)))
35105 ++__first;
35106 return __first;
35107 }
35108 return std::__search_n(__first, __last, __count, __val, __binary_pred,
35109 std::__iterator_category(__first));
35110 }
35111 template<typename _InputIterator, typename _OutputIterator,
35112 typename _UnaryOperation>
35113 _OutputIterator
35114 transform(_InputIterator __first, _InputIterator __last,
35115 _OutputIterator __result, _UnaryOperation __unary_op)
35116 {
35117
35118
35119 ;
35120 for (; __first != __last; ++__first, ++__result)
35121 *__result = __unary_op(*__first);
35122 return __result;
35123 }
35124 template<typename _InputIterator1, typename _InputIterator2,
35125 typename _OutputIterator, typename _BinaryOperation>
35126 _OutputIterator
35127 transform(_InputIterator1 __first1, _InputIterator1 __last1,
35128 _InputIterator2 __first2, _OutputIterator __result,
35129 _BinaryOperation __binary_op)
35130 {
35131
35132
35133
35134 ;
35135 for (; __first1 != __last1; ++__first1, ++__first2, ++__result)
35136 *__result = __binary_op(*__first1, *__first2);
35137 return __result;
35138 }
35139 template<typename _ForwardIterator, typename _Tp>
35140 void
35141 replace(_ForwardIterator __first, _ForwardIterator __last,
35142 const _Tp& __old_value, const _Tp& __new_value)
35143 {
35144
35145
35146
35147 ;
35148 for (; __first != __last; ++__first)
35149 if (*__first == __old_value)
35150 *__first = __new_value;
35151 }
35152 template<typename _ForwardIterator, typename _Predicate, typename _Tp>
35153 void
35154 replace_if(_ForwardIterator __first, _ForwardIterator __last,
35155 _Predicate __pred, const _Tp& __new_value)
35156 {
35157
35158
35159
35160 ;
35161 for (; __first != __last; ++__first)
35162 if (__pred(*__first))
35163 *__first = __new_value;
35164 }
35165 template<typename _ForwardIterator, typename _Generator>
35166 void
35167 generate(_ForwardIterator __first, _ForwardIterator __last,
35168 _Generator __gen)
35169 {
35170
35171
35172 ;
35173 for (; __first != __last; ++__first)
35174 *__first = __gen();
35175 }
35176 template<typename _OutputIterator, typename _Size, typename _Generator>
35177 _OutputIterator
35178 generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
35179 {
35180
35181 for (; __n > 0; --__n, ++__first)
35182 *__first = __gen();
35183 return __first;
35184 }
35185 template<typename _InputIterator, typename _OutputIterator>
35186 inline _OutputIterator
35187 unique_copy(_InputIterator __first, _InputIterator __last,
35188 _OutputIterator __result)
35189 {
35190
35191
35192
35193 ;
35194 if (__first == __last)
35195 return __result;
35196 return std::__unique_copy(__first, __last, __result,
35197 std::__iterator_category(__first),
35198 std::__iterator_category(__result));
35199 }
35200 template<typename _InputIterator, typename _OutputIterator,
35201 typename _BinaryPredicate>
35202 inline _OutputIterator
35203 unique_copy(_InputIterator __first, _InputIterator __last,
35204 _OutputIterator __result,
35205 _BinaryPredicate __binary_pred)
35206 {
35207
35208
35209 ;
35210 if (__first == __last)
35211 return __result;
35212 return std::__unique_copy(__first, __last, __result, __binary_pred,
35213 std::__iterator_category(__first),
35214 std::__iterator_category(__result));
35215 }
35216 template<typename _RandomAccessIterator>
35217 inline void
35218 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
35219 {
35220
35221 ;
35222 if (__first != __last)
35223 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
35224 std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
35225 }
35226 template<typename _RandomAccessIterator, typename _RandomNumberGenerator>
35227 void
35228 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
35229 _RandomNumberGenerator& __rand)
35230 {
35231
35232 ;
35233 if (__first == __last)
35234 return;
35235 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
35236 std::iter_swap(__i, __first + __rand((__i - __first) + 1));
35237 }
35238 template<typename _ForwardIterator, typename _Predicate>
35239 inline _ForwardIterator
35240 partition(_ForwardIterator __first, _ForwardIterator __last,
35241 _Predicate __pred)
35242 {
35243
35244
35245 ;
35246 return std::__partition(__first, __last, __pred,
35247 std::__iterator_category(__first));
35248 }
35249 template<typename _RandomAccessIterator>
35250 inline void
35251 partial_sort(_RandomAccessIterator __first,
35252 _RandomAccessIterator __middle,
35253 _RandomAccessIterator __last)
35254 {
35255 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35256 _ValueType;
35257
35258
35259 ;
35260 ;
35261 std::__heap_select(__first, __middle, __last);
35262 std::sort_heap(__first, __middle);
35263 }
35264 template<typename _RandomAccessIterator, typename _Compare>
35265 inline void
35266 partial_sort(_RandomAccessIterator __first,
35267 _RandomAccessIterator __middle,
35268 _RandomAccessIterator __last,
35269 _Compare __comp)
35270 {
35271 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35272 _ValueType;
35273
35274
35275 ;
35276 ;
35277 std::__heap_select(__first, __middle, __last, __comp);
35278 std::sort_heap(__first, __middle, __comp);
35279 }
35280 template<typename _RandomAccessIterator>
35281 inline void
35282 nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
35283 _RandomAccessIterator __last)
35284 {
35285 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35286 _ValueType;
35287
35288
35289 ;
35290 ;
35291 if (__first == __last || __nth == __last)
35292 return;
35293 std::__introselect(__first, __nth, __last,
35294 std::__lg(__last - __first) * 2);
35295 }
35296 template<typename _RandomAccessIterator, typename _Compare>
35297 inline void
35298 nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
35299 _RandomAccessIterator __last, _Compare __comp)
35300 {
35301 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35302 _ValueType;
35303
35304
35305 ;
35306 ;
35307 if (__first == __last || __nth == __last)
35308 return;
35309 std::__introselect(__first, __nth, __last,
35310 std::__lg(__last - __first) * 2, __comp);
35311 }
35312 template<typename _RandomAccessIterator>
35313 inline void
35314 sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
35315 {
35316 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35317 _ValueType;
35318
35319
35320 ;
35321 if (__first != __last)
35322 {
35323 std::__introsort_loop(__first, __last,
35324 std::__lg(__last - __first) * 2);
35325 std::__final_insertion_sort(__first, __last);
35326 }
35327 }
35328 template<typename _RandomAccessIterator, typename _Compare>
35329 inline void
35330 sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
35331 _Compare __comp)
35332 {
35333 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35334 _ValueType;
35335
35336
35337 ;
35338 if (__first != __last)
35339 {
35340 std::__introsort_loop(__first, __last,
35341 std::__lg(__last - __first) * 2, __comp);
35342 std::__final_insertion_sort(__first, __last, __comp);
35343 }
35344 }
35345 template<typename _InputIterator1, typename _InputIterator2,
35346 typename _OutputIterator>
35347 _OutputIterator
35348 merge(_InputIterator1 __first1, _InputIterator1 __last1,
35349 _InputIterator2 __first2, _InputIterator2 __last2,
35350 _OutputIterator __result)
35351 {
35352 typedef typename iterator_traits<_InputIterator1>::value_type
35353 _ValueType1;
35354 typedef typename iterator_traits<_InputIterator2>::value_type
35355 _ValueType2;
35356
35357
35358
35359
35360
35361 ;
35362 ;
35363 while (__first1 != __last1 && __first2 != __last2)
35364 {
35365 if (*__first2 < *__first1)
35366 {
35367 *__result = *__first2;
35368 ++__first2;
35369 }
35370 else
35371 {
35372 *__result = *__first1;
35373 ++__first1;
35374 }
35375 ++__result;
35376 }
35377 return std::copy(__first2, __last2, std::copy(__first1, __last1,
35378 __result));
35379 }
35380 template<typename _InputIterator1, typename _InputIterator2,
35381 typename _OutputIterator, typename _Compare>
35382 _OutputIterator
35383 merge(_InputIterator1 __first1, _InputIterator1 __last1,
35384 _InputIterator2 __first2, _InputIterator2 __last2,
35385 _OutputIterator __result, _Compare __comp)
35386 {
35387 typedef typename iterator_traits<_InputIterator1>::value_type
35388 _ValueType1;
35389 typedef typename iterator_traits<_InputIterator2>::value_type
35390 _ValueType2;
35391
35392
35393
35394
35395
35396 ;
35397 ;
35398 while (__first1 != __last1 && __first2 != __last2)
35399 {
35400 if (__comp(*__first2, *__first1))
35401 {
35402 *__result = *__first2;
35403 ++__first2;
35404 }
35405 else
35406 {
35407 *__result = *__first1;
35408 ++__first1;
35409 }
35410 ++__result;
35411 }
35412 return std::copy(__first2, __last2, std::copy(__first1, __last1,
35413 __result));
35414 }
35415 template<typename _RandomAccessIterator>
35416 inline void
35417 stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
35418 {
35419 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35420 _ValueType;
35421 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
35422 _DistanceType;
35423
35424
35425 ;
35426 _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first,
35427 __last);
35428 if (__buf.begin() == 0)
35429 std::__inplace_stable_sort(__first, __last);
35430 else
35431 std::__stable_sort_adaptive(__first, __last, __buf.begin(),
35432 _DistanceType(__buf.size()));
35433 }
35434 template<typename _RandomAccessIterator, typename _Compare>
35435 inline void
35436 stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
35437 _Compare __comp)
35438 {
35439 typedef typename iterator_traits<_RandomAccessIterator>::value_type
35440 _ValueType;
35441 typedef typename iterator_traits<_RandomAccessIterator>::difference_type
35442 _DistanceType;
35443
35444
35445 ;
35446 _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first,
35447 __last);
35448 if (__buf.begin() == 0)
35449 std::__inplace_stable_sort(__first, __last, __comp);
35450 else
35451 std::__stable_sort_adaptive(__first, __last, __buf.begin(),
35452 _DistanceType(__buf.size()), __comp);
35453 }
35454 template<typename _InputIterator1, typename _InputIterator2,
35455 typename _OutputIterator>
35456 _OutputIterator
35457 set_union(_InputIterator1 __first1, _InputIterator1 __last1,
35458 _InputIterator2 __first2, _InputIterator2 __last2,
35459 _OutputIterator __result)
35460 {
35461 typedef typename iterator_traits<_InputIterator1>::value_type
35462 _ValueType1;
35463 typedef typename iterator_traits<_InputIterator2>::value_type
35464 _ValueType2;
35465
35466
35467
35468
35469
35470
35471 ;
35472 ;
35473 while (__first1 != __last1 && __first2 != __last2)
35474 {
35475 if (*__first1 < *__first2)
35476 {
35477 *__result = *__first1;
35478 ++__first1;
35479 }
35480 else if (*__first2 < *__first1)
35481 {
35482 *__result = *__first2;
35483 ++__first2;
35484 }
35485 else
35486 {
35487 *__result = *__first1;
35488 ++__first1;
35489 ++__first2;
35490 }
35491 ++__result;
35492 }
35493 return std::copy(__first2, __last2, std::copy(__first1, __last1,
35494 __result));
35495 }
35496 template<typename _InputIterator1, typename _InputIterator2,
35497 typename _OutputIterator, typename _Compare>
35498 _OutputIterator
35499 set_union(_InputIterator1 __first1, _InputIterator1 __last1,
35500 _InputIterator2 __first2, _InputIterator2 __last2,
35501 _OutputIterator __result, _Compare __comp)
35502 {
35503 typedef typename iterator_traits<_InputIterator1>::value_type
35504 _ValueType1;
35505 typedef typename iterator_traits<_InputIterator2>::value_type
35506 _ValueType2;
35507
35508
35509
35510
35511
35512
35513 ;
35514 ;
35515 while (__first1 != __last1 && __first2 != __last2)
35516 {
35517 if (__comp(*__first1, *__first2))
35518 {
35519 *__result = *__first1;
35520 ++__first1;
35521 }
35522 else if (__comp(*__first2, *__first1))
35523 {
35524 *__result = *__first2;
35525 ++__first2;
35526 }
35527 else
35528 {
35529 *__result = *__first1;
35530 ++__first1;
35531 ++__first2;
35532 }
35533 ++__result;
35534 }
35535 return std::copy(__first2, __last2, std::copy(__first1, __last1,
35536 __result));
35537 }
35538 template<typename _InputIterator1, typename _InputIterator2,
35539 typename _OutputIterator>
35540 _OutputIterator
35541 set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
35542 _InputIterator2 __first2, _InputIterator2 __last2,
35543 _OutputIterator __result)
35544 {
35545 typedef typename iterator_traits<_InputIterator1>::value_type
35546 _ValueType1;
35547 typedef typename iterator_traits<_InputIterator2>::value_type
35548 _ValueType2;
35549
35550
35551
35552
35553
35554 ;
35555 ;
35556 while (__first1 != __last1 && __first2 != __last2)
35557 if (*__first1 < *__first2)
35558 ++__first1;
35559 else if (*__first2 < *__first1)
35560 ++__first2;
35561 else
35562 {
35563 *__result = *__first1;
35564 ++__first1;
35565 ++__first2;
35566 ++__result;
35567 }
35568 return __result;
35569 }
35570 template<typename _InputIterator1, typename _InputIterator2,
35571 typename _OutputIterator, typename _Compare>
35572 _OutputIterator
35573 set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
35574 _InputIterator2 __first2, _InputIterator2 __last2,
35575 _OutputIterator __result, _Compare __comp)
35576 {
35577 typedef typename iterator_traits<_InputIterator1>::value_type
35578 _ValueType1;
35579 typedef typename iterator_traits<_InputIterator2>::value_type
35580 _ValueType2;
35581
35582
35583
35584
35585
35586 ;
35587 ;
35588 while (__first1 != __last1 && __first2 != __last2)
35589 if (__comp(*__first1, *__first2))
35590 ++__first1;
35591 else if (__comp(*__first2, *__first1))
35592 ++__first2;
35593 else
35594 {
35595 *__result = *__first1;
35596 ++__first1;
35597 ++__first2;
35598 ++__result;
35599 }
35600 return __result;
35601 }
35602 template<typename _InputIterator1, typename _InputIterator2,
35603 typename _OutputIterator>
35604 _OutputIterator
35605 set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
35606 _InputIterator2 __first2, _InputIterator2 __last2,
35607 _OutputIterator __result)
35608 {
35609 typedef typename iterator_traits<_InputIterator1>::value_type
35610 _ValueType1;
35611 typedef typename iterator_traits<_InputIterator2>::value_type
35612 _ValueType2;
35613
35614
35615
35616
35617
35618 ;
35619 ;
35620 while (__first1 != __last1 && __first2 != __last2)
35621 if (*__first1 < *__first2)
35622 {
35623 *__result = *__first1;
35624 ++__first1;
35625 ++__result;
35626 }
35627 else if (*__first2 < *__first1)
35628 ++__first2;
35629 else
35630 {
35631 ++__first1;
35632 ++__first2;
35633 }
35634 return std::copy(__first1, __last1, __result);
35635 }
35636 template<typename _InputIterator1, typename _InputIterator2,
35637 typename _OutputIterator, typename _Compare>
35638 _OutputIterator
35639 set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
35640 _InputIterator2 __first2, _InputIterator2 __last2,
35641 _OutputIterator __result, _Compare __comp)
35642 {
35643 typedef typename iterator_traits<_InputIterator1>::value_type
35644 _ValueType1;
35645 typedef typename iterator_traits<_InputIterator2>::value_type
35646 _ValueType2;
35647
35648
35649
35650
35651
35652 ;
35653 ;
35654 while (__first1 != __last1 && __first2 != __last2)
35655 if (__comp(*__first1, *__first2))
35656 {
35657 *__result = *__first1;
35658 ++__first1;
35659 ++__result;
35660 }
35661 else if (__comp(*__first2, *__first1))
35662 ++__first2;
35663 else
35664 {
35665 ++__first1;
35666 ++__first2;
35667 }
35668 return std::copy(__first1, __last1, __result);
35669 }
35670 template<typename _InputIterator1, typename _InputIterator2,
35671 typename _OutputIterator>
35672 _OutputIterator
35673 set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
35674 _InputIterator2 __first2, _InputIterator2 __last2,
35675 _OutputIterator __result)
35676 {
35677 typedef typename iterator_traits<_InputIterator1>::value_type
35678 _ValueType1;
35679 typedef typename iterator_traits<_InputIterator2>::value_type
35680 _ValueType2;
35681
35682
35683
35684
35685
35686
35687 ;
35688 ;
35689 while (__first1 != __last1 && __first2 != __last2)
35690 if (*__first1 < *__first2)
35691 {
35692 *__result = *__first1;
35693 ++__first1;
35694 ++__result;
35695 }
35696 else if (*__first2 < *__first1)
35697 {
35698 *__result = *__first2;
35699 ++__first2;
35700 ++__result;
35701 }
35702 else
35703 {
35704 ++__first1;
35705 ++__first2;
35706 }
35707 return std::copy(__first2, __last2, std::copy(__first1,
35708 __last1, __result));
35709 }
35710 template<typename _InputIterator1, typename _InputIterator2,
35711 typename _OutputIterator, typename _Compare>
35712 _OutputIterator
35713 set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
35714 _InputIterator2 __first2, _InputIterator2 __last2,
35715 _OutputIterator __result,
35716 _Compare __comp)
35717 {
35718 typedef typename iterator_traits<_InputIterator1>::value_type
35719 _ValueType1;
35720 typedef typename iterator_traits<_InputIterator2>::value_type
35721 _ValueType2;
35722
35723
35724
35725
35726
35727
35728 ;
35729 ;
35730 while (__first1 != __last1 && __first2 != __last2)
35731 if (__comp(*__first1, *__first2))
35732 {
35733 *__result = *__first1;
35734 ++__first1;
35735 ++__result;
35736 }
35737 else if (__comp(*__first2, *__first1))
35738 {
35739 *__result = *__first2;
35740 ++__first2;
35741 ++__result;
35742 }
35743 else
35744 {
35745 ++__first1;
35746 ++__first2;
35747 }
35748 return std::copy(__first2, __last2,
35749 std::copy(__first1, __last1, __result));
35750 }
35751 template<typename _ForwardIterator>
35752 _ForwardIterator
35753 min_element(_ForwardIterator __first, _ForwardIterator __last)
35754 {
35755
35756
35757 ;
35758 if (__first == __last)
35759 return __first;
35760 _ForwardIterator __result = __first;
35761 while (++__first != __last)
35762 if (*__first < *__result)
35763 __result = __first;
35764 return __result;
35765 }
35766 template<typename _ForwardIterator, typename _Compare>
35767 _ForwardIterator
35768 min_element(_ForwardIterator __first, _ForwardIterator __last,
35769 _Compare __comp)
35770 {
35771
35772
35773 ;
35774 if (__first == __last)
35775 return __first;
35776 _ForwardIterator __result = __first;
35777 while (++__first != __last)
35778 if (__comp(*__first, *__result))
35779 __result = __first;
35780 return __result;
35781 }
35782 template<typename _ForwardIterator>
35783 _ForwardIterator
35784 max_element(_ForwardIterator __first, _ForwardIterator __last)
35785 {
35786
35787
35788 ;
35789 if (__first == __last)
35790 return __first;
35791 _ForwardIterator __result = __first;
35792 while (++__first != __last)
35793 if (*__result < *__first)
35794 __result = __first;
35795 return __result;
35796 }
35797 template<typename _ForwardIterator, typename _Compare>
35798 _ForwardIterator
35799 max_element(_ForwardIterator __first, _ForwardIterator __last,
35800 _Compare __comp)
35801 {
35802
35803
35804 ;
35805 if (__first == __last) return __first;
35806 _ForwardIterator __result = __first;
35807 while (++__first != __last)
35808 if (__comp(*__result, *__first))
35809 __result = __first;
35810 return __result;
35811 }
35812 }
35813
35814
35815 namespace
35816 boost
35817 {
35818 namespace
35819 exception_detail
35820 {
35821 template <class T>
35822 class
35823 refcount_ptr
35824 {
35825 public:
35826 refcount_ptr():
35827 px_(0)
35828 {
35829 }
35830 ~refcount_ptr()
35831 {
35832 release();
35833 }
35834 refcount_ptr( refcount_ptr const & x ):
35835 px_(x.px_)
35836 {
35837 add_ref();
35838 }
35839 refcount_ptr &
35840 operator=( refcount_ptr const & x )
35841 {
35842 adopt(x.px_);
35843 return *this;
35844 }
35845 void
35846 adopt( T * px )
35847 {
35848 release();
35849 px_=px;
35850 add_ref();
35851 }
35852 T *
35853 get() const
35854 {
35855 return px_;
35856 }
35857 private:
35858 T * px_;
35859 void
35860 add_ref()
35861 {
35862 if( px_ )
35863 px_->add_ref();
35864 }
35865 void
35866 release()
35867 {
35868 if( px_ )
35869 px_->release();
35870 }
35871 };
35872 }
35873 template <class Tag,class T>
35874 class error_info;
35875 typedef error_info<struct throw_function_,char const *> throw_function;
35876 typedef error_info<struct throw_file_,char const *> throw_file;
35877 typedef error_info<struct throw_line_,int> throw_line;
35878 template <>
35879 class
35880 error_info<throw_function_,char const *>
35881 {
35882 public:
35883 typedef char const * value_type;
35884 value_type v_;
35885 explicit
35886 error_info( value_type v ):
35887 v_(v)
35888 {
35889 }
35890 };
35891 template <>
35892 class
35893 error_info<throw_file_,char const *>
35894 {
35895 public:
35896 typedef char const * value_type;
35897 value_type v_;
35898 explicit
35899 error_info( value_type v ):
35900 v_(v)
35901 {
35902 }
35903 };
35904 template <>
35905 class
35906 error_info<throw_line_,int>
35907 {
35908 public:
35909 typedef int value_type;
35910 value_type v_;
35911 explicit
35912 error_info( value_type v ):
35913 v_(v)
35914 {
35915 }
35916 };
35917 template <class E,class Tag,class T>
35918 E const & operator<<( E const &, error_info<Tag,T> const & );
35919 template <class E>
35920 E const & operator<<( E const &, throw_function const & );
35921 template <class E>
35922 E const & operator<<( E const &, throw_file const & );
35923 template <class E>
35924 E const & operator<<( E const &, throw_line const & );
35925 class exception;
35926 template <class>
35927 class shared_ptr;
35928 namespace
35929 exception_detail
35930 {
35931 class error_info_base;
35932 struct type_info_;
35933 struct
35934 error_info_container
35935 {
35936 virtual char const * diagnostic_information( char const * ) const = 0;
35937 virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
35938 virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
35939 virtual void add_ref() const = 0;
35940 virtual void release() const = 0;
35941 protected:
35942 ~error_info_container() throw()
35943 {
35944 }
35945 };
35946 template <class>
35947 struct get_info;
35948 template <>
35949 struct get_info<throw_function>;
35950 template <>
35951 struct get_info<throw_file>;
35952 template <>
35953 struct get_info<throw_line>;
35954 char const * get_diagnostic_information( exception const &, char const * );
35955 }
35956 class
35957 exception
35958 {
35959 protected:
35960 exception():
35961 throw_function_(0),
35962 throw_file_(0),
35963 throw_line_(-1)
35964 {
35965 }
35966 virtual ~exception() throw()
35967 = 0
35968 ;
35969 private:
35970 template <class E>
35971 friend E const & operator<<( E const &, throw_function const & );
35972 template <class E>
35973 friend E const & operator<<( E const &, throw_file const & );
35974 template <class E>
35975 friend E const & operator<<( E const &, throw_line const & );
35976 friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
35977 template <class E,class Tag,class T>
35978 friend E const & operator<<( E const &, error_info<Tag,T> const & );
35979 template <class>
35980 friend struct exception_detail::get_info;
35981 friend struct exception_detail::get_info<throw_function>;
35982 friend struct exception_detail::get_info<throw_file>;
35983 friend struct exception_detail::get_info<throw_line>;
35984 mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
35985 mutable char const * throw_function_;
35986 mutable char const * throw_file_;
35987 mutable int throw_line_;
35988 };
35989 inline
35990 exception::
35991 ~exception() throw()
35992 {
35993 }
35994 template <class E>
35995 E const &
35996 operator<<( E const & x, throw_function const & y )
35997 {
35998 x.throw_function_=y.v_;
35999 return x;
36000 }
36001 template <class E>
36002 E const &
36003 operator<<( E const & x, throw_file const & y )
36004 {
36005 x.throw_file_=y.v_;
36006 return x;
36007 }
36008 template <class E>
36009 E const &
36010 operator<<( E const & x, throw_line const & y )
36011 {
36012 x.throw_line_=y.v_;
36013 return x;
36014 }
36015 namespace
36016 exception_detail
36017 {
36018 template <class T>
36019 struct
36020 error_info_injector:
36021 public T,
36022 public exception
36023 {
36024 explicit
36025 error_info_injector( T const & x ):
36026 T(x)
36027 {
36028 }
36029 ~error_info_injector() throw()
36030 {
36031 }
36032 };
36033 struct large_size { char c[256]; };
36034 large_size dispatch( exception * );
36035 struct small_size { };
36036 small_size dispatch( void * );
36037 template <class,int>
36038 struct enable_error_info_helper;
36039 template <class T>
36040 struct
36041 enable_error_info_helper<T,sizeof(large_size)>
36042 {
36043 typedef T type;
36044 };
36045 template <class T>
36046 struct
36047 enable_error_info_helper<T,sizeof(small_size)>
36048 {
36049 typedef error_info_injector<T> type;
36050 };
36051 template <class T>
36052 struct
36053 enable_error_info_return_type
36054 {
36055 typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch((T*)0))>::type type;
36056 };
36057 }
36058 template <class T>
36059 inline
36060 typename
36061 exception_detail::enable_error_info_return_type<T>::type
36062 enable_error_info( T const & x )
36063 {
36064 typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
36065 return rt(x);
36066 }
36067 namespace
36068 exception_detail
36069 {
36070 class
36071 clone_base
36072 {
36073 public:
36074 virtual clone_base const * clone() const = 0;
36075 virtual void rethrow() const = 0;
36076 virtual
36077 ~clone_base() throw()
36078 {
36079 }
36080 };
36081 inline
36082 void
36083 copy_boost_exception( exception * a, exception const * b )
36084 {
36085 *a = *b;
36086 }
36087 inline
36088 void
36089 copy_boost_exception( void *, void const * )
36090 {
36091 }
36092 template <class T>
36093 class
36094 clone_impl:
36095 public T,
36096 public clone_base
36097 {
36098 public:
36099 explicit
36100 clone_impl( T const & x ):
36101 T(x)
36102 {
36103 copy_boost_exception(this,&x);
36104 }
36105 ~clone_impl() throw()
36106 {
36107 }
36108 private:
36109 clone_base const *
36110 clone() const
36111 {
36112 return new clone_impl(*this);
36113 }
36114 void
36115 rethrow() const
36116 {
36117 throw*this;
36118 }
36119 };
36120 }
36121 template <class T>
36122 inline
36123 exception_detail::clone_impl<T>
36124 enable_current_exception( T const & x )
36125 {
36126 return exception_detail::clone_impl<T>(x);
36127 }
36128 }
36129 namespace boost
36130 {
36131 namespace detail
36132 {
36133 inline void current_function_helper()
36134 {
36135 }
36136 }
36137 }
36138 namespace boost
36139 {
36140 inline void throw_exception_assert_compatibility( std::exception const & ) { }
36141 template<class E> __attribute__((noreturn)) inline void throw_exception( E const & e )
36142 {
36143 throw_exception_assert_compatibility(e);
36144 throw enable_current_exception(enable_error_info(e));
36145 }
36146 }
36147
36148 namespace std __attribute__ ((__visibility__ ("default"))) {
36149 class logic_error : public exception
36150 {
36151 string _M_msg;
36152 public:
36153 explicit
36154 logic_error(const string& __arg);
36155 virtual
36156 ~logic_error() throw();
36157 virtual const char*
36158 what() const throw();
36159 };
36160 class domain_error : public logic_error
36161 {
36162 public:
36163 explicit domain_error(const string& __arg);
36164 };
36165 class invalid_argument : public logic_error
36166 {
36167 public:
36168 explicit invalid_argument(const string& __arg);
36169 };
36170 class length_error : public logic_error
36171 {
36172 public:
36173 explicit length_error(const string& __arg);
36174 };
36175 class out_of_range : public logic_error
36176 {
36177 public:
36178 explicit out_of_range(const string& __arg);
36179 };
36180 class runtime_error : public exception
36181 {
36182 string _M_msg;
36183 public:
36184 explicit
36185 runtime_error(const string& __arg);
36186 virtual
36187 ~runtime_error() throw();
36188 virtual const char*
36189 what() const throw();
36190 };
36191 class range_error : public runtime_error
36192 {
36193 public:
36194 explicit range_error(const string& __arg);
36195 };
36196 class overflow_error : public runtime_error
36197 {
36198 public:
36199 explicit overflow_error(const string& __arg);
36200 };
36201 class underflow_error : public runtime_error
36202 {
36203 public:
36204 explicit underflow_error(const string& __arg);
36205 };
36206 }
36207
36208 namespace std __attribute__ ((__visibility__ ("default"))) {
36209 template <class _OutputIterator, class _Tp>
36210 class raw_storage_iterator
36211 : public iterator<output_iterator_tag, void, void, void, void>
36212 {
36213 protected:
36214 _OutputIterator _M_iter;
36215 public:
36216 explicit
36217 raw_storage_iterator(_OutputIterator __x)
36218 : _M_iter(__x) {}
36219 raw_storage_iterator&
36220 operator*() { return *this; }
36221 raw_storage_iterator&
36222 operator=(const _Tp& __element)
36223 {
36224 std::_Construct(&*_M_iter, __element);
36225 return *this;
36226 }
36227 raw_storage_iterator<_OutputIterator, _Tp>&
36228 operator++()
36229 {
36230 ++_M_iter;
36231 return *this;
36232 }
36233 raw_storage_iterator<_OutputIterator, _Tp>
36234 operator++(int)
36235 {
36236 raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
36237 ++_M_iter;
36238 return __tmp;
36239 }
36240 };
36241 }
36242 namespace std __attribute__ ((__visibility__ ("default"))) {
36243 template<typename _Tp1>
36244 struct auto_ptr_ref
36245 {
36246 _Tp1* _M_ptr;
36247 explicit
36248 auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
36249 } ;
36250 template<typename _Tp>
36251 class auto_ptr
36252 {
36253 private:
36254 _Tp* _M_ptr;
36255 public:
36256 typedef _Tp element_type;
36257 explicit
36258 auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
36259 auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
36260 template<typename _Tp1>
36261 auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
36262 auto_ptr&
36263 operator=(auto_ptr& __a) throw()
36264 {
36265 reset(__a.release());
36266 return *this;
36267 }
36268 template<typename _Tp1>
36269 auto_ptr&
36270 operator=(auto_ptr<_Tp1>& __a) throw()
36271 {
36272 reset(__a.release());
36273 return *this;
36274 }
36275 ~auto_ptr() { delete _M_ptr; }
36276 element_type&
36277 operator*() const throw()
36278 {
36279 ;
36280 return *_M_ptr;
36281 }
36282 element_type*
36283 operator->() const throw()
36284 {
36285 ;
36286 return _M_ptr;
36287 }
36288 element_type*
36289 get() const throw() { return _M_ptr; }
36290 element_type*
36291 release() throw()
36292 {
36293 element_type* __tmp = _M_ptr;
36294 _M_ptr = 0;
36295 return __tmp;
36296 }
36297 void
36298 reset(element_type* __p = 0) throw()
36299 {
36300 if (__p != _M_ptr)
36301 {
36302 delete _M_ptr;
36303 _M_ptr = __p;
36304 }
36305 }
36306 auto_ptr(auto_ptr_ref<element_type> __ref) throw()
36307 : _M_ptr(__ref._M_ptr) { }
36308 auto_ptr&
36309 operator=(auto_ptr_ref<element_type> __ref) throw()
36310 {
36311 if (__ref._M_ptr != this->get())
36312 {
36313 delete _M_ptr;
36314 _M_ptr = __ref._M_ptr;
36315 }
36316 return *this;
36317 }
36318 template<typename _Tp1>
36319 operator auto_ptr_ref<_Tp1>() throw()
36320 { return auto_ptr_ref<_Tp1>(this->release()); }
36321 template<typename _Tp1>
36322 operator auto_ptr<_Tp1>() throw()
36323 { return auto_ptr<_Tp1>(this->release()); }
36324 } ;
36325 template<>
36326 class auto_ptr<void>
36327 {
36328 public:
36329 typedef void element_type;
36330 } ;
36331 }
36332
36333 extern "C++" {
36334 namespace __cxxabiv1
36335 {
36336 class __class_type_info;
36337 }
36338 namespace std
36339 {
36340 class type_info
36341 {
36342 public:
36343 virtual ~type_info();
36344 const char* name() const
36345 { return __name[0] == '*' ? __name + 1 : __name; }
36346 bool before(const type_info& __arg) const
36347 { return (__name[0] == '*' && __arg.__name[0] == '*')
36348 ? __name < __arg.__name
36349 : __builtin_strcmp (__name, __arg.__name) < 0; }
36350 bool operator==(const type_info& __arg) const
36351 {
36352 return ((__name == __arg.__name)
36353 || (__name[0] != '*' &&
36354 __builtin_strcmp (__name, __arg.__name) == 0));
36355 }
36356 bool operator!=(const type_info& __arg) const
36357 { return !operator==(__arg); }
36358 virtual bool __is_pointer_p() const;
36359 virtual bool __is_function_p() const;
36360 virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
36361 unsigned __outer) const;
36362 virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
36363 void **__obj_ptr) const;
36364 protected:
36365 const char *__name;
36366 explicit type_info(const char *__n): __name(__n) { }
36367 private:
36368 type_info& operator=(const type_info&);
36369 type_info(const type_info&);
36370 };
36371 class bad_cast : public exception
36372 {
36373 public:
36374 bad_cast() throw() { }
36375 virtual ~bad_cast() throw();
36376 virtual const char* what() const throw();
36377 };
36378 class bad_typeid : public exception
36379 {
36380 public:
36381 bad_typeid () throw() { }
36382 virtual ~bad_typeid() throw();
36383 virtual const char* what() const throw();
36384 };
36385 }
36386 }
36387 namespace boost
36388 {
36389 namespace detail
36390 {
36391 typedef std::type_info sp_typeinfo;
36392 }
36393 }
36394
36395
36396
36397 namespace std __attribute__ ((__visibility__ ("default"))) {
36398 enum float_round_style
36399 {
36400 round_indeterminate = -1,
36401 round_toward_zero = 0,
36402 round_to_nearest = 1,
36403 round_toward_infinity = 2,
36404 round_toward_neg_infinity = 3
36405 };
36406 enum float_denorm_style
36407 {
36408 denorm_indeterminate = -1,
36409 denorm_absent = 0,
36410 denorm_present = 1
36411 };
36412 struct __numeric_limits_base
36413 {
36414 static const bool is_specialized = false;
36415 static const int digits = 0;
36416 static const int digits10 = 0;
36417 static const bool is_signed = false;
36418 static const bool is_integer = false;
36419 static const bool is_exact = false;
36420 static const int radix = 0;
36421 static const int min_exponent = 0;
36422 static const int min_exponent10 = 0;
36423 static const int max_exponent = 0;
36424 static const int max_exponent10 = 0;
36425 static const bool has_infinity = false;
36426 static const bool has_quiet_NaN = false;
36427 static const bool has_signaling_NaN = false;
36428 static const float_denorm_style has_denorm = denorm_absent;
36429 static const bool has_denorm_loss = false;
36430 static const bool is_iec559 = false;
36431 static const bool is_bounded = false;
36432 static const bool is_modulo = false;
36433 static const bool traps = false;
36434 static const bool tinyness_before = false;
36435 static const float_round_style round_style = round_toward_zero;
36436 };
36437 template<typename _Tp>
36438 struct numeric_limits : public __numeric_limits_base
36439 {
36440 static _Tp min() throw() { return static_cast<_Tp>(0); }
36441 static _Tp max() throw() { return static_cast<_Tp>(0); }
36442 static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
36443 static _Tp round_error() throw() { return static_cast<_Tp>(0); }
36444 static _Tp infinity() throw() { return static_cast<_Tp>(0); }
36445 static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
36446 static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
36447 static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
36448 };
36449 template<>
36450 struct numeric_limits<bool>
36451 {
36452 static const bool is_specialized = true;
36453 static bool min() throw()
36454 { return false; }
36455 static bool max() throw()
36456 { return true; }
36457 static const int digits = 1;
36458 static const int digits10 = 0;
36459 static const bool is_signed = false;
36460 static const bool is_integer = true;
36461 static const bool is_exact = true;
36462 static const int radix = 2;
36463 static bool epsilon() throw()
36464 { return false; }
36465 static bool round_error() throw()
36466 { return false; }
36467 static const int min_exponent = 0;
36468 static const int min_exponent10 = 0;
36469 static const int max_exponent = 0;
36470 static const int max_exponent10 = 0;
36471 static const bool has_infinity = false;
36472 static const bool has_quiet_NaN = false;
36473 static const bool has_signaling_NaN = false;
36474 static const float_denorm_style has_denorm = denorm_absent;
36475 static const bool has_denorm_loss = false;
36476 static bool infinity() throw()
36477 { return false; }
36478 static bool quiet_NaN() throw()
36479 { return false; }
36480 static bool signaling_NaN() throw()
36481 { return false; }
36482 static bool denorm_min() throw()
36483 { return false; }
36484 static const bool is_iec559 = false;
36485 static const bool is_bounded = true;
36486 static const bool is_modulo = false;
36487 static const bool traps = true;
36488 static const bool tinyness_before = false;
36489 static const float_round_style round_style = round_toward_zero;
36490 };
36491 template<>
36492 struct numeric_limits<char>
36493 {
36494 static const bool is_specialized = true;
36495 static char min() throw()
36496 { return (((char)(-1) < 0) ? (char)1 << (sizeof(char) * 8 - ((char)(-1) < 0)) : (char)0); }
36497 static char max() throw()
36498 { return (((char)(-1) < 0) ? (((((char)1 << ((sizeof(char) * 8 - ((char)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char)0); }
36499 static const int digits = (sizeof(char) * 8 - ((char)(-1) < 0));
36500 static const int digits10 = ((sizeof(char) * 8 - ((char)(-1) < 0)) * 643 / 2136);
36501 static const bool is_signed = ((char)(-1) < 0);
36502 static const bool is_integer = true;
36503 static const bool is_exact = true;
36504 static const int radix = 2;
36505 static char epsilon() throw()
36506 { return 0; }
36507 static char round_error() throw()
36508 { return 0; }
36509 static const int min_exponent = 0;
36510 static const int min_exponent10 = 0;
36511 static const int max_exponent = 0;
36512 static const int max_exponent10 = 0;
36513 static const bool has_infinity = false;
36514 static const bool has_quiet_NaN = false;
36515 static const bool has_signaling_NaN = false;
36516 static const float_denorm_style has_denorm = denorm_absent;
36517 static const bool has_denorm_loss = false;
36518 static char infinity() throw()
36519 { return char(); }
36520 static char quiet_NaN() throw()
36521 { return char(); }
36522 static char signaling_NaN() throw()
36523 { return char(); }
36524 static char denorm_min() throw()
36525 { return static_cast<char>(0); }
36526 static const bool is_iec559 = false;
36527 static const bool is_bounded = true;
36528 static const bool is_modulo = true;
36529 static const bool traps = true;
36530 static const bool tinyness_before = false;
36531 static const float_round_style round_style = round_toward_zero;
36532 };
36533 template<>
36534 struct numeric_limits<signed char>
36535 {
36536 static const bool is_specialized = true;
36537 static signed char min() throw()
36538 { return -127 - 1; }
36539 static signed char max() throw()
36540 { return 127; }
36541 static const int digits = (sizeof(signed char) * 8 - ((signed char)(-1) < 0));
36542 static const int digits10 = ((sizeof(signed char) * 8 - ((signed char)(-1) < 0)) * 643 / 2136);
36543 static const bool is_signed = true;
36544 static const bool is_integer = true;
36545 static const bool is_exact = true;
36546 static const int radix = 2;
36547 static signed char epsilon() throw()
36548 { return 0; }
36549 static signed char round_error() throw()
36550 { return 0; }
36551 static const int min_exponent = 0;
36552 static const int min_exponent10 = 0;
36553 static const int max_exponent = 0;
36554 static const int max_exponent10 = 0;
36555 static const bool has_infinity = false;
36556 static const bool has_quiet_NaN = false;
36557 static const bool has_signaling_NaN = false;
36558 static const float_denorm_style has_denorm = denorm_absent;
36559 static const bool has_denorm_loss = false;
36560 static signed char infinity() throw()
36561 { return static_cast<signed char>(0); }
36562 static signed char quiet_NaN() throw()
36563 { return static_cast<signed char>(0); }
36564 static signed char signaling_NaN() throw()
36565 { return static_cast<signed char>(0); }
36566 static signed char denorm_min() throw()
36567 { return static_cast<signed char>(0); }
36568 static const bool is_iec559 = false;
36569 static const bool is_bounded = true;
36570 static const bool is_modulo = true;
36571 static const bool traps = true;
36572 static const bool tinyness_before = false;
36573 static const float_round_style round_style = round_toward_zero;
36574 };
36575 template<>
36576 struct numeric_limits<unsigned char>
36577 {
36578 static const bool is_specialized = true;
36579 static unsigned char min() throw()
36580 { return 0; }
36581 static unsigned char max() throw()
36582 { return 127 * 2U + 1; }
36583 static const int digits = (sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0));
36584 static const int digits10 = ((sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0)) * 643 / 2136);
36585 static const bool is_signed = false;
36586 static const bool is_integer = true;
36587 static const bool is_exact = true;
36588 static const int radix = 2;
36589 static unsigned char epsilon() throw()
36590 { return 0; }
36591 static unsigned char round_error() throw()
36592 { return 0; }
36593 static const int min_exponent = 0;
36594 static const int min_exponent10 = 0;
36595 static const int max_exponent = 0;
36596 static const int max_exponent10 = 0;
36597 static const bool has_infinity = false;
36598 static const bool has_quiet_NaN = false;
36599 static const bool has_signaling_NaN = false;
36600 static const float_denorm_style has_denorm = denorm_absent;
36601 static const bool has_denorm_loss = false;
36602 static unsigned char infinity() throw()
36603 { return static_cast<unsigned char>(0); }
36604 static unsigned char quiet_NaN() throw()
36605 { return static_cast<unsigned char>(0); }
36606 static unsigned char signaling_NaN() throw()
36607 { return static_cast<unsigned char>(0); }
36608 static unsigned char denorm_min() throw()
36609 { return static_cast<unsigned char>(0); }
36610 static const bool is_iec559 = false;
36611 static const bool is_bounded = true;
36612 static const bool is_modulo = true;
36613 static const bool traps = true;
36614 static const bool tinyness_before = false;
36615 static const float_round_style round_style = round_toward_zero;
36616 };
36617 template<>
36618 struct numeric_limits<wchar_t>
36619 {
36620 static const bool is_specialized = true;
36621 static wchar_t min() throw()
36622 { return (((wchar_t)(-1) < 0) ? (wchar_t)1 << (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) : (wchar_t)0); }
36623 static wchar_t max() throw()
36624 { return (((wchar_t)(-1) < 0) ? (((((wchar_t)1 << ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(wchar_t)0); }
36625 static const int digits = (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0));
36626 static const int digits10 = ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) * 643 / 2136);
36627 static const bool is_signed = ((wchar_t)(-1) < 0);
36628 static const bool is_integer = true;
36629 static const bool is_exact = true;
36630 static const int radix = 2;
36631 static wchar_t epsilon() throw()
36632 { return 0; }
36633 static wchar_t round_error() throw()
36634 { return 0; }
36635 static const int min_exponent = 0;
36636 static const int min_exponent10 = 0;
36637 static const int max_exponent = 0;
36638 static const int max_exponent10 = 0;
36639 static const bool has_infinity = false;
36640 static const bool has_quiet_NaN = false;
36641 static const bool has_signaling_NaN = false;
36642 static const float_denorm_style has_denorm = denorm_absent;
36643 static const bool has_denorm_loss = false;
36644 static wchar_t infinity() throw()
36645 { return wchar_t(); }
36646 static wchar_t quiet_NaN() throw()
36647 { return wchar_t(); }
36648 static wchar_t signaling_NaN() throw()
36649 { return wchar_t(); }
36650 static wchar_t denorm_min() throw()
36651 { return wchar_t(); }
36652 static const bool is_iec559 = false;
36653 static const bool is_bounded = true;
36654 static const bool is_modulo = true;
36655 static const bool traps = true;
36656 static const bool tinyness_before = false;
36657 static const float_round_style round_style = round_toward_zero;
36658 };
36659 template<>
36660 struct numeric_limits<short>
36661 {
36662 static const bool is_specialized = true;
36663 static short min() throw()
36664 { return -32767 - 1; }
36665 static short max() throw()
36666 { return 32767; }
36667 static const int digits = (sizeof(short) * 8 - ((short)(-1) < 0));
36668 static const int digits10 = ((sizeof(short) * 8 - ((short)(-1) < 0)) * 643 / 2136);
36669 static const bool is_signed = true;
36670 static const bool is_integer = true;
36671 static const bool is_exact = true;
36672 static const int radix = 2;
36673 static short epsilon() throw()
36674 { return 0; }
36675 static short round_error() throw()
36676 { return 0; }
36677 static const int min_exponent = 0;
36678 static const int min_exponent10 = 0;
36679 static const int max_exponent = 0;
36680 static const int max_exponent10 = 0;
36681 static const bool has_infinity = false;
36682 static const bool has_quiet_NaN = false;
36683 static const bool has_signaling_NaN = false;
36684 static const float_denorm_style has_denorm = denorm_absent;
36685 static const bool has_denorm_loss = false;
36686 static short infinity() throw()
36687 { return short(); }
36688 static short quiet_NaN() throw()
36689 { return short(); }
36690 static short signaling_NaN() throw()
36691 { return short(); }
36692 static short denorm_min() throw()
36693 { return short(); }
36694 static const bool is_iec559 = false;
36695 static const bool is_bounded = true;
36696 static const bool is_modulo = true;
36697 static const bool traps = true;
36698 static const bool tinyness_before = false;
36699 static const float_round_style round_style = round_toward_zero;
36700 };
36701 template<>
36702 struct numeric_limits<unsigned short>
36703 {
36704 static const bool is_specialized = true;
36705 static unsigned short min() throw()
36706 { return 0; }
36707 static unsigned short max() throw()
36708 { return 32767 * 2U + 1; }
36709 static const int digits = (sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0));
36710 static const int digits10 = ((sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0)) * 643 / 2136);
36711 static const bool is_signed = false;
36712 static const bool is_integer = true;
36713 static const bool is_exact = true;
36714 static const int radix = 2;
36715 static unsigned short epsilon() throw()
36716 { return 0; }
36717 static unsigned short round_error() throw()
36718 { return 0; }
36719 static const int min_exponent = 0;
36720 static const int min_exponent10 = 0;
36721 static const int max_exponent = 0;
36722 static const int max_exponent10 = 0;
36723 static const bool has_infinity = false;
36724 static const bool has_quiet_NaN = false;
36725 static const bool has_signaling_NaN = false;
36726 static const float_denorm_style has_denorm = denorm_absent;
36727 static const bool has_denorm_loss = false;
36728 static unsigned short infinity() throw()
36729 { return static_cast<unsigned short>(0); }
36730 static unsigned short quiet_NaN() throw()
36731 { return static_cast<unsigned short>(0); }
36732 static unsigned short signaling_NaN() throw()
36733 { return static_cast<unsigned short>(0); }
36734 static unsigned short denorm_min() throw()
36735 { return static_cast<unsigned short>(0); }
36736 static const bool is_iec559 = false;
36737 static const bool is_bounded = true;
36738 static const bool is_modulo = true;
36739 static const bool traps = true;
36740 static const bool tinyness_before = false;
36741 static const float_round_style round_style = round_toward_zero;
36742 };
36743 template<>
36744 struct numeric_limits<int>
36745 {
36746 static const bool is_specialized = true;
36747 static int min() throw()
36748 { return -2147483647 - 1; }
36749 static int max() throw()
36750 { return 2147483647; }
36751 static const int digits = (sizeof(int) * 8 - ((int)(-1) < 0));
36752 static const int digits10 = ((sizeof(int) * 8 - ((int)(-1) < 0)) * 643 / 2136);
36753 static const bool is_signed = true;
36754 static const bool is_integer = true;
36755 static const bool is_exact = true;
36756 static const int radix = 2;
36757 static int epsilon() throw()
36758 { return 0; }
36759 static int round_error() throw()
36760 { return 0; }
36761 static const int min_exponent = 0;
36762 static const int min_exponent10 = 0;
36763 static const int max_exponent = 0;
36764 static const int max_exponent10 = 0;
36765 static const bool has_infinity = false;
36766 static const bool has_quiet_NaN = false;
36767 static const bool has_signaling_NaN = false;
36768 static const float_denorm_style has_denorm = denorm_absent;
36769 static const bool has_denorm_loss = false;
36770 static int infinity() throw()
36771 { return static_cast<int>(0); }
36772 static int quiet_NaN() throw()
36773 { return static_cast<int>(0); }
36774 static int signaling_NaN() throw()
36775 { return static_cast<int>(0); }
36776 static int denorm_min() throw()
36777 { return static_cast<int>(0); }
36778 static const bool is_iec559 = false;
36779 static const bool is_bounded = true;
36780 static const bool is_modulo = true;
36781 static const bool traps = true;
36782 static const bool tinyness_before = false;
36783 static const float_round_style round_style = round_toward_zero;
36784 };
36785 template<>
36786 struct numeric_limits<unsigned int>
36787 {
36788 static const bool is_specialized = true;
36789 static unsigned int min() throw()
36790 { return 0; }
36791 static unsigned int max() throw()
36792 { return 2147483647 * 2U + 1; }
36793 static const int digits = (sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0));
36794 static const int digits10 = ((sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)) * 643 / 2136);
36795 static const bool is_signed = false;
36796 static const bool is_integer = true;
36797 static const bool is_exact = true;
36798 static const int radix = 2;
36799 static unsigned int epsilon() throw()
36800 { return 0; }
36801 static unsigned int round_error() throw()
36802 { return 0; }
36803 static const int min_exponent = 0;
36804 static const int min_exponent10 = 0;
36805 static const int max_exponent = 0;
36806 static const int max_exponent10 = 0;
36807 static const bool has_infinity = false;
36808 static const bool has_quiet_NaN = false;
36809 static const bool has_signaling_NaN = false;
36810 static const float_denorm_style has_denorm = denorm_absent;
36811 static const bool has_denorm_loss = false;
36812 static unsigned int infinity() throw()
36813 { return static_cast<unsigned int>(0); }
36814 static unsigned int quiet_NaN() throw()
36815 { return static_cast<unsigned int>(0); }
36816 static unsigned int signaling_NaN() throw()
36817 { return static_cast<unsigned int>(0); }
36818 static unsigned int denorm_min() throw()
36819 { return static_cast<unsigned int>(0); }
36820 static const bool is_iec559 = false;
36821 static const bool is_bounded = true;
36822 static const bool is_modulo = true;
36823 static const bool traps = true;
36824 static const bool tinyness_before = false;
36825 static const float_round_style round_style = round_toward_zero;
36826 };
36827 template<>
36828 struct numeric_limits<long>
36829 {
36830 static const bool is_specialized = true;
36831 static long min() throw()
36832 { return -9223372036854775807L - 1; }
36833 static long max() throw()
36834 { return 9223372036854775807L; }
36835 static const int digits = (sizeof(long) * 8 - ((long)(-1) < 0));
36836 static const int digits10 = ((sizeof(long) * 8 - ((long)(-1) < 0)) * 643 / 2136);
36837 static const bool is_signed = true;
36838 static const bool is_integer = true;
36839 static const bool is_exact = true;
36840 static const int radix = 2;
36841 static long epsilon() throw()
36842 { return 0; }
36843 static long round_error() throw()
36844 { return 0; }
36845 static const int min_exponent = 0;
36846 static const int min_exponent10 = 0;
36847 static const int max_exponent = 0;
36848 static const int max_exponent10 = 0;
36849 static const bool has_infinity = false;
36850 static const bool has_quiet_NaN = false;
36851 static const bool has_signaling_NaN = false;
36852 static const float_denorm_style has_denorm = denorm_absent;
36853 static const bool has_denorm_loss = false;
36854 static long infinity() throw()
36855 { return static_cast<long>(0); }
36856 static long quiet_NaN() throw()
36857 { return static_cast<long>(0); }
36858 static long signaling_NaN() throw()
36859 { return static_cast<long>(0); }
36860 static long denorm_min() throw()
36861 { return static_cast<long>(0); }
36862 static const bool is_iec559 = false;
36863 static const bool is_bounded = true;
36864 static const bool is_modulo = true;
36865 static const bool traps = true;
36866 static const bool tinyness_before = false;
36867 static const float_round_style round_style = round_toward_zero;
36868 };
36869 template<>
36870 struct numeric_limits<unsigned long>
36871 {
36872 static const bool is_specialized = true;
36873 static unsigned long min() throw()
36874 { return 0; }
36875 static unsigned long max() throw()
36876 { return 9223372036854775807L * 2UL + 1; }
36877 static const int digits = (sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0));
36878 static const int digits10 = ((sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0)) * 643 / 2136);
36879 static const bool is_signed = false;
36880 static const bool is_integer = true;
36881 static const bool is_exact = true;
36882 static const int radix = 2;
36883 static unsigned long epsilon() throw()
36884 { return 0; }
36885 static unsigned long round_error() throw()
36886 { return 0; }
36887 static const int min_exponent = 0;
36888 static const int min_exponent10 = 0;
36889 static const int max_exponent = 0;
36890 static const int max_exponent10 = 0;
36891 static const bool has_infinity = false;
36892 static const bool has_quiet_NaN = false;
36893 static const bool has_signaling_NaN = false;
36894 static const float_denorm_style has_denorm = denorm_absent;
36895 static const bool has_denorm_loss = false;
36896 static unsigned long infinity() throw()
36897 { return static_cast<unsigned long>(0); }
36898 static unsigned long quiet_NaN() throw()
36899 { return static_cast<unsigned long>(0); }
36900 static unsigned long signaling_NaN() throw()
36901 { return static_cast<unsigned long>(0); }
36902 static unsigned long denorm_min() throw()
36903 { return static_cast<unsigned long>(0); }
36904 static const bool is_iec559 = false;
36905 static const bool is_bounded = true;
36906 static const bool is_modulo = true;
36907 static const bool traps = true;
36908 static const bool tinyness_before = false;
36909 static const float_round_style round_style = round_toward_zero;
36910 };
36911 template<>
36912 struct numeric_limits<long long>
36913 {
36914 static const bool is_specialized = true;
36915 static long long min() throw()
36916 { return -9223372036854775807LL - 1; }
36917 static long long max() throw()
36918 { return 9223372036854775807LL; }
36919 static const int digits = (sizeof(long long) * 8 - ((long long)(-1) < 0));
36920 static const int digits10 = ((sizeof(long long) * 8 - ((long long)(-1) < 0)) * 643 / 2136);
36921 static const bool is_signed = true;
36922 static const bool is_integer = true;
36923 static const bool is_exact = true;
36924 static const int radix = 2;
36925 static long long epsilon() throw()
36926 { return 0; }
36927 static long long round_error() throw()
36928 { return 0; }
36929 static const int min_exponent = 0;
36930 static const int min_exponent10 = 0;
36931 static const int max_exponent = 0;
36932 static const int max_exponent10 = 0;
36933 static const bool has_infinity = false;
36934 static const bool has_quiet_NaN = false;
36935 static const bool has_signaling_NaN = false;
36936 static const float_denorm_style has_denorm = denorm_absent;
36937 static const bool has_denorm_loss = false;
36938 static long long infinity() throw()
36939 { return static_cast<long long>(0); }
36940 static long long quiet_NaN() throw()
36941 { return static_cast<long long>(0); }
36942 static long long signaling_NaN() throw()
36943 { return static_cast<long long>(0); }
36944 static long long denorm_min() throw()
36945 { return static_cast<long long>(0); }
36946 static const bool is_iec559 = false;
36947 static const bool is_bounded = true;
36948 static const bool is_modulo = true;
36949 static const bool traps = true;
36950 static const bool tinyness_before = false;
36951 static const float_round_style round_style = round_toward_zero;
36952 };
36953 template<>
36954 struct numeric_limits<unsigned long long>
36955 {
36956 static const bool is_specialized = true;
36957 static unsigned long long min() throw()
36958 { return 0; }
36959 static unsigned long long max() throw()
36960 { return 9223372036854775807LL * 2ULL + 1; }
36961 static const int digits = (sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0));
36962 static const int digits10 = ((sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0)) * 643 / 2136);
36963 static const bool is_signed = false;
36964 static const bool is_integer = true;
36965 static const bool is_exact = true;
36966 static const int radix = 2;
36967 static unsigned long long epsilon() throw()
36968 { return 0; }
36969 static unsigned long long round_error() throw()
36970 { return 0; }
36971 static const int min_exponent = 0;
36972 static const int min_exponent10 = 0;
36973 static const int max_exponent = 0;
36974 static const int max_exponent10 = 0;
36975 static const bool has_infinity = false;
36976 static const bool has_quiet_NaN = false;
36977 static const bool has_signaling_NaN = false;
36978 static const float_denorm_style has_denorm = denorm_absent;
36979 static const bool has_denorm_loss = false;
36980 static unsigned long long infinity() throw()
36981 { return static_cast<unsigned long long>(0); }
36982 static unsigned long long quiet_NaN() throw()
36983 { return static_cast<unsigned long long>(0); }
36984 static unsigned long long signaling_NaN() throw()
36985 { return static_cast<unsigned long long>(0); }
36986 static unsigned long long denorm_min() throw()
36987 { return static_cast<unsigned long long>(0); }
36988 static const bool is_iec559 = false;
36989 static const bool is_bounded = true;
36990 static const bool is_modulo = true;
36991 static const bool traps = true;
36992 static const bool tinyness_before = false;
36993 static const float_round_style round_style = round_toward_zero;
36994 };
36995 template<>
36996 struct numeric_limits<float>
36997 {
36998 static const bool is_specialized = true;
36999 static float min() throw()
37000 { return 1.17549435082228750797e-38F; }
37001 static float max() throw()
37002 { return 3.40282346638528859812e+38F; }
37003 static const int digits = 24;
37004 static const int digits10 = 6;
37005 static const bool is_signed = true;
37006 static const bool is_integer = false;
37007 static const bool is_exact = false;
37008 static const int radix = 2;
37009 static float epsilon() throw()
37010 { return 1.19209289550781250000e-7F; }
37011 static float round_error() throw()
37012 { return 0.5F; }
37013 static const int min_exponent = (-125);
37014 static const int min_exponent10 = (-37);
37015 static const int max_exponent = 128;
37016 static const int max_exponent10 = 38;
37017 static const bool has_infinity = 1;
37018 static const bool has_quiet_NaN = 1;
37019 static const bool has_signaling_NaN = has_quiet_NaN;
37020 static const float_denorm_style has_denorm
37021 = bool(1) ? denorm_present : denorm_absent;
37022 static const bool has_denorm_loss = false;
37023 static float infinity() throw()
37024 { return __builtin_huge_valf (); }
37025 static float quiet_NaN() throw()
37026 { return __builtin_nanf (""); }
37027 static float signaling_NaN() throw()
37028 { return __builtin_nansf (""); }
37029 static float denorm_min() throw()
37030 { return 1.40129846432481707092e-45F; }
37031 static const bool is_iec559
37032 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
37033 static const bool is_bounded = true;
37034 static const bool is_modulo = false;
37035 static const bool traps = false;
37036 static const bool tinyness_before = false;
37037 static const float_round_style round_style = round_to_nearest;
37038 };
37039 template<>
37040 struct numeric_limits<double>
37041 {
37042 static const bool is_specialized = true;
37043 static double min() throw()
37044 { return ((double)2.22507385850720138309e-308L); }
37045 static double max() throw()
37046 { return ((double)1.79769313486231570815e+308L); }
37047 static const int digits = 53;
37048 static const int digits10 = 15;
37049 static const bool is_signed = true;
37050 static const bool is_integer = false;
37051 static const bool is_exact = false;
37052 static const int radix = 2;
37053 static double epsilon() throw()
37054 { return ((double)2.22044604925031308085e-16L); }
37055 static double round_error() throw()
37056 { return 0.5; }
37057 static const int min_exponent = (-1021);
37058 static const int min_exponent10 = (-307);
37059 static const int max_exponent = 1024;
37060 static const int max_exponent10 = 308;
37061 static const bool has_infinity = 1;
37062 static const bool has_quiet_NaN = 1;
37063 static const bool has_signaling_NaN = has_quiet_NaN;
37064 static const float_denorm_style has_denorm
37065 = bool(1) ? denorm_present : denorm_absent;
37066 static const bool has_denorm_loss = false;
37067 static double infinity() throw()
37068 { return __builtin_huge_val(); }
37069 static double quiet_NaN() throw()
37070 { return __builtin_nan (""); }
37071 static double signaling_NaN() throw()
37072 { return __builtin_nans (""); }
37073 static double denorm_min() throw()
37074 { return ((double)4.94065645841246544177e-324L); }
37075 static const bool is_iec559
37076 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
37077 static const bool is_bounded = true;
37078 static const bool is_modulo = false;
37079 static const bool traps = false;
37080 static const bool tinyness_before = false;
37081 static const float_round_style round_style = round_to_nearest;
37082 };
37083 template<>
37084 struct numeric_limits<long double>
37085 {
37086 static const bool is_specialized = true;
37087 static long double min() throw()
37088 { return 3.36210314311209350626e-4932L; }
37089 static long double max() throw()
37090 { return 1.18973149535723176502e+4932L; }
37091 static const int digits = 64;
37092 static const int digits10 = 18;
37093 static const bool is_signed = true;
37094 static const bool is_integer = false;
37095 static const bool is_exact = false;
37096 static const int radix = 2;
37097 static long double epsilon() throw()
37098 { return 1.08420217248550443401e-19L; }
37099 static long double round_error() throw()
37100 { return 0.5L; }
37101 static const int min_exponent = (-16381);
37102 static const int min_exponent10 = (-4931);
37103 static const int max_exponent = 16384;
37104 static const int max_exponent10 = 4932;
37105 static const bool has_infinity = 1;
37106 static const bool has_quiet_NaN = 1;
37107 static const bool has_signaling_NaN = has_quiet_NaN;
37108 static const float_denorm_style has_denorm
37109 = bool(1) ? denorm_present : denorm_absent;
37110 static const bool has_denorm_loss
37111 = false;
37112 static long double infinity() throw()
37113 { return __builtin_huge_vall (); }
37114 static long double quiet_NaN() throw()
37115 { return __builtin_nanl (""); }
37116 static long double signaling_NaN() throw()
37117 { return __builtin_nansl (""); }
37118 static long double denorm_min() throw()
37119 { return 3.64519953188247460253e-4951L; }
37120 static const bool is_iec559
37121 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
37122 static const bool is_bounded = true;
37123 static const bool is_modulo = false;
37124 static const bool traps = false;
37125 static const bool tinyness_before = false;
37126 static const float_round_style round_style = round_to_nearest;
37127 };
37128 }
37129 namespace boost
37130 {
37131 using ::int8_t;
37132 using ::int_least8_t;
37133 using ::int_fast8_t;
37134 using ::uint8_t;
37135 using ::uint_least8_t;
37136 using ::uint_fast8_t;
37137 using ::int16_t;
37138 using ::int_least16_t;
37139 using ::int_fast16_t;
37140 using ::uint16_t;
37141 using ::uint_least16_t;
37142 using ::uint_fast16_t;
37143 using ::int32_t;
37144 using ::int_least32_t;
37145 using ::int_fast32_t;
37146 using ::uint32_t;
37147 using ::uint_least32_t;
37148 using ::uint_fast32_t;
37149 using ::int64_t;
37150 using ::int_least64_t;
37151 using ::int_fast64_t;
37152 using ::uint64_t;
37153 using ::uint_least64_t;
37154 using ::uint_fast64_t;
37155 using ::intmax_t;
37156 using ::uintmax_t;
37157 }
37158 namespace boost
37159 {
37160 typedef boost::uintmax_t static_min_max_unsigned_type;
37161 typedef boost::intmax_t static_min_max_signed_type;
37162 typedef boost::uintmax_t static_log2_argument_type;
37163 typedef int static_log2_result_type;
37164 template < class T >
37165 class integer_traits;
37166 template < >
37167 class integer_traits< bool >;
37168 template < >
37169 class integer_traits< char >;
37170 template < >
37171 class integer_traits< signed char >;
37172 template < >
37173 class integer_traits< unsigned char >;
37174 template < >
37175 class integer_traits< wchar_t >;
37176 template < >
37177 class integer_traits< short >;
37178 template < >
37179 class integer_traits< unsigned short >;
37180 template < >
37181 class integer_traits< int >;
37182 template < >
37183 class integer_traits< unsigned int >;
37184 template < >
37185 class integer_traits< long >;
37186 template < >
37187 class integer_traits< unsigned long >;
37188 template < >
37189 class integer_traits< ::boost::long_long_type>;
37190 template < >
37191 class integer_traits< ::boost::ulong_long_type >;
37192 template < typename LeastInt >
37193 struct int_fast_t;
37194 template< int Bits >
37195 struct int_t;
37196 template< int Bits >
37197 struct uint_t;
37198 template< boost::long_long_type MaxValue >
37199 struct int_max_value_t;
37200 template< boost::long_long_type MinValue >
37201 struct int_min_value_t;
37202 template< boost::ulong_long_type MaxValue >
37203 struct uint_value_t;
37204 template < std::size_t Bit >
37205 struct high_bit_mask_t;
37206 template < std::size_t Bits >
37207 struct low_bits_mask_t;
37208 template < >
37209 struct low_bits_mask_t< ::std::numeric_limits<unsigned char>::digits >;
37210 template < >
37211 struct low_bits_mask_t< ::std::numeric_limits<unsigned short>::digits >;
37212 template < >
37213 struct low_bits_mask_t< ::std::numeric_limits<unsigned int>::digits >;
37214 template < >
37215 struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >;
37216 template <static_log2_argument_type Value >
37217 struct static_log2;
37218 template <> struct static_log2<0u>;
37219 template <static_min_max_signed_type Value1, static_min_max_signed_type Value2>
37220 struct static_signed_min;
37221 template <static_min_max_signed_type Value1, static_min_max_signed_type Value2>
37222 struct static_signed_max;
37223 template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
37224 struct static_unsigned_min;
37225 template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
37226 struct static_unsigned_max;
37227 }
37228
37229 namespace boost {
37230 template<class T>
37231 class integer_traits : public std::numeric_limits<T>
37232 {
37233 public:
37234 static const bool is_integral = false;
37235 };
37236 namespace detail {
37237 template<class T, T min_val, T max_val>
37238 class integer_traits_base
37239 {
37240 public:
37241 static const bool is_integral = true;
37242 static const T const_min = min_val;
37243 static const T const_max = max_val;
37244 };
37245 template<class T, T min_val, T max_val>
37246 const bool integer_traits_base<T, min_val, max_val>::is_integral;
37247 template<class T, T min_val, T max_val>
37248 const T integer_traits_base<T, min_val, max_val>::const_min;
37249 template<class T, T min_val, T max_val>
37250 const T integer_traits_base<T, min_val, max_val>::const_max;
37251 }
37252 template<>
37253 class integer_traits<bool>
37254 : public std::numeric_limits<bool>,
37255 public detail::integer_traits_base<bool, false, true>
37256 { };
37257 template<>
37258 class integer_traits<char>
37259 : public std::numeric_limits<char>,
37260 public detail::integer_traits_base<char, (-127 - 1), 127>
37261 { };
37262 template<>
37263 class integer_traits<signed char>
37264 : public std::numeric_limits<signed char>,
37265 public detail::integer_traits_base<signed char, (-127 - 1), 127>
37266 { };
37267 template<>
37268 class integer_traits<unsigned char>
37269 : public std::numeric_limits<unsigned char>,
37270 public detail::integer_traits_base<unsigned char, 0, (127 * 2 + 1)>
37271 { };
37272 template<>
37273 class integer_traits<wchar_t>
37274 : public std::numeric_limits<wchar_t>,
37275 public detail::integer_traits_base<wchar_t, (-2147483647 - 1), (2147483647)>
37276 { };
37277 template<>
37278 class integer_traits<short>
37279 : public std::numeric_limits<short>,
37280 public detail::integer_traits_base<short, (-32767 - 1), 32767>
37281 { };
37282 template<>
37283 class integer_traits<unsigned short>
37284 : public std::numeric_limits<unsigned short>,
37285 public detail::integer_traits_base<unsigned short, 0, (32767 * 2 + 1)>
37286 { };
37287 template<>
37288 class integer_traits<int>
37289 : public std::numeric_limits<int>,
37290 public detail::integer_traits_base<int, (-2147483647 - 1), 2147483647>
37291 { };
37292 template<>
37293 class integer_traits<unsigned int>
37294 : public std::numeric_limits<unsigned int>,
37295 public detail::integer_traits_base<unsigned int, 0, (2147483647 * 2U + 1U)>
37296 { };
37297 template<>
37298 class integer_traits<long>
37299 : public std::numeric_limits<long>,
37300 public detail::integer_traits_base<long, (-9223372036854775807L - 1L), 9223372036854775807L>
37301 { };
37302 template<>
37303 class integer_traits<unsigned long>
37304 : public std::numeric_limits<unsigned long>,
37305 public detail::integer_traits_base<unsigned long, 0, (9223372036854775807L * 2UL + 1UL)>
37306 { };
37307 template<>
37308 class integer_traits< ::boost::long_long_type>
37309 : public std::numeric_limits< ::boost::long_long_type>,
37310 public detail::integer_traits_base< ::boost::long_long_type, (-9223372036854775807LL -1), 9223372036854775807LL>
37311 { };
37312 template<>
37313 class integer_traits< ::boost::ulong_long_type>
37314 : public std::numeric_limits< ::boost::ulong_long_type>,
37315 public detail::integer_traits_base< ::boost::ulong_long_type, 0, (9223372036854775807LL * 2ULL + 1)>
37316 { };
37317 }
37318
37319 namespace boost
37320 {
37321 template< typename LeastInt >
37322 struct int_fast_t
37323 {
37324 typedef LeastInt fast;
37325 typedef fast type;
37326 };
37327 namespace detail{
37328 template< int Category > struct int_least_helper {};
37329 template<> struct int_least_helper<1> { typedef boost::long_long_type least; };
37330 template<> struct int_least_helper<2> { typedef long least; };
37331 template<> struct int_least_helper<3> { typedef int least; };
37332 template<> struct int_least_helper<4> { typedef short least; };
37333 template<> struct int_least_helper<5> { typedef signed char least; };
37334 template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; };
37335 template<> struct int_least_helper<7> { typedef unsigned long least; };
37336 template<> struct int_least_helper<8> { typedef unsigned int least; };
37337 template<> struct int_least_helper<9> { typedef unsigned short least; };
37338 template<> struct int_least_helper<10> { typedef unsigned char least; };
37339 template <int Bits>
37340 struct exact_signed_base_helper{};
37341 template <int Bits>
37342 struct exact_unsigned_base_helper{};
37343 template <> struct exact_signed_base_helper<sizeof(signed char)* 8> { typedef signed char exact; };
37344 template <> struct exact_unsigned_base_helper<sizeof(unsigned char)* 8> { typedef unsigned char exact; };
37345 template <> struct exact_signed_base_helper<sizeof(short)* 8> { typedef short exact; };
37346 template <> struct exact_unsigned_base_helper<sizeof(unsigned short)* 8> { typedef unsigned short exact; };
37347 template <> struct exact_signed_base_helper<sizeof(int)* 8> { typedef int exact; };
37348 template <> struct exact_unsigned_base_helper<sizeof(unsigned int)* 8> { typedef unsigned int exact; };
37349 template <> struct exact_signed_base_helper<sizeof(long)* 8> { typedef long exact; };
37350 template <> struct exact_unsigned_base_helper<sizeof(unsigned long)* 8> { typedef unsigned long exact; };
37351 }
37352 template< int Bits >
37353 struct int_t : public detail::exact_signed_base_helper<Bits>
37354 {
37355 typedef typename detail::int_least_helper
37356 <
37357 (Bits-1 <= (int)(sizeof(boost::long_long_type) * 8)) +
37358 (Bits-1 <= ::std::numeric_limits<long>::digits) +
37359 (Bits-1 <= ::std::numeric_limits<int>::digits) +
37360 (Bits-1 <= ::std::numeric_limits<short>::digits) +
37361 (Bits-1 <= ::std::numeric_limits<signed char>::digits)
37362 >::least least;
37363 typedef typename int_fast_t<least>::type fast;
37364 };
37365 template< int Bits >
37366 struct uint_t : public detail::exact_unsigned_base_helper<Bits>
37367 {
37368 typedef typename detail::int_least_helper
37369 <
37370 5 +
37371 (Bits-1 <= (int)(sizeof(boost::long_long_type) * 8)) +
37372 (Bits <= ::std::numeric_limits<unsigned long>::digits) +
37373 (Bits <= ::std::numeric_limits<unsigned int>::digits) +
37374 (Bits <= ::std::numeric_limits<unsigned short>::digits) +
37375 (Bits <= ::std::numeric_limits<unsigned char>::digits)
37376 >::least least;
37377 typedef typename int_fast_t<least>::type fast;
37378 };
37379 template< boost::long_long_type MaxValue >
37380 struct int_max_value_t
37381 {
37382 typedef typename detail::int_least_helper
37383 <
37384 (MaxValue <= ::boost::integer_traits<boost::long_long_type>::const_max) +
37385 (MaxValue <= ::boost::integer_traits<long>::const_max) +
37386 (MaxValue <= ::boost::integer_traits<int>::const_max) +
37387 (MaxValue <= ::boost::integer_traits<short>::const_max) +
37388 (MaxValue <= ::boost::integer_traits<signed char>::const_max)
37389 >::least least;
37390 typedef typename int_fast_t<least>::type fast;
37391 };
37392 template< boost::long_long_type MinValue >
37393 struct int_min_value_t
37394 {
37395 typedef typename detail::int_least_helper
37396 <
37397 (MinValue >= ::boost::integer_traits<boost::long_long_type>::const_min) +
37398 (MinValue >= ::boost::integer_traits<long>::const_min) +
37399 (MinValue >= ::boost::integer_traits<int>::const_min) +
37400 (MinValue >= ::boost::integer_traits<short>::const_min) +
37401 (MinValue >= ::boost::integer_traits<signed char>::const_min)
37402 >::least least;
37403 typedef typename int_fast_t<least>::type fast;
37404 };
37405 template< boost::ulong_long_type MaxValue >
37406 struct uint_value_t
37407 {
37408 typedef typename detail::int_least_helper
37409 <
37410 5 +
37411 (MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
37412 (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
37413 (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
37414 (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
37415 (MaxValue <= ::boost::integer_traits<unsigned char>::const_max)
37416 >::least least;
37417 typedef typename int_fast_t<least>::type fast;
37418 };
37419 }
37420 namespace boost {
37421 template< typename T > struct is_void : ::boost::integral_constant<bool,false> { };
37422 template<> struct is_void< void > : ::boost::integral_constant<bool,true> { };
37423 template<> struct is_void< void const > : ::boost::integral_constant<bool,true> { };
37424 template<> struct is_void< void volatile > : ::boost::integral_constant<bool,true> { };
37425 template<> struct is_void< void const volatile > : ::boost::integral_constant<bool,true> { };
37426 }
37427 namespace boost {
37428 template< typename T > struct is_integral : ::boost::integral_constant<bool,false> { };
37429 template<> struct is_integral< unsigned char > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned char const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned char volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned char const volatile > : ::boost::integral_constant<bool,true> { };
37430 template<> struct is_integral< unsigned short > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned short const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned short volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned short const volatile > : ::boost::integral_constant<bool,true> { };
37431 template<> struct is_integral< unsigned int > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned int const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned int volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned int const volatile > : ::boost::integral_constant<bool,true> { };
37432 template<> struct is_integral< unsigned long > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned long const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned long volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< unsigned long const volatile > : ::boost::integral_constant<bool,true> { };
37433 template<> struct is_integral< signed char > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed char const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed char volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed char const volatile > : ::boost::integral_constant<bool,true> { };
37434 template<> struct is_integral< signed short > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed short const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed short volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed short const volatile > : ::boost::integral_constant<bool,true> { };
37435 template<> struct is_integral< signed int > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed int const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed int volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed int const volatile > : ::boost::integral_constant<bool,true> { };
37436 template<> struct is_integral< signed long > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed long const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed long volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< signed long const volatile > : ::boost::integral_constant<bool,true> { };
37437 template<> struct is_integral< bool > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< bool const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< bool volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< bool const volatile > : ::boost::integral_constant<bool,true> { };
37438 template<> struct is_integral< char > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< char const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< char volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< char const volatile > : ::boost::integral_constant<bool,true> { };
37439 template<> struct is_integral< wchar_t > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< wchar_t const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< wchar_t volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< wchar_t const volatile > : ::boost::integral_constant<bool,true> { };
37440 template<> struct is_integral< ::boost::ulong_long_type > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< ::boost::ulong_long_type const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< ::boost::ulong_long_type volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< ::boost::ulong_long_type const volatile > : ::boost::integral_constant<bool,true> { };
37441 template<> struct is_integral< ::boost::long_long_type > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< ::boost::long_long_type const > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< ::boost::long_long_type volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_integral< ::boost::long_long_type const volatile > : ::boost::integral_constant<bool,true> { };
37442 }
37443 namespace boost {
37444 template< typename T > struct is_float : ::boost::integral_constant<bool,false> { };
37445 template<> struct is_float< float > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< float const > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< float volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< float const volatile > : ::boost::integral_constant<bool,true> { };
37446 template<> struct is_float< double > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< double const > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< double volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< double const volatile > : ::boost::integral_constant<bool,true> { };
37447 template<> struct is_float< long double > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< long double const > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< long double volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_float< long double const volatile > : ::boost::integral_constant<bool,true> { };
37448 }
37449 namespace boost {
37450 namespace type_traits {
37451 template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false>
37452 struct ice_or;
37453 template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
37454 struct ice_or
37455 {
37456 static const bool value = true;
37457 };
37458 template <>
37459 struct ice_or<false, false, false, false, false, false, false>
37460 {
37461 static const bool value = false;
37462 };
37463 }
37464 }
37465 namespace boost {
37466 namespace detail {
37467 template< typename T >
37468 struct is_arithmetic_impl
37469 {
37470 static const bool value = (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_float<T>::value >::value)
37471 ;
37472 };
37473 }
37474 template< typename T > struct is_arithmetic : ::boost::integral_constant<bool,::boost::detail::is_arithmetic_impl<T>::value> { };
37475 }
37476 namespace boost {
37477 template< typename T > struct is_enum : ::boost::integral_constant<bool,__is_enum(T)> { };
37478 }
37479 namespace boost {
37480 namespace type_traits {
37481 template <typename T>
37482 struct is_mem_fun_pointer_impl
37483 {
37484 static const bool value = false;
37485 };
37486 template <class R, class T >
37487 struct is_mem_fun_pointer_impl<R (T::*)() > { static const bool value = true; };
37488 template <class R, class T >
37489 struct is_mem_fun_pointer_impl<R (T::*)( ...) > { static const bool value = true; };
37490 template <class R, class T >
37491 struct is_mem_fun_pointer_impl<R (T::*)() const > { static const bool value = true; };
37492 template <class R, class T >
37493 struct is_mem_fun_pointer_impl<R (T::*)() volatile > { static const bool value = true; };
37494 template <class R, class T >
37495 struct is_mem_fun_pointer_impl<R (T::*)() const volatile > { static const bool value = true; };
37496 template <class R, class T >
37497 struct is_mem_fun_pointer_impl<R (T::*)( ...) const > { static const bool value = true; };
37498 template <class R, class T >
37499 struct is_mem_fun_pointer_impl<R (T::*)( ...) volatile > { static const bool value = true; };
37500 template <class R, class T >
37501 struct is_mem_fun_pointer_impl<R (T::*)( ...) const volatile > { static const bool value = true; };
37502 template <class R, class T , class T0>
37503 struct is_mem_fun_pointer_impl<R (T::*)( T0) > { static const bool value = true; };
37504 template <class R, class T , class T0>
37505 struct is_mem_fun_pointer_impl<R (T::*)( T0 ...) > { static const bool value = true; };
37506 template <class R, class T , class T0>
37507 struct is_mem_fun_pointer_impl<R (T::*)( T0) const > { static const bool value = true; };
37508 template <class R, class T , class T0>
37509 struct is_mem_fun_pointer_impl<R (T::*)( T0) volatile > { static const bool value = true; };
37510 template <class R, class T , class T0>
37511 struct is_mem_fun_pointer_impl<R (T::*)( T0) const volatile > { static const bool value = true; };
37512 template <class R, class T , class T0>
37513 struct is_mem_fun_pointer_impl<R (T::*)( T0 ...) const > { static const bool value = true; };
37514 template <class R, class T , class T0>
37515 struct is_mem_fun_pointer_impl<R (T::*)( T0 ...) volatile > { static const bool value = true; };
37516 template <class R, class T , class T0>
37517 struct is_mem_fun_pointer_impl<R (T::*)( T0 ...) const volatile > { static const bool value = true; };
37518 template <class R, class T , class T0 , class T1>
37519 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1) > { static const bool value = true; };
37520 template <class R, class T , class T0 , class T1>
37521 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 ...) > { static const bool value = true; };
37522 template <class R, class T , class T0 , class T1>
37523 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1) const > { static const bool value = true; };
37524 template <class R, class T , class T0 , class T1>
37525 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1) volatile > { static const bool value = true; };
37526 template <class R, class T , class T0 , class T1>
37527 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1) const volatile > { static const bool value = true; };
37528 template <class R, class T , class T0 , class T1>
37529 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 ...) const > { static const bool value = true; };
37530 template <class R, class T , class T0 , class T1>
37531 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 ...) volatile > { static const bool value = true; };
37532 template <class R, class T , class T0 , class T1>
37533 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 ...) const volatile > { static const bool value = true; };
37534 template <class R, class T , class T0 , class T1 , class T2>
37535 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2) > { static const bool value = true; };
37536 template <class R, class T , class T0 , class T1 , class T2>
37537 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 ...) > { static const bool value = true; };
37538 template <class R, class T , class T0 , class T1 , class T2>
37539 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2) const > { static const bool value = true; };
37540 template <class R, class T , class T0 , class T1 , class T2>
37541 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2) volatile > { static const bool value = true; };
37542 template <class R, class T , class T0 , class T1 , class T2>
37543 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2) const volatile > { static const bool value = true; };
37544 template <class R, class T , class T0 , class T1 , class T2>
37545 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 ...) const > { static const bool value = true; };
37546 template <class R, class T , class T0 , class T1 , class T2>
37547 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 ...) volatile > { static const bool value = true; };
37548 template <class R, class T , class T0 , class T1 , class T2>
37549 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 ...) const volatile > { static const bool value = true; };
37550 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37551 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3) > { static const bool value = true; };
37552 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37553 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 ...) > { static const bool value = true; };
37554 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37555 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3) const > { static const bool value = true; };
37556 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37557 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3) volatile > { static const bool value = true; };
37558 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37559 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3) const volatile > { static const bool value = true; };
37560 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37561 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 ...) const > { static const bool value = true; };
37562 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37563 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 ...) volatile > { static const bool value = true; };
37564 template <class R, class T , class T0 , class T1 , class T2 , class T3>
37565 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 ...) const volatile > { static const bool value = true; };
37566 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37567 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4) > { static const bool value = true; };
37568 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37569 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 ...) > { static const bool value = true; };
37570 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37571 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4) const > { static const bool value = true; };
37572 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37573 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4) volatile > { static const bool value = true; };
37574 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37575 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4) const volatile > { static const bool value = true; };
37576 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37577 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 ...) const > { static const bool value = true; };
37578 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37579 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 ...) volatile > { static const bool value = true; };
37580 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4>
37581 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 ...) const volatile > { static const bool value = true; };
37582 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37583 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5) > { static const bool value = true; };
37584 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37585 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 ...) > { static const bool value = true; };
37586 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37587 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5) const > { static const bool value = true; };
37588 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37589 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5) volatile > { static const bool value = true; };
37590 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37591 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5) const volatile > { static const bool value = true; };
37592 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37593 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 ...) const > { static const bool value = true; };
37594 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37595 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 ...) volatile > { static const bool value = true; };
37596 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
37597 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 ...) const volatile > { static const bool value = true; };
37598 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37599 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) > { static const bool value = true; };
37600 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37601 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...) > { static const bool value = true; };
37602 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37603 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) const > { static const bool value = true; };
37604 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37605 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) volatile > { static const bool value = true; };
37606 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37607 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) const volatile > { static const bool value = true; };
37608 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37609 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...) const > { static const bool value = true; };
37610 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37611 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...) volatile > { static const bool value = true; };
37612 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
37613 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...) const volatile > { static const bool value = true; };
37614 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37615 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) > { static const bool value = true; };
37616 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37617 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...) > { static const bool value = true; };
37618 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37619 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) const > { static const bool value = true; };
37620 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37621 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) volatile > { static const bool value = true; };
37622 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37623 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) const volatile > { static const bool value = true; };
37624 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37625 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...) const > { static const bool value = true; };
37626 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37627 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...) volatile > { static const bool value = true; };
37628 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
37629 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...) const volatile > { static const bool value = true; };
37630 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37631 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) > { static const bool value = true; };
37632 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37633 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...) > { static const bool value = true; };
37634 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37635 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) const > { static const bool value = true; };
37636 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37637 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) volatile > { static const bool value = true; };
37638 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37639 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) const volatile > { static const bool value = true; };
37640 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37641 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...) const > { static const bool value = true; };
37642 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37643 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...) volatile > { static const bool value = true; };
37644 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
37645 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...) const volatile > { static const bool value = true; };
37646 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37647 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) > { static const bool value = true; };
37648 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37649 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...) > { static const bool value = true; };
37650 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37651 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) const > { static const bool value = true; };
37652 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37653 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) volatile > { static const bool value = true; };
37654 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37655 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) const volatile > { static const bool value = true; };
37656 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37657 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...) const > { static const bool value = true; };
37658 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37659 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...) volatile > { static const bool value = true; };
37660 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
37661 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...) const volatile > { static const bool value = true; };
37662 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37663 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) > { static const bool value = true; };
37664 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37665 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...) > { static const bool value = true; };
37666 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37667 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) const > { static const bool value = true; };
37668 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37669 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) volatile > { static const bool value = true; };
37670 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37671 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) const volatile > { static const bool value = true; };
37672 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37673 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...) const > { static const bool value = true; };
37674 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37675 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...) volatile > { static const bool value = true; };
37676 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
37677 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...) const volatile > { static const bool value = true; };
37678 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37679 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) > { static const bool value = true; };
37680 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37681 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...) > { static const bool value = true; };
37682 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37683 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) const > { static const bool value = true; };
37684 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37685 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) volatile > { static const bool value = true; };
37686 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37687 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) const volatile > { static const bool value = true; };
37688 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37689 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...) const > { static const bool value = true; };
37690 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37691 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...) volatile > { static const bool value = true; };
37692 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
37693 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...) const volatile > { static const bool value = true; };
37694 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37695 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) > { static const bool value = true; };
37696 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37697 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...) > { static const bool value = true; };
37698 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37699 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) const > { static const bool value = true; };
37700 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37701 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) volatile > { static const bool value = true; };
37702 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37703 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) const volatile > { static const bool value = true; };
37704 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37705 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...) const > { static const bool value = true; };
37706 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37707 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...) volatile > { static const bool value = true; };
37708 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
37709 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...) const volatile > { static const bool value = true; };
37710 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37711 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) > { static const bool value = true; };
37712 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37713 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...) > { static const bool value = true; };
37714 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37715 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) const > { static const bool value = true; };
37716 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37717 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) volatile > { static const bool value = true; };
37718 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37719 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) const volatile > { static const bool value = true; };
37720 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37721 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...) const > { static const bool value = true; };
37722 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37723 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...) volatile > { static const bool value = true; };
37724 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
37725 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...) const volatile > { static const bool value = true; };
37726 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37727 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) > { static const bool value = true; };
37728 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37729 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...) > { static const bool value = true; };
37730 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37731 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) const > { static const bool value = true; };
37732 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37733 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) volatile > { static const bool value = true; };
37734 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37735 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) const volatile > { static const bool value = true; };
37736 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37737 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...) const > { static const bool value = true; };
37738 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37739 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...) volatile > { static const bool value = true; };
37740 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
37741 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...) const volatile > { static const bool value = true; };
37742 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37743 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15) > { static const bool value = true; };
37744 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37745 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...) > { static const bool value = true; };
37746 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37747 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15) const > { static const bool value = true; };
37748 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37749 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15) volatile > { static const bool value = true; };
37750 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37751 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15) const volatile > { static const bool value = true; };
37752 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37753 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...) const > { static const bool value = true; };
37754 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37755 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...) volatile > { static const bool value = true; };
37756 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
37757 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...) const volatile > { static const bool value = true; };
37758 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37759 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16) > { static const bool value = true; };
37760 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37761 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...) > { static const bool value = true; };
37762 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37763 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16) const > { static const bool value = true; };
37764 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37765 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16) volatile > { static const bool value = true; };
37766 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37767 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16) const volatile > { static const bool value = true; };
37768 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37769 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...) const > { static const bool value = true; };
37770 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37771 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...) volatile > { static const bool value = true; };
37772 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
37773 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...) const volatile > { static const bool value = true; };
37774 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37775 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17) > { static const bool value = true; };
37776 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37777 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...) > { static const bool value = true; };
37778 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37779 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17) const > { static const bool value = true; };
37780 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37781 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17) volatile > { static const bool value = true; };
37782 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37783 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17) const volatile > { static const bool value = true; };
37784 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37785 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...) const > { static const bool value = true; };
37786 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37787 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...) volatile > { static const bool value = true; };
37788 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
37789 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...) const volatile > { static const bool value = true; };
37790 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37791 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18) > { static const bool value = true; };
37792 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37793 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...) > { static const bool value = true; };
37794 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37795 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18) const > { static const bool value = true; };
37796 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37797 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18) volatile > { static const bool value = true; };
37798 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37799 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18) const volatile > { static const bool value = true; };
37800 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37801 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...) const > { static const bool value = true; };
37802 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37803 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...) volatile > { static const bool value = true; };
37804 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
37805 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...) const volatile > { static const bool value = true; };
37806 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37807 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19) > { static const bool value = true; };
37808 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37809 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...) > { static const bool value = true; };
37810 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37811 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19) const > { static const bool value = true; };
37812 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37813 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19) volatile > { static const bool value = true; };
37814 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37815 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19) const volatile > { static const bool value = true; };
37816 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37817 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...) const > { static const bool value = true; };
37818 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37819 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...) volatile > { static const bool value = true; };
37820 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
37821 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...) const volatile > { static const bool value = true; };
37822 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37823 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20) > { static const bool value = true; };
37824 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37825 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...) > { static const bool value = true; };
37826 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37827 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20) const > { static const bool value = true; };
37828 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37829 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20) volatile > { static const bool value = true; };
37830 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37831 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20) const volatile > { static const bool value = true; };
37832 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37833 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...) const > { static const bool value = true; };
37834 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37835 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...) volatile > { static const bool value = true; };
37836 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
37837 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...) const volatile > { static const bool value = true; };
37838 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37839 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21) > { static const bool value = true; };
37840 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37841 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...) > { static const bool value = true; };
37842 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37843 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21) const > { static const bool value = true; };
37844 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37845 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21) volatile > { static const bool value = true; };
37846 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37847 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21) const volatile > { static const bool value = true; };
37848 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37849 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...) const > { static const bool value = true; };
37850 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37851 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...) volatile > { static const bool value = true; };
37852 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
37853 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...) const volatile > { static const bool value = true; };
37854 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37855 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22) > { static const bool value = true; };
37856 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37857 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...) > { static const bool value = true; };
37858 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37859 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22) const > { static const bool value = true; };
37860 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37861 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22) volatile > { static const bool value = true; };
37862 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37863 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22) const volatile > { static const bool value = true; };
37864 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37865 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...) const > { static const bool value = true; };
37866 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37867 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...) volatile > { static const bool value = true; };
37868 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
37869 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...) const volatile > { static const bool value = true; };
37870 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37871 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23) > { static const bool value = true; };
37872 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37873 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...) > { static const bool value = true; };
37874 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37875 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23) const > { static const bool value = true; };
37876 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37877 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23) volatile > { static const bool value = true; };
37878 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37879 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23) const volatile > { static const bool value = true; };
37880 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37881 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...) const > { static const bool value = true; };
37882 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37883 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...) volatile > { static const bool value = true; };
37884 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
37885 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...) const volatile > { static const bool value = true; };
37886 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37887 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24) > { static const bool value = true; };
37888 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37889 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...) > { static const bool value = true; };
37890 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37891 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24) const > { static const bool value = true; };
37892 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37893 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24) volatile > { static const bool value = true; };
37894 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37895 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24) const volatile > { static const bool value = true; };
37896 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37897 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...) const > { static const bool value = true; };
37898 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37899 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...) volatile > { static const bool value = true; };
37900 template <class R, class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
37901 struct is_mem_fun_pointer_impl<R (T::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...) const volatile > { static const bool value = true; };
37902 }
37903 }
37904 namespace boost {
37905 template< typename T > struct is_member_function_pointer : ::boost::integral_constant<bool,::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value> { };
37906 }
37907 namespace boost {
37908 template< typename T > struct is_member_pointer : ::boost::integral_constant<bool,::boost::is_member_function_pointer<T>::value> { };
37909 template< typename T, typename U > struct is_member_pointer< U T::* > : ::boost::integral_constant<bool,true> { };
37910 template< typename T, typename U > struct is_member_pointer< U T::*const > : ::boost::integral_constant<bool,true> { };
37911 template< typename T, typename U > struct is_member_pointer< U T::*volatile > : ::boost::integral_constant<bool,true> { };
37912 template< typename T, typename U > struct is_member_pointer< U T::*const volatile > : ::boost::integral_constant<bool,true> { };
37913 }
37914 namespace boost {
37915 namespace type_traits {
37916 template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true>
37917 struct ice_and;
37918 template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
37919 struct ice_and
37920 {
37921 static const bool value = false;
37922 };
37923 template <>
37924 struct ice_and<true, true, true, true, true, true, true>
37925 {
37926 static const bool value = true;
37927 };
37928 }
37929 }
37930 namespace boost {
37931 namespace type_traits {
37932 template <bool b>
37933 struct ice_not
37934 {
37935 static const bool value = true;
37936 };
37937 template <>
37938 struct ice_not<true>
37939 {
37940 static const bool value = false;
37941 };
37942 }
37943 }
37944 namespace boost {
37945 namespace detail {
37946 template< typename T > struct is_pointer_helper
37947 {
37948 static const bool value = false;
37949 };
37950 template< typename T > struct is_pointer_helper<T*> { static const bool value = true; };
37951 template< typename T >
37952 struct is_pointer_impl
37953 {
37954 static const bool value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value , ::boost::type_traits::ice_not< ::boost::is_member_pointer<T>::value >::value >::value)
37955 ;
37956 };
37957 }
37958 template< typename T > struct is_pointer : ::boost::integral_constant<bool,::boost::detail::is_pointer_impl<T>::value> { };
37959 }
37960 namespace boost {
37961 namespace detail {
37962 template <typename T>
37963 struct is_scalar_impl
37964 {
37965 static const bool value = (::boost::type_traits::ice_or< ::boost::is_arithmetic<T>::value, ::boost::is_enum<T>::value, ::boost::is_pointer<T>::value, ::boost::is_member_pointer<T>::value >::value)
37966 ;
37967 };
37968 template <> struct is_scalar_impl<void>{ static const bool value = false; };
37969 template <> struct is_scalar_impl<void const>{ static const bool value = false; };
37970 template <> struct is_scalar_impl<void volatile>{ static const bool value = false; };
37971 template <> struct is_scalar_impl<void const volatile>{ static const bool value = false; };
37972 }
37973 template< typename T > struct is_scalar : ::boost::integral_constant<bool,::boost::detail::is_scalar_impl<T>::value> { };
37974 }
37975
37976 namespace boost {
37977 template< typename T > struct is_POD;
37978 namespace detail {
37979 template <typename T> struct is_pod_impl
37980 {
37981 static const bool value = (::boost::type_traits::ice_or< ::boost::is_scalar<T>::value, ::boost::is_void<T>::value, __is_pod(T) >::value)
37982 ;
37983 };
37984 template <typename T, std::size_t sz>
37985 struct is_pod_impl<T[sz]>
37986 : is_pod_impl<T>
37987 {
37988 };
37989 template<> struct is_pod_impl< void > { static const bool value = (true); };
37990 template<> struct is_pod_impl< void const > { static const bool value = (true); };
37991 template<> struct is_pod_impl< void volatile > { static const bool value = (true); };
37992 template<> struct is_pod_impl< void const volatile > { static const bool value = (true); };
37993 }
37994 template< typename T > struct is_POD : ::boost::integral_constant<bool,::boost::detail::is_pod_impl<T>::value> { };
37995 template< typename T > struct is_pod : ::boost::integral_constant<bool,::boost::detail::is_pod_impl<T>::value> { };
37996 }
37997 namespace boost {
37998 namespace detail {
37999 template <typename T>
38000 struct has_trivial_copy_impl
38001 {
38002 static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_or< ::boost::is_pod<T>::value, (__has_trivial_copy(T) && !is_reference<T>::value) >::value, ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value >::value)
38003 ;
38004 };
38005 }
38006 template< typename T > struct has_trivial_copy : ::boost::integral_constant<bool,::boost::detail::has_trivial_copy_impl<T>::value> { };
38007 template< typename T > struct has_trivial_copy_constructor : ::boost::integral_constant<bool,::boost::detail::has_trivial_copy_impl<T>::value> { };
38008 }
38009 namespace boost {
38010 namespace detail {
38011 template <typename T>
38012 struct has_trivial_dtor_impl
38013 {
38014 static const bool value = (::boost::type_traits::ice_or< ::boost::is_pod<T>::value, __has_trivial_destructor(T) >::value)
38015 ;
38016 };
38017 }
38018 template< typename T > struct has_trivial_destructor : ::boost::integral_constant<bool,::boost::detail::has_trivial_dtor_impl<T>::value> { };
38019 }
38020
38021 namespace boost {
38022 template< typename T > struct is_array : ::boost::integral_constant<bool,false> { };
38023 template< typename T, std::size_t N > struct is_array< T[N] > : ::boost::integral_constant<bool,true> { };
38024 template< typename T, std::size_t N > struct is_array< T const[N] > : ::boost::integral_constant<bool,true> { };
38025 template< typename T, std::size_t N > struct is_array< T volatile[N] > : ::boost::integral_constant<bool,true> { };
38026 template< typename T, std::size_t N > struct is_array< T const volatile[N] > : ::boost::integral_constant<bool,true> { };
38027 template< typename T > struct is_array< T[] > : ::boost::integral_constant<bool,true> { };
38028 template< typename T > struct is_array< T const[] > : ::boost::integral_constant<bool,true> { };
38029 template< typename T > struct is_array< T volatile[] > : ::boost::integral_constant<bool,true> { };
38030 template< typename T > struct is_array< T const volatile[] > : ::boost::integral_constant<bool,true> { };
38031 }
38032 namespace boost {
38033 namespace detail {
38034 template <typename T> struct is_union_impl
38035 {
38036 static const bool value = __is_union(T);
38037 };
38038 }
38039 template< typename T > struct is_union : ::boost::integral_constant<bool,::boost::detail::is_union_impl<T>::value> { };
38040 }
38041 namespace boost {
38042 namespace type_traits {
38043 typedef char yes_type;
38044 struct no_type
38045 {
38046 char padding[8];
38047 };
38048 }
38049 }
38050 namespace boost {
38051 namespace type_traits {
38052 template <int b1, int b2>
38053 struct ice_eq
38054 {
38055 static const bool value = (b1 == b2);
38056 };
38057 template <int b1, int b2>
38058 struct ice_ne
38059 {
38060 static const bool value = (b1 != b2);
38061 };
38062 template <int b1, int b2> bool const ice_eq<b1,b2>::value;
38063 template <int b1, int b2> bool const ice_ne<b1,b2>::value;
38064 }
38065 }
38066 namespace boost
38067 {
38068 namespace detail
38069 {
38070 template<class T> struct addr_impl_ref
38071 {
38072 T & v_;
38073 inline addr_impl_ref( T & v ): v_( v ) {}
38074 inline operator T& () const { return v_; }
38075 private:
38076 addr_impl_ref & operator=(const addr_impl_ref &);
38077 };
38078 template<class T> struct addressof_impl
38079 {
38080 static inline T * f( T & v, long )
38081 {
38082 return reinterpret_cast<T*>(
38083 &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
38084 }
38085 static inline T * f( T * v, int )
38086 {
38087 return v;
38088 }
38089 };
38090 }
38091 template<class T> T * addressof( T & v )
38092 {
38093 return boost::detail::addressof_impl<T>::f( boost::detail::addr_impl_ref<T>( v ), 0 );
38094 }
38095 }
38096 namespace boost
38097 {
38098 template<class T> class reference_wrapper
38099 {
38100 public:
38101 typedef T type;
38102 explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
38103 operator T& () const { return *t_; }
38104 T& get() const { return *t_; }
38105 T* get_pointer() const { return t_; }
38106 private:
38107 T* t_;
38108 };
38109 template<class T> inline reference_wrapper<T> const ref(T & t)
38110 {
38111 return reference_wrapper<T>(t);
38112 }
38113 template<class T> inline reference_wrapper<T const> const cref(T const & t)
38114 {
38115 return reference_wrapper<T const>(t);
38116 }
38117 template<typename T>
38118 class is_reference_wrapper
38119 : public mpl::false_
38120 {
38121 };
38122 template<typename T>
38123 class unwrap_reference
38124 {
38125 public:
38126 typedef T type;
38127 };
38128 template<typename T> class is_reference_wrapper< reference_wrapper<T> > : public mpl::true_ { }; template<typename T> class unwrap_reference< reference_wrapper<T> > { public: typedef T type; };
38129 template<typename T> class is_reference_wrapper< reference_wrapper<T> const > : public mpl::true_ { }; template<typename T> class unwrap_reference< reference_wrapper<T> const > { public: typedef T type; };
38130 template<typename T> class is_reference_wrapper< reference_wrapper<T> volatile > : public mpl::true_ { }; template<typename T> class unwrap_reference< reference_wrapper<T> volatile > { public: typedef T type; };
38131 template<typename T> class is_reference_wrapper< reference_wrapper<T> const volatile > : public mpl::true_ { }; template<typename T> class unwrap_reference< reference_wrapper<T> const volatile > { public: typedef T type; };
38132 template <class T> inline typename unwrap_reference<T>::type&
38133 unwrap_ref(T& t)
38134 {
38135 return t;
38136 }
38137 template<class T> inline T* get_pointer( reference_wrapper<T> const & r )
38138 {
38139 return r.get_pointer();
38140 }
38141 }
38142 namespace boost { namespace mpl { namespace aux {
38143 template< typename T > struct value_type_wknd
38144 {
38145 typedef typename T::value_type type;
38146 };
38147 }}}
38148 namespace mpl_ {
38149 struct void_;
38150 }
38151 namespace boost { namespace mpl { using ::mpl_::void_; } }
38152 namespace mpl_ {
38153 struct na
38154 {
38155 typedef na type;
38156 enum { value = 0 };
38157 };
38158 }
38159 namespace boost { namespace mpl { using ::mpl_::na; } }
38160 namespace boost { namespace mpl {
38161 template< typename T >
38162 struct is_na
38163 : false_
38164 {
38165 };
38166 template<>
38167 struct is_na<na>
38168 : true_
38169 {
38170 };
38171 template< typename T >
38172 struct is_not_na
38173 : true_
38174 {
38175 };
38176 template<>
38177 struct is_not_na<na>
38178 : false_
38179 {
38180 };
38181 template< typename T, typename U > struct if_na
38182 {
38183 typedef T type;
38184 };
38185 template< typename U > struct if_na<na,U>
38186 {
38187 typedef U type;
38188 };
38189 }}
38190 namespace boost { namespace mpl {
38191 template<
38192 typename T = na
38193 , typename Tag = void_
38194 , typename Arity = int_< aux::template_arity<T>::value >
38195 >
38196 struct lambda;
38197 }}
38198 namespace boost { namespace mpl {
38199 template<
38200 bool C
38201 , typename T1
38202 , typename T2
38203 >
38204 struct if_c
38205 {
38206 typedef T1 type;
38207 };
38208 template<
38209 typename T1
38210 , typename T2
38211 >
38212 struct if_c<false,T1,T2>
38213 {
38214 typedef T2 type;
38215 };
38216 template<
38217 typename T1 = na
38218 , typename T2 = na
38219 , typename T3 = na
38220 >
38221 struct if_
38222 {
38223 private:
38224 typedef if_c<
38225 static_cast<bool>(T1::value)
38226 , T2
38227 , T3
38228 > almost_type_;
38229 public:
38230 typedef typename almost_type_::type type;
38231
38232 };
38233 template<> struct if_< na , na , na > { template< typename T1 , typename T2 , typename T3 , typename T4 =na , typename T5 =na > struct apply : if_< T1 , T2 , T3 > { }; }; template< typename Tag > struct lambda< if_< na , na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef if_< na , na , na > result_; typedef if_< na , na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 > struct template_arity< if_< T1 , T2 , T3 > > : int_<3> { }; template<> struct template_arity< if_< na , na , na > > : int_<-1> { }; }
38234 }}
38235
38236
38237 namespace mpl_ {
38238 template< std::size_t N > struct size_t;
38239 }
38240 namespace boost { namespace mpl { using ::mpl_::size_t; } }
38241 namespace mpl_ {
38242 template< std::size_t N >
38243 struct size_t
38244 {
38245 static const std::size_t value = N;
38246 typedef size_t type;
38247 typedef std::size_t value_type;
38248 typedef integral_c_tag tag;
38249 typedef mpl_::size_t< static_cast<std::size_t>((value + 1)) > next;
38250 typedef mpl_::size_t< static_cast<std::size_t>((value - 1)) > prior;
38251 operator std::size_t() const { return static_cast<std::size_t>(this->value); }
38252 };
38253 template< std::size_t N >
38254 std::size_t const mpl_::size_t< N >::value;
38255 }
38256
38257 namespace boost {
38258 template <typename T> struct alignment_of;
38259 namespace detail {
38260 template <typename T>
38261 struct alignment_of_hack
38262 {
38263 char c;
38264 T t;
38265 alignment_of_hack();
38266 };
38267 template <unsigned A, unsigned S>
38268 struct alignment_logic
38269 {
38270 static const std::size_t value = A < S ? A : S;
38271 };
38272 template< typename T >
38273 struct alignment_of_impl
38274 {
38275 static const std::size_t value = __alignof__(T);
38276 };
38277 }
38278 template< typename T > struct alignment_of : ::boost::integral_constant<std::size_t,::boost::detail::alignment_of_impl<T>::value> { };
38279 template <typename T>
38280 struct alignment_of<T&>
38281 : alignment_of<T*>
38282 {
38283 };
38284 template<> struct alignment_of<void> : ::boost::integral_constant<std::size_t,0> { };
38285 template<> struct alignment_of<void const> : ::boost::integral_constant<std::size_t,0> { };
38286 template<> struct alignment_of<void volatile> : ::boost::integral_constant<std::size_t,0> { };
38287 template<> struct alignment_of<void const volatile> : ::boost::integral_constant<std::size_t,0> { };
38288 }
38289 namespace boost
38290 {
38291 template <bool B, class T = void>
38292 struct enable_if_c {
38293 typedef T type;
38294 };
38295 template <class T>
38296 struct enable_if_c<false, T> {};
38297 template <class Cond, class T = void>
38298 struct enable_if : public enable_if_c<Cond::value, T> {};
38299 template <bool B, class T>
38300 struct lazy_enable_if_c {
38301 typedef typename T::type type;
38302 };
38303 template <class T>
38304 struct lazy_enable_if_c<false, T> {};
38305 template <class Cond, class T>
38306 struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
38307 template <bool B, class T = void>
38308 struct disable_if_c {
38309 typedef T type;
38310 };
38311 template <class T>
38312 struct disable_if_c<true, T> {};
38313 template <class Cond, class T = void>
38314 struct disable_if : public disable_if_c<Cond::value, T> {};
38315 template <bool B, class T>
38316 struct lazy_disable_if_c {
38317 typedef typename T::type type;
38318 };
38319 template <class T>
38320 struct lazy_disable_if_c<true, T> {};
38321 template <class Cond, class T>
38322 struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
38323 }
38324 namespace boost {
38325 template<typename F, typename G>
38326 bool function_equal_impl(const F& f, const G& g, long)
38327 { return f == g; }
38328 template<typename F, typename G>
38329 bool function_equal(const F& f, const G& g)
38330 { return function_equal_impl(f, g, 0); }
38331 }
38332 namespace boost {
38333 class bad_function_call;
38334 template<typename Signature> class function;
38335 template<typename Signature>
38336 inline void swap(function<Signature>& f1, function<Signature>& f2)
38337 {
38338 f1.swap(f2);
38339 }
38340 template<typename R> class function0;
38341 template<typename R, typename T1> class function1;
38342 template<typename R, typename T1, typename T2> class function2;
38343 template<typename R, typename T1, typename T2, typename T3> class function3;
38344 template<typename R, typename T1, typename T2, typename T3, typename T4>
38345 class function4;
38346 template<typename R, typename T1, typename T2, typename T3, typename T4,
38347 typename T5>
38348 class function5;
38349 template<typename R, typename T1, typename T2, typename T3, typename T4,
38350 typename T5, typename T6>
38351 class function6;
38352 template<typename R, typename T1, typename T2, typename T3, typename T4,
38353 typename T5, typename T6, typename T7>
38354 class function7;
38355 template<typename R, typename T1, typename T2, typename T3, typename T4,
38356 typename T5, typename T6, typename T7, typename T8>
38357 class function8;
38358 template<typename R, typename T1, typename T2, typename T3, typename T4,
38359 typename T5, typename T6, typename T7, typename T8, typename T9>
38360 class function9;
38361 template<typename R, typename T1, typename T2, typename T3, typename T4,
38362 typename T5, typename T6, typename T7, typename T8, typename T9,
38363 typename T10>
38364 class function10;
38365 }
38366
38367
38368 namespace std __attribute__ ((__visibility__ ("default"))) {
38369 using ::memchr;
38370 using ::memcmp;
38371 using ::memcpy;
38372 using ::memmove;
38373 using ::memset;
38374 using ::strcat;
38375 using ::strcmp;
38376 using ::strcoll;
38377 using ::strcpy;
38378 using ::strcspn;
38379 using ::strerror;
38380 using ::strlen;
38381 using ::strncat;
38382 using ::strncmp;
38383 using ::strncpy;
38384 using ::strspn;
38385 using ::strtok;
38386 using ::strxfrm;
38387 using ::strchr;
38388 using ::strpbrk;
38389 using ::strrchr;
38390 using ::strstr;
38391 }
38392 namespace boost {
38393 namespace detail {
38394 namespace function {
38395 class X;
38396 union function_buffer
38397 {
38398 mutable void* obj_ptr;
38399 struct type_t {
38400 const detail::sp_typeinfo* type;
38401 bool const_qualified;
38402 bool volatile_qualified;
38403 } type;
38404 mutable void (*func_ptr)();
38405 struct bound_memfunc_ptr_t {
38406 void (X::*memfunc_ptr)(int);
38407 void* obj_ptr;
38408 } bound_memfunc_ptr;
38409 struct obj_ref_t {
38410 mutable void* obj_ptr;
38411 bool is_const_qualified;
38412 bool is_volatile_qualified;
38413 } obj_ref;
38414 mutable char data;
38415 };
38416 struct unusable
38417 {
38418 unusable() {}
38419 template<typename T> unusable(const T&) {}
38420 };
38421 template<typename T> struct function_return_type { typedef T type; };
38422 template<>
38423 struct function_return_type<void>
38424 {
38425 typedef unusable type;
38426 };
38427 enum functor_manager_operation_type {
38428 clone_functor_tag,
38429 move_functor_tag,
38430 destroy_functor_tag,
38431 check_functor_type_tag,
38432 get_functor_type_tag
38433 };
38434 struct function_ptr_tag {};
38435 struct function_obj_tag {};
38436 struct member_ptr_tag {};
38437 struct function_obj_ref_tag {};
38438 template<typename F>
38439 class get_function_tag
38440 {
38441 typedef typename mpl::if_c<(is_pointer<F>::value),
38442 function_ptr_tag,
38443 function_obj_tag>::type ptr_or_obj_tag;
38444 typedef typename mpl::if_c<(is_member_pointer<F>::value),
38445 member_ptr_tag,
38446 ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
38447 typedef typename mpl::if_c<(is_reference_wrapper<F>::value),
38448 function_obj_ref_tag,
38449 ptr_or_obj_or_mem_tag>::type or_ref_tag;
38450 public:
38451 typedef or_ref_tag type;
38452 };
38453 template<typename F>
38454 struct reference_manager
38455 {
38456 static inline void
38457 manage(const function_buffer& in_buffer, function_buffer& out_buffer,
38458 functor_manager_operation_type op)
38459 {
38460 switch (op) {
38461 case clone_functor_tag:
38462 out_buffer.obj_ref.obj_ptr = in_buffer.obj_ref.obj_ptr;
38463 return;
38464 case move_functor_tag:
38465 out_buffer.obj_ref.obj_ptr = in_buffer.obj_ref.obj_ptr;
38466 in_buffer.obj_ref.obj_ptr = 0;
38467 return;
38468 case destroy_functor_tag:
38469 out_buffer.obj_ref.obj_ptr = 0;
38470 return;
38471 case check_functor_type_tag:
38472 {
38473 const detail::sp_typeinfo& check_type
38474 = *out_buffer.type.type;
38475 if ((std::strcmp((check_type).name(),(typeid(F)).name()) == 0)
38476 && (!in_buffer.obj_ref.is_const_qualified
38477 || out_buffer.type.const_qualified)
38478 && (!in_buffer.obj_ref.is_volatile_qualified
38479 || out_buffer.type.volatile_qualified))
38480 out_buffer.obj_ptr = in_buffer.obj_ref.obj_ptr;
38481 else
38482 out_buffer.obj_ptr = 0;
38483 }
38484 return;
38485 case get_functor_type_tag:
38486 out_buffer.type.type = &typeid(F);
38487 out_buffer.type.const_qualified = in_buffer.obj_ref.is_const_qualified;
38488 out_buffer.type.volatile_qualified = in_buffer.obj_ref.is_volatile_qualified;
38489 return;
38490 }
38491 }
38492 };
38493 template<typename F>
38494 struct function_allows_small_object_optimization
38495 {
38496 static const bool value = ((sizeof(F) <= sizeof(function_buffer) && (alignment_of<function_buffer>::value % alignment_of<F>::value == 0)))
38497 ;
38498 };
38499 template <typename F,typename A>
38500 struct functor_wrapper: public F, public A
38501 {
38502 functor_wrapper( F f, A a ):
38503 F(f),
38504 A(a)
38505 {
38506 }
38507 functor_wrapper(const functor_wrapper& f) :
38508 F(static_cast<const F&>(f)),
38509 A(static_cast<const A&>(f))
38510 {
38511 }
38512 };
38513 template<typename Functor>
38514 struct functor_manager_common
38515 {
38516 typedef Functor functor_type;
38517 static inline void
38518 manage_ptr(const function_buffer& in_buffer, function_buffer& out_buffer,
38519 functor_manager_operation_type op)
38520 {
38521 if (op == clone_functor_tag)
38522 out_buffer.func_ptr = in_buffer.func_ptr;
38523 else if (op == move_functor_tag) {
38524 out_buffer.func_ptr = in_buffer.func_ptr;
38525 in_buffer.func_ptr = 0;
38526 } else if (op == destroy_functor_tag)
38527 out_buffer.func_ptr = 0;
38528 else if (op == check_functor_type_tag) {
38529 const detail::sp_typeinfo& check_type
38530 = *out_buffer.type.type;
38531 if ((std::strcmp((check_type).name(),(typeid(Functor)).name()) == 0))
38532 out_buffer.obj_ptr = &in_buffer.func_ptr;
38533 else
38534 out_buffer.obj_ptr = 0;
38535 } else {
38536 out_buffer.type.type = &typeid(Functor);
38537 out_buffer.type.const_qualified = false;
38538 out_buffer.type.volatile_qualified = false;
38539 }
38540 }
38541 static inline void
38542 manage_small(const function_buffer& in_buffer, function_buffer& out_buffer,
38543 functor_manager_operation_type op)
38544 {
38545 if (op == clone_functor_tag || op == move_functor_tag) {
38546 const functor_type* in_functor =
38547 reinterpret_cast<const functor_type*>(&in_buffer.data);
38548 new ((void*)&out_buffer.data) functor_type(*in_functor);
38549 if (op == move_functor_tag) {
38550 reinterpret_cast<functor_type*>(&in_buffer.data)->~Functor();
38551 }
38552 } else if (op == destroy_functor_tag) {
38553 reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
38554 } else if (op == check_functor_type_tag) {
38555 const detail::sp_typeinfo& check_type
38556 = *out_buffer.type.type;
38557 if ((std::strcmp((check_type).name(),(typeid(Functor)).name()) == 0))
38558 out_buffer.obj_ptr = &in_buffer.data;
38559 else
38560 out_buffer.obj_ptr = 0;
38561 } else {
38562 out_buffer.type.type = &typeid(Functor);
38563 out_buffer.type.const_qualified = false;
38564 out_buffer.type.volatile_qualified = false;
38565 }
38566 }
38567 };
38568 template<typename Functor>
38569 struct functor_manager
38570 {
38571 private:
38572 typedef Functor functor_type;
38573 static inline void
38574 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38575 functor_manager_operation_type op, function_ptr_tag)
38576 {
38577 functor_manager_common<Functor>::manage_ptr(in_buffer,out_buffer,op);
38578 }
38579 static inline void
38580 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38581 functor_manager_operation_type op, mpl::true_)
38582 {
38583 functor_manager_common<Functor>::manage_small(in_buffer,out_buffer,op);
38584 }
38585 static inline void
38586 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38587 functor_manager_operation_type op, mpl::false_)
38588 {
38589 if (op == clone_functor_tag) {
38590 const functor_type* f =
38591 (const functor_type*)(in_buffer.obj_ptr);
38592 functor_type* new_f = new functor_type(*f);
38593 out_buffer.obj_ptr = new_f;
38594 } else if (op == move_functor_tag) {
38595 out_buffer.obj_ptr = in_buffer.obj_ptr;
38596 in_buffer.obj_ptr = 0;
38597 } else if (op == destroy_functor_tag) {
38598 functor_type* f =
38599 static_cast<functor_type*>(out_buffer.obj_ptr);
38600 delete f;
38601 out_buffer.obj_ptr = 0;
38602 } else if (op == check_functor_type_tag) {
38603 const detail::sp_typeinfo& check_type
38604 = *out_buffer.type.type;
38605 if ((std::strcmp((check_type).name(),(typeid(Functor)).name()) == 0))
38606 out_buffer.obj_ptr = in_buffer.obj_ptr;
38607 else
38608 out_buffer.obj_ptr = 0;
38609 } else {
38610 out_buffer.type.type = &typeid(Functor);
38611 out_buffer.type.const_qualified = false;
38612 out_buffer.type.volatile_qualified = false;
38613 }
38614 }
38615 static inline void
38616 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38617 functor_manager_operation_type op, function_obj_tag)
38618 {
38619 manager(in_buffer, out_buffer, op,
38620 mpl::bool_<(function_allows_small_object_optimization<functor_type>::value)>());
38621 }
38622 static inline void
38623 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38624 functor_manager_operation_type op, member_ptr_tag)
38625 {
38626 manager(in_buffer, out_buffer, op, mpl::true_());
38627 }
38628 public:
38629 static inline void
38630 manage(const function_buffer& in_buffer, function_buffer& out_buffer,
38631 functor_manager_operation_type op)
38632 {
38633 typedef typename get_function_tag<functor_type>::type tag_type;
38634 switch (op) {
38635 case get_functor_type_tag:
38636 out_buffer.type.type = &typeid(functor_type);
38637 out_buffer.type.const_qualified = false;
38638 out_buffer.type.volatile_qualified = false;
38639 return;
38640 default:
38641 manager(in_buffer, out_buffer, op, tag_type());
38642 return;
38643 }
38644 }
38645 };
38646 template<typename Functor, typename Allocator>
38647 struct functor_manager_a
38648 {
38649 private:
38650 typedef Functor functor_type;
38651 static inline void
38652 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38653 functor_manager_operation_type op, function_ptr_tag)
38654 {
38655 functor_manager_common<Functor>::manage_ptr(in_buffer,out_buffer,op);
38656 }
38657 static inline void
38658 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38659 functor_manager_operation_type op, mpl::true_)
38660 {
38661 functor_manager_common<Functor>::manage_small(in_buffer,out_buffer,op);
38662 }
38663 static inline void
38664 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38665 functor_manager_operation_type op, mpl::false_)
38666 {
38667 typedef functor_wrapper<Functor,Allocator> functor_wrapper_type;
38668 typedef typename Allocator::template rebind<functor_wrapper_type>::other
38669 wrapper_allocator_type;
38670 typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type;
38671 if (op == clone_functor_tag) {
38672 const functor_wrapper_type* f =
38673 (const functor_wrapper_type*)(in_buffer.obj_ptr);
38674 wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*f));
38675 wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1);
38676 wrapper_allocator.construct(copy, *f);
38677 functor_wrapper_type* new_f = static_cast<functor_wrapper_type*>(copy);
38678 out_buffer.obj_ptr = new_f;
38679 } else if (op == move_functor_tag) {
38680 out_buffer.obj_ptr = in_buffer.obj_ptr;
38681 in_buffer.obj_ptr = 0;
38682 } else if (op == destroy_functor_tag) {
38683 functor_wrapper_type* victim =
38684 static_cast<functor_wrapper_type*>(in_buffer.obj_ptr);
38685 wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*victim));
38686 wrapper_allocator.destroy(victim);
38687 wrapper_allocator.deallocate(victim,1);
38688 out_buffer.obj_ptr = 0;
38689 } else if (op == check_functor_type_tag) {
38690 const detail::sp_typeinfo& check_type
38691 = *out_buffer.type.type;
38692 if ((std::strcmp((check_type).name(),(typeid(Functor)).name()) == 0))
38693 out_buffer.obj_ptr = in_buffer.obj_ptr;
38694 else
38695 out_buffer.obj_ptr = 0;
38696 } else {
38697 out_buffer.type.type = &typeid(Functor);
38698 out_buffer.type.const_qualified = false;
38699 out_buffer.type.volatile_qualified = false;
38700 }
38701 }
38702 static inline void
38703 manager(const function_buffer& in_buffer, function_buffer& out_buffer,
38704 functor_manager_operation_type op, function_obj_tag)
38705 {
38706 manager(in_buffer, out_buffer, op,
38707 mpl::bool_<(function_allows_small_object_optimization<functor_type>::value)>());
38708 }
38709 public:
38710 static inline void
38711 manage(const function_buffer& in_buffer, function_buffer& out_buffer,
38712 functor_manager_operation_type op)
38713 {
38714 typedef typename get_function_tag<functor_type>::type tag_type;
38715 switch (op) {
38716 case get_functor_type_tag:
38717 out_buffer.type.type = &typeid(functor_type);
38718 out_buffer.type.const_qualified = false;
38719 out_buffer.type.volatile_qualified = false;
38720 return;
38721 default:
38722 manager(in_buffer, out_buffer, op, tag_type());
38723 return;
38724 }
38725 }
38726 };
38727 struct useless_clear_type {};
38728 struct vtable_base
38729 {
38730 void (*manager)(const function_buffer& in_buffer,
38731 function_buffer& out_buffer,
38732 functor_manager_operation_type op);
38733 };
38734 }
38735 }
38736 class function_base
38737 {
38738 public:
38739 function_base() : vtable(0) { }
38740 bool empty() const { return !vtable; }
38741 const detail::sp_typeinfo& target_type() const
38742 {
38743 if (!vtable) return typeid(void);
38744 detail::function::function_buffer type;
38745 get_vtable()->manager(functor, type, detail::function::get_functor_type_tag);
38746 return *type.type.type;
38747 }
38748 template<typename Functor>
38749 Functor* target()
38750 {
38751 if (!vtable) return 0;
38752 detail::function::function_buffer type_result;
38753 type_result.type.type = &typeid(Functor);
38754 type_result.type.const_qualified = is_const<Functor>::value;
38755 type_result.type.volatile_qualified = is_volatile<Functor>::value;
38756 get_vtable()->manager(functor, type_result,
38757 detail::function::check_functor_type_tag);
38758 return static_cast<Functor*>(type_result.obj_ptr);
38759 }
38760 template<typename Functor>
38761 const Functor* target() const
38762 {
38763 if (!vtable) return 0;
38764 detail::function::function_buffer type_result;
38765 type_result.type.type = &typeid(Functor);
38766 type_result.type.const_qualified = true;
38767 type_result.type.volatile_qualified = is_volatile<Functor>::value;
38768 get_vtable()->manager(functor, type_result,
38769 detail::function::check_functor_type_tag);
38770 return (const Functor*)(type_result.obj_ptr);
38771 }
38772 template<typename F>
38773 bool contains(const F& f) const
38774 {
38775 if (const F* fp = this->template target<F>())
38776 {
38777 return function_equal(*fp, f);
38778 } else {
38779 return false;
38780 }
38781 }
38782 public:
38783 detail::function::vtable_base* get_vtable() const {
38784 return reinterpret_cast<detail::function::vtable_base*>(
38785 reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
38786 }
38787 bool has_trivial_copy_and_destroy() const {
38788 return reinterpret_cast<std::size_t>(vtable) & 0x01;
38789 }
38790 detail::function::vtable_base* vtable;
38791 mutable detail::function::function_buffer functor;
38792 };
38793 class bad_function_call : public std::runtime_error
38794 {
38795 public:
38796 bad_function_call() : std::runtime_error("call to empty boost::function") {}
38797 };
38798 inline bool operator==(const function_base& f,
38799 detail::function::useless_clear_type*)
38800 {
38801 return f.empty();
38802 }
38803 inline bool operator!=(const function_base& f,
38804 detail::function::useless_clear_type*)
38805 {
38806 return !f.empty();
38807 }
38808 inline bool operator==(detail::function::useless_clear_type*,
38809 const function_base& f)
38810 {
38811 return f.empty();
38812 }
38813 inline bool operator!=(detail::function::useless_clear_type*,
38814 const function_base& f)
38815 {
38816 return !f.empty();
38817 }
38818 template<typename Functor>
38819 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38820 operator==(const function_base& f, Functor g)
38821 {
38822 if (const Functor* fp = f.template target<Functor>())
38823 return function_equal(*fp, g);
38824 else return false;
38825 }
38826 template<typename Functor>
38827 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38828 operator==(Functor g, const function_base& f)
38829 {
38830 if (const Functor* fp = f.template target<Functor>())
38831 return function_equal(g, *fp);
38832 else return false;
38833 }
38834 template<typename Functor>
38835 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38836 operator!=(const function_base& f, Functor g)
38837 {
38838 if (const Functor* fp = f.template target<Functor>())
38839 return !function_equal(*fp, g);
38840 else return true;
38841 }
38842 template<typename Functor>
38843 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38844 operator!=(Functor g, const function_base& f)
38845 {
38846 if (const Functor* fp = f.template target<Functor>())
38847 return !function_equal(g, *fp);
38848 else return true;
38849 }
38850 template<typename Functor>
38851 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38852 operator==(const function_base& f, reference_wrapper<Functor> g)
38853 {
38854 if (const Functor* fp = f.template target<Functor>())
38855 return fp == g.get_pointer();
38856 else return false;
38857 }
38858 template<typename Functor>
38859 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38860 operator==(reference_wrapper<Functor> g, const function_base& f)
38861 {
38862 if (const Functor* fp = f.template target<Functor>())
38863 return g.get_pointer() == fp;
38864 else return false;
38865 }
38866 template<typename Functor>
38867 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38868 operator!=(const function_base& f, reference_wrapper<Functor> g)
38869 {
38870 if (const Functor* fp = f.template target<Functor>())
38871 return fp != g.get_pointer();
38872 else return true;
38873 }
38874 template<typename Functor>
38875 typename ::boost::enable_if_c<(::boost::type_traits::ice_not< (::boost::is_integral<Functor>::value)>::value), bool>::type
38876 operator!=(reference_wrapper<Functor> g, const function_base& f)
38877 {
38878 if (const Functor* fp = f.template target<Functor>())
38879 return g.get_pointer() != fp;
38880 else return true;
38881 }
38882 namespace detail {
38883 namespace function {
38884 inline bool has_empty_target(const function_base* f)
38885 {
38886 return f->empty();
38887 }
38888 inline bool has_empty_target(...)
38889 {
38890 return false;
38891 }
38892 }
38893 }
38894 }
38895 namespace boost {
38896 template<class T> T * get_pointer(T * p)
38897 {
38898 return p;
38899 }
38900 template<class T> T * get_pointer(std::auto_ptr<T> const& p)
38901 {
38902 return p.get();
38903 }
38904 }
38905 namespace boost
38906 {
38907 namespace _mfi
38908 {
38909 template<class R, class T > class mf0
38910 {
38911 public:
38912 typedef R result_type;
38913 typedef T * argument_type;
38914 private:
38915 typedef R ( T::*F) ();
38916 F f_;
38917 template<class U> R call(U & u, T const *) const
38918 {
38919 return (u.*f_)();
38920 }
38921 template<class U> R call(U & u, void const *) const
38922 {
38923 return (get_pointer(u)->*f_)();
38924 }
38925 public:
38926 explicit mf0(F f): f_(f) {}
38927 R operator()(T * p) const
38928 {
38929 return (p->*f_)();
38930 }
38931 template<class U> R operator()(U & u) const
38932 {
38933 U const * p = 0;
38934 return call(u, p);
38935 }
38936 template<class U> R operator()(U const & u) const
38937 {
38938 U const * p = 0;
38939 return call(u, p);
38940 }
38941 R operator()(T & t) const
38942 {
38943 return (t.*f_)();
38944 }
38945 bool operator==(mf0 const & rhs) const
38946 {
38947 return f_ == rhs.f_;
38948 }
38949 bool operator!=(mf0 const & rhs) const
38950 {
38951 return f_ != rhs.f_;
38952 }
38953 };
38954 template<class R, class T > class cmf0
38955 {
38956 public:
38957 typedef R result_type;
38958 typedef T const * argument_type;
38959 private:
38960 typedef R ( T::*F) () const;
38961 F f_;
38962 template<class U> R call(U & u, T const *) const
38963 {
38964 return (u.*f_)();
38965 }
38966 template<class U> R call(U & u, void const *) const
38967 {
38968 return (get_pointer(u)->*f_)();
38969 }
38970 public:
38971 explicit cmf0(F f): f_(f) {}
38972 template<class U> R operator()(U const & u) const
38973 {
38974 U const * p = 0;
38975 return call(u, p);
38976 }
38977 R operator()(T const & t) const
38978 {
38979 return (t.*f_)();
38980 }
38981 bool operator==(cmf0 const & rhs) const
38982 {
38983 return f_ == rhs.f_;
38984 }
38985 bool operator!=(cmf0 const & rhs) const
38986 {
38987 return f_ != rhs.f_;
38988 }
38989 };
38990 template<class R, class T, class A1 > class mf1
38991 {
38992 public:
38993 typedef R result_type;
38994 typedef T * first_argument_type;
38995 typedef A1 second_argument_type;
38996 private:
38997 typedef R ( T::*F) (A1);
38998 F f_;
38999 template<class U, class B1> R call(U & u, T const *, B1 & b1) const
39000 {
39001 return (u.*f_)(b1);
39002 }
39003 template<class U, class B1> R call(U & u, void const *, B1 & b1) const
39004 {
39005 return (get_pointer(u)->*f_)(b1);
39006 }
39007 public:
39008 explicit mf1(F f): f_(f) {}
39009 R operator()(T * p, A1 a1) const
39010 {
39011 return (p->*f_)(a1);
39012 }
39013 template<class U> R operator()(U & u, A1 a1) const
39014 {
39015 U const * p = 0;
39016 return call(u, p, a1);
39017 }
39018 template<class U> R operator()(U const & u, A1 a1) const
39019 {
39020 U const * p = 0;
39021 return call(u, p, a1);
39022 }
39023 R operator()(T & t, A1 a1) const
39024 {
39025 return (t.*f_)(a1);
39026 }
39027 bool operator==(mf1 const & rhs) const
39028 {
39029 return f_ == rhs.f_;
39030 }
39031 bool operator!=(mf1 const & rhs) const
39032 {
39033 return f_ != rhs.f_;
39034 }
39035 };
39036 template<class R, class T, class A1 > class cmf1
39037 {
39038 public:
39039 typedef R result_type;
39040 typedef T const * first_argument_type;
39041 typedef A1 second_argument_type;
39042 private:
39043 typedef R ( T::*F) (A1) const;
39044 F f_;
39045 template<class U, class B1> R call(U & u, T const *, B1 & b1) const
39046 {
39047 return (u.*f_)(b1);
39048 }
39049 template<class U, class B1> R call(U & u, void const *, B1 & b1) const
39050 {
39051 return (get_pointer(u)->*f_)(b1);
39052 }
39053 public:
39054 explicit cmf1(F f): f_(f) {}
39055 template<class U> R operator()(U const & u, A1 a1) const
39056 {
39057 U const * p = 0;
39058 return call(u, p, a1);
39059 }
39060 R operator()(T const & t, A1 a1) const
39061 {
39062 return (t.*f_)(a1);
39063 }
39064 bool operator==(cmf1 const & rhs) const
39065 {
39066 return f_ == rhs.f_;
39067 }
39068 bool operator!=(cmf1 const & rhs) const
39069 {
39070 return f_ != rhs.f_;
39071 }
39072 };
39073 template<class R, class T, class A1, class A2 > class mf2
39074 {
39075 public:
39076 typedef R result_type;
39077 private:
39078 typedef R ( T::*F) (A1, A2);
39079 F f_;
39080 template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
39081 {
39082 return (u.*f_)(b1, b2);
39083 }
39084 template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
39085 {
39086 return (get_pointer(u)->*f_)(b1, b2);
39087 }
39088 public:
39089 explicit mf2(F f): f_(f) {}
39090 R operator()(T * p, A1 a1, A2 a2) const
39091 {
39092 return (p->*f_)(a1, a2);
39093 }
39094 template<class U> R operator()(U & u, A1 a1, A2 a2) const
39095 {
39096 U const * p = 0;
39097 return call(u, p, a1, a2);
39098 }
39099 template<class U> R operator()(U const & u, A1 a1, A2 a2) const
39100 {
39101 U const * p = 0;
39102 return call(u, p, a1, a2);
39103 }
39104 R operator()(T & t, A1 a1, A2 a2) const
39105 {
39106 return (t.*f_)(a1, a2);
39107 }
39108 bool operator==(mf2 const & rhs) const
39109 {
39110 return f_ == rhs.f_;
39111 }
39112 bool operator!=(mf2 const & rhs) const
39113 {
39114 return f_ != rhs.f_;
39115 }
39116 };
39117 template<class R, class T, class A1, class A2 > class cmf2
39118 {
39119 public:
39120 typedef R result_type;
39121 private:
39122 typedef R ( T::*F) (A1, A2) const;
39123 F f_;
39124 template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
39125 {
39126 return (u.*f_)(b1, b2);
39127 }
39128 template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
39129 {
39130 return (get_pointer(u)->*f_)(b1, b2);
39131 }
39132 public:
39133 explicit cmf2(F f): f_(f) {}
39134 template<class U> R operator()(U const & u, A1 a1, A2 a2) const
39135 {
39136 U const * p = 0;
39137 return call(u, p, a1, a2);
39138 }
39139 R operator()(T const & t, A1 a1, A2 a2) const
39140 {
39141 return (t.*f_)(a1, a2);
39142 }
39143 bool operator==(cmf2 const & rhs) const
39144 {
39145 return f_ == rhs.f_;
39146 }
39147 bool operator!=(cmf2 const & rhs) const
39148 {
39149 return f_ != rhs.f_;
39150 }
39151 };
39152 template<class R, class T, class A1, class A2, class A3 > class mf3
39153 {
39154 public:
39155 typedef R result_type;
39156 private:
39157 typedef R ( T::*F) (A1, A2, A3);
39158 F f_;
39159 template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
39160 {
39161 return (u.*f_)(b1, b2, b3);
39162 }
39163 template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
39164 {
39165 return (get_pointer(u)->*f_)(b1, b2, b3);
39166 }
39167 public:
39168 explicit mf3(F f): f_(f) {}
39169 R operator()(T * p, A1 a1, A2 a2, A3 a3) const
39170 {
39171 return (p->*f_)(a1, a2, a3);
39172 }
39173 template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3) const
39174 {
39175 U const * p = 0;
39176 return call(u, p, a1, a2, a3);
39177 }
39178 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
39179 {
39180 U const * p = 0;
39181 return call(u, p, a1, a2, a3);
39182 }
39183 R operator()(T & t, A1 a1, A2 a2, A3 a3) const
39184 {
39185 return (t.*f_)(a1, a2, a3);
39186 }
39187 bool operator==(mf3 const & rhs) const
39188 {
39189 return f_ == rhs.f_;
39190 }
39191 bool operator!=(mf3 const & rhs) const
39192 {
39193 return f_ != rhs.f_;
39194 }
39195 };
39196 template<class R, class T, class A1, class A2, class A3 > class cmf3
39197 {
39198 public:
39199 typedef R result_type;
39200 private:
39201 typedef R ( T::*F) (A1, A2, A3) const;
39202 F f_;
39203 template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
39204 {
39205 return (u.*f_)(b1, b2, b3);
39206 }
39207 template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
39208 {
39209 return (get_pointer(u)->*f_)(b1, b2, b3);
39210 }
39211 public:
39212 explicit cmf3(F f): f_(f) {}
39213 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
39214 {
39215 U const * p = 0;
39216 return call(u, p, a1, a2, a3);
39217 }
39218 R operator()(T const & t, A1 a1, A2 a2, A3 a3) const
39219 {
39220 return (t.*f_)(a1, a2, a3);
39221 }
39222 bool operator==(cmf3 const & rhs) const
39223 {
39224 return f_ == rhs.f_;
39225 }
39226 bool operator!=(cmf3 const & rhs) const
39227 {
39228 return f_ != rhs.f_;
39229 }
39230 };
39231 template<class R, class T, class A1, class A2, class A3, class A4 > class mf4
39232 {
39233 public:
39234 typedef R result_type;
39235 private:
39236 typedef R ( T::*F) (A1, A2, A3, A4);
39237 F f_;
39238 template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
39239 {
39240 return (u.*f_)(b1, b2, b3, b4);
39241 }
39242 template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
39243 {
39244 return (get_pointer(u)->*f_)(b1, b2, b3, b4);
39245 }
39246 public:
39247 explicit mf4(F f): f_(f) {}
39248 R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4) const
39249 {
39250 return (p->*f_)(a1, a2, a3, a4);
39251 }
39252 template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const
39253 {
39254 U const * p = 0;
39255 return call(u, p, a1, a2, a3, a4);
39256 }
39257 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
39258 {
39259 U const * p = 0;
39260 return call(u, p, a1, a2, a3, a4);
39261 }
39262 R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const
39263 {
39264 return (t.*f_)(a1, a2, a3, a4);
39265 }
39266 bool operator==(mf4 const & rhs) const
39267 {
39268 return f_ == rhs.f_;
39269 }
39270 bool operator!=(mf4 const & rhs) const
39271 {
39272 return f_ != rhs.f_;
39273 }
39274 };
39275 template<class R, class T, class A1, class A2, class A3, class A4 > class cmf4
39276 {
39277 public:
39278 typedef R result_type;
39279 private:
39280 typedef R ( T::*F) (A1, A2, A3, A4) const;
39281 F f_;
39282 template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
39283 {
39284 return (u.*f_)(b1, b2, b3, b4);
39285 }
39286 template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
39287 {
39288 return (get_pointer(u)->*f_)(b1, b2, b3, b4);
39289 }
39290 public:
39291 explicit cmf4(F f): f_(f) {}
39292 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
39293 {
39294 U const * p = 0;
39295 return call(u, p, a1, a2, a3, a4);
39296 }
39297 R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const
39298 {
39299 return (t.*f_)(a1, a2, a3, a4);
39300 }
39301 bool operator==(cmf4 const & rhs) const
39302 {
39303 return f_ == rhs.f_;
39304 }
39305 bool operator!=(cmf4 const & rhs) const
39306 {
39307 return f_ != rhs.f_;
39308 }
39309 };
39310 template<class R, class T, class A1, class A2, class A3, class A4, class A5 > class mf5
39311 {
39312 public:
39313 typedef R result_type;
39314 private:
39315 typedef R ( T::*F) (A1, A2, A3, A4, A5);
39316 F f_;
39317 template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
39318 {
39319 return (u.*f_)(b1, b2, b3, b4, b5);
39320 }
39321 template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
39322 {
39323 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
39324 }
39325 public:
39326 explicit mf5(F f): f_(f) {}
39327 R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
39328 {
39329 return (p->*f_)(a1, a2, a3, a4, a5);
39330 }
39331 template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
39332 {
39333 U const * p = 0;
39334 return call(u, p, a1, a2, a3, a4, a5);
39335 }
39336 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
39337 {
39338 U const * p = 0;
39339 return call(u, p, a1, a2, a3, a4, a5);
39340 }
39341 R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
39342 {
39343 return (t.*f_)(a1, a2, a3, a4, a5);
39344 }
39345 bool operator==(mf5 const & rhs) const
39346 {
39347 return f_ == rhs.f_;
39348 }
39349 bool operator!=(mf5 const & rhs) const
39350 {
39351 return f_ != rhs.f_;
39352 }
39353 };
39354 template<class R, class T, class A1, class A2, class A3, class A4, class A5 > class cmf5
39355 {
39356 public:
39357 typedef R result_type;
39358 private:
39359 typedef R ( T::*F) (A1, A2, A3, A4, A5) const;
39360 F f_;
39361 template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
39362 {
39363 return (u.*f_)(b1, b2, b3, b4, b5);
39364 }
39365 template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
39366 {
39367 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
39368 }
39369 public:
39370 explicit cmf5(F f): f_(f) {}
39371 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
39372 {
39373 U const * p = 0;
39374 return call(u, p, a1, a2, a3, a4, a5);
39375 }
39376 R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
39377 {
39378 return (t.*f_)(a1, a2, a3, a4, a5);
39379 }
39380 bool operator==(cmf5 const & rhs) const
39381 {
39382 return f_ == rhs.f_;
39383 }
39384 bool operator!=(cmf5 const & rhs) const
39385 {
39386 return f_ != rhs.f_;
39387 }
39388 };
39389 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 > class mf6
39390 {
39391 public:
39392 typedef R result_type;
39393 private:
39394 typedef R ( T::*F) (A1, A2, A3, A4, A5, A6);
39395 F f_;
39396 template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
39397 {
39398 return (u.*f_)(b1, b2, b3, b4, b5, b6);
39399 }
39400 template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
39401 {
39402 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
39403 }
39404 public:
39405 explicit mf6(F f): f_(f) {}
39406 R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
39407 {
39408 return (p->*f_)(a1, a2, a3, a4, a5, a6);
39409 }
39410 template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
39411 {
39412 U const * p = 0;
39413 return call(u, p, a1, a2, a3, a4, a5, a6);
39414 }
39415 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
39416 {
39417 U const * p = 0;
39418 return call(u, p, a1, a2, a3, a4, a5, a6);
39419 }
39420 R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
39421 {
39422 return (t.*f_)(a1, a2, a3, a4, a5, a6);
39423 }
39424 bool operator==(mf6 const & rhs) const
39425 {
39426 return f_ == rhs.f_;
39427 }
39428 bool operator!=(mf6 const & rhs) const
39429 {
39430 return f_ != rhs.f_;
39431 }
39432 };
39433 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 > class cmf6
39434 {
39435 public:
39436 typedef R result_type;
39437 private:
39438 typedef R ( T::*F) (A1, A2, A3, A4, A5, A6) const;
39439 F f_;
39440 template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
39441 {
39442 return (u.*f_)(b1, b2, b3, b4, b5, b6);
39443 }
39444 template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
39445 {
39446 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
39447 }
39448 public:
39449 explicit cmf6(F f): f_(f) {}
39450 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
39451 {
39452 U const * p = 0;
39453 return call(u, p, a1, a2, a3, a4, a5, a6);
39454 }
39455 R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
39456 {
39457 return (t.*f_)(a1, a2, a3, a4, a5, a6);
39458 }
39459 bool operator==(cmf6 const & rhs) const
39460 {
39461 return f_ == rhs.f_;
39462 }
39463 bool operator!=(cmf6 const & rhs) const
39464 {
39465 return f_ != rhs.f_;
39466 }
39467 };
39468 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class mf7
39469 {
39470 public:
39471 typedef R result_type;
39472 private:
39473 typedef R ( T::*F) (A1, A2, A3, A4, A5, A6, A7);
39474 F f_;
39475 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
39476 {
39477 return (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
39478 }
39479 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
39480 {
39481 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
39482 }
39483 public:
39484 explicit mf7(F f): f_(f) {}
39485 R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
39486 {
39487 return (p->*f_)(a1, a2, a3, a4, a5, a6, a7);
39488 }
39489 template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
39490 {
39491 U const * p = 0;
39492 return call(u, p, a1, a2, a3, a4, a5, a6, a7);
39493 }
39494 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
39495 {
39496 U const * p = 0;
39497 return call(u, p, a1, a2, a3, a4, a5, a6, a7);
39498 }
39499 R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
39500 {
39501 return (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
39502 }
39503 bool operator==(mf7 const & rhs) const
39504 {
39505 return f_ == rhs.f_;
39506 }
39507 bool operator!=(mf7 const & rhs) const
39508 {
39509 return f_ != rhs.f_;
39510 }
39511 };
39512 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class cmf7
39513 {
39514 public:
39515 typedef R result_type;
39516 private:
39517 typedef R ( T::*F) (A1, A2, A3, A4, A5, A6, A7) const;
39518 F f_;
39519 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
39520 {
39521 return (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
39522 }
39523 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
39524 {
39525 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
39526 }
39527 public:
39528 explicit cmf7(F f): f_(f) {}
39529 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
39530 {
39531 U const * p = 0;
39532 return call(u, p, a1, a2, a3, a4, a5, a6, a7);
39533 }
39534 R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
39535 {
39536 return (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
39537 }
39538 bool operator==(cmf7 const & rhs) const
39539 {
39540 return f_ == rhs.f_;
39541 }
39542 bool operator!=(cmf7 const & rhs) const
39543 {
39544 return f_ != rhs.f_;
39545 }
39546 };
39547 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class mf8
39548 {
39549 public:
39550 typedef R result_type;
39551 private:
39552 typedef R ( T::*F) (A1, A2, A3, A4, A5, A6, A7, A8);
39553 F f_;
39554 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
39555 {
39556 return (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
39557 }
39558 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
39559 {
39560 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
39561 }
39562 public:
39563 explicit mf8(F f): f_(f) {}
39564 R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39565 {
39566 return (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
39567 }
39568 template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39569 {
39570 U const * p = 0;
39571 return call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
39572 }
39573 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39574 {
39575 U const * p = 0;
39576 return call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
39577 }
39578 R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39579 {
39580 return (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
39581 }
39582 bool operator==(mf8 const & rhs) const
39583 {
39584 return f_ == rhs.f_;
39585 }
39586 bool operator!=(mf8 const & rhs) const
39587 {
39588 return f_ != rhs.f_;
39589 }
39590 };
39591 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class cmf8
39592 {
39593 public:
39594 typedef R result_type;
39595 private:
39596 typedef R ( T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const;
39597 F f_;
39598 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
39599 {
39600 return (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
39601 }
39602 template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
39603 {
39604 return (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
39605 }
39606 public:
39607 explicit cmf8(F f): f_(f) {}
39608 R operator()(T const * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39609 {
39610 return (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
39611 }
39612 template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39613 {
39614 U const * p = 0;
39615 return call(u, p, a1, a2, a3, a4, a5, a6, a7, a8);
39616 }
39617 R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
39618 {
39619 return (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
39620 }
39621 bool operator==(cmf8 const & rhs) const
39622 {
39623 return f_ == rhs.f_;
39624 }
39625 bool operator!=(cmf8 const & rhs) const
39626 {
39627 return f_ != rhs.f_;
39628 }
39629 };
39630 }
39631 template<class R, class T> _mfi::mf0<R, T> mem_fn(R ( T::*f) ())
39632 {
39633 return _mfi::mf0<R, T>(f);
39634 }
39635 template<class R, class T> _mfi::cmf0<R, T> mem_fn(R ( T::*f) () const)
39636 {
39637 return _mfi::cmf0<R, T>(f);
39638 }
39639 template<class R, class T, class A1> _mfi::mf1<R, T, A1> mem_fn(R ( T::*f) (A1))
39640 {
39641 return _mfi::mf1<R, T, A1>(f);
39642 }
39643 template<class R, class T, class A1> _mfi::cmf1<R, T, A1> mem_fn(R ( T::*f) (A1) const)
39644 {
39645 return _mfi::cmf1<R, T, A1>(f);
39646 }
39647 template<class R, class T, class A1, class A2> _mfi::mf2<R, T, A1, A2> mem_fn(R ( T::*f) (A1, A2))
39648 {
39649 return _mfi::mf2<R, T, A1, A2>(f);
39650 }
39651 template<class R, class T, class A1, class A2> _mfi::cmf2<R, T, A1, A2> mem_fn(R ( T::*f) (A1, A2) const)
39652 {
39653 return _mfi::cmf2<R, T, A1, A2>(f);
39654 }
39655 template<class R, class T, class A1, class A2, class A3> _mfi::mf3<R, T, A1, A2, A3> mem_fn(R ( T::*f) (A1, A2, A3))
39656 {
39657 return _mfi::mf3<R, T, A1, A2, A3>(f);
39658 }
39659 template<class R, class T, class A1, class A2, class A3> _mfi::cmf3<R, T, A1, A2, A3> mem_fn(R ( T::*f) (A1, A2, A3) const)
39660 {
39661 return _mfi::cmf3<R, T, A1, A2, A3>(f);
39662 }
39663 template<class R, class T, class A1, class A2, class A3, class A4> _mfi::mf4<R, T, A1, A2, A3, A4> mem_fn(R ( T::*f) (A1, A2, A3, A4))
39664 {
39665 return _mfi::mf4<R, T, A1, A2, A3, A4>(f);
39666 }
39667 template<class R, class T, class A1, class A2, class A3, class A4> _mfi::cmf4<R, T, A1, A2, A3, A4> mem_fn(R ( T::*f) (A1, A2, A3, A4) const)
39668 {
39669 return _mfi::cmf4<R, T, A1, A2, A3, A4>(f);
39670 }
39671 template<class R, class T, class A1, class A2, class A3, class A4, class A5> _mfi::mf5<R, T, A1, A2, A3, A4, A5> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5))
39672 {
39673 return _mfi::mf5<R, T, A1, A2, A3, A4, A5>(f);
39674 }
39675 template<class R, class T, class A1, class A2, class A3, class A4, class A5> _mfi::cmf5<R, T, A1, A2, A3, A4, A5> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5) const)
39676 {
39677 return _mfi::cmf5<R, T, A1, A2, A3, A4, A5>(f);
39678 }
39679 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> _mfi::mf6<R, T, A1, A2, A3, A4, A5, A6> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5, A6))
39680 {
39681 return _mfi::mf6<R, T, A1, A2, A3, A4, A5, A6>(f);
39682 }
39683 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> _mfi::cmf6<R, T, A1, A2, A3, A4, A5, A6> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5, A6) const)
39684 {
39685 return _mfi::cmf6<R, T, A1, A2, A3, A4, A5, A6>(f);
39686 }
39687 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> _mfi::mf7<R, T, A1, A2, A3, A4, A5, A6, A7> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5, A6, A7))
39688 {
39689 return _mfi::mf7<R, T, A1, A2, A3, A4, A5, A6, A7>(f);
39690 }
39691 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> _mfi::cmf7<R, T, A1, A2, A3, A4, A5, A6, A7> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5, A6, A7) const)
39692 {
39693 return _mfi::cmf7<R, T, A1, A2, A3, A4, A5, A6, A7>(f);
39694 }
39695 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> _mfi::mf8<R, T, A1, A2, A3, A4, A5, A6, A7, A8> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5, A6, A7, A8))
39696 {
39697 return _mfi::mf8<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f);
39698 }
39699 template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> _mfi::cmf8<R, T, A1, A2, A3, A4, A5, A6, A7, A8> mem_fn(R ( T::*f) (A1, A2, A3, A4, A5, A6, A7, A8) const)
39700 {
39701 return _mfi::cmf8<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f);
39702 }
39703 namespace _mfi
39704 {
39705 template<class R, class T> class dm
39706 {
39707 public:
39708 typedef R const & result_type;
39709 typedef T const * argument_type;
39710 private:
39711 typedef R (T::*F);
39712 F f_;
39713 template<class U> R const & call(U & u, T const *) const
39714 {
39715 return (u.*f_);
39716 }
39717 template<class U> R const & call(U & u, void const *) const
39718 {
39719 return (get_pointer(u)->*f_);
39720 }
39721 public:
39722 explicit dm(F f): f_(f) {}
39723 R & operator()(T * p) const
39724 {
39725 return (p->*f_);
39726 }
39727 R const & operator()(T const * p) const
39728 {
39729 return (p->*f_);
39730 }
39731 template<class U> R const & operator()(U const & u) const
39732 {
39733 return call(u, &u);
39734 }
39735 R & operator()(T & t) const
39736 {
39737 return (t.*f_);
39738 }
39739 R const & operator()(T const & t) const
39740 {
39741 return (t.*f_);
39742 }
39743 bool operator==(dm const & rhs) const
39744 {
39745 return f_ == rhs.f_;
39746 }
39747 bool operator!=(dm const & rhs) const
39748 {
39749 return f_ != rhs.f_;
39750 }
39751 };
39752 }
39753 template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
39754 {
39755 return _mfi::dm<R, T>(f);
39756 }
39757 }
39758 namespace boost {
39759 namespace detail {
39760 namespace function {
39761 template<
39762 typename FunctionPtr,
39763 typename R
39764
39765 >
39766 struct function_invoker0
39767 {
39768 static R invoke(function_buffer& function_ptr
39769 )
39770 {
39771 FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
39772 return f();
39773 }
39774 };
39775 template<
39776 typename FunctionPtr,
39777 typename R
39778
39779 >
39780 struct void_function_invoker0
39781 {
39782 static void
39783 invoke(function_buffer& function_ptr
39784 )
39785 {
39786 FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
39787 f();
39788 }
39789 };
39790 template<
39791 typename FunctionObj,
39792 typename R
39793
39794 >
39795 struct function_obj_invoker0
39796 {
39797 static R invoke(function_buffer& function_obj_ptr
39798 )
39799 {
39800 FunctionObj* f;
39801 if (function_allows_small_object_optimization<FunctionObj>::value)
39802 f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
39803 else
39804 f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
39805 return (*f)();
39806 }
39807 };
39808 template<
39809 typename FunctionObj,
39810 typename R
39811
39812 >
39813 struct void_function_obj_invoker0
39814 {
39815 static void
39816 invoke(function_buffer& function_obj_ptr
39817 )
39818 {
39819 FunctionObj* f;
39820 if (function_allows_small_object_optimization<FunctionObj>::value)
39821 f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
39822 else
39823 f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
39824 (*f)();
39825 }
39826 };
39827 template<
39828 typename FunctionObj,
39829 typename R
39830
39831 >
39832 struct function_ref_invoker0
39833 {
39834 static R invoke(function_buffer& function_obj_ptr
39835 )
39836 {
39837 FunctionObj* f =
39838 reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
39839 return (*f)();
39840 }
39841 };
39842 template<
39843 typename FunctionObj,
39844 typename R
39845
39846 >
39847 struct void_function_ref_invoker0
39848 {
39849 static void
39850 invoke(function_buffer& function_obj_ptr
39851 )
39852 {
39853 FunctionObj* f =
39854 reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
39855 (*f)();
39856 }
39857 };
39858 template<
39859 typename FunctionPtr,
39860 typename R
39861
39862 >
39863 struct get_function_invoker0
39864 {
39865 typedef typename mpl::if_c<(is_void<R>::value),
39866 void_function_invoker0<
39867 FunctionPtr,
39868 R
39869
39870 >,
39871 function_invoker0<
39872 FunctionPtr,
39873 R
39874
39875 >
39876 >::type type;
39877 };
39878 template<
39879 typename FunctionObj,
39880 typename R
39881
39882 >
39883 struct get_function_obj_invoker0
39884 {
39885 typedef typename mpl::if_c<(is_void<R>::value),
39886 void_function_obj_invoker0<
39887 FunctionObj,
39888 R
39889
39890 >,
39891 function_obj_invoker0<
39892 FunctionObj,
39893 R
39894
39895 >
39896 >::type type;
39897 };
39898 template<
39899 typename FunctionObj,
39900 typename R
39901
39902 >
39903 struct get_function_ref_invoker0
39904 {
39905 typedef typename mpl::if_c<(is_void<R>::value),
39906 void_function_ref_invoker0<
39907 FunctionObj,
39908 R
39909
39910 >,
39911 function_ref_invoker0<
39912 FunctionObj,
39913 R
39914
39915 >
39916 >::type type;
39917 };
39918 template<typename Tag>
39919 struct get_invoker0 { };
39920 template<>
39921 struct get_invoker0<function_ptr_tag>
39922 {
39923 template<typename FunctionPtr,
39924 typename R >
39925 struct apply
39926 {
39927 typedef typename get_function_invoker0<
39928 FunctionPtr,
39929 R
39930
39931 >::type
39932 invoker_type;
39933 typedef functor_manager<FunctionPtr> manager_type;
39934 };
39935 template<typename FunctionPtr,
39936 typename R ,
39937 typename Allocator>
39938 struct apply_a
39939 {
39940 typedef typename get_function_invoker0<
39941 FunctionPtr,
39942 R
39943
39944 >::type
39945 invoker_type;
39946 typedef functor_manager<FunctionPtr> manager_type;
39947 };
39948 };
39949 template<>
39950 struct get_invoker0<function_obj_tag>
39951 {
39952 template<typename FunctionObj,
39953 typename R >
39954 struct apply
39955 {
39956 typedef typename get_function_obj_invoker0<
39957 FunctionObj,
39958 R
39959
39960 >::type
39961 invoker_type;
39962 typedef functor_manager<FunctionObj> manager_type;
39963 };
39964 template<typename FunctionObj,
39965 typename R ,
39966 typename Allocator>
39967 struct apply_a
39968 {
39969 typedef typename get_function_obj_invoker0<
39970 FunctionObj,
39971 R
39972
39973 >::type
39974 invoker_type;
39975 typedef functor_manager_a<FunctionObj, Allocator> manager_type;
39976 };
39977 };
39978 template<>
39979 struct get_invoker0<function_obj_ref_tag>
39980 {
39981 template<typename RefWrapper,
39982 typename R >
39983 struct apply
39984 {
39985 typedef typename get_function_ref_invoker0<
39986 typename RefWrapper::type,
39987 R
39988
39989 >::type
39990 invoker_type;
39991 typedef reference_manager<typename RefWrapper::type> manager_type;
39992 };
39993 template<typename RefWrapper,
39994 typename R ,
39995 typename Allocator>
39996 struct apply_a
39997 {
39998 typedef typename get_function_ref_invoker0<
39999 typename RefWrapper::type,
40000 R
40001
40002 >::type
40003 invoker_type;
40004 typedef reference_manager<typename RefWrapper::type> manager_type;
40005 };
40006 };
40007 template<typename R >
40008 struct basic_vtable0
40009 {
40010 typedef R result_type;
40011 typedef result_type (*invoker_type)(function_buffer&
40012
40013 );
40014 template<typename F>
40015 bool assign_to(F f, function_buffer& functor)
40016 {
40017 typedef typename get_function_tag<F>::type tag;
40018 return assign_to(f, functor, tag());
40019 }
40020 template<typename F,typename Allocator>
40021 bool assign_to_a(F f, function_buffer& functor, Allocator a)
40022 {
40023 typedef typename get_function_tag<F>::type tag;
40024 return assign_to_a(f, functor, a, tag());
40025 }
40026 void clear(function_buffer& functor)
40027 {
40028 if (base.manager)
40029 base.manager(functor, functor, destroy_functor_tag);
40030 }
40031 private:
40032 template<typename FunctionPtr>
40033 bool
40034 assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag)
40035 {
40036 this->clear(functor);
40037 if (f) {
40038 functor.func_ptr = (void (*)())(f);
40039 return true;
40040 } else {
40041 return false;
40042 }
40043 }
40044 template<typename FunctionPtr,typename Allocator>
40045 bool
40046 assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag)
40047 {
40048 return assign_to(f,functor,function_ptr_tag());
40049 }
40050 template<typename FunctionObj>
40051 void
40052 assign_functor(FunctionObj f, function_buffer& functor, mpl::true_)
40053 {
40054 new ((void*)&functor.data) FunctionObj(f);
40055 }
40056 template<typename FunctionObj,typename Allocator>
40057 void
40058 assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, mpl::true_)
40059 {
40060 assign_functor(f,functor,mpl::true_());
40061 }
40062 template<typename FunctionObj>
40063 void
40064 assign_functor(FunctionObj f, function_buffer& functor, mpl::false_)
40065 {
40066 functor.obj_ptr = new FunctionObj(f);
40067 }
40068 template<typename FunctionObj,typename Allocator>
40069 void
40070 assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_)
40071 {
40072 typedef functor_wrapper<FunctionObj,Allocator> functor_wrapper_type;
40073 typedef typename Allocator::template rebind<functor_wrapper_type>::other
40074 wrapper_allocator_type;
40075 typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type;
40076 wrapper_allocator_type wrapper_allocator(a);
40077 wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1);
40078 wrapper_allocator.construct(copy, functor_wrapper_type(f,a));
40079 functor_wrapper_type* new_f = static_cast<functor_wrapper_type*>(copy);
40080 functor.obj_ptr = new_f;
40081 }
40082 template<typename FunctionObj>
40083 bool
40084 assign_to(FunctionObj f, function_buffer& functor, function_obj_tag)
40085 {
40086 if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
40087 assign_functor(f, functor,
40088 mpl::bool_<(function_allows_small_object_optimization<FunctionObj>::value)>());
40089 return true;
40090 } else {
40091 return false;
40092 }
40093 }
40094 template<typename FunctionObj,typename Allocator>
40095 bool
40096 assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag)
40097 {
40098 if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
40099 assign_functor_a(f, functor, a,
40100 mpl::bool_<(function_allows_small_object_optimization<FunctionObj>::value)>());
40101 return true;
40102 } else {
40103 return false;
40104 }
40105 }
40106 template<typename FunctionObj>
40107 bool
40108 assign_to(const reference_wrapper<FunctionObj>& f,
40109 function_buffer& functor, function_obj_ref_tag)
40110 {
40111 functor.obj_ref.obj_ptr = (void *)f.get_pointer();
40112 functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
40113 functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
40114 return true;
40115 }
40116 template<typename FunctionObj,typename Allocator>
40117 bool
40118 assign_to_a(const reference_wrapper<FunctionObj>& f,
40119 function_buffer& functor, Allocator, function_obj_ref_tag)
40120 {
40121 return assign_to(f,functor,function_obj_ref_tag());
40122 }
40123 public:
40124 vtable_base base;
40125 invoker_type invoker;
40126 };
40127 }
40128 }
40129 template<
40130 typename R
40131
40132 >
40133 class function0 : public function_base
40134 {
40135 public:
40136 typedef R result_type;
40137 private:
40138 typedef boost::detail::function::basic_vtable0<
40139 R >
40140 vtable_type;
40141 vtable_type* get_vtable() const {
40142 return reinterpret_cast<vtable_type*>(
40143 reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
40144 }
40145 struct clear_type {};
40146 public:
40147 static const int args = 0;
40148 template<typename Args>
40149 struct sig
40150 {
40151 typedef result_type type;
40152 };
40153 static const int arity = 0;
40154
40155 typedef function0 self_type;
40156 function0() : function_base() { }
40157 template<typename Functor>
40158 function0(Functor f
40159 ,typename enable_if_c<
40160 (boost::type_traits::ice_not<
40161 (is_integral<Functor>::value)>::value),
40162 int>::type = 0
40163 ) :
40164 function_base()
40165 {
40166 this->assign_to(f);
40167 }
40168 template<typename Functor,typename Allocator>
40169 function0(Functor f, Allocator a
40170 ,typename enable_if_c<
40171 (boost::type_traits::ice_not<
40172 (is_integral<Functor>::value)>::value),
40173 int>::type = 0
40174 ) :
40175 function_base()
40176 {
40177 this->assign_to_a(f,a);
40178 }
40179 function0(clear_type*) : function_base() { }
40180 function0(const function0& f) : function_base()
40181 {
40182 this->assign_to_own(f);
40183 }
40184 ~function0() { clear(); }
40185 result_type operator()() const;
40186 template<typename Functor>
40187 typename enable_if_c<
40188 (boost::type_traits::ice_not<
40189 (is_integral<Functor>::value)>::value),
40190 function0&>::type
40191 operator=(Functor f)
40192 {
40193 this->clear();
40194 { try {
40195 this->assign_to(f);
40196 } catch(...) {
40197 vtable = 0;
40198 throw;;
40199 }
40200 }
40201 return *this;
40202 }
40203 template<typename Functor,typename Allocator>
40204 void assign(Functor f, Allocator a)
40205 {
40206 this->clear();
40207 { try{
40208 this->assign_to_a(f,a);
40209 } catch(...) {
40210 vtable = 0;
40211 throw;;
40212 }
40213 }
40214 }
40215 function0& operator=(clear_type*)
40216 {
40217 this->clear();
40218 return *this;
40219 }
40220 function0& operator=(const function0& f)
40221 {
40222 if (&f == this)
40223 return *this;
40224 this->clear();
40225 { try {
40226 this->assign_to_own(f);
40227 } catch(...) {
40228 vtable = 0;
40229 throw;;
40230 }
40231 }
40232 return *this;
40233 }
40234 void swap(function0& other)
40235 {
40236 if (&other == this)
40237 return;
40238 function0 tmp;
40239 tmp.move_assign(*this);
40240 this->move_assign(other);
40241 other.move_assign(tmp);
40242 }
40243 void clear()
40244 {
40245 if (vtable) {
40246 if (!this->has_trivial_copy_and_destroy())
40247 get_vtable()->clear(this->functor);
40248 vtable = 0;
40249 }
40250 }
40251 private:
40252 struct dummy {
40253 void nonnull() {};
40254 };
40255 typedef void (dummy::*safe_bool)();
40256 public:
40257 operator safe_bool () const
40258 { return (this->empty())? 0 : &dummy::nonnull; }
40259 bool operator!() const
40260 { return this->empty(); }
40261 private:
40262 void assign_to_own(const function0& f)
40263 {
40264 if (!f.empty()) {
40265 this->vtable = f.vtable;
40266 if (this->has_trivial_copy_and_destroy())
40267 this->functor = f.functor;
40268 else
40269 get_vtable()->base.manager(f.functor, this->functor,
40270 boost::detail::function::clone_functor_tag);
40271 }
40272 }
40273 template<typename Functor>
40274 void assign_to(Functor f)
40275 {
40276 using detail::function::vtable_base;
40277 typedef typename detail::function::get_function_tag<Functor>::type tag;
40278 typedef detail::function::get_invoker0<tag> get_invoker;
40279 typedef typename get_invoker::
40280 template apply<Functor, R
40281 >
40282 handler_type;
40283 typedef typename handler_type::invoker_type invoker_type;
40284 typedef typename handler_type::manager_type manager_type;
40285 static vtable_type stored_vtable =
40286 { { &manager_type::manage }, &invoker_type::invoke };
40287 if (stored_vtable.assign_to(f, functor)) {
40288 std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
40289 if (boost::has_trivial_copy_constructor<Functor>::value &&
40290 boost::has_trivial_destructor<Functor>::value &&
40291 detail::function::function_allows_small_object_optimization<Functor>::value)
40292 value |= (std::size_t)0x01;
40293 vtable = reinterpret_cast<detail::function::vtable_base *>(value);
40294 } else
40295 vtable = 0;
40296 }
40297 template<typename Functor,typename Allocator>
40298 void assign_to_a(Functor f,Allocator a)
40299 {
40300 using detail::function::vtable_base;
40301 typedef typename detail::function::get_function_tag<Functor>::type tag;
40302 typedef detail::function::get_invoker0<tag> get_invoker;
40303 typedef typename get_invoker::
40304 template apply_a<Functor, R
40305 ,
40306 Allocator>
40307 handler_type;
40308 typedef typename handler_type::invoker_type invoker_type;
40309 typedef typename handler_type::manager_type manager_type;
40310 static vtable_type stored_vtable =
40311 { { &manager_type::manage }, &invoker_type::invoke };
40312 if (stored_vtable.assign_to_a(f, functor, a)) {
40313 std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
40314 if (boost::has_trivial_copy_constructor<Functor>::value &&
40315 boost::has_trivial_destructor<Functor>::value &&
40316 detail::function::function_allows_small_object_optimization<Functor>::value)
40317 value |= (std::size_t)0x01;
40318 vtable = reinterpret_cast<detail::function::vtable_base *>(value);
40319 } else
40320 vtable = 0;
40321 }
40322 void move_assign(function0& f)
40323 {
40324 if (&f == this)
40325 return;
40326 { try {
40327 if (!f.empty()) {
40328 this->vtable = f.vtable;
40329 if (this->has_trivial_copy_and_destroy())
40330 this->functor = f.functor;
40331 else
40332 get_vtable()->base.manager(f.functor, this->functor,
40333 boost::detail::function::move_functor_tag);
40334 f.vtable = 0;
40335 } else {
40336 clear();
40337 }
40338 } catch(...) {
40339 vtable = 0;
40340 throw;;
40341 }
40342 }
40343 }
40344 };
40345 template<typename R >
40346 inline void swap(function0<
40347 R
40348
40349 >& f1,
40350 function0<
40351 R
40352
40353 >& f2)
40354 {
40355 f1.swap(f2);
40356 }
40357 template<typename R >
40358 typename function0<
40359 R >::result_type
40360 inline
40361 function0<R >
40362 ::operator()() const
40363 {
40364 if (this->empty())
40365 boost::throw_exception(bad_function_call());
40366 return get_vtable()->invoker
40367 (this->functor );
40368 }
40369 template<typename R >
40370 void operator==(const function0<
40371 R
40372 >&,
40373 const function0<
40374 R
40375 >&);
40376 template<typename R >
40377 void operator!=(const function0<
40378 R
40379 >&,
40380 const function0<
40381 R
40382 >& );
40383 template<typename R
40384 >
40385 class function<R (void)>
40386 : public function0<R >
40387 {
40388 typedef function0<R > base_type;
40389 typedef function self_type;
40390 struct clear_type {};
40391 public:
40392 function() : base_type() {}
40393 template<typename Functor>
40394 function(Functor f
40395 ,typename enable_if_c<
40396 (boost::type_traits::ice_not<
40397 (is_integral<Functor>::value)>::value),
40398 int>::type = 0
40399 ) :
40400 base_type(f)
40401 {
40402 }
40403 template<typename Functor,typename Allocator>
40404 function(Functor f, Allocator a
40405 ,typename enable_if_c<
40406 (boost::type_traits::ice_not<
40407 (is_integral<Functor>::value)>::value),
40408 int>::type = 0
40409 ) :
40410 base_type(f,a)
40411 {
40412 }
40413 function(clear_type*) : base_type() {}
40414 function(const self_type& f) : base_type(static_cast<const base_type&>(f)){}
40415 function(const base_type& f) : base_type(static_cast<const base_type&>(f)){}
40416 self_type& operator=(const self_type& f)
40417 {
40418 self_type(f).swap(*this);
40419 return *this;
40420 }
40421 template<typename Functor>
40422 typename enable_if_c<
40423 (boost::type_traits::ice_not<
40424 (is_integral<Functor>::value)>::value),
40425 self_type&>::type
40426 operator=(Functor f)
40427 {
40428 self_type(f).swap(*this);
40429 return *this;
40430 }
40431 self_type& operator=(clear_type*)
40432 {
40433 this->clear();
40434 return *this;
40435 }
40436 self_type& operator=(const base_type& f)
40437 {
40438 self_type(f).swap(*this);
40439 return *this;
40440 }
40441 };
40442 }
40443 namespace boost { namespace python {
40444 struct __attribute__ ((visibility("default"))) error_already_set
40445 {
40446 virtual ~error_already_set();
40447 };
40448 bool handle_exception_impl(function0<void>);
40449 template <class T>
40450 bool handle_exception(T f)
40451 {
40452 return handle_exception_impl(function0<void>(boost::ref(f)));
40453 }
40454 namespace detail { inline void rethrow() { throw; } }
40455 inline void handle_exception()
40456 {
40457 handle_exception(detail::rethrow);
40458 }
40459 void throw_error_already_set();
40460 template <class T>
40461 inline T* expect_non_null(T* x)
40462 {
40463 if (x == 0)
40464 throw_error_already_set();
40465 return x;
40466 }
40467 PyObject* pytype_check(PyTypeObject* pytype, PyObject* source);
40468 }}
40469 namespace boost {
40470 namespace detail {
40471 template <typename T>
40472 struct has_trivial_assign_impl
40473 {
40474 static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_or< ::boost::is_pod<T>::value, __has_trivial_assign(T) >::value, ::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value, ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value >::value)
40475 ;
40476 };
40477 }
40478 template< typename T > struct has_trivial_assign : ::boost::integral_constant<bool,::boost::detail::has_trivial_assign_impl<T>::value> { };
40479 }
40480 namespace boost {
40481 namespace detail {
40482 template <typename T>
40483 struct has_trivial_ctor_impl
40484 {
40485 static const bool value = (::boost::type_traits::ice_or< ::boost::is_pod<T>::value, __has_trivial_constructor(T) >::value)
40486 ;
40487 };
40488 }
40489 template< typename T > struct has_trivial_constructor : ::boost::integral_constant<bool,::boost::detail::has_trivial_ctor_impl<T>::value> { };
40490 template< typename T > struct has_trivial_default_constructor : ::boost::integral_constant<bool,::boost::detail::has_trivial_ctor_impl<T>::value> { };
40491 }
40492 namespace boost {
40493 namespace detail{
40494 template <class T>
40495 struct has_nothrow_constructor_imp{
40496 static const bool value = (::boost::type_traits::ice_or< ::boost::has_trivial_constructor<T>::value, __has_nothrow_constructor(T) >::value)
40497 ;
40498 };
40499 }
40500 template< typename T > struct has_nothrow_constructor : ::boost::integral_constant<bool,::boost::detail::has_nothrow_constructor_imp<T>::value> { };
40501 template< typename T > struct has_nothrow_default_constructor : ::boost::integral_constant<bool,::boost::detail::has_nothrow_constructor_imp<T>::value> { };
40502 }
40503 namespace boost {
40504 namespace detail{
40505 template <class T>
40506 struct has_nothrow_copy_imp{
40507 static const bool value = (::boost::type_traits::ice_or< ::boost::has_trivial_copy<T>::value, (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value) >::value)
40508 ;
40509 };
40510 }
40511 template< typename T > struct has_nothrow_copy : ::boost::integral_constant<bool,::boost::detail::has_nothrow_copy_imp<T>::value> { };
40512 template< typename T > struct has_nothrow_copy_constructor : ::boost::integral_constant<bool,::boost::detail::has_nothrow_copy_imp<T>::value> { };
40513 }
40514 namespace boost {
40515 namespace detail{
40516 template <class T>
40517 struct has_nothrow_assign_imp{
40518 static const bool value = (::boost::type_traits::ice_or< ::boost::has_trivial_assign<T>::value, (__has_nothrow_assign(T) && !is_volatile<T>::value) >::value)
40519 ;
40520 };
40521 }
40522 template< typename T > struct has_nothrow_assign : ::boost::integral_constant<bool,::boost::detail::has_nothrow_assign_imp<T>::value> { };
40523 }
40524 namespace boost {
40525 namespace detail {
40526 template <typename B, typename D>
40527 struct is_base_and_derived_impl
40528 {
40529 typedef typename remove_cv<B>::type ncvB;
40530 typedef typename remove_cv<D>::type ncvD;
40531 static const bool value = ((__is_base_of(B,D) && !is_same<B,D>::value) && ! ::boost::is_same<ncvB,ncvD>::value);
40532 };
40533 }
40534 template< typename Base, typename Derived > struct is_base_and_derived : ::boost::integral_constant<bool,(::boost::detail::is_base_and_derived_impl<Base,Derived>::value)> { };
40535 template< typename Base, typename Derived > struct is_base_and_derived< Base&,Derived > : ::boost::integral_constant<bool,false> { };
40536 template< typename Base, typename Derived > struct is_base_and_derived< Base,Derived& > : ::boost::integral_constant<bool,false> { };
40537 template< typename Base, typename Derived > struct is_base_and_derived< Base&,Derived& > : ::boost::integral_constant<bool,false> { };
40538 }
40539 namespace boost {
40540 namespace detail {
40541 template <typename T>
40542 struct is_class_impl
40543 {
40544 static const bool value = __is_class(T);
40545 };
40546 }
40547 template< typename T > struct is_class : ::boost::integral_constant<bool,::boost::detail::is_class_impl<T>::value> { };
40548 }
40549 namespace boost {
40550 namespace detail {
40551 template <typename T>
40552 struct is_fundamental_impl
40553 : ::boost::type_traits::ice_or<
40554 ::boost::is_arithmetic<T>::value
40555 , ::boost::is_void<T>::value
40556 >
40557 {
40558 };
40559 }
40560 template< typename T > struct is_fundamental : ::boost::integral_constant<bool,::boost::detail::is_fundamental_impl<T>::value> { };
40561 }
40562 namespace boost {
40563 namespace detail {
40564 template <typename T>
40565 struct is_compound_impl
40566 {
40567 static const bool value = (::boost::type_traits::ice_not< ::boost::is_fundamental<T>::value >::value)
40568 ;
40569 };
40570 }
40571 template< typename T > struct is_compound : ::boost::integral_constant<bool,::boost::detail::is_compound_impl<T>::value> { };
40572 }
40573 namespace boost {
40574 namespace detail {
40575 template <typename T>
40576 struct add_reference_impl
40577 {
40578 typedef T& type;
40579 };
40580 template< typename T > struct add_reference_impl<T&> { typedef T& type; };
40581 template<> struct add_reference_impl<void> { typedef void type; };
40582 template<> struct add_reference_impl<void const> { typedef void const type; };
40583 template<> struct add_reference_impl<void volatile> { typedef void volatile type; };
40584 template<> struct add_reference_impl<void const volatile> { typedef void const volatile type; };
40585 }
40586 template< typename T > struct add_reference { typedef typename boost::detail::add_reference_impl<T>::type type; };
40587 }
40588 namespace boost {
40589 namespace detail{
40590 template <class T>
40591 struct is_abstract_imp
40592 {
40593 static const bool value = __is_abstract(T);
40594 };
40595 }
40596 template< typename T > struct is_abstract : ::boost::integral_constant<bool,::boost::detail::is_abstract_imp<T>::value> { };
40597 }
40598 namespace boost {
40599 namespace detail {
40600 struct any_conversion
40601 {
40602 template <typename T> any_conversion(const volatile T&);
40603 template <typename T> any_conversion(T&);
40604 };
40605 template <typename T> struct checker
40606 {
40607 static boost::type_traits::no_type _m_check(any_conversion ...);
40608 static boost::type_traits::yes_type _m_check(T, int);
40609 };
40610 template <typename From, typename To>
40611 struct is_convertible_basic_impl
40612 {
40613 static From _m_from;
40614 static bool const value = sizeof( detail::checker<To>::_m_check(_m_from, 0) )
40615 == sizeof(::boost::type_traits::yes_type);
40616 };
40617 template <typename From, typename To>
40618 struct is_convertible_impl
40619 {
40620 typedef typename add_reference<From>::type ref_type;
40621 static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_or< ::boost::detail::is_convertible_basic_impl<ref_type,To>::value, ::boost::is_void<To>::value >::value, ::boost::type_traits::ice_not< ::boost::is_array<To>::value >::value >::value)
40622 ;
40623 };
40624 template <bool trivial1, bool trivial2, bool abstract_target>
40625 struct is_convertible_impl_select
40626 {
40627 template <class From, class To>
40628 struct rebind
40629 {
40630 typedef is_convertible_impl<From, To> type;
40631 };
40632 };
40633 template <>
40634 struct is_convertible_impl_select<true, true, false>
40635 {
40636 template <class From, class To>
40637 struct rebind
40638 {
40639 typedef true_type type;
40640 };
40641 };
40642 template <>
40643 struct is_convertible_impl_select<false, false, true>
40644 {
40645 template <class From, class To>
40646 struct rebind
40647 {
40648 typedef false_type type;
40649 };
40650 };
40651 template <>
40652 struct is_convertible_impl_select<true, false, true>
40653 {
40654 template <class From, class To>
40655 struct rebind
40656 {
40657 typedef false_type type;
40658 };
40659 };
40660 template <typename From, typename To>
40661 struct is_convertible_impl_dispatch_base
40662 {
40663 typedef is_convertible_impl_select<
40664 ::boost::is_arithmetic<From>::value,
40665 ::boost::is_arithmetic<To>::value,
40666 ::boost::is_abstract<To>::value
40667 > selector;
40668 typedef typename selector::template rebind<From, To> isc_binder;
40669 typedef typename isc_binder::type type;
40670 };
40671 template <typename From, typename To>
40672 struct is_convertible_impl_dispatch
40673 : public is_convertible_impl_dispatch_base<From, To>::type
40674 {};
40675 template<> struct is_convertible_impl< void,void > { static const bool value = (true); }; template<> struct is_convertible_impl< void,void const > { static const bool value = (true); }; template<> struct is_convertible_impl< void,void volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void,void const volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void const,void > { static const bool value = (true); }; template<> struct is_convertible_impl< void const,void const > { static const bool value = (true); }; template<> struct is_convertible_impl< void const,void volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void const,void const volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void volatile,void > { static const bool value = (true); }; template<> struct is_convertible_impl< void volatile,void const > { static const bool value = (true); }; template<> struct is_convertible_impl< void volatile,void volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void volatile,void const volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void const volatile,void > { static const bool value = (true); }; template<> struct is_convertible_impl< void const volatile,void const > { static const bool value = (true); }; template<> struct is_convertible_impl< void const volatile,void volatile > { static const bool value = (true); }; template<> struct is_convertible_impl< void const volatile,void const volatile > { static const bool value = (true); };
40676 template< typename To > struct is_convertible_impl< void,To > { static const bool value = (false); };
40677 template< typename From > struct is_convertible_impl< From,void > { static const bool value = (true); };
40678 template< typename To > struct is_convertible_impl< void const,To > { static const bool value = (false); };
40679 template< typename To > struct is_convertible_impl< void volatile,To > { static const bool value = (false); };
40680 template< typename To > struct is_convertible_impl< void const volatile,To > { static const bool value = (false); };
40681 template< typename From > struct is_convertible_impl< From,void const > { static const bool value = (true); };
40682 template< typename From > struct is_convertible_impl< From,void volatile > { static const bool value = (true); };
40683 template< typename From > struct is_convertible_impl< From,void const volatile > { static const bool value = (true); };
40684 }
40685 template< typename From, typename To > struct is_convertible : ::boost::integral_constant<bool,(::boost::detail::is_convertible_impl_dispatch<From,To>::value)> { };
40686 }
40687 namespace boost {
40688 namespace detail {
40689 template <typename T>
40690 struct empty_helper_t1 : public T
40691 {
40692 empty_helper_t1();
40693 int i[256];
40694 private:
40695 empty_helper_t1(const empty_helper_t1&);
40696 empty_helper_t1& operator=(const empty_helper_t1&);
40697 };
40698 struct empty_helper_t2 { int i[256]; };
40699 template <typename T, bool is_a_class = false>
40700 struct empty_helper
40701 {
40702 static const bool value = false;
40703 };
40704 template <typename T>
40705 struct empty_helper<T, true>
40706 {
40707 static const bool value = (sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2))
40708 ;
40709 };
40710 template <typename T>
40711 struct is_empty_impl
40712 {
40713 typedef typename remove_cv<T>::type cvt;
40714 static const bool value = ( ::boost::type_traits::ice_or< ::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value , __is_empty(cvt) >::value )
40715 ;
40716 };
40717 template<> struct is_empty_impl< void > { static const bool value = (false); };
40718 template<> struct is_empty_impl< void const > { static const bool value = (false); };
40719 template<> struct is_empty_impl< void volatile > { static const bool value = (false); };
40720 template<> struct is_empty_impl< void const volatile > { static const bool value = (false); };
40721 }
40722 template< typename T > struct is_empty : ::boost::integral_constant<bool,::boost::detail::is_empty_impl<T>::value> { };
40723 }
40724 namespace boost {
40725 namespace type_traits {
40726 struct false_result
40727 {
40728 template <typename T> struct result_
40729 {
40730 static const bool value = false;
40731 };
40732 };
40733 }}
40734 namespace boost {
40735 namespace type_traits {
40736 template <class R>
40737 struct is_function_ptr_helper
40738 {
40739 static const bool value = false;
40740 };
40741 template <class R >
40742 struct is_function_ptr_helper<R (*)()> { static const bool value = true; };
40743 template <class R >
40744 struct is_function_ptr_helper<R (*)( ...)> { static const bool value = true; };
40745 template <class R , class T0>
40746 struct is_function_ptr_helper<R (*)( T0)> { static const bool value = true; };
40747 template <class R , class T0>
40748 struct is_function_ptr_helper<R (*)( T0 ...)> { static const bool value = true; };
40749 template <class R , class T0 , class T1>
40750 struct is_function_ptr_helper<R (*)( T0 , T1)> { static const bool value = true; };
40751 template <class R , class T0 , class T1>
40752 struct is_function_ptr_helper<R (*)( T0 , T1 ...)> { static const bool value = true; };
40753 template <class R , class T0 , class T1 , class T2>
40754 struct is_function_ptr_helper<R (*)( T0 , T1 , T2)> { static const bool value = true; };
40755 template <class R , class T0 , class T1 , class T2>
40756 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 ...)> { static const bool value = true; };
40757 template <class R , class T0 , class T1 , class T2 , class T3>
40758 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3)> { static const bool value = true; };
40759 template <class R , class T0 , class T1 , class T2 , class T3>
40760 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 ...)> { static const bool value = true; };
40761 template <class R , class T0 , class T1 , class T2 , class T3 , class T4>
40762 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4)> { static const bool value = true; };
40763 template <class R , class T0 , class T1 , class T2 , class T3 , class T4>
40764 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 ...)> { static const bool value = true; };
40765 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
40766 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5)> { static const bool value = true; };
40767 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
40768 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 ...)> { static const bool value = true; };
40769 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
40770 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6)> { static const bool value = true; };
40771 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
40772 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...)> { static const bool value = true; };
40773 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
40774 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7)> { static const bool value = true; };
40775 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
40776 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...)> { static const bool value = true; };
40777 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
40778 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8)> { static const bool value = true; };
40779 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
40780 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...)> { static const bool value = true; };
40781 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
40782 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9)> { static const bool value = true; };
40783 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
40784 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...)> { static const bool value = true; };
40785 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
40786 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10)> { static const bool value = true; };
40787 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
40788 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...)> { static const bool value = true; };
40789 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
40790 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11)> { static const bool value = true; };
40791 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
40792 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...)> { static const bool value = true; };
40793 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
40794 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12)> { static const bool value = true; };
40795 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
40796 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...)> { static const bool value = true; };
40797 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
40798 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13)> { static const bool value = true; };
40799 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
40800 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...)> { static const bool value = true; };
40801 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
40802 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14)> { static const bool value = true; };
40803 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
40804 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...)> { static const bool value = true; };
40805 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
40806 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15)> { static const bool value = true; };
40807 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15>
40808 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...)> { static const bool value = true; };
40809 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
40810 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16)> { static const bool value = true; };
40811 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16>
40812 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...)> { static const bool value = true; };
40813 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
40814 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17)> { static const bool value = true; };
40815 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17>
40816 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...)> { static const bool value = true; };
40817 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
40818 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18)> { static const bool value = true; };
40819 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18>
40820 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...)> { static const bool value = true; };
40821 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
40822 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19)> { static const bool value = true; };
40823 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19>
40824 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...)> { static const bool value = true; };
40825 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
40826 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20)> { static const bool value = true; };
40827 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20>
40828 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...)> { static const bool value = true; };
40829 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
40830 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21)> { static const bool value = true; };
40831 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21>
40832 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...)> { static const bool value = true; };
40833 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
40834 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22)> { static const bool value = true; };
40835 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22>
40836 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...)> { static const bool value = true; };
40837 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
40838 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23)> { static const bool value = true; };
40839 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23>
40840 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...)> { static const bool value = true; };
40841 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
40842 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24)> { static const bool value = true; };
40843 template <class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19 , class T20 , class T21 , class T22 , class T23 , class T24>
40844 struct is_function_ptr_helper<R (*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...)> { static const bool value = true; };
40845 }
40846 }
40847 namespace boost {
40848 namespace detail {
40849 template<bool is_ref = true>
40850 struct is_function_chooser
40851 : ::boost::type_traits::false_result
40852 {
40853 };
40854 template <>
40855 struct is_function_chooser<false>
40856 {
40857 template< typename T > struct result_
40858 : ::boost::type_traits::is_function_ptr_helper<T*>
40859 {
40860 };
40861 };
40862 template <typename T>
40863 struct is_function_impl
40864 : is_function_chooser< ::boost::is_reference<T>::value >
40865 ::template result_<T>
40866 {
40867 };
40868 }
40869 template< typename T > struct is_function : ::boost::integral_constant<bool,::boost::detail::is_function_impl<T>::value> { };
40870 }
40871 namespace boost {
40872 namespace detail {
40873 template <typename T>
40874 struct is_object_impl
40875 {
40876 static const bool value = (::boost::type_traits::ice_and< ::boost::type_traits::ice_not< ::boost::is_reference<T>::value>::value, ::boost::type_traits::ice_not< ::boost::is_void<T>::value>::value, ::boost::type_traits::ice_not< ::boost::is_function<T>::value>::value >::value)
40877 ;
40878 };
40879 }
40880 template< typename T > struct is_object : ::boost::integral_constant<bool,::boost::detail::is_object_impl<T>::value> { };
40881 }
40882 namespace boost {
40883 namespace detail {
40884 template <typename T>
40885 struct is_stateless_impl
40886 {
40887 static const bool value = (::boost::type_traits::ice_and< ::boost::has_trivial_constructor<T>::value, ::boost::has_trivial_copy<T>::value, ::boost::has_trivial_destructor<T>::value, ::boost::is_class<T>::value, ::boost::is_empty<T>::value >::value)
40888 ;
40889 };
40890 }
40891 template< typename T > struct is_stateless : ::boost::integral_constant<bool,::boost::detail::is_stateless_impl<T>::value> { };
40892 }
40893 namespace boost { namespace python {
40894 enum tag_t { tag };
40895 }}
40896 namespace boost { namespace python { namespace detail {
40897 template<class T> class borrowed
40898 {
40899 typedef T type;
40900 };
40901 template<typename T>
40902 struct is_borrowed_ptr
40903 {
40904 static const bool value = false;
40905 };
40906 template<typename T>
40907 struct is_borrowed_ptr<borrowed<T>*>
40908 {
40909 static const bool value = true;
40910 };
40911 template<typename T>
40912 struct is_borrowed_ptr<borrowed<T> const*>
40913 {
40914 static const bool value = true;
40915 };
40916 template<typename T>
40917 struct is_borrowed_ptr<borrowed<T> volatile*>
40918 {
40919 static const bool value = true;
40920 };
40921 template<typename T>
40922 struct is_borrowed_ptr<borrowed<T> const volatile*>
40923 {
40924 static const bool value = true;
40925 };
40926 }
40927 template <class T>
40928 inline T* get_managed_object(detail::borrowed<T> const volatile* p, tag_t)
40929 {
40930 return (T*)p;
40931 }
40932 }}
40933 namespace boost { namespace python {
40934 template <class T>
40935 inline python::detail::borrowed<T>* borrowed(T* p)
40936 {
40937 return (detail::borrowed<T>*)p;
40938 }
40939 }}
40940 namespace boost { namespace python {
40941 template <class T = PyObject> class handle;
40942 }}
40943 namespace boost { namespace python {
40944 template <class T>
40945 inline T* incref(T* p)
40946 {
40947 ( ((PyObject*)(python::upcast<PyObject>(p)))->ob_refcnt++);
40948 return p;
40949 }
40950 template <class T>
40951 inline T* xincref(T* p)
40952 {
40953 if ((python::upcast<PyObject>(p)) == __null) ; else ( ((PyObject*)(python::upcast<PyObject>(p)))->ob_refcnt++);
40954 return p;
40955 }
40956 template <class T>
40957 inline void decref(T* p)
40958 {
40959 if ( --((PyObject*)(python::upcast<PyObject>(p)))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(python::upcast<PyObject>(p))))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(python::upcast<PyObject>(p)))));
40960 }
40961 template <class T>
40962 inline void xdecref(T* p)
40963 {
40964 if ((python::upcast<PyObject>(p)) == __null) ; else if ( --((PyObject*)(python::upcast<PyObject>(p)))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(python::upcast<PyObject>(p))))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(python::upcast<PyObject>(p)))));
40965 }
40966 }}
40967 namespace boost { namespace python { namespace detail {
40968 struct new_reference_t;
40969 typedef new_reference_t* new_reference;
40970 struct borrowed_reference_t;
40971 typedef borrowed_reference_t* borrowed_reference;
40972 struct new_non_null_reference_t;
40973 typedef new_non_null_reference_t* new_non_null_reference;
40974 }}}
40975 namespace boost { namespace python {
40976 template <class T> struct null_ok;
40977 template <class T>
40978 inline null_ok<T>* allow_null(T* p)
40979 {
40980 return (null_ok<T>*)p;
40981 }
40982 namespace detail
40983 {
40984 template <class T>
40985 inline T* manage_ptr(detail::borrowed<null_ok<T> >* p, int)
40986 {
40987 return python::xincref((T*)p);
40988 }
40989 template <class T>
40990 inline T* manage_ptr(null_ok<detail::borrowed<T> >* p, int)
40991 {
40992 return python::xincref((T*)p);
40993 }
40994 template <class T>
40995 inline T* manage_ptr(detail::borrowed<T>* p, long)
40996 {
40997 return python::incref(expect_non_null((T*)p));
40998 }
40999 template <class T>
41000 inline T* manage_ptr(null_ok<T>* p, long)
41001 {
41002 return (T*)p;
41003 }
41004 template <class T>
41005 inline T* manage_ptr(T* p, ...)
41006 {
41007 return expect_non_null(p);
41008 }
41009 }
41010 template <class T>
41011 class handle
41012 {
41013 typedef T* (handle::* bool_type )() const;
41014 public:
41015 typedef T element_type;
41016 public:
41017 handle();
41018 ~handle();
41019 template <class Y>
41020 explicit handle(Y* p)
41021 : m_p(
41022 python::upcast<T>(
41023 detail::manage_ptr(p, 0)
41024 )
41025 )
41026 {
41027 }
41028 handle& operator=(handle const& r)
41029 {
41030 python::xdecref(m_p);
41031 m_p = python::xincref(r.m_p);
41032 return *this;
41033 }
41034 template<typename Y>
41035 handle& operator=(handle<Y> const & r)
41036 {
41037 python::xdecref(m_p);
41038 m_p = python::xincref(python::upcast<T>(r.get()));
41039 return *this;
41040 }
41041 template <typename Y>
41042 handle(handle<Y> const& r)
41043 : m_p(python::xincref(python::upcast<T>(r.get())))
41044 {
41045 }
41046 handle(handle const& r)
41047 : m_p(python::xincref(r.m_p))
41048 {
41049 }
41050 T* operator-> () const;
41051 T& operator* () const;
41052 T* get() const;
41053 T* release();
41054 void reset();
41055 operator bool_type() const
41056 {
41057 return m_p ? &handle<T>::get : 0;
41058 }
41059 bool operator! () const;
41060 public:
41061 inline handle(detail::borrowed_reference x)
41062 : m_p(
41063 python::incref(
41064 downcast<T>((PyObject*)x)
41065 ))
41066 {
41067 }
41068 private:
41069 T* m_p;
41070 };
41071 template<class T> inline T * get_pointer(python::handle<T> const & p)
41072 {
41073 return p.get();
41074 }
41075 using boost::get_pointer;
41076 typedef handle<PyTypeObject> type_handle;
41077 template<typename T>
41078 class is_handle
41079 {
41080 public:
41081 static const bool value = false;
41082 };
41083 template<typename T>
41084 class is_handle<handle<T> >
41085 {
41086 public:
41087 static const bool value = true;
41088 };
41089 template <class T>
41090 inline handle<T>::handle()
41091 : m_p(0)
41092 {
41093 }
41094 template <class T>
41095 inline handle<T>::~handle()
41096 {
41097 python::xdecref(m_p);
41098 }
41099 template <class T>
41100 inline T* handle<T>::operator->() const
41101 {
41102 return m_p;
41103 }
41104 template <class T>
41105 inline T& handle<T>::operator*() const
41106 {
41107 return *m_p;
41108 }
41109 template <class T>
41110 inline T* handle<T>::get() const
41111 {
41112 return m_p;
41113 }
41114 template <class T>
41115 inline bool handle<T>::operator!() const
41116 {
41117 return m_p == 0;
41118 }
41119 template <class T>
41120 inline T* handle<T>::release()
41121 {
41122 T* result = m_p;
41123 m_p = 0;
41124 return result;
41125 }
41126 template <class T>
41127 inline void handle<T>::reset()
41128 {
41129 python::xdecref(m_p);
41130 m_p = 0;
41131 }
41132 template <class T>
41133 inline PyObject* get_managed_object(handle<T> const& h, tag_t)
41134 {
41135 return h.get() ? python::upcast<PyObject>(h.get()) : (&_Py_NoneStruct);
41136 }
41137 }}
41138
41139 namespace boost { namespace python {
41140 namespace detail
41141 {
41142 struct keyword
41143 {
41144 keyword(char const* name_=0)
41145 : name(name_)
41146 {}
41147 char const* name;
41148 handle<> default_value;
41149 };
41150 template <std::size_t nkeywords = 0> struct keywords;
41151 typedef std::pair<keyword const*, keyword const*> keyword_range;
41152 template <>
41153 struct keywords<0>
41154 {
41155 static const std::size_t size = 0;
41156 static keyword_range range() { return keyword_range(); }
41157 };
41158 namespace error
41159 {
41160 template <int keywords, int function_args>
41161 struct more_keywords_than_function_arguments
41162 {
41163 typedef char too_many_keywords[keywords > function_args ? -1 : 1];
41164 };
41165 }
41166 }
41167 }}
41168 namespace boost { namespace mpl {
41169 template< typename Tag > struct at_impl;
41170 template< typename Sequence, typename N > struct at;
41171 }}
41172 namespace boost { namespace mpl { namespace aux {
41173 struct v_iter_tag;
41174 struct vector_tag;
41175 }}}
41176 namespace mpl_ {
41177 template< long N > struct long_;
41178 }
41179 namespace boost { namespace mpl { using ::mpl_::long_; } }
41180 namespace mpl_ {
41181 template< long N >
41182 struct long_
41183 {
41184 static const long value = N;
41185 typedef long_ type;
41186 typedef long value_type;
41187 typedef integral_c_tag tag;
41188 typedef mpl_::long_< static_cast<long>((value + 1)) > next;
41189 typedef mpl_::long_< static_cast<long>((value - 1)) > prior;
41190 operator long() const { return static_cast<long>(this->value); }
41191 };
41192 template< long N >
41193 long const mpl_::long_< N >::value;
41194 }
41195 namespace mpl_ {
41196 struct void_ { typedef void_ type; };
41197 }
41198 namespace boost { namespace mpl {
41199 template< typename T >
41200 struct is_void_
41201 : false_
41202 {
41203 };
41204 template<>
41205 struct is_void_<void_>
41206 : true_
41207 {
41208 };
41209 template< typename T >
41210 struct is_not_void_
41211 : true_
41212 {
41213 };
41214 template<>
41215 struct is_not_void_<void_>
41216 : false_
41217 {
41218 };
41219 template<> struct is_void_< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : is_void_< T1 > { }; }; template< typename Tag > struct lambda< is_void_< na > , Tag , int_<-1> > { typedef false_ is_le; typedef is_void_< na > result_; typedef is_void_< na > type; }; namespace aux { template< typename T1 > struct template_arity< is_void_< T1 > > : int_<1> { }; template<> struct template_arity< is_void_< na > > : int_<-1> { }; }
41220 template<> struct is_not_void_< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : is_not_void_< T1 > { }; }; template< typename Tag > struct lambda< is_not_void_< na > , Tag , int_<-1> > { typedef false_ is_le; typedef is_not_void_< na > result_; typedef is_not_void_< na > type; }; namespace aux { template< typename T1 > struct template_arity< is_not_void_< T1 > > : int_<1> { }; template<> struct template_arity< is_not_void_< na > > : int_<-1> { }; }
41221 }}
41222 namespace boost { namespace mpl { namespace aux {
41223 template< typename T > struct type_wrapper
41224 {
41225 typedef T type;
41226 };
41227 template< typename T > struct wrapped_type;
41228 template< typename T > struct wrapped_type< type_wrapper<T> >
41229 {
41230 typedef T type;
41231 };
41232 }}}
41233 namespace boost { namespace mpl {
41234 template< typename Vector, long n_ >
41235 struct v_at_impl
41236 {
41237 typedef long_< (Vector::lower_bound_::value + n_) > index_;
41238 typedef __typeof__( Vector::item_(index_()) ) type;
41239 };
41240 template< typename Vector, long n_ >
41241 struct v_at
41242 : aux::wrapped_type< typename v_at_impl<Vector,n_>::type >
41243 {
41244 };
41245 template<>
41246 struct at_impl< aux::vector_tag >
41247 {
41248 template< typename Vector, typename N > struct apply
41249 : v_at<
41250 Vector
41251 , N::value
41252 >
41253 {
41254 };
41255 };
41256 }}
41257 namespace boost { namespace mpl {
41258 template< typename Tag > struct front_impl;
41259 template< typename Sequence > struct front;
41260 }}
41261 namespace boost { namespace mpl {
41262 template<>
41263 struct front_impl< aux::vector_tag >
41264 {
41265 template< typename Vector > struct apply
41266 : v_at<Vector,0>
41267 {
41268 };
41269 };
41270 }}
41271 namespace boost { namespace mpl {
41272 template< typename Tag > struct push_front_impl;
41273 template< typename Sequence, typename T > struct push_front;
41274 }}
41275 namespace boost { namespace mpl {
41276 template<
41277 typename T = na
41278 >
41279 struct next
41280 {
41281 typedef typename T::next type;
41282
41283 };
41284 template<
41285 typename T = na
41286 >
41287 struct prior
41288 {
41289 typedef typename T::prior type;
41290
41291 };
41292 template<> struct next< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : next< T1 > { }; }; template< typename Tag > struct lambda< next< na > , Tag , int_<-1> > { typedef false_ is_le; typedef next< na > result_; typedef next< na > type; }; namespace aux { template< typename T1 > struct template_arity< next< T1 > > : int_<1> { }; template<> struct template_arity< next< na > > : int_<-1> { }; }
41293 template<> struct prior< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : prior< T1 > { }; }; template< typename Tag > struct lambda< prior< na > , Tag , int_<-1> > { typedef false_ is_le; typedef prior< na > result_; typedef prior< na > type; }; namespace aux { template< typename T1 > struct template_arity< prior< T1 > > : int_<1> { }; template<> struct template_arity< prior< na > > : int_<-1> { }; }
41294 }}
41295 namespace boost { namespace mpl {
41296 template<
41297 typename T
41298 , typename Base
41299 , int at_front = 0
41300 >
41301 struct v_item
41302 : Base
41303 {
41304 typedef typename Base::upper_bound_ index_;
41305 typedef typename next<index_>::type upper_bound_;
41306 typedef typename next<typename Base::size>::type size;
41307 typedef Base base;
41308 typedef v_item type;
41309 static aux::type_wrapper<T> item_(index_);
41310 using Base::item_;
41311 };
41312 template<
41313 typename T
41314 , typename Base
41315 >
41316 struct v_item<T,Base,1>
41317 : Base
41318 {
41319 typedef typename prior<typename Base::lower_bound_>::type index_;
41320 typedef index_ lower_bound_;
41321 typedef typename next<typename Base::size>::type size;
41322 typedef Base base;
41323 typedef v_item type;
41324 static aux::type_wrapper<T> item_(index_);
41325 using Base::item_;
41326 };
41327 template<
41328 typename Base
41329 , int at_front
41330 >
41331 struct v_mask
41332 : Base
41333 {
41334 typedef typename prior<typename Base::upper_bound_>::type index_;
41335 typedef index_ upper_bound_;
41336 typedef typename prior<typename Base::size>::type size;
41337 typedef Base base;
41338 typedef v_mask type;
41339 static aux::type_wrapper<void_> item_(index_);
41340 using Base::item_;
41341 };
41342 template<
41343 typename Base
41344 >
41345 struct v_mask<Base,1>
41346 : Base
41347 {
41348 typedef typename Base::lower_bound_ index_;
41349 typedef typename next<index_>::type lower_bound_;
41350 typedef typename prior<typename Base::size>::type size;
41351 typedef Base base;
41352 typedef v_mask type;
41353 static aux::type_wrapper<void_> item_(index_);
41354 using Base::item_;
41355 };
41356 }}
41357 namespace boost { namespace mpl {
41358 template<>
41359 struct push_front_impl< aux::vector_tag >
41360 {
41361 template< typename Vector, typename T > struct apply
41362 {
41363 typedef v_item<T,Vector,1> type;
41364 };
41365 };
41366 }}
41367 namespace boost { namespace mpl {
41368 template< typename Tag > struct pop_front_impl;
41369 template< typename Sequence > struct pop_front;
41370 }}
41371 namespace boost { namespace mpl {
41372 template<>
41373 struct pop_front_impl< aux::vector_tag >
41374 {
41375 template< typename Vector > struct apply
41376 {
41377 typedef v_mask<Vector,1> type;
41378 };
41379 };
41380 }}
41381 namespace boost { namespace mpl {
41382 template< typename Tag > struct push_back_impl;
41383 template< typename Sequence, typename T > struct push_back;
41384 }}
41385 namespace boost { namespace mpl {
41386 template<>
41387 struct push_back_impl< aux::vector_tag >
41388 {
41389 template< typename Vector, typename T > struct apply
41390 {
41391 typedef v_item<T,Vector,0> type;
41392 };
41393 };
41394 }}
41395 namespace boost { namespace mpl {
41396 template< typename Tag > struct pop_back_impl;
41397 template< typename Sequence > struct pop_back;
41398 }}
41399 namespace boost { namespace mpl {
41400 template<>
41401 struct pop_back_impl< aux::vector_tag >
41402 {
41403 template< typename Vector > struct apply
41404 {
41405 typedef v_mask<Vector,0> type;
41406 };
41407 };
41408 }}
41409 namespace boost { namespace mpl {
41410 template< typename Tag > struct back_impl;
41411 template< typename Sequence > struct back;
41412 }}
41413 namespace boost { namespace mpl {
41414 template<>
41415 struct back_impl< aux::vector_tag >
41416 {
41417 template< typename Vector > struct apply
41418 : v_at<
41419 Vector
41420 , prior<typename Vector::size>::type::value
41421 >
41422 {
41423 };
41424 };
41425 }}
41426 namespace boost { namespace mpl {
41427 template< typename Tag > struct clear_impl;
41428 template< typename Sequence > struct clear;
41429 }}
41430 namespace boost { namespace mpl {
41431 struct forward_iterator_tag : int_<0> { typedef forward_iterator_tag type; };
41432 struct bidirectional_iterator_tag : int_<1> { typedef bidirectional_iterator_tag type; };
41433 struct random_access_iterator_tag : int_<2> { typedef random_access_iterator_tag type; };
41434 }}
41435 namespace boost { namespace mpl { namespace aux {
41436 template< typename T > struct integral_rank;
41437 template<> struct integral_rank<bool> : int_<1> {};
41438 template<> struct integral_rank<signed char> : int_<2> {};
41439 template<> struct integral_rank<char> : int_<3> {};
41440 template<> struct integral_rank<unsigned char> : int_<4> {};
41441 template<> struct integral_rank<wchar_t> : int_<5> {};
41442 template<> struct integral_rank<short> : int_<6> {};
41443 template<> struct integral_rank<unsigned short> : int_<7> {};
41444 template<> struct integral_rank<int> : int_<8> {};
41445 template<> struct integral_rank<unsigned int> : int_<9> {};
41446 template<> struct integral_rank<long> : int_<10> {};
41447 template<> struct integral_rank<unsigned long> : int_<11> {};
41448 template<> struct integral_rank<long_long_type> : int_<12> {};
41449 template<> struct integral_rank<ulong_long_type>: int_<13> {};
41450 template< typename T1, typename T2 > struct largest_int
41451 : if_c<
41452 ( integral_rank<T1>::value >= integral_rank<T2>::value )
41453 , T1
41454 , T2
41455 >
41456 {
41457 };
41458 }}}
41459 namespace boost { namespace mpl {
41460 template< typename SourceTag, typename TargetTag > struct numeric_cast
41461 {
41462 template< typename N > struct apply;
41463 };
41464 }}
41465 namespace boost { namespace mpl { namespace aux {
41466 typedef char (&no_tag)[1];
41467 typedef char (&yes_tag)[2];
41468 template< bool C_ > struct yes_no_tag
41469 {
41470 typedef no_tag type;
41471 };
41472 template<> struct yes_no_tag<true>
41473 {
41474 typedef yes_tag type;
41475 };
41476 template< long n > struct weighted_tag
41477 {
41478 typedef char (&type)[n];
41479 };
41480 }}}
41481 namespace boost { namespace mpl { namespace aux {
41482 template< typename T, typename fallback_ = boost::mpl::bool_<false> > struct has_apply { struct gcc_3_2_wknd { template< typename U > static boost::mpl::aux::yes_tag test( boost::mpl::aux::type_wrapper<U> const volatile* , boost::mpl::aux::type_wrapper<typename U::apply>* = 0 ); static boost::mpl::aux::no_tag test(...); }; typedef boost::mpl::aux::type_wrapper<T> t_; static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) == sizeof(boost::mpl::aux::yes_tag); typedef boost::mpl::bool_<value> type; };
41483 }}}
41484 namespace boost { namespace mpl {
41485 template<
41486 typename F
41487 , typename has_apply_ = typename aux::has_apply<F>::type
41488 >
41489 struct apply_wrap0
41490 : F::template apply< >
41491 {
41492 };
41493 template< typename F >
41494 struct apply_wrap0< F,true_ >
41495 : F::apply
41496 {
41497 };
41498 template<
41499 typename F, typename T1
41500 >
41501 struct apply_wrap1
41502 : F::template apply<T1>
41503 {
41504 };
41505 template<
41506 typename F, typename T1, typename T2
41507 >
41508 struct apply_wrap2
41509 : F::template apply< T1,T2 >
41510 {
41511 };
41512 template<
41513 typename F, typename T1, typename T2, typename T3
41514 >
41515 struct apply_wrap3
41516 : F::template apply< T1,T2,T3 >
41517 {
41518 };
41519 template<
41520 typename F, typename T1, typename T2, typename T3, typename T4
41521 >
41522 struct apply_wrap4
41523 : F::template apply< T1,T2,T3,T4 >
41524 {
41525 };
41526 template<
41527 typename F, typename T1, typename T2, typename T3, typename T4
41528 , typename T5
41529 >
41530 struct apply_wrap5
41531 : F::template apply< T1,T2,T3,T4,T5 >
41532 {
41533 };
41534 }}
41535 namespace boost { namespace mpl {
41536 template<
41537 typename C = na
41538 , typename F1 = na
41539 , typename F2 = na
41540 >
41541 struct eval_if
41542 {
41543 typedef typename if_<C,F1,F2>::type f_;
41544 typedef typename f_::type type;
41545
41546 };
41547 template<
41548 bool C
41549 , typename F1
41550 , typename F2
41551 >
41552 struct eval_if_c
41553 {
41554 typedef typename if_c<C,F1,F2>::type f_;
41555 typedef typename f_::type type;
41556 };
41557 template<> struct eval_if< na , na , na > { template< typename T1 , typename T2 , typename T3 , typename T4 =na , typename T5 =na > struct apply : eval_if< T1 , T2 , T3 > { }; }; template< typename Tag > struct lambda< eval_if< na , na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef eval_if< na , na , na > result_; typedef eval_if< na , na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 > struct template_arity< eval_if< T1 , T2 , T3 > > : int_<3> { }; template<> struct template_arity< eval_if< na , na , na > > : int_<-1> { }; }
41558 }}
41559 namespace boost { namespace mpl { namespace aux {
41560 template< typename T, typename fallback_ = boost::mpl::bool_<false> > struct has_tag { struct gcc_3_2_wknd { template< typename U > static boost::mpl::aux::yes_tag test( boost::mpl::aux::type_wrapper<U> const volatile* , boost::mpl::aux::type_wrapper<typename U::tag>* = 0 ); static boost::mpl::aux::no_tag test(...); }; typedef boost::mpl::aux::type_wrapper<T> t_; static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) == sizeof(boost::mpl::aux::yes_tag); typedef boost::mpl::bool_<value> type; };
41561 }}}
41562 namespace boost { namespace mpl {
41563 namespace aux {
41564 template< typename T > struct tag_impl
41565 {
41566 typedef typename T::tag type;
41567 };
41568 }
41569 template< typename T, typename Default = void_ > struct tag
41570 : if_<
41571 aux::has_tag<T>
41572 , aux::tag_impl<T>
41573 , Default
41574 >::type
41575 {
41576 };
41577 }}
41578 namespace boost { namespace mpl { namespace aux {
41579 template<
41580 typename F
41581 , typename Tag1
41582 , typename Tag2
41583 >
41584 struct cast1st_impl
41585 {
41586 template< typename N1, typename N2 > struct apply
41587 : apply_wrap2<
41588 F
41589 , typename apply_wrap1< numeric_cast<Tag1,Tag2>,N1 >::type
41590 , N2
41591 >
41592 {
41593 };
41594 };
41595 template<
41596 typename F
41597 , typename Tag1
41598 , typename Tag2
41599 >
41600 struct cast2nd_impl
41601 {
41602 template< typename N1, typename N2 > struct apply
41603 : apply_wrap2<
41604 F
41605 , N1
41606 , typename apply_wrap1< numeric_cast<Tag2,Tag1>,N2 >::type
41607 >
41608 {
41609 };
41610 };
41611 }}}
41612 namespace boost { namespace mpl { namespace aux {
41613 }}}
41614 namespace boost { namespace mpl { namespace aux {
41615 template< typename T > struct msvc_eti_base
41616 : T
41617 {
41618 msvc_eti_base();
41619 typedef T type;
41620 };
41621 template<> struct msvc_eti_base<int>
41622 {
41623 typedef msvc_eti_base type;
41624 typedef msvc_eti_base first;
41625 typedef msvc_eti_base second;
41626 typedef msvc_eti_base tag;
41627 enum { value = 0 };
41628 };
41629 }}}
41630 namespace boost { namespace mpl {
41631 template<
41632 typename Tag1
41633 , typename Tag2
41634 >
41635 struct plus_impl
41636 : if_c<
41637 ( Tag1::value
41638 > Tag2::value
41639 )
41640 , aux::cast2nd_impl< plus_impl< Tag1,Tag1 >,Tag1, Tag2 >
41641 , aux::cast1st_impl< plus_impl< Tag2,Tag2 >,Tag1, Tag2 >
41642 >::type
41643 {
41644 };
41645 template<> struct plus_impl< na,na >
41646 {
41647 template< typename U1, typename U2 > struct apply
41648 {
41649 typedef apply type;
41650 static const int value = 0;
41651 };
41652 };
41653 template< typename Tag > struct plus_impl< na,Tag >
41654 {
41655 template< typename U1, typename U2 > struct apply
41656 {
41657 typedef apply type;
41658 static const int value = 0;
41659 };
41660 };
41661 template< typename Tag > struct plus_impl< Tag,na >
41662 {
41663 template< typename U1, typename U2 > struct apply
41664 {
41665 typedef apply type;
41666 static const int value = 0;
41667 };
41668 };
41669 template< typename T > struct plus_tag
41670 {
41671 typedef typename T::tag type;
41672 };
41673 template<
41674 typename N1 = na
41675 , typename N2 = na
41676 , typename N3 = na, typename N4 = na, typename N5 = na
41677 >
41678 struct plus
41679 : plus< plus< plus< plus< N1,N2 >, N3>, N4>, N5>
41680 {
41681
41682 };
41683 template<
41684 typename N1, typename N2, typename N3, typename N4
41685 >
41686 struct plus< N1,N2,N3,N4,na >
41687 : plus< plus< plus< N1,N2 >, N3>, N4>
41688 {
41689
41690 };
41691 template<
41692 typename N1, typename N2, typename N3
41693 >
41694 struct plus< N1,N2,N3,na,na >
41695 : plus< plus< N1,N2 >, N3>
41696 {
41697
41698 };
41699 template<
41700 typename N1, typename N2
41701 >
41702 struct plus< N1,N2,na,na,na >
41703 : plus_impl<
41704 typename plus_tag<N1>::type
41705 , typename plus_tag<N2>::type
41706 >::template apply< N1,N2 >::type
41707 {
41708
41709 };
41710 template<> struct plus< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : plus< T1 , T2 > { }; }; template< typename Tag > struct lambda< plus< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef plus< na , na > result_; typedef plus< na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< plus< T1 , T2 , T3 , T4 , T5 > > : int_<5> { }; template<> struct template_arity< plus< na , na > > : int_<-1> { }; }
41711 }}
41712 namespace boost { namespace mpl {
41713 template<>
41714 struct plus_impl< integral_c_tag,integral_c_tag >
41715 {
41716 template< typename N1, typename N2 > struct apply
41717 : integral_c<
41718 typename aux::largest_int<
41719 typename N1::value_type
41720 , typename N2::value_type
41721 >::type
41722 , ( N1::value
41723 + N2::value
41724 )
41725 >
41726 {
41727 };
41728 };
41729 }}
41730 namespace boost { namespace mpl {
41731 template<
41732 typename Tag1
41733 , typename Tag2
41734 >
41735 struct minus_impl
41736 : if_c<
41737 ( Tag1::value
41738 > Tag2::value
41739 )
41740 , aux::cast2nd_impl< minus_impl< Tag1,Tag1 >,Tag1, Tag2 >
41741 , aux::cast1st_impl< minus_impl< Tag2,Tag2 >,Tag1, Tag2 >
41742 >::type
41743 {
41744 };
41745 template<> struct minus_impl< na,na >
41746 {
41747 template< typename U1, typename U2 > struct apply
41748 {
41749 typedef apply type;
41750 static const int value = 0;
41751 };
41752 };
41753 template< typename Tag > struct minus_impl< na,Tag >
41754 {
41755 template< typename U1, typename U2 > struct apply
41756 {
41757 typedef apply type;
41758 static const int value = 0;
41759 };
41760 };
41761 template< typename Tag > struct minus_impl< Tag,na >
41762 {
41763 template< typename U1, typename U2 > struct apply
41764 {
41765 typedef apply type;
41766 static const int value = 0;
41767 };
41768 };
41769 template< typename T > struct minus_tag
41770 {
41771 typedef typename T::tag type;
41772 };
41773 template<
41774 typename N1 = na
41775 , typename N2 = na
41776 , typename N3 = na, typename N4 = na, typename N5 = na
41777 >
41778 struct minus
41779 : minus< minus< minus< minus< N1,N2 >, N3>, N4>, N5>
41780 {
41781
41782 };
41783 template<
41784 typename N1, typename N2, typename N3, typename N4
41785 >
41786 struct minus< N1,N2,N3,N4,na >
41787 : minus< minus< minus< N1,N2 >, N3>, N4>
41788 {
41789
41790 };
41791 template<
41792 typename N1, typename N2, typename N3
41793 >
41794 struct minus< N1,N2,N3,na,na >
41795 : minus< minus< N1,N2 >, N3>
41796 {
41797
41798 };
41799 template<
41800 typename N1, typename N2
41801 >
41802 struct minus< N1,N2,na,na,na >
41803 : minus_impl<
41804 typename minus_tag<N1>::type
41805 , typename minus_tag<N2>::type
41806 >::template apply< N1,N2 >::type
41807 {
41808
41809 };
41810 template<> struct minus< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : minus< T1 , T2 > { }; }; template< typename Tag > struct lambda< minus< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef minus< na , na > result_; typedef minus< na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< minus< T1 , T2 , T3 , T4 , T5 > > : int_<5> { }; template<> struct template_arity< minus< na , na > > : int_<-1> { }; }
41811 }}
41812 namespace boost { namespace mpl {
41813 template<>
41814 struct minus_impl< integral_c_tag,integral_c_tag >
41815 {
41816 template< typename N1, typename N2 > struct apply
41817 : integral_c<
41818 typename aux::largest_int<
41819 typename N1::value_type
41820 , typename N2::value_type
41821 >::type
41822 , ( N1::value
41823 - N2::value
41824 )
41825 >
41826 {
41827 };
41828 };
41829 }}
41830 namespace boost { namespace mpl {
41831 template< typename Tag > struct advance_impl;
41832 template< typename Iterator, typename N > struct advance;
41833 }}
41834 namespace boost { namespace mpl {
41835 template< typename Tag > struct distance_impl;
41836 template< typename First, typename Last > struct distance;
41837 }}
41838 namespace boost { namespace mpl {
41839 template<
41840 typename Vector
41841 , long n_
41842 >
41843 struct v_iter
41844 {
41845 typedef aux::v_iter_tag tag;
41846 typedef random_access_iterator_tag category;
41847 typedef typename v_at<Vector,n_>::type type;
41848 typedef Vector vector_;
41849 typedef mpl::long_<n_> pos;
41850 };
41851 template<
41852 typename Vector
41853 , long n_
41854 >
41855 struct next< v_iter<Vector,n_> >
41856 {
41857 typedef v_iter<Vector,(n_ + 1)> type;
41858 };
41859 template<
41860 typename Vector
41861 , long n_
41862 >
41863 struct prior< v_iter<Vector,n_> >
41864 {
41865 typedef v_iter<Vector,(n_ - 1)> type;
41866 };
41867 template<
41868 typename Vector
41869 , long n_
41870 , typename Distance
41871 >
41872 struct advance< v_iter<Vector,n_>,Distance>
41873 {
41874 typedef v_iter<
41875 Vector
41876 , (n_ + Distance::value)
41877 > type;
41878 };
41879 template<
41880 typename Vector
41881 , long n_
41882 , long m_
41883 >
41884 struct distance< v_iter<Vector,n_>, v_iter<Vector,m_> >
41885 : mpl::long_<(m_ - n_)>
41886 {
41887 };
41888 }}
41889 namespace boost { namespace mpl {
41890 template< typename Dummy = na > struct vector0;
41891 template<> struct vector0<na>
41892 {
41893 typedef aux::vector_tag tag;
41894 typedef vector0 type;
41895 typedef long_<32768> lower_bound_;
41896 typedef lower_bound_ upper_bound_;
41897 typedef long_<0> size;
41898 static aux::type_wrapper<void_> item_(...);
41899 };
41900 }}
41901 namespace boost { namespace mpl {
41902 template<>
41903 struct clear_impl< aux::vector_tag >
41904 {
41905 template< typename Vector > struct apply
41906 {
41907 typedef vector0<> type;
41908 };
41909 };
41910 }}
41911 namespace boost { namespace mpl {
41912 template< typename Tag > struct O1_size_impl;
41913 template< typename Sequence > struct O1_size;
41914 }}
41915 namespace boost { namespace mpl {
41916 template<>
41917 struct O1_size_impl< aux::vector_tag >
41918 {
41919 template< typename Vector > struct apply
41920 : Vector::size
41921 {
41922 };
41923 };
41924 }}
41925 namespace boost { namespace mpl {
41926 template< typename Tag > struct size_impl;
41927 template< typename Sequence > struct size;
41928 }}
41929 namespace boost { namespace mpl {
41930 template<>
41931 struct size_impl< aux::vector_tag >
41932 : O1_size_impl< aux::vector_tag >
41933 {
41934 };
41935 }}
41936 namespace boost { namespace mpl {
41937 template< typename Tag > struct empty_impl;
41938 template< typename Sequence > struct empty;
41939 }}
41940 namespace boost { namespace mpl {
41941 template<>
41942 struct empty_impl< aux::vector_tag >
41943 {
41944 template< typename Vector > struct apply
41945 : is_same<
41946 typename Vector::lower_bound_
41947 , typename Vector::upper_bound_
41948 >
41949 {
41950 };
41951 };
41952 }}
41953 namespace boost { namespace mpl {
41954 template< typename Tag > struct begin_impl;
41955 template< typename Tag > struct end_impl;
41956 template< typename Sequence > struct begin;
41957 template< typename Sequence > struct end;
41958 }}
41959 namespace boost { namespace mpl {
41960 template<>
41961 struct begin_impl< aux::vector_tag >
41962 {
41963 template< typename Vector > struct apply
41964 {
41965 typedef v_iter<Vector,0> type;
41966 };
41967 };
41968 template<>
41969 struct end_impl< aux::vector_tag >
41970 {
41971 template< typename Vector > struct apply
41972 {
41973 typedef v_iter<Vector,Vector::size::value> type;
41974 };
41975 };
41976 }}
41977 namespace boost { namespace mpl {
41978 template<
41979 typename T0
41980 >
41981 struct vector1
41982 : v_item<
41983 T0
41984 , vector0< >
41985 >
41986 {
41987 typedef vector1 type;
41988 };
41989 template<
41990 typename T0, typename T1
41991 >
41992 struct vector2
41993 : v_item<
41994 T1
41995 , vector1<T0>
41996 >
41997 {
41998 typedef vector2 type;
41999 };
42000 template<
42001 typename T0, typename T1, typename T2
42002 >
42003 struct vector3
42004 : v_item<
42005 T2
42006 , vector2< T0,T1 >
42007 >
42008 {
42009 typedef vector3 type;
42010 };
42011 template<
42012 typename T0, typename T1, typename T2, typename T3
42013 >
42014 struct vector4
42015 : v_item<
42016 T3
42017 , vector3< T0,T1,T2 >
42018 >
42019 {
42020 typedef vector4 type;
42021 };
42022 template<
42023 typename T0, typename T1, typename T2, typename T3, typename T4
42024 >
42025 struct vector5
42026 : v_item<
42027 T4
42028 , vector4< T0,T1,T2,T3 >
42029 >
42030 {
42031 typedef vector5 type;
42032 };
42033 template<
42034 typename T0, typename T1, typename T2, typename T3, typename T4
42035 , typename T5
42036 >
42037 struct vector6
42038 : v_item<
42039 T5
42040 , vector5< T0,T1,T2,T3,T4 >
42041 >
42042 {
42043 typedef vector6 type;
42044 };
42045 template<
42046 typename T0, typename T1, typename T2, typename T3, typename T4
42047 , typename T5, typename T6
42048 >
42049 struct vector7
42050 : v_item<
42051 T6
42052 , vector6< T0,T1,T2,T3,T4,T5 >
42053 >
42054 {
42055 typedef vector7 type;
42056 };
42057 template<
42058 typename T0, typename T1, typename T2, typename T3, typename T4
42059 , typename T5, typename T6, typename T7
42060 >
42061 struct vector8
42062 : v_item<
42063 T7
42064 , vector7< T0,T1,T2,T3,T4,T5,T6 >
42065 >
42066 {
42067 typedef vector8 type;
42068 };
42069 template<
42070 typename T0, typename T1, typename T2, typename T3, typename T4
42071 , typename T5, typename T6, typename T7, typename T8
42072 >
42073 struct vector9
42074 : v_item<
42075 T8
42076 , vector8< T0,T1,T2,T3,T4,T5,T6,T7 >
42077 >
42078 {
42079 typedef vector9 type;
42080 };
42081 template<
42082 typename T0, typename T1, typename T2, typename T3, typename T4
42083 , typename T5, typename T6, typename T7, typename T8, typename T9
42084 >
42085 struct vector10
42086 : v_item<
42087 T9
42088 , vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >
42089 >
42090 {
42091 typedef vector10 type;
42092 };
42093 }}
42094 namespace boost { namespace mpl {
42095 template<
42096 typename T0, typename T1, typename T2, typename T3, typename T4
42097 , typename T5, typename T6, typename T7, typename T8, typename T9
42098 , typename T10
42099 >
42100 struct vector11
42101 : v_item<
42102 T10
42103 , vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >
42104 >
42105 {
42106 typedef vector11 type;
42107 };
42108 template<
42109 typename T0, typename T1, typename T2, typename T3, typename T4
42110 , typename T5, typename T6, typename T7, typename T8, typename T9
42111 , typename T10, typename T11
42112 >
42113 struct vector12
42114 : v_item<
42115 T11
42116 , vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >
42117 >
42118 {
42119 typedef vector12 type;
42120 };
42121 template<
42122 typename T0, typename T1, typename T2, typename T3, typename T4
42123 , typename T5, typename T6, typename T7, typename T8, typename T9
42124 , typename T10, typename T11, typename T12
42125 >
42126 struct vector13
42127 : v_item<
42128 T12
42129 , vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >
42130 >
42131 {
42132 typedef vector13 type;
42133 };
42134 template<
42135 typename T0, typename T1, typename T2, typename T3, typename T4
42136 , typename T5, typename T6, typename T7, typename T8, typename T9
42137 , typename T10, typename T11, typename T12, typename T13
42138 >
42139 struct vector14
42140 : v_item<
42141 T13
42142 , vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >
42143 >
42144 {
42145 typedef vector14 type;
42146 };
42147 template<
42148 typename T0, typename T1, typename T2, typename T3, typename T4
42149 , typename T5, typename T6, typename T7, typename T8, typename T9
42150 , typename T10, typename T11, typename T12, typename T13, typename T14
42151 >
42152 struct vector15
42153 : v_item<
42154 T14
42155 , vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >
42156 >
42157 {
42158 typedef vector15 type;
42159 };
42160 template<
42161 typename T0, typename T1, typename T2, typename T3, typename T4
42162 , typename T5, typename T6, typename T7, typename T8, typename T9
42163 , typename T10, typename T11, typename T12, typename T13, typename T14
42164 , typename T15
42165 >
42166 struct vector16
42167 : v_item<
42168 T15
42169 , vector15< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 >
42170 >
42171 {
42172 typedef vector16 type;
42173 };
42174 template<
42175 typename T0, typename T1, typename T2, typename T3, typename T4
42176 , typename T5, typename T6, typename T7, typename T8, typename T9
42177 , typename T10, typename T11, typename T12, typename T13, typename T14
42178 , typename T15, typename T16
42179 >
42180 struct vector17
42181 : v_item<
42182 T16
42183 , vector16< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 >
42184 >
42185 {
42186 typedef vector17 type;
42187 };
42188 template<
42189 typename T0, typename T1, typename T2, typename T3, typename T4
42190 , typename T5, typename T6, typename T7, typename T8, typename T9
42191 , typename T10, typename T11, typename T12, typename T13, typename T14
42192 , typename T15, typename T16, typename T17
42193 >
42194 struct vector18
42195 : v_item<
42196 T17
42197 , vector17< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 >
42198 >
42199 {
42200 typedef vector18 type;
42201 };
42202 template<
42203 typename T0, typename T1, typename T2, typename T3, typename T4
42204 , typename T5, typename T6, typename T7, typename T8, typename T9
42205 , typename T10, typename T11, typename T12, typename T13, typename T14
42206 , typename T15, typename T16, typename T17, typename T18
42207 >
42208 struct vector19
42209 : v_item<
42210 T18
42211 , vector18< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 >
42212 >
42213 {
42214 typedef vector19 type;
42215 };
42216 template<
42217 typename T0, typename T1, typename T2, typename T3, typename T4
42218 , typename T5, typename T6, typename T7, typename T8, typename T9
42219 , typename T10, typename T11, typename T12, typename T13, typename T14
42220 , typename T15, typename T16, typename T17, typename T18, typename T19
42221 >
42222 struct vector20
42223 : v_item<
42224 T19
42225 , vector19< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 >
42226 >
42227 {
42228 typedef vector20 type;
42229 };
42230 }}
42231 namespace boost { namespace python { namespace detail {
42232 template < class T0 = mpl::void_ , class T1 = mpl::void_ , class T2 = mpl::void_ , class T3 = mpl::void_ , class T4 = mpl::void_ , class T5 = mpl::void_ , class T6 = mpl::void_ , class T7 = mpl::void_ , class T8 = mpl::void_ , class T9 = mpl::void_ , class T10 = mpl::void_ , class T11 = mpl::void_ , class T12 = mpl::void_ , class T13 = mpl::void_ , class T14 = mpl::void_ , class T15 = mpl::void_ , class T16 = mpl::void_ >
42233 struct type_list
42234 : mpl::vector17< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16>
42235 {
42236 };
42237 template <
42238
42239 >
42240 struct type_list<
42241
42242
42243
42244 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42245 >
42246 : mpl::vector0<>
42247 {
42248 };
42249 template <
42250 class T0
42251 >
42252 struct type_list<
42253 T0
42254 ,
42255
42256 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42257 >
42258 : mpl::vector1< T0>
42259 {
42260 };
42261 template <
42262 class T0 , class T1
42263 >
42264 struct type_list<
42265 T0 , T1
42266 ,
42267
42268 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42269 >
42270 : mpl::vector2< T0 , T1>
42271 {
42272 };
42273 template <
42274 class T0 , class T1 , class T2
42275 >
42276 struct type_list<
42277 T0 , T1 , T2
42278 ,
42279
42280 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42281 >
42282 : mpl::vector3< T0 , T1 , T2>
42283 {
42284 };
42285 template <
42286 class T0 , class T1 , class T2 , class T3
42287 >
42288 struct type_list<
42289 T0 , T1 , T2 , T3
42290 ,
42291
42292 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42293 >
42294 : mpl::vector4< T0 , T1 , T2 , T3>
42295 {
42296 };
42297 template <
42298 class T0 , class T1 , class T2 , class T3 , class T4
42299 >
42300 struct type_list<
42301 T0 , T1 , T2 , T3 , T4
42302 ,
42303
42304 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42305 >
42306 : mpl::vector5< T0 , T1 , T2 , T3 , T4>
42307 {
42308 };
42309 template <
42310 class T0 , class T1 , class T2 , class T3 , class T4 , class T5
42311 >
42312 struct type_list<
42313 T0 , T1 , T2 , T3 , T4 , T5
42314 ,
42315
42316 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42317 >
42318 : mpl::vector6< T0 , T1 , T2 , T3 , T4 , T5>
42319 {
42320 };
42321 template <
42322 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6
42323 >
42324 struct type_list<
42325 T0 , T1 , T2 , T3 , T4 , T5 , T6
42326 ,
42327
42328 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42329 >
42330 : mpl::vector7< T0 , T1 , T2 , T3 , T4 , T5 , T6>
42331 {
42332 };
42333 template <
42334 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7
42335 >
42336 struct type_list<
42337 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
42338 ,
42339
42340 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42341 >
42342 : mpl::vector8< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>
42343 {
42344 };
42345 template <
42346 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8
42347 >
42348 struct type_list<
42349 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
42350 ,
42351
42352 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42353 >
42354 : mpl::vector9< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>
42355 {
42356 };
42357 template <
42358 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9
42359 >
42360 struct type_list<
42361 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
42362 ,
42363
42364 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42365 >
42366 : mpl::vector10< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
42367 {
42368 };
42369 template <
42370 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10
42371 >
42372 struct type_list<
42373 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
42374 ,
42375
42376 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42377 >
42378 : mpl::vector11< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10>
42379 {
42380 };
42381 template <
42382 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11
42383 >
42384 struct type_list<
42385 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
42386 ,
42387
42388 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42389 >
42390 : mpl::vector12< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11>
42391 {
42392 };
42393 template <
42394 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12
42395 >
42396 struct type_list<
42397 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
42398 ,
42399
42400 mpl::void_ , mpl::void_ , mpl::void_ , mpl::void_
42401 >
42402 : mpl::vector13< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12>
42403 {
42404 };
42405 template <
42406 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13
42407 >
42408 struct type_list<
42409 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
42410 ,
42411
42412 mpl::void_ , mpl::void_ , mpl::void_
42413 >
42414 : mpl::vector14< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13>
42415 {
42416 };
42417 template <
42418 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14
42419 >
42420 struct type_list<
42421 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
42422 ,
42423
42424 mpl::void_ , mpl::void_
42425 >
42426 : mpl::vector15< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
42427 {
42428 };
42429 template <
42430 class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15
42431 >
42432 struct type_list<
42433 T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15
42434 ,
42435
42436 mpl::void_
42437 >
42438 : mpl::vector16< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15>
42439 {
42440 };
42441 }}}
42442 namespace boost {
42443 template< typename T > struct remove_reference { typedef T type; };
42444 template< typename T > struct remove_reference<T&> { typedef T type; };
42445 }
42446 namespace boost { namespace python {
42447 template<class Ptr> class pointer_wrapper
42448 {
42449 public:
42450 typedef Ptr type;
42451 explicit pointer_wrapper(Ptr x): p_(x) {}
42452 operator Ptr() const { return p_; }
42453 Ptr get() const { return p_; }
42454 private:
42455 Ptr p_;
42456 };
42457 template<class T>
42458 inline pointer_wrapper<T> ptr(T t)
42459 {
42460 return pointer_wrapper<T>(t);
42461 }
42462 template<typename T>
42463 class is_pointer_wrapper
42464 : public mpl::false_
42465 {
42466 };
42467 template<typename T>
42468 class is_pointer_wrapper<pointer_wrapper<T> >
42469 : public mpl::true_
42470 {
42471 };
42472 template<typename T>
42473 class unwrap_pointer
42474 {
42475 public:
42476 typedef T type;
42477 };
42478 template<typename T>
42479 class unwrap_pointer<pointer_wrapper<T> >
42480 {
42481 public:
42482 typedef T type;
42483 };
42484 }}
42485 namespace boost
42486 {
42487 template < typename MemberType, int UniqueID = 0 >
42488 class base_from_member
42489 {
42490 protected:
42491 MemberType member;
42492 base_from_member()
42493 : member()
42494 {}
42495
42496 template < typename T0 > explicit base_from_member( T0 x0 ) : member( x0 ) {} template < typename T0 , typename T1 > explicit base_from_member( T0 x0 , T1 x1 ) : member( x0 , x1 ) {} template < typename T0 , typename T1 , typename T2 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 ) : member( x0 , x1 , x2 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 ) : member( x0 , x1 , x2 , x3 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 , typename T4 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 ) : member( x0 , x1 , x2 , x3 , x4 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 ) : member( x0 , x1 , x2 , x3 , x4 , x5 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 , T6 x6 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 , T6 x6 , T7 x7 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 , T6 x6 , T7 x7 , T8 x8 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 ) {} template < typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 > explicit base_from_member( T0 x0 , T1 x1 , T2 x2 , T3 x3 , T4 x4 , T5 x5 , T6 x6 , T7 x7 , T8 x8 , T9 x9 ) : member( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 ) {}
42497 };
42498 }
42499 namespace boost
42500 {
42501 template<class T> inline void checked_delete(T * x)
42502 {
42503 typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
42504 (void) sizeof(type_must_be_complete);
42505 delete x;
42506 }
42507 template<class T> inline void checked_array_delete(T * x)
42508 {
42509 typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
42510 (void) sizeof(type_must_be_complete);
42511 delete [] x;
42512 }
42513 template<class T> struct checked_deleter
42514 {
42515 typedef void result_type;
42516 typedef T * argument_type;
42517 void operator()(T * x) const
42518 {
42519 boost::checked_delete(x);
42520 }
42521 };
42522 template<class T> struct checked_array_deleter
42523 {
42524 typedef void result_type;
42525 typedef T * argument_type;
42526 void operator()(T * x) const
42527 {
42528 boost::checked_array_delete(x);
42529 }
42530 };
42531 }
42532 namespace boost {
42533 template <class T>
42534 inline T next(T x) { return ++x; }
42535 template <class T, class Distance>
42536 inline T next(T x, Distance n)
42537 {
42538 std::advance(x, n);
42539 return x;
42540 }
42541 template <class T>
42542 inline T prior(T x) { return --x; }
42543 template <class T, class Distance>
42544 inline T prior(T x, Distance n)
42545 {
42546 std::advance(x, -n);
42547 return x;
42548 }
42549 }
42550 namespace boost {
42551 namespace noncopyable_
42552 {
42553 class noncopyable
42554 {
42555 protected:
42556 noncopyable() {}
42557 ~noncopyable() {}
42558 private:
42559 noncopyable( const noncopyable& );
42560 const noncopyable& operator=( const noncopyable& );
42561 };
42562 }
42563 typedef noncopyable_::noncopyable noncopyable;
42564 }
42565
42566 namespace boost
42567 {
42568 namespace detail {
42569 template <class Category, class T, class Distance, class Pointer, class Reference>
42570 struct iterator_base : std::iterator<Category, T, Distance, Pointer, Reference> {};
42571 }
42572 template <class Category, class T, class Distance = std::ptrdiff_t,
42573 class Pointer = T*, class Reference = T&>
42574 struct iterator : boost::detail::iterator_base<Category, T, Distance, Pointer, Reference> {};
42575 }
42576 namespace boost {
42577 namespace detail {
42578 template <typename T> class empty_base {
42579 };
42580 }
42581 }
42582 namespace boost
42583 {
42584 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42585 struct less_than_comparable2 : B
42586 {
42587 friend bool operator<=(const T& x, const U& y) { return !static_cast<bool>(x > y); }
42588 friend bool operator>=(const T& x, const U& y) { return !static_cast<bool>(x < y); }
42589 friend bool operator>(const U& x, const T& y) { return y < x; }
42590 friend bool operator<(const U& x, const T& y) { return y > x; }
42591 friend bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); }
42592 friend bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); }
42593 };
42594 template <class T, class B = ::boost::detail::empty_base<T> >
42595 struct less_than_comparable1 : B
42596 {
42597 friend bool operator>(const T& x, const T& y) { return y < x; }
42598 friend bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); }
42599 friend bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); }
42600 };
42601 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42602 struct equality_comparable2 : B
42603 {
42604 friend bool operator==(const U& y, const T& x) { return x == y; }
42605 friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); }
42606 friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); }
42607 };
42608 template <class T, class B = ::boost::detail::empty_base<T> >
42609 struct equality_comparable1 : B
42610 {
42611 friend bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); }
42612 };
42613 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct multipliable2 : B { friend T operator *( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv *= rhs; return nrv; } friend T operator *( const U& lhs, const T& rhs ) { T nrv( rhs ); nrv *= lhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct multipliable1 : B { friend T operator *( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv *= rhs; return nrv; } };
42614 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct addable2 : B { friend T operator +( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv += rhs; return nrv; } friend T operator +( const U& lhs, const T& rhs ) { T nrv( rhs ); nrv += lhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct addable1 : B { friend T operator +( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv += rhs; return nrv; } };
42615 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct subtractable2 : B { friend T operator -( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv -= rhs; return nrv; } }; template <class T, class U, class B = ::boost::detail::empty_base<T> > struct subtractable2_left : B { friend T operator -( const U& lhs, const T& rhs ) { T nrv( lhs ); nrv -= rhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct subtractable1 : B { friend T operator -( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv -= rhs; return nrv; } };
42616 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct dividable2 : B { friend T operator /( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv /= rhs; return nrv; } }; template <class T, class U, class B = ::boost::detail::empty_base<T> > struct dividable2_left : B { friend T operator /( const U& lhs, const T& rhs ) { T nrv( lhs ); nrv /= rhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct dividable1 : B { friend T operator /( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv /= rhs; return nrv; } };
42617 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct modable2 : B { friend T operator %( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv %= rhs; return nrv; } }; template <class T, class U, class B = ::boost::detail::empty_base<T> > struct modable2_left : B { friend T operator %( const U& lhs, const T& rhs ) { T nrv( lhs ); nrv %= rhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct modable1 : B { friend T operator %( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv %= rhs; return nrv; } };
42618 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct xorable2 : B { friend T operator ^( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv ^= rhs; return nrv; } friend T operator ^( const U& lhs, const T& rhs ) { T nrv( rhs ); nrv ^= lhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct xorable1 : B { friend T operator ^( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv ^= rhs; return nrv; } };
42619 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct andable2 : B { friend T operator &( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv &= rhs; return nrv; } friend T operator &( const U& lhs, const T& rhs ) { T nrv( rhs ); nrv &= lhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct andable1 : B { friend T operator &( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv &= rhs; return nrv; } };
42620 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct orable2 : B { friend T operator |( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv |= rhs; return nrv; } friend T operator |( const U& lhs, const T& rhs ) { T nrv( rhs ); nrv |= lhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct orable1 : B { friend T operator |( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv |= rhs; return nrv; } };
42621 template <class T, class B = ::boost::detail::empty_base<T> >
42622 struct incrementable : B
42623 {
42624 friend T operator++(T& x, int)
42625 {
42626 incrementable_type nrv(x);
42627 ++x;
42628 return nrv;
42629 }
42630 private:
42631 typedef T incrementable_type;
42632 };
42633 template <class T, class B = ::boost::detail::empty_base<T> >
42634 struct decrementable : B
42635 {
42636 friend T operator--(T& x, int)
42637 {
42638 decrementable_type nrv(x);
42639 --x;
42640 return nrv;
42641 }
42642 private:
42643 typedef T decrementable_type;
42644 };
42645 template <class T, class P, class B = ::boost::detail::empty_base<T> >
42646 struct dereferenceable : B
42647 {
42648 P operator->() const
42649 {
42650 return &*static_cast<const T&>(*this);
42651 }
42652 };
42653 template <class T, class I, class R, class B = ::boost::detail::empty_base<T> >
42654 struct indexable : B
42655 {
42656 R operator[](I n) const
42657 {
42658 return *(static_cast<const T&>(*this) + n);
42659 }
42660 };
42661 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct left_shiftable2 : B { friend T operator <<( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv <<= rhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct left_shiftable1 : B { friend T operator <<( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv <<= rhs; return nrv; } };
42662 template <class T, class U, class B = ::boost::detail::empty_base<T> > struct right_shiftable2 : B { friend T operator >>( const T& lhs, const U& rhs ) { T nrv( lhs ); nrv >>= rhs; return nrv; } }; template <class T, class B = ::boost::detail::empty_base<T> > struct right_shiftable1 : B { friend T operator >>( const T& lhs, const T& rhs ) { T nrv( lhs ); nrv >>= rhs; return nrv; } };
42663 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42664 struct equivalent2 : B
42665 {
42666 friend bool operator==(const T& x, const U& y)
42667 {
42668 return !static_cast<bool>(x < y) && !static_cast<bool>(x > y);
42669 }
42670 };
42671 template <class T, class B = ::boost::detail::empty_base<T> >
42672 struct equivalent1 : B
42673 {
42674 friend bool operator==(const T&x, const T&y)
42675 {
42676 return !static_cast<bool>(x < y) && !static_cast<bool>(y < x);
42677 }
42678 };
42679 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42680 struct partially_ordered2 : B
42681 {
42682 friend bool operator<=(const T& x, const U& y)
42683 { return static_cast<bool>(x < y) || static_cast<bool>(x == y); }
42684 friend bool operator>=(const T& x, const U& y)
42685 { return static_cast<bool>(x > y) || static_cast<bool>(x == y); }
42686 friend bool operator>(const U& x, const T& y)
42687 { return y < x; }
42688 friend bool operator<(const U& x, const T& y)
42689 { return y > x; }
42690 friend bool operator<=(const U& x, const T& y)
42691 { return static_cast<bool>(y > x) || static_cast<bool>(y == x); }
42692 friend bool operator>=(const U& x, const T& y)
42693 { return static_cast<bool>(y < x) || static_cast<bool>(y == x); }
42694 };
42695 template <class T, class B = ::boost::detail::empty_base<T> >
42696 struct partially_ordered1 : B
42697 {
42698 friend bool operator>(const T& x, const T& y)
42699 { return y < x; }
42700 friend bool operator<=(const T& x, const T& y)
42701 { return static_cast<bool>(x < y) || static_cast<bool>(x == y); }
42702 friend bool operator>=(const T& x, const T& y)
42703 { return static_cast<bool>(y < x) || static_cast<bool>(x == y); }
42704 };
42705 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42706 struct totally_ordered2
42707 : less_than_comparable2<T, U
42708 , equality_comparable2<T, U, B
42709 > > {};
42710 template <class T, class B = ::boost::detail::empty_base<T> >
42711 struct totally_ordered1
42712 : less_than_comparable1<T
42713 , equality_comparable1<T, B
42714 > > {};
42715 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42716 struct additive2
42717 : addable2<T, U
42718 , subtractable2<T, U, B
42719 > > {};
42720 template <class T, class B = ::boost::detail::empty_base<T> >
42721 struct additive1
42722 : addable1<T
42723 , subtractable1<T, B
42724 > > {};
42725 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42726 struct multiplicative2
42727 : multipliable2<T, U
42728 , dividable2<T, U, B
42729 > > {};
42730 template <class T, class B = ::boost::detail::empty_base<T> >
42731 struct multiplicative1
42732 : multipliable1<T
42733 , dividable1<T, B
42734 > > {};
42735 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42736 struct integer_multiplicative2
42737 : multiplicative2<T, U
42738 , modable2<T, U, B
42739 > > {};
42740 template <class T, class B = ::boost::detail::empty_base<T> >
42741 struct integer_multiplicative1
42742 : multiplicative1<T
42743 , modable1<T, B
42744 > > {};
42745 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42746 struct arithmetic2
42747 : additive2<T, U
42748 , multiplicative2<T, U, B
42749 > > {};
42750 template <class T, class B = ::boost::detail::empty_base<T> >
42751 struct arithmetic1
42752 : additive1<T
42753 , multiplicative1<T, B
42754 > > {};
42755 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42756 struct integer_arithmetic2
42757 : additive2<T, U
42758 , integer_multiplicative2<T, U, B
42759 > > {};
42760 template <class T, class B = ::boost::detail::empty_base<T> >
42761 struct integer_arithmetic1
42762 : additive1<T
42763 , integer_multiplicative1<T, B
42764 > > {};
42765 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42766 struct bitwise2
42767 : xorable2<T, U
42768 , andable2<T, U
42769 , orable2<T, U, B
42770 > > > {};
42771 template <class T, class B = ::boost::detail::empty_base<T> >
42772 struct bitwise1
42773 : xorable1<T
42774 , andable1<T
42775 , orable1<T, B
42776 > > > {};
42777 template <class T, class B = ::boost::detail::empty_base<T> >
42778 struct unit_steppable
42779 : incrementable<T
42780 , decrementable<T, B
42781 > > {};
42782 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42783 struct shiftable2
42784 : left_shiftable2<T, U
42785 , right_shiftable2<T, U, B
42786 > > {};
42787 template <class T, class B = ::boost::detail::empty_base<T> >
42788 struct shiftable1
42789 : left_shiftable1<T
42790 , right_shiftable1<T, B
42791 > > {};
42792 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42793 struct ring_operators2
42794 : additive2<T, U
42795 , subtractable2_left<T, U
42796 , multipliable2<T, U, B
42797 > > > {};
42798 template <class T, class B = ::boost::detail::empty_base<T> >
42799 struct ring_operators1
42800 : additive1<T
42801 , multipliable1<T, B
42802 > > {};
42803 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42804 struct ordered_ring_operators2
42805 : ring_operators2<T, U
42806 , totally_ordered2<T, U, B
42807 > > {};
42808 template <class T, class B = ::boost::detail::empty_base<T> >
42809 struct ordered_ring_operators1
42810 : ring_operators1<T
42811 , totally_ordered1<T, B
42812 > > {};
42813 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42814 struct field_operators2
42815 : ring_operators2<T, U
42816 , dividable2<T, U
42817 , dividable2_left<T, U, B
42818 > > > {};
42819 template <class T, class B = ::boost::detail::empty_base<T> >
42820 struct field_operators1
42821 : ring_operators1<T
42822 , dividable1<T, B
42823 > > {};
42824 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42825 struct ordered_field_operators2
42826 : field_operators2<T, U
42827 , totally_ordered2<T, U, B
42828 > > {};
42829 template <class T, class B = ::boost::detail::empty_base<T> >
42830 struct ordered_field_operators1
42831 : field_operators1<T
42832 , totally_ordered1<T, B
42833 > > {};
42834 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42835 struct euclidian_ring_operators2
42836 : ring_operators2<T, U
42837 , dividable2<T, U
42838 , dividable2_left<T, U
42839 , modable2<T, U
42840 , modable2_left<T, U, B
42841 > > > > > {};
42842 template <class T, class B = ::boost::detail::empty_base<T> >
42843 struct euclidian_ring_operators1
42844 : ring_operators1<T
42845 , dividable1<T
42846 , modable1<T, B
42847 > > > {};
42848 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42849 struct ordered_euclidian_ring_operators2
42850 : totally_ordered2<T, U
42851 , euclidian_ring_operators2<T, U, B
42852 > > {};
42853 template <class T, class B = ::boost::detail::empty_base<T> >
42854 struct ordered_euclidian_ring_operators1
42855 : totally_ordered1<T
42856 , euclidian_ring_operators1<T, B
42857 > > {};
42858 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42859 struct euclidean_ring_operators2
42860 : ring_operators2<T, U
42861 , dividable2<T, U
42862 , dividable2_left<T, U
42863 , modable2<T, U
42864 , modable2_left<T, U, B
42865 > > > > > {};
42866 template <class T, class B = ::boost::detail::empty_base<T> >
42867 struct euclidean_ring_operators1
42868 : ring_operators1<T
42869 , dividable1<T
42870 , modable1<T, B
42871 > > > {};
42872 template <class T, class U, class B = ::boost::detail::empty_base<T> >
42873 struct ordered_euclidean_ring_operators2
42874 : totally_ordered2<T, U
42875 , euclidean_ring_operators2<T, U, B
42876 > > {};
42877 template <class T, class B = ::boost::detail::empty_base<T> >
42878 struct ordered_euclidean_ring_operators1
42879 : totally_ordered1<T
42880 , euclidean_ring_operators1<T, B
42881 > > {};
42882 template <class T, class P, class B = ::boost::detail::empty_base<T> >
42883 struct input_iteratable
42884 : equality_comparable1<T
42885 , incrementable<T
42886 , dereferenceable<T, P, B
42887 > > > {};
42888 template <class T, class B = ::boost::detail::empty_base<T> >
42889 struct output_iteratable
42890 : incrementable<T, B
42891 > {};
42892 template <class T, class P, class B = ::boost::detail::empty_base<T> >
42893 struct forward_iteratable
42894 : input_iteratable<T, P, B
42895 > {};
42896 template <class T, class P, class B = ::boost::detail::empty_base<T> >
42897 struct bidirectional_iteratable
42898 : forward_iteratable<T, P
42899 , decrementable<T, B
42900 > > {};
42901 template <class T, class P, class D, class R, class B = ::boost::detail::empty_base<T> >
42902 struct random_access_iteratable
42903 : bidirectional_iteratable<T, P
42904 , less_than_comparable1<T
42905 , additive2<T, D
42906 , indexable<T, D, R, B
42907 > > > > {};
42908 }
42909 namespace boost {
42910 namespace detail {
42911 struct true_t {};
42912 struct false_t {};
42913 }
42914 template<class T> struct is_chained_base {
42915 typedef ::boost::detail::false_t value;
42916 };
42917 }
42918 namespace boost {
42919 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct less_than_comparable : less_than_comparable2<T, U, B> {}; template<class T, class U, class B> struct less_than_comparable<T, U, B, ::boost::detail::true_t> : less_than_comparable1<T, U> {}; template <class T, class B> struct less_than_comparable<T, T, B, ::boost::detail::false_t> : less_than_comparable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::less_than_comparable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::less_than_comparable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::less_than_comparable1<T, B> > { typedef ::boost::detail::true_t value; };
42920 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct equality_comparable : equality_comparable2<T, U, B> {}; template<class T, class U, class B> struct equality_comparable<T, U, B, ::boost::detail::true_t> : equality_comparable1<T, U> {}; template <class T, class B> struct equality_comparable<T, T, B, ::boost::detail::false_t> : equality_comparable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::equality_comparable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::equality_comparable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::equality_comparable1<T, B> > { typedef ::boost::detail::true_t value; };
42921 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct multipliable : multipliable2<T, U, B> {}; template<class T, class U, class B> struct multipliable<T, U, B, ::boost::detail::true_t> : multipliable1<T, U> {}; template <class T, class B> struct multipliable<T, T, B, ::boost::detail::false_t> : multipliable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::multipliable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::multipliable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::multipliable1<T, B> > { typedef ::boost::detail::true_t value; };
42922 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct addable : addable2<T, U, B> {}; template<class T, class U, class B> struct addable<T, U, B, ::boost::detail::true_t> : addable1<T, U> {}; template <class T, class B> struct addable<T, T, B, ::boost::detail::false_t> : addable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::addable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::addable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::addable1<T, B> > { typedef ::boost::detail::true_t value; };
42923 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct subtractable : subtractable2<T, U, B> {}; template<class T, class U, class B> struct subtractable<T, U, B, ::boost::detail::true_t> : subtractable1<T, U> {}; template <class T, class B> struct subtractable<T, T, B, ::boost::detail::false_t> : subtractable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::subtractable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::subtractable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::subtractable1<T, B> > { typedef ::boost::detail::true_t value; };
42924 template<class T, class U, class B> struct is_chained_base< ::boost::subtractable2_left<T, U, B> > { typedef ::boost::detail::true_t value; };
42925 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct dividable : dividable2<T, U, B> {}; template<class T, class U, class B> struct dividable<T, U, B, ::boost::detail::true_t> : dividable1<T, U> {}; template <class T, class B> struct dividable<T, T, B, ::boost::detail::false_t> : dividable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::dividable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::dividable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::dividable1<T, B> > { typedef ::boost::detail::true_t value; };
42926 template<class T, class U, class B> struct is_chained_base< ::boost::dividable2_left<T, U, B> > { typedef ::boost::detail::true_t value; };
42927 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct modable : modable2<T, U, B> {}; template<class T, class U, class B> struct modable<T, U, B, ::boost::detail::true_t> : modable1<T, U> {}; template <class T, class B> struct modable<T, T, B, ::boost::detail::false_t> : modable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::modable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::modable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::modable1<T, B> > { typedef ::boost::detail::true_t value; };
42928 template<class T, class U, class B> struct is_chained_base< ::boost::modable2_left<T, U, B> > { typedef ::boost::detail::true_t value; };
42929 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct xorable : xorable2<T, U, B> {}; template<class T, class U, class B> struct xorable<T, U, B, ::boost::detail::true_t> : xorable1<T, U> {}; template <class T, class B> struct xorable<T, T, B, ::boost::detail::false_t> : xorable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::xorable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::xorable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::xorable1<T, B> > { typedef ::boost::detail::true_t value; };
42930 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct andable : andable2<T, U, B> {}; template<class T, class U, class B> struct andable<T, U, B, ::boost::detail::true_t> : andable1<T, U> {}; template <class T, class B> struct andable<T, T, B, ::boost::detail::false_t> : andable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::andable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::andable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::andable1<T, B> > { typedef ::boost::detail::true_t value; };
42931 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct orable : orable2<T, U, B> {}; template<class T, class U, class B> struct orable<T, U, B, ::boost::detail::true_t> : orable1<T, U> {}; template <class T, class B> struct orable<T, T, B, ::boost::detail::false_t> : orable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::orable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::orable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::orable1<T, B> > { typedef ::boost::detail::true_t value; };
42932 template<class T, class B> struct is_chained_base< ::boost::incrementable<T, B> > { typedef ::boost::detail::true_t value; };
42933 template<class T, class B> struct is_chained_base< ::boost::decrementable<T, B> > { typedef ::boost::detail::true_t value; };
42934 template<class T, class U, class B> struct is_chained_base< ::boost::dereferenceable<T, U, B> > { typedef ::boost::detail::true_t value; };
42935 template<class T, class U, class V, class B> struct is_chained_base< ::boost::indexable<T, U, V, B> > { typedef ::boost::detail::true_t value; };
42936 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct left_shiftable : left_shiftable2<T, U, B> {}; template<class T, class U, class B> struct left_shiftable<T, U, B, ::boost::detail::true_t> : left_shiftable1<T, U> {}; template <class T, class B> struct left_shiftable<T, T, B, ::boost::detail::false_t> : left_shiftable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::left_shiftable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::left_shiftable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::left_shiftable1<T, B> > { typedef ::boost::detail::true_t value; };
42937 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct right_shiftable : right_shiftable2<T, U, B> {}; template<class T, class U, class B> struct right_shiftable<T, U, B, ::boost::detail::true_t> : right_shiftable1<T, U> {}; template <class T, class B> struct right_shiftable<T, T, B, ::boost::detail::false_t> : right_shiftable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::right_shiftable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::right_shiftable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::right_shiftable1<T, B> > { typedef ::boost::detail::true_t value; };
42938 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct equivalent : equivalent2<T, U, B> {}; template<class T, class U, class B> struct equivalent<T, U, B, ::boost::detail::true_t> : equivalent1<T, U> {}; template <class T, class B> struct equivalent<T, T, B, ::boost::detail::false_t> : equivalent1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::equivalent<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::equivalent2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::equivalent1<T, B> > { typedef ::boost::detail::true_t value; };
42939 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct partially_ordered : partially_ordered2<T, U, B> {}; template<class T, class U, class B> struct partially_ordered<T, U, B, ::boost::detail::true_t> : partially_ordered1<T, U> {}; template <class T, class B> struct partially_ordered<T, T, B, ::boost::detail::false_t> : partially_ordered1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::partially_ordered<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::partially_ordered2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::partially_ordered1<T, B> > { typedef ::boost::detail::true_t value; };
42940 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct totally_ordered : totally_ordered2<T, U, B> {}; template<class T, class U, class B> struct totally_ordered<T, U, B, ::boost::detail::true_t> : totally_ordered1<T, U> {}; template <class T, class B> struct totally_ordered<T, T, B, ::boost::detail::false_t> : totally_ordered1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::totally_ordered<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::totally_ordered2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::totally_ordered1<T, B> > { typedef ::boost::detail::true_t value; };
42941 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct additive : additive2<T, U, B> {}; template<class T, class U, class B> struct additive<T, U, B, ::boost::detail::true_t> : additive1<T, U> {}; template <class T, class B> struct additive<T, T, B, ::boost::detail::false_t> : additive1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::additive<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::additive2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::additive1<T, B> > { typedef ::boost::detail::true_t value; };
42942 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct multiplicative : multiplicative2<T, U, B> {}; template<class T, class U, class B> struct multiplicative<T, U, B, ::boost::detail::true_t> : multiplicative1<T, U> {}; template <class T, class B> struct multiplicative<T, T, B, ::boost::detail::false_t> : multiplicative1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::multiplicative<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::multiplicative2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::multiplicative1<T, B> > { typedef ::boost::detail::true_t value; };
42943 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct integer_multiplicative : integer_multiplicative2<T, U, B> {}; template<class T, class U, class B> struct integer_multiplicative<T, U, B, ::boost::detail::true_t> : integer_multiplicative1<T, U> {}; template <class T, class B> struct integer_multiplicative<T, T, B, ::boost::detail::false_t> : integer_multiplicative1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::integer_multiplicative<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::integer_multiplicative2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::integer_multiplicative1<T, B> > { typedef ::boost::detail::true_t value; };
42944 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct arithmetic : arithmetic2<T, U, B> {}; template<class T, class U, class B> struct arithmetic<T, U, B, ::boost::detail::true_t> : arithmetic1<T, U> {}; template <class T, class B> struct arithmetic<T, T, B, ::boost::detail::false_t> : arithmetic1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::arithmetic<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::arithmetic2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::arithmetic1<T, B> > { typedef ::boost::detail::true_t value; };
42945 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct integer_arithmetic : integer_arithmetic2<T, U, B> {}; template<class T, class U, class B> struct integer_arithmetic<T, U, B, ::boost::detail::true_t> : integer_arithmetic1<T, U> {}; template <class T, class B> struct integer_arithmetic<T, T, B, ::boost::detail::false_t> : integer_arithmetic1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::integer_arithmetic<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::integer_arithmetic2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::integer_arithmetic1<T, B> > { typedef ::boost::detail::true_t value; };
42946 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct bitwise : bitwise2<T, U, B> {}; template<class T, class U, class B> struct bitwise<T, U, B, ::boost::detail::true_t> : bitwise1<T, U> {}; template <class T, class B> struct bitwise<T, T, B, ::boost::detail::false_t> : bitwise1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::bitwise<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::bitwise2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::bitwise1<T, B> > { typedef ::boost::detail::true_t value; };
42947 template<class T, class B> struct is_chained_base< ::boost::unit_steppable<T, B> > { typedef ::boost::detail::true_t value; };
42948 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct shiftable : shiftable2<T, U, B> {}; template<class T, class U, class B> struct shiftable<T, U, B, ::boost::detail::true_t> : shiftable1<T, U> {}; template <class T, class B> struct shiftable<T, T, B, ::boost::detail::false_t> : shiftable1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::shiftable<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::shiftable2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::shiftable1<T, B> > { typedef ::boost::detail::true_t value; };
42949 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct ring_operators : ring_operators2<T, U, B> {}; template<class T, class U, class B> struct ring_operators<T, U, B, ::boost::detail::true_t> : ring_operators1<T, U> {}; template <class T, class B> struct ring_operators<T, T, B, ::boost::detail::false_t> : ring_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::ring_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::ring_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::ring_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42950 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct ordered_ring_operators : ordered_ring_operators2<T, U, B> {}; template<class T, class U, class B> struct ordered_ring_operators<T, U, B, ::boost::detail::true_t> : ordered_ring_operators1<T, U> {}; template <class T, class B> struct ordered_ring_operators<T, T, B, ::boost::detail::false_t> : ordered_ring_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::ordered_ring_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::ordered_ring_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::ordered_ring_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42951 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct field_operators : field_operators2<T, U, B> {}; template<class T, class U, class B> struct field_operators<T, U, B, ::boost::detail::true_t> : field_operators1<T, U> {}; template <class T, class B> struct field_operators<T, T, B, ::boost::detail::false_t> : field_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::field_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::field_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::field_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42952 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct ordered_field_operators : ordered_field_operators2<T, U, B> {}; template<class T, class U, class B> struct ordered_field_operators<T, U, B, ::boost::detail::true_t> : ordered_field_operators1<T, U> {}; template <class T, class B> struct ordered_field_operators<T, T, B, ::boost::detail::false_t> : ordered_field_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::ordered_field_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::ordered_field_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::ordered_field_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42953 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct euclidian_ring_operators : euclidian_ring_operators2<T, U, B> {}; template<class T, class U, class B> struct euclidian_ring_operators<T, U, B, ::boost::detail::true_t> : euclidian_ring_operators1<T, U> {}; template <class T, class B> struct euclidian_ring_operators<T, T, B, ::boost::detail::false_t> : euclidian_ring_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::euclidian_ring_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::euclidian_ring_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::euclidian_ring_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42954 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct ordered_euclidian_ring_operators : ordered_euclidian_ring_operators2<T, U, B> {}; template<class T, class U, class B> struct ordered_euclidian_ring_operators<T, U, B, ::boost::detail::true_t> : ordered_euclidian_ring_operators1<T, U> {}; template <class T, class B> struct ordered_euclidian_ring_operators<T, T, B, ::boost::detail::false_t> : ordered_euclidian_ring_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::ordered_euclidian_ring_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::ordered_euclidian_ring_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::ordered_euclidian_ring_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42955 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct euclidean_ring_operators : euclidean_ring_operators2<T, U, B> {}; template<class T, class U, class B> struct euclidean_ring_operators<T, U, B, ::boost::detail::true_t> : euclidean_ring_operators1<T, U> {}; template <class T, class B> struct euclidean_ring_operators<T, T, B, ::boost::detail::false_t> : euclidean_ring_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::euclidean_ring_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::euclidean_ring_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::euclidean_ring_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42956 template <class T ,class U = T ,class B = ::boost::detail::empty_base<T> ,class O = typename is_chained_base<U>::value > struct ordered_euclidean_ring_operators : ordered_euclidean_ring_operators2<T, U, B> {}; template<class T, class U, class B> struct ordered_euclidean_ring_operators<T, U, B, ::boost::detail::true_t> : ordered_euclidean_ring_operators1<T, U> {}; template <class T, class B> struct ordered_euclidean_ring_operators<T, T, B, ::boost::detail::false_t> : ordered_euclidean_ring_operators1<T, B> {}; template<class T, class U, class B, class O> struct is_chained_base< ::boost::ordered_euclidean_ring_operators<T, U, B, O> > { typedef ::boost::detail::true_t value; }; template<class T, class U, class B> struct is_chained_base< ::boost::ordered_euclidean_ring_operators2<T, U, B> > { typedef ::boost::detail::true_t value; }; template<class T, class B> struct is_chained_base< ::boost::ordered_euclidean_ring_operators1<T, B> > { typedef ::boost::detail::true_t value; };
42957 template<class T, class U, class B> struct is_chained_base< ::boost::input_iteratable<T, U, B> > { typedef ::boost::detail::true_t value; };
42958 template<class T, class B> struct is_chained_base< ::boost::output_iteratable<T, B> > { typedef ::boost::detail::true_t value; };
42959 template<class T, class U, class B> struct is_chained_base< ::boost::forward_iteratable<T, U, B> > { typedef ::boost::detail::true_t value; };
42960 template<class T, class U, class B> struct is_chained_base< ::boost::bidirectional_iteratable<T, U, B> > { typedef ::boost::detail::true_t value; };
42961 template<class T, class U, class V, class W, class B> struct is_chained_base< ::boost::random_access_iteratable<T, U, V, W, B> > { typedef ::boost::detail::true_t value; };
42962 template <class T, class U>
42963 struct operators2
42964 : totally_ordered2<T,U
42965 , integer_arithmetic2<T,U
42966 , bitwise2<T,U
42967 > > > {};
42968 template <class T, class U = T>
42969 struct operators : operators2<T, U> {};
42970 template <class T> struct operators<T, T>
42971 : totally_ordered<T
42972 , integer_arithmetic<T
42973 , bitwise<T
42974 , unit_steppable<T
42975 > > > > {};
42976 template <class T,
42977 class V,
42978 class D = std::ptrdiff_t,
42979 class P = V const *,
42980 class R = V const &>
42981 struct input_iterator_helper
42982 : input_iteratable<T, P
42983 , boost::iterator<std::input_iterator_tag, V, D, P, R
42984 > > {};
42985 template<class T>
42986 struct output_iterator_helper
42987 : output_iteratable<T
42988 , boost::iterator<std::output_iterator_tag, void, void, void, void
42989 > >
42990 {
42991 T& operator*() { return static_cast<T&>(*this); }
42992 T& operator++() { return static_cast<T&>(*this); }
42993 };
42994 template <class T,
42995 class V,
42996 class D = std::ptrdiff_t,
42997 class P = V*,
42998 class R = V&>
42999 struct forward_iterator_helper
43000 : forward_iteratable<T, P
43001 , boost::iterator<std::forward_iterator_tag, V, D, P, R
43002 > > {};
43003 template <class T,
43004 class V,
43005 class D = std::ptrdiff_t,
43006 class P = V*,
43007 class R = V&>
43008 struct bidirectional_iterator_helper
43009 : bidirectional_iteratable<T, P
43010 , boost::iterator<std::bidirectional_iterator_tag, V, D, P, R
43011 > > {};
43012 template <class T,
43013 class V,
43014 class D = std::ptrdiff_t,
43015 class P = V*,
43016 class R = V&>
43017 struct random_access_iterator_helper
43018 : random_access_iteratable<T, P, D, R
43019 , boost::iterator<std::random_access_iterator_tag, V, D, P, R
43020 > >
43021 {
43022 friend D requires_difference_operator(const T& x, const T& y) {
43023 return x - y;
43024 }
43025 };
43026 }
43027
43028
43029 namespace boost{
43030 template <bool x> struct STATIC_ASSERTION_FAILURE;
43031 template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
43032 template<int x> struct static_assert_test{};
43033 }
43034 namespace boost { namespace python {
43035 bool cxxabi_cxa_demangle_is_broken();
43036 struct type_info : private totally_ordered<type_info>
43037 {
43038 inline type_info(std::type_info const& = typeid(void));
43039 inline bool operator<(type_info const& rhs) const;
43040 inline bool operator==(type_info const& rhs) const;
43041 char const* name() const;
43042 friend std::ostream& operator<<(
43043 std::ostream&, type_info const&);
43044 private:
43045 typedef char const* base_id_t;
43046 base_id_t m_base_type;
43047 };
43048 template <class T>
43049 inline type_info type_id()
43050 {
43051 return type_info(
43052 typeid(T)
43053 );
43054 }
43055 inline type_info::type_info(std::type_info const& id)
43056 : m_base_type(
43057 id.name()
43058 )
43059 {
43060 }
43061 inline bool type_info::operator<(type_info const& rhs) const
43062 {
43063 return std::strcmp(m_base_type, rhs.m_base_type) < 0;
43064 }
43065 inline bool type_info::operator==(type_info const& rhs) const
43066 {
43067 return !std::strcmp(m_base_type, rhs.m_base_type);
43068 }
43069 namespace detail
43070 {
43071 char const* gcc_demangle(char const*);
43072 }
43073 inline char const* type_info::name() const
43074 {
43075 char const* raw_name
43076 = m_base_type
43077 ;
43078 return detail::gcc_demangle(raw_name);
43079 }
43080 std::ostream& operator<<(std::ostream&, type_info const&);
43081 template<>
43082 inline type_info type_id<void>()
43083 {
43084 return type_info (typeid (void *));
43085 }
43086 template<>
43087 inline type_info type_id<const volatile void>()
43088 {
43089 return type_info (typeid (void *));
43090 }
43091 }}
43092
43093 namespace boost { namespace python {
43094 struct instance_holder : private noncopyable
43095 {
43096 public:
43097 instance_holder();
43098 virtual ~instance_holder();
43099 instance_holder* next() const;
43100 virtual void* holds(type_info, bool null_ptr_only) = 0;
43101 void install(PyObject* inst) throw();
43102 static void* allocate(PyObject*, std::size_t offset, std::size_t size);
43103 static void deallocate(PyObject*, void* storage) throw();
43104 private:
43105 instance_holder* m_next;
43106 };
43107 inline instance_holder* instance_holder::next() const
43108 {
43109 return m_next;
43110 }
43111 }}
43112 namespace boost { namespace python { namespace objects {
43113 void* find_static_type(void* p, type_info src, type_info dst);
43114 void* find_dynamic_type(void* p, type_info src, type_info dst);
43115 }}}
43116 namespace boost { namespace python { namespace detail {
43117 template <class T> struct is_auto_ptr : mpl::false_ { }; template < class T0 > struct is_auto_ptr< std::auto_ptr< T0 > > : mpl::true_ { };
43118 }}}
43119 namespace boost { namespace python { namespace detail {
43120 template <class T>
43121 struct copy_ctor_mutates_rhs
43122 : is_auto_ptr<T>
43123 {
43124 };
43125 }}}
43126 namespace boost { namespace python { namespace detail {
43127 template <class T>
43128 struct value_arg
43129 : mpl::if_<
43130 copy_ctor_mutates_rhs<T>
43131 , T
43132 , typename add_reference<
43133 typename add_const<T>::type
43134 >::type
43135 >
43136 {};
43137 }}}
43138 namespace boost { namespace mpl { namespace aux {
43139 template< typename T > struct nested_type_wknd
43140 : T::type
43141 {
43142 };
43143 }}}
43144 namespace boost { namespace mpl {
43145 namespace aux {
43146 template< bool C_, typename T1, typename T2, typename T3, typename T4 >
43147 struct or_impl
43148 : true_
43149 {
43150 };
43151 template< typename T1, typename T2, typename T3, typename T4 >
43152 struct or_impl< false,T1,T2,T3,T4 >
43153 : or_impl<
43154 ::boost::mpl::aux::nested_type_wknd<T1>::value
43155 , T2, T3, T4
43156 , false_
43157 >
43158 {
43159 };
43160 template<>
43161 struct or_impl<
43162 false
43163 , false_, false_, false_, false_
43164 >
43165 : false_
43166 {
43167 };
43168 }
43169 template<
43170 typename T1 = na
43171 , typename T2 = na
43172 , typename T3 = false_, typename T4 = false_, typename T5 = false_
43173 >
43174 struct or_
43175 : aux::or_impl<
43176 ::boost::mpl::aux::nested_type_wknd<T1>::value
43177 , T2, T3, T4, T5
43178 >
43179 {
43180
43181 };
43182 template<> struct or_<
43183 na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : or_< T1 , T2 > { }; }; template< typename Tag > struct lambda< or_< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef or_< na , na > result_; typedef or_< na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< or_< T1 , T2 , T3 , T4 , T5 > > : int_<5> { }; template<> struct template_arity< or_< na , na > > : int_<-1> { }; }
43184 }}
43185 namespace boost { namespace python { namespace objects {
43186 template <class T>
43187 struct reference_to_value
43188 {
43189 typedef typename add_reference<typename add_const<T>::type>::type reference;
43190 reference_to_value(reference x) : m_value(x) {}
43191 reference get() const { return m_value; }
43192 private:
43193 reference m_value;
43194 };
43195 template <class T>
43196 struct forward
43197 : mpl::if_<
43198 mpl::or_<python::detail::copy_ctor_mutates_rhs<T>, is_scalar<T> >
43199 , T
43200 , reference_to_value<T>
43201 >
43202 {
43203 };
43204 template<typename T>
43205 struct unforward
43206 {
43207 typedef typename unwrap_reference<T>::type& type;
43208 };
43209 template<typename T>
43210 struct unforward<reference_to_value<T> >
43211 {
43212 typedef T type;
43213 };
43214 template <typename T>
43215 struct unforward_cref
43216 : python::detail::value_arg<
43217 typename unwrap_reference<T>::type
43218 >
43219 {
43220 };
43221 template<typename T>
43222 struct unforward_cref<reference_to_value<T> >
43223 : add_reference<typename add_const<T>::type>
43224 {
43225 };
43226 template <class T>
43227 typename reference_to_value<T>::reference
43228 do_unforward(reference_to_value<T> const& x, int)
43229 {
43230 return x.get();
43231 }
43232 template <class T>
43233 typename reference_wrapper<T>::type&
43234 do_unforward(reference_wrapper<T> const& x, int)
43235 {
43236 return x.get();
43237 }
43238 template <class T>
43239 T const& do_unforward(T const& x, ...)
43240 {
43241 return x;
43242 }
43243 }}}
43244 namespace boost {
43245 template< typename T > struct remove_pointer { typedef T type; };
43246 template< typename T > struct remove_pointer<T*> { typedef T type; };
43247 template< typename T > struct remove_pointer<T* const> { typedef T type; };
43248 template< typename T > struct remove_pointer<T* volatile> { typedef T type; };
43249 template< typename T > struct remove_pointer<T* const volatile> { typedef T type; };
43250 }
43251 namespace boost { namespace python {
43252 namespace detail
43253 {
43254 template <bool is_ptr = true>
43255 struct pointee_impl
43256 {
43257 template <class T> struct apply : remove_pointer<T> {};
43258 };
43259 template <>
43260 struct pointee_impl<false>
43261 {
43262 template <class T> struct apply
43263 {
43264 typedef typename T::element_type type;
43265 };
43266 };
43267 }
43268 template <class T>
43269 struct pointee
43270 : detail::pointee_impl<
43271 ::boost::is_pointer<T>::value
43272 >::template apply<T>
43273 {
43274 };
43275 }}
43276 namespace boost{
43277 template< typename T > struct is_polymorphic : ::boost::integral_constant<bool,__is_polymorphic(T)> { };
43278 }
43279 namespace boost { namespace python {
43280 class override;
43281 namespace detail
43282 {
43283 class wrapper_base;
43284 namespace wrapper_base_
43285 {
43286 inline PyObject* get_owner(wrapper_base const volatile& w);
43287 inline PyObject*
43288 owner_impl(void const volatile* , mpl::false_)
43289 {
43290 return 0;
43291 }
43292 template <class T>
43293 inline PyObject*
43294 owner_impl(T const volatile* x, mpl::true_);
43295 template <class T>
43296 inline PyObject*
43297 owner(T const volatile* x)
43298 {
43299 return wrapper_base_::owner_impl(x,is_polymorphic<T>());
43300 }
43301 }
43302 class wrapper_base
43303 {
43304 friend void initialize_wrapper(PyObject* self, wrapper_base* w);
43305 friend PyObject* wrapper_base_::get_owner(wrapper_base const volatile& w);
43306 protected:
43307 wrapper_base() : m_self(0) {}
43308 override get_override(
43309 char const* name, PyTypeObject* class_object) const;
43310 private:
43311 void detach();
43312 private:
43313 PyObject* m_self;
43314 };
43315 namespace wrapper_base_
43316 {
43317 template <class T>
43318 inline PyObject*
43319 owner_impl(T const volatile* x, mpl::true_)
43320 {
43321 if (wrapper_base const volatile* w = dynamic_cast<wrapper_base const volatile*>(x))
43322 {
43323 return wrapper_base_::get_owner(*w);
43324 }
43325 return 0;
43326 }
43327 inline PyObject* get_owner(wrapper_base const volatile& w)
43328 {
43329 return w.m_self;
43330 }
43331 }
43332 inline void initialize_wrapper(PyObject* self, wrapper_base* w)
43333 {
43334 w->m_self = self;
43335 }
43336 inline void initialize_wrapper(PyObject* , ...) {}
43337 }
43338 }}
43339 namespace boost { namespace python { namespace detail {
43340 template <class T>
43341 inline void force_instantiate(T const&) {}
43342 }}}
43343 namespace boost { namespace mpl {
43344 template<
43345 typename F, typename T1 = na, typename T2 = na, typename T3 = na
43346 , typename T4 = na, typename T5 = na
43347 >
43348 struct apply;
43349 template<
43350 typename F
43351 >
43352 struct apply0;
43353 template<
43354 typename F, typename T1
43355 >
43356 struct apply1;
43357 template<
43358 typename F, typename T1, typename T2
43359 >
43360 struct apply2;
43361 template<
43362 typename F, typename T1, typename T2, typename T3
43363 >
43364 struct apply3;
43365 template<
43366 typename F, typename T1, typename T2, typename T3, typename T4
43367 >
43368 struct apply4;
43369 template<
43370 typename F, typename T1, typename T2, typename T3, typename T4
43371 , typename T5
43372 >
43373 struct apply5;
43374 }}
43375 namespace mpl_ {
43376 template< int N > struct arg;
43377 }
43378 namespace boost { namespace mpl { using ::mpl_::arg; } }
43379 namespace boost { namespace mpl {
43380 namespace aux {
43381 template< long C_ >
43382 struct not_impl
43383 : bool_<!C_>
43384 {
43385 };
43386 }
43387 template<
43388 typename T = na
43389 >
43390 struct not_
43391 : aux::not_impl<
43392 ::boost::mpl::aux::nested_type_wknd<T>::value
43393 >
43394 {
43395
43396 };
43397 template<> struct not_< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : not_< T1 > { }; }; template< typename Tag > struct lambda< not_< na > , Tag , int_<-1> > { typedef false_ is_le; typedef not_< na > result_; typedef not_< na > type; }; namespace aux { template< typename T1 > struct template_arity< not_< T1 > > : int_<1> { }; template<> struct template_arity< not_< na > > : int_<-1> { }; }
43398 }}
43399
43400 namespace mpl_ {
43401 struct failed {};
43402 template< bool C > struct assert { typedef void* type; };
43403 template<> struct assert<false> { typedef assert type; };
43404 template< bool C >
43405 int assertion_failed( typename assert<C>::type );
43406 template< bool C >
43407 struct assertion
43408 {
43409 static int failed( assert<false> );
43410 };
43411 template<>
43412 struct assertion<true>
43413 {
43414 static int failed( void* );
43415 };
43416 struct assert_
43417 {
43418 template< typename T1, typename T2 = na, typename T3 = na, typename T4 = na > struct types {};
43419 static assert_ const arg;
43420 enum relations { equal = 1, not_equal, greater, greater_equal, less, less_equal };
43421 };
43422 boost::mpl::aux::weighted_tag<1>::type operator==( assert_, assert_ );
43423 boost::mpl::aux::weighted_tag<2>::type operator!=( assert_, assert_ );
43424 boost::mpl::aux::weighted_tag<3>::type operator>( assert_, assert_ );
43425 boost::mpl::aux::weighted_tag<4>::type operator>=( assert_, assert_ );
43426 boost::mpl::aux::weighted_tag<5>::type operator<( assert_, assert_ );
43427 boost::mpl::aux::weighted_tag<6>::type operator<=( assert_, assert_ );
43428 template< assert_::relations r, long x, long y > struct assert_relation {};
43429 template< bool > struct assert_arg_pred_impl { typedef int type; };
43430 template<> struct assert_arg_pred_impl<true> { typedef void* type; };
43431 template< typename P > struct assert_arg_pred
43432 {
43433 typedef typename P::type p_type;
43434 typedef typename assert_arg_pred_impl< p_type::value >::type type;
43435 };
43436 template< typename P > struct assert_arg_pred_not
43437 {
43438 typedef typename P::type p_type;
43439 enum { p = !p_type::value };
43440 typedef typename assert_arg_pred_impl<p>::type type;
43441 };
43442 template< typename Pred >
43443 failed ************ (Pred::************
43444 assert_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type )
43445 );
43446 template< typename Pred >
43447 failed ************ (boost::mpl::not_<Pred>::************
43448 assert_not_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type )
43449 );
43450 template< typename Pred >
43451 assert<false>
43452 assert_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type );
43453 template< typename Pred >
43454 assert<false>
43455 assert_not_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type );
43456 }
43457 namespace mpl_ {
43458 template<> struct arg< -1 >
43459 {
43460 static const int value = -1;
43461
43462
43463 template<
43464 typename U1 = na, typename U2 = na, typename U3 = na
43465 , typename U4 = na, typename U5 = na
43466 >
43467 struct apply
43468 {
43469 typedef U1 type;
43470 enum { mpl_assertion_in_line_27 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (boost::mpl::is_na<type>))0, 1 ) ) ) };
43471 };
43472 };
43473 template<> struct arg<1>
43474 {
43475 static const int value = 1;
43476 typedef arg<2> next;
43477
43478
43479 template<
43480 typename U1 = na, typename U2 = na, typename U3 = na
43481 , typename U4 = na, typename U5 = na
43482 >
43483 struct apply
43484 {
43485 typedef U1 type;
43486 enum { mpl_assertion_in_line_45 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (boost::mpl::is_na<type>))0, 1 ) ) ) };
43487 };
43488 };
43489 template<> struct arg<2>
43490 {
43491 static const int value = 2;
43492 typedef arg<3> next;
43493
43494
43495 template<
43496 typename U1 = na, typename U2 = na, typename U3 = na
43497 , typename U4 = na, typename U5 = na
43498 >
43499 struct apply
43500 {
43501 typedef U2 type;
43502 enum { mpl_assertion_in_line_63 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (boost::mpl::is_na<type>))0, 1 ) ) ) };
43503 };
43504 };
43505 template<> struct arg<3>
43506 {
43507 static const int value = 3;
43508 typedef arg<4> next;
43509
43510
43511 template<
43512 typename U1 = na, typename U2 = na, typename U3 = na
43513 , typename U4 = na, typename U5 = na
43514 >
43515 struct apply
43516 {
43517 typedef U3 type;
43518 enum { mpl_assertion_in_line_81 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (boost::mpl::is_na<type>))0, 1 ) ) ) };
43519 };
43520 };
43521 template<> struct arg<4>
43522 {
43523 static const int value = 4;
43524 typedef arg<5> next;
43525
43526
43527 template<
43528 typename U1 = na, typename U2 = na, typename U3 = na
43529 , typename U4 = na, typename U5 = na
43530 >
43531 struct apply
43532 {
43533 typedef U4 type;
43534 enum { mpl_assertion_in_line_99 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (boost::mpl::is_na<type>))0, 1 ) ) ) };
43535 };
43536 };
43537 template<> struct arg<5>
43538 {
43539 static const int value = 5;
43540 typedef arg<6> next;
43541
43542
43543 template<
43544 typename U1 = na, typename U2 = na, typename U3 = na
43545 , typename U4 = na, typename U5 = na
43546 >
43547 struct apply
43548 {
43549 typedef U5 type;
43550 enum { mpl_assertion_in_line_117 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (boost::mpl::is_na<type>))0, 1 ) ) ) };
43551 };
43552 };
43553 }
43554 namespace mpl_ {
43555 typedef arg< -1 > _;
43556 }
43557 namespace boost { namespace mpl {
43558 using ::mpl_::_;
43559 namespace placeholders {
43560 using mpl_::_;
43561 }
43562 }}
43563 namespace mpl_ {
43564 typedef arg<1> _1;
43565 }
43566 namespace boost { namespace mpl {
43567 using ::mpl_::_1;
43568 namespace placeholders {
43569 using mpl_::_1;
43570 }
43571 }}
43572 namespace mpl_ {
43573 typedef arg<2> _2;
43574 }
43575 namespace boost { namespace mpl {
43576 using ::mpl_::_2;
43577 namespace placeholders {
43578 using mpl_::_2;
43579 }
43580 }}
43581 namespace mpl_ {
43582 typedef arg<3> _3;
43583 }
43584 namespace boost { namespace mpl {
43585 using ::mpl_::_3;
43586 namespace placeholders {
43587 using mpl_::_3;
43588 }
43589 }}
43590 namespace mpl_ {
43591 typedef arg<4> _4;
43592 }
43593 namespace boost { namespace mpl {
43594 using ::mpl_::_4;
43595 namespace placeholders {
43596 using mpl_::_4;
43597 }
43598 }}
43599 namespace mpl_ {
43600 typedef arg<5> _5;
43601 }
43602 namespace boost { namespace mpl {
43603 using ::mpl_::_5;
43604 namespace placeholders {
43605 using mpl_::_5;
43606 }
43607 }}
43608 namespace mpl_ {
43609 typedef arg<6> _6;
43610 }
43611 namespace boost { namespace mpl {
43612 using ::mpl_::_6;
43613 namespace placeholders {
43614 using mpl_::_6;
43615 }
43616 }}
43617 namespace boost { namespace mpl {
43618 template<
43619 typename F, typename T1 = na, typename T2 = na, typename T3 = na
43620 , typename T4 = na, typename T5 = na
43621 >
43622 struct bind;
43623 template<
43624 typename F
43625 >
43626 struct bind0;
43627 template<
43628 typename F, typename T1
43629 >
43630 struct bind1;
43631 template<
43632 typename F, typename T1, typename T2
43633 >
43634 struct bind2;
43635 template<
43636 typename F, typename T1, typename T2, typename T3
43637 >
43638 struct bind3;
43639 template<
43640 typename F, typename T1, typename T2, typename T3, typename T4
43641 >
43642 struct bind4;
43643 template<
43644 typename F, typename T1, typename T2, typename T3, typename T4
43645 , typename T5
43646 >
43647 struct bind5;
43648 }}
43649 namespace boost { namespace mpl {
43650 template<
43651 typename T = na
43652 , int not_le_ = 0
43653 >
43654 struct protect : T
43655 {
43656 typedef protect type;
43657 };
43658 template<> struct protect< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : protect< T1 > { }; };
43659 namespace aux { template< typename T1 > struct template_arity< protect< T1 > > : int_<1> { }; template<> struct template_arity< protect< na > > : int_<-1> { }; }
43660 }}
43661 namespace boost { namespace mpl {
43662 namespace aux {
43663 template<
43664 typename T, typename U1, typename U2, typename U3, typename U4
43665 , typename U5
43666 >
43667 struct resolve_bind_arg
43668 {
43669 typedef T type;
43670 };
43671 template<
43672 typename T
43673 , typename Arg
43674 >
43675 struct replace_unnamed_arg
43676 {
43677 typedef Arg next;
43678 typedef T type;
43679 };
43680 template<
43681 typename Arg
43682 >
43683 struct replace_unnamed_arg< arg< -1 >, Arg >
43684 {
43685 typedef typename Arg::next next;
43686 typedef Arg type;
43687 };
43688 template<
43689 int N, typename U1, typename U2, typename U3, typename U4, typename U5
43690 >
43691 struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
43692 {
43693 typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
43694 };
43695 template<
43696 typename F, typename T1, typename T2, typename T3, typename T4
43697 , typename T5, typename U1, typename U2, typename U3, typename U4
43698 , typename U5
43699 >
43700 struct resolve_bind_arg< bind< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5 >
43701 {
43702 typedef bind< F,T1,T2,T3,T4,T5 > f_;
43703 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43704 };
43705 }
43706 template<
43707 typename F
43708 >
43709 struct bind0
43710 {
43711 template<
43712 typename U1 = na, typename U2 = na, typename U3 = na
43713 , typename U4 = na, typename U5 = na
43714 >
43715 struct apply
43716 {
43717 private:
43718 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
43719 typedef typename r0::type a0;
43720 typedef typename r0::next n1;
43721 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
43722 public:
43723 typedef typename apply_wrap0<
43724 f_
43725 >::type type;
43726 };
43727 };
43728 namespace aux {
43729 template<
43730 typename F, typename U1, typename U2, typename U3, typename U4
43731 , typename U5
43732 >
43733 struct resolve_bind_arg<
43734 bind0<F>, U1, U2, U3, U4, U5
43735 >
43736 {
43737 typedef bind0<F> f_;
43738 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43739 };
43740 }
43741 namespace aux { template< typename T1 > struct template_arity< bind0< T1> > : int_<1> { }; }
43742 template<
43743 typename F
43744 >
43745 struct bind< F,na,na,na,na,na >
43746 : bind0<F>
43747 {
43748 };
43749 template<
43750 typename F, typename T1
43751 >
43752 struct bind1
43753 {
43754 template<
43755 typename U1 = na, typename U2 = na, typename U3 = na
43756 , typename U4 = na, typename U5 = na
43757 >
43758 struct apply
43759 {
43760 private:
43761 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
43762 typedef typename r0::type a0;
43763 typedef typename r0::next n1;
43764 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
43765 typedef aux::replace_unnamed_arg< T1,n1 > r1;
43766 typedef typename r1::type a1;
43767 typedef typename r1::next n2;
43768 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
43769 public:
43770 typedef typename apply_wrap1<
43771 f_
43772 , typename t1::type
43773 >::type type;
43774 };
43775 };
43776 namespace aux {
43777 template<
43778 typename F, typename T1, typename U1, typename U2, typename U3
43779 , typename U4, typename U5
43780 >
43781 struct resolve_bind_arg<
43782 bind1< F,T1 >, U1, U2, U3, U4, U5
43783 >
43784 {
43785 typedef bind1< F,T1 > f_;
43786 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43787 };
43788 }
43789 namespace aux { template< typename T1 , typename T2 > struct template_arity< bind1< T1 , T2> > : int_<2> { }; }
43790 template<
43791 typename F, typename T1
43792 >
43793 struct bind< F,T1,na,na,na,na >
43794 : bind1< F,T1 >
43795 {
43796 };
43797 template<
43798 typename F, typename T1, typename T2
43799 >
43800 struct bind2
43801 {
43802 template<
43803 typename U1 = na, typename U2 = na, typename U3 = na
43804 , typename U4 = na, typename U5 = na
43805 >
43806 struct apply
43807 {
43808 private:
43809 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
43810 typedef typename r0::type a0;
43811 typedef typename r0::next n1;
43812 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
43813 typedef aux::replace_unnamed_arg< T1,n1 > r1;
43814 typedef typename r1::type a1;
43815 typedef typename r1::next n2;
43816 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
43817 typedef aux::replace_unnamed_arg< T2,n2 > r2;
43818 typedef typename r2::type a2;
43819 typedef typename r2::next n3;
43820 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
43821 public:
43822 typedef typename apply_wrap2<
43823 f_
43824 , typename t1::type, typename t2::type
43825 >::type type;
43826 };
43827 };
43828 namespace aux {
43829 template<
43830 typename F, typename T1, typename T2, typename U1, typename U2
43831 , typename U3, typename U4, typename U5
43832 >
43833 struct resolve_bind_arg<
43834 bind2< F,T1,T2 >, U1, U2, U3, U4, U5
43835 >
43836 {
43837 typedef bind2< F,T1,T2 > f_;
43838 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43839 };
43840 }
43841 namespace aux { template< typename T1 , typename T2 , typename T3 > struct template_arity< bind2< T1 , T2 , T3> > : int_<3> { }; }
43842 template<
43843 typename F, typename T1, typename T2
43844 >
43845 struct bind< F,T1,T2,na,na,na >
43846 : bind2< F,T1,T2 >
43847 {
43848 };
43849 template<
43850 typename F, typename T1, typename T2, typename T3
43851 >
43852 struct bind3
43853 {
43854 template<
43855 typename U1 = na, typename U2 = na, typename U3 = na
43856 , typename U4 = na, typename U5 = na
43857 >
43858 struct apply
43859 {
43860 private:
43861 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
43862 typedef typename r0::type a0;
43863 typedef typename r0::next n1;
43864 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
43865 typedef aux::replace_unnamed_arg< T1,n1 > r1;
43866 typedef typename r1::type a1;
43867 typedef typename r1::next n2;
43868 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
43869 typedef aux::replace_unnamed_arg< T2,n2 > r2;
43870 typedef typename r2::type a2;
43871 typedef typename r2::next n3;
43872 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
43873 typedef aux::replace_unnamed_arg< T3,n3 > r3;
43874 typedef typename r3::type a3;
43875 typedef typename r3::next n4;
43876 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
43877 public:
43878 typedef typename apply_wrap3<
43879 f_
43880 , typename t1::type, typename t2::type, typename t3::type
43881 >::type type;
43882 };
43883 };
43884 namespace aux {
43885 template<
43886 typename F, typename T1, typename T2, typename T3, typename U1
43887 , typename U2, typename U3, typename U4, typename U5
43888 >
43889 struct resolve_bind_arg<
43890 bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
43891 >
43892 {
43893 typedef bind3< F,T1,T2,T3 > f_;
43894 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43895 };
43896 }
43897 namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 > struct template_arity< bind3< T1 , T2 , T3 , T4> > : int_<4> { }; }
43898 template<
43899 typename F, typename T1, typename T2, typename T3
43900 >
43901 struct bind< F,T1,T2,T3,na,na >
43902 : bind3< F,T1,T2,T3 >
43903 {
43904 };
43905 template<
43906 typename F, typename T1, typename T2, typename T3, typename T4
43907 >
43908 struct bind4
43909 {
43910 template<
43911 typename U1 = na, typename U2 = na, typename U3 = na
43912 , typename U4 = na, typename U5 = na
43913 >
43914 struct apply
43915 {
43916 private:
43917 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
43918 typedef typename r0::type a0;
43919 typedef typename r0::next n1;
43920 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
43921 typedef aux::replace_unnamed_arg< T1,n1 > r1;
43922 typedef typename r1::type a1;
43923 typedef typename r1::next n2;
43924 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
43925 typedef aux::replace_unnamed_arg< T2,n2 > r2;
43926 typedef typename r2::type a2;
43927 typedef typename r2::next n3;
43928 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
43929 typedef aux::replace_unnamed_arg< T3,n3 > r3;
43930 typedef typename r3::type a3;
43931 typedef typename r3::next n4;
43932 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
43933 typedef aux::replace_unnamed_arg< T4,n4 > r4;
43934 typedef typename r4::type a4;
43935 typedef typename r4::next n5;
43936 typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
43937 public:
43938 typedef typename apply_wrap4<
43939 f_
43940 , typename t1::type, typename t2::type, typename t3::type
43941 , typename t4::type
43942 >::type type;
43943 };
43944 };
43945 namespace aux {
43946 template<
43947 typename F, typename T1, typename T2, typename T3, typename T4
43948 , typename U1, typename U2, typename U3, typename U4, typename U5
43949 >
43950 struct resolve_bind_arg<
43951 bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
43952 >
43953 {
43954 typedef bind4< F,T1,T2,T3,T4 > f_;
43955 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43956 };
43957 }
43958 namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< bind4< T1 , T2 , T3 , T4 , T5> > : int_<5> { }; }
43959 template<
43960 typename F, typename T1, typename T2, typename T3, typename T4
43961 >
43962 struct bind< F,T1,T2,T3,T4,na >
43963 : bind4< F,T1,T2,T3,T4 >
43964 {
43965 };
43966 template<
43967 typename F, typename T1, typename T2, typename T3, typename T4
43968 , typename T5
43969 >
43970 struct bind5
43971 {
43972 template<
43973 typename U1 = na, typename U2 = na, typename U3 = na
43974 , typename U4 = na, typename U5 = na
43975 >
43976 struct apply
43977 {
43978 private:
43979 typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
43980 typedef typename r0::type a0;
43981 typedef typename r0::next n1;
43982 typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
43983 typedef aux::replace_unnamed_arg< T1,n1 > r1;
43984 typedef typename r1::type a1;
43985 typedef typename r1::next n2;
43986 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
43987 typedef aux::replace_unnamed_arg< T2,n2 > r2;
43988 typedef typename r2::type a2;
43989 typedef typename r2::next n3;
43990 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
43991 typedef aux::replace_unnamed_arg< T3,n3 > r3;
43992 typedef typename r3::type a3;
43993 typedef typename r3::next n4;
43994 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
43995 typedef aux::replace_unnamed_arg< T4,n4 > r4;
43996 typedef typename r4::type a4;
43997 typedef typename r4::next n5;
43998 typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
43999 typedef aux::replace_unnamed_arg< T5,n5 > r5;
44000 typedef typename r5::type a5;
44001 typedef typename r5::next n6;
44002 typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
44003 public:
44004 typedef typename apply_wrap5<
44005 f_
44006 , typename t1::type, typename t2::type, typename t3::type
44007 , typename t4::type, typename t5::type
44008 >::type type;
44009 };
44010 };
44011 namespace aux {
44012 template<
44013 typename F, typename T1, typename T2, typename T3, typename T4
44014 , typename T5, typename U1, typename U2, typename U3, typename U4
44015 , typename U5
44016 >
44017 struct resolve_bind_arg<
44018 bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
44019 >
44020 {
44021 typedef bind5< F,T1,T2,T3,T4,T5 > f_;
44022 typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
44023 };
44024 }
44025 namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > struct template_arity< bind5< T1 , T2 , T3 , T4 , T5 , T6> > : int_<6> { }; }
44026 template<
44027 typename F, typename T1, typename T2, typename T3, typename T4
44028 , typename T5
44029 >
44030 struct bind
44031 : bind5< F,T1,T2,T3,T4,T5 >
44032 {
44033 };
44034 template< template< typename T1, typename T2, typename T3 > class F, typename Tag >
44035 struct quote3;
44036 template< typename T1, typename T2, typename T3 > struct if_;
44037 template<
44038 typename Tag, typename T1, typename T2, typename T3
44039 >
44040 struct bind3<
44041 quote3< if_,Tag >
44042 , T1, T2, T3
44043 >
44044 {
44045 template<
44046 typename U1 = na, typename U2 = na, typename U3 = na
44047 , typename U4 = na, typename U5 = na
44048 >
44049 struct apply
44050 {
44051 private:
44052 typedef mpl::arg<1> n1;
44053 typedef aux::replace_unnamed_arg< T1,n1 > r1;
44054 typedef typename r1::type a1;
44055 typedef typename r1::next n2;
44056 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
44057 typedef aux::replace_unnamed_arg< T2,n2 > r2;
44058 typedef typename r2::type a2;
44059 typedef typename r2::next n3;
44060 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
44061 typedef aux::replace_unnamed_arg< T3,n3 > r3;
44062 typedef typename r3::type a3;
44063 typedef typename r3::next n4;
44064 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
44065 typedef typename if_<
44066 typename t1::type
44067 , t2, t3
44068 >::type f_;
44069 public:
44070 typedef typename f_::type type;
44071 };
44072 };
44073 template<
44074 template< typename T1, typename T2, typename T3 > class F, typename Tag
44075 >
44076 struct quote3;
44077 template< typename T1, typename T2, typename T3 > struct eval_if;
44078 template<
44079 typename Tag, typename T1, typename T2, typename T3
44080 >
44081 struct bind3<
44082 quote3< eval_if,Tag >
44083 , T1, T2, T3
44084 >
44085 {
44086 template<
44087 typename U1 = na, typename U2 = na, typename U3 = na
44088 , typename U4 = na, typename U5 = na
44089 >
44090 struct apply
44091 {
44092 private:
44093 typedef mpl::arg<1> n1;
44094 typedef aux::replace_unnamed_arg< T1,n1 > r1;
44095 typedef typename r1::type a1;
44096 typedef typename r1::next n2;
44097 typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
44098 typedef aux::replace_unnamed_arg< T2,n2 > r2;
44099 typedef typename r2::type a2;
44100 typedef typename r2::next n3;
44101 typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
44102 typedef aux::replace_unnamed_arg< T3,n3 > r3;
44103 typedef typename r3::type a3;
44104 typedef typename r3::next n4;
44105 typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
44106 typedef typename eval_if<
44107 typename t1::type
44108 , t2, t3
44109 >::type f_;
44110 public:
44111 typedef typename f_::type type;
44112 };
44113 };
44114 }}
44115 namespace boost { namespace mpl { namespace aux {
44116 template< typename T, typename fallback_ = boost::mpl::bool_<true> > struct has_type { struct gcc_3_2_wknd { template< typename U > static boost::mpl::aux::yes_tag test( boost::mpl::aux::type_wrapper<U> const volatile* , boost::mpl::aux::type_wrapper<typename U::type>* = 0 ); static boost::mpl::aux::no_tag test(...); }; typedef boost::mpl::aux::type_wrapper<T> t_; static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) == sizeof(boost::mpl::aux::yes_tag); typedef boost::mpl::bool_<value> type; };
44117 }}}
44118 namespace boost { namespace mpl {
44119 template< typename T, bool has_type_ >
44120 struct quote_impl
44121 {
44122 typedef typename T::type type;
44123 };
44124 template< typename T >
44125 struct quote_impl< T,false >
44126 {
44127 typedef T type;
44128 };
44129 template<
44130 template< typename P1 > class F
44131 , typename Tag = void_
44132 >
44133 struct quote1
44134 {
44135 template< typename U1 > struct apply
44136 : quote_impl<
44137 F<U1>
44138 , aux::has_type< F<U1> >::value
44139 >
44140 {
44141 };
44142 };
44143 template<
44144 template< typename P1, typename P2 > class F
44145 , typename Tag = void_
44146 >
44147 struct quote2
44148 {
44149 template< typename U1, typename U2 > struct apply
44150 : quote_impl<
44151 F< U1,U2 >
44152 , aux::has_type< F< U1,U2 > >::value
44153 >
44154 {
44155 };
44156 };
44157 template<
44158 template< typename P1, typename P2, typename P3 > class F
44159 , typename Tag = void_
44160 >
44161 struct quote3
44162 {
44163 template< typename U1, typename U2, typename U3 > struct apply
44164 : quote_impl<
44165 F< U1,U2,U3 >
44166 , aux::has_type< F< U1,U2,U3 > >::value
44167 >
44168 {
44169 };
44170 };
44171 template<
44172 template< typename P1, typename P2, typename P3, typename P4 > class F
44173 , typename Tag = void_
44174 >
44175 struct quote4
44176 {
44177 template<
44178 typename U1, typename U2, typename U3, typename U4
44179 >
44180 struct apply
44181 : quote_impl<
44182 F< U1,U2,U3,U4 >
44183 , aux::has_type< F< U1,U2,U3,U4 > >::value
44184 >
44185 {
44186 };
44187 };
44188 template<
44189 template<
44190 typename P1, typename P2, typename P3, typename P4
44191 , typename P5
44192 >
44193 class F
44194 , typename Tag = void_
44195 >
44196 struct quote5
44197 {
44198 template<
44199 typename U1, typename U2, typename U3, typename U4
44200 , typename U5
44201 >
44202 struct apply
44203 : quote_impl<
44204 F< U1,U2,U3,U4,U5 >
44205 , aux::has_type< F< U1,U2,U3,U4,U5 > >::value
44206 >
44207 {
44208 };
44209 };
44210 }}
44211 namespace boost { namespace mpl { namespace aux {
44212 template< int N > struct arity_tag
44213 {
44214 typedef char (&type)[N + 1];
44215 };
44216 template<
44217 int C1, int C2, int C3, int C4, int C5, int C6
44218 >
44219 struct max_arity
44220 {
44221 static const int value = ( C6 > 0 ? C6 : ( C5 > 0 ? C5 : ( C4 > 0 ? C4 : ( C3 > 0 ? C3 : ( C2 > 0 ? C2 : ( C1 > 0 ? C1 : -1 ) ) ) ) ) )
44222 ;
44223 };
44224 arity_tag<0>::type arity_helper(...);
44225 template<
44226 template< typename P1 > class F
44227 , typename T1
44228 >
44229 typename arity_tag<1>::type
44230 arity_helper(type_wrapper< F<T1> >, arity_tag<1>);
44231 template<
44232 template< typename P1, typename P2 > class F
44233 , typename T1, typename T2
44234 >
44235 typename arity_tag<2>::type
44236 arity_helper(type_wrapper< F< T1,T2 > >, arity_tag<2>);
44237 template<
44238 template< typename P1, typename P2, typename P3 > class F
44239 , typename T1, typename T2, typename T3
44240 >
44241 typename arity_tag<3>::type
44242 arity_helper(type_wrapper< F< T1,T2,T3 > >, arity_tag<3>);
44243 template<
44244 template< typename P1, typename P2, typename P3, typename P4 > class F
44245 , typename T1, typename T2, typename T3, typename T4
44246 >
44247 typename arity_tag<4>::type
44248 arity_helper(type_wrapper< F< T1,T2,T3,T4 > >, arity_tag<4>);
44249 template<
44250 template<
44251 typename P1, typename P2, typename P3, typename P4
44252 , typename P5
44253 >
44254 class F
44255 , typename T1, typename T2, typename T3, typename T4, typename T5
44256 >
44257 typename arity_tag<5>::type
44258 arity_helper(type_wrapper< F< T1,T2,T3,T4,T5 > >, arity_tag<5>);
44259 template<
44260 template<
44261 typename P1, typename P2, typename P3, typename P4
44262 , typename P5, typename P6
44263 >
44264 class F
44265 , typename T1, typename T2, typename T3, typename T4, typename T5
44266 , typename T6
44267 >
44268 typename arity_tag<6>::type
44269 arity_helper(type_wrapper< F< T1,T2,T3,T4,T5,T6 > >, arity_tag<6>);
44270 template< typename F, int N >
44271 struct template_arity_impl
44272 {
44273 static const int value = sizeof(arity_helper(type_wrapper<F>(), arity_tag<N>())) - 1
44274 ;
44275 };
44276 template< typename F >
44277 struct template_arity
44278 {
44279 static const int value = ( max_arity< template_arity_impl< F,1 >::value, template_arity_impl< F,2 >::value, template_arity_impl< F,3 >::value, template_arity_impl< F,4 >::value, template_arity_impl< F,5 >::value, template_arity_impl< F,6 >::value >::value )
44280 ;
44281 typedef mpl::int_<value> type;
44282 };
44283 }}}
44284 namespace boost { namespace mpl {
44285 namespace aux {
44286 template<
44287 bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false
44288 , bool C5 = false
44289 >
44290 struct lambda_or
44291 : true_
44292 {
44293 };
44294 template<>
44295 struct lambda_or< false,false,false,false,false >
44296 : false_
44297 {
44298 };
44299 }
44300 template<
44301 typename T
44302 , typename Tag
44303 , typename Arity
44304 >
44305 struct lambda
44306 {
44307 typedef false_ is_le;
44308 typedef T result_;
44309 typedef T type;
44310 };
44311 template<
44312 typename T
44313 >
44314 struct is_lambda_expression
44315 : lambda<T>::is_le
44316 {
44317 };
44318 template< int N, typename Tag >
44319 struct lambda< arg<N>,Tag, int_< -1 > >
44320 {
44321 typedef true_ is_le;
44322 typedef mpl::arg<N> result_;
44323 typedef mpl::protect<result_> type;
44324 };
44325 template<
44326 typename F
44327 , typename Tag
44328 >
44329 struct lambda<
44330 bind0<F>
44331 , Tag
44332 , int_<1>
44333 >
44334 {
44335 typedef false_ is_le;
44336 typedef bind0<
44337 F
44338 > result_;
44339 typedef result_ type;
44340 };
44341 namespace aux {
44342 template<
44343 typename IsLE, typename Tag
44344 , template< typename P1 > class F
44345 , typename L1
44346 >
44347 struct le_result1
44348 {
44349 typedef F<
44350 typename L1::type
44351 > result_;
44352 typedef result_ type;
44353 };
44354 template<
44355 typename Tag
44356 , template< typename P1 > class F
44357 , typename L1
44358 >
44359 struct le_result1< true_,Tag,F,L1 >
44360 {
44361 typedef bind1<
44362 quote1< F,Tag >
44363 , typename L1::result_
44364 > result_;
44365 typedef mpl::protect<result_> type;
44366 };
44367 }
44368 template<
44369 template< typename P1 > class F
44370 , typename T1
44371 , typename Tag
44372 >
44373 struct lambda<
44374 F<T1>
44375 , Tag
44376 , int_<1>
44377 >
44378 {
44379 typedef lambda< T1,Tag > l1;
44380 typedef typename l1::is_le is_le1;
44381 typedef typename aux::lambda_or<
44382 is_le1::value
44383 >::type is_le;
44384 typedef aux::le_result1<
44385 is_le, Tag, F, l1
44386 > le_result_;
44387 typedef typename le_result_::result_ result_;
44388 typedef typename le_result_::type type;
44389 };
44390 template<
44391 typename F, typename T1
44392 , typename Tag
44393 >
44394 struct lambda<
44395 bind1< F,T1 >
44396 , Tag
44397 , int_<2>
44398 >
44399 {
44400 typedef false_ is_le;
44401 typedef bind1<
44402 F
44403 , T1
44404 > result_;
44405 typedef result_ type;
44406 };
44407 namespace aux {
44408 template<
44409 typename IsLE, typename Tag
44410 , template< typename P1, typename P2 > class F
44411 , typename L1, typename L2
44412 >
44413 struct le_result2
44414 {
44415 typedef F<
44416 typename L1::type, typename L2::type
44417 > result_;
44418 typedef result_ type;
44419 };
44420 template<
44421 typename Tag
44422 , template< typename P1, typename P2 > class F
44423 , typename L1, typename L2
44424 >
44425 struct le_result2< true_,Tag,F,L1,L2 >
44426 {
44427 typedef bind2<
44428 quote2< F,Tag >
44429 , typename L1::result_, typename L2::result_
44430 > result_;
44431 typedef mpl::protect<result_> type;
44432 };
44433 }
44434 template<
44435 template< typename P1, typename P2 > class F
44436 , typename T1, typename T2
44437 , typename Tag
44438 >
44439 struct lambda<
44440 F< T1,T2 >
44441 , Tag
44442 , int_<2>
44443 >
44444 {
44445 typedef lambda< T1,Tag > l1;
44446 typedef lambda< T2,Tag > l2;
44447 typedef typename l1::is_le is_le1;
44448 typedef typename l2::is_le is_le2;
44449 typedef typename aux::lambda_or<
44450 is_le1::value, is_le2::value
44451 >::type is_le;
44452 typedef aux::le_result2<
44453 is_le, Tag, F, l1, l2
44454 > le_result_;
44455 typedef typename le_result_::result_ result_;
44456 typedef typename le_result_::type type;
44457 };
44458 template<
44459 typename F, typename T1, typename T2
44460 , typename Tag
44461 >
44462 struct lambda<
44463 bind2< F,T1,T2 >
44464 , Tag
44465 , int_<3>
44466 >
44467 {
44468 typedef false_ is_le;
44469 typedef bind2<
44470 F
44471 , T1, T2
44472 > result_;
44473 typedef result_ type;
44474 };
44475 namespace aux {
44476 template<
44477 typename IsLE, typename Tag
44478 , template< typename P1, typename P2, typename P3 > class F
44479 , typename L1, typename L2, typename L3
44480 >
44481 struct le_result3
44482 {
44483 typedef F<
44484 typename L1::type, typename L2::type, typename L3::type
44485 > result_;
44486 typedef result_ type;
44487 };
44488 template<
44489 typename Tag
44490 , template< typename P1, typename P2, typename P3 > class F
44491 , typename L1, typename L2, typename L3
44492 >
44493 struct le_result3< true_,Tag,F,L1,L2,L3 >
44494 {
44495 typedef bind3<
44496 quote3< F,Tag >
44497 , typename L1::result_, typename L2::result_, typename L3::result_
44498 > result_;
44499 typedef mpl::protect<result_> type;
44500 };
44501 }
44502 template<
44503 template< typename P1, typename P2, typename P3 > class F
44504 , typename T1, typename T2, typename T3
44505 , typename Tag
44506 >
44507 struct lambda<
44508 F< T1,T2,T3 >
44509 , Tag
44510 , int_<3>
44511 >
44512 {
44513 typedef lambda< T1,Tag > l1;
44514 typedef lambda< T2,Tag > l2;
44515 typedef lambda< T3,Tag > l3;
44516 typedef typename l1::is_le is_le1;
44517 typedef typename l2::is_le is_le2;
44518 typedef typename l3::is_le is_le3;
44519 typedef typename aux::lambda_or<
44520 is_le1::value, is_le2::value, is_le3::value
44521 >::type is_le;
44522 typedef aux::le_result3<
44523 is_le, Tag, F, l1, l2, l3
44524 > le_result_;
44525 typedef typename le_result_::result_ result_;
44526 typedef typename le_result_::type type;
44527 };
44528 template<
44529 typename F, typename T1, typename T2, typename T3
44530 , typename Tag
44531 >
44532 struct lambda<
44533 bind3< F,T1,T2,T3 >
44534 , Tag
44535 , int_<4>
44536 >
44537 {
44538 typedef false_ is_le;
44539 typedef bind3<
44540 F
44541 , T1, T2, T3
44542 > result_;
44543 typedef result_ type;
44544 };
44545 namespace aux {
44546 template<
44547 typename IsLE, typename Tag
44548 , template< typename P1, typename P2, typename P3, typename P4 > class F
44549 , typename L1, typename L2, typename L3, typename L4
44550 >
44551 struct le_result4
44552 {
44553 typedef F<
44554 typename L1::type, typename L2::type, typename L3::type
44555 , typename L4::type
44556 > result_;
44557 typedef result_ type;
44558 };
44559 template<
44560 typename Tag
44561 , template< typename P1, typename P2, typename P3, typename P4 > class F
44562 , typename L1, typename L2, typename L3, typename L4
44563 >
44564 struct le_result4< true_,Tag,F,L1,L2,L3,L4 >
44565 {
44566 typedef bind4<
44567 quote4< F,Tag >
44568 , typename L1::result_, typename L2::result_, typename L3::result_
44569 , typename L4::result_
44570 > result_;
44571 typedef mpl::protect<result_> type;
44572 };
44573 }
44574 template<
44575 template< typename P1, typename P2, typename P3, typename P4 > class F
44576 , typename T1, typename T2, typename T3, typename T4
44577 , typename Tag
44578 >
44579 struct lambda<
44580 F< T1,T2,T3,T4 >
44581 , Tag
44582 , int_<4>
44583 >
44584 {
44585 typedef lambda< T1,Tag > l1;
44586 typedef lambda< T2,Tag > l2;
44587 typedef lambda< T3,Tag > l3;
44588 typedef lambda< T4,Tag > l4;
44589 typedef typename l1::is_le is_le1;
44590 typedef typename l2::is_le is_le2;
44591 typedef typename l3::is_le is_le3;
44592 typedef typename l4::is_le is_le4;
44593 typedef typename aux::lambda_or<
44594 is_le1::value, is_le2::value, is_le3::value, is_le4::value
44595 >::type is_le;
44596 typedef aux::le_result4<
44597 is_le, Tag, F, l1, l2, l3, l4
44598 > le_result_;
44599 typedef typename le_result_::result_ result_;
44600 typedef typename le_result_::type type;
44601 };
44602 template<
44603 typename F, typename T1, typename T2, typename T3, typename T4
44604 , typename Tag
44605 >
44606 struct lambda<
44607 bind4< F,T1,T2,T3,T4 >
44608 , Tag
44609 , int_<5>
44610 >
44611 {
44612 typedef false_ is_le;
44613 typedef bind4<
44614 F
44615 , T1, T2, T3, T4
44616 > result_;
44617 typedef result_ type;
44618 };
44619 namespace aux {
44620 template<
44621 typename IsLE, typename Tag
44622 , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
44623 , typename L1, typename L2, typename L3, typename L4, typename L5
44624 >
44625 struct le_result5
44626 {
44627 typedef F<
44628 typename L1::type, typename L2::type, typename L3::type
44629 , typename L4::type, typename L5::type
44630 > result_;
44631 typedef result_ type;
44632 };
44633 template<
44634 typename Tag
44635 , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
44636 , typename L1, typename L2, typename L3, typename L4, typename L5
44637 >
44638 struct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 >
44639 {
44640 typedef bind5<
44641 quote5< F,Tag >
44642 , typename L1::result_, typename L2::result_, typename L3::result_
44643 , typename L4::result_, typename L5::result_
44644 > result_;
44645 typedef mpl::protect<result_> type;
44646 };
44647 }
44648 template<
44649 template<
44650 typename P1, typename P2, typename P3, typename P4
44651 , typename P5
44652 >
44653 class F
44654 , typename T1, typename T2, typename T3, typename T4, typename T5
44655 , typename Tag
44656 >
44657 struct lambda<
44658 F< T1,T2,T3,T4,T5 >
44659 , Tag
44660 , int_<5>
44661 >
44662 {
44663 typedef lambda< T1,Tag > l1;
44664 typedef lambda< T2,Tag > l2;
44665 typedef lambda< T3,Tag > l3;
44666 typedef lambda< T4,Tag > l4;
44667 typedef lambda< T5,Tag > l5;
44668 typedef typename l1::is_le is_le1;
44669 typedef typename l2::is_le is_le2;
44670 typedef typename l3::is_le is_le3;
44671 typedef typename l4::is_le is_le4;
44672 typedef typename l5::is_le is_le5;
44673 typedef typename aux::lambda_or<
44674 is_le1::value, is_le2::value, is_le3::value, is_le4::value
44675 , is_le5::value
44676 >::type is_le;
44677 typedef aux::le_result5<
44678 is_le, Tag, F, l1, l2, l3, l4, l5
44679 > le_result_;
44680 typedef typename le_result_::result_ result_;
44681 typedef typename le_result_::type type;
44682 };
44683 template<
44684 typename F, typename T1, typename T2, typename T3, typename T4
44685 , typename T5
44686 , typename Tag
44687 >
44688 struct lambda<
44689 bind5< F,T1,T2,T3,T4,T5 >
44690 , Tag
44691 , int_<6>
44692 >
44693 {
44694 typedef false_ is_le;
44695 typedef bind5<
44696 F
44697 , T1, T2, T3, T4, T5
44698 > result_;
44699 typedef result_ type;
44700 };
44701 template< typename T, typename Tag >
44702 struct lambda< mpl::protect<T>,Tag, int_<1> >
44703 {
44704 typedef false_ is_le;
44705 typedef mpl::protect<T> result_;
44706 typedef result_ type;
44707 };
44708 template<
44709 typename F, typename T1, typename T2, typename T3, typename T4
44710 , typename T5
44711 , typename Tag
44712 >
44713 struct lambda<
44714 bind< F,T1,T2,T3,T4,T5 >
44715 , Tag
44716 , int_<6>
44717 >
44718 {
44719 typedef false_ is_le;
44720 typedef bind< F,T1,T2,T3,T4,T5 > result_;
44721 typedef result_ type;
44722 };
44723 template<
44724 typename F
44725 , typename Tag1
44726 , typename Tag2
44727 , typename Arity
44728 >
44729 struct lambda<
44730 lambda< F,Tag1,Arity >
44731 , Tag2
44732 , int_<3>
44733 >
44734 {
44735 typedef lambda< F,Tag2 > l1;
44736 typedef lambda< Tag1,Tag2 > l2;
44737 typedef typename l1::is_le is_le;
44738 typedef bind1< quote1<aux::template_arity>, typename l1::result_ > arity_;
44739 typedef lambda< typename if_< is_le,arity_,Arity >::type, Tag2 > l3;
44740 typedef aux::le_result3<is_le, Tag2, mpl::lambda, l1, l2, l3> le_result_;
44741 typedef typename le_result_::result_ result_;
44742 typedef typename le_result_::type type;
44743 };
44744 template<> struct lambda< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : lambda< T1 , T2 > { }; }; template< typename Tag > struct lambda< lambda< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef lambda< na , na > result_; typedef lambda< na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 > struct template_arity< lambda< T1 , T2 , T3 > > : int_<3> { }; template<> struct template_arity< lambda< na , na > > : int_<-1> { }; }
44745 }}
44746 namespace boost { namespace mpl {
44747 template<
44748 typename F
44749 >
44750 struct apply0
44751 : apply_wrap0<
44752 typename lambda<F>::type
44753 >
44754 {
44755
44756 };
44757 template<
44758 typename F
44759 >
44760 struct apply< F,na,na,na,na,na >
44761 : apply0<F>
44762 {
44763 };
44764 template<
44765 typename F, typename T1
44766 >
44767 struct apply1
44768 : apply_wrap1<
44769 typename lambda<F>::type
44770 , T1
44771 >
44772 {
44773
44774 };
44775 template<
44776 typename F, typename T1
44777 >
44778 struct apply< F,T1,na,na,na,na >
44779 : apply1< F,T1 >
44780 {
44781 };
44782 template<
44783 typename F, typename T1, typename T2
44784 >
44785 struct apply2
44786 : apply_wrap2<
44787 typename lambda<F>::type
44788 , T1, T2
44789 >
44790 {
44791
44792 };
44793 template<
44794 typename F, typename T1, typename T2
44795 >
44796 struct apply< F,T1,T2,na,na,na >
44797 : apply2< F,T1,T2 >
44798 {
44799 };
44800 template<
44801 typename F, typename T1, typename T2, typename T3
44802 >
44803 struct apply3
44804 : apply_wrap3<
44805 typename lambda<F>::type
44806 , T1, T2, T3
44807 >
44808 {
44809
44810 };
44811 template<
44812 typename F, typename T1, typename T2, typename T3
44813 >
44814 struct apply< F,T1,T2,T3,na,na >
44815 : apply3< F,T1,T2,T3 >
44816 {
44817 };
44818 template<
44819 typename F, typename T1, typename T2, typename T3, typename T4
44820 >
44821 struct apply4
44822 : apply_wrap4<
44823 typename lambda<F>::type
44824 , T1, T2, T3, T4
44825 >
44826 {
44827
44828 };
44829 template<
44830 typename F, typename T1, typename T2, typename T3, typename T4
44831 >
44832 struct apply< F,T1,T2,T3,T4,na >
44833 : apply4< F,T1,T2,T3,T4 >
44834 {
44835 };
44836 template<
44837 typename F, typename T1, typename T2, typename T3, typename T4
44838 , typename T5
44839 >
44840 struct apply5
44841 : apply_wrap5<
44842 typename lambda<F>::type
44843 , T1, T2, T3, T4, T5
44844 >
44845 {
44846
44847 };
44848 template<
44849 typename F, typename T1, typename T2, typename T3, typename T4
44850 , typename T5
44851 >
44852 struct apply
44853 : apply5< F,T1,T2,T3,T4,T5 >
44854 {
44855 };
44856 }}
44857 namespace boost { namespace python {
44858 template <class T> class wrapper;
44859 }}
44860 namespace boost { namespace python { namespace objects {
44861 template <class Pointer, class Value>
44862 struct pointer_holder : instance_holder
44863 {
44864 typedef Value value_type;
44865 pointer_holder(Pointer);
44866 pointer_holder(PyObject* self )
44867 : m_p(new Value(
44868
44869 ))
44870 {
44871 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44872 }
44873 template< class A0 >
44874 pointer_holder(PyObject* self , A0 a0)
44875 : m_p(new Value(
44876 objects::do_unforward(a0,0)
44877 ))
44878 {
44879 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44880 }
44881 template< class A0 , class A1 >
44882 pointer_holder(PyObject* self , A0 a0 , A1 a1)
44883 : m_p(new Value(
44884 objects::do_unforward(a0,0) , objects::do_unforward(a1,0)
44885 ))
44886 {
44887 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44888 }
44889 template< class A0 , class A1 , class A2 >
44890 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2)
44891 : m_p(new Value(
44892 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0)
44893 ))
44894 {
44895 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44896 }
44897 template< class A0 , class A1 , class A2 , class A3 >
44898 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3)
44899 : m_p(new Value(
44900 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0)
44901 ))
44902 {
44903 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44904 }
44905 template< class A0 , class A1 , class A2 , class A3 , class A4 >
44906 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4)
44907 : m_p(new Value(
44908 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0)
44909 ))
44910 {
44911 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44912 }
44913 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 >
44914 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5)
44915 : m_p(new Value(
44916 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0)
44917 ))
44918 {
44919 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44920 }
44921 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 >
44922 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6)
44923 : m_p(new Value(
44924 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0)
44925 ))
44926 {
44927 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44928 }
44929 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 >
44930 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7)
44931 : m_p(new Value(
44932 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0)
44933 ))
44934 {
44935 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44936 }
44937 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 >
44938 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8)
44939 : m_p(new Value(
44940 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0)
44941 ))
44942 {
44943 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44944 }
44945 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 >
44946 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9)
44947 : m_p(new Value(
44948 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0)
44949 ))
44950 {
44951 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44952 }
44953 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 >
44954 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10)
44955 : m_p(new Value(
44956 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0)
44957 ))
44958 {
44959 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44960 }
44961 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 >
44962 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11)
44963 : m_p(new Value(
44964 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0)
44965 ))
44966 {
44967 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44968 }
44969 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 >
44970 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12)
44971 : m_p(new Value(
44972 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0)
44973 ))
44974 {
44975 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44976 }
44977 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
44978 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13)
44979 : m_p(new Value(
44980 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0)
44981 ))
44982 {
44983 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44984 }
44985 template< class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14 >
44986 pointer_holder(PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13 , A14 a14)
44987 : m_p(new Value(
44988 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0) , objects::do_unforward(a14,0)
44989 ))
44990 {
44991 python::detail::initialize_wrapper(self, get_pointer(this->m_p));
44992 }
44993 private:
44994 private:
44995 void* holds(type_info, bool null_ptr_only);
44996 template <class T>
44997 inline void* holds_wrapped(type_info dst_t, wrapper<T>*,T* p)
44998 {
44999 return python::type_id<T>() == dst_t ? p : 0;
45000 }
45001 inline void* holds_wrapped(type_info, ...)
45002 {
45003 return 0;
45004 }
45005 private:
45006 Pointer m_p;
45007 };
45008 template <class Pointer, class Value>
45009 struct pointer_holder_back_reference : instance_holder
45010 {
45011 private:
45012 typedef typename python::pointee<Pointer>::type held_type;
45013 public:
45014 typedef Value value_type;
45015 pointer_holder_back_reference(Pointer);
45016 pointer_holder_back_reference(
45017 PyObject* p )
45018 : m_p(new held_type(
45019 p
45020 ))
45021 {}
45022 template < class A0 >
45023 pointer_holder_back_reference(
45024 PyObject* p , A0 a0)
45025 : m_p(new held_type(
45026 p , objects::do_unforward(a0,0)
45027 ))
45028 {}
45029 template < class A0 , class A1 >
45030 pointer_holder_back_reference(
45031 PyObject* p , A0 a0 , A1 a1)
45032 : m_p(new held_type(
45033 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0)
45034 ))
45035 {}
45036 template < class A0 , class A1 , class A2 >
45037 pointer_holder_back_reference(
45038 PyObject* p , A0 a0 , A1 a1 , A2 a2)
45039 : m_p(new held_type(
45040 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0)
45041 ))
45042 {}
45043 template < class A0 , class A1 , class A2 , class A3 >
45044 pointer_holder_back_reference(
45045 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3)
45046 : m_p(new held_type(
45047 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0)
45048 ))
45049 {}
45050 template < class A0 , class A1 , class A2 , class A3 , class A4 >
45051 pointer_holder_back_reference(
45052 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4)
45053 : m_p(new held_type(
45054 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0)
45055 ))
45056 {}
45057 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 >
45058 pointer_holder_back_reference(
45059 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5)
45060 : m_p(new held_type(
45061 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0)
45062 ))
45063 {}
45064 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 >
45065 pointer_holder_back_reference(
45066 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6)
45067 : m_p(new held_type(
45068 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0)
45069 ))
45070 {}
45071 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 >
45072 pointer_holder_back_reference(
45073 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7)
45074 : m_p(new held_type(
45075 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0)
45076 ))
45077 {}
45078 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 >
45079 pointer_holder_back_reference(
45080 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8)
45081 : m_p(new held_type(
45082 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0)
45083 ))
45084 {}
45085 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 >
45086 pointer_holder_back_reference(
45087 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9)
45088 : m_p(new held_type(
45089 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0)
45090 ))
45091 {}
45092 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 >
45093 pointer_holder_back_reference(
45094 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10)
45095 : m_p(new held_type(
45096 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0)
45097 ))
45098 {}
45099 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 >
45100 pointer_holder_back_reference(
45101 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11)
45102 : m_p(new held_type(
45103 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0)
45104 ))
45105 {}
45106 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 >
45107 pointer_holder_back_reference(
45108 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12)
45109 : m_p(new held_type(
45110 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0)
45111 ))
45112 {}
45113 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
45114 pointer_holder_back_reference(
45115 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13)
45116 : m_p(new held_type(
45117 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0)
45118 ))
45119 {}
45120 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14 >
45121 pointer_holder_back_reference(
45122 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13 , A14 a14)
45123 : m_p(new held_type(
45124 p , objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0) , objects::do_unforward(a14,0)
45125 ))
45126 {}
45127 private:
45128 void* holds(type_info, bool null_ptr_only);
45129 private:
45130 Pointer m_p;
45131 };
45132 template <class Pointer, class Value>
45133 inline pointer_holder<Pointer,Value>::pointer_holder(Pointer p)
45134 : m_p(p)
45135 {
45136 }
45137 template <class Pointer, class Value>
45138 inline pointer_holder_back_reference<Pointer,Value>::pointer_holder_back_reference(Pointer p)
45139 : m_p(p)
45140 {
45141 }
45142 template <class Pointer, class Value>
45143 void* pointer_holder<Pointer, Value>::holds(type_info dst_t, bool null_ptr_only)
45144 {
45145 if (dst_t == python::type_id<Pointer>()
45146 && !(null_ptr_only && get_pointer(this->m_p))
45147 )
45148 return &this->m_p;
45149 Value* p
45150 = get_pointer(this->m_p)
45151 ;
45152 if (p == 0)
45153 return 0;
45154 if (void* wrapped = holds_wrapped(dst_t, p, p))
45155 return wrapped;
45156 type_info src_t = python::type_id<Value>();
45157 return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t);
45158 }
45159 template <class Pointer, class Value>
45160 void* pointer_holder_back_reference<Pointer, Value>::holds(type_info dst_t, bool null_ptr_only)
45161 {
45162 if (dst_t == python::type_id<Pointer>()
45163 && !(null_ptr_only && get_pointer(this->m_p))
45164 )
45165 return &this->m_p;
45166 if (!get_pointer(this->m_p))
45167 return 0;
45168 Value* p = get_pointer(m_p);
45169 if (dst_t == python::type_id<held_type>())
45170 return p;
45171 type_info src_t = python::type_id<Value>();
45172 return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t);
45173 }
45174 }}}
45175
45176 namespace boost {
45177 namespace detail {
45178 class alignment_dummy;
45179 typedef void (*function_ptr)();
45180 typedef int (alignment_dummy::*member_ptr);
45181 typedef int (alignment_dummy::*member_function_ptr)();
45182 template <bool found, std::size_t target, class TestType>
45183 struct lower_alignment_helper
45184 {
45185 typedef char type;
45186 enum { value = true };
45187 };
45188 template <std::size_t target, class TestType>
45189 struct lower_alignment_helper<false,target,TestType>
45190 {
45191 enum { value = (alignment_of<TestType>::value == target) };
45192 typedef typename mpl::if_c<value, TestType, char>::type type;
45193 };
45194 template <typename T>
45195 struct has_one_T
45196 {
45197 T data;
45198 };
45199 template <std::size_t target>
45200 union lower_alignment
45201 {
45202 enum { found0 = false };
45203
45204 typename lower_alignment_helper< found0,target,char >::type t0; enum { found1 = lower_alignment_helper<found0,target,char >::value }; typename lower_alignment_helper< found1,target,short >::type t1; enum { found2 = lower_alignment_helper<found1,target,short >::value }; typename lower_alignment_helper< found2,target,int >::type t2; enum { found3 = lower_alignment_helper<found2,target,int >::value }; typename lower_alignment_helper< found3,target,long >::type t3; enum { found4 = lower_alignment_helper<found3,target,long >::value }; typename lower_alignment_helper< found4,target,::boost::long_long_type >::type t4; enum { found5 = lower_alignment_helper<found4,target,::boost::long_long_type >::value }; typename lower_alignment_helper< found5,target,float >::type t5; enum { found6 = lower_alignment_helper<found5,target,float >::value }; typename lower_alignment_helper< found6,target,double >::type t6; enum { found7 = lower_alignment_helper<found6,target,double >::value }; typename lower_alignment_helper< found7,target,long double >::type t7; enum { found8 = lower_alignment_helper<found7,target,long double >::value }; typename lower_alignment_helper< found8,target,void* >::type t8; enum { found9 = lower_alignment_helper<found8,target,void* >::value }; typename lower_alignment_helper< found9,target,function_ptr >::type t9; enum { found10 = lower_alignment_helper<found9,target,function_ptr >::value }; typename lower_alignment_helper< found10,target,member_ptr >::type t10; enum { found11 = lower_alignment_helper<found10,target,member_ptr >::value }; typename lower_alignment_helper< found11,target,member_function_ptr >::type t11; enum { found12 = lower_alignment_helper<found11,target,member_function_ptr >::value }; typename lower_alignment_helper< found12,target,boost::detail::has_one_T< char > >::type t12; enum { found13 = lower_alignment_helper<found12,target,boost::detail::has_one_T< char > >::value }; typename lower_alignment_helper< found13,target,boost::detail::has_one_T< short > >::type t13; enum { found14 = lower_alignment_helper<found13,target,boost::detail::has_one_T< short > >::value }; typename lower_alignment_helper< found14,target,boost::detail::has_one_T< int > >::type t14; enum { found15 = lower_alignment_helper<found14,target,boost::detail::has_one_T< int > >::value }; typename lower_alignment_helper< found15,target,boost::detail::has_one_T< long > >::type t15; enum { found16 = lower_alignment_helper<found15,target,boost::detail::has_one_T< long > >::value }; typename lower_alignment_helper< found16,target,boost::detail::has_one_T< ::boost::long_long_type > >::type t16; enum { found17 = lower_alignment_helper<found16,target,boost::detail::has_one_T< ::boost::long_long_type > >::value }; typename lower_alignment_helper< found17,target,boost::detail::has_one_T< float > >::type t17; enum { found18 = lower_alignment_helper<found17,target,boost::detail::has_one_T< float > >::value }; typename lower_alignment_helper< found18,target,boost::detail::has_one_T< double > >::type t18; enum { found19 = lower_alignment_helper<found18,target,boost::detail::has_one_T< double > >::value }; typename lower_alignment_helper< found19,target,boost::detail::has_one_T< long double > >::type t19; enum { found20 = lower_alignment_helper<found19,target,boost::detail::has_one_T< long double > >::value }; typename lower_alignment_helper< found20,target,boost::detail::has_one_T< void* > >::type t20; enum { found21 = lower_alignment_helper<found20,target,boost::detail::has_one_T< void* > >::value }; typename lower_alignment_helper< found21,target,boost::detail::has_one_T< function_ptr > >::type t21; enum { found22 = lower_alignment_helper<found21,target,boost::detail::has_one_T< function_ptr > >::value }; typename lower_alignment_helper< found22,target,boost::detail::has_one_T< member_ptr > >::type t22; enum { found23 = lower_alignment_helper<found22,target,boost::detail::has_one_T< member_ptr > >::value }; typename lower_alignment_helper< found23,target,boost::detail::has_one_T< member_function_ptr > >::type t23; enum { found24 = lower_alignment_helper<found23,target,boost::detail::has_one_T< member_function_ptr > >::value };
45205 };
45206 union max_align
45207 {
45208
45209 char t0; short t1; int t2; long t3; ::boost::long_long_type t4; float t5; double t6; long double t7; void* t8; function_ptr t9; member_ptr t10; member_function_ptr t11; boost::detail::has_one_T< char > t12; boost::detail::has_one_T< short > t13; boost::detail::has_one_T< int > t14; boost::detail::has_one_T< long > t15; boost::detail::has_one_T< ::boost::long_long_type > t16; boost::detail::has_one_T< float > t17; boost::detail::has_one_T< double > t18; boost::detail::has_one_T< long double > t19; boost::detail::has_one_T< void* > t20; boost::detail::has_one_T< function_ptr > t21; boost::detail::has_one_T< member_ptr > t22; boost::detail::has_one_T< member_function_ptr > t23;
45210 };
45211 template<std::size_t TAlign, std::size_t Align>
45212 struct is_aligned
45213 {
45214 static const bool value = (TAlign >= Align) & (TAlign % Align == 0)
45215 ;
45216 };
45217 }
45218 template<std::size_t Align>
45219 struct is_pod< ::boost::detail::lower_alignment<Align> >
45220 {
45221 static const std::size_t value = true;
45222 };
45223 namespace detail{
45224 template <std::size_t Align>
45225 class type_with_alignment_imp
45226 {
45227 typedef ::boost::detail::lower_alignment<Align> t1;
45228 typedef typename mpl::if_c<
45229 ::boost::detail::is_aligned< ::boost::alignment_of<t1>::value,Align >::value
45230 , t1
45231 , ::boost::detail::max_align
45232 >::type align_t;
45233 static const std::size_t found = alignment_of<align_t>::value;
45234 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((found >= Align) == 0 ? false : true) >)> boost_static_assert_typedef_206;
45235 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((found % Align == 0) == 0 ? false : true) >)> boost_static_assert_typedef_207;
45236 public:
45237 typedef align_t type;
45238 };
45239 }
45240 template <std::size_t Align>
45241 class type_with_alignment
45242 : public ::boost::detail::type_with_alignment_imp<Align>
45243 {
45244 };
45245 namespace align {
45246 struct __attribute__((__aligned__(2))) a2 {};
45247 struct __attribute__((__aligned__(4))) a4 {};
45248 struct __attribute__((__aligned__(8))) a8 {};
45249 struct __attribute__((__aligned__(16))) a16 {};
45250 struct __attribute__((__aligned__(32))) a32 {};
45251 }
45252 template<> class type_with_alignment<1> { public: typedef char type; };
45253 template<> class type_with_alignment<2> { public: typedef align::a2 type; };
45254 template<> class type_with_alignment<4> { public: typedef align::a4 type; };
45255 template<> class type_with_alignment<8> { public: typedef align::a8 type; };
45256 template<> class type_with_alignment<16> { public: typedef align::a16 type; };
45257 template<> class type_with_alignment<32> { public: typedef align::a32 type; };
45258 namespace detail {
45259 template<> struct is_pod_impl< ::boost::align::a2 > { static const bool value = (true); };
45260 template<> struct is_pod_impl< ::boost::align::a4 > { static const bool value = (true); };
45261 template<> struct is_pod_impl< ::boost::align::a8 > { static const bool value = (true); };
45262 template<> struct is_pod_impl< ::boost::align::a16 > { static const bool value = (true); };
45263 template<> struct is_pod_impl< ::boost::align::a32 > { static const bool value = (true); };
45264 }
45265 }
45266
45267 namespace boost { namespace python
45268 {
45269 struct instance_holder;
45270 }}
45271 namespace boost { namespace python { namespace objects {
45272 template <class Data = char>
45273 struct instance
45274 {
45275 Py_ssize_t ob_refcnt; struct _typeobject *ob_type; Py_ssize_t ob_size;
45276 PyObject* dict;
45277 PyObject* weakrefs;
45278 instance_holder* objects;
45279 typedef typename type_with_alignment<
45280 ::boost::alignment_of<Data>::value
45281 >::type align_t;
45282 union
45283 {
45284 align_t align;
45285 char bytes[sizeof(Data)];
45286 } storage;
45287 };
45288 template <class Data>
45289 struct additional_instance_size
45290 {
45291 typedef instance<Data> instance_data;
45292 typedef instance<char> instance_char;
45293 static const std::size_t value = sizeof(instance_data) - __builtin_offsetof (instance_char, storage)
45294 ;
45295 };
45296 }}}
45297 namespace boost { namespace python { namespace converter {
45298 typedef PyObject* (*to_python_function_t)(void const*);
45299 }}}
45300 namespace boost { namespace python { namespace converter {
45301 struct rvalue_from_python_stage1_data;
45302 typedef void (*constructor_function)(PyObject* source, rvalue_from_python_stage1_data*);
45303 }}}
45304
45305 namespace boost { namespace python { namespace detail {
45306 struct alignment_dummy;
45307 typedef void (*function_ptr)();
45308 typedef int (alignment_dummy::*member_ptr);
45309 typedef int (alignment_dummy::*member_function_ptr)();
45310 template <std::size_t size>
45311 union aligned_storage
45312 {
45313 typename mpl::if_c< sizeof(char) <= size, char, char>::type t0;
45314 typename mpl::if_c< sizeof(short) <= size, short, char>::type t1;
45315 typename mpl::if_c< sizeof(int) <= size, int, char>::type t2;
45316 typename mpl::if_c< sizeof(long) <= size, long, char>::type t3;
45317 typename mpl::if_c< sizeof(float) <= size, float, char>::type t4;
45318 typename mpl::if_c< sizeof(double) <= size, double, char>::type t5;
45319 typename mpl::if_c< sizeof(long double) <= size, long double, char>::type t6;
45320 typename mpl::if_c< sizeof(void*) <= size, void*, char>::type t7;
45321 typename mpl::if_c< sizeof(function_ptr) <= size, function_ptr, char>::type t8;
45322 typename mpl::if_c< sizeof(member_ptr) <= size, member_ptr, char>::type t9;
45323 typename mpl::if_c< sizeof(member_function_ptr) <= size, member_function_ptr, char>::type t10;
45324 char bytes[size];
45325 };
45326 template <class T> struct referent_size;
45327 template <class T>
45328 struct referent_size<T&>
45329 {
45330 static const std::size_t value = sizeof(T)
45331 ;
45332 };
45333 template <class T>
45334 struct referent_storage
45335 {
45336 typedef aligned_storage<
45337 ::boost::python::detail::referent_size<T>::value
45338 > type;
45339 };
45340 }}}
45341 namespace boost { namespace python { namespace detail {
45342 template <
45343 bool array
45344 > struct value_destroyer;
45345 template <>
45346 struct value_destroyer<
45347 false
45348 >
45349 {
45350 template <class T>
45351 static void execute(T const volatile* p)
45352 {
45353 p->T::~T();
45354 }
45355 };
45356 template <>
45357 struct value_destroyer<
45358 true
45359 >
45360 {
45361 template <class A, class T>
45362 static void execute(A*, T const volatile* const first)
45363 {
45364 for (T const volatile* p = first; p != first + sizeof(A)/sizeof(T); ++p)
45365 {
45366 value_destroyer<
45367 boost::is_array<T>::value
45368 >::execute(p);
45369 }
45370 }
45371 template <class T>
45372 static void execute(T const volatile* p)
45373 {
45374 execute(p, *p);
45375 }
45376 };
45377 template <class T>
45378 inline void destroy_referent_impl(void* p, T& (*)())
45379 {
45380 value_destroyer<
45381 (boost::is_array<T>::value)
45382 >::execute((const volatile T*)p);
45383 }
45384 template <class T>
45385 inline void destroy_referent(void* p, T(*)() = 0)
45386 {
45387 destroy_referent_impl(p, (T(*)())0);
45388 }
45389 }}}
45390
45391 namespace boost { namespace python { namespace converter {
45392 struct rvalue_from_python_stage1_data
45393 {
45394 void* convertible;
45395 constructor_function construct;
45396 };
45397 template <class T>
45398 struct rvalue_from_python_storage
45399 {
45400 rvalue_from_python_stage1_data stage1;
45401 typename python::detail::referent_storage<
45402 typename add_reference<T>::type
45403 >::type storage;
45404 };
45405 template <class T>
45406 struct rvalue_from_python_data : rvalue_from_python_storage<T>
45407 {
45408 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((__builtin_offsetof (rvalue_from_python_storage<T>, stage1) == 0) == 0 ? false : true) >)> boost_static_assert_typedef_99;
45409 rvalue_from_python_data(rvalue_from_python_stage1_data const&);
45410 rvalue_from_python_data(void* convertible);
45411 ~rvalue_from_python_data();
45412 private:
45413 typedef typename add_reference<typename add_cv<T>::type>::type ref_type;
45414 };
45415 template <class T>
45416 inline rvalue_from_python_data<T>::rvalue_from_python_data(rvalue_from_python_stage1_data const& _stage1)
45417 {
45418 this->stage1 = _stage1;
45419 }
45420 template <class T>
45421 inline rvalue_from_python_data<T>::rvalue_from_python_data(void* convertible)
45422 {
45423 this->stage1.convertible = convertible;
45424 }
45425 template <class T>
45426 inline rvalue_from_python_data<T>::~rvalue_from_python_data()
45427 {
45428 if (this->stage1.convertible == this->storage.bytes)
45429 python::detail::destroy_referent<ref_type>(this->storage.bytes);
45430 }
45431 }}}
45432 namespace boost { namespace python { namespace converter {
45433 typedef void* (*convertible_function)(PyObject*);
45434 }}}
45435 namespace boost { namespace python { namespace converter {
45436 struct registration;
45437 namespace registry
45438 {
45439 registration const& lookup(type_info);
45440 registration const& lookup_shared_ptr(type_info);
45441 registration const* query(type_info);
45442 void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0);
45443 void insert(void* (*convert)(PyObject*), type_info, PyTypeObject const* (*expected_pytype)() = 0);
45444 void insert(
45445 convertible_function
45446 , constructor_function
45447 , type_info
45448 , PyTypeObject const* (*expected_pytype)() = 0
45449 );
45450 void push_back(
45451 convertible_function
45452 , constructor_function
45453 , type_info
45454 , PyTypeObject const* (*expected_pytype)() = 0
45455 );
45456 }
45457 }}}
45458 namespace boost { namespace python { namespace converter {
45459 struct lvalue_from_python_chain
45460 {
45461 convertible_function convert;
45462 lvalue_from_python_chain* next;
45463 };
45464 struct rvalue_from_python_chain
45465 {
45466 convertible_function convertible;
45467 constructor_function construct;
45468 PyTypeObject const* (*expected_pytype)();
45469 rvalue_from_python_chain* next;
45470 };
45471 struct registration
45472 {
45473 public:
45474 explicit registration(type_info target, bool is_shared_ptr = false);
45475 ~registration();
45476 PyObject* to_python(void const volatile*) const;
45477 PyTypeObject* get_class_object() const;
45478 PyTypeObject const* expected_from_python_type() const;
45479 PyTypeObject const* to_python_target_type() const;
45480 public:
45481 const python::type_info target_type;
45482 lvalue_from_python_chain* lvalue_chain;
45483 rvalue_from_python_chain* rvalue_chain;
45484 PyTypeObject* m_class_object;
45485 to_python_function_t m_to_python;
45486 PyTypeObject const* (*m_to_python_target_type)();
45487 const bool is_shared_ptr;
45488 };
45489 inline registration::registration(type_info target_type, bool is_shared_ptr)
45490 : target_type(target_type)
45491 , lvalue_chain(0)
45492 , rvalue_chain(0)
45493 , m_class_object(0)
45494 , m_to_python(0)
45495 , m_to_python_target_type(0)
45496 , is_shared_ptr(is_shared_ptr)
45497 {}
45498 inline bool operator<(registration const& lhs, registration const& rhs)
45499 {
45500 return lhs.target_type < rhs.target_type;
45501 }
45502 }}}
45503 namespace boost {
45504 namespace detail {
45505 template <typename T>
45506 struct add_pointer_impl
45507 {
45508 typedef typename remove_reference<T>::type no_ref_type;
45509 typedef no_ref_type* type;
45510 };
45511 }
45512 template< typename T > struct add_pointer { typedef typename boost::detail::add_pointer_impl<T>::type type; };
45513 }
45514
45515 namespace boost {
45516 template< typename T > struct remove_bounds { typedef T type; };
45517 template< typename T, std::size_t N > struct remove_bounds<T[N]> { typedef T type; };
45518 template< typename T, std::size_t N > struct remove_bounds<T const[N]> { typedef T const type; };
45519 template< typename T, std::size_t N > struct remove_bounds<T volatile[N]> { typedef T volatile type; };
45520 template< typename T, std::size_t N > struct remove_bounds<T const volatile[N]> { typedef T const volatile type; };
45521 template< typename T > struct remove_bounds<T[]> { typedef T type; };
45522 template< typename T > struct remove_bounds<T const[]> { typedef T const type; };
45523 template< typename T > struct remove_bounds<T volatile[]> { typedef T volatile type; };
45524 template< typename T > struct remove_bounds<T const volatile[]> { typedef T const volatile type; };
45525 }
45526 namespace boost {
45527 template <class T> class shared_ptr;
45528 namespace python { namespace converter {
45529 struct registration;
45530 namespace detail
45531 {
45532 template <class T>
45533 struct registered_base
45534 {
45535 static registration const& converters;
45536 };
45537 }
45538 template <class T>
45539 struct registered
45540 : detail::registered_base<
45541 typename add_reference<
45542 typename add_cv<T>::type
45543 >::type
45544 >
45545 {
45546 };
45547 template <class T>
45548 struct registered<T&>
45549 : registered<T> {};
45550 namespace detail
45551 {
45552 inline void
45553 register_shared_ptr0(...)
45554 {
45555 }
45556 template <class T>
45557 inline void
45558 register_shared_ptr0(shared_ptr<T>*)
45559 {
45560 registry::lookup_shared_ptr(type_id<shared_ptr<T> >());
45561 }
45562 template <class T>
45563 inline void
45564 register_shared_ptr1(T const volatile*)
45565 {
45566 detail::register_shared_ptr0((T*)0);
45567 }
45568 template <class T>
45569 inline registration const&
45570 registry_lookup2(T&(*)())
45571 {
45572 detail::register_shared_ptr1((T*)0);
45573 return registry::lookup(type_id<T&>());
45574 }
45575 template <class T>
45576 inline registration const&
45577 registry_lookup1(type<T>)
45578 {
45579 return registry_lookup2((T(*)())0);
45580 }
45581 inline registration const&
45582 registry_lookup1(type<const volatile void>)
45583 {
45584 detail::register_shared_ptr1((void*)0);
45585 return registry::lookup(type_id<void>());
45586 }
45587 template <class T>
45588 registration const& registered_base<T>::converters = detail::registry_lookup1(type<T>());
45589 }
45590 }}}
45591 namespace boost { namespace python { namespace detail {
45592 struct decref_guard
45593 {
45594 decref_guard(PyObject* o) : obj(o) {}
45595 ~decref_guard() { if ((obj) == __null) ; else if ( --((PyObject*)(obj))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(obj)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(obj)))); }
45596 void cancel() { obj = 0; }
45597 private:
45598 PyObject* obj;
45599 };
45600 }}}
45601 namespace boost { namespace python { namespace detail {
45602 inline PyObject* none() { ( ((PyObject*)((&_Py_NoneStruct)))->ob_refcnt++); return (&_Py_NoneStruct); }
45603 }}}
45604 namespace boost { namespace python { namespace objects {
45605 template <class T, class Holder, class Derived>
45606 struct make_instance_impl
45607 {
45608 typedef objects::instance<Holder> instance_t;
45609 template <class Arg>
45610 static inline PyObject* execute(Arg& x)
45611 {
45612 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((is_class<T>::value) == 0 ? false : true) >)> boost_static_assert_typedef_24;
45613 PyTypeObject* type = Derived::get_class_object(x);
45614 if (type == 0)
45615 return python::detail::none();
45616 PyObject* raw_result = type->tp_alloc(
45617 type, objects::additional_instance_size<Holder>::value);
45618 if (raw_result != 0)
45619 {
45620 python::detail::decref_guard protect(raw_result);
45621 instance_t* instance = (instance_t*)raw_result;
45622 Derived::construct(&instance->storage, (PyObject*)instance, x)->install(raw_result);
45623 (((PyVarObject*)(instance))->ob_size) = __builtin_offsetof (instance_t, storage);
45624 protect.cancel();
45625 }
45626 return raw_result;
45627 }
45628 };
45629 template <class T, class Holder>
45630 struct make_instance
45631 : make_instance_impl<T, Holder, make_instance<T,Holder> >
45632 {
45633 template <class U>
45634 static inline PyTypeObject* get_class_object(U&)
45635 {
45636 return converter::registered<T>::converters.get_class_object();
45637 }
45638 static inline Holder* construct(void* storage, PyObject* instance, reference_wrapper<T const> x)
45639 {
45640 return new (storage) Holder(instance, x);
45641 }
45642 };
45643 }}}
45644 namespace boost { namespace python { namespace objects {
45645 template <class T, class Holder>
45646 struct make_ptr_instance
45647 : make_instance_impl<T, Holder, make_ptr_instance<T,Holder> >
45648 {
45649 template <class Arg>
45650 static inline Holder* construct(void* storage, PyObject*, Arg& x)
45651 {
45652 return new (storage) Holder(x);
45653 }
45654 template <class Ptr>
45655 static inline PyTypeObject* get_class_object(Ptr const& x)
45656 {
45657 return get_class_object_impl(get_pointer(x));
45658 }
45659 static inline PyTypeObject const* get_pytype()
45660 {
45661 return converter::registered<T>::converters.get_class_object();
45662 }
45663 private:
45664 template <class U>
45665 static inline PyTypeObject* get_class_object_impl(U const volatile* p)
45666 {
45667 if (p == 0)
45668 return 0;
45669 PyTypeObject* derived = get_derived_class_object(
45670 typename is_polymorphic<U>::type(), p);
45671 if (derived)
45672 return derived;
45673 return converter::registered<T>::converters.get_class_object();
45674 }
45675 template <class U>
45676 static inline PyTypeObject* get_derived_class_object(mpl::true_, U const volatile* x)
45677 {
45678 converter::registration const* r = converter::registry::query(
45679 type_info(typeid(*get_pointer(x)))
45680 );
45681 return r ? r->m_class_object : 0;
45682 }
45683 template <class U>
45684 static inline PyTypeObject* get_derived_class_object(mpl::false_, U*)
45685 {
45686 return 0;
45687 }
45688 };
45689 }}}
45690 namespace boost { namespace python { namespace detail {
45691 template <bool is_const_, bool is_volatile_>
45692 struct cv_tag
45693 {
45694 static const bool is_const = is_const_;
45695 static const bool is_volatile = is_const_;
45696 };
45697 typedef cv_tag<false,false> cv_unqualified;
45698 typedef cv_tag<true,false> const_;
45699 typedef cv_tag<false,true> volatile_;
45700 typedef cv_tag<true,true> const_volatile_;
45701 template <class T>
45702 struct cv_category
45703 {
45704 typedef cv_tag<
45705 ::boost::is_const<T>::value
45706 , ::boost::is_volatile<T>::value
45707 > type;
45708 };
45709 }}}
45710 namespace boost { namespace mpl {
45711 namespace aux {
45712 template< bool C_, typename T1, typename T2, typename T3, typename T4 >
45713 struct and_impl
45714 : false_
45715 {
45716 };
45717 template< typename T1, typename T2, typename T3, typename T4 >
45718 struct and_impl< true,T1,T2,T3,T4 >
45719 : and_impl<
45720 ::boost::mpl::aux::nested_type_wknd<T1>::value
45721 , T2, T3, T4
45722 , true_
45723 >
45724 {
45725 };
45726 template<>
45727 struct and_impl<
45728 true
45729 , true_, true_, true_, true_
45730 >
45731 : true_
45732 {
45733 };
45734 }
45735 template<
45736 typename T1 = na
45737 , typename T2 = na
45738 , typename T3 = true_, typename T4 = true_, typename T5 = true_
45739 >
45740 struct and_
45741 : aux::and_impl<
45742 ::boost::mpl::aux::nested_type_wknd<T1>::value
45743 , T2, T3, T4, T5
45744 >
45745 {
45746
45747 };
45748 template<> struct and_<
45749 na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : and_< T1 , T2 > { }; }; template< typename Tag > struct lambda< and_< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef and_< na , na > result_; typedef and_< na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< and_< T1 , T2 , T3 , T4 , T5 > > : int_<5> { }; template<> struct template_arity< and_< na , na > > : int_<-1> { }; }
45750 }}
45751 namespace boost { namespace detail {
45752 namespace indirect_traits {
45753 template <class T>
45754 struct is_reference_to_const : mpl::false_
45755 {
45756 };
45757 template <class T>
45758 struct is_reference_to_const<T const&> : mpl::true_
45759 {
45760 };
45761 template <class T>
45762 struct is_reference_to_function : mpl::false_
45763 {
45764 };
45765 template <class T>
45766 struct is_reference_to_function<T&> : is_function<T>
45767 {
45768 };
45769 template <class T>
45770 struct is_pointer_to_function : mpl::false_
45771 {
45772 };
45773 template <class T>
45774 struct is_pointer_to_function<T*> : is_function<T>
45775 {
45776 };
45777 template <class T>
45778 struct is_reference_to_member_function_pointer_impl : mpl::false_
45779 {
45780 };
45781 template <class T>
45782 struct is_reference_to_member_function_pointer_impl<T&>
45783 : is_member_function_pointer<typename remove_cv<T>::type>
45784 {
45785 };
45786 template <class T>
45787 struct is_reference_to_member_function_pointer
45788 : is_reference_to_member_function_pointer_impl<T>
45789 {
45790
45791 };
45792 template <class T>
45793 struct is_reference_to_function_pointer_aux
45794 : mpl::and_<
45795 is_reference<T>
45796 , is_pointer_to_function<
45797 typename remove_cv<
45798 typename remove_reference<T>::type
45799 >::type
45800 >
45801 >
45802 {
45803 };
45804 template <class T>
45805 struct is_reference_to_function_pointer
45806 : mpl::if_<
45807 is_reference_to_function<T>
45808 , mpl::false_
45809 , is_reference_to_function_pointer_aux<T>
45810 >::type
45811 {
45812 };
45813 template <class T>
45814 struct is_reference_to_non_const
45815 : mpl::and_<
45816 is_reference<T>
45817 , mpl::not_<
45818 is_reference_to_const<T>
45819 >
45820 >
45821 {
45822 };
45823 template <class T>
45824 struct is_reference_to_volatile : mpl::false_
45825 {
45826 };
45827 template <class T>
45828 struct is_reference_to_volatile<T volatile&> : mpl::true_
45829 {
45830 };
45831 template <class T>
45832 struct is_reference_to_pointer : mpl::false_
45833 {
45834 };
45835 template <class T>
45836 struct is_reference_to_pointer<T*&> : mpl::true_
45837 {
45838 };
45839 template <class T>
45840 struct is_reference_to_pointer<T* const&> : mpl::true_
45841 {
45842 };
45843 template <class T>
45844 struct is_reference_to_pointer<T* volatile&> : mpl::true_
45845 {
45846 };
45847 template <class T>
45848 struct is_reference_to_pointer<T* const volatile&> : mpl::true_
45849 {
45850 };
45851 template <class T>
45852 struct is_reference_to_class
45853 : mpl::and_<
45854 is_reference<T>
45855 , is_class<
45856 typename remove_cv<
45857 typename remove_reference<T>::type
45858 >::type
45859 >
45860 >
45861 {
45862
45863 };
45864 template <class T>
45865 struct is_pointer_to_class
45866 : mpl::and_<
45867 is_pointer<T>
45868 , is_class<
45869 typename remove_cv<
45870 typename remove_pointer<T>::type
45871 >::type
45872 >
45873 >
45874 {
45875
45876 };
45877 }
45878 using namespace indirect_traits;
45879 }}
45880 namespace boost { namespace python {
45881 namespace indirect_traits = boost::detail::indirect_traits;
45882 }}
45883 namespace boost { namespace python { namespace detail {
45884 template <class Generator, class U>
45885 inline typename Generator::result_type
45886 unwind_type(U const& p, Generator* = 0);
45887 template <class Generator, class U>
45888 inline typename Generator::result_type
45889 unwind_type(boost::type<U>*p = 0, Generator* = 0);
45890 template <class Generator, class U>
45891 inline typename Generator::result_type
45892 unwind_type_cv(U* p, cv_unqualified, Generator* = 0)
45893 {
45894 return Generator::execute(p);
45895 }
45896 template <class Generator, class U>
45897 inline typename Generator::result_type
45898 unwind_type_cv(U const* p, const_, Generator* = 0)
45899 {
45900 return unwind_type(const_cast<U*>(p), (Generator*)0);
45901 }
45902 template <class Generator, class U>
45903 inline typename Generator::result_type
45904 unwind_type_cv(U volatile* p, volatile_, Generator* = 0)
45905 {
45906 return unwind_type(const_cast<U*>(p), (Generator*)0);
45907 }
45908 template <class Generator, class U>
45909 inline typename Generator::result_type
45910 unwind_type_cv(U const volatile* p, const_volatile_, Generator* = 0)
45911 {
45912 return unwind_type(const_cast<U*>(p), (Generator*)0);
45913 }
45914 template <class Generator, class U>
45915 inline typename Generator::result_type
45916 unwind_ptr_type(U* p, Generator* = 0)
45917 {
45918 typedef typename cv_category<U>::type tag;
45919 return unwind_type_cv<Generator>(p, tag());
45920 }
45921 template <bool is_ptr>
45922 struct unwind_helper
45923 {
45924 template <class Generator, class U>
45925 static typename Generator::result_type
45926 execute(U p, Generator* = 0)
45927 {
45928 return unwind_ptr_type(p, (Generator*)0);
45929 }
45930 };
45931 template <>
45932 struct unwind_helper<false>
45933 {
45934 template <class Generator, class U>
45935 static typename Generator::result_type
45936 execute(U& p, Generator* = 0)
45937 {
45938 return unwind_ptr_type(&p, (Generator*)0);
45939 }
45940 };
45941 template <class Generator, class U>
45942 inline typename Generator::result_type
45943 unwind_type(U const& p, Generator*)
45944 {
45945 return unwind_helper<is_pointer<U>::value>::execute(p, (Generator*)0);
45946 }
45947 enum { direct_ = 0, pointer_ = 1, reference_ = 2, reference_to_pointer_ = 3 };
45948 template <int indirection> struct unwind_helper2;
45949 template <>
45950 struct unwind_helper2<direct_>
45951 {
45952 template <class Generator, class U>
45953 static typename Generator::result_type
45954 execute(U(*)(), Generator* = 0)
45955 {
45956 return unwind_ptr_type((U*)0, (Generator*)0);
45957 }
45958 };
45959 template <>
45960 struct unwind_helper2<pointer_>
45961 {
45962 template <class Generator, class U>
45963 static typename Generator::result_type
45964 execute(U*(*)(), Generator* = 0)
45965 {
45966 return unwind_ptr_type((U*)0, (Generator*)0);
45967 }
45968 };
45969 template <>
45970 struct unwind_helper2<reference_>
45971 {
45972 template <class Generator, class U>
45973 static typename Generator::result_type
45974 execute(U&(*)(), Generator* = 0)
45975 {
45976 return unwind_ptr_type((U*)0, (Generator*)0);
45977 }
45978 };
45979 template <>
45980 struct unwind_helper2<reference_to_pointer_>
45981 {
45982 template <class Generator, class U>
45983 static typename Generator::result_type
45984 execute(U&(*)(), Generator* = 0)
45985 {
45986 return unwind_ptr_type(U(0), (Generator*)0);
45987 }
45988 };
45989 template <class Generator, class U>
45990 inline typename Generator::result_type
45991 unwind_type(boost::type<U>*, Generator*)
45992 {
45993 static const int indirection = (boost::is_pointer<U>::value ? pointer_ : 0) + (indirect_traits::is_reference_to_pointer<U>::value ? reference_to_pointer_ : boost::is_reference<U>::value ? reference_ : 0)
45994 ;
45995 return unwind_helper2<indirection>::execute((U(*)())0,(Generator*)0);
45996 }
45997 }}}
45998 namespace boost { namespace python {
45999 namespace converter
46000 {
46001 template <PyTypeObject const* python_type>
46002 struct wrap_pytype
46003 {
46004 static PyTypeObject const* get_pytype()
46005 {
46006 return python_type;
46007 }
46008 };
46009 typedef PyTypeObject const* (*pytype_function)();
46010 namespace detail
46011 {
46012 struct unwind_type_id_helper{
46013 typedef python::type_info result_type;
46014 template <class U>
46015 static result_type execute(U* ){
46016 return python::type_id<U>();
46017 }
46018 };
46019 template <class T>
46020 inline python::type_info unwind_type_id_(boost::type<T>* = 0, mpl::false_ * =0)
46021 {
46022 return boost::python::detail::unwind_type<unwind_type_id_helper, T> ();
46023 }
46024 inline python::type_info unwind_type_id_(boost::type<void>* = 0, mpl::true_* =0)
46025 {
46026 return type_id<void>();
46027 }
46028 template <class T>
46029 inline python::type_info unwind_type_id(boost::type<T>* p= 0)
46030 {
46031 return unwind_type_id_(p, (mpl::bool_<boost::is_void<T>::value >*)0 );
46032 }
46033 }
46034 template <class T>
46035 struct expected_pytype_for_arg
46036 {
46037 static PyTypeObject const *get_pytype()
46038 {
46039 const converter::registration *r=converter::registry::query(
46040 detail::unwind_type_id_((boost::type<T>*)0, (mpl::bool_<boost::is_void<T>::value >*)0 )
46041 );
46042 return r ? r->expected_from_python_type(): 0;
46043 }
46044 };
46045 template <class T>
46046 struct registered_pytype
46047 {
46048 static PyTypeObject const *get_pytype()
46049 {
46050 const converter::registration *r=converter::registry::query(
46051 detail::unwind_type_id_((boost::type<T>*) 0, (mpl::bool_<boost::is_void<T>::value >*)0 )
46052 );
46053 return r ? r->m_class_object: 0;
46054 }
46055 };
46056 template <class T>
46057 struct registered_pytype_direct
46058 {
46059 static PyTypeObject const* get_pytype()
46060 {
46061 return registered<T>::converters.m_class_object;
46062 }
46063 };
46064 template <class T>
46065 struct expected_from_python_type : expected_pytype_for_arg<T>{};
46066 template <class T>
46067 struct expected_from_python_type_direct
46068 {
46069 static PyTypeObject const* get_pytype()
46070 {
46071 return registered<T>::converters.expected_from_python_type();
46072 }
46073 };
46074 template <class T>
46075 struct to_python_target_type
46076 {
46077 static PyTypeObject const *get_pytype()
46078 {
46079 const converter::registration *r=converter::registry::query(
46080 detail::unwind_type_id_((boost::type<T>*)0, (mpl::bool_<boost::is_void<T>::value >*)0 )
46081 );
46082 return r ? r->to_python_target_type(): 0;
46083 }
46084 };
46085 template <class T>
46086 struct to_python_target_type_direct
46087 {
46088 static PyTypeObject const *get_pytype()
46089 {
46090 return registered<T>::converters.to_python_target_type();
46091 }
46092 };
46093 }}}
46094 namespace boost { namespace python {
46095 template <class T, class MakeHolder>
46096 struct to_python_indirect
46097 {
46098 template <class U>
46099 inline PyObject*
46100 operator()(U const& ref) const
46101 {
46102 return this->execute(const_cast<U&>(ref), is_pointer<U>());
46103 }
46104 inline PyTypeObject const*
46105 get_pytype()const
46106 {
46107 return converter::registered_pytype<T>::get_pytype();
46108 }
46109 private:
46110 template <class U>
46111 inline PyObject* execute(U* ptr, mpl::true_) const
46112 {
46113 if (ptr == 0)
46114 return python::detail::none();
46115 else
46116 return this->execute(*ptr, mpl::false_());
46117 }
46118 template <class U>
46119 inline PyObject* execute(U const& x, mpl::false_) const
46120 {
46121 U* const p = &const_cast<U&>(x);
46122 if (is_polymorphic<U>::value)
46123 {
46124 if (PyObject* o = detail::wrapper_base_::owner(p))
46125 return incref(o);
46126 }
46127 return MakeHolder::execute(p);
46128 }
46129 };
46130 namespace detail
46131 {
46132 struct make_owning_holder
46133 {
46134 template <class T>
46135 static PyObject* execute(T* p)
46136 {
46137 typedef std::auto_ptr<T> smart_pointer;
46138 typedef objects::pointer_holder<smart_pointer, T> holder_t;
46139 smart_pointer ptr(const_cast<T*>(p));
46140 return objects::make_ptr_instance<T, holder_t>::execute(ptr);
46141 }
46142 };
46143 struct make_reference_holder
46144 {
46145 template <class T>
46146 static PyObject* execute(T* p)
46147 {
46148 typedef objects::pointer_holder<T*, T> holder_t;
46149 T* q = const_cast<T*>(p);
46150 return objects::make_ptr_instance<T, holder_t>::execute(q);
46151 }
46152 };
46153 }
46154 }}
46155 namespace boost { namespace python { namespace converter {
46156 namespace detail
46157 {
46158 template <bool is_ref = false>
46159 struct pointer_typeid_select
46160 {
46161 template <class T>
46162 static inline type_info execute(T*(*)() = 0)
46163 {
46164 return type_id<T>();
46165 }
46166 };
46167 template <>
46168 struct pointer_typeid_select<true>
46169 {
46170 template <class T>
46171 static inline type_info execute(T* const volatile&(*)() = 0)
46172 {
46173 return type_id<T>();
46174 }
46175 template <class T>
46176 static inline type_info execute(T*volatile&(*)() = 0)
46177 {
46178 return type_id<T>();
46179 }
46180 template <class T>
46181 static inline type_info execute(T*const&(*)() = 0)
46182 {
46183 return type_id<T>();
46184 }
46185 template <class T>
46186 static inline type_info execute(T*&(*)() = 0)
46187 {
46188 return type_id<T>();
46189 }
46190 };
46191 }
46192 template <class T>
46193 type_info pointer_type_id(T(*)() = 0)
46194 {
46195 return detail::pointer_typeid_select<
46196 is_reference<T>::value
46197 >::execute((T(*)())0);
46198 }
46199 }}}
46200 namespace boost { namespace python { namespace converter {
46201 struct registration;
46202 template <class T>
46203 struct registered_pointee
46204 : registered<
46205 typename remove_pointer<
46206 typename remove_cv<
46207 typename remove_reference<T>::type
46208 >::type
46209 >::type
46210 >
46211 {
46212 };
46213 }}}
46214 namespace boost { namespace python { namespace converter {
46215 struct registration;
46216 namespace detail
46217 {
46218 struct arg_to_python_base
46219 : handle<>
46220 {
46221 arg_to_python_base(void const volatile* source, registration const&);
46222 };
46223 }
46224 }}}
46225 namespace boost { namespace python { namespace converter {
46226 struct shared_ptr_deleter
46227 {
46228 shared_ptr_deleter(handle<> owner);
46229 ~shared_ptr_deleter();
46230 void operator()(void const*);
46231 handle<> owner;
46232 };
46233 }}}
46234 namespace boost
46235 {
46236 class bad_weak_ptr: public std::exception
46237 {
46238 public:
46239 virtual char const * what() const throw()
46240 {
46241 return "tr1::bad_weak_ptr";
46242 }
46243 };
46244 }
46245 namespace boost
46246 {
46247 namespace detail
46248 {
46249 inline int atomic_exchange_and_add( int * pw, int dv )
46250 {
46251 int r;
46252 __asm__ __volatile__
46253 (
46254 "lock\n\t"
46255 "xadd %1, %0":
46256 "=m"( *pw ), "=r"( r ):
46257 "m"( *pw ), "1"( dv ):
46258 "memory", "cc"
46259 );
46260 return r;
46261 }
46262 inline void atomic_increment( int * pw )
46263 {
46264 __asm__
46265 (
46266 "lock\n\t"
46267 "incl %0":
46268 "=m"( *pw ):
46269 "m"( *pw ):
46270 "cc"
46271 );
46272 }
46273 inline int atomic_conditional_increment( int * pw )
46274 {
46275 int rv, tmp;
46276 __asm__
46277 (
46278 "movl %0, %%eax\n\t"
46279 "0:\n\t"
46280 "test %%eax, %%eax\n\t"
46281 "je 1f\n\t"
46282 "movl %%eax, %2\n\t"
46283 "incl %2\n\t"
46284 "lock\n\t"
46285 "cmpxchgl %2, %0\n\t"
46286 "jne 0b\n\t"
46287 "1:":
46288 "=m"( *pw ), "=&a"( rv ), "=&r"( tmp ):
46289 "m"( *pw ):
46290 "cc"
46291 );
46292 return rv;
46293 }
46294 class sp_counted_base
46295 {
46296 private:
46297 sp_counted_base( sp_counted_base const & );
46298 sp_counted_base & operator= ( sp_counted_base const & );
46299 int use_count_;
46300 int weak_count_;
46301 public:
46302 sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
46303 {
46304 }
46305 virtual ~sp_counted_base()
46306 {
46307 }
46308 virtual void dispose() = 0;
46309 virtual void destroy()
46310 {
46311 delete this;
46312 }
46313 virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
46314 void add_ref_copy()
46315 {
46316 atomic_increment( &use_count_ );
46317 }
46318 bool add_ref_lock()
46319 {
46320 return atomic_conditional_increment( &use_count_ ) != 0;
46321 }
46322 void release()
46323 {
46324 if( atomic_exchange_and_add( &use_count_, -1 ) == 1 )
46325 {
46326 dispose();
46327 weak_release();
46328 }
46329 }
46330 void weak_add_ref()
46331 {
46332 atomic_increment( &weak_count_ );
46333 }
46334 void weak_release()
46335 {
46336 if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 )
46337 {
46338 destroy();
46339 }
46340 }
46341 long use_count() const
46342 {
46343 return static_cast<int const volatile &>( use_count_ );
46344 }
46345 };
46346 }
46347 }
46348
46349 namespace boost
46350 {
46351 namespace detail
46352 {
46353 template<class X> class sp_counted_impl_p: public sp_counted_base
46354 {
46355 private:
46356 X * px_;
46357 sp_counted_impl_p( sp_counted_impl_p const & );
46358 sp_counted_impl_p & operator= ( sp_counted_impl_p const & );
46359 typedef sp_counted_impl_p<X> this_type;
46360 public:
46361 explicit sp_counted_impl_p( X * px ): px_( px )
46362 {
46363 }
46364 virtual void dispose()
46365 {
46366 boost::checked_delete( px_ );
46367 }
46368 virtual void * get_deleter( detail::sp_typeinfo const & )
46369 {
46370 return 0;
46371 }
46372 };
46373 template<class P, class D> class sp_counted_impl_pd: public sp_counted_base
46374 {
46375 private:
46376 P ptr;
46377 D del;
46378 sp_counted_impl_pd( sp_counted_impl_pd const & );
46379 sp_counted_impl_pd & operator= ( sp_counted_impl_pd const & );
46380 typedef sp_counted_impl_pd<P, D> this_type;
46381 public:
46382 sp_counted_impl_pd( P p, D d ): ptr(p), del(d)
46383 {
46384 }
46385 virtual void dispose()
46386 {
46387 del( ptr );
46388 }
46389 virtual void * get_deleter( detail::sp_typeinfo const & ti )
46390 {
46391 return ti == typeid(D)? &reinterpret_cast<char&>( del ): 0;
46392 }
46393 };
46394 template<class P, class D, class A> class sp_counted_impl_pda: public sp_counted_base
46395 {
46396 private:
46397 P p_;
46398 D d_;
46399 A a_;
46400 sp_counted_impl_pda( sp_counted_impl_pda const & );
46401 sp_counted_impl_pda & operator= ( sp_counted_impl_pda const & );
46402 typedef sp_counted_impl_pda<P, D, A> this_type;
46403 public:
46404 sp_counted_impl_pda( P p, D d, A a ): p_( p ), d_( d ), a_( a )
46405 {
46406 }
46407 virtual void dispose()
46408 {
46409 d_( p_ );
46410 }
46411 virtual void destroy()
46412 {
46413 typedef typename A::template rebind< this_type >::other A2;
46414 A2 a2( a_ );
46415 this->~this_type();
46416 a2.deallocate( this, 1 );
46417 }
46418 virtual void * get_deleter( detail::sp_typeinfo const & ti )
46419 {
46420 return ti == typeid(D)? &reinterpret_cast<char&>( d_ ): 0;
46421 }
46422 };
46423 }
46424 }
46425 namespace boost
46426 {
46427 namespace detail
46428 {
46429 struct sp_nothrow_tag {};
46430 class weak_count;
46431 class shared_count
46432 {
46433 private:
46434 sp_counted_base * pi_;
46435 friend class weak_count;
46436 public:
46437 shared_count(): pi_(0)
46438 {
46439 }
46440 template<class Y> explicit shared_count( Y * p ): pi_( 0 )
46441 {
46442 try
46443 {
46444 pi_ = new sp_counted_impl_p<Y>( p );
46445 }
46446 catch(...)
46447 {
46448 boost::checked_delete( p );
46449 throw;
46450 }
46451 }
46452 template<class P, class D> shared_count( P p, D d ): pi_(0)
46453 {
46454 try
46455 {
46456 pi_ = new sp_counted_impl_pd<P, D>(p, d);
46457 }
46458 catch(...)
46459 {
46460 d(p);
46461 throw;
46462 }
46463 }
46464 template<class P, class D, class A> shared_count( P p, D d, A a ): pi_( 0 )
46465 {
46466 typedef sp_counted_impl_pda<P, D, A> impl_type;
46467 typedef typename A::template rebind< impl_type >::other A2;
46468 A2 a2( a );
46469 try
46470 {
46471 pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
46472 new( static_cast< void* >( pi_ ) ) impl_type( p, d, a );
46473 }
46474 catch(...)
46475 {
46476 d( p );
46477 if( pi_ != 0 )
46478 {
46479 a2.deallocate( static_cast< impl_type* >( pi_ ), 1 );
46480 }
46481 throw;
46482 }
46483 }
46484 template<class Y>
46485 explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
46486 {
46487 r.release();
46488 }
46489 ~shared_count()
46490 {
46491 if( pi_ != 0 ) pi_->release();
46492 }
46493 shared_count(shared_count const & r): pi_(r.pi_)
46494 {
46495 if( pi_ != 0 ) pi_->add_ref_copy();
46496 }
46497 explicit shared_count(weak_count const & r);
46498 shared_count( weak_count const & r, sp_nothrow_tag );
46499 shared_count & operator= (shared_count const & r)
46500 {
46501 sp_counted_base * tmp = r.pi_;
46502 if( tmp != pi_ )
46503 {
46504 if( tmp != 0 ) tmp->add_ref_copy();
46505 if( pi_ != 0 ) pi_->release();
46506 pi_ = tmp;
46507 }
46508 return *this;
46509 }
46510 void swap(shared_count & r)
46511 {
46512 sp_counted_base * tmp = r.pi_;
46513 r.pi_ = pi_;
46514 pi_ = tmp;
46515 }
46516 long use_count() const
46517 {
46518 return pi_ != 0? pi_->use_count(): 0;
46519 }
46520 bool unique() const
46521 {
46522 return use_count() == 1;
46523 }
46524 bool empty() const
46525 {
46526 return pi_ == 0;
46527 }
46528 friend inline bool operator==(shared_count const & a, shared_count const & b)
46529 {
46530 return a.pi_ == b.pi_;
46531 }
46532 friend inline bool operator<(shared_count const & a, shared_count const & b)
46533 {
46534 return std::less<sp_counted_base *>()( a.pi_, b.pi_ );
46535 }
46536 void * get_deleter( sp_typeinfo const & ti ) const
46537 {
46538 return pi_? pi_->get_deleter( ti ): 0;
46539 }
46540 };
46541 class weak_count
46542 {
46543 private:
46544 sp_counted_base * pi_;
46545 friend class shared_count;
46546 public:
46547 weak_count(): pi_(0)
46548 {
46549 }
46550 weak_count(shared_count const & r): pi_(r.pi_)
46551 {
46552 if(pi_ != 0) pi_->weak_add_ref();
46553 }
46554 weak_count(weak_count const & r): pi_(r.pi_)
46555 {
46556 if(pi_ != 0) pi_->weak_add_ref();
46557 }
46558 ~weak_count()
46559 {
46560 if(pi_ != 0) pi_->weak_release();
46561 }
46562 weak_count & operator= (shared_count const & r)
46563 {
46564 sp_counted_base * tmp = r.pi_;
46565 if( tmp != pi_ )
46566 {
46567 if(tmp != 0) tmp->weak_add_ref();
46568 if(pi_ != 0) pi_->weak_release();
46569 pi_ = tmp;
46570 }
46571 return *this;
46572 }
46573 weak_count & operator= (weak_count const & r)
46574 {
46575 sp_counted_base * tmp = r.pi_;
46576 if( tmp != pi_ )
46577 {
46578 if(tmp != 0) tmp->weak_add_ref();
46579 if(pi_ != 0) pi_->weak_release();
46580 pi_ = tmp;
46581 }
46582 return *this;
46583 }
46584 void swap(weak_count & r)
46585 {
46586 sp_counted_base * tmp = r.pi_;
46587 r.pi_ = pi_;
46588 pi_ = tmp;
46589 }
46590 long use_count() const
46591 {
46592 return pi_ != 0? pi_->use_count(): 0;
46593 }
46594 bool empty() const
46595 {
46596 return pi_ == 0;
46597 }
46598 friend inline bool operator==(weak_count const & a, weak_count const & b)
46599 {
46600 return a.pi_ == b.pi_;
46601 }
46602 friend inline bool operator<(weak_count const & a, weak_count const & b)
46603 {
46604 return std::less<sp_counted_base *>()(a.pi_, b.pi_);
46605 }
46606 };
46607 inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ )
46608 {
46609 if( pi_ == 0 || !pi_->add_ref_lock() )
46610 {
46611 boost::throw_exception( boost::bad_weak_ptr() );
46612 }
46613 }
46614 inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ): pi_( r.pi_ )
46615 {
46616 if( pi_ != 0 && !pi_->add_ref_lock() )
46617 {
46618 pi_ = 0;
46619 }
46620 }
46621 }
46622 }
46623 namespace boost
46624 {
46625 namespace detail
46626 {
46627 template< class Y, class T > struct sp_convertible
46628 {
46629 typedef char (&yes) [1];
46630 typedef char (&no) [2];
46631 static yes f( T* );
46632 static no f( ... );
46633 enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };
46634 };
46635 struct sp_empty
46636 {
46637 };
46638 template< bool > struct sp_enable_if_convertible_impl;
46639 template<> struct sp_enable_if_convertible_impl<true>
46640 {
46641 typedef sp_empty type;
46642 };
46643 template<> struct sp_enable_if_convertible_impl<false>
46644 {
46645 };
46646 template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_if_convertible_impl< sp_convertible< Y, T >::value >
46647 {
46648 };
46649 }
46650 }
46651 namespace boost
46652 {
46653 namespace detail
46654 {
46655 inline void yield( unsigned k )
46656 {
46657 if( k < 4 )
46658 {
46659 }
46660 else if( k < 16 )
46661 {
46662 __asm__ __volatile__( "rep; nop" : : : "memory" );
46663 }
46664 else if( k < 32 || k & 1 )
46665 {
46666 sched_yield();
46667 }
46668 else
46669 {
46670 struct timespec rqtp = { 0, 0 };
46671 rqtp.tv_sec = 0;
46672 rqtp.tv_nsec = 1000;
46673 nanosleep( &rqtp, 0 );
46674 }
46675 }
46676 }
46677 }
46678 namespace boost
46679 {
46680 namespace detail
46681 {
46682 class spinlock
46683 {
46684 public:
46685 int v_;
46686 public:
46687 bool try_lock()
46688 {
46689 int r = __sync_lock_test_and_set( &v_, 1 );
46690 return r == 0;
46691 }
46692 void lock()
46693 {
46694 for( unsigned k = 0; !try_lock(); ++k )
46695 {
46696 boost::detail::yield( k );
46697 }
46698 }
46699 void unlock()
46700 {
46701 __sync_lock_release( &v_ );
46702 }
46703 public:
46704 class scoped_lock
46705 {
46706 private:
46707 spinlock & sp_;
46708 scoped_lock( scoped_lock const & );
46709 scoped_lock & operator=( scoped_lock const & );
46710 public:
46711 explicit scoped_lock( spinlock & sp ): sp_( sp )
46712 {
46713 sp.lock();
46714 }
46715 ~scoped_lock()
46716 {
46717 sp_.unlock();
46718 }
46719 };
46720 };
46721 }
46722 }
46723
46724 namespace boost
46725 {
46726 namespace detail
46727 {
46728 template< int I > class spinlock_pool
46729 {
46730 private:
46731 static spinlock pool_[ 41 ];
46732 public:
46733 static spinlock & spinlock_for( void const * pv )
46734 {
46735 std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41;
46736 return pool_[ i ];
46737 }
46738 class scoped_lock
46739 {
46740 private:
46741 spinlock & sp_;
46742 scoped_lock( scoped_lock const & );
46743 scoped_lock & operator=( scoped_lock const & );
46744 public:
46745 explicit scoped_lock( void const * pv ): sp_( spinlock_for( pv ) )
46746 {
46747 sp_.lock();
46748 }
46749 ~scoped_lock()
46750 {
46751 sp_.unlock();
46752 }
46753 };
46754 };
46755 template< int I > spinlock spinlock_pool< I >::pool_[ 41 ] =
46756 {
46757 {0}, {0}, {0}, {0}, {0},
46758 {0}, {0}, {0}, {0}, {0},
46759 {0}, {0}, {0}, {0}, {0},
46760 {0}, {0}, {0}, {0}, {0},
46761 {0}, {0}, {0}, {0}, {0},
46762 {0}, {0}, {0}, {0}, {0},
46763 {0}, {0}, {0}, {0}, {0},
46764 {0}, {0}, {0}, {0}, {0},
46765 {0}
46766 };
46767 }
46768 }
46769 namespace boost
46770 {
46771 enum memory_order
46772 {
46773 memory_order_relaxed = 0,
46774 memory_order_acquire = 1,
46775 memory_order_release = 2,
46776 memory_order_acq_rel = 3,
46777 memory_order_seq_cst = 7,
46778 memory_order_consume = 8
46779 };
46780 }
46781 namespace boost
46782 {
46783 template<class T> class shared_ptr;
46784 template<class T> class weak_ptr;
46785 template<class T> class enable_shared_from_this;
46786 template<class T> class enable_shared_from_this2;
46787 namespace detail
46788 {
46789 struct static_cast_tag {};
46790 struct const_cast_tag {};
46791 struct dynamic_cast_tag {};
46792 struct polymorphic_cast_tag {};
46793 template<class T> struct shared_ptr_traits
46794 {
46795 typedef T & reference;
46796 };
46797 template<> struct shared_ptr_traits<void>
46798 {
46799 typedef void reference;
46800 };
46801 template<> struct shared_ptr_traits<void const>
46802 {
46803 typedef void reference;
46804 };
46805 template<> struct shared_ptr_traits<void volatile>
46806 {
46807 typedef void reference;
46808 };
46809 template<> struct shared_ptr_traits<void const volatile>
46810 {
46811 typedef void reference;
46812 };
46813 template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> const * ppx, Y const * py, boost::enable_shared_from_this< T > const * pe )
46814 {
46815 if( pe != 0 )
46816 {
46817 pe->_internal_accept_owner( ppx, const_cast< Y* >( py ) );
46818 }
46819 }
46820 template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> * ppx, Y const * py, boost::enable_shared_from_this2< T > const * pe )
46821 {
46822 if( pe != 0 )
46823 {
46824 pe->_internal_accept_owner( ppx, const_cast< Y* >( py ) );
46825 }
46826 }
46827 inline void sp_enable_shared_from_this( ... )
46828 {
46829 }
46830 template< class T, class R > struct sp_enable_if_auto_ptr
46831 {
46832 };
46833 template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R >
46834 {
46835 typedef R type;
46836 };
46837 }
46838 template<class T> class shared_ptr
46839 {
46840 private:
46841 typedef shared_ptr<T> this_type;
46842 public:
46843 typedef T element_type;
46844 typedef T value_type;
46845 typedef T * pointer;
46846 typedef typename boost::detail::shared_ptr_traits<T>::reference reference;
46847 shared_ptr(): px(0), pn()
46848 {
46849 }
46850 template<class Y>
46851 explicit shared_ptr( Y * p ): px( p ), pn( p )
46852 {
46853 boost::detail::sp_enable_shared_from_this( this, p, p );
46854 }
46855 template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
46856 {
46857 boost::detail::sp_enable_shared_from_this( this, p, p );
46858 }
46859 template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a )
46860 {
46861 boost::detail::sp_enable_shared_from_this( this, p, p );
46862 }
46863 template<class Y>
46864 explicit shared_ptr(weak_ptr<Y> const & r): pn(r.pn)
46865 {
46866 px = r.px;
46867 }
46868 template<class Y>
46869 shared_ptr( weak_ptr<Y> const & r, boost::detail::sp_nothrow_tag ): px( 0 ), pn( r.pn, boost::detail::sp_nothrow_tag() )
46870 {
46871 if( !pn.empty() )
46872 {
46873 px = r.px;
46874 }
46875 }
46876 template<class Y>
46877 shared_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
46878 : px( r.px ), pn( r.pn )
46879 {
46880 }
46881 template< class Y >
46882 shared_ptr( shared_ptr<Y> const & r, T * p ): px( p ), pn( r.pn )
46883 {
46884 }
46885 template<class Y>
46886 shared_ptr(shared_ptr<Y> const & r, boost::detail::static_cast_tag): px(static_cast<element_type *>(r.px)), pn(r.pn)
46887 {
46888 }
46889 template<class Y>
46890 shared_ptr(shared_ptr<Y> const & r, boost::detail::const_cast_tag): px(const_cast<element_type *>(r.px)), pn(r.pn)
46891 {
46892 }
46893 template<class Y>
46894 shared_ptr(shared_ptr<Y> const & r, boost::detail::dynamic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
46895 {
46896 if(px == 0)
46897 {
46898 pn = boost::detail::shared_count();
46899 }
46900 }
46901 template<class Y>
46902 shared_ptr(shared_ptr<Y> const & r, boost::detail::polymorphic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
46903 {
46904 if(px == 0)
46905 {
46906 boost::throw_exception(std::bad_cast());
46907 }
46908 }
46909 template<class Y>
46910 explicit shared_ptr(std::auto_ptr<Y> & r): px(r.get()), pn()
46911 {
46912 Y * tmp = r.get();
46913 pn = boost::detail::shared_count(r);
46914 boost::detail::sp_enable_shared_from_this( this, tmp, tmp );
46915 }
46916 template<class Ap>
46917 explicit shared_ptr( Ap r, typename boost::detail::sp_enable_if_auto_ptr<Ap, int>::type = 0 ): px( r.get() ), pn()
46918 {
46919 typename Ap::element_type * tmp = r.get();
46920 pn = boost::detail::shared_count( r );
46921 boost::detail::sp_enable_shared_from_this( this, tmp, tmp );
46922 }
46923 shared_ptr & operator=( shared_ptr const & r )
46924 {
46925 this_type(r).swap(*this);
46926 return *this;
46927 }
46928 template<class Y>
46929 shared_ptr & operator=(shared_ptr<Y> const & r)
46930 {
46931 this_type(r).swap(*this);
46932 return *this;
46933 }
46934 template<class Y>
46935 shared_ptr & operator=( std::auto_ptr<Y> & r )
46936 {
46937 this_type(r).swap(*this);
46938 return *this;
46939 }
46940 template<class Ap>
46941 typename boost::detail::sp_enable_if_auto_ptr< Ap, shared_ptr & >::type operator=( Ap r )
46942 {
46943 this_type( r ).swap( *this );
46944 return *this;
46945 }
46946 void reset()
46947 {
46948 this_type().swap(*this);
46949 }
46950 template<class Y> void reset(Y * p)
46951 {
46952 (static_cast<void> (0));
46953 this_type(p).swap(*this);
46954 }
46955 template<class Y, class D> void reset( Y * p, D d )
46956 {
46957 this_type( p, d ).swap( *this );
46958 }
46959 template<class Y, class D, class A> void reset( Y * p, D d, A a )
46960 {
46961 this_type( p, d, a ).swap( *this );
46962 }
46963 template<class Y> void reset( shared_ptr<Y> const & r, T * p )
46964 {
46965 this_type( r, p ).swap( *this );
46966 }
46967 reference operator* () const
46968 {
46969 (static_cast<void> (0));
46970 return *px;
46971 }
46972 T * operator-> () const
46973 {
46974 (static_cast<void> (0));
46975 return px;
46976 }
46977 T * get() const
46978 {
46979 return px;
46980 }
46981 typedef T * this_type::*unspecified_bool_type;
46982 operator unspecified_bool_type() const
46983 {
46984 return px == 0? 0: &this_type::px;
46985 }
46986 bool operator! () const
46987 {
46988 return px == 0;
46989 }
46990 bool unique() const
46991 {
46992 return pn.unique();
46993 }
46994 long use_count() const
46995 {
46996 return pn.use_count();
46997 }
46998 void swap(shared_ptr<T> & other)
46999 {
47000 std::swap(px, other.px);
47001 pn.swap(other.pn);
47002 }
47003 template<class Y> bool _internal_less(shared_ptr<Y> const & rhs) const
47004 {
47005 return pn < rhs.pn;
47006 }
47007 void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const
47008 {
47009 return pn.get_deleter( ti );
47010 }
47011 bool _internal_equiv( shared_ptr const & r ) const
47012 {
47013 return px == r.px && pn == r.pn;
47014 }
47015 private:
47016 template<class Y> friend class shared_ptr;
47017 template<class Y> friend class weak_ptr;
47018 T * px;
47019 boost::detail::shared_count pn;
47020 };
47021 template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b)
47022 {
47023 return a.get() == b.get();
47024 }
47025 template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b)
47026 {
47027 return a.get() != b.get();
47028 }
47029 template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b)
47030 {
47031 return a._internal_less(b);
47032 }
47033 template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b)
47034 {
47035 a.swap(b);
47036 }
47037 template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r)
47038 {
47039 return shared_ptr<T>(r, boost::detail::static_cast_tag());
47040 }
47041 template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r)
47042 {
47043 return shared_ptr<T>(r, boost::detail::const_cast_tag());
47044 }
47045 template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r)
47046 {
47047 return shared_ptr<T>(r, boost::detail::dynamic_cast_tag());
47048 }
47049 template<class T, class U> shared_ptr<T> shared_static_cast(shared_ptr<U> const & r)
47050 {
47051 return shared_ptr<T>(r, boost::detail::static_cast_tag());
47052 }
47053 template<class T, class U> shared_ptr<T> shared_dynamic_cast(shared_ptr<U> const & r)
47054 {
47055 return shared_ptr<T>(r, boost::detail::dynamic_cast_tag());
47056 }
47057 template<class T, class U> shared_ptr<T> shared_polymorphic_cast(shared_ptr<U> const & r)
47058 {
47059 return shared_ptr<T>(r, boost::detail::polymorphic_cast_tag());
47060 }
47061 template<class T, class U> shared_ptr<T> shared_polymorphic_downcast(shared_ptr<U> const & r)
47062 {
47063 (static_cast<void> (0));
47064 return shared_static_cast<T>(r);
47065 }
47066 template<class T> inline T * get_pointer(shared_ptr<T> const & p)
47067 {
47068 return p.get();
47069 }
47070 template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p)
47071 {
47072 os << p.get();
47073 return os;
47074 }
47075 template<class D, class T> D * get_deleter(shared_ptr<T> const & p)
47076 {
47077 return static_cast<D *>(p._internal_get_deleter(typeid(D)));
47078 }
47079 template<class T> inline bool atomic_is_lock_free( shared_ptr<T> const * )
47080 {
47081 return false;
47082 }
47083 template<class T> shared_ptr<T> atomic_load( shared_ptr<T> const * p )
47084 {
47085 boost::detail::spinlock_pool<2>::scoped_lock lock( p );
47086 return *p;
47087 }
47088 template<class T> inline shared_ptr<T> atomic_load_explicit( shared_ptr<T> const * p, memory_order )
47089 {
47090 return atomic_load( p );
47091 }
47092 template<class T> void atomic_store( shared_ptr<T> * p, shared_ptr<T> r )
47093 {
47094 boost::detail::spinlock_pool<2>::scoped_lock lock( p );
47095 p->swap( r );
47096 }
47097 template<class T> inline void atomic_store_explicit( shared_ptr<T> * p, shared_ptr<T> r, memory_order )
47098 {
47099 atomic_store( p, r );
47100 }
47101 template<class T> shared_ptr<T> atomic_exchange( shared_ptr<T> * p, shared_ptr<T> r )
47102 {
47103 boost::detail::spinlock & sp = boost::detail::spinlock_pool<2>::spinlock_for( p );
47104 sp.lock();
47105 p->swap( r );
47106 sp.unlock();
47107 return r;
47108 }
47109 template<class T> shared_ptr<T> atomic_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> r, memory_order )
47110 {
47111 return atomic_exchange( p, r );
47112 }
47113 template<class T> bool atomic_compare_exchange( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w )
47114 {
47115 boost::detail::spinlock & sp = boost::detail::spinlock_pool<2>::spinlock_for( p );
47116 sp.lock();
47117 if( p->_internal_equiv( *v ) )
47118 {
47119 p->swap( w );
47120 sp.unlock();
47121 return true;
47122 }
47123 else
47124 {
47125 shared_ptr<T> tmp( *p );
47126 sp.unlock();
47127 tmp.swap( *v );
47128 return false;
47129 }
47130 }
47131 template<class T> inline bool atomic_compare_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w, memory_order , memory_order )
47132 {
47133 return atomic_compare_exchange( p, v, w );
47134 }
47135 }
47136 namespace boost { namespace python { namespace converter {
47137 template <class T>
47138 PyObject* shared_ptr_to_python(shared_ptr<T> const& x)
47139 {
47140 if (!x)
47141 return python::detail::none();
47142 else if (shared_ptr_deleter* d = boost::get_deleter<shared_ptr_deleter>(x))
47143 return incref( get_pointer( d->owner ) );
47144 else
47145 return converter::registered<shared_ptr<T> const&>::converters.to_python(&x);
47146 }
47147 }}}
47148 namespace boost { namespace python {
47149 typedef Py_ssize_t ssize_t;
47150 ssize_t const ssize_t_max = ((Py_ssize_t)(((size_t)-1)>>1));
47151 ssize_t const ssize_t_min = (-((Py_ssize_t)(((size_t)-1)>>1))-1);
47152 }}
47153 namespace boost { namespace mpl {
47154 template<
47155 typename T = na
47156 >
47157 struct identity
47158 {
47159 typedef T type;
47160
47161 };
47162 template<
47163 typename T = na
47164 >
47165 struct make_identity
47166 {
47167 typedef identity<T> type;
47168
47169 };
47170 template<> struct identity< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : identity< T1 > { }; }; template< typename Tag > struct lambda< identity< na > , Tag , int_<-1> > { typedef false_ is_le; typedef identity< na > result_; typedef identity< na > type; }; namespace aux { template< typename T1 > struct template_arity< identity< T1 > > : int_<1> { }; template<> struct template_arity< identity< na > > : int_<-1> { }; }
47171 template<> struct make_identity< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : make_identity< T1 > { }; }; template< typename Tag > struct lambda< make_identity< na > , Tag , int_<-1> > { typedef false_ is_le; typedef make_identity< na > result_; typedef make_identity< na > type; }; namespace aux { template< typename T1 > struct template_arity< make_identity< T1 > > : int_<1> { }; template<> struct template_arity< make_identity< na > > : int_<-1> { }; }
47172 }}
47173 namespace boost {
47174 template <typename T>
47175 inline T implicit_cast (typename mpl::identity<T>::type x) {
47176 return x;
47177 }
47178 }
47179
47180
47181 namespace std __attribute__ ((__visibility__ ("default"))) {
47182 template<typename _Tp>
47183 _Tp __cmath_power(_Tp, unsigned int);
47184 template<typename _Tp>
47185 inline _Tp
47186 __pow_helper(_Tp __x, int __n)
47187 {
47188 return __n < 0
47189 ? _Tp(1)/__cmath_power(__x, -__n)
47190 : __cmath_power(__x, __n);
47191 }
47192 inline double
47193 abs(double __x)
47194 { return __builtin_fabs(__x); }
47195 inline float
47196 abs(float __x)
47197 { return __builtin_fabsf(__x); }
47198 inline long double
47199 abs(long double __x)
47200 { return __builtin_fabsl(__x); }
47201 template<typename _Tp>
47202 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47203 double>::__type
47204 abs(_Tp __x)
47205 { return __builtin_fabs(__x); }
47206 using ::acos;
47207 inline float
47208 acos(float __x)
47209 { return __builtin_acosf(__x); }
47210 inline long double
47211 acos(long double __x)
47212 { return __builtin_acosl(__x); }
47213 template<typename _Tp>
47214 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47215 double>::__type
47216 acos(_Tp __x)
47217 { return __builtin_acos(__x); }
47218 using ::asin;
47219 inline float
47220 asin(float __x)
47221 { return __builtin_asinf(__x); }
47222 inline long double
47223 asin(long double __x)
47224 { return __builtin_asinl(__x); }
47225 template<typename _Tp>
47226 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47227 double>::__type
47228 asin(_Tp __x)
47229 { return __builtin_asin(__x); }
47230 using ::atan;
47231 inline float
47232 atan(float __x)
47233 { return __builtin_atanf(__x); }
47234 inline long double
47235 atan(long double __x)
47236 { return __builtin_atanl(__x); }
47237 template<typename _Tp>
47238 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47239 double>::__type
47240 atan(_Tp __x)
47241 { return __builtin_atan(__x); }
47242 using ::atan2;
47243 inline float
47244 atan2(float __y, float __x)
47245 { return __builtin_atan2f(__y, __x); }
47246 inline long double
47247 atan2(long double __y, long double __x)
47248 { return __builtin_atan2l(__y, __x); }
47249 template<typename _Tp, typename _Up>
47250 inline
47251 typename __gnu_cxx::__promote_2<
47252 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
47253 && __is_arithmetic<_Up>::__value,
47254 _Tp>::__type, _Up>::__type
47255 atan2(_Tp __y, _Up __x)
47256 {
47257 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
47258 return atan2(__type(__y), __type(__x));
47259 }
47260 using ::ceil;
47261 inline float
47262 ceil(float __x)
47263 { return __builtin_ceilf(__x); }
47264 inline long double
47265 ceil(long double __x)
47266 { return __builtin_ceill(__x); }
47267 template<typename _Tp>
47268 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47269 double>::__type
47270 ceil(_Tp __x)
47271 { return __builtin_ceil(__x); }
47272 using ::cos;
47273 inline float
47274 cos(float __x)
47275 { return __builtin_cosf(__x); }
47276 inline long double
47277 cos(long double __x)
47278 { return __builtin_cosl(__x); }
47279 template<typename _Tp>
47280 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47281 double>::__type
47282 cos(_Tp __x)
47283 { return __builtin_cos(__x); }
47284 using ::cosh;
47285 inline float
47286 cosh(float __x)
47287 { return __builtin_coshf(__x); }
47288 inline long double
47289 cosh(long double __x)
47290 { return __builtin_coshl(__x); }
47291 template<typename _Tp>
47292 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47293 double>::__type
47294 cosh(_Tp __x)
47295 { return __builtin_cosh(__x); }
47296 using ::exp;
47297 inline float
47298 exp(float __x)
47299 { return __builtin_expf(__x); }
47300 inline long double
47301 exp(long double __x)
47302 { return __builtin_expl(__x); }
47303 template<typename _Tp>
47304 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47305 double>::__type
47306 exp(_Tp __x)
47307 { return __builtin_exp(__x); }
47308 using ::fabs;
47309 inline float
47310 fabs(float __x)
47311 { return __builtin_fabsf(__x); }
47312 inline long double
47313 fabs(long double __x)
47314 { return __builtin_fabsl(__x); }
47315 template<typename _Tp>
47316 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47317 double>::__type
47318 fabs(_Tp __x)
47319 { return __builtin_fabs(__x); }
47320 using ::floor;
47321 inline float
47322 floor(float __x)
47323 { return __builtin_floorf(__x); }
47324 inline long double
47325 floor(long double __x)
47326 { return __builtin_floorl(__x); }
47327 template<typename _Tp>
47328 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47329 double>::__type
47330 floor(_Tp __x)
47331 { return __builtin_floor(__x); }
47332 using ::fmod;
47333 inline float
47334 fmod(float __x, float __y)
47335 { return __builtin_fmodf(__x, __y); }
47336 inline long double
47337 fmod(long double __x, long double __y)
47338 { return __builtin_fmodl(__x, __y); }
47339 using ::frexp;
47340 inline float
47341 frexp(float __x, int* __exp)
47342 { return __builtin_frexpf(__x, __exp); }
47343 inline long double
47344 frexp(long double __x, int* __exp)
47345 { return __builtin_frexpl(__x, __exp); }
47346 template<typename _Tp>
47347 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47348 double>::__type
47349 frexp(_Tp __x, int* __exp)
47350 { return __builtin_frexp(__x, __exp); }
47351 using ::ldexp;
47352 inline float
47353 ldexp(float __x, int __exp)
47354 { return __builtin_ldexpf(__x, __exp); }
47355 inline long double
47356 ldexp(long double __x, int __exp)
47357 { return __builtin_ldexpl(__x, __exp); }
47358 template<typename _Tp>
47359 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47360 double>::__type
47361 ldexp(_Tp __x, int __exp)
47362 { return __builtin_ldexp(__x, __exp); }
47363 using ::log;
47364 inline float
47365 log(float __x)
47366 { return __builtin_logf(__x); }
47367 inline long double
47368 log(long double __x)
47369 { return __builtin_logl(__x); }
47370 template<typename _Tp>
47371 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47372 double>::__type
47373 log(_Tp __x)
47374 { return __builtin_log(__x); }
47375 using ::log10;
47376 inline float
47377 log10(float __x)
47378 { return __builtin_log10f(__x); }
47379 inline long double
47380 log10(long double __x)
47381 { return __builtin_log10l(__x); }
47382 template<typename _Tp>
47383 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47384 double>::__type
47385 log10(_Tp __x)
47386 { return __builtin_log10(__x); }
47387 using ::modf;
47388 inline float
47389 modf(float __x, float* __iptr)
47390 { return __builtin_modff(__x, __iptr); }
47391 inline long double
47392 modf(long double __x, long double* __iptr)
47393 { return __builtin_modfl(__x, __iptr); }
47394 using ::pow;
47395 inline float
47396 pow(float __x, float __y)
47397 { return __builtin_powf(__x, __y); }
47398 inline long double
47399 pow(long double __x, long double __y)
47400 { return __builtin_powl(__x, __y); }
47401 inline double
47402 pow(double __x, int __i)
47403 { return __builtin_powi(__x, __i); }
47404 inline float
47405 pow(float __x, int __n)
47406 { return __builtin_powif(__x, __n); }
47407 inline long double
47408 pow(long double __x, int __n)
47409 { return __builtin_powil(__x, __n); }
47410 template<typename _Tp, typename _Up>
47411 inline
47412 typename __gnu_cxx::__promote_2<
47413 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
47414 && __is_arithmetic<_Up>::__value,
47415 _Tp>::__type, _Up>::__type
47416 pow(_Tp __x, _Up __y)
47417 {
47418 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
47419 return pow(__type(__x), __type(__y));
47420 }
47421 using ::sin;
47422 inline float
47423 sin(float __x)
47424 { return __builtin_sinf(__x); }
47425 inline long double
47426 sin(long double __x)
47427 { return __builtin_sinl(__x); }
47428 template<typename _Tp>
47429 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47430 double>::__type
47431 sin(_Tp __x)
47432 { return __builtin_sin(__x); }
47433 using ::sinh;
47434 inline float
47435 sinh(float __x)
47436 { return __builtin_sinhf(__x); }
47437 inline long double
47438 sinh(long double __x)
47439 { return __builtin_sinhl(__x); }
47440 template<typename _Tp>
47441 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47442 double>::__type
47443 sinh(_Tp __x)
47444 { return __builtin_sinh(__x); }
47445 using ::sqrt;
47446 inline float
47447 sqrt(float __x)
47448 { return __builtin_sqrtf(__x); }
47449 inline long double
47450 sqrt(long double __x)
47451 { return __builtin_sqrtl(__x); }
47452 template<typename _Tp>
47453 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47454 double>::__type
47455 sqrt(_Tp __x)
47456 { return __builtin_sqrt(__x); }
47457 using ::tan;
47458 inline float
47459 tan(float __x)
47460 { return __builtin_tanf(__x); }
47461 inline long double
47462 tan(long double __x)
47463 { return __builtin_tanl(__x); }
47464 template<typename _Tp>
47465 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47466 double>::__type
47467 tan(_Tp __x)
47468 { return __builtin_tan(__x); }
47469 using ::tanh;
47470 inline float
47471 tanh(float __x)
47472 { return __builtin_tanhf(__x); }
47473 inline long double
47474 tanh(long double __x)
47475 { return __builtin_tanhl(__x); }
47476 template<typename _Tp>
47477 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
47478 double>::__type
47479 tanh(_Tp __x)
47480 { return __builtin_tanh(__x); }
47481 }
47482 namespace std __attribute__ ((__visibility__ ("default"))) {
47483 template<typename _Tp>
47484 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47485 int>::__type
47486 fpclassify(_Tp __f)
47487 {
47488 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47489 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
47490 FP_SUBNORMAL, FP_ZERO, __type(__f));
47491 }
47492 template<typename _Tp>
47493 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47494 int>::__type
47495 isfinite(_Tp __f)
47496 {
47497 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47498 return __builtin_isfinite(__type(__f));
47499 }
47500 template<typename _Tp>
47501 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47502 int>::__type
47503 isinf(_Tp __f)
47504 {
47505 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47506 return __builtin_isinf(__type(__f));
47507 }
47508 template<typename _Tp>
47509 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47510 int>::__type
47511 isnan(_Tp __f)
47512 {
47513 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47514 return __builtin_isnan(__type(__f));
47515 }
47516 template<typename _Tp>
47517 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47518 int>::__type
47519 isnormal(_Tp __f)
47520 {
47521 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47522 return __builtin_isnormal(__type(__f));
47523 }
47524 template<typename _Tp>
47525 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47526 int>::__type
47527 signbit(_Tp __f)
47528 {
47529 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47530 return __builtin_signbit(__type(__f));
47531 }
47532 template<typename _Tp>
47533 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47534 int>::__type
47535 isgreater(_Tp __f1, _Tp __f2)
47536 {
47537 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47538 return __builtin_isgreater(__type(__f1), __type(__f2));
47539 }
47540 template<typename _Tp>
47541 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47542 int>::__type
47543 isgreaterequal(_Tp __f1, _Tp __f2)
47544 {
47545 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47546 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
47547 }
47548 template<typename _Tp>
47549 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47550 int>::__type
47551 isless(_Tp __f1, _Tp __f2)
47552 {
47553 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47554 return __builtin_isless(__type(__f1), __type(__f2));
47555 }
47556 template<typename _Tp>
47557 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47558 int>::__type
47559 islessequal(_Tp __f1, _Tp __f2)
47560 {
47561 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47562 return __builtin_islessequal(__type(__f1), __type(__f2));
47563 }
47564 template<typename _Tp>
47565 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47566 int>::__type
47567 islessgreater(_Tp __f1, _Tp __f2)
47568 {
47569 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47570 return __builtin_islessgreater(__type(__f1), __type(__f2));
47571 }
47572 template<typename _Tp>
47573 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
47574 int>::__type
47575 isunordered(_Tp __f1, _Tp __f2)
47576 {
47577 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
47578 return __builtin_isunordered(__type(__f1), __type(__f2));
47579 }
47580 }
47581 namespace std __attribute__ ((__visibility__ ("default"))) {
47582 template<typename _Tp>
47583 inline _Tp
47584 __cmath_power(_Tp __x, unsigned int __n)
47585 {
47586 _Tp __y = __n % 2 ? __x : _Tp(1);
47587 while (__n >>= 1)
47588 {
47589 __x = __x * __x;
47590 if (__n % 2)
47591 __y = __y * __x;
47592 }
47593 return __y;
47594 }
47595 }
47596
47597 namespace std __attribute__ ((__visibility__ ("default"))) {
47598 template<typename _CharT, typename _Traits, typename _Alloc>
47599 class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
47600 {
47601 public:
47602 typedef _CharT char_type;
47603 typedef _Traits traits_type;
47604 typedef _Alloc allocator_type;
47605 typedef typename traits_type::int_type int_type;
47606 typedef typename traits_type::pos_type pos_type;
47607 typedef typename traits_type::off_type off_type;
47608 typedef basic_streambuf<char_type, traits_type> __streambuf_type;
47609 typedef basic_string<char_type, _Traits, _Alloc> __string_type;
47610 typedef typename __string_type::size_type __size_type;
47611 protected:
47612 ios_base::openmode _M_mode;
47613 __string_type _M_string;
47614 public:
47615 explicit
47616 basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
47617 : __streambuf_type(), _M_mode(__mode), _M_string()
47618 { }
47619 explicit
47620 basic_stringbuf(const __string_type& __str,
47621 ios_base::openmode __mode = ios_base::in | ios_base::out)
47622 : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size())
47623 { _M_stringbuf_init(__mode); }
47624 __string_type
47625 str() const
47626 {
47627 __string_type __ret;
47628 if (this->pptr())
47629 {
47630 if (this->pptr() > this->egptr())
47631 __ret = __string_type(this->pbase(), this->pptr());
47632 else
47633 __ret = __string_type(this->pbase(), this->egptr());
47634 }
47635 else
47636 __ret = _M_string;
47637 return __ret;
47638 }
47639 void
47640 str(const __string_type& __s)
47641 {
47642 _M_string.assign(__s.data(), __s.size());
47643 _M_stringbuf_init(_M_mode);
47644 }
47645 protected:
47646 void
47647 _M_stringbuf_init(ios_base::openmode __mode)
47648 {
47649 _M_mode = __mode;
47650 __size_type __len = 0;
47651 if (_M_mode & (ios_base::ate | ios_base::app))
47652 __len = _M_string.size();
47653 _M_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
47654 }
47655 virtual streamsize
47656 showmanyc()
47657 {
47658 streamsize __ret = -1;
47659 if (_M_mode & ios_base::in)
47660 {
47661 _M_update_egptr();
47662 __ret = this->egptr() - this->gptr();
47663 }
47664 return __ret;
47665 }
47666 virtual int_type
47667 underflow();
47668 virtual int_type
47669 pbackfail(int_type __c = traits_type::eof());
47670 virtual int_type
47671 overflow(int_type __c = traits_type::eof());
47672 virtual __streambuf_type*
47673 setbuf(char_type* __s, streamsize __n)
47674 {
47675 if (__s && __n >= 0)
47676 {
47677 _M_string.clear();
47678 _M_sync(__s, __n, 0);
47679 }
47680 return this;
47681 }
47682 virtual pos_type
47683 seekoff(off_type __off, ios_base::seekdir __way,
47684 ios_base::openmode __mode = ios_base::in | ios_base::out);
47685 virtual pos_type
47686 seekpos(pos_type __sp,
47687 ios_base::openmode __mode = ios_base::in | ios_base::out);
47688 void
47689 _M_sync(char_type* __base, __size_type __i, __size_type __o);
47690 void
47691 _M_update_egptr()
47692 {
47693 const bool __testin = _M_mode & ios_base::in;
47694 if (this->pptr() && this->pptr() > this->egptr())
47695 {
47696 if (__testin)
47697 this->setg(this->eback(), this->gptr(), this->pptr());
47698 else
47699 this->setg(this->pptr(), this->pptr(), this->pptr());
47700 }
47701 }
47702 };
47703 template<typename _CharT, typename _Traits, typename _Alloc>
47704 class basic_istringstream : public basic_istream<_CharT, _Traits>
47705 {
47706 public:
47707 typedef _CharT char_type;
47708 typedef _Traits traits_type;
47709 typedef _Alloc allocator_type;
47710 typedef typename traits_type::int_type int_type;
47711 typedef typename traits_type::pos_type pos_type;
47712 typedef typename traits_type::off_type off_type;
47713 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
47714 typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
47715 typedef basic_istream<char_type, traits_type> __istream_type;
47716 private:
47717 __stringbuf_type _M_stringbuf;
47718 public:
47719 explicit
47720 basic_istringstream(ios_base::openmode __mode = ios_base::in)
47721 : __istream_type(), _M_stringbuf(__mode | ios_base::in)
47722 { this->init(&_M_stringbuf); }
47723 explicit
47724 basic_istringstream(const __string_type& __str,
47725 ios_base::openmode __mode = ios_base::in)
47726 : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in)
47727 { this->init(&_M_stringbuf); }
47728 ~basic_istringstream()
47729 { }
47730 __stringbuf_type*
47731 rdbuf() const
47732 { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
47733 __string_type
47734 str() const
47735 { return _M_stringbuf.str(); }
47736 void
47737 str(const __string_type& __s)
47738 { _M_stringbuf.str(__s); }
47739 };
47740 template <typename _CharT, typename _Traits, typename _Alloc>
47741 class basic_ostringstream : public basic_ostream<_CharT, _Traits>
47742 {
47743 public:
47744 typedef _CharT char_type;
47745 typedef _Traits traits_type;
47746 typedef _Alloc allocator_type;
47747 typedef typename traits_type::int_type int_type;
47748 typedef typename traits_type::pos_type pos_type;
47749 typedef typename traits_type::off_type off_type;
47750 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
47751 typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
47752 typedef basic_ostream<char_type, traits_type> __ostream_type;
47753 private:
47754 __stringbuf_type _M_stringbuf;
47755 public:
47756 explicit
47757 basic_ostringstream(ios_base::openmode __mode = ios_base::out)
47758 : __ostream_type(), _M_stringbuf(__mode | ios_base::out)
47759 { this->init(&_M_stringbuf); }
47760 explicit
47761 basic_ostringstream(const __string_type& __str,
47762 ios_base::openmode __mode = ios_base::out)
47763 : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out)
47764 { this->init(&_M_stringbuf); }
47765 ~basic_ostringstream()
47766 { }
47767 __stringbuf_type*
47768 rdbuf() const
47769 { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
47770 __string_type
47771 str() const
47772 { return _M_stringbuf.str(); }
47773 void
47774 str(const __string_type& __s)
47775 { _M_stringbuf.str(__s); }
47776 };
47777 template <typename _CharT, typename _Traits, typename _Alloc>
47778 class basic_stringstream : public basic_iostream<_CharT, _Traits>
47779 {
47780 public:
47781 typedef _CharT char_type;
47782 typedef _Traits traits_type;
47783 typedef _Alloc allocator_type;
47784 typedef typename traits_type::int_type int_type;
47785 typedef typename traits_type::pos_type pos_type;
47786 typedef typename traits_type::off_type off_type;
47787 typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
47788 typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
47789 typedef basic_iostream<char_type, traits_type> __iostream_type;
47790 private:
47791 __stringbuf_type _M_stringbuf;
47792 public:
47793 explicit
47794 basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
47795 : __iostream_type(), _M_stringbuf(__m)
47796 { this->init(&_M_stringbuf); }
47797 explicit
47798 basic_stringstream(const __string_type& __str,
47799 ios_base::openmode __m = ios_base::out | ios_base::in)
47800 : __iostream_type(), _M_stringbuf(__str, __m)
47801 { this->init(&_M_stringbuf); }
47802 ~basic_stringstream()
47803 { }
47804 __stringbuf_type*
47805 rdbuf() const
47806 { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
47807 __string_type
47808 str() const
47809 { return _M_stringbuf.str(); }
47810 void
47811 str(const __string_type& __s)
47812 { _M_stringbuf.str(__s); }
47813 };
47814 }
47815
47816 namespace std __attribute__ ((__visibility__ ("default"))) {
47817 template <class _CharT, class _Traits, class _Alloc>
47818 typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
47819 basic_stringbuf<_CharT, _Traits, _Alloc>::
47820 pbackfail(int_type __c)
47821 {
47822 int_type __ret = traits_type::eof();
47823 if (this->eback() < this->gptr())
47824 {
47825 const bool __testeof = traits_type::eq_int_type(__c, __ret);
47826 if (!__testeof)
47827 {
47828 const bool __testeq = traits_type::eq(traits_type::
47829 to_char_type(__c),
47830 this->gptr()[-1]);
47831 const bool __testout = this->_M_mode & ios_base::out;
47832 if (__testeq || __testout)
47833 {
47834 this->gbump(-1);
47835 if (!__testeq)
47836 *this->gptr() = traits_type::to_char_type(__c);
47837 __ret = __c;
47838 }
47839 }
47840 else
47841 {
47842 this->gbump(-1);
47843 __ret = traits_type::not_eof(__c);
47844 }
47845 }
47846 return __ret;
47847 }
47848 template <class _CharT, class _Traits, class _Alloc>
47849 typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
47850 basic_stringbuf<_CharT, _Traits, _Alloc>::
47851 overflow(int_type __c)
47852 {
47853 const bool __testout = this->_M_mode & ios_base::out;
47854 if (__builtin_expect(!__testout, false))
47855 return traits_type::eof();
47856 const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
47857 if (__builtin_expect(__testeof, false))
47858 return traits_type::not_eof(__c);
47859 const __size_type __capacity = _M_string.capacity();
47860 const __size_type __max_size = _M_string.max_size();
47861 const bool __testput = this->pptr() < this->epptr();
47862 if (__builtin_expect(!__testput && __capacity == __max_size, false))
47863 return traits_type::eof();
47864 const char_type __conv = traits_type::to_char_type(__c);
47865 if (!__testput)
47866 {
47867 const __size_type __opt_len = std::max(__size_type(2 * __capacity),
47868 __size_type(512));
47869 const __size_type __len = std::min(__opt_len, __max_size);
47870 __string_type __tmp;
47871 __tmp.reserve(__len);
47872 if (this->pbase())
47873 __tmp.assign(this->pbase(), this->epptr() - this->pbase());
47874 __tmp.push_back(__conv);
47875 _M_string.swap(__tmp);
47876 _M_sync(const_cast<char_type*>(_M_string.data()),
47877 this->gptr() - this->eback(), this->pptr() - this->pbase());
47878 }
47879 else
47880 *this->pptr() = __conv;
47881 this->pbump(1);
47882 return __c;
47883 }
47884 template <class _CharT, class _Traits, class _Alloc>
47885 typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
47886 basic_stringbuf<_CharT, _Traits, _Alloc>::
47887 underflow()
47888 {
47889 int_type __ret = traits_type::eof();
47890 const bool __testin = this->_M_mode & ios_base::in;
47891 if (__testin)
47892 {
47893 _M_update_egptr();
47894 if (this->gptr() < this->egptr())
47895 __ret = traits_type::to_int_type(*this->gptr());
47896 }
47897 return __ret;
47898 }
47899 template <class _CharT, class _Traits, class _Alloc>
47900 typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
47901 basic_stringbuf<_CharT, _Traits, _Alloc>::
47902 seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
47903 {
47904 pos_type __ret = pos_type(off_type(-1));
47905 bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
47906 bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
47907 const bool __testboth = __testin && __testout && __way != ios_base::cur;
47908 __testin &= !(__mode & ios_base::out);
47909 __testout &= !(__mode & ios_base::in);
47910 const char_type* __beg = __testin ? this->eback() : this->pbase();
47911 if ((__beg || !__off) && (__testin || __testout || __testboth))
47912 {
47913 _M_update_egptr();
47914 off_type __newoffi = __off;
47915 off_type __newoffo = __newoffi;
47916 if (__way == ios_base::cur)
47917 {
47918 __newoffi += this->gptr() - __beg;
47919 __newoffo += this->pptr() - __beg;
47920 }
47921 else if (__way == ios_base::end)
47922 __newoffo = __newoffi += this->egptr() - __beg;
47923 if ((__testin || __testboth)
47924 && __newoffi >= 0
47925 && this->egptr() - __beg >= __newoffi)
47926 {
47927 this->gbump((__beg + __newoffi) - this->gptr());
47928 __ret = pos_type(__newoffi);
47929 }
47930 if ((__testout || __testboth)
47931 && __newoffo >= 0
47932 && this->egptr() - __beg >= __newoffo)
47933 {
47934 this->pbump((__beg + __newoffo) - this->pptr());
47935 __ret = pos_type(__newoffo);
47936 }
47937 }
47938 return __ret;
47939 }
47940 template <class _CharT, class _Traits, class _Alloc>
47941 typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
47942 basic_stringbuf<_CharT, _Traits, _Alloc>::
47943 seekpos(pos_type __sp, ios_base::openmode __mode)
47944 {
47945 pos_type __ret = pos_type(off_type(-1));
47946 const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
47947 const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
47948 const char_type* __beg = __testin ? this->eback() : this->pbase();
47949 if ((__beg || !off_type(__sp)) && (__testin || __testout))
47950 {
47951 _M_update_egptr();
47952 const off_type __pos(__sp);
47953 const bool __testpos = (0 <= __pos
47954 && __pos <= this->egptr() - __beg);
47955 if (__testpos)
47956 {
47957 if (__testin)
47958 this->gbump((__beg + __pos) - this->gptr());
47959 if (__testout)
47960 this->pbump((__beg + __pos) - this->pptr());
47961 __ret = __sp;
47962 }
47963 }
47964 return __ret;
47965 }
47966 template <class _CharT, class _Traits, class _Alloc>
47967 void
47968 basic_stringbuf<_CharT, _Traits, _Alloc>::
47969 _M_sync(char_type* __base, __size_type __i, __size_type __o)
47970 {
47971 const bool __testin = _M_mode & ios_base::in;
47972 const bool __testout = _M_mode & ios_base::out;
47973 char_type* __endg = __base + _M_string.size();
47974 char_type* __endp = __base + _M_string.capacity();
47975 if (__base != _M_string.data())
47976 {
47977 __endg += __i;
47978 __i = 0;
47979 __endp = __endg;
47980 }
47981 if (__testin)
47982 this->setg(__base, __base + __i, __endg);
47983 if (__testout)
47984 {
47985 this->setp(__base, __endp);
47986 this->pbump(__o);
47987 if (!__testin)
47988 this->setg(__endg, __endg, __endg);
47989 }
47990 }
47991 extern template class basic_stringbuf<char>;
47992 extern template class basic_istringstream<char>;
47993 extern template class basic_ostringstream<char>;
47994 extern template class basic_stringstream<char>;
47995 extern template class basic_stringbuf<wchar_t>;
47996 extern template class basic_istringstream<wchar_t>;
47997 extern template class basic_ostringstream<wchar_t>;
47998 extern template class basic_stringstream<wchar_t>;
47999 }
48000 namespace std __attribute__ ((__visibility__ ("default"))) {
48001 template<typename _Tp> class complex;
48002 template<> class complex<float>;
48003 template<> class complex<double>;
48004 template<> class complex<long double>;
48005 template<typename _Tp> _Tp abs(const complex<_Tp>&);
48006 template<typename _Tp> _Tp arg(const complex<_Tp>&);
48007 template<typename _Tp> _Tp norm(const complex<_Tp>&);
48008 template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
48009 template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0);
48010 template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&);
48011 template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&);
48012 template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&);
48013 template<typename _Tp> complex<_Tp> log(const complex<_Tp>&);
48014 template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&);
48015 template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int);
48016 template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&);
48017 template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
48018 const complex<_Tp>&);
48019 template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&);
48020 template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&);
48021 template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&);
48022 template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&);
48023 template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&);
48024 template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&);
48025 template<typename _Tp>
48026 struct complex
48027 {
48028 typedef _Tp value_type;
48029 complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
48030 : _M_real(__r), _M_imag(__i) { }
48031 template<typename _Up>
48032 complex(const complex<_Up>& __z)
48033 : _M_real(__z.real()), _M_imag(__z.imag()) { }
48034 _Tp& real()
48035 { return _M_real; }
48036 const _Tp& real() const
48037 { return _M_real; }
48038 _Tp& imag()
48039 { return _M_imag; }
48040 const _Tp& imag() const
48041 { return _M_imag; }
48042 void real(_Tp __val)
48043 { _M_real = __val; }
48044 void imag(_Tp __val)
48045 { _M_imag = __val; }
48046 complex<_Tp>& operator=(const _Tp&);
48047 complex<_Tp>&
48048 operator+=(const _Tp& __t)
48049 {
48050 _M_real += __t;
48051 return *this;
48052 }
48053 complex<_Tp>&
48054 operator-=(const _Tp& __t)
48055 {
48056 _M_real -= __t;
48057 return *this;
48058 }
48059 complex<_Tp>& operator*=(const _Tp&);
48060 complex<_Tp>& operator/=(const _Tp&);
48061 template<typename _Up>
48062 complex<_Tp>& operator=(const complex<_Up>&);
48063 template<typename _Up>
48064 complex<_Tp>& operator+=(const complex<_Up>&);
48065 template<typename _Up>
48066 complex<_Tp>& operator-=(const complex<_Up>&);
48067 template<typename _Up>
48068 complex<_Tp>& operator*=(const complex<_Up>&);
48069 template<typename _Up>
48070 complex<_Tp>& operator/=(const complex<_Up>&);
48071 const complex& __rep() const
48072 { return *this; }
48073 private:
48074 _Tp _M_real;
48075 _Tp _M_imag;
48076 };
48077 template<typename _Tp>
48078 complex<_Tp>&
48079 complex<_Tp>::operator=(const _Tp& __t)
48080 {
48081 _M_real = __t;
48082 _M_imag = _Tp();
48083 return *this;
48084 }
48085 template<typename _Tp>
48086 complex<_Tp>&
48087 complex<_Tp>::operator*=(const _Tp& __t)
48088 {
48089 _M_real *= __t;
48090 _M_imag *= __t;
48091 return *this;
48092 }
48093 template<typename _Tp>
48094 complex<_Tp>&
48095 complex<_Tp>::operator/=(const _Tp& __t)
48096 {
48097 _M_real /= __t;
48098 _M_imag /= __t;
48099 return *this;
48100 }
48101 template<typename _Tp>
48102 template<typename _Up>
48103 complex<_Tp>&
48104 complex<_Tp>::operator=(const complex<_Up>& __z)
48105 {
48106 _M_real = __z.real();
48107 _M_imag = __z.imag();
48108 return *this;
48109 }
48110 template<typename _Tp>
48111 template<typename _Up>
48112 complex<_Tp>&
48113 complex<_Tp>::operator+=(const complex<_Up>& __z)
48114 {
48115 _M_real += __z.real();
48116 _M_imag += __z.imag();
48117 return *this;
48118 }
48119 template<typename _Tp>
48120 template<typename _Up>
48121 complex<_Tp>&
48122 complex<_Tp>::operator-=(const complex<_Up>& __z)
48123 {
48124 _M_real -= __z.real();
48125 _M_imag -= __z.imag();
48126 return *this;
48127 }
48128 template<typename _Tp>
48129 template<typename _Up>
48130 complex<_Tp>&
48131 complex<_Tp>::operator*=(const complex<_Up>& __z)
48132 {
48133 const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag();
48134 _M_imag = _M_real * __z.imag() + _M_imag * __z.real();
48135 _M_real = __r;
48136 return *this;
48137 }
48138 template<typename _Tp>
48139 template<typename _Up>
48140 complex<_Tp>&
48141 complex<_Tp>::operator/=(const complex<_Up>& __z)
48142 {
48143 const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
48144 const _Tp __n = std::norm(__z);
48145 _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
48146 _M_real = __r / __n;
48147 return *this;
48148 }
48149 template<typename _Tp>
48150 inline complex<_Tp>
48151 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
48152 {
48153 complex<_Tp> __r = __x;
48154 __r += __y;
48155 return __r;
48156 }
48157 template<typename _Tp>
48158 inline complex<_Tp>
48159 operator+(const complex<_Tp>& __x, const _Tp& __y)
48160 {
48161 complex<_Tp> __r = __x;
48162 __r += __y;
48163 return __r;
48164 }
48165 template<typename _Tp>
48166 inline complex<_Tp>
48167 operator+(const _Tp& __x, const complex<_Tp>& __y)
48168 {
48169 complex<_Tp> __r = __y;
48170 __r += __x;
48171 return __r;
48172 }
48173 template<typename _Tp>
48174 inline complex<_Tp>
48175 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
48176 {
48177 complex<_Tp> __r = __x;
48178 __r -= __y;
48179 return __r;
48180 }
48181 template<typename _Tp>
48182 inline complex<_Tp>
48183 operator-(const complex<_Tp>& __x, const _Tp& __y)
48184 {
48185 complex<_Tp> __r = __x;
48186 __r -= __y;
48187 return __r;
48188 }
48189 template<typename _Tp>
48190 inline complex<_Tp>
48191 operator-(const _Tp& __x, const complex<_Tp>& __y)
48192 {
48193 complex<_Tp> __r(__x, -__y.imag());
48194 __r -= __y.real();
48195 return __r;
48196 }
48197 template<typename _Tp>
48198 inline complex<_Tp>
48199 operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
48200 {
48201 complex<_Tp> __r = __x;
48202 __r *= __y;
48203 return __r;
48204 }
48205 template<typename _Tp>
48206 inline complex<_Tp>
48207 operator*(const complex<_Tp>& __x, const _Tp& __y)
48208 {
48209 complex<_Tp> __r = __x;
48210 __r *= __y;
48211 return __r;
48212 }
48213 template<typename _Tp>
48214 inline complex<_Tp>
48215 operator*(const _Tp& __x, const complex<_Tp>& __y)
48216 {
48217 complex<_Tp> __r = __y;
48218 __r *= __x;
48219 return __r;
48220 }
48221 template<typename _Tp>
48222 inline complex<_Tp>
48223 operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
48224 {
48225 complex<_Tp> __r = __x;
48226 __r /= __y;
48227 return __r;
48228 }
48229 template<typename _Tp>
48230 inline complex<_Tp>
48231 operator/(const complex<_Tp>& __x, const _Tp& __y)
48232 {
48233 complex<_Tp> __r = __x;
48234 __r /= __y;
48235 return __r;
48236 }
48237 template<typename _Tp>
48238 inline complex<_Tp>
48239 operator/(const _Tp& __x, const complex<_Tp>& __y)
48240 {
48241 complex<_Tp> __r = __x;
48242 __r /= __y;
48243 return __r;
48244 }
48245 template<typename _Tp>
48246 inline complex<_Tp>
48247 operator+(const complex<_Tp>& __x)
48248 { return __x; }
48249 template<typename _Tp>
48250 inline complex<_Tp>
48251 operator-(const complex<_Tp>& __x)
48252 { return complex<_Tp>(-__x.real(), -__x.imag()); }
48253 template<typename _Tp>
48254 inline bool
48255 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
48256 { return __x.real() == __y.real() && __x.imag() == __y.imag(); }
48257 template<typename _Tp>
48258 inline bool
48259 operator==(const complex<_Tp>& __x, const _Tp& __y)
48260 { return __x.real() == __y && __x.imag() == _Tp(); }
48261 template<typename _Tp>
48262 inline bool
48263 operator==(const _Tp& __x, const complex<_Tp>& __y)
48264 { return __x == __y.real() && _Tp() == __y.imag(); }
48265 template<typename _Tp>
48266 inline bool
48267 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
48268 { return __x.real() != __y.real() || __x.imag() != __y.imag(); }
48269 template<typename _Tp>
48270 inline bool
48271 operator!=(const complex<_Tp>& __x, const _Tp& __y)
48272 { return __x.real() != __y || __x.imag() != _Tp(); }
48273 template<typename _Tp>
48274 inline bool
48275 operator!=(const _Tp& __x, const complex<_Tp>& __y)
48276 { return __x != __y.real() || _Tp() != __y.imag(); }
48277 template<typename _Tp, typename _CharT, class _Traits>
48278 basic_istream<_CharT, _Traits>&
48279 operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
48280 {
48281 _Tp __re_x, __im_x;
48282 _CharT __ch;
48283 __is >> __ch;
48284 if (__ch == '(')
48285 {
48286 __is >> __re_x >> __ch;
48287 if (__ch == ',')
48288 {
48289 __is >> __im_x >> __ch;
48290 if (__ch == ')')
48291 __x = complex<_Tp>(__re_x, __im_x);
48292 else
48293 __is.setstate(ios_base::failbit);
48294 }
48295 else if (__ch == ')')
48296 __x = __re_x;
48297 else
48298 __is.setstate(ios_base::failbit);
48299 }
48300 else
48301 {
48302 __is.putback(__ch);
48303 __is >> __re_x;
48304 __x = __re_x;
48305 }
48306 return __is;
48307 }
48308 template<typename _Tp, typename _CharT, class _Traits>
48309 basic_ostream<_CharT, _Traits>&
48310 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
48311 {
48312 basic_ostringstream<_CharT, _Traits> __s;
48313 __s.flags(__os.flags());
48314 __s.imbue(__os.getloc());
48315 __s.precision(__os.precision());
48316 __s << '(' << __x.real() << ',' << __x.imag() << ')';
48317 return __os << __s.str();
48318 }
48319 template<typename _Tp>
48320 inline _Tp&
48321 real(complex<_Tp>& __z)
48322 { return __z.real(); }
48323 template<typename _Tp>
48324 inline const _Tp&
48325 real(const complex<_Tp>& __z)
48326 { return __z.real(); }
48327 template<typename _Tp>
48328 inline _Tp&
48329 imag(complex<_Tp>& __z)
48330 { return __z.imag(); }
48331 template<typename _Tp>
48332 inline const _Tp&
48333 imag(const complex<_Tp>& __z)
48334 { return __z.imag(); }
48335 template<typename _Tp>
48336 inline _Tp
48337 __complex_abs(const complex<_Tp>& __z)
48338 {
48339 _Tp __x = __z.real();
48340 _Tp __y = __z.imag();
48341 const _Tp __s = std::max(abs(__x), abs(__y));
48342 if (__s == _Tp())
48343 return __s;
48344 __x /= __s;
48345 __y /= __s;
48346 return __s * sqrt(__x * __x + __y * __y);
48347 }
48348 inline float
48349 __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
48350 inline double
48351 __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); }
48352 inline long double
48353 __complex_abs(const __complex__ long double& __z)
48354 { return __builtin_cabsl(__z); }
48355 template<typename _Tp>
48356 inline _Tp
48357 abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
48358 template<typename _Tp>
48359 inline _Tp
48360 __complex_arg(const complex<_Tp>& __z)
48361 { return atan2(__z.imag(), __z.real()); }
48362 inline float
48363 __complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
48364 inline double
48365 __complex_arg(__complex__ double __z) { return __builtin_carg(__z); }
48366 inline long double
48367 __complex_arg(const __complex__ long double& __z)
48368 { return __builtin_cargl(__z); }
48369 template<typename _Tp>
48370 inline _Tp
48371 arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); }
48372 template<bool>
48373 struct _Norm_helper
48374 {
48375 template<typename _Tp>
48376 static inline _Tp _S_do_it(const complex<_Tp>& __z)
48377 {
48378 const _Tp __x = __z.real();
48379 const _Tp __y = __z.imag();
48380 return __x * __x + __y * __y;
48381 }
48382 };
48383 template<>
48384 struct _Norm_helper<true>
48385 {
48386 template<typename _Tp>
48387 static inline _Tp _S_do_it(const complex<_Tp>& __z)
48388 {
48389 _Tp __res = std::abs(__z);
48390 return __res * __res;
48391 }
48392 };
48393 template<typename _Tp>
48394 inline _Tp
48395 norm(const complex<_Tp>& __z)
48396 {
48397 return _Norm_helper<__is_floating<_Tp>::__value
48398 && !0>::_S_do_it(__z);
48399 }
48400 template<typename _Tp>
48401 inline complex<_Tp>
48402 polar(const _Tp& __rho, const _Tp& __theta)
48403 { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
48404 template<typename _Tp>
48405 inline complex<_Tp>
48406 conj(const complex<_Tp>& __z)
48407 { return complex<_Tp>(__z.real(), -__z.imag()); }
48408 template<typename _Tp>
48409 inline complex<_Tp>
48410 __complex_cos(const complex<_Tp>& __z)
48411 {
48412 const _Tp __x = __z.real();
48413 const _Tp __y = __z.imag();
48414 return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
48415 }
48416 inline __complex__ float
48417 __complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
48418 inline __complex__ double
48419 __complex_cos(__complex__ double __z) { return __builtin_ccos(__z); }
48420 inline __complex__ long double
48421 __complex_cos(const __complex__ long double& __z)
48422 { return __builtin_ccosl(__z); }
48423 template<typename _Tp>
48424 inline complex<_Tp>
48425 cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); }
48426 template<typename _Tp>
48427 inline complex<_Tp>
48428 __complex_cosh(const complex<_Tp>& __z)
48429 {
48430 const _Tp __x = __z.real();
48431 const _Tp __y = __z.imag();
48432 return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
48433 }
48434 inline __complex__ float
48435 __complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
48436 inline __complex__ double
48437 __complex_cosh(__complex__ double __z) { return __builtin_ccosh(__z); }
48438 inline __complex__ long double
48439 __complex_cosh(const __complex__ long double& __z)
48440 { return __builtin_ccoshl(__z); }
48441 template<typename _Tp>
48442 inline complex<_Tp>
48443 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); }
48444 template<typename _Tp>
48445 inline complex<_Tp>
48446 __complex_exp(const complex<_Tp>& __z)
48447 { return std::polar(exp(__z.real()), __z.imag()); }
48448 inline __complex__ float
48449 __complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
48450 inline __complex__ double
48451 __complex_exp(__complex__ double __z) { return __builtin_cexp(__z); }
48452 inline __complex__ long double
48453 __complex_exp(const __complex__ long double& __z)
48454 { return __builtin_cexpl(__z); }
48455 template<typename _Tp>
48456 inline complex<_Tp>
48457 exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); }
48458 template<typename _Tp>
48459 inline complex<_Tp>
48460 __complex_log(const complex<_Tp>& __z)
48461 { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
48462 inline __complex__ float
48463 __complex_log(__complex__ float __z) { return __builtin_clogf(__z); }
48464 inline __complex__ double
48465 __complex_log(__complex__ double __z) { return __builtin_clog(__z); }
48466 inline __complex__ long double
48467 __complex_log(const __complex__ long double& __z)
48468 { return __builtin_clogl(__z); }
48469 template<typename _Tp>
48470 inline complex<_Tp>
48471 log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
48472 template<typename _Tp>
48473 inline complex<_Tp>
48474 log10(const complex<_Tp>& __z)
48475 { return std::log(__z) / log(_Tp(10.0)); }
48476 template<typename _Tp>
48477 inline complex<_Tp>
48478 __complex_sin(const complex<_Tp>& __z)
48479 {
48480 const _Tp __x = __z.real();
48481 const _Tp __y = __z.imag();
48482 return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
48483 }
48484 inline __complex__ float
48485 __complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
48486 inline __complex__ double
48487 __complex_sin(__complex__ double __z) { return __builtin_csin(__z); }
48488 inline __complex__ long double
48489 __complex_sin(const __complex__ long double& __z)
48490 { return __builtin_csinl(__z); }
48491 template<typename _Tp>
48492 inline complex<_Tp>
48493 sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); }
48494 template<typename _Tp>
48495 inline complex<_Tp>
48496 __complex_sinh(const complex<_Tp>& __z)
48497 {
48498 const _Tp __x = __z.real();
48499 const _Tp __y = __z.imag();
48500 return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
48501 }
48502 inline __complex__ float
48503 __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
48504 inline __complex__ double
48505 __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
48506 inline __complex__ long double
48507 __complex_sinh(const __complex__ long double& __z)
48508 { return __builtin_csinhl(__z); }
48509 template<typename _Tp>
48510 inline complex<_Tp>
48511 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); }
48512 template<typename _Tp>
48513 complex<_Tp>
48514 __complex_sqrt(const complex<_Tp>& __z)
48515 {
48516 _Tp __x = __z.real();
48517 _Tp __y = __z.imag();
48518 if (__x == _Tp())
48519 {
48520 _Tp __t = sqrt(abs(__y) / 2);
48521 return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
48522 }
48523 else
48524 {
48525 _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
48526 _Tp __u = __t / 2;
48527 return __x > _Tp()
48528 ? complex<_Tp>(__u, __y / __t)
48529 : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
48530 }
48531 }
48532 inline __complex__ float
48533 __complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
48534 inline __complex__ double
48535 __complex_sqrt(__complex__ double __z) { return __builtin_csqrt(__z); }
48536 inline __complex__ long double
48537 __complex_sqrt(const __complex__ long double& __z)
48538 { return __builtin_csqrtl(__z); }
48539 template<typename _Tp>
48540 inline complex<_Tp>
48541 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
48542 template<typename _Tp>
48543 inline complex<_Tp>
48544 __complex_tan(const complex<_Tp>& __z)
48545 { return std::sin(__z) / std::cos(__z); }
48546 inline __complex__ float
48547 __complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
48548 inline __complex__ double
48549 __complex_tan(__complex__ double __z) { return __builtin_ctan(__z); }
48550 inline __complex__ long double
48551 __complex_tan(const __complex__ long double& __z)
48552 { return __builtin_ctanl(__z); }
48553 template<typename _Tp>
48554 inline complex<_Tp>
48555 tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); }
48556 template<typename _Tp>
48557 inline complex<_Tp>
48558 __complex_tanh(const complex<_Tp>& __z)
48559 { return std::sinh(__z) / std::cosh(__z); }
48560 inline __complex__ float
48561 __complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
48562 inline __complex__ double
48563 __complex_tanh(__complex__ double __z) { return __builtin_ctanh(__z); }
48564 inline __complex__ long double
48565 __complex_tanh(const __complex__ long double& __z)
48566 { return __builtin_ctanhl(__z); }
48567 template<typename _Tp>
48568 inline complex<_Tp>
48569 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); }
48570 template<typename _Tp>
48571 inline complex<_Tp>
48572 pow(const complex<_Tp>& __z, int __n)
48573 { return std::__pow_helper(__z, __n); }
48574 template<typename _Tp>
48575 complex<_Tp>
48576 pow(const complex<_Tp>& __x, const _Tp& __y)
48577 {
48578 if (__x.imag() == _Tp() && __x.real() > _Tp())
48579 return pow(__x.real(), __y);
48580 complex<_Tp> __t = std::log(__x);
48581 return std::polar(exp(__y * __t.real()), __y * __t.imag());
48582 }
48583 template<typename _Tp>
48584 inline complex<_Tp>
48585 __complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
48586 { return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); }
48587 inline __complex__ float
48588 __complex_pow(__complex__ float __x, __complex__ float __y)
48589 { return __builtin_cpowf(__x, __y); }
48590 inline __complex__ double
48591 __complex_pow(__complex__ double __x, __complex__ double __y)
48592 { return __builtin_cpow(__x, __y); }
48593 inline __complex__ long double
48594 __complex_pow(const __complex__ long double& __x,
48595 const __complex__ long double& __y)
48596 { return __builtin_cpowl(__x, __y); }
48597 template<typename _Tp>
48598 inline complex<_Tp>
48599 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
48600 { return __complex_pow(__x.__rep(), __y.__rep()); }
48601 template<typename _Tp>
48602 inline complex<_Tp>
48603 pow(const _Tp& __x, const complex<_Tp>& __y)
48604 {
48605 return __x > _Tp() ? std::polar(pow(__x, __y.real()),
48606 __y.imag() * log(__x))
48607 : std::pow(complex<_Tp>(__x), __y);
48608 }
48609 template<>
48610 struct complex<float>
48611 {
48612 typedef float value_type;
48613 typedef __complex__ float _ComplexT;
48614 complex(_ComplexT __z) : _M_value(__z) { }
48615 complex(float __r = 0.0f, float __i = 0.0f)
48616 {
48617 __real__ _M_value = __r;
48618 __imag__ _M_value = __i;
48619 }
48620 explicit complex(const complex<double>&);
48621 explicit complex(const complex<long double>&);
48622 float& real()
48623 { return __real__ _M_value; }
48624 const float& real() const
48625 { return __real__ _M_value; }
48626 float& imag()
48627 { return __imag__ _M_value; }
48628 const float& imag() const
48629 { return __imag__ _M_value; }
48630 void real(float __val)
48631 { __real__ _M_value = __val; }
48632 void imag(float __val)
48633 { __imag__ _M_value = __val; }
48634 complex<float>&
48635 operator=(float __f)
48636 {
48637 __real__ _M_value = __f;
48638 __imag__ _M_value = 0.0f;
48639 return *this;
48640 }
48641 complex<float>&
48642 operator+=(float __f)
48643 {
48644 __real__ _M_value += __f;
48645 return *this;
48646 }
48647 complex<float>&
48648 operator-=(float __f)
48649 {
48650 __real__ _M_value -= __f;
48651 return *this;
48652 }
48653 complex<float>&
48654 operator*=(float __f)
48655 {
48656 _M_value *= __f;
48657 return *this;
48658 }
48659 complex<float>&
48660 operator/=(float __f)
48661 {
48662 _M_value /= __f;
48663 return *this;
48664 }
48665 template<typename _Tp>
48666 complex<float>&
48667 operator=(const complex<_Tp>& __z)
48668 {
48669 __real__ _M_value = __z.real();
48670 __imag__ _M_value = __z.imag();
48671 return *this;
48672 }
48673 template<typename _Tp>
48674 complex<float>&
48675 operator+=(const complex<_Tp>& __z)
48676 {
48677 __real__ _M_value += __z.real();
48678 __imag__ _M_value += __z.imag();
48679 return *this;
48680 }
48681 template<class _Tp>
48682 complex<float>&
48683 operator-=(const complex<_Tp>& __z)
48684 {
48685 __real__ _M_value -= __z.real();
48686 __imag__ _M_value -= __z.imag();
48687 return *this;
48688 }
48689 template<class _Tp>
48690 complex<float>&
48691 operator*=(const complex<_Tp>& __z)
48692 {
48693 _ComplexT __t;
48694 __real__ __t = __z.real();
48695 __imag__ __t = __z.imag();
48696 _M_value *= __t;
48697 return *this;
48698 }
48699 template<class _Tp>
48700 complex<float>&
48701 operator/=(const complex<_Tp>& __z)
48702 {
48703 _ComplexT __t;
48704 __real__ __t = __z.real();
48705 __imag__ __t = __z.imag();
48706 _M_value /= __t;
48707 return *this;
48708 }
48709 const _ComplexT& __rep() const { return _M_value; }
48710 private:
48711 _ComplexT _M_value;
48712 };
48713 template<>
48714 struct complex<double>
48715 {
48716 typedef double value_type;
48717 typedef __complex__ double _ComplexT;
48718 complex(_ComplexT __z) : _M_value(__z) { }
48719 complex(double __r = 0.0, double __i = 0.0)
48720 {
48721 __real__ _M_value = __r;
48722 __imag__ _M_value = __i;
48723 }
48724 complex(const complex<float>& __z)
48725 : _M_value(__z.__rep()) { }
48726 explicit complex(const complex<long double>&);
48727 double& real()
48728 { return __real__ _M_value; }
48729 const double& real() const
48730 { return __real__ _M_value; }
48731 double& imag()
48732 { return __imag__ _M_value; }
48733 const double& imag() const
48734 { return __imag__ _M_value; }
48735 void real(double __val)
48736 { __real__ _M_value = __val; }
48737 void imag(double __val)
48738 { __imag__ _M_value = __val; }
48739 complex<double>&
48740 operator=(double __d)
48741 {
48742 __real__ _M_value = __d;
48743 __imag__ _M_value = 0.0;
48744 return *this;
48745 }
48746 complex<double>&
48747 operator+=(double __d)
48748 {
48749 __real__ _M_value += __d;
48750 return *this;
48751 }
48752 complex<double>&
48753 operator-=(double __d)
48754 {
48755 __real__ _M_value -= __d;
48756 return *this;
48757 }
48758 complex<double>&
48759 operator*=(double __d)
48760 {
48761 _M_value *= __d;
48762 return *this;
48763 }
48764 complex<double>&
48765 operator/=(double __d)
48766 {
48767 _M_value /= __d;
48768 return *this;
48769 }
48770 template<typename _Tp>
48771 complex<double>&
48772 operator=(const complex<_Tp>& __z)
48773 {
48774 __real__ _M_value = __z.real();
48775 __imag__ _M_value = __z.imag();
48776 return *this;
48777 }
48778 template<typename _Tp>
48779 complex<double>&
48780 operator+=(const complex<_Tp>& __z)
48781 {
48782 __real__ _M_value += __z.real();
48783 __imag__ _M_value += __z.imag();
48784 return *this;
48785 }
48786 template<typename _Tp>
48787 complex<double>&
48788 operator-=(const complex<_Tp>& __z)
48789 {
48790 __real__ _M_value -= __z.real();
48791 __imag__ _M_value -= __z.imag();
48792 return *this;
48793 }
48794 template<typename _Tp>
48795 complex<double>&
48796 operator*=(const complex<_Tp>& __z)
48797 {
48798 _ComplexT __t;
48799 __real__ __t = __z.real();
48800 __imag__ __t = __z.imag();
48801 _M_value *= __t;
48802 return *this;
48803 }
48804 template<typename _Tp>
48805 complex<double>&
48806 operator/=(const complex<_Tp>& __z)
48807 {
48808 _ComplexT __t;
48809 __real__ __t = __z.real();
48810 __imag__ __t = __z.imag();
48811 _M_value /= __t;
48812 return *this;
48813 }
48814 const _ComplexT& __rep() const { return _M_value; }
48815 private:
48816 _ComplexT _M_value;
48817 };
48818 template<>
48819 struct complex<long double>
48820 {
48821 typedef long double value_type;
48822 typedef __complex__ long double _ComplexT;
48823 complex(_ComplexT __z) : _M_value(__z) { }
48824 complex(long double __r = 0.0L, long double __i = 0.0L)
48825 {
48826 __real__ _M_value = __r;
48827 __imag__ _M_value = __i;
48828 }
48829 complex(const complex<float>& __z)
48830 : _M_value(__z.__rep()) { }
48831 complex(const complex<double>& __z)
48832 : _M_value(__z.__rep()) { }
48833 long double& real()
48834 { return __real__ _M_value; }
48835 const long double& real() const
48836 { return __real__ _M_value; }
48837 long double& imag()
48838 { return __imag__ _M_value; }
48839 const long double& imag() const
48840 { return __imag__ _M_value; }
48841 void real(long double __val)
48842 { __real__ _M_value = __val; }
48843 void imag(long double __val)
48844 { __imag__ _M_value = __val; }
48845 complex<long double>&
48846 operator=(long double __r)
48847 {
48848 __real__ _M_value = __r;
48849 __imag__ _M_value = 0.0L;
48850 return *this;
48851 }
48852 complex<long double>&
48853 operator+=(long double __r)
48854 {
48855 __real__ _M_value += __r;
48856 return *this;
48857 }
48858 complex<long double>&
48859 operator-=(long double __r)
48860 {
48861 __real__ _M_value -= __r;
48862 return *this;
48863 }
48864 complex<long double>&
48865 operator*=(long double __r)
48866 {
48867 _M_value *= __r;
48868 return *this;
48869 }
48870 complex<long double>&
48871 operator/=(long double __r)
48872 {
48873 _M_value /= __r;
48874 return *this;
48875 }
48876 template<typename _Tp>
48877 complex<long double>&
48878 operator=(const complex<_Tp>& __z)
48879 {
48880 __real__ _M_value = __z.real();
48881 __imag__ _M_value = __z.imag();
48882 return *this;
48883 }
48884 template<typename _Tp>
48885 complex<long double>&
48886 operator+=(const complex<_Tp>& __z)
48887 {
48888 __real__ _M_value += __z.real();
48889 __imag__ _M_value += __z.imag();
48890 return *this;
48891 }
48892 template<typename _Tp>
48893 complex<long double>&
48894 operator-=(const complex<_Tp>& __z)
48895 {
48896 __real__ _M_value -= __z.real();
48897 __imag__ _M_value -= __z.imag();
48898 return *this;
48899 }
48900 template<typename _Tp>
48901 complex<long double>&
48902 operator*=(const complex<_Tp>& __z)
48903 {
48904 _ComplexT __t;
48905 __real__ __t = __z.real();
48906 __imag__ __t = __z.imag();
48907 _M_value *= __t;
48908 return *this;
48909 }
48910 template<typename _Tp>
48911 complex<long double>&
48912 operator/=(const complex<_Tp>& __z)
48913 {
48914 _ComplexT __t;
48915 __real__ __t = __z.real();
48916 __imag__ __t = __z.imag();
48917 _M_value /= __t;
48918 return *this;
48919 }
48920 const _ComplexT& __rep() const { return _M_value; }
48921 private:
48922 _ComplexT _M_value;
48923 };
48924 inline
48925 complex<float>::complex(const complex<double>& __z)
48926 : _M_value(__z.__rep()) { }
48927 inline
48928 complex<float>::complex(const complex<long double>& __z)
48929 : _M_value(__z.__rep()) { }
48930 inline
48931 complex<double>::complex(const complex<long double>& __z)
48932 : _M_value(__z.__rep()) { }
48933 extern template istream& operator>>(istream&, complex<float>&);
48934 extern template ostream& operator<<(ostream&, const complex<float>&);
48935 extern template istream& operator>>(istream&, complex<double>&);
48936 extern template ostream& operator<<(ostream&, const complex<double>&);
48937 extern template istream& operator>>(istream&, complex<long double>&);
48938 extern template ostream& operator<<(ostream&, const complex<long double>&);
48939 extern template wistream& operator>>(wistream&, complex<float>&);
48940 extern template wostream& operator<<(wostream&, const complex<float>&);
48941 extern template wistream& operator>>(wistream&, complex<double>&);
48942 extern template wostream& operator<<(wostream&, const complex<double>&);
48943 extern template wistream& operator>>(wistream&, complex<long double>&);
48944 extern template wostream& operator<<(wostream&, const complex<long double>&);
48945 }
48946 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
48947 template<typename _Tp, typename _Up>
48948 struct __promote_2<std::complex<_Tp>, _Up>
48949 {
48950 public:
48951 typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
48952 };
48953 template<typename _Tp, typename _Up>
48954 struct __promote_2<_Tp, std::complex<_Up> >
48955 {
48956 public:
48957 typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
48958 };
48959 template<typename _Tp, typename _Up>
48960 struct __promote_2<std::complex<_Tp>, std::complex<_Up> >
48961 {
48962 public:
48963 typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
48964 };
48965 }
48966 namespace boost { namespace python {
48967 namespace converter
48968 {
48969 template <class T> struct arg_to_python;
48970 PyObject* do_return_to_python(char);
48971 PyObject* do_return_to_python(char const*);
48972 PyObject* do_return_to_python(PyObject*);
48973 PyObject* do_arg_to_python(PyObject*);
48974 }
48975 template <class T> struct to_python_value;
48976 namespace detail
48977 {
48978 struct builtin_to_python
48979 {
48980 static const bool uses_registry = false;
48981 };
48982 }
48983 template <> struct to_python_value<bool&> : detail::builtin_to_python { inline PyObject* operator()(bool const& x) const { return (::PyBool_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyBool_Type); } }; template <> struct to_python_value<bool const&> : detail::builtin_to_python { inline PyObject* operator()(bool const& x) const { return (::PyBool_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyBool_Type); } }; namespace converter { template <> struct arg_to_python< bool > : handle<> { arg_to_python(bool const& x) : python::handle<>(::PyBool_FromLong(x)) {} }; }
48984 template <> struct to_python_value<signed char&> : detail::builtin_to_python { inline PyObject* operator()(signed char const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<signed char const&> : detail::builtin_to_python { inline PyObject* operator()(signed char const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< signed char > : handle<> { arg_to_python(signed char const& x) : python::handle<>(::PyInt_FromLong(x)) {} }; } template <> struct to_python_value<unsigned char&> : detail::builtin_to_python { inline PyObject* operator()(unsigned char const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<unsigned char const&> : detail::builtin_to_python { inline PyObject* operator()(unsigned char const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< unsigned char > : handle<> { arg_to_python(unsigned char const& x) : python::handle<>(static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)) {} }; }
48985 template <> struct to_python_value<signed short&> : detail::builtin_to_python { inline PyObject* operator()(signed short const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<signed short const&> : detail::builtin_to_python { inline PyObject* operator()(signed short const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< signed short > : handle<> { arg_to_python(signed short const& x) : python::handle<>(::PyInt_FromLong(x)) {} }; } template <> struct to_python_value<unsigned short&> : detail::builtin_to_python { inline PyObject* operator()(unsigned short const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<unsigned short const&> : detail::builtin_to_python { inline PyObject* operator()(unsigned short const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< unsigned short > : handle<> { arg_to_python(unsigned short const& x) : python::handle<>(static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)) {} }; }
48986 template <> struct to_python_value<signed int&> : detail::builtin_to_python { inline PyObject* operator()(signed int const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<signed int const&> : detail::builtin_to_python { inline PyObject* operator()(signed int const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< signed int > : handle<> { arg_to_python(signed int const& x) : python::handle<>(::PyInt_FromLong(x)) {} }; } template <> struct to_python_value<unsigned int&> : detail::builtin_to_python { inline PyObject* operator()(unsigned int const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<unsigned int const&> : detail::builtin_to_python { inline PyObject* operator()(unsigned int const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< unsigned int > : handle<> { arg_to_python(unsigned int const& x) : python::handle<>(static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)) {} }; }
48987 template <> struct to_python_value<signed long&> : detail::builtin_to_python { inline PyObject* operator()(signed long const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<signed long const&> : detail::builtin_to_python { inline PyObject* operator()(signed long const& x) const { return (::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< signed long > : handle<> { arg_to_python(signed long const& x) : python::handle<>(::PyInt_FromLong(x)) {} }; } template <> struct to_python_value<unsigned long&> : detail::builtin_to_python { inline PyObject* operator()(unsigned long const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; template <> struct to_python_value<unsigned long const&> : detail::builtin_to_python { inline PyObject* operator()(unsigned long const& x) const { return (static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyInt_Type); } }; namespace converter { template <> struct arg_to_python< unsigned long > : handle<> { arg_to_python(unsigned long const& x) : python::handle<>(static_cast<unsigned long>(x) > static_cast<unsigned long>( (std::numeric_limits<long>::max)()) ? ::PyLong_FromUnsignedLong(x) : ::PyInt_FromLong(x)) {} }; }
48988 template <> struct to_python_value<signed long long&> : detail::builtin_to_python { inline PyObject* operator()(signed long long const& x) const { return (::PyLong_FromLongLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyLong_Type); } }; template <> struct to_python_value<signed long long const&> : detail::builtin_to_python { inline PyObject* operator()(signed long long const& x) const { return (::PyLong_FromLongLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyLong_Type); } }; namespace converter { template <> struct arg_to_python< signed long long > : handle<> { arg_to_python(signed long long const& x) : python::handle<>(::PyLong_FromLongLong(x)) {} }; }
48989 template <> struct to_python_value<unsigned long long&> : detail::builtin_to_python { inline PyObject* operator()(unsigned long long const& x) const { return (::PyLong_FromUnsignedLongLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyLong_Type); } }; template <> struct to_python_value<unsigned long long const&> : detail::builtin_to_python { inline PyObject* operator()(unsigned long long const& x) const { return (::PyLong_FromUnsignedLongLong(x)); } inline PyTypeObject const* get_pytype() const { return (&PyLong_Type); } }; namespace converter { template <> struct arg_to_python< unsigned long long > : handle<> { arg_to_python(unsigned long long const& x) : python::handle<>(::PyLong_FromUnsignedLongLong(x)) {} }; }
48990 template <> struct to_python_value<char&> : detail::builtin_to_python { inline PyObject* operator()(char const& x) const { return (converter::do_return_to_python(x)); } inline PyTypeObject const* get_pytype() const { return (&PyString_Type); } }; template <> struct to_python_value<char const&> : detail::builtin_to_python { inline PyObject* operator()(char const& x) const { return (converter::do_return_to_python(x)); } inline PyTypeObject const* get_pytype() const { return (&PyString_Type); } }; namespace converter { template <> struct arg_to_python< char > : handle<> { arg_to_python(char const& x) : python::handle<>(converter::do_return_to_python(x)) {} }; }
48991 template <> struct to_python_value<char const*&> : detail::builtin_to_python { inline PyObject* operator()(char const* const& x) const { return (converter::do_return_to_python(x)); } inline PyTypeObject const* get_pytype() const { return (&PyString_Type); } }; template <> struct to_python_value<char const* const&> : detail::builtin_to_python { inline PyObject* operator()(char const* const& x) const { return (converter::do_return_to_python(x)); } inline PyTypeObject const* get_pytype() const { return (&PyString_Type); } }; namespace converter { template <> struct arg_to_python< char const* > : handle<> { arg_to_python(char const* const& x) : python::handle<>(converter::do_return_to_python(x)) {} }; }
48992 template <> struct to_python_value<std::string&> : detail::builtin_to_python { inline PyObject* operator()(std::string const& x) const { return (::PyString_FromStringAndSize(x.data(),implicit_cast<ssize_t>(x.size()))); } inline PyTypeObject const* get_pytype() const { return (&PyString_Type); } }; template <> struct to_python_value<std::string const&> : detail::builtin_to_python { inline PyObject* operator()(std::string const& x) const { return (::PyString_FromStringAndSize(x.data(),implicit_cast<ssize_t>(x.size()))); } inline PyTypeObject const* get_pytype() const { return (&PyString_Type); } }; namespace converter { template <> struct arg_to_python< std::string > : handle<> { arg_to_python(std::string const& x) : python::handle<>(::PyString_FromStringAndSize(x.data(),implicit_cast<ssize_t>(x.size()))) {} }; }
48993 template <> struct to_python_value<std::wstring&> : detail::builtin_to_python { inline PyObject* operator()(std::wstring const& x) const { return (::PyUnicodeUCS4_FromWideChar(x.data(),implicit_cast<ssize_t>(x.size()))); } inline PyTypeObject const* get_pytype() const { return (&PyUnicode_Type); } }; template <> struct to_python_value<std::wstring const&> : detail::builtin_to_python { inline PyObject* operator()(std::wstring const& x) const { return (::PyUnicodeUCS4_FromWideChar(x.data(),implicit_cast<ssize_t>(x.size()))); } inline PyTypeObject const* get_pytype() const { return (&PyUnicode_Type); } }; namespace converter { template <> struct arg_to_python< std::wstring > : handle<> { arg_to_python(std::wstring const& x) : python::handle<>(::PyUnicodeUCS4_FromWideChar(x.data(),implicit_cast<ssize_t>(x.size()))) {} }; }
48994 template <> struct to_python_value<float&> : detail::builtin_to_python { inline PyObject* operator()(float const& x) const { return (::PyFloat_FromDouble(x)); } inline PyTypeObject const* get_pytype() const { return (&PyFloat_Type); } }; template <> struct to_python_value<float const&> : detail::builtin_to_python { inline PyObject* operator()(float const& x) const { return (::PyFloat_FromDouble(x)); } inline PyTypeObject const* get_pytype() const { return (&PyFloat_Type); } }; namespace converter { template <> struct arg_to_python< float > : handle<> { arg_to_python(float const& x) : python::handle<>(::PyFloat_FromDouble(x)) {} }; }
48995 template <> struct to_python_value<double&> : detail::builtin_to_python { inline PyObject* operator()(double const& x) const { return (::PyFloat_FromDouble(x)); } inline PyTypeObject const* get_pytype() const { return (&PyFloat_Type); } }; template <> struct to_python_value<double const&> : detail::builtin_to_python { inline PyObject* operator()(double const& x) const { return (::PyFloat_FromDouble(x)); } inline PyTypeObject const* get_pytype() const { return (&PyFloat_Type); } }; namespace converter { template <> struct arg_to_python< double > : handle<> { arg_to_python(double const& x) : python::handle<>(::PyFloat_FromDouble(x)) {} }; }
48996 template <> struct to_python_value<long double&> : detail::builtin_to_python { inline PyObject* operator()(long double const& x) const { return (::PyFloat_FromDouble(x)); } inline PyTypeObject const* get_pytype() const { return (&PyFloat_Type); } }; template <> struct to_python_value<long double const&> : detail::builtin_to_python { inline PyObject* operator()(long double const& x) const { return (::PyFloat_FromDouble(x)); } inline PyTypeObject const* get_pytype() const { return (&PyFloat_Type); } }; namespace converter { template <> struct arg_to_python< long double > : handle<> { arg_to_python(long double const& x) : python::handle<>(::PyFloat_FromDouble(x)) {} }; }
48997 template <> struct to_python_value<PyObject*&> : detail::builtin_to_python { inline PyObject* operator()(PyObject* const& x) const { return (converter::do_return_to_python(x)); } inline PyTypeObject const* get_pytype() const { return (0); } }; template <> struct to_python_value<PyObject* const&> : detail::builtin_to_python { inline PyObject* operator()(PyObject* const& x) const { return (converter::do_return_to_python(x)); } inline PyTypeObject const* get_pytype() const { return (0); } };
48998 template <> struct to_python_value<std::complex<float>&> : detail::builtin_to_python { inline PyObject* operator()(std::complex<float> const& x) const { return (::PyComplex_FromDoubles(x.real(), x.imag())); } inline PyTypeObject const* get_pytype() const { return (&PyComplex_Type); } }; template <> struct to_python_value<std::complex<float> const&> : detail::builtin_to_python { inline PyObject* operator()(std::complex<float> const& x) const { return (::PyComplex_FromDoubles(x.real(), x.imag())); } inline PyTypeObject const* get_pytype() const { return (&PyComplex_Type); } }; namespace converter { template <> struct arg_to_python< std::complex<float> > : handle<> { arg_to_python(std::complex<float> const& x) : python::handle<>(::PyComplex_FromDoubles(x.real(), x.imag())) {} }; }
48999 template <> struct to_python_value<std::complex<double>&> : detail::builtin_to_python { inline PyObject* operator()(std::complex<double> const& x) const { return (::PyComplex_FromDoubles(x.real(), x.imag())); } inline PyTypeObject const* get_pytype() const { return (&PyComplex_Type); } }; template <> struct to_python_value<std::complex<double> const&> : detail::builtin_to_python { inline PyObject* operator()(std::complex<double> const& x) const { return (::PyComplex_FromDoubles(x.real(), x.imag())); } inline PyTypeObject const* get_pytype() const { return (&PyComplex_Type); } }; namespace converter { template <> struct arg_to_python< std::complex<double> > : handle<> { arg_to_python(std::complex<double> const& x) : python::handle<>(::PyComplex_FromDoubles(x.real(), x.imag())) {} }; }
49000 template <> struct to_python_value<std::complex<long double>&> : detail::builtin_to_python { inline PyObject* operator()(std::complex<long double> const& x) const { return (::PyComplex_FromDoubles(x.real(), x.imag())); } inline PyTypeObject const* get_pytype() const { return (&PyComplex_Type); } }; template <> struct to_python_value<std::complex<long double> const&> : detail::builtin_to_python { inline PyObject* operator()(std::complex<long double> const& x) const { return (::PyComplex_FromDoubles(x.real(), x.imag())); } inline PyTypeObject const* get_pytype() const { return (&PyComplex_Type); } }; namespace converter { template <> struct arg_to_python< std::complex<long double> > : handle<> { arg_to_python(std::complex<long double> const& x) : python::handle<>(::PyComplex_FromDoubles(x.real(), x.imag())) {} }; }
49001 namespace converter
49002 {
49003 void initialize_builtin_converters();
49004 }
49005 }}
49006 namespace boost { namespace python { namespace converter {
49007 PyObject* checked_downcast_impl(PyObject*, PyTypeObject*);
49008 template <class Object, PyTypeObject* pytype>
49009 struct pyobject_type
49010 {
49011 static bool check(PyObject* x)
49012 {
49013 return ::PyObject_IsInstance(x, (PyObject*)pytype);
49014 }
49015 static Object* checked_downcast(PyObject* x)
49016 {
49017 return python::downcast<Object>(
49018 (checked_downcast_impl)(x, pytype)
49019 );
49020 }
49021 static PyTypeObject const* get_pytype() { return pytype; }
49022 };
49023 }}}
49024 namespace boost { namespace python { namespace converter {
49025 template <class> struct pyobject_traits;
49026 template <>
49027 struct pyobject_traits<PyObject>
49028 {
49029 static bool check(PyObject*) { return true; }
49030 static PyObject* checked_downcast(PyObject* x) { return x; }
49031 static PyTypeObject const* get_pytype() { return 0; }
49032 };
49033 template <> struct pyobject_traits<PyTypeObject> : pyobject_type<PyTypeObject, &PyType_Type> {};
49034 template <> struct pyobject_traits<PyListObject> : pyobject_type<PyListObject, &PyList_Type> {};
49035 template <> struct pyobject_traits<PyIntObject> : pyobject_type<PyIntObject, &PyInt_Type> {};
49036 template <> struct pyobject_traits<PyLongObject> : pyobject_type<PyLongObject, &PyLong_Type> {};
49037 template <> struct pyobject_traits<PyDictObject> : pyobject_type<PyDictObject, &PyDict_Type> {};
49038 template <> struct pyobject_traits<PyTupleObject> : pyobject_type<PyTupleObject, &PyTuple_Type> {};
49039 }}}
49040 namespace boost { namespace python
49041 {
49042 namespace api
49043 {
49044 class object;
49045 }
49046 }}
49047 namespace boost { namespace python { namespace converter {
49048 template <class T>
49049 struct handle_object_manager_traits
49050 : pyobject_traits<typename T::element_type>
49051 {
49052 private:
49053 typedef pyobject_traits<typename T::element_type> base;
49054 public:
49055 static const bool is_specialized = true;
49056 static null_ok<typename T::element_type>* adopt(PyObject* p)
49057 {
49058 return python::allow_null(base::checked_downcast(p));
49059 }
49060 };
49061 template <class T>
49062 struct default_object_manager_traits
49063 {
49064 static const bool is_specialized = python::detail::is_borrowed_ptr<T>::value
49065 ;
49066 };
49067 template <class T>
49068 struct object_manager_traits
49069 : mpl::if_c<
49070 is_handle<T>::value
49071 , handle_object_manager_traits<T>
49072 , default_object_manager_traits<T>
49073 >::type
49074 {
49075 };
49076 template <class T>
49077 struct is_object_manager
49078 : mpl::bool_<object_manager_traits<T>::is_specialized>
49079 {
49080 };
49081 template <class T>
49082 struct is_reference_to_object_manager
49083 : mpl::false_
49084 {
49085 };
49086 template <class T>
49087 struct is_reference_to_object_manager<T&>
49088 : is_object_manager<T>
49089 {
49090 };
49091 template <class T>
49092 struct is_reference_to_object_manager<T const&>
49093 : is_object_manager<T>
49094 {
49095 };
49096 template <class T>
49097 struct is_reference_to_object_manager<T volatile&>
49098 : is_object_manager<T>
49099 {
49100 };
49101 template <class T>
49102 struct is_reference_to_object_manager<T const volatile&>
49103 : is_object_manager<T>
49104 {
49105 };
49106 }}}
49107 namespace boost { namespace python { namespace detail {
49108 template <class X_> struct value_is_shared_ptr { template <class T> struct is_shared_ptr : mpl::false_ { }; template < class T0 > struct is_shared_ptr< shared_ptr< T0 > > : mpl::true_ { }; static const bool value = is_shared_ptr< typename remove_cv< typename remove_reference<X_>::type >::type >::value; typedef mpl::bool_<value> type; };
49109 }}}
49110 namespace boost { namespace python {
49111 namespace detail
49112 {
49113 template <bool is_const_ref>
49114 struct object_manager_get_pytype
49115 {
49116 template <class U>
49117 static PyTypeObject const* get( U& (*)() =0)
49118 {
49119 return converter::object_manager_traits<U>::get_pytype();
49120 }
49121 };
49122 template <>
49123 struct object_manager_get_pytype<true>
49124 {
49125 template <class U>
49126 static PyTypeObject const* get( U const& (*)() =0)
49127 {
49128 return converter::object_manager_traits<U>::get_pytype();
49129 }
49130 };
49131 template <class T>
49132 struct object_manager_to_python_value
49133 {
49134 typedef typename value_arg<T>::type argument_type;
49135 PyObject* operator()(argument_type) const;
49136 typedef boost::mpl::bool_<is_handle<T>::value> is_t_handle;
49137 typedef boost::detail::indirect_traits::is_reference_to_const<T> is_t_const;
49138 PyTypeObject const* get_pytype() const {
49139 return get_pytype_aux((is_t_handle*)0);
49140 }
49141 inline static PyTypeObject const* get_pytype_aux(mpl::true_*) {return converter::object_manager_traits<T>::get_pytype();}
49142 inline static PyTypeObject const* get_pytype_aux(mpl::false_* )
49143 {
49144 return object_manager_get_pytype<is_t_const::value>::get((T(*)())0);
49145 }
49146 static const bool uses_registry = false;
49147 };
49148 template <class T>
49149 struct registry_to_python_value
49150 {
49151 typedef typename value_arg<T>::type argument_type;
49152 PyObject* operator()(argument_type) const;
49153 PyTypeObject const* get_pytype() const {return converter::registered<T>::converters.to_python_target_type();}
49154 static const bool uses_registry = true;
49155 };
49156 template <class T>
49157 struct shared_ptr_to_python_value
49158 {
49159 typedef typename value_arg<T>::type argument_type;
49160 PyObject* operator()(argument_type) const;
49161 PyTypeObject const* get_pytype() const {return get_pytype((boost::type<argument_type>*)0);}
49162 static const bool uses_registry = false;
49163 private:
49164 template <class U>
49165 PyTypeObject const* get_pytype(boost::type<shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
49166 template <class U>
49167 PyTypeObject const* get_pytype(boost::type<const shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
49168 };
49169 }
49170 template <class T>
49171 struct to_python_value
49172 : mpl::if_<
49173 detail::value_is_shared_ptr<T>
49174 , detail::shared_ptr_to_python_value<T>
49175 , typename mpl::if_<
49176 mpl::or_<
49177 converter::is_object_manager<T>
49178 , converter::is_reference_to_object_manager<T>
49179 >
49180 , detail::object_manager_to_python_value<T>
49181 , detail::registry_to_python_value<T>
49182 >::type
49183 >::type
49184 {
49185 };
49186 namespace detail
49187 {
49188 template <class T>
49189 inline PyObject* registry_to_python_value<T>::operator()(argument_type x) const
49190 {
49191 typedef converter::registered<argument_type> r;
49192 return converter::registered<argument_type>::converters.to_python(&x);
49193 }
49194 template <class T>
49195 inline PyObject* object_manager_to_python_value<T>::operator()(argument_type x) const
49196 {
49197 return python::upcast<PyObject>(
49198 python::xincref(
49199 get_managed_object(x, tag))
49200 );
49201 }
49202 template <class T>
49203 inline PyObject* shared_ptr_to_python_value<T>::operator()(argument_type x) const
49204 {
49205 return converter::shared_ptr_to_python(x);
49206 }
49207 }
49208 }}
49209 namespace boost { namespace python { namespace detail {
49210 typedef int void_result_to_python;
49211 template <bool void_return, bool member>
49212 struct invoke_tag_ {};
49213 template <class R, class F>
49214 struct invoke_tag
49215 : invoke_tag_<
49216 is_same<R,void>::value
49217 , is_member_function_pointer<F>::value
49218 >
49219 {
49220 };
49221 template <class RC, class F >
49222 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f )
49223 {
49224 return rc(f( ));
49225 }
49226 template <class RC, class F >
49227 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f )
49228 {
49229 f( );
49230 return none();
49231 }
49232 template <class RC, class F, class TC >
49233 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc )
49234 {
49235 return rc( (tc().*f)() );
49236 }
49237 template <class RC, class F, class TC >
49238 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc )
49239 {
49240 (tc().*f)();
49241 return none();
49242 }
49243 template <class RC, class F , class AC0>
49244 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 )
49245 {
49246 return rc(f( ac0 () ));
49247 }
49248 template <class RC, class F , class AC0>
49249 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 )
49250 {
49251 f( ac0 () );
49252 return none();
49253 }
49254 template <class RC, class F, class TC , class AC0>
49255 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 )
49256 {
49257 return rc( (tc().*f)( ac0 () ) );
49258 }
49259 template <class RC, class F, class TC , class AC0>
49260 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 )
49261 {
49262 (tc().*f)( ac0 () );
49263 return none();
49264 }
49265 template <class RC, class F , class AC0 , class AC1>
49266 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 )
49267 {
49268 return rc(f( ac0 () , ac1 () ));
49269 }
49270 template <class RC, class F , class AC0 , class AC1>
49271 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 )
49272 {
49273 f( ac0 () , ac1 () );
49274 return none();
49275 }
49276 template <class RC, class F, class TC , class AC0 , class AC1>
49277 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 )
49278 {
49279 return rc( (tc().*f)( ac0 () , ac1 () ) );
49280 }
49281 template <class RC, class F, class TC , class AC0 , class AC1>
49282 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 )
49283 {
49284 (tc().*f)( ac0 () , ac1 () );
49285 return none();
49286 }
49287 template <class RC, class F , class AC0 , class AC1 , class AC2>
49288 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 )
49289 {
49290 return rc(f( ac0 () , ac1 () , ac2 () ));
49291 }
49292 template <class RC, class F , class AC0 , class AC1 , class AC2>
49293 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 )
49294 {
49295 f( ac0 () , ac1 () , ac2 () );
49296 return none();
49297 }
49298 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2>
49299 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 )
49300 {
49301 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () ) );
49302 }
49303 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2>
49304 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 )
49305 {
49306 (tc().*f)( ac0 () , ac1 () , ac2 () );
49307 return none();
49308 }
49309 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3>
49310 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 )
49311 {
49312 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () ));
49313 }
49314 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3>
49315 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 )
49316 {
49317 f( ac0 () , ac1 () , ac2 () , ac3 () );
49318 return none();
49319 }
49320 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3>
49321 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 )
49322 {
49323 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () ) );
49324 }
49325 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3>
49326 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 )
49327 {
49328 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () );
49329 return none();
49330 }
49331 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4>
49332 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 )
49333 {
49334 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () ));
49335 }
49336 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4>
49337 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 )
49338 {
49339 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () );
49340 return none();
49341 }
49342 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4>
49343 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 )
49344 {
49345 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () ) );
49346 }
49347 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4>
49348 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 )
49349 {
49350 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () );
49351 return none();
49352 }
49353 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5>
49354 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 )
49355 {
49356 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () ));
49357 }
49358 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5>
49359 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 )
49360 {
49361 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () );
49362 return none();
49363 }
49364 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5>
49365 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 )
49366 {
49367 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () ) );
49368 }
49369 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5>
49370 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 )
49371 {
49372 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () );
49373 return none();
49374 }
49375 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6>
49376 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 )
49377 {
49378 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () ));
49379 }
49380 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6>
49381 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 )
49382 {
49383 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () );
49384 return none();
49385 }
49386 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6>
49387 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 )
49388 {
49389 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () ) );
49390 }
49391 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6>
49392 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 )
49393 {
49394 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () );
49395 return none();
49396 }
49397 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7>
49398 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 )
49399 {
49400 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () ));
49401 }
49402 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7>
49403 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 )
49404 {
49405 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () );
49406 return none();
49407 }
49408 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7>
49409 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 )
49410 {
49411 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () ) );
49412 }
49413 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7>
49414 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 )
49415 {
49416 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () );
49417 return none();
49418 }
49419 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8>
49420 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 )
49421 {
49422 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () ));
49423 }
49424 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8>
49425 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 )
49426 {
49427 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () );
49428 return none();
49429 }
49430 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8>
49431 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 )
49432 {
49433 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () ) );
49434 }
49435 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8>
49436 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 )
49437 {
49438 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () );
49439 return none();
49440 }
49441 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9>
49442 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 )
49443 {
49444 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () ));
49445 }
49446 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9>
49447 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 )
49448 {
49449 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () );
49450 return none();
49451 }
49452 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9>
49453 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 )
49454 {
49455 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () ) );
49456 }
49457 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9>
49458 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 )
49459 {
49460 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () );
49461 return none();
49462 }
49463 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10>
49464 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 )
49465 {
49466 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () ));
49467 }
49468 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10>
49469 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 )
49470 {
49471 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () );
49472 return none();
49473 }
49474 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10>
49475 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 )
49476 {
49477 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () ) );
49478 }
49479 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10>
49480 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 )
49481 {
49482 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () );
49483 return none();
49484 }
49485 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11>
49486 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 )
49487 {
49488 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () ));
49489 }
49490 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11>
49491 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 )
49492 {
49493 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () );
49494 return none();
49495 }
49496 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11>
49497 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 )
49498 {
49499 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () ) );
49500 }
49501 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11>
49502 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 )
49503 {
49504 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () );
49505 return none();
49506 }
49507 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12>
49508 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 )
49509 {
49510 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () ));
49511 }
49512 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12>
49513 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 )
49514 {
49515 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () );
49516 return none();
49517 }
49518 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12>
49519 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 )
49520 {
49521 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () ) );
49522 }
49523 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12>
49524 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 )
49525 {
49526 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () );
49527 return none();
49528 }
49529 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13>
49530 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 )
49531 {
49532 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () ));
49533 }
49534 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13>
49535 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 )
49536 {
49537 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () );
49538 return none();
49539 }
49540 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13>
49541 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 )
49542 {
49543 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () ) );
49544 }
49545 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13>
49546 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 )
49547 {
49548 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () );
49549 return none();
49550 }
49551 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13 , class AC14>
49552 inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 , AC14 & ac14 )
49553 {
49554 return rc(f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () , ac14 () ));
49555 }
49556 template <class RC, class F , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13 , class AC14>
49557 inline PyObject* invoke(invoke_tag_<true,false>, RC const&, F& f , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 , AC14 & ac14 )
49558 {
49559 f( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () , ac14 () );
49560 return none();
49561 }
49562 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13 , class AC14>
49563 inline PyObject* invoke(invoke_tag_<false,true>, RC const& rc, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 , AC14 & ac14 )
49564 {
49565 return rc( (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () , ac14 () ) );
49566 }
49567 template <class RC, class F, class TC , class AC0 , class AC1 , class AC2 , class AC3 , class AC4 , class AC5 , class AC6 , class AC7 , class AC8 , class AC9 , class AC10 , class AC11 , class AC12 , class AC13 , class AC14>
49568 inline PyObject* invoke(invoke_tag_<true,true>, RC const&, F& f, TC& tc , AC0 & ac0 , AC1 & ac1 , AC2 & ac2 , AC3 & ac3 , AC4 & ac4 , AC5 & ac5 , AC6 & ac6 , AC7 & ac7 , AC8 & ac8 , AC9 & ac9 , AC10 & ac10 , AC11 & ac11 , AC12 & ac12 , AC13 & ac13 , AC14 & ac14 )
49569 {
49570 (tc().*f)( ac0 () , ac1 () , ac2 () , ac3 () , ac4 () , ac5 () , ac6 () , ac7 () , ac8 () , ac9 () , ac10 () , ac11 () , ac12 () , ac13 () , ac14 () );
49571 return none();
49572 }
49573 }}}
49574 namespace boost { namespace mpl {
49575 struct nested_begin_end_tag;
49576 struct non_sequence_tag;
49577 template< typename Sequence > struct sequence_tag;
49578 }}
49579 namespace boost { namespace mpl { namespace aux {
49580 template< typename T, typename fallback_ = boost::mpl::bool_<true> > struct has_begin { struct gcc_3_2_wknd { template< typename U > static boost::mpl::aux::yes_tag test( boost::mpl::aux::type_wrapper<U> const volatile* , boost::mpl::aux::type_wrapper<typename U::begin>* = 0 ); static boost::mpl::aux::no_tag test(...); }; typedef boost::mpl::aux::type_wrapper<T> t_; static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) == sizeof(boost::mpl::aux::yes_tag); typedef boost::mpl::bool_<value> type; };
49581 }}}
49582 namespace boost { namespace mpl {
49583 namespace aux {
49584 template< typename Sequence >
49585 struct begin_type
49586 {
49587 typedef typename Sequence::begin type;
49588 };
49589 template< typename Sequence >
49590 struct end_type
49591 {
49592 typedef typename Sequence::end type;
49593 };
49594 }
49595 template< typename Tag >
49596 struct begin_impl
49597 {
49598 template< typename Sequence > struct apply
49599 {
49600 typedef typename eval_if<aux::has_begin<Sequence, true_>,
49601 aux::begin_type<Sequence>, void_>::type type;
49602 };
49603 };
49604 template< typename Tag >
49605 struct end_impl
49606 {
49607 template< typename Sequence > struct apply
49608 {
49609 typedef typename eval_if<aux::has_begin<Sequence, true_>,
49610 aux::end_type<Sequence>, void_>::type type;
49611 };
49612 };
49613 template<> struct begin_impl<nested_begin_end_tag> { template< typename Sequence > struct apply { typedef typename Sequence::begin type; }; };
49614 template<> struct end_impl<nested_begin_end_tag> { template< typename Sequence > struct apply { typedef typename Sequence::end type; }; };
49615 template<> struct begin_impl<non_sequence_tag> { template< typename Sequence > struct apply { typedef void_ type; }; };
49616 template<> struct end_impl<non_sequence_tag> { template< typename Sequence > struct apply { typedef void_ type; }; };
49617 template<> struct begin_impl<na> { template< typename Sequence > struct apply { typedef void_ type; }; };
49618 template<> struct end_impl<na> { template< typename Sequence > struct apply { typedef void_ type; }; };
49619 }}
49620 namespace boost { namespace mpl {
49621 namespace aux {
49622 template< bool has_tag_, bool has_begin_ >
49623 struct sequence_tag_impl
49624 {
49625 template< typename Sequence > struct result2_;
49626 };
49627 template<> struct sequence_tag_impl<true,true> { template< typename Sequence > struct result2_ { typedef typename Sequence::tag type; }; };
49628 template<> struct sequence_tag_impl<true,false> { template< typename Sequence > struct result2_ { typedef typename Sequence::tag type; }; };
49629 template<> struct sequence_tag_impl<false,true> { template< typename Sequence > struct result2_ { typedef nested_begin_end_tag type; }; };
49630 template<> struct sequence_tag_impl<false,false> { template< typename Sequence > struct result2_ { typedef non_sequence_tag type; }; };
49631 }
49632 template<
49633 typename Sequence = na
49634 >
49635 struct sequence_tag
49636 : aux::sequence_tag_impl<
49637 ::boost::mpl::aux::has_tag<Sequence>::value
49638 , ::boost::mpl::aux::has_begin<Sequence>::value
49639 >::template result2_<Sequence>
49640 {
49641 };
49642 template<> struct sequence_tag< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : sequence_tag< T1 > { }; }; template< typename Tag > struct lambda< sequence_tag< na > , Tag , int_<-1> > { typedef false_ is_le; typedef sequence_tag< na > result_; typedef sequence_tag< na > type; }; namespace aux { template< typename T1 > struct template_arity< sequence_tag< T1 > > : int_<1> { }; template<> struct template_arity< sequence_tag< na > > : int_<-1> { }; }
49643 }}
49644 namespace boost { namespace mpl {
49645 template<
49646 typename Sequence = na
49647 >
49648 struct begin
49649 {
49650 typedef typename sequence_tag<Sequence>::type tag_;
49651 typedef typename begin_impl< tag_ >
49652 ::template apply< Sequence >::type type;
49653
49654 };
49655 template<
49656 typename Sequence = na
49657 >
49658 struct end
49659 {
49660 typedef typename sequence_tag<Sequence>::type tag_;
49661 typedef typename end_impl< tag_ >
49662 ::template apply< Sequence >::type type;
49663
49664 };
49665 template<> struct begin< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : begin< T1 > { }; }; template< typename Tag > struct lambda< begin< na > , Tag , int_<-1> > { typedef false_ is_le; typedef begin< na > result_; typedef begin< na > type; }; namespace aux { template< typename T1 > struct template_arity< begin< T1 > > : int_<1> { }; template<> struct template_arity< begin< na > > : int_<-1> { }; }
49666 template<> struct end< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : end< T1 > { }; }; template< typename Tag > struct lambda< end< na > , Tag , int_<-1> > { typedef false_ is_le; typedef end< na > result_; typedef end< na > type; }; namespace aux { template< typename T1 > struct template_arity< end< T1 > > : int_<1> { }; template<> struct template_arity< end< na > > : int_<-1> { }; }
49667 }}
49668 namespace boost { namespace mpl {
49669 template<
49670 typename Tag1
49671 , typename Tag2
49672 >
49673 struct less_impl
49674 : if_c<
49675 ( Tag1::value
49676 > Tag2::value
49677 )
49678 , aux::cast2nd_impl< less_impl< Tag1,Tag1 >,Tag1, Tag2 >
49679 , aux::cast1st_impl< less_impl< Tag2,Tag2 >,Tag1, Tag2 >
49680 >::type
49681 {
49682 };
49683 template<> struct less_impl< na,na >
49684 {
49685 template< typename U1, typename U2 > struct apply
49686 {
49687 typedef apply type;
49688 static const int value = 0;
49689 };
49690 };
49691 template< typename Tag > struct less_impl< na,Tag >
49692 {
49693 template< typename U1, typename U2 > struct apply
49694 {
49695 typedef apply type;
49696 static const int value = 0;
49697 };
49698 };
49699 template< typename Tag > struct less_impl< Tag,na >
49700 {
49701 template< typename U1, typename U2 > struct apply
49702 {
49703 typedef apply type;
49704 static const int value = 0;
49705 };
49706 };
49707 template< typename T > struct less_tag
49708 {
49709 typedef typename T::tag type;
49710 };
49711 template<
49712 typename N1 = na
49713 , typename N2 = na
49714 >
49715 struct less
49716 : less_impl<
49717 typename less_tag<N1>::type
49718 , typename less_tag<N2>::type
49719 >::template apply< N1,N2 >::type
49720 {
49721
49722 };
49723 template<> struct less< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : less< T1 , T2 > { }; }; template< typename Tag > struct lambda< less< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef less< na , na > result_; typedef less< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< less< T1 , T2 > > : int_<2> { }; template<> struct template_arity< less< na , na > > : int_<-1> { }; }
49724 }}
49725 namespace boost { namespace mpl {
49726 template<>
49727 struct less_impl< integral_c_tag,integral_c_tag >
49728 {
49729 template< typename N1, typename N2 > struct apply
49730 : bool_< ( N2::value > N1::value ) >
49731 {
49732 };
49733 };
49734 }}
49735 namespace boost { namespace mpl {
49736 template< typename Tag > struct negate_impl;
49737 template< typename T > struct negate_tag
49738 {
49739 typedef typename T::tag type;
49740 };
49741 template<
49742 typename N = na
49743 >
49744 struct negate
49745 : negate_impl<
49746 typename negate_tag<N>::type
49747 >::template apply<N>::type
49748 {
49749
49750 };
49751 template<> struct negate< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : negate< T1 > { }; }; template< typename Tag > struct lambda< negate< na > , Tag , int_<-1> > { typedef false_ is_le; typedef negate< na > result_; typedef negate< na > type; }; namespace aux { template< typename T1 > struct template_arity< negate< T1 > > : int_<1> { }; template<> struct template_arity< negate< na > > : int_<-1> { }; }
49752 template<>
49753 struct negate_impl<integral_c_tag>
49754 {
49755 template< typename N > struct apply
49756 : integral_c< typename N::value_type, (-N::value) >
49757 {
49758 };
49759 };
49760 }}
49761 namespace boost { namespace mpl { namespace aux {
49762 template< long N > struct advance_forward;
49763 template<>
49764 struct advance_forward<0>
49765 {
49766 template< typename Iterator > struct apply
49767 {
49768 typedef Iterator iter0;
49769 typedef iter0 type;
49770 };
49771 };
49772 template<>
49773 struct advance_forward<1>
49774 {
49775 template< typename Iterator > struct apply
49776 {
49777 typedef Iterator iter0;
49778 typedef typename next<iter0>::type iter1;
49779 typedef iter1 type;
49780 };
49781 };
49782 template<>
49783 struct advance_forward<2>
49784 {
49785 template< typename Iterator > struct apply
49786 {
49787 typedef Iterator iter0;
49788 typedef typename next<iter0>::type iter1;
49789 typedef typename next<iter1>::type iter2;
49790 typedef iter2 type;
49791 };
49792 };
49793 template<>
49794 struct advance_forward<3>
49795 {
49796 template< typename Iterator > struct apply
49797 {
49798 typedef Iterator iter0;
49799 typedef typename next<iter0>::type iter1;
49800 typedef typename next<iter1>::type iter2;
49801 typedef typename next<iter2>::type iter3;
49802 typedef iter3 type;
49803 };
49804 };
49805 template<>
49806 struct advance_forward<4>
49807 {
49808 template< typename Iterator > struct apply
49809 {
49810 typedef Iterator iter0;
49811 typedef typename next<iter0>::type iter1;
49812 typedef typename next<iter1>::type iter2;
49813 typedef typename next<iter2>::type iter3;
49814 typedef typename next<iter3>::type iter4;
49815 typedef iter4 type;
49816 };
49817 };
49818 template< long N >
49819 struct advance_forward
49820 {
49821 template< typename Iterator > struct apply
49822 {
49823 typedef typename apply_wrap1<
49824 advance_forward<4>
49825 , Iterator
49826 >::type chunk_result_;
49827 typedef typename apply_wrap1<
49828 advance_forward<(
49829 (N - 4) < 0
49830 ? 0
49831 : N - 4
49832 )>
49833 , chunk_result_
49834 >::type type;
49835 };
49836 };
49837 }}}
49838 namespace boost { namespace mpl { namespace aux {
49839 template< long N > struct advance_backward;
49840 template<>
49841 struct advance_backward<0>
49842 {
49843 template< typename Iterator > struct apply
49844 {
49845 typedef Iterator iter0;
49846 typedef iter0 type;
49847 };
49848 };
49849 template<>
49850 struct advance_backward<1>
49851 {
49852 template< typename Iterator > struct apply
49853 {
49854 typedef Iterator iter0;
49855 typedef typename prior<iter0>::type iter1;
49856 typedef iter1 type;
49857 };
49858 };
49859 template<>
49860 struct advance_backward<2>
49861 {
49862 template< typename Iterator > struct apply
49863 {
49864 typedef Iterator iter0;
49865 typedef typename prior<iter0>::type iter1;
49866 typedef typename prior<iter1>::type iter2;
49867 typedef iter2 type;
49868 };
49869 };
49870 template<>
49871 struct advance_backward<3>
49872 {
49873 template< typename Iterator > struct apply
49874 {
49875 typedef Iterator iter0;
49876 typedef typename prior<iter0>::type iter1;
49877 typedef typename prior<iter1>::type iter2;
49878 typedef typename prior<iter2>::type iter3;
49879 typedef iter3 type;
49880 };
49881 };
49882 template<>
49883 struct advance_backward<4>
49884 {
49885 template< typename Iterator > struct apply
49886 {
49887 typedef Iterator iter0;
49888 typedef typename prior<iter0>::type iter1;
49889 typedef typename prior<iter1>::type iter2;
49890 typedef typename prior<iter2>::type iter3;
49891 typedef typename prior<iter3>::type iter4;
49892 typedef iter4 type;
49893 };
49894 };
49895 template< long N >
49896 struct advance_backward
49897 {
49898 template< typename Iterator > struct apply
49899 {
49900 typedef typename apply_wrap1<
49901 advance_backward<4>
49902 , Iterator
49903 >::type chunk_result_;
49904 typedef typename apply_wrap1<
49905 advance_backward<(
49906 (N - 4) < 0
49907 ? 0
49908 : N - 4
49909 )>
49910 , chunk_result_
49911 >::type type;
49912 };
49913 };
49914 }}}
49915 namespace boost { namespace mpl {
49916 template< typename Tag >
49917 struct advance_impl
49918 {
49919 template< typename Iterator, typename N > struct apply
49920 {
49921 typedef typename less< N,long_<0> >::type backward_;
49922 typedef typename if_< backward_, negate<N>, N >::type offset_;
49923 typedef typename if_<
49924 backward_
49925 , aux::advance_backward< offset_::value >
49926 , aux::advance_forward< offset_::value >
49927 >::type f_;
49928 typedef typename apply_wrap1<f_,Iterator>::type type;
49929 };
49930 };
49931 template<
49932 typename Iterator = na
49933 , typename N = na
49934 >
49935 struct advance
49936 : advance_impl< typename tag<Iterator>::type >
49937 ::template apply<Iterator,N>
49938 {
49939 };
49940 template<
49941 typename Iterator
49942 , long N
49943 >
49944 struct advance_c
49945 : advance_impl< typename tag<Iterator>::type >
49946 ::template apply<Iterator,long_<N> >
49947 {
49948 };
49949 template<> struct advance< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : advance< T1 , T2 > { }; }; template< typename Tag > struct lambda< advance< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef advance< na , na > result_; typedef advance< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< advance< T1 , T2 > > : int_<2> { }; template<> struct template_arity< advance< na , na > > : int_<-1> { }; }
49950 }}
49951 namespace boost { namespace mpl { namespace aux {
49952 template< typename T > struct msvc_type
49953 {
49954 typedef typename T::type type;
49955 };
49956 template<> struct msvc_type<int>
49957 {
49958 typedef int type;
49959 };
49960 }}}
49961 namespace boost { namespace mpl {
49962 template<
49963 typename Iterator = na
49964 >
49965 struct deref
49966 {
49967 typedef typename Iterator::type type;
49968
49969 };
49970 template<> struct deref< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : deref< T1 > { }; }; template< typename Tag > struct lambda< deref< na > , Tag , int_<-1> > { typedef false_ is_le; typedef deref< na > result_; typedef deref< na > type; }; namespace aux { template< typename T1 > struct template_arity< deref< T1 > > : int_<1> { }; template<> struct template_arity< deref< na > > : int_<-1> { }; }
49971 }}
49972 namespace boost { namespace mpl {
49973 template< typename Tag >
49974 struct at_impl
49975 {
49976 template< typename Sequence, typename N > struct apply
49977 {
49978 typedef typename advance<
49979 typename begin<Sequence>::type
49980 , N
49981 >::type iter_;
49982 typedef typename deref<iter_>::type type;
49983 };
49984 };
49985 template<> struct at_impl<non_sequence_tag> {};
49986 }}
49987 namespace boost { namespace mpl {
49988 template<
49989 typename Sequence = na
49990 , typename N = na
49991 >
49992 struct at
49993 : at_impl< typename sequence_tag<Sequence>::type >
49994 ::template apply< Sequence,N >
49995 {
49996
49997 };
49998 template<
49999 typename Sequence
50000 , long N
50001 >
50002 struct at_c
50003 : at_impl< typename sequence_tag<Sequence>::type >
50004 ::template apply< Sequence,mpl::long_<N> >
50005 {
50006 };
50007 template<> struct at< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : at< T1 , T2 > { }; }; template< typename Tag > struct lambda< at< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef at< na , na > result_; typedef at< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< at< T1 , T2 > > : int_<2> { }; template<> struct template_arity< at< na , na > > : int_<-1> { }; }
50008 }}
50009 namespace boost { namespace mpl { namespace aux {
50010 template< typename T, typename fallback_ = boost::mpl::bool_<false> > struct has_size { struct gcc_3_2_wknd { template< typename U > static boost::mpl::aux::yes_tag test( boost::mpl::aux::type_wrapper<U> const volatile* , boost::mpl::aux::type_wrapper<typename U::size>* = 0 ); static boost::mpl::aux::no_tag test(...); }; typedef boost::mpl::aux::type_wrapper<T> t_; static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) == sizeof(boost::mpl::aux::yes_tag); typedef boost::mpl::bool_<value> type; };
50011 }}}
50012 namespace boost { namespace mpl {
50013 namespace aux {
50014 template< typename Sequence > struct O1_size_impl
50015 : Sequence::size
50016 {
50017 };
50018 }
50019 template< typename Tag >
50020 struct O1_size_impl
50021 {
50022 template< typename Sequence > struct apply
50023 : if_<
50024 aux::has_size<Sequence>
50025 , aux::O1_size_impl<Sequence>
50026 , long_<-1>
50027 >::type
50028 {
50029 };
50030 };
50031 }}
50032 namespace boost { namespace mpl {
50033 template<
50034 typename Sequence = na
50035 >
50036 struct O1_size
50037 : O1_size_impl< typename sequence_tag<Sequence>::type >
50038 ::template apply< Sequence >
50039 {
50040
50041 };
50042 template<> struct O1_size< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : O1_size< T1 > { }; }; template< typename Tag > struct lambda< O1_size< na > , Tag , int_<-1> > { typedef false_ is_le; typedef O1_size< na > result_; typedef O1_size< na > type; }; namespace aux { template< typename T1 > struct template_arity< O1_size< T1 > > : int_<1> { }; template<> struct template_arity< O1_size< na > > : int_<-1> { }; }
50043 }}
50044 namespace boost { namespace mpl { namespace aux {
50045 template<
50046 int N
50047 , typename First
50048 , typename Last
50049 , typename State
50050 , typename ForwardOp
50051 >
50052 struct iter_fold_impl;
50053 template<
50054 typename First
50055 , typename Last
50056 , typename State
50057 , typename ForwardOp
50058 >
50059 struct iter_fold_impl< 0,First,Last,State,ForwardOp >
50060 {
50061 typedef First iter0;
50062 typedef State state0;
50063 typedef state0 state;
50064 typedef iter0 iterator;
50065 };
50066 template<
50067 typename First
50068 , typename Last
50069 , typename State
50070 , typename ForwardOp
50071 >
50072 struct iter_fold_impl< 1,First,Last,State,ForwardOp >
50073 {
50074 typedef First iter0;
50075 typedef State state0;
50076 typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
50077 typedef typename mpl::next<iter0>::type iter1;
50078 typedef state1 state;
50079 typedef iter1 iterator;
50080 };
50081 template<
50082 typename First
50083 , typename Last
50084 , typename State
50085 , typename ForwardOp
50086 >
50087 struct iter_fold_impl< 2,First,Last,State,ForwardOp >
50088 {
50089 typedef First iter0;
50090 typedef State state0;
50091 typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
50092 typedef typename mpl::next<iter0>::type iter1;
50093 typedef typename apply2< ForwardOp,state1,iter1 >::type state2;
50094 typedef typename mpl::next<iter1>::type iter2;
50095 typedef state2 state;
50096 typedef iter2 iterator;
50097 };
50098 template<
50099 typename First
50100 , typename Last
50101 , typename State
50102 , typename ForwardOp
50103 >
50104 struct iter_fold_impl< 3,First,Last,State,ForwardOp >
50105 {
50106 typedef First iter0;
50107 typedef State state0;
50108 typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
50109 typedef typename mpl::next<iter0>::type iter1;
50110 typedef typename apply2< ForwardOp,state1,iter1 >::type state2;
50111 typedef typename mpl::next<iter1>::type iter2;
50112 typedef typename apply2< ForwardOp,state2,iter2 >::type state3;
50113 typedef typename mpl::next<iter2>::type iter3;
50114 typedef state3 state;
50115 typedef iter3 iterator;
50116 };
50117 template<
50118 typename First
50119 , typename Last
50120 , typename State
50121 , typename ForwardOp
50122 >
50123 struct iter_fold_impl< 4,First,Last,State,ForwardOp >
50124 {
50125 typedef First iter0;
50126 typedef State state0;
50127 typedef typename apply2< ForwardOp,state0,iter0 >::type state1;
50128 typedef typename mpl::next<iter0>::type iter1;
50129 typedef typename apply2< ForwardOp,state1,iter1 >::type state2;
50130 typedef typename mpl::next<iter1>::type iter2;
50131 typedef typename apply2< ForwardOp,state2,iter2 >::type state3;
50132 typedef typename mpl::next<iter2>::type iter3;
50133 typedef typename apply2< ForwardOp,state3,iter3 >::type state4;
50134 typedef typename mpl::next<iter3>::type iter4;
50135 typedef state4 state;
50136 typedef iter4 iterator;
50137 };
50138 template<
50139 int N
50140 , typename First
50141 , typename Last
50142 , typename State
50143 , typename ForwardOp
50144 >
50145 struct iter_fold_impl
50146 {
50147 typedef iter_fold_impl<
50148 4
50149 , First
50150 , Last
50151 , State
50152 , ForwardOp
50153 > chunk_;
50154 typedef iter_fold_impl<
50155 ( (N - 4) < 0 ? 0 : N - 4 )
50156 , typename chunk_::iterator
50157 , Last
50158 , typename chunk_::state
50159 , ForwardOp
50160 > res_;
50161 typedef typename res_::state state;
50162 typedef typename res_::iterator iterator;
50163 };
50164 template<
50165 typename First
50166 , typename Last
50167 , typename State
50168 , typename ForwardOp
50169 >
50170 struct iter_fold_impl< -1,First,Last,State,ForwardOp >
50171 : iter_fold_impl<
50172 -1
50173 , typename mpl::next<First>::type
50174 , Last
50175 , typename apply2< ForwardOp,State,First >::type
50176 , ForwardOp
50177 >
50178 {
50179 };
50180 template<
50181 typename Last
50182 , typename State
50183 , typename ForwardOp
50184 >
50185 struct iter_fold_impl< -1,Last,Last,State,ForwardOp >
50186 {
50187 typedef State state;
50188 typedef Last iterator;
50189 };
50190 }}}
50191 namespace boost { namespace mpl {
50192 template<
50193 typename Sequence = na
50194 , typename State = na
50195 , typename ForwardOp = na
50196 >
50197 struct iter_fold
50198 {
50199 typedef typename aux::iter_fold_impl<
50200 ::boost::mpl::O1_size<Sequence>::value
50201 , typename begin<Sequence>::type
50202 , typename end<Sequence>::type
50203 , State
50204 , typename lambda<ForwardOp>::type
50205 >::state type;
50206
50207 };
50208 template<> struct iter_fold< na , na , na > { template< typename T1 , typename T2 , typename T3 , typename T4 =na , typename T5 =na > struct apply : iter_fold< T1 , T2 , T3 > { }; }; template< typename Tag > struct lambda< iter_fold< na , na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef iter_fold< na , na , na > result_; typedef iter_fold< na , na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 > struct template_arity< iter_fold< T1 , T2 , T3 > > : int_<3> { }; template<> struct template_arity< iter_fold< na , na , na > > : int_<-1> { }; }
50209 }}
50210 namespace boost { namespace mpl {
50211 struct iterator_range_tag;
50212 template<
50213 typename First = na
50214 , typename Last = na
50215 >
50216 struct iterator_range
50217 {
50218 typedef iterator_range_tag tag;
50219 typedef iterator_range type;
50220 typedef First begin;
50221 typedef Last end;
50222
50223 };
50224 template<> struct iterator_range< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : iterator_range< T1 , T2 > { }; }; template< typename Tag > struct lambda< iterator_range< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef iterator_range< na , na > result_; typedef iterator_range< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< iterator_range< T1 , T2 > > : int_<2> { }; template<> struct template_arity< iterator_range< na , na > > : int_<-1> { }; }
50225 }}
50226 namespace boost { namespace mpl {
50227 template< typename Tag > struct distance_impl
50228 {
50229 template< typename First, typename Last > struct apply
50230 : aux::msvc_eti_base< typename iter_fold<
50231 iterator_range<First,Last>
50232 , mpl::long_<0>
50233 , next<>
50234 >::type >
50235 {
50236 };
50237 };
50238 template<
50239 typename First = na
50240 , typename Last = na
50241 >
50242 struct distance
50243 : distance_impl< typename tag<First>::type >
50244 ::template apply<First, Last>
50245 {
50246
50247 };
50248 template<> struct distance< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : distance< T1 , T2 > { }; }; template< typename Tag > struct lambda< distance< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef distance< na , na > result_; typedef distance< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< distance< T1 , T2 > > : int_<2> { }; template<> struct template_arity< distance< na , na > > : int_<-1> { }; }
50249 }}
50250 namespace boost { namespace mpl {
50251 template< typename Tag >
50252 struct size_impl
50253 {
50254 template< typename Sequence > struct apply
50255 : distance<
50256 typename begin<Sequence>::type
50257 , typename end<Sequence>::type
50258 >
50259 {
50260 };
50261 };
50262 template<> struct size_impl<non_sequence_tag> {};
50263 }}
50264 namespace boost { namespace mpl {
50265 template<
50266 typename Sequence = na
50267 >
50268 struct size
50269 : aux::msvc_eti_base<
50270 typename size_impl< typename sequence_tag<Sequence>::type >
50271 ::template apply< Sequence >::type
50272 >::type
50273 {
50274
50275 };
50276 template<> struct size< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : size< T1 > { }; }; template< typename Tag > struct lambda< size< na > , Tag , int_<-1> > { typedef false_ is_le; typedef size< na > result_; typedef size< na > type; }; namespace aux { template< typename T1 > struct template_arity< size< T1 > > : int_<1> { }; template<> struct template_arity< size< na > > : int_<-1> { }; }
50277 }}
50278 namespace boost { namespace python { namespace detail {
50279 struct signature_element
50280 {
50281 char const* basename;
50282 converter::pytype_function pytype_f;
50283 bool lvalue;
50284 };
50285 struct py_func_sig_info
50286 {
50287 signature_element const *signature;
50288 signature_element const *ret;
50289 };
50290 template <unsigned> struct signature_arity;
50291 template <>
50292 struct signature_arity<0>
50293 {
50294 template <class Sig>
50295 struct impl
50296 {
50297 static signature_element const* elements()
50298 {
50299 static signature_element const result[0 +2] = {
50300 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50301 {0,0,0}
50302 };
50303 return result;
50304 }
50305 };
50306 };
50307 template <>
50308 struct signature_arity<1>
50309 {
50310 template <class Sig>
50311 struct impl
50312 {
50313 static signature_element const* elements()
50314 {
50315 static signature_element const result[1 +2] = {
50316 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50317 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50318 {0,0,0}
50319 };
50320 return result;
50321 }
50322 };
50323 };
50324 template <>
50325 struct signature_arity<2>
50326 {
50327 template <class Sig>
50328 struct impl
50329 {
50330 static signature_element const* elements()
50331 {
50332 static signature_element const result[2 +2] = {
50333 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50334 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50335 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50336 {0,0,0}
50337 };
50338 return result;
50339 }
50340 };
50341 };
50342 template <>
50343 struct signature_arity<3>
50344 {
50345 template <class Sig>
50346 struct impl
50347 {
50348 static signature_element const* elements()
50349 {
50350 static signature_element const result[3 +2] = {
50351 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50352 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50353 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50354 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50355 {0,0,0}
50356 };
50357 return result;
50358 }
50359 };
50360 };
50361 template <>
50362 struct signature_arity<4>
50363 {
50364 template <class Sig>
50365 struct impl
50366 {
50367 static signature_element const* elements()
50368 {
50369 static signature_element const result[4 +2] = {
50370 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50371 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50372 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50373 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50374 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50375 {0,0,0}
50376 };
50377 return result;
50378 }
50379 };
50380 };
50381 template <>
50382 struct signature_arity<5>
50383 {
50384 template <class Sig>
50385 struct impl
50386 {
50387 static signature_element const* elements()
50388 {
50389 static signature_element const result[5 +2] = {
50390 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50391 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50392 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50393 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50394 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50395 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50396 {0,0,0}
50397 };
50398 return result;
50399 }
50400 };
50401 };
50402 template <>
50403 struct signature_arity<6>
50404 {
50405 template <class Sig>
50406 struct impl
50407 {
50408 static signature_element const* elements()
50409 {
50410 static signature_element const result[6 +2] = {
50411 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50412 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50413 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50414 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50415 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50416 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50417 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50418 {0,0,0}
50419 };
50420 return result;
50421 }
50422 };
50423 };
50424 template <>
50425 struct signature_arity<7>
50426 {
50427 template <class Sig>
50428 struct impl
50429 {
50430 static signature_element const* elements()
50431 {
50432 static signature_element const result[7 +2] = {
50433 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50434 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50435 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50436 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50437 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50438 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50439 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50440 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50441 {0,0,0}
50442 };
50443 return result;
50444 }
50445 };
50446 };
50447 template <>
50448 struct signature_arity<8>
50449 {
50450 template <class Sig>
50451 struct impl
50452 {
50453 static signature_element const* elements()
50454 {
50455 static signature_element const result[8 +2] = {
50456 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50457 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50458 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50459 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50460 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50461 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50462 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50463 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50464 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50465 {0,0,0}
50466 };
50467 return result;
50468 }
50469 };
50470 };
50471 template <>
50472 struct signature_arity<9>
50473 {
50474 template <class Sig>
50475 struct impl
50476 {
50477 static signature_element const* elements()
50478 {
50479 static signature_element const result[9 +2] = {
50480 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50481 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50482 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50483 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50484 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50485 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50486 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50487 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50488 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50489 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50490 {0,0,0}
50491 };
50492 return result;
50493 }
50494 };
50495 };
50496 template <>
50497 struct signature_arity<10>
50498 {
50499 template <class Sig>
50500 struct impl
50501 {
50502 static signature_element const* elements()
50503 {
50504 static signature_element const result[10 +2] = {
50505 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50506 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50507 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50508 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50509 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50510 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50511 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50512 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50513 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50514 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50515 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50516 {0,0,0}
50517 };
50518 return result;
50519 }
50520 };
50521 };
50522 template <>
50523 struct signature_arity<11>
50524 {
50525 template <class Sig>
50526 struct impl
50527 {
50528 static signature_element const* elements()
50529 {
50530 static signature_element const result[11 +2] = {
50531 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50532 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50533 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50534 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50535 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50536 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50537 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50538 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50539 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50540 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50541 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50542 { type_id<typename mpl::at_c<Sig,11>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,11>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,11>::type>::value },
50543 {0,0,0}
50544 };
50545 return result;
50546 }
50547 };
50548 };
50549 template <>
50550 struct signature_arity<12>
50551 {
50552 template <class Sig>
50553 struct impl
50554 {
50555 static signature_element const* elements()
50556 {
50557 static signature_element const result[12 +2] = {
50558 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50559 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50560 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50561 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50562 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50563 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50564 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50565 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50566 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50567 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50568 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50569 { type_id<typename mpl::at_c<Sig,11>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,11>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,11>::type>::value },
50570 { type_id<typename mpl::at_c<Sig,12>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,12>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,12>::type>::value },
50571 {0,0,0}
50572 };
50573 return result;
50574 }
50575 };
50576 };
50577 template <>
50578 struct signature_arity<13>
50579 {
50580 template <class Sig>
50581 struct impl
50582 {
50583 static signature_element const* elements()
50584 {
50585 static signature_element const result[13 +2] = {
50586 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50587 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50588 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50589 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50590 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50591 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50592 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50593 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50594 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50595 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50596 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50597 { type_id<typename mpl::at_c<Sig,11>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,11>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,11>::type>::value },
50598 { type_id<typename mpl::at_c<Sig,12>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,12>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,12>::type>::value },
50599 { type_id<typename mpl::at_c<Sig,13>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,13>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,13>::type>::value },
50600 {0,0,0}
50601 };
50602 return result;
50603 }
50604 };
50605 };
50606 template <>
50607 struct signature_arity<14>
50608 {
50609 template <class Sig>
50610 struct impl
50611 {
50612 static signature_element const* elements()
50613 {
50614 static signature_element const result[14 +2] = {
50615 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50616 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50617 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50618 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50619 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50620 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50621 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50622 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50623 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50624 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50625 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50626 { type_id<typename mpl::at_c<Sig,11>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,11>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,11>::type>::value },
50627 { type_id<typename mpl::at_c<Sig,12>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,12>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,12>::type>::value },
50628 { type_id<typename mpl::at_c<Sig,13>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,13>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,13>::type>::value },
50629 { type_id<typename mpl::at_c<Sig,14>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,14>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,14>::type>::value },
50630 {0,0,0}
50631 };
50632 return result;
50633 }
50634 };
50635 };
50636 template <>
50637 struct signature_arity<15>
50638 {
50639 template <class Sig>
50640 struct impl
50641 {
50642 static signature_element const* elements()
50643 {
50644 static signature_element const result[15 +2] = {
50645 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50646 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50647 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50648 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50649 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50650 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50651 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50652 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50653 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50654 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50655 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50656 { type_id<typename mpl::at_c<Sig,11>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,11>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,11>::type>::value },
50657 { type_id<typename mpl::at_c<Sig,12>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,12>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,12>::type>::value },
50658 { type_id<typename mpl::at_c<Sig,13>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,13>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,13>::type>::value },
50659 { type_id<typename mpl::at_c<Sig,14>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,14>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,14>::type>::value },
50660 { type_id<typename mpl::at_c<Sig,15>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,15>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,15>::type>::value },
50661 {0,0,0}
50662 };
50663 return result;
50664 }
50665 };
50666 };
50667 template <>
50668 struct signature_arity<16>
50669 {
50670 template <class Sig>
50671 struct impl
50672 {
50673 static signature_element const* elements()
50674 {
50675 static signature_element const result[16 +2] = {
50676 { type_id<typename mpl::at_c<Sig,0>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,0>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,0>::type>::value },
50677 { type_id<typename mpl::at_c<Sig,1>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,1>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,1>::type>::value },
50678 { type_id<typename mpl::at_c<Sig,2>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,2>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,2>::type>::value },
50679 { type_id<typename mpl::at_c<Sig,3>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,3>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,3>::type>::value },
50680 { type_id<typename mpl::at_c<Sig,4>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,4>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,4>::type>::value },
50681 { type_id<typename mpl::at_c<Sig,5>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,5>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,5>::type>::value },
50682 { type_id<typename mpl::at_c<Sig,6>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,6>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,6>::type>::value },
50683 { type_id<typename mpl::at_c<Sig,7>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,7>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,7>::type>::value },
50684 { type_id<typename mpl::at_c<Sig,8>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,8>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,8>::type>::value },
50685 { type_id<typename mpl::at_c<Sig,9>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,9>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,9>::type>::value },
50686 { type_id<typename mpl::at_c<Sig,10>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,10>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,10>::type>::value },
50687 { type_id<typename mpl::at_c<Sig,11>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,11>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,11>::type>::value },
50688 { type_id<typename mpl::at_c<Sig,12>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,12>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,12>::type>::value },
50689 { type_id<typename mpl::at_c<Sig,13>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,13>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,13>::type>::value },
50690 { type_id<typename mpl::at_c<Sig,14>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,14>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,14>::type>::value },
50691 { type_id<typename mpl::at_c<Sig,15>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,15>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,15>::type>::value },
50692 { type_id<typename mpl::at_c<Sig,16>::type>().name() , &converter::expected_pytype_for_arg<typename mpl::at_c<Sig,16>::type>::get_pytype , indirect_traits::is_reference_to_non_const<typename mpl::at_c<Sig,16>::type>::value },
50693 {0,0,0}
50694 };
50695 return result;
50696 }
50697 };
50698 };
50699 template <class Sig>
50700 struct signature_base_select
50701 {
50702 enum { arity = mpl::size<Sig>::value - 1 };
50703 typedef typename signature_arity<arity>::template impl<Sig> type;
50704 };
50705 template <class Sig>
50706 struct signature
50707 : signature_base_select<Sig>::type
50708 {
50709 };
50710 }}}
50711 namespace boost { namespace python { namespace converter {
50712 struct registration;
50713 void* get_lvalue_from_python(
50714 PyObject* source, registration const&);
50715 bool implicit_rvalue_convertible_from_python(
50716 PyObject* source, registration const&);
50717 rvalue_from_python_stage1_data rvalue_from_python_stage1(
50718 PyObject* source, registration const&);
50719 void* rvalue_from_python_stage2(
50720 PyObject* source, rvalue_from_python_stage1_data&, registration const&);
50721 void* rvalue_result_from_python(
50722 PyObject*, rvalue_from_python_stage1_data&);
50723 void* reference_result_from_python(PyObject*, registration const&);
50724 void* pointer_result_from_python(PyObject*, registration const&);
50725 void void_result_from_python(PyObject*);
50726 void throw_no_pointer_from_python(PyObject*, registration const&);
50727 void throw_no_reference_from_python(PyObject*, registration const&);
50728 }}}
50729 namespace boost { namespace python { namespace detail {
50730 template <class U>
50731 inline U& void_ptr_to_reference(void const volatile* p, U&(*)())
50732 {
50733 return *(U*)p;
50734 }
50735 template <class T>
50736 inline void write_void_ptr(void const volatile* storage, void* ptr, T*)
50737 {
50738 *(T**)storage = (T*)ptr;
50739 }
50740 template <class U>
50741 inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U&(*)())
50742 {
50743 typedef typename remove_cv<U>::type u_stripped;
50744 write_void_ptr(storage, ptr, u_stripped(0));
50745 }
50746 }}}
50747 namespace boost { namespace python {
50748 namespace api
50749 {
50750 class object;
50751 }
50752 using api::object;
50753 }}
50754 namespace boost { namespace python { namespace detail {
50755 template <class T, class U>
50756 struct dependent
50757 {
50758 typedef T type;
50759 };
50760 }}}
50761 namespace boost { namespace python {
50762 template <class T>
50763 struct back_reference
50764 {
50765 private:
50766 typedef typename detail::dependent<object,T>::type source_t;
50767 public:
50768 typedef T type;
50769 back_reference(PyObject*, T);
50770 source_t const& source() const;
50771 T get() const;
50772 private:
50773 source_t m_source;
50774 T m_value;
50775 };
50776 template<typename T>
50777 class is_back_reference
50778 {
50779 public:
50780 static const bool value = false;
50781 };
50782 template<typename T>
50783 class is_back_reference<back_reference<T> >
50784 {
50785 public:
50786 static const bool value = true;
50787 };
50788 template <class T>
50789 back_reference<T>::back_reference(PyObject* p, T x)
50790 : m_source(detail::borrowed_reference(p))
50791 , m_value(x)
50792 {
50793 }
50794 template <class T>
50795 typename back_reference<T>::source_t const& back_reference<T>::source() const
50796 {
50797 return m_source;
50798 }
50799 template <class T>
50800 T back_reference<T>::get() const
50801 {
50802 return m_value;
50803 }
50804 }}
50805 namespace boost { namespace python { namespace detail {
50806 template <class T, class Arg>
50807 void construct_pointee(void* storage, Arg& x
50808 , T const volatile*
50809 )
50810 {
50811 new (storage) T(x);
50812 }
50813 template <class T, class Arg>
50814 void construct_referent_impl(void* storage, Arg& x, T&(*)())
50815 {
50816 construct_pointee(storage, x, (T*)0);
50817 }
50818 template <class T, class Arg>
50819 void construct_referent(void* storage, Arg const& x, T(*tag)() = 0)
50820 {
50821 construct_referent_impl(storage, x, tag);
50822 }
50823 template <class T, class Arg>
50824 void construct_referent(void* storage, Arg& x, T(*tag)() = 0)
50825 {
50826 construct_referent_impl(storage, x, tag);
50827 }
50828 }}}
50829 namespace boost { namespace python { namespace converter {
50830 template <class T>
50831 struct object_manager_value_arg_from_python
50832 {
50833 typedef T result_type;
50834 object_manager_value_arg_from_python(PyObject*);
50835 bool convertible() const;
50836 T operator()() const;
50837 private:
50838 PyObject* m_source;
50839 };
50840 template <class Ref>
50841 struct object_manager_ref_arg_from_python
50842 {
50843 typedef Ref result_type;
50844 object_manager_ref_arg_from_python(PyObject*);
50845 bool convertible() const;
50846 Ref operator()() const;
50847 ~object_manager_ref_arg_from_python();
50848 private:
50849 typename python::detail::referent_storage<Ref>::type m_result;
50850 };
50851 template <class T>
50852 inline object_manager_value_arg_from_python<T>::object_manager_value_arg_from_python(PyObject* x)
50853 : m_source(x)
50854 {
50855 }
50856 template <class T>
50857 inline bool object_manager_value_arg_from_python<T>::convertible() const
50858 {
50859 return object_manager_traits<T>::check(m_source);
50860 }
50861 template <class T>
50862 inline T object_manager_value_arg_from_python<T>::operator()() const
50863 {
50864 return T(python::detail::borrowed_reference(m_source));
50865 }
50866 template <class Ref>
50867 inline object_manager_ref_arg_from_python<Ref>::object_manager_ref_arg_from_python(PyObject* x)
50868 {
50869 python::detail::construct_referent<Ref>(&m_result.bytes, (python::detail::borrowed_reference)x);
50870 }
50871 template <class Ref>
50872 inline object_manager_ref_arg_from_python<Ref>::~object_manager_ref_arg_from_python()
50873 {
50874 python::detail::destroy_referent<Ref>(this->m_result.bytes);
50875 }
50876 namespace detail
50877 {
50878 template <class T>
50879 inline bool object_manager_ref_check(T const& x)
50880 {
50881 return object_manager_traits<T>::check(get_managed_object(x, tag));
50882 }
50883 }
50884 template <class Ref>
50885 inline bool object_manager_ref_arg_from_python<Ref>::convertible() const
50886 {
50887 return detail::object_manager_ref_check(
50888 python::detail::void_ptr_to_reference(this->m_result.bytes, (Ref(*)())0));
50889 }
50890 template <class Ref>
50891 inline Ref object_manager_ref_arg_from_python<Ref>::operator()() const
50892 {
50893 return python::detail::void_ptr_to_reference(
50894 this->m_result.bytes, (Ref(*)())0);
50895 }
50896 }}}
50897 namespace boost { namespace python
50898 {
50899 template <class T> struct arg_from_python;
50900 }}
50901 namespace boost { namespace python { namespace converter {
50902 template <class T>
50903 struct pointer_cref_arg_from_python
50904 {
50905 typedef T result_type;
50906 pointer_cref_arg_from_python(PyObject*);
50907 T operator()() const;
50908 bool convertible() const;
50909 private:
50910 typename python::detail::referent_storage<T>::type m_result;
50911 };
50912 struct arg_lvalue_from_python_base
50913 {
50914 public:
50915 arg_lvalue_from_python_base(void* result);
50916 bool convertible() const;
50917 protected:
50918 void*const& result() const;
50919 private:
50920 void* m_result;
50921 };
50922 template <class T>
50923 struct pointer_arg_from_python : arg_lvalue_from_python_base
50924 {
50925 typedef T result_type;
50926 pointer_arg_from_python(PyObject*);
50927 T operator()() const;
50928 };
50929 template <class T>
50930 struct reference_arg_from_python : arg_lvalue_from_python_base
50931 {
50932 typedef T result_type;
50933 reference_arg_from_python(PyObject*);
50934 T operator()() const;
50935 };
50936 template <class T>
50937 struct arg_rvalue_from_python
50938 {
50939 typedef typename boost::add_reference<
50940 T
50941 >::type result_type;
50942 arg_rvalue_from_python(PyObject*);
50943 bool convertible() const;
50944 typename arg_rvalue_from_python<T>::
50945 result_type operator()();
50946 private:
50947 rvalue_from_python_data<result_type> m_data;
50948 PyObject* m_source;
50949 };
50950 template <class T>
50951 struct back_reference_arg_from_python
50952 : boost::python::arg_from_python<typename T::type>
50953 {
50954 typedef T result_type;
50955 back_reference_arg_from_python(PyObject*);
50956 T operator()();
50957 private:
50958 typedef boost::python::arg_from_python<typename T::type> base;
50959 PyObject* m_source;
50960 };
50961 template <class C, class T, class F>
50962 struct if_2
50963 {
50964 typedef typename mpl::eval_if<C, mpl::identity<T>, F>::type type;
50965 };
50966 template <class T>
50967 struct select_arg_from_python
50968 {
50969 typedef typename if_2<
50970 is_object_manager<T>
50971 , object_manager_value_arg_from_python<T>
50972 , if_2<
50973 is_reference_to_object_manager<T>
50974 , object_manager_ref_arg_from_python<T>
50975 , if_2<
50976 is_pointer<T>
50977 , pointer_arg_from_python<T>
50978 , if_2<
50979 mpl::and_<
50980 indirect_traits::is_reference_to_pointer<T>
50981 , indirect_traits::is_reference_to_const<T>
50982 , mpl::not_<indirect_traits::is_reference_to_volatile<T> >
50983 >
50984 , pointer_cref_arg_from_python<T>
50985 , if_2<
50986 mpl::or_<
50987 indirect_traits::is_reference_to_non_const<T>
50988 , indirect_traits::is_reference_to_volatile<T>
50989 >
50990 , reference_arg_from_python<T>
50991 , mpl::if_<
50992 boost::python::is_back_reference<T>
50993 , back_reference_arg_from_python<T>
50994 , arg_rvalue_from_python<T>
50995 >
50996 >
50997 >
50998 >
50999 >
51000 >::type type;
51001 };
51002 inline arg_lvalue_from_python_base::arg_lvalue_from_python_base(void* result)
51003 : m_result(result)
51004 {
51005 }
51006 inline bool arg_lvalue_from_python_base::convertible() const
51007 {
51008 return m_result != 0;
51009 }
51010 inline void*const& arg_lvalue_from_python_base::result() const
51011 {
51012 return m_result;
51013 }
51014 namespace detail
51015 {
51016 template <class T>
51017 struct null_ptr_owner
51018 {
51019 static T value;
51020 };
51021 template <class T> T null_ptr_owner<T>::value = 0;
51022 template <class U>
51023 inline U& null_ptr_reference(U&(*)())
51024 {
51025 return null_ptr_owner<U>::value;
51026 }
51027 }
51028 template <class T>
51029 inline pointer_cref_arg_from_python<T>::pointer_cref_arg_from_python(PyObject* p)
51030 {
51031 python::detail::write_void_ptr_reference(
51032 m_result.bytes
51033 , p == (&_Py_NoneStruct) ? p : converter::get_lvalue_from_python(p, registered_pointee<T>::converters)
51034 , (T(*)())0);
51035 }
51036 template <class T>
51037 inline bool pointer_cref_arg_from_python<T>::convertible() const
51038 {
51039 return python::detail::void_ptr_to_reference(m_result.bytes, (T(*)())0) != 0;
51040 }
51041 template <class T>
51042 inline T pointer_cref_arg_from_python<T>::operator()() const
51043 {
51044 return (*(void**)m_result.bytes == (&_Py_NoneStruct))
51045 ? detail::null_ptr_reference((T(*)())0)
51046 : python::detail::void_ptr_to_reference(m_result.bytes, (T(*)())0);
51047 }
51048 template <class T>
51049 inline pointer_arg_from_python<T>::pointer_arg_from_python(PyObject* p)
51050 : arg_lvalue_from_python_base(
51051 p == (&_Py_NoneStruct) ? p : converter::get_lvalue_from_python(p, registered_pointee<T>::converters))
51052 {
51053 }
51054 template <class T>
51055 inline T pointer_arg_from_python<T>::operator()() const
51056 {
51057 return (result() == (&_Py_NoneStruct)) ? 0 : T(result());
51058 }
51059 template <class T>
51060 inline reference_arg_from_python<T>::reference_arg_from_python(PyObject* p)
51061 : arg_lvalue_from_python_base(converter::get_lvalue_from_python(p,registered<T>::converters))
51062 {
51063 }
51064 template <class T>
51065 inline T reference_arg_from_python<T>::operator()() const
51066 {
51067 return python::detail::void_ptr_to_reference(result(), (T(*)())0);
51068 }
51069 template <class T>
51070 inline arg_rvalue_from_python<T>::arg_rvalue_from_python(PyObject* obj)
51071 : m_data(converter::rvalue_from_python_stage1(obj, registered<T>::converters))
51072 , m_source(obj)
51073 {
51074 }
51075 template <class T>
51076 inline bool arg_rvalue_from_python<T>::convertible() const
51077 {
51078 return m_data.stage1.convertible != 0;
51079 }
51080 template <class T>
51081 inline typename arg_rvalue_from_python<T>::result_type
51082 arg_rvalue_from_python<T>::operator()()
51083 {
51084 if (m_data.stage1.construct != 0)
51085 m_data.stage1.construct(m_source, &m_data.stage1);
51086 return python::detail::void_ptr_to_reference(m_data.stage1.convertible, (result_type(*)())0);
51087 }
51088 template <class T>
51089 back_reference_arg_from_python<T>::back_reference_arg_from_python(PyObject* x)
51090 : base(x), m_source(x)
51091 {
51092 }
51093 template <class T>
51094 inline T
51095 back_reference_arg_from_python<T>::operator()()
51096 {
51097 return T(m_source, base::operator()());
51098 }
51099 }}}
51100 namespace boost { namespace python {
51101 template <class T>
51102 struct arg_from_python
51103 : converter::select_arg_from_python<
51104 T
51105 >::type
51106 {
51107 typedef typename converter::select_arg_from_python<
51108 T
51109 >::type base;
51110 arg_from_python(PyObject*);
51111 };
51112 template <>
51113 struct arg_from_python<PyObject*>
51114 {
51115 typedef PyObject* result_type;
51116 arg_from_python(PyObject* p) : m_source(p) {}
51117 bool convertible() const { return true; }
51118 PyObject* operator()() const { return m_source; }
51119 private:
51120 PyObject* m_source;
51121 };
51122 template <>
51123 struct arg_from_python<PyObject* const&>
51124 {
51125 typedef PyObject* const& result_type;
51126 arg_from_python(PyObject* p) : m_source(p) {}
51127 bool convertible() const { return true; }
51128 PyObject*const& operator()() const { return m_source; }
51129 private:
51130 PyObject* m_source;
51131 };
51132 template <class T>
51133 inline arg_from_python<T>::arg_from_python(PyObject* source)
51134 : base(source)
51135 {
51136 }
51137 }}
51138 namespace boost { namespace python { namespace converter {
51139 struct context_result_converter {};
51140 }}}
51141
51142 namespace boost{
51143 namespace detail{
51144 template <typename T, bool small_>
51145 struct ct_imp2
51146 {
51147 typedef const T& param_type;
51148 };
51149 template <typename T>
51150 struct ct_imp2<T, true>
51151 {
51152 typedef const T param_type;
51153 };
51154 template <typename T, bool isp, bool b1>
51155 struct ct_imp
51156 {
51157 typedef const T& param_type;
51158 };
51159 template <typename T, bool isp>
51160 struct ct_imp<T, isp, true>
51161 {
51162 typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
51163 };
51164 template <typename T, bool b1>
51165 struct ct_imp<T, true, b1>
51166 {
51167 typedef const T param_type;
51168 };
51169 }
51170 template <typename T>
51171 struct call_traits
51172 {
51173 public:
51174 typedef T value_type;
51175 typedef T& reference;
51176 typedef const T& const_reference;
51177 typedef typename boost::detail::ct_imp<
51178 T,
51179 ::boost::is_pointer<T>::value,
51180 ::boost::is_arithmetic<T>::value
51181 >::param_type param_type;
51182 };
51183 template <typename T>
51184 struct call_traits<T&>
51185 {
51186 typedef T& value_type;
51187 typedef T& reference;
51188 typedef const T& const_reference;
51189 typedef T& param_type;
51190 };
51191 template <typename T, std::size_t BOOST_PP_ITERATION_0>
51192 struct call_traits<T [BOOST_PP_ITERATION_0]>
51193 {
51194 private:
51195 typedef T array_type[BOOST_PP_ITERATION_0];
51196 public:
51197 typedef const T* value_type;
51198 typedef array_type& reference;
51199 typedef const array_type& const_reference;
51200 typedef const T* const param_type;
51201 };
51202 template <typename T, std::size_t BOOST_PP_ITERATION_0>
51203 struct call_traits<const T [BOOST_PP_ITERATION_0]>
51204 {
51205 private:
51206 typedef const T array_type[BOOST_PP_ITERATION_0];
51207 public:
51208 typedef const T* value_type;
51209 typedef array_type& reference;
51210 typedef const array_type& const_reference;
51211 typedef const T* const param_type;
51212 };
51213 }
51214 namespace boost
51215 {
51216 template <class T1, class T2>
51217 class compressed_pair;
51218 namespace details
51219 {
51220 template <class T1, class T2, bool IsSame, bool FirstEmpty, bool SecondEmpty>
51221 struct compressed_pair_switch;
51222 template <class T1, class T2>
51223 struct compressed_pair_switch<T1, T2, false, false, false>
51224 {static const int value = 0;};
51225 template <class T1, class T2>
51226 struct compressed_pair_switch<T1, T2, false, true, true>
51227 {static const int value = 3;};
51228 template <class T1, class T2>
51229 struct compressed_pair_switch<T1, T2, false, true, false>
51230 {static const int value = 1;};
51231 template <class T1, class T2>
51232 struct compressed_pair_switch<T1, T2, false, false, true>
51233 {static const int value = 2;};
51234 template <class T1, class T2>
51235 struct compressed_pair_switch<T1, T2, true, true, true>
51236 {static const int value = 4;};
51237 template <class T1, class T2>
51238 struct compressed_pair_switch<T1, T2, true, false, false>
51239 {static const int value = 5;};
51240 template <class T1, class T2, int Version> class compressed_pair_imp;
51241 using std::swap;
51242 template <typename T>
51243 inline void cp_swap(T& t1, T& t2)
51244 {
51245 swap(t1, t2);
51246 }
51247 template <class T1, class T2>
51248 class compressed_pair_imp<T1, T2, 0>
51249 {
51250 public:
51251 typedef T1 first_type;
51252 typedef T2 second_type;
51253 typedef typename call_traits<first_type>::param_type first_param_type;
51254 typedef typename call_traits<second_type>::param_type second_param_type;
51255 typedef typename call_traits<first_type>::reference first_reference;
51256 typedef typename call_traits<second_type>::reference second_reference;
51257 typedef typename call_traits<first_type>::const_reference first_const_reference;
51258 typedef typename call_traits<second_type>::const_reference second_const_reference;
51259 compressed_pair_imp() {}
51260 compressed_pair_imp(first_param_type x, second_param_type y)
51261 : first_(x), second_(y) {}
51262 compressed_pair_imp(first_param_type x)
51263 : first_(x) {}
51264 compressed_pair_imp(second_param_type y)
51265 : second_(y) {}
51266 first_reference first() {return first_;}
51267 first_const_reference first() const {return first_;}
51268 second_reference second() {return second_;}
51269 second_const_reference second() const {return second_;}
51270 void swap(::boost::compressed_pair<T1, T2>& y)
51271 {
51272 cp_swap(first_, y.first());
51273 cp_swap(second_, y.second());
51274 }
51275 private:
51276 first_type first_;
51277 second_type second_;
51278 };
51279 template <class T1, class T2>
51280 class compressed_pair_imp<T1, T2, 1>
51281 : protected ::boost::remove_cv<T1>::type
51282 {
51283 public:
51284 typedef T1 first_type;
51285 typedef T2 second_type;
51286 typedef typename call_traits<first_type>::param_type first_param_type;
51287 typedef typename call_traits<second_type>::param_type second_param_type;
51288 typedef typename call_traits<first_type>::reference first_reference;
51289 typedef typename call_traits<second_type>::reference second_reference;
51290 typedef typename call_traits<first_type>::const_reference first_const_reference;
51291 typedef typename call_traits<second_type>::const_reference second_const_reference;
51292 compressed_pair_imp() {}
51293 compressed_pair_imp(first_param_type x, second_param_type y)
51294 : first_type(x), second_(y) {}
51295 compressed_pair_imp(first_param_type x)
51296 : first_type(x) {}
51297 compressed_pair_imp(second_param_type y)
51298 : second_(y) {}
51299 first_reference first() {return *this;}
51300 first_const_reference first() const {return *this;}
51301 second_reference second() {return second_;}
51302 second_const_reference second() const {return second_;}
51303 void swap(::boost::compressed_pair<T1,T2>& y)
51304 {
51305 cp_swap(second_, y.second());
51306 }
51307 private:
51308 second_type second_;
51309 };
51310 template <class T1, class T2>
51311 class compressed_pair_imp<T1, T2, 2>
51312 : protected ::boost::remove_cv<T2>::type
51313 {
51314 public:
51315 typedef T1 first_type;
51316 typedef T2 second_type;
51317 typedef typename call_traits<first_type>::param_type first_param_type;
51318 typedef typename call_traits<second_type>::param_type second_param_type;
51319 typedef typename call_traits<first_type>::reference first_reference;
51320 typedef typename call_traits<second_type>::reference second_reference;
51321 typedef typename call_traits<first_type>::const_reference first_const_reference;
51322 typedef typename call_traits<second_type>::const_reference second_const_reference;
51323 compressed_pair_imp() {}
51324 compressed_pair_imp(first_param_type x, second_param_type y)
51325 : second_type(y), first_(x) {}
51326 compressed_pair_imp(first_param_type x)
51327 : first_(x) {}
51328 compressed_pair_imp(second_param_type y)
51329 : second_type(y) {}
51330 first_reference first() {return first_;}
51331 first_const_reference first() const {return first_;}
51332 second_reference second() {return *this;}
51333 second_const_reference second() const {return *this;}
51334 void swap(::boost::compressed_pair<T1,T2>& y)
51335 {
51336 cp_swap(first_, y.first());
51337 }
51338 private:
51339 first_type first_;
51340 };
51341 template <class T1, class T2>
51342 class compressed_pair_imp<T1, T2, 3>
51343 : protected ::boost::remove_cv<T1>::type,
51344 protected ::boost::remove_cv<T2>::type
51345 {
51346 public:
51347 typedef T1 first_type;
51348 typedef T2 second_type;
51349 typedef typename call_traits<first_type>::param_type first_param_type;
51350 typedef typename call_traits<second_type>::param_type second_param_type;
51351 typedef typename call_traits<first_type>::reference first_reference;
51352 typedef typename call_traits<second_type>::reference second_reference;
51353 typedef typename call_traits<first_type>::const_reference first_const_reference;
51354 typedef typename call_traits<second_type>::const_reference second_const_reference;
51355 compressed_pair_imp() {}
51356 compressed_pair_imp(first_param_type x, second_param_type y)
51357 : first_type(x), second_type(y) {}
51358 compressed_pair_imp(first_param_type x)
51359 : first_type(x) {}
51360 compressed_pair_imp(second_param_type y)
51361 : second_type(y) {}
51362 first_reference first() {return *this;}
51363 first_const_reference first() const {return *this;}
51364 second_reference second() {return *this;}
51365 second_const_reference second() const {return *this;}
51366 void swap(::boost::compressed_pair<T1,T2>&) {}
51367 };
51368 template <class T1, class T2>
51369 class compressed_pair_imp<T1, T2, 4>
51370 : protected ::boost::remove_cv<T1>::type
51371 {
51372 public:
51373 typedef T1 first_type;
51374 typedef T2 second_type;
51375 typedef typename call_traits<first_type>::param_type first_param_type;
51376 typedef typename call_traits<second_type>::param_type second_param_type;
51377 typedef typename call_traits<first_type>::reference first_reference;
51378 typedef typename call_traits<second_type>::reference second_reference;
51379 typedef typename call_traits<first_type>::const_reference first_const_reference;
51380 typedef typename call_traits<second_type>::const_reference second_const_reference;
51381 compressed_pair_imp() {}
51382 compressed_pair_imp(first_param_type x, second_param_type y)
51383 : first_type(x), m_second(y) {}
51384 compressed_pair_imp(first_param_type x)
51385 : first_type(x), m_second(x) {}
51386 first_reference first() {return *this;}
51387 first_const_reference first() const {return *this;}
51388 second_reference second() {return m_second;}
51389 second_const_reference second() const {return m_second;}
51390 void swap(::boost::compressed_pair<T1,T2>&) {}
51391 private:
51392 T2 m_second;
51393 };
51394 template <class T1, class T2>
51395 class compressed_pair_imp<T1, T2, 5>
51396 {
51397 public:
51398 typedef T1 first_type;
51399 typedef T2 second_type;
51400 typedef typename call_traits<first_type>::param_type first_param_type;
51401 typedef typename call_traits<second_type>::param_type second_param_type;
51402 typedef typename call_traits<first_type>::reference first_reference;
51403 typedef typename call_traits<second_type>::reference second_reference;
51404 typedef typename call_traits<first_type>::const_reference first_const_reference;
51405 typedef typename call_traits<second_type>::const_reference second_const_reference;
51406 compressed_pair_imp() {}
51407 compressed_pair_imp(first_param_type x, second_param_type y)
51408 : first_(x), second_(y) {}
51409 compressed_pair_imp(first_param_type x)
51410 : first_(x), second_(x) {}
51411 first_reference first() {return first_;}
51412 first_const_reference first() const {return first_;}
51413 second_reference second() {return second_;}
51414 second_const_reference second() const {return second_;}
51415 void swap(::boost::compressed_pair<T1, T2>& y)
51416 {
51417 cp_swap(first_, y.first());
51418 cp_swap(second_, y.second());
51419 }
51420 private:
51421 first_type first_;
51422 second_type second_;
51423 };
51424 }
51425 template <class T1, class T2>
51426 class compressed_pair
51427 : private ::boost::details::compressed_pair_imp<T1, T2,
51428 ::boost::details::compressed_pair_switch<
51429 T1,
51430 T2,
51431 ::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
51432 ::boost::is_empty<T1>::value,
51433 ::boost::is_empty<T2>::value>::value>
51434 {
51435 private:
51436 typedef details::compressed_pair_imp<T1, T2,
51437 ::boost::details::compressed_pair_switch<
51438 T1,
51439 T2,
51440 ::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
51441 ::boost::is_empty<T1>::value,
51442 ::boost::is_empty<T2>::value>::value> base;
51443 public:
51444 typedef T1 first_type;
51445 typedef T2 second_type;
51446 typedef typename call_traits<first_type>::param_type first_param_type;
51447 typedef typename call_traits<second_type>::param_type second_param_type;
51448 typedef typename call_traits<first_type>::reference first_reference;
51449 typedef typename call_traits<second_type>::reference second_reference;
51450 typedef typename call_traits<first_type>::const_reference first_const_reference;
51451 typedef typename call_traits<second_type>::const_reference second_const_reference;
51452 compressed_pair() : base() {}
51453 compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
51454 explicit compressed_pair(first_param_type x) : base(x) {}
51455 explicit compressed_pair(second_param_type y) : base(y) {}
51456 first_reference first() {return base::first();}
51457 first_const_reference first() const {return base::first();}
51458 second_reference second() {return base::second();}
51459 second_const_reference second() const {return base::second();}
51460 void swap(compressed_pair& y) { base::swap(y); }
51461 };
51462 template <class T>
51463 class compressed_pair<T, T>
51464 : private details::compressed_pair_imp<T, T,
51465 ::boost::details::compressed_pair_switch<
51466 T,
51467 T,
51468 ::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value,
51469 ::boost::is_empty<T>::value,
51470 ::boost::is_empty<T>::value>::value>
51471 {
51472 private:
51473 typedef details::compressed_pair_imp<T, T,
51474 ::boost::details::compressed_pair_switch<
51475 T,
51476 T,
51477 ::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value,
51478 ::boost::is_empty<T>::value,
51479 ::boost::is_empty<T>::value>::value> base;
51480 public:
51481 typedef T first_type;
51482 typedef T second_type;
51483 typedef typename call_traits<first_type>::param_type first_param_type;
51484 typedef typename call_traits<second_type>::param_type second_param_type;
51485 typedef typename call_traits<first_type>::reference first_reference;
51486 typedef typename call_traits<second_type>::reference second_reference;
51487 typedef typename call_traits<first_type>::const_reference first_const_reference;
51488 typedef typename call_traits<second_type>::const_reference second_const_reference;
51489 compressed_pair() : base() {}
51490 compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
51491 explicit
51492 compressed_pair(first_param_type x) : base(x) {}
51493 first_reference first() {return base::first();}
51494 first_const_reference first() const {return base::first();}
51495 second_reference second() {return base::second();}
51496 second_const_reference second() const {return base::second();}
51497 void swap(::boost::compressed_pair<T,T>& y) { base::swap(y); }
51498 };
51499 template <class T1, class T2>
51500 inline
51501 void
51502 swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
51503 {
51504 x.swap(y);
51505 }
51506 }
51507 namespace boost { namespace python { namespace detail {
51508 template <int BOOST_PP_ITERATION_0>
51509 inline PyObject* get(mpl::int_<BOOST_PP_ITERATION_0>, PyObject* const& args_)
51510 {
51511 return (((PyTupleObject *)(args_))->ob_item[BOOST_PP_ITERATION_0]);
51512 }
51513 inline unsigned arity(PyObject* const& args_)
51514 {
51515 return (((PyVarObject*)(args_))->ob_size);
51516 }
51517 typedef int void_result_to_python;
51518 template <class Policies, class Result>
51519 struct select_result_converter
51520 : mpl::eval_if<
51521 is_same<Result,void>
51522 , mpl::identity<void_result_to_python>
51523 , mpl::apply1<typename Policies::result_converter,Result>
51524 >
51525 {
51526 };
51527 template <class ArgPackage, class ResultConverter>
51528 inline ResultConverter create_result_converter(
51529 ArgPackage const& args_
51530 , ResultConverter*
51531 , converter::context_result_converter*
51532 )
51533 {
51534 return ResultConverter(args_);
51535 }
51536 template <class ArgPackage, class ResultConverter>
51537 inline ResultConverter create_result_converter(
51538 ArgPackage const&
51539 , ResultConverter*
51540 , ...
51541 )
51542 {
51543 return ResultConverter();
51544 }
51545 template <class ResultConverter>
51546 struct converter_target_type
51547 {
51548 static PyTypeObject const *get_pytype()
51549 {
51550 return create_result_converter((PyObject*)0, (ResultConverter *)0, (ResultConverter *)0).get_pytype();
51551 }
51552 };
51553 template < >
51554 struct converter_target_type <void_result_to_python >
51555 {
51556 static PyTypeObject const *get_pytype()
51557 {
51558 return 0;
51559 }
51560 };
51561 template <unsigned> struct caller_arity;
51562 template <class F, class CallPolicies, class Sig>
51563 struct caller;
51564 template <>
51565 struct caller_arity<0>
51566 {
51567 template <class F, class Policies, class Sig>
51568 struct impl
51569 {
51570 impl(F f, Policies p) : m_data(f,p) {}
51571 PyObject* operator()(PyObject* args_, PyObject*)
51572 {
51573 typedef typename mpl::begin<Sig>::type first;
51574 typedef typename first::type result_t;
51575 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51576 typedef typename Policies::argument_package argument_package;
51577 argument_package inner_args(args_);
51578 if (!m_data.second().precall(inner_args))
51579 return 0;
51580 PyObject* result = detail::invoke(
51581 detail::invoke_tag<result_t,F>()
51582 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51583 , m_data.first()
51584
51585 );
51586 return m_data.second().postcall(inner_args, result);
51587 }
51588 static unsigned min_arity() { return 0; }
51589 static py_func_sig_info signature()
51590 {
51591 const signature_element * sig = detail::signature<Sig>::elements();
51592 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51593 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51594 static const signature_element ret = {
51595 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51596 , &detail::converter_target_type<result_converter>::get_pytype
51597 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51598 };
51599 py_func_sig_info res = {sig, &ret };
51600 return res;
51601 }
51602 private:
51603 compressed_pair<F,Policies> m_data;
51604 };
51605 };
51606 template <>
51607 struct caller_arity<1>
51608 {
51609 template <class F, class Policies, class Sig>
51610 struct impl
51611 {
51612 impl(F f, Policies p) : m_data(f,p) {}
51613 PyObject* operator()(PyObject* args_, PyObject*)
51614 {
51615 typedef typename mpl::begin<Sig>::type first;
51616 typedef typename first::type result_t;
51617 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51618 typedef typename Policies::argument_package argument_package;
51619 argument_package inner_args(args_);
51620 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51621 if (!m_data.second().precall(inner_args))
51622 return 0;
51623 PyObject* result = detail::invoke(
51624 detail::invoke_tag<result_t,F>()
51625 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51626 , m_data.first()
51627 , c0
51628 );
51629 return m_data.second().postcall(inner_args, result);
51630 }
51631 static unsigned min_arity() { return 1; }
51632 static py_func_sig_info signature()
51633 {
51634 const signature_element * sig = detail::signature<Sig>::elements();
51635 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51636 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51637 static const signature_element ret = {
51638 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51639 , &detail::converter_target_type<result_converter>::get_pytype
51640 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51641 };
51642 py_func_sig_info res = {sig, &ret };
51643 return res;
51644 }
51645 private:
51646 compressed_pair<F,Policies> m_data;
51647 };
51648 };
51649 template <>
51650 struct caller_arity<2>
51651 {
51652 template <class F, class Policies, class Sig>
51653 struct impl
51654 {
51655 impl(F f, Policies p) : m_data(f,p) {}
51656 PyObject* operator()(PyObject* args_, PyObject*)
51657 {
51658 typedef typename mpl::begin<Sig>::type first;
51659 typedef typename first::type result_t;
51660 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51661 typedef typename Policies::argument_package argument_package;
51662 argument_package inner_args(args_);
51663 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51664 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51665 if (!m_data.second().precall(inner_args))
51666 return 0;
51667 PyObject* result = detail::invoke(
51668 detail::invoke_tag<result_t,F>()
51669 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51670 , m_data.first()
51671 , c0 , c1
51672 );
51673 return m_data.second().postcall(inner_args, result);
51674 }
51675 static unsigned min_arity() { return 2; }
51676 static py_func_sig_info signature()
51677 {
51678 const signature_element * sig = detail::signature<Sig>::elements();
51679 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51680 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51681 static const signature_element ret = {
51682 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51683 , &detail::converter_target_type<result_converter>::get_pytype
51684 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51685 };
51686 py_func_sig_info res = {sig, &ret };
51687 return res;
51688 }
51689 private:
51690 compressed_pair<F,Policies> m_data;
51691 };
51692 };
51693 template <>
51694 struct caller_arity<3>
51695 {
51696 template <class F, class Policies, class Sig>
51697 struct impl
51698 {
51699 impl(F f, Policies p) : m_data(f,p) {}
51700 PyObject* operator()(PyObject* args_, PyObject*)
51701 {
51702 typedef typename mpl::begin<Sig>::type first;
51703 typedef typename first::type result_t;
51704 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51705 typedef typename Policies::argument_package argument_package;
51706 argument_package inner_args(args_);
51707 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51708 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51709 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51710 if (!m_data.second().precall(inner_args))
51711 return 0;
51712 PyObject* result = detail::invoke(
51713 detail::invoke_tag<result_t,F>()
51714 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51715 , m_data.first()
51716 , c0 , c1 , c2
51717 );
51718 return m_data.second().postcall(inner_args, result);
51719 }
51720 static unsigned min_arity() { return 3; }
51721 static py_func_sig_info signature()
51722 {
51723 const signature_element * sig = detail::signature<Sig>::elements();
51724 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51725 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51726 static const signature_element ret = {
51727 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51728 , &detail::converter_target_type<result_converter>::get_pytype
51729 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51730 };
51731 py_func_sig_info res = {sig, &ret };
51732 return res;
51733 }
51734 private:
51735 compressed_pair<F,Policies> m_data;
51736 };
51737 };
51738 template <>
51739 struct caller_arity<4>
51740 {
51741 template <class F, class Policies, class Sig>
51742 struct impl
51743 {
51744 impl(F f, Policies p) : m_data(f,p) {}
51745 PyObject* operator()(PyObject* args_, PyObject*)
51746 {
51747 typedef typename mpl::begin<Sig>::type first;
51748 typedef typename first::type result_t;
51749 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51750 typedef typename Policies::argument_package argument_package;
51751 argument_package inner_args(args_);
51752 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51753 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51754 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51755 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
51756 if (!m_data.second().precall(inner_args))
51757 return 0;
51758 PyObject* result = detail::invoke(
51759 detail::invoke_tag<result_t,F>()
51760 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51761 , m_data.first()
51762 , c0 , c1 , c2 , c3
51763 );
51764 return m_data.second().postcall(inner_args, result);
51765 }
51766 static unsigned min_arity() { return 4; }
51767 static py_func_sig_info signature()
51768 {
51769 const signature_element * sig = detail::signature<Sig>::elements();
51770 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51771 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51772 static const signature_element ret = {
51773 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51774 , &detail::converter_target_type<result_converter>::get_pytype
51775 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51776 };
51777 py_func_sig_info res = {sig, &ret };
51778 return res;
51779 }
51780 private:
51781 compressed_pair<F,Policies> m_data;
51782 };
51783 };
51784 template <>
51785 struct caller_arity<5>
51786 {
51787 template <class F, class Policies, class Sig>
51788 struct impl
51789 {
51790 impl(F f, Policies p) : m_data(f,p) {}
51791 PyObject* operator()(PyObject* args_, PyObject*)
51792 {
51793 typedef typename mpl::begin<Sig>::type first;
51794 typedef typename first::type result_t;
51795 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51796 typedef typename Policies::argument_package argument_package;
51797 argument_package inner_args(args_);
51798 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51799 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51800 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51801 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
51802 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
51803 if (!m_data.second().precall(inner_args))
51804 return 0;
51805 PyObject* result = detail::invoke(
51806 detail::invoke_tag<result_t,F>()
51807 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51808 , m_data.first()
51809 , c0 , c1 , c2 , c3 , c4
51810 );
51811 return m_data.second().postcall(inner_args, result);
51812 }
51813 static unsigned min_arity() { return 5; }
51814 static py_func_sig_info signature()
51815 {
51816 const signature_element * sig = detail::signature<Sig>::elements();
51817 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51818 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51819 static const signature_element ret = {
51820 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51821 , &detail::converter_target_type<result_converter>::get_pytype
51822 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51823 };
51824 py_func_sig_info res = {sig, &ret };
51825 return res;
51826 }
51827 private:
51828 compressed_pair<F,Policies> m_data;
51829 };
51830 };
51831 template <>
51832 struct caller_arity<6>
51833 {
51834 template <class F, class Policies, class Sig>
51835 struct impl
51836 {
51837 impl(F f, Policies p) : m_data(f,p) {}
51838 PyObject* operator()(PyObject* args_, PyObject*)
51839 {
51840 typedef typename mpl::begin<Sig>::type first;
51841 typedef typename first::type result_t;
51842 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51843 typedef typename Policies::argument_package argument_package;
51844 argument_package inner_args(args_);
51845 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51846 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51847 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51848 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
51849 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
51850 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
51851 if (!m_data.second().precall(inner_args))
51852 return 0;
51853 PyObject* result = detail::invoke(
51854 detail::invoke_tag<result_t,F>()
51855 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51856 , m_data.first()
51857 , c0 , c1 , c2 , c3 , c4 , c5
51858 );
51859 return m_data.second().postcall(inner_args, result);
51860 }
51861 static unsigned min_arity() { return 6; }
51862 static py_func_sig_info signature()
51863 {
51864 const signature_element * sig = detail::signature<Sig>::elements();
51865 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51866 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51867 static const signature_element ret = {
51868 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51869 , &detail::converter_target_type<result_converter>::get_pytype
51870 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51871 };
51872 py_func_sig_info res = {sig, &ret };
51873 return res;
51874 }
51875 private:
51876 compressed_pair<F,Policies> m_data;
51877 };
51878 };
51879 template <>
51880 struct caller_arity<7>
51881 {
51882 template <class F, class Policies, class Sig>
51883 struct impl
51884 {
51885 impl(F f, Policies p) : m_data(f,p) {}
51886 PyObject* operator()(PyObject* args_, PyObject*)
51887 {
51888 typedef typename mpl::begin<Sig>::type first;
51889 typedef typename first::type result_t;
51890 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51891 typedef typename Policies::argument_package argument_package;
51892 argument_package inner_args(args_);
51893 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51894 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51895 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51896 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
51897 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
51898 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
51899 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
51900 if (!m_data.second().precall(inner_args))
51901 return 0;
51902 PyObject* result = detail::invoke(
51903 detail::invoke_tag<result_t,F>()
51904 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51905 , m_data.first()
51906 , c0 , c1 , c2 , c3 , c4 , c5 , c6
51907 );
51908 return m_data.second().postcall(inner_args, result);
51909 }
51910 static unsigned min_arity() { return 7; }
51911 static py_func_sig_info signature()
51912 {
51913 const signature_element * sig = detail::signature<Sig>::elements();
51914 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51915 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51916 static const signature_element ret = {
51917 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51918 , &detail::converter_target_type<result_converter>::get_pytype
51919 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51920 };
51921 py_func_sig_info res = {sig, &ret };
51922 return res;
51923 }
51924 private:
51925 compressed_pair<F,Policies> m_data;
51926 };
51927 };
51928 template <>
51929 struct caller_arity<8>
51930 {
51931 template <class F, class Policies, class Sig>
51932 struct impl
51933 {
51934 impl(F f, Policies p) : m_data(f,p) {}
51935 PyObject* operator()(PyObject* args_, PyObject*)
51936 {
51937 typedef typename mpl::begin<Sig>::type first;
51938 typedef typename first::type result_t;
51939 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51940 typedef typename Policies::argument_package argument_package;
51941 argument_package inner_args(args_);
51942 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51943 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51944 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51945 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
51946 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
51947 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
51948 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
51949 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
51950 if (!m_data.second().precall(inner_args))
51951 return 0;
51952 PyObject* result = detail::invoke(
51953 detail::invoke_tag<result_t,F>()
51954 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
51955 , m_data.first()
51956 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7
51957 );
51958 return m_data.second().postcall(inner_args, result);
51959 }
51960 static unsigned min_arity() { return 8; }
51961 static py_func_sig_info signature()
51962 {
51963 const signature_element * sig = detail::signature<Sig>::elements();
51964 typedef typename Policies::template extract_return_type<Sig>::type rtype;
51965 typedef typename select_result_converter<Policies, rtype>::type result_converter;
51966 static const signature_element ret = {
51967 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
51968 , &detail::converter_target_type<result_converter>::get_pytype
51969 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
51970 };
51971 py_func_sig_info res = {sig, &ret };
51972 return res;
51973 }
51974 private:
51975 compressed_pair<F,Policies> m_data;
51976 };
51977 };
51978 template <>
51979 struct caller_arity<9>
51980 {
51981 template <class F, class Policies, class Sig>
51982 struct impl
51983 {
51984 impl(F f, Policies p) : m_data(f,p) {}
51985 PyObject* operator()(PyObject* args_, PyObject*)
51986 {
51987 typedef typename mpl::begin<Sig>::type first;
51988 typedef typename first::type result_t;
51989 typedef typename select_result_converter<Policies, result_t>::type result_converter;
51990 typedef typename Policies::argument_package argument_package;
51991 argument_package inner_args(args_);
51992 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
51993 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
51994 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
51995 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
51996 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
51997 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
51998 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
51999 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52000 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52001 if (!m_data.second().precall(inner_args))
52002 return 0;
52003 PyObject* result = detail::invoke(
52004 detail::invoke_tag<result_t,F>()
52005 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52006 , m_data.first()
52007 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8
52008 );
52009 return m_data.second().postcall(inner_args, result);
52010 }
52011 static unsigned min_arity() { return 9; }
52012 static py_func_sig_info signature()
52013 {
52014 const signature_element * sig = detail::signature<Sig>::elements();
52015 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52016 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52017 static const signature_element ret = {
52018 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52019 , &detail::converter_target_type<result_converter>::get_pytype
52020 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52021 };
52022 py_func_sig_info res = {sig, &ret };
52023 return res;
52024 }
52025 private:
52026 compressed_pair<F,Policies> m_data;
52027 };
52028 };
52029 template <>
52030 struct caller_arity<10>
52031 {
52032 template <class F, class Policies, class Sig>
52033 struct impl
52034 {
52035 impl(F f, Policies p) : m_data(f,p) {}
52036 PyObject* operator()(PyObject* args_, PyObject*)
52037 {
52038 typedef typename mpl::begin<Sig>::type first;
52039 typedef typename first::type result_t;
52040 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52041 typedef typename Policies::argument_package argument_package;
52042 argument_package inner_args(args_);
52043 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52044 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52045 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52046 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52047 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52048 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52049 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52050 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52051 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52052 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52053 if (!m_data.second().precall(inner_args))
52054 return 0;
52055 PyObject* result = detail::invoke(
52056 detail::invoke_tag<result_t,F>()
52057 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52058 , m_data.first()
52059 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9
52060 );
52061 return m_data.second().postcall(inner_args, result);
52062 }
52063 static unsigned min_arity() { return 10; }
52064 static py_func_sig_info signature()
52065 {
52066 const signature_element * sig = detail::signature<Sig>::elements();
52067 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52068 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52069 static const signature_element ret = {
52070 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52071 , &detail::converter_target_type<result_converter>::get_pytype
52072 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52073 };
52074 py_func_sig_info res = {sig, &ret };
52075 return res;
52076 }
52077 private:
52078 compressed_pair<F,Policies> m_data;
52079 };
52080 };
52081 template <>
52082 struct caller_arity<11>
52083 {
52084 template <class F, class Policies, class Sig>
52085 struct impl
52086 {
52087 impl(F f, Policies p) : m_data(f,p) {}
52088 PyObject* operator()(PyObject* args_, PyObject*)
52089 {
52090 typedef typename mpl::begin<Sig>::type first;
52091 typedef typename first::type result_t;
52092 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52093 typedef typename Policies::argument_package argument_package;
52094 argument_package inner_args(args_);
52095 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52096 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52097 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52098 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52099 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52100 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52101 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52102 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52103 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52104 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52105 typedef typename mpl::next< arg_iter9 >::type arg_iter10; typedef arg_from_python<typename arg_iter10::type> c_t10; c_t10 c10(get(mpl::int_<10>(), inner_args)); if (!c10.convertible()) return 0;
52106 if (!m_data.second().precall(inner_args))
52107 return 0;
52108 PyObject* result = detail::invoke(
52109 detail::invoke_tag<result_t,F>()
52110 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52111 , m_data.first()
52112 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10
52113 );
52114 return m_data.second().postcall(inner_args, result);
52115 }
52116 static unsigned min_arity() { return 11; }
52117 static py_func_sig_info signature()
52118 {
52119 const signature_element * sig = detail::signature<Sig>::elements();
52120 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52121 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52122 static const signature_element ret = {
52123 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52124 , &detail::converter_target_type<result_converter>::get_pytype
52125 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52126 };
52127 py_func_sig_info res = {sig, &ret };
52128 return res;
52129 }
52130 private:
52131 compressed_pair<F,Policies> m_data;
52132 };
52133 };
52134 template <>
52135 struct caller_arity<12>
52136 {
52137 template <class F, class Policies, class Sig>
52138 struct impl
52139 {
52140 impl(F f, Policies p) : m_data(f,p) {}
52141 PyObject* operator()(PyObject* args_, PyObject*)
52142 {
52143 typedef typename mpl::begin<Sig>::type first;
52144 typedef typename first::type result_t;
52145 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52146 typedef typename Policies::argument_package argument_package;
52147 argument_package inner_args(args_);
52148 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52149 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52150 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52151 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52152 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52153 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52154 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52155 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52156 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52157 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52158 typedef typename mpl::next< arg_iter9 >::type arg_iter10; typedef arg_from_python<typename arg_iter10::type> c_t10; c_t10 c10(get(mpl::int_<10>(), inner_args)); if (!c10.convertible()) return 0;
52159 typedef typename mpl::next< arg_iter10 >::type arg_iter11; typedef arg_from_python<typename arg_iter11::type> c_t11; c_t11 c11(get(mpl::int_<11>(), inner_args)); if (!c11.convertible()) return 0;
52160 if (!m_data.second().precall(inner_args))
52161 return 0;
52162 PyObject* result = detail::invoke(
52163 detail::invoke_tag<result_t,F>()
52164 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52165 , m_data.first()
52166 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10 , c11
52167 );
52168 return m_data.second().postcall(inner_args, result);
52169 }
52170 static unsigned min_arity() { return 12; }
52171 static py_func_sig_info signature()
52172 {
52173 const signature_element * sig = detail::signature<Sig>::elements();
52174 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52175 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52176 static const signature_element ret = {
52177 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52178 , &detail::converter_target_type<result_converter>::get_pytype
52179 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52180 };
52181 py_func_sig_info res = {sig, &ret };
52182 return res;
52183 }
52184 private:
52185 compressed_pair<F,Policies> m_data;
52186 };
52187 };
52188 template <>
52189 struct caller_arity<13>
52190 {
52191 template <class F, class Policies, class Sig>
52192 struct impl
52193 {
52194 impl(F f, Policies p) : m_data(f,p) {}
52195 PyObject* operator()(PyObject* args_, PyObject*)
52196 {
52197 typedef typename mpl::begin<Sig>::type first;
52198 typedef typename first::type result_t;
52199 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52200 typedef typename Policies::argument_package argument_package;
52201 argument_package inner_args(args_);
52202 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52203 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52204 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52205 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52206 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52207 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52208 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52209 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52210 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52211 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52212 typedef typename mpl::next< arg_iter9 >::type arg_iter10; typedef arg_from_python<typename arg_iter10::type> c_t10; c_t10 c10(get(mpl::int_<10>(), inner_args)); if (!c10.convertible()) return 0;
52213 typedef typename mpl::next< arg_iter10 >::type arg_iter11; typedef arg_from_python<typename arg_iter11::type> c_t11; c_t11 c11(get(mpl::int_<11>(), inner_args)); if (!c11.convertible()) return 0;
52214 typedef typename mpl::next< arg_iter11 >::type arg_iter12; typedef arg_from_python<typename arg_iter12::type> c_t12; c_t12 c12(get(mpl::int_<12>(), inner_args)); if (!c12.convertible()) return 0;
52215 if (!m_data.second().precall(inner_args))
52216 return 0;
52217 PyObject* result = detail::invoke(
52218 detail::invoke_tag<result_t,F>()
52219 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52220 , m_data.first()
52221 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10 , c11 , c12
52222 );
52223 return m_data.second().postcall(inner_args, result);
52224 }
52225 static unsigned min_arity() { return 13; }
52226 static py_func_sig_info signature()
52227 {
52228 const signature_element * sig = detail::signature<Sig>::elements();
52229 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52230 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52231 static const signature_element ret = {
52232 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52233 , &detail::converter_target_type<result_converter>::get_pytype
52234 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52235 };
52236 py_func_sig_info res = {sig, &ret };
52237 return res;
52238 }
52239 private:
52240 compressed_pair<F,Policies> m_data;
52241 };
52242 };
52243 template <>
52244 struct caller_arity<14>
52245 {
52246 template <class F, class Policies, class Sig>
52247 struct impl
52248 {
52249 impl(F f, Policies p) : m_data(f,p) {}
52250 PyObject* operator()(PyObject* args_, PyObject*)
52251 {
52252 typedef typename mpl::begin<Sig>::type first;
52253 typedef typename first::type result_t;
52254 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52255 typedef typename Policies::argument_package argument_package;
52256 argument_package inner_args(args_);
52257 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52258 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52259 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52260 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52261 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52262 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52263 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52264 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52265 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52266 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52267 typedef typename mpl::next< arg_iter9 >::type arg_iter10; typedef arg_from_python<typename arg_iter10::type> c_t10; c_t10 c10(get(mpl::int_<10>(), inner_args)); if (!c10.convertible()) return 0;
52268 typedef typename mpl::next< arg_iter10 >::type arg_iter11; typedef arg_from_python<typename arg_iter11::type> c_t11; c_t11 c11(get(mpl::int_<11>(), inner_args)); if (!c11.convertible()) return 0;
52269 typedef typename mpl::next< arg_iter11 >::type arg_iter12; typedef arg_from_python<typename arg_iter12::type> c_t12; c_t12 c12(get(mpl::int_<12>(), inner_args)); if (!c12.convertible()) return 0;
52270 typedef typename mpl::next< arg_iter12 >::type arg_iter13; typedef arg_from_python<typename arg_iter13::type> c_t13; c_t13 c13(get(mpl::int_<13>(), inner_args)); if (!c13.convertible()) return 0;
52271 if (!m_data.second().precall(inner_args))
52272 return 0;
52273 PyObject* result = detail::invoke(
52274 detail::invoke_tag<result_t,F>()
52275 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52276 , m_data.first()
52277 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10 , c11 , c12 , c13
52278 );
52279 return m_data.second().postcall(inner_args, result);
52280 }
52281 static unsigned min_arity() { return 14; }
52282 static py_func_sig_info signature()
52283 {
52284 const signature_element * sig = detail::signature<Sig>::elements();
52285 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52286 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52287 static const signature_element ret = {
52288 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52289 , &detail::converter_target_type<result_converter>::get_pytype
52290 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52291 };
52292 py_func_sig_info res = {sig, &ret };
52293 return res;
52294 }
52295 private:
52296 compressed_pair<F,Policies> m_data;
52297 };
52298 };
52299 template <>
52300 struct caller_arity<15>
52301 {
52302 template <class F, class Policies, class Sig>
52303 struct impl
52304 {
52305 impl(F f, Policies p) : m_data(f,p) {}
52306 PyObject* operator()(PyObject* args_, PyObject*)
52307 {
52308 typedef typename mpl::begin<Sig>::type first;
52309 typedef typename first::type result_t;
52310 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52311 typedef typename Policies::argument_package argument_package;
52312 argument_package inner_args(args_);
52313 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52314 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52315 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52316 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52317 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52318 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52319 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52320 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52321 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52322 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52323 typedef typename mpl::next< arg_iter9 >::type arg_iter10; typedef arg_from_python<typename arg_iter10::type> c_t10; c_t10 c10(get(mpl::int_<10>(), inner_args)); if (!c10.convertible()) return 0;
52324 typedef typename mpl::next< arg_iter10 >::type arg_iter11; typedef arg_from_python<typename arg_iter11::type> c_t11; c_t11 c11(get(mpl::int_<11>(), inner_args)); if (!c11.convertible()) return 0;
52325 typedef typename mpl::next< arg_iter11 >::type arg_iter12; typedef arg_from_python<typename arg_iter12::type> c_t12; c_t12 c12(get(mpl::int_<12>(), inner_args)); if (!c12.convertible()) return 0;
52326 typedef typename mpl::next< arg_iter12 >::type arg_iter13; typedef arg_from_python<typename arg_iter13::type> c_t13; c_t13 c13(get(mpl::int_<13>(), inner_args)); if (!c13.convertible()) return 0;
52327 typedef typename mpl::next< arg_iter13 >::type arg_iter14; typedef arg_from_python<typename arg_iter14::type> c_t14; c_t14 c14(get(mpl::int_<14>(), inner_args)); if (!c14.convertible()) return 0;
52328 if (!m_data.second().precall(inner_args))
52329 return 0;
52330 PyObject* result = detail::invoke(
52331 detail::invoke_tag<result_t,F>()
52332 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52333 , m_data.first()
52334 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10 , c11 , c12 , c13 , c14
52335 );
52336 return m_data.second().postcall(inner_args, result);
52337 }
52338 static unsigned min_arity() { return 15; }
52339 static py_func_sig_info signature()
52340 {
52341 const signature_element * sig = detail::signature<Sig>::elements();
52342 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52343 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52344 static const signature_element ret = {
52345 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52346 , &detail::converter_target_type<result_converter>::get_pytype
52347 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52348 };
52349 py_func_sig_info res = {sig, &ret };
52350 return res;
52351 }
52352 private:
52353 compressed_pair<F,Policies> m_data;
52354 };
52355 };
52356 template <>
52357 struct caller_arity<16>
52358 {
52359 template <class F, class Policies, class Sig>
52360 struct impl
52361 {
52362 impl(F f, Policies p) : m_data(f,p) {}
52363 PyObject* operator()(PyObject* args_, PyObject*)
52364 {
52365 typedef typename mpl::begin<Sig>::type first;
52366 typedef typename first::type result_t;
52367 typedef typename select_result_converter<Policies, result_t>::type result_converter;
52368 typedef typename Policies::argument_package argument_package;
52369 argument_package inner_args(args_);
52370 typedef typename mpl::next<first>::type arg_iter0; typedef arg_from_python<typename arg_iter0::type> c_t0; c_t0 c0(get(mpl::int_<0>(), inner_args)); if (!c0.convertible()) return 0;
52371 typedef typename mpl::next< arg_iter0 >::type arg_iter1; typedef arg_from_python<typename arg_iter1::type> c_t1; c_t1 c1(get(mpl::int_<1>(), inner_args)); if (!c1.convertible()) return 0;
52372 typedef typename mpl::next< arg_iter1 >::type arg_iter2; typedef arg_from_python<typename arg_iter2::type> c_t2; c_t2 c2(get(mpl::int_<2>(), inner_args)); if (!c2.convertible()) return 0;
52373 typedef typename mpl::next< arg_iter2 >::type arg_iter3; typedef arg_from_python<typename arg_iter3::type> c_t3; c_t3 c3(get(mpl::int_<3>(), inner_args)); if (!c3.convertible()) return 0;
52374 typedef typename mpl::next< arg_iter3 >::type arg_iter4; typedef arg_from_python<typename arg_iter4::type> c_t4; c_t4 c4(get(mpl::int_<4>(), inner_args)); if (!c4.convertible()) return 0;
52375 typedef typename mpl::next< arg_iter4 >::type arg_iter5; typedef arg_from_python<typename arg_iter5::type> c_t5; c_t5 c5(get(mpl::int_<5>(), inner_args)); if (!c5.convertible()) return 0;
52376 typedef typename mpl::next< arg_iter5 >::type arg_iter6; typedef arg_from_python<typename arg_iter6::type> c_t6; c_t6 c6(get(mpl::int_<6>(), inner_args)); if (!c6.convertible()) return 0;
52377 typedef typename mpl::next< arg_iter6 >::type arg_iter7; typedef arg_from_python<typename arg_iter7::type> c_t7; c_t7 c7(get(mpl::int_<7>(), inner_args)); if (!c7.convertible()) return 0;
52378 typedef typename mpl::next< arg_iter7 >::type arg_iter8; typedef arg_from_python<typename arg_iter8::type> c_t8; c_t8 c8(get(mpl::int_<8>(), inner_args)); if (!c8.convertible()) return 0;
52379 typedef typename mpl::next< arg_iter8 >::type arg_iter9; typedef arg_from_python<typename arg_iter9::type> c_t9; c_t9 c9(get(mpl::int_<9>(), inner_args)); if (!c9.convertible()) return 0;
52380 typedef typename mpl::next< arg_iter9 >::type arg_iter10; typedef arg_from_python<typename arg_iter10::type> c_t10; c_t10 c10(get(mpl::int_<10>(), inner_args)); if (!c10.convertible()) return 0;
52381 typedef typename mpl::next< arg_iter10 >::type arg_iter11; typedef arg_from_python<typename arg_iter11::type> c_t11; c_t11 c11(get(mpl::int_<11>(), inner_args)); if (!c11.convertible()) return 0;
52382 typedef typename mpl::next< arg_iter11 >::type arg_iter12; typedef arg_from_python<typename arg_iter12::type> c_t12; c_t12 c12(get(mpl::int_<12>(), inner_args)); if (!c12.convertible()) return 0;
52383 typedef typename mpl::next< arg_iter12 >::type arg_iter13; typedef arg_from_python<typename arg_iter13::type> c_t13; c_t13 c13(get(mpl::int_<13>(), inner_args)); if (!c13.convertible()) return 0;
52384 typedef typename mpl::next< arg_iter13 >::type arg_iter14; typedef arg_from_python<typename arg_iter14::type> c_t14; c_t14 c14(get(mpl::int_<14>(), inner_args)); if (!c14.convertible()) return 0;
52385 typedef typename mpl::next< arg_iter14 >::type arg_iter15; typedef arg_from_python<typename arg_iter15::type> c_t15; c_t15 c15(get(mpl::int_<15>(), inner_args)); if (!c15.convertible()) return 0;
52386 if (!m_data.second().precall(inner_args))
52387 return 0;
52388 PyObject* result = detail::invoke(
52389 detail::invoke_tag<result_t,F>()
52390 , create_result_converter(args_, (result_converter*)0, (result_converter*)0)
52391 , m_data.first()
52392 , c0 , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10 , c11 , c12 , c13 , c14 , c15
52393 );
52394 return m_data.second().postcall(inner_args, result);
52395 }
52396 static unsigned min_arity() { return 16; }
52397 static py_func_sig_info signature()
52398 {
52399 const signature_element * sig = detail::signature<Sig>::elements();
52400 typedef typename Policies::template extract_return_type<Sig>::type rtype;
52401 typedef typename select_result_converter<Policies, rtype>::type result_converter;
52402 static const signature_element ret = {
52403 (boost::is_void<rtype>::value ? "void" : type_id<rtype>().name())
52404 , &detail::converter_target_type<result_converter>::get_pytype
52405 , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
52406 };
52407 py_func_sig_info res = {sig, &ret };
52408 return res;
52409 }
52410 private:
52411 compressed_pair<F,Policies> m_data;
52412 };
52413 };
52414 template <class F, class CallPolicies, class Sig>
52415 struct caller_base_select
52416 {
52417 enum { arity = mpl::size<Sig>::value - 1 };
52418 typedef typename caller_arity<arity>::template impl<F,CallPolicies,Sig> type;
52419 };
52420 template <class F, class CallPolicies, class Sig>
52421 struct caller
52422 : caller_base_select<F,CallPolicies,Sig>::type
52423 {
52424 typedef typename caller_base_select<
52425 F,CallPolicies,Sig
52426 >::type base;
52427 typedef PyObject* result_type;
52428 caller(F f, CallPolicies p) : base(f,p) {}
52429 };
52430 }}}
52431 namespace boost { namespace mpl {
52432 template< typename Tag >
52433 struct front_impl
52434 {
52435 template< typename Sequence > struct apply
52436 {
52437 typedef typename begin<Sequence>::type iter_;
52438 typedef typename deref<iter_>::type type;
52439 };
52440 };
52441 template<> struct front_impl<non_sequence_tag> {};
52442 }}
52443 namespace boost { namespace mpl {
52444 template<
52445 typename Sequence = na
52446 >
52447 struct front
52448 : front_impl< typename sequence_tag<Sequence>::type >
52449 ::template apply< Sequence >
52450 {
52451
52452 };
52453 template<> struct front< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : front< T1 > { }; }; template< typename Tag > struct lambda< front< na > , Tag , int_<-1> > { typedef false_ is_le; typedef front< na > result_; typedef front< na > type; }; namespace aux { template< typename T1 > struct template_arity< front< T1 > > : int_<1> { }; template<> struct template_arity< front< na > > : int_<-1> { }; }
52454 }}
52455 namespace boost { namespace python {
52456 template <class T> struct to_python_value;
52457 namespace detail
52458 {
52459 template <class T> struct specify_a_return_value_policy_to_wrap_functions_returning
52460 {}
52461 ;
52462 }
52463 struct default_result_converter;
52464 struct default_call_policies
52465 {
52466 template <class ArgumentPackage>
52467 static bool precall(ArgumentPackage const&)
52468 {
52469 return true;
52470 }
52471 template <class ArgumentPackage>
52472 static PyObject* postcall(ArgumentPackage const&, PyObject* result)
52473 {
52474 return result;
52475 }
52476 typedef default_result_converter result_converter;
52477 typedef PyObject* argument_package;
52478 template <class Sig>
52479 struct extract_return_type : mpl::front<Sig>
52480 {
52481 };
52482 };
52483 struct default_result_converter
52484 {
52485 template <class R>
52486 struct apply
52487 {
52488 typedef typename mpl::if_<
52489 mpl::or_<is_pointer<R>, is_reference<R> >
52490 , detail::specify_a_return_value_policy_to_wrap_functions_returning<R>
52491 , boost::python::to_python_value<
52492 typename detail::value_arg<R>::type
52493 >
52494 >::type type;
52495 };
52496 };
52497 template <>
52498 struct default_result_converter::apply<char const*>
52499 {
52500 typedef boost::python::to_python_value<char const*const&> type;
52501 };
52502 template <>
52503 struct default_result_converter::apply<PyObject*>
52504 {
52505 typedef boost::python::to_python_value<PyObject*const&> type;
52506 };
52507 }}
52508 namespace boost { namespace python { namespace objects {
52509 struct py_function_impl_base
52510 {
52511 virtual ~py_function_impl_base();
52512 virtual PyObject* operator()(PyObject*, PyObject*) = 0;
52513 virtual unsigned min_arity() const = 0;
52514 virtual unsigned max_arity() const;
52515 virtual python::detail::py_func_sig_info signature() const = 0;
52516 };
52517 template <class Caller>
52518 struct caller_py_function_impl : py_function_impl_base
52519 {
52520 caller_py_function_impl(Caller const& caller)
52521 : m_caller(caller)
52522 {}
52523 PyObject* operator()(PyObject* args, PyObject* kw)
52524 {
52525 return m_caller(args, kw);
52526 }
52527 virtual unsigned min_arity() const
52528 {
52529 return m_caller.min_arity();
52530 }
52531 virtual python::detail::py_func_sig_info signature() const
52532 {
52533 return m_caller.signature();
52534 }
52535 private:
52536 Caller m_caller;
52537 };
52538 template <class Caller, class Sig>
52539 struct signature_py_function_impl : py_function_impl_base
52540 {
52541 signature_py_function_impl(Caller const& caller)
52542 : m_caller(caller)
52543 {}
52544 PyObject* operator()(PyObject* args, PyObject* kw)
52545 {
52546 return m_caller(args, kw);
52547 }
52548 virtual unsigned min_arity() const
52549 {
52550 return mpl::size<Sig>::value - 1;
52551 }
52552 virtual python::detail::py_func_sig_info signature() const
52553 {
52554 python::detail::signature_element const* sig = python::detail::signature<Sig>::elements();
52555 python::detail::py_func_sig_info res = {sig, sig};
52556 return res;
52557 }
52558 private:
52559 Caller m_caller;
52560 };
52561 template <class Caller, class Sig>
52562 struct full_py_function_impl : py_function_impl_base
52563 {
52564 full_py_function_impl(Caller const& caller, unsigned min_arity, unsigned max_arity)
52565 : m_caller(caller)
52566 , m_min_arity(min_arity)
52567 , m_max_arity(max_arity > min_arity ? max_arity : min_arity)
52568 {}
52569 PyObject* operator()(PyObject* args, PyObject* kw)
52570 {
52571 return m_caller(args, kw);
52572 }
52573 virtual unsigned min_arity() const
52574 {
52575 return m_min_arity;
52576 }
52577 virtual unsigned max_arity() const
52578 {
52579 return m_max_arity;
52580 }
52581 virtual python::detail::py_func_sig_info signature() const
52582 {
52583 python::detail::signature_element const* sig = python::detail::signature<Sig>::elements();
52584 python::detail::py_func_sig_info res = {sig, sig};
52585 return res;
52586 }
52587 private:
52588 Caller m_caller;
52589 unsigned m_min_arity;
52590 unsigned m_max_arity;
52591 };
52592 struct py_function
52593 {
52594 template <class Caller>
52595 py_function(Caller const& caller)
52596 : m_impl(new caller_py_function_impl<Caller>(caller))
52597 {}
52598 template <class Caller, class Sig>
52599 py_function(Caller const& caller, Sig)
52600 : m_impl(new signature_py_function_impl<Caller, Sig>(caller))
52601 {}
52602 template <class Caller, class Sig>
52603 py_function(Caller const& caller, Sig, int min_arity, int max_arity = 0)
52604 : m_impl(new full_py_function_impl<Caller, Sig>(caller, min_arity, max_arity))
52605 {}
52606 py_function(py_function const& rhs)
52607 : m_impl(rhs.m_impl)
52608 {}
52609 PyObject* operator()(PyObject* args, PyObject* kw) const
52610 {
52611 return (*m_impl)(args, kw);
52612 }
52613 unsigned min_arity() const
52614 {
52615 return m_impl->min_arity();
52616 }
52617 unsigned max_arity() const
52618 {
52619 return m_impl->max_arity();
52620 }
52621 python::detail::signature_element const* signature() const
52622 {
52623 return m_impl->signature().signature;
52624 }
52625 python::detail::signature_element const& get_return_type() const
52626 {
52627 return *m_impl->signature().ret;
52628 }
52629 private:
52630 mutable std::auto_ptr<py_function_impl_base> m_impl;
52631 };
52632 }}}
52633 namespace boost { namespace python { namespace detail {
52634 template <class C1, class C2>
52635 struct most_derived
52636 {
52637 typedef typename mpl::if_<
52638 is_convertible<C1*,C2*>
52639 , C1
52640 , C2
52641 >::type type;
52642 };
52643 template <
52644 class RT >
52645 inline mpl::vector1<
52646 RT >
52647 get_signature(RT(*)(), void* = 0)
52648 {
52649 return mpl::vector1<
52650 RT
52651 >();
52652 }
52653 template <
52654 class RT, class ClassT >
52655 inline mpl::vector2<
52656 RT, ClassT& >
52657 get_signature(RT(ClassT::*)() )
52658 {
52659 return mpl::vector2<
52660 RT, ClassT&
52661 >();
52662 }
52663 template <
52664 class Target
52665 , class RT
52666 , class ClassT
52667
52668 >
52669 inline mpl::vector2<
52670 RT
52671 , typename most_derived<Target, ClassT>::type&
52672
52673 >
52674 get_signature(
52675 RT(ClassT::*)()
52676 , Target*
52677 )
52678 {
52679 return mpl::vector2<
52680 RT
52681 , typename most_derived<Target, ClassT>::type&
52682
52683 >();
52684 }
52685 template <
52686 class RT, class ClassT >
52687 inline mpl::vector2<
52688 RT, ClassT& >
52689 get_signature(RT(ClassT::*)() const)
52690 {
52691 return mpl::vector2<
52692 RT, ClassT&
52693 >();
52694 }
52695 template <
52696 class Target
52697 , class RT
52698 , class ClassT
52699
52700 >
52701 inline mpl::vector2<
52702 RT
52703 , typename most_derived<Target, ClassT>::type&
52704
52705 >
52706 get_signature(
52707 RT(ClassT::*)() const
52708 , Target*
52709 )
52710 {
52711 return mpl::vector2<
52712 RT
52713 , typename most_derived<Target, ClassT>::type&
52714
52715 >();
52716 }
52717 template <
52718 class RT, class ClassT >
52719 inline mpl::vector2<
52720 RT, ClassT& >
52721 get_signature(RT(ClassT::*)() volatile)
52722 {
52723 return mpl::vector2<
52724 RT, ClassT&
52725 >();
52726 }
52727 template <
52728 class Target
52729 , class RT
52730 , class ClassT
52731
52732 >
52733 inline mpl::vector2<
52734 RT
52735 , typename most_derived<Target, ClassT>::type&
52736
52737 >
52738 get_signature(
52739 RT(ClassT::*)() volatile
52740 , Target*
52741 )
52742 {
52743 return mpl::vector2<
52744 RT
52745 , typename most_derived<Target, ClassT>::type&
52746
52747 >();
52748 }
52749 template <
52750 class RT, class ClassT >
52751 inline mpl::vector2<
52752 RT, ClassT& >
52753 get_signature(RT(ClassT::*)() const volatile)
52754 {
52755 return mpl::vector2<
52756 RT, ClassT&
52757 >();
52758 }
52759 template <
52760 class Target
52761 , class RT
52762 , class ClassT
52763
52764 >
52765 inline mpl::vector2<
52766 RT
52767 , typename most_derived<Target, ClassT>::type&
52768
52769 >
52770 get_signature(
52771 RT(ClassT::*)() const volatile
52772 , Target*
52773 )
52774 {
52775 return mpl::vector2<
52776 RT
52777 , typename most_derived<Target, ClassT>::type&
52778
52779 >();
52780 }
52781 template <
52782 class RT , class T0>
52783 inline mpl::vector2<
52784 RT , T0>
52785 get_signature(RT(*)( T0), void* = 0)
52786 {
52787 return mpl::vector2<
52788 RT , T0
52789 >();
52790 }
52791 template <
52792 class RT, class ClassT , class T0>
52793 inline mpl::vector3<
52794 RT, ClassT& , T0>
52795 get_signature(RT(ClassT::*)( T0) )
52796 {
52797 return mpl::vector3<
52798 RT, ClassT& , T0
52799 >();
52800 }
52801 template <
52802 class Target
52803 , class RT
52804 , class ClassT
52805 , class T0
52806 >
52807 inline mpl::vector3<
52808 RT
52809 , typename most_derived<Target, ClassT>::type&
52810 , T0
52811 >
52812 get_signature(
52813 RT(ClassT::*)( T0)
52814 , Target*
52815 )
52816 {
52817 return mpl::vector3<
52818 RT
52819 , typename most_derived<Target, ClassT>::type&
52820 , T0
52821 >();
52822 }
52823 template <
52824 class RT, class ClassT , class T0>
52825 inline mpl::vector3<
52826 RT, ClassT& , T0>
52827 get_signature(RT(ClassT::*)( T0) const)
52828 {
52829 return mpl::vector3<
52830 RT, ClassT& , T0
52831 >();
52832 }
52833 template <
52834 class Target
52835 , class RT
52836 , class ClassT
52837 , class T0
52838 >
52839 inline mpl::vector3<
52840 RT
52841 , typename most_derived<Target, ClassT>::type&
52842 , T0
52843 >
52844 get_signature(
52845 RT(ClassT::*)( T0) const
52846 , Target*
52847 )
52848 {
52849 return mpl::vector3<
52850 RT
52851 , typename most_derived<Target, ClassT>::type&
52852 , T0
52853 >();
52854 }
52855 template <
52856 class RT, class ClassT , class T0>
52857 inline mpl::vector3<
52858 RT, ClassT& , T0>
52859 get_signature(RT(ClassT::*)( T0) volatile)
52860 {
52861 return mpl::vector3<
52862 RT, ClassT& , T0
52863 >();
52864 }
52865 template <
52866 class Target
52867 , class RT
52868 , class ClassT
52869 , class T0
52870 >
52871 inline mpl::vector3<
52872 RT
52873 , typename most_derived<Target, ClassT>::type&
52874 , T0
52875 >
52876 get_signature(
52877 RT(ClassT::*)( T0) volatile
52878 , Target*
52879 )
52880 {
52881 return mpl::vector3<
52882 RT
52883 , typename most_derived<Target, ClassT>::type&
52884 , T0
52885 >();
52886 }
52887 template <
52888 class RT, class ClassT , class T0>
52889 inline mpl::vector3<
52890 RT, ClassT& , T0>
52891 get_signature(RT(ClassT::*)( T0) const volatile)
52892 {
52893 return mpl::vector3<
52894 RT, ClassT& , T0
52895 >();
52896 }
52897 template <
52898 class Target
52899 , class RT
52900 , class ClassT
52901 , class T0
52902 >
52903 inline mpl::vector3<
52904 RT
52905 , typename most_derived<Target, ClassT>::type&
52906 , T0
52907 >
52908 get_signature(
52909 RT(ClassT::*)( T0) const volatile
52910 , Target*
52911 )
52912 {
52913 return mpl::vector3<
52914 RT
52915 , typename most_derived<Target, ClassT>::type&
52916 , T0
52917 >();
52918 }
52919 template <
52920 class RT , class T0 , class T1>
52921 inline mpl::vector3<
52922 RT , T0 , T1>
52923 get_signature(RT(*)( T0 , T1), void* = 0)
52924 {
52925 return mpl::vector3<
52926 RT , T0 , T1
52927 >();
52928 }
52929 template <
52930 class RT, class ClassT , class T0 , class T1>
52931 inline mpl::vector4<
52932 RT, ClassT& , T0 , T1>
52933 get_signature(RT(ClassT::*)( T0 , T1) )
52934 {
52935 return mpl::vector4<
52936 RT, ClassT& , T0 , T1
52937 >();
52938 }
52939 template <
52940 class Target
52941 , class RT
52942 , class ClassT
52943 , class T0 , class T1
52944 >
52945 inline mpl::vector4<
52946 RT
52947 , typename most_derived<Target, ClassT>::type&
52948 , T0 , T1
52949 >
52950 get_signature(
52951 RT(ClassT::*)( T0 , T1)
52952 , Target*
52953 )
52954 {
52955 return mpl::vector4<
52956 RT
52957 , typename most_derived<Target, ClassT>::type&
52958 , T0 , T1
52959 >();
52960 }
52961 template <
52962 class RT, class ClassT , class T0 , class T1>
52963 inline mpl::vector4<
52964 RT, ClassT& , T0 , T1>
52965 get_signature(RT(ClassT::*)( T0 , T1) const)
52966 {
52967 return mpl::vector4<
52968 RT, ClassT& , T0 , T1
52969 >();
52970 }
52971 template <
52972 class Target
52973 , class RT
52974 , class ClassT
52975 , class T0 , class T1
52976 >
52977 inline mpl::vector4<
52978 RT
52979 , typename most_derived<Target, ClassT>::type&
52980 , T0 , T1
52981 >
52982 get_signature(
52983 RT(ClassT::*)( T0 , T1) const
52984 , Target*
52985 )
52986 {
52987 return mpl::vector4<
52988 RT
52989 , typename most_derived<Target, ClassT>::type&
52990 , T0 , T1
52991 >();
52992 }
52993 template <
52994 class RT, class ClassT , class T0 , class T1>
52995 inline mpl::vector4<
52996 RT, ClassT& , T0 , T1>
52997 get_signature(RT(ClassT::*)( T0 , T1) volatile)
52998 {
52999 return mpl::vector4<
53000 RT, ClassT& , T0 , T1
53001 >();
53002 }
53003 template <
53004 class Target
53005 , class RT
53006 , class ClassT
53007 , class T0 , class T1
53008 >
53009 inline mpl::vector4<
53010 RT
53011 , typename most_derived<Target, ClassT>::type&
53012 , T0 , T1
53013 >
53014 get_signature(
53015 RT(ClassT::*)( T0 , T1) volatile
53016 , Target*
53017 )
53018 {
53019 return mpl::vector4<
53020 RT
53021 , typename most_derived<Target, ClassT>::type&
53022 , T0 , T1
53023 >();
53024 }
53025 template <
53026 class RT, class ClassT , class T0 , class T1>
53027 inline mpl::vector4<
53028 RT, ClassT& , T0 , T1>
53029 get_signature(RT(ClassT::*)( T0 , T1) const volatile)
53030 {
53031 return mpl::vector4<
53032 RT, ClassT& , T0 , T1
53033 >();
53034 }
53035 template <
53036 class Target
53037 , class RT
53038 , class ClassT
53039 , class T0 , class T1
53040 >
53041 inline mpl::vector4<
53042 RT
53043 , typename most_derived<Target, ClassT>::type&
53044 , T0 , T1
53045 >
53046 get_signature(
53047 RT(ClassT::*)( T0 , T1) const volatile
53048 , Target*
53049 )
53050 {
53051 return mpl::vector4<
53052 RT
53053 , typename most_derived<Target, ClassT>::type&
53054 , T0 , T1
53055 >();
53056 }
53057 template <
53058 class RT , class T0 , class T1 , class T2>
53059 inline mpl::vector4<
53060 RT , T0 , T1 , T2>
53061 get_signature(RT(*)( T0 , T1 , T2), void* = 0)
53062 {
53063 return mpl::vector4<
53064 RT , T0 , T1 , T2
53065 >();
53066 }
53067 template <
53068 class RT, class ClassT , class T0 , class T1 , class T2>
53069 inline mpl::vector5<
53070 RT, ClassT& , T0 , T1 , T2>
53071 get_signature(RT(ClassT::*)( T0 , T1 , T2) )
53072 {
53073 return mpl::vector5<
53074 RT, ClassT& , T0 , T1 , T2
53075 >();
53076 }
53077 template <
53078 class Target
53079 , class RT
53080 , class ClassT
53081 , class T0 , class T1 , class T2
53082 >
53083 inline mpl::vector5<
53084 RT
53085 , typename most_derived<Target, ClassT>::type&
53086 , T0 , T1 , T2
53087 >
53088 get_signature(
53089 RT(ClassT::*)( T0 , T1 , T2)
53090 , Target*
53091 )
53092 {
53093 return mpl::vector5<
53094 RT
53095 , typename most_derived<Target, ClassT>::type&
53096 , T0 , T1 , T2
53097 >();
53098 }
53099 template <
53100 class RT, class ClassT , class T0 , class T1 , class T2>
53101 inline mpl::vector5<
53102 RT, ClassT& , T0 , T1 , T2>
53103 get_signature(RT(ClassT::*)( T0 , T1 , T2) const)
53104 {
53105 return mpl::vector5<
53106 RT, ClassT& , T0 , T1 , T2
53107 >();
53108 }
53109 template <
53110 class Target
53111 , class RT
53112 , class ClassT
53113 , class T0 , class T1 , class T2
53114 >
53115 inline mpl::vector5<
53116 RT
53117 , typename most_derived<Target, ClassT>::type&
53118 , T0 , T1 , T2
53119 >
53120 get_signature(
53121 RT(ClassT::*)( T0 , T1 , T2) const
53122 , Target*
53123 )
53124 {
53125 return mpl::vector5<
53126 RT
53127 , typename most_derived<Target, ClassT>::type&
53128 , T0 , T1 , T2
53129 >();
53130 }
53131 template <
53132 class RT, class ClassT , class T0 , class T1 , class T2>
53133 inline mpl::vector5<
53134 RT, ClassT& , T0 , T1 , T2>
53135 get_signature(RT(ClassT::*)( T0 , T1 , T2) volatile)
53136 {
53137 return mpl::vector5<
53138 RT, ClassT& , T0 , T1 , T2
53139 >();
53140 }
53141 template <
53142 class Target
53143 , class RT
53144 , class ClassT
53145 , class T0 , class T1 , class T2
53146 >
53147 inline mpl::vector5<
53148 RT
53149 , typename most_derived<Target, ClassT>::type&
53150 , T0 , T1 , T2
53151 >
53152 get_signature(
53153 RT(ClassT::*)( T0 , T1 , T2) volatile
53154 , Target*
53155 )
53156 {
53157 return mpl::vector5<
53158 RT
53159 , typename most_derived<Target, ClassT>::type&
53160 , T0 , T1 , T2
53161 >();
53162 }
53163 template <
53164 class RT, class ClassT , class T0 , class T1 , class T2>
53165 inline mpl::vector5<
53166 RT, ClassT& , T0 , T1 , T2>
53167 get_signature(RT(ClassT::*)( T0 , T1 , T2) const volatile)
53168 {
53169 return mpl::vector5<
53170 RT, ClassT& , T0 , T1 , T2
53171 >();
53172 }
53173 template <
53174 class Target
53175 , class RT
53176 , class ClassT
53177 , class T0 , class T1 , class T2
53178 >
53179 inline mpl::vector5<
53180 RT
53181 , typename most_derived<Target, ClassT>::type&
53182 , T0 , T1 , T2
53183 >
53184 get_signature(
53185 RT(ClassT::*)( T0 , T1 , T2) const volatile
53186 , Target*
53187 )
53188 {
53189 return mpl::vector5<
53190 RT
53191 , typename most_derived<Target, ClassT>::type&
53192 , T0 , T1 , T2
53193 >();
53194 }
53195 template <
53196 class RT , class T0 , class T1 , class T2 , class T3>
53197 inline mpl::vector5<
53198 RT , T0 , T1 , T2 , T3>
53199 get_signature(RT(*)( T0 , T1 , T2 , T3), void* = 0)
53200 {
53201 return mpl::vector5<
53202 RT , T0 , T1 , T2 , T3
53203 >();
53204 }
53205 template <
53206 class RT, class ClassT , class T0 , class T1 , class T2 , class T3>
53207 inline mpl::vector6<
53208 RT, ClassT& , T0 , T1 , T2 , T3>
53209 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3) )
53210 {
53211 return mpl::vector6<
53212 RT, ClassT& , T0 , T1 , T2 , T3
53213 >();
53214 }
53215 template <
53216 class Target
53217 , class RT
53218 , class ClassT
53219 , class T0 , class T1 , class T2 , class T3
53220 >
53221 inline mpl::vector6<
53222 RT
53223 , typename most_derived<Target, ClassT>::type&
53224 , T0 , T1 , T2 , T3
53225 >
53226 get_signature(
53227 RT(ClassT::*)( T0 , T1 , T2 , T3)
53228 , Target*
53229 )
53230 {
53231 return mpl::vector6<
53232 RT
53233 , typename most_derived<Target, ClassT>::type&
53234 , T0 , T1 , T2 , T3
53235 >();
53236 }
53237 template <
53238 class RT, class ClassT , class T0 , class T1 , class T2 , class T3>
53239 inline mpl::vector6<
53240 RT, ClassT& , T0 , T1 , T2 , T3>
53241 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3) const)
53242 {
53243 return mpl::vector6<
53244 RT, ClassT& , T0 , T1 , T2 , T3
53245 >();
53246 }
53247 template <
53248 class Target
53249 , class RT
53250 , class ClassT
53251 , class T0 , class T1 , class T2 , class T3
53252 >
53253 inline mpl::vector6<
53254 RT
53255 , typename most_derived<Target, ClassT>::type&
53256 , T0 , T1 , T2 , T3
53257 >
53258 get_signature(
53259 RT(ClassT::*)( T0 , T1 , T2 , T3) const
53260 , Target*
53261 )
53262 {
53263 return mpl::vector6<
53264 RT
53265 , typename most_derived<Target, ClassT>::type&
53266 , T0 , T1 , T2 , T3
53267 >();
53268 }
53269 template <
53270 class RT, class ClassT , class T0 , class T1 , class T2 , class T3>
53271 inline mpl::vector6<
53272 RT, ClassT& , T0 , T1 , T2 , T3>
53273 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3) volatile)
53274 {
53275 return mpl::vector6<
53276 RT, ClassT& , T0 , T1 , T2 , T3
53277 >();
53278 }
53279 template <
53280 class Target
53281 , class RT
53282 , class ClassT
53283 , class T0 , class T1 , class T2 , class T3
53284 >
53285 inline mpl::vector6<
53286 RT
53287 , typename most_derived<Target, ClassT>::type&
53288 , T0 , T1 , T2 , T3
53289 >
53290 get_signature(
53291 RT(ClassT::*)( T0 , T1 , T2 , T3) volatile
53292 , Target*
53293 )
53294 {
53295 return mpl::vector6<
53296 RT
53297 , typename most_derived<Target, ClassT>::type&
53298 , T0 , T1 , T2 , T3
53299 >();
53300 }
53301 template <
53302 class RT, class ClassT , class T0 , class T1 , class T2 , class T3>
53303 inline mpl::vector6<
53304 RT, ClassT& , T0 , T1 , T2 , T3>
53305 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3) const volatile)
53306 {
53307 return mpl::vector6<
53308 RT, ClassT& , T0 , T1 , T2 , T3
53309 >();
53310 }
53311 template <
53312 class Target
53313 , class RT
53314 , class ClassT
53315 , class T0 , class T1 , class T2 , class T3
53316 >
53317 inline mpl::vector6<
53318 RT
53319 , typename most_derived<Target, ClassT>::type&
53320 , T0 , T1 , T2 , T3
53321 >
53322 get_signature(
53323 RT(ClassT::*)( T0 , T1 , T2 , T3) const volatile
53324 , Target*
53325 )
53326 {
53327 return mpl::vector6<
53328 RT
53329 , typename most_derived<Target, ClassT>::type&
53330 , T0 , T1 , T2 , T3
53331 >();
53332 }
53333 template <
53334 class RT , class T0 , class T1 , class T2 , class T3 , class T4>
53335 inline mpl::vector6<
53336 RT , T0 , T1 , T2 , T3 , T4>
53337 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4), void* = 0)
53338 {
53339 return mpl::vector6<
53340 RT , T0 , T1 , T2 , T3 , T4
53341 >();
53342 }
53343 template <
53344 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4>
53345 inline mpl::vector7<
53346 RT, ClassT& , T0 , T1 , T2 , T3 , T4>
53347 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) )
53348 {
53349 return mpl::vector7<
53350 RT, ClassT& , T0 , T1 , T2 , T3 , T4
53351 >();
53352 }
53353 template <
53354 class Target
53355 , class RT
53356 , class ClassT
53357 , class T0 , class T1 , class T2 , class T3 , class T4
53358 >
53359 inline mpl::vector7<
53360 RT
53361 , typename most_derived<Target, ClassT>::type&
53362 , T0 , T1 , T2 , T3 , T4
53363 >
53364 get_signature(
53365 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4)
53366 , Target*
53367 )
53368 {
53369 return mpl::vector7<
53370 RT
53371 , typename most_derived<Target, ClassT>::type&
53372 , T0 , T1 , T2 , T3 , T4
53373 >();
53374 }
53375 template <
53376 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4>
53377 inline mpl::vector7<
53378 RT, ClassT& , T0 , T1 , T2 , T3 , T4>
53379 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) const)
53380 {
53381 return mpl::vector7<
53382 RT, ClassT& , T0 , T1 , T2 , T3 , T4
53383 >();
53384 }
53385 template <
53386 class Target
53387 , class RT
53388 , class ClassT
53389 , class T0 , class T1 , class T2 , class T3 , class T4
53390 >
53391 inline mpl::vector7<
53392 RT
53393 , typename most_derived<Target, ClassT>::type&
53394 , T0 , T1 , T2 , T3 , T4
53395 >
53396 get_signature(
53397 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) const
53398 , Target*
53399 )
53400 {
53401 return mpl::vector7<
53402 RT
53403 , typename most_derived<Target, ClassT>::type&
53404 , T0 , T1 , T2 , T3 , T4
53405 >();
53406 }
53407 template <
53408 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4>
53409 inline mpl::vector7<
53410 RT, ClassT& , T0 , T1 , T2 , T3 , T4>
53411 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) volatile)
53412 {
53413 return mpl::vector7<
53414 RT, ClassT& , T0 , T1 , T2 , T3 , T4
53415 >();
53416 }
53417 template <
53418 class Target
53419 , class RT
53420 , class ClassT
53421 , class T0 , class T1 , class T2 , class T3 , class T4
53422 >
53423 inline mpl::vector7<
53424 RT
53425 , typename most_derived<Target, ClassT>::type&
53426 , T0 , T1 , T2 , T3 , T4
53427 >
53428 get_signature(
53429 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) volatile
53430 , Target*
53431 )
53432 {
53433 return mpl::vector7<
53434 RT
53435 , typename most_derived<Target, ClassT>::type&
53436 , T0 , T1 , T2 , T3 , T4
53437 >();
53438 }
53439 template <
53440 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4>
53441 inline mpl::vector7<
53442 RT, ClassT& , T0 , T1 , T2 , T3 , T4>
53443 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) const volatile)
53444 {
53445 return mpl::vector7<
53446 RT, ClassT& , T0 , T1 , T2 , T3 , T4
53447 >();
53448 }
53449 template <
53450 class Target
53451 , class RT
53452 , class ClassT
53453 , class T0 , class T1 , class T2 , class T3 , class T4
53454 >
53455 inline mpl::vector7<
53456 RT
53457 , typename most_derived<Target, ClassT>::type&
53458 , T0 , T1 , T2 , T3 , T4
53459 >
53460 get_signature(
53461 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4) const volatile
53462 , Target*
53463 )
53464 {
53465 return mpl::vector7<
53466 RT
53467 , typename most_derived<Target, ClassT>::type&
53468 , T0 , T1 , T2 , T3 , T4
53469 >();
53470 }
53471 template <
53472 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
53473 inline mpl::vector7<
53474 RT , T0 , T1 , T2 , T3 , T4 , T5>
53475 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5), void* = 0)
53476 {
53477 return mpl::vector7<
53478 RT , T0 , T1 , T2 , T3 , T4 , T5
53479 >();
53480 }
53481 template <
53482 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
53483 inline mpl::vector8<
53484 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5>
53485 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) )
53486 {
53487 return mpl::vector8<
53488 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5
53489 >();
53490 }
53491 template <
53492 class Target
53493 , class RT
53494 , class ClassT
53495 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5
53496 >
53497 inline mpl::vector8<
53498 RT
53499 , typename most_derived<Target, ClassT>::type&
53500 , T0 , T1 , T2 , T3 , T4 , T5
53501 >
53502 get_signature(
53503 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5)
53504 , Target*
53505 )
53506 {
53507 return mpl::vector8<
53508 RT
53509 , typename most_derived<Target, ClassT>::type&
53510 , T0 , T1 , T2 , T3 , T4 , T5
53511 >();
53512 }
53513 template <
53514 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
53515 inline mpl::vector8<
53516 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5>
53517 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) const)
53518 {
53519 return mpl::vector8<
53520 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5
53521 >();
53522 }
53523 template <
53524 class Target
53525 , class RT
53526 , class ClassT
53527 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5
53528 >
53529 inline mpl::vector8<
53530 RT
53531 , typename most_derived<Target, ClassT>::type&
53532 , T0 , T1 , T2 , T3 , T4 , T5
53533 >
53534 get_signature(
53535 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) const
53536 , Target*
53537 )
53538 {
53539 return mpl::vector8<
53540 RT
53541 , typename most_derived<Target, ClassT>::type&
53542 , T0 , T1 , T2 , T3 , T4 , T5
53543 >();
53544 }
53545 template <
53546 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
53547 inline mpl::vector8<
53548 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5>
53549 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) volatile)
53550 {
53551 return mpl::vector8<
53552 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5
53553 >();
53554 }
53555 template <
53556 class Target
53557 , class RT
53558 , class ClassT
53559 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5
53560 >
53561 inline mpl::vector8<
53562 RT
53563 , typename most_derived<Target, ClassT>::type&
53564 , T0 , T1 , T2 , T3 , T4 , T5
53565 >
53566 get_signature(
53567 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) volatile
53568 , Target*
53569 )
53570 {
53571 return mpl::vector8<
53572 RT
53573 , typename most_derived<Target, ClassT>::type&
53574 , T0 , T1 , T2 , T3 , T4 , T5
53575 >();
53576 }
53577 template <
53578 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5>
53579 inline mpl::vector8<
53580 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5>
53581 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) const volatile)
53582 {
53583 return mpl::vector8<
53584 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5
53585 >();
53586 }
53587 template <
53588 class Target
53589 , class RT
53590 , class ClassT
53591 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5
53592 >
53593 inline mpl::vector8<
53594 RT
53595 , typename most_derived<Target, ClassT>::type&
53596 , T0 , T1 , T2 , T3 , T4 , T5
53597 >
53598 get_signature(
53599 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5) const volatile
53600 , Target*
53601 )
53602 {
53603 return mpl::vector8<
53604 RT
53605 , typename most_derived<Target, ClassT>::type&
53606 , T0 , T1 , T2 , T3 , T4 , T5
53607 >();
53608 }
53609 template <
53610 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
53611 inline mpl::vector8<
53612 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6>
53613 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6), void* = 0)
53614 {
53615 return mpl::vector8<
53616 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6
53617 >();
53618 }
53619 template <
53620 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
53621 inline mpl::vector9<
53622 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6>
53623 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) )
53624 {
53625 return mpl::vector9<
53626 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6
53627 >();
53628 }
53629 template <
53630 class Target
53631 , class RT
53632 , class ClassT
53633 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6
53634 >
53635 inline mpl::vector9<
53636 RT
53637 , typename most_derived<Target, ClassT>::type&
53638 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53639 >
53640 get_signature(
53641 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6)
53642 , Target*
53643 )
53644 {
53645 return mpl::vector9<
53646 RT
53647 , typename most_derived<Target, ClassT>::type&
53648 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53649 >();
53650 }
53651 template <
53652 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
53653 inline mpl::vector9<
53654 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6>
53655 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) const)
53656 {
53657 return mpl::vector9<
53658 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6
53659 >();
53660 }
53661 template <
53662 class Target
53663 , class RT
53664 , class ClassT
53665 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6
53666 >
53667 inline mpl::vector9<
53668 RT
53669 , typename most_derived<Target, ClassT>::type&
53670 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53671 >
53672 get_signature(
53673 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) const
53674 , Target*
53675 )
53676 {
53677 return mpl::vector9<
53678 RT
53679 , typename most_derived<Target, ClassT>::type&
53680 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53681 >();
53682 }
53683 template <
53684 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
53685 inline mpl::vector9<
53686 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6>
53687 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) volatile)
53688 {
53689 return mpl::vector9<
53690 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6
53691 >();
53692 }
53693 template <
53694 class Target
53695 , class RT
53696 , class ClassT
53697 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6
53698 >
53699 inline mpl::vector9<
53700 RT
53701 , typename most_derived<Target, ClassT>::type&
53702 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53703 >
53704 get_signature(
53705 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) volatile
53706 , Target*
53707 )
53708 {
53709 return mpl::vector9<
53710 RT
53711 , typename most_derived<Target, ClassT>::type&
53712 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53713 >();
53714 }
53715 template <
53716 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6>
53717 inline mpl::vector9<
53718 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6>
53719 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) const volatile)
53720 {
53721 return mpl::vector9<
53722 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6
53723 >();
53724 }
53725 template <
53726 class Target
53727 , class RT
53728 , class ClassT
53729 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6
53730 >
53731 inline mpl::vector9<
53732 RT
53733 , typename most_derived<Target, ClassT>::type&
53734 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53735 >
53736 get_signature(
53737 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6) const volatile
53738 , Target*
53739 )
53740 {
53741 return mpl::vector9<
53742 RT
53743 , typename most_derived<Target, ClassT>::type&
53744 , T0 , T1 , T2 , T3 , T4 , T5 , T6
53745 >();
53746 }
53747 template <
53748 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
53749 inline mpl::vector9<
53750 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>
53751 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7), void* = 0)
53752 {
53753 return mpl::vector9<
53754 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53755 >();
53756 }
53757 template <
53758 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
53759 inline mpl::vector10<
53760 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>
53761 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) )
53762 {
53763 return mpl::vector10<
53764 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53765 >();
53766 }
53767 template <
53768 class Target
53769 , class RT
53770 , class ClassT
53771 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7
53772 >
53773 inline mpl::vector10<
53774 RT
53775 , typename most_derived<Target, ClassT>::type&
53776 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53777 >
53778 get_signature(
53779 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7)
53780 , Target*
53781 )
53782 {
53783 return mpl::vector10<
53784 RT
53785 , typename most_derived<Target, ClassT>::type&
53786 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53787 >();
53788 }
53789 template <
53790 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
53791 inline mpl::vector10<
53792 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>
53793 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) const)
53794 {
53795 return mpl::vector10<
53796 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53797 >();
53798 }
53799 template <
53800 class Target
53801 , class RT
53802 , class ClassT
53803 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7
53804 >
53805 inline mpl::vector10<
53806 RT
53807 , typename most_derived<Target, ClassT>::type&
53808 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53809 >
53810 get_signature(
53811 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) const
53812 , Target*
53813 )
53814 {
53815 return mpl::vector10<
53816 RT
53817 , typename most_derived<Target, ClassT>::type&
53818 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53819 >();
53820 }
53821 template <
53822 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
53823 inline mpl::vector10<
53824 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>
53825 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) volatile)
53826 {
53827 return mpl::vector10<
53828 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53829 >();
53830 }
53831 template <
53832 class Target
53833 , class RT
53834 , class ClassT
53835 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7
53836 >
53837 inline mpl::vector10<
53838 RT
53839 , typename most_derived<Target, ClassT>::type&
53840 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53841 >
53842 get_signature(
53843 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) volatile
53844 , Target*
53845 )
53846 {
53847 return mpl::vector10<
53848 RT
53849 , typename most_derived<Target, ClassT>::type&
53850 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53851 >();
53852 }
53853 template <
53854 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7>
53855 inline mpl::vector10<
53856 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>
53857 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) const volatile)
53858 {
53859 return mpl::vector10<
53860 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53861 >();
53862 }
53863 template <
53864 class Target
53865 , class RT
53866 , class ClassT
53867 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7
53868 >
53869 inline mpl::vector10<
53870 RT
53871 , typename most_derived<Target, ClassT>::type&
53872 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53873 >
53874 get_signature(
53875 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7) const volatile
53876 , Target*
53877 )
53878 {
53879 return mpl::vector10<
53880 RT
53881 , typename most_derived<Target, ClassT>::type&
53882 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7
53883 >();
53884 }
53885 template <
53886 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
53887 inline mpl::vector10<
53888 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>
53889 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8), void* = 0)
53890 {
53891 return mpl::vector10<
53892 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53893 >();
53894 }
53895 template <
53896 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
53897 inline mpl::vector11<
53898 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>
53899 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) )
53900 {
53901 return mpl::vector11<
53902 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53903 >();
53904 }
53905 template <
53906 class Target
53907 , class RT
53908 , class ClassT
53909 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8
53910 >
53911 inline mpl::vector11<
53912 RT
53913 , typename most_derived<Target, ClassT>::type&
53914 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53915 >
53916 get_signature(
53917 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8)
53918 , Target*
53919 )
53920 {
53921 return mpl::vector11<
53922 RT
53923 , typename most_derived<Target, ClassT>::type&
53924 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53925 >();
53926 }
53927 template <
53928 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
53929 inline mpl::vector11<
53930 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>
53931 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) const)
53932 {
53933 return mpl::vector11<
53934 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53935 >();
53936 }
53937 template <
53938 class Target
53939 , class RT
53940 , class ClassT
53941 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8
53942 >
53943 inline mpl::vector11<
53944 RT
53945 , typename most_derived<Target, ClassT>::type&
53946 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53947 >
53948 get_signature(
53949 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) const
53950 , Target*
53951 )
53952 {
53953 return mpl::vector11<
53954 RT
53955 , typename most_derived<Target, ClassT>::type&
53956 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53957 >();
53958 }
53959 template <
53960 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
53961 inline mpl::vector11<
53962 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>
53963 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) volatile)
53964 {
53965 return mpl::vector11<
53966 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53967 >();
53968 }
53969 template <
53970 class Target
53971 , class RT
53972 , class ClassT
53973 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8
53974 >
53975 inline mpl::vector11<
53976 RT
53977 , typename most_derived<Target, ClassT>::type&
53978 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53979 >
53980 get_signature(
53981 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) volatile
53982 , Target*
53983 )
53984 {
53985 return mpl::vector11<
53986 RT
53987 , typename most_derived<Target, ClassT>::type&
53988 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53989 >();
53990 }
53991 template <
53992 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8>
53993 inline mpl::vector11<
53994 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>
53995 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) const volatile)
53996 {
53997 return mpl::vector11<
53998 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
53999 >();
54000 }
54001 template <
54002 class Target
54003 , class RT
54004 , class ClassT
54005 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8
54006 >
54007 inline mpl::vector11<
54008 RT
54009 , typename most_derived<Target, ClassT>::type&
54010 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
54011 >
54012 get_signature(
54013 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8) const volatile
54014 , Target*
54015 )
54016 {
54017 return mpl::vector11<
54018 RT
54019 , typename most_derived<Target, ClassT>::type&
54020 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8
54021 >();
54022 }
54023 template <
54024 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
54025 inline mpl::vector11<
54026 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
54027 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9), void* = 0)
54028 {
54029 return mpl::vector11<
54030 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54031 >();
54032 }
54033 template <
54034 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
54035 inline mpl::vector12<
54036 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
54037 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) )
54038 {
54039 return mpl::vector12<
54040 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54041 >();
54042 }
54043 template <
54044 class Target
54045 , class RT
54046 , class ClassT
54047 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9
54048 >
54049 inline mpl::vector12<
54050 RT
54051 , typename most_derived<Target, ClassT>::type&
54052 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54053 >
54054 get_signature(
54055 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9)
54056 , Target*
54057 )
54058 {
54059 return mpl::vector12<
54060 RT
54061 , typename most_derived<Target, ClassT>::type&
54062 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54063 >();
54064 }
54065 template <
54066 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
54067 inline mpl::vector12<
54068 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
54069 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) const)
54070 {
54071 return mpl::vector12<
54072 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54073 >();
54074 }
54075 template <
54076 class Target
54077 , class RT
54078 , class ClassT
54079 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9
54080 >
54081 inline mpl::vector12<
54082 RT
54083 , typename most_derived<Target, ClassT>::type&
54084 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54085 >
54086 get_signature(
54087 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) const
54088 , Target*
54089 )
54090 {
54091 return mpl::vector12<
54092 RT
54093 , typename most_derived<Target, ClassT>::type&
54094 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54095 >();
54096 }
54097 template <
54098 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
54099 inline mpl::vector12<
54100 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
54101 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) volatile)
54102 {
54103 return mpl::vector12<
54104 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54105 >();
54106 }
54107 template <
54108 class Target
54109 , class RT
54110 , class ClassT
54111 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9
54112 >
54113 inline mpl::vector12<
54114 RT
54115 , typename most_derived<Target, ClassT>::type&
54116 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54117 >
54118 get_signature(
54119 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) volatile
54120 , Target*
54121 )
54122 {
54123 return mpl::vector12<
54124 RT
54125 , typename most_derived<Target, ClassT>::type&
54126 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54127 >();
54128 }
54129 template <
54130 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9>
54131 inline mpl::vector12<
54132 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
54133 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) const volatile)
54134 {
54135 return mpl::vector12<
54136 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54137 >();
54138 }
54139 template <
54140 class Target
54141 , class RT
54142 , class ClassT
54143 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9
54144 >
54145 inline mpl::vector12<
54146 RT
54147 , typename most_derived<Target, ClassT>::type&
54148 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54149 >
54150 get_signature(
54151 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9) const volatile
54152 , Target*
54153 )
54154 {
54155 return mpl::vector12<
54156 RT
54157 , typename most_derived<Target, ClassT>::type&
54158 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9
54159 >();
54160 }
54161 template <
54162 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
54163 inline mpl::vector12<
54164 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10>
54165 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10), void* = 0)
54166 {
54167 return mpl::vector12<
54168 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54169 >();
54170 }
54171 template <
54172 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
54173 inline mpl::vector13<
54174 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10>
54175 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) )
54176 {
54177 return mpl::vector13<
54178 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54179 >();
54180 }
54181 template <
54182 class Target
54183 , class RT
54184 , class ClassT
54185 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10
54186 >
54187 inline mpl::vector13<
54188 RT
54189 , typename most_derived<Target, ClassT>::type&
54190 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54191 >
54192 get_signature(
54193 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10)
54194 , Target*
54195 )
54196 {
54197 return mpl::vector13<
54198 RT
54199 , typename most_derived<Target, ClassT>::type&
54200 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54201 >();
54202 }
54203 template <
54204 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
54205 inline mpl::vector13<
54206 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10>
54207 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) const)
54208 {
54209 return mpl::vector13<
54210 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54211 >();
54212 }
54213 template <
54214 class Target
54215 , class RT
54216 , class ClassT
54217 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10
54218 >
54219 inline mpl::vector13<
54220 RT
54221 , typename most_derived<Target, ClassT>::type&
54222 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54223 >
54224 get_signature(
54225 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) const
54226 , Target*
54227 )
54228 {
54229 return mpl::vector13<
54230 RT
54231 , typename most_derived<Target, ClassT>::type&
54232 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54233 >();
54234 }
54235 template <
54236 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
54237 inline mpl::vector13<
54238 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10>
54239 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) volatile)
54240 {
54241 return mpl::vector13<
54242 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54243 >();
54244 }
54245 template <
54246 class Target
54247 , class RT
54248 , class ClassT
54249 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10
54250 >
54251 inline mpl::vector13<
54252 RT
54253 , typename most_derived<Target, ClassT>::type&
54254 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54255 >
54256 get_signature(
54257 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) volatile
54258 , Target*
54259 )
54260 {
54261 return mpl::vector13<
54262 RT
54263 , typename most_derived<Target, ClassT>::type&
54264 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54265 >();
54266 }
54267 template <
54268 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10>
54269 inline mpl::vector13<
54270 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10>
54271 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) const volatile)
54272 {
54273 return mpl::vector13<
54274 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54275 >();
54276 }
54277 template <
54278 class Target
54279 , class RT
54280 , class ClassT
54281 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10
54282 >
54283 inline mpl::vector13<
54284 RT
54285 , typename most_derived<Target, ClassT>::type&
54286 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54287 >
54288 get_signature(
54289 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10) const volatile
54290 , Target*
54291 )
54292 {
54293 return mpl::vector13<
54294 RT
54295 , typename most_derived<Target, ClassT>::type&
54296 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10
54297 >();
54298 }
54299 template <
54300 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
54301 inline mpl::vector13<
54302 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11>
54303 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11), void* = 0)
54304 {
54305 return mpl::vector13<
54306 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54307 >();
54308 }
54309 template <
54310 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
54311 inline mpl::vector14<
54312 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11>
54313 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) )
54314 {
54315 return mpl::vector14<
54316 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54317 >();
54318 }
54319 template <
54320 class Target
54321 , class RT
54322 , class ClassT
54323 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11
54324 >
54325 inline mpl::vector14<
54326 RT
54327 , typename most_derived<Target, ClassT>::type&
54328 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54329 >
54330 get_signature(
54331 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11)
54332 , Target*
54333 )
54334 {
54335 return mpl::vector14<
54336 RT
54337 , typename most_derived<Target, ClassT>::type&
54338 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54339 >();
54340 }
54341 template <
54342 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
54343 inline mpl::vector14<
54344 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11>
54345 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) const)
54346 {
54347 return mpl::vector14<
54348 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54349 >();
54350 }
54351 template <
54352 class Target
54353 , class RT
54354 , class ClassT
54355 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11
54356 >
54357 inline mpl::vector14<
54358 RT
54359 , typename most_derived<Target, ClassT>::type&
54360 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54361 >
54362 get_signature(
54363 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) const
54364 , Target*
54365 )
54366 {
54367 return mpl::vector14<
54368 RT
54369 , typename most_derived<Target, ClassT>::type&
54370 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54371 >();
54372 }
54373 template <
54374 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
54375 inline mpl::vector14<
54376 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11>
54377 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) volatile)
54378 {
54379 return mpl::vector14<
54380 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54381 >();
54382 }
54383 template <
54384 class Target
54385 , class RT
54386 , class ClassT
54387 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11
54388 >
54389 inline mpl::vector14<
54390 RT
54391 , typename most_derived<Target, ClassT>::type&
54392 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54393 >
54394 get_signature(
54395 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) volatile
54396 , Target*
54397 )
54398 {
54399 return mpl::vector14<
54400 RT
54401 , typename most_derived<Target, ClassT>::type&
54402 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54403 >();
54404 }
54405 template <
54406 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11>
54407 inline mpl::vector14<
54408 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11>
54409 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) const volatile)
54410 {
54411 return mpl::vector14<
54412 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54413 >();
54414 }
54415 template <
54416 class Target
54417 , class RT
54418 , class ClassT
54419 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11
54420 >
54421 inline mpl::vector14<
54422 RT
54423 , typename most_derived<Target, ClassT>::type&
54424 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54425 >
54426 get_signature(
54427 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11) const volatile
54428 , Target*
54429 )
54430 {
54431 return mpl::vector14<
54432 RT
54433 , typename most_derived<Target, ClassT>::type&
54434 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11
54435 >();
54436 }
54437 template <
54438 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
54439 inline mpl::vector14<
54440 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12>
54441 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12), void* = 0)
54442 {
54443 return mpl::vector14<
54444 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54445 >();
54446 }
54447 template <
54448 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
54449 inline mpl::vector15<
54450 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12>
54451 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) )
54452 {
54453 return mpl::vector15<
54454 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54455 >();
54456 }
54457 template <
54458 class Target
54459 , class RT
54460 , class ClassT
54461 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12
54462 >
54463 inline mpl::vector15<
54464 RT
54465 , typename most_derived<Target, ClassT>::type&
54466 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54467 >
54468 get_signature(
54469 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12)
54470 , Target*
54471 )
54472 {
54473 return mpl::vector15<
54474 RT
54475 , typename most_derived<Target, ClassT>::type&
54476 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54477 >();
54478 }
54479 template <
54480 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
54481 inline mpl::vector15<
54482 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12>
54483 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) const)
54484 {
54485 return mpl::vector15<
54486 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54487 >();
54488 }
54489 template <
54490 class Target
54491 , class RT
54492 , class ClassT
54493 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12
54494 >
54495 inline mpl::vector15<
54496 RT
54497 , typename most_derived<Target, ClassT>::type&
54498 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54499 >
54500 get_signature(
54501 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) const
54502 , Target*
54503 )
54504 {
54505 return mpl::vector15<
54506 RT
54507 , typename most_derived<Target, ClassT>::type&
54508 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54509 >();
54510 }
54511 template <
54512 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
54513 inline mpl::vector15<
54514 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12>
54515 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) volatile)
54516 {
54517 return mpl::vector15<
54518 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54519 >();
54520 }
54521 template <
54522 class Target
54523 , class RT
54524 , class ClassT
54525 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12
54526 >
54527 inline mpl::vector15<
54528 RT
54529 , typename most_derived<Target, ClassT>::type&
54530 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54531 >
54532 get_signature(
54533 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) volatile
54534 , Target*
54535 )
54536 {
54537 return mpl::vector15<
54538 RT
54539 , typename most_derived<Target, ClassT>::type&
54540 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54541 >();
54542 }
54543 template <
54544 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12>
54545 inline mpl::vector15<
54546 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12>
54547 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) const volatile)
54548 {
54549 return mpl::vector15<
54550 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54551 >();
54552 }
54553 template <
54554 class Target
54555 , class RT
54556 , class ClassT
54557 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12
54558 >
54559 inline mpl::vector15<
54560 RT
54561 , typename most_derived<Target, ClassT>::type&
54562 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54563 >
54564 get_signature(
54565 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12) const volatile
54566 , Target*
54567 )
54568 {
54569 return mpl::vector15<
54570 RT
54571 , typename most_derived<Target, ClassT>::type&
54572 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12
54573 >();
54574 }
54575 template <
54576 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
54577 inline mpl::vector15<
54578 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13>
54579 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13), void* = 0)
54580 {
54581 return mpl::vector15<
54582 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54583 >();
54584 }
54585 template <
54586 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
54587 inline mpl::vector16<
54588 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13>
54589 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) )
54590 {
54591 return mpl::vector16<
54592 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54593 >();
54594 }
54595 template <
54596 class Target
54597 , class RT
54598 , class ClassT
54599 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13
54600 >
54601 inline mpl::vector16<
54602 RT
54603 , typename most_derived<Target, ClassT>::type&
54604 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54605 >
54606 get_signature(
54607 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13)
54608 , Target*
54609 )
54610 {
54611 return mpl::vector16<
54612 RT
54613 , typename most_derived<Target, ClassT>::type&
54614 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54615 >();
54616 }
54617 template <
54618 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
54619 inline mpl::vector16<
54620 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13>
54621 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) const)
54622 {
54623 return mpl::vector16<
54624 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54625 >();
54626 }
54627 template <
54628 class Target
54629 , class RT
54630 , class ClassT
54631 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13
54632 >
54633 inline mpl::vector16<
54634 RT
54635 , typename most_derived<Target, ClassT>::type&
54636 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54637 >
54638 get_signature(
54639 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) const
54640 , Target*
54641 )
54642 {
54643 return mpl::vector16<
54644 RT
54645 , typename most_derived<Target, ClassT>::type&
54646 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54647 >();
54648 }
54649 template <
54650 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
54651 inline mpl::vector16<
54652 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13>
54653 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) volatile)
54654 {
54655 return mpl::vector16<
54656 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54657 >();
54658 }
54659 template <
54660 class Target
54661 , class RT
54662 , class ClassT
54663 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13
54664 >
54665 inline mpl::vector16<
54666 RT
54667 , typename most_derived<Target, ClassT>::type&
54668 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54669 >
54670 get_signature(
54671 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) volatile
54672 , Target*
54673 )
54674 {
54675 return mpl::vector16<
54676 RT
54677 , typename most_derived<Target, ClassT>::type&
54678 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54679 >();
54680 }
54681 template <
54682 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13>
54683 inline mpl::vector16<
54684 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13>
54685 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) const volatile)
54686 {
54687 return mpl::vector16<
54688 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54689 >();
54690 }
54691 template <
54692 class Target
54693 , class RT
54694 , class ClassT
54695 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13
54696 >
54697 inline mpl::vector16<
54698 RT
54699 , typename most_derived<Target, ClassT>::type&
54700 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54701 >
54702 get_signature(
54703 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13) const volatile
54704 , Target*
54705 )
54706 {
54707 return mpl::vector16<
54708 RT
54709 , typename most_derived<Target, ClassT>::type&
54710 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13
54711 >();
54712 }
54713 template <
54714 class RT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
54715 inline mpl::vector16<
54716 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
54717 get_signature(RT(*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14), void* = 0)
54718 {
54719 return mpl::vector16<
54720 RT , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54721 >();
54722 }
54723 template <
54724 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
54725 inline mpl::vector17<
54726 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
54727 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) )
54728 {
54729 return mpl::vector17<
54730 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54731 >();
54732 }
54733 template <
54734 class Target
54735 , class RT
54736 , class ClassT
54737 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14
54738 >
54739 inline mpl::vector17<
54740 RT
54741 , typename most_derived<Target, ClassT>::type&
54742 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54743 >
54744 get_signature(
54745 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14)
54746 , Target*
54747 )
54748 {
54749 return mpl::vector17<
54750 RT
54751 , typename most_derived<Target, ClassT>::type&
54752 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54753 >();
54754 }
54755 template <
54756 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
54757 inline mpl::vector17<
54758 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
54759 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) const)
54760 {
54761 return mpl::vector17<
54762 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54763 >();
54764 }
54765 template <
54766 class Target
54767 , class RT
54768 , class ClassT
54769 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14
54770 >
54771 inline mpl::vector17<
54772 RT
54773 , typename most_derived<Target, ClassT>::type&
54774 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54775 >
54776 get_signature(
54777 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) const
54778 , Target*
54779 )
54780 {
54781 return mpl::vector17<
54782 RT
54783 , typename most_derived<Target, ClassT>::type&
54784 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54785 >();
54786 }
54787 template <
54788 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
54789 inline mpl::vector17<
54790 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
54791 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) volatile)
54792 {
54793 return mpl::vector17<
54794 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54795 >();
54796 }
54797 template <
54798 class Target
54799 , class RT
54800 , class ClassT
54801 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14
54802 >
54803 inline mpl::vector17<
54804 RT
54805 , typename most_derived<Target, ClassT>::type&
54806 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54807 >
54808 get_signature(
54809 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) volatile
54810 , Target*
54811 )
54812 {
54813 return mpl::vector17<
54814 RT
54815 , typename most_derived<Target, ClassT>::type&
54816 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54817 >();
54818 }
54819 template <
54820 class RT, class ClassT , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
54821 inline mpl::vector17<
54822 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
54823 get_signature(RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) const volatile)
54824 {
54825 return mpl::vector17<
54826 RT, ClassT& , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54827 >();
54828 }
54829 template <
54830 class Target
54831 , class RT
54832 , class ClassT
54833 , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14
54834 >
54835 inline mpl::vector17<
54836 RT
54837 , typename most_derived<Target, ClassT>::type&
54838 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54839 >
54840 get_signature(
54841 RT(ClassT::*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14) const volatile
54842 , Target*
54843 )
54844 {
54845 return mpl::vector17<
54846 RT
54847 , typename most_derived<Target, ClassT>::type&
54848 , T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14
54849 >();
54850 }
54851 }}}
54852 namespace boost { namespace python { namespace objects {
54853 handle<> function_handle_impl(py_function const& f);
54854 template <class F, class Signature>
54855 inline handle<> function_handle(F const& f, Signature)
54856 {
54857 enum { n_arguments = mpl::size<Signature>::value - 1 };
54858 return objects::function_handle_impl(
54859 python::detail::caller<
54860 F,default_call_policies,Signature
54861 >(
54862 f, default_call_policies()
54863 )
54864 );
54865 }
54866 template <class F>
54867 handle<> make_function_handle(F f)
54868 {
54869 return objects::function_handle(f, python::detail::get_signature(f));
54870 }
54871 }}}
54872
54873 namespace boost { namespace python { namespace detail {
54874 template <class T>
54875 struct is_string_literal : mpl::false_
54876 {
54877 };
54878 template <std::size_t n>
54879 struct is_string_literal<char const[n]> : mpl::true_
54880 {
54881 };
54882 }}}
54883 namespace boost {
54884 namespace detail {
54885 template<typename Function> struct function_traits_helper;
54886 template<typename R>
54887 struct function_traits_helper<R (*)(void)>
54888 {
54889 static const unsigned arity = 0;
54890 typedef R result_type;
54891 };
54892 template<typename R, typename T1>
54893 struct function_traits_helper<R (*)(T1)>
54894 {
54895 static const unsigned arity = 1;
54896 typedef R result_type;
54897 typedef T1 arg1_type;
54898 typedef T1 argument_type;
54899 };
54900 template<typename R, typename T1, typename T2>
54901 struct function_traits_helper<R (*)(T1, T2)>
54902 {
54903 static const unsigned arity = 2;
54904 typedef R result_type;
54905 typedef T1 arg1_type;
54906 typedef T2 arg2_type;
54907 typedef T1 first_argument_type;
54908 typedef T2 second_argument_type;
54909 };
54910 template<typename R, typename T1, typename T2, typename T3>
54911 struct function_traits_helper<R (*)(T1, T2, T3)>
54912 {
54913 static const unsigned arity = 3;
54914 typedef R result_type;
54915 typedef T1 arg1_type;
54916 typedef T2 arg2_type;
54917 typedef T3 arg3_type;
54918 };
54919 template<typename R, typename T1, typename T2, typename T3, typename T4>
54920 struct function_traits_helper<R (*)(T1, T2, T3, T4)>
54921 {
54922 static const unsigned arity = 4;
54923 typedef R result_type;
54924 typedef T1 arg1_type;
54925 typedef T2 arg2_type;
54926 typedef T3 arg3_type;
54927 typedef T4 arg4_type;
54928 };
54929 template<typename R, typename T1, typename T2, typename T3, typename T4,
54930 typename T5>
54931 struct function_traits_helper<R (*)(T1, T2, T3, T4, T5)>
54932 {
54933 static const unsigned arity = 5;
54934 typedef R result_type;
54935 typedef T1 arg1_type;
54936 typedef T2 arg2_type;
54937 typedef T3 arg3_type;
54938 typedef T4 arg4_type;
54939 typedef T5 arg5_type;
54940 };
54941 template<typename R, typename T1, typename T2, typename T3, typename T4,
54942 typename T5, typename T6>
54943 struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6)>
54944 {
54945 static const unsigned arity = 6;
54946 typedef R result_type;
54947 typedef T1 arg1_type;
54948 typedef T2 arg2_type;
54949 typedef T3 arg3_type;
54950 typedef T4 arg4_type;
54951 typedef T5 arg5_type;
54952 typedef T6 arg6_type;
54953 };
54954 template<typename R, typename T1, typename T2, typename T3, typename T4,
54955 typename T5, typename T6, typename T7>
54956 struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7)>
54957 {
54958 static const unsigned arity = 7;
54959 typedef R result_type;
54960 typedef T1 arg1_type;
54961 typedef T2 arg2_type;
54962 typedef T3 arg3_type;
54963 typedef T4 arg4_type;
54964 typedef T5 arg5_type;
54965 typedef T6 arg6_type;
54966 typedef T7 arg7_type;
54967 };
54968 template<typename R, typename T1, typename T2, typename T3, typename T4,
54969 typename T5, typename T6, typename T7, typename T8>
54970 struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8)>
54971 {
54972 static const unsigned arity = 8;
54973 typedef R result_type;
54974 typedef T1 arg1_type;
54975 typedef T2 arg2_type;
54976 typedef T3 arg3_type;
54977 typedef T4 arg4_type;
54978 typedef T5 arg5_type;
54979 typedef T6 arg6_type;
54980 typedef T7 arg7_type;
54981 typedef T8 arg8_type;
54982 };
54983 template<typename R, typename T1, typename T2, typename T3, typename T4,
54984 typename T5, typename T6, typename T7, typename T8, typename T9>
54985 struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9)>
54986 {
54987 static const unsigned arity = 9;
54988 typedef R result_type;
54989 typedef T1 arg1_type;
54990 typedef T2 arg2_type;
54991 typedef T3 arg3_type;
54992 typedef T4 arg4_type;
54993 typedef T5 arg5_type;
54994 typedef T6 arg6_type;
54995 typedef T7 arg7_type;
54996 typedef T8 arg8_type;
54997 typedef T9 arg9_type;
54998 };
54999 template<typename R, typename T1, typename T2, typename T3, typename T4,
55000 typename T5, typename T6, typename T7, typename T8, typename T9,
55001 typename T10>
55002 struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
55003 {
55004 static const unsigned arity = 10;
55005 typedef R result_type;
55006 typedef T1 arg1_type;
55007 typedef T2 arg2_type;
55008 typedef T3 arg3_type;
55009 typedef T4 arg4_type;
55010 typedef T5 arg5_type;
55011 typedef T6 arg6_type;
55012 typedef T7 arg7_type;
55013 typedef T8 arg8_type;
55014 typedef T9 arg9_type;
55015 typedef T10 arg10_type;
55016 };
55017 }
55018 template<typename Function>
55019 struct function_traits :
55020 public detail::function_traits_helper<typename boost::add_pointer<Function>::type>
55021 {
55022 };
55023 }
55024 namespace boost { namespace python { namespace converter {
55025 template <class T> struct is_object_manager;
55026 namespace detail
55027 {
55028 template <class T>
55029 struct function_arg_to_python : handle<>
55030 {
55031 function_arg_to_python(T const& x);
55032 };
55033 template <class T>
55034 struct reference_arg_to_python : handle<>
55035 {
55036 reference_arg_to_python(T& x);
55037 private:
55038 static PyObject* get_object(T& x);
55039 };
55040 template <class T>
55041 struct shared_ptr_arg_to_python : handle<>
55042 {
55043 shared_ptr_arg_to_python(T const& x);
55044 private:
55045 static PyObject* get_object(T& x);
55046 };
55047 template <class T>
55048 struct value_arg_to_python : arg_to_python_base
55049 {
55050 value_arg_to_python(T const&);
55051 };
55052 template <class Ptr>
55053 struct pointer_deep_arg_to_python : arg_to_python_base
55054 {
55055 pointer_deep_arg_to_python(Ptr);
55056 };
55057 template <class Ptr>
55058 struct pointer_shallow_arg_to_python : handle<>
55059 {
55060 pointer_shallow_arg_to_python(Ptr);
55061 private:
55062 static PyObject* get_object(Ptr p);
55063 };
55064 template <class T>
55065 struct object_manager_arg_to_python
55066 {
55067 object_manager_arg_to_python(T const& x) : m_src(x) {}
55068 PyObject* get() const
55069 {
55070 return python::upcast<PyObject>(get_managed_object(m_src, tag));
55071 }
55072 private:
55073 T const& m_src;
55074 };
55075 template <class T>
55076 struct select_arg_to_python
55077 {
55078 typedef typename unwrap_reference<T>::type unwrapped_referent;
55079 typedef typename unwrap_pointer<T>::type unwrapped_ptr;
55080 typedef typename mpl::if_<
55081 python::detail::is_string_literal<T const>
55082 , arg_to_python<char const*>
55083 , typename mpl::if_<
55084 python::detail::value_is_shared_ptr<T>
55085 , shared_ptr_arg_to_python<T>
55086 , typename mpl::if_<
55087 mpl::or_<
55088 is_function<T>
55089 , indirect_traits::is_pointer_to_function<T>
55090 , is_member_function_pointer<T>
55091 >
55092 , function_arg_to_python<T>
55093 , typename mpl::if_<
55094 is_object_manager<T>
55095 , object_manager_arg_to_python<T>
55096 , typename mpl::if_<
55097 is_pointer<T>
55098 , pointer_deep_arg_to_python<T>
55099 , typename mpl::if_<
55100 is_pointer_wrapper<T>
55101 , pointer_shallow_arg_to_python<unwrapped_ptr>
55102 , typename mpl::if_<
55103 is_reference_wrapper<T>
55104 , reference_arg_to_python<unwrapped_referent>
55105 , value_arg_to_python<T>
55106 >::type
55107 >::type
55108 >::type
55109 >::type
55110 >::type
55111 >::type
55112 >::type
55113 type;
55114 };
55115 }
55116 template <class T>
55117 struct arg_to_python
55118 : detail::select_arg_to_python<T>::type
55119 {
55120 typedef typename detail::select_arg_to_python<T>::type base;
55121 public:
55122 arg_to_python(T const& x);
55123 };
55124 namespace detail
55125 {
55126 using python::detail::yes_convertible;
55127 using python::detail::no_convertible;
55128 using python::detail::unspecialized;
55129 template <class T> struct cannot_convert_raw_PyObject;
55130 template <class T, class Convertibility>
55131 struct reject_raw_object_helper
55132 {
55133 static void error(Convertibility)
55134 {
55135 cannot_convert_raw_PyObject<T*>::to_python_use_handle_instead();
55136 }
55137 static void error(...) {}
55138 };
55139 template <class T>
55140 inline void reject_raw_object_ptr(T*)
55141 {
55142 reject_raw_object_helper<T,yes_convertible>::error(
55143 python::detail::convertible<PyObject const volatile*>::check((T*)0));
55144 typedef typename remove_cv<T>::type value_type;
55145 reject_raw_object_helper<T,no_convertible>::error(
55146 python::detail::convertible<unspecialized*>::check(
55147 (base_type_traits<value_type>*)0
55148 ));
55149 }
55150 template <class T>
55151 inline function_arg_to_python<T>::function_arg_to_python(T const& x)
55152 : handle<>(python::objects::make_function_handle(x))
55153 {
55154 }
55155 template <class T>
55156 inline value_arg_to_python<T>::value_arg_to_python(T const& x)
55157 : arg_to_python_base(&x, registered<T>::converters)
55158 {
55159 }
55160 template <class Ptr>
55161 inline pointer_deep_arg_to_python<Ptr>::pointer_deep_arg_to_python(Ptr x)
55162 : arg_to_python_base(x, registered_pointee<Ptr>::converters)
55163 {
55164 detail::reject_raw_object_ptr((Ptr)0);
55165 }
55166 template <class T>
55167 inline PyObject* reference_arg_to_python<T>::get_object(T& x)
55168 {
55169 to_python_indirect<T&,python::detail::make_reference_holder> convert;
55170 return convert(x);
55171 }
55172 template <class T>
55173 inline reference_arg_to_python<T>::reference_arg_to_python(T& x)
55174 : handle<>(reference_arg_to_python<T>::get_object(x))
55175 {
55176 }
55177 template <class T>
55178 inline shared_ptr_arg_to_python<T>::shared_ptr_arg_to_python(T const& x)
55179 : handle<>(shared_ptr_to_python(x))
55180 {
55181 }
55182 template <class Ptr>
55183 inline pointer_shallow_arg_to_python<Ptr>::pointer_shallow_arg_to_python(Ptr x)
55184 : handle<>(pointer_shallow_arg_to_python<Ptr>::get_object(x))
55185 {
55186 detail::reject_raw_object_ptr((Ptr)0);
55187 }
55188 template <class Ptr>
55189 inline PyObject* pointer_shallow_arg_to_python<Ptr>::get_object(Ptr x)
55190 {
55191 to_python_indirect<Ptr,python::detail::make_reference_holder> convert;
55192 return convert(x);
55193 }
55194 }
55195 template <class T>
55196 inline arg_to_python<T>::arg_to_python(T const& x)
55197 : base(x)
55198 {}
55199 }}}
55200 namespace boost { namespace python { namespace detail {
55201 struct void_return
55202 {
55203 void_return() {}
55204 private:
55205 void operator=(void_return const&);
55206 };
55207 template <class T>
55208 struct returnable
55209 {
55210 typedef T type;
55211 };
55212 }}}
55213 namespace boost { namespace python { namespace converter {
55214 template <class T> struct is_object_manager;
55215 namespace detail
55216 {
55217 template <class T>
55218 struct return_pointer_from_python
55219 {
55220 typedef T result_type;
55221 T operator()(PyObject*) const;
55222 };
55223 template <class T>
55224 struct return_reference_from_python
55225 {
55226 typedef T result_type;
55227 T operator()(PyObject*) const;
55228 };
55229 template <class T>
55230 struct return_rvalue_from_python
55231 {
55232 typedef T result_type;
55233 return_rvalue_from_python();
55234 result_type operator()(PyObject*);
55235 private:
55236 rvalue_from_python_data<T> m_data;
55237 };
55238 template <class T>
55239 struct return_object_manager_from_python
55240 {
55241 typedef T result_type;
55242 result_type operator()(PyObject*) const;
55243 };
55244 template <class T>
55245 struct select_return_from_python
55246 {
55247 static const bool obj_mgr = is_object_manager<T>::value
55248 ;
55249 static const bool ptr = is_pointer<T>::value
55250 ;
55251 static const bool ref = is_reference<T>::value
55252 ;
55253 typedef typename mpl::if_c<
55254 obj_mgr
55255 , return_object_manager_from_python<T>
55256 , typename mpl::if_c<
55257 ptr
55258 , return_pointer_from_python<T>
55259 , typename mpl::if_c<
55260 ref
55261 , return_reference_from_python<T>
55262 , return_rvalue_from_python<T>
55263 >::type
55264 >::type
55265 >::type type;
55266 };
55267 }
55268 template <class T>
55269 struct return_from_python
55270 : detail::select_return_from_python<T>::type
55271 {
55272 };
55273 template <>
55274 struct return_from_python<void>
55275 {
55276 typedef python::detail::returnable<void>::type result_type;
55277 result_type operator()(PyObject* x) const
55278 {
55279 (void_result_from_python)(x);
55280 }
55281 };
55282 namespace detail
55283 {
55284 template <class T>
55285 inline return_rvalue_from_python<T>::return_rvalue_from_python()
55286 : m_data(
55287 const_cast<registration*>(&registered<T>::converters)
55288 )
55289 {
55290 }
55291 template <class T>
55292 inline typename return_rvalue_from_python<T>::result_type
55293 return_rvalue_from_python<T>::operator()(PyObject* obj)
55294 {
55295 handle<> holder(obj);
55296 return *(T*)
55297 (rvalue_result_from_python)(obj, m_data.stage1);
55298 }
55299 template <class T>
55300 inline T return_reference_from_python<T>::operator()(PyObject* obj) const
55301 {
55302 return python::detail::void_ptr_to_reference(
55303 (reference_result_from_python)(obj, registered<T>::converters)
55304 , (T(*)())0);
55305 }
55306 template <class T>
55307 inline T return_pointer_from_python<T>::operator()(PyObject* obj) const
55308 {
55309 return T(
55310 (pointer_result_from_python)(obj, registered_pointee<T>::converters)
55311 );
55312 }
55313 template <class T>
55314 inline T return_object_manager_from_python<T>::operator()(PyObject* obj) const
55315 {
55316 return T(
55317 object_manager_traits<T>::adopt(expect_non_null(obj))
55318 );
55319 }
55320 }
55321 }}}
55322 namespace boost { namespace python {
55323 template <
55324 class R
55325
55326 >
55327 typename detail::returnable<R>::type
55328 call(PyObject* callable
55329
55330 , boost::type<R>* = 0
55331 )
55332 {
55333 PyObject* const result =
55334 PyEval_CallFunction(
55335 callable
55336 , const_cast<char*>("(" ")")
55337
55338 );
55339 converter::return_from_python<R> converter;
55340 return converter(result);
55341 }
55342 template <
55343 class R
55344 , class A0
55345 >
55346 typename detail::returnable<R>::type
55347 call(PyObject* callable
55348 , A0 const& a0
55349 , boost::type<R>* = 0
55350 )
55351 {
55352 PyObject* const result =
55353 PyEval_CallFunction(
55354 callable
55355 , const_cast<char*>("(" "O" ")")
55356 , converter::arg_to_python<A0>(a0).get()
55357 );
55358 converter::return_from_python<R> converter;
55359 return converter(result);
55360 }
55361 template <
55362 class R
55363 , class A0 , class A1
55364 >
55365 typename detail::returnable<R>::type
55366 call(PyObject* callable
55367 , A0 const& a0 , A1 const& a1
55368 , boost::type<R>* = 0
55369 )
55370 {
55371 PyObject* const result =
55372 PyEval_CallFunction(
55373 callable
55374 , const_cast<char*>("(" "O" "O" ")")
55375 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get()
55376 );
55377 converter::return_from_python<R> converter;
55378 return converter(result);
55379 }
55380 template <
55381 class R
55382 , class A0 , class A1 , class A2
55383 >
55384 typename detail::returnable<R>::type
55385 call(PyObject* callable
55386 , A0 const& a0 , A1 const& a1 , A2 const& a2
55387 , boost::type<R>* = 0
55388 )
55389 {
55390 PyObject* const result =
55391 PyEval_CallFunction(
55392 callable
55393 , const_cast<char*>("(" "O" "O" "O" ")")
55394 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get()
55395 );
55396 converter::return_from_python<R> converter;
55397 return converter(result);
55398 }
55399 template <
55400 class R
55401 , class A0 , class A1 , class A2 , class A3
55402 >
55403 typename detail::returnable<R>::type
55404 call(PyObject* callable
55405 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3
55406 , boost::type<R>* = 0
55407 )
55408 {
55409 PyObject* const result =
55410 PyEval_CallFunction(
55411 callable
55412 , const_cast<char*>("(" "O" "O" "O" "O" ")")
55413 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get()
55414 );
55415 converter::return_from_python<R> converter;
55416 return converter(result);
55417 }
55418 template <
55419 class R
55420 , class A0 , class A1 , class A2 , class A3 , class A4
55421 >
55422 typename detail::returnable<R>::type
55423 call(PyObject* callable
55424 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4
55425 , boost::type<R>* = 0
55426 )
55427 {
55428 PyObject* const result =
55429 PyEval_CallFunction(
55430 callable
55431 , const_cast<char*>("(" "O" "O" "O" "O" "O" ")")
55432 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get()
55433 );
55434 converter::return_from_python<R> converter;
55435 return converter(result);
55436 }
55437 template <
55438 class R
55439 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5
55440 >
55441 typename detail::returnable<R>::type
55442 call(PyObject* callable
55443 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5
55444 , boost::type<R>* = 0
55445 )
55446 {
55447 PyObject* const result =
55448 PyEval_CallFunction(
55449 callable
55450 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" ")")
55451 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get()
55452 );
55453 converter::return_from_python<R> converter;
55454 return converter(result);
55455 }
55456 template <
55457 class R
55458 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6
55459 >
55460 typename detail::returnable<R>::type
55461 call(PyObject* callable
55462 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6
55463 , boost::type<R>* = 0
55464 )
55465 {
55466 PyObject* const result =
55467 PyEval_CallFunction(
55468 callable
55469 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" ")")
55470 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get()
55471 );
55472 converter::return_from_python<R> converter;
55473 return converter(result);
55474 }
55475 template <
55476 class R
55477 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7
55478 >
55479 typename detail::returnable<R>::type
55480 call(PyObject* callable
55481 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7
55482 , boost::type<R>* = 0
55483 )
55484 {
55485 PyObject* const result =
55486 PyEval_CallFunction(
55487 callable
55488 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55489 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get()
55490 );
55491 converter::return_from_python<R> converter;
55492 return converter(result);
55493 }
55494 template <
55495 class R
55496 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8
55497 >
55498 typename detail::returnable<R>::type
55499 call(PyObject* callable
55500 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8
55501 , boost::type<R>* = 0
55502 )
55503 {
55504 PyObject* const result =
55505 PyEval_CallFunction(
55506 callable
55507 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55508 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get()
55509 );
55510 converter::return_from_python<R> converter;
55511 return converter(result);
55512 }
55513 template <
55514 class R
55515 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9
55516 >
55517 typename detail::returnable<R>::type
55518 call(PyObject* callable
55519 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9
55520 , boost::type<R>* = 0
55521 )
55522 {
55523 PyObject* const result =
55524 PyEval_CallFunction(
55525 callable
55526 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55527 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get()
55528 );
55529 converter::return_from_python<R> converter;
55530 return converter(result);
55531 }
55532 template <
55533 class R
55534 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10
55535 >
55536 typename detail::returnable<R>::type
55537 call(PyObject* callable
55538 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10
55539 , boost::type<R>* = 0
55540 )
55541 {
55542 PyObject* const result =
55543 PyEval_CallFunction(
55544 callable
55545 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55546 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get()
55547 );
55548 converter::return_from_python<R> converter;
55549 return converter(result);
55550 }
55551 template <
55552 class R
55553 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11
55554 >
55555 typename detail::returnable<R>::type
55556 call(PyObject* callable
55557 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11
55558 , boost::type<R>* = 0
55559 )
55560 {
55561 PyObject* const result =
55562 PyEval_CallFunction(
55563 callable
55564 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55565 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get()
55566 );
55567 converter::return_from_python<R> converter;
55568 return converter(result);
55569 }
55570 template <
55571 class R
55572 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12
55573 >
55574 typename detail::returnable<R>::type
55575 call(PyObject* callable
55576 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12
55577 , boost::type<R>* = 0
55578 )
55579 {
55580 PyObject* const result =
55581 PyEval_CallFunction(
55582 callable
55583 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55584 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get()
55585 );
55586 converter::return_from_python<R> converter;
55587 return converter(result);
55588 }
55589 template <
55590 class R
55591 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13
55592 >
55593 typename detail::returnable<R>::type
55594 call(PyObject* callable
55595 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13
55596 , boost::type<R>* = 0
55597 )
55598 {
55599 PyObject* const result =
55600 PyEval_CallFunction(
55601 callable
55602 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55603 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get() , converter::arg_to_python<A13>(a13).get()
55604 );
55605 converter::return_from_python<R> converter;
55606 return converter(result);
55607 }
55608 template <
55609 class R
55610 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14
55611 >
55612 typename detail::returnable<R>::type
55613 call(PyObject* callable
55614 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14
55615 , boost::type<R>* = 0
55616 )
55617 {
55618 PyObject* const result =
55619 PyEval_CallFunction(
55620 callable
55621 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
55622 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get() , converter::arg_to_python<A13>(a13).get() , converter::arg_to_python<A14>(a14).get()
55623 );
55624 converter::return_from_python<R> converter;
55625 return converter(result);
55626 }
55627 }}
55628 namespace boost { namespace python {
55629 template <class DerivedVisitor> class def_visitor;
55630 template <class T, class X1, class X2, class X3> class class_;
55631 class def_visitor_access
55632 {
55633 template <class Derived> friend class def_visitor;
55634 template <class V, class classT>
55635 static void visit(V const& v, classT& c)
55636 {
55637 v.derived_visitor().visit(c);
55638 }
55639 template <class V, class classT, class OptionalArgs>
55640 static void visit(
55641 V const& v
55642 , classT& c
55643 , char const* name
55644 , OptionalArgs const& options
55645 )
55646 {
55647 v.derived_visitor().visit(c, name, options);
55648 }
55649 };
55650 template <class DerivedVisitor>
55651 class def_visitor
55652 {
55653 friend class def_visitor_access;
55654 template <class T, class X1, class X2, class X3> friend class class_;
55655 template <class classT>
55656 void visit(classT& c) const
55657 {
55658 def_visitor_access::visit(*this, c);
55659 }
55660 template <class classT, class OptionalArgs>
55661 void visit(classT& c, char const* name, OptionalArgs const& options) const
55662 {
55663 def_visitor_access::visit(*this, c, name, options);
55664 }
55665 protected:
55666 DerivedVisitor const& derived_visitor() const
55667 {
55668 return static_cast<DerivedVisitor const&>(*this);
55669 }
55670 };
55671 }}
55672 namespace boost { namespace python { namespace objects {
55673 void add_to_namespace(
55674 object const& name_space, char const* name, object const& attribute);
55675 void add_to_namespace(
55676 object const& name_space, char const* name, object const& attribute, char const* doc);
55677 }}}
55678 namespace boost { namespace python { namespace detail {
55679 struct not_specified {};
55680 }}}
55681 namespace boost { namespace python { namespace detail {
55682 template <class T1, class T2 = not_specified, class T3 = not_specified, class T4 = not_specified>
55683 struct def_helper;
55684 }}}
55685 namespace boost { namespace python {
55686 namespace detail
55687 {
55688 class kwds_proxy;
55689 class args_proxy;
55690 }
55691 namespace converter
55692 {
55693 template <class T> struct arg_to_python;
55694 }
55695 namespace api
55696 {
55697 template <class Policies> class proxy;
55698 struct const_attribute_policies;
55699 struct attribute_policies;
55700 struct const_objattribute_policies;
55701 struct objattribute_policies;
55702 struct const_item_policies;
55703 struct item_policies;
55704 struct const_slice_policies;
55705 struct slice_policies;
55706 class slice_nil;
55707 typedef proxy<const_attribute_policies> const_object_attribute;
55708 typedef proxy<attribute_policies> object_attribute;
55709 typedef proxy<const_objattribute_policies> const_object_objattribute;
55710 typedef proxy<objattribute_policies> object_objattribute;
55711 typedef proxy<const_item_policies> const_object_item;
55712 typedef proxy<item_policies> object_item;
55713 typedef proxy<const_slice_policies> const_object_slice;
55714 typedef proxy<slice_policies> object_slice;
55715 template <class T> struct is_proxy : mpl::false_ { }; template < class T0 > struct is_proxy< boost::python::api::proxy< T0 > > : mpl::true_ { };
55716 template <class T> struct object_initializer;
55717 class object;
55718 typedef PyObject* (object::*bool_type)() const;
55719 template <class U>
55720 class object_operators : public def_visitor<U>
55721 {
55722 protected:
55723 typedef object const& object_cref;
55724 public:
55725 object operator()() const;
55726 template < class A0>
55727 typename detail::dependent<object, A0>::type
55728 operator()( A0 const& a0) const
55729 {
55730 typedef typename detail::dependent<object, A0>::type obj;
55731 U const& self = *static_cast<U const*>(this);
55732 return call<obj>(get_managed_object(self, tag), a0);
55733 }
55734 template < class A0 , class A1>
55735 typename detail::dependent<object, A0>::type
55736 operator()( A0 const& a0 , A1 const& a1) const
55737 {
55738 typedef typename detail::dependent<object, A0>::type obj;
55739 U const& self = *static_cast<U const*>(this);
55740 return call<obj>(get_managed_object(self, tag), a0 , a1);
55741 }
55742 template < class A0 , class A1 , class A2>
55743 typename detail::dependent<object, A0>::type
55744 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2) const
55745 {
55746 typedef typename detail::dependent<object, A0>::type obj;
55747 U const& self = *static_cast<U const*>(this);
55748 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2);
55749 }
55750 template < class A0 , class A1 , class A2 , class A3>
55751 typename detail::dependent<object, A0>::type
55752 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3) const
55753 {
55754 typedef typename detail::dependent<object, A0>::type obj;
55755 U const& self = *static_cast<U const*>(this);
55756 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3);
55757 }
55758 template < class A0 , class A1 , class A2 , class A3 , class A4>
55759 typename detail::dependent<object, A0>::type
55760 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4) const
55761 {
55762 typedef typename detail::dependent<object, A0>::type obj;
55763 U const& self = *static_cast<U const*>(this);
55764 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4);
55765 }
55766 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
55767 typename detail::dependent<object, A0>::type
55768 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5) const
55769 {
55770 typedef typename detail::dependent<object, A0>::type obj;
55771 U const& self = *static_cast<U const*>(this);
55772 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5);
55773 }
55774 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
55775 typename detail::dependent<object, A0>::type
55776 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6) const
55777 {
55778 typedef typename detail::dependent<object, A0>::type obj;
55779 U const& self = *static_cast<U const*>(this);
55780 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6);
55781 }
55782 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
55783 typename detail::dependent<object, A0>::type
55784 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7) const
55785 {
55786 typedef typename detail::dependent<object, A0>::type obj;
55787 U const& self = *static_cast<U const*>(this);
55788 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
55789 }
55790 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
55791 typename detail::dependent<object, A0>::type
55792 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8) const
55793 {
55794 typedef typename detail::dependent<object, A0>::type obj;
55795 U const& self = *static_cast<U const*>(this);
55796 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
55797 }
55798 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
55799 typename detail::dependent<object, A0>::type
55800 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9) const
55801 {
55802 typedef typename detail::dependent<object, A0>::type obj;
55803 U const& self = *static_cast<U const*>(this);
55804 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
55805 }
55806 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
55807 typename detail::dependent<object, A0>::type
55808 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10) const
55809 {
55810 typedef typename detail::dependent<object, A0>::type obj;
55811 U const& self = *static_cast<U const*>(this);
55812 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10);
55813 }
55814 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
55815 typename detail::dependent<object, A0>::type
55816 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11) const
55817 {
55818 typedef typename detail::dependent<object, A0>::type obj;
55819 U const& self = *static_cast<U const*>(this);
55820 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11);
55821 }
55822 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
55823 typename detail::dependent<object, A0>::type
55824 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12) const
55825 {
55826 typedef typename detail::dependent<object, A0>::type obj;
55827 U const& self = *static_cast<U const*>(this);
55828 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12);
55829 }
55830 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
55831 typename detail::dependent<object, A0>::type
55832 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13) const
55833 {
55834 typedef typename detail::dependent<object, A0>::type obj;
55835 U const& self = *static_cast<U const*>(this);
55836 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13);
55837 }
55838 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
55839 typename detail::dependent<object, A0>::type
55840 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14) const
55841 {
55842 typedef typename detail::dependent<object, A0>::type obj;
55843 U const& self = *static_cast<U const*>(this);
55844 return call<obj>(get_managed_object(self, tag), a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10 , a11 , a12 , a13 , a14);
55845 }
55846 detail::args_proxy operator* () const;
55847 object operator()(detail::args_proxy const &args) const;
55848 object operator()(detail::args_proxy const &args,
55849 detail::kwds_proxy const &kwds) const;
55850 operator bool_type() const;
55851 bool operator!() const;
55852 const_object_attribute attr(char const*) const;
55853 object_attribute attr(char const*);
55854 const_object_objattribute attr(object const&) const;
55855 object_objattribute attr(object const&);
55856 template <class T>
55857 object contains(T const& key) const;
55858 const_object_item operator[](object_cref) const;
55859 object_item operator[](object_cref);
55860 template <class T>
55861 const_object_item
55862 operator[](T const& key) const
55863 ;
55864 template <class T>
55865 object_item
55866 operator[](T const& key)
55867 ;
55868 const_object_slice slice(object_cref, object_cref) const;
55869 object_slice slice(object_cref, object_cref);
55870 const_object_slice slice(slice_nil, object_cref) const;
55871 object_slice slice(slice_nil, object_cref);
55872 const_object_slice slice(object_cref, slice_nil) const;
55873 object_slice slice(object_cref, slice_nil);
55874 const_object_slice slice(slice_nil, slice_nil) const;
55875 object_slice slice(slice_nil, slice_nil);
55876 template <class T, class V>
55877 const_object_slice
55878 slice(T const& start, V const& end) const
55879 ;
55880 template <class T, class V>
55881 object_slice
55882 slice(T const& start, V const& end)
55883 ;
55884 private:
55885 template <class ClassT, class DocStringT>
55886 void visit(ClassT& cl, char const* name, python::detail::def_helper<DocStringT> const& helper) const
55887 {
55888 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((is_same<char const*,DocStringT>::value || detail::is_string_literal<DocStringT const>::value)) == 0 ? false : true) >)>
55889 boost_static_assert_typedef_209;
55890 objects::add_to_namespace(cl, name, this->derived_visitor(), helper.doc());
55891 }
55892 friend class python::def_visitor_access;
55893 private:
55894 typedef object const& object_cref2;
55895 };
55896 struct object_base : object_operators<object>
55897 {
55898 inline object_base(object_base const&);
55899 inline object_base(PyObject* ptr);
55900 inline object_base& operator=(object_base const& rhs);
55901 inline ~object_base();
55902 inline PyObject* ptr() const;
55903 private:
55904 PyObject* m_ptr;
55905 };
55906 template <class T, class U>
55907 struct is_derived
55908 : is_convertible<
55909 typename remove_reference<T>::type*
55910 , U const*
55911 >
55912 {};
55913 template <class T>
55914 typename objects::unforward_cref<T>::type do_unforward_cref(T const& x)
55915 {
55916 return x;
55917 }
55918 class object;
55919 template <class T>
55920 PyObject* object_base_initializer(T const& x)
55921 {
55922 typedef typename is_derived<
55923 typename objects::unforward_cref<T>::type
55924 , object
55925 >::type is_obj;
55926 return object_initializer<
55927 typename unwrap_reference<T>::type
55928 >::get(
55929 x
55930 , is_obj()
55931 );
55932 }
55933 class object : public object_base
55934 {
55935 public:
55936 object();
55937 template <class T>
55938 explicit object(
55939 T const& x
55940 )
55941 : object_base(object_base_initializer(x))
55942 {
55943 }
55944 explicit object(handle<> const&);
55945 private:
55946 public:
55947 explicit object(detail::borrowed_reference);
55948 explicit object(detail::new_reference);
55949 explicit object(detail::new_non_null_reference);
55950 };
55951 template <bool is_proxy = false, bool is_object_manager = false>
55952 struct object_initializer_impl
55953 {
55954 static PyObject*
55955 get(object const& x, mpl::true_)
55956 {
55957 return python::incref(x.ptr());
55958 }
55959 template <class T>
55960 static PyObject*
55961 get(T const& x, mpl::false_)
55962 {
55963 return python::incref(converter::arg_to_python<T>(x).get());
55964 }
55965 };
55966 template <>
55967 struct object_initializer_impl<true, false>
55968 {
55969 template <class Policies>
55970 static PyObject*
55971 get(proxy<Policies> const& x, mpl::false_)
55972 {
55973 return python::incref(x.operator object().ptr());
55974 }
55975 };
55976 template <>
55977 struct object_initializer_impl<false, true>
55978 {
55979 template <class T, class U>
55980 static PyObject*
55981 get(T const& x, U)
55982 {
55983 return python::incref(get_managed_object(x, boost::python::tag));
55984 }
55985 };
55986 template <>
55987 struct object_initializer_impl<true, true>
55988 {};
55989 template <class T>
55990 struct object_initializer : object_initializer_impl<
55991 is_proxy<T>::value
55992 , converter::is_object_manager<T>::value
55993 >
55994 {};
55995 }
55996 using api::object;
55997 template <class T> struct extract;
55998 namespace detail
55999 {
56000 class call_proxy
56001 {
56002 public:
56003 call_proxy(object target) : m_target(target) {}
56004 operator object() const { return m_target;}
56005 private:
56006 object m_target;
56007 };
56008 class kwds_proxy : public call_proxy
56009 {
56010 public:
56011 kwds_proxy(object o = object()) : call_proxy(o) {}
56012 };
56013 class args_proxy : public call_proxy
56014 {
56015 public:
56016 args_proxy(object o) : call_proxy(o) {}
56017 kwds_proxy operator* () const { return kwds_proxy(*this);}
56018 };
56019 }
56020 template <typename U>
56021 detail::args_proxy api::object_operators<U>::operator* () const
56022 {
56023 object_cref2 x = *static_cast<U const*>(this);
56024 return boost::python::detail::args_proxy(x);
56025 }
56026 template <typename U>
56027 object api::object_operators<U>::operator()(detail::args_proxy const &args) const
56028 {
56029 U const& self = *static_cast<U const*>(this);
56030 PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag),
56031 args.operator object().ptr(),
56032 0);
56033 return object(boost::python::detail::new_reference(result));
56034 }
56035 template <typename U>
56036 object api::object_operators<U>::operator()(detail::args_proxy const &args,
56037 detail::kwds_proxy const &kwds) const
56038 {
56039 U const& self = *static_cast<U const*>(this);
56040 PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag),
56041 args.operator object().ptr(),
56042 kwds.operator object().ptr());
56043 return object(boost::python::detail::new_reference(result));
56044 }
56045 template <typename U>
56046 template <class T>
56047 object api::object_operators<U>::contains(T const& key) const
56048 {
56049 return this->attr("__contains__")(object(key));
56050 }
56051 inline object::object()
56052 : object_base(python::incref((&_Py_NoneStruct)))
56053 {}
56054 inline api::object_base::object_base(object_base const& rhs)
56055 : m_ptr(python::incref(rhs.m_ptr))
56056 {}
56057 inline api::object_base::object_base(PyObject* p)
56058 : m_ptr(p)
56059 {}
56060 inline api::object_base& api::object_base::operator=(api::object_base const& rhs)
56061 {
56062 ( ((PyObject*)(rhs.m_ptr))->ob_refcnt++);
56063 if ( --((PyObject*)(this->m_ptr))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(this->m_ptr)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(this->m_ptr))));
56064 this->m_ptr = rhs.m_ptr;
56065 return *this;
56066 }
56067 inline api::object_base::~object_base()
56068 {
56069 if ( --((PyObject*)(m_ptr))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(m_ptr)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(m_ptr))));
56070 }
56071 inline object::object(detail::borrowed_reference p)
56072 : object_base(python::incref((PyObject*)p))
56073 {}
56074 inline object::object(detail::new_reference p)
56075 : object_base(expect_non_null((PyObject*)p))
56076 {}
56077 inline object::object(detail::new_non_null_reference p)
56078 : object_base((PyObject*)p)
56079 {}
56080 inline PyObject* api::object_base::ptr() const
56081 {
56082 return m_ptr;
56083 }
56084 namespace converter
56085 {
56086 template <class T> struct object_manager_traits;
56087 template <>
56088 struct object_manager_traits<object>
56089 {
56090 static const bool is_specialized = true;
56091 static bool check(PyObject*) { return true; }
56092 static python::detail::new_non_null_reference adopt(PyObject* x)
56093 {
56094 return python::detail::new_non_null_reference(x);
56095 }
56096 static PyTypeObject const *get_pytype() {return 0;}
56097 };
56098 }
56099 inline PyObject* get_managed_object(object const& x, tag_t)
56100 {
56101 return x.ptr();
56102 }
56103 }}
56104 namespace boost { namespace python { namespace api {
56105 class slice_nil : public object
56106 {
56107 public:
56108 slice_nil() : object() {}
56109 };
56110 static const slice_nil _ = slice_nil();
56111 template <class T>
56112 struct slice_bound
56113 {
56114 typedef object type;
56115 };
56116 template <>
56117 struct slice_bound<slice_nil>
56118 {
56119 typedef slice_nil type;
56120 };
56121 }
56122 using api::slice_nil;
56123 using api::_;
56124 }}
56125
56126 namespace boost { namespace python {
56127 typedef detail::keywords<1> arg;
56128 typedef arg arg_;
56129 namespace detail
56130 {
56131 template <std::size_t nkeywords>
56132 struct keywords_base
56133 {
56134 static const std::size_t size = nkeywords;
56135 keyword_range range() const
56136 {
56137 return keyword_range(elements, elements + nkeywords);
56138 }
56139 keyword elements[nkeywords];
56140 keywords<nkeywords+1>
56141 operator,(python::arg const &k) const;
56142 keywords<nkeywords + 1>
56143 operator,(char const *name) const;
56144 };
56145 template <std::size_t nkeywords>
56146 struct keywords : keywords_base<nkeywords>
56147 {
56148 };
56149 template <>
56150 struct keywords<1> : keywords_base<1>
56151 {
56152 explicit keywords(char const *name)
56153 {
56154 elements[0].name = name;
56155 }
56156 template <class T>
56157 python::arg& operator=(T const& value)
56158 {
56159 object z(value);
56160 elements[0].default_value = handle<>(python::borrowed(object(value).ptr()));
56161 return *this;
56162 }
56163 operator detail::keyword const&() const
56164 {
56165 return elements[0];
56166 }
56167 };
56168 template <std::size_t nkeywords>
56169 inline
56170 keywords<nkeywords+1>
56171 keywords_base<nkeywords>::operator,(python::arg const &k) const
56172 {
56173 keywords<nkeywords> const& l = *static_cast<keywords<nkeywords> const*>(this);
56174 python::detail::keywords<nkeywords+1> res;
56175 std::copy(l.elements, l.elements+nkeywords, res.elements);
56176 res.elements[nkeywords] = k.elements[0];
56177 return res;
56178 }
56179 template <std::size_t nkeywords>
56180 inline
56181 keywords<nkeywords + 1>
56182 keywords_base<nkeywords>::operator,(char const *name) const
56183 {
56184 return this->operator,(python::arg(name));
56185 }
56186 template<typename T>
56187 struct is_keywords
56188 {
56189 static const bool value = false;
56190 };
56191 template<std::size_t nkeywords>
56192 struct is_keywords<keywords<nkeywords> >
56193 {
56194 static const bool value = true;
56195 };
56196 template <class T>
56197 struct is_reference_to_keywords
56198 {
56199 static const bool is_ref = is_reference<T>::value;
56200 typedef typename remove_reference<T>::type deref;
56201 typedef typename remove_cv<deref>::type key_t;
56202 static const bool is_key = is_keywords<key_t>::value;
56203 static const bool value = (is_ref & is_key);
56204 typedef mpl::bool_<value> type;
56205
56206 };
56207 }
56208 inline detail::keywords<1> args(char const* name)
56209 {
56210 return detail::keywords<1>(name);
56211 }
56212 inline detail::keywords<2> args( char const* name0 , char const* name1) { detail::keywords<2> result; result.elements[0].name = name0; result.elements[1].name = name1; return result; }
56213 inline detail::keywords<3> args( char const* name0 , char const* name1 , char const* name2) { detail::keywords<3> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; return result; }
56214 inline detail::keywords<4> args( char const* name0 , char const* name1 , char const* name2 , char const* name3) { detail::keywords<4> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; return result; }
56215 inline detail::keywords<5> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4) { detail::keywords<5> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; return result; }
56216 inline detail::keywords<6> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5) { detail::keywords<6> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; return result; }
56217 inline detail::keywords<7> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6) { detail::keywords<7> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; return result; }
56218 inline detail::keywords<8> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7) { detail::keywords<8> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; return result; }
56219 inline detail::keywords<9> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8) { detail::keywords<9> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; return result; }
56220 inline detail::keywords<10> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8 , char const* name9) { detail::keywords<10> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; result.elements[9].name = name9; return result; }
56221 inline detail::keywords<11> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8 , char const* name9 , char const* name10) { detail::keywords<11> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; result.elements[9].name = name9; result.elements[10].name = name10; return result; }
56222 inline detail::keywords<12> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8 , char const* name9 , char const* name10 , char const* name11) { detail::keywords<12> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; result.elements[9].name = name9; result.elements[10].name = name10; result.elements[11].name = name11; return result; }
56223 inline detail::keywords<13> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8 , char const* name9 , char const* name10 , char const* name11 , char const* name12) { detail::keywords<13> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; result.elements[9].name = name9; result.elements[10].name = name10; result.elements[11].name = name11; result.elements[12].name = name12; return result; }
56224 inline detail::keywords<14> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8 , char const* name9 , char const* name10 , char const* name11 , char const* name12 , char const* name13) { detail::keywords<14> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; result.elements[9].name = name9; result.elements[10].name = name10; result.elements[11].name = name11; result.elements[12].name = name12; result.elements[13].name = name13; return result; }
56225 inline detail::keywords<15> args( char const* name0 , char const* name1 , char const* name2 , char const* name3 , char const* name4 , char const* name5 , char const* name6 , char const* name7 , char const* name8 , char const* name9 , char const* name10 , char const* name11 , char const* name12 , char const* name13 , char const* name14) { detail::keywords<15> result; result.elements[0].name = name0; result.elements[1].name = name1; result.elements[2].name = name2; result.elements[3].name = name3; result.elements[4].name = name4; result.elements[5].name = name5; result.elements[6].name = name6; result.elements[7].name = name7; result.elements[8].name = name8; result.elements[9].name = name9; result.elements[10].name = name10; result.elements[11].name = name11; result.elements[12].name = name12; result.elements[13].name = name13; result.elements[14].name = name14; return result; }
56226 }}
56227 namespace boost { namespace python {
56228 template < typename Base0 = mpl::void_ >
56229 struct bases : detail::type_list< Base0 >::type
56230 {};
56231 namespace detail
56232 {
56233 template <class T> struct specifies_bases
56234 : mpl::false_
56235 {
56236 };
56237 template < class Base0 >
56238 struct specifies_bases< bases< Base0 > >
56239 : mpl::true_
56240 {
56241 };
56242 template <class T, class Prev = bases<> >
56243 struct select_bases
56244 : mpl::if_<
56245 specifies_bases<T>
56246 , T
56247 , Prev
56248 >
56249 {
56250 };
56251 }
56252 }}
56253 namespace boost { namespace python {
56254 template <
56255 class R
56256
56257 >
56258 typename detail::returnable<R>::type
56259 call_method(PyObject* self, char const* name
56260
56261 , boost::type<R>* = 0
56262 )
56263 {
56264 PyObject* const result =
56265 PyEval_CallMethod(
56266 self
56267 , const_cast<char*>(name)
56268 , const_cast<char*>("(" ")")
56269
56270 );
56271 converter::return_from_python<R> converter;
56272 return converter(result);
56273 }
56274 template <
56275 class R
56276 , class A0
56277 >
56278 typename detail::returnable<R>::type
56279 call_method(PyObject* self, char const* name
56280 , A0 const& a0
56281 , boost::type<R>* = 0
56282 )
56283 {
56284 PyObject* const result =
56285 PyEval_CallMethod(
56286 self
56287 , const_cast<char*>(name)
56288 , const_cast<char*>("(" "O" ")")
56289 , converter::arg_to_python<A0>(a0).get()
56290 );
56291 converter::return_from_python<R> converter;
56292 return converter(result);
56293 }
56294 template <
56295 class R
56296 , class A0 , class A1
56297 >
56298 typename detail::returnable<R>::type
56299 call_method(PyObject* self, char const* name
56300 , A0 const& a0 , A1 const& a1
56301 , boost::type<R>* = 0
56302 )
56303 {
56304 PyObject* const result =
56305 PyEval_CallMethod(
56306 self
56307 , const_cast<char*>(name)
56308 , const_cast<char*>("(" "O" "O" ")")
56309 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get()
56310 );
56311 converter::return_from_python<R> converter;
56312 return converter(result);
56313 }
56314 template <
56315 class R
56316 , class A0 , class A1 , class A2
56317 >
56318 typename detail::returnable<R>::type
56319 call_method(PyObject* self, char const* name
56320 , A0 const& a0 , A1 const& a1 , A2 const& a2
56321 , boost::type<R>* = 0
56322 )
56323 {
56324 PyObject* const result =
56325 PyEval_CallMethod(
56326 self
56327 , const_cast<char*>(name)
56328 , const_cast<char*>("(" "O" "O" "O" ")")
56329 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get()
56330 );
56331 converter::return_from_python<R> converter;
56332 return converter(result);
56333 }
56334 template <
56335 class R
56336 , class A0 , class A1 , class A2 , class A3
56337 >
56338 typename detail::returnable<R>::type
56339 call_method(PyObject* self, char const* name
56340 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3
56341 , boost::type<R>* = 0
56342 )
56343 {
56344 PyObject* const result =
56345 PyEval_CallMethod(
56346 self
56347 , const_cast<char*>(name)
56348 , const_cast<char*>("(" "O" "O" "O" "O" ")")
56349 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get()
56350 );
56351 converter::return_from_python<R> converter;
56352 return converter(result);
56353 }
56354 template <
56355 class R
56356 , class A0 , class A1 , class A2 , class A3 , class A4
56357 >
56358 typename detail::returnable<R>::type
56359 call_method(PyObject* self, char const* name
56360 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4
56361 , boost::type<R>* = 0
56362 )
56363 {
56364 PyObject* const result =
56365 PyEval_CallMethod(
56366 self
56367 , const_cast<char*>(name)
56368 , const_cast<char*>("(" "O" "O" "O" "O" "O" ")")
56369 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get()
56370 );
56371 converter::return_from_python<R> converter;
56372 return converter(result);
56373 }
56374 template <
56375 class R
56376 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5
56377 >
56378 typename detail::returnable<R>::type
56379 call_method(PyObject* self, char const* name
56380 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5
56381 , boost::type<R>* = 0
56382 )
56383 {
56384 PyObject* const result =
56385 PyEval_CallMethod(
56386 self
56387 , const_cast<char*>(name)
56388 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" ")")
56389 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get()
56390 );
56391 converter::return_from_python<R> converter;
56392 return converter(result);
56393 }
56394 template <
56395 class R
56396 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6
56397 >
56398 typename detail::returnable<R>::type
56399 call_method(PyObject* self, char const* name
56400 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6
56401 , boost::type<R>* = 0
56402 )
56403 {
56404 PyObject* const result =
56405 PyEval_CallMethod(
56406 self
56407 , const_cast<char*>(name)
56408 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" ")")
56409 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get()
56410 );
56411 converter::return_from_python<R> converter;
56412 return converter(result);
56413 }
56414 template <
56415 class R
56416 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7
56417 >
56418 typename detail::returnable<R>::type
56419 call_method(PyObject* self, char const* name
56420 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7
56421 , boost::type<R>* = 0
56422 )
56423 {
56424 PyObject* const result =
56425 PyEval_CallMethod(
56426 self
56427 , const_cast<char*>(name)
56428 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56429 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get()
56430 );
56431 converter::return_from_python<R> converter;
56432 return converter(result);
56433 }
56434 template <
56435 class R
56436 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8
56437 >
56438 typename detail::returnable<R>::type
56439 call_method(PyObject* self, char const* name
56440 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8
56441 , boost::type<R>* = 0
56442 )
56443 {
56444 PyObject* const result =
56445 PyEval_CallMethod(
56446 self
56447 , const_cast<char*>(name)
56448 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56449 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get()
56450 );
56451 converter::return_from_python<R> converter;
56452 return converter(result);
56453 }
56454 template <
56455 class R
56456 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9
56457 >
56458 typename detail::returnable<R>::type
56459 call_method(PyObject* self, char const* name
56460 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9
56461 , boost::type<R>* = 0
56462 )
56463 {
56464 PyObject* const result =
56465 PyEval_CallMethod(
56466 self
56467 , const_cast<char*>(name)
56468 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56469 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get()
56470 );
56471 converter::return_from_python<R> converter;
56472 return converter(result);
56473 }
56474 template <
56475 class R
56476 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10
56477 >
56478 typename detail::returnable<R>::type
56479 call_method(PyObject* self, char const* name
56480 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10
56481 , boost::type<R>* = 0
56482 )
56483 {
56484 PyObject* const result =
56485 PyEval_CallMethod(
56486 self
56487 , const_cast<char*>(name)
56488 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56489 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get()
56490 );
56491 converter::return_from_python<R> converter;
56492 return converter(result);
56493 }
56494 template <
56495 class R
56496 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11
56497 >
56498 typename detail::returnable<R>::type
56499 call_method(PyObject* self, char const* name
56500 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11
56501 , boost::type<R>* = 0
56502 )
56503 {
56504 PyObject* const result =
56505 PyEval_CallMethod(
56506 self
56507 , const_cast<char*>(name)
56508 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56509 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get()
56510 );
56511 converter::return_from_python<R> converter;
56512 return converter(result);
56513 }
56514 template <
56515 class R
56516 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12
56517 >
56518 typename detail::returnable<R>::type
56519 call_method(PyObject* self, char const* name
56520 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12
56521 , boost::type<R>* = 0
56522 )
56523 {
56524 PyObject* const result =
56525 PyEval_CallMethod(
56526 self
56527 , const_cast<char*>(name)
56528 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56529 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get()
56530 );
56531 converter::return_from_python<R> converter;
56532 return converter(result);
56533 }
56534 template <
56535 class R
56536 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13
56537 >
56538 typename detail::returnable<R>::type
56539 call_method(PyObject* self, char const* name
56540 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13
56541 , boost::type<R>* = 0
56542 )
56543 {
56544 PyObject* const result =
56545 PyEval_CallMethod(
56546 self
56547 , const_cast<char*>(name)
56548 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56549 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get() , converter::arg_to_python<A13>(a13).get()
56550 );
56551 converter::return_from_python<R> converter;
56552 return converter(result);
56553 }
56554 template <
56555 class R
56556 , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14
56557 >
56558 typename detail::returnable<R>::type
56559 call_method(PyObject* self, char const* name
56560 , A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14
56561 , boost::type<R>* = 0
56562 )
56563 {
56564 PyObject* const result =
56565 PyEval_CallMethod(
56566 self
56567 , const_cast<char*>(name)
56568 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
56569 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get() , converter::arg_to_python<A13>(a13).get() , converter::arg_to_python<A14>(a14).get()
56570 );
56571 converter::return_from_python<R> converter;
56572 return converter(result);
56573 }
56574 }}
56575 namespace boost { namespace python {
56576 template <
56577 class T
56578 , class X1 = ::boost::python::detail::not_specified
56579 , class X2 = ::boost::python::detail::not_specified
56580 , class X3 = ::boost::python::detail::not_specified
56581 >
56582 class class_;
56583 }}
56584
56585 namespace boost { namespace python {
56586 namespace objects {
56587 struct class_base : python::api::object
56588 {
56589 class_base(
56590 char const* name
56591 , std::size_t num_types
56592 , type_info const*const types
56593 , char const* doc = 0
56594 );
56595 void enable_pickling_(bool getstate_manages_dict);
56596 protected:
56597 void add_property(
56598 char const* name, object const& fget, char const* docstr);
56599 void add_property(char const* name,
56600 object const& fget, object const& fset, char const* docstr);
56601 void add_static_property(char const* name, object const& fget);
56602 void add_static_property(char const* name, object const& fget, object const& fset);
56603 void setattr(char const* name, object const&);
56604 void set_instance_size(std::size_t bytes);
56605 void def_no_init();
56606 void make_method_static(const char *method_name);
56607 };
56608 }}}
56609 namespace boost
56610 {
56611 namespace iterators
56612 {
56613 template<bool>
56614 struct enabled
56615 {
56616 template<typename T>
56617 struct base
56618 {
56619 typedef T type;
56620 };
56621 };
56622 template<>
56623 struct enabled<false>
56624 {
56625 template<typename T>
56626 struct base
56627 {
56628 };
56629 };
56630 template <class Cond,
56631 class Return>
56632 struct enable_if
56633 : enabled<(Cond::value)>::template base<Return>
56634 {
56635 };
56636 }
56637 }
56638 namespace boost { namespace python { namespace api {
56639 template <class X>
56640 char is_object_operators_helper(object_operators<X> const*);
56641 typedef char (&no_type)[2];
56642 no_type is_object_operators_helper(...);
56643 template <class X> X* make_ptr();
56644 template <class L, class R = L>
56645 struct is_object_operators
56646 {
56647 enum {
56648 value
56649 = (sizeof(api::is_object_operators_helper(api::make_ptr<L>()))
56650 + sizeof(api::is_object_operators_helper(api::make_ptr<R>()))
56651 < 4
56652 )
56653 };
56654 typedef mpl::bool_<value> type;
56655 };
56656 template <class L, class R, class T>
56657 struct enable_binary
56658 : boost::iterators::enable_if<is_object_operators<L,R>, T>
56659 {};
56660 template <class U>
56661 object object_operators<U>::operator()() const
56662 {
56663 object_cref2 f = *static_cast<U const*>(this);
56664 return call<object>(f.ptr());
56665 }
56666 template <class U>
56667 inline
56668 object_operators<U>::operator bool_type() const
56669 {
56670 object_cref2 x = *static_cast<U const*>(this);
56671 int is_true = PyObject_IsTrue(x.ptr());
56672 if (is_true < 0) throw_error_already_set();
56673 return is_true ? &object::ptr : 0;
56674 }
56675 template <class U>
56676 inline bool
56677 object_operators<U>::operator!() const
56678 {
56679 object_cref2 x = *static_cast<U const*>(this);
56680 int is_true = PyObject_IsTrue(x.ptr());
56681 if (is_true < 0) throw_error_already_set();
56682 return !is_true;
56683 }
56684 object operator >(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator >(L const& l, R const& r) { return object(l) > object(r); }
56685 object operator >=(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator >=(L const& l, R const& r) { return object(l) >= object(r); }
56686 object operator <(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator <(L const& l, R const& r) { return object(l) < object(r); }
56687 object operator <=(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator <=(L const& l, R const& r) { return object(l) <= object(r); }
56688 object operator ==(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator ==(L const& l, R const& r) { return object(l) == object(r); }
56689 object operator !=(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator !=(L const& l, R const& r) { return object(l) != object(r); }
56690 object operator +(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator +(L const& l, R const& r) { return object(l) + object(r); }
56691 object operator -(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator -(L const& l, R const& r) { return object(l) - object(r); }
56692 object operator *(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator *(L const& l, R const& r) { return object(l) * object(r); }
56693 object operator /(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator /(L const& l, R const& r) { return object(l) / object(r); }
56694 object operator %(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator %(L const& l, R const& r) { return object(l) % object(r); }
56695 object operator <<(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator <<(L const& l, R const& r) { return object(l) << object(r); }
56696 object operator >>(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator >>(L const& l, R const& r) { return object(l) >> object(r); }
56697 object operator &(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator &(L const& l, R const& r) { return object(l) & object(r); }
56698 object operator ^(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator ^(L const& l, R const& r) { return object(l) ^ object(r); }
56699 object operator |(object const& l, object const& r); template <class L, class R> typename enable_binary<L,R,object>::type operator |(L const& l, R const& r) { return object(l) | object(r); }
56700 object& operator +=(object& l, object const& r); template <class R> object& operator +=(object& l, R const& r) { return l += object(r); }
56701 object& operator -=(object& l, object const& r); template <class R> object& operator -=(object& l, R const& r) { return l -= object(r); }
56702 object& operator *=(object& l, object const& r); template <class R> object& operator *=(object& l, R const& r) { return l *= object(r); }
56703 object& operator /=(object& l, object const& r); template <class R> object& operator /=(object& l, R const& r) { return l /= object(r); }
56704 object& operator %=(object& l, object const& r); template <class R> object& operator %=(object& l, R const& r) { return l %= object(r); }
56705 object& operator <<=(object& l, object const& r); template <class R> object& operator <<=(object& l, R const& r) { return l <<= object(r); }
56706 object& operator >>=(object& l, object const& r); template <class R> object& operator >>=(object& l, R const& r) { return l >>= object(r); }
56707 object& operator &=(object& l, object const& r); template <class R> object& operator &=(object& l, R const& r) { return l &= object(r); }
56708 object& operator ^=(object& l, object const& r); template <class R> object& operator ^=(object& l, R const& r) { return l ^= object(r); }
56709 object& operator |=(object& l, object const& r); template <class R> object& operator |=(object& l, R const& r) { return l |= object(r); }
56710 }}}
56711 namespace boost { namespace python { namespace api {
56712 template <class Policies>
56713 class proxy : public object_operators<proxy<Policies> >
56714 {
56715 typedef typename Policies::key_type key_type;
56716 typedef proxy const& assignment_self;
56717 public:
56718 proxy(object const& target, key_type const& key);
56719 operator object() const;
56720 proxy const& operator=(assignment_self) const;
56721 template <class T>
56722 inline proxy const& operator=(T const& rhs) const
56723 {
56724 Policies::set(m_target, m_key, object(rhs));
56725 return *this;
56726 }
56727 public:
56728 void del() const;
56729 private:
56730 object m_target;
56731 key_type m_key;
56732 };
56733 template <class T>
56734 inline void del(proxy<T> const& x)
56735 {
56736 x.del();
56737 }
56738 template <class Policies>
56739 inline proxy<Policies>::proxy(object const& target, key_type const& key)
56740 : m_target(target), m_key(key)
56741 {}
56742 template <class Policies>
56743 inline proxy<Policies>::operator object() const
56744 {
56745 return Policies::get(m_target, m_key);
56746 }
56747 template <class Policies>
56748 inline proxy<Policies> const& proxy<Policies>::operator=(typename proxy::assignment_self rhs) const
56749 {
56750 return *this = python::object(rhs);
56751 }
56752 template <class Policies, class R> proxy<Policies> const& operator +=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old += rhs); }
56753 template <class Policies, class R> proxy<Policies> const& operator -=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old -= rhs); }
56754 template <class Policies, class R> proxy<Policies> const& operator *=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old *= rhs); }
56755 template <class Policies, class R> proxy<Policies> const& operator /=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old /= rhs); }
56756 template <class Policies, class R> proxy<Policies> const& operator %=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old %= rhs); }
56757 template <class Policies, class R> proxy<Policies> const& operator <<=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old <<= rhs); }
56758 template <class Policies, class R> proxy<Policies> const& operator >>=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old >>= rhs); }
56759 template <class Policies, class R> proxy<Policies> const& operator &=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old &= rhs); }
56760 template <class Policies, class R> proxy<Policies> const& operator ^=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old ^= rhs); }
56761 template <class Policies, class R> proxy<Policies> const& operator |=(proxy<Policies> const& lhs, R const& rhs) { object old(lhs); return lhs = (old |= rhs); }
56762 template <class Policies>
56763 inline void proxy<Policies>::del() const
56764 {
56765 Policies::del(m_target, m_key);
56766 }
56767 }}}
56768 namespace boost { namespace python {
56769 namespace api
56770 {
56771 class object;
56772 object getattr(object const& target, object const& key);
56773 object getattr(object const& target, object const& key, object const& default_);
56774 void setattr(object const& target, object const& key, object const& value);
56775 void delattr(object const& target, object const& key);
56776 object getattr(object const& target, char const* key);
56777 object getattr(object const& target, char const* key, object const& default_);
56778 void setattr(object const& target, char const* key, object const& value);
56779 void delattr(object const& target, char const* key);
56780 object getitem(object const& target, object const& key);
56781 void setitem(object const& target, object const& key, object const& value);
56782 void delitem(object const& target, object const& key);
56783 object getslice(object const& target, handle<> const& begin, handle<> const& end);
56784 void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value);
56785 void delslice(object const& target, handle<> const& begin, handle<> const& end);
56786 }
56787 using api::getattr;
56788 using api::setattr;
56789 using api::delattr;
56790 using api::getitem;
56791 using api::setitem;
56792 using api::delitem;
56793 using api::getslice;
56794 using api::setslice;
56795 using api::delslice;
56796 }}
56797 namespace boost { namespace python { namespace api {
56798 template <class Target, class Key>
56799 object getattr(Target const& target, Key const& key )
56800 {
56801 return getattr(object(target), object(key));
56802 }
56803 template <class Target, class Key, class Default>
56804 object getattr(Target const& target, Key const& key, Default const& default_ )
56805 {
56806 return getattr(object(target), object(key), object(default_));
56807 }
56808 template <class Key, class Value>
56809 void setattr(object const& target, Key const& key, Value const& value )
56810 {
56811 setattr(target, object(key), object(value));
56812 }
56813 template <class Key>
56814 void delattr(object const& target, Key const& key )
56815 {
56816 delattr(target, object(key));
56817 }
56818 template <class Target, class Key>
56819 object getitem(Target const& target, Key const& key )
56820 {
56821 return getitem(object(target), object(key));
56822 }
56823 template <class Key, class Value>
56824 void setitem(object const& target, Key const& key, Value const& value )
56825 {
56826 setitem(target, object(key), object(value));
56827 }
56828 template <class Key>
56829 void delitem(object const& target, Key const& key )
56830 {
56831 delitem(target, object(key));
56832 }
56833 template <class Target, class Begin, class End>
56834 object getslice(Target const& target, Begin const& begin, End const& end)
56835 {
56836 return getslice(object(target), object(begin), object(end));
56837 }
56838 template <class Begin, class End, class Value>
56839 void setslice(object const& target, Begin const& begin, End const& end, Value const& value)
56840 {
56841 setslice(target, object(begin), object(end), object(value));
56842 }
56843 template <class Begin, class End>
56844 void delslice(object const& target, Begin const& begin, End const& end)
56845 {
56846 delslice(target, object(begin), object(end));
56847 }
56848 }}}
56849 namespace boost { namespace python { namespace api {
56850 struct const_attribute_policies
56851 {
56852 typedef char const* key_type;
56853 static object get(object const& target, char const* key);
56854 static object get(object const& target, object const& key);
56855 };
56856 struct attribute_policies : const_attribute_policies
56857 {
56858 static object const& set(object const& target, char const* key, object const& value);
56859 static void del(object const&target, char const* key);
56860 };
56861 struct const_objattribute_policies
56862 {
56863 typedef object const key_type;
56864 static object get(object const& target, object const& key);
56865 };
56866 struct objattribute_policies : const_objattribute_policies
56867 {
56868 static object const& set(object const& target, object const& key, object const& value);
56869 static void del(object const&target, object const& key);
56870 };
56871 template <class U>
56872 inline object_attribute object_operators<U>::attr(char const* name)
56873 {
56874 object_cref2 x = *static_cast<U*>(this);
56875 return object_attribute(x, name);
56876 }
56877 template <class U>
56878 inline const_object_attribute object_operators<U>::attr(char const* name) const
56879 {
56880 object_cref2 x = *static_cast<U const*>(this);
56881 return const_object_attribute(x, name);
56882 }
56883 template <class U>
56884 inline object_objattribute object_operators<U>::attr(object const& name)
56885 {
56886 object_cref2 x = *static_cast<U*>(this);
56887 return object_objattribute(x, name);
56888 }
56889 template <class U>
56890 inline const_object_objattribute object_operators<U>::attr(object const& name) const
56891 {
56892 object_cref2 x = *static_cast<U const*>(this);
56893 return const_object_objattribute(x, name);
56894 }
56895 inline object const_attribute_policies::get(object const& target, char const* key)
56896 {
56897 return python::getattr(target, key);
56898 }
56899 inline object const_objattribute_policies::get(object const& target, object const& key)
56900 {
56901 return python::getattr(target, key);
56902 }
56903 inline object const& attribute_policies::set(
56904 object const& target
56905 , char const* key
56906 , object const& value)
56907 {
56908 python::setattr(target, key, value);
56909 return value;
56910 }
56911 inline object const& objattribute_policies::set(
56912 object const& target
56913 , object const& key
56914 , object const& value)
56915 {
56916 python::setattr(target, key, value);
56917 return value;
56918 }
56919 inline void attribute_policies::del(
56920 object const& target
56921 , char const* key)
56922 {
56923 python::delattr(target, key);
56924 }
56925 inline void objattribute_policies::del(
56926 object const& target
56927 , object const& key)
56928 {
56929 python::delattr(target, key);
56930 }
56931 }}}
56932 namespace boost { namespace python { namespace api {
56933 struct const_item_policies
56934 {
56935 typedef object key_type;
56936 static object get(object const& target, object const& key);
56937 };
56938 struct item_policies : const_item_policies
56939 {
56940 static object const& set(object const& target, object const& key, object const& value);
56941 static void del(object const& target, object const& key);
56942 };
56943 template <class U>
56944 inline object_item
56945 object_operators<U>::operator[](object_cref key)
56946 {
56947 object_cref2 x = *static_cast<U*>(this);
56948 return object_item(x, key);
56949 }
56950 template <class U>
56951 inline const_object_item
56952 object_operators<U>::operator[](object_cref key) const
56953 {
56954 object_cref2 x = *static_cast<U const*>(this);
56955 return const_object_item(x, key);
56956 }
56957 template <class U>
56958 template <class T>
56959 inline const_object_item
56960 object_operators<U>::operator[](T const& key) const
56961 {
56962 return (*this)[object(key)];
56963 }
56964 template <class U>
56965 template <class T>
56966 inline object_item
56967 object_operators<U>::operator[](T const& key)
56968 {
56969 return (*this)[object(key)];
56970 }
56971 inline object const_item_policies::get(object const& target, object const& key)
56972 {
56973 return getitem(target, key);
56974 }
56975 inline object const& item_policies::set(
56976 object const& target
56977 , object const& key
56978 , object const& value)
56979 {
56980 setitem(target, key, value);
56981 return value;
56982 }
56983 inline void item_policies::del(
56984 object const& target
56985 , object const& key)
56986 {
56987 delitem(target, key);
56988 }
56989 }}}
56990 namespace boost { namespace python { namespace api {
56991 struct const_slice_policies
56992 {
56993 typedef std::pair<handle<>, handle<> > key_type;
56994 static object get(object const& target, key_type const& key);
56995 };
56996 struct slice_policies : const_slice_policies
56997 {
56998 static object const& set(object const& target, key_type const& key, object const& value);
56999 static void del(object const& target, key_type const& key);
57000 };
57001 template <class T, class U>
57002 inline slice_policies::key_type slice_key(T x, U y)
57003 {
57004 return slice_policies::key_type(handle<>(x), handle<>(y));
57005 }
57006 template <class U>
57007 object_slice
57008 object_operators<U>::slice(object_cref start, object_cref finish)
57009 {
57010 object_cref2 x = *static_cast<U*>(this);
57011 return object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr())));
57012 }
57013 template <class U>
57014 const_object_slice
57015 object_operators<U>::slice(object_cref start, object_cref finish) const
57016 {
57017 object_cref2 x = *static_cast<U const*>(this);
57018 return const_object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr())));
57019 }
57020 template <class U>
57021 object_slice
57022 object_operators<U>::slice(slice_nil, object_cref finish)
57023 {
57024 object_cref2 x = *static_cast<U*>(this);
57025 return object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr())));
57026 }
57027 template <class U>
57028 const_object_slice
57029 object_operators<U>::slice(slice_nil, object_cref finish) const
57030 {
57031 object_cref2 x = *static_cast<U const*>(this);
57032 return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr())));
57033 }
57034 template <class U>
57035 object_slice
57036 object_operators<U>::slice(slice_nil, slice_nil)
57037 {
57038 object_cref2 x = *static_cast<U*>(this);
57039 return object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0)));
57040 }
57041 template <class U>
57042 const_object_slice
57043 object_operators<U>::slice(slice_nil, slice_nil) const
57044 {
57045 object_cref2 x = *static_cast<U const*>(this);
57046 return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0)));
57047 }
57048 template <class U>
57049 object_slice
57050 object_operators<U>::slice(object_cref start, slice_nil)
57051 {
57052 object_cref2 x = *static_cast<U*>(this);
57053 return object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
57054 }
57055 template <class U>
57056 const_object_slice
57057 object_operators<U>::slice(object_cref start, slice_nil) const
57058 {
57059 object_cref2 x = *static_cast<U const*>(this);
57060 return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
57061 }
57062 template <class U>
57063 template <class T, class V>
57064 inline const_object_slice
57065 object_operators<U>::slice(T const& start, V const& end) const
57066 {
57067 return this->slice(
57068 typename slice_bound<T>::type(start)
57069 , typename slice_bound<V>::type(end));
57070 }
57071 template <class U>
57072 template <class T, class V>
57073 inline object_slice
57074 object_operators<U>::slice(T const& start, V const& end)
57075 {
57076 return this->slice(
57077 typename slice_bound<T>::type(start)
57078 , typename slice_bound<V>::type(end));
57079 }
57080 inline object const_slice_policies::get(object const& target, key_type const& key)
57081 {
57082 return getslice(target, key.first, key.second);
57083 }
57084 inline object const& slice_policies::set(
57085 object const& target
57086 , key_type const& key
57087 , object const& value)
57088 {
57089 setslice(target, key.first, key.second, value);
57090 return value;
57091 }
57092 inline void slice_policies::del(
57093 object const& target
57094 , key_type const& key)
57095 {
57096 delslice(target, key.first, key.second);
57097 }
57098 }}}
57099 namespace boost { namespace python {
57100 inline ssize_t len(object const& obj)
57101 {
57102 ssize_t result = PyObject_Size(obj.ptr());
57103 if (PyErr_Occurred()) throw_error_already_set();
57104 return result;
57105 }
57106 }}
57107 namespace boost { namespace python {
57108 template <class ResultConverterGenerator, class BasePolicy_ = default_call_policies>
57109 struct return_value_policy : BasePolicy_
57110 {
57111 typedef ResultConverterGenerator result_converter;
57112 };
57113 }}
57114 namespace boost { namespace python {
57115 struct return_by_value
57116 {
57117 template <class R>
57118 struct apply
57119 {
57120 typedef to_python_value<
57121 typename detail::value_arg<R>::type
57122 > type;
57123 };
57124 };
57125 }}
57126 namespace boost { namespace python {
57127 namespace detail
57128 {
57129 template <class R>
57130 struct reference_existing_object_requires_a_pointer_or_reference_return_type
57131 {}
57132 ;
57133 }
57134 template <class T> struct to_python_value;
57135 struct reference_existing_object
57136 {
57137 template <class T>
57138 struct apply
57139 {
57140 static const bool ok = is_pointer<T>::value || is_reference<T>::value
57141 ;
57142 typedef typename mpl::if_c<
57143 ok
57144 , to_python_indirect<T, detail::make_reference_holder>
57145 , detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T>
57146 >::type type;
57147 };
57148 };
57149 }}
57150 namespace boost { namespace python { namespace objects {
57151 PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient);
57152 }}}
57153 namespace boost { namespace python {
57154 namespace detail
57155 {
57156 template <std::size_t N>
57157 struct get_prev
57158 {
57159 template <class ArgumentPackage>
57160 static PyObject* execute(ArgumentPackage const& args, PyObject* = 0)
57161 {
57162 int const pre_n = static_cast<int>(N) - 1;
57163 return detail::get(mpl::int_<pre_n>(), args);
57164 }
57165 };
57166 template <>
57167 struct get_prev<0>
57168 {
57169 template <class ArgumentPackage>
57170 static PyObject* execute(ArgumentPackage const&, PyObject* zeroth)
57171 {
57172 return zeroth;
57173 }
57174 };
57175 }
57176 template <
57177 std::size_t custodian
57178 , std::size_t ward
57179 , class BasePolicy_ = default_call_policies
57180 >
57181 struct with_custodian_and_ward : BasePolicy_
57182 {
57183 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((custodian != ward) == 0 ? false : true) >)> boost_static_assert_typedef_45;
57184 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((custodian > 0) == 0 ? false : true) >)> boost_static_assert_typedef_46;
57185 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((ward > 0) == 0 ? false : true) >)> boost_static_assert_typedef_47;
57186 template <class ArgumentPackage>
57187 static bool precall(ArgumentPackage const& args_)
57188 {
57189 unsigned arity_ = detail::arity(args_);
57190 if (custodian > arity_ || ward > arity_)
57191 {
57192 PyErr_SetString(
57193 PyExc_IndexError
57194 , "boost::python::with_custodian_and_ward: argument index out of range"
57195 );
57196 return false;
57197 }
57198 PyObject* patient = detail::get_prev<ward>::execute(args_);
57199 PyObject* nurse = detail::get_prev<custodian>::execute(args_);
57200 PyObject* life_support = python::objects::make_nurse_and_patient(nurse, patient);
57201 if (life_support == 0)
57202 return false;
57203 bool result = BasePolicy_::precall(args_);
57204 if (!result) {
57205 if ( --((PyObject*)(life_support))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(life_support)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(life_support))));
57206 }
57207 return result;
57208 }
57209 };
57210 template <std::size_t custodian, std::size_t ward, class BasePolicy_ = default_call_policies>
57211 struct with_custodian_and_ward_postcall : BasePolicy_
57212 {
57213 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((custodian != ward) == 0 ? false : true) >)> boost_static_assert_typedef_82;
57214 template <class ArgumentPackage>
57215 static PyObject* postcall(ArgumentPackage const& args_, PyObject* result)
57216 {
57217 std::size_t arity_ = detail::arity(args_);
57218 if ( (std::max)(custodian, ward) > arity_ )
57219 {
57220 PyErr_SetString(
57221 PyExc_IndexError
57222 , "boost::python::with_custodian_and_ward_postcall: argument index out of range"
57223 );
57224 return 0;
57225 }
57226 PyObject* patient = detail::get_prev<ward>::execute(args_, result);
57227 PyObject* nurse = detail::get_prev<custodian>::execute(args_, result);
57228 if (nurse == 0) return 0;
57229 result = BasePolicy_::postcall(args_, result);
57230 if (result == 0)
57231 return 0;
57232 if (python::objects::make_nurse_and_patient(nurse, patient) == 0)
57233 {
57234 if ((result) == __null) ; else if ( --((PyObject*)(result))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(result)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(result))));
57235 return 0;
57236 }
57237 return result;
57238 }
57239 };
57240 }}
57241 namespace boost { namespace python {
57242 namespace detail
57243 {
57244 template <std::size_t>
57245 struct return_internal_reference_owner_arg_must_be_greater_than_zero
57246 {}
57247 ;
57248 }
57249 template <std::size_t owner_arg = 1, class BasePolicy_ = default_call_policies>
57250 struct return_internal_reference
57251 : with_custodian_and_ward_postcall<0, owner_arg, BasePolicy_>
57252 {
57253 private:
57254 static const bool legal = owner_arg > 0;
57255 public:
57256 typedef typename mpl::if_c<
57257 legal
57258 , reference_existing_object
57259 , detail::return_internal_reference_owner_arg_must_be_greater_than_zero<owner_arg>
57260 >::type result_converter;
57261 };
57262 }}
57263 namespace boost {
57264 namespace detail {
57265 namespace function {
57266 template<
57267 typename FunctionPtr,
57268 typename R ,
57269 typename T0 , typename T1
57270 >
57271 struct function_invoker2
57272 {
57273 static R invoke(function_buffer& function_ptr ,
57274 T0 a0 , T1 a1)
57275 {
57276 FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
57277 return f( a0 , a1);
57278 }
57279 };
57280 template<
57281 typename FunctionPtr,
57282 typename R ,
57283 typename T0 , typename T1
57284 >
57285 struct void_function_invoker2
57286 {
57287 static void
57288 invoke(function_buffer& function_ptr ,
57289 T0 a0 , T1 a1)
57290 {
57291 FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
57292 f( a0 , a1);
57293 }
57294 };
57295 template<
57296 typename FunctionObj,
57297 typename R ,
57298 typename T0 , typename T1
57299 >
57300 struct function_obj_invoker2
57301 {
57302 static R invoke(function_buffer& function_obj_ptr ,
57303 T0 a0 , T1 a1)
57304 {
57305 FunctionObj* f;
57306 if (function_allows_small_object_optimization<FunctionObj>::value)
57307 f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
57308 else
57309 f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
57310 return (*f)( a0 , a1);
57311 }
57312 };
57313 template<
57314 typename FunctionObj,
57315 typename R ,
57316 typename T0 , typename T1
57317 >
57318 struct void_function_obj_invoker2
57319 {
57320 static void
57321 invoke(function_buffer& function_obj_ptr ,
57322 T0 a0 , T1 a1)
57323 {
57324 FunctionObj* f;
57325 if (function_allows_small_object_optimization<FunctionObj>::value)
57326 f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
57327 else
57328 f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
57329 (*f)( a0 , a1);
57330 }
57331 };
57332 template<
57333 typename FunctionObj,
57334 typename R ,
57335 typename T0 , typename T1
57336 >
57337 struct function_ref_invoker2
57338 {
57339 static R invoke(function_buffer& function_obj_ptr ,
57340 T0 a0 , T1 a1)
57341 {
57342 FunctionObj* f =
57343 reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
57344 return (*f)( a0 , a1);
57345 }
57346 };
57347 template<
57348 typename FunctionObj,
57349 typename R ,
57350 typename T0 , typename T1
57351 >
57352 struct void_function_ref_invoker2
57353 {
57354 static void
57355 invoke(function_buffer& function_obj_ptr ,
57356 T0 a0 , T1 a1)
57357 {
57358 FunctionObj* f =
57359 reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
57360 (*f)( a0 , a1);
57361 }
57362 };
57363 template<
57364 typename MemberPtr,
57365 typename R ,
57366 typename T0 , typename T1
57367 >
57368 struct function_mem_invoker2
57369 {
57370 static R invoke(function_buffer& function_obj_ptr ,
57371 T0 a0 , T1 a1)
57372 {
57373 MemberPtr* f =
57374 reinterpret_cast<MemberPtr*>(&function_obj_ptr.data);
57375 return boost::mem_fn(*f)( a0 , a1);
57376 }
57377 };
57378 template<
57379 typename MemberPtr,
57380 typename R ,
57381 typename T0 , typename T1
57382 >
57383 struct function_void_mem_invoker2
57384 {
57385 static void
57386 invoke(function_buffer& function_obj_ptr ,
57387 T0 a0 , T1 a1)
57388 {
57389 MemberPtr* f =
57390 reinterpret_cast<MemberPtr*>(&function_obj_ptr.data);
57391 boost::mem_fn(*f)( a0 , a1);
57392 }
57393 };
57394 template<
57395 typename FunctionPtr,
57396 typename R ,
57397 typename T0 , typename T1
57398 >
57399 struct get_function_invoker2
57400 {
57401 typedef typename mpl::if_c<(is_void<R>::value),
57402 void_function_invoker2<
57403 FunctionPtr,
57404 R ,
57405 T0 , T1
57406 >,
57407 function_invoker2<
57408 FunctionPtr,
57409 R ,
57410 T0 , T1
57411 >
57412 >::type type;
57413 };
57414 template<
57415 typename FunctionObj,
57416 typename R ,
57417 typename T0 , typename T1
57418 >
57419 struct get_function_obj_invoker2
57420 {
57421 typedef typename mpl::if_c<(is_void<R>::value),
57422 void_function_obj_invoker2<
57423 FunctionObj,
57424 R ,
57425 T0 , T1
57426 >,
57427 function_obj_invoker2<
57428 FunctionObj,
57429 R ,
57430 T0 , T1
57431 >
57432 >::type type;
57433 };
57434 template<
57435 typename FunctionObj,
57436 typename R ,
57437 typename T0 , typename T1
57438 >
57439 struct get_function_ref_invoker2
57440 {
57441 typedef typename mpl::if_c<(is_void<R>::value),
57442 void_function_ref_invoker2<
57443 FunctionObj,
57444 R ,
57445 T0 , T1
57446 >,
57447 function_ref_invoker2<
57448 FunctionObj,
57449 R ,
57450 T0 , T1
57451 >
57452 >::type type;
57453 };
57454 template<
57455 typename MemberPtr,
57456 typename R ,
57457 typename T0 , typename T1
57458 >
57459 struct get_member_invoker2
57460 {
57461 typedef typename mpl::if_c<(is_void<R>::value),
57462 function_void_mem_invoker2<
57463 MemberPtr,
57464 R ,
57465 T0 , T1
57466 >,
57467 function_mem_invoker2<
57468 MemberPtr,
57469 R ,
57470 T0 , T1
57471 >
57472 >::type type;
57473 };
57474 template<typename Tag>
57475 struct get_invoker2 { };
57476 template<>
57477 struct get_invoker2<function_ptr_tag>
57478 {
57479 template<typename FunctionPtr,
57480 typename R , typename T0 , typename T1>
57481 struct apply
57482 {
57483 typedef typename get_function_invoker2<
57484 FunctionPtr,
57485 R ,
57486 T0 , T1
57487 >::type
57488 invoker_type;
57489 typedef functor_manager<FunctionPtr> manager_type;
57490 };
57491 template<typename FunctionPtr,
57492 typename R , typename T0 , typename T1,
57493 typename Allocator>
57494 struct apply_a
57495 {
57496 typedef typename get_function_invoker2<
57497 FunctionPtr,
57498 R ,
57499 T0 , T1
57500 >::type
57501 invoker_type;
57502 typedef functor_manager<FunctionPtr> manager_type;
57503 };
57504 };
57505 template<>
57506 struct get_invoker2<member_ptr_tag>
57507 {
57508 template<typename MemberPtr,
57509 typename R , typename T0 , typename T1>
57510 struct apply
57511 {
57512 typedef typename get_member_invoker2<
57513 MemberPtr,
57514 R ,
57515 T0 , T1
57516 >::type
57517 invoker_type;
57518 typedef functor_manager<MemberPtr> manager_type;
57519 };
57520 template<typename MemberPtr,
57521 typename R , typename T0 , typename T1,
57522 typename Allocator>
57523 struct apply_a
57524 {
57525 typedef typename get_member_invoker2<
57526 MemberPtr,
57527 R ,
57528 T0 , T1
57529 >::type
57530 invoker_type;
57531 typedef functor_manager<MemberPtr> manager_type;
57532 };
57533 };
57534 template<>
57535 struct get_invoker2<function_obj_tag>
57536 {
57537 template<typename FunctionObj,
57538 typename R , typename T0 , typename T1>
57539 struct apply
57540 {
57541 typedef typename get_function_obj_invoker2<
57542 FunctionObj,
57543 R ,
57544 T0 , T1
57545 >::type
57546 invoker_type;
57547 typedef functor_manager<FunctionObj> manager_type;
57548 };
57549 template<typename FunctionObj,
57550 typename R , typename T0 , typename T1,
57551 typename Allocator>
57552 struct apply_a
57553 {
57554 typedef typename get_function_obj_invoker2<
57555 FunctionObj,
57556 R ,
57557 T0 , T1
57558 >::type
57559 invoker_type;
57560 typedef functor_manager_a<FunctionObj, Allocator> manager_type;
57561 };
57562 };
57563 template<>
57564 struct get_invoker2<function_obj_ref_tag>
57565 {
57566 template<typename RefWrapper,
57567 typename R , typename T0 , typename T1>
57568 struct apply
57569 {
57570 typedef typename get_function_ref_invoker2<
57571 typename RefWrapper::type,
57572 R ,
57573 T0 , T1
57574 >::type
57575 invoker_type;
57576 typedef reference_manager<typename RefWrapper::type> manager_type;
57577 };
57578 template<typename RefWrapper,
57579 typename R , typename T0 , typename T1,
57580 typename Allocator>
57581 struct apply_a
57582 {
57583 typedef typename get_function_ref_invoker2<
57584 typename RefWrapper::type,
57585 R ,
57586 T0 , T1
57587 >::type
57588 invoker_type;
57589 typedef reference_manager<typename RefWrapper::type> manager_type;
57590 };
57591 };
57592 template<typename R , typename T0 , typename T1>
57593 struct basic_vtable2
57594 {
57595 typedef R result_type;
57596 typedef result_type (*invoker_type)(function_buffer&
57597 ,
57598 T0 , T1);
57599 template<typename F>
57600 bool assign_to(F f, function_buffer& functor)
57601 {
57602 typedef typename get_function_tag<F>::type tag;
57603 return assign_to(f, functor, tag());
57604 }
57605 template<typename F,typename Allocator>
57606 bool assign_to_a(F f, function_buffer& functor, Allocator a)
57607 {
57608 typedef typename get_function_tag<F>::type tag;
57609 return assign_to_a(f, functor, a, tag());
57610 }
57611 void clear(function_buffer& functor)
57612 {
57613 if (base.manager)
57614 base.manager(functor, functor, destroy_functor_tag);
57615 }
57616 private:
57617 template<typename FunctionPtr>
57618 bool
57619 assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag)
57620 {
57621 this->clear(functor);
57622 if (f) {
57623 functor.func_ptr = (void (*)())(f);
57624 return true;
57625 } else {
57626 return false;
57627 }
57628 }
57629 template<typename FunctionPtr,typename Allocator>
57630 bool
57631 assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag)
57632 {
57633 return assign_to(f,functor,function_ptr_tag());
57634 }
57635 template<typename MemberPtr>
57636 bool assign_to(MemberPtr f, function_buffer& functor, member_ptr_tag)
57637 {
57638 if (f) {
57639 this->assign_to(mem_fn(f), functor);
57640 return true;
57641 } else {
57642 return false;
57643 }
57644 }
57645 template<typename MemberPtr,typename Allocator>
57646 bool assign_to_a(MemberPtr f, function_buffer& functor, Allocator a, member_ptr_tag)
57647 {
57648 if (f) {
57649 this->assign_to_a(mem_fn(f), functor, a);
57650 return true;
57651 } else {
57652 return false;
57653 }
57654 }
57655 template<typename FunctionObj>
57656 void
57657 assign_functor(FunctionObj f, function_buffer& functor, mpl::true_)
57658 {
57659 new ((void*)&functor.data) FunctionObj(f);
57660 }
57661 template<typename FunctionObj,typename Allocator>
57662 void
57663 assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, mpl::true_)
57664 {
57665 assign_functor(f,functor,mpl::true_());
57666 }
57667 template<typename FunctionObj>
57668 void
57669 assign_functor(FunctionObj f, function_buffer& functor, mpl::false_)
57670 {
57671 functor.obj_ptr = new FunctionObj(f);
57672 }
57673 template<typename FunctionObj,typename Allocator>
57674 void
57675 assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_)
57676 {
57677 typedef functor_wrapper<FunctionObj,Allocator> functor_wrapper_type;
57678 typedef typename Allocator::template rebind<functor_wrapper_type>::other
57679 wrapper_allocator_type;
57680 typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type;
57681 wrapper_allocator_type wrapper_allocator(a);
57682 wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1);
57683 wrapper_allocator.construct(copy, functor_wrapper_type(f,a));
57684 functor_wrapper_type* new_f = static_cast<functor_wrapper_type*>(copy);
57685 functor.obj_ptr = new_f;
57686 }
57687 template<typename FunctionObj>
57688 bool
57689 assign_to(FunctionObj f, function_buffer& functor, function_obj_tag)
57690 {
57691 if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
57692 assign_functor(f, functor,
57693 mpl::bool_<(function_allows_small_object_optimization<FunctionObj>::value)>());
57694 return true;
57695 } else {
57696 return false;
57697 }
57698 }
57699 template<typename FunctionObj,typename Allocator>
57700 bool
57701 assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag)
57702 {
57703 if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
57704 assign_functor_a(f, functor, a,
57705 mpl::bool_<(function_allows_small_object_optimization<FunctionObj>::value)>());
57706 return true;
57707 } else {
57708 return false;
57709 }
57710 }
57711 template<typename FunctionObj>
57712 bool
57713 assign_to(const reference_wrapper<FunctionObj>& f,
57714 function_buffer& functor, function_obj_ref_tag)
57715 {
57716 functor.obj_ref.obj_ptr = (void *)f.get_pointer();
57717 functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
57718 functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
57719 return true;
57720 }
57721 template<typename FunctionObj,typename Allocator>
57722 bool
57723 assign_to_a(const reference_wrapper<FunctionObj>& f,
57724 function_buffer& functor, Allocator, function_obj_ref_tag)
57725 {
57726 return assign_to(f,functor,function_obj_ref_tag());
57727 }
57728 public:
57729 vtable_base base;
57730 invoker_type invoker;
57731 };
57732 }
57733 }
57734 template<
57735 typename R ,
57736 typename T0 , typename T1
57737 >
57738 class function2 : public function_base
57739 , public std::binary_function<T0,T1,R>
57740 {
57741 public:
57742 typedef R result_type;
57743 private:
57744 typedef boost::detail::function::basic_vtable2<
57745 R , T0 , T1>
57746 vtable_type;
57747 vtable_type* get_vtable() const {
57748 return reinterpret_cast<vtable_type*>(
57749 reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
57750 }
57751 struct clear_type {};
57752 public:
57753 static const int args = 2;
57754 template<typename Args>
57755 struct sig
57756 {
57757 typedef result_type type;
57758 };
57759 typedef T0 first_argument_type;
57760 typedef T1 second_argument_type;
57761 static const int arity = 2;
57762 typedef T0 arg1_type; typedef T1 arg2_type;
57763 typedef function2 self_type;
57764 function2() : function_base() { }
57765 template<typename Functor>
57766 function2(Functor f
57767 ,typename enable_if_c<
57768 (boost::type_traits::ice_not<
57769 (is_integral<Functor>::value)>::value),
57770 int>::type = 0
57771 ) :
57772 function_base()
57773 {
57774 this->assign_to(f);
57775 }
57776 template<typename Functor,typename Allocator>
57777 function2(Functor f, Allocator a
57778 ,typename enable_if_c<
57779 (boost::type_traits::ice_not<
57780 (is_integral<Functor>::value)>::value),
57781 int>::type = 0
57782 ) :
57783 function_base()
57784 {
57785 this->assign_to_a(f,a);
57786 }
57787 function2(clear_type*) : function_base() { }
57788 function2(const function2& f) : function_base()
57789 {
57790 this->assign_to_own(f);
57791 }
57792 ~function2() { clear(); }
57793 result_type operator()( T0 a0 , T1 a1) const;
57794 template<typename Functor>
57795 typename enable_if_c<
57796 (boost::type_traits::ice_not<
57797 (is_integral<Functor>::value)>::value),
57798 function2&>::type
57799 operator=(Functor f)
57800 {
57801 this->clear();
57802 { try {
57803 this->assign_to(f);
57804 } catch(...) {
57805 vtable = 0;
57806 throw;;
57807 }
57808 }
57809 return *this;
57810 }
57811 template<typename Functor,typename Allocator>
57812 void assign(Functor f, Allocator a)
57813 {
57814 this->clear();
57815 { try{
57816 this->assign_to_a(f,a);
57817 } catch(...) {
57818 vtable = 0;
57819 throw;;
57820 }
57821 }
57822 }
57823 function2& operator=(clear_type*)
57824 {
57825 this->clear();
57826 return *this;
57827 }
57828 function2& operator=(const function2& f)
57829 {
57830 if (&f == this)
57831 return *this;
57832 this->clear();
57833 { try {
57834 this->assign_to_own(f);
57835 } catch(...) {
57836 vtable = 0;
57837 throw;;
57838 }
57839 }
57840 return *this;
57841 }
57842 void swap(function2& other)
57843 {
57844 if (&other == this)
57845 return;
57846 function2 tmp;
57847 tmp.move_assign(*this);
57848 this->move_assign(other);
57849 other.move_assign(tmp);
57850 }
57851 void clear()
57852 {
57853 if (vtable) {
57854 if (!this->has_trivial_copy_and_destroy())
57855 get_vtable()->clear(this->functor);
57856 vtable = 0;
57857 }
57858 }
57859 private:
57860 struct dummy {
57861 void nonnull() {};
57862 };
57863 typedef void (dummy::*safe_bool)();
57864 public:
57865 operator safe_bool () const
57866 { return (this->empty())? 0 : &dummy::nonnull; }
57867 bool operator!() const
57868 { return this->empty(); }
57869 private:
57870 void assign_to_own(const function2& f)
57871 {
57872 if (!f.empty()) {
57873 this->vtable = f.vtable;
57874 if (this->has_trivial_copy_and_destroy())
57875 this->functor = f.functor;
57876 else
57877 get_vtable()->base.manager(f.functor, this->functor,
57878 boost::detail::function::clone_functor_tag);
57879 }
57880 }
57881 template<typename Functor>
57882 void assign_to(Functor f)
57883 {
57884 using detail::function::vtable_base;
57885 typedef typename detail::function::get_function_tag<Functor>::type tag;
57886 typedef detail::function::get_invoker2<tag> get_invoker;
57887 typedef typename get_invoker::
57888 template apply<Functor, R ,
57889 T0 , T1>
57890 handler_type;
57891 typedef typename handler_type::invoker_type invoker_type;
57892 typedef typename handler_type::manager_type manager_type;
57893 static vtable_type stored_vtable =
57894 { { &manager_type::manage }, &invoker_type::invoke };
57895 if (stored_vtable.assign_to(f, functor)) {
57896 std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
57897 if (boost::has_trivial_copy_constructor<Functor>::value &&
57898 boost::has_trivial_destructor<Functor>::value &&
57899 detail::function::function_allows_small_object_optimization<Functor>::value)
57900 value |= (std::size_t)0x01;
57901 vtable = reinterpret_cast<detail::function::vtable_base *>(value);
57902 } else
57903 vtable = 0;
57904 }
57905 template<typename Functor,typename Allocator>
57906 void assign_to_a(Functor f,Allocator a)
57907 {
57908 using detail::function::vtable_base;
57909 typedef typename detail::function::get_function_tag<Functor>::type tag;
57910 typedef detail::function::get_invoker2<tag> get_invoker;
57911 typedef typename get_invoker::
57912 template apply_a<Functor, R ,
57913 T0 , T1,
57914 Allocator>
57915 handler_type;
57916 typedef typename handler_type::invoker_type invoker_type;
57917 typedef typename handler_type::manager_type manager_type;
57918 static vtable_type stored_vtable =
57919 { { &manager_type::manage }, &invoker_type::invoke };
57920 if (stored_vtable.assign_to_a(f, functor, a)) {
57921 std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
57922 if (boost::has_trivial_copy_constructor<Functor>::value &&
57923 boost::has_trivial_destructor<Functor>::value &&
57924 detail::function::function_allows_small_object_optimization<Functor>::value)
57925 value |= (std::size_t)0x01;
57926 vtable = reinterpret_cast<detail::function::vtable_base *>(value);
57927 } else
57928 vtable = 0;
57929 }
57930 void move_assign(function2& f)
57931 {
57932 if (&f == this)
57933 return;
57934 { try {
57935 if (!f.empty()) {
57936 this->vtable = f.vtable;
57937 if (this->has_trivial_copy_and_destroy())
57938 this->functor = f.functor;
57939 else
57940 get_vtable()->base.manager(f.functor, this->functor,
57941 boost::detail::function::move_functor_tag);
57942 f.vtable = 0;
57943 } else {
57944 clear();
57945 }
57946 } catch(...) {
57947 vtable = 0;
57948 throw;;
57949 }
57950 }
57951 }
57952 };
57953 template<typename R , typename T0 , typename T1>
57954 inline void swap(function2<
57955 R ,
57956 T0 , T1
57957 >& f1,
57958 function2<
57959 R ,
57960 T0 , T1
57961 >& f2)
57962 {
57963 f1.swap(f2);
57964 }
57965 template<typename R , typename T0 , typename T1>
57966 typename function2<
57967 R , T0 , T1>::result_type
57968 inline
57969 function2<R , T0 , T1>
57970 ::operator()( T0 a0 , T1 a1) const
57971 {
57972 if (this->empty())
57973 boost::throw_exception(bad_function_call());
57974 return get_vtable()->invoker
57975 (this->functor , a0 , a1);
57976 }
57977 template<typename R , typename T0 , typename T1>
57978 void operator==(const function2<
57979 R ,
57980 T0 , T1>&,
57981 const function2<
57982 R ,
57983 T0 , T1>&);
57984 template<typename R , typename T0 , typename T1>
57985 void operator!=(const function2<
57986 R ,
57987 T0 , T1>&,
57988 const function2<
57989 R ,
57990 T0 , T1>& );
57991 template<typename R ,
57992 typename T0 , typename T1>
57993 class function<R ( T0 , T1)>
57994 : public function2<R , T0 , T1>
57995 {
57996 typedef function2<R , T0 , T1> base_type;
57997 typedef function self_type;
57998 struct clear_type {};
57999 public:
58000 function() : base_type() {}
58001 template<typename Functor>
58002 function(Functor f
58003 ,typename enable_if_c<
58004 (boost::type_traits::ice_not<
58005 (is_integral<Functor>::value)>::value),
58006 int>::type = 0
58007 ) :
58008 base_type(f)
58009 {
58010 }
58011 template<typename Functor,typename Allocator>
58012 function(Functor f, Allocator a
58013 ,typename enable_if_c<
58014 (boost::type_traits::ice_not<
58015 (is_integral<Functor>::value)>::value),
58016 int>::type = 0
58017 ) :
58018 base_type(f,a)
58019 {
58020 }
58021 function(clear_type*) : base_type() {}
58022 function(const self_type& f) : base_type(static_cast<const base_type&>(f)){}
58023 function(const base_type& f) : base_type(static_cast<const base_type&>(f)){}
58024 self_type& operator=(const self_type& f)
58025 {
58026 self_type(f).swap(*this);
58027 return *this;
58028 }
58029 template<typename Functor>
58030 typename enable_if_c<
58031 (boost::type_traits::ice_not<
58032 (is_integral<Functor>::value)>::value),
58033 self_type&>::type
58034 operator=(Functor f)
58035 {
58036 self_type(f).swap(*this);
58037 return *this;
58038 }
58039 self_type& operator=(clear_type*)
58040 {
58041 this->clear();
58042 return *this;
58043 }
58044 self_type& operator=(const base_type& f)
58045 {
58046 self_type(f).swap(*this);
58047 return *this;
58048 }
58049 };
58050 }
58051 namespace boost { namespace python {
58052 namespace objects
58053 {
58054 api::object function_object(
58055 py_function const& f
58056 , python::detail::keyword_range const&);
58057 api::object function_object(
58058 py_function const& f
58059 , python::detail::keyword_range const&);
58060 api::object function_object(py_function const& f);
58061 void add_to_namespace(
58062 object const& name_space, char const* name, object const& attribute);
58063 void add_to_namespace(
58064 object const& name_space, char const* name, object const& attribute, char const* doc);
58065 }
58066 }}
58067 namespace boost { namespace python {
58068 namespace detail
58069 {
58070 template <class F, class CallPolicies, class Sig>
58071 object make_function_aux(
58072 F f
58073 , CallPolicies const& p
58074 , Sig const&
58075 )
58076 {
58077 return objects::function_object(
58078 detail::caller<F,CallPolicies,Sig>(f, p)
58079 );
58080 }
58081 template <class F, class CallPolicies, class Sig, class NumKeywords>
58082 object make_function_aux(
58083 F f
58084 , CallPolicies const& p
58085 , Sig const&
58086 , detail::keyword_range const& kw
58087 , NumKeywords
58088 )
58089 {
58090 enum { arity = mpl::size<Sig>::value - 1 };
58091 typedef typename detail::error::more_keywords_than_function_arguments<
58092 NumKeywords::value, arity
58093 >::too_many_keywords assertion;
58094 return objects::function_object(
58095 detail::caller<F,CallPolicies,Sig>(f, p)
58096 , kw);
58097 }
58098 template <class F, class CallPolicies, class Keywords>
58099 object make_function_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_)
58100 {
58101 return detail::make_function_aux(
58102 f
58103 , policies
58104 , detail::get_signature(f)
58105 , kw.range()
58106 , mpl::int_<Keywords::size>()
58107 );
58108 }
58109 template <class F, class CallPolicies, class Signature>
58110 object make_function_dispatch(F f, CallPolicies const& policies, Signature const& sig, mpl::false_)
58111 {
58112 return detail::make_function_aux(
58113 f
58114 , policies
58115 , sig
58116 );
58117 }
58118 }
58119 template <class F>
58120 object make_function(F f)
58121 {
58122 return detail::make_function_aux(
58123 f,default_call_policies(), detail::get_signature(f));
58124 }
58125 template <class F, class CallPolicies>
58126 object make_function(F f, CallPolicies const& policies)
58127 {
58128 return detail::make_function_aux(
58129 f, policies, detail::get_signature(f));
58130 }
58131 template <class F, class CallPolicies, class KeywordsOrSignature>
58132 object make_function(
58133 F f
58134 , CallPolicies const& policies
58135 , KeywordsOrSignature const& keywords_or_signature)
58136 {
58137 typedef typename
58138 detail::is_reference_to_keywords<KeywordsOrSignature&>::type
58139 is_kw;
58140 return detail::make_function_dispatch(
58141 f
58142 , policies
58143 , keywords_or_signature
58144 , is_kw()
58145 );
58146 }
58147 template <class F, class CallPolicies, class Keywords, class Signature>
58148 object make_function(
58149 F f
58150 , CallPolicies const& policies
58151 , Keywords const& kw
58152 , Signature const& sig
58153 )
58154 {
58155 return detail::make_function_aux(
58156 f
58157 , policies
58158 , sig
58159 , kw.range()
58160 , mpl::int_<Keywords::size>()
58161 );
58162 }
58163 }}
58164 namespace boost { namespace python {
58165 namespace detail
58166 {
58167 template <class Data, class Class>
58168 struct member
58169 {
58170 public:
58171 member(Data Class::*which) : m_which(which) {}
58172 Data& operator()(Class& c) const
58173 {
58174 return c.*m_which;
58175 }
58176 void operator()(Class& c, typename value_arg<Data>::type d) const
58177 {
58178 c.*m_which = d;
58179 }
58180 private:
58181 Data Class::*m_which;
58182 };
58183 template <class Data>
58184 struct datum
58185 {
58186 public:
58187 datum(Data *which) : m_which(which) {}
58188 Data& operator()() const
58189 {
58190 return *m_which;
58191 }
58192 void operator()(typename value_arg<Data>::type d) const
58193 {
58194 *m_which = d;
58195 }
58196 private:
58197 Data *m_which;
58198 };
58199 template <class T>
58200 struct default_getter_by_ref
58201 : mpl::and_<
58202 mpl::bool_<
58203 to_python_value<
58204 typename value_arg<T>::type
58205 >::uses_registry
58206 >
58207 , indirect_traits::is_reference_to_class<
58208 typename value_arg<T>::type
58209 >
58210 >
58211 {
58212 };
58213 template <class T>
58214 struct default_member_getter_policy
58215 : mpl::if_<
58216 default_getter_by_ref<T>
58217 , return_internal_reference<>
58218 , return_value_policy<return_by_value>
58219 >
58220 {};
58221 template <class T>
58222 struct default_datum_getter_policy
58223 : mpl::if_<
58224 default_getter_by_ref<T>
58225 , return_value_policy<reference_existing_object>
58226 , return_value_policy<return_by_value>
58227 >
58228 {};
58229 template <class D, class Policies>
58230 inline object make_getter(D* d, Policies const& policies, mpl::false_, int)
58231 {
58232 return python::make_function(
58233 detail::datum<D>(d), policies, mpl::vector1<D&>()
58234 );
58235 }
58236 template <class D>
58237 inline object make_getter(D* d, not_specified, mpl::false_, long)
58238 {
58239 typedef typename default_datum_getter_policy<D>::type policies;
58240 return detail::make_getter(d, policies(), mpl::false_(), 0);
58241 }
58242 template <class C, class D, class Policies>
58243 inline object make_getter(D C::*pm, Policies const& policies, mpl::true_, int)
58244 {
58245 typedef C Class;
58246 return python::make_function(
58247 detail::member<D,Class>(pm)
58248 , policies
58249 , mpl::vector2<D&,Class&>()
58250 );
58251 }
58252 template <class C, class D>
58253 inline object make_getter(D C::*pm, not_specified, mpl::true_, long)
58254 {
58255 typedef typename default_member_getter_policy<D>::type policies;
58256 return detail::make_getter(pm, policies(), mpl::true_(), 0);
58257 }
58258 template <class D, class P>
58259 inline object make_getter(D& d, P& p, mpl::false_, ...)
58260 {
58261 return detail::make_getter(&d, p, mpl::false_(), 0L);
58262 }
58263 template <class D, class Policies>
58264 inline object make_setter(D* p, Policies const& policies, mpl::false_, int)
58265 {
58266 return python::make_function(
58267 detail::datum<D>(p), policies, mpl::vector2<void,D const&>()
58268 );
58269 }
58270 template <class C, class D, class Policies>
58271 inline object make_setter(D C::*pm, Policies const& policies, mpl::true_, int)
58272 {
58273 return python::make_function(
58274 detail::member<D,C>(pm)
58275 , policies
58276 , mpl::vector3<void, C&, D const&>()
58277 );
58278 }
58279 template <class D, class Policies>
58280 inline object make_setter(D& x, Policies const& policies, mpl::false_, ...)
58281 {
58282 return detail::make_setter(&x, policies, mpl::false_(), 0L);
58283 }
58284 }
58285 template <class D, class Policies>
58286 inline object make_getter(D& d, Policies const& policies)
58287 {
58288 return detail::make_getter(d, policies, is_member_pointer<D>(), 0L);
58289 }
58290 template <class D, class Policies>
58291 inline object make_getter(D const& d, Policies const& policies)
58292 {
58293 return detail::make_getter(d, policies, is_member_pointer<D>(), 0L);
58294 }
58295 template <class D>
58296 inline object make_getter(D& x)
58297 {
58298 detail::not_specified policy
58299 = detail::not_specified();
58300 return detail::make_getter(x, policy, is_member_pointer<D>(), 0L);
58301 }
58302 template <class D>
58303 inline object make_getter(D const& d)
58304 {
58305 detail::not_specified policy
58306 = detail::not_specified();
58307 return detail::make_getter(d, policy, is_member_pointer<D>(), 0L);
58308 }
58309 template <class D, class Policies>
58310 inline object make_setter(D& x, Policies const& policies)
58311 {
58312 return detail::make_setter(x, policies, is_member_pointer<D>(), 0);
58313 }
58314 template <class D, class Policies>
58315 inline object make_setter(D const& x, Policies const& policies)
58316 {
58317 return detail::make_setter(x, policies, is_member_pointer<D>(), 0);
58318 }
58319 template <class D>
58320 inline object make_setter(D& x)
58321 {
58322 return detail::make_setter(x, default_call_policies(), is_member_pointer<D>(), 0);
58323 }
58324 template <class D>
58325 inline object make_setter(D const& x)
58326 {
58327 return detail::make_setter(x, default_call_policies(), is_member_pointer<D>(), 0);
58328 }
58329 }}
58330
58331 namespace boost { namespace python { namespace objects {
58332 template <int nargs> struct make_holder;
58333 template <>
58334 struct make_holder<0>
58335 {
58336 template <class Holder, class ArgList>
58337 struct apply
58338 {
58339 static void execute(
58340 PyObject *p
58341 )
58342 {
58343 typedef instance<Holder> instance_t;
58344 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58345 try {
58346 (new (memory) Holder(
58347 p ))->install(p);
58348 }
58349 catch(...) {
58350 Holder::deallocate(p, memory);
58351 throw;
58352 }
58353 }
58354 };
58355 };
58356 template <>
58357 struct make_holder<1>
58358 {
58359 template <class Holder, class ArgList>
58360 struct apply
58361 {
58362 typedef typename mpl::begin<ArgList>::type iter0;
58363 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58364 static void execute(
58365 PyObject *p
58366 , t0 a0)
58367 {
58368 typedef instance<Holder> instance_t;
58369 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58370 try {
58371 (new (memory) Holder(
58372 p , f0(a0)))->install(p);
58373 }
58374 catch(...) {
58375 Holder::deallocate(p, memory);
58376 throw;
58377 }
58378 }
58379 };
58380 };
58381 template <>
58382 struct make_holder<2>
58383 {
58384 template <class Holder, class ArgList>
58385 struct apply
58386 {
58387 typedef typename mpl::begin<ArgList>::type iter0;
58388 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58389 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58390 static void execute(
58391 PyObject *p
58392 , t0 a0 , t1 a1)
58393 {
58394 typedef instance<Holder> instance_t;
58395 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58396 try {
58397 (new (memory) Holder(
58398 p , f0(a0) , f1(a1)))->install(p);
58399 }
58400 catch(...) {
58401 Holder::deallocate(p, memory);
58402 throw;
58403 }
58404 }
58405 };
58406 };
58407 template <>
58408 struct make_holder<3>
58409 {
58410 template <class Holder, class ArgList>
58411 struct apply
58412 {
58413 typedef typename mpl::begin<ArgList>::type iter0;
58414 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58415 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58416 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58417 static void execute(
58418 PyObject *p
58419 , t0 a0 , t1 a1 , t2 a2)
58420 {
58421 typedef instance<Holder> instance_t;
58422 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58423 try {
58424 (new (memory) Holder(
58425 p , f0(a0) , f1(a1) , f2(a2)))->install(p);
58426 }
58427 catch(...) {
58428 Holder::deallocate(p, memory);
58429 throw;
58430 }
58431 }
58432 };
58433 };
58434 template <>
58435 struct make_holder<4>
58436 {
58437 template <class Holder, class ArgList>
58438 struct apply
58439 {
58440 typedef typename mpl::begin<ArgList>::type iter0;
58441 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58442 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58443 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58444 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58445 static void execute(
58446 PyObject *p
58447 , t0 a0 , t1 a1 , t2 a2 , t3 a3)
58448 {
58449 typedef instance<Holder> instance_t;
58450 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58451 try {
58452 (new (memory) Holder(
58453 p , f0(a0) , f1(a1) , f2(a2) , f3(a3)))->install(p);
58454 }
58455 catch(...) {
58456 Holder::deallocate(p, memory);
58457 throw;
58458 }
58459 }
58460 };
58461 };
58462 template <>
58463 struct make_holder<5>
58464 {
58465 template <class Holder, class ArgList>
58466 struct apply
58467 {
58468 typedef typename mpl::begin<ArgList>::type iter0;
58469 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58470 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58471 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58472 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58473 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58474 static void execute(
58475 PyObject *p
58476 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4)
58477 {
58478 typedef instance<Holder> instance_t;
58479 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58480 try {
58481 (new (memory) Holder(
58482 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4)))->install(p);
58483 }
58484 catch(...) {
58485 Holder::deallocate(p, memory);
58486 throw;
58487 }
58488 }
58489 };
58490 };
58491 template <>
58492 struct make_holder<6>
58493 {
58494 template <class Holder, class ArgList>
58495 struct apply
58496 {
58497 typedef typename mpl::begin<ArgList>::type iter0;
58498 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58499 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58500 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58501 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58502 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58503 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58504 static void execute(
58505 PyObject *p
58506 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5)
58507 {
58508 typedef instance<Holder> instance_t;
58509 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58510 try {
58511 (new (memory) Holder(
58512 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5)))->install(p);
58513 }
58514 catch(...) {
58515 Holder::deallocate(p, memory);
58516 throw;
58517 }
58518 }
58519 };
58520 };
58521 template <>
58522 struct make_holder<7>
58523 {
58524 template <class Holder, class ArgList>
58525 struct apply
58526 {
58527 typedef typename mpl::begin<ArgList>::type iter0;
58528 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58529 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58530 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58531 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58532 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58533 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58534 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58535 static void execute(
58536 PyObject *p
58537 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6)
58538 {
58539 typedef instance<Holder> instance_t;
58540 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58541 try {
58542 (new (memory) Holder(
58543 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6)))->install(p);
58544 }
58545 catch(...) {
58546 Holder::deallocate(p, memory);
58547 throw;
58548 }
58549 }
58550 };
58551 };
58552 template <>
58553 struct make_holder<8>
58554 {
58555 template <class Holder, class ArgList>
58556 struct apply
58557 {
58558 typedef typename mpl::begin<ArgList>::type iter0;
58559 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58560 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58561 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58562 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58563 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58564 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58565 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58566 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58567 static void execute(
58568 PyObject *p
58569 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7)
58570 {
58571 typedef instance<Holder> instance_t;
58572 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58573 try {
58574 (new (memory) Holder(
58575 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7)))->install(p);
58576 }
58577 catch(...) {
58578 Holder::deallocate(p, memory);
58579 throw;
58580 }
58581 }
58582 };
58583 };
58584 template <>
58585 struct make_holder<9>
58586 {
58587 template <class Holder, class ArgList>
58588 struct apply
58589 {
58590 typedef typename mpl::begin<ArgList>::type iter0;
58591 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58592 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58593 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58594 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58595 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58596 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58597 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58598 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58599 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58600 static void execute(
58601 PyObject *p
58602 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8)
58603 {
58604 typedef instance<Holder> instance_t;
58605 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58606 try {
58607 (new (memory) Holder(
58608 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8)))->install(p);
58609 }
58610 catch(...) {
58611 Holder::deallocate(p, memory);
58612 throw;
58613 }
58614 }
58615 };
58616 };
58617 template <>
58618 struct make_holder<10>
58619 {
58620 template <class Holder, class ArgList>
58621 struct apply
58622 {
58623 typedef typename mpl::begin<ArgList>::type iter0;
58624 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58625 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58626 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58627 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58628 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58629 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58630 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58631 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58632 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58633 typedef typename mpl::deref<iter9>::type t9; typedef typename forward<t9>::type f9; typedef typename mpl::next<iter9>::type iter10;
58634 static void execute(
58635 PyObject *p
58636 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8 , t9 a9)
58637 {
58638 typedef instance<Holder> instance_t;
58639 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58640 try {
58641 (new (memory) Holder(
58642 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8) , f9(a9)))->install(p);
58643 }
58644 catch(...) {
58645 Holder::deallocate(p, memory);
58646 throw;
58647 }
58648 }
58649 };
58650 };
58651 template <>
58652 struct make_holder<11>
58653 {
58654 template <class Holder, class ArgList>
58655 struct apply
58656 {
58657 typedef typename mpl::begin<ArgList>::type iter0;
58658 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58659 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58660 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58661 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58662 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58663 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58664 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58665 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58666 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58667 typedef typename mpl::deref<iter9>::type t9; typedef typename forward<t9>::type f9; typedef typename mpl::next<iter9>::type iter10;
58668 typedef typename mpl::deref<iter10>::type t10; typedef typename forward<t10>::type f10; typedef typename mpl::next<iter10>::type iter11;
58669 static void execute(
58670 PyObject *p
58671 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8 , t9 a9 , t10 a10)
58672 {
58673 typedef instance<Holder> instance_t;
58674 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58675 try {
58676 (new (memory) Holder(
58677 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8) , f9(a9) , f10(a10)))->install(p);
58678 }
58679 catch(...) {
58680 Holder::deallocate(p, memory);
58681 throw;
58682 }
58683 }
58684 };
58685 };
58686 template <>
58687 struct make_holder<12>
58688 {
58689 template <class Holder, class ArgList>
58690 struct apply
58691 {
58692 typedef typename mpl::begin<ArgList>::type iter0;
58693 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58694 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58695 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58696 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58697 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58698 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58699 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58700 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58701 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58702 typedef typename mpl::deref<iter9>::type t9; typedef typename forward<t9>::type f9; typedef typename mpl::next<iter9>::type iter10;
58703 typedef typename mpl::deref<iter10>::type t10; typedef typename forward<t10>::type f10; typedef typename mpl::next<iter10>::type iter11;
58704 typedef typename mpl::deref<iter11>::type t11; typedef typename forward<t11>::type f11; typedef typename mpl::next<iter11>::type iter12;
58705 static void execute(
58706 PyObject *p
58707 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8 , t9 a9 , t10 a10 , t11 a11)
58708 {
58709 typedef instance<Holder> instance_t;
58710 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58711 try {
58712 (new (memory) Holder(
58713 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8) , f9(a9) , f10(a10) , f11(a11)))->install(p);
58714 }
58715 catch(...) {
58716 Holder::deallocate(p, memory);
58717 throw;
58718 }
58719 }
58720 };
58721 };
58722 template <>
58723 struct make_holder<13>
58724 {
58725 template <class Holder, class ArgList>
58726 struct apply
58727 {
58728 typedef typename mpl::begin<ArgList>::type iter0;
58729 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58730 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58731 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58732 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58733 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58734 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58735 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58736 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58737 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58738 typedef typename mpl::deref<iter9>::type t9; typedef typename forward<t9>::type f9; typedef typename mpl::next<iter9>::type iter10;
58739 typedef typename mpl::deref<iter10>::type t10; typedef typename forward<t10>::type f10; typedef typename mpl::next<iter10>::type iter11;
58740 typedef typename mpl::deref<iter11>::type t11; typedef typename forward<t11>::type f11; typedef typename mpl::next<iter11>::type iter12;
58741 typedef typename mpl::deref<iter12>::type t12; typedef typename forward<t12>::type f12; typedef typename mpl::next<iter12>::type iter13;
58742 static void execute(
58743 PyObject *p
58744 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8 , t9 a9 , t10 a10 , t11 a11 , t12 a12)
58745 {
58746 typedef instance<Holder> instance_t;
58747 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58748 try {
58749 (new (memory) Holder(
58750 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8) , f9(a9) , f10(a10) , f11(a11) , f12(a12)))->install(p);
58751 }
58752 catch(...) {
58753 Holder::deallocate(p, memory);
58754 throw;
58755 }
58756 }
58757 };
58758 };
58759 template <>
58760 struct make_holder<14>
58761 {
58762 template <class Holder, class ArgList>
58763 struct apply
58764 {
58765 typedef typename mpl::begin<ArgList>::type iter0;
58766 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58767 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58768 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58769 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58770 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58771 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58772 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58773 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58774 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58775 typedef typename mpl::deref<iter9>::type t9; typedef typename forward<t9>::type f9; typedef typename mpl::next<iter9>::type iter10;
58776 typedef typename mpl::deref<iter10>::type t10; typedef typename forward<t10>::type f10; typedef typename mpl::next<iter10>::type iter11;
58777 typedef typename mpl::deref<iter11>::type t11; typedef typename forward<t11>::type f11; typedef typename mpl::next<iter11>::type iter12;
58778 typedef typename mpl::deref<iter12>::type t12; typedef typename forward<t12>::type f12; typedef typename mpl::next<iter12>::type iter13;
58779 typedef typename mpl::deref<iter13>::type t13; typedef typename forward<t13>::type f13; typedef typename mpl::next<iter13>::type iter14;
58780 static void execute(
58781 PyObject *p
58782 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8 , t9 a9 , t10 a10 , t11 a11 , t12 a12 , t13 a13)
58783 {
58784 typedef instance<Holder> instance_t;
58785 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58786 try {
58787 (new (memory) Holder(
58788 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8) , f9(a9) , f10(a10) , f11(a11) , f12(a12) , f13(a13)))->install(p);
58789 }
58790 catch(...) {
58791 Holder::deallocate(p, memory);
58792 throw;
58793 }
58794 }
58795 };
58796 };
58797 template <>
58798 struct make_holder<15>
58799 {
58800 template <class Holder, class ArgList>
58801 struct apply
58802 {
58803 typedef typename mpl::begin<ArgList>::type iter0;
58804 typedef typename mpl::deref<iter0>::type t0; typedef typename forward<t0>::type f0; typedef typename mpl::next<iter0>::type iter1;
58805 typedef typename mpl::deref<iter1>::type t1; typedef typename forward<t1>::type f1; typedef typename mpl::next<iter1>::type iter2;
58806 typedef typename mpl::deref<iter2>::type t2; typedef typename forward<t2>::type f2; typedef typename mpl::next<iter2>::type iter3;
58807 typedef typename mpl::deref<iter3>::type t3; typedef typename forward<t3>::type f3; typedef typename mpl::next<iter3>::type iter4;
58808 typedef typename mpl::deref<iter4>::type t4; typedef typename forward<t4>::type f4; typedef typename mpl::next<iter4>::type iter5;
58809 typedef typename mpl::deref<iter5>::type t5; typedef typename forward<t5>::type f5; typedef typename mpl::next<iter5>::type iter6;
58810 typedef typename mpl::deref<iter6>::type t6; typedef typename forward<t6>::type f6; typedef typename mpl::next<iter6>::type iter7;
58811 typedef typename mpl::deref<iter7>::type t7; typedef typename forward<t7>::type f7; typedef typename mpl::next<iter7>::type iter8;
58812 typedef typename mpl::deref<iter8>::type t8; typedef typename forward<t8>::type f8; typedef typename mpl::next<iter8>::type iter9;
58813 typedef typename mpl::deref<iter9>::type t9; typedef typename forward<t9>::type f9; typedef typename mpl::next<iter9>::type iter10;
58814 typedef typename mpl::deref<iter10>::type t10; typedef typename forward<t10>::type f10; typedef typename mpl::next<iter10>::type iter11;
58815 typedef typename mpl::deref<iter11>::type t11; typedef typename forward<t11>::type f11; typedef typename mpl::next<iter11>::type iter12;
58816 typedef typename mpl::deref<iter12>::type t12; typedef typename forward<t12>::type f12; typedef typename mpl::next<iter12>::type iter13;
58817 typedef typename mpl::deref<iter13>::type t13; typedef typename forward<t13>::type f13; typedef typename mpl::next<iter13>::type iter14;
58818 typedef typename mpl::deref<iter14>::type t14; typedef typename forward<t14>::type f14; typedef typename mpl::next<iter14>::type iter15;
58819 static void execute(
58820 PyObject *p
58821 , t0 a0 , t1 a1 , t2 a2 , t3 a3 , t4 a4 , t5 a5 , t6 a6 , t7 a7 , t8 a8 , t9 a9 , t10 a10 , t11 a11 , t12 a12 , t13 a13 , t14 a14)
58822 {
58823 typedef instance<Holder> instance_t;
58824 void* memory = Holder::allocate(p, __builtin_offsetof (instance_t, storage), sizeof(Holder));
58825 try {
58826 (new (memory) Holder(
58827 p , f0(a0) , f1(a1) , f2(a2) , f3(a3) , f4(a4) , f5(a5) , f6(a6) , f7(a7) , f8(a8) , f9(a9) , f10(a10) , f11(a11) , f12(a12) , f13(a13) , f14(a14)))->install(p);
58828 }
58829 catch(...) {
58830 Holder::deallocate(p, memory);
58831 throw;
58832 }
58833 }
58834 };
58835 };
58836 }}}
58837 namespace boost { namespace python { namespace detail {
58838 template <class F, class Policies>
58839 object make_keyword_range_function(
58840 F f
58841 , Policies const& policies
58842 , keyword_range const& kw)
58843 {
58844 return detail::make_function_aux(
58845 f, policies, detail::get_signature(f), kw, mpl::int_<0>());
58846 }
58847 template <class F, class Policies, class Signature>
58848 object make_keyword_range_function(
58849 F f
58850 , Policies const& policies
58851 , keyword_range const& kw
58852 , Signature const& sig)
58853 {
58854 return detail::make_function_aux(
58855 f, policies, sig, kw, mpl::int_<0>());
58856 }
58857 template <class ArgList, class Arity, class Holder, class CallPolicies>
58858 object make_keyword_range_constructor(
58859 CallPolicies const& policies
58860 , detail::keyword_range const& kw
58861 , Holder* = 0
58862 , ArgList* = 0, Arity* = 0)
58863 {
58864 return detail::make_keyword_range_function(
58865 objects::make_holder<Arity::value>
58866 ::template apply<Holder,ArgList>::execute
58867 , policies
58868 , kw);
58869 }
58870 }}}
58871 namespace boost { namespace mpl {
58872 template< typename Tag >
58873 struct empty_impl
58874 {
58875 template< typename Sequence > struct apply
58876 : is_same<
58877 typename begin<Sequence>::type
58878 , typename end<Sequence>::type
58879 >
58880 {
58881 };
58882 };
58883 template<> struct empty_impl<non_sequence_tag> {};
58884 }}
58885 namespace boost { namespace mpl {
58886 template<
58887 typename Sequence = na
58888 >
58889 struct empty
58890 : empty_impl< typename sequence_tag<Sequence>::type >
58891 ::template apply< Sequence >
58892 {
58893
58894 };
58895 template<> struct empty< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : empty< T1 > { }; }; template< typename Tag > struct lambda< empty< na > , Tag , int_<-1> > { typedef false_ is_le; typedef empty< na > result_; typedef empty< na > type; }; namespace aux { template< typename T1 > struct template_arity< empty< T1 > > : int_<1> { }; template<> struct template_arity< empty< na > > : int_<-1> { }; }
58896 }}
58897 namespace boost { namespace mpl {
58898 template<
58899 typename Iterator1
58900 , typename LastIterator1
58901 , typename Iterator2
58902 >
58903 struct joint_iter
58904 {
58905 typedef Iterator1 base;
58906 typedef forward_iterator_tag category;
58907 };
58908 template<
58909 typename LastIterator1
58910 , typename Iterator2
58911 >
58912 struct joint_iter<LastIterator1,LastIterator1,Iterator2>
58913 {
58914 typedef Iterator2 base;
58915 typedef forward_iterator_tag category;
58916 };
58917 template< typename I1, typename L1, typename I2 >
58918 struct deref< joint_iter<I1,L1,I2> >
58919 {
58920 typedef typename joint_iter<I1,L1,I2>::base base_;
58921 typedef typename deref<base_>::type type;
58922 };
58923 template< typename I1, typename L1, typename I2 >
58924 struct next< joint_iter<I1,L1,I2> >
58925 {
58926 typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > type;
58927 };
58928 template< typename L1, typename I2 >
58929 struct next< joint_iter<L1,L1,I2> >
58930 {
58931 typedef joint_iter< L1,L1,typename mpl::next<I2>::type > type;
58932 };
58933 template< typename T1 , typename T2 , typename T3 , typename Tag > struct lambda< joint_iter< T1 , T2 , T3 > , Tag , int_<3> > { typedef false_ is_le; typedef joint_iter< T1 , T2 , T3 > result_; typedef result_ type; };
58934 }}
58935 namespace boost { namespace mpl {
58936 namespace aux {
58937 struct joint_view_tag;
58938 }
58939 template<>
58940 struct size_impl< aux::joint_view_tag >
58941 {
58942 template < typename JointView > struct apply
58943 : plus<
58944 size<typename JointView::sequence1_>
58945 , size<typename JointView::sequence2_>
58946 >
58947 {};
58948 };
58949 template<
58950 typename Sequence1_ = na
58951 , typename Sequence2_ = na
58952 >
58953 struct joint_view
58954 {
58955 typedef typename mpl::begin<Sequence1_>::type first1_;
58956 typedef typename mpl::end<Sequence1_>::type last1_;
58957 typedef typename mpl::begin<Sequence2_>::type first2_;
58958 typedef typename mpl::end<Sequence2_>::type last2_;
58959 typedef Sequence1_ sequence1_;
58960 typedef Sequence2_ sequence2_;
58961 typedef joint_view type;
58962 typedef aux::joint_view_tag tag;
58963 typedef joint_iter<first1_,last1_,first2_> begin;
58964 typedef joint_iter<last1_,last1_,last2_> end;
58965 };
58966 template<> struct joint_view< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : joint_view< T1 , T2 > { }; }; template< typename Tag > struct lambda< joint_view< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef joint_view< na , na > result_; typedef joint_view< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< joint_view< T1 , T2 > > : int_<2> { }; template<> struct template_arity< joint_view< na , na > > : int_<-1> { }; }
58967 }}
58968 namespace boost { namespace mpl {
58969 template< typename Tag >
58970 struct back_impl
58971 {
58972 template< typename Sequence > struct apply
58973 {
58974 typedef typename end<Sequence>::type end_;
58975 typedef typename prior<end_>::type last_;
58976 typedef typename deref<last_>::type type;
58977 };
58978 };
58979 template<> struct back_impl<non_sequence_tag> {};
58980 }}
58981 namespace boost { namespace mpl {
58982 template<
58983 typename Sequence = na
58984 >
58985 struct back
58986 : back_impl< typename sequence_tag<Sequence>::type >
58987 ::template apply< Sequence >
58988 {
58989
58990 };
58991 template<> struct back< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : back< T1 > { }; }; template< typename Tag > struct lambda< back< na > , Tag , int_<-1> > { typedef false_ is_le; typedef back< na > result_; typedef back< na > type; }; namespace aux { template< typename T1 > struct template_arity< back< T1 > > : int_<1> { }; template<> struct template_arity< back< na > > : int_<-1> { }; }
58992 }}
58993 namespace boost { namespace python {
58994 template < class T0 = mpl::void_ , class T1 = mpl::void_ , class T2 = mpl::void_ , class T3 = mpl::void_ , class T4 = mpl::void_ , class T5 = mpl::void_ , class T6 = mpl::void_ , class T7 = mpl::void_ , class T8 = mpl::void_ , class T9 = mpl::void_ , class T10 = mpl::void_ , class T11 = mpl::void_ , class T12 = mpl::void_ , class T13 = mpl::void_ , class T14 = mpl::void_ >
58995 class init;
58996 template < class T0 = mpl::void_ , class T1 = mpl::void_ , class T2 = mpl::void_ , class T3 = mpl::void_ , class T4 = mpl::void_ , class T5 = mpl::void_ , class T6 = mpl::void_ , class T7 = mpl::void_ , class T8 = mpl::void_ , class T9 = mpl::void_ , class T10 = mpl::void_ , class T11 = mpl::void_ , class T12 = mpl::void_ , class T13 = mpl::void_ , class T14 = mpl::void_ >
58997 struct optional;
58998 namespace detail
58999 {
59000 namespace error
59001 {
59002 template <int keywords, int init_args>
59003 struct more_keywords_than_init_arguments
59004 {
59005 typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1];
59006 };
59007 }
59008 template <class T>
59009 struct is_optional
59010 : mpl::false_
59011 {};
59012 template < class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
59013 struct is_optional<optional< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14> >
59014 : mpl::true_
59015 {};
59016 template <int NDefaults>
59017 struct define_class_init_helper;
59018 }
59019 template <class DerivedT>
59020 struct init_base : def_visitor<DerivedT>
59021 {
59022 init_base(char const* doc_, detail::keyword_range const& keywords_)
59023 : m_doc(doc_), m_keywords(keywords_)
59024 {}
59025 init_base(char const* doc_)
59026 : m_doc(doc_)
59027 {}
59028 DerivedT const& derived() const
59029 {
59030 return *static_cast<DerivedT const*>(this);
59031 }
59032 char const* doc_string() const
59033 {
59034 return m_doc;
59035 }
59036 detail::keyword_range const& keywords() const
59037 {
59038 return m_keywords;
59039 }
59040 static default_call_policies call_policies()
59041 {
59042 return default_call_policies();
59043 }
59044 private:
59045 template <class classT>
59046 void visit(classT& cl) const
59047 {
59048 typedef typename DerivedT::signature signature;
59049 typedef typename DerivedT::n_arguments n_arguments;
59050 typedef typename DerivedT::n_defaults n_defaults;
59051 detail::define_class_init_helper<n_defaults::value>::apply(
59052 cl
59053 , derived().call_policies()
59054 , signature()
59055 , n_arguments()
59056 , derived().doc_string()
59057 , derived().keywords());
59058 }
59059 friend class python::def_visitor_access;
59060 private:
59061 char const* m_doc;
59062 detail::keyword_range m_keywords;
59063 };
59064 template <class CallPoliciesT, class InitT>
59065 class init_with_call_policies
59066 : public init_base<init_with_call_policies<CallPoliciesT, InitT> >
59067 {
59068 typedef init_base<init_with_call_policies<CallPoliciesT, InitT> > base;
59069 public:
59070 typedef typename InitT::n_arguments n_arguments;
59071 typedef typename InitT::n_defaults n_defaults;
59072 typedef typename InitT::signature signature;
59073 init_with_call_policies(
59074 CallPoliciesT const& policies_
59075 , char const* doc_
59076 , detail::keyword_range const& keywords
59077 )
59078 : base(doc_, keywords)
59079 , m_policies(policies_)
59080 {}
59081 CallPoliciesT const& call_policies() const
59082 {
59083 return this->m_policies;
59084 }
59085 private:
59086 CallPoliciesT m_policies;
59087 };
59088 namespace detail
59089 {
59090 template <class S>
59091 struct drop1
59092 : mpl::iterator_range<
59093 typename mpl::begin<S>::type
59094 , typename mpl::prior<
59095 typename mpl::end<S>::type
59096 >::type
59097 >
59098 {};
59099 }
59100 template < class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
59101 class init : public init_base<init< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14> >
59102 {
59103 typedef init_base<init< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14> > base;
59104 public:
59105 typedef init< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14> self_t;
59106 init(char const* doc_ = 0)
59107 : base(doc_)
59108 {
59109 }
59110 template <std::size_t N>
59111 init(char const* doc_, detail::keywords<N> const& kw)
59112 : base(doc_, kw.range())
59113 {
59114 typedef typename detail::error::more_keywords_than_init_arguments<
59115 N, n_arguments::value + 1
59116 >::too_many_keywords assertion;
59117 }
59118 template <std::size_t N>
59119 init(detail::keywords<N> const& kw, char const* doc_ = 0)
59120 : base(doc_, kw.range())
59121 {
59122 typedef typename detail::error::more_keywords_than_init_arguments<
59123 N, n_arguments::value + 1
59124 >::too_many_keywords assertion;
59125 }
59126 template <class CallPoliciesT>
59127 init_with_call_policies<CallPoliciesT, self_t>
59128 operator[](CallPoliciesT const& policies) const
59129 {
59130 return init_with_call_policies<CallPoliciesT, self_t>(
59131 policies, this->doc_string(), this->keywords());
59132 }
59133 typedef detail::type_list< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14> signature_;
59134 typedef detail::is_optional<
59135 typename mpl::eval_if<
59136 mpl::empty<signature_>
59137 , mpl::false_
59138 , mpl::back<signature_>
59139 >::type
59140 > back_is_optional;
59141 typedef typename mpl::eval_if<
59142 back_is_optional
59143 , mpl::back<signature_>
59144 , mpl::vector0<>
59145 >::type optional_args;
59146 typedef typename mpl::eval_if<
59147 back_is_optional
59148 , mpl::if_<
59149 mpl::empty<optional_args>
59150 , detail::drop1<signature_>
59151 , mpl::joint_view<
59152 detail::drop1<signature_>
59153 , optional_args
59154 >
59155 >
59156 , signature_
59157 >::type signature;
59158 typedef mpl::size<optional_args> n_defaults;
59159 typedef mpl::size<signature> n_arguments;
59160 };
59161 template < class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14>
59162 struct optional
59163 : detail::type_list< T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14>
59164 {
59165 };
59166 namespace detail
59167 {
59168 template <class ClassT, class CallPoliciesT, class Signature, class NArgs>
59169 inline void def_init_aux(
59170 ClassT& cl
59171 , Signature const&
59172 , NArgs
59173 , CallPoliciesT const& policies
59174 , char const* doc
59175 , detail::keyword_range const& keywords_
59176 )
59177 {
59178 cl.def(
59179 "__init__"
59180 , detail::make_keyword_range_constructor<Signature,NArgs>(
59181 policies
59182 , keywords_
59183 , (typename ClassT::metadata::holder*)0
59184 )
59185 , doc
59186 );
59187 }
59188 template <int NDefaults>
59189 struct define_class_init_helper
59190 {
59191 template <class ClassT, class CallPoliciesT, class Signature, class NArgs>
59192 static void apply(
59193 ClassT& cl
59194 , CallPoliciesT const& policies
59195 , Signature const& args
59196 , NArgs
59197 , char const* doc
59198 , detail::keyword_range keywords)
59199 {
59200 detail::def_init_aux(cl, args, NArgs(), policies, doc, keywords);
59201 if (keywords.second > keywords.first)
59202 --keywords.second;
59203 typedef typename mpl::prior<NArgs>::type next_nargs;
59204 define_class_init_helper<NDefaults-1>::apply(
59205 cl, policies, Signature(), next_nargs(), doc, keywords);
59206 }
59207 };
59208 template <>
59209 struct define_class_init_helper<0> {
59210 template <class ClassT, class CallPoliciesT, class Signature, class NArgs>
59211 static void apply(
59212 ClassT& cl
59213 , CallPoliciesT const& policies
59214 , Signature const& args
59215 , NArgs
59216 , char const* doc
59217 , detail::keyword_range const& keywords)
59218 {
59219 detail::def_init_aux(cl, args, NArgs(), policies, doc, keywords);
59220 }
59221 };
59222 }
59223 }}
59224 namespace boost { namespace python { namespace converter {
59225 template <class T>
59226 struct shared_ptr_from_python
59227 {
59228 shared_ptr_from_python()
59229 {
59230 converter::registry::insert(&convertible, &construct, type_id<shared_ptr<T> >()
59231 , &converter::expected_from_python_type_direct<T>::get_pytype
59232 );
59233 }
59234 private:
59235 static void* convertible(PyObject* p)
59236 {
59237 if (p == (&_Py_NoneStruct))
59238 return p;
59239 return converter::get_lvalue_from_python(p, registered<T>::converters);
59240 }
59241 static void construct(PyObject* source, rvalue_from_python_stage1_data* data)
59242 {
59243 void* const storage = ((converter::rvalue_from_python_storage<shared_ptr<T> >*)data)->storage.bytes;
59244 if (data->convertible == source)
59245 new (storage) shared_ptr<T>();
59246 else
59247 {
59248 boost::shared_ptr<void> hold_convertible_ref_count(
59249 (void*)0, shared_ptr_deleter(handle<>(borrowed(source))) );
59250 new (storage) shared_ptr<T>(
59251 hold_convertible_ref_count,
59252 static_cast<T*>(data->convertible));
59253 }
59254 data->convertible = storage;
59255 }
59256 };
59257 }}}
59258 namespace boost { namespace python { namespace objects {
59259 typedef type_info class_id;
59260 using python::type_id;
59261 typedef std::pair<void*,class_id> dynamic_id_t;
59262 typedef dynamic_id_t (*dynamic_id_function)(void*);
59263 void register_dynamic_id_aux(
59264 class_id static_id, dynamic_id_function get_dynamic_id);
59265 void add_cast(
59266 class_id src_t, class_id dst_t, void* (*cast)(void*), bool is_downcast);
59267 template <class T>
59268 struct polymorphic_id_generator
59269 {
59270 static dynamic_id_t execute(void* p_)
59271 {
59272 T* p = static_cast<T*>(p_);
59273 return std::make_pair(dynamic_cast<void*>(p), class_id(typeid(*p)));
59274 }
59275 };
59276 template <class T>
59277 struct non_polymorphic_id_generator
59278 {
59279 static dynamic_id_t execute(void* p_)
59280 {
59281 return std::make_pair(p_, python::type_id<T>());
59282 }
59283 };
59284 template <class T>
59285 struct dynamic_id_generator
59286 : mpl::if_<
59287 boost::is_polymorphic<T>
59288 , boost::python::objects::polymorphic_id_generator<T>
59289 , boost::python::objects::non_polymorphic_id_generator<T>
59290 >
59291 {};
59292 template <class T>
59293 void register_dynamic_id(T* = 0)
59294 {
59295 typedef typename dynamic_id_generator<T>::type generator;
59296 register_dynamic_id_aux(
59297 python::type_id<T>(), &generator::execute);
59298 }
59299 template <class Source, class Target>
59300 struct dynamic_cast_generator
59301 {
59302 static void* execute(void* source)
59303 {
59304 return dynamic_cast<Target*>(
59305 static_cast<Source*>(source));
59306 }
59307 };
59308 template <class Source, class Target>
59309 struct implicit_cast_generator
59310 {
59311 static void* execute(void* source)
59312 {
59313 Target* result = static_cast<Source*>(source);
59314 return result;
59315 }
59316 };
59317 template <class Source, class Target>
59318 struct cast_generator
59319 : mpl::if_<
59320 is_base_and_derived<Target,Source>
59321 , implicit_cast_generator<Source,Target>
59322 , dynamic_cast_generator<Source,Target>
59323 >
59324 {
59325 };
59326 template <class Source, class Target>
59327 inline void register_conversion(
59328 bool is_downcast = ::boost::is_base_and_derived<Source,Target>::value
59329 , Source* = 0, Target* = 0)
59330 {
59331 typedef typename cast_generator<Source,Target>::type generator;
59332 add_cast(
59333 python::type_id<Source>()
59334 , python::type_id<Target>()
59335 , &generator::execute
59336 , is_downcast
59337 );
59338 }
59339 }}}
59340 namespace boost { namespace python { namespace converter {
59341 template <class T, class ToPython>
59342 struct as_to_python_function
59343 {
59344 template <class U>
59345 static void convert_function_must_take_value_or_const_reference(U(*)(T), int, T* = 0) {}
59346 template <class U>
59347 static void convert_function_must_take_value_or_const_reference(U(*)(T const&), long ...) {}
59348 static PyObject* convert(void const* x)
59349 {
59350 convert_function_must_take_value_or_const_reference(&ToPython::convert, 1L);
59351 return ToPython::convert(*const_cast<T*>(static_cast<T const*>(x)));
59352 }
59353 static PyTypeObject const * get_pytype() { return ToPython::get_pytype(); }
59354 };
59355 }}}
59356 namespace boost { namespace python {
59357 template < class T, class Conversion, bool has_get_pytype=false >
59358 struct to_python_converter
59359 {
59360 typedef boost::mpl::bool_<has_get_pytype> HasGetPytype;
59361 static PyTypeObject const* get_pytype_1(boost::mpl::true_ *)
59362 {
59363 return Conversion::get_pytype();
59364 }
59365 static PyTypeObject const* get_pytype_1(boost::mpl::false_ *)
59366 {
59367 return 0;
59368 }
59369 static PyTypeObject const* get_pytype_impl()
59370 {
59371 return get_pytype_1((HasGetPytype*)0);
59372 }
59373 to_python_converter();
59374 };
59375 template <class T, class Conversion ,bool has_get_pytype>
59376 to_python_converter<T,Conversion, has_get_pytype>::to_python_converter()
59377 {
59378 typedef converter::as_to_python_function<
59379 T, Conversion
59380 > normalized;
59381 converter::registry::insert(
59382 &normalized::convert
59383 , type_id<T>()
59384 , &get_pytype_impl
59385 );
59386 }
59387 }}
59388 namespace boost { namespace python { namespace objects {
59389 template <class Src, class MakeInstance>
59390 struct class_cref_wrapper
59391 : to_python_converter<Src,class_cref_wrapper<Src,MakeInstance> ,true>
59392 {
59393 static PyObject* convert(Src const& x)
59394 {
59395 return MakeInstance::execute(boost::ref(x));
59396 }
59397 static PyTypeObject const *get_pytype() { return converter::registered_pytype_direct<Src>::get_pytype(); }
59398 };
59399 template <class Src, class MakeInstance>
59400 struct class_value_wrapper
59401 : to_python_converter<Src,class_value_wrapper<Src,MakeInstance> ,true>
59402 {
59403 static PyObject* convert(Src x)
59404 {
59405 return MakeInstance::execute(x);
59406 }
59407 static PyTypeObject const *get_pytype() { return MakeInstance::get_pytype(); }
59408 };
59409 }}}
59410 namespace boost { namespace python { namespace objects {
59411 struct no_back_reference;
59412 template <class CallbackType = no_back_reference> struct value_holder_generator;
59413 }}}
59414 namespace boost { namespace python {
59415 namespace api
59416 {
59417 class object;
59418 }
59419 namespace converter
59420 {
59421 template <class Ptr>
59422 struct extract_pointer
59423 {
59424 typedef Ptr result_type;
59425 extract_pointer(PyObject*);
59426 bool check() const;
59427 Ptr operator()() const;
59428 private:
59429 PyObject* m_source;
59430 void* m_result;
59431 };
59432 template <class Ref>
59433 struct extract_reference
59434 {
59435 typedef Ref result_type;
59436 extract_reference(PyObject*);
59437 bool check() const;
59438 Ref operator()() const;
59439 private:
59440 PyObject* m_source;
59441 void* m_result;
59442 };
59443 template <class T>
59444 struct extract_rvalue : private noncopyable
59445 {
59446 typedef typename mpl::if_<
59447 python::detail::copy_ctor_mutates_rhs<T>
59448 , T&
59449 , typename call_traits<T>::param_type
59450 >::type result_type;
59451 extract_rvalue(PyObject*);
59452 bool check() const;
59453 result_type operator()() const;
59454 private:
59455 PyObject* m_source;
59456 mutable rvalue_from_python_data<T> m_data;
59457 };
59458 template <class T>
59459 struct extract_object_manager
59460 {
59461 typedef T result_type;
59462 extract_object_manager(PyObject*);
59463 bool check() const;
59464 result_type operator()() const;
59465 private:
59466 PyObject* m_source;
59467 };
59468 template <class T>
59469 struct select_extract
59470 {
59471 static const bool obj_mgr = is_object_manager<T>::value
59472 ;
59473 static const bool ptr = is_pointer<T>::value
59474 ;
59475 static const bool ref = is_reference<T>::value
59476 ;
59477 typedef typename mpl::if_c<
59478 obj_mgr
59479 , extract_object_manager<T>
59480 , typename mpl::if_c<
59481 ptr
59482 , extract_pointer<T>
59483 , typename mpl::if_c<
59484 ref
59485 , extract_reference<T>
59486 , extract_rvalue<T>
59487 >::type
59488 >::type
59489 >::type type;
59490 };
59491 }
59492 template <class T>
59493 struct extract
59494 : converter::select_extract<T>::type
59495 {
59496 private:
59497 typedef typename converter::select_extract<T>::type base;
59498 public:
59499 typedef typename base::result_type result_type;
59500 operator result_type() const
59501 {
59502 return (*this)();
59503 }
59504 extract(PyObject*);
59505 extract(api::object const&);
59506 };
59507 template <class T>
59508 inline extract<T>::extract(PyObject* o)
59509 : base(o)
59510 {
59511 }
59512 template <class T>
59513 inline extract<T>::extract(api::object const& o)
59514 : base(o.ptr())
59515 {
59516 }
59517 namespace converter
59518 {
59519 template <class T>
59520 inline extract_rvalue<T>::extract_rvalue(PyObject* x)
59521 : m_source(x)
59522 , m_data(
59523 (rvalue_from_python_stage1)(x, registered<T>::converters)
59524 )
59525 {
59526 }
59527 template <class T>
59528 inline bool
59529 extract_rvalue<T>::check() const
59530 {
59531 return m_data.stage1.convertible;
59532 }
59533 template <class T>
59534 inline typename extract_rvalue<T>::result_type
59535 extract_rvalue<T>::operator()() const
59536 {
59537 return *(T*)(
59538 m_data.stage1.convertible == m_data.storage.bytes
59539 ? m_data.storage.bytes
59540 : (rvalue_from_python_stage2)(m_source, m_data.stage1, registered<T>::converters)
59541 );
59542 }
59543 template <class Ref>
59544 inline extract_reference<Ref>::extract_reference(PyObject* obj)
59545 : m_source(obj)
59546 , m_result(
59547 (get_lvalue_from_python)(obj, registered<Ref>::converters)
59548 )
59549 {
59550 }
59551 template <class Ref>
59552 inline bool extract_reference<Ref>::check() const
59553 {
59554 return m_result != 0;
59555 }
59556 template <class Ref>
59557 inline Ref extract_reference<Ref>::operator()() const
59558 {
59559 if (m_result == 0)
59560 (throw_no_reference_from_python)(m_source, registered<Ref>::converters);
59561 return python::detail::void_ptr_to_reference(m_result, (Ref(*)())0);
59562 }
59563 template <class Ptr>
59564 inline extract_pointer<Ptr>::extract_pointer(PyObject* obj)
59565 : m_source(obj)
59566 , m_result(
59567 obj == (&_Py_NoneStruct) ? 0 : (get_lvalue_from_python)(obj, registered_pointee<Ptr>::converters)
59568 )
59569 {
59570 }
59571 template <class Ptr>
59572 inline bool extract_pointer<Ptr>::check() const
59573 {
59574 return m_source == (&_Py_NoneStruct) || m_result != 0;
59575 }
59576 template <class Ptr>
59577 inline Ptr extract_pointer<Ptr>::operator()() const
59578 {
59579 if (m_result == 0 && m_source != (&_Py_NoneStruct))
59580 (throw_no_pointer_from_python)(m_source, registered_pointee<Ptr>::converters);
59581 return Ptr(m_result);
59582 }
59583 template <class T>
59584 inline extract_object_manager<T>::extract_object_manager(PyObject* obj)
59585 : m_source(obj)
59586 {
59587 }
59588 template <class T>
59589 inline bool extract_object_manager<T>::check() const
59590 {
59591 return object_manager_traits<T>::check(m_source);
59592 }
59593 template <class T>
59594 inline T extract_object_manager<T>::operator()() const
59595 {
59596 return T(
59597 object_manager_traits<T>::adopt(python::incref(m_source))
59598 );
59599 }
59600 }
59601 }}
59602 namespace boost { namespace python {
59603 class override;
59604 namespace detail
59605 {
59606 class wrapper_base;
59607 class method_result
59608 {
59609 private:
59610 friend class boost::python::override;
59611 explicit method_result(PyObject* x)
59612 : m_obj(x)
59613 {}
59614 public:
59615 template <class T>
59616 operator T()
59617 {
59618 converter::return_from_python<T> converter;
59619 return converter(m_obj.release());
59620 }
59621 template <class T>
59622 operator T&() const
59623 {
59624 converter::return_from_python<T&> converter;
59625 return converter(const_cast<handle<>&>(m_obj).release());
59626 }
59627 template <class T>
59628 T as(type<T>* = 0)
59629 {
59630 converter::return_from_python<T> converter;
59631 return converter(m_obj.release());
59632 }
59633 template <class T>
59634 T unchecked(type<T>* = 0)
59635 {
59636 return extract<T>(m_obj)();
59637 }
59638 private:
59639 mutable handle<> m_obj;
59640 };
59641 }
59642 class override : public object
59643 {
59644 private:
59645 friend class detail::wrapper_base;
59646 override(handle<> x)
59647 : object(x)
59648 {}
59649 public:
59650 detail::method_result
59651 operator()() const
59652 {
59653 detail::method_result x(
59654 PyEval_CallFunction(
59655 this->ptr()
59656 , const_cast<char*>("()")
59657 ));
59658 return x;
59659 }
59660 template <
59661 class A0
59662 >
59663 detail::method_result
59664 operator()( A0 const& a0 ) const
59665 {
59666 detail::method_result x(
59667 PyEval_CallFunction(
59668 this->ptr()
59669 , const_cast<char*>("(" "O" ")")
59670 , converter::arg_to_python<A0>(a0).get()
59671 ));
59672 return x;
59673 }
59674 template <
59675 class A0 , class A1
59676 >
59677 detail::method_result
59678 operator()( A0 const& a0 , A1 const& a1 ) const
59679 {
59680 detail::method_result x(
59681 PyEval_CallFunction(
59682 this->ptr()
59683 , const_cast<char*>("(" "O" "O" ")")
59684 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get()
59685 ));
59686 return x;
59687 }
59688 template <
59689 class A0 , class A1 , class A2
59690 >
59691 detail::method_result
59692 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 ) const
59693 {
59694 detail::method_result x(
59695 PyEval_CallFunction(
59696 this->ptr()
59697 , const_cast<char*>("(" "O" "O" "O" ")")
59698 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get()
59699 ));
59700 return x;
59701 }
59702 template <
59703 class A0 , class A1 , class A2 , class A3
59704 >
59705 detail::method_result
59706 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 ) const
59707 {
59708 detail::method_result x(
59709 PyEval_CallFunction(
59710 this->ptr()
59711 , const_cast<char*>("(" "O" "O" "O" "O" ")")
59712 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get()
59713 ));
59714 return x;
59715 }
59716 template <
59717 class A0 , class A1 , class A2 , class A3 , class A4
59718 >
59719 detail::method_result
59720 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 ) const
59721 {
59722 detail::method_result x(
59723 PyEval_CallFunction(
59724 this->ptr()
59725 , const_cast<char*>("(" "O" "O" "O" "O" "O" ")")
59726 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get()
59727 ));
59728 return x;
59729 }
59730 template <
59731 class A0 , class A1 , class A2 , class A3 , class A4 , class A5
59732 >
59733 detail::method_result
59734 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 ) const
59735 {
59736 detail::method_result x(
59737 PyEval_CallFunction(
59738 this->ptr()
59739 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" ")")
59740 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get()
59741 ));
59742 return x;
59743 }
59744 template <
59745 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6
59746 >
59747 detail::method_result
59748 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 ) const
59749 {
59750 detail::method_result x(
59751 PyEval_CallFunction(
59752 this->ptr()
59753 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" ")")
59754 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get()
59755 ));
59756 return x;
59757 }
59758 template <
59759 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7
59760 >
59761 detail::method_result
59762 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 ) const
59763 {
59764 detail::method_result x(
59765 PyEval_CallFunction(
59766 this->ptr()
59767 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59768 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get()
59769 ));
59770 return x;
59771 }
59772 template <
59773 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8
59774 >
59775 detail::method_result
59776 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 ) const
59777 {
59778 detail::method_result x(
59779 PyEval_CallFunction(
59780 this->ptr()
59781 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59782 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get()
59783 ));
59784 return x;
59785 }
59786 template <
59787 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9
59788 >
59789 detail::method_result
59790 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 ) const
59791 {
59792 detail::method_result x(
59793 PyEval_CallFunction(
59794 this->ptr()
59795 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59796 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get()
59797 ));
59798 return x;
59799 }
59800 template <
59801 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10
59802 >
59803 detail::method_result
59804 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 ) const
59805 {
59806 detail::method_result x(
59807 PyEval_CallFunction(
59808 this->ptr()
59809 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59810 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get()
59811 ));
59812 return x;
59813 }
59814 template <
59815 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11
59816 >
59817 detail::method_result
59818 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 ) const
59819 {
59820 detail::method_result x(
59821 PyEval_CallFunction(
59822 this->ptr()
59823 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59824 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get()
59825 ));
59826 return x;
59827 }
59828 template <
59829 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12
59830 >
59831 detail::method_result
59832 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 ) const
59833 {
59834 detail::method_result x(
59835 PyEval_CallFunction(
59836 this->ptr()
59837 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59838 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get()
59839 ));
59840 return x;
59841 }
59842 template <
59843 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13
59844 >
59845 detail::method_result
59846 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 ) const
59847 {
59848 detail::method_result x(
59849 PyEval_CallFunction(
59850 this->ptr()
59851 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59852 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get() , converter::arg_to_python<A13>(a13).get()
59853 ));
59854 return x;
59855 }
59856 template <
59857 class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14
59858 >
59859 detail::method_result
59860 operator()( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14 ) const
59861 {
59862 detail::method_result x(
59863 PyEval_CallFunction(
59864 this->ptr()
59865 , const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
59866 , converter::arg_to_python<A0>(a0).get() , converter::arg_to_python<A1>(a1).get() , converter::arg_to_python<A2>(a2).get() , converter::arg_to_python<A3>(a3).get() , converter::arg_to_python<A4>(a4).get() , converter::arg_to_python<A5>(a5).get() , converter::arg_to_python<A6>(a6).get() , converter::arg_to_python<A7>(a7).get() , converter::arg_to_python<A8>(a8).get() , converter::arg_to_python<A9>(a9).get() , converter::arg_to_python<A10>(a10).get() , converter::arg_to_python<A11>(a11).get() , converter::arg_to_python<A12>(a12).get() , converter::arg_to_python<A13>(a13).get() , converter::arg_to_python<A14>(a14).get()
59867 ));
59868 return x;
59869 }
59870 };
59871 }}
59872 namespace boost { namespace python {
59873 template <class T>
59874 class wrapper : public detail::wrapper_base
59875 {
59876 public:
59877 typedef T _wrapper_wrapped_type_;
59878 protected:
59879 override get_override(char const* name) const
59880 {
59881 typedef detail::wrapper_base base;
59882 converter::registration const& r
59883 = converter::registered<T>::converters;
59884 PyTypeObject* type = r.get_class_object();
59885 return this->base::get_override(name, type);
59886 }
59887 };
59888 }}
59889 namespace boost { namespace python { namespace objects {
59890 template <class Value>
59891 struct value_holder : instance_holder
59892 {
59893 typedef Value held_type;
59894 typedef Value value_type;
59895 value_holder(
59896 PyObject* self )
59897 : m_held(
59898
59899 )
59900 {
59901 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59902 }
59903 template < class A0>
59904 value_holder(
59905 PyObject* self , A0 a0)
59906 : m_held(
59907 objects::do_unforward(a0,0)
59908 )
59909 {
59910 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59911 }
59912 template < class A0 , class A1>
59913 value_holder(
59914 PyObject* self , A0 a0 , A1 a1)
59915 : m_held(
59916 objects::do_unforward(a0,0) , objects::do_unforward(a1,0)
59917 )
59918 {
59919 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59920 }
59921 template < class A0 , class A1 , class A2>
59922 value_holder(
59923 PyObject* self , A0 a0 , A1 a1 , A2 a2)
59924 : m_held(
59925 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0)
59926 )
59927 {
59928 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59929 }
59930 template < class A0 , class A1 , class A2 , class A3>
59931 value_holder(
59932 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3)
59933 : m_held(
59934 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0)
59935 )
59936 {
59937 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59938 }
59939 template < class A0 , class A1 , class A2 , class A3 , class A4>
59940 value_holder(
59941 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4)
59942 : m_held(
59943 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0)
59944 )
59945 {
59946 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59947 }
59948 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
59949 value_holder(
59950 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5)
59951 : m_held(
59952 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0)
59953 )
59954 {
59955 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59956 }
59957 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
59958 value_holder(
59959 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6)
59960 : m_held(
59961 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0)
59962 )
59963 {
59964 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59965 }
59966 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
59967 value_holder(
59968 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7)
59969 : m_held(
59970 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0)
59971 )
59972 {
59973 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59974 }
59975 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
59976 value_holder(
59977 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8)
59978 : m_held(
59979 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0)
59980 )
59981 {
59982 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59983 }
59984 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
59985 value_holder(
59986 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9)
59987 : m_held(
59988 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0)
59989 )
59990 {
59991 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
59992 }
59993 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
59994 value_holder(
59995 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10)
59996 : m_held(
59997 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0)
59998 )
59999 {
60000 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
60001 }
60002 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
60003 value_holder(
60004 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11)
60005 : m_held(
60006 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0)
60007 )
60008 {
60009 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
60010 }
60011 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
60012 value_holder(
60013 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12)
60014 : m_held(
60015 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0)
60016 )
60017 {
60018 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
60019 }
60020 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
60021 value_holder(
60022 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13)
60023 : m_held(
60024 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0)
60025 )
60026 {
60027 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
60028 }
60029 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
60030 value_holder(
60031 PyObject* self , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13 , A14 a14)
60032 : m_held(
60033 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0) , objects::do_unforward(a14,0)
60034 )
60035 {
60036 python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
60037 }
60038 private:
60039 void* holds(type_info, bool null_ptr_only);
60040 template <class T>
60041 inline void* holds_wrapped(type_info dst_t, wrapper<T>*,T* p)
60042 {
60043 return python::type_id<T>() == dst_t ? p : 0;
60044 }
60045 inline void* holds_wrapped(type_info, ...)
60046 {
60047 return 0;
60048 }
60049 private:
60050 Value m_held;
60051 };
60052 template <class Value, class Held>
60053 struct value_holder_back_reference : instance_holder
60054 {
60055 typedef Held held_type;
60056 typedef Value value_type;
60057 value_holder_back_reference(
60058 PyObject* p )
60059 : m_held(
60060 p
60061
60062 )
60063 {
60064 }
60065 template < class A0>
60066 value_holder_back_reference(
60067 PyObject* p , A0 a0)
60068 : m_held(
60069 p ,
60070 objects::do_unforward(a0,0)
60071 )
60072 {
60073 }
60074 template < class A0 , class A1>
60075 value_holder_back_reference(
60076 PyObject* p , A0 a0 , A1 a1)
60077 : m_held(
60078 p ,
60079 objects::do_unforward(a0,0) , objects::do_unforward(a1,0)
60080 )
60081 {
60082 }
60083 template < class A0 , class A1 , class A2>
60084 value_holder_back_reference(
60085 PyObject* p , A0 a0 , A1 a1 , A2 a2)
60086 : m_held(
60087 p ,
60088 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0)
60089 )
60090 {
60091 }
60092 template < class A0 , class A1 , class A2 , class A3>
60093 value_holder_back_reference(
60094 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3)
60095 : m_held(
60096 p ,
60097 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0)
60098 )
60099 {
60100 }
60101 template < class A0 , class A1 , class A2 , class A3 , class A4>
60102 value_holder_back_reference(
60103 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4)
60104 : m_held(
60105 p ,
60106 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0)
60107 )
60108 {
60109 }
60110 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
60111 value_holder_back_reference(
60112 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5)
60113 : m_held(
60114 p ,
60115 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0)
60116 )
60117 {
60118 }
60119 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
60120 value_holder_back_reference(
60121 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6)
60122 : m_held(
60123 p ,
60124 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0)
60125 )
60126 {
60127 }
60128 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
60129 value_holder_back_reference(
60130 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7)
60131 : m_held(
60132 p ,
60133 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0)
60134 )
60135 {
60136 }
60137 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
60138 value_holder_back_reference(
60139 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8)
60140 : m_held(
60141 p ,
60142 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0)
60143 )
60144 {
60145 }
60146 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
60147 value_holder_back_reference(
60148 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9)
60149 : m_held(
60150 p ,
60151 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0)
60152 )
60153 {
60154 }
60155 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
60156 value_holder_back_reference(
60157 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10)
60158 : m_held(
60159 p ,
60160 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0)
60161 )
60162 {
60163 }
60164 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
60165 value_holder_back_reference(
60166 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11)
60167 : m_held(
60168 p ,
60169 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0)
60170 )
60171 {
60172 }
60173 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
60174 value_holder_back_reference(
60175 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12)
60176 : m_held(
60177 p ,
60178 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0)
60179 )
60180 {
60181 }
60182 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
60183 value_holder_back_reference(
60184 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13)
60185 : m_held(
60186 p ,
60187 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0)
60188 )
60189 {
60190 }
60191 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
60192 value_holder_back_reference(
60193 PyObject* p , A0 a0 , A1 a1 , A2 a2 , A3 a3 , A4 a4 , A5 a5 , A6 a6 , A7 a7 , A8 a8 , A9 a9 , A10 a10 , A11 a11 , A12 a12 , A13 a13 , A14 a14)
60194 : m_held(
60195 p ,
60196 objects::do_unforward(a0,0) , objects::do_unforward(a1,0) , objects::do_unforward(a2,0) , objects::do_unforward(a3,0) , objects::do_unforward(a4,0) , objects::do_unforward(a5,0) , objects::do_unforward(a6,0) , objects::do_unforward(a7,0) , objects::do_unforward(a8,0) , objects::do_unforward(a9,0) , objects::do_unforward(a10,0) , objects::do_unforward(a11,0) , objects::do_unforward(a12,0) , objects::do_unforward(a13,0) , objects::do_unforward(a14,0)
60197 )
60198 {
60199 }
60200 private:
60201 void* holds(type_info, bool null_ptr_only);
60202 private:
60203 Held m_held;
60204 };
60205 template <class Value>
60206 void* value_holder<Value>::holds(type_info dst_t, bool )
60207 {
60208 if (void* wrapped = holds_wrapped(dst_t, boost::addressof(m_held), boost::addressof(m_held)))
60209 return wrapped;
60210 type_info src_t = python::type_id<Value>();
60211 return src_t == dst_t ? boost::addressof(m_held)
60212 : find_static_type(boost::addressof(m_held), src_t, dst_t);
60213 }
60214 template <class Value, class Held>
60215 void* value_holder_back_reference<Value,Held>::holds(
60216 type_info dst_t, bool )
60217 {
60218 type_info src_t = python::type_id<Value>();
60219 Value* x = &m_held;
60220 if (dst_t == src_t)
60221 return x;
60222 else if (dst_t == python::type_id<Held>())
60223 return &m_held;
60224 else
60225 return find_static_type(x, src_t, dst_t);
60226 }
60227 }}}
60228 namespace boost { namespace python {
60229 template <class T>
60230 struct has_back_reference
60231 : mpl::false_
60232 {
60233 };
60234 }}
60235 namespace boost { namespace mpl {
60236 template<
60237 typename T = na
60238 >
60239 struct is_sequence
60240 : not_< is_same< typename begin<T>::type, void_ > >
60241 {
60242
60243 };
60244 template<> struct is_sequence< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : is_sequence< T1 > { }; }; template< typename Tag > struct lambda< is_sequence< na > , Tag , int_<-1> > { typedef false_ is_le; typedef is_sequence< na > result_; typedef is_sequence< na > type; }; namespace aux { template< typename T1 > struct template_arity< is_sequence< T1 > > : int_<1> { }; template<> struct template_arity< is_sequence< na > > : int_<-1> { }; }
60245 }}
60246 namespace boost { namespace mpl { namespace aux {
60247 template< typename F >
60248 inline
60249 F& unwrap(F& f, long)
60250 {
60251 return f;
60252 }
60253 template< typename F >
60254 inline
60255 F&
60256 unwrap(reference_wrapper<F>& f, int)
60257 {
60258 return f;
60259 }
60260 template< typename F >
60261 inline
60262 F&
60263 unwrap(reference_wrapper<F> const& f, int)
60264 {
60265 return f;
60266 }
60267 }}}
60268
60269 namespace boost {
60270 namespace detail { namespace aligned_storage {
60271 static const std::size_t alignment_of_max_align = ::boost::alignment_of<max_align>::value
60272 ;
60273 template <
60274 std::size_t size_
60275 , std::size_t alignment_
60276 >
60277 struct aligned_storage_imp
60278 {
60279 union data_t
60280 {
60281 char buf[size_];
60282 typename mpl::eval_if_c<
60283 alignment_ == std::size_t(-1)
60284 , mpl::identity<detail::max_align>
60285 , type_with_alignment<alignment_>
60286 >::type align_;
60287 } data_;
60288 void* address() const { return const_cast<aligned_storage_imp*>(this); }
60289 };
60290 template< std::size_t alignment_ >
60291 struct aligned_storage_imp<0u,alignment_>
60292 {
60293 void* address() const { return 0; }
60294 };
60295 }}
60296 template <
60297 std::size_t size_
60298 , std::size_t alignment_ = std::size_t(-1)
60299 >
60300 class aligned_storage :
60301 private
60302 detail::aligned_storage::aligned_storage_imp<size_, alignment_>
60303 {
60304 public:
60305 typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
60306 static const std::size_t size = size_
60307 ;
60308 static const std::size_t alignment = ( alignment_ == std::size_t(-1) ? ::boost::detail::aligned_storage::alignment_of_max_align : alignment_ )
60309 ;
60310 private:
60311 aligned_storage(const aligned_storage&);
60312 aligned_storage& operator=(const aligned_storage&);
60313 public:
60314 aligned_storage()
60315 {
60316 }
60317 ~aligned_storage()
60318 {
60319 }
60320 public:
60321 void* address()
60322 {
60323 return static_cast<type*>(this)->address();
60324 }
60325 const void* address() const
60326 {
60327 return static_cast<const type*>(this)->address();
60328 }
60329 };
60330 template <std::size_t size_, std::size_t alignment_>
60331 struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
60332 : ::boost::integral_constant<bool,true>
60333 {
60334
60335 };
60336 }
60337
60338 namespace boost_swap_impl
60339 {
60340 template<class T>
60341 void swap_impl(T& left, T& right)
60342 {
60343 using namespace std;
60344 swap(left,right);
60345 }
60346 template<class T, std::size_t N>
60347 void swap_impl(T (& left)[N], T (& right)[N])
60348 {
60349 for (std::size_t i = 0; i < N; ++i)
60350 {
60351 ::boost_swap_impl::swap_impl(left[i], right[i]);
60352 }
60353 }
60354 }
60355 namespace boost
60356 {
60357 template<class T1, class T2>
60358 void swap(T1& left, T2& right)
60359 {
60360 ::boost_swap_impl::swap_impl(left, right);
60361 }
60362 }
60363
60364
60365 namespace boost {
60366 template<class T>
60367 class value_initialized
60368 {
60369 private :
60370 struct wrapper
60371 {
60372 typename
60373 remove_const<T>::type data;
60374 };
60375 mutable
60376 typename
60377 aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value>::type x;
60378 wrapper * wrapper_address() const
60379 {
60380 return static_cast<wrapper *>( static_cast<void*>(&x));
60381 }
60382 public :
60383 value_initialized()
60384 {
60385 std::memset(&x, 0, sizeof(x));
60386 new (wrapper_address()) wrapper();
60387 }
60388 value_initialized(value_initialized const & arg)
60389 {
60390 new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address())));
60391 }
60392 value_initialized & operator=(value_initialized const & arg)
60393 {
60394 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((! is_const<T>::value) == 0 ? false : true) >)> boost_static_assert_typedef_84;
60395 *wrapper_address() = static_cast<wrapper const &>(*(arg.wrapper_address()));
60396 return *this;
60397 }
60398 ~value_initialized()
60399 {
60400 wrapper_address()->wrapper::~wrapper();
60401 }
60402 T const & data() const
60403 {
60404 return wrapper_address()->data;
60405 }
60406 T& data()
60407 {
60408 return wrapper_address()->data;
60409 }
60410 void swap(value_initialized & arg)
60411 {
60412 ::boost::swap( this->data(), arg.data() );
60413 }
60414 operator T const &() const { return this->data(); }
60415 operator T&() { return this->data(); }
60416 } ;
60417 template<class T>
60418 T const& get ( value_initialized<T> const& x )
60419 {
60420 return x.data() ;
60421 }
60422 template<class T>
60423 T& get ( value_initialized<T>& x )
60424 {
60425 return x.data() ;
60426 }
60427 template<class T>
60428 void swap ( value_initialized<T> & lhs, value_initialized<T> & rhs )
60429 {
60430 lhs.swap(rhs) ;
60431 }
60432 class initialized_value_t
60433 {
60434 public :
60435 template <class T> operator T() const
60436 {
60437 return get( value_initialized<T>() );
60438 }
60439 };
60440 initialized_value_t const initialized_value = {} ;
60441 }
60442 namespace boost { namespace mpl {
60443 namespace aux {
60444 template< bool done = true >
60445 struct for_each_impl
60446 {
60447 template<
60448 typename Iterator
60449 , typename LastIterator
60450 , typename TransformFunc
60451 , typename F
60452 >
60453 static void execute(
60454 Iterator*
60455 , LastIterator*
60456 , TransformFunc*
60457 , F
60458 )
60459 {
60460 }
60461 };
60462 template<>
60463 struct for_each_impl<false>
60464 {
60465 template<
60466 typename Iterator
60467 , typename LastIterator
60468 , typename TransformFunc
60469 , typename F
60470 >
60471 static void execute(
60472 Iterator*
60473 , LastIterator*
60474 , TransformFunc*
60475 , F f
60476 )
60477 {
60478 typedef typename deref<Iterator>::type item;
60479 typedef typename apply1<TransformFunc,item>::type arg;
60480 value_initialized<arg> x;
60481 aux::unwrap(f, 0)(boost::get(x));
60482 typedef typename mpl::next<Iterator>::type iter;
60483 for_each_impl<boost::is_same<iter,LastIterator>::value>
60484 ::execute( static_cast<iter*>(0), static_cast<LastIterator*>(0), static_cast<TransformFunc*>(0), f);
60485 }
60486 };
60487 }
60488 template<
60489 typename Sequence
60490 , typename TransformOp
60491 , typename F
60492 >
60493 inline
60494 void for_each(F f, Sequence* = 0, TransformOp* = 0)
60495 {
60496 enum { mpl_assertion_in_line_95 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_arg( (void (*) ( is_sequence<Sequence> ))0, 1 ) ) ) };
60497 typedef typename begin<Sequence>::type first;
60498 typedef typename end<Sequence>::type last;
60499 aux::for_each_impl< boost::is_same<first,last>::value >
60500 ::execute(static_cast<first*>(0), static_cast<last*>(0), static_cast<TransformOp*>(0), f);
60501 }
60502 template<
60503 typename Sequence
60504 , typename F
60505 >
60506 inline
60507 void for_each(F f, Sequence* = 0)
60508 {
60509 for_each<Sequence, identity<> >(f);
60510 }
60511 }}
60512 namespace boost { namespace mpl {
60513 namespace aux {
60514 template< typename T, int is_last_ >
60515 struct sel_iter;
60516 template< typename T >
60517 struct sel_iter<T,0>
60518 {
60519 typedef random_access_iterator_tag category;
60520 typedef sel_iter<T,1> next;
60521 typedef T type;
60522 };
60523 template< typename T >
60524 struct sel_iter<T,1>
60525 {
60526 typedef random_access_iterator_tag category;
60527 typedef sel_iter<T,0> prior;
60528 };
60529 }
60530 template< typename T, int is_last_, typename Distance >
60531 struct advance< aux::sel_iter<T,is_last_>,Distance>
60532 {
60533 typedef aux::sel_iter<
60534 T
60535 , ( is_last_ + Distance::value )
60536 > type;
60537 };
60538 template<
60539 typename T
60540 , int l1
60541 , int l2
60542 >
60543 struct distance< aux::sel_iter<T,l1>, aux::sel_iter<T,l2> >
60544 : int_<( l2 - l1 )>
60545 {
60546 };
60547 }}
60548 namespace boost { namespace mpl {
60549 template<
60550 typename T = na
60551 >
60552 struct single_view
60553 : iterator_range<
60554 aux::sel_iter<T,0>
60555 , aux::sel_iter<T,1>
60556 >
60557 {
60558 };
60559 template<> struct single_view< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : single_view< T1 > { }; }; template< typename Tag > struct lambda< single_view< na > , Tag , int_<-1> > { typedef false_ is_le; typedef single_view< na > result_; typedef single_view< na > type; }; namespace aux { template< typename T1 > struct template_arity< single_view< T1 > > : int_<1> { }; template<> struct template_arity< single_view< na > > : int_<-1> { }; }
60560 }}
60561 namespace boost { namespace python { namespace objects {
60562 void copy_class_object(type_info const& src, type_info const& dst);
60563 template <class Derived>
60564 struct register_base_of
60565 {
60566 template <class Base>
60567 inline void operator()(Base*) const
60568 {
60569 enum { mpl_assertion_in_line_57 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (is_same<Base,Derived>))0, 1 ) ) ) };
60570 register_dynamic_id<Base>();
60571 register_conversion<Derived,Base>(false);
60572 this->register_downcast((Base*)0, is_polymorphic<Base>());
60573 }
60574 private:
60575 static inline void register_downcast(void*, mpl::false_) {}
60576 template <class Base>
60577 static inline void register_downcast(Base*, mpl::true_)
60578 {
60579 register_conversion<Base, Derived>(true);
60580 }
60581 };
60582 template <class T, class Bases>
60583 inline void register_shared_ptr_from_python_and_casts(T*, Bases)
60584 {
60585 python::detail::force_instantiate(converter::shared_ptr_from_python<T>());
60586 register_dynamic_id<T>();
60587 mpl::for_each(register_base_of<T>(), (Bases*)0, (add_pointer<mpl::_>*)0);
60588 }
60589 template <class T, class Prev>
60590 struct select_held_type
60591 : mpl::if_<
60592 mpl::or_<
60593 python::detail::specifies_bases<T>
60594 , is_same<T,noncopyable>
60595 >
60596 , Prev
60597 , T
60598 >
60599 {
60600 };
60601 template <
60602 class T
60603 , class X1
60604 , class X2
60605 , class X3
60606 >
60607 struct class_metadata
60608 {
60609 typedef typename select_held_type<
60610 X1
60611 , typename select_held_type<
60612 X2
60613 , typename select_held_type<
60614 X3
60615 , python::detail::not_specified
60616 >::type
60617 >::type
60618 >::type held_type_arg;
60619 typedef typename python::detail::select_bases<
60620 X1
60621 , typename python::detail::select_bases<
60622 X2
60623 , typename python::detail::select_bases<
60624 X3
60625 , python::bases<>
60626 >::type
60627 >::type
60628 >::type bases;
60629 typedef mpl::or_<
60630 is_same<X1,noncopyable>
60631 , is_same<X2,noncopyable>
60632 , is_same<X3,noncopyable>
60633 > is_noncopyable;
60634 typedef typename mpl::if_<
60635 is_same<held_type_arg,python::detail::not_specified>, T, held_type_arg
60636 >::type held_type;
60637 typedef is_convertible<held_type*,T*> use_value_holder;
60638 typedef typename mpl::eval_if<
60639 use_value_holder
60640 , mpl::identity<held_type>
60641 , pointee<held_type>
60642 >::type wrapped;
60643 typedef mpl::or_<
60644 has_back_reference<T>
60645 , is_same<held_type_arg,T>
60646 , is_base_and_derived<T,wrapped>
60647 > use_back_reference;
60648 typedef typename mpl::eval_if<
60649 use_back_reference
60650 , mpl::if_<
60651 use_value_holder
60652 , value_holder_back_reference<T, wrapped>
60653 , pointer_holder_back_reference<held_type,T>
60654 >
60655 , mpl::if_<
60656 use_value_holder
60657 , value_holder<T>
60658 , pointer_holder<held_type,wrapped>
60659 >
60660 >::type holder;
60661 inline static void register_()
60662 {
60663 class_metadata::register_aux((T*)0);
60664 }
60665 private:
60666 template <class T2>
60667 inline static void register_aux(python::wrapper<T2>*)
60668 {
60669 typedef typename mpl::not_<is_same<T2,wrapped> >::type use_callback;
60670 class_metadata::register_aux2((T2*)0, use_callback());
60671 }
60672 inline static void register_aux(void*)
60673 {
60674 typedef typename is_base_and_derived<T,wrapped>::type use_callback;
60675 class_metadata::register_aux2((T*)0, use_callback());
60676 }
60677 template <class T2, class Callback>
60678 inline static void register_aux2(T2*, Callback)
60679 {
60680 objects::register_shared_ptr_from_python_and_casts((T2*)0, bases());
60681 class_metadata::maybe_register_callback_class((T2*)0, Callback());
60682 class_metadata::maybe_register_class_to_python((T2*)0, is_noncopyable());
60683 class_metadata::maybe_register_pointer_to_python(
60684 (T2*)0, (use_value_holder*)0, (use_back_reference*)0);
60685 }
60686 inline static void maybe_register_pointer_to_python(...) {}
60687 inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*)
60688 {
60689 objects::copy_class_object(python::type_id<T>(), python::type_id<back_reference<T const &> >());
60690 objects::copy_class_object(python::type_id<T>(), python::type_id<back_reference<T &> >());
60691 }
60692 template <class T2>
60693 inline static void maybe_register_pointer_to_python(T2*, mpl::false_*, mpl::false_*)
60694 {
60695 python::detail::force_instantiate(
60696 objects::class_value_wrapper<
60697 held_type
60698 , make_ptr_instance<T2, pointer_holder<held_type, T2> >
60699 >()
60700 );
60701 objects::copy_class_object(python::type_id<T2>(), python::type_id<held_type>());
60702 }
60703 inline static void maybe_register_class_to_python(void*, mpl::true_) {}
60704 template <class T2>
60705 inline static void maybe_register_class_to_python(T2*, mpl::false_)
60706 {
60707 python::detail::force_instantiate(class_cref_wrapper<T2, make_instance<T2, holder> >());
60708 objects::copy_class_object(python::type_id<T2>(), python::type_id<held_type>());
60709 }
60710 inline static void maybe_register_callback_class(void*, mpl::false_) {}
60711 template <class T2>
60712 inline static void maybe_register_callback_class(T2*, mpl::true_)
60713 {
60714 objects::register_shared_ptr_from_python_and_casts(
60715 (wrapped*)0, mpl::single_view<T2>());
60716 objects::copy_class_object(python::type_id<T2>(), python::type_id<wrapped>());
60717 }
60718 };
60719 }}}
60720 namespace boost { namespace python {
60721 namespace api
60722 {
60723 class object;
60724 }
60725 using api::object;
60726 class tuple;
60727 object const& make_instance_reduce_function();
60728 struct pickle_suite;
60729 namespace error_messages {
60730 template <class T>
60731 struct missing_pickle_suite_function_or_incorrect_signature {};
60732 inline void must_be_derived_from_pickle_suite(pickle_suite const&) {}
60733 }
60734 namespace detail { struct pickle_suite_registration; }
60735 struct pickle_suite
60736 {
60737 private:
60738 struct inaccessible {};
60739 friend struct detail::pickle_suite_registration;
60740 public:
60741 static inaccessible* getinitargs() { return 0; }
60742 static inaccessible* getstate() { return 0; }
60743 static inaccessible* setstate() { return 0; }
60744 static bool getstate_manages_dict() { return false; }
60745 };
60746 namespace detail {
60747 struct pickle_suite_registration
60748 {
60749 typedef pickle_suite::inaccessible inaccessible;
60750 template <class Class_, class Tgetinitargs>
60751 static
60752 void
60753 register_(
60754 Class_& cl,
60755 tuple (*getinitargs_fn)(Tgetinitargs),
60756 inaccessible* (* )(),
60757 inaccessible* (* )(),
60758 bool)
60759 {
60760 cl.enable_pickling_(false);
60761 cl.def("__getinitargs__", getinitargs_fn);
60762 }
60763 template <class Class_,
60764 class Rgetstate, class Tgetstate,
60765 class Tsetstate, class Ttuple>
60766 static
60767 void
60768 register_(
60769 Class_& cl,
60770 inaccessible* (* )(),
60771 Rgetstate (*getstate_fn)(Tgetstate),
60772 void (*setstate_fn)(Tsetstate, Ttuple),
60773 bool getstate_manages_dict)
60774 {
60775 cl.enable_pickling_(getstate_manages_dict);
60776 cl.def("__getstate__", getstate_fn);
60777 cl.def("__setstate__", setstate_fn);
60778 }
60779 template <class Class_,
60780 class Tgetinitargs,
60781 class Rgetstate, class Tgetstate,
60782 class Tsetstate, class Ttuple>
60783 static
60784 void
60785 register_(
60786 Class_& cl,
60787 tuple (*getinitargs_fn)(Tgetinitargs),
60788 Rgetstate (*getstate_fn)(Tgetstate),
60789 void (*setstate_fn)(Tsetstate, Ttuple),
60790 bool getstate_manages_dict)
60791 {
60792 cl.enable_pickling_(getstate_manages_dict);
60793 cl.def("__getinitargs__", getinitargs_fn);
60794 cl.def("__getstate__", getstate_fn);
60795 cl.def("__setstate__", setstate_fn);
60796 }
60797 template <class Class_>
60798 static
60799 void
60800 register_(
60801 Class_&,
60802 ...)
60803 {
60804 typedef typename
60805 error_messages::missing_pickle_suite_function_or_incorrect_signature<
60806 Class_>::error_type error_type;
60807 }
60808 };
60809 template <typename PickleSuiteType>
60810 struct pickle_suite_finalize
60811 : PickleSuiteType,
60812 pickle_suite_registration
60813 {};
60814 }
60815 }}
60816 namespace boost { namespace python { namespace detail {
60817 struct overloads_base;
60818 template <class OverloadsT, class NameSpaceT, class SigT>
60819 inline void define_with_defaults(char const* name, OverloadsT const&, NameSpaceT&, SigT const&);
60820 }}}
60821 namespace boost { namespace python { namespace detail {
60822 enum operator_id
60823 {
60824 op_add,
60825 op_sub,
60826 op_mul,
60827 op_div,
60828 op_mod,
60829 op_divmod,
60830 op_pow,
60831 op_lshift,
60832 op_rshift,
60833 op_and,
60834 op_xor,
60835 op_or,
60836 op_neg,
60837 op_pos,
60838 op_abs,
60839 op_invert,
60840 op_int,
60841 op_long,
60842 op_float,
60843 op_str,
60844 op_cmp,
60845 op_gt,
60846 op_ge,
60847 op_lt,
60848 op_le,
60849 op_eq,
60850 op_ne,
60851 op_iadd,
60852 op_isub,
60853 op_imul,
60854 op_idiv,
60855 op_imod,
60856 op_ilshift,
60857 op_irshift,
60858 op_iand,
60859 op_ixor,
60860 op_ior,
60861 op_complex,
60862 op_nonzero,
60863 op_repr
60864 };
60865 }}}
60866 namespace boost {
60867 namespace tuples {
60868 struct null_type {};
60869 namespace detail {
60870 inline const null_type cnull() { return null_type(); }
60871 template <bool If, class Then, class Else> struct IF { typedef Then RET; };
60872 template <class Then, class Else> struct IF<false, Then, Else> {
60873 typedef Else RET;
60874 };
60875 }
60876 template <class HT, class TT> struct cons;
60877 template <
60878 class T0 = null_type, class T1 = null_type, class T2 = null_type,
60879 class T3 = null_type, class T4 = null_type, class T5 = null_type,
60880 class T6 = null_type, class T7 = null_type, class T8 = null_type,
60881 class T9 = null_type>
60882 class tuple;
60883 template<class T> struct length;
60884 namespace detail {
60885 template<class T>
60886 class generate_error;
60887 template< int N >
60888 struct get_class {
60889 template<class RET, class HT, class TT >
60890 inline static RET get(const cons<HT, TT>& t)
60891 {
60892 return get_class<N-1>::template get<RET>(t.tail);
60893 }
60894 template<class RET, class HT, class TT >
60895 inline static RET get(cons<HT, TT>& t)
60896 {
60897 return get_class<N-1>::template get<RET>(t.tail);
60898 }
60899 };
60900 template<>
60901 struct get_class<0> {
60902 template<class RET, class HT, class TT>
60903 inline static RET get(const cons<HT, TT>& t)
60904 {
60905 return t.head;
60906 }
60907 template<class RET, class HT, class TT>
60908 inline static RET get(cons<HT, TT>& t)
60909 {
60910 return t.head;
60911 }
60912 };
60913 }
60914 template<int N, class T>
60915 struct element
60916 {
60917 private:
60918 typedef typename T::tail_type Next;
60919 public:
60920 typedef typename element<N-1, Next>::type type;
60921 };
60922 template<class T>
60923 struct element<0,T>
60924 {
60925 typedef typename T::head_type type;
60926 };
60927 template<int N, class T>
60928 struct element<N, const T>
60929 {
60930 private:
60931 typedef typename T::tail_type Next;
60932 typedef typename element<N-1, Next>::type unqualified_type;
60933 public:
60934 typedef typename boost::add_const<unqualified_type>::type type;
60935 };
60936 template<class T>
60937 struct element<0,const T>
60938 {
60939 typedef typename boost::add_const<typename T::head_type>::type type;
60940 };
60941 template <class T> struct access_traits {
60942 typedef const T& const_type;
60943 typedef T& non_const_type;
60944 typedef const typename boost::remove_cv<T>::type& parameter_type;
60945 };
60946 template <class T> struct access_traits<T&> {
60947 typedef T& const_type;
60948 typedef T& non_const_type;
60949 typedef T& parameter_type;
60950 };
60951 template<int N, class HT, class TT>
60952 inline typename access_traits<
60953 typename element<N, cons<HT, TT> >::type
60954 >::non_const_type
60955 get(cons<HT, TT>& c ) {
60956 return detail::get_class<N>::template
60957 get<
60958 typename access_traits<
60959 typename element<N, cons<HT, TT> >::type
60960 >::non_const_type,
60961 HT,TT
60962 >(c);
60963 }
60964 template<int N, class HT, class TT>
60965 inline typename access_traits<
60966 typename element<N, cons<HT, TT> >::type
60967 >::const_type
60968 get(const cons<HT, TT>& c ) {
60969 return detail::get_class<N>::template
60970 get<
60971 typename access_traits<
60972 typename element<N, cons<HT, TT> >::type
60973 >::const_type,
60974 HT,TT
60975 >(c);
60976 }
60977 namespace detail {
60978 template <class T> class non_storeable_type {
60979 non_storeable_type();
60980 };
60981 template <class T> struct wrap_non_storeable_type {
60982 typedef typename IF<
60983 ::boost::is_function<T>::value, non_storeable_type<T>, T
60984 >::RET type;
60985 };
60986 template <> struct wrap_non_storeable_type<void> {
60987 typedef non_storeable_type<void> type;
60988 };
60989 }
60990 template <class HT, class TT>
60991 struct cons {
60992 typedef HT head_type;
60993 typedef TT tail_type;
60994 typedef typename
60995 detail::wrap_non_storeable_type<head_type>::type stored_head_type;
60996 stored_head_type head;
60997 tail_type tail;
60998 typename access_traits<stored_head_type>::non_const_type
60999 get_head() { return head; }
61000 typename access_traits<tail_type>::non_const_type
61001 get_tail() { return tail; }
61002 typename access_traits<stored_head_type>::const_type
61003 get_head() const { return head; }
61004 typename access_traits<tail_type>::const_type
61005 get_tail() const { return tail; }
61006 cons() : head(), tail() {}
61007 cons(typename access_traits<stored_head_type>::parameter_type h,
61008 const tail_type& t)
61009 : head (h), tail(t) {}
61010 template <class T1, class T2, class T3, class T4, class T5,
61011 class T6, class T7, class T8, class T9, class T10>
61012 cons( T1& t1, T2& t2, T3& t3, T4& t4, T5& t5,
61013 T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 )
61014 : head (t1),
61015 tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull())
61016 {}
61017 template <class T2, class T3, class T4, class T5,
61018 class T6, class T7, class T8, class T9, class T10>
61019 cons( const null_type& , T2& t2, T3& t3, T4& t4, T5& t5,
61020 T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 )
61021 : head (),
61022 tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull())
61023 {}
61024 template <class HT2, class TT2>
61025 cons( const cons<HT2, TT2>& u ) : head(u.head), tail(u.tail) {}
61026 template <class HT2, class TT2>
61027 cons& operator=( const cons<HT2, TT2>& u ) {
61028 head=u.head; tail=u.tail; return *this;
61029 }
61030 cons& operator=(const cons& u) {
61031 head = u.head; tail = u.tail; return *this;
61032 }
61033 template <class T1, class T2>
61034 cons& operator=( const std::pair<T1, T2>& u ) {
61035 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((length<cons>::value == 2) == 0 ? false : true) >)> boost_static_assert_typedef_388;
61036 head = u.first; tail.head = u.second; return *this;
61037 }
61038 template <int N>
61039 typename access_traits<
61040 typename element<N, cons<HT, TT> >::type
61041 >::non_const_type
61042 get() {
61043 return boost::tuples::get<N>(*this);
61044 }
61045 template <int N>
61046 typename access_traits<
61047 typename element<N, cons<HT, TT> >::type
61048 >::const_type
61049 get() const {
61050 return boost::tuples::get<N>(*this);
61051 }
61052 };
61053 template <class HT>
61054 struct cons<HT, null_type> {
61055 typedef HT head_type;
61056 typedef null_type tail_type;
61057 typedef cons<HT, null_type> self_type;
61058 typedef typename
61059 detail::wrap_non_storeable_type<head_type>::type stored_head_type;
61060 stored_head_type head;
61061 typename access_traits<stored_head_type>::non_const_type
61062 get_head() { return head; }
61063 null_type get_tail() { return null_type(); }
61064 typename access_traits<stored_head_type>::const_type
61065 get_head() const { return head; }
61066 const null_type get_tail() const { return null_type(); }
61067 cons() : head() {}
61068 cons(typename access_traits<stored_head_type>::parameter_type h,
61069 const null_type& = null_type())
61070 : head (h) {}
61071 template<class T1>
61072 cons(T1& t1, const null_type&, const null_type&, const null_type&,
61073 const null_type&, const null_type&, const null_type&,
61074 const null_type&, const null_type&, const null_type&)
61075 : head (t1) {}
61076 cons(const null_type&,
61077 const null_type&, const null_type&, const null_type&,
61078 const null_type&, const null_type&, const null_type&,
61079 const null_type&, const null_type&, const null_type&)
61080 : head () {}
61081 template <class HT2>
61082 cons( const cons<HT2, null_type>& u ) : head(u.head) {}
61083 template <class HT2>
61084 cons& operator=(const cons<HT2, null_type>& u )
61085 { head = u.head; return *this; }
61086 cons& operator=(const cons& u) { head = u.head; return *this; }
61087 template <int N>
61088 typename access_traits<
61089 typename element<N, self_type>::type
61090 >::non_const_type
61091 get() {
61092 return boost::tuples::get<N>(*this);
61093 }
61094 template <int N>
61095 typename access_traits<
61096 typename element<N, self_type>::type
61097 >::const_type
61098 get() const {
61099 return boost::tuples::get<N>(*this);
61100 }
61101 };
61102 template<class T>
61103 struct length {
61104 static const int value = 1 + length<typename T::tail_type>::value;
61105 };
61106 template<>
61107 struct length<tuple<> > {
61108 static const int value = 0;
61109 };
61110 template<>
61111 struct length<tuple<> const> {
61112 static const int value = 0;
61113 };
61114 template<>
61115 struct length<null_type> {
61116 static const int value = 0;
61117 };
61118 template<>
61119 struct length<null_type const> {
61120 static const int value = 0;
61121 };
61122 namespace detail {
61123 template <class T0, class T1, class T2, class T3, class T4,
61124 class T5, class T6, class T7, class T8, class T9>
61125 struct map_tuple_to_cons
61126 {
61127 typedef cons<T0,
61128 typename map_tuple_to_cons<T1, T2, T3, T4, T5,
61129 T6, T7, T8, T9, null_type>::type
61130 > type;
61131 };
61132 template <>
61133 struct map_tuple_to_cons<null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type>
61134 {
61135 typedef null_type type;
61136 };
61137 }
61138 template <class T0, class T1, class T2, class T3, class T4,
61139 class T5, class T6, class T7, class T8, class T9>
61140 class tuple :
61141 public detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
61142 {
61143 public:
61144 typedef typename
61145 detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type inherited;
61146 typedef typename inherited::head_type head_type;
61147 typedef typename inherited::tail_type tail_type;
61148 tuple() {}
61149 tuple(typename access_traits<T0>::parameter_type t0)
61150 : inherited(t0, detail::cnull(), detail::cnull(), detail::cnull(),
61151 detail::cnull(), detail::cnull(), detail::cnull(),
61152 detail::cnull(), detail::cnull(), detail::cnull()) {}
61153 tuple(typename access_traits<T0>::parameter_type t0,
61154 typename access_traits<T1>::parameter_type t1)
61155 : inherited(t0, t1, detail::cnull(), detail::cnull(),
61156 detail::cnull(), detail::cnull(), detail::cnull(),
61157 detail::cnull(), detail::cnull(), detail::cnull()) {}
61158 tuple(typename access_traits<T0>::parameter_type t0,
61159 typename access_traits<T1>::parameter_type t1,
61160 typename access_traits<T2>::parameter_type t2)
61161 : inherited(t0, t1, t2, detail::cnull(), detail::cnull(),
61162 detail::cnull(), detail::cnull(), detail::cnull(),
61163 detail::cnull(), detail::cnull()) {}
61164 tuple(typename access_traits<T0>::parameter_type t0,
61165 typename access_traits<T1>::parameter_type t1,
61166 typename access_traits<T2>::parameter_type t2,
61167 typename access_traits<T3>::parameter_type t3)
61168 : inherited(t0, t1, t2, t3, detail::cnull(), detail::cnull(),
61169 detail::cnull(), detail::cnull(), detail::cnull(),
61170 detail::cnull()) {}
61171 tuple(typename access_traits<T0>::parameter_type t0,
61172 typename access_traits<T1>::parameter_type t1,
61173 typename access_traits<T2>::parameter_type t2,
61174 typename access_traits<T3>::parameter_type t3,
61175 typename access_traits<T4>::parameter_type t4)
61176 : inherited(t0, t1, t2, t3, t4, detail::cnull(), detail::cnull(),
61177 detail::cnull(), detail::cnull(), detail::cnull()) {}
61178 tuple(typename access_traits<T0>::parameter_type t0,
61179 typename access_traits<T1>::parameter_type t1,
61180 typename access_traits<T2>::parameter_type t2,
61181 typename access_traits<T3>::parameter_type t3,
61182 typename access_traits<T4>::parameter_type t4,
61183 typename access_traits<T5>::parameter_type t5)
61184 : inherited(t0, t1, t2, t3, t4, t5, detail::cnull(), detail::cnull(),
61185 detail::cnull(), detail::cnull()) {}
61186 tuple(typename access_traits<T0>::parameter_type t0,
61187 typename access_traits<T1>::parameter_type t1,
61188 typename access_traits<T2>::parameter_type t2,
61189 typename access_traits<T3>::parameter_type t3,
61190 typename access_traits<T4>::parameter_type t4,
61191 typename access_traits<T5>::parameter_type t5,
61192 typename access_traits<T6>::parameter_type t6)
61193 : inherited(t0, t1, t2, t3, t4, t5, t6, detail::cnull(),
61194 detail::cnull(), detail::cnull()) {}
61195 tuple(typename access_traits<T0>::parameter_type t0,
61196 typename access_traits<T1>::parameter_type t1,
61197 typename access_traits<T2>::parameter_type t2,
61198 typename access_traits<T3>::parameter_type t3,
61199 typename access_traits<T4>::parameter_type t4,
61200 typename access_traits<T5>::parameter_type t5,
61201 typename access_traits<T6>::parameter_type t6,
61202 typename access_traits<T7>::parameter_type t7)
61203 : inherited(t0, t1, t2, t3, t4, t5, t6, t7, detail::cnull(),
61204 detail::cnull()) {}
61205 tuple(typename access_traits<T0>::parameter_type t0,
61206 typename access_traits<T1>::parameter_type t1,
61207 typename access_traits<T2>::parameter_type t2,
61208 typename access_traits<T3>::parameter_type t3,
61209 typename access_traits<T4>::parameter_type t4,
61210 typename access_traits<T5>::parameter_type t5,
61211 typename access_traits<T6>::parameter_type t6,
61212 typename access_traits<T7>::parameter_type t7,
61213 typename access_traits<T8>::parameter_type t8)
61214 : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, detail::cnull()) {}
61215 tuple(typename access_traits<T0>::parameter_type t0,
61216 typename access_traits<T1>::parameter_type t1,
61217 typename access_traits<T2>::parameter_type t2,
61218 typename access_traits<T3>::parameter_type t3,
61219 typename access_traits<T4>::parameter_type t4,
61220 typename access_traits<T5>::parameter_type t5,
61221 typename access_traits<T6>::parameter_type t6,
61222 typename access_traits<T7>::parameter_type t7,
61223 typename access_traits<T8>::parameter_type t8,
61224 typename access_traits<T9>::parameter_type t9)
61225 : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {}
61226 template<class U1, class U2>
61227 tuple(const cons<U1, U2>& p) : inherited(p) {}
61228 template <class U1, class U2>
61229 tuple& operator=(const cons<U1, U2>& k) {
61230 inherited::operator=(k);
61231 return *this;
61232 }
61233 template <class U1, class U2>
61234 tuple& operator=(const std::pair<U1, U2>& k) {
61235 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((length<tuple>::value == 2) == 0 ? false : true) >)> boost_static_assert_typedef_645;
61236 this->head = k.first;
61237 this->tail.head = k.second;
61238 return *this;
61239 }
61240 };
61241 template <>
61242 class tuple<null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type> :
61243 public null_type
61244 {
61245 public:
61246 typedef null_type inherited;
61247 };
61248 namespace detail {
61249 struct swallow_assign {
61250 template<typename T>
61251 swallow_assign const& operator=(const T&) const {
61252 return *this;
61253 }
61254 };
61255 }
61256 detail::swallow_assign const ignore = detail::swallow_assign();
61257 template<class T>
61258 struct make_tuple_traits {
61259 typedef T type;
61260 };
61261 template<class T>
61262 struct make_tuple_traits<T&> {
61263 typedef typename
61264 detail::generate_error<T&>::
61265 do_not_use_with_reference_type error;
61266 };
61267 template<class T, int n> struct make_tuple_traits <T[n]> {
61268 typedef const T (&type)[n];
61269 };
61270 template<class T, int n>
61271 struct make_tuple_traits<const T[n]> {
61272 typedef const T (&type)[n];
61273 };
61274 template<class T, int n> struct make_tuple_traits<volatile T[n]> {
61275 typedef const volatile T (&type)[n];
61276 };
61277 template<class T, int n>
61278 struct make_tuple_traits<const volatile T[n]> {
61279 typedef const volatile T (&type)[n];
61280 };
61281 template<class T>
61282 struct make_tuple_traits<reference_wrapper<T> >{
61283 typedef T& type;
61284 };
61285 template<class T>
61286 struct make_tuple_traits<const reference_wrapper<T> >{
61287 typedef T& type;
61288 };
61289 namespace detail {
61290 template <
61291 class T0 = null_type, class T1 = null_type, class T2 = null_type,
61292 class T3 = null_type, class T4 = null_type, class T5 = null_type,
61293 class T6 = null_type, class T7 = null_type, class T8 = null_type,
61294 class T9 = null_type
61295 >
61296 struct make_tuple_mapper {
61297 typedef
61298 tuple<typename make_tuple_traits<T0>::type,
61299 typename make_tuple_traits<T1>::type,
61300 typename make_tuple_traits<T2>::type,
61301 typename make_tuple_traits<T3>::type,
61302 typename make_tuple_traits<T4>::type,
61303 typename make_tuple_traits<T5>::type,
61304 typename make_tuple_traits<T6>::type,
61305 typename make_tuple_traits<T7>::type,
61306 typename make_tuple_traits<T8>::type,
61307 typename make_tuple_traits<T9>::type> type;
61308 };
61309 }
61310 inline tuple<> make_tuple() {
61311 return tuple<>();
61312 }
61313 template<class T0>
61314 inline typename detail::make_tuple_mapper<T0>::type
61315 make_tuple(const T0& t0) {
61316 typedef typename detail::make_tuple_mapper<T0>::type t;
61317 return t(t0);
61318 }
61319 template<class T0, class T1>
61320 inline typename detail::make_tuple_mapper<T0, T1>::type
61321 make_tuple(const T0& t0, const T1& t1) {
61322 typedef typename detail::make_tuple_mapper<T0, T1>::type t;
61323 return t(t0, t1);
61324 }
61325 template<class T0, class T1, class T2>
61326 inline typename detail::make_tuple_mapper<T0, T1, T2>::type
61327 make_tuple(const T0& t0, const T1& t1, const T2& t2) {
61328 typedef typename detail::make_tuple_mapper<T0, T1, T2>::type t;
61329 return t(t0, t1, t2);
61330 }
61331 template<class T0, class T1, class T2, class T3>
61332 inline typename detail::make_tuple_mapper<T0, T1, T2, T3>::type
61333 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3) {
61334 typedef typename detail::make_tuple_mapper<T0, T1, T2, T3>::type t;
61335 return t(t0, t1, t2, t3);
61336 }
61337 template<class T0, class T1, class T2, class T3, class T4>
61338 inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4>::type
61339 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
61340 const T4& t4) {
61341 typedef typename detail::make_tuple_mapper<T0, T1, T2, T3, T4>::type t;
61342 return t(t0, t1, t2, t3, t4);
61343 }
61344 template<class T0, class T1, class T2, class T3, class T4, class T5>
61345 inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type
61346 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
61347 const T4& t4, const T5& t5) {
61348 typedef typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type t;
61349 return t(t0, t1, t2, t3, t4, t5);
61350 }
61351 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
61352 inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6>::type
61353 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
61354 const T4& t4, const T5& t5, const T6& t6) {
61355 typedef typename detail::make_tuple_mapper
61356 <T0, T1, T2, T3, T4, T5, T6>::type t;
61357 return t(t0, t1, t2, t3, t4, t5, t6);
61358 }
61359 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
61360 class T7>
61361 inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
61362 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
61363 const T4& t4, const T5& t5, const T6& t6, const T7& t7) {
61364 typedef typename detail::make_tuple_mapper
61365 <T0, T1, T2, T3, T4, T5, T6, T7>::type t;
61366 return t(t0, t1, t2, t3, t4, t5, t6, t7);
61367 }
61368 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
61369 class T7, class T8>
61370 inline typename detail::make_tuple_mapper
61371 <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
61372 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
61373 const T4& t4, const T5& t5, const T6& t6, const T7& t7,
61374 const T8& t8) {
61375 typedef typename detail::make_tuple_mapper
61376 <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type t;
61377 return t(t0, t1, t2, t3, t4, t5, t6, t7, t8);
61378 }
61379 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
61380 class T7, class T8, class T9>
61381 inline typename detail::make_tuple_mapper
61382 <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
61383 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
61384 const T4& t4, const T5& t5, const T6& t6, const T7& t7,
61385 const T8& t8, const T9& t9) {
61386 typedef typename detail::make_tuple_mapper
61387 <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type t;
61388 return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
61389 }
61390 template<class T1>
61391 inline tuple<T1&> tie(T1& t1) {
61392 return tuple<T1&> (t1);
61393 }
61394 template<class T1, class T2>
61395 inline tuple<T1&, T2&> tie(T1& t1, T2& t2) {
61396 return tuple<T1&, T2&> (t1, t2);
61397 }
61398 template<class T1, class T2, class T3>
61399 inline tuple<T1&, T2&, T3&> tie(T1& t1, T2& t2, T3& t3) {
61400 return tuple<T1&, T2&, T3&> (t1, t2, t3);
61401 }
61402 template<class T1, class T2, class T3, class T4>
61403 inline tuple<T1&, T2&, T3&, T4&> tie(T1& t1, T2& t2, T3& t3, T4& t4) {
61404 return tuple<T1&, T2&, T3&, T4&> (t1, t2, t3, t4);
61405 }
61406 template<class T1, class T2, class T3, class T4, class T5>
61407 inline tuple<T1&, T2&, T3&, T4&, T5&>
61408 tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) {
61409 return tuple<T1&, T2&, T3&, T4&, T5&> (t1, t2, t3, t4, t5);
61410 }
61411 template<class T1, class T2, class T3, class T4, class T5, class T6>
61412 inline tuple<T1&, T2&, T3&, T4&, T5&, T6&>
61413 tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) {
61414 return tuple<T1&, T2&, T3&, T4&, T5&, T6&> (t1, t2, t3, t4, t5, t6);
61415 }
61416 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
61417 inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&>
61418 tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) {
61419 return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&> (t1, t2, t3, t4, t5, t6, t7);
61420 }
61421 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
61422 class T8>
61423 inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
61424 tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) {
61425 return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
61426 (t1, t2, t3, t4, t5, t6, t7, t8);
61427 }
61428 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
61429 class T8, class T9>
61430 inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
61431 tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
61432 T9& t9) {
61433 return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
61434 (t1, t2, t3, t4, t5, t6, t7, t8, t9);
61435 }
61436 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
61437 class T8, class T9, class T10>
61438 inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&, T10&>
61439 tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
61440 T9& t9, T10& t10) {
61441 return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&, T10&>
61442 (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
61443 }
61444 }
61445 }
61446 namespace boost {
61447 using tuples::tuple;
61448 using tuples::make_tuple;
61449 using tuples::tie;
61450 using tuples::get;
61451 }
61452 namespace boost { namespace python {
61453 struct default_call_policies;
61454 namespace detail
61455 {
61456 template <class Tuple, class Predicate>
61457 struct tuple_extract;
61458 template <bool matched>
61459 struct tuple_extract_impl
61460 {
61461 template <class Tuple, class Predicate>
61462 struct apply
61463 {
61464 typedef typename Tuple::head_type result_type;
61465 static typename Tuple::head_type extract(Tuple const& x)
61466 {
61467 return x.get_head();
61468 }
61469 };
61470 };
61471 template <>
61472 struct tuple_extract_impl<false>
61473 {
61474 template <class Tuple, class Predicate>
61475 struct apply
61476 {
61477 typedef tuple_extract<typename Tuple::tail_type, Predicate> next;
61478 typedef typename next::result_type result_type;
61479 static result_type extract(Tuple const& x)
61480 {
61481 return next::extract(x.get_tail());
61482 }
61483 };
61484 };
61485 template <class Tuple, class Predicate>
61486 struct tuple_extract_base_select
61487 {
61488 typedef typename Tuple::head_type head_type;
61489 typedef typename mpl::apply1<Predicate, typename add_reference<head_type>::type>::type match_t;
61490 static const bool match = match_t::value;
61491 typedef typename tuple_extract_impl<match>::template apply<Tuple,Predicate> type;
61492 };
61493 template <class Tuple, class Predicate>
61494 struct tuple_extract
61495 : tuple_extract_base_select<
61496 Tuple
61497 , typename mpl::lambda<Predicate>::type
61498 >::type
61499 {
61500 };
61501 template <class Tuple>
61502 struct doc_extract
61503 : tuple_extract<
61504 Tuple
61505 , mpl::not_<
61506 mpl::or_<
61507 indirect_traits::is_reference_to_class<mpl::_1>
61508 , indirect_traits::is_reference_to_member_function_pointer<mpl::_1 >
61509 >
61510 >
61511 >
61512 {
61513 };
61514 template <class Tuple>
61515 struct keyword_extract
61516 : tuple_extract<Tuple, is_reference_to_keywords<mpl::_1 > >
61517 {
61518 };
61519 template <class Tuple>
61520 struct policy_extract
61521 : tuple_extract<
61522 Tuple
61523 , mpl::and_<
61524 mpl::not_<is_same<not_specified const&,mpl::_1> >
61525 , indirect_traits::is_reference_to_class<mpl::_1 >
61526 , mpl::not_<is_reference_to_keywords<mpl::_1 > >
61527 >
61528 >
61529 {
61530 };
61531 template <class Tuple>
61532 struct default_implementation_extract
61533 : tuple_extract<
61534 Tuple
61535 , indirect_traits::is_reference_to_member_function_pointer<mpl::_1 >
61536 >
61537 {
61538 };
61539 template <class T1, class T2, class T3, class T4>
61540 struct def_helper
61541 {
61542 typedef boost::tuples::tuple<
61543 T1 const&
61544 , T2 const&
61545 , T3 const&
61546 , T4 const&
61547 , default_call_policies
61548 , detail::keywords<0>
61549 , char const*
61550 , void(not_specified::*)()
61551 > all_t;
61552 def_helper(T1 const& a1) : m_all(a1,m_nil,m_nil,m_nil) {}
61553 def_helper(T1 const& a1, T2 const& a2) : m_all(a1,a2,m_nil,m_nil) {}
61554 def_helper(T1 const& a1, T2 const& a2, T3 const& a3) : m_all(a1,a2,a3,m_nil) {}
61555 def_helper(T1 const& a1, T2 const& a2, T3 const& a3, T4 const& a4) : m_all(a1,a2,a3,a4) {}
61556 private:
61557 typedef typename default_implementation_extract<all_t>::result_type default_implementation_t;
61558 public:
61559 static const bool has_default_implementation = ( !is_same<default_implementation_t, void(not_specified::*)()>::value)
61560 ;
61561 public:
61562 char const* doc() const
61563 {
61564 return doc_extract<all_t>::extract(m_all);
61565 }
61566 typename keyword_extract<all_t>::result_type keywords() const
61567 {
61568 return keyword_extract<all_t>::extract(m_all);
61569 }
61570 typename policy_extract<all_t>::result_type policies() const
61571 {
61572 return policy_extract<all_t>::extract(m_all);
61573 }
61574 default_implementation_t default_implementation() const
61575 {
61576 return default_implementation_extract<all_t>::extract(m_all);
61577 }
61578 private:
61579 all_t m_all;
61580 not_specified m_nil;
61581 };
61582 }
61583 }}
61584 namespace boost { namespace python {
61585 template <class T> class wrapper;
61586 namespace detail {
61587 template <class T>
61588 inline type_info unwrap_type_id(T*, ...)
61589 {
61590 return type_id<T>();
61591 }
61592 template <class U, class T>
61593 inline type_info unwrap_type_id(U*, wrapper<T>*)
61594 {
61595 return type_id<T>();
61596 }
61597 }}}
61598 namespace boost { namespace python {
61599 template <class T> class wrapper;
61600 namespace detail
61601 {
61602 typedef char (&is_not_wrapper)[2];
61603 is_not_wrapper is_wrapper_helper(...);
61604 template <class T>
61605 char is_wrapper_helper(wrapper<T> const volatile*);
61606 template <class T>
61607 struct is_wrapper
61608 : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)>
61609 {};
61610 }}}
61611 namespace boost { namespace python { namespace detail {
61612 template <class T>
61613 struct unwrap_wrapper_helper
61614 {
61615 typedef typename T::_wrapper_wrapped_type_ type;
61616 };
61617 template <class T>
61618 struct unwrap_wrapper_
61619 : mpl::eval_if<is_wrapper<T>,unwrap_wrapper_helper<T>,mpl::identity<T> >
61620 {};
61621 template <class T>
61622 typename unwrap_wrapper_<T>::type*
61623 unwrap_wrapper(T*)
61624 {
61625 return 0;
61626 }
61627 }}}
61628 namespace boost { namespace python {
61629 template <class DerivedVisitor> class def_visitor;
61630 enum no_init_t { no_init };
61631 namespace detail
61632 {
61633 struct write_type_id
61634 {
61635 write_type_id(type_info**p) : p(p) {}
61636 template <class T>
61637 void operator()(T*) const
61638 {
61639 *(*p)++ = type_id<T>();
61640 }
61641 type_info** p;
61642 };
61643 template <class T>
61644 struct is_data_member_pointer
61645 : mpl::and_<
61646 is_member_pointer<T>
61647 , mpl::not_<is_member_function_pointer<T> >
61648 >
61649 {};
61650 namespace error
61651 {
61652 template <class C> struct assertion_failed { };
61653 template <class C> struct assertion_ok { typedef C failed; };
61654 template <class C>
61655 struct assertion
61656 : mpl::if_<C, assertion_ok<C>, assertion_failed<C> >::type
61657 {};
61658 template <class Default>
61659 void not_a_derived_class_member(Default) {}
61660 template <class T, class Fn>
61661 struct virtual_function_default
61662 {
61663 template <class Default>
61664 static void
61665 must_be_derived_class_member(Default const&)
61666 {
61667 typedef typename assertion<mpl::not_<is_same<Default,Fn> > >::failed test0;
61668 typedef typename assertion<is_polymorphic<T> >::failed test1;
61669 typedef typename assertion<is_member_function_pointer<Fn> >::failed test2;
61670 not_a_derived_class_member<Default>(Fn());
61671 }
61672 };
61673 }
61674 }
61675 template <
61676 class W
61677 , class X1
61678 , class X2
61679 , class X3
61680 >
61681 class class_ : public objects::class_base
61682 {
61683 public:
61684 typedef objects::class_base base;
61685 typedef class_<W,X1,X2,X3> self;
61686 typedef typename objects::class_metadata<W,X1,X2,X3> metadata;
61687 typedef W wrapped_type;
61688 private:
61689 struct id_vector
61690 {
61691 typedef typename metadata::bases bases;
61692 id_vector()
61693 {
61694 ids[0] = detail::unwrap_type_id((W*)0, (W*)0);
61695 type_info* p = ids + 1;
61696 mpl::for_each(detail::write_type_id(&p), (bases*)0, (add_pointer<mpl::_>*)0);
61697 }
61698 static const std::size_t size = mpl::size<bases>::value + 1
61699 ;
61700 type_info ids[size];
61701 };
61702 friend struct id_vector;
61703 public:
61704 class_(char const* name, char const* doc = 0);
61705 class_(char const* name, no_init_t);
61706 class_(char const* name, char const* doc, no_init_t);
61707 template <class DerivedT>
61708 inline class_(char const* name, init_base<DerivedT> const& i)
61709 : base(name, id_vector::size, id_vector().ids)
61710 {
61711 this->initialize(i);
61712 }
61713 template <class DerivedT>
61714 inline class_(char const* name, char const* doc, init_base<DerivedT> const& i)
61715 : base(name, id_vector::size, id_vector().ids, doc)
61716 {
61717 this->initialize(i);
61718 }
61719 public:
61720 template <class Derived>
61721 self& def(def_visitor<Derived> const& visitor)
61722 {
61723 visitor.visit(*this);
61724 return *this;
61725 }
61726 template <class F>
61727 self& def(char const* name, F f)
61728 {
61729 this->def_impl(
61730 detail::unwrap_wrapper((W*)0)
61731 , name, f, detail::def_helper<char const*>(0), &f);
61732 return *this;
61733 }
61734 template <class A1, class A2>
61735 self& def(char const* name, A1 a1, A2 const& a2)
61736 {
61737 this->def_maybe_overloads(name, a1, a2, &a2);
61738 return *this;
61739 }
61740 template <class Fn, class A1, class A2>
61741 self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2)
61742 {
61743 this->def_impl(
61744 detail::unwrap_wrapper((W*)0)
61745 , name, fn
61746 , detail::def_helper<A1,A2>(a1,a2)
61747 , &fn);
61748 return *this;
61749 }
61750 template <class Fn, class A1, class A2, class A3>
61751 self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2, A3 const& a3)
61752 {
61753 this->def_impl(
61754 detail::unwrap_wrapper((W*)0)
61755 , name, fn
61756 , detail::def_helper<A1,A2,A3>(a1,a2,a3)
61757 , &fn);
61758 return *this;
61759 }
61760 template <class D>
61761 self& def_readonly(char const* name, D const& d, char const* doc=0)
61762 {
61763 return this->def_readonly_impl(name, d, doc );
61764 }
61765 template <class D>
61766 self& def_readwrite(char const* name, D const& d, char const* doc=0)
61767 {
61768 return this->def_readwrite_impl(name, d, doc );
61769 }
61770 template <class D>
61771 self& def_readonly(char const* name, D& d, char const* doc=0)
61772 {
61773 return this->def_readonly_impl(name, d, doc );
61774 }
61775 template <class D>
61776 self& def_readwrite(char const* name, D& d, char const* doc=0)
61777 {
61778 return this->def_readwrite_impl(name, d, doc );
61779 }
61780 template <class Get>
61781 self& add_property(char const* name, Get fget, char const* docstr = 0)
61782 {
61783 base::add_property(name, this->make_getter(fget), docstr);
61784 return *this;
61785 }
61786 template <class Get, class Set>
61787 self& add_property(char const* name, Get fget, Set fset, char const* docstr = 0)
61788 {
61789 base::add_property(
61790 name, this->make_getter(fget), this->make_setter(fset), docstr);
61791 return *this;
61792 }
61793 template <class Get>
61794 self& add_static_property(char const* name, Get fget)
61795 {
61796 base::add_static_property(name, object(fget));
61797 return *this;
61798 }
61799 template <class Get, class Set>
61800 self& add_static_property(char const* name, Get fget, Set fset)
61801 {
61802 base::add_static_property(name, object(fget), object(fset));
61803 return *this;
61804 }
61805 template <class U>
61806 self& setattr(char const* name, U const& x)
61807 {
61808 this->base::setattr(name, object(x));
61809 return *this;
61810 }
61811 template <typename PickleSuiteType>
61812 self& def_pickle(PickleSuiteType const& x)
61813 {
61814 error_messages::must_be_derived_from_pickle_suite(x);
61815 detail::pickle_suite_finalize<PickleSuiteType>::register_(
61816 *this,
61817 &PickleSuiteType::getinitargs,
61818 &PickleSuiteType::getstate,
61819 &PickleSuiteType::setstate,
61820 PickleSuiteType::getstate_manages_dict());
61821 return *this;
61822 }
61823 self& enable_pickling()
61824 {
61825 this->base::enable_pickling_(false);
61826 return *this;
61827 }
61828 self& staticmethod(char const* name)
61829 {
61830 this->make_method_static(name);
61831 return *this;
61832 }
61833 private:
61834 template <class F>
61835 object make_getter(F f)
61836 {
61837 typedef typename api::is_object_operators<F>::type is_obj_or_proxy;
61838 return this->make_fn_impl(
61839 detail::unwrap_wrapper((W*)0)
61840 , f, is_obj_or_proxy(), (char*)0, detail::is_data_member_pointer<F>()
61841 );
61842 }
61843 template <class F>
61844 object make_setter(F f)
61845 {
61846 typedef typename api::is_object_operators<F>::type is_obj_or_proxy;
61847 return this->make_fn_impl(
61848 detail::unwrap_wrapper((W*)0)
61849 , f, is_obj_or_proxy(), (int*)0, detail::is_data_member_pointer<F>()
61850 );
61851 }
61852 template <class T, class F>
61853 object make_fn_impl(T*, F const& f, mpl::false_, void*, mpl::false_)
61854 {
61855 return python::make_function(f, default_call_policies(), detail::get_signature(f, (T*)0));
61856 }
61857 template <class T, class D, class B>
61858 object make_fn_impl(T*, D B::*pm_, mpl::false_, char*, mpl::true_)
61859 {
61860 D T::*pm = pm_;
61861 return python::make_getter(pm);
61862 }
61863 template <class T, class D, class B>
61864 object make_fn_impl(T*, D B::*pm_, mpl::false_, int*, mpl::true_)
61865 {
61866 D T::*pm = pm_;
61867 return python::make_setter(pm);
61868 }
61869 template <class T, class F>
61870 object make_fn_impl(T*, F const& x, mpl::true_, void*, mpl::false_)
61871 {
61872 return x;
61873 }
61874 template <class D, class B>
61875 self& def_readonly_impl(
61876 char const* name, D B::*pm_, char const* doc )
61877 {
61878 return this->add_property(name, pm_, doc);
61879 }
61880 template <class D, class B>
61881 self& def_readwrite_impl(
61882 char const* name, D B::*pm_, char const* doc )
61883 {
61884 return this->add_property(name, pm_, pm_, doc);
61885 }
61886 template <class D>
61887 self& def_readonly_impl(
61888 char const* name, D& d, char const* )
61889 {
61890 return this->add_static_property(name, python::make_getter(d));
61891 }
61892 template <class D>
61893 self& def_readwrite_impl(
61894 char const* name, D& d, char const* )
61895 {
61896 return this->add_static_property(name, python::make_getter(d), python::make_setter(d));
61897 }
61898 template <class DefVisitor>
61899 inline void initialize(DefVisitor const& i)
61900 {
61901 metadata::register_();
61902 typedef typename metadata::holder holder;
61903 this->set_instance_size( objects::additional_instance_size<holder>::value );
61904 this->def(i);
61905 }
61906 inline void initialize(no_init_t)
61907 {
61908 metadata::register_();
61909 this->def_no_init();
61910 }
61911 template <class T, class Helper, class LeafVisitor, class Visitor>
61912 inline void def_impl(
61913 T*
61914 , char const* name
61915 , LeafVisitor
61916 , Helper const& helper
61917 , def_visitor<Visitor> const* v
61918 )
61919 {
61920 v->visit(*this, name, helper);
61921 }
61922 template <class T, class Fn, class Helper>
61923 inline void def_impl(
61924 T*
61925 , char const* name
61926 , Fn fn
61927 , Helper const& helper
61928 , ...
61929 )
61930 {
61931 objects::add_to_namespace(
61932 *this
61933 , name
61934 , make_function(
61935 fn
61936 , helper.policies()
61937 , helper.keywords()
61938 , detail::get_signature(fn, (T*)0)
61939 )
61940 , helper.doc()
61941 );
61942 this->def_default(name, fn, helper, mpl::bool_<Helper::has_default_implementation>());
61943 }
61944 template <class Fn, class Helper>
61945 inline void def_default(
61946 char const* name
61947 , Fn
61948 , Helper const& helper
61949 , mpl::bool_<true>)
61950 {
61951 detail::error::virtual_function_default<W,Fn>::must_be_derived_class_member(
61952 helper.default_implementation());
61953 objects::add_to_namespace(
61954 *this, name,
61955 make_function(
61956 helper.default_implementation(), helper.policies(), helper.keywords())
61957 );
61958 }
61959 template <class Fn, class Helper>
61960 inline void def_default(char const*, Fn, Helper const&, mpl::bool_<false>)
61961 { }
61962 template <class OverloadsT, class SigT>
61963 void def_maybe_overloads(
61964 char const* name
61965 , SigT sig
61966 , OverloadsT const& overloads
61967 , detail::overloads_base const*)
61968 {
61969 detail::define_with_defaults(
61970 name, overloads, *this, detail::get_signature(sig));
61971 }
61972 template <class Fn, class A1>
61973 void def_maybe_overloads(
61974 char const* name
61975 , Fn fn
61976 , A1 const& a1
61977 , ...)
61978 {
61979 this->def_impl(
61980 detail::unwrap_wrapper((W*)0)
61981 , name
61982 , fn
61983 , detail::def_helper<A1>(a1)
61984 , &fn
61985 );
61986 }
61987 };
61988 template <class W, class X1, class X2, class X3>
61989 inline class_<W,X1,X2,X3>::class_(char const* name, char const* doc)
61990 : base(name, id_vector::size, id_vector().ids, doc)
61991 {
61992 this->initialize(init<>());
61993 }
61994 template <class W, class X1, class X2, class X3>
61995 inline class_<W,X1,X2,X3>::class_(char const* name, no_init_t)
61996 : base(name, id_vector::size, id_vector().ids)
61997 {
61998 this->initialize(no_init);
61999 }
62000 template <class W, class X1, class X2, class X3>
62001 inline class_<W,X1,X2,X3>::class_(char const* name, char const* doc, no_init_t)
62002 : base(name, id_vector::size, id_vector().ids, doc)
62003 {
62004 this->initialize(no_init);
62005 }
62006 }}
62007 namespace boost { namespace python {
62008 namespace detail
62009 {
62010 template <class R>
62011 struct copy_const_reference_expects_a_const_reference_return_type
62012 {}
62013 ;
62014 }
62015 template <class T> struct to_python_value;
62016 struct copy_const_reference
62017 {
62018 template <class T>
62019 struct apply
62020 {
62021 typedef typename mpl::if_c<
62022 indirect_traits::is_reference_to_const<T>::value
62023 , to_python_value<T>
62024 , detail::copy_const_reference_expects_a_const_reference_return_type<T>
62025 >::type type;
62026 };
62027 };
62028 }}
62029 namespace boost { namespace python {
62030 namespace detail
62031 {
62032 template <class R>
62033 struct copy_non_const_reference_expects_a_non_const_reference_return_type
62034 {}
62035 ;
62036 }
62037 template <class T> struct to_python_value;
62038 struct copy_non_const_reference
62039 {
62040 template <class T>
62041 struct apply
62042 {
62043 typedef typename mpl::if_c<
62044 indirect_traits::is_reference_to_non_const<T>::value
62045 , to_python_value<T>
62046 , detail::copy_non_const_reference_expects_a_non_const_reference_return_type<T>
62047 >::type type;
62048 };
62049 };
62050 }}
62051 namespace boost { namespace python {
62052 namespace detail
62053 {
62054 extern PyObject* current_scope;
62055 }
62056 class scope
62057 : public object
62058 {
62059 public:
62060 inline scope(scope const&);
62061 inline scope(object const&);
62062 inline scope();
62063 inline ~scope();
62064 private:
62065 PyObject* m_previous_scope;
62066 private:
62067 void operator=(scope const&);
62068 };
62069 inline scope::scope(object const& new_scope)
62070 : object(new_scope)
62071 , m_previous_scope(detail::current_scope)
62072 {
62073 detail::current_scope = python::incref(new_scope.ptr());
62074 }
62075 inline scope::scope()
62076 : object(detail::borrowed_reference(
62077 detail::current_scope ? detail::current_scope : (&_Py_NoneStruct)
62078 ))
62079 , m_previous_scope(python::xincref(detail::current_scope))
62080 {
62081 }
62082 inline scope::~scope()
62083 {
62084 python::xdecref(detail::current_scope);
62085 detail::current_scope = m_previous_scope;
62086 }
62087 namespace converter
62088 {
62089 template <>
62090 struct object_manager_traits<scope>
62091 : object_manager_traits<object>
62092 {
62093 };
62094 }
62095 inline scope::scope(scope const& new_scope)
62096 : object(new_scope)
62097 , m_previous_scope(detail::current_scope)
62098 {
62099 detail::current_scope = python::incref(new_scope.ptr());
62100 }
62101 }}
62102 namespace boost { namespace python { namespace detail {
62103 void scope_setattr_doc(char const* name, object const& obj, char const* doc);
62104 }}}
62105 namespace boost { namespace python {
62106 namespace detail
62107 {
62108 namespace error
62109 {
62110 template <bool> struct multiple_functions_passed_to_def;
62111 template <> struct multiple_functions_passed_to_def<false> { typedef char type; };
62112 }
62113 template <class F, class Helper>
62114 void def_from_helper(
62115 char const* name, F const& fn, Helper const& helper)
62116 {
62117 typedef typename error::multiple_functions_passed_to_def<
62118 Helper::has_default_implementation
62119 >::type assertion;
62120 detail::scope_setattr_doc(
62121 name, boost::python::make_function(
62122 fn
62123 , helper.policies()
62124 , helper.keywords())
62125 , helper.doc()
62126 );
62127 }
62128 template <class Fn, class A1>
62129 void
62130 def_maybe_overloads(
62131 char const* name
62132 , Fn fn
62133 , A1 const& a1
62134 , ...)
62135 {
62136 detail::def_from_helper(name, fn, def_helper<A1>(a1));
62137 }
62138 template <class StubsT, class SigT>
62139 void def_maybe_overloads(
62140 char const* name
62141 , SigT sig
62142 , StubsT const& stubs
62143 , detail::overloads_base const*)
62144 {
62145 scope current;
62146 detail::define_with_defaults(
62147 name, stubs, current, detail::get_signature(sig));
62148 }
62149 template <class T>
62150 object make_function1(T fn, ...) { return make_function(fn); }
62151 inline
62152 object make_function1(object const& x, object const*) { return x; }
62153 }
62154 template <class Fn>
62155 void def(char const* name, Fn fn)
62156 {
62157 detail::scope_setattr_doc(name, detail::make_function1(fn, &fn), 0);
62158 }
62159 template <class Arg1T, class Arg2T>
62160 void def(char const* name, Arg1T arg1, Arg2T const& arg2)
62161 {
62162 detail::def_maybe_overloads(name, arg1, arg2, &arg2);
62163 }
62164 template <class F, class A1, class A2>
62165 void def(char const* name, F f, A1 const& a1, A2 const& a2)
62166 {
62167 detail::def_from_helper(name, f, detail::def_helper<A1,A2>(a1,a2));
62168 }
62169 template <class F, class A1, class A2, class A3>
62170 void def(char const* name, F f, A1 const& a1, A2 const& a2, A3 const& a3)
62171 {
62172 detail::def_from_helper(name, f, detail::def_helper<A1,A2,A3>(a1,a2,a3));
62173 }
62174 }}
62175 namespace boost { namespace python { namespace converter {
62176 template <class T> struct object_manager_traits;
62177 template <PyTypeObject* pytype, class T>
62178 struct pytype_object_manager_traits
62179 : pyobject_type<T, pytype>
62180 {
62181 static const bool is_specialized = true;
62182 static inline python::detail::new_reference adopt(PyObject*);
62183 };
62184 template <PyTypeObject* pytype, class T>
62185 inline python::detail::new_reference pytype_object_manager_traits<pytype,T>::adopt(PyObject* x)
62186 {
62187 return python::detail::new_reference(python::pytype_check(pytype, x));
62188 }
62189 }}}
62190 namespace boost { namespace python {
62191 namespace detail
62192 {
62193 struct list_base : object
62194 {
62195 void append(object_cref);
62196 ssize_t count(object_cref value) const;
62197 void extend(object_cref sequence);
62198 long index(object_cref value) const;
62199 void insert(ssize_t index, object_cref);
62200 void insert(object const& index, object_cref);
62201 object pop();
62202 object pop(ssize_t index);
62203 object pop(object const& index);
62204 void remove(object_cref value);
62205 void reverse();
62206 void sort();
62207 void sort(object_cref cmpfunc);
62208 protected:
62209 list_base();
62210 explicit list_base(object_cref sequence);
62211 inline explicit list_base(python::detail::borrowed_reference p) : object(p) {} inline explicit list_base(python::detail::new_reference p) : object(p) {} inline explicit list_base(python::detail::new_non_null_reference p) : object(p) {}
62212 private:
62213 static detail::new_non_null_reference call(object const&);
62214 };
62215 }
62216 class list : public detail::list_base
62217 {
62218 typedef detail::list_base base;
62219 public:
62220 list() {}
62221 template <class T>
62222 explicit list(T const& sequence)
62223 : base(object(sequence))
62224 {
62225 }
62226 template <class T>
62227 void append(T const& x)
62228 {
62229 base::append(object(x));
62230 }
62231 template <class T>
62232 long count(T const& value) const
62233 {
62234 return base::count(object(value));
62235 }
62236 template <class T>
62237 void extend(T const& x)
62238 {
62239 base::extend(object(x));
62240 }
62241 template <class T>
62242 long index(T const& x) const
62243 {
62244 return base::index(object(x));
62245 }
62246 template <class T>
62247 void insert(ssize_t index, T const& x)
62248 {
62249 base::insert(index, object(x));
62250 }
62251 template <class T>
62252 void insert(object const& index, T const& x)
62253 {
62254 base::insert(index, object(x));
62255 }
62256 object pop() { return base::pop(); }
62257 object pop(ssize_t index) { return base::pop(index); }
62258 template <class T>
62259 object pop(T const& index)
62260 {
62261 return base::pop(object(index));
62262 }
62263 template <class T>
62264 void remove(T const& value)
62265 {
62266 base::remove(object(value));
62267 }
62268 void sort() { base::sort(); }
62269 template <class T>
62270 void sort(T const& value)
62271 {
62272 base::sort(object(value));
62273 }
62274 public:
62275 inline explicit list(python::detail::borrowed_reference p) : base(p) {} inline explicit list(python::detail::new_reference p) : base(p) {} inline explicit list(python::detail::new_non_null_reference p) : base(p) {}
62276 };
62277 namespace converter
62278 {
62279 template <>
62280 struct object_manager_traits<list>
62281 : pytype_object_manager_traits<&PyList_Type,list>
62282 {
62283 };
62284 }
62285 }}
62286 namespace boost { namespace python {
62287 namespace detail
62288 {
62289 struct tuple_base : object
62290 {
62291 protected:
62292 tuple_base();
62293 tuple_base(object_cref sequence);
62294 inline explicit tuple_base(python::detail::borrowed_reference p) : object(p) {} inline explicit tuple_base(python::detail::new_reference p) : object(p) {} inline explicit tuple_base(python::detail::new_non_null_reference p) : object(p) {}
62295 private:
62296 static detail::new_reference call(object const&);
62297 };
62298 }
62299 class tuple : public detail::tuple_base
62300 {
62301 typedef detail::tuple_base base;
62302 public:
62303 tuple() {}
62304 template <class T>
62305 explicit tuple(T const& sequence)
62306 : base(object(sequence))
62307 {
62308 }
62309 public:
62310 inline explicit tuple(python::detail::borrowed_reference p) : base(p) {} inline explicit tuple(python::detail::new_reference p) : base(p) {} inline explicit tuple(python::detail::new_non_null_reference p) : base(p) {}
62311 };
62312 namespace converter
62313 {
62314 template <>
62315 struct object_manager_traits<tuple>
62316 : pytype_object_manager_traits<&PyTuple_Type,tuple>
62317 {
62318 };
62319 }
62320 inline tuple make_tuple() { return tuple(); }
62321 template < class A0>
62322 tuple
62323 make_tuple( A0 const& a0)
62324 {
62325 tuple result((detail::new_reference)::PyTuple_New(1));
62326 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr()));
62327 return result;
62328 }
62329 template < class A0 , class A1>
62330 tuple
62331 make_tuple( A0 const& a0 , A1 const& a1)
62332 {
62333 tuple result((detail::new_reference)::PyTuple_New(2));
62334 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr()));
62335 return result;
62336 }
62337 template < class A0 , class A1 , class A2>
62338 tuple
62339 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2)
62340 {
62341 tuple result((detail::new_reference)::PyTuple_New(3));
62342 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr()));
62343 return result;
62344 }
62345 template < class A0 , class A1 , class A2 , class A3>
62346 tuple
62347 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3)
62348 {
62349 tuple result((detail::new_reference)::PyTuple_New(4));
62350 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr()));
62351 return result;
62352 }
62353 template < class A0 , class A1 , class A2 , class A3 , class A4>
62354 tuple
62355 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4)
62356 {
62357 tuple result((detail::new_reference)::PyTuple_New(5));
62358 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr()));
62359 return result;
62360 }
62361 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
62362 tuple
62363 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5)
62364 {
62365 tuple result((detail::new_reference)::PyTuple_New(6));
62366 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr()));
62367 return result;
62368 }
62369 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
62370 tuple
62371 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6)
62372 {
62373 tuple result((detail::new_reference)::PyTuple_New(7));
62374 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr()));
62375 return result;
62376 }
62377 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
62378 tuple
62379 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7)
62380 {
62381 tuple result((detail::new_reference)::PyTuple_New(8));
62382 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr()));
62383 return result;
62384 }
62385 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
62386 tuple
62387 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8)
62388 {
62389 tuple result((detail::new_reference)::PyTuple_New(9));
62390 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr()));
62391 return result;
62392 }
62393 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
62394 tuple
62395 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9)
62396 {
62397 tuple result((detail::new_reference)::PyTuple_New(10));
62398 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[9] = python::incref(python::object(a9).ptr()));
62399 return result;
62400 }
62401 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
62402 tuple
62403 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10)
62404 {
62405 tuple result((detail::new_reference)::PyTuple_New(11));
62406 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[9] = python::incref(python::object(a9).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[10] = python::incref(python::object(a10).ptr()));
62407 return result;
62408 }
62409 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
62410 tuple
62411 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11)
62412 {
62413 tuple result((detail::new_reference)::PyTuple_New(12));
62414 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[9] = python::incref(python::object(a9).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[10] = python::incref(python::object(a10).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[11] = python::incref(python::object(a11).ptr()));
62415 return result;
62416 }
62417 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
62418 tuple
62419 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12)
62420 {
62421 tuple result((detail::new_reference)::PyTuple_New(13));
62422 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[9] = python::incref(python::object(a9).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[10] = python::incref(python::object(a10).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[11] = python::incref(python::object(a11).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[12] = python::incref(python::object(a12).ptr()));
62423 return result;
62424 }
62425 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
62426 tuple
62427 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13)
62428 {
62429 tuple result((detail::new_reference)::PyTuple_New(14));
62430 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[9] = python::incref(python::object(a9).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[10] = python::incref(python::object(a10).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[11] = python::incref(python::object(a11).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[12] = python::incref(python::object(a12).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[13] = python::incref(python::object(a13).ptr()));
62431 return result;
62432 }
62433 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
62434 tuple
62435 make_tuple( A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 , A10 const& a10 , A11 const& a11 , A12 const& a12 , A13 const& a13 , A14 const& a14)
62436 {
62437 tuple result((detail::new_reference)::PyTuple_New(15));
62438 (((PyTupleObject *)(result.ptr()))->ob_item[0] = python::incref(python::object(a0).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[1] = python::incref(python::object(a1).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[2] = python::incref(python::object(a2).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[3] = python::incref(python::object(a3).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[4] = python::incref(python::object(a4).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[5] = python::incref(python::object(a5).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[6] = python::incref(python::object(a6).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[7] = python::incref(python::object(a7).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[8] = python::incref(python::object(a8).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[9] = python::incref(python::object(a9).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[10] = python::incref(python::object(a10).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[11] = python::incref(python::object(a11).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[12] = python::incref(python::object(a12).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[13] = python::incref(python::object(a13).ptr())); (((PyTupleObject *)(result.ptr()))->ob_item[14] = python::incref(python::object(a14).ptr()));
62439 return result;
62440 }
62441 }}
62442 namespace boost { namespace python {
62443 class dict;
62444 namespace detail
62445 {
62446 struct dict_base : object
62447 {
62448 void clear();
62449 dict copy();
62450 object get(object_cref k) const;
62451 object get(object_cref k, object_cref d) const;
62452 bool has_key(object_cref k) const;
62453 list items() const;
62454 object iteritems() const;
62455 object iterkeys() const;
62456 object itervalues() const;
62457 list keys() const;
62458 tuple popitem();
62459 object setdefault(object_cref k);
62460 object setdefault(object_cref k, object_cref d);
62461 void update(object_cref E);
62462 list values() const;
62463 protected:
62464 dict_base();
62465 explicit dict_base(object_cref data);
62466 inline explicit dict_base(python::detail::borrowed_reference p) : object(p) {} inline explicit dict_base(python::detail::new_reference p) : object(p) {} inline explicit dict_base(python::detail::new_non_null_reference p) : object(p) {}
62467 private:
62468 static detail::new_reference call(object const&);
62469 };
62470 }
62471 class dict : public detail::dict_base
62472 {
62473 typedef detail::dict_base base;
62474 public:
62475 dict() {}
62476 template <class T>
62477 explicit dict(T const& data)
62478 : base(object(data))
62479 {
62480 }
62481 template<class T>
62482 object get(T const& k) const
62483 {
62484 return base::get(object(k));
62485 }
62486 template<class T1, class T2>
62487 object get(T1 const& k, T2 const& d) const
62488 {
62489 return base::get(object(k),object(d));
62490 }
62491 template<class T>
62492 bool has_key(T const& k) const
62493 {
62494 return base::has_key(object(k));
62495 }
62496 template<class T>
62497 object setdefault(T const& k)
62498 {
62499 return base::setdefault(object(k));
62500 }
62501 template<class T1, class T2>
62502 object setdefault(T1 const& k, T2 const& d)
62503 {
62504 return base::setdefault(object(k),object(d));
62505 }
62506 template<class T>
62507 void update(T const& E)
62508 {
62509 base::update(object(E));
62510 }
62511 public:
62512 inline explicit dict(python::detail::borrowed_reference p) : base(p) {} inline explicit dict(python::detail::new_reference p) : base(p) {} inline explicit dict(python::detail::new_non_null_reference p) : base(p) {}
62513 };
62514 namespace converter
62515 {
62516 template <>
62517 struct object_manager_traits<dict>
62518 : pytype_object_manager_traits<&PyDict_Type,dict>
62519 {
62520 };
62521 }
62522 }}
62523 namespace boost { namespace python { namespace objects {
62524 struct function : PyObject
62525 {
62526 function(
62527 py_function const&
62528 , python::detail::keyword const* names_and_defaults
62529 , unsigned num_keywords);
62530 ~function();
62531 PyObject* call(PyObject*, PyObject*) const;
62532 static void add_to_namespace(
62533 object const& name_space, char const* name, object const& attribute);
62534 static void add_to_namespace(
62535 object const& name_space, char const* name, object const& attribute, char const* doc);
62536 object const& doc() const;
62537 void doc(object const& x);
62538 object const& name() const;
62539 private:
62540 object signature(bool show_return_type=false) const;
62541 object signatures(bool show_return_type=false) const;
62542 void argument_error(PyObject* args, PyObject* keywords) const;
62543 void add_overload(handle<function> const&);
62544 private:
62545 py_function m_fn;
62546 handle<function> m_overloads;
62547 object m_name;
62548 object m_namespace;
62549 object m_doc;
62550 object m_arg_names;
62551 unsigned m_nkeyword_values;
62552 friend class function_doc_signature_generator;
62553 };
62554 inline object const& function::doc() const
62555 {
62556 return this->m_doc;
62557 }
62558 inline void function::doc(object const& x)
62559 {
62560 this->m_doc = x;
62561 }
62562 inline object const& function::name() const
62563 {
62564 return this->m_name;
62565 }
62566 }}}
62567 namespace boost { namespace python {
62568 class docstring_options : boost::noncopyable
62569 {
62570 public:
62571 docstring_options(bool show_all=true)
62572 {
62573 previous_show_user_defined_ = show_user_defined_;
62574 previous_show_py_signatures_ = show_py_signatures_;
62575 previous_show_cpp_signatures_ = show_cpp_signatures_;
62576 show_user_defined_ = show_all;
62577 show_cpp_signatures_ = show_all;
62578 show_py_signatures_ = show_all;
62579 }
62580 docstring_options(bool show_user_defined, bool show_signatures)
62581 {
62582 previous_show_user_defined_ = show_user_defined_;
62583 previous_show_cpp_signatures_ = show_cpp_signatures_;
62584 previous_show_py_signatures_ = show_py_signatures_;
62585 show_user_defined_ = show_user_defined;
62586 show_cpp_signatures_ = show_signatures;
62587 show_py_signatures_ = show_signatures;
62588 }
62589 docstring_options(bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures)
62590 {
62591 previous_show_user_defined_ = show_user_defined_;
62592 previous_show_cpp_signatures_ = show_cpp_signatures_;
62593 previous_show_py_signatures_ = show_py_signatures_;
62594 show_user_defined_ = show_user_defined;
62595 show_cpp_signatures_ = show_cpp_signatures;
62596 show_py_signatures_ = show_py_signatures;
62597 }
62598 ~docstring_options()
62599 {
62600 show_user_defined_ = previous_show_user_defined_;
62601 show_cpp_signatures_ = previous_show_cpp_signatures_;
62602 show_py_signatures_ = previous_show_py_signatures_;
62603 }
62604 void
62605 disable_user_defined() { show_user_defined_ = false; }
62606 void
62607 enable_user_defined() { show_user_defined_ = true; }
62608 void
62609 disable_py_signatures()
62610 {
62611 show_py_signatures_ = false;
62612 }
62613 void
62614 enable_py_signatures()
62615 {
62616 show_py_signatures_ = true;
62617 }
62618 void
62619 disable_cpp_signatures()
62620 {
62621 show_cpp_signatures_ = false;
62622 }
62623 void
62624 enable_cpp_signatures()
62625 {
62626 show_cpp_signatures_ = true;
62627 }
62628 void
62629 disable_signatures()
62630 {
62631 show_cpp_signatures_ = false;
62632 show_py_signatures_ = false;
62633 }
62634 void
62635 enable_signatures()
62636 {
62637 show_cpp_signatures_ = true;
62638 show_py_signatures_ = true;
62639 }
62640 void
62641 disable_all()
62642 {
62643 show_user_defined_ = false;
62644 show_cpp_signatures_ = false;
62645 show_py_signatures_ = false;
62646 }
62647 void
62648 enable_all()
62649 {
62650 show_user_defined_ = true;
62651 show_cpp_signatures_ = true;
62652 show_py_signatures_ = true;
62653 }
62654 friend struct objects::function;
62655 private:
62656 static volatile bool show_user_defined_;
62657 static volatile bool show_cpp_signatures_;
62658 static volatile bool show_py_signatures_;
62659 bool previous_show_user_defined_;
62660 bool previous_show_cpp_signatures_;
62661 bool previous_show_py_signatures_;
62662 };
62663 }}
62664 namespace boost { namespace python { namespace objects {
62665 struct enum_base : python::api::object
62666 {
62667 protected:
62668 enum_base(
62669 char const* name
62670 , converter::to_python_function_t
62671 , converter::convertible_function
62672 , converter::constructor_function
62673 , type_info
62674 , const char *doc = 0
62675 );
62676 void add_value(char const* name, long value);
62677 void export_values();
62678 static PyObject* to_python(PyTypeObject* type, long x);
62679 };
62680 }}}
62681 namespace boost { namespace python {
62682 template <class T>
62683 struct enum_ : public objects::enum_base
62684 {
62685 typedef objects::enum_base base;
62686 enum_(char const* name, char const* doc = 0);
62687 inline enum_<T>& value(char const* name, T);
62688 inline enum_<T>& export_values();
62689 private:
62690 static PyObject* to_python(void const* x);
62691 static void* convertible_from_python(PyObject* obj);
62692 static void construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data);
62693 };
62694 template <class T>
62695 inline enum_<T>::enum_(char const* name, char const* doc )
62696 : base(
62697 name
62698 , &enum_<T>::to_python
62699 , &enum_<T>::convertible_from_python
62700 , &enum_<T>::construct
62701 , type_id<T>()
62702 , doc
62703 )
62704 {
62705 }
62706 template <class T>
62707 PyObject* enum_<T>::to_python(void const* x)
62708 {
62709 return base::to_python(
62710 converter::registered<T>::converters.m_class_object
62711 , static_cast<long>(*(T const*)x));
62712 }
62713 template <class T>
62714 void* enum_<T>::convertible_from_python(PyObject* obj)
62715 {
62716 return PyObject_IsInstance(
62717 obj
62718 , upcast<PyObject>(
62719 converter::registered<T>::converters.m_class_object))
62720 ? obj : 0;
62721 }
62722 template <class T>
62723 void enum_<T>::construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data)
62724 {
62725 T x = static_cast<T>((((PyIntObject *)(obj))->ob_ival));
62726 void* const storage = ((converter::rvalue_from_python_storage<T>*)data)->storage.bytes;
62727 new (storage) T(x);
62728 data->convertible = storage;
62729 }
62730 template <class T>
62731 inline enum_<T>& enum_<T>::value(char const* name, T x)
62732 {
62733 this->add_value(name, static_cast<long>(x));
62734 return *this;
62735 }
62736 template <class T>
62737 inline enum_<T>& enum_<T>::export_values()
62738 {
62739 this->base::export_values();
62740 return *this;
62741 }
62742 }}
62743 namespace boost
62744 {
62745 template< class T > struct is_placeholder
62746 {
62747 enum _vt { value = 0 };
62748 };
62749 }
62750 namespace boost
62751 {
62752 template< int I > struct arg
62753 {
62754 arg()
62755 {
62756 }
62757 template< class T > arg( T const & )
62758 {
62759 typedef char T_must_be_placeholder[ I == is_placeholder<T>::value? 1: -1 ];
62760 }
62761 };
62762 template< int I > bool operator==( arg<I> const &, arg<I> const & )
62763 {
62764 return true;
62765 }
62766 template< int I > struct is_placeholder< arg<I> >
62767 {
62768 enum _vt { value = I };
62769 };
62770 template< int I > struct is_placeholder< arg<I> (*) () >
62771 {
62772 enum _vt { value = I };
62773 };
62774 }
62775 namespace boost {
62776 template<typename Visitor, typename T>
62777 inline void visit_each(Visitor& visitor, const T& t, long)
62778 {
62779 visitor(t);
62780 }
62781 template<typename Visitor, typename T>
62782 inline void visit_each(Visitor& visitor, const T& t)
62783 {
62784 visit_each(visitor, t, 0);
62785 }
62786 }
62787 namespace boost
62788 {
62789 namespace _bi
62790 {
62791 template<class A1> struct storage1
62792 {
62793 explicit storage1( A1 a1 ): a1_( a1 ) {}
62794 template<class V> void accept(V & v) const
62795 {
62796 visit_each(v, a1_, 0);
62797 }
62798 A1 a1_;
62799 };
62800 template<int I> struct storage1< boost::arg<I> >
62801 {
62802 explicit storage1( boost::arg<I> ) {}
62803 template<class V> void accept(V &) const { }
62804 static boost::arg<I> a1_() { return boost::arg<I>(); }
62805 };
62806 template<int I> struct storage1< boost::arg<I> (*) () >
62807 {
62808 explicit storage1( boost::arg<I> (*) () ) {}
62809 template<class V> void accept(V &) const { }
62810 static boost::arg<I> a1_() { return boost::arg<I>(); }
62811 };
62812 template<class A1, class A2> struct storage2: public storage1<A1>
62813 {
62814 typedef storage1<A1> inherited;
62815 storage2( A1 a1, A2 a2 ): storage1<A1>( a1 ), a2_( a2 ) {}
62816 template<class V> void accept(V & v) const
62817 {
62818 inherited::accept(v);
62819 visit_each(v, a2_, 0);
62820 }
62821 A2 a2_;
62822 };
62823 template<class A1, int I> struct storage2< A1, boost::arg<I> >: public storage1<A1>
62824 {
62825 typedef storage1<A1> inherited;
62826 storage2( A1 a1, boost::arg<I> ): storage1<A1>( a1 ) {}
62827 template<class V> void accept(V & v) const
62828 {
62829 inherited::accept(v);
62830 }
62831 static boost::arg<I> a2_() { return boost::arg<I>(); }
62832 };
62833 template<class A1, int I> struct storage2< A1, boost::arg<I> (*) () >: public storage1<A1>
62834 {
62835 typedef storage1<A1> inherited;
62836 storage2( A1 a1, boost::arg<I> (*) () ): storage1<A1>( a1 ) {}
62837 template<class V> void accept(V & v) const
62838 {
62839 inherited::accept(v);
62840 }
62841 static boost::arg<I> a2_() { return boost::arg<I>(); }
62842 };
62843 template<class A1, class A2, class A3> struct storage3: public storage2< A1, A2 >
62844 {
62845 typedef storage2<A1, A2> inherited;
62846 storage3( A1 a1, A2 a2, A3 a3 ): storage2<A1, A2>( a1, a2 ), a3_( a3 ) {}
62847 template<class V> void accept(V & v) const
62848 {
62849 inherited::accept(v);
62850 visit_each(v, a3_, 0);
62851 }
62852 A3 a3_;
62853 };
62854 template<class A1, class A2, int I> struct storage3< A1, A2, boost::arg<I> >: public storage2< A1, A2 >
62855 {
62856 typedef storage2<A1, A2> inherited;
62857 storage3( A1 a1, A2 a2, boost::arg<I> ): storage2<A1, A2>( a1, a2 ) {}
62858 template<class V> void accept(V & v) const
62859 {
62860 inherited::accept(v);
62861 }
62862 static boost::arg<I> a3_() { return boost::arg<I>(); }
62863 };
62864 template<class A1, class A2, int I> struct storage3< A1, A2, boost::arg<I> (*) () >: public storage2< A1, A2 >
62865 {
62866 typedef storage2<A1, A2> inherited;
62867 storage3( A1 a1, A2 a2, boost::arg<I> (*) () ): storage2<A1, A2>( a1, a2 ) {}
62868 template<class V> void accept(V & v) const
62869 {
62870 inherited::accept(v);
62871 }
62872 static boost::arg<I> a3_() { return boost::arg<I>(); }
62873 };
62874 template<class A1, class A2, class A3, class A4> struct storage4: public storage3< A1, A2, A3 >
62875 {
62876 typedef storage3<A1, A2, A3> inherited;
62877 storage4( A1 a1, A2 a2, A3 a3, A4 a4 ): storage3<A1, A2, A3>( a1, a2, a3 ), a4_( a4 ) {}
62878 template<class V> void accept(V & v) const
62879 {
62880 inherited::accept(v);
62881 visit_each(v, a4_, 0);
62882 }
62883 A4 a4_;
62884 };
62885 template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, boost::arg<I> >: public storage3< A1, A2, A3 >
62886 {
62887 typedef storage3<A1, A2, A3> inherited;
62888 storage4( A1 a1, A2 a2, A3 a3, boost::arg<I> ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
62889 template<class V> void accept(V & v) const
62890 {
62891 inherited::accept(v);
62892 }
62893 static boost::arg<I> a4_() { return boost::arg<I>(); }
62894 };
62895 template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, boost::arg<I> (*) () >: public storage3< A1, A2, A3 >
62896 {
62897 typedef storage3<A1, A2, A3> inherited;
62898 storage4( A1 a1, A2 a2, A3 a3, boost::arg<I> (*) () ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
62899 template<class V> void accept(V & v) const
62900 {
62901 inherited::accept(v);
62902 }
62903 static boost::arg<I> a4_() { return boost::arg<I>(); }
62904 };
62905 template<class A1, class A2, class A3, class A4, class A5> struct storage5: public storage4< A1, A2, A3, A4 >
62906 {
62907 typedef storage4<A1, A2, A3, A4> inherited;
62908 storage5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ), a5_( a5 ) {}
62909 template<class V> void accept(V & v) const
62910 {
62911 inherited::accept(v);
62912 visit_each(v, a5_, 0);
62913 }
62914 A5 a5_;
62915 };
62916 template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, boost::arg<I> >: public storage4< A1, A2, A3, A4 >
62917 {
62918 typedef storage4<A1, A2, A3, A4> inherited;
62919 storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg<I> ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
62920 template<class V> void accept(V & v) const
62921 {
62922 inherited::accept(v);
62923 }
62924 static boost::arg<I> a5_() { return boost::arg<I>(); }
62925 };
62926 template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, boost::arg<I> (*) () >: public storage4< A1, A2, A3, A4 >
62927 {
62928 typedef storage4<A1, A2, A3, A4> inherited;
62929 storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg<I> (*) () ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
62930 template<class V> void accept(V & v) const
62931 {
62932 inherited::accept(v);
62933 }
62934 static boost::arg<I> a5_() { return boost::arg<I>(); }
62935 };
62936 template<class A1, class A2, class A3, class A4, class A5, class A6> struct storage6: public storage5< A1, A2, A3, A4, A5 >
62937 {
62938 typedef storage5<A1, A2, A3, A4, A5> inherited;
62939 storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ), a6_( a6 ) {}
62940 template<class V> void accept(V & v) const
62941 {
62942 inherited::accept(v);
62943 visit_each(v, a6_, 0);
62944 }
62945 A6 a6_;
62946 };
62947 template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, boost::arg<I> >: public storage5< A1, A2, A3, A4, A5 >
62948 {
62949 typedef storage5<A1, A2, A3, A4, A5> inherited;
62950 storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg<I> ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
62951 template<class V> void accept(V & v) const
62952 {
62953 inherited::accept(v);
62954 }
62955 static boost::arg<I> a6_() { return boost::arg<I>(); }
62956 };
62957 template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, boost::arg<I> (*) () >: public storage5< A1, A2, A3, A4, A5 >
62958 {
62959 typedef storage5<A1, A2, A3, A4, A5> inherited;
62960 storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg<I> (*) () ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
62961 template<class V> void accept(V & v) const
62962 {
62963 inherited::accept(v);
62964 }
62965 static boost::arg<I> a6_() { return boost::arg<I>(); }
62966 };
62967 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct storage7: public storage6< A1, A2, A3, A4, A5, A6 >
62968 {
62969 typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
62970 storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ), a7_( a7 ) {}
62971 template<class V> void accept(V & v) const
62972 {
62973 inherited::accept(v);
62974 visit_each(v, a7_, 0);
62975 }
62976 A7 a7_;
62977 };
62978 template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, boost::arg<I> >: public storage6< A1, A2, A3, A4, A5, A6 >
62979 {
62980 typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
62981 storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg<I> ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
62982 template<class V> void accept(V & v) const
62983 {
62984 inherited::accept(v);
62985 }
62986 static boost::arg<I> a7_() { return boost::arg<I>(); }
62987 };
62988 template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, boost::arg<I> (*) () >: public storage6< A1, A2, A3, A4, A5, A6 >
62989 {
62990 typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
62991 storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg<I> (*) () ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
62992 template<class V> void accept(V & v) const
62993 {
62994 inherited::accept(v);
62995 }
62996 static boost::arg<I> a7_() { return boost::arg<I>(); }
62997 };
62998 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct storage8: public storage7< A1, A2, A3, A4, A5, A6, A7 >
62999 {
63000 typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
63001 storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ), a8_( a8 ) {}
63002 template<class V> void accept(V & v) const
63003 {
63004 inherited::accept(v);
63005 visit_each(v, a8_, 0);
63006 }
63007 A8 a8_;
63008 };
63009 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg<I> >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
63010 {
63011 typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
63012 storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg<I> ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
63013 template<class V> void accept(V & v) const
63014 {
63015 inherited::accept(v);
63016 }
63017 static boost::arg<I> a8_() { return boost::arg<I>(); }
63018 };
63019 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg<I> (*) () >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
63020 {
63021 typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
63022 storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg<I> (*) () ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
63023 template<class V> void accept(V & v) const
63024 {
63025 inherited::accept(v);
63026 }
63027 static boost::arg<I> a8_() { return boost::arg<I>(); }
63028 };
63029 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct storage9: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
63030 {
63031 typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
63032 storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ), a9_( a9 ) {}
63033 template<class V> void accept(V & v) const
63034 {
63035 inherited::accept(v);
63036 visit_each(v, a9_, 0);
63037 }
63038 A9 a9_;
63039 };
63040 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg<I> >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
63041 {
63042 typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
63043 storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg<I> ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
63044 template<class V> void accept(V & v) const
63045 {
63046 inherited::accept(v);
63047 }
63048 static boost::arg<I> a9_() { return boost::arg<I>(); }
63049 };
63050 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg<I> (*) () >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
63051 {
63052 typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
63053 storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg<I> (*) () ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
63054 template<class V> void accept(V & v) const
63055 {
63056 inherited::accept(v);
63057 }
63058 static boost::arg<I> a9_() { return boost::arg<I>(); }
63059 };
63060 }
63061 }
63062 namespace boost
63063 {
63064 template<class T> class weak_ptr;
63065 namespace _bi
63066 {
63067 template<class R, class F> struct result_traits
63068 {
63069 typedef R type;
63070 };
63071 struct unspecified {};
63072 template<class F> struct result_traits<unspecified, F>
63073 {
63074 typedef typename F::result_type type;
63075 };
63076 template<class F> struct result_traits< unspecified, reference_wrapper<F> >
63077 {
63078 typedef typename F::result_type type;
63079 };
63080 template<class T> bool ref_compare( T const & a, T const & b, long )
63081 {
63082 return a == b;
63083 }
63084 template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
63085 {
63086 return true;
63087 }
63088 template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
63089 {
63090 return true;
63091 }
63092 template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
63093 {
63094 return a.get_pointer() == b.get_pointer();
63095 }
63096 template<class R, class F, class L> class bind_t;
63097 template<class R, class F, class L> bool ref_compare( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
63098 {
63099 return a.compare( b );
63100 }
63101 template<class T> class value
63102 {
63103 public:
63104 value(T const & t): t_(t) {}
63105 T & get() { return t_; }
63106 T const & get() const { return t_; }
63107 bool operator==(value const & rhs) const
63108 {
63109 return t_ == rhs.t_;
63110 }
63111 private:
63112 T t_;
63113 };
63114 template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b, int )
63115 {
63116 return !(a.get() < b.get()) && !(b.get() < a.get());
63117 }
63118 template<class T> class type {};
63119 template<class F> struct unwrapper
63120 {
63121 static inline F & unwrap( F & f, long )
63122 {
63123 return f;
63124 }
63125 template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
63126 {
63127 return rf.get();
63128 }
63129 template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
63130 {
63131 return _mfi::dm<R, T>( pm );
63132 }
63133 };
63134 class list0
63135 {
63136 public:
63137 list0() {}
63138 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63139 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63140 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63141 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63142 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63143 template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
63144 {
63145 return unwrapper<F>::unwrap(f, 0)();
63146 }
63147 template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
63148 {
63149 return unwrapper<F const>::unwrap(f, 0)();
63150 }
63151 template<class F, class A> void operator()(type<void>, F & f, A &, int)
63152 {
63153 unwrapper<F>::unwrap(f, 0)();
63154 }
63155 template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
63156 {
63157 unwrapper<F const>::unwrap(f, 0)();
63158 }
63159 template<class V> void accept(V &) const
63160 {
63161 }
63162 bool operator==(list0 const &) const
63163 {
63164 return true;
63165 }
63166 };
63167 template< class A1 > class list1: private storage1< A1 >
63168 {
63169 private:
63170 typedef storage1< A1 > base_type;
63171 public:
63172 explicit list1( A1 a1 ): base_type( a1 ) {}
63173 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63174 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63175 template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
63176 template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
63177 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63178 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63179 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63180 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63181 {
63182 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
63183 }
63184 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63185 {
63186 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
63187 }
63188 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63189 {
63190 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
63191 }
63192 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63193 {
63194 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
63195 }
63196 template<class V> void accept(V & v) const
63197 {
63198 base_type::accept(v);
63199 }
63200 bool operator==(list1 const & rhs) const
63201 {
63202 return ref_compare(base_type::a1_, rhs.a1_, 0);
63203 }
63204 };
63205 struct logical_and;
63206 struct logical_or;
63207 template< class A1, class A2 > class list2: private storage2< A1, A2 >
63208 {
63209 private:
63210 typedef storage2< A1, A2 > base_type;
63211 public:
63212 list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
63213 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63214 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63215 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63216 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63217 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63218 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63219 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63220 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63221 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63222 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63223 {
63224 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
63225 }
63226 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63227 {
63228 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
63229 }
63230 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63231 {
63232 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
63233 }
63234 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63235 {
63236 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
63237 }
63238 template<class A> bool operator()( type<bool>, logical_and & , A & a, int )
63239 {
63240 return a[ base_type::a1_ ] && a[ base_type::a2_ ];
63241 }
63242 template<class A> bool operator()( type<bool>, logical_and const & , A & a, int ) const
63243 {
63244 return a[ base_type::a1_ ] && a[ base_type::a2_ ];
63245 }
63246 template<class A> bool operator()( type<bool>, logical_or & , A & a, int )
63247 {
63248 return a[ base_type::a1_ ] || a[ base_type::a2_ ];
63249 }
63250 template<class A> bool operator()( type<bool>, logical_or const & , A & a, int ) const
63251 {
63252 return a[ base_type::a1_ ] || a[ base_type::a2_ ];
63253 }
63254 template<class V> void accept(V & v) const
63255 {
63256 base_type::accept(v);
63257 }
63258 bool operator==(list2 const & rhs) const
63259 {
63260 return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
63261 }
63262 };
63263 template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
63264 {
63265 private:
63266 typedef storage3< A1, A2, A3 > base_type;
63267 public:
63268 list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
63269 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63270 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63271 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63272 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63273 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63274 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63275 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63276 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63277 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63278 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63279 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63280 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63281 {
63282 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
63283 }
63284 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63285 {
63286 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
63287 }
63288 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63289 {
63290 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
63291 }
63292 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63293 {
63294 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
63295 }
63296 template<class V> void accept(V & v) const
63297 {
63298 base_type::accept(v);
63299 }
63300 bool operator==(list3 const & rhs) const
63301 {
63302 return
63303 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63304 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63305 ref_compare( base_type::a3_, rhs.a3_, 0 );
63306 }
63307 };
63308 template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
63309 {
63310 private:
63311 typedef storage4< A1, A2, A3, A4 > base_type;
63312 public:
63313 list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
63314 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63315 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63316 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63317 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
63318 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63319 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63320 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63321 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
63322 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63323 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63324 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63325 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63326 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63327 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63328 {
63329 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
63330 }
63331 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63332 {
63333 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
63334 }
63335 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63336 {
63337 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
63338 }
63339 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63340 {
63341 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
63342 }
63343 template<class V> void accept(V & v) const
63344 {
63345 base_type::accept(v);
63346 }
63347 bool operator==(list4 const & rhs) const
63348 {
63349 return
63350 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63351 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63352 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
63353 ref_compare( base_type::a4_, rhs.a4_, 0 );
63354 }
63355 };
63356 template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
63357 {
63358 private:
63359 typedef storage5< A1, A2, A3, A4, A5 > base_type;
63360 public:
63361 list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
63362 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63363 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63364 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63365 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
63366 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
63367 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63368 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63369 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63370 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
63371 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
63372 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63373 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63374 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63375 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63376 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63377 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63378 {
63379 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
63380 }
63381 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63382 {
63383 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
63384 }
63385 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63386 {
63387 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
63388 }
63389 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63390 {
63391 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
63392 }
63393 template<class V> void accept(V & v) const
63394 {
63395 base_type::accept(v);
63396 }
63397 bool operator==(list5 const & rhs) const
63398 {
63399 return
63400 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63401 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63402 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
63403 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
63404 ref_compare( base_type::a5_, rhs.a5_, 0 );
63405 }
63406 };
63407 template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
63408 {
63409 private:
63410 typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
63411 public:
63412 list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
63413 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63414 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63415 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63416 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
63417 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
63418 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
63419 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63420 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63421 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63422 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
63423 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
63424 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
63425 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63426 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63427 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63428 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63429 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63430 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63431 {
63432 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
63433 }
63434 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63435 {
63436 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
63437 }
63438 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63439 {
63440 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
63441 }
63442 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63443 {
63444 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
63445 }
63446 template<class V> void accept(V & v) const
63447 {
63448 base_type::accept(v);
63449 }
63450 bool operator==(list6 const & rhs) const
63451 {
63452 return
63453 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63454 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63455 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
63456 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
63457 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
63458 ref_compare( base_type::a6_, rhs.a6_, 0 );
63459 }
63460 };
63461 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 >
63462 {
63463 private:
63464 typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
63465 public:
63466 list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
63467 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63468 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63469 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63470 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
63471 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
63472 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
63473 A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
63474 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63475 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63476 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63477 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
63478 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
63479 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
63480 A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
63481 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63482 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63483 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63484 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63485 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63486 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63487 {
63488 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
63489 }
63490 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63491 {
63492 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
63493 }
63494 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63495 {
63496 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
63497 }
63498 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63499 {
63500 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
63501 }
63502 template<class V> void accept(V & v) const
63503 {
63504 base_type::accept(v);
63505 }
63506 bool operator==(list7 const & rhs) const
63507 {
63508 return
63509 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63510 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63511 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
63512 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
63513 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
63514 ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
63515 ref_compare( base_type::a7_, rhs.a7_, 0 );
63516 }
63517 };
63518 template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
63519 {
63520 private:
63521 typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
63522 public:
63523 list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
63524 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63525 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63526 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63527 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
63528 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
63529 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
63530 A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
63531 A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
63532 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63533 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63534 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63535 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
63536 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
63537 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
63538 A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
63539 A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
63540 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63541 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63542 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63543 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63544 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63545 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63546 {
63547 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
63548 }
63549 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63550 {
63551 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
63552 }
63553 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63554 {
63555 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
63556 }
63557 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63558 {
63559 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
63560 }
63561 template<class V> void accept(V & v) const
63562 {
63563 base_type::accept(v);
63564 }
63565 bool operator==(list8 const & rhs) const
63566 {
63567 return
63568 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63569 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63570 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
63571 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
63572 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
63573 ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
63574 ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
63575 ref_compare( base_type::a8_, rhs.a8_, 0 );
63576 }
63577 };
63578 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9: private storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 >
63579 {
63580 private:
63581 typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
63582 public:
63583 list9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) {}
63584 A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
63585 A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
63586 A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
63587 A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
63588 A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
63589 A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
63590 A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
63591 A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
63592 A9 operator[] (boost::arg<9>) const { return base_type::a9_; }
63593 A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
63594 A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
63595 A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
63596 A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
63597 A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
63598 A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
63599 A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
63600 A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
63601 A9 operator[] (boost::arg<9> (*) ()) const { return base_type::a9_; }
63602 template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
63603 template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
63604 template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
63605 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
63606 template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
63607 template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
63608 {
63609 return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
63610 }
63611 template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
63612 {
63613 return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
63614 }
63615 template<class F, class A> void operator()(type<void>, F & f, A & a, int)
63616 {
63617 unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
63618 }
63619 template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
63620 {
63621 unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
63622 }
63623 template<class V> void accept(V & v) const
63624 {
63625 base_type::accept(v);
63626 }
63627 bool operator==(list9 const & rhs) const
63628 {
63629 return
63630 ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
63631 ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
63632 ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
63633 ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
63634 ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
63635 ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
63636 ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
63637 ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
63638 ref_compare( base_type::a9_, rhs.a9_, 0 );
63639 }
63640 };
63641 template<class R, class F, class L> class bind_t
63642 {
63643 public:
63644 typedef bind_t this_type;
63645 bind_t(F f, L const & l): f_(f), l_(l) {}
63646 typedef typename result_traits<R, F>::type result_type;
63647 result_type operator()()
63648 {
63649 list0 a;
63650 return l_(type<result_type>(), f_, a, 0);
63651 }
63652 result_type operator()() const
63653 {
63654 list0 a;
63655 return l_(type<result_type>(), f_, a, 0);
63656 }
63657 template<class A1> result_type operator()(A1 & a1)
63658 {
63659 list1<A1 &> a(a1);
63660 return l_(type<result_type>(), f_, a, 0);
63661 }
63662 template<class A1> result_type operator()(A1 & a1) const
63663 {
63664 list1<A1 &> a(a1);
63665 return l_(type<result_type>(), f_, a, 0);
63666 }
63667 template<class A1> result_type operator()(A1 const & a1)
63668 {
63669 list1<A1 const &> a(a1);
63670 return l_(type<result_type>(), f_, a, 0);
63671 }
63672 template<class A1> result_type operator()(A1 const & a1) const
63673 {
63674 list1<A1 const &> a(a1);
63675 return l_(type<result_type>(), f_, a, 0);
63676 }
63677 template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
63678 {
63679 list2<A1 &, A2 &> a(a1, a2);
63680 return l_(type<result_type>(), f_, a, 0);
63681 }
63682 template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
63683 {
63684 list2<A1 &, A2 &> a(a1, a2);
63685 return l_(type<result_type>(), f_, a, 0);
63686 }
63687 template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
63688 {
63689 list2<A1 const &, A2 &> a(a1, a2);
63690 return l_(type<result_type>(), f_, a, 0);
63691 }
63692 template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
63693 {
63694 list2<A1 const &, A2 &> a(a1, a2);
63695 return l_(type<result_type>(), f_, a, 0);
63696 }
63697 template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
63698 {
63699 list2<A1 &, A2 const &> a(a1, a2);
63700 return l_(type<result_type>(), f_, a, 0);
63701 }
63702 template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
63703 {
63704 list2<A1 &, A2 const &> a(a1, a2);
63705 return l_(type<result_type>(), f_, a, 0);
63706 }
63707 template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
63708 {
63709 list2<A1 const &, A2 const &> a(a1, a2);
63710 return l_(type<result_type>(), f_, a, 0);
63711 }
63712 template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
63713 {
63714 list2<A1 const &, A2 const &> a(a1, a2);
63715 return l_(type<result_type>(), f_, a, 0);
63716 }
63717 template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
63718 {
63719 list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
63720 return l_(type<result_type>(), f_, a, 0);
63721 }
63722 template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
63723 {
63724 list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
63725 return l_(type<result_type>(), f_, a, 0);
63726 }
63727 template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3)
63728 {
63729 list3<A1 const &, A2 const &, A3 const &> a(a1, a2, a3);
63730 return l_(type<result_type>(), f_, a, 0);
63731 }
63732 template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const
63733 {
63734 list3<A1 const &, A2 const &, A3 const &> a(a1, a2, a3);
63735 return l_(type<result_type>(), f_, a, 0);
63736 }
63737 template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
63738 {
63739 list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
63740 return l_(type<result_type>(), f_, a, 0);
63741 }
63742 template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
63743 {
63744 list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
63745 return l_(type<result_type>(), f_, a, 0);
63746 }
63747 template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4)
63748 {
63749 list4<A1 const &, A2 const &, A3 const &, A4 const &> a(a1, a2, a3, a4);
63750 return l_(type<result_type>(), f_, a, 0);
63751 }
63752 template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const
63753 {
63754 list4<A1 const &, A2 const &, A3 const &, A4 const &> a(a1, a2, a3, a4);
63755 return l_(type<result_type>(), f_, a, 0);
63756 }
63757 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
63758 {
63759 list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
63760 return l_(type<result_type>(), f_, a, 0);
63761 }
63762 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
63763 {
63764 list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
63765 return l_(type<result_type>(), f_, a, 0);
63766 }
63767 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5)
63768 {
63769 list5<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &> a(a1, a2, a3, a4, a5);
63770 return l_(type<result_type>(), f_, a, 0);
63771 }
63772 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const
63773 {
63774 list5<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &> a(a1, a2, a3, a4, a5);
63775 return l_(type<result_type>(), f_, a, 0);
63776 }
63777 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
63778 {
63779 list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
63780 return l_(type<result_type>(), f_, a, 0);
63781 }
63782 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
63783 {
63784 list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
63785 return l_(type<result_type>(), f_, a, 0);
63786 }
63787 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6)
63788 {
63789 list6<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &> a(a1, a2, a3, a4, a5, a6);
63790 return l_(type<result_type>(), f_, a, 0);
63791 }
63792 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const
63793 {
63794 list6<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &> a(a1, a2, a3, a4, a5, a6);
63795 return l_(type<result_type>(), f_, a, 0);
63796 }
63797 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
63798 {
63799 list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
63800 return l_(type<result_type>(), f_, a, 0);
63801 }
63802 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
63803 {
63804 list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
63805 return l_(type<result_type>(), f_, a, 0);
63806 }
63807 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7)
63808 {
63809 list7<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &> a(a1, a2, a3, a4, a5, a6, a7);
63810 return l_(type<result_type>(), f_, a, 0);
63811 }
63812 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const
63813 {
63814 list7<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &> a(a1, a2, a3, a4, a5, a6, a7);
63815 return l_(type<result_type>(), f_, a, 0);
63816 }
63817 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
63818 {
63819 list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
63820 return l_(type<result_type>(), f_, a, 0);
63821 }
63822 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
63823 {
63824 list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
63825 return l_(type<result_type>(), f_, a, 0);
63826 }
63827 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8)
63828 {
63829 list8<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &> a(a1, a2, a3, a4, a5, a6, a7, a8);
63830 return l_(type<result_type>(), f_, a, 0);
63831 }
63832 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const
63833 {
63834 list8<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &> a(a1, a2, a3, a4, a5, a6, a7, a8);
63835 return l_(type<result_type>(), f_, a, 0);
63836 }
63837 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
63838 {
63839 list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
63840 return l_(type<result_type>(), f_, a, 0);
63841 }
63842 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
63843 {
63844 list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
63845 return l_(type<result_type>(), f_, a, 0);
63846 }
63847 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9)
63848 {
63849 list9<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &, A9 const &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
63850 return l_(type<result_type>(), f_, a, 0);
63851 }
63852 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const
63853 {
63854 list9<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &, A9 const &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
63855 return l_(type<result_type>(), f_, a, 0);
63856 }
63857 template<class A> result_type eval(A & a)
63858 {
63859 return l_(type<result_type>(), f_, a, 0);
63860 }
63861 template<class A> result_type eval(A & a) const
63862 {
63863 return l_(type<result_type>(), f_, a, 0);
63864 }
63865 template<class V> void accept(V & v) const
63866 {
63867 using boost::visit_each;
63868 visit_each(v, f_, 0);
63869 l_.accept(v);
63870 }
63871 bool compare(this_type const & rhs) const
63872 {
63873 return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_;
63874 }
63875 private:
63876 F f_;
63877 L l_;
63878 };
63879 template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
63880 {
63881 return a.compare(b);
63882 }
63883 template< class T, int I > struct add_value_2
63884 {
63885 typedef boost::arg<I> type;
63886 };
63887 template< class T > struct add_value_2< T, 0 >
63888 {
63889 typedef _bi::value< T > type;
63890 };
63891 template<class T> struct add_value
63892 {
63893 typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type;
63894 };
63895 template<class T> struct add_value< value<T> >
63896 {
63897 typedef _bi::value<T> type;
63898 };
63899 template<class T> struct add_value< reference_wrapper<T> >
63900 {
63901 typedef reference_wrapper<T> type;
63902 };
63903 template<int I> struct add_value< arg<I> >
63904 {
63905 typedef boost::arg<I> type;
63906 };
63907 template<int I> struct add_value< arg<I> (*) () >
63908 {
63909 typedef boost::arg<I> (*type) ();
63910 };
63911 template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
63912 {
63913 typedef bind_t<R, F, L> type;
63914 };
63915 template<class A1> struct list_av_1
63916 {
63917 typedef typename add_value<A1>::type B1;
63918 typedef list1<B1> type;
63919 };
63920 template<class A1, class A2> struct list_av_2
63921 {
63922 typedef typename add_value<A1>::type B1;
63923 typedef typename add_value<A2>::type B2;
63924 typedef list2<B1, B2> type;
63925 };
63926 template<class A1, class A2, class A3> struct list_av_3
63927 {
63928 typedef typename add_value<A1>::type B1;
63929 typedef typename add_value<A2>::type B2;
63930 typedef typename add_value<A3>::type B3;
63931 typedef list3<B1, B2, B3> type;
63932 };
63933 template<class A1, class A2, class A3, class A4> struct list_av_4
63934 {
63935 typedef typename add_value<A1>::type B1;
63936 typedef typename add_value<A2>::type B2;
63937 typedef typename add_value<A3>::type B3;
63938 typedef typename add_value<A4>::type B4;
63939 typedef list4<B1, B2, B3, B4> type;
63940 };
63941 template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
63942 {
63943 typedef typename add_value<A1>::type B1;
63944 typedef typename add_value<A2>::type B2;
63945 typedef typename add_value<A3>::type B3;
63946 typedef typename add_value<A4>::type B4;
63947 typedef typename add_value<A5>::type B5;
63948 typedef list5<B1, B2, B3, B4, B5> type;
63949 };
63950 template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
63951 {
63952 typedef typename add_value<A1>::type B1;
63953 typedef typename add_value<A2>::type B2;
63954 typedef typename add_value<A3>::type B3;
63955 typedef typename add_value<A4>::type B4;
63956 typedef typename add_value<A5>::type B5;
63957 typedef typename add_value<A6>::type B6;
63958 typedef list6<B1, B2, B3, B4, B5, B6> type;
63959 };
63960 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
63961 {
63962 typedef typename add_value<A1>::type B1;
63963 typedef typename add_value<A2>::type B2;
63964 typedef typename add_value<A3>::type B3;
63965 typedef typename add_value<A4>::type B4;
63966 typedef typename add_value<A5>::type B5;
63967 typedef typename add_value<A6>::type B6;
63968 typedef typename add_value<A7>::type B7;
63969 typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
63970 };
63971 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
63972 {
63973 typedef typename add_value<A1>::type B1;
63974 typedef typename add_value<A2>::type B2;
63975 typedef typename add_value<A3>::type B3;
63976 typedef typename add_value<A4>::type B4;
63977 typedef typename add_value<A5>::type B5;
63978 typedef typename add_value<A6>::type B6;
63979 typedef typename add_value<A7>::type B7;
63980 typedef typename add_value<A8>::type B8;
63981 typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
63982 };
63983 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
63984 {
63985 typedef typename add_value<A1>::type B1;
63986 typedef typename add_value<A2>::type B2;
63987 typedef typename add_value<A3>::type B3;
63988 typedef typename add_value<A4>::type B4;
63989 typedef typename add_value<A5>::type B5;
63990 typedef typename add_value<A6>::type B6;
63991 typedef typename add_value<A7>::type B7;
63992 typedef typename add_value<A8>::type B8;
63993 typedef typename add_value<A9>::type B9;
63994 typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
63995 };
63996 struct logical_not
63997 {
63998 template<class V> bool operator()(V const & v) const { return !v; }
63999 };
64000 template<class R, class F, class L>
64001 bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
64002 operator! (bind_t<R, F, L> const & f)
64003 {
64004 typedef list1< bind_t<R, F, L> > list_type;
64005 return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
64006 }
64007 struct equal { template<class V, class W> bool operator()(V const & v, W const & w) const { return v == w; } }; template<class R, class F, class L, class A2> bind_t< bool, equal, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator == (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, equal, list_type> ( equal(), list_type(f, a2) ); }
64008 struct not_equal { template<class V, class W> bool operator()(V const & v, W const & w) const { return v != w; } }; template<class R, class F, class L, class A2> bind_t< bool, not_equal, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator != (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, not_equal, list_type> ( not_equal(), list_type(f, a2) ); }
64009 struct less { template<class V, class W> bool operator()(V const & v, W const & w) const { return v < w; } }; template<class R, class F, class L, class A2> bind_t< bool, less, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator < (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, less, list_type> ( less(), list_type(f, a2) ); }
64010 struct less_equal { template<class V, class W> bool operator()(V const & v, W const & w) const { return v <= w; } }; template<class R, class F, class L, class A2> bind_t< bool, less_equal, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator <= (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, less_equal, list_type> ( less_equal(), list_type(f, a2) ); }
64011 struct greater { template<class V, class W> bool operator()(V const & v, W const & w) const { return v > w; } }; template<class R, class F, class L, class A2> bind_t< bool, greater, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator > (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, greater, list_type> ( greater(), list_type(f, a2) ); }
64012 struct greater_equal { template<class V, class W> bool operator()(V const & v, W const & w) const { return v >= w; } }; template<class R, class F, class L, class A2> bind_t< bool, greater_equal, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator >= (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, greater_equal, list_type> ( greater_equal(), list_type(f, a2) ); }
64013 struct logical_and { template<class V, class W> bool operator()(V const & v, W const & w) const { return v && w; } }; template<class R, class F, class L, class A2> bind_t< bool, logical_and, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator && (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, logical_and, list_type> ( logical_and(), list_type(f, a2) ); }
64014 struct logical_or { template<class V, class W> bool operator()(V const & v, W const & w) const { return v || w; } }; template<class R, class F, class L, class A2> bind_t< bool, logical_or, list2< bind_t<R, F, L>, typename add_value<A2>::type > > operator || (bind_t<R, F, L> const & f, A2 a2) { typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F, L>, B2> list_type; return bind_t<bool, logical_or, list_type> ( logical_or(), list_type(f, a2) ); }
64015 template<class V, class T> void visit_each( V & v, value<T> const & t, int )
64016 {
64017 using boost::visit_each;
64018 visit_each( v, t.get(), 0 );
64019 }
64020 template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
64021 {
64022 t.accept( v );
64023 }
64024 }
64025 template< class T > struct is_bind_expression
64026 {
64027 enum _vt { value = 0 };
64028 };
64029 template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
64030 {
64031 enum _vt { value = 1 };
64032 };
64033 template<class R, class F>
64034 _bi::bind_t<R, F, _bi::list0>
64035 bind(F f)
64036 {
64037 typedef _bi::list0 list_type;
64038 return _bi::bind_t<R, F, list_type> (f, list_type());
64039 }
64040 template<class R, class F, class A1>
64041 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
64042 bind(F f, A1 a1)
64043 {
64044 typedef typename _bi::list_av_1<A1>::type list_type;
64045 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
64046 }
64047 template<class R, class F, class A1, class A2>
64048 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
64049 bind(F f, A1 a1, A2 a2)
64050 {
64051 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64052 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
64053 }
64054 template<class R, class F, class A1, class A2, class A3>
64055 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
64056 bind(F f, A1 a1, A2 a2, A3 a3)
64057 {
64058 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64059 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
64060 }
64061 template<class R, class F, class A1, class A2, class A3, class A4>
64062 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64063 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4)
64064 {
64065 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64066 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
64067 }
64068 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
64069 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64070 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64071 {
64072 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64073 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
64074 }
64075 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
64076 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64077 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64078 {
64079 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64080 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
64081 }
64082 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64083 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64084 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64085 {
64086 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64087 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
64088 }
64089 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64090 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64091 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64092 {
64093 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64094 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64095 }
64096 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64097 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64098 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64099 {
64100 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64101 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64102 }
64103 template<class R, class F>
64104 _bi::bind_t<R, F, _bi::list0>
64105 bind(boost::type<R>, F f)
64106 {
64107 typedef _bi::list0 list_type;
64108 return _bi::bind_t<R, F, list_type> (f, list_type());
64109 }
64110 template<class R, class F, class A1>
64111 _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
64112 bind(boost::type<R>, F f, A1 a1)
64113 {
64114 typedef typename _bi::list_av_1<A1>::type list_type;
64115 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
64116 }
64117 template<class R, class F, class A1, class A2>
64118 _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
64119 bind(boost::type<R>, F f, A1 a1, A2 a2)
64120 {
64121 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64122 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
64123 }
64124 template<class R, class F, class A1, class A2, class A3>
64125 _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
64126 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
64127 {
64128 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64129 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
64130 }
64131 template<class R, class F, class A1, class A2, class A3, class A4>
64132 _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64133 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
64134 {
64135 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64136 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
64137 }
64138 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
64139 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64140 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64141 {
64142 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64143 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
64144 }
64145 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
64146 _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64147 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64148 {
64149 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64150 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
64151 }
64152 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64153 _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64154 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64155 {
64156 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64157 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
64158 }
64159 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64160 _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64161 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64162 {
64163 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64164 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64165 }
64166 template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64167 _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64168 bind(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64169 {
64170 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64171 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64172 }
64173 template<class F>
64174 _bi::bind_t<_bi::unspecified, F, _bi::list0>
64175 bind(F f)
64176 {
64177 typedef _bi::list0 list_type;
64178 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
64179 }
64180 template<class F, class A1>
64181 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
64182 bind(F f, A1 a1)
64183 {
64184 typedef typename _bi::list_av_1<A1>::type list_type;
64185 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
64186 }
64187 template<class F, class A1, class A2>
64188 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
64189 bind(F f, A1 a1, A2 a2)
64190 {
64191 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64192 return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
64193 }
64194 template<class F, class A1, class A2, class A3>
64195 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
64196 bind(F f, A1 a1, A2 a2, A3 a3)
64197 {
64198 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64199 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
64200 }
64201 template<class F, class A1, class A2, class A3, class A4>
64202 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64203 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4)
64204 {
64205 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64206 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
64207 }
64208 template<class F, class A1, class A2, class A3, class A4, class A5>
64209 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64210 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64211 {
64212 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64213 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
64214 }
64215 template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
64216 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64217 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64218 {
64219 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64220 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
64221 }
64222 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64223 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64224 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64225 {
64226 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64227 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
64228 }
64229 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64230 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64231 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64232 {
64233 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64234 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64235 }
64236 template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64237 _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64238 bind(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64239 {
64240 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64241 return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64242 }
64243 template<class R>
64244 _bi::bind_t<R, R ( *) (), _bi::list0>
64245 bind( R ( *f) ())
64246 {
64247 typedef R ( *F) ();
64248 typedef _bi::list0 list_type;
64249 return _bi::bind_t<R, F, list_type> (f, list_type());
64250 }
64251 template<class R, class B1, class A1>
64252 _bi::bind_t<R, R ( *) (B1), typename _bi::list_av_1<A1>::type>
64253 bind( R ( *f) (B1), A1 a1)
64254 {
64255 typedef R ( *F) (B1);
64256 typedef typename _bi::list_av_1<A1>::type list_type;
64257 return _bi::bind_t<R, F, list_type> (f, list_type(a1));
64258 }
64259 template<class R, class B1, class B2, class A1, class A2>
64260 _bi::bind_t<R, R ( *) (B1, B2), typename _bi::list_av_2<A1, A2>::type>
64261 bind( R ( *f) (B1, B2), A1 a1, A2 a2)
64262 {
64263 typedef R ( *F) (B1, B2);
64264 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64265 return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
64266 }
64267 template<class R,
64268 class B1, class B2, class B3,
64269 class A1, class A2, class A3>
64270 _bi::bind_t<R, R ( *) (B1, B2, B3), typename _bi::list_av_3<A1, A2, A3>::type>
64271 bind( R ( *f) (B1, B2, B3), A1 a1, A2 a2, A3 a3)
64272 {
64273 typedef R ( *F) (B1, B2, B3);
64274 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64275 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
64276 }
64277 template<class R,
64278 class B1, class B2, class B3, class B4,
64279 class A1, class A2, class A3, class A4>
64280 _bi::bind_t<R, R ( *) (B1, B2, B3, B4), typename _bi::list_av_4<A1, A2, A3, A4>::type>
64281 bind( R ( *f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4)
64282 {
64283 typedef R ( *F) (B1, B2, B3, B4);
64284 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64285 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
64286 }
64287 template<class R,
64288 class B1, class B2, class B3, class B4, class B5,
64289 class A1, class A2, class A3, class A4, class A5>
64290 _bi::bind_t<R, R ( *) (B1, B2, B3, B4, B5), typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64291 bind( R ( *f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64292 {
64293 typedef R ( *F) (B1, B2, B3, B4, B5);
64294 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64295 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
64296 }
64297 template<class R,
64298 class B1, class B2, class B3, class B4, class B5, class B6,
64299 class A1, class A2, class A3, class A4, class A5, class A6>
64300 _bi::bind_t<R, R ( *) (B1, B2, B3, B4, B5, B6), typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64301 bind( R ( *f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64302 {
64303 typedef R ( *F) (B1, B2, B3, B4, B5, B6);
64304 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64305 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
64306 }
64307 template<class R,
64308 class B1, class B2, class B3, class B4, class B5, class B6, class B7,
64309 class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64310 _bi::bind_t<R, R ( *) (B1, B2, B3, B4, B5, B6, B7), typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64311 bind( R ( *f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64312 {
64313 typedef R ( *F) (B1, B2, B3, B4, B5, B6, B7);
64314 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64315 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
64316 }
64317 template<class R,
64318 class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
64319 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64320 _bi::bind_t<R, R ( *) (B1, B2, B3, B4, B5, B6, B7, B8), typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64321 bind( R ( *f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64322 {
64323 typedef R ( *F) (B1, B2, B3, B4, B5, B6, B7, B8);
64324 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64325 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64326 }
64327 template<class R,
64328 class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9,
64329 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64330 _bi::bind_t<R, R ( *) (B1, B2, B3, B4, B5, B6, B7, B8, B9), typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64331 bind( R ( *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64332 {
64333 typedef R ( *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9);
64334 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64335 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64336 }
64337 template<class R, class T,
64338 class A1>
64339 _bi::bind_t<R, _mfi::mf0<R, T>, typename _bi::list_av_1<A1>::type>
64340 bind(R ( T::*f) (), A1 a1)
64341 {
64342 typedef _mfi::mf0<R, T> F;
64343 typedef typename _bi::list_av_1<A1>::type list_type;
64344 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
64345 }
64346 template<class R, class T,
64347 class A1>
64348 _bi::bind_t<R, _mfi::cmf0<R, T>, typename _bi::list_av_1<A1>::type>
64349 bind(R ( T::*f) () const, A1 a1)
64350 {
64351 typedef _mfi::cmf0<R, T> F;
64352 typedef typename _bi::list_av_1<A1>::type list_type;
64353 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
64354 }
64355 template<class R, class T,
64356 class B1,
64357 class A1, class A2>
64358 _bi::bind_t<R, _mfi::mf1<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
64359 bind(R ( T::*f) (B1), A1 a1, A2 a2)
64360 {
64361 typedef _mfi::mf1<R, T, B1> F;
64362 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64363 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
64364 }
64365 template<class R, class T,
64366 class B1,
64367 class A1, class A2>
64368 _bi::bind_t<R, _mfi::cmf1<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
64369 bind(R ( T::*f) (B1) const, A1 a1, A2 a2)
64370 {
64371 typedef _mfi::cmf1<R, T, B1> F;
64372 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64373 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
64374 }
64375 template<class R, class T,
64376 class B1, class B2,
64377 class A1, class A2, class A3>
64378 _bi::bind_t<R, _mfi::mf2<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
64379 bind(R ( T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
64380 {
64381 typedef _mfi::mf2<R, T, B1, B2> F;
64382 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64383 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
64384 }
64385 template<class R, class T,
64386 class B1, class B2,
64387 class A1, class A2, class A3>
64388 _bi::bind_t<R, _mfi::cmf2<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
64389 bind(R ( T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
64390 {
64391 typedef _mfi::cmf2<R, T, B1, B2> F;
64392 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64393 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
64394 }
64395 template<class R, class T,
64396 class B1, class B2, class B3,
64397 class A1, class A2, class A3, class A4>
64398 _bi::bind_t<R, _mfi::mf3<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64399 bind(R ( T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
64400 {
64401 typedef _mfi::mf3<R, T, B1, B2, B3> F;
64402 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64403 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
64404 }
64405 template<class R, class T,
64406 class B1, class B2, class B3,
64407 class A1, class A2, class A3, class A4>
64408 _bi::bind_t<R, _mfi::cmf3<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64409 bind(R ( T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
64410 {
64411 typedef _mfi::cmf3<R, T, B1, B2, B3> F;
64412 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64413 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
64414 }
64415 template<class R, class T,
64416 class B1, class B2, class B3, class B4,
64417 class A1, class A2, class A3, class A4, class A5>
64418 _bi::bind_t<R, _mfi::mf4<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64419 bind(R ( T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64420 {
64421 typedef _mfi::mf4<R, T, B1, B2, B3, B4> F;
64422 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64423 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
64424 }
64425 template<class R, class T,
64426 class B1, class B2, class B3, class B4,
64427 class A1, class A2, class A3, class A4, class A5>
64428 _bi::bind_t<R, _mfi::cmf4<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64429 bind(R ( T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64430 {
64431 typedef _mfi::cmf4<R, T, B1, B2, B3, B4> F;
64432 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64433 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
64434 }
64435 template<class R, class T,
64436 class B1, class B2, class B3, class B4, class B5,
64437 class A1, class A2, class A3, class A4, class A5, class A6>
64438 _bi::bind_t<R, _mfi::mf5<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64439 bind(R ( T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64440 {
64441 typedef _mfi::mf5<R, T, B1, B2, B3, B4, B5> F;
64442 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64443 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
64444 }
64445 template<class R, class T,
64446 class B1, class B2, class B3, class B4, class B5,
64447 class A1, class A2, class A3, class A4, class A5, class A6>
64448 _bi::bind_t<R, _mfi::cmf5<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64449 bind(R ( T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64450 {
64451 typedef _mfi::cmf5<R, T, B1, B2, B3, B4, B5> F;
64452 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64453 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
64454 }
64455 template<class R, class T,
64456 class B1, class B2, class B3, class B4, class B5, class B6,
64457 class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64458 _bi::bind_t<R, _mfi::mf6<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64459 bind(R ( T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64460 {
64461 typedef _mfi::mf6<R, T, B1, B2, B3, B4, B5, B6> F;
64462 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64463 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
64464 }
64465 template<class R, class T,
64466 class B1, class B2, class B3, class B4, class B5, class B6,
64467 class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64468 _bi::bind_t<R, _mfi::cmf6<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64469 bind(R ( T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64470 {
64471 typedef _mfi::cmf6<R, T, B1, B2, B3, B4, B5, B6> F;
64472 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64473 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
64474 }
64475 template<class R, class T,
64476 class B1, class B2, class B3, class B4, class B5, class B6, class B7,
64477 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64478 _bi::bind_t<R, _mfi::mf7<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64479 bind(R ( T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64480 {
64481 typedef _mfi::mf7<R, T, B1, B2, B3, B4, B5, B6, B7> F;
64482 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64483 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64484 }
64485 template<class R, class T,
64486 class B1, class B2, class B3, class B4, class B5, class B6, class B7,
64487 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64488 _bi::bind_t<R, _mfi::cmf7<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64489 bind(R ( T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64490 {
64491 typedef _mfi::cmf7<R, T, B1, B2, B3, B4, B5, B6, B7> F;
64492 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64493 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64494 }
64495 template<class R, class T,
64496 class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
64497 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64498 _bi::bind_t<R, _mfi::mf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64499 bind(R ( T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64500 {
64501 typedef _mfi::mf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
64502 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64503 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64504 }
64505 template<class R, class T,
64506 class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
64507 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64508 _bi::bind_t<R, _mfi::cmf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64509 bind(R ( T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64510 {
64511 typedef _mfi::cmf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
64512 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64513 return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64514 }
64515 template<class Rt2, class R, class T,
64516 class A1>
64517 _bi::bind_t<Rt2, _mfi::mf0<R, T>, typename _bi::list_av_1<A1>::type>
64518 bind(boost::type<Rt2>, R ( T::*f) (), A1 a1)
64519 {
64520 typedef _mfi::mf0<R, T> F;
64521 typedef typename _bi::list_av_1<A1>::type list_type;
64522 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
64523 }
64524 template<class Rt2, class R, class T,
64525 class A1>
64526 _bi::bind_t<Rt2, _mfi::cmf0<R, T>, typename _bi::list_av_1<A1>::type>
64527 bind(boost::type<Rt2>, R ( T::*f) () const, A1 a1)
64528 {
64529 typedef _mfi::cmf0<R, T> F;
64530 typedef typename _bi::list_av_1<A1>::type list_type;
64531 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
64532 }
64533 template<class Rt2, class R, class T,
64534 class B1,
64535 class A1, class A2>
64536 _bi::bind_t<Rt2, _mfi::mf1<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
64537 bind(boost::type<Rt2>, R ( T::*f) (B1), A1 a1, A2 a2)
64538 {
64539 typedef _mfi::mf1<R, T, B1> F;
64540 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64541 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
64542 }
64543 template<class Rt2, class R, class T,
64544 class B1,
64545 class A1, class A2>
64546 _bi::bind_t<Rt2, _mfi::cmf1<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
64547 bind(boost::type<Rt2>, R ( T::*f) (B1) const, A1 a1, A2 a2)
64548 {
64549 typedef _mfi::cmf1<R, T, B1> F;
64550 typedef typename _bi::list_av_2<A1, A2>::type list_type;
64551 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
64552 }
64553 template<class Rt2, class R, class T,
64554 class B1, class B2,
64555 class A1, class A2, class A3>
64556 _bi::bind_t<Rt2, _mfi::mf2<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
64557 bind(boost::type<Rt2>, R ( T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
64558 {
64559 typedef _mfi::mf2<R, T, B1, B2> F;
64560 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64561 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
64562 }
64563 template<class Rt2, class R, class T,
64564 class B1, class B2,
64565 class A1, class A2, class A3>
64566 _bi::bind_t<Rt2, _mfi::cmf2<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
64567 bind(boost::type<Rt2>, R ( T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
64568 {
64569 typedef _mfi::cmf2<R, T, B1, B2> F;
64570 typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
64571 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
64572 }
64573 template<class Rt2, class R, class T,
64574 class B1, class B2, class B3,
64575 class A1, class A2, class A3, class A4>
64576 _bi::bind_t<Rt2, _mfi::mf3<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64577 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
64578 {
64579 typedef _mfi::mf3<R, T, B1, B2, B3> F;
64580 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64581 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
64582 }
64583 template<class Rt2, class R, class T,
64584 class B1, class B2, class B3,
64585 class A1, class A2, class A3, class A4>
64586 _bi::bind_t<Rt2, _mfi::cmf3<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
64587 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
64588 {
64589 typedef _mfi::cmf3<R, T, B1, B2, B3> F;
64590 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
64591 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
64592 }
64593 template<class Rt2, class R, class T,
64594 class B1, class B2, class B3, class B4,
64595 class A1, class A2, class A3, class A4, class A5>
64596 _bi::bind_t<Rt2, _mfi::mf4<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64597 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64598 {
64599 typedef _mfi::mf4<R, T, B1, B2, B3, B4> F;
64600 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64601 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
64602 }
64603 template<class Rt2, class R, class T,
64604 class B1, class B2, class B3, class B4,
64605 class A1, class A2, class A3, class A4, class A5>
64606 _bi::bind_t<Rt2, _mfi::cmf4<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
64607 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
64608 {
64609 typedef _mfi::cmf4<R, T, B1, B2, B3, B4> F;
64610 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
64611 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
64612 }
64613 template<class Rt2, class R, class T,
64614 class B1, class B2, class B3, class B4, class B5,
64615 class A1, class A2, class A3, class A4, class A5, class A6>
64616 _bi::bind_t<Rt2, _mfi::mf5<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64617 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64618 {
64619 typedef _mfi::mf5<R, T, B1, B2, B3, B4, B5> F;
64620 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64621 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
64622 }
64623 template<class Rt2, class R, class T,
64624 class B1, class B2, class B3, class B4, class B5,
64625 class A1, class A2, class A3, class A4, class A5, class A6>
64626 _bi::bind_t<Rt2, _mfi::cmf5<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
64627 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
64628 {
64629 typedef _mfi::cmf5<R, T, B1, B2, B3, B4, B5> F;
64630 typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
64631 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
64632 }
64633 template<class Rt2, class R, class T,
64634 class B1, class B2, class B3, class B4, class B5, class B6,
64635 class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64636 _bi::bind_t<Rt2, _mfi::mf6<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64637 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64638 {
64639 typedef _mfi::mf6<R, T, B1, B2, B3, B4, B5, B6> F;
64640 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64641 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
64642 }
64643 template<class Rt2, class R, class T,
64644 class B1, class B2, class B3, class B4, class B5, class B6,
64645 class A1, class A2, class A3, class A4, class A5, class A6, class A7>
64646 _bi::bind_t<Rt2, _mfi::cmf6<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
64647 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
64648 {
64649 typedef _mfi::cmf6<R, T, B1, B2, B3, B4, B5, B6> F;
64650 typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
64651 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
64652 }
64653 template<class Rt2, class R, class T,
64654 class B1, class B2, class B3, class B4, class B5, class B6, class B7,
64655 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64656 _bi::bind_t<Rt2, _mfi::mf7<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64657 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64658 {
64659 typedef _mfi::mf7<R, T, B1, B2, B3, B4, B5, B6, B7> F;
64660 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64661 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64662 }
64663 template<class Rt2, class R, class T,
64664 class B1, class B2, class B3, class B4, class B5, class B6, class B7,
64665 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
64666 _bi::bind_t<Rt2, _mfi::cmf7<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
64667 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
64668 {
64669 typedef _mfi::cmf7<R, T, B1, B2, B3, B4, B5, B6, B7> F;
64670 typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
64671 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
64672 }
64673 template<class Rt2, class R, class T,
64674 class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
64675 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64676 _bi::bind_t<Rt2, _mfi::mf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64677 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64678 {
64679 typedef _mfi::mf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
64680 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64681 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64682 }
64683 template<class Rt2, class R, class T,
64684 class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
64685 class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
64686 _bi::bind_t<Rt2, _mfi::cmf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
64687 bind(boost::type<Rt2>, R ( T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
64688 {
64689 typedef _mfi::cmf8<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
64690 typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
64691 return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
64692 }
64693 namespace _bi
64694 {
64695 template< class Pm, int I > struct add_cref;
64696 template< class M, class T > struct add_cref< M T::*, 0 >
64697 {
64698 typedef M type;
64699 };
64700 template< class M, class T > struct add_cref< M T::*, 1 >
64701 {
64702 typedef M const & type;
64703 };
64704 template< class R, class T > struct add_cref< R (T::*) (), 1 >
64705 {
64706 typedef void type;
64707 };
64708 template< class R, class T > struct add_cref< R (T::*) () const, 1 >
64709 {
64710 typedef void type;
64711 };
64712 template<class R> struct isref
64713 {
64714 enum value_type { value = 0 };
64715 };
64716 template<class R> struct isref< R& >
64717 {
64718 enum value_type { value = 1 };
64719 };
64720 template<class R> struct isref< R* >
64721 {
64722 enum value_type { value = 1 };
64723 };
64724 template<class Pm, class A1> struct dm_result
64725 {
64726 typedef typename add_cref< Pm, 1 >::type type;
64727 };
64728 template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
64729 {
64730 typedef typename bind_t<R, F, L>::result_type result_type;
64731 typedef typename add_cref< Pm, isref< result_type >::value >::type type;
64732 };
64733 }
64734 template< class A1, class M, class T >
64735 _bi::bind_t<
64736 typename _bi::dm_result< M T::*, A1 >::type,
64737 _mfi::dm<M, T>,
64738 typename _bi::list_av_1<A1>::type
64739 >
64740 bind( M T::*f, A1 a1 )
64741 {
64742 typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
64743 typedef _mfi::dm<M, T> F;
64744 typedef typename _bi::list_av_1<A1>::type list_type;
64745 return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
64746 }
64747 }
64748 namespace
64749 {
64750 boost::arg<1> _1;
64751 boost::arg<2> _2;
64752 boost::arg<3> _3;
64753 boost::arg<4> _4;
64754 boost::arg<5> _5;
64755 boost::arg<6> _6;
64756 boost::arg<7> _7;
64757 boost::arg<8> _8;
64758 boost::arg<9> _9;
64759 }
64760 namespace boost { namespace python { namespace detail {
64761 struct exception_handler;
64762 typedef function2<bool, exception_handler const&, function0<void> const&> handler_function;
64763 struct exception_handler
64764 {
64765 private:
64766 public:
64767 explicit exception_handler(handler_function const& impl);
64768 inline bool handle(function0<void> const& f) const;
64769 bool operator()(function0<void> const& f) const;
64770 static exception_handler* chain;
64771 private:
64772 static exception_handler* tail;
64773 handler_function m_impl;
64774 exception_handler* m_next;
64775 };
64776 inline bool exception_handler::handle(function0<void> const& f) const
64777 {
64778 return this->m_impl(*this, f);
64779 }
64780 void register_exception_handler(handler_function const& f);
64781 }}}
64782 namespace boost { namespace python { namespace detail {
64783 template <class ExceptionType, class Translate>
64784 struct translate_exception
64785 {
64786 typedef typename add_reference<
64787 typename add_const<ExceptionType>::type
64788 >::type exception_cref;
64789 inline bool operator()(
64790 exception_handler const& handler
64791 , function0<void> const& f
64792 , typename call_traits<Translate>::param_type translate) const
64793 {
64794 try
64795 {
64796 return handler(f);
64797 }
64798 catch(exception_cref e)
64799 {
64800 translate(e);
64801 return true;
64802 }
64803 }
64804 };
64805 }}}
64806 namespace boost { namespace python {
64807 template <class ExceptionType, class Translate>
64808 void register_exception_translator(Translate translate, boost::type<ExceptionType>* = 0)
64809 {
64810 detail::register_exception_handler(
64811 bind<bool>(detail::translate_exception<ExceptionType,Translate>(), _1, _2, translate)
64812 );
64813 }
64814 }}
64815 namespace boost { namespace python {
64816 class str;
64817 namespace detail
64818 {
64819 struct str_base : object
64820 {
64821 str capitalize() const;
64822 str center(object_cref width) const;
64823 long count(object_cref sub) const;
64824 long count(object_cref sub, object_cref start) const;
64825 long count(object_cref sub, object_cref start, object_cref end) const;
64826 object decode() const;
64827 object decode(object_cref encoding) const;
64828 object decode(object_cref encoding, object_cref errors) const;
64829 object encode() const;
64830 object encode(object_cref encoding) const;
64831 object encode(object_cref encoding, object_cref errors) const;
64832 bool endswith(object_cref suffix) const;
64833 bool endswith(object_cref suffix, object_cref start) const;
64834 bool endswith(object_cref suffix, object_cref start, object_cref end) const;
64835 str expandtabs() const;
64836 str expandtabs(object_cref tabsize) const;
64837 long find(object_cref sub) const;
64838 long find(object_cref sub, object_cref start) const;
64839 long find(object_cref sub, object_cref start, object_cref end) const;
64840 long index(object_cref sub) const;
64841 long index(object_cref sub, object_cref start) const;
64842 long index(object_cref sub, object_cref start, object_cref end) const;
64843 bool isalnum() const;
64844 bool isalpha() const;
64845 bool isdigit() const;
64846 bool islower() const;
64847 bool isspace() const;
64848 bool istitle() const;
64849 bool isupper() const;
64850 str join(object_cref sequence) const;
64851 str ljust(object_cref width) const;
64852 str lower() const;
64853 str lstrip() const;
64854 str replace(object_cref old, object_cref new_) const;
64855 str replace(object_cref old, object_cref new_, object_cref maxsplit) const;
64856 long rfind(object_cref sub) const;
64857 long rfind(object_cref sub, object_cref start) const;
64858 long rfind(object_cref sub, object_cref start, object_cref end) const;
64859 long rindex(object_cref sub) const;
64860 long rindex(object_cref sub, object_cref start) const;
64861 long rindex(object_cref sub, object_cref start, object_cref end) const;
64862 str rjust(object_cref width) const;
64863 str rstrip() const;
64864 list split() const;
64865 list split(object_cref sep) const;
64866 list split(object_cref sep, object_cref maxsplit) const;
64867 list splitlines() const;
64868 list splitlines(object_cref keepends) const;
64869 bool startswith(object_cref prefix) const;
64870 bool startswith(object_cref prefix, object_cref start) const;
64871 bool startswith(object_cref prefix, object_cref start, object_cref end) const;
64872 str strip() const;
64873 str swapcase() const;
64874 str title() const;
64875 str translate(object_cref table) const;
64876 str translate(object_cref table, object_cref deletechars) const;
64877 str upper() const;
64878 protected:
64879 str_base();
64880 str_base(const char* s);
64881 str_base(char const* start, char const* finish);
64882 str_base(char const* start, std::size_t length);
64883 explicit str_base(object_cref other);
64884 inline explicit str_base(python::detail::borrowed_reference p) : object(p) {} inline explicit str_base(python::detail::new_reference p) : object(p) {} inline explicit str_base(python::detail::new_non_null_reference p) : object(p) {}
64885 private:
64886 static new_reference call(object const&);
64887 };
64888 }
64889 class str : public detail::str_base
64890 {
64891 typedef detail::str_base base;
64892 public:
64893 str() {}
64894 str(const char* s) : base(s) {}
64895 str(char const* start, char const* finish)
64896 : base(start, finish)
64897 {}
64898 str(char const* start, std::size_t length)
64899 : base(start, length)
64900 {}
64901 template <class T>
64902 explicit str(T const& other)
64903 : base(object(other))
64904 {
64905 }
64906 template <class T>
64907 str center(T const& width) const
64908 {
64909 return base::center(object(width));
64910 }
64911 template<class T>
64912 long count(T const& sub) const
64913 {
64914 return base::count(object(sub));
64915 }
64916 template<class T1, class T2>
64917 long count(T1 const& sub,T2 const& start) const
64918 {
64919 return base::count(object(sub), object(start));
64920 }
64921 template<class T1, class T2, class T3>
64922 long count(T1 const& sub,T2 const& start, T3 const& end) const
64923 {
64924 return base::count(object(sub), object(start));
64925 }
64926 object decode() const { return base::decode(); }
64927 template<class T>
64928 object decode(T const& encoding) const
64929 {
64930 return base::decode(object(encoding));
64931 }
64932 template<class T1, class T2>
64933 object decode(T1 const& encoding, T2 const& errors) const
64934 {
64935 return base::decode(object(encoding),object(errors));
64936 }
64937 object encode() const { return base::encode(); }
64938 template <class T>
64939 object encode(T const& encoding) const
64940 {
64941 return base::encode(object(encoding));
64942 }
64943 template <class T1, class T2>
64944 object encode(T1 const& encoding, T2 const& errors) const
64945 {
64946 return base::encode(object(encoding),object(errors));
64947 }
64948 template <class T>
64949 bool endswith(T const& suffix) const
64950 {
64951 return base::endswith(object(suffix));
64952 }
64953 template <class T1, class T2>
64954 bool endswith(T1 const& suffix, T2 const& start) const
64955 {
64956 return base::endswith(object(suffix), object(start));
64957 }
64958 template <class T1, class T2, class T3>
64959 bool endswith(T1 const& suffix, T2 const& start, T3 const& end) const
64960 {
64961 return base::endswith(object(suffix), object(start), object(end));
64962 }
64963 str expandtabs() const { return base::expandtabs(); }
64964 template <class T>
64965 str expandtabs(T const& tabsize) const
64966 {
64967 return base::expandtabs(object(tabsize));
64968 }
64969 template <class T>
64970 long find(T const& sub) const
64971 {
64972 return base::find(object(sub));
64973 }
64974 template <class T1, class T2>
64975 long find(T1 const& sub, T2 const& start) const
64976 {
64977 return base::find(object(sub), object(start));
64978 }
64979 template <class T1, class T2, class T3>
64980 long find(T1 const& sub, T2 const& start, T3 const& end) const
64981 {
64982 return base::find(object(sub), object(start), object(end));
64983 }
64984 template <class T>
64985 long index(T const& sub) const
64986 {
64987 return base::index(object(sub));
64988 }
64989 template <class T1, class T2>
64990 long index(T1 const& sub, T2 const& start) const
64991 {
64992 return base::index(object(sub), object(start));
64993 }
64994 template <class T1, class T2, class T3>
64995 long index(T1 const& sub, T2 const& start, T3 const& end) const
64996 {
64997 return base::index(object(sub), object(start), object(end));
64998 }
64999 template <class T>
65000 str join(T const& sequence) const
65001 {
65002 return base::join(object(sequence));
65003 }
65004 template <class T>
65005 str ljust(T const& width) const
65006 {
65007 return base::ljust(object(width));
65008 }
65009 template <class T1, class T2>
65010 str replace(T1 const& old, T2 const& new_) const
65011 {
65012 return base::replace(object(old),object(new_));
65013 }
65014 template <class T1, class T2, class T3>
65015 str replace(T1 const& old, T2 const& new_, T3 const& maxsplit) const
65016 {
65017 return base::replace(object(old),object(new_), object(maxsplit));
65018 }
65019 template <class T>
65020 long rfind(T const& sub) const
65021 {
65022 return base::rfind(object(sub));
65023 }
65024 template <class T1, class T2>
65025 long rfind(T1 const& sub, T2 const& start) const
65026 {
65027 return base::rfind(object(sub), object(start));
65028 }
65029 template <class T1, class T2, class T3>
65030 long rfind(T1 const& sub, T2 const& start, T3 const& end) const
65031 {
65032 return base::rfind(object(sub), object(start), object(end));
65033 }
65034 template <class T>
65035 long rindex(T const& sub) const
65036 {
65037 return base::rindex(object(sub));
65038 }
65039 template <class T1, class T2>
65040 long rindex(T1 const& sub, T2 const& start) const
65041 {
65042 return base::rindex(object(sub), object(start));
65043 }
65044 template <class T1, class T2, class T3>
65045 long rindex(T1 const& sub, T2 const& start, T3 const& end) const
65046 {
65047 return base::rindex(object(sub), object(start), object(end));
65048 }
65049 template <class T>
65050 str rjust(T const& width) const
65051 {
65052 return base::rjust(object(width));
65053 }
65054 list split() const { return base::split(); }
65055 template <class T>
65056 list split(T const& sep) const
65057 {
65058 return base::split(object(sep));
65059 }
65060 template <class T1, class T2>
65061 list split(T1 const& sep, T2 const& maxsplit) const
65062 {
65063 return base::split(object(sep), object(maxsplit));
65064 }
65065 list splitlines() const { return base::splitlines(); }
65066 template <class T>
65067 list splitlines(T const& keepends) const
65068 {
65069 return base::splitlines(object(keepends));
65070 }
65071 template <class T>
65072 bool startswith(T const& prefix) const
65073 {
65074 return base::startswith(object(prefix));
65075 }
65076 template <class T1, class T2>
65077 bool startswith(T1 const& prefix, T2 const& start) const
65078 {
65079 return base::startswith(object(prefix), object(start));
65080 }
65081 template <class T1, class T2, class T3>
65082 bool startswith(T1 const& prefix, T2 const& start, T3 const& end) const
65083 {
65084 return base::startswith(object(prefix), object(start), object(end));
65085 }
65086 template <class T>
65087 str translate(T const& table) const
65088 {
65089 return base::translate(object(table));
65090 }
65091 template <class T1, class T2>
65092 str translate(T1 const& table, T2 const& deletechars) const
65093 {
65094 return base::translate(object(table), object(deletechars));
65095 }
65096 public:
65097 inline explicit str(python::detail::borrowed_reference p) : base(p) {} inline explicit str(python::detail::new_reference p) : base(p) {} inline explicit str(python::detail::new_non_null_reference p) : base(p) {}
65098 };
65099 namespace converter
65100 {
65101 template <>
65102 struct object_manager_traits<str>
65103 : pytype_object_manager_traits<&PyString_Type,str>
65104 {
65105 };
65106 }
65107 }}
65108 namespace boost
65109 {
65110 namespace python
65111 {
65112 object
65113 eval(str string, object global = object(), object local = object());
65114 object
65115 exec_statement(str string, object global = object(), object local = object());
65116 object
65117 exec(str string, object global = object(), object local = object());
65118 object
65119 exec_file(str filename, object global = object(), object local = object());
65120 }
65121 }
65122 namespace boost { namespace python { namespace converter {
65123 template <class Source, class Target>
65124 struct implicit
65125 {
65126 static void* convertible(PyObject* obj)
65127 {
65128 return implicit_rvalue_convertible_from_python(obj, registered<Source>::converters)
65129 ? obj : 0;
65130 }
65131 static void construct(PyObject* obj, rvalue_from_python_stage1_data* data)
65132 {
65133 void* storage = ((rvalue_from_python_storage<Target>*)data)->storage.bytes;
65134 arg_from_python<Source> get_source(obj);
65135 bool convertible = get_source.convertible();
65136 ((void)(convertible));
65137 new (storage) Target(get_source());
65138 data->convertible = storage;
65139 }
65140 };
65141 }}}
65142 namespace boost { namespace python {
65143 template <class Source, class Target>
65144 void implicitly_convertible(boost::type<Source>* = 0, boost::type<Target>* = 0)
65145 {
65146 typedef converter::implicit<Source,Target> functions;
65147 converter::registry::push_back(
65148 &functions::convertible
65149 , &functions::construct
65150 , type_id<Target>()
65151 , &converter::expected_from_python_type_direct<Source>::get_pytype
65152 );
65153 }
65154 }}
65155 namespace boost
65156 {
65157 namespace python
65158 {
65159 object import(str name);
65160 }
65161 }
65162 namespace boost { namespace python { namespace detail {
65163 template <class R >
65164 void(* target(R (*)()) )()
65165 {
65166 return 0;
65167 }
65168 template <class R , class A0>
65169 A0(* target(R (*)( A0)) )()
65170 {
65171 return 0;
65172 }
65173 template <class R , class A0 , class A1>
65174 A0(* target(R (*)( A0 , A1)) )()
65175 {
65176 return 0;
65177 }
65178 template <class R , class A0 , class A1 , class A2>
65179 A0(* target(R (*)( A0 , A1 , A2)) )()
65180 {
65181 return 0;
65182 }
65183 template <class R , class A0 , class A1 , class A2 , class A3>
65184 A0(* target(R (*)( A0 , A1 , A2 , A3)) )()
65185 {
65186 return 0;
65187 }
65188 template <class R , class A0 , class A1 , class A2 , class A3 , class A4>
65189 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4)) )()
65190 {
65191 return 0;
65192 }
65193 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
65194 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5)) )()
65195 {
65196 return 0;
65197 }
65198 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
65199 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6)) )()
65200 {
65201 return 0;
65202 }
65203 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
65204 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)) )()
65205 {
65206 return 0;
65207 }
65208 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
65209 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)) )()
65210 {
65211 return 0;
65212 }
65213 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
65214 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)) )()
65215 {
65216 return 0;
65217 }
65218 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
65219 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10)) )()
65220 {
65221 return 0;
65222 }
65223 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
65224 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11)) )()
65225 {
65226 return 0;
65227 }
65228 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
65229 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12)) )()
65230 {
65231 return 0;
65232 }
65233 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
65234 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13)) )()
65235 {
65236 return 0;
65237 }
65238 template <class R , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
65239 A0(* target(R (*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14)) )()
65240 {
65241 return 0;
65242 }
65243 template <class R, class T >
65244 T& (* target(R (T::*)() ) )()
65245 {
65246 return 0;
65247 }
65248 template <class R, class T , class A0>
65249 T& (* target(R (T::*)( A0) ) )()
65250 {
65251 return 0;
65252 }
65253 template <class R, class T , class A0 , class A1>
65254 T& (* target(R (T::*)( A0 , A1) ) )()
65255 {
65256 return 0;
65257 }
65258 template <class R, class T , class A0 , class A1 , class A2>
65259 T& (* target(R (T::*)( A0 , A1 , A2) ) )()
65260 {
65261 return 0;
65262 }
65263 template <class R, class T , class A0 , class A1 , class A2 , class A3>
65264 T& (* target(R (T::*)( A0 , A1 , A2 , A3) ) )()
65265 {
65266 return 0;
65267 }
65268 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4>
65269 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4) ) )()
65270 {
65271 return 0;
65272 }
65273 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
65274 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5) ) )()
65275 {
65276 return 0;
65277 }
65278 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
65279 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6) ) )()
65280 {
65281 return 0;
65282 }
65283 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
65284 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7) ) )()
65285 {
65286 return 0;
65287 }
65288 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
65289 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8) ) )()
65290 {
65291 return 0;
65292 }
65293 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
65294 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9) ) )()
65295 {
65296 return 0;
65297 }
65298 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
65299 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10) ) )()
65300 {
65301 return 0;
65302 }
65303 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
65304 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11) ) )()
65305 {
65306 return 0;
65307 }
65308 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
65309 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12) ) )()
65310 {
65311 return 0;
65312 }
65313 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
65314 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13) ) )()
65315 {
65316 return 0;
65317 }
65318 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
65319 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14) ) )()
65320 {
65321 return 0;
65322 }
65323 template <class R, class T >
65324 T& (* target(R (T::*)() const) )()
65325 {
65326 return 0;
65327 }
65328 template <class R, class T , class A0>
65329 T& (* target(R (T::*)( A0) const) )()
65330 {
65331 return 0;
65332 }
65333 template <class R, class T , class A0 , class A1>
65334 T& (* target(R (T::*)( A0 , A1) const) )()
65335 {
65336 return 0;
65337 }
65338 template <class R, class T , class A0 , class A1 , class A2>
65339 T& (* target(R (T::*)( A0 , A1 , A2) const) )()
65340 {
65341 return 0;
65342 }
65343 template <class R, class T , class A0 , class A1 , class A2 , class A3>
65344 T& (* target(R (T::*)( A0 , A1 , A2 , A3) const) )()
65345 {
65346 return 0;
65347 }
65348 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4>
65349 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4) const) )()
65350 {
65351 return 0;
65352 }
65353 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
65354 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5) const) )()
65355 {
65356 return 0;
65357 }
65358 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
65359 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6) const) )()
65360 {
65361 return 0;
65362 }
65363 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
65364 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7) const) )()
65365 {
65366 return 0;
65367 }
65368 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
65369 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8) const) )()
65370 {
65371 return 0;
65372 }
65373 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
65374 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9) const) )()
65375 {
65376 return 0;
65377 }
65378 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
65379 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10) const) )()
65380 {
65381 return 0;
65382 }
65383 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
65384 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11) const) )()
65385 {
65386 return 0;
65387 }
65388 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
65389 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12) const) )()
65390 {
65391 return 0;
65392 }
65393 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
65394 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13) const) )()
65395 {
65396 return 0;
65397 }
65398 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
65399 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14) const) )()
65400 {
65401 return 0;
65402 }
65403 template <class R, class T >
65404 T& (* target(R (T::*)() volatile) )()
65405 {
65406 return 0;
65407 }
65408 template <class R, class T , class A0>
65409 T& (* target(R (T::*)( A0) volatile) )()
65410 {
65411 return 0;
65412 }
65413 template <class R, class T , class A0 , class A1>
65414 T& (* target(R (T::*)( A0 , A1) volatile) )()
65415 {
65416 return 0;
65417 }
65418 template <class R, class T , class A0 , class A1 , class A2>
65419 T& (* target(R (T::*)( A0 , A1 , A2) volatile) )()
65420 {
65421 return 0;
65422 }
65423 template <class R, class T , class A0 , class A1 , class A2 , class A3>
65424 T& (* target(R (T::*)( A0 , A1 , A2 , A3) volatile) )()
65425 {
65426 return 0;
65427 }
65428 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4>
65429 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4) volatile) )()
65430 {
65431 return 0;
65432 }
65433 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
65434 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5) volatile) )()
65435 {
65436 return 0;
65437 }
65438 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
65439 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6) volatile) )()
65440 {
65441 return 0;
65442 }
65443 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
65444 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7) volatile) )()
65445 {
65446 return 0;
65447 }
65448 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
65449 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8) volatile) )()
65450 {
65451 return 0;
65452 }
65453 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
65454 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9) volatile) )()
65455 {
65456 return 0;
65457 }
65458 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
65459 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10) volatile) )()
65460 {
65461 return 0;
65462 }
65463 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
65464 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11) volatile) )()
65465 {
65466 return 0;
65467 }
65468 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
65469 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12) volatile) )()
65470 {
65471 return 0;
65472 }
65473 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
65474 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13) volatile) )()
65475 {
65476 return 0;
65477 }
65478 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
65479 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14) volatile) )()
65480 {
65481 return 0;
65482 }
65483 template <class R, class T >
65484 T& (* target(R (T::*)() const volatile) )()
65485 {
65486 return 0;
65487 }
65488 template <class R, class T , class A0>
65489 T& (* target(R (T::*)( A0) const volatile) )()
65490 {
65491 return 0;
65492 }
65493 template <class R, class T , class A0 , class A1>
65494 T& (* target(R (T::*)( A0 , A1) const volatile) )()
65495 {
65496 return 0;
65497 }
65498 template <class R, class T , class A0 , class A1 , class A2>
65499 T& (* target(R (T::*)( A0 , A1 , A2) const volatile) )()
65500 {
65501 return 0;
65502 }
65503 template <class R, class T , class A0 , class A1 , class A2 , class A3>
65504 T& (* target(R (T::*)( A0 , A1 , A2 , A3) const volatile) )()
65505 {
65506 return 0;
65507 }
65508 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4>
65509 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4) const volatile) )()
65510 {
65511 return 0;
65512 }
65513 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5>
65514 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5) const volatile) )()
65515 {
65516 return 0;
65517 }
65518 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6>
65519 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6) const volatile) )()
65520 {
65521 return 0;
65522 }
65523 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7>
65524 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7) const volatile) )()
65525 {
65526 return 0;
65527 }
65528 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8>
65529 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8) const volatile) )()
65530 {
65531 return 0;
65532 }
65533 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9>
65534 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9) const volatile) )()
65535 {
65536 return 0;
65537 }
65538 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10>
65539 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10) const volatile) )()
65540 {
65541 return 0;
65542 }
65543 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11>
65544 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11) const volatile) )()
65545 {
65546 return 0;
65547 }
65548 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12>
65549 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12) const volatile) )()
65550 {
65551 return 0;
65552 }
65553 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13>
65554 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13) const volatile) )()
65555 {
65556 return 0;
65557 }
65558 template <class R, class T , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14>
65559 T& (* target(R (T::*)( A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14) const volatile) )()
65560 {
65561 return 0;
65562 }
65563 template <class R, class T>
65564 T& (* target(R (T::*)) )() { return 0; }
65565 }}}
65566 namespace boost { namespace python { namespace objects {
65567 object const& identity_function();
65568 void stop_iteration_error();
65569 }}}
65570 namespace boost { namespace python { namespace objects {
65571 type_handle registered_class_object(type_info id);
65572 type_handle class_metatype();
65573 type_handle class_type();
65574 }}}
65575 namespace boost { namespace detail {
65576 template <class Iterator>
65577 struct iterator_traits
65578 : std::iterator_traits<Iterator>
65579 {};
65580 using std::distance;
65581 }}
65582 namespace boost { namespace python { namespace objects {
65583 typedef return_value_policy<return_by_value> default_iterator_call_policies;
65584 template <class NextPolicies, class Iterator>
65585 struct iterator_range
65586 {
65587 iterator_range(object sequence, Iterator start, Iterator finish);
65588 typedef boost::detail::iterator_traits<Iterator> traits_t;
65589 struct next
65590 {
65591 typedef typename mpl::if_<
65592 is_reference<
65593 typename traits_t::reference
65594 >
65595 , typename traits_t::reference
65596 , typename traits_t::value_type
65597 >::type result_type;
65598 result_type
65599 operator()(iterator_range<NextPolicies,Iterator>& self)
65600 {
65601 if (self.m_start == self.m_finish)
65602 stop_iteration_error();
65603 return *self.m_start++;
65604 }
65605 };
65606 typedef next next_fn;
65607 object m_sequence;
65608 Iterator m_start;
65609 Iterator m_finish;
65610 };
65611 namespace detail
65612 {
65613 template <class Iterator, class NextPolicies>
65614 object demand_iterator_class(char const* name, Iterator* = 0, NextPolicies const& policies = NextPolicies())
65615 {
65616 typedef iterator_range<NextPolicies,Iterator> range_;
65617 handle<> class_obj(
65618 objects::registered_class_object(python::type_id<range_>()));
65619 if (class_obj.get() != 0)
65620 return object(class_obj);
65621 typedef typename range_::next_fn next_fn;
65622 typedef typename next_fn::result_type result_type;
65623 return class_<range_>(name, no_init)
65624 .def("__iter__", identity_function())
65625 .def(
65626 "next"
65627 , make_function(
65628 next_fn()
65629 , policies
65630 , mpl::vector2<result_type,range_&>()
65631 ));
65632 }
65633 template <
65634 class Target
65635 , class Iterator
65636 , class Accessor1
65637 , class Accessor2
65638 , class NextPolicies
65639 >
65640 struct py_iter_
65641 {
65642 py_iter_(Accessor1 const& get_start, Accessor2 const& get_finish)
65643 : m_get_start(get_start)
65644 , m_get_finish(get_finish)
65645 {}
65646 iterator_range<NextPolicies,Iterator>
65647 operator()(back_reference<Target&> x) const
65648 {
65649 detail::demand_iterator_class("iterator", (Iterator*)0, NextPolicies());
65650 return iterator_range<NextPolicies,Iterator>(
65651 x.source()
65652 , m_get_start(x.get())
65653 , m_get_finish(x.get())
65654 );
65655 }
65656 private:
65657 Accessor1 m_get_start;
65658 Accessor2 m_get_finish;
65659 };
65660 template <class Target, class Iterator, class NextPolicies, class Accessor1, class Accessor2>
65661 inline object make_iterator_function(
65662 Accessor1 const& get_start
65663 , Accessor2 const& get_finish
65664 , NextPolicies const&
65665 , Iterator const& (*)()
65666 , boost::type<Target>*
65667 , int
65668 )
65669 {
65670 return make_function(
65671 py_iter_<Target,Iterator,Accessor1,Accessor2,NextPolicies>(get_start, get_finish)
65672 , default_call_policies()
65673 , mpl::vector2<iterator_range<NextPolicies,Iterator>, back_reference<Target&> >()
65674 );
65675 }
65676 template <class Target, class Iterator, class NextPolicies, class Accessor1, class Accessor2>
65677 inline object make_iterator_function(
65678 Accessor1 const& get_start
65679 , Accessor2 const& get_finish
65680 , NextPolicies const& next_policies
65681 , Iterator& (*)()
65682 , boost::type<Target>*
65683 , ...)
65684 {
65685 return make_iterator_function(
65686 get_start
65687 , get_finish
65688 , next_policies
65689 , (Iterator const&(*)())0
65690 , (boost::type<Target>*)0
65691 , 0
65692 );
65693 }
65694 }
65695 template <class Target, class NextPolicies, class Accessor1, class Accessor2>
65696 inline object make_iterator_function(
65697 Accessor1 const& get_start
65698 , Accessor2 const& get_finish
65699 , NextPolicies const& next_policies
65700 , boost::type<Target>* = 0
65701 )
65702 {
65703 typedef typename Accessor1::result_type iterator;
65704 typedef typename add_const<iterator>::type iterator_const;
65705 typedef typename add_reference<iterator_const>::type iterator_cref;
65706 return detail::make_iterator_function(
65707 get_start
65708 , get_finish
65709 , next_policies
65710 , (iterator_cref(*)())0
65711 , (boost::type<Target>*)0
65712 , 0
65713 );
65714 }
65715 template <class NextPolicies, class Iterator>
65716 inline iterator_range<NextPolicies,Iterator>::iterator_range(
65717 object sequence, Iterator start, Iterator finish)
65718 : m_sequence(sequence), m_start(start), m_finish(finish)
65719 {
65720 }
65721 }}}
65722 namespace boost
65723 {
65724 namespace _bi
65725 {
65726 template<class F> class protected_bind_t
65727 {
65728 public:
65729 typedef typename F::result_type result_type;
65730 explicit protected_bind_t(F f): f_(f)
65731 {
65732 }
65733 result_type operator()()
65734 {
65735 return f_();
65736 }
65737 result_type operator()() const
65738 {
65739 return f_();
65740 }
65741 template<class A1> result_type operator()(A1 & a1)
65742 {
65743 return f_(a1);
65744 }
65745 template<class A1> result_type operator()(A1 & a1) const
65746 {
65747 return f_(a1);
65748 }
65749 template<class A1> result_type operator()(const A1 & a1)
65750 {
65751 return f_(a1);
65752 }
65753 template<class A1> result_type operator()(const A1 & a1) const
65754 {
65755 return f_(a1);
65756 }
65757 template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
65758 {
65759 return f_(a1, a2);
65760 }
65761 template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
65762 {
65763 return f_(a1, a2);
65764 }
65765 template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
65766 {
65767 return f_(a1, a2);
65768 }
65769 template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
65770 {
65771 return f_(a1, a2);
65772 }
65773 template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
65774 {
65775 return f_(a1, a2);
65776 }
65777 template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
65778 {
65779 return f_(a1, a2);
65780 }
65781 template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
65782 {
65783 return f_(a1, a2);
65784 }
65785 template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
65786 {
65787 return f_(a1, a2);
65788 }
65789 template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
65790 {
65791 return f_(a1, a2, a3);
65792 }
65793 template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
65794 {
65795 return f_(a1, a2, a3);
65796 }
65797 template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3)
65798 {
65799 return f_(a1, a2, a3);
65800 }
65801 template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const
65802 {
65803 return f_(a1, a2, a3);
65804 }
65805 template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
65806 {
65807 return f_(a1, a2, a3, a4);
65808 }
65809 template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
65810 {
65811 return f_(a1, a2, a3, a4);
65812 }
65813 template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4)
65814 {
65815 return f_(a1, a2, a3, a4);
65816 }
65817 template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const
65818 {
65819 return f_(a1, a2, a3, a4);
65820 }
65821 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
65822 {
65823 return f_(a1, a2, a3, a4, a5);
65824 }
65825 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
65826 {
65827 return f_(a1, a2, a3, a4, a5);
65828 }
65829 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5)
65830 {
65831 return f_(a1, a2, a3, a4, a5);
65832 }
65833 template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const
65834 {
65835 return f_(a1, a2, a3, a4, a5);
65836 }
65837 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
65838 {
65839 return f_(a1, a2, a3, a4, a5, a6);
65840 }
65841 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
65842 {
65843 return f_(a1, a2, a3, a4, a5, a6);
65844 }
65845 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6)
65846 {
65847 return f_(a1, a2, a3, a4, a5, a6);
65848 }
65849 template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const
65850 {
65851 return f_(a1, a2, a3, a4, a5, a6);
65852 }
65853 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
65854 {
65855 return f_(a1, a2, a3, a4, a5, a6, a7);
65856 }
65857 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
65858 {
65859 return f_(a1, a2, a3, a4, a5, a6, a7);
65860 }
65861 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7)
65862 {
65863 return f_(a1, a2, a3, a4, a5, a6, a7);
65864 }
65865 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const
65866 {
65867 return f_(a1, a2, a3, a4, a5, a6, a7);
65868 }
65869 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
65870 {
65871 return f_(a1, a2, a3, a4, a5, a6, a7, a8);
65872 }
65873 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
65874 {
65875 return f_(a1, a2, a3, a4, a5, a6, a7, a8);
65876 }
65877 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8)
65878 {
65879 return f_(a1, a2, a3, a4, a5, a6, a7, a8);
65880 }
65881 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const
65882 {
65883 return f_(a1, a2, a3, a4, a5, a6, a7, a8);
65884 }
65885 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
65886 {
65887 return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
65888 }
65889 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
65890 {
65891 return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
65892 }
65893 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9)
65894 {
65895 return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
65896 }
65897 template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const
65898 {
65899 return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
65900 }
65901 private:
65902 F f_;
65903 };
65904 }
65905 template<class F> _bi::protected_bind_t<F> protect(F f)
65906 {
65907 return _bi::protected_bind_t<F>(f);
65908 }
65909 }
65910 namespace boost { namespace python {
65911 namespace detail
65912 {
65913 template <class Target, class Accessor1, class Accessor2, class NextPolicies>
65914 inline object make_iterator(
65915 Accessor1 get_start
65916 , Accessor2 get_finish
65917 , NextPolicies next_policies
65918 , Target&(*)()
65919 )
65920 {
65921 return objects::make_iterator_function<Target>(
65922 boost::protect(boost::bind(get_start, _1))
65923 , boost::protect(boost::bind(get_finish, _1))
65924 , next_policies
65925 );
65926 }
65927 template <bool const_ = false>
65928 struct iterators_impl
65929 {
65930 template <class T>
65931 struct apply
65932 {
65933 typedef typename T::iterator iterator;
65934 static iterator begin(T& x) { return x.begin(); }
65935 static iterator end(T& x) { return x.end(); }
65936 };
65937 };
65938 template <>
65939 struct iterators_impl<true>
65940 {
65941 template <class T>
65942 struct apply
65943 {
65944 typedef typename T::const_iterator iterator;
65945 static iterator begin(T& x) { return x.begin(); }
65946 static iterator end(T& x) { return x.end(); }
65947 };
65948 };
65949 }
65950 template <class T>
65951 struct iterators
65952 : detail::iterators_impl<
65953 boost::is_const<T>::value
65954 >::template apply<T>
65955 {
65956 };
65957 template <class Accessor1, class Accessor2>
65958 object range(Accessor1 start, Accessor2 finish)
65959 {
65960 return detail::make_iterator(
65961 start, finish
65962 , objects::default_iterator_call_policies()
65963 , detail::target(start)
65964 );
65965 }
65966 template <class NextPolicies, class Accessor1, class Accessor2>
65967 object range(Accessor1 start, Accessor2 finish, NextPolicies* = 0)
65968 {
65969 return detail::make_iterator(start, finish, NextPolicies(), detail::target(start));
65970 }
65971 template <class NextPolicies, class Target, class Accessor1, class Accessor2>
65972 object range(Accessor1 start, Accessor2 finish, NextPolicies* = 0, boost::type<Target>* = 0)
65973 {
65974 return detail::make_iterator(start, finish, NextPolicies(), (Target&(*)())0);
65975 }
65976 template <class Container
65977 , class NextPolicies = objects::default_iterator_call_policies>
65978 struct iterator : object
65979 {
65980 iterator()
65981 : object(
65982 python::range<NextPolicies>(
65983 &iterators<Container>::begin, &iterators<Container>::end
65984 ))
65985 {
65986 }
65987 };
65988 }}
65989 namespace boost { namespace python {
65990 namespace detail
65991 {
65992 struct long_base : object
65993 {
65994 protected:
65995 long_base();
65996 explicit long_base(object_cref rhs);
65997 explicit long_base(object_cref rhs, object_cref base);
65998 inline explicit long_base(python::detail::borrowed_reference p) : object(p) {} inline explicit long_base(python::detail::new_reference p) : object(p) {} inline explicit long_base(python::detail::new_non_null_reference p) : object(p) {}
65999 private:
66000 static detail::new_non_null_reference call(object const&);
66001 static detail::new_non_null_reference call(object const&, object const&);
66002 };
66003 }
66004 class long_ : public detail::long_base
66005 {
66006 typedef detail::long_base base;
66007 public:
66008 long_() {}
66009 template <class T>
66010 explicit long_(T const& rhs)
66011 : detail::long_base(object(rhs))
66012 {
66013 }
66014 template <class T, class U>
66015 explicit long_(T const& rhs, U const& base)
66016 : detail::long_base(object(rhs), object(base))
66017 {
66018 }
66019 public:
66020 inline explicit long_(python::detail::borrowed_reference p) : base(p) {} inline explicit long_(python::detail::new_reference p) : base(p) {} inline explicit long_(python::detail::new_non_null_reference p) : base(p) {}
66021 };
66022 namespace converter
66023 {
66024 template <>
66025 struct object_manager_traits<long_>
66026 : pytype_object_manager_traits<&PyLong_Type,long_>
66027 {
66028 };
66029 }
66030 }}
66031 namespace boost { namespace python {
66032 namespace detail
66033 {
66034 template <class T, class U>
66035 inline type_info extractor_type_id(T&(*)(U))
66036 {
66037 return type_id<T>();
66038 }
66039 template <class Extractor, class U>
66040 struct normalized_extractor
66041 {
66042 static inline void* execute(PyObject* op)
66043 {
66044 typedef typename boost::add_reference<U>::type param;
66045 return &Extractor::execute(
66046 boost::python::detail::void_ptr_to_reference(
66047 op, (param(*)())0 )
66048 );
66049 }
66050 };
66051 template <class Extractor, class T, class U>
66052 inline normalized_extractor<Extractor,U>
66053 normalize(T(*)(U), Extractor* = 0)
66054 {
66055 return normalized_extractor<Extractor, U>();
66056 }
66057 }
66058 template <class InstanceType, class MemberType, MemberType (InstanceType::*member)>
66059 struct extract_member
66060 {
66061 static MemberType& execute(InstanceType& c)
66062 {
66063 (void)(((PyObject*)(&c))->ob_type);
66064 return c.*member;
66065 }
66066 };
66067 template <class InstanceType>
66068 struct extract_identity
66069 {
66070 static InstanceType& execute(InstanceType& c)
66071 {
66072 (void)(((PyObject*)(&c))->ob_type);
66073 return c;
66074 }
66075 };
66076 template <class Extractor, PyTypeObject const* python_type>
66077 struct lvalue_from_pytype
66078 {
66079 lvalue_from_pytype()
66080 {
66081 converter::registry::insert
66082 ( &extract
66083 , detail::extractor_type_id(&Extractor::execute)
66084 , &get_pytype
66085 );
66086 }
66087 private:
66088 static void* extract(PyObject* op)
66089 {
66090 return ((((PyObject*)(op))->ob_type) == (const_cast<PyTypeObject*>(python_type)) || PyType_IsSubtype((((PyObject*)(op))->ob_type), (const_cast<PyTypeObject*>(python_type))))
66091 ? const_cast<void*>(
66092 static_cast<void const volatile*>(
66093 detail::normalize<Extractor>(&Extractor::execute).execute(op)))
66094 : 0
66095 ;
66096 }
66097 static PyTypeObject const*get_pytype() { return python_type; }
66098 };
66099 }}
66100 namespace boost { namespace mpl {
66101 struct has_push_front_arg {};
66102 template< typename Tag >
66103 struct push_front_impl
66104 {
66105 template< typename Sequence, typename T > struct apply
66106 {
66107 struct REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST; typedef struct
66108 REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST45
66109 : boost::mpl::assert_ { static boost::mpl::failed ************ (REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST::************ assert_arg()) ( Sequence ) { return 0; } }
66110 mpl_assert_arg45
66111 ; enum { mpl_assertion_in_line_45 = sizeof( boost::mpl::assertion_failed<(( boost::is_same< T, has_push_front_arg >::value ))>( mpl_assert_arg45::assert_arg() ) ) }
66112 ;
66113 };
66114 };
66115 template< typename Tag >
66116 struct has_push_front_impl
66117 {
66118 template< typename Seq > struct apply
66119 : aux::has_type< push_front< Seq, has_push_front_arg > >
66120 {
66121 };
66122 };
66123 template<> struct push_front_impl<non_sequence_tag> {};
66124 template<> struct has_push_front_impl<non_sequence_tag> {};
66125 }}
66126 namespace boost { namespace mpl {
66127 template<
66128 typename Sequence = na
66129 , typename T = na
66130 >
66131 struct push_front
66132 : push_front_impl< typename sequence_tag<Sequence>::type >
66133 ::template apply< Sequence,T >
66134 {
66135
66136 };
66137 template<
66138 typename Sequence = na
66139 >
66140 struct has_push_front
66141 : has_push_front_impl< typename sequence_tag<Sequence>::type >
66142 ::template apply< Sequence >
66143 {
66144
66145 };
66146 template<> struct push_front< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : push_front< T1 , T2 > { }; }; template< typename Tag > struct lambda< push_front< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef push_front< na , na > result_; typedef push_front< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< push_front< T1 , T2 > > : int_<2> { }; template<> struct template_arity< push_front< na , na > > : int_<-1> { }; }
66147 template<> struct has_push_front< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : has_push_front< T1 > { }; }; template< typename Tag > struct lambda< has_push_front< na > , Tag , int_<-1> > { typedef false_ is_le; typedef has_push_front< na > result_; typedef has_push_front< na > type; }; namespace aux { template< typename T1 > struct template_arity< has_push_front< T1 > > : int_<1> { }; template<> struct template_arity< has_push_front< na > > : int_<-1> { }; }
66148 }}
66149 namespace boost { namespace mpl {
66150 template< typename Tag >
66151 struct pop_front_impl
66152 {
66153 template< typename Sequence > struct apply
66154 ;
66155 };
66156 template<> struct pop_front_impl<non_sequence_tag> {};
66157 }}
66158 namespace boost { namespace mpl {
66159 template<
66160 typename Sequence = na
66161 >
66162 struct pop_front
66163 : pop_front_impl< typename sequence_tag<Sequence>::type >
66164 ::template apply< Sequence >
66165 {
66166
66167 };
66168 template<> struct pop_front< na > { template< typename T1 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : pop_front< T1 > { }; }; template< typename Tag > struct lambda< pop_front< na > , Tag , int_<-1> > { typedef false_ is_le; typedef pop_front< na > result_; typedef pop_front< na > type; }; namespace aux { template< typename T1 > struct template_arity< pop_front< T1 > > : int_<1> { }; template<> struct template_arity< pop_front< na > > : int_<-1> { }; }
66169 }}
66170 namespace boost { namespace python {
66171 namespace detail
66172 {
66173 template <class T>
66174 struct install_holder : converter::context_result_converter
66175 {
66176 install_holder(PyObject* args_)
66177 : m_self(PyTuple_GetItem(args_, 0)) {}
66178 PyObject* operator()(T x) const
66179 {
66180 dispatch(x, is_pointer<T>());
66181 return none();
66182 }
66183 private:
66184 template <class U>
66185 void dispatch(U* x, mpl::true_) const
66186 {
66187 std::auto_ptr<U> owner(x);
66188 dispatch(owner, mpl::false_());
66189 }
66190 template <class Ptr>
66191 void dispatch(Ptr x, mpl::false_) const
66192 {
66193 typedef typename pointee<Ptr>::type value_type;
66194 typedef objects::pointer_holder<Ptr,value_type> holder;
66195 typedef objects::instance<holder> instance_t;
66196 void* memory = holder::allocate(this->m_self, __builtin_offsetof (instance_t, storage), sizeof(holder));
66197 try {
66198 (new (memory) holder(x))->install(this->m_self);
66199 }
66200 catch(...) {
66201 holder::deallocate(this->m_self, memory);
66202 throw;
66203 }
66204 }
66205 PyObject* m_self;
66206 };
66207 struct constructor_result_converter
66208 {
66209 template <class T>
66210 struct apply
66211 {
66212 typedef install_holder<T> type;
66213 };
66214 };
66215 template <class BaseArgs, class Offset>
66216 struct offset_args
66217 {
66218 offset_args(BaseArgs base_) : base(base_) {}
66219 BaseArgs base;
66220 };
66221 template <int N, class BaseArgs, class Offset>
66222 inline PyObject* get(mpl::int_<N>, offset_args<BaseArgs,Offset> const& args_)
66223 {
66224 return get(mpl::int_<(N+Offset::value)>(), args_.base);
66225 }
66226 template <class BaseArgs, class Offset>
66227 inline unsigned arity(offset_args<BaseArgs,Offset> const& args_)
66228 {
66229 return arity(args_.base) - Offset::value;
66230 }
66231 template <class BasePolicy_ = default_call_policies>
66232 struct constructor_policy : BasePolicy_
66233 {
66234 constructor_policy(BasePolicy_ base) : BasePolicy_(base) {}
66235 struct MAKE_CONSTRUCTOR_SUPPLIES_ITS_OWN_RESULT_CONVERTER_THAT_WOULD_OVERRIDE_YOURS; typedef struct
66236 MAKE_CONSTRUCTOR_SUPPLIES_ITS_OWN_RESULT_CONVERTER_THAT_WOULD_OVERRIDE_YOURS122
66237 : boost::mpl::assert_ { static boost::mpl::failed ************ (MAKE_CONSTRUCTOR_SUPPLIES_ITS_OWN_RESULT_CONVERTER_THAT_WOULD_OVERRIDE_YOURS::************ assert_arg()) (typename BasePolicy_::result_converter) { return 0; } }
66238 mpl_assert_arg122
66239 ; enum { mpl_assertion_in_line_122 = sizeof( boost::mpl::assertion_failed<((is_same< typename BasePolicy_::result_converter , default_result_converter >::value))>( mpl_assert_arg122::assert_arg() ) ) }
66240 ;
66241 typedef constructor_result_converter result_converter;
66242 typedef offset_args<typename BasePolicy_::argument_package, mpl::int_<1> > argument_package;
66243 };
66244 template <class InnerSignature>
66245 struct outer_constructor_signature
66246 {
66247 typedef typename mpl::pop_front<InnerSignature>::type inner_args;
66248 typedef typename mpl::push_front<inner_args,object>::type outer_args;
66249 typedef typename mpl::push_front<outer_args,void>::type type;
66250 };
66251 template <>
66252 struct outer_constructor_signature<int>
66253 {
66254 typedef int type;
66255 };
66256 template <class F, class CallPolicies, class Sig>
66257 object make_constructor_aux(
66258 F f
66259 , CallPolicies const& p
66260 , Sig const&
66261 )
66262 {
66263 typedef typename outer_constructor_signature<Sig>::type outer_signature;
66264 typedef constructor_policy<CallPolicies> inner_policy;
66265 return objects::function_object(
66266 objects::py_function(
66267 detail::caller<F,inner_policy,Sig>(f, inner_policy(p))
66268 , outer_signature()
66269 )
66270 );
66271 }
66272 template <class F, class CallPolicies, class Sig, class NumKeywords>
66273 object make_constructor_aux(
66274 F f
66275 , CallPolicies const& p
66276 , Sig const&
66277 , detail::keyword_range const& kw
66278 , NumKeywords
66279 )
66280 {
66281 enum { arity = mpl::size<Sig>::value - 1 };
66282 typedef typename detail::error::more_keywords_than_function_arguments<
66283 NumKeywords::value, arity
66284 >::too_many_keywords assertion;
66285 typedef typename outer_constructor_signature<Sig>::type outer_signature;
66286 typedef constructor_policy<CallPolicies> inner_policy;
66287 return objects::function_object(
66288 objects::py_function(
66289 detail::caller<F,inner_policy,Sig>(f, inner_policy(p))
66290 , outer_signature()
66291 )
66292 , kw
66293 );
66294 }
66295 template <class F, class CallPolicies, class Keywords>
66296 object make_constructor_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_)
66297 {
66298 return detail::make_constructor_aux(
66299 f
66300 , policies
66301 , detail::get_signature(f)
66302 , kw.range()
66303 , mpl::int_<Keywords::size>()
66304 );
66305 }
66306 template <class F, class CallPolicies, class Signature>
66307 object make_constructor_dispatch(F f, CallPolicies const& policies, Signature const& sig, mpl::false_)
66308 {
66309 return detail::make_constructor_aux(
66310 f
66311 , policies
66312 , sig
66313 );
66314 }
66315 }
66316 template <class F>
66317 object make_constructor(F f)
66318 {
66319 return detail::make_constructor_aux(
66320 f,default_call_policies(), detail::get_signature(f));
66321 }
66322 template <class F, class CallPolicies>
66323 object make_constructor(F f, CallPolicies const& policies)
66324 {
66325 return detail::make_constructor_aux(
66326 f, policies, detail::get_signature(f));
66327 }
66328 template <class F, class CallPolicies, class KeywordsOrSignature>
66329 object make_constructor(
66330 F f
66331 , CallPolicies const& policies
66332 , KeywordsOrSignature const& keywords_or_signature)
66333 {
66334 typedef typename
66335 detail::is_reference_to_keywords<KeywordsOrSignature&>::type
66336 is_kw;
66337 return detail::make_constructor_dispatch(
66338 f
66339 , policies
66340 , keywords_or_signature
66341 , is_kw()
66342 );
66343 }
66344 template <class F, class CallPolicies, class Keywords, class Signature>
66345 object make_constructor(
66346 F f
66347 , CallPolicies const& policies
66348 , Keywords const& kw
66349 , Signature const& sig
66350 )
66351 {
66352 return detail::make_constructor_aux(
66353 f
66354 , policies
66355 , sig
66356 , kw.range()
66357 , mpl::int_<Keywords::size>()
66358 );
66359 }
66360 }}
66361 namespace boost { namespace python {
66362 namespace detail
66363 {
66364 template <class R>
66365 struct manage_new_object_requires_a_pointer_return_type
66366 {}
66367 ;
66368 }
66369 struct manage_new_object
66370 {
66371 template <class T>
66372 struct apply
66373 {
66374 typedef typename mpl::if_c<
66375 boost::is_pointer<T>::value
66376 , to_python_indirect<T, detail::make_owning_holder>
66377 , detail::manage_new_object_requires_a_pointer_return_type<T>
66378 >::type type;
66379 };
66380 };
66381 }}
66382 namespace boost { namespace python { namespace detail {
66383 PyObject* init_module(char const* name, void(*)());
66384 }}}
66385 namespace boost { namespace python { namespace numeric {
66386 class array;
66387 namespace aux
66388 {
66389 struct array_base : object
66390 {
66391 array_base( object const& x0);
66392 array_base( object const& x0 , object const& x1);
66393 array_base( object const& x0 , object const& x1 , object const& x2);
66394 array_base( object const& x0 , object const& x1 , object const& x2 , object const& x3);
66395 array_base( object const& x0 , object const& x1 , object const& x2 , object const& x3 , object const& x4);
66396 array_base( object const& x0 , object const& x1 , object const& x2 , object const& x3 , object const& x4 , object const& x5);
66397 array_base( object const& x0 , object const& x1 , object const& x2 , object const& x3 , object const& x4 , object const& x5 , object const& x6);
66398 object argmax(long axis=-1);
66399 object argmin(long axis=-1);
66400 object argsort(long axis=-1);
66401 object astype(object const& type = object());
66402 void byteswap();
66403 object copy() const;
66404 object diagonal(long offset = 0, long axis1 = 0, long axis2 = 1) const;
66405 void info() const;
66406 bool is_c_array() const;
66407 bool isbyteswapped() const;
66408 array new_(object type) const;
66409 void sort();
66410 object trace(long offset = 0, long axis1 = 0, long axis2 = 1) const;
66411 object type() const;
66412 char typecode() const;
66413 object factory(
66414 object const& sequence = object()
66415 , object const& typecode = object()
66416 , bool copy = true
66417 , bool savespace = false
66418 , object type = object()
66419 , object shape = object());
66420 object getflat() const;
66421 long getrank() const;
66422 object getshape() const;
66423 bool isaligned() const;
66424 bool iscontiguous() const;
66425 long itemsize() const;
66426 long nelements() const;
66427 object nonzero() const;
66428 void put(object const& indices, object const& values);
66429 void ravel();
66430 object repeat(object const& repeats, long axis=0);
66431 void resize(object const& shape);
66432 void setflat(object const& flat);
66433 void setshape(object const& shape);
66434 void swapaxes(long axis1, long axis2);
66435 object take(object const& sequence, long axis = 0) const;
66436 void tofile(object const& file) const;
66437 str tostring() const;
66438 void transpose(object const& axes = object());
66439 object view() const;
66440 public:
66441 inline explicit array_base(python::detail::borrowed_reference p) : object(p) {} inline explicit array_base(python::detail::new_reference p) : object(p) {} inline explicit array_base(python::detail::new_non_null_reference p) : object(p) {};
66442 };
66443 struct array_object_manager_traits
66444 {
66445 static bool check(PyObject* obj);
66446 static detail::new_non_null_reference adopt(PyObject* obj);
66447 static PyTypeObject const* get_pytype() ;
66448 };
66449 }
66450 class array : public aux::array_base
66451 {
66452 typedef aux::array_base base;
66453 public:
66454 object astype() { return base::astype(); }
66455 template <class Type>
66456 object astype(Type const& type_)
66457 {
66458 return base::astype(object(type_));
66459 }
66460 template <class Type>
66461 array new_(Type const& type_) const
66462 {
66463 return base::new_(object(type_));
66464 }
66465 template <class Sequence>
66466 void resize(Sequence const& x)
66467 {
66468 base::resize(object(x));
66469 }
66470 void resize( long x0) { resize(make_tuple( x0)); }
66471 void resize( long x0 , long x1) { resize(make_tuple( x0 , x1)); }
66472 void resize( long x0 , long x1 , long x2) { resize(make_tuple( x0 , x1 , x2)); }
66473 void resize( long x0 , long x1 , long x2 , long x3) { resize(make_tuple( x0 , x1 , x2 , x3)); }
66474 void resize( long x0 , long x1 , long x2 , long x3 , long x4) { resize(make_tuple( x0 , x1 , x2 , x3 , x4)); }
66475 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5)); }
66476 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6)); }
66477 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7)); }
66478 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8)); }
66479 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9)); }
66480 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10)); }
66481 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11)); }
66482 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11 , long x12) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12)); }
66483 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11 , long x12 , long x13) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12 , x13)); }
66484 void resize( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11 , long x12 , long x13 , long x14) { resize(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12 , x13 , x14)); }
66485 template <class Sequence>
66486 void setshape(Sequence const& x)
66487 {
66488 base::setshape(object(x));
66489 }
66490 void setshape( long x0) { setshape(make_tuple( x0)); }
66491 void setshape( long x0 , long x1) { setshape(make_tuple( x0 , x1)); }
66492 void setshape( long x0 , long x1 , long x2) { setshape(make_tuple( x0 , x1 , x2)); }
66493 void setshape( long x0 , long x1 , long x2 , long x3) { setshape(make_tuple( x0 , x1 , x2 , x3)); }
66494 void setshape( long x0 , long x1 , long x2 , long x3 , long x4) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4)); }
66495 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5)); }
66496 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6)); }
66497 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7)); }
66498 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8)); }
66499 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9)); }
66500 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10)); }
66501 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11)); }
66502 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11 , long x12) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12)); }
66503 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11 , long x12 , long x13) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12 , x13)); }
66504 void setshape( long x0 , long x1 , long x2 , long x3 , long x4 , long x5 , long x6 , long x7 , long x8 , long x9 , long x10 , long x11 , long x12 , long x13 , long x14) { setshape(make_tuple( x0 , x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12 , x13 , x14)); }
66505 template <class Indices, class Values>
66506 void put(Indices const& indices, Values const& values)
66507 {
66508 base::put(object(indices), object(values));
66509 }
66510 template <class Sequence>
66511 object take(Sequence const& sequence, long axis = 0)
66512 {
66513 return base::take(object(sequence), axis);
66514 }
66515 template <class File>
66516 void tofile(File const& f) const
66517 {
66518 base::tofile(object(f));
66519 }
66520 object factory()
66521 {
66522 return base::factory();
66523 }
66524 template <class Sequence>
66525 object factory(Sequence const& sequence)
66526 {
66527 return base::factory(object(sequence));
66528 }
66529 template <class Sequence, class Typecode>
66530 object factory(
66531 Sequence const& sequence
66532 , Typecode const& typecode_
66533 , bool copy = true
66534 , bool savespace = false
66535 )
66536 {
66537 return base::factory(object(sequence), object(typecode_), copy, savespace);
66538 }
66539 template <class Sequence, class Typecode, class Type>
66540 object factory(
66541 Sequence const& sequence
66542 , Typecode const& typecode_
66543 , bool copy
66544 , bool savespace
66545 , Type const& type
66546 )
66547 {
66548 return base::factory(object(sequence), object(typecode_), copy, savespace, object(type));
66549 }
66550 template <class Sequence, class Typecode, class Type, class Shape>
66551 object factory(
66552 Sequence const& sequence
66553 , Typecode const& typecode_
66554 , bool copy
66555 , bool savespace
66556 , Type const& type
66557 , Shape const& shape
66558 )
66559 {
66560 return base::factory(object(sequence), object(typecode_), copy, savespace, object(type), object(shape));
66561 }
66562 template < class T0> explicit array( T0 const& x0) : base( object(x0)) {}
66563 template < class T0 , class T1> explicit array( T0 const& x0 , T1 const& x1) : base( object(x0) , object(x1)) {}
66564 template < class T0 , class T1 , class T2> explicit array( T0 const& x0 , T1 const& x1 , T2 const& x2) : base( object(x0) , object(x1) , object(x2)) {}
66565 template < class T0 , class T1 , class T2 , class T3> explicit array( T0 const& x0 , T1 const& x1 , T2 const& x2 , T3 const& x3) : base( object(x0) , object(x1) , object(x2) , object(x3)) {}
66566 template < class T0 , class T1 , class T2 , class T3 , class T4> explicit array( T0 const& x0 , T1 const& x1 , T2 const& x2 , T3 const& x3 , T4 const& x4) : base( object(x0) , object(x1) , object(x2) , object(x3) , object(x4)) {}
66567 template < class T0 , class T1 , class T2 , class T3 , class T4 , class T5> explicit array( T0 const& x0 , T1 const& x1 , T2 const& x2 , T3 const& x3 , T4 const& x4 , T5 const& x5) : base( object(x0) , object(x1) , object(x2) , object(x3) , object(x4) , object(x5)) {}
66568 template < class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6> explicit array( T0 const& x0 , T1 const& x1 , T2 const& x2 , T3 const& x3 , T4 const& x4 , T5 const& x5 , T6 const& x6) : base( object(x0) , object(x1) , object(x2) , object(x3) , object(x4) , object(x5) , object(x6)) {}
66569 static void set_module_and_type(char const* package_name = 0, char const* type_attribute_name = 0);
66570 static std::string get_module_name();
66571 public:
66572 inline explicit array(python::detail::borrowed_reference p) : base(p) {} inline explicit array(python::detail::new_reference p) : base(p) {} inline explicit array(python::detail::new_non_null_reference p) : base(p) {};
66573 };
66574 }
66575 namespace converter
66576 {
66577 template <>
66578 struct object_manager_traits< numeric::array >
66579 : numeric::aux::array_object_manager_traits
66580 {
66581 static const bool is_specialized = true;
66582 };
66583 }
66584 }}
66585 namespace boost { namespace python { namespace detail {
66586 extern "C"
66587 {
66588 inline void dealloc(PyObject* self)
66589 {
66590 PyObject_Free(self);
66591 }
66592 }
66593 }}}
66594 namespace boost { namespace python {
66595 template <class Pointee>
66596 struct opaque
66597 {
66598 opaque()
66599 {
66600 if (type_object.tp_name == 0)
66601 {
66602 type_object.tp_name = const_cast<char*>(type_id<Pointee*>().name());
66603 if (PyType_Ready (&type_object) < 0)
66604 {
66605 throw error_already_set();
66606 }
66607 this->register_self();
66608 }
66609 }
66610 static opaque instance;
66611 private:
66612 static void* extract(PyObject* op)
66613 {
66614 return ((((PyObject*)(op))->ob_type) == (&type_object) || PyType_IsSubtype((((PyObject*)(op))->ob_type), (&type_object)))
66615 ? static_cast<python_instance*>(implicit_cast<void*>(op))->x
66616 : 0
66617 ;
66618 }
66619 static PyObject* wrap(void const* px)
66620 {
66621 Pointee* x = *static_cast<Pointee*const*>(px);
66622 if (x == 0)
66623 return detail::none();
66624 if ( python_instance *o = ( (python_instance *) _PyObject_New(&type_object) ) )
66625 {
66626 o->x = x;
66627 return static_cast<PyObject*>(implicit_cast<void*>(o));
66628 }
66629 else
66630 {
66631 throw error_already_set();
66632 }
66633 }
66634 void register_self()
66635 {
66636 converter::registration const *existing =
66637 converter::registry::query (type_id<Pointee*>());
66638 if ((existing == 0) || (existing->m_to_python == 0))
66639 {
66640 converter::registry::insert(&extract, type_id<Pointee>(), &get_pytype);
66641 converter::registry::insert(&wrap, type_id<Pointee*>(), &get_pytype);
66642 }
66643 }
66644 struct python_instance
66645 {
66646 Py_ssize_t ob_refcnt; struct _typeobject *ob_type;
66647 Pointee* x;
66648 };
66649 static PyTypeObject type_object;
66650 static PyTypeObject const *get_pytype(){return &type_object; }
66651 };
66652 template <class Pointee>
66653 opaque<Pointee> opaque<Pointee>::instance;
66654 template <class Pointee>
66655 PyTypeObject opaque<Pointee>::type_object =
66656 {
66657 1, __null, 0,
66658 0,
66659 sizeof( typename opaque<Pointee>::python_instance ),
66660 0,
66661 ::boost::python::detail::dealloc,
66662 0,
66663 0,
66664 0,
66665 0,
66666 0,
66667 0,
66668 0,
66669 0,
66670 0,
66671 0,
66672 0,
66673 0,
66674 0,
66675 0,
66676 0,
66677 0,
66678 0,
66679 0,
66680 0,
66681 0,
66682 0,
66683 0,
66684 0,
66685 0,
66686 0,
66687 0,
66688 0,
66689 0,
66690 0,
66691 0,
66692 0,
66693 0,
66694 0,
66695 0,
66696 0,
66697 0,
66698 0,
66699 0,
66700 0,
66701 0,
66702 0
66703 };
66704 }}
66705 namespace boost { namespace python {
66706 namespace self_ns
66707 {
66708 struct self_t {};
66709 extern self_t self;
66710 }
66711 using self_ns::self_t;
66712 using self_ns::self;
66713 }}
66714 namespace boost { namespace python {
66715 template<class T> struct other
66716 {
66717 typedef T type;
66718 };
66719 namespace detail
66720 {
66721 template<typename T>
66722 class is_other
66723 {
66724 public:
66725 static const bool value = false;
66726 };
66727 template<typename T>
66728 class is_other<other<T> >
66729 {
66730 public:
66731 static const bool value = true;
66732 };
66733 template<typename T>
66734 class unwrap_other
66735 {
66736 public:
66737 typedef T type;
66738 };
66739 template<typename T>
66740 class unwrap_other<other<T> >
66741 {
66742 public:
66743 typedef T type;
66744 };
66745 }
66746 }}
66747
66748
66749 namespace boost {
66750 namespace detail{
66751 template <class T>
66752 struct is_signed_values
66753 {
66754 typedef typename remove_cv<T>::type no_cv_t;
66755 static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
66756 static const no_cv_t zero = (static_cast<no_cv_t>(0));
66757 };
66758 template <class T>
66759 struct is_signed_helper
66760 {
66761 typedef typename remove_cv<T>::type no_cv_t;
66762 static const bool value = (!(::boost::detail::is_signed_values<T>::minus_one > boost::detail::is_signed_values<T>::zero));
66763 };
66764 template <bool integral_type>
66765 struct is_signed_select_helper
66766 {
66767 template <class T>
66768 struct rebind
66769 {
66770 typedef is_signed_helper<T> type;
66771 };
66772 };
66773 template <>
66774 struct is_signed_select_helper<false>
66775 {
66776 template <class T>
66777 struct rebind
66778 {
66779 typedef false_type type;
66780 };
66781 };
66782 template <class T>
66783 struct is_signed_imp
66784 {
66785 typedef is_signed_select_helper<
66786 ::boost::type_traits::ice_or<
66787 ::boost::is_integral<T>::value,
66788 ::boost::is_enum<T>::value>::value
66789 > selector;
66790 typedef typename selector::template rebind<T> binder;
66791 typedef typename binder::type type;
66792 static const bool value = type::value;
66793 };
66794 }
66795 template< typename T > struct is_signed : ::boost::integral_constant<bool,::boost::detail::is_signed_imp<T>::value> { };
66796 }
66797 namespace boost {
66798 namespace detail{
66799 template <class T>
66800 struct is_unsigned_values
66801 {
66802 typedef typename remove_cv<T>::type no_cv_t;
66803 static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
66804 static const no_cv_t zero = (static_cast<no_cv_t>(0));
66805 };
66806 template <class T>
66807 struct is_ununsigned_helper
66808 {
66809 static const bool value = (::boost::detail::is_unsigned_values<T>::minus_one > ::boost::detail::is_unsigned_values<T>::zero);
66810 };
66811 template <bool integral_type>
66812 struct is_ununsigned_select_helper
66813 {
66814 template <class T>
66815 struct rebind
66816 {
66817 typedef is_ununsigned_helper<T> type;
66818 };
66819 };
66820 template <>
66821 struct is_ununsigned_select_helper<false>
66822 {
66823 template <class T>
66824 struct rebind
66825 {
66826 typedef false_type type;
66827 };
66828 };
66829 template <class T>
66830 struct is_unsigned_imp
66831 {
66832 typedef is_ununsigned_select_helper<
66833 ::boost::type_traits::ice_or<
66834 ::boost::is_integral<T>::value,
66835 ::boost::is_enum<T>::value>::value
66836 > selector;
66837 typedef typename selector::template rebind<T> binder;
66838 typedef typename binder::type type;
66839 static const bool value = type::value;
66840 };
66841 }
66842 template< typename T > struct is_unsigned : ::boost::integral_constant<bool,::boost::detail::is_unsigned_imp<T>::value> { };
66843 }
66844 namespace boost {
66845 namespace detail {
66846 template <class T>
66847 struct make_unsigned_imp
66848 {
66849 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_enum<T>::value>::value)) == 0 ? false : true) >)>
66850 boost_static_assert_typedef_39;
66851 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((::boost::type_traits::ice_not< ::boost::is_same< typename remove_cv<T>::type, bool>::value>::value)) == 0 ? false : true) >)>
66852 boost_static_assert_typedef_43;
66853 typedef typename remove_cv<T>::type t_no_cv;
66854 typedef typename mpl::if_c<
66855 (::boost::type_traits::ice_and<
66856 ::boost::is_unsigned<T>::value,
66857 ::boost::is_integral<T>::value,
66858 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
66859 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
66860 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value >::value),
66861 T,
66862 typename mpl::if_c<
66863 (::boost::type_traits::ice_and<
66864 ::boost::is_integral<T>::value,
66865 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
66866 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
66867 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value>
66868 ::value),
66869 typename mpl::if_<
66870 is_same<t_no_cv, signed char>,
66871 unsigned char,
66872 typename mpl::if_<
66873 is_same<t_no_cv, short>,
66874 unsigned short,
66875 typename mpl::if_<
66876 is_same<t_no_cv, int>,
66877 unsigned int,
66878 typename mpl::if_<
66879 is_same<t_no_cv, long>,
66880 unsigned long,
66881 boost::ulong_long_type
66882 >::type
66883 >::type
66884 >::type
66885 >::type,
66886 typename mpl::if_c<
66887 sizeof(t_no_cv) == sizeof(unsigned char),
66888 unsigned char,
66889 typename mpl::if_c<
66890 sizeof(t_no_cv) == sizeof(unsigned short),
66891 unsigned short,
66892 typename mpl::if_c<
66893 sizeof(t_no_cv) == sizeof(unsigned int),
66894 unsigned int,
66895 typename mpl::if_c<
66896 sizeof(t_no_cv) == sizeof(unsigned long),
66897 unsigned long,
66898 boost::ulong_long_type
66899 >::type
66900 >::type
66901 >::type
66902 >::type
66903 >::type
66904 >::type base_integer_type;
66905 typedef typename mpl::if_<
66906 is_const<T>,
66907 typename add_const<base_integer_type>::type,
66908 base_integer_type
66909 >::type const_base_integer_type;
66910 typedef typename mpl::if_<
66911 is_volatile<T>,
66912 typename add_volatile<const_base_integer_type>::type,
66913 const_base_integer_type
66914 >::type type;
66915 };
66916 }
66917 template< typename T > struct make_unsigned { typedef typename boost::detail::make_unsigned_imp<T>::type type; };
66918 }
66919
66920 namespace boost { namespace detail {
66921 class lcast_abstract_stub {};
66922 template<class T>
66923 struct lcast_precision
66924 {
66925 typedef typename boost::mpl::if_<
66926 boost::is_abstract<T>
66927 , std::numeric_limits<lcast_abstract_stub>
66928 , std::numeric_limits<T>
66929 >::type limits;
66930 static const bool use_default_precision = !limits::is_specialized || limits::is_exact
66931 ;
66932 static const bool is_specialized_bin = !use_default_precision && limits::radix == 2 && limits::digits > 0
66933 ;
66934 static const bool is_specialized_dec = !use_default_precision && limits::radix == 10 && limits::digits10 > 0
66935 ;
66936 static const std::streamsize streamsize_max = boost::integer_traits<std::streamsize>::const_max
66937 ;
66938 static const unsigned int precision_dec = limits::digits10 + 1U;
66939 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((!is_specialized_dec || precision_dec <= streamsize_max + 0UL) == 0 ? false : true) >)>
66940 boost_static_assert_typedef_79;
66941 static const unsigned long precision_bin = 2UL + limits::digits * 30103UL / 100000UL
66942 ;
66943 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((!is_specialized_bin || (limits::digits + 0UL < (9223372036854775807L * 2UL + 1UL) / 30103UL && precision_bin > limits::digits10 + 0UL && precision_bin <= streamsize_max + 0UL)) == 0 ? false : true) >)>
66944 boost_static_assert_typedef_89;
66945 static const std::streamsize value = is_specialized_bin ? precision_bin : is_specialized_dec ? precision_dec : 6
66946 ;
66947 };
66948 template<class T>
66949 inline std::streamsize lcast_get_precision(T* = 0)
66950 {
66951 return lcast_precision<T>::value;
66952 }
66953 template<class T>
66954 inline void lcast_set_precision(std::ios_base& stream, T*)
66955 {
66956 stream.precision(lcast_get_precision<T>());
66957 }
66958 template<class Source, class Target>
66959 inline void lcast_set_precision(std::ios_base& stream, Source*, Target*)
66960 {
66961 std::streamsize const s = lcast_get_precision((Source*)0);
66962 std::streamsize const t = lcast_get_precision((Target*)0);
66963 stream.precision(s > t ? s : t);
66964 }
66965 }}
66966
66967
66968
66969
66970 namespace std __attribute__ ((__visibility__ ("default"))) {
66971 using ::clock_t;
66972 using ::time_t;
66973 using ::tm;
66974 using ::clock;
66975 using ::difftime;
66976 using ::mktime;
66977 using ::time;
66978 using ::asctime;
66979 using ::ctime;
66980 using ::gmtime;
66981 using ::localtime;
66982 using ::strftime;
66983 }
66984 namespace std __attribute__ ((__visibility__ ("default"))) {
66985 class time_base
66986 {
66987 public:
66988 enum dateorder { no_order, dmy, mdy, ymd, ydm };
66989 };
66990 template<typename _CharT>
66991 struct __timepunct_cache : public locale::facet
66992 {
66993 static const _CharT* _S_timezones[14];
66994 const _CharT* _M_date_format;
66995 const _CharT* _M_date_era_format;
66996 const _CharT* _M_time_format;
66997 const _CharT* _M_time_era_format;
66998 const _CharT* _M_date_time_format;
66999 const _CharT* _M_date_time_era_format;
67000 const _CharT* _M_am;
67001 const _CharT* _M_pm;
67002 const _CharT* _M_am_pm_format;
67003 const _CharT* _M_day1;
67004 const _CharT* _M_day2;
67005 const _CharT* _M_day3;
67006 const _CharT* _M_day4;
67007 const _CharT* _M_day5;
67008 const _CharT* _M_day6;
67009 const _CharT* _M_day7;
67010 const _CharT* _M_aday1;
67011 const _CharT* _M_aday2;
67012 const _CharT* _M_aday3;
67013 const _CharT* _M_aday4;
67014 const _CharT* _M_aday5;
67015 const _CharT* _M_aday6;
67016 const _CharT* _M_aday7;
67017 const _CharT* _M_month01;
67018 const _CharT* _M_month02;
67019 const _CharT* _M_month03;
67020 const _CharT* _M_month04;
67021 const _CharT* _M_month05;
67022 const _CharT* _M_month06;
67023 const _CharT* _M_month07;
67024 const _CharT* _M_month08;
67025 const _CharT* _M_month09;
67026 const _CharT* _M_month10;
67027 const _CharT* _M_month11;
67028 const _CharT* _M_month12;
67029 const _CharT* _M_amonth01;
67030 const _CharT* _M_amonth02;
67031 const _CharT* _M_amonth03;
67032 const _CharT* _M_amonth04;
67033 const _CharT* _M_amonth05;
67034 const _CharT* _M_amonth06;
67035 const _CharT* _M_amonth07;
67036 const _CharT* _M_amonth08;
67037 const _CharT* _M_amonth09;
67038 const _CharT* _M_amonth10;
67039 const _CharT* _M_amonth11;
67040 const _CharT* _M_amonth12;
67041 bool _M_allocated;
67042 __timepunct_cache(size_t __refs = 0) : facet(__refs),
67043 _M_date_format(__null), _M_date_era_format(__null), _M_time_format(__null),
67044 _M_time_era_format(__null), _M_date_time_format(__null),
67045 _M_date_time_era_format(__null), _M_am(__null), _M_pm(__null),
67046 _M_am_pm_format(__null), _M_day1(__null), _M_day2(__null), _M_day3(__null),
67047 _M_day4(__null), _M_day5(__null), _M_day6(__null), _M_day7(__null),
67048 _M_aday1(__null), _M_aday2(__null), _M_aday3(__null), _M_aday4(__null),
67049 _M_aday5(__null), _M_aday6(__null), _M_aday7(__null), _M_month01(__null),
67050 _M_month02(__null), _M_month03(__null), _M_month04(__null), _M_month05(__null),
67051 _M_month06(__null), _M_month07(__null), _M_month08(__null), _M_month09(__null),
67052 _M_month10(__null), _M_month11(__null), _M_month12(__null), _M_amonth01(__null),
67053 _M_amonth02(__null), _M_amonth03(__null), _M_amonth04(__null),
67054 _M_amonth05(__null), _M_amonth06(__null), _M_amonth07(__null),
67055 _M_amonth08(__null), _M_amonth09(__null), _M_amonth10(__null),
67056 _M_amonth11(__null), _M_amonth12(__null), _M_allocated(false)
67057 { }
67058 ~__timepunct_cache();
67059 void
67060 _M_cache(const locale& __loc);
67061 private:
67062 __timepunct_cache&
67063 operator=(const __timepunct_cache&);
67064 explicit
67065 __timepunct_cache(const __timepunct_cache&);
67066 };
67067 template<typename _CharT>
67068 __timepunct_cache<_CharT>::~__timepunct_cache()
67069 {
67070 if (_M_allocated)
67071 {
67072 }
67073 }
67074 template<>
67075 const char*
67076 __timepunct_cache<char>::_S_timezones[14];
67077 template<>
67078 const wchar_t*
67079 __timepunct_cache<wchar_t>::_S_timezones[14];
67080 template<typename _CharT>
67081 const _CharT* __timepunct_cache<_CharT>::_S_timezones[14];
67082 template<typename _CharT>
67083 class __timepunct : public locale::facet
67084 {
67085 public:
67086 typedef _CharT __char_type;
67087 typedef basic_string<_CharT> __string_type;
67088 typedef __timepunct_cache<_CharT> __cache_type;
67089 protected:
67090 __cache_type* _M_data;
67091 __c_locale _M_c_locale_timepunct;
67092 const char* _M_name_timepunct;
67093 public:
67094 static locale::id id;
67095 explicit
67096 __timepunct(size_t __refs = 0);
67097 explicit
67098 __timepunct(__cache_type* __cache, size_t __refs = 0);
67099 explicit
67100 __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);
67101 void
67102 _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
67103 const tm* __tm) const throw ();
67104 void
67105 _M_date_formats(const _CharT** __date) const
67106 {
67107 __date[0] = _M_data->_M_date_format;
67108 __date[1] = _M_data->_M_date_era_format;
67109 }
67110 void
67111 _M_time_formats(const _CharT** __time) const
67112 {
67113 __time[0] = _M_data->_M_time_format;
67114 __time[1] = _M_data->_M_time_era_format;
67115 }
67116 void
67117 _M_date_time_formats(const _CharT** __dt) const
67118 {
67119 __dt[0] = _M_data->_M_date_time_format;
67120 __dt[1] = _M_data->_M_date_time_era_format;
67121 }
67122 void
67123 _M_am_pm_format(const _CharT* __ampm) const
67124 { __ampm = _M_data->_M_am_pm_format; }
67125 void
67126 _M_am_pm(const _CharT** __ampm) const
67127 {
67128 __ampm[0] = _M_data->_M_am;
67129 __ampm[1] = _M_data->_M_pm;
67130 }
67131 void
67132 _M_days(const _CharT** __days) const
67133 {
67134 __days[0] = _M_data->_M_day1;
67135 __days[1] = _M_data->_M_day2;
67136 __days[2] = _M_data->_M_day3;
67137 __days[3] = _M_data->_M_day4;
67138 __days[4] = _M_data->_M_day5;
67139 __days[5] = _M_data->_M_day6;
67140 __days[6] = _M_data->_M_day7;
67141 }
67142 void
67143 _M_days_abbreviated(const _CharT** __days) const
67144 {
67145 __days[0] = _M_data->_M_aday1;
67146 __days[1] = _M_data->_M_aday2;
67147 __days[2] = _M_data->_M_aday3;
67148 __days[3] = _M_data->_M_aday4;
67149 __days[4] = _M_data->_M_aday5;
67150 __days[5] = _M_data->_M_aday6;
67151 __days[6] = _M_data->_M_aday7;
67152 }
67153 void
67154 _M_months(const _CharT** __months) const
67155 {
67156 __months[0] = _M_data->_M_month01;
67157 __months[1] = _M_data->_M_month02;
67158 __months[2] = _M_data->_M_month03;
67159 __months[3] = _M_data->_M_month04;
67160 __months[4] = _M_data->_M_month05;
67161 __months[5] = _M_data->_M_month06;
67162 __months[6] = _M_data->_M_month07;
67163 __months[7] = _M_data->_M_month08;
67164 __months[8] = _M_data->_M_month09;
67165 __months[9] = _M_data->_M_month10;
67166 __months[10] = _M_data->_M_month11;
67167 __months[11] = _M_data->_M_month12;
67168 }
67169 void
67170 _M_months_abbreviated(const _CharT** __months) const
67171 {
67172 __months[0] = _M_data->_M_amonth01;
67173 __months[1] = _M_data->_M_amonth02;
67174 __months[2] = _M_data->_M_amonth03;
67175 __months[3] = _M_data->_M_amonth04;
67176 __months[4] = _M_data->_M_amonth05;
67177 __months[5] = _M_data->_M_amonth06;
67178 __months[6] = _M_data->_M_amonth07;
67179 __months[7] = _M_data->_M_amonth08;
67180 __months[8] = _M_data->_M_amonth09;
67181 __months[9] = _M_data->_M_amonth10;
67182 __months[10] = _M_data->_M_amonth11;
67183 __months[11] = _M_data->_M_amonth12;
67184 }
67185 protected:
67186 virtual
67187 ~__timepunct();
67188 void
67189 _M_initialize_timepunct(__c_locale __cloc = __null);
67190 };
67191 template<typename _CharT>
67192 locale::id __timepunct<_CharT>::id;
67193 template<>
67194 void
67195 __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
67196 template<>
67197 void
67198 __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const throw ();
67199 template<>
67200 void
67201 __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
67202 template<>
67203 void
67204 __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*,
67205 const tm*) const throw ();
67206 }
67207 namespace std __attribute__ ((__visibility__ ("default"))) {
67208 template<typename _CharT>
67209 __timepunct<_CharT>::__timepunct(size_t __refs)
67210 : facet(__refs), _M_data(__null), _M_c_locale_timepunct(__null),
67211 _M_name_timepunct(_S_get_c_name())
67212 { _M_initialize_timepunct(); }
67213 template<typename _CharT>
67214 __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
67215 : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(__null),
67216 _M_name_timepunct(_S_get_c_name())
67217 { _M_initialize_timepunct(); }
67218 template<typename _CharT>
67219 __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
67220 size_t __refs)
67221 : facet(__refs), _M_data(__null), _M_c_locale_timepunct(__null),
67222 _M_name_timepunct(__null)
67223 {
67224 if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
67225 {
67226 const size_t __len = __builtin_strlen(__s) + 1;
67227 char* __tmp = new char[__len];
67228 __builtin_memcpy(__tmp, __s, __len);
67229 _M_name_timepunct = __tmp;
67230 }
67231 else
67232 _M_name_timepunct = _S_get_c_name();
67233 try
67234 { _M_initialize_timepunct(__cloc); }
67235 catch(...)
67236 {
67237 if (_M_name_timepunct != _S_get_c_name())
67238 delete [] _M_name_timepunct;
67239 throw;
67240 }
67241 }
67242 template<typename _CharT>
67243 __timepunct<_CharT>::~__timepunct()
67244 {
67245 if (_M_name_timepunct != _S_get_c_name())
67246 delete [] _M_name_timepunct;
67247 delete _M_data;
67248 _S_destroy_c_locale(_M_c_locale_timepunct);
67249 }
67250 }
67251 namespace std __attribute__ ((__visibility__ ("default"))) {
67252 template<typename _CharT, typename _InIter>
67253 class time_get : public locale::facet, public time_base
67254 {
67255 public:
67256 typedef _CharT char_type;
67257 typedef _InIter iter_type;
67258 typedef basic_string<_CharT> __string_type;
67259 static locale::id id;
67260 explicit
67261 time_get(size_t __refs = 0)
67262 : facet (__refs) { }
67263 dateorder
67264 date_order() const
67265 { return this->do_date_order(); }
67266 iter_type
67267 get_time(iter_type __beg, iter_type __end, ios_base& __io,
67268 ios_base::iostate& __err, tm* __tm) const
67269 { return this->do_get_time(__beg, __end, __io, __err, __tm); }
67270 iter_type
67271 get_date(iter_type __beg, iter_type __end, ios_base& __io,
67272 ios_base::iostate& __err, tm* __tm) const
67273 { return this->do_get_date(__beg, __end, __io, __err, __tm); }
67274 iter_type
67275 get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
67276 ios_base::iostate& __err, tm* __tm) const
67277 { return this->do_get_weekday(__beg, __end, __io, __err, __tm); }
67278 iter_type
67279 get_monthname(iter_type __beg, iter_type __end, ios_base& __io,
67280 ios_base::iostate& __err, tm* __tm) const
67281 { return this->do_get_monthname(__beg, __end, __io, __err, __tm); }
67282 iter_type
67283 get_year(iter_type __beg, iter_type __end, ios_base& __io,
67284 ios_base::iostate& __err, tm* __tm) const
67285 { return this->do_get_year(__beg, __end, __io, __err, __tm); }
67286 protected:
67287 virtual
67288 ~time_get() { }
67289 virtual dateorder
67290 do_date_order() const;
67291 virtual iter_type
67292 do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
67293 ios_base::iostate& __err, tm* __tm) const;
67294 virtual iter_type
67295 do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
67296 ios_base::iostate& __err, tm* __tm) const;
67297 virtual iter_type
67298 do_get_weekday(iter_type __beg, iter_type __end, ios_base&,
67299 ios_base::iostate& __err, tm* __tm) const;
67300 virtual iter_type
67301 do_get_monthname(iter_type __beg, iter_type __end, ios_base&,
67302 ios_base::iostate& __err, tm* __tm) const;
67303 virtual iter_type
67304 do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
67305 ios_base::iostate& __err, tm* __tm) const;
67306 iter_type
67307 _M_extract_num(iter_type __beg, iter_type __end, int& __member,
67308 int __min, int __max, size_t __len,
67309 ios_base& __io, ios_base::iostate& __err) const;
67310 iter_type
67311 _M_extract_name(iter_type __beg, iter_type __end, int& __member,
67312 const _CharT** __names, size_t __indexlen,
67313 ios_base& __io, ios_base::iostate& __err) const;
67314 iter_type
67315 _M_extract_wday_or_month(iter_type __beg, iter_type __end, int& __member,
67316 const _CharT** __names, size_t __indexlen,
67317 ios_base& __io, ios_base::iostate& __err) const;
67318 iter_type
67319 _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
67320 ios_base::iostate& __err, tm* __tm,
67321 const _CharT* __format) const;
67322 };
67323 template<typename _CharT, typename _InIter>
67324 locale::id time_get<_CharT, _InIter>::id;
67325 template<typename _CharT, typename _InIter>
67326 class time_get_byname : public time_get<_CharT, _InIter>
67327 {
67328 public:
67329 typedef _CharT char_type;
67330 typedef _InIter iter_type;
67331 explicit
67332 time_get_byname(const char*, size_t __refs = 0)
67333 : time_get<_CharT, _InIter>(__refs) { }
67334 protected:
67335 virtual
67336 ~time_get_byname() { }
67337 };
67338 template<typename _CharT, typename _OutIter>
67339 class time_put : public locale::facet
67340 {
67341 public:
67342 typedef _CharT char_type;
67343 typedef _OutIter iter_type;
67344 static locale::id id;
67345 explicit
67346 time_put(size_t __refs = 0)
67347 : facet(__refs) { }
67348 iter_type
67349 put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
67350 const _CharT* __beg, const _CharT* __end) const;
67351 iter_type
67352 put(iter_type __s, ios_base& __io, char_type __fill,
67353 const tm* __tm, char __format, char __mod = 0) const
67354 { return this->do_put(__s, __io, __fill, __tm, __format, __mod); }
67355 protected:
67356 virtual
67357 ~time_put()
67358 { }
67359 virtual iter_type
67360 do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
67361 char __format, char __mod) const;
67362 };
67363 template<typename _CharT, typename _OutIter>
67364 locale::id time_put<_CharT, _OutIter>::id;
67365 template<typename _CharT, typename _OutIter>
67366 class time_put_byname : public time_put<_CharT, _OutIter>
67367 {
67368 public:
67369 typedef _CharT char_type;
67370 typedef _OutIter iter_type;
67371 explicit
67372 time_put_byname(const char*, size_t __refs = 0)
67373 : time_put<_CharT, _OutIter>(__refs)
67374 { };
67375 protected:
67376 virtual
67377 ~time_put_byname() { }
67378 };
67379 class money_base
67380 {
67381 public:
67382 enum part { none, space, symbol, sign, value };
67383 struct pattern { char field[4]; };
67384 static const pattern _S_default_pattern;
67385 enum
67386 {
67387 _S_minus,
67388 _S_zero,
67389 _S_end = 11
67390 };
67391 static const char* _S_atoms;
67392 __attribute__ ((__const__)) static pattern
67393 _S_construct_pattern(char __precedes, char __space, char __posn) throw ();
67394 };
67395 template<typename _CharT, bool _Intl>
67396 struct __moneypunct_cache : public locale::facet
67397 {
67398 const char* _M_grouping;
67399 size_t _M_grouping_size;
67400 bool _M_use_grouping;
67401 _CharT _M_decimal_point;
67402 _CharT _M_thousands_sep;
67403 const _CharT* _M_curr_symbol;
67404 size_t _M_curr_symbol_size;
67405 const _CharT* _M_positive_sign;
67406 size_t _M_positive_sign_size;
67407 const _CharT* _M_negative_sign;
67408 size_t _M_negative_sign_size;
67409 int _M_frac_digits;
67410 money_base::pattern _M_pos_format;
67411 money_base::pattern _M_neg_format;
67412 _CharT _M_atoms[money_base::_S_end];
67413 bool _M_allocated;
67414 __moneypunct_cache(size_t __refs = 0) : facet(__refs),
67415 _M_grouping(__null), _M_grouping_size(0), _M_use_grouping(false),
67416 _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()),
67417 _M_curr_symbol(__null), _M_curr_symbol_size(0),
67418 _M_positive_sign(__null), _M_positive_sign_size(0),
67419 _M_negative_sign(__null), _M_negative_sign_size(0),
67420 _M_frac_digits(0),
67421 _M_pos_format(money_base::pattern()),
67422 _M_neg_format(money_base::pattern()), _M_allocated(false)
67423 { }
67424 ~__moneypunct_cache();
67425 void
67426 _M_cache(const locale& __loc);
67427 private:
67428 __moneypunct_cache&
67429 operator=(const __moneypunct_cache&);
67430 explicit
67431 __moneypunct_cache(const __moneypunct_cache&);
67432 };
67433 template<typename _CharT, bool _Intl>
67434 __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache()
67435 {
67436 if (_M_allocated)
67437 {
67438 delete [] _M_grouping;
67439 delete [] _M_curr_symbol;
67440 delete [] _M_positive_sign;
67441 delete [] _M_negative_sign;
67442 }
67443 }
67444 template<typename _CharT, bool _Intl>
67445 class moneypunct : public locale::facet, public money_base
67446 {
67447 public:
67448 typedef _CharT char_type;
67449 typedef basic_string<_CharT> string_type;
67450 typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
67451 private:
67452 __cache_type* _M_data;
67453 public:
67454 static const bool intl = _Intl;
67455 static locale::id id;
67456 explicit
67457 moneypunct(size_t __refs = 0) : facet(__refs), _M_data(__null)
67458 { _M_initialize_moneypunct(); }
67459 explicit
67460 moneypunct(__cache_type* __cache, size_t __refs = 0)
67461 : facet(__refs), _M_data(__cache)
67462 { _M_initialize_moneypunct(); }
67463 explicit
67464 moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
67465 : facet(__refs), _M_data(__null)
67466 { _M_initialize_moneypunct(__cloc, __s); }
67467 char_type
67468 decimal_point() const
67469 { return this->do_decimal_point(); }
67470 char_type
67471 thousands_sep() const
67472 { return this->do_thousands_sep(); }
67473 string
67474 grouping() const
67475 { return this->do_grouping(); }
67476 string_type
67477 curr_symbol() const
67478 { return this->do_curr_symbol(); }
67479 string_type
67480 positive_sign() const
67481 { return this->do_positive_sign(); }
67482 string_type
67483 negative_sign() const
67484 { return this->do_negative_sign(); }
67485 int
67486 frac_digits() const
67487 { return this->do_frac_digits(); }
67488 pattern
67489 pos_format() const
67490 { return this->do_pos_format(); }
67491 pattern
67492 neg_format() const
67493 { return this->do_neg_format(); }
67494 protected:
67495 virtual
67496 ~moneypunct();
67497 virtual char_type
67498 do_decimal_point() const
67499 { return _M_data->_M_decimal_point; }
67500 virtual char_type
67501 do_thousands_sep() const
67502 { return _M_data->_M_thousands_sep; }
67503 virtual string
67504 do_grouping() const
67505 { return _M_data->_M_grouping; }
67506 virtual string_type
67507 do_curr_symbol() const
67508 { return _M_data->_M_curr_symbol; }
67509 virtual string_type
67510 do_positive_sign() const
67511 { return _M_data->_M_positive_sign; }
67512 virtual string_type
67513 do_negative_sign() const
67514 { return _M_data->_M_negative_sign; }
67515 virtual int
67516 do_frac_digits() const
67517 { return _M_data->_M_frac_digits; }
67518 virtual pattern
67519 do_pos_format() const
67520 { return _M_data->_M_pos_format; }
67521 virtual pattern
67522 do_neg_format() const
67523 { return _M_data->_M_neg_format; }
67524 void
67525 _M_initialize_moneypunct(__c_locale __cloc = __null,
67526 const char* __name = __null);
67527 };
67528 template<typename _CharT, bool _Intl>
67529 locale::id moneypunct<_CharT, _Intl>::id;
67530 template<typename _CharT, bool _Intl>
67531 const bool moneypunct<_CharT, _Intl>::intl;
67532 template<>
67533 moneypunct<char, true>::~moneypunct();
67534 template<>
67535 moneypunct<char, false>::~moneypunct();
67536 template<>
67537 void
67538 moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);
67539 template<>
67540 void
67541 moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
67542 template<>
67543 moneypunct<wchar_t, true>::~moneypunct();
67544 template<>
67545 moneypunct<wchar_t, false>::~moneypunct();
67546 template<>
67547 void
67548 moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
67549 const char*);
67550 template<>
67551 void
67552 moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
67553 const char*);
67554 template<typename _CharT, bool _Intl>
67555 class moneypunct_byname : public moneypunct<_CharT, _Intl>
67556 {
67557 public:
67558 typedef _CharT char_type;
67559 typedef basic_string<_CharT> string_type;
67560 static const bool intl = _Intl;
67561 explicit
67562 moneypunct_byname(const char* __s, size_t __refs = 0)
67563 : moneypunct<_CharT, _Intl>(__refs)
67564 {
67565 if (__builtin_strcmp(__s, "C") != 0
67566 && __builtin_strcmp(__s, "POSIX") != 0)
67567 {
67568 __c_locale __tmp;
67569 this->_S_create_c_locale(__tmp, __s);
67570 this->_M_initialize_moneypunct(__tmp);
67571 this->_S_destroy_c_locale(__tmp);
67572 }
67573 }
67574 protected:
67575 virtual
67576 ~moneypunct_byname() { }
67577 };
67578 template<typename _CharT, bool _Intl>
67579 const bool moneypunct_byname<_CharT, _Intl>::intl;
67580 template<typename _CharT, typename _InIter>
67581 class money_get : public locale::facet
67582 {
67583 public:
67584 typedef _CharT char_type;
67585 typedef _InIter iter_type;
67586 typedef basic_string<_CharT> string_type;
67587 static locale::id id;
67588 explicit
67589 money_get(size_t __refs = 0) : facet(__refs) { }
67590 iter_type
67591 get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
67592 ios_base::iostate& __err, long double& __units) const
67593 { return this->do_get(__s, __end, __intl, __io, __err, __units); }
67594 iter_type
67595 get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
67596 ios_base::iostate& __err, string_type& __digits) const
67597 { return this->do_get(__s, __end, __intl, __io, __err, __digits); }
67598 protected:
67599 virtual
67600 ~money_get() { }
67601 virtual iter_type
67602 do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
67603 ios_base::iostate& __err, long double& __units) const;
67604 virtual iter_type
67605 do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
67606 ios_base::iostate& __err, string_type& __digits) const;
67607 template<bool _Intl>
67608 iter_type
67609 _M_extract(iter_type __s, iter_type __end, ios_base& __io,
67610 ios_base::iostate& __err, string& __digits) const;
67611 };
67612 template<typename _CharT, typename _InIter>
67613 locale::id money_get<_CharT, _InIter>::id;
67614 template<typename _CharT, typename _OutIter>
67615 class money_put : public locale::facet
67616 {
67617 public:
67618 typedef _CharT char_type;
67619 typedef _OutIter iter_type;
67620 typedef basic_string<_CharT> string_type;
67621 static locale::id id;
67622 explicit
67623 money_put(size_t __refs = 0) : facet(__refs) { }
67624 iter_type
67625 put(iter_type __s, bool __intl, ios_base& __io,
67626 char_type __fill, long double __units) const
67627 { return this->do_put(__s, __intl, __io, __fill, __units); }
67628 iter_type
67629 put(iter_type __s, bool __intl, ios_base& __io,
67630 char_type __fill, const string_type& __digits) const
67631 { return this->do_put(__s, __intl, __io, __fill, __digits); }
67632 protected:
67633 virtual
67634 ~money_put() { }
67635 virtual iter_type
67636 do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
67637 long double __units) const;
67638 virtual iter_type
67639 do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
67640 const string_type& __digits) const;
67641 template<bool _Intl>
67642 iter_type
67643 _M_insert(iter_type __s, ios_base& __io, char_type __fill,
67644 const string_type& __digits) const;
67645 };
67646 template<typename _CharT, typename _OutIter>
67647 locale::id money_put<_CharT, _OutIter>::id;
67648 struct messages_base
67649 {
67650 typedef int catalog;
67651 };
67652 template<typename _CharT>
67653 class messages : public locale::facet, public messages_base
67654 {
67655 public:
67656 typedef _CharT char_type;
67657 typedef basic_string<_CharT> string_type;
67658 protected:
67659 __c_locale _M_c_locale_messages;
67660 const char* _M_name_messages;
67661 public:
67662 static locale::id id;
67663 explicit
67664 messages(size_t __refs = 0);
67665 explicit
67666 messages(__c_locale __cloc, const char* __s, size_t __refs = 0);
67667 catalog
67668 open(const basic_string<char>& __s, const locale& __loc) const
67669 { return this->do_open(__s, __loc); }
67670 catalog
67671 open(const basic_string<char>&, const locale&, const char*) const;
67672 string_type
67673 get(catalog __c, int __set, int __msgid, const string_type& __s) const
67674 { return this->do_get(__c, __set, __msgid, __s); }
67675 void
67676 close(catalog __c) const
67677 { return this->do_close(__c); }
67678 protected:
67679 virtual
67680 ~messages();
67681 virtual catalog
67682 do_open(const basic_string<char>&, const locale&) const;
67683 virtual string_type
67684 do_get(catalog, int, int, const string_type& __dfault) const;
67685 virtual void
67686 do_close(catalog) const;
67687 char*
67688 _M_convert_to_char(const string_type& __msg) const
67689 {
67690 return reinterpret_cast<char*>(const_cast<_CharT*>(__msg.c_str()));
67691 }
67692 string_type
67693 _M_convert_from_char(char*) const
67694 {
67695 return string_type();
67696 }
67697 };
67698 template<typename _CharT>
67699 locale::id messages<_CharT>::id;
67700 template<>
67701 string
67702 messages<char>::do_get(catalog, int, int, const string&) const;
67703 template<>
67704 wstring
67705 messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
67706 template<typename _CharT>
67707 class messages_byname : public messages<_CharT>
67708 {
67709 public:
67710 typedef _CharT char_type;
67711 typedef basic_string<_CharT> string_type;
67712 explicit
67713 messages_byname(const char* __s, size_t __refs = 0);
67714 protected:
67715 virtual
67716 ~messages_byname()
67717 { }
67718 };
67719 }
67720 extern "C" {
67721 extern char *gettext (__const char *__msgid)
67722 throw () __attribute__ ((__format_arg__ (1)));
67723 extern char *dgettext (__const char *__domainname, __const char *__msgid)
67724 throw () __attribute__ ((__format_arg__ (2)));
67725 extern char *__dgettext (__const char *__domainname, __const char *__msgid)
67726 throw () __attribute__ ((__format_arg__ (2)));
67727 extern char *dcgettext (__const char *__domainname,
67728 __const char *__msgid, int __category)
67729 throw () __attribute__ ((__format_arg__ (2)));
67730 extern char *__dcgettext (__const char *__domainname,
67731 __const char *__msgid, int __category)
67732 throw () __attribute__ ((__format_arg__ (2)));
67733 extern char *ngettext (__const char *__msgid1, __const char *__msgid2,
67734 unsigned long int __n)
67735 throw () __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));
67736 extern char *dngettext (__const char *__domainname, __const char *__msgid1,
67737 __const char *__msgid2, unsigned long int __n)
67738 throw () __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));
67739 extern char *dcngettext (__const char *__domainname, __const char *__msgid1,
67740 __const char *__msgid2, unsigned long int __n,
67741 int __category)
67742 throw () __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));
67743 extern char *textdomain (__const char *__domainname) throw ();
67744 extern char *bindtextdomain (__const char *__domainname,
67745 __const char *__dirname) throw ();
67746 extern char *bind_textdomain_codeset (__const char *__domainname,
67747 __const char *__codeset) throw ();
67748 }
67749 namespace std __attribute__ ((__visibility__ ("default"))) {
67750 template<typename _CharT>
67751 messages<_CharT>::messages(size_t __refs)
67752 : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
67753 _M_name_messages(_S_get_c_name())
67754 { }
67755 template<typename _CharT>
67756 messages<_CharT>::messages(__c_locale __cloc, const char* __s,
67757 size_t __refs)
67758 : facet(__refs), _M_c_locale_messages(__null), _M_name_messages(__null)
67759 {
67760 if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
67761 {
67762 const size_t __len = __builtin_strlen(__s) + 1;
67763 char* __tmp = new char[__len];
67764 __builtin_memcpy(__tmp, __s, __len);
67765 _M_name_messages = __tmp;
67766 }
67767 else
67768 _M_name_messages = _S_get_c_name();
67769 _M_c_locale_messages = _S_clone_c_locale(__cloc);
67770 }
67771 template<typename _CharT>
67772 typename messages<_CharT>::catalog
67773 messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
67774 const char* __dir) const
67775 {
67776 bindtextdomain(__s.c_str(), __dir);
67777 return this->do_open(__s, __loc);
67778 }
67779 template<typename _CharT>
67780 messages<_CharT>::~messages()
67781 {
67782 if (_M_name_messages != _S_get_c_name())
67783 delete [] _M_name_messages;
67784 _S_destroy_c_locale(_M_c_locale_messages);
67785 }
67786 template<typename _CharT>
67787 typename messages<_CharT>::catalog
67788 messages<_CharT>::do_open(const basic_string<char>& __s,
67789 const locale&) const
67790 {
67791 textdomain(__s.c_str());
67792 return 0;
67793 }
67794 template<typename _CharT>
67795 void
67796 messages<_CharT>::do_close(catalog) const
67797 { }
67798 template<typename _CharT>
67799 messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
67800 : messages<_CharT>(__refs)
67801 {
67802 if (this->_M_name_messages != locale::facet::_S_get_c_name())
67803 {
67804 delete [] this->_M_name_messages;
67805 if (__builtin_strcmp(__s, locale::facet::_S_get_c_name()) != 0)
67806 {
67807 const size_t __len = __builtin_strlen(__s) + 1;
67808 char* __tmp = new char[__len];
67809 __builtin_memcpy(__tmp, __s, __len);
67810 this->_M_name_messages = __tmp;
67811 }
67812 else
67813 this->_M_name_messages = locale::facet::_S_get_c_name();
67814 }
67815 if (__builtin_strcmp(__s, "C") != 0
67816 && __builtin_strcmp(__s, "POSIX") != 0)
67817 {
67818 this->_S_destroy_c_locale(this->_M_c_locale_messages);
67819 this->_S_create_c_locale(this->_M_c_locale_messages, __s);
67820 }
67821 }
67822 }
67823
67824 namespace std __attribute__ ((__visibility__ ("default"))) {
67825 class codecvt_base
67826 {
67827 public:
67828 enum result
67829 {
67830 ok,
67831 partial,
67832 error,
67833 noconv
67834 };
67835 };
67836 template<typename _InternT, typename _ExternT, typename _StateT>
67837 class __codecvt_abstract_base
67838 : public locale::facet, public codecvt_base
67839 {
67840 public:
67841 typedef codecvt_base::result result;
67842 typedef _InternT intern_type;
67843 typedef _ExternT extern_type;
67844 typedef _StateT state_type;
67845 result
67846 out(state_type& __state, const intern_type* __from,
67847 const intern_type* __from_end, const intern_type*& __from_next,
67848 extern_type* __to, extern_type* __to_end,
67849 extern_type*& __to_next) const
67850 {
67851 return this->do_out(__state, __from, __from_end, __from_next,
67852 __to, __to_end, __to_next);
67853 }
67854 result
67855 unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
67856 extern_type*& __to_next) const
67857 { return this->do_unshift(__state, __to,__to_end,__to_next); }
67858 result
67859 in(state_type& __state, const extern_type* __from,
67860 const extern_type* __from_end, const extern_type*& __from_next,
67861 intern_type* __to, intern_type* __to_end,
67862 intern_type*& __to_next) const
67863 {
67864 return this->do_in(__state, __from, __from_end, __from_next,
67865 __to, __to_end, __to_next);
67866 }
67867 int
67868 encoding() const throw()
67869 { return this->do_encoding(); }
67870 bool
67871 always_noconv() const throw()
67872 { return this->do_always_noconv(); }
67873 int
67874 length(state_type& __state, const extern_type* __from,
67875 const extern_type* __end, size_t __max) const
67876 { return this->do_length(__state, __from, __end, __max); }
67877 int
67878 max_length() const throw()
67879 { return this->do_max_length(); }
67880 protected:
67881 explicit
67882 __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }
67883 virtual
67884 ~__codecvt_abstract_base() { }
67885 virtual result
67886 do_out(state_type& __state, const intern_type* __from,
67887 const intern_type* __from_end, const intern_type*& __from_next,
67888 extern_type* __to, extern_type* __to_end,
67889 extern_type*& __to_next) const = 0;
67890 virtual result
67891 do_unshift(state_type& __state, extern_type* __to,
67892 extern_type* __to_end, extern_type*& __to_next) const = 0;
67893 virtual result
67894 do_in(state_type& __state, const extern_type* __from,
67895 const extern_type* __from_end, const extern_type*& __from_next,
67896 intern_type* __to, intern_type* __to_end,
67897 intern_type*& __to_next) const = 0;
67898 virtual int
67899 do_encoding() const throw() = 0;
67900 virtual bool
67901 do_always_noconv() const throw() = 0;
67902 virtual int
67903 do_length(state_type&, const extern_type* __from,
67904 const extern_type* __end, size_t __max) const = 0;
67905 virtual int
67906 do_max_length() const throw() = 0;
67907 };
67908 template<typename _InternT, typename _ExternT, typename _StateT>
67909 class codecvt
67910 : public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
67911 {
67912 public:
67913 typedef codecvt_base::result result;
67914 typedef _InternT intern_type;
67915 typedef _ExternT extern_type;
67916 typedef _StateT state_type;
67917 protected:
67918 __c_locale _M_c_locale_codecvt;
67919 public:
67920 static locale::id id;
67921 explicit
67922 codecvt(size_t __refs = 0)
67923 : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { }
67924 explicit
67925 codecvt(__c_locale __cloc, size_t __refs = 0);
67926 protected:
67927 virtual
67928 ~codecvt() { }
67929 virtual result
67930 do_out(state_type& __state, const intern_type* __from,
67931 const intern_type* __from_end, const intern_type*& __from_next,
67932 extern_type* __to, extern_type* __to_end,
67933 extern_type*& __to_next) const;
67934 virtual result
67935 do_unshift(state_type& __state, extern_type* __to,
67936 extern_type* __to_end, extern_type*& __to_next) const;
67937 virtual result
67938 do_in(state_type& __state, const extern_type* __from,
67939 const extern_type* __from_end, const extern_type*& __from_next,
67940 intern_type* __to, intern_type* __to_end,
67941 intern_type*& __to_next) const;
67942 virtual int
67943 do_encoding() const throw();
67944 virtual bool
67945 do_always_noconv() const throw();
67946 virtual int
67947 do_length(state_type&, const extern_type* __from,
67948 const extern_type* __end, size_t __max) const;
67949 virtual int
67950 do_max_length() const throw();
67951 };
67952 template<typename _InternT, typename _ExternT, typename _StateT>
67953 locale::id codecvt<_InternT, _ExternT, _StateT>::id;
67954 template<>
67955 class codecvt<char, char, mbstate_t>
67956 : public __codecvt_abstract_base<char, char, mbstate_t>
67957 {
67958 public:
67959 typedef char intern_type;
67960 typedef char extern_type;
67961 typedef mbstate_t state_type;
67962 protected:
67963 __c_locale _M_c_locale_codecvt;
67964 public:
67965 static locale::id id;
67966 explicit
67967 codecvt(size_t __refs = 0);
67968 explicit
67969 codecvt(__c_locale __cloc, size_t __refs = 0);
67970 protected:
67971 virtual
67972 ~codecvt();
67973 virtual result
67974 do_out(state_type& __state, const intern_type* __from,
67975 const intern_type* __from_end, const intern_type*& __from_next,
67976 extern_type* __to, extern_type* __to_end,
67977 extern_type*& __to_next) const;
67978 virtual result
67979 do_unshift(state_type& __state, extern_type* __to,
67980 extern_type* __to_end, extern_type*& __to_next) const;
67981 virtual result
67982 do_in(state_type& __state, const extern_type* __from,
67983 const extern_type* __from_end, const extern_type*& __from_next,
67984 intern_type* __to, intern_type* __to_end,
67985 intern_type*& __to_next) const;
67986 virtual int
67987 do_encoding() const throw();
67988 virtual bool
67989 do_always_noconv() const throw();
67990 virtual int
67991 do_length(state_type&, const extern_type* __from,
67992 const extern_type* __end, size_t __max) const;
67993 virtual int
67994 do_max_length() const throw();
67995 };
67996 template<>
67997 class codecvt<wchar_t, char, mbstate_t>
67998 : public __codecvt_abstract_base<wchar_t, char, mbstate_t>
67999 {
68000 public:
68001 typedef wchar_t intern_type;
68002 typedef char extern_type;
68003 typedef mbstate_t state_type;
68004 protected:
68005 __c_locale _M_c_locale_codecvt;
68006 public:
68007 static locale::id id;
68008 explicit
68009 codecvt(size_t __refs = 0);
68010 explicit
68011 codecvt(__c_locale __cloc, size_t __refs = 0);
68012 protected:
68013 virtual
68014 ~codecvt();
68015 virtual result
68016 do_out(state_type& __state, const intern_type* __from,
68017 const intern_type* __from_end, const intern_type*& __from_next,
68018 extern_type* __to, extern_type* __to_end,
68019 extern_type*& __to_next) const;
68020 virtual result
68021 do_unshift(state_type& __state,
68022 extern_type* __to, extern_type* __to_end,
68023 extern_type*& __to_next) const;
68024 virtual result
68025 do_in(state_type& __state,
68026 const extern_type* __from, const extern_type* __from_end,
68027 const extern_type*& __from_next,
68028 intern_type* __to, intern_type* __to_end,
68029 intern_type*& __to_next) const;
68030 virtual
68031 int do_encoding() const throw();
68032 virtual
68033 bool do_always_noconv() const throw();
68034 virtual
68035 int do_length(state_type&, const extern_type* __from,
68036 const extern_type* __end, size_t __max) const;
68037 virtual int
68038 do_max_length() const throw();
68039 };
68040 template<typename _InternT, typename _ExternT, typename _StateT>
68041 class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
68042 {
68043 public:
68044 explicit
68045 codecvt_byname(const char* __s, size_t __refs = 0)
68046 : codecvt<_InternT, _ExternT, _StateT>(__refs)
68047 {
68048 if (__builtin_strcmp(__s, "C") != 0
68049 && __builtin_strcmp(__s, "POSIX") != 0)
68050 {
68051 this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
68052 this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
68053 }
68054 }
68055 protected:
68056 virtual
68057 ~codecvt_byname() { }
68058 };
68059 extern template class codecvt_byname<char, char, mbstate_t>;
68060 extern template
68061 const codecvt<char, char, mbstate_t>&
68062 use_facet<codecvt<char, char, mbstate_t> >(const locale&);
68063 extern template
68064 bool
68065 has_facet<codecvt<char, char, mbstate_t> >(const locale&);
68066 extern template class codecvt_byname<wchar_t, char, mbstate_t>;
68067 extern template
68068 const codecvt<wchar_t, char, mbstate_t>&
68069 use_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
68070 extern template
68071 bool
68072 has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
68073 }
68074
68075 namespace std __attribute__ ((__visibility__ ("default"))) {
68076 template<typename _CharT, bool _Intl>
68077 struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
68078 {
68079 const __moneypunct_cache<_CharT, _Intl>*
68080 operator() (const locale& __loc) const
68081 {
68082 const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
68083 const locale::facet** __caches = __loc._M_impl->_M_caches;
68084 if (!__caches[__i])
68085 {
68086 __moneypunct_cache<_CharT, _Intl>* __tmp = __null;
68087 try
68088 {
68089 __tmp = new __moneypunct_cache<_CharT, _Intl>;
68090 __tmp->_M_cache(__loc);
68091 }
68092 catch(...)
68093 {
68094 delete __tmp;
68095 throw;
68096 }
68097 __loc._M_impl->_M_install_cache(__tmp, __i);
68098 }
68099 return static_cast<
68100 const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]);
68101 }
68102 };
68103 template<typename _CharT, bool _Intl>
68104 void
68105 __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc)
68106 {
68107 _M_allocated = true;
68108 const moneypunct<_CharT, _Intl>& __mp =
68109 use_facet<moneypunct<_CharT, _Intl> >(__loc);
68110 _M_decimal_point = __mp.decimal_point();
68111 _M_thousands_sep = __mp.thousands_sep();
68112 _M_frac_digits = __mp.frac_digits();
68113 char* __grouping = 0;
68114 _CharT* __curr_symbol = 0;
68115 _CharT* __positive_sign = 0;
68116 _CharT* __negative_sign = 0;
68117 try
68118 {
68119 _M_grouping_size = __mp.grouping().size();
68120 __grouping = new char[_M_grouping_size];
68121 __mp.grouping().copy(__grouping, _M_grouping_size);
68122 _M_grouping = __grouping;
68123 _M_use_grouping = (_M_grouping_size
68124 && static_cast<signed char>(_M_grouping[0]) > 0
68125 && (_M_grouping[0]
68126 != __gnu_cxx::__numeric_traits<char>::__max));
68127 _M_curr_symbol_size = __mp.curr_symbol().size();
68128 __curr_symbol = new _CharT[_M_curr_symbol_size];
68129 __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size);
68130 _M_curr_symbol = __curr_symbol;
68131 _M_positive_sign_size = __mp.positive_sign().size();
68132 __positive_sign = new _CharT[_M_positive_sign_size];
68133 __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size);
68134 _M_positive_sign = __positive_sign;
68135 _M_negative_sign_size = __mp.negative_sign().size();
68136 __negative_sign = new _CharT[_M_negative_sign_size];
68137 __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size);
68138 _M_negative_sign = __negative_sign;
68139 _M_pos_format = __mp.pos_format();
68140 _M_neg_format = __mp.neg_format();
68141 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
68142 __ct.widen(money_base::_S_atoms,
68143 money_base::_S_atoms + money_base::_S_end, _M_atoms);
68144 }
68145 catch(...)
68146 {
68147 delete [] __grouping;
68148 delete [] __curr_symbol;
68149 delete [] __positive_sign;
68150 delete [] __negative_sign;
68151 throw;
68152 }
68153 }
68154 template<typename _CharT, typename _InIter>
68155 template<bool _Intl>
68156 _InIter
68157 money_get<_CharT, _InIter>::
68158 _M_extract(iter_type __beg, iter_type __end, ios_base& __io,
68159 ios_base::iostate& __err, string& __units) const
68160 {
68161 typedef char_traits<_CharT> __traits_type;
68162 typedef typename string_type::size_type size_type;
68163 typedef money_base::part part;
68164 typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
68165 const locale& __loc = __io._M_getloc();
68166 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68167 __use_cache<__cache_type> __uc;
68168 const __cache_type* __lc = __uc(__loc);
68169 const char_type* __lit = __lc->_M_atoms;
68170 bool __negative = false;
68171 size_type __sign_size = 0;
68172 const bool __mandatory_sign = (__lc->_M_positive_sign_size
68173 && __lc->_M_negative_sign_size);
68174 string __grouping_tmp;
68175 if (__lc->_M_use_grouping)
68176 __grouping_tmp.reserve(32);
68177 int __last_pos = 0;
68178 int __n = 0;
68179 bool __testvalid = true;
68180 bool __testdecfound = false;
68181 string __res;
68182 __res.reserve(32);
68183 const char_type* __lit_zero = __lit + money_base::_S_zero;
68184 const money_base::pattern __p = __lc->_M_neg_format;
68185 for (int __i = 0; __i < 4 && __testvalid; ++__i)
68186 {
68187 const part __which = static_cast<part>(__p.field[__i]);
68188 switch (__which)
68189 {
68190 case money_base::symbol:
68191 if (__io.flags() & ios_base::showbase || __sign_size > 1
68192 || __i == 0
68193 || (__i == 1 && (__mandatory_sign
68194 || (static_cast<part>(__p.field[0])
68195 == money_base::sign)
68196 || (static_cast<part>(__p.field[2])
68197 == money_base::space)))
68198 || (__i == 2 && ((static_cast<part>(__p.field[3])
68199 == money_base::value)
68200 || (__mandatory_sign
68201 && (static_cast<part>(__p.field[3])
68202 == money_base::sign)))))
68203 {
68204 const size_type __len = __lc->_M_curr_symbol_size;
68205 size_type __j = 0;
68206 for (; __beg != __end && __j < __len
68207 && *__beg == __lc->_M_curr_symbol[__j];
68208 ++__beg, ++__j);
68209 if (__j != __len
68210 && (__j || __io.flags() & ios_base::showbase))
68211 __testvalid = false;
68212 }
68213 break;
68214 case money_base::sign:
68215 if (__lc->_M_positive_sign_size && __beg != __end
68216 && *__beg == __lc->_M_positive_sign[0])
68217 {
68218 __sign_size = __lc->_M_positive_sign_size;
68219 ++__beg;
68220 }
68221 else if (__lc->_M_negative_sign_size && __beg != __end
68222 && *__beg == __lc->_M_negative_sign[0])
68223 {
68224 __negative = true;
68225 __sign_size = __lc->_M_negative_sign_size;
68226 ++__beg;
68227 }
68228 else if (__lc->_M_positive_sign_size
68229 && !__lc->_M_negative_sign_size)
68230 __negative = true;
68231 else if (__mandatory_sign)
68232 __testvalid = false;
68233 break;
68234 case money_base::value:
68235 for (; __beg != __end; ++__beg)
68236 {
68237 const char_type __c = *__beg;
68238 const char_type* __q = __traits_type::find(__lit_zero,
68239 10, __c);
68240 if (__q != 0)
68241 {
68242 __res += money_base::_S_atoms[__q - __lit];
68243 ++__n;
68244 }
68245 else if (__c == __lc->_M_decimal_point
68246 && !__testdecfound)
68247 {
68248 if (__lc->_M_frac_digits <= 0)
68249 break;
68250 __last_pos = __n;
68251 __n = 0;
68252 __testdecfound = true;
68253 }
68254 else if (__lc->_M_use_grouping
68255 && __c == __lc->_M_thousands_sep
68256 && !__testdecfound)
68257 {
68258 if (__n)
68259 {
68260 __grouping_tmp += static_cast<char>(__n);
68261 __n = 0;
68262 }
68263 else
68264 {
68265 __testvalid = false;
68266 break;
68267 }
68268 }
68269 else
68270 break;
68271 }
68272 if (__res.empty())
68273 __testvalid = false;
68274 break;
68275 case money_base::space:
68276 if (__beg != __end && __ctype.is(ctype_base::space, *__beg))
68277 ++__beg;
68278 else
68279 __testvalid = false;
68280 case money_base::none:
68281 if (__i != 3)
68282 for (; __beg != __end
68283 && __ctype.is(ctype_base::space, *__beg); ++__beg);
68284 break;
68285 }
68286 }
68287 if (__sign_size > 1 && __testvalid)
68288 {
68289 const char_type* __sign = __negative ? __lc->_M_negative_sign
68290 : __lc->_M_positive_sign;
68291 size_type __i = 1;
68292 for (; __beg != __end && __i < __sign_size
68293 && *__beg == __sign[__i]; ++__beg, ++__i);
68294 if (__i != __sign_size)
68295 __testvalid = false;
68296 }
68297 if (__testvalid)
68298 {
68299 if (__res.size() > 1)
68300 {
68301 const size_type __first = __res.find_first_not_of('0');
68302 const bool __only_zeros = __first == string::npos;
68303 if (__first)
68304 __res.erase(0, __only_zeros ? __res.size() - 1 : __first);
68305 }
68306 if (__negative && __res[0] != '0')
68307 __res.insert(__res.begin(), '-');
68308 if (__grouping_tmp.size())
68309 {
68310 __grouping_tmp += static_cast<char>(__testdecfound ? __last_pos
68311 : __n);
68312 if (!std::__verify_grouping(__lc->_M_grouping,
68313 __lc->_M_grouping_size,
68314 __grouping_tmp))
68315 __err |= ios_base::failbit;
68316 }
68317 if (__testdecfound && __n != __lc->_M_frac_digits)
68318 __testvalid = false;
68319 }
68320 if (!__testvalid)
68321 __err |= ios_base::failbit;
68322 else
68323 __units.swap(__res);
68324 if (__beg == __end)
68325 __err |= ios_base::eofbit;
68326 return __beg;
68327 }
68328 template<typename _CharT, typename _InIter>
68329 _InIter
68330 money_get<_CharT, _InIter>::
68331 do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
68332 ios_base::iostate& __err, long double& __units) const
68333 {
68334 string __str;
68335 __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
68336 : _M_extract<false>(__beg, __end, __io, __err, __str);
68337 std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
68338 return __beg;
68339 }
68340 template<typename _CharT, typename _InIter>
68341 _InIter
68342 money_get<_CharT, _InIter>::
68343 do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
68344 ios_base::iostate& __err, string_type& __digits) const
68345 {
68346 typedef typename string::size_type size_type;
68347 const locale& __loc = __io._M_getloc();
68348 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68349 string __str;
68350 __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
68351 : _M_extract<false>(__beg, __end, __io, __err, __str);
68352 const size_type __len = __str.size();
68353 if (__len)
68354 {
68355 __digits.resize(__len);
68356 __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]);
68357 }
68358 return __beg;
68359 }
68360 template<typename _CharT, typename _OutIter>
68361 template<bool _Intl>
68362 _OutIter
68363 money_put<_CharT, _OutIter>::
68364 _M_insert(iter_type __s, ios_base& __io, char_type __fill,
68365 const string_type& __digits) const
68366 {
68367 typedef typename string_type::size_type size_type;
68368 typedef money_base::part part;
68369 typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
68370 const locale& __loc = __io._M_getloc();
68371 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68372 __use_cache<__cache_type> __uc;
68373 const __cache_type* __lc = __uc(__loc);
68374 const char_type* __lit = __lc->_M_atoms;
68375 const char_type* __beg = __digits.data();
68376 money_base::pattern __p;
68377 const char_type* __sign;
68378 size_type __sign_size;
68379 if (!(*__beg == __lit[money_base::_S_minus]))
68380 {
68381 __p = __lc->_M_pos_format;
68382 __sign = __lc->_M_positive_sign;
68383 __sign_size = __lc->_M_positive_sign_size;
68384 }
68385 else
68386 {
68387 __p = __lc->_M_neg_format;
68388 __sign = __lc->_M_negative_sign;
68389 __sign_size = __lc->_M_negative_sign_size;
68390 if (__digits.size())
68391 ++__beg;
68392 }
68393 size_type __len = __ctype.scan_not(ctype_base::digit, __beg,
68394 __beg + __digits.size()) - __beg;
68395 if (__len)
68396 {
68397 string_type __value;
68398 __value.reserve(2 * __len);
68399 long __paddec = __len - __lc->_M_frac_digits;
68400 if (__paddec > 0)
68401 {
68402 if (__lc->_M_frac_digits < 0)
68403 __paddec = __len;
68404 if (__lc->_M_grouping_size)
68405 {
68406 __value.assign(2 * __paddec, char_type());
68407 _CharT* __vend =
68408 std::__add_grouping(&__value[0], __lc->_M_thousands_sep,
68409 __lc->_M_grouping,
68410 __lc->_M_grouping_size,
68411 __beg, __beg + __paddec);
68412 __value.erase(__vend - &__value[0]);
68413 }
68414 else
68415 __value.assign(__beg, __paddec);
68416 }
68417 if (__lc->_M_frac_digits > 0)
68418 {
68419 __value += __lc->_M_decimal_point;
68420 if (__paddec >= 0)
68421 __value.append(__beg + __paddec, __lc->_M_frac_digits);
68422 else
68423 {
68424 __value.append(-__paddec, __lit[money_base::_S_zero]);
68425 __value.append(__beg, __len);
68426 }
68427 }
68428 const ios_base::fmtflags __f = __io.flags()
68429 & ios_base::adjustfield;
68430 __len = __value.size() + __sign_size;
68431 __len += ((__io.flags() & ios_base::showbase)
68432 ? __lc->_M_curr_symbol_size : 0);
68433 string_type __res;
68434 __res.reserve(2 * __len);
68435 const size_type __width = static_cast<size_type>(__io.width());
68436 const bool __testipad = (__f == ios_base::internal
68437 && __len < __width);
68438 for (int __i = 0; __i < 4; ++__i)
68439 {
68440 const part __which = static_cast<part>(__p.field[__i]);
68441 switch (__which)
68442 {
68443 case money_base::symbol:
68444 if (__io.flags() & ios_base::showbase)
68445 __res.append(__lc->_M_curr_symbol,
68446 __lc->_M_curr_symbol_size);
68447 break;
68448 case money_base::sign:
68449 if (__sign_size)
68450 __res += __sign[0];
68451 break;
68452 case money_base::value:
68453 __res += __value;
68454 break;
68455 case money_base::space:
68456 if (__testipad)
68457 __res.append(__width - __len, __fill);
68458 else
68459 __res += __fill;
68460 break;
68461 case money_base::none:
68462 if (__testipad)
68463 __res.append(__width - __len, __fill);
68464 break;
68465 }
68466 }
68467 if (__sign_size > 1)
68468 __res.append(__sign + 1, __sign_size - 1);
68469 __len = __res.size();
68470 if (__width > __len)
68471 {
68472 if (__f == ios_base::left)
68473 __res.append(__width - __len, __fill);
68474 else
68475 __res.insert(0, __width - __len, __fill);
68476 __len = __width;
68477 }
68478 __s = std::__write(__s, __res.data(), __len);
68479 }
68480 __io.width(0);
68481 return __s;
68482 }
68483 template<typename _CharT, typename _OutIter>
68484 _OutIter
68485 money_put<_CharT, _OutIter>::
68486 do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
68487 long double __units) const
68488 {
68489 const locale __loc = __io.getloc();
68490 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68491 int __cs_size = 64;
68492 char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
68493 int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
68494 "%.*Lf", 0, __units);
68495 if (__len >= __cs_size)
68496 {
68497 __cs_size = __len + 1;
68498 __cs = static_cast<char*>(__builtin_alloca(__cs_size));
68499 __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
68500 "%.*Lf", 0, __units);
68501 }
68502 string_type __digits(__len, char_type());
68503 __ctype.widen(__cs, __cs + __len, &__digits[0]);
68504 return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
68505 : _M_insert<false>(__s, __io, __fill, __digits);
68506 }
68507 template<typename _CharT, typename _OutIter>
68508 _OutIter
68509 money_put<_CharT, _OutIter>::
68510 do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
68511 const string_type& __digits) const
68512 { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
68513 : _M_insert<false>(__s, __io, __fill, __digits); }
68514 template<typename _CharT, typename _InIter>
68515 time_base::dateorder
68516 time_get<_CharT, _InIter>::do_date_order() const
68517 { return time_base::no_order; }
68518 template<typename _CharT, typename _InIter>
68519 _InIter
68520 time_get<_CharT, _InIter>::
68521 _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
68522 ios_base::iostate& __err, tm* __tm,
68523 const _CharT* __format) const
68524 {
68525 const locale& __loc = __io._M_getloc();
68526 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
68527 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68528 const size_t __len = char_traits<_CharT>::length(__format);
68529 ios_base::iostate __tmperr = ios_base::goodbit;
68530 for (size_t __i = 0; __beg != __end && __i < __len && !__tmperr; ++__i)
68531 {
68532 if (__ctype.narrow(__format[__i], 0) == '%')
68533 {
68534 char __c = __ctype.narrow(__format[++__i], 0);
68535 int __mem = 0;
68536 if (__c == 'E' || __c == 'O')
68537 __c = __ctype.narrow(__format[++__i], 0);
68538 switch (__c)
68539 {
68540 const char* __cs;
68541 _CharT __wcs[10];
68542 case 'a':
68543 const char_type* __days1[7];
68544 __tp._M_days_abbreviated(__days1);
68545 __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1,
68546 7, __io, __tmperr);
68547 break;
68548 case 'A':
68549 const char_type* __days2[7];
68550 __tp._M_days(__days2);
68551 __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2,
68552 7, __io, __tmperr);
68553 break;
68554 case 'h':
68555 case 'b':
68556 const char_type* __months1[12];
68557 __tp._M_months_abbreviated(__months1);
68558 __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
68559 __months1, 12, __io, __tmperr);
68560 break;
68561 case 'B':
68562 const char_type* __months2[12];
68563 __tp._M_months(__months2);
68564 __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
68565 __months2, 12, __io, __tmperr);
68566 break;
68567 case 'c':
68568 const char_type* __dt[2];
68569 __tp._M_date_time_formats(__dt);
68570 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
68571 __tm, __dt[0]);
68572 break;
68573 case 'd':
68574 __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2,
68575 __io, __tmperr);
68576 break;
68577 case 'e':
68578 if (__ctype.is(ctype_base::space, *__beg))
68579 __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9,
68580 1, __io, __tmperr);
68581 else
68582 __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31,
68583 2, __io, __tmperr);
68584 break;
68585 case 'D':
68586 __cs = "%m/%d/%y";
68587 __ctype.widen(__cs, __cs + 9, __wcs);
68588 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
68589 __tm, __wcs);
68590 break;
68591 case 'H':
68592 __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2,
68593 __io, __tmperr);
68594 break;
68595 case 'I':
68596 __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2,
68597 __io, __tmperr);
68598 break;
68599 case 'm':
68600 __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2,
68601 __io, __tmperr);
68602 if (!__tmperr)
68603 __tm->tm_mon = __mem - 1;
68604 break;
68605 case 'M':
68606 __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2,
68607 __io, __tmperr);
68608 break;
68609 case 'n':
68610 if (__ctype.narrow(*__beg, 0) == '\n')
68611 ++__beg;
68612 else
68613 __tmperr |= ios_base::failbit;
68614 break;
68615 case 'R':
68616 __cs = "%H:%M";
68617 __ctype.widen(__cs, __cs + 6, __wcs);
68618 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
68619 __tm, __wcs);
68620 break;
68621 case 'S':
68622 __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2,
68623 __io, __tmperr);
68624 break;
68625 case 't':
68626 if (__ctype.narrow(*__beg, 0) == '\t')
68627 ++__beg;
68628 else
68629 __tmperr |= ios_base::failbit;
68630 break;
68631 case 'T':
68632 __cs = "%H:%M:%S";
68633 __ctype.widen(__cs, __cs + 9, __wcs);
68634 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
68635 __tm, __wcs);
68636 break;
68637 case 'x':
68638 const char_type* __dates[2];
68639 __tp._M_date_formats(__dates);
68640 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
68641 __tm, __dates[0]);
68642 break;
68643 case 'X':
68644 const char_type* __times[2];
68645 __tp._M_time_formats(__times);
68646 __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
68647 __tm, __times[0]);
68648 break;
68649 case 'y':
68650 case 'C':
68651 case 'Y':
68652 __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
68653 __io, __tmperr);
68654 if (!__tmperr)
68655 __tm->tm_year = __mem < 0 ? __mem + 100 : __mem - 1900;
68656 break;
68657 case 'Z':
68658 if (__ctype.is(ctype_base::upper, *__beg))
68659 {
68660 int __tmp;
68661 __beg = _M_extract_name(__beg, __end, __tmp,
68662 __timepunct_cache<_CharT>::_S_timezones,
68663 14, __io, __tmperr);
68664 if (__beg != __end && !__tmperr && __tmp == 0
68665 && (*__beg == __ctype.widen('-')
68666 || *__beg == __ctype.widen('+')))
68667 {
68668 __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2,
68669 __io, __tmperr);
68670 __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2,
68671 __io, __tmperr);
68672 }
68673 }
68674 else
68675 __tmperr |= ios_base::failbit;
68676 break;
68677 default:
68678 __tmperr |= ios_base::failbit;
68679 }
68680 }
68681 else
68682 {
68683 if (__format[__i] == *__beg)
68684 ++__beg;
68685 else
68686 __tmperr |= ios_base::failbit;
68687 }
68688 }
68689 if (__tmperr)
68690 __err |= ios_base::failbit;
68691 return __beg;
68692 }
68693 template<typename _CharT, typename _InIter>
68694 _InIter
68695 time_get<_CharT, _InIter>::
68696 _M_extract_num(iter_type __beg, iter_type __end, int& __member,
68697 int __min, int __max, size_t __len,
68698 ios_base& __io, ios_base::iostate& __err) const
68699 {
68700 const locale& __loc = __io._M_getloc();
68701 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68702 int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);
68703 ++__min;
68704 size_t __i = 0;
68705 int __value = 0;
68706 for (; __beg != __end && __i < __len; ++__beg, ++__i)
68707 {
68708 const char __c = __ctype.narrow(*__beg, '*');
68709 if (__c >= '0' && __c <= '9')
68710 {
68711 __value = __value * 10 + (__c - '0');
68712 const int __valuec = __value * __mult;
68713 if (__valuec > __max || __valuec + __mult < __min)
68714 break;
68715 __mult /= 10;
68716 }
68717 else
68718 break;
68719 }
68720 if (__i == __len)
68721 __member = __value;
68722 else if (__len == 4 && __i == 2)
68723 __member = __value - 100;
68724 else
68725 __err |= ios_base::failbit;
68726 return __beg;
68727 }
68728 template<typename _CharT, typename _InIter>
68729 _InIter
68730 time_get<_CharT, _InIter>::
68731 _M_extract_name(iter_type __beg, iter_type __end, int& __member,
68732 const _CharT** __names, size_t __indexlen,
68733 ios_base& __io, ios_base::iostate& __err) const
68734 {
68735 typedef char_traits<_CharT> __traits_type;
68736 const locale& __loc = __io._M_getloc();
68737 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68738 int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int)
68739 * __indexlen));
68740 size_t __nmatches = 0;
68741 size_t __pos = 0;
68742 bool __testvalid = true;
68743 const char_type* __name;
68744 if (__beg != __end)
68745 {
68746 const char_type __c = *__beg;
68747 for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
68748 if (__c == __names[__i1][0]
68749 || __c == __ctype.toupper(__names[__i1][0]))
68750 __matches[__nmatches++] = __i1;
68751 }
68752 while (__nmatches > 1)
68753 {
68754 size_t __minlen = __traits_type::length(__names[__matches[0]]);
68755 for (size_t __i2 = 1; __i2 < __nmatches; ++__i2)
68756 __minlen = std::min(__minlen,
68757 __traits_type::length(__names[__matches[__i2]]));
68758 ++__beg, ++__pos;
68759 if (__pos < __minlen && __beg != __end)
68760 for (size_t __i3 = 0; __i3 < __nmatches;)
68761 {
68762 __name = __names[__matches[__i3]];
68763 if (!(__name[__pos] == *__beg))
68764 __matches[__i3] = __matches[--__nmatches];
68765 else
68766 ++__i3;
68767 }
68768 else
68769 break;
68770 }
68771 if (__nmatches == 1)
68772 {
68773 ++__beg, ++__pos;
68774 __name = __names[__matches[0]];
68775 const size_t __len = __traits_type::length(__name);
68776 while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
68777 ++__beg, ++__pos;
68778 if (__len == __pos)
68779 __member = __matches[0];
68780 else
68781 __testvalid = false;
68782 }
68783 else
68784 __testvalid = false;
68785 if (!__testvalid)
68786 __err |= ios_base::failbit;
68787 return __beg;
68788 }
68789 template<typename _CharT, typename _InIter>
68790 _InIter
68791 time_get<_CharT, _InIter>::
68792 _M_extract_wday_or_month(iter_type __beg, iter_type __end, int& __member,
68793 const _CharT** __names, size_t __indexlen,
68794 ios_base& __io, ios_base::iostate& __err) const
68795 {
68796 typedef char_traits<_CharT> __traits_type;
68797 const locale& __loc = __io._M_getloc();
68798 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68799 int* __matches = static_cast<int*>(__builtin_alloca(2 * sizeof(int)
68800 * __indexlen));
68801 size_t __nmatches = 0;
68802 size_t* __matches_lengths = 0;
68803 size_t __pos = 0;
68804 if (__beg != __end)
68805 {
68806 const char_type __c = *__beg;
68807 for (size_t __i = 0; __i < 2 * __indexlen; ++__i)
68808 if (__c == __names[__i][0]
68809 || __c == __ctype.toupper(__names[__i][0]))
68810 __matches[__nmatches++] = __i;
68811 }
68812 if (__nmatches)
68813 {
68814 ++__beg, ++__pos;
68815 __matches_lengths
68816 = static_cast<size_t*>(__builtin_alloca(sizeof(size_t)
68817 * __nmatches));
68818 for (size_t __i = 0; __i < __nmatches; ++__i)
68819 __matches_lengths[__i]
68820 = __traits_type::length(__names[__matches[__i]]);
68821 }
68822 for (; __beg != __end; ++__beg, ++__pos)
68823 {
68824 size_t __nskipped = 0;
68825 const char_type __c = *__beg;
68826 for (size_t __i = 0; __i < __nmatches;)
68827 {
68828 const char_type* __name = __names[__matches[__i]];
68829 if (__pos >= __matches_lengths[__i])
68830 ++__nskipped, ++__i;
68831 else if (!(__name[__pos] == __c))
68832 {
68833 --__nmatches;
68834 __matches[__i] = __matches[__nmatches];
68835 __matches_lengths[__i] = __matches_lengths[__nmatches];
68836 }
68837 else
68838 ++__i;
68839 }
68840 if (__nskipped == __nmatches)
68841 break;
68842 }
68843 if ((__nmatches == 1 && __matches_lengths[0] == __pos)
68844 || (__nmatches == 2 && (__matches_lengths[0] == __pos
68845 || __matches_lengths[1] == __pos)))
68846 __member = (__matches[0] >= __indexlen
68847 ? __matches[0] - __indexlen : __matches[0]);
68848 else
68849 __err |= ios_base::failbit;
68850 return __beg;
68851 }
68852 template<typename _CharT, typename _InIter>
68853 _InIter
68854 time_get<_CharT, _InIter>::
68855 do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
68856 ios_base::iostate& __err, tm* __tm) const
68857 {
68858 const locale& __loc = __io._M_getloc();
68859 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
68860 const char_type* __times[2];
68861 __tp._M_time_formats(__times);
68862 __beg = _M_extract_via_format(__beg, __end, __io, __err,
68863 __tm, __times[0]);
68864 if (__beg == __end)
68865 __err |= ios_base::eofbit;
68866 return __beg;
68867 }
68868 template<typename _CharT, typename _InIter>
68869 _InIter
68870 time_get<_CharT, _InIter>::
68871 do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
68872 ios_base::iostate& __err, tm* __tm) const
68873 {
68874 const locale& __loc = __io._M_getloc();
68875 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
68876 const char_type* __dates[2];
68877 __tp._M_date_formats(__dates);
68878 __beg = _M_extract_via_format(__beg, __end, __io, __err,
68879 __tm, __dates[0]);
68880 if (__beg == __end)
68881 __err |= ios_base::eofbit;
68882 return __beg;
68883 }
68884 template<typename _CharT, typename _InIter>
68885 _InIter
68886 time_get<_CharT, _InIter>::
68887 do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
68888 ios_base::iostate& __err, tm* __tm) const
68889 {
68890 typedef char_traits<_CharT> __traits_type;
68891 const locale& __loc = __io._M_getloc();
68892 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
68893 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68894 const char_type* __days[14];
68895 __tp._M_days_abbreviated(__days);
68896 __tp._M_days(__days + 7);
68897 int __tmpwday;
68898 ios_base::iostate __tmperr = ios_base::goodbit;
68899 __beg = _M_extract_wday_or_month(__beg, __end, __tmpwday, __days, 7,
68900 __io, __tmperr);
68901 if (!__tmperr)
68902 __tm->tm_wday = __tmpwday;
68903 else
68904 __err |= ios_base::failbit;
68905 if (__beg == __end)
68906 __err |= ios_base::eofbit;
68907 return __beg;
68908 }
68909 template<typename _CharT, typename _InIter>
68910 _InIter
68911 time_get<_CharT, _InIter>::
68912 do_get_monthname(iter_type __beg, iter_type __end,
68913 ios_base& __io, ios_base::iostate& __err, tm* __tm) const
68914 {
68915 typedef char_traits<_CharT> __traits_type;
68916 const locale& __loc = __io._M_getloc();
68917 const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
68918 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68919 const char_type* __months[24];
68920 __tp._M_months_abbreviated(__months);
68921 __tp._M_months(__months + 12);
68922 int __tmpmon;
68923 ios_base::iostate __tmperr = ios_base::goodbit;
68924 __beg = _M_extract_wday_or_month(__beg, __end, __tmpmon, __months, 12,
68925 __io, __tmperr);
68926 if (!__tmperr)
68927 __tm->tm_mon = __tmpmon;
68928 else
68929 __err |= ios_base::failbit;
68930 if (__beg == __end)
68931 __err |= ios_base::eofbit;
68932 return __beg;
68933 }
68934 template<typename _CharT, typename _InIter>
68935 _InIter
68936 time_get<_CharT, _InIter>::
68937 do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
68938 ios_base::iostate& __err, tm* __tm) const
68939 {
68940 const locale& __loc = __io._M_getloc();
68941 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
68942 int __tmpyear;
68943 ios_base::iostate __tmperr = ios_base::goodbit;
68944 __beg = _M_extract_num(__beg, __end, __tmpyear, 0, 9999, 4,
68945 __io, __tmperr);
68946 if (!__tmperr)
68947 __tm->tm_year = __tmpyear < 0 ? __tmpyear + 100 : __tmpyear - 1900;
68948 else
68949 __err |= ios_base::failbit;
68950 if (__beg == __end)
68951 __err |= ios_base::eofbit;
68952 return __beg;
68953 }
68954 template<typename _CharT, typename _OutIter>
68955 _OutIter
68956 time_put<_CharT, _OutIter>::
68957 put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
68958 const _CharT* __beg, const _CharT* __end) const
68959 {
68960 const locale& __loc = __io._M_getloc();
68961 ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
68962 for (; __beg != __end; ++__beg)
68963 if (__ctype.narrow(*__beg, 0) != '%')
68964 {
68965 *__s = *__beg;
68966 ++__s;
68967 }
68968 else if (++__beg != __end)
68969 {
68970 char __format;
68971 char __mod = 0;
68972 const char __c = __ctype.narrow(*__beg, 0);
68973 if (__c != 'E' && __c != 'O')
68974 __format = __c;
68975 else if (++__beg != __end)
68976 {
68977 __mod = __c;
68978 __format = __ctype.narrow(*__beg, 0);
68979 }
68980 else
68981 break;
68982 __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
68983 }
68984 else
68985 break;
68986 return __s;
68987 }
68988 template<typename _CharT, typename _OutIter>
68989 _OutIter
68990 time_put<_CharT, _OutIter>::
68991 do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm,
68992 char __format, char __mod) const
68993 {
68994 const locale& __loc = __io._M_getloc();
68995 ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
68996 __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
68997 const size_t __maxlen = 128;
68998 char_type __res[__maxlen];
68999 char_type __fmt[4];
69000 __fmt[0] = __ctype.widen('%');
69001 if (!__mod)
69002 {
69003 __fmt[1] = __format;
69004 __fmt[2] = char_type();
69005 }
69006 else
69007 {
69008 __fmt[1] = __mod;
69009 __fmt[2] = __format;
69010 __fmt[3] = char_type();
69011 }
69012 __tp._M_put(__res, __maxlen, __fmt, __tm);
69013 return std::__write(__s, __res, char_traits<char_type>::length(__res));
69014 }
69015 extern template class moneypunct<char, false>;
69016 extern template class moneypunct<char, true>;
69017 extern template class moneypunct_byname<char, false>;
69018 extern template class moneypunct_byname<char, true>;
69019 extern template class money_get<char>;
69020 extern template class money_put<char>;
69021 extern template class __timepunct<char>;
69022 extern template class time_put<char>;
69023 extern template class time_put_byname<char>;
69024 extern template class time_get<char>;
69025 extern template class time_get_byname<char>;
69026 extern template class messages<char>;
69027 extern template class messages_byname<char>;
69028 extern template
69029 const moneypunct<char, true>&
69030 use_facet<moneypunct<char, true> >(const locale&);
69031 extern template
69032 const moneypunct<char, false>&
69033 use_facet<moneypunct<char, false> >(const locale&);
69034 extern template
69035 const money_put<char>&
69036 use_facet<money_put<char> >(const locale&);
69037 extern template
69038 const money_get<char>&
69039 use_facet<money_get<char> >(const locale&);
69040 extern template
69041 const __timepunct<char>&
69042 use_facet<__timepunct<char> >(const locale&);
69043 extern template
69044 const time_put<char>&
69045 use_facet<time_put<char> >(const locale&);
69046 extern template
69047 const time_get<char>&
69048 use_facet<time_get<char> >(const locale&);
69049 extern template
69050 const messages<char>&
69051 use_facet<messages<char> >(const locale&);
69052 extern template
69053 bool
69054 has_facet<moneypunct<char> >(const locale&);
69055 extern template
69056 bool
69057 has_facet<money_put<char> >(const locale&);
69058 extern template
69059 bool
69060 has_facet<money_get<char> >(const locale&);
69061 extern template
69062 bool
69063 has_facet<__timepunct<char> >(const locale&);
69064 extern template
69065 bool
69066 has_facet<time_put<char> >(const locale&);
69067 extern template
69068 bool
69069 has_facet<time_get<char> >(const locale&);
69070 extern template
69071 bool
69072 has_facet<messages<char> >(const locale&);
69073 extern template class moneypunct<wchar_t, false>;
69074 extern template class moneypunct<wchar_t, true>;
69075 extern template class moneypunct_byname<wchar_t, false>;
69076 extern template class moneypunct_byname<wchar_t, true>;
69077 extern template class money_get<wchar_t>;
69078 extern template class money_put<wchar_t>;
69079 extern template class __timepunct<wchar_t>;
69080 extern template class time_put<wchar_t>;
69081 extern template class time_put_byname<wchar_t>;
69082 extern template class time_get<wchar_t>;
69083 extern template class time_get_byname<wchar_t>;
69084 extern template class messages<wchar_t>;
69085 extern template class messages_byname<wchar_t>;
69086 extern template
69087 const moneypunct<wchar_t, true>&
69088 use_facet<moneypunct<wchar_t, true> >(const locale&);
69089 extern template
69090 const moneypunct<wchar_t, false>&
69091 use_facet<moneypunct<wchar_t, false> >(const locale&);
69092 extern template
69093 const money_put<wchar_t>&
69094 use_facet<money_put<wchar_t> >(const locale&);
69095 extern template
69096 const money_get<wchar_t>&
69097 use_facet<money_get<wchar_t> >(const locale&);
69098 extern template
69099 const __timepunct<wchar_t>&
69100 use_facet<__timepunct<wchar_t> >(const locale&);
69101 extern template
69102 const time_put<wchar_t>&
69103 use_facet<time_put<wchar_t> >(const locale&);
69104 extern template
69105 const time_get<wchar_t>&
69106 use_facet<time_get<wchar_t> >(const locale&);
69107 extern template
69108 const messages<wchar_t>&
69109 use_facet<messages<wchar_t> >(const locale&);
69110 extern template
69111 bool
69112 has_facet<moneypunct<wchar_t> >(const locale&);
69113 extern template
69114 bool
69115 has_facet<money_put<wchar_t> >(const locale&);
69116 extern template
69117 bool
69118 has_facet<money_get<wchar_t> >(const locale&);
69119 extern template
69120 bool
69121 has_facet<__timepunct<wchar_t> >(const locale&);
69122 extern template
69123 bool
69124 has_facet<time_put<wchar_t> >(const locale&);
69125 extern template
69126 bool
69127 has_facet<time_get<wchar_t> >(const locale&);
69128 extern template
69129 bool
69130 has_facet<messages<wchar_t> >(const locale&);
69131 }
69132 namespace boost
69133 {
69134 class bad_lexical_cast : public std::bad_cast
69135 {
69136 public:
69137 bad_lexical_cast() :
69138 source(&typeid(void)), target(&typeid(void))
69139 {
69140 }
69141 bad_lexical_cast(
69142 const std::type_info &source_type_arg,
69143 const std::type_info &target_type_arg) :
69144 source(&source_type_arg), target(&target_type_arg)
69145 {
69146 }
69147 const std::type_info &source_type() const
69148 {
69149 return *source;
69150 }
69151 const std::type_info &target_type() const
69152 {
69153 return *target;
69154 }
69155 virtual const char *what() const throw()
69156 {
69157 return "bad lexical cast: "
69158 "source type value could not be interpreted as target";
69159 }
69160 virtual ~bad_lexical_cast() throw()
69161 {
69162 }
69163 private:
69164 const std::type_info *source;
69165 const std::type_info *target;
69166 };
69167 namespace detail
69168 {
69169 template<typename Type>
69170 struct stream_char
69171 {
69172 typedef char type;
69173 };
69174 template<class CharT, class Traits, class Alloc>
69175 struct stream_char< std::basic_string<CharT,Traits,Alloc> >
69176 {
69177 typedef CharT type;
69178 };
69179 template<>
69180 struct stream_char<wchar_t>
69181 {
69182 typedef wchar_t type;
69183 };
69184 template<>
69185 struct stream_char<wchar_t *>
69186 {
69187 typedef wchar_t type;
69188 };
69189 template<>
69190 struct stream_char<const wchar_t *>
69191 {
69192 typedef wchar_t type;
69193 };
69194 template<typename TargetChar, typename SourceChar>
69195 struct widest_char
69196 {
69197 typedef TargetChar type;
69198 };
69199 template<>
69200 struct widest_char<char, wchar_t>
69201 {
69202 typedef wchar_t type;
69203 };
69204 }
69205 namespace detail
69206 {
69207 template<class CharT, class Target, class Source>
69208 struct deduce_char_traits
69209 {
69210 typedef std::char_traits<CharT> type;
69211 };
69212 template<class CharT, class Traits, class Alloc, class Source>
69213 struct deduce_char_traits< CharT
69214 , std::basic_string<CharT,Traits,Alloc>
69215 , Source
69216 >
69217 {
69218 typedef Traits type;
69219 };
69220 template<class CharT, class Target, class Traits, class Alloc>
69221 struct deduce_char_traits< CharT
69222 , Target
69223 , std::basic_string<CharT,Traits,Alloc>
69224 >
69225 {
69226 typedef Traits type;
69227 };
69228 template<class CharT, class Traits, class Alloc1, class Alloc2>
69229 struct deduce_char_traits< CharT
69230 , std::basic_string<CharT,Traits,Alloc1>
69231 , std::basic_string<CharT,Traits,Alloc2>
69232 >
69233 {
69234 typedef Traits type;
69235 };
69236 }
69237 namespace detail
69238 {
69239 template< class CharT
69240 , class Source
69241 >
69242 struct lcast_src_length
69243 {
69244 static const std::size_t value = 0;
69245 static void check_coverage() {}
69246 };
69247 template<>
69248 struct lcast_src_length<char, bool>
69249 {
69250 static const std::size_t value = 1;
69251 static void check_coverage() {}
69252 };
69253 template<>
69254 struct lcast_src_length<char, char>
69255 {
69256 static const std::size_t value = 1;
69257 static void check_coverage() {}
69258 };
69259 template<>
69260 struct lcast_src_length<wchar_t, bool>
69261 {
69262 static const std::size_t value = 1;
69263 static void check_coverage() {}
69264 };
69265 template<>
69266 struct lcast_src_length<wchar_t, char>
69267 {
69268 static const std::size_t value = 1;
69269 static void check_coverage() {}
69270 };
69271 template<>
69272 struct lcast_src_length<wchar_t, wchar_t>
69273 {
69274 static const std::size_t value = 1;
69275 static void check_coverage() {}
69276 };
69277 template<>
69278 struct lcast_src_length<char, char const*>
69279 {
69280 static const std::size_t value = 1;
69281 static void check_coverage() {}
69282 };
69283 template<>
69284 struct lcast_src_length<char, char*>
69285 {
69286 static const std::size_t value = 1;
69287 static void check_coverage() {}
69288 };
69289 template<>
69290 struct lcast_src_length<wchar_t, wchar_t const*>
69291 {
69292 static const std::size_t value = 1;
69293 static void check_coverage() {}
69294 };
69295 template<>
69296 struct lcast_src_length<wchar_t, wchar_t*>
69297 {
69298 static const std::size_t value = 1;
69299 static void check_coverage() {}
69300 };
69301 template<class CharT, class Traits, class Alloc>
69302 struct lcast_src_length< CharT, std::basic_string<CharT,Traits,Alloc> >
69303 {
69304 static const std::size_t value = 1;
69305 static void check_coverage() {}
69306 };
69307 template<class Source>
69308 struct lcast_src_length_integral
69309 {
69310 static const std::size_t value = std::numeric_limits<Source>::is_signed + std::numeric_limits<Source>::is_specialized + std::numeric_limits<Source>::digits10 * 2
69311 ;
69312 };
69313 template<> struct lcast_src_length<char, short> : lcast_src_length_integral<short> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, short> : lcast_src_length_integral<short> { static void check_coverage() {} };
69314 template<> struct lcast_src_length<char, unsigned short> : lcast_src_length_integral<unsigned short> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, unsigned short> : lcast_src_length_integral<unsigned short> { static void check_coverage() {} };
69315 template<> struct lcast_src_length<char, int> : lcast_src_length_integral<int> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, int> : lcast_src_length_integral<int> { static void check_coverage() {} };
69316 template<> struct lcast_src_length<char, unsigned int> : lcast_src_length_integral<unsigned int> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, unsigned int> : lcast_src_length_integral<unsigned int> { static void check_coverage() {} };
69317 template<> struct lcast_src_length<char, long> : lcast_src_length_integral<long> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, long> : lcast_src_length_integral<long> { static void check_coverage() {} };
69318 template<> struct lcast_src_length<char, unsigned long> : lcast_src_length_integral<unsigned long> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, unsigned long> : lcast_src_length_integral<unsigned long> { static void check_coverage() {} };
69319 template<> struct lcast_src_length<char, boost::ulong_long_type> : lcast_src_length_integral<boost::ulong_long_type> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, boost::ulong_long_type> : lcast_src_length_integral<boost::ulong_long_type> { static void check_coverage() {} };
69320 template<> struct lcast_src_length<char, boost::long_long_type> : lcast_src_length_integral<boost::long_long_type> { static void check_coverage() {} }; template<> struct lcast_src_length<wchar_t, boost::long_long_type> : lcast_src_length_integral<boost::long_long_type> { static void check_coverage() {} };
69321 template<class Source>
69322 struct lcast_src_length_floating
69323 {
69324 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((std::numeric_limits<Source>::max_exponent10 <= 999999L && std::numeric_limits<Source>::min_exponent10 >= -999999L) == 0 ? false : true) >)>
69325 boost_static_assert_typedef_401;
69326 static const std::size_t value = 5 + lcast_precision<Source>::value + 6
69327 ;
69328 };
69329 template<>
69330 struct lcast_src_length<char,float>
69331 : lcast_src_length_floating<float>
69332 {
69333 static void check_coverage() {}
69334 };
69335 template<>
69336 struct lcast_src_length<char,double>
69337 : lcast_src_length_floating<double>
69338 {
69339 static void check_coverage() {}
69340 };
69341 template<>
69342 struct lcast_src_length<char,long double>
69343 : lcast_src_length_floating<long double>
69344 {
69345 static void check_coverage() {}
69346 };
69347 template<>
69348 struct lcast_src_length<wchar_t,float>
69349 : lcast_src_length_floating<float>
69350 {
69351 static void check_coverage() {}
69352 };
69353 template<>
69354 struct lcast_src_length<wchar_t,double>
69355 : lcast_src_length_floating<double>
69356 {
69357 static void check_coverage() {}
69358 };
69359 template<>
69360 struct lcast_src_length<wchar_t,long double>
69361 : lcast_src_length_floating<long double>
69362 {
69363 static void check_coverage() {}
69364 };
69365 }
69366 namespace detail
69367 {
69368 template<typename CharT> struct lcast_char_constants;
69369 template<>
69370 struct lcast_char_constants<char>
69371 {
69372 static const char zero = '0';
69373 static const char minus = '-';
69374 };
69375 template<>
69376 struct lcast_char_constants<wchar_t>
69377 {
69378 static const wchar_t zero = L'0';
69379 static const wchar_t minus = L'-';
69380 };
69381 }
69382 namespace detail
69383 {
69384 struct lexical_streambuf_fake
69385 {
69386 };
69387 }
69388 namespace detail
69389 {
69390 template<class T>
69391 inline
69392 typename make_unsigned<T>::type lcast_to_unsigned(T value)
69393 {
69394 typedef typename make_unsigned<T>::type result_type;
69395 result_type uvalue = static_cast<result_type>(value);
69396 return value < 0 ? -uvalue : uvalue;
69397 }
69398 }
69399 namespace detail
69400 {
69401 template<class Traits, class T, class CharT>
69402 CharT* lcast_put_unsigned(T n, CharT* finish)
69403 {
69404 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((!std::numeric_limits<T>::is_signed) == 0 ? false : true) >)> boost_static_assert_typedef_512;
69405 std::locale loc;
69406 typedef std::numpunct<CharT> numpunct;
69407 numpunct const& np = std::use_facet< numpunct >(loc);
69408 std::string const& grouping = np.grouping();
69409 std::string::size_type const grouping_size = grouping.size();
69410 CharT thousands_sep = grouping_size ? np.thousands_sep() : 0;
69411 std::string::size_type group = 0;
69412 char last_grp_size = grouping[0] <= 0 ? 127 : grouping[0];
69413 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((std::numeric_limits<T>::digits10 < 127) == 0 ? false : true) >)> boost_static_assert_typedef_529;
69414 char left = last_grp_size;
69415 typedef typename Traits::int_type int_type;
69416 CharT const czero = lcast_char_constants<CharT>::zero;
69417 int_type const zero = Traits::to_int_type(czero);
69418 do
69419 {
69420 if(left == 0)
69421 {
69422 ++group;
69423 if(group < grouping_size)
69424 {
69425 char const grp_size = grouping[group];
69426 last_grp_size = grp_size <= 0 ? 127 : grp_size;
69427 }
69428 left = last_grp_size;
69429 --finish;
69430 Traits::assign(*finish, thousands_sep);
69431 }
69432 --left;
69433 --finish;
69434 int_type const digit = static_cast<int_type>(n % 10U);
69435 Traits::assign(*finish, Traits::to_char_type(zero + digit));
69436 n /= 10;
69437 } while(n);
69438 return finish;
69439 }
69440 }
69441 namespace detail
69442 {
69443 template<typename Target, typename Source, typename Traits>
69444 class lexical_stream
69445 {
69446 private:
69447 typedef typename widest_char<
69448 typename stream_char<Target>::type,
69449 typename stream_char<Source>::type>::type char_type;
69450 typedef Traits traits_type;
69451 public:
69452 lexical_stream(char_type* = 0, char_type* = 0)
69453 {
69454 stream.unsetf(std::ios::skipws);
69455 lcast_set_precision(stream, static_cast<Source*>(0), static_cast<Target*>(0) );
69456 }
69457 ~lexical_stream()
69458 {
69459 }
69460 bool operator<<(const Source &input)
69461 {
69462 return !(stream << input).fail();
69463 }
69464 template<typename InputStreamable>
69465 bool operator>>(InputStreamable &output)
69466 {
69467 return !is_pointer<InputStreamable>::value &&
69468 stream >> output &&
69469 stream.get() ==
69470 traits_type::eof();
69471 }
69472 bool operator>>(std::basic_string<char_type,traits_type>& output)
69473 {
69474 stream.str().swap(output);
69475 return true;
69476 }
69477 template<class Alloc>
69478 bool operator>>(std::basic_string<char_type,traits_type,Alloc>& out)
69479 {
69480 std::basic_string<char_type,traits_type> str(stream.str());
69481 out.assign(str.begin(), str.end());
69482 return true;
69483 }
69484 private:
69485 std::basic_stringstream<char_type,traits_type> stream;
69486 };
69487 }
69488 namespace detail
69489 {
69490 template< class CharT
69491 , class Base
69492 , class Traits
69493 >
69494 class lexical_stream_limited_src : public Base
69495 {
69496 CharT* start;
69497 CharT* finish;
69498 private:
69499 static void widen_and_assign(char*p, char ch)
69500 {
69501 Traits::assign(*p, ch);
69502 }
69503 static void widen_and_assign(wchar_t* p, char ch)
69504 {
69505 std::locale loc;
69506 wchar_t w = std::use_facet< std::ctype<wchar_t> >(loc).widen(ch);
69507 Traits::assign(*p, w);
69508 }
69509 static void widen_and_assign(wchar_t* p, wchar_t ch)
69510 {
69511 Traits::assign(*p, ch);
69512 }
69513 static void widen_and_assign(char*, wchar_t ch);
69514 template<class OutputStreamable>
69515 bool lcast_put(const OutputStreamable& input)
69516 {
69517 this->setp(start, finish);
69518 std::basic_ostream<CharT> stream(static_cast<Base*>(this));
69519 lcast_set_precision(stream, static_cast<OutputStreamable*>(0));
69520 bool const result = !(stream << input).fail();
69521 finish = this->pptr();
69522 return result;
69523 }
69524 lexical_stream_limited_src(lexical_stream_limited_src const&);
69525 void operator=(lexical_stream_limited_src const&);
69526 public:
69527 lexical_stream_limited_src(CharT* sta, CharT* fin)
69528 : start(sta)
69529 , finish(fin)
69530 {}
69531 public:
69532 template<class Alloc>
69533 bool operator<<(std::basic_string<CharT,Traits,Alloc> const& str)
69534 {
69535 start = const_cast<CharT*>(str.data());
69536 finish = start + str.length();
69537 return true;
69538 }
69539 bool operator<<(bool);
69540 bool operator<<(char);
69541 bool operator<<(wchar_t);
69542 bool operator<<(CharT const*);
69543 bool operator<<(short);
69544 bool operator<<(int);
69545 bool operator<<(long);
69546 bool operator<<(unsigned short);
69547 bool operator<<(unsigned int);
69548 bool operator<<(unsigned long);
69549 bool operator<<(boost::ulong_long_type);
69550 bool operator<<(boost::long_long_type );
69551 bool operator<<(float);
69552 bool operator<<(double);
69553 bool operator<<(long double);
69554 public:
69555 template<typename InputStreamable>
69556 bool operator>>(InputStreamable& output)
69557 {
69558 if(is_pointer<InputStreamable>::value)
69559 return false;
69560 this->setg(start, start, finish);
69561 std::basic_istream<CharT> stream(static_cast<Base*>(this));
69562 stream.unsetf(std::ios::skipws);
69563 lcast_set_precision(stream, static_cast<InputStreamable*>(0));
69564 return stream >> output &&
69565 stream.get() ==
69566 Traits::eof();
69567 }
69568 bool operator>>(CharT&);
69569 template<class Alloc>
69570 bool operator>>(std::basic_string<CharT,Traits,Alloc>& str)
69571 {
69572 str.assign(start, finish);
69573 return true;
69574 }
69575 };
69576 template<typename CharT, class Base, class Traits>
69577 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69578 bool value)
69579 {
69580 typedef typename Traits::int_type int_type;
69581 CharT const czero = lcast_char_constants<CharT>::zero;
69582 int_type const zero = Traits::to_int_type(czero);
69583 Traits::assign(*start, Traits::to_char_type(zero + value));
69584 finish = start + 1;
69585 return true;
69586 }
69587 template<typename CharT, class Base, class Traits>
69588 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69589 char ch)
69590 {
69591 widen_and_assign(start, ch);
69592 finish = start + 1;
69593 return true;
69594 }
69595 template<typename CharT, class Base, class Traits>
69596 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69597 wchar_t ch)
69598 {
69599 widen_and_assign(start, ch);
69600 finish = start + 1;
69601 return true;
69602 }
69603 template<typename CharT, class Base, class Traits>
69604 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69605 short n)
69606 {
69607 start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n), finish);
69608 if(n < 0)
69609 {
69610 --start;
69611 CharT const minus = lcast_char_constants<CharT>::minus;
69612 Traits::assign(*start, minus);
69613 }
69614 return true;
69615 }
69616 template<typename CharT, class Base, class Traits>
69617 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69618 int n)
69619 {
69620 start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n), finish);
69621 if(n < 0)
69622 {
69623 --start;
69624 CharT const minus = lcast_char_constants<CharT>::minus;
69625 Traits::assign(*start, minus);
69626 }
69627 return true;
69628 }
69629 template<typename CharT, class Base, class Traits>
69630 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69631 long n)
69632 {
69633 start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n), finish);
69634 if(n < 0)
69635 {
69636 --start;
69637 CharT const minus = lcast_char_constants<CharT>::minus;
69638 Traits::assign(*start, minus);
69639 }
69640 return true;
69641 }
69642 template<typename CharT, class Base, class Traits>
69643 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69644 boost::long_long_type n)
69645 {
69646 start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n), finish);
69647 if(n < 0)
69648 {
69649 --start;
69650 CharT const minus = lcast_char_constants<CharT>::minus;
69651 Traits::assign(*start, minus);
69652 }
69653 return true;
69654 }
69655 template<typename CharT, class Base, class Traits>
69656 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69657 unsigned short n)
69658 {
69659 start = lcast_put_unsigned<Traits>(n, finish);
69660 return true;
69661 }
69662 template<typename CharT, class Base, class Traits>
69663 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69664 unsigned int n)
69665 {
69666 start = lcast_put_unsigned<Traits>(n, finish);
69667 return true;
69668 }
69669 template<typename CharT, class Base, class Traits>
69670 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69671 unsigned long n)
69672 {
69673 start = lcast_put_unsigned<Traits>(n, finish);
69674 return true;
69675 }
69676 template<typename CharT, class Base, class Traits>
69677 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69678 boost::ulong_long_type n)
69679 {
69680 start = lcast_put_unsigned<Traits>(n, finish);
69681 return true;
69682 }
69683 template<typename CharT, class Base, class Traits>
69684 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69685 float val)
69686 {
69687 return this->lcast_put(val);
69688 }
69689 template<typename CharT, class Base, class Traits>
69690 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69691 double val)
69692 {
69693 return this->lcast_put(val);
69694 }
69695 template<typename CharT, class Base, class Traits>
69696 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69697 long double val)
69698 {
69699 return this->lcast_put(val);
69700 }
69701 template<typename CharT, class Base, class Traits>
69702 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
69703 CharT const* str)
69704 {
69705 start = const_cast<CharT*>(str);
69706 finish = start + Traits::length(str);
69707 return true;
69708 }
69709 template<typename CharT, class Base, class Traits>
69710 inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator>>(
69711 CharT& output)
69712 {
69713 bool const ok = (finish - start == 1);
69714 if(ok)
69715 Traits::assign(output, *start);
69716 return ok;
69717 }
69718 }
69719 namespace detail
69720 {
69721 template<class Source>
69722 struct lcast_streambuf_for_source
69723 {
69724 static const bool value = false;
69725 };
69726 template<>
69727 struct lcast_streambuf_for_source<float>
69728 {
69729 static const bool value = true;
69730 };
69731 template<>
69732 struct lcast_streambuf_for_source<double>
69733 {
69734 static const bool value = true;
69735 };
69736 template<>
69737 struct lcast_streambuf_for_source<long double>
69738 {
69739 static const bool value = true;
69740 };
69741 }
69742 namespace detail
69743 {
69744 template<class Target>
69745 struct lcast_streambuf_for_target
69746 {
69747 static const bool value = true;
69748 };
69749 template<>
69750 struct lcast_streambuf_for_target<char>
69751 {
69752 static const bool value = false;
69753 };
69754 template<>
69755 struct lcast_streambuf_for_target<wchar_t>
69756 {
69757 static const bool value = false;
69758 };
69759 template<class Traits, class Alloc>
69760 struct lcast_streambuf_for_target<
69761 std::basic_string<char,Traits,Alloc> >
69762 {
69763 static const bool value = false;
69764 };
69765 template<class Traits, class Alloc>
69766 struct lcast_streambuf_for_target<
69767 std::basic_string<wchar_t,Traits,Alloc> >
69768 {
69769 static const bool value = false;
69770 };
69771 }
69772 namespace detail
69773 {
69774 template<class T>
69775 struct array_to_pointer_decay
69776 {
69777 typedef T type;
69778 };
69779 template<class T, std::size_t N>
69780 struct array_to_pointer_decay<T[N]>
69781 {
69782 typedef const T * type;
69783 };
69784 template< typename Target
69785 , typename Source
69786 , bool Unlimited
69787 , typename CharT
69788 >
69789 Target lexical_cast(
69790 typename boost::call_traits<Source>::param_type arg,
69791 CharT* buf, std::size_t src_len)
69792 {
69793 typedef typename
69794 deduce_char_traits<CharT,Target,Source>::type traits;
69795 typedef typename boost::mpl::if_c<
69796 lcast_streambuf_for_target<Target>::value ||
69797 lcast_streambuf_for_source<Source>::value
69798 , std::basic_streambuf<CharT>
69799 , lexical_streambuf_fake
69800 >::type base;
69801 typename boost::mpl::if_c<
69802 Unlimited
69803 , detail::lexical_stream<Target,Source,traits>
69804 , detail::lexical_stream_limited_src<CharT,base,traits>
69805 >::type interpreter(buf, buf + src_len);
69806 Target result;
69807 if(!(interpreter << arg && interpreter >> result))
69808 throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
69809 return result;
69810 }
69811 }
69812 template<typename Target, typename Source>
69813 inline Target lexical_cast(const Source &arg)
69814 {
69815 typedef typename detail::array_to_pointer_decay<Source>::type src;
69816 typedef typename detail::widest_char<
69817 typename detail::stream_char<Target>::type
69818 , typename detail::stream_char<src>::type
69819 >::type char_type;
69820 typedef detail::lcast_src_length<char_type, src> lcast_src_length;
69821 std::size_t const src_len = lcast_src_length::value;
69822 char_type buf[src_len + 1];
69823 lcast_src_length::check_coverage();
69824 return detail::lexical_cast<Target, src, !src_len>(arg, buf, src_len);
69825 }
69826 }
69827 namespace boost { namespace python {
69828 namespace detail
69829 {
69830 template <class T>
69831 PyObject* convert_result(T const& x)
69832 {
69833 return converter::arg_to_python<T>(x).release();
69834 }
69835 template <operator_id> struct operator_l
69836 {
69837 template <class L, class R> struct apply;
69838 };
69839 template <operator_id> struct operator_r
69840 {
69841 template <class L, class R> struct apply;
69842 };
69843 template <operator_id> struct operator_1
69844 {
69845 template <class T> struct apply;
69846 };
69847 template <operator_id id, class L, class R>
69848 struct operator_l_inner
69849 : operator_l<id>::template apply<L,R>
69850 {};
69851 template <operator_id id, class L, class R>
69852 struct operator_r_inner
69853 : operator_r<id>::template apply<L,R>
69854 {};
69855 template <operator_id id, class T>
69856 struct operator_1_inner
69857 : operator_1<id>::template apply<T>
69858 {};
69859 template <operator_id id>
69860 struct binary_op : operator_l<id>
69861 {
69862 template <class T>
69863 struct apply : operator_l_inner<id,T,T>
69864 {
69865 };
69866 };
69867 template <operator_id id, class R>
69868 struct binary_op_l : operator_l<id>
69869 {
69870 template <class T>
69871 struct apply : operator_l_inner<id,T,R>
69872 {
69873 };
69874 };
69875 template <operator_id id, class L>
69876 struct binary_op_r : operator_r<id>
69877 {
69878 template <class T>
69879 struct apply : operator_r_inner<id,L,T>
69880 {
69881 };
69882 };
69883 template <operator_id id>
69884 struct unary_op : operator_1<id>
69885 {
69886 template <class T>
69887 struct apply : operator_1_inner<id,T>
69888 {
69889 };
69890 };
69891 template <operator_id id, class L = not_specified, class R = not_specified>
69892 struct operator_
69893 : def_visitor<operator_<id,L,R> >
69894 {
69895 private:
69896 template <class ClassT>
69897 void visit(ClassT& cl) const
69898 {
69899 typedef typename mpl::eval_if<
69900 is_same<L,self_t>
69901 , mpl::if_<
69902 is_same<R,self_t>
69903 , binary_op<id>
69904 , binary_op_l<
69905 id
69906 , typename unwrap_other<R>::type
69907 >
69908 >
69909 , mpl::if_<
69910 is_same<L,not_specified>
69911 , unary_op<id>
69912 , binary_op_r<
69913 id
69914 , typename unwrap_other<L>::type
69915 >
69916 >
69917 >::type generator;
69918 cl.def(
69919 generator::name()
69920 , &generator::template apply<
69921 typename ClassT::wrapped_type
69922 >::execute
69923 );
69924 }
69925 friend class python::def_visitor_access;
69926 };
69927 }
69928 namespace detail { template <> struct operator_l<op_add> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l + r); } }; static char const* name() { return "__" "add" "__"; } }; template <> struct operator_r<op_add> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l + r); } }; static char const* name() { return "__" "radd" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_add,L,R> operator +(L const&, R const&) { return detail::operator_<detail::op_add,L,R>(); } }
69929 namespace detail { template <> struct operator_l<op_sub> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l - r); } }; static char const* name() { return "__" "sub" "__"; } }; template <> struct operator_r<op_sub> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l - r); } }; static char const* name() { return "__" "rsub" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_sub,L,R> operator -(L const&, R const&) { return detail::operator_<detail::op_sub,L,R>(); } }
69930 namespace detail { template <> struct operator_l<op_mul> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l * r); } }; static char const* name() { return "__" "mul" "__"; } }; template <> struct operator_r<op_mul> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l * r); } }; static char const* name() { return "__" "rmul" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_mul,L,R> operator *(L const&, R const&) { return detail::operator_<detail::op_mul,L,R>(); } }
69931 namespace detail { template <> struct operator_l<op_div> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l / r); } }; static char const* name() { return "__" "div" "__"; } }; template <> struct operator_r<op_div> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l / r); } }; static char const* name() { return "__" "rdiv" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_div,L,R> operator /(L const&, R const&) { return detail::operator_<detail::op_div,L,R>(); } }
69932 namespace detail { template <> struct operator_l<op_mod> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l % r); } }; static char const* name() { return "__" "mod" "__"; } }; template <> struct operator_r<op_mod> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l % r); } }; static char const* name() { return "__" "rmod" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_mod,L,R> operator %(L const&, R const&) { return detail::operator_<detail::op_mod,L,R>(); } }
69933 namespace detail { template <> struct operator_l<op_lshift> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l << r); } }; static char const* name() { return "__" "lshift" "__"; } }; template <> struct operator_r<op_lshift> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l << r); } }; static char const* name() { return "__" "rlshift" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_lshift,L,R> operator <<(L const&, R const&) { return detail::operator_<detail::op_lshift,L,R>(); } }
69934 namespace detail { template <> struct operator_l<op_rshift> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l >> r); } }; static char const* name() { return "__" "rshift" "__"; } }; template <> struct operator_r<op_rshift> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l >> r); } }; static char const* name() { return "__" "rrshift" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_rshift,L,R> operator >>(L const&, R const&) { return detail::operator_<detail::op_rshift,L,R>(); } }
69935 namespace detail { template <> struct operator_l<op_and> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l & r); } }; static char const* name() { return "__" "and" "__"; } }; template <> struct operator_r<op_and> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l & r); } }; static char const* name() { return "__" "rand" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_and,L,R> operator &(L const&, R const&) { return detail::operator_<detail::op_and,L,R>(); } }
69936 namespace detail { template <> struct operator_l<op_xor> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l ^ r); } }; static char const* name() { return "__" "xor" "__"; } }; template <> struct operator_r<op_xor> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l ^ r); } }; static char const* name() { return "__" "rxor" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_xor,L,R> operator ^(L const&, R const&) { return detail::operator_<detail::op_xor,L,R>(); } }
69937 namespace detail { template <> struct operator_l<op_or> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l | r); } }; static char const* name() { return "__" "or" "__"; } }; template <> struct operator_r<op_or> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l | r); } }; static char const* name() { return "__" "ror" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_or,L,R> operator |(L const&, R const&) { return detail::operator_<detail::op_or,L,R>(); } }
69938 namespace detail { template <> struct operator_l<op_gt> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l > r); } }; static char const* name() { return "__" "gt" "__"; } }; template <> struct operator_r<op_gt> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l > r); } }; static char const* name() { return "__" "lt" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_gt,L,R> operator >(L const&, R const&) { return detail::operator_<detail::op_gt,L,R>(); } }
69939 namespace detail { template <> struct operator_l<op_ge> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l >= r); } }; static char const* name() { return "__" "ge" "__"; } }; template <> struct operator_r<op_ge> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l >= r); } }; static char const* name() { return "__" "le" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_ge,L,R> operator >=(L const&, R const&) { return detail::operator_<detail::op_ge,L,R>(); } }
69940 namespace detail { template <> struct operator_l<op_lt> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l < r); } }; static char const* name() { return "__" "lt" "__"; } }; template <> struct operator_r<op_lt> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l < r); } }; static char const* name() { return "__" "gt" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_lt,L,R> operator <(L const&, R const&) { return detail::operator_<detail::op_lt,L,R>(); } }
69941 namespace detail { template <> struct operator_l<op_le> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l <= r); } }; static char const* name() { return "__" "le" "__"; } }; template <> struct operator_r<op_le> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l <= r); } }; static char const* name() { return "__" "ge" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_le,L,R> operator <=(L const&, R const&) { return detail::operator_<detail::op_le,L,R>(); } }
69942 namespace detail { template <> struct operator_l<op_eq> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l == r); } }; static char const* name() { return "__" "eq" "__"; } }; template <> struct operator_r<op_eq> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l == r); } }; static char const* name() { return "__" "eq" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_eq,L,R> operator ==(L const&, R const&) { return detail::operator_<detail::op_eq,L,R>(); } }
69943 namespace detail { template <> struct operator_l<op_ne> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(l != r); } }; static char const* name() { return "__" "ne" "__"; } }; template <> struct operator_r<op_ne> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(l != r); } }; static char const* name() { return "__" "ne" "__"; } }; } namespace self_ns { template <class L, class R> inline detail::operator_<detail::op_ne,L,R> operator !=(L const&, R const&) { return detail::operator_<detail::op_ne,L,R>(); } }
69944 namespace detail { template <> struct operator_l<op_pow> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(lhs& l, rhs const& r) { return detail::convert_result(pow(l,r)); } }; static char const* name() { return "__" "pow" "__"; } }; template <> struct operator_r<op_pow> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(rhs& r, lhs const& l) { return detail::convert_result(pow(l,r)); } }; static char const* name() { return "__" "rpow" "__"; } }; }
69945 namespace self_ns
69946 {
69947 template <class L, class R>
69948 inline detail::operator_<detail::op_pow,L,R>
69949 pow(L const&, R const&)
69950 {
69951 return detail::operator_<detail::op_pow,L,R>();
69952 }
69953 }
69954 namespace detail { template <> struct operator_l<op_iadd> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() += r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "iadd" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_iadd,self_t,R> operator +=(self_t const&, R const&) { return detail::operator_<detail::op_iadd,self_t,R>(); } }
69955 namespace detail { template <> struct operator_l<op_isub> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() -= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "isub" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_isub,self_t,R> operator -=(self_t const&, R const&) { return detail::operator_<detail::op_isub,self_t,R>(); } }
69956 namespace detail { template <> struct operator_l<op_imul> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() *= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "imul" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_imul,self_t,R> operator *=(self_t const&, R const&) { return detail::operator_<detail::op_imul,self_t,R>(); } }
69957 namespace detail { template <> struct operator_l<op_idiv> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() /= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "idiv" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_idiv,self_t,R> operator /=(self_t const&, R const&) { return detail::operator_<detail::op_idiv,self_t,R>(); } }
69958 namespace detail { template <> struct operator_l<op_imod> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() %= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "imod" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_imod,self_t,R> operator %=(self_t const&, R const&) { return detail::operator_<detail::op_imod,self_t,R>(); } }
69959 namespace detail { template <> struct operator_l<op_ilshift> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() <<= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "ilshift" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_ilshift,self_t,R> operator <<=(self_t const&, R const&) { return detail::operator_<detail::op_ilshift,self_t,R>(); } }
69960 namespace detail { template <> struct operator_l<op_irshift> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() >>= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "irshift" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_irshift,self_t,R> operator >>=(self_t const&, R const&) { return detail::operator_<detail::op_irshift,self_t,R>(); } }
69961 namespace detail { template <> struct operator_l<op_iand> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() &= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "iand" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_iand,self_t,R> operator &=(self_t const&, R const&) { return detail::operator_<detail::op_iand,self_t,R>(); } }
69962 namespace detail { template <> struct operator_l<op_ixor> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() ^= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "ixor" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_ixor,self_t,R> operator ^=(self_t const&, R const&) { return detail::operator_<detail::op_ixor,self_t,R>(); } }
69963 namespace detail { template <> struct operator_l<op_ior> { template <class L, class R> struct apply { typedef typename unwrap_wrapper_<L>::type lhs; typedef typename unwrap_wrapper_<R>::type rhs; static PyObject* execute(back_reference<lhs&> l, rhs const& r) { l.get() |= r; return python::incref(l.source().ptr()); } }; static char const* name() { return "__" "ior" "__"; } }; } namespace self_ns { template <class R> inline detail::operator_<detail::op_ior,self_t,R> operator |=(self_t const&, R const&) { return detail::operator_<detail::op_ior,self_t,R>(); } }
69964 namespace detail { template <> struct operator_1<op_neg> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(-(x)); } }; static char const* name() { return "__" "neg" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_neg> operator-(self_t const&) { return detail::operator_<detail::op_neg>(); } }
69965 namespace detail { template <> struct operator_1<op_pos> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(+(x)); } }; static char const* name() { return "__" "pos" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_pos> operator+(self_t const&) { return detail::operator_<detail::op_pos>(); } }
69966 namespace detail { template <> struct operator_1<op_abs> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(abs(x)); } }; static char const* name() { return "__" "abs" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_abs> abs(self_t const&) { return detail::operator_<detail::op_abs>(); } }
69967 namespace detail { template <> struct operator_1<op_invert> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(~(x)); } }; static char const* name() { return "__" "invert" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_invert> operator~(self_t const&) { return detail::operator_<detail::op_invert>(); } }
69968 namespace detail { template <> struct operator_1<op_nonzero> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(!!(x)); } }; static char const* name() { return "__" "nonzero" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_nonzero> operator!(self_t const&) { return detail::operator_<detail::op_nonzero>(); } }
69969 namespace detail { template <> struct operator_1<op_int> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(long(x)); } }; static char const* name() { return "__" "int" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_int> int_(self_t const&) { return detail::operator_<detail::op_int>(); } }
69970 namespace detail { template <> struct operator_1<op_long> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(PyLong_FromLong(x)); } }; static char const* name() { return "__" "long" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_long> long_(self_t const&) { return detail::operator_<detail::op_long>(); } }
69971 namespace detail { template <> struct operator_1<op_float> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(double(x)); } }; static char const* name() { return "__" "float" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_float> float_(self_t const&) { return detail::operator_<detail::op_float>(); } }
69972 namespace detail { template <> struct operator_1<op_complex> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(std::complex<double>(x)); } }; static char const* name() { return "__" "complex" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_complex> complex_(self_t const&) { return detail::operator_<detail::op_complex>(); } }
69973 namespace detail { template <> struct operator_1<op_str> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(lexical_cast<std::string>(x)); } }; static char const* name() { return "__" "str" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_str> str(self_t const&) { return detail::operator_<detail::op_str>(); } }
69974 namespace detail { template <> struct operator_1<op_repr> { template <class T> struct apply { typedef typename unwrap_wrapper_<T>::type self_t; static PyObject* execute(self_t& x) { return detail::convert_result(lexical_cast<std::string>(x)); } }; static char const* name() { return "__" "repr" "__"; } }; } namespace self_ns { inline detail::operator_<detail::op_repr> repr(self_t const&) { return detail::operator_<detail::op_repr>(); } }
69975 }}
69976
69977 namespace boost { namespace python {
69978 namespace detail
69979 {
69980 struct overloads_base
69981 {
69982 overloads_base(char const* doc_)
69983 : m_doc(doc_) {}
69984 overloads_base(char const* doc_, detail::keyword_range const& kw)
69985 : m_doc(doc_), m_keywords(kw) {}
69986 char const* doc_string() const
69987 {
69988 return m_doc;
69989 }
69990 detail::keyword_range const& keywords() const
69991 {
69992 return m_keywords;
69993 }
69994 private:
69995 char const* m_doc;
69996 detail::keyword_range m_keywords;
69997 };
69998 template <class CallPoliciesT, class OverloadsT>
69999 struct overloads_proxy
70000 : public overloads_base
70001 {
70002 typedef typename OverloadsT::non_void_return_type non_void_return_type;
70003 typedef typename OverloadsT::void_return_type void_return_type;
70004 overloads_proxy(
70005 CallPoliciesT const& policies_
70006 , char const* doc
70007 , keyword_range const& kw
70008 )
70009 : overloads_base(doc, kw)
70010 , policies(policies_)
70011 {}
70012 CallPoliciesT
70013 call_policies() const
70014 {
70015 return policies;
70016 }
70017 CallPoliciesT policies;
70018 };
70019 template <class DerivedT>
70020 struct overloads_common
70021 : public overloads_base
70022 {
70023 overloads_common(char const* doc)
70024 : overloads_base(doc) {}
70025 overloads_common(char const* doc, keyword_range const& kw)
70026 : overloads_base(doc, kw) {}
70027 default_call_policies
70028 call_policies() const
70029 {
70030 return default_call_policies();
70031 }
70032 template <class CallPoliciesT>
70033 overloads_proxy<CallPoliciesT, DerivedT>
70034 operator[](CallPoliciesT const& policies) const
70035 {
70036 return overloads_proxy<CallPoliciesT, DerivedT>(
70037 policies, this->doc_string(), this->keywords());
70038 }
70039 };
70040 }}}
70041 namespace boost {
70042 template< typename T > struct has_nothrow_destructor : ::boost::integral_constant<bool,::boost::has_trivial_destructor<T>::value> { };
70043 }
70044 namespace boost {
70045 template< typename T > struct has_virtual_destructor : ::boost::integral_constant<bool,__has_virtual_destructor(T)> { };
70046 }
70047 namespace boost {
70048 namespace detail{
70049 template <class B, class D>
70050 struct is_base_of_imp
70051 {
70052 typedef typename remove_cv<B>::type ncvB;
70053 typedef typename remove_cv<D>::type ncvD;
70054 static const bool value = (::boost::type_traits::ice_or< (::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value), (::boost::type_traits::ice_and< ::boost::is_same<ncvB,ncvD>::value, ::boost::is_class<ncvB>::value>::value)>::value)
70055 ;
70056 };
70057 }
70058 template< typename Base, typename Derived > struct is_base_of : ::boost::integral_constant<bool,(::boost::detail::is_base_of_imp<Base, Derived>::value)> { };
70059 template< typename Base, typename Derived > struct is_base_of< Base&,Derived > : ::boost::integral_constant<bool,false> { };
70060 template< typename Base, typename Derived > struct is_base_of< Base,Derived& > : ::boost::integral_constant<bool,false> { };
70061 template< typename Base, typename Derived > struct is_base_of< Base&,Derived& > : ::boost::integral_constant<bool,false> { };
70062 }
70063 namespace boost {
70064 template< typename T > struct is_floating_point : ::boost::integral_constant<bool,false> { };
70065 template<> struct is_floating_point< float > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< float const > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< float volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< float const volatile > : ::boost::integral_constant<bool,true> { };
70066 template<> struct is_floating_point< double > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< double const > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< double volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< double const volatile > : ::boost::integral_constant<bool,true> { };
70067 template<> struct is_floating_point< long double > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< long double const > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< long double volatile > : ::boost::integral_constant<bool,true> { }; template<> struct is_floating_point< long double const volatile > : ::boost::integral_constant<bool,true> { };
70068 }
70069 namespace boost {
70070 namespace detail{
70071 template <typename T>
70072 struct is_member_object_pointer_impl
70073 {
70074 static const bool value = (::boost::type_traits::ice_and< ::boost::is_member_pointer<T>::value, ::boost::type_traits::ice_not< ::boost::is_member_function_pointer<T>::value >::value >::value )
70075 ;
70076 };
70077 }
70078 template< typename T > struct is_member_object_pointer : ::boost::integral_constant<bool,::boost::detail::is_member_object_pointer_impl<T>::value> { };
70079 }
70080
70081 namespace boost {
70082 namespace detail{
70083 template <class T, std::size_t N>
70084 struct rank_imp
70085 {
70086 static const std::size_t value = N;
70087 };
70088 template <class T, std::size_t R, std::size_t N>
70089 struct rank_imp<T[R], N>
70090 {
70091 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70092 };
70093 template <class T, std::size_t R, std::size_t N>
70094 struct rank_imp<T const[R], N>
70095 {
70096 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70097 };
70098 template <class T, std::size_t R, std::size_t N>
70099 struct rank_imp<T volatile[R], N>
70100 {
70101 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70102 };
70103 template <class T, std::size_t R, std::size_t N>
70104 struct rank_imp<T const volatile[R], N>
70105 {
70106 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70107 };
70108 template <class T, std::size_t N>
70109 struct rank_imp<T[], N>
70110 {
70111 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70112 };
70113 template <class T, std::size_t N>
70114 struct rank_imp<T const[], N>
70115 {
70116 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70117 };
70118 template <class T, std::size_t N>
70119 struct rank_imp<T volatile[], N>
70120 {
70121 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70122 };
70123 template <class T, std::size_t N>
70124 struct rank_imp<T const volatile[], N>
70125 {
70126 static const std::size_t value = (::boost::detail::rank_imp<T, N+1>::value);
70127 };
70128 }
70129 template< typename T > struct rank : ::boost::integral_constant<std::size_t,(::boost::detail::rank_imp<T,0>::value)> { };
70130 }
70131
70132 namespace boost {
70133 namespace detail{
70134 template <class T, std::size_t N>
70135 struct extent_imp
70136 {
70137 static const std::size_t value = 0;
70138 };
70139 template <class T, std::size_t R, std::size_t N>
70140 struct extent_imp<T[R], N>
70141 {
70142 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70143 };
70144 template <class T, std::size_t R, std::size_t N>
70145 struct extent_imp<T const[R], N>
70146 {
70147 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70148 };
70149 template <class T, std::size_t R, std::size_t N>
70150 struct extent_imp<T volatile[R], N>
70151 {
70152 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70153 };
70154 template <class T, std::size_t R, std::size_t N>
70155 struct extent_imp<T const volatile[R], N>
70156 {
70157 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70158 };
70159 template <class T, std::size_t R>
70160 struct extent_imp<T[R],0>
70161 {
70162 static const std::size_t value = R;
70163 };
70164 template <class T, std::size_t R>
70165 struct extent_imp<T const[R], 0>
70166 {
70167 static const std::size_t value = R;
70168 };
70169 template <class T, std::size_t R>
70170 struct extent_imp<T volatile[R], 0>
70171 {
70172 static const std::size_t value = R;
70173 };
70174 template <class T, std::size_t R>
70175 struct extent_imp<T const volatile[R], 0>
70176 {
70177 static const std::size_t value = R;
70178 };
70179 template <class T, std::size_t N>
70180 struct extent_imp<T[], N>
70181 {
70182 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70183 };
70184 template <class T, std::size_t N>
70185 struct extent_imp<T const[], N>
70186 {
70187 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70188 };
70189 template <class T, std::size_t N>
70190 struct extent_imp<T volatile[], N>
70191 {
70192 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70193 };
70194 template <class T, std::size_t N>
70195 struct extent_imp<T const volatile[], N>
70196 {
70197 static const std::size_t value = (::boost::detail::extent_imp<T, N-1>::value);
70198 };
70199 template <class T>
70200 struct extent_imp<T[], 0>
70201 {
70202 static const std::size_t value = 0;
70203 };
70204 template <class T>
70205 struct extent_imp<T const[], 0>
70206 {
70207 static const std::size_t value = 0;
70208 };
70209 template <class T>
70210 struct extent_imp<T volatile[], 0>
70211 {
70212 static const std::size_t value = 0;
70213 };
70214 template <class T>
70215 struct extent_imp<T const volatile[], 0>
70216 {
70217 static const std::size_t value = 0;
70218 };
70219 }
70220 template <class T, std::size_t N = 0>
70221 struct extent
70222 : public ::boost::integral_constant<std::size_t, ::boost::detail::extent_imp<T,N>::value>
70223 {
70224
70225 };
70226 }
70227
70228 namespace boost {
70229 template< typename T > struct remove_extent { typedef T type; };
70230 template< typename T, std::size_t N > struct remove_extent<T[N]> { typedef T type; };
70231 template< typename T, std::size_t N > struct remove_extent<T const[N]> { typedef T const type; };
70232 template< typename T, std::size_t N > struct remove_extent<T volatile[N]> { typedef T volatile type; };
70233 template< typename T, std::size_t N > struct remove_extent<T const volatile[N]> { typedef T const volatile type; };
70234 template< typename T > struct remove_extent<T[]> { typedef T type; };
70235 template< typename T > struct remove_extent<T const[]> { typedef T const type; };
70236 template< typename T > struct remove_extent<T volatile[]> { typedef T volatile type; };
70237 template< typename T > struct remove_extent<T const volatile[]> { typedef T const volatile type; };
70238 }
70239
70240 namespace boost {
70241 template< typename T > struct remove_all_extents { typedef T type; };
70242 template< typename T, std::size_t N > struct remove_all_extents<T[N]> { typedef typename boost::remove_all_extents<T>::type type; };
70243 template< typename T, std::size_t N > struct remove_all_extents<T const[N]> { typedef typename boost::remove_all_extents<T const>::type type; };
70244 template< typename T, std::size_t N > struct remove_all_extents<T volatile[N]> { typedef typename boost::remove_all_extents<T volatile>::type type; };
70245 template< typename T, std::size_t N > struct remove_all_extents<T const volatile[N]> { typedef typename boost::remove_all_extents<T const volatile>::type type; };
70246 template< typename T > struct remove_all_extents<T[]> { typedef typename boost::remove_all_extents<T>::type type; };
70247 template< typename T > struct remove_all_extents<T const[]> { typedef typename boost::remove_all_extents<T const>::type type; };
70248 template< typename T > struct remove_all_extents<T volatile[]> { typedef typename boost::remove_all_extents<T volatile>::type type; };
70249 template< typename T > struct remove_all_extents<T const volatile[]> { typedef typename boost::remove_all_extents<T const volatile>::type type; };
70250 }
70251 namespace boost {
70252 namespace type_traits { namespace detail {
70253 template<class T>
70254 struct floating_point_promotion
70255 {
70256 typedef T type;
70257 };
70258 template<>
70259 struct floating_point_promotion<float>
70260 {
70261 typedef double type;
70262 };
70263 template<>
70264 struct floating_point_promotion<float const>
70265 {
70266 typedef double const type;
70267 };
70268 template<>
70269 struct floating_point_promotion<float volatile>
70270 {
70271 typedef double volatile type;
70272 };
70273 template<>
70274 struct floating_point_promotion<float const volatile>
70275 {
70276 typedef double const volatile type;
70277 };
70278 } }
70279 template< typename T > struct floating_point_promotion { typedef typename boost::type_traits::detail::floating_point_promotion<T>::type type; };
70280 }
70281 namespace boost {
70282 namespace type_traits { namespace detail {
70283 template <class T> struct need_promotion : boost::is_enum<T> {};
70284 template<> struct need_promotion<char > : true_type {};
70285 template<> struct need_promotion<signed char > : true_type {};
70286 template<> struct need_promotion<unsigned char > : true_type {};
70287 template<> struct need_promotion<signed short int > : true_type {};
70288 template<> struct need_promotion<unsigned short int> : true_type {};
70289 template<> struct need_promotion<boost::ulong_long_type> : integral_constant<bool, (sizeof(boost::ulong_long_type) < sizeof(int))> {};
70290 template<> struct need_promotion<boost::long_long_type> : integral_constant<bool, (sizeof(boost::long_long_type) < sizeof(int))> {};
70291 template<> struct need_promotion<wchar_t> : true_type {};
70292 template<> struct need_promotion<bool> : true_type {};
70293 template<int Index, int IsConst, int IsVolatile> struct promote_from_index;
70294 template<> struct promote_from_index<1,0,0> { typedef int type; }; template<> struct promote_from_index<1,0,1> { typedef int volatile type; }; template<> struct promote_from_index<1,1,0> { typedef int const type; }; template<> struct promote_from_index<1,1,1> { typedef int const volatile type; };
70295 template<> struct promote_from_index<2,0,0> { typedef unsigned int type; }; template<> struct promote_from_index<2,0,1> { typedef unsigned int volatile type; }; template<> struct promote_from_index<2,1,0> { typedef unsigned int const type; }; template<> struct promote_from_index<2,1,1> { typedef unsigned int const volatile type; };
70296 template<> struct promote_from_index<3,0,0> { typedef long type; }; template<> struct promote_from_index<3,0,1> { typedef long volatile type; }; template<> struct promote_from_index<3,1,0> { typedef long const type; }; template<> struct promote_from_index<3,1,1> { typedef long const volatile type; };
70297 template<> struct promote_from_index<4,0,0> { typedef unsigned long type; }; template<> struct promote_from_index<4,0,1> { typedef unsigned long volatile type; }; template<> struct promote_from_index<4,1,0> { typedef unsigned long const type; }; template<> struct promote_from_index<4,1,1> { typedef unsigned long const volatile type; };
70298 template<> struct promote_from_index<5,0,0> { typedef boost::long_long_type type; }; template<> struct promote_from_index<5,0,1> { typedef boost::long_long_type volatile type; }; template<> struct promote_from_index<5,1,0> { typedef boost::long_long_type const type; }; template<> struct promote_from_index<5,1,1> { typedef boost::long_long_type const volatile type; };
70299 template<> struct promote_from_index<6,0,0> { typedef boost::ulong_long_type type; }; template<> struct promote_from_index<6,0,1> { typedef boost::ulong_long_type volatile type; }; template<> struct promote_from_index<6,1,0> { typedef boost::ulong_long_type const type; }; template<> struct promote_from_index<6,1,1> { typedef boost::ulong_long_type const volatile type; };
70300 template<int N>
70301 struct sized_type_for_promotion
70302 {
70303 typedef char (&type)[N];
70304 };
70305 sized_type_for_promotion<1>::type promoted_index_tester(int);
70306 sized_type_for_promotion<2>::type promoted_index_tester(unsigned int);
70307 sized_type_for_promotion<3>::type promoted_index_tester(long);
70308 sized_type_for_promotion<4>::type promoted_index_tester(unsigned long);
70309 sized_type_for_promotion<5>::type promoted_index_tester(boost::long_long_type);
70310 sized_type_for_promotion<6>::type promoted_index_tester(boost::ulong_long_type);
70311 template<class T>
70312 struct promoted_index
70313 {
70314 static T testee;
70315 static const int value = sizeof(promoted_index_tester(+testee));
70316 };
70317 template<class T>
70318 struct integral_promotion_impl
70319 {
70320 typedef typename promote_from_index<
70321 (boost::type_traits::detail::promoted_index<T>::value)
70322 , (boost::is_const<T>::value)
70323 , (boost::is_volatile<T>::value)
70324 >::type type;
70325 };
70326 template<class T>
70327 struct integral_promotion
70328 : boost::mpl::eval_if<
70329 need_promotion<typename remove_cv<T>::type>
70330 , integral_promotion_impl<T>
70331 , boost::mpl::identity<T>
70332 >
70333 {
70334 };
70335 } }
70336 template< typename T > struct integral_promotion { typedef typename boost::type_traits::detail::integral_promotion<T>::type type; };
70337 }
70338 namespace boost {
70339 namespace detail {
70340 template<class T>
70341 struct promote_impl
70342 : integral_promotion<
70343 typename floating_point_promotion<T>::type
70344 >
70345 {
70346 };
70347 }
70348 template< typename T > struct promote { typedef typename boost::detail::promote_impl<T>::type type; };
70349 }
70350 namespace boost {
70351 namespace detail {
70352 template <class T>
70353 struct make_signed_imp
70354 {
70355 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_enum<T>::value>::value)) == 0 ? false : true) >)>
70356 boost_static_assert_typedef_39;
70357 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((::boost::type_traits::ice_not< ::boost::is_same< typename remove_cv<T>::type, bool>::value>::value)) == 0 ? false : true) >)>
70358 boost_static_assert_typedef_43;
70359 typedef typename remove_cv<T>::type t_no_cv;
70360 typedef typename mpl::if_c<
70361 (::boost::type_traits::ice_and<
70362 ::boost::is_signed<T>::value,
70363 ::boost::is_integral<T>::value,
70364 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
70365 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
70366 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value >::value),
70367 T,
70368 typename mpl::if_c<
70369 (::boost::type_traits::ice_and<
70370 ::boost::is_integral<T>::value,
70371 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
70372 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
70373 ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value>
70374 ::value),
70375 typename mpl::if_<
70376 is_same<t_no_cv, unsigned char>,
70377 signed char,
70378 typename mpl::if_<
70379 is_same<t_no_cv, unsigned short>,
70380 signed short,
70381 typename mpl::if_<
70382 is_same<t_no_cv, unsigned int>,
70383 int,
70384 typename mpl::if_<
70385 is_same<t_no_cv, unsigned long>,
70386 long,
70387 boost::long_long_type
70388 >::type
70389 >::type
70390 >::type
70391 >::type,
70392 typename mpl::if_c<
70393 sizeof(t_no_cv) == sizeof(unsigned char),
70394 signed char,
70395 typename mpl::if_c<
70396 sizeof(t_no_cv) == sizeof(unsigned short),
70397 signed short,
70398 typename mpl::if_c<
70399 sizeof(t_no_cv) == sizeof(unsigned int),
70400 int,
70401 typename mpl::if_c<
70402 sizeof(t_no_cv) == sizeof(unsigned long),
70403 long,
70404 boost::long_long_type
70405 >::type
70406 >::type
70407 >::type
70408 >::type
70409 >::type
70410 >::type base_integer_type;
70411 typedef typename mpl::if_<
70412 is_const<T>,
70413 typename add_const<base_integer_type>::type,
70414 base_integer_type
70415 >::type const_base_integer_type;
70416 typedef typename mpl::if_<
70417 is_volatile<T>,
70418 typename add_volatile<const_base_integer_type>::type,
70419 const_base_integer_type
70420 >::type type;
70421 };
70422 }
70423 template< typename T > struct make_signed { typedef typename boost::detail::make_signed_imp<T>::type type; };
70424 }
70425 namespace boost
70426 {
70427 template< class T >
70428 struct decay
70429 {
70430 private:
70431 typedef typename remove_reference<T>::type Ty;
70432 public:
70433 typedef typename mpl::eval_if<
70434 is_array<Ty>,
70435 mpl::identity<typename remove_bounds<Ty>::type*>,
70436 typename mpl::eval_if<
70437 is_function<Ty>,
70438 add_pointer<Ty>,
70439 mpl::identity<Ty>
70440 >
70441 >::type type;
70442 };
70443 }
70444 namespace boost {
70445 namespace detail{
70446 struct is_convertible_from_tester
70447 {
70448 template <class T>
70449 is_convertible_from_tester(const std::complex<T>&);
70450 };
70451 }
70452 template< typename T > struct is_complex : ::boost::integral_constant<bool,(::boost::is_convertible<T, detail::is_convertible_from_tester>::value)> { };
70453 }
70454 namespace boost { namespace python {
70455 struct module;
70456 namespace objects
70457 {
70458 struct class_base;
70459 }
70460 namespace detail
70461 {
70462 template <class Func, class CallPolicies, class NameSpaceT>
70463 static void name_space_def(
70464 NameSpaceT& name_space
70465 , char const* name
70466 , Func f
70467 , keyword_range const& kw
70468 , CallPolicies const& policies
70469 , char const* doc
70470 , objects::class_base*
70471 )
70472 {
70473 typedef typename NameSpaceT::wrapped_type wrapped_type;
70474 objects::add_to_namespace(
70475 name_space, name,
70476 detail::make_keyword_range_function(
70477 f, policies, kw, get_signature(f, (wrapped_type*)0))
70478 , doc
70479 );
70480 }
70481 template <class Func, class CallPolicies>
70482 static void name_space_def(
70483 object& name_space
70484 , char const* name
70485 , Func f
70486 , keyword_range const& kw
70487 , CallPolicies const& policies
70488 , char const* doc
70489 , ...
70490 )
70491 {
70492 scope within(name_space);
70493 detail::scope_setattr_doc(
70494 name
70495 , detail::make_keyword_range_function(f, policies, kw)
70496 , doc);
70497 }
70498 template <class Func, class CallPolicies, class NameSpaceT>
70499 static void name_space_def(
70500 NameSpaceT& name_space
70501 , char const* name
70502 , Func f
70503 , keyword_range const& kw
70504 , CallPolicies const& policies
70505 , char const* doc
70506 , module*
70507 )
70508 {
70509 name_space.def(name, f, policies, doc);
70510 }
70511 template <int N>
70512 struct define_stub_function {};
70513 template <>
70514 struct define_stub_function<0> {
70515 template <class StubsT, class CallPolicies, class NameSpaceT>
70516 static void define(
70517 char const* name
70518 , StubsT const&
70519 , keyword_range const& kw
70520 , CallPolicies const& policies
70521 , NameSpaceT& name_space
70522 , char const* doc)
70523 {
70524 detail::name_space_def(
70525 name_space
70526 , name
70527 , &StubsT::func_0
70528 , kw
70529 , policies
70530 , doc
70531 , &name_space);
70532 }
70533 };
70534 template <>
70535 struct define_stub_function<1> {
70536 template <class StubsT, class CallPolicies, class NameSpaceT>
70537 static void define(
70538 char const* name
70539 , StubsT const&
70540 , keyword_range const& kw
70541 , CallPolicies const& policies
70542 , NameSpaceT& name_space
70543 , char const* doc)
70544 {
70545 detail::name_space_def(
70546 name_space
70547 , name
70548 , &StubsT::func_1
70549 , kw
70550 , policies
70551 , doc
70552 , &name_space);
70553 }
70554 };
70555 template <>
70556 struct define_stub_function<2> {
70557 template <class StubsT, class CallPolicies, class NameSpaceT>
70558 static void define(
70559 char const* name
70560 , StubsT const&
70561 , keyword_range const& kw
70562 , CallPolicies const& policies
70563 , NameSpaceT& name_space
70564 , char const* doc)
70565 {
70566 detail::name_space_def(
70567 name_space
70568 , name
70569 , &StubsT::func_2
70570 , kw
70571 , policies
70572 , doc
70573 , &name_space);
70574 }
70575 };
70576 template <>
70577 struct define_stub_function<3> {
70578 template <class StubsT, class CallPolicies, class NameSpaceT>
70579 static void define(
70580 char const* name
70581 , StubsT const&
70582 , keyword_range const& kw
70583 , CallPolicies const& policies
70584 , NameSpaceT& name_space
70585 , char const* doc)
70586 {
70587 detail::name_space_def(
70588 name_space
70589 , name
70590 , &StubsT::func_3
70591 , kw
70592 , policies
70593 , doc
70594 , &name_space);
70595 }
70596 };
70597 template <>
70598 struct define_stub_function<4> {
70599 template <class StubsT, class CallPolicies, class NameSpaceT>
70600 static void define(
70601 char const* name
70602 , StubsT const&
70603 , keyword_range const& kw
70604 , CallPolicies const& policies
70605 , NameSpaceT& name_space
70606 , char const* doc)
70607 {
70608 detail::name_space_def(
70609 name_space
70610 , name
70611 , &StubsT::func_4
70612 , kw
70613 , policies
70614 , doc
70615 , &name_space);
70616 }
70617 };
70618 template <>
70619 struct define_stub_function<5> {
70620 template <class StubsT, class CallPolicies, class NameSpaceT>
70621 static void define(
70622 char const* name
70623 , StubsT const&
70624 , keyword_range const& kw
70625 , CallPolicies const& policies
70626 , NameSpaceT& name_space
70627 , char const* doc)
70628 {
70629 detail::name_space_def(
70630 name_space
70631 , name
70632 , &StubsT::func_5
70633 , kw
70634 , policies
70635 , doc
70636 , &name_space);
70637 }
70638 };
70639 template <>
70640 struct define_stub_function<6> {
70641 template <class StubsT, class CallPolicies, class NameSpaceT>
70642 static void define(
70643 char const* name
70644 , StubsT const&
70645 , keyword_range const& kw
70646 , CallPolicies const& policies
70647 , NameSpaceT& name_space
70648 , char const* doc)
70649 {
70650 detail::name_space_def(
70651 name_space
70652 , name
70653 , &StubsT::func_6
70654 , kw
70655 , policies
70656 , doc
70657 , &name_space);
70658 }
70659 };
70660 template <>
70661 struct define_stub_function<7> {
70662 template <class StubsT, class CallPolicies, class NameSpaceT>
70663 static void define(
70664 char const* name
70665 , StubsT const&
70666 , keyword_range const& kw
70667 , CallPolicies const& policies
70668 , NameSpaceT& name_space
70669 , char const* doc)
70670 {
70671 detail::name_space_def(
70672 name_space
70673 , name
70674 , &StubsT::func_7
70675 , kw
70676 , policies
70677 , doc
70678 , &name_space);
70679 }
70680 };
70681 template <>
70682 struct define_stub_function<8> {
70683 template <class StubsT, class CallPolicies, class NameSpaceT>
70684 static void define(
70685 char const* name
70686 , StubsT const&
70687 , keyword_range const& kw
70688 , CallPolicies const& policies
70689 , NameSpaceT& name_space
70690 , char const* doc)
70691 {
70692 detail::name_space_def(
70693 name_space
70694 , name
70695 , &StubsT::func_8
70696 , kw
70697 , policies
70698 , doc
70699 , &name_space);
70700 }
70701 };
70702 template <>
70703 struct define_stub_function<9> {
70704 template <class StubsT, class CallPolicies, class NameSpaceT>
70705 static void define(
70706 char const* name
70707 , StubsT const&
70708 , keyword_range const& kw
70709 , CallPolicies const& policies
70710 , NameSpaceT& name_space
70711 , char const* doc)
70712 {
70713 detail::name_space_def(
70714 name_space
70715 , name
70716 , &StubsT::func_9
70717 , kw
70718 , policies
70719 , doc
70720 , &name_space);
70721 }
70722 };
70723 template <>
70724 struct define_stub_function<10> {
70725 template <class StubsT, class CallPolicies, class NameSpaceT>
70726 static void define(
70727 char const* name
70728 , StubsT const&
70729 , keyword_range const& kw
70730 , CallPolicies const& policies
70731 , NameSpaceT& name_space
70732 , char const* doc)
70733 {
70734 detail::name_space_def(
70735 name_space
70736 , name
70737 , &StubsT::func_10
70738 , kw
70739 , policies
70740 , doc
70741 , &name_space);
70742 }
70743 };
70744 template <>
70745 struct define_stub_function<11> {
70746 template <class StubsT, class CallPolicies, class NameSpaceT>
70747 static void define(
70748 char const* name
70749 , StubsT const&
70750 , keyword_range const& kw
70751 , CallPolicies const& policies
70752 , NameSpaceT& name_space
70753 , char const* doc)
70754 {
70755 detail::name_space_def(
70756 name_space
70757 , name
70758 , &StubsT::func_11
70759 , kw
70760 , policies
70761 , doc
70762 , &name_space);
70763 }
70764 };
70765 template <>
70766 struct define_stub_function<12> {
70767 template <class StubsT, class CallPolicies, class NameSpaceT>
70768 static void define(
70769 char const* name
70770 , StubsT const&
70771 , keyword_range const& kw
70772 , CallPolicies const& policies
70773 , NameSpaceT& name_space
70774 , char const* doc)
70775 {
70776 detail::name_space_def(
70777 name_space
70778 , name
70779 , &StubsT::func_12
70780 , kw
70781 , policies
70782 , doc
70783 , &name_space);
70784 }
70785 };
70786 template <>
70787 struct define_stub_function<13> {
70788 template <class StubsT, class CallPolicies, class NameSpaceT>
70789 static void define(
70790 char const* name
70791 , StubsT const&
70792 , keyword_range const& kw
70793 , CallPolicies const& policies
70794 , NameSpaceT& name_space
70795 , char const* doc)
70796 {
70797 detail::name_space_def(
70798 name_space
70799 , name
70800 , &StubsT::func_13
70801 , kw
70802 , policies
70803 , doc
70804 , &name_space);
70805 }
70806 };
70807 template <>
70808 struct define_stub_function<14> {
70809 template <class StubsT, class CallPolicies, class NameSpaceT>
70810 static void define(
70811 char const* name
70812 , StubsT const&
70813 , keyword_range const& kw
70814 , CallPolicies const& policies
70815 , NameSpaceT& name_space
70816 , char const* doc)
70817 {
70818 detail::name_space_def(
70819 name_space
70820 , name
70821 , &StubsT::func_14
70822 , kw
70823 , policies
70824 , doc
70825 , &name_space);
70826 }
70827 };
70828 template <>
70829 struct define_stub_function<15> {
70830 template <class StubsT, class CallPolicies, class NameSpaceT>
70831 static void define(
70832 char const* name
70833 , StubsT const&
70834 , keyword_range const& kw
70835 , CallPolicies const& policies
70836 , NameSpaceT& name_space
70837 , char const* doc)
70838 {
70839 detail::name_space_def(
70840 name_space
70841 , name
70842 , &StubsT::func_15
70843 , kw
70844 , policies
70845 , doc
70846 , &name_space);
70847 }
70848 };
70849 template <int N>
70850 struct define_with_defaults_helper {
70851 template <class StubsT, class CallPolicies, class NameSpaceT>
70852 static void
70853 def(
70854 char const* name,
70855 StubsT stubs,
70856 keyword_range kw,
70857 CallPolicies const& policies,
70858 NameSpaceT& name_space,
70859 char const* doc)
70860 {
70861 define_stub_function<N>::define(name, stubs, kw, policies, name_space, doc);
70862 if (kw.second > kw.first)
70863 --kw.second;
70864 define_with_defaults_helper<N-1>::def(name, stubs, kw, policies, name_space, doc);
70865 }
70866 };
70867 template <>
70868 struct define_with_defaults_helper<0> {
70869 template <class StubsT, class CallPolicies, class NameSpaceT>
70870 static void
70871 def(
70872 char const* name,
70873 StubsT stubs,
70874 keyword_range const& kw,
70875 CallPolicies const& policies,
70876 NameSpaceT& name_space,
70877 char const* doc)
70878 {
70879 define_stub_function<0>::define(name, stubs, kw, policies, name_space, doc);
70880 }
70881 };
70882 template <class OverloadsT, class NameSpaceT, class SigT>
70883 inline void
70884 define_with_defaults(
70885 char const* name,
70886 OverloadsT const& overloads,
70887 NameSpaceT& name_space,
70888 SigT const&)
70889 {
70890 typedef typename mpl::front<SigT>::type return_type;
70891 typedef typename OverloadsT::void_return_type void_return_type;
70892 typedef typename OverloadsT::non_void_return_type non_void_return_type;
70893 typedef typename mpl::if_c<
70894 boost::is_same<void, return_type>::value
70895 , void_return_type
70896 , non_void_return_type
70897 >::type stubs_type;
70898 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((stubs_type::max_args) <= mpl::size<SigT>::value) == 0 ? false : true) >)>
70899 boost_static_assert_typedef_247;
70900 typedef typename stubs_type::template gen<SigT> gen_type;
70901 define_with_defaults_helper<stubs_type::n_funcs-1>::def(
70902 name
70903 , gen_type()
70904 , overloads.keywords()
70905 , overloads.call_policies()
70906 , name_space
70907 , overloads.doc_string());
70908 }
70909 }
70910 }}
70911 namespace boost { namespace python { namespace detail {
70912 template <class NullaryFunction>
70913 struct nullary_function_adaptor
70914 {
70915 nullary_function_adaptor(NullaryFunction fn)
70916 : m_fn(fn)
70917 {}
70918 void operator()() const { m_fn(); }
70919 template < class A0> void operator()( A0 const& ) const { m_fn(); }
70920 template < class A0 , class A1> void operator()( A0 const& , A1 const& ) const { m_fn(); }
70921 template < class A0 , class A1 , class A2> void operator()( A0 const& , A1 const& , A2 const& ) const { m_fn(); }
70922 template < class A0 , class A1 , class A2 , class A3> void operator()( A0 const& , A1 const& , A2 const& , A3 const& ) const { m_fn(); }
70923 template < class A0 , class A1 , class A2 , class A3 , class A4> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& ) const { m_fn(); }
70924 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& ) const { m_fn(); }
70925 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& ) const { m_fn(); }
70926 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& ) const { m_fn(); }
70927 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& ) const { m_fn(); }
70928 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const& ) const { m_fn(); }
70929 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const& , A10 const& ) const { m_fn(); }
70930 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const& , A10 const& , A11 const& ) const { m_fn(); }
70931 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const& , A10 const& , A11 const& , A12 const& ) const { m_fn(); }
70932 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const& , A10 const& , A11 const& , A12 const& , A13 const& ) const { m_fn(); }
70933 template < class A0 , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 , class A14> void operator()( A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const& , A10 const& , A11 const& , A12 const& , A13 const& , A14 const& ) const { m_fn(); }
70934 private:
70935 NullaryFunction m_fn;
70936 };
70937 }}}
70938 namespace boost { namespace python {
70939 namespace detail
70940 {
70941 void pure_virtual_called();
70942 template <class S, class T1, class T2>
70943 struct replace_front2
70944 {
70945 typedef typename mpl::push_front<
70946 typename mpl::push_front<
70947 typename mpl::pop_front<
70948 typename mpl::pop_front<
70949 S
70950 >::type
70951 >::type
70952 , T2
70953 >::type
70954 , T1
70955 >::type type;
70956 };
70957 template <class C, class S>
70958 typename replace_front2<S,void,C&>::type
70959 error_signature(S )
70960 {
70961 typedef typename replace_front2<S,void,C&>::type r;
70962 return r();
70963 }
70964 template <class PointerToMemberFunction>
70965 struct pure_virtual_visitor
70966 : def_visitor<pure_virtual_visitor<PointerToMemberFunction> >
70967 {
70968 pure_virtual_visitor(PointerToMemberFunction pmf)
70969 : m_pmf(pmf)
70970 {}
70971 private:
70972 friend class python::def_visitor_access;
70973 template <class C_, class Options>
70974 void visit(C_& c, char const* name, Options& options) const
70975 {
70976 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((!Options::has_default_implementation) == 0 ? false : true) >)> boost_static_assert_typedef_80;
70977 c.def(
70978 name
70979 , m_pmf
70980 , options.doc()
70981 , options.keywords()
70982 , options.policies()
70983 );
70984 typedef typename C_::metadata::held_type held_type;
70985 c.def(
70986 name
70987 , make_function(
70988 detail::nullary_function_adaptor<void(*)()>(pure_virtual_called)
70989 , default_call_policies()
70990 , detail::error_signature<held_type>(detail::get_signature(m_pmf))
70991 )
70992 );
70993 }
70994 private:
70995 PointerToMemberFunction m_pmf;
70996 };
70997 }
70998 template <class PointerToMemberFunction>
70999 detail::pure_virtual_visitor<PointerToMemberFunction>
71000 pure_virtual(PointerToMemberFunction pmf)
71001 {
71002 return detail::pure_virtual_visitor<PointerToMemberFunction>(pmf);
71003 }
71004 }}
71005 namespace boost { namespace python {
71006 template <class P>
71007 void register_ptr_to_python()
71008 {
71009 typedef typename boost::python::pointee<P>::type X;
71010 objects::class_value_wrapper<
71011 P
71012 , objects::make_ptr_instance<
71013 X
71014 , objects::pointer_holder<P,X>
71015 >
71016 >();
71017 }
71018 }}
71019
71020 namespace boost { namespace python {
71021 namespace detail
71022 {
71023 template <std::size_t>
71024 struct return_arg_pos_argument_must_be_positive
71025 {}
71026 ;
71027 struct return_none
71028 {
71029 template <class T> struct apply
71030 {
71031 struct type
71032 {
71033 static bool convertible()
71034 {
71035 return true;
71036 }
71037 PyObject *operator()( typename value_arg<T>::type ) const
71038 {
71039 return none();
71040 }
71041 PyTypeObject const *get_pytype() const { return converter::expected_pytype_for_arg<T>::get_pytype() ; }
71042 };
71043 };
71044 };
71045 }
71046 template <
71047 std::size_t arg_pos=1
71048 , class Base = default_call_policies
71049 >
71050 struct return_arg : Base
71051 {
71052 private:
71053 static const bool legal = arg_pos > 0;
71054 public:
71055 typedef typename mpl::if_c<
71056 legal
71057 , detail::return_none
71058 , detail::return_arg_pos_argument_must_be_positive<arg_pos>
71059 >::type result_converter;
71060 template <class ArgumentPackage>
71061 static PyObject* postcall(ArgumentPackage const& args, PyObject* result)
71062 {
71063 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((arg_pos > 0) == 0 ? false : true) >)> boost_static_assert_typedef_85;
71064 result = Base::postcall(args,result);
71065 if (!result)
71066 return 0;
71067 if ( --((PyObject*)(result))->ob_refcnt != 0) ; else ( (*(((PyObject*)((PyObject *)(result)))->ob_type)->tp_dealloc)((PyObject *)((PyObject *)(result))));
71068 return incref( detail::get(mpl::int_<arg_pos-1>(),args) );
71069 }
71070 template <class Sig>
71071 struct extract_return_type : mpl::at_c<Sig, arg_pos>
71072 {
71073 };
71074 };
71075 template <
71076 class Base = default_call_policies
71077 >
71078 struct return_self
71079 : return_arg<1,Base>
71080 {};
71081 }}
71082 namespace boost { namespace python {
71083 namespace detail
71084 {
71085 template <class Pointee>
71086 static void opaque_pointee(Pointee const volatile*)
71087 {
71088 force_instantiate(opaque<Pointee>::instance);
71089 }
71090 }
71091 struct return_opaque_pointer
71092 {
71093 template <class R>
71094 struct apply
71095 {
71096 struct RETURN_OPAQUE_POINTER_EXPECTS_A_POINTER_TYPE; typedef struct RETURN_OPAQUE_POINTER_EXPECTS_A_POINTER_TYPE34 : boost::mpl::assert_ { static boost::mpl::failed ************ (RETURN_OPAQUE_POINTER_EXPECTS_A_POINTER_TYPE::************ assert_arg()) (R) { return 0; } } mpl_assert_arg34; enum { mpl_assertion_in_line_34 = sizeof( boost::mpl::assertion_failed<(is_pointer<R>::value)>( mpl_assert_arg34::assert_arg() ) ) };
71097 struct type :
71098 boost::python::to_python_value<
71099 typename detail::value_arg<R>::type
71100 >
71101 {
71102 type() { detail::opaque_pointee(R()); }
71103 };
71104 };
71105 };
71106 }}
71107
71108 namespace boost { namespace python {
71109 namespace detail
71110 {
71111 template <class F>
71112 struct raw_dispatcher
71113 {
71114 raw_dispatcher(F f) : f(f) {}
71115 PyObject* operator()(PyObject* args, PyObject* keywords)
71116 {
71117 return incref(
71118 object(
71119 f(
71120 tuple(borrowed_reference(args))
71121 , keywords ? dict(borrowed_reference(keywords)) : dict()
71122 )
71123 ).ptr()
71124 );
71125 }
71126 private:
71127 F f;
71128 };
71129 object make_raw_function(objects::py_function);
71130 }
71131 template <class F>
71132 object raw_function(F f, std::size_t min_args = 0)
71133 {
71134 return detail::make_raw_function(
71135 objects::py_function(
71136 detail::raw_dispatcher<F>(f)
71137 , mpl::vector1<PyObject*>()
71138 , min_args
71139 , (std::numeric_limits<unsigned>::max)()
71140 )
71141 );
71142 }
71143 }}
71144 namespace boost {
71145 template <class Iterator>
71146 struct iterator_value
71147 {
71148 typedef typename boost::detail::iterator_traits<Iterator>::value_type type;
71149 };
71150 template <class Iterator>
71151 struct iterator_reference
71152 {
71153 typedef typename boost::detail::iterator_traits<Iterator>::reference type;
71154 };
71155 template <class Iterator>
71156 struct iterator_pointer
71157 {
71158 typedef typename boost::detail::iterator_traits<Iterator>::pointer type;
71159 };
71160 template <class Iterator>
71161 struct iterator_difference
71162 {
71163 typedef typename boost::detail::iterator_traits<Iterator>::difference_type type;
71164 };
71165 template <class Iterator>
71166 struct iterator_category
71167 {
71168 typedef typename boost::detail::iterator_traits<Iterator>::iterator_category type;
71169 };
71170 }
71171 namespace boost { namespace python {
71172 namespace detail
71173 {
71174 class slice_base : public object
71175 {
71176 public:
71177 object start() const;
71178 object stop() const;
71179 object step() const;
71180 protected:
71181 explicit slice_base(PyObject*, PyObject*, PyObject*);
71182 inline explicit slice_base(python::detail::borrowed_reference p) : object(p) {} inline explicit slice_base(python::detail::new_reference p) : object(p) {} inline explicit slice_base(python::detail::new_non_null_reference p) : object(p) {}
71183 };
71184 }
71185 class slice : public detail::slice_base
71186 {
71187 typedef detail::slice_base base;
71188 public:
71189 slice() : base(0,0,0) {}
71190 template<typename Integer1, typename Integer2>
71191 slice( Integer1 start, Integer2 stop)
71192 : base( object(start).ptr(), object(stop).ptr(), 0 )
71193 {}
71194 template<typename Integer1, typename Integer2, typename Integer3>
71195 slice( Integer1 start, Integer2 stop, Integer3 stride)
71196 : base( object(start).ptr(), object(stop).ptr(), object(stride).ptr() )
71197 {}
71198 template<typename RandomAccessIterator>
71199 struct range
71200 {
71201 RandomAccessIterator start;
71202 RandomAccessIterator stop;
71203 typename iterator_difference<RandomAccessIterator>::type step;
71204 };
71205 template<typename RandomAccessIterator>
71206 slice::range<RandomAccessIterator>
71207 get_indicies( const RandomAccessIterator& begin,
71208 const RandomAccessIterator& end) const
71209 {
71210 slice::range<RandomAccessIterator> ret;
71211 typedef typename iterator_difference<RandomAccessIterator>::type difference_type;
71212 difference_type max_dist = boost::detail::distance(begin, end);
71213 object slice_start = this->start();
71214 object slice_stop = this->stop();
71215 object slice_step = this->step();
71216 if (slice_step == object()) {
71217 ret.step = 1;
71218 }
71219 else {
71220 ret.step = extract<long>( slice_step);
71221 if (ret.step == 0) {
71222 PyErr_SetString( PyExc_IndexError, "step size cannot be zero.");
71223 throw_error_already_set();
71224 }
71225 }
71226 if (slice_start == object()) {
71227 if (ret.step < 0) {
71228 ret.start = end;
71229 --ret.start;
71230 }
71231 else
71232 ret.start = begin;
71233 }
71234 else {
71235 difference_type i = extract<long>( slice_start);
71236 if (i >= max_dist && ret.step > 0)
71237 throw std::invalid_argument( "Zero-length slice");
71238 if (i >= 0) {
71239 ret.start = begin;
71240 using std::min;
71241 std::advance( ret.start, min (i, max_dist-1));
71242 }
71243 else {
71244 if (i < -max_dist && ret.step < 0)
71245 throw std::invalid_argument( "Zero-length slice");
71246 ret.start = end;
71247 std::advance( ret.start, (-i < max_dist) ? i : -max_dist );
71248 }
71249 }
71250 if (slice_stop == object()) {
71251 if (ret.step < 0) {
71252 ret.stop = begin;
71253 }
71254 else {
71255 ret.stop = end;
71256 std::advance( ret.stop, -1);
71257 }
71258 }
71259 else {
71260 difference_type i = extract<long>(slice_stop);
71261 if (ret.step < 0) {
71262 if (i+1 >= max_dist || i == -1)
71263 throw std::invalid_argument( "Zero-length slice");
71264 if (i >= 0) {
71265 ret.stop = begin;
71266 std::advance( ret.stop, i+1);
71267 }
71268 else {
71269 ret.stop = end;
71270 std::advance( ret.stop, (-i < max_dist) ? i : -max_dist);
71271 }
71272 }
71273 else {
71274 if (i == 0 || -i >= max_dist)
71275 throw std::invalid_argument( "Zero-length slice");
71276 if (i > 0) {
71277 ret.stop = begin;
71278 std::advance( ret.stop, (std::min)( i-1, max_dist-1));
71279 }
71280 else {
71281 ret.stop = end;
71282 std::advance( ret.stop, i-1);
71283 }
71284 }
71285 }
71286 typename iterator_difference<RandomAccessIterator>::type final_dist =
71287 boost::detail::distance( ret.start, ret.stop);
71288 if (final_dist == 0)
71289 return ret;
71290 if ((final_dist > 0) != (ret.step > 0))
71291 throw std::invalid_argument( "Zero-length slice.");
71292 if (final_dist < 0) {
71293 difference_type remainder = -final_dist % -ret.step;
71294 std::advance( ret.stop, remainder);
71295 }
71296 else {
71297 difference_type remainder = final_dist % ret.step;
71298 std::advance( ret.stop, -remainder);
71299 }
71300 return ret;
71301 }
71302 public:
71303 inline explicit slice(python::detail::borrowed_reference p) : detail::slice_base(p) {} inline explicit slice(python::detail::new_reference p) : detail::slice_base(p) {} inline explicit slice(python::detail::new_non_null_reference p) : detail::slice_base(p) {}
71304 };
71305 namespace converter {
71306 template<>
71307 struct object_manager_traits<slice>
71308 : pytype_object_manager_traits<&PySlice_Type, slice>
71309 {
71310 };
71311 }
71312 } }
71313 namespace boost
71314 {
71315 template<class T> class scoped_ptr
71316 {
71317 private:
71318 T * px;
71319 scoped_ptr(scoped_ptr const &);
71320 scoped_ptr & operator=(scoped_ptr const &);
71321 typedef scoped_ptr<T> this_type;
71322 void operator==( scoped_ptr const& ) const;
71323 void operator!=( scoped_ptr const& ) const;
71324 public:
71325 typedef T element_type;
71326 explicit scoped_ptr( T * p = 0 ): px( p )
71327 {
71328 }
71329 explicit scoped_ptr( std::auto_ptr<T> p ): px( p.release() )
71330 {
71331 }
71332 ~scoped_ptr()
71333 {
71334 boost::checked_delete( px );
71335 }
71336 void reset(T * p = 0)
71337 {
71338 (static_cast<void> (0));
71339 this_type(p).swap(*this);
71340 }
71341 T & operator*() const
71342 {
71343 (static_cast<void> (0));
71344 return *px;
71345 }
71346 T * operator->() const
71347 {
71348 (static_cast<void> (0));
71349 return px;
71350 }
71351 T * get() const
71352 {
71353 return px;
71354 }
71355 typedef T * this_type::*unspecified_bool_type;
71356 operator unspecified_bool_type() const
71357 {
71358 return px == 0? 0: &this_type::px;
71359 }
71360 bool operator! () const
71361 {
71362 return px == 0;
71363 }
71364 void swap(scoped_ptr & b)
71365 {
71366 T * tmp = b.px;
71367 b.px = px;
71368 px = tmp;
71369 }
71370 };
71371 template<class T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b)
71372 {
71373 a.swap(b);
71374 }
71375 template<class T> inline T * get_pointer(scoped_ptr<T> const & p)
71376 {
71377 return p.get();
71378 }
71379 }
71380 namespace boost { namespace detail {
71381 template <class ForwardIter, class Tp>
71382 ForwardIter lower_bound(ForwardIter first, ForwardIter last,
71383 const Tp& val)
71384 {
71385 typedef detail::iterator_traits<ForwardIter> traits;
71386 typename traits::difference_type len = boost::detail::distance(first, last);
71387 typename traits::difference_type half;
71388 ForwardIter middle;
71389 while (len > 0) {
71390 half = len >> 1;
71391 middle = first;
71392 std::advance(middle, half);
71393 if (*middle < val) {
71394 first = middle;
71395 ++first;
71396 len = len - half - 1;
71397 }
71398 else
71399 len = half;
71400 }
71401 return first;
71402 }
71403 template <class ForwardIter, class Tp, class Compare>
71404 ForwardIter lower_bound(ForwardIter first, ForwardIter last,
71405 const Tp& val, Compare comp)
71406 {
71407 typedef detail::iterator_traits<ForwardIter> traits;
71408 typename traits::difference_type len = boost::detail::distance(first, last);
71409 typename traits::difference_type half;
71410 ForwardIter middle;
71411 while (len > 0) {
71412 half = len >> 1;
71413 middle = first;
71414 std::advance(middle, half);
71415 if (comp(*middle, val)) {
71416 first = middle;
71417 ++first;
71418 len = len - half - 1;
71419 }
71420 else
71421 len = half;
71422 }
71423 return first;
71424 }
71425 template <class ForwardIter, class Tp>
71426 ForwardIter upper_bound(ForwardIter first, ForwardIter last,
71427 const Tp& val)
71428 {
71429 typedef detail::iterator_traits<ForwardIter> traits;
71430 typename traits::difference_type len = boost::detail::distance(first, last);
71431 typename traits::difference_type half;
71432 ForwardIter middle;
71433 while (len > 0) {
71434 half = len >> 1;
71435 middle = first;
71436 std::advance(middle, half);
71437 if (val < *middle)
71438 len = half;
71439 else {
71440 first = middle;
71441 ++first;
71442 len = len - half - 1;
71443 }
71444 }
71445 return first;
71446 }
71447 template <class ForwardIter, class Tp, class Compare>
71448 ForwardIter upper_bound(ForwardIter first, ForwardIter last,
71449 const Tp& val, Compare comp)
71450 {
71451 typedef detail::iterator_traits<ForwardIter> traits;
71452 typename traits::difference_type len = boost::detail::distance(first, last);
71453 typename traits::difference_type half;
71454 ForwardIter middle;
71455 while (len > 0) {
71456 half = len >> 1;
71457 middle = first;
71458 std::advance(middle, half);
71459 if (comp(val, *middle))
71460 len = half;
71461 else {
71462 first = middle;
71463 ++first;
71464 len = len - half - 1;
71465 }
71466 }
71467 return first;
71468 }
71469 template <class ForwardIter, class Tp>
71470 std::pair<ForwardIter, ForwardIter>
71471 equal_range(ForwardIter first, ForwardIter last, const Tp& val)
71472 {
71473 typedef detail::iterator_traits<ForwardIter> traits;
71474 typename traits::difference_type len = boost::detail::distance(first, last);
71475 typename traits::difference_type half;
71476 ForwardIter middle, left, right;
71477 while (len > 0) {
71478 half = len >> 1;
71479 middle = first;
71480 std::advance(middle, half);
71481 if (*middle < val) {
71482 first = middle;
71483 ++first;
71484 len = len - half - 1;
71485 }
71486 else if (val < *middle)
71487 len = half;
71488 else {
71489 left = boost::detail::lower_bound(first, middle, val);
71490 std::advance(first, len);
71491 right = boost::detail::upper_bound(++middle, first, val);
71492 return std::pair<ForwardIter, ForwardIter>(left, right);
71493 }
71494 }
71495 return std::pair<ForwardIter, ForwardIter>(first, first);
71496 }
71497 template <class ForwardIter, class Tp, class Compare>
71498 std::pair<ForwardIter, ForwardIter>
71499 equal_range(ForwardIter first, ForwardIter last, const Tp& val,
71500 Compare comp)
71501 {
71502 typedef detail::iterator_traits<ForwardIter> traits;
71503 typename traits::difference_type len = boost::detail::distance(first, last);
71504 typename traits::difference_type half;
71505 ForwardIter middle, left, right;
71506 while (len > 0) {
71507 half = len >> 1;
71508 middle = first;
71509 std::advance(middle, half);
71510 if (comp(*middle, val)) {
71511 first = middle;
71512 ++first;
71513 len = len - half - 1;
71514 }
71515 else if (comp(val, *middle))
71516 len = half;
71517 else {
71518 left = boost::detail::lower_bound(first, middle, val, comp);
71519 std::advance(first, len);
71520 right = boost::detail::upper_bound(++middle, first, val, comp);
71521 return std::pair<ForwardIter, ForwardIter>(left, right);
71522 }
71523 }
71524 return std::pair<ForwardIter, ForwardIter>(first, first);
71525 }
71526 template <class ForwardIter, class Tp>
71527 bool binary_search(ForwardIter first, ForwardIter last,
71528 const Tp& val) {
71529 ForwardIter i = boost::detail::lower_bound(first, last, val);
71530 return i != last && !(val < *i);
71531 }
71532 template <class ForwardIter, class Tp, class Compare>
71533 bool binary_search(ForwardIter first, ForwardIter last,
71534 const Tp& val,
71535 Compare comp) {
71536 ForwardIter i = boost::detail::lower_bound(first, last, val, comp);
71537 return i != last && !comp(val, *i);
71538 }
71539 }}
71540 namespace boost { namespace mpl {
71541 template<
71542 typename Tag1
71543 , typename Tag2
71544 >
71545 struct equal_to_impl
71546 : if_c<
71547 ( Tag1::value
71548 > Tag2::value
71549 )
71550 , aux::cast2nd_impl< equal_to_impl< Tag1,Tag1 >,Tag1, Tag2 >
71551 , aux::cast1st_impl< equal_to_impl< Tag2,Tag2 >,Tag1, Tag2 >
71552 >::type
71553 {
71554 };
71555 template<> struct equal_to_impl< na,na >
71556 {
71557 template< typename U1, typename U2 > struct apply
71558 {
71559 typedef apply type;
71560 static const int value = 0;
71561 };
71562 };
71563 template< typename Tag > struct equal_to_impl< na,Tag >
71564 {
71565 template< typename U1, typename U2 > struct apply
71566 {
71567 typedef apply type;
71568 static const int value = 0;
71569 };
71570 };
71571 template< typename Tag > struct equal_to_impl< Tag,na >
71572 {
71573 template< typename U1, typename U2 > struct apply
71574 {
71575 typedef apply type;
71576 static const int value = 0;
71577 };
71578 };
71579 template< typename T > struct equal_to_tag
71580 {
71581 typedef typename T::tag type;
71582 };
71583 template<
71584 typename N1 = na
71585 , typename N2 = na
71586 >
71587 struct equal_to
71588 : equal_to_impl<
71589 typename equal_to_tag<N1>::type
71590 , typename equal_to_tag<N2>::type
71591 >::template apply< N1,N2 >::type
71592 {
71593
71594 };
71595 template<> struct equal_to< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : equal_to< T1 , T2 > { }; }; template< typename Tag > struct lambda< equal_to< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef equal_to< na , na > result_; typedef equal_to< na , na > type; }; namespace aux { template< typename T1 , typename T2 > struct template_arity< equal_to< T1 , T2 > > : int_<2> { }; template<> struct template_arity< equal_to< na , na > > : int_<-1> { }; }
71596 }}
71597 namespace boost { namespace mpl {
71598 template<>
71599 struct equal_to_impl< integral_c_tag,integral_c_tag >
71600 {
71601 template< typename N1, typename N2 > struct apply
71602 : bool_< ( N1::value == N2::value ) >
71603 {
71604 };
71605 };
71606 }}
71607 namespace boost { namespace numeric { namespace convdetail
71608 {
71609 template< class T1, class T2>
71610 struct equal_to
71611 {
71612 enum { x = ( T1::value == T2::value ) };
71613 static const bool value = x;
71614 typedef mpl::bool_<value> type;
71615 };
71616 template<class Value,
71617 class Case0Val,
71618 class Case1Val,
71619 class Case2Val,
71620 class Case0Type,
71621 class Case1Type,
71622 class Case2Type,
71623 class DefaultType
71624 >
71625 struct ct_switch4
71626 {
71627 typedef mpl::identity<Case0Type> Case0TypeQ ;
71628 typedef mpl::identity<Case1Type> Case1TypeQ ;
71629 typedef equal_to<Value,Case0Val> is_case0 ;
71630 typedef equal_to<Value,Case1Val> is_case1 ;
71631 typedef equal_to<Value,Case2Val> is_case2 ;
71632 typedef mpl::if_<is_case2,Case2Type,DefaultType> choose_2_3Q ;
71633 typedef mpl::eval_if<is_case1,Case1TypeQ,choose_2_3Q> choose_1_2_3Q ;
71634 typedef typename
71635 mpl::eval_if<is_case0,Case0TypeQ,choose_1_2_3Q>::type
71636 type ;
71637 } ;
71638 template<class expr0, class expr1, class TT, class TF, class FT, class FF>
71639 struct for_both
71640 {
71641 typedef mpl::identity<TF> TF_Q ;
71642 typedef mpl::identity<TT> TT_Q ;
71643 typedef typename mpl::not_<expr0>::type not_expr0 ;
71644 typedef typename mpl::not_<expr1>::type not_expr1 ;
71645 typedef typename mpl::and_<expr0,expr1>::type caseTT ;
71646 typedef typename mpl::and_<expr0,not_expr1>::type caseTF ;
71647 typedef typename mpl::and_<not_expr0,expr1>::type caseFT ;
71648 typedef mpl::if_<caseFT,FT,FF> choose_FT_FF_Q ;
71649 typedef mpl::eval_if<caseTF,TF_Q,choose_FT_FF_Q> choose_TF_FT_FF_Q ;
71650 typedef typename mpl::eval_if<caseTT,TT_Q,choose_TF_FT_FF_Q>::type type ;
71651 } ;
71652 } } }
71653 namespace boost { namespace numeric
71654 {
71655 enum int_float_mixture_enum
71656 {
71657 integral_to_integral
71658 ,integral_to_float
71659 ,float_to_integral
71660 ,float_to_float
71661 } ;
71662 } }
71663 namespace boost { namespace numeric { namespace convdetail
71664 {
71665 typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
71666 typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
71667 typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
71668 typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
71669 template<class T,class S>
71670 struct get_int_float_mixture
71671 {
71672 typedef mpl::bool_< ::std::numeric_limits<S>::is_integer > S_int ;
71673 typedef mpl::bool_< ::std::numeric_limits<T>::is_integer > T_int ;
71674 typedef typename
71675 for_both<S_int, T_int, int2int_c, int2float_c, float2int_c, float2float_c>::type
71676 type ;
71677 } ;
71678 template<class IntFloatMixture, class Int2Int, class Int2Float, class Float2Int, class Float2Float>
71679 struct for_int_float_mixture
71680 {
71681 typedef typename
71682 ct_switch4<IntFloatMixture
71683 ,int2int_c, int2float_c, float2int_c
71684 ,Int2Int , Int2Float , Float2Int , Float2Float
71685 >::type
71686 type ;
71687 } ;
71688 } } }
71689 namespace boost { namespace numeric
71690 {
71691 enum sign_mixture_enum
71692 {
71693 unsigned_to_unsigned
71694 ,signed_to_signed
71695 ,signed_to_unsigned
71696 ,unsigned_to_signed
71697 } ;
71698 } }
71699 namespace boost { namespace numeric { namespace convdetail
71700 {
71701 typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
71702 typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
71703 typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
71704 typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
71705 template<class T,class S>
71706 struct get_sign_mixture
71707 {
71708 typedef mpl::bool_< ::std::numeric_limits<S>::is_signed > S_signed ;
71709 typedef mpl::bool_< ::std::numeric_limits<T>::is_signed > T_signed ;
71710 typedef typename
71711 for_both<S_signed, T_signed, sig2sig_c, sig2unsig_c, unsig2sig_c, unsig2unsig_c>::type
71712 type ;
71713 } ;
71714 template<class SignMixture, class Sig2Sig, class Sig2Unsig, class Unsig2Sig, class Unsig2Unsig>
71715 struct for_sign_mixture
71716 {
71717 typedef typename
71718 ct_switch4<SignMixture
71719 , sig2sig_c, sig2unsig_c, unsig2sig_c
71720 , Sig2Sig , Sig2Unsig , Unsig2Sig , Unsig2Unsig
71721 >::type
71722 type ;
71723 } ;
71724 } } }
71725 namespace boost { namespace numeric
71726 {
71727 enum udt_builtin_mixture_enum
71728 {
71729 builtin_to_builtin
71730 ,builtin_to_udt
71731 ,udt_to_builtin
71732 ,udt_to_udt
71733 } ;
71734 } }
71735 namespace boost { namespace numeric { namespace convdetail
71736 {
71737 typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
71738 typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
71739 typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
71740 typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
71741 template<class UdtMixture, class BuiltIn2BuiltIn, class BuiltIn2Udt, class Udt2BuiltIn, class Udt2Udt>
71742 struct for_udt_builtin_mixture
71743 {
71744 typedef typename
71745 ct_switch4<UdtMixture
71746 , builtin2builtin_c, builtin2udt_c, udt2builtin_c
71747 , BuiltIn2BuiltIn , BuiltIn2Udt , Udt2BuiltIn , Udt2Udt
71748 >::type
71749 type ;
71750 } ;
71751 template<class T,class S>
71752 struct get_udt_builtin_mixture
71753 {
71754 typedef is_arithmetic<S> S_builtin ;
71755 typedef is_arithmetic<T> T_builtin ;
71756 typedef typename
71757 for_both<S_builtin, T_builtin, builtin2builtin_c, builtin2udt_c, udt2builtin_c, udt2udt_c>::type
71758 type ;
71759 } ;
71760 } } }
71761 namespace boost { namespace mpl {
71762 template<
71763 typename Tag1
71764 , typename Tag2
71765 >
71766 struct times_impl
71767 : if_c<
71768 ( Tag1::value
71769 > Tag2::value
71770 )
71771 , aux::cast2nd_impl< times_impl< Tag1,Tag1 >,Tag1, Tag2 >
71772 , aux::cast1st_impl< times_impl< Tag2,Tag2 >,Tag1, Tag2 >
71773 >::type
71774 {
71775 };
71776 template<> struct times_impl< na,na >
71777 {
71778 template< typename U1, typename U2 > struct apply
71779 {
71780 typedef apply type;
71781 static const int value = 0;
71782 };
71783 };
71784 template< typename Tag > struct times_impl< na,Tag >
71785 {
71786 template< typename U1, typename U2 > struct apply
71787 {
71788 typedef apply type;
71789 static const int value = 0;
71790 };
71791 };
71792 template< typename Tag > struct times_impl< Tag,na >
71793 {
71794 template< typename U1, typename U2 > struct apply
71795 {
71796 typedef apply type;
71797 static const int value = 0;
71798 };
71799 };
71800 template< typename T > struct times_tag
71801 {
71802 typedef typename T::tag type;
71803 };
71804 template<
71805 typename N1 = na
71806 , typename N2 = na
71807 , typename N3 = na, typename N4 = na, typename N5 = na
71808 >
71809 struct times
71810 : times< times< times< times< N1,N2 >, N3>, N4>, N5>
71811 {
71812
71813 };
71814 template<
71815 typename N1, typename N2, typename N3, typename N4
71816 >
71817 struct times< N1,N2,N3,N4,na >
71818 : times< times< times< N1,N2 >, N3>, N4>
71819 {
71820
71821 };
71822 template<
71823 typename N1, typename N2, typename N3
71824 >
71825 struct times< N1,N2,N3,na,na >
71826 : times< times< N1,N2 >, N3>
71827 {
71828
71829 };
71830 template<
71831 typename N1, typename N2
71832 >
71833 struct times< N1,N2,na,na,na >
71834 : times_impl<
71835 typename times_tag<N1>::type
71836 , typename times_tag<N2>::type
71837 >::template apply< N1,N2 >::type
71838 {
71839
71840 };
71841 template<> struct times< na , na > { template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : times< T1 , T2 > { }; }; template< typename Tag > struct lambda< times< na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef times< na , na > result_; typedef times< na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< times< T1 , T2 , T3 , T4 , T5 > > : int_<5> { }; template<> struct template_arity< times< na , na > > : int_<-1> { }; }
71842 }}
71843 namespace boost { namespace mpl {
71844 template<>
71845 struct times_impl< integral_c_tag,integral_c_tag >
71846 {
71847 template< typename N1, typename N2 > struct apply
71848 : integral_c<
71849 typename aux::largest_int<
71850 typename N1::value_type
71851 , typename N2::value_type
71852 >::type
71853 , ( N1::value
71854 * N2::value
71855 )
71856 >
71857 {
71858 };
71859 };
71860 }}
71861 namespace boost { namespace mpl {
71862 template<
71863 typename N1 = na , typename N2 = na , typename N3 = na , typename N4 = na , typename N5 = na
71864 >
71865 struct multiplies
71866 : times< N1 , N2 , N3 , N4 , N5 >
71867 {
71868
71869 };
71870 template<> struct multiplies< na , na , na , na , na > { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct apply : multiplies< T1 , T2 , T3 , T4 , T5 > { }; }; template< typename Tag > struct lambda< multiplies< na , na , na , na , na > , Tag , int_<-1> > { typedef false_ is_le; typedef multiplies< na , na , na , na , na > result_; typedef multiplies< na , na , na , na , na > type; }; namespace aux { template< typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > struct template_arity< multiplies< T1 , T2 , T3 , T4 , T5 > > : int_<5> { }; template<> struct template_arity< multiplies< na , na , na , na , na > > : int_<-1> { }; }
71871 }}
71872 namespace boost { namespace numeric { namespace convdetail
71873 {
71874 template<class T,class S>
71875 struct subranged_Sig2Unsig
71876 {
71877 typedef mpl::true_ type ;
71878 } ;
71879 template<class T,class S>
71880 struct subranged_Unsig2Sig
71881 {
71882 typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
71883 typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
71884 typedef typename T_digits::next u_T_digits ;
71885 typedef mpl::int_<2> Two ;
71886 typedef typename mpl::multiplies<S_digits,Two>::type S_digits_times_2 ;
71887 typedef typename mpl::less<u_T_digits,S_digits_times_2>::type type ;
71888 } ;
71889 template<class T,class S>
71890 struct subranged_SameSign
71891 {
71892 typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
71893 typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
71894 typedef typename mpl::less<T_digits,S_digits>::type type ;
71895 } ;
71896 template<class T,class S>
71897 struct subranged_Int2Float
71898 {
71899 typedef mpl::false_ type ;
71900 } ;
71901 template<class T,class S>
71902 struct subranged_Float2Int
71903 {
71904 typedef mpl::true_ type ;
71905 } ;
71906 template<class T,class S>
71907 struct subranged_Float2Float
71908 {
71909 typedef mpl::int_< ::std::numeric_limits<S>::digits > S_mantisa ;
71910 typedef mpl::int_< ::std::numeric_limits<T>::digits > T_mantisa ;
71911 typedef mpl::int_< ::std::numeric_limits<S>::max_exponent > S_exponent ;
71912 typedef mpl::int_< ::std::numeric_limits<T>::max_exponent > T_exponent ;
71913 typedef typename mpl::less<T_exponent,S_exponent>::type T_smaller_exponent ;
71914 typedef typename mpl::equal_to<T_exponent,S_exponent>::type equal_exponents ;
71915 typedef mpl::less<T_mantisa,S_mantisa> T_smaller_mantisa ;
71916 typedef mpl::eval_if<equal_exponents,T_smaller_mantisa,mpl::false_> not_bigger_exponent_case ;
71917 typedef typename
71918 mpl::eval_if<T_smaller_exponent,mpl::true_,not_bigger_exponent_case>::type
71919 type ;
71920 } ;
71921 template<class T,class S>
71922 struct subranged_Udt2BuiltIn
71923 {
71924 typedef mpl::true_ type ;
71925 } ;
71926 template<class T,class S>
71927 struct subranged_BuiltIn2Udt
71928 {
71929 typedef mpl::false_ type ;
71930 } ;
71931 template<class T,class S>
71932 struct subranged_Udt2Udt
71933 {
71934 typedef mpl::false_ type ;
71935 } ;
71936 template<class T,class S>
71937 struct get_subranged_Int2Int
71938 {
71939 typedef subranged_SameSign<T,S> Sig2Sig ;
71940 typedef subranged_Sig2Unsig<T,S> Sig2Unsig ;
71941 typedef subranged_Unsig2Sig<T,S> Unsig2Sig ;
71942 typedef Sig2Sig Unsig2Unsig ;
71943 typedef typename get_sign_mixture<T,S>::type sign_mixture ;
71944 typedef typename
71945 for_sign_mixture<sign_mixture, Sig2Sig, Sig2Unsig, Unsig2Sig, Unsig2Unsig>::type
71946 type ;
71947 } ;
71948 template<class T,class S>
71949 struct get_subranged_BuiltIn2BuiltIn
71950 {
71951 typedef get_subranged_Int2Int<T,S> Int2IntQ ;
71952 typedef subranged_Int2Float <T,S> Int2Float ;
71953 typedef subranged_Float2Int <T,S> Float2Int ;
71954 typedef subranged_Float2Float<T,S> Float2Float ;
71955 typedef mpl::identity<Int2Float > Int2FloatQ ;
71956 typedef mpl::identity<Float2Int > Float2IntQ ;
71957 typedef mpl::identity<Float2Float> Float2FloatQ ;
71958 typedef typename get_int_float_mixture<T,S>::type int_float_mixture ;
71959 typedef for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ> for_ ;
71960 typedef typename for_::type selected ;
71961 typedef typename selected::type type ;
71962 } ;
71963 template<class T,class S>
71964 struct get_subranged
71965 {
71966 typedef get_subranged_BuiltIn2BuiltIn<T,S> BuiltIn2BuiltInQ ;
71967 typedef subranged_BuiltIn2Udt<T,S> BuiltIn2Udt ;
71968 typedef subranged_Udt2BuiltIn<T,S> Udt2BuiltIn ;
71969 typedef subranged_Udt2Udt<T,S> Udt2Udt ;
71970 typedef mpl::identity<BuiltIn2Udt> BuiltIn2UdtQ ;
71971 typedef mpl::identity<Udt2BuiltIn> Udt2BuiltInQ ;
71972 typedef mpl::identity<Udt2Udt > Udt2UdtQ ;
71973 typedef typename get_udt_builtin_mixture<T,S>::type udt_builtin_mixture ;
71974 typedef typename
71975 for_udt_builtin_mixture<udt_builtin_mixture, BuiltIn2BuiltInQ, BuiltIn2UdtQ, Udt2BuiltInQ, Udt2UdtQ>::type
71976 selected ;
71977 typedef typename selected::type selected2 ;
71978 typedef typename selected2::type type ;
71979 } ;
71980 template<class T, class S>
71981 struct get_is_subranged
71982 {
71983 typedef get_subranged<T,S> non_trivial_case ;
71984 typedef mpl::identity<mpl::false_> trivial_case ;
71985 typedef is_same<T,S> is_trivial ;
71986 typedef typename mpl::if_<is_trivial,trivial_case,non_trivial_case>::type selected ;
71987 typedef typename selected::type type ;
71988 } ;
71989 } } }
71990 namespace boost { namespace numeric { namespace convdetail
71991 {
71992 template<class T,class S>
71993 struct non_trivial_traits_impl
71994 {
71995 typedef typename get_int_float_mixture <T,S>::type int_float_mixture ;
71996 typedef typename get_sign_mixture <T,S>::type sign_mixture ;
71997 typedef typename get_udt_builtin_mixture <T,S>::type udt_builtin_mixture ;
71998 typedef typename get_is_subranged<T,S>::type subranged ;
71999 typedef mpl::false_ trivial ;
72000 typedef T target_type ;
72001 typedef S source_type ;
72002 typedef T result_type ;
72003 typedef typename mpl::if_< is_arithmetic<S>, S, S const&>::type argument_type ;
72004 typedef typename mpl::if_<subranged,S,T>::type supertype ;
72005 typedef typename mpl::if_<subranged,T,S>::type subtype ;
72006 } ;
72007 template<class N>
72008 struct trivial_traits_impl
72009 {
72010 typedef typename get_int_float_mixture <N,N>::type int_float_mixture ;
72011 typedef typename get_sign_mixture <N,N>::type sign_mixture ;
72012 typedef typename get_udt_builtin_mixture<N,N>::type udt_builtin_mixture ;
72013 typedef mpl::false_ subranged ;
72014 typedef mpl::true_ trivial ;
72015 typedef N target_type ;
72016 typedef N source_type ;
72017 typedef N const& result_type ;
72018 typedef N const& argument_type ;
72019 typedef N supertype ;
72020 typedef N subtype ;
72021 } ;
72022 template<class T, class S>
72023 struct get_conversion_traits
72024 {
72025 typedef typename remove_cv<T>::type target_type ;
72026 typedef typename remove_cv<S>::type source_type ;
72027 typedef typename is_same<target_type,source_type>::type is_trivial ;
72028 typedef trivial_traits_impl <target_type> trivial_imp ;
72029 typedef non_trivial_traits_impl<target_type,source_type> non_trivial_imp ;
72030 typedef typename mpl::if_<is_trivial,trivial_imp,non_trivial_imp>::type type ;
72031 } ;
72032 } } }
72033 namespace boost { namespace numeric
72034 {
72035 template<class T, class S>
72036 struct conversion_traits
72037 : convdetail::get_conversion_traits<T,S>::type
72038 {
72039 } ;
72040 } }
72041
72042 namespace boost { namespace numeric
72043 {
72044 template<class S>
72045 struct Trunc
72046 {
72047 typedef S source_type ;
72048 typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
72049 static source_type nearbyint ( argument_type s )
72050 {
72051 using std::floor ;
72052 using std::ceil ;
72053 return s < static_cast<S>(0) ? ceil(s) : floor(s) ;
72054 }
72055 typedef mpl::integral_c< std::float_round_style, std::round_toward_zero> round_style ;
72056 } ;
72057 template<class S>
72058 struct Floor
72059 {
72060 typedef S source_type ;
72061 typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
72062 static source_type nearbyint ( argument_type s )
72063 {
72064 using std::floor ;
72065 return floor(s) ;
72066 }
72067 typedef mpl::integral_c< std::float_round_style, std::round_toward_neg_infinity> round_style ;
72068 } ;
72069 template<class S>
72070 struct Ceil
72071 {
72072 typedef S source_type ;
72073 typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
72074 static source_type nearbyint ( argument_type s )
72075 {
72076 using std::ceil ;
72077 return ceil(s) ;
72078 }
72079 typedef mpl::integral_c< std::float_round_style, std::round_toward_infinity> round_style ;
72080 } ;
72081 template<class S>
72082 struct RoundEven
72083 {
72084 typedef S source_type ;
72085 typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
72086 static source_type nearbyint ( argument_type s )
72087 {
72088 using std::floor ;
72089 using std::ceil ;
72090 S prev = floor(s);
72091 S next = ceil(s);
72092 S rt = (s - prev) - (next - s);
72093 S const zero(0.0);
72094 S const two(2.0);
72095 if ( rt < zero )
72096 return prev;
72097 else if ( rt > zero )
72098 return next;
72099 else
72100 {
72101 bool is_prev_even = two * floor(prev / two) == prev ;
72102 return ( is_prev_even ? prev : next ) ;
72103 }
72104 }
72105 typedef mpl::integral_c< std::float_round_style, std::round_to_nearest> round_style ;
72106 } ;
72107 enum range_check_result
72108 {
72109 cInRange = 0 ,
72110 cNegOverflow = 1 ,
72111 cPosOverflow = 2
72112 } ;
72113 class bad_numeric_cast : public std::bad_cast
72114 {
72115 public:
72116 virtual const char * what() const throw()
72117 { return "bad numeric conversion: overflow"; }
72118 };
72119 class negative_overflow : public bad_numeric_cast
72120 {
72121 public:
72122 virtual const char * what() const throw()
72123 { return "bad numeric conversion: negative overflow"; }
72124 };
72125 class positive_overflow : public bad_numeric_cast
72126 {
72127 public:
72128 virtual const char * what() const throw()
72129 { return "bad numeric conversion: positive overflow"; }
72130 };
72131 struct def_overflow_handler
72132 {
72133 void operator() ( range_check_result r )
72134 {
72135 if ( r == cNegOverflow )
72136 throw negative_overflow() ;
72137 else if ( r == cPosOverflow )
72138 throw positive_overflow() ;
72139 }
72140 } ;
72141 struct silent_overflow_handler
72142 {
72143 void operator() ( range_check_result ) {}
72144 } ;
72145 template<class Traits>
72146 struct raw_converter
72147 {
72148 typedef typename Traits::result_type result_type ;
72149 typedef typename Traits::argument_type argument_type ;
72150 static result_type low_level_convert ( argument_type s ) { return static_cast<result_type>(s) ; }
72151 } ;
72152 struct UseInternalRangeChecker {} ;
72153 } }
72154 namespace boost { namespace numeric { namespace boundsdetail
72155 {
72156 template<class N>
72157 class Integral
72158 {
72159 typedef std::numeric_limits<N> limits ;
72160 public :
72161 static N lowest () { return limits::min (); }
72162 static N highest () { return limits::max (); }
72163 static N smallest() { return static_cast<N>(1); }
72164 } ;
72165 template<class N>
72166 class Float
72167 {
72168 typedef std::numeric_limits<N> limits ;
72169 public :
72170 static N lowest () { return static_cast<N>(-limits::max ()) ; }
72171 static N highest () { return limits::max (); }
72172 static N smallest() { return limits::min (); }
72173 } ;
72174 template<class N>
72175 struct get_impl
72176 {
72177 typedef mpl::bool_< ::std::numeric_limits<N>::is_integer > is_int ;
72178 typedef Integral<N> impl_int ;
72179 typedef Float <N> impl_float ;
72180 typedef typename mpl::if_<is_int,impl_int,impl_float>::type type ;
72181 } ;
72182 } } }
72183 namespace boost { namespace numeric
72184 {
72185 template<class N>
72186 struct bounds : boundsdetail::get_impl<N>::type
72187 {} ;
72188 } }
72189 namespace boost { namespace numeric { namespace convdetail
72190 {
72191 typedef mpl::integral_c<std::float_round_style, std::round_toward_zero> round2zero_c ;
72192 typedef mpl::integral_c<std::float_round_style, std::round_to_nearest> round2nearest_c ;
72193 typedef mpl::integral_c<std::float_round_style, std::round_toward_infinity> round2inf_c ;
72194 typedef mpl::integral_c<std::float_round_style, std::round_toward_neg_infinity> round2neg_inf_c ;
72195 template<class RoundStyle,class RoundToZero,class RoundToNearest,class RoundToInf,class RoundToNegInf>
72196 struct for_round_style
72197 {
72198 typedef ct_switch4<RoundStyle
72199 , round2zero_c, round2nearest_c, round2inf_c
72200 , RoundToZero , RoundToNearest , RoundToInf , RoundToNegInf
72201 > selector ;
72202 typedef typename selector::type type ;
72203 } ;
72204 struct non_applicable { typedef mpl::false_ do_apply ; } ;
72205 struct applicable { typedef mpl::true_ do_apply ; } ;
72206 template<class Traits>
72207 struct LT_LoT : applicable
72208 {
72209 typedef typename Traits::target_type T ;
72210 typedef typename Traits::source_type S ;
72211 typedef typename Traits::argument_type argument_type ;
72212 static range_check_result apply ( argument_type s )
72213 {
72214 return s < static_cast<S>(bounds<T>::lowest()) ? cNegOverflow : cInRange ;
72215 }
72216 } ;
72217 template<class Traits>
72218 struct LT_Zero : applicable
72219 {
72220 typedef typename Traits::source_type S ;
72221 typedef typename Traits::argument_type argument_type ;
72222 static range_check_result apply ( argument_type s )
72223 {
72224 return s < static_cast<S>(0) ? cNegOverflow : cInRange ;
72225 }
72226 } ;
72227 template<class Traits>
72228 struct LE_PrevLoT : applicable
72229 {
72230 typedef typename Traits::target_type T ;
72231 typedef typename Traits::source_type S ;
72232 typedef typename Traits::argument_type argument_type ;
72233 static range_check_result apply ( argument_type s )
72234 {
72235 return s <= static_cast<S>(bounds<T>::lowest()) - static_cast<S>(1.0)
72236 ? cNegOverflow : cInRange ;
72237 }
72238 } ;
72239 template<class Traits>
72240 struct LT_HalfPrevLoT : applicable
72241 {
72242 typedef typename Traits::target_type T ;
72243 typedef typename Traits::source_type S ;
72244 typedef typename Traits::argument_type argument_type ;
72245 static range_check_result apply ( argument_type s )
72246 {
72247 return s < static_cast<S>(bounds<T>::lowest()) - static_cast<S>(0.5)
72248 ? cNegOverflow : cInRange ;
72249 }
72250 } ;
72251 template<class Traits>
72252 struct GT_HiT : applicable
72253 {
72254 typedef typename Traits::target_type T ;
72255 typedef typename Traits::source_type S ;
72256 typedef typename Traits::argument_type argument_type ;
72257 static range_check_result apply ( argument_type s )
72258 {
72259 return s > static_cast<S>(bounds<T>::highest())
72260 ? cPosOverflow : cInRange ;
72261 }
72262 } ;
72263 template<class Traits>
72264 struct GE_SuccHiT : applicable
72265 {
72266 typedef typename Traits::target_type T ;
72267 typedef typename Traits::source_type S ;
72268 typedef typename Traits::argument_type argument_type ;
72269 static range_check_result apply ( argument_type s )
72270 {
72271 return s >= static_cast<S>(bounds<T>::highest()) + static_cast<S>(1.0)
72272 ? cPosOverflow : cInRange ;
72273 }
72274 } ;
72275 template<class Traits>
72276 struct GT_HalfSuccHiT : applicable
72277 {
72278 typedef typename Traits::target_type T ;
72279 typedef typename Traits::source_type S ;
72280 typedef typename Traits::argument_type argument_type ;
72281 static range_check_result apply ( argument_type s )
72282 {
72283 return s >= static_cast<S>(bounds<T>::highest()) + static_cast<S>(0.5)
72284 ? cPosOverflow : cInRange ;
72285 }
72286 } ;
72287 template<class PredA, class PredB>
72288 struct applyBoth
72289 {
72290 typedef typename PredA::argument_type argument_type ;
72291 static range_check_result apply ( argument_type s )
72292 {
72293 range_check_result r = PredA::apply(s) ;
72294 if ( r == cInRange )
72295 r = PredB::apply(s);
72296 return r ;
72297 }
72298 } ;
72299 template<class PredA, class PredB>
72300 struct combine
72301 {
72302 typedef applyBoth<PredA,PredB> Both ;
72303 typedef void NNone ;
72304 typedef typename PredA::do_apply do_applyA ;
72305 typedef typename PredB::do_apply do_applyB ;
72306 typedef typename for_both<do_applyA, do_applyB, Both, PredA, PredB, NNone>::type type ;
72307 } ;
72308 template<class Traits>
72309 struct dummy_range_checker
72310 {
72311 typedef typename Traits::argument_type argument_type ;
72312 static range_check_result out_of_range ( argument_type ) { return cInRange ; }
72313 static void validate_range ( argument_type ) {}
72314 } ;
72315 template<class Traits, class IsNegOverflow, class IsPosOverflow, class OverflowHandler>
72316 struct generic_range_checker
72317 {
72318 typedef OverflowHandler overflow_handler ;
72319 typedef typename Traits::argument_type argument_type ;
72320 static range_check_result out_of_range ( argument_type s )
72321 {
72322 typedef typename combine<IsNegOverflow,IsPosOverflow>::type Predicate ;
72323 return Predicate::apply(s);
72324 }
72325 static void validate_range ( argument_type s )
72326 { OverflowHandler()( out_of_range(s) ) ; }
72327 } ;
72328 template<class Traits,class OverflowHandler>
72329 struct GetRC_Sig2Sig_or_Unsig2Unsig
72330 {
72331 typedef dummy_range_checker<Traits> Dummy ;
72332 typedef LT_LoT<Traits> Pred1 ;
72333 typedef GT_HiT<Traits> Pred2 ;
72334 typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> Normal ;
72335 typedef typename Traits::subranged subranged ;
72336 typedef typename mpl::if_<subranged,Normal,Dummy>::type type ;
72337 } ;
72338 template<class Traits, class OverflowHandler>
72339 struct GetRC_Sig2Unsig
72340 {
72341 typedef LT_Zero<Traits> Pred1 ;
72342 typedef GT_HiT <Traits> Pred2 ;
72343 typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> ChoiceA ;
72344 typedef generic_range_checker<Traits,Pred1,non_applicable,OverflowHandler> ChoiceB ;
72345 typedef typename Traits::target_type T ;
72346 typedef typename Traits::source_type S ;
72347 typedef typename subranged_Unsig2Sig<S,T>::type oposite_subranged ;
72348 typedef typename mpl::not_<oposite_subranged>::type positively_subranged ;
72349 typedef typename mpl::if_<positively_subranged,ChoiceA,ChoiceB>::type type ;
72350 } ;
72351 template<class Traits, class OverflowHandler>
72352 struct GetRC_Unsig2Sig
72353 {
72354 typedef GT_HiT<Traits> Pred1 ;
72355 typedef generic_range_checker<Traits,non_applicable,Pred1,OverflowHandler> type ;
72356 } ;
72357 template<class Traits,class OverflowHandler>
72358 struct GetRC_Int2Int
72359 {
72360 typedef GetRC_Sig2Sig_or_Unsig2Unsig<Traits,OverflowHandler> Sig2SigQ ;
72361 typedef GetRC_Sig2Unsig <Traits,OverflowHandler> Sig2UnsigQ ;
72362 typedef GetRC_Unsig2Sig <Traits,OverflowHandler> Unsig2SigQ ;
72363 typedef Sig2SigQ Unsig2UnsigQ ;
72364 typedef typename Traits::sign_mixture sign_mixture ;
72365 typedef typename
72366 for_sign_mixture<sign_mixture,Sig2SigQ,Sig2UnsigQ,Unsig2SigQ,Unsig2UnsigQ>::type
72367 selector ;
72368 typedef typename selector::type type ;
72369 } ;
72370 template<class Traits>
72371 struct GetRC_Int2Float
72372 {
72373 typedef dummy_range_checker<Traits> type ;
72374 } ;
72375 template<class Traits, class OverflowHandler, class Float2IntRounder>
72376 struct GetRC_Float2Int
72377 {
72378 typedef LE_PrevLoT <Traits> Pred1 ;
72379 typedef GE_SuccHiT <Traits> Pred2 ;
72380 typedef LT_HalfPrevLoT<Traits> Pred3 ;
72381 typedef GT_HalfSuccHiT<Traits> Pred4 ;
72382 typedef GT_HiT <Traits> Pred5 ;
72383 typedef LT_LoT <Traits> Pred6 ;
72384 typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> ToZero ;
72385 typedef generic_range_checker<Traits,Pred3,Pred4,OverflowHandler> ToNearest ;
72386 typedef generic_range_checker<Traits,Pred1,Pred5,OverflowHandler> ToInf ;
72387 typedef generic_range_checker<Traits,Pred6,Pred2,OverflowHandler> ToNegInf ;
72388 typedef typename Float2IntRounder::round_style round_style ;
72389 typedef typename for_round_style<round_style,ToZero,ToNearest,ToInf,ToNegInf>::type type ;
72390 } ;
72391 template<class Traits, class OverflowHandler>
72392 struct GetRC_Float2Float
72393 {
72394 typedef dummy_range_checker<Traits> Dummy ;
72395 typedef LT_LoT<Traits> Pred1 ;
72396 typedef GT_HiT<Traits> Pred2 ;
72397 typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> Normal ;
72398 typedef typename Traits::subranged subranged ;
72399 typedef typename mpl::if_<subranged,Normal,Dummy>::type type ;
72400 } ;
72401 template<class Traits, class OverflowHandler, class Float2IntRounder>
72402 struct GetRC_BuiltIn2BuiltIn
72403 {
72404 typedef GetRC_Int2Int<Traits,OverflowHandler> Int2IntQ ;
72405 typedef GetRC_Int2Float<Traits> Int2FloatQ ;
72406 typedef GetRC_Float2Int<Traits,OverflowHandler,Float2IntRounder> Float2IntQ ;
72407 typedef GetRC_Float2Float<Traits,OverflowHandler> Float2FloatQ ;
72408 typedef typename Traits::int_float_mixture int_float_mixture ;
72409 typedef typename for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ>::type selector ;
72410 typedef typename selector::type type ;
72411 } ;
72412 template<class Traits, class OverflowHandler, class Float2IntRounder>
72413 struct GetRC
72414 {
72415 typedef GetRC_BuiltIn2BuiltIn<Traits,OverflowHandler,Float2IntRounder> BuiltIn2BuiltInQ ;
72416 typedef dummy_range_checker<Traits> Dummy ;
72417 typedef mpl::identity<Dummy> DummyQ ;
72418 typedef typename Traits::udt_builtin_mixture udt_builtin_mixture ;
72419 typedef typename for_udt_builtin_mixture<udt_builtin_mixture,BuiltIn2BuiltInQ,DummyQ,DummyQ,DummyQ>::type selector ;
72420 typedef typename selector::type type ;
72421 } ;
72422 template<class Traits>
72423 struct trivial_converter_impl : public std::unary_function< typename Traits::argument_type
72424 ,typename Traits::result_type
72425 >
72426 ,public dummy_range_checker<Traits>
72427 {
72428 typedef Traits traits ;
72429 typedef typename Traits::source_type source_type ;
72430 typedef typename Traits::argument_type argument_type ;
72431 typedef typename Traits::result_type result_type ;
72432 static result_type low_level_convert ( argument_type s ) { return s ; }
72433 static source_type nearbyint ( argument_type s ) { return s ; }
72434 static result_type convert ( argument_type s ) { return s ; }
72435 } ;
72436 template<class Traits,class RangeChecker,class RawConverter,class Float2IntRounder>
72437 struct rounding_converter : public std::unary_function< typename Traits::argument_type
72438 ,typename Traits::result_type
72439 >
72440 ,public RangeChecker
72441 ,public Float2IntRounder
72442 ,public RawConverter
72443 {
72444 typedef RangeChecker RangeCheckerBase ;
72445 typedef Float2IntRounder Float2IntRounderBase ;
72446 typedef RawConverter RawConverterBase ;
72447 typedef Traits traits ;
72448 typedef typename Traits::source_type source_type ;
72449 typedef typename Traits::argument_type argument_type ;
72450 typedef typename Traits::result_type result_type ;
72451 static result_type convert ( argument_type s )
72452 {
72453 RangeCheckerBase::validate_range(s);
72454 source_type s1 = Float2IntRounderBase::nearbyint(s);
72455 return RawConverterBase::low_level_convert(s1);
72456 }
72457 } ;
72458 template<class Traits,class RangeChecker,class RawConverter>
72459 struct non_rounding_converter : public std::unary_function< typename Traits::argument_type
72460 ,typename Traits::result_type
72461 >
72462 ,public RangeChecker
72463 ,public RawConverter
72464 {
72465 typedef RangeChecker RangeCheckerBase ;
72466 typedef RawConverter RawConverterBase ;
72467 typedef Traits traits ;
72468 typedef typename Traits::source_type source_type ;
72469 typedef typename Traits::argument_type argument_type ;
72470 typedef typename Traits::result_type result_type ;
72471 static source_type nearbyint ( argument_type s ) { return s ; }
72472 static result_type convert ( argument_type s )
72473 {
72474 RangeCheckerBase::validate_range(s);
72475 return RawConverterBase::low_level_convert(s);
72476 }
72477 } ;
72478 template<class Traits,class OverflowHandler,class Float2IntRounder,class RawConverter, class UserRangeChecker>
72479 struct get_non_trivial_converter
72480 {
72481 typedef GetRC<Traits,OverflowHandler,Float2IntRounder> InternalRangeCheckerQ ;
72482 typedef is_same<UserRangeChecker,UseInternalRangeChecker> use_internal_RC ;
72483 typedef mpl::identity<UserRangeChecker> UserRangeCheckerQ ;
72484 typedef typename
72485 mpl::eval_if<use_internal_RC,InternalRangeCheckerQ,UserRangeCheckerQ>::type
72486 RangeChecker ;
72487 typedef non_rounding_converter<Traits,RangeChecker,RawConverter> NonRounding ;
72488 typedef rounding_converter<Traits,RangeChecker,RawConverter,Float2IntRounder> Rounding ;
72489 typedef mpl::identity<NonRounding> NonRoundingQ ;
72490 typedef mpl::identity<Rounding> RoundingQ ;
72491 typedef typename Traits::int_float_mixture int_float_mixture ;
72492 typedef typename
72493 for_int_float_mixture<int_float_mixture, NonRoundingQ, NonRoundingQ, RoundingQ, NonRoundingQ>::type
72494 selector ;
72495 typedef typename selector::type type ;
72496 } ;
72497 template< class Traits
72498 ,class OverflowHandler
72499 ,class Float2IntRounder
72500 ,class RawConverter
72501 ,class UserRangeChecker
72502 >
72503 struct get_converter_impl
72504 {
72505 typedef trivial_converter_impl<Traits> Trivial ;
72506 typedef mpl::identity <Trivial> TrivialQ ;
72507 typedef get_non_trivial_converter< Traits
72508 ,OverflowHandler
72509 ,Float2IntRounder
72510 ,RawConverter
72511 ,UserRangeChecker
72512 > NonTrivialQ ;
72513 typedef typename Traits::trivial trivial ;
72514 typedef typename mpl::eval_if<trivial,TrivialQ,NonTrivialQ>::type type ;
72515 } ;
72516 } } }
72517 namespace boost { namespace numeric
72518 {
72519 template<class T,
72520 class S,
72521 class Traits = conversion_traits<T,S>,
72522 class OverflowHandler = def_overflow_handler,
72523 class Float2IntRounder = Trunc< typename Traits::source_type> ,
72524 class RawConverter = raw_converter<Traits>,
72525 class UserRangeChecker = UseInternalRangeChecker
72526 >
72527 struct converter : convdetail::get_converter_impl<Traits,
72528 OverflowHandler,
72529 Float2IntRounder,
72530 RawConverter,
72531 UserRangeChecker
72532 >::type
72533 {
72534 typedef Traits traits ;
72535 typedef typename Traits::argument_type argument_type ;
72536 typedef typename Traits::result_type result_type ;
72537 result_type operator() ( argument_type s ) const { return this->convert(s) ; }
72538 } ;
72539 template<class S,
72540 class OverflowHandler = def_overflow_handler,
72541 class Float2IntRounder = Trunc<S> ,
72542 class UserRangeChecker = UseInternalRangeChecker
72543 >
72544 struct make_converter_from
72545 {
72546 template<class T,
72547 class Traits = conversion_traits<T,S>,
72548 class RawConverter = raw_converter<Traits>
72549 >
72550 struct to
72551 {
72552 typedef converter<T,S,Traits,OverflowHandler,Float2IntRounder,RawConverter,UserRangeChecker> type ;
72553 } ;
72554 } ;
72555 } }
72556 namespace boost
72557 {
72558 template<typename Target, typename Source>
72559 inline
72560 Target numeric_cast ( Source arg )
72561 {
72562 typedef boost::numeric::converter<Target,Source> Converter ;
72563 return Converter::convert(arg);
72564 }
72565 using numeric::bad_numeric_cast;
72566 }
72567
72568 namespace std __attribute__ ((__visibility__ ("default"))) {
72569 enum _Rb_tree_color { _S_red = false, _S_black = true };
72570 struct _Rb_tree_node_base
72571 {
72572 typedef _Rb_tree_node_base* _Base_ptr;
72573 typedef const _Rb_tree_node_base* _Const_Base_ptr;
72574 _Rb_tree_color _M_color;
72575 _Base_ptr _M_parent;
72576 _Base_ptr _M_left;
72577 _Base_ptr _M_right;
72578 static _Base_ptr
72579 _S_minimum(_Base_ptr __x)
72580 {
72581 while (__x->_M_left != 0) __x = __x->_M_left;
72582 return __x;
72583 }
72584 static _Const_Base_ptr
72585 _S_minimum(_Const_Base_ptr __x)
72586 {
72587 while (__x->_M_left != 0) __x = __x->_M_left;
72588 return __x;
72589 }
72590 static _Base_ptr
72591 _S_maximum(_Base_ptr __x)
72592 {
72593 while (__x->_M_right != 0) __x = __x->_M_right;
72594 return __x;
72595 }
72596 static _Const_Base_ptr
72597 _S_maximum(_Const_Base_ptr __x)
72598 {
72599 while (__x->_M_right != 0) __x = __x->_M_right;
72600 return __x;
72601 }
72602 };
72603 template<typename _Val>
72604 struct _Rb_tree_node : public _Rb_tree_node_base
72605 {
72606 typedef _Rb_tree_node<_Val>* _Link_type;
72607 _Val _M_value_field;
72608 };
72609 __attribute__ ((__pure__)) _Rb_tree_node_base*
72610 _Rb_tree_increment(_Rb_tree_node_base* __x) throw ();
72611 __attribute__ ((__pure__)) const _Rb_tree_node_base*
72612 _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ();
72613 __attribute__ ((__pure__)) _Rb_tree_node_base*
72614 _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ();
72615 __attribute__ ((__pure__)) const _Rb_tree_node_base*
72616 _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ();
72617 template<typename _Tp>
72618 struct _Rb_tree_iterator
72619 {
72620 typedef _Tp value_type;
72621 typedef _Tp& reference;
72622 typedef _Tp* pointer;
72623 typedef bidirectional_iterator_tag iterator_category;
72624 typedef ptrdiff_t difference_type;
72625 typedef _Rb_tree_iterator<_Tp> _Self;
72626 typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
72627 typedef _Rb_tree_node<_Tp>* _Link_type;
72628 _Rb_tree_iterator()
72629 : _M_node() { }
72630 explicit
72631 _Rb_tree_iterator(_Link_type __x)
72632 : _M_node(__x) { }
72633 reference
72634 operator*() const
72635 { return static_cast<_Link_type>(_M_node)->_M_value_field; }
72636 pointer
72637 operator->() const
72638 { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
72639 _Self&
72640 operator++()
72641 {
72642 _M_node = _Rb_tree_increment(_M_node);
72643 return *this;
72644 }
72645 _Self
72646 operator++(int)
72647 {
72648 _Self __tmp = *this;
72649 _M_node = _Rb_tree_increment(_M_node);
72650 return __tmp;
72651 }
72652 _Self&
72653 operator--()
72654 {
72655 _M_node = _Rb_tree_decrement(_M_node);
72656 return *this;
72657 }
72658 _Self
72659 operator--(int)
72660 {
72661 _Self __tmp = *this;
72662 _M_node = _Rb_tree_decrement(_M_node);
72663 return __tmp;
72664 }
72665 bool
72666 operator==(const _Self& __x) const
72667 { return _M_node == __x._M_node; }
72668 bool
72669 operator!=(const _Self& __x) const
72670 { return _M_node != __x._M_node; }
72671 _Base_ptr _M_node;
72672 };
72673 template<typename _Tp>
72674 struct _Rb_tree_const_iterator
72675 {
72676 typedef _Tp value_type;
72677 typedef const _Tp& reference;
72678 typedef const _Tp* pointer;
72679 typedef _Rb_tree_iterator<_Tp> iterator;
72680 typedef bidirectional_iterator_tag iterator_category;
72681 typedef ptrdiff_t difference_type;
72682 typedef _Rb_tree_const_iterator<_Tp> _Self;
72683 typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
72684 typedef const _Rb_tree_node<_Tp>* _Link_type;
72685 _Rb_tree_const_iterator()
72686 : _M_node() { }
72687 explicit
72688 _Rb_tree_const_iterator(_Link_type __x)
72689 : _M_node(__x) { }
72690 _Rb_tree_const_iterator(const iterator& __it)
72691 : _M_node(__it._M_node) { }
72692 reference
72693 operator*() const
72694 { return static_cast<_Link_type>(_M_node)->_M_value_field; }
72695 pointer
72696 operator->() const
72697 { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
72698 _Self&
72699 operator++()
72700 {
72701 _M_node = _Rb_tree_increment(_M_node);
72702 return *this;
72703 }
72704 _Self
72705 operator++(int)
72706 {
72707 _Self __tmp = *this;
72708 _M_node = _Rb_tree_increment(_M_node);
72709 return __tmp;
72710 }
72711 _Self&
72712 operator--()
72713 {
72714 _M_node = _Rb_tree_decrement(_M_node);
72715 return *this;
72716 }
72717 _Self
72718 operator--(int)
72719 {
72720 _Self __tmp = *this;
72721 _M_node = _Rb_tree_decrement(_M_node);
72722 return __tmp;
72723 }
72724 bool
72725 operator==(const _Self& __x) const
72726 { return _M_node == __x._M_node; }
72727 bool
72728 operator!=(const _Self& __x) const
72729 { return _M_node != __x._M_node; }
72730 _Base_ptr _M_node;
72731 };
72732 template<typename _Val>
72733 inline bool
72734 operator==(const _Rb_tree_iterator<_Val>& __x,
72735 const _Rb_tree_const_iterator<_Val>& __y)
72736 { return __x._M_node == __y._M_node; }
72737 template<typename _Val>
72738 inline bool
72739 operator!=(const _Rb_tree_iterator<_Val>& __x,
72740 const _Rb_tree_const_iterator<_Val>& __y)
72741 { return __x._M_node != __y._M_node; }
72742 void
72743 _Rb_tree_insert_and_rebalance(const bool __insert_left,
72744 _Rb_tree_node_base* __x,
72745 _Rb_tree_node_base* __p,
72746 _Rb_tree_node_base& __header) throw ();
72747 _Rb_tree_node_base*
72748 _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
72749 _Rb_tree_node_base& __header) throw ();
72750 template<typename _Key, typename _Val, typename _KeyOfValue,
72751 typename _Compare, typename _Alloc = allocator<_Val> >
72752 class _Rb_tree
72753 {
72754 typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
72755 _Node_allocator;
72756 protected:
72757 typedef _Rb_tree_node_base* _Base_ptr;
72758 typedef const _Rb_tree_node_base* _Const_Base_ptr;
72759 public:
72760 typedef _Key key_type;
72761 typedef _Val value_type;
72762 typedef value_type* pointer;
72763 typedef const value_type* const_pointer;
72764 typedef value_type& reference;
72765 typedef const value_type& const_reference;
72766 typedef _Rb_tree_node<_Val>* _Link_type;
72767 typedef const _Rb_tree_node<_Val>* _Const_Link_type;
72768 typedef size_t size_type;
72769 typedef ptrdiff_t difference_type;
72770 typedef _Alloc allocator_type;
72771 _Node_allocator&
72772 _M_get_Node_allocator()
72773 { return *static_cast<_Node_allocator*>(&this->_M_impl); }
72774 const _Node_allocator&
72775 _M_get_Node_allocator() const
72776 { return *static_cast<const _Node_allocator*>(&this->_M_impl); }
72777 allocator_type
72778 get_allocator() const
72779 { return allocator_type(_M_get_Node_allocator()); }
72780 protected:
72781 _Link_type
72782 _M_get_node()
72783 { return _M_impl._Node_allocator::allocate(1); }
72784 void
72785 _M_put_node(_Link_type __p)
72786 { _M_impl._Node_allocator::deallocate(__p, 1); }
72787 _Link_type
72788 _M_create_node(const value_type& __x)
72789 {
72790 _Link_type __tmp = _M_get_node();
72791 try
72792 { get_allocator().construct(&__tmp->_M_value_field, __x); }
72793 catch(...)
72794 {
72795 _M_put_node(__tmp);
72796 throw;
72797 }
72798 return __tmp;
72799 }
72800 void
72801 _M_destroy_node(_Link_type __p)
72802 {
72803 get_allocator().destroy(&__p->_M_value_field);
72804 _M_put_node(__p);
72805 }
72806 _Link_type
72807 _M_clone_node(_Const_Link_type __x)
72808 {
72809 _Link_type __tmp = _M_create_node(__x->_M_value_field);
72810 __tmp->_M_color = __x->_M_color;
72811 __tmp->_M_left = 0;
72812 __tmp->_M_right = 0;
72813 return __tmp;
72814 }
72815 protected:
72816 template<typename _Key_compare,
72817 bool _Is_pod_comparator = __is_pod(_Key_compare)>
72818 struct _Rb_tree_impl : public _Node_allocator
72819 {
72820 _Key_compare _M_key_compare;
72821 _Rb_tree_node_base _M_header;
72822 size_type _M_node_count;
72823 _Rb_tree_impl()
72824 : _Node_allocator(), _M_key_compare(), _M_header(),
72825 _M_node_count(0)
72826 { _M_initialize(); }
72827 _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
72828 : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
72829 _M_node_count(0)
72830 { _M_initialize(); }
72831 private:
72832 void
72833 _M_initialize()
72834 {
72835 this->_M_header._M_color = _S_red;
72836 this->_M_header._M_parent = 0;
72837 this->_M_header._M_left = &this->_M_header;
72838 this->_M_header._M_right = &this->_M_header;
72839 }
72840 };
72841 _Rb_tree_impl<_Compare> _M_impl;
72842 protected:
72843 _Base_ptr&
72844 _M_root()
72845 { return this->_M_impl._M_header._M_parent; }
72846 _Const_Base_ptr
72847 _M_root() const
72848 { return this->_M_impl._M_header._M_parent; }
72849 _Base_ptr&
72850 _M_leftmost()
72851 { return this->_M_impl._M_header._M_left; }
72852 _Const_Base_ptr
72853 _M_leftmost() const
72854 { return this->_M_impl._M_header._M_left; }
72855 _Base_ptr&
72856 _M_rightmost()
72857 { return this->_M_impl._M_header._M_right; }
72858 _Const_Base_ptr
72859 _M_rightmost() const
72860 { return this->_M_impl._M_header._M_right; }
72861 _Link_type
72862 _M_begin()
72863 { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
72864 _Const_Link_type
72865 _M_begin() const
72866 {
72867 return static_cast<_Const_Link_type>
72868 (this->_M_impl._M_header._M_parent);
72869 }
72870 _Link_type
72871 _M_end()
72872 { return static_cast<_Link_type>(&this->_M_impl._M_header); }
72873 _Const_Link_type
72874 _M_end() const
72875 { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
72876 static const_reference
72877 _S_value(_Const_Link_type __x)
72878 { return __x->_M_value_field; }
72879 static const _Key&
72880 _S_key(_Const_Link_type __x)
72881 { return _KeyOfValue()(_S_value(__x)); }
72882 static _Link_type
72883 _S_left(_Base_ptr __x)
72884 { return static_cast<_Link_type>(__x->_M_left); }
72885 static _Const_Link_type
72886 _S_left(_Const_Base_ptr __x)
72887 { return static_cast<_Const_Link_type>(__x->_M_left); }
72888 static _Link_type
72889 _S_right(_Base_ptr __x)
72890 { return static_cast<_Link_type>(__x->_M_right); }
72891 static _Const_Link_type
72892 _S_right(_Const_Base_ptr __x)
72893 { return static_cast<_Const_Link_type>(__x->_M_right); }
72894 static const_reference
72895 _S_value(_Const_Base_ptr __x)
72896 { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
72897 static const _Key&
72898 _S_key(_Const_Base_ptr __x)
72899 { return _KeyOfValue()(_S_value(__x)); }
72900 static _Base_ptr
72901 _S_minimum(_Base_ptr __x)
72902 { return _Rb_tree_node_base::_S_minimum(__x); }
72903 static _Const_Base_ptr
72904 _S_minimum(_Const_Base_ptr __x)
72905 { return _Rb_tree_node_base::_S_minimum(__x); }
72906 static _Base_ptr
72907 _S_maximum(_Base_ptr __x)
72908 { return _Rb_tree_node_base::_S_maximum(__x); }
72909 static _Const_Base_ptr
72910 _S_maximum(_Const_Base_ptr __x)
72911 { return _Rb_tree_node_base::_S_maximum(__x); }
72912 public:
72913 typedef _Rb_tree_iterator<value_type> iterator;
72914 typedef _Rb_tree_const_iterator<value_type> const_iterator;
72915 typedef std::reverse_iterator<iterator> reverse_iterator;
72916 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
72917 private:
72918 iterator
72919 _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y,
72920 const value_type& __v);
72921 iterator
72922 _M_insert_lower(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
72923 iterator
72924 _M_insert_equal_lower(const value_type& __x);
72925 _Link_type
72926 _M_copy(_Const_Link_type __x, _Link_type __p);
72927 void
72928 _M_erase(_Link_type __x);
72929 iterator
72930 _M_lower_bound(_Link_type __x, _Link_type __y,
72931 const _Key& __k);
72932 const_iterator
72933 _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
72934 const _Key& __k) const;
72935 iterator
72936 _M_upper_bound(_Link_type __x, _Link_type __y,
72937 const _Key& __k);
72938 const_iterator
72939 _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
72940 const _Key& __k) const;
72941 public:
72942 _Rb_tree() { }
72943 _Rb_tree(const _Compare& __comp,
72944 const allocator_type& __a = allocator_type())
72945 : _M_impl(__comp, __a) { }
72946 _Rb_tree(const _Rb_tree& __x)
72947 : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
72948 {
72949 if (__x._M_root() != 0)
72950 {
72951 _M_root() = _M_copy(__x._M_begin(), _M_end());
72952 _M_leftmost() = _S_minimum(_M_root());
72953 _M_rightmost() = _S_maximum(_M_root());
72954 _M_impl._M_node_count = __x._M_impl._M_node_count;
72955 }
72956 }
72957 ~_Rb_tree()
72958 { _M_erase(_M_begin()); }
72959 _Rb_tree&
72960 operator=(const _Rb_tree& __x);
72961 _Compare
72962 key_comp() const
72963 { return _M_impl._M_key_compare; }
72964 iterator
72965 begin()
72966 {
72967 return iterator(static_cast<_Link_type>
72968 (this->_M_impl._M_header._M_left));
72969 }
72970 const_iterator
72971 begin() const
72972 {
72973 return const_iterator(static_cast<_Const_Link_type>
72974 (this->_M_impl._M_header._M_left));
72975 }
72976 iterator
72977 end()
72978 { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
72979 const_iterator
72980 end() const
72981 {
72982 return const_iterator(static_cast<_Const_Link_type>
72983 (&this->_M_impl._M_header));
72984 }
72985 reverse_iterator
72986 rbegin()
72987 { return reverse_iterator(end()); }
72988 const_reverse_iterator
72989 rbegin() const
72990 { return const_reverse_iterator(end()); }
72991 reverse_iterator
72992 rend()
72993 { return reverse_iterator(begin()); }
72994 const_reverse_iterator
72995 rend() const
72996 { return const_reverse_iterator(begin()); }
72997 bool
72998 empty() const
72999 { return _M_impl._M_node_count == 0; }
73000 size_type
73001 size() const
73002 { return _M_impl._M_node_count; }
73003 size_type
73004 max_size() const
73005 { return _M_get_Node_allocator().max_size(); }
73006 void
73007 swap(_Rb_tree& __t);
73008 pair<iterator, bool>
73009 _M_insert_unique(const value_type& __x);
73010 iterator
73011 _M_insert_equal(const value_type& __x);
73012 iterator
73013 _M_insert_unique_(const_iterator __position, const value_type& __x);
73014 iterator
73015 _M_insert_equal_(const_iterator __position, const value_type& __x);
73016 template<typename _InputIterator>
73017 void
73018 _M_insert_unique(_InputIterator __first, _InputIterator __last);
73019 template<typename _InputIterator>
73020 void
73021 _M_insert_equal(_InputIterator __first, _InputIterator __last);
73022 void
73023 erase(iterator __position);
73024 void
73025 erase(const_iterator __position);
73026 size_type
73027 erase(const key_type& __x);
73028 void
73029 erase(iterator __first, iterator __last);
73030 void
73031 erase(const_iterator __first, const_iterator __last);
73032 void
73033 erase(const key_type* __first, const key_type* __last);
73034 void
73035 clear()
73036 {
73037 _M_erase(_M_begin());
73038 _M_leftmost() = _M_end();
73039 _M_root() = 0;
73040 _M_rightmost() = _M_end();
73041 _M_impl._M_node_count = 0;
73042 }
73043 iterator
73044 find(const key_type& __k);
73045 const_iterator
73046 find(const key_type& __k) const;
73047 size_type
73048 count(const key_type& __k) const;
73049 iterator
73050 lower_bound(const key_type& __k)
73051 { return _M_lower_bound(_M_begin(), _M_end(), __k); }
73052 const_iterator
73053 lower_bound(const key_type& __k) const
73054 { return _M_lower_bound(_M_begin(), _M_end(), __k); }
73055 iterator
73056 upper_bound(const key_type& __k)
73057 { return _M_upper_bound(_M_begin(), _M_end(), __k); }
73058 const_iterator
73059 upper_bound(const key_type& __k) const
73060 { return _M_upper_bound(_M_begin(), _M_end(), __k); }
73061 pair<iterator, iterator>
73062 equal_range(const key_type& __k);
73063 pair<const_iterator, const_iterator>
73064 equal_range(const key_type& __k) const;
73065 bool
73066 __rb_verify() const;
73067 };
73068 template<typename _Key, typename _Val, typename _KeyOfValue,
73069 typename _Compare, typename _Alloc>
73070 inline bool
73071 operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73072 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73073 {
73074 return __x.size() == __y.size()
73075 && std::equal(__x.begin(), __x.end(), __y.begin());
73076 }
73077 template<typename _Key, typename _Val, typename _KeyOfValue,
73078 typename _Compare, typename _Alloc>
73079 inline bool
73080 operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73081 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73082 {
73083 return std::lexicographical_compare(__x.begin(), __x.end(),
73084 __y.begin(), __y.end());
73085 }
73086 template<typename _Key, typename _Val, typename _KeyOfValue,
73087 typename _Compare, typename _Alloc>
73088 inline bool
73089 operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73090 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73091 { return !(__x == __y); }
73092 template<typename _Key, typename _Val, typename _KeyOfValue,
73093 typename _Compare, typename _Alloc>
73094 inline bool
73095 operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73096 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73097 { return __y < __x; }
73098 template<typename _Key, typename _Val, typename _KeyOfValue,
73099 typename _Compare, typename _Alloc>
73100 inline bool
73101 operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73102 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73103 { return !(__y < __x); }
73104 template<typename _Key, typename _Val, typename _KeyOfValue,
73105 typename _Compare, typename _Alloc>
73106 inline bool
73107 operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73108 const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73109 { return !(__x < __y); }
73110 template<typename _Key, typename _Val, typename _KeyOfValue,
73111 typename _Compare, typename _Alloc>
73112 inline void
73113 swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
73114 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
73115 { __x.swap(__y); }
73116 template<typename _Key, typename _Val, typename _KeyOfValue,
73117 typename _Compare, typename _Alloc>
73118 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
73119 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73120 operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
73121 {
73122 if (this != &__x)
73123 {
73124 clear();
73125 _M_impl._M_key_compare = __x._M_impl._M_key_compare;
73126 if (__x._M_root() != 0)
73127 {
73128 _M_root() = _M_copy(__x._M_begin(), _M_end());
73129 _M_leftmost() = _S_minimum(_M_root());
73130 _M_rightmost() = _S_maximum(_M_root());
73131 _M_impl._M_node_count = __x._M_impl._M_node_count;
73132 }
73133 }
73134 return *this;
73135 }
73136 template<typename _Key, typename _Val, typename _KeyOfValue,
73137 typename _Compare, typename _Alloc>
73138 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
73139 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73140 _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, const _Val& __v)
73141 {
73142 bool __insert_left = (__x != 0 || __p == _M_end()
73143 || _M_impl._M_key_compare(_KeyOfValue()(__v),
73144 _S_key(__p)));
73145 _Link_type __z = _M_create_node(__v);
73146 _Rb_tree_insert_and_rebalance(__insert_left, __z,
73147 const_cast<_Base_ptr>(__p),
73148 this->_M_impl._M_header);
73149 ++_M_impl._M_node_count;
73150 return iterator(__z);
73151 }
73152 template<typename _Key, typename _Val, typename _KeyOfValue,
73153 typename _Compare, typename _Alloc>
73154 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
73155 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73156 _M_insert_lower(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
73157 {
73158 bool __insert_left = (__x != 0 || __p == _M_end()
73159 || !_M_impl._M_key_compare(_S_key(__p),
73160 _KeyOfValue()(__v)));
73161 _Link_type __z = _M_create_node(__v);
73162 _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
73163 this->_M_impl._M_header);
73164 ++_M_impl._M_node_count;
73165 return iterator(__z);
73166 }
73167 template<typename _Key, typename _Val, typename _KeyOfValue,
73168 typename _Compare, typename _Alloc>
73169 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
73170 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73171 _M_insert_equal_lower(const _Val& __v)
73172 {
73173 _Link_type __x = _M_begin();
73174 _Link_type __y = _M_end();
73175 while (__x != 0)
73176 {
73177 __y = __x;
73178 __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
73179 _S_left(__x) : _S_right(__x);
73180 }
73181 return _M_insert_lower(__x, __y, __v);
73182 }
73183 template<typename _Key, typename _Val, typename _KoV,
73184 typename _Compare, typename _Alloc>
73185 typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
73186 _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
73187 _M_copy(_Const_Link_type __x, _Link_type __p)
73188 {
73189 _Link_type __top = _M_clone_node(__x);
73190 __top->_M_parent = __p;
73191 try
73192 {
73193 if (__x->_M_right)
73194 __top->_M_right = _M_copy(_S_right(__x), __top);
73195 __p = __top;
73196 __x = _S_left(__x);
73197 while (__x != 0)
73198 {
73199 _Link_type __y = _M_clone_node(__x);
73200 __p->_M_left = __y;
73201 __y->_M_parent = __p;
73202 if (__x->_M_right)
73203 __y->_M_right = _M_copy(_S_right(__x), __y);
73204 __p = __y;
73205 __x = _S_left(__x);
73206 }
73207 }
73208 catch(...)
73209 {
73210 _M_erase(__top);
73211 throw;
73212 }
73213 return __top;
73214 }
73215 template<typename _Key, typename _Val, typename _KeyOfValue,
73216 typename _Compare, typename _Alloc>
73217 void
73218 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73219 _M_erase(_Link_type __x)
73220 {
73221 while (__x != 0)
73222 {
73223 _M_erase(_S_right(__x));
73224 _Link_type __y = _S_left(__x);
73225 _M_destroy_node(__x);
73226 __x = __y;
73227 }
73228 }
73229 template<typename _Key, typename _Val, typename _KeyOfValue,
73230 typename _Compare, typename _Alloc>
73231 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73232 _Compare, _Alloc>::iterator
73233 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73234 _M_lower_bound(_Link_type __x, _Link_type __y,
73235 const _Key& __k)
73236 {
73237 while (__x != 0)
73238 if (!_M_impl._M_key_compare(_S_key(__x), __k))
73239 __y = __x, __x = _S_left(__x);
73240 else
73241 __x = _S_right(__x);
73242 return iterator(__y);
73243 }
73244 template<typename _Key, typename _Val, typename _KeyOfValue,
73245 typename _Compare, typename _Alloc>
73246 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73247 _Compare, _Alloc>::const_iterator
73248 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73249 _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
73250 const _Key& __k) const
73251 {
73252 while (__x != 0)
73253 if (!_M_impl._M_key_compare(_S_key(__x), __k))
73254 __y = __x, __x = _S_left(__x);
73255 else
73256 __x = _S_right(__x);
73257 return const_iterator(__y);
73258 }
73259 template<typename _Key, typename _Val, typename _KeyOfValue,
73260 typename _Compare, typename _Alloc>
73261 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73262 _Compare, _Alloc>::iterator
73263 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73264 _M_upper_bound(_Link_type __x, _Link_type __y,
73265 const _Key& __k)
73266 {
73267 while (__x != 0)
73268 if (_M_impl._M_key_compare(__k, _S_key(__x)))
73269 __y = __x, __x = _S_left(__x);
73270 else
73271 __x = _S_right(__x);
73272 return iterator(__y);
73273 }
73274 template<typename _Key, typename _Val, typename _KeyOfValue,
73275 typename _Compare, typename _Alloc>
73276 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73277 _Compare, _Alloc>::const_iterator
73278 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73279 _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
73280 const _Key& __k) const
73281 {
73282 while (__x != 0)
73283 if (_M_impl._M_key_compare(__k, _S_key(__x)))
73284 __y = __x, __x = _S_left(__x);
73285 else
73286 __x = _S_right(__x);
73287 return const_iterator(__y);
73288 }
73289 template<typename _Key, typename _Val, typename _KeyOfValue,
73290 typename _Compare, typename _Alloc>
73291 pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
73292 _Compare, _Alloc>::iterator,
73293 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73294 _Compare, _Alloc>::iterator>
73295 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73296 equal_range(const _Key& __k)
73297 {
73298 _Link_type __x = _M_begin();
73299 _Link_type __y = _M_end();
73300 while (__x != 0)
73301 {
73302 if (_M_impl._M_key_compare(_S_key(__x), __k))
73303 __x = _S_right(__x);
73304 else if (_M_impl._M_key_compare(__k, _S_key(__x)))
73305 __y = __x, __x = _S_left(__x);
73306 else
73307 {
73308 _Link_type __xu(__x), __yu(__y);
73309 __y = __x, __x = _S_left(__x);
73310 __xu = _S_right(__xu);
73311 return pair<iterator,
73312 iterator>(_M_lower_bound(__x, __y, __k),
73313 _M_upper_bound(__xu, __yu, __k));
73314 }
73315 }
73316 return pair<iterator, iterator>(iterator(__y),
73317 iterator(__y));
73318 }
73319 template<typename _Key, typename _Val, typename _KeyOfValue,
73320 typename _Compare, typename _Alloc>
73321 pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
73322 _Compare, _Alloc>::const_iterator,
73323 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73324 _Compare, _Alloc>::const_iterator>
73325 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73326 equal_range(const _Key& __k) const
73327 {
73328 _Const_Link_type __x = _M_begin();
73329 _Const_Link_type __y = _M_end();
73330 while (__x != 0)
73331 {
73332 if (_M_impl._M_key_compare(_S_key(__x), __k))
73333 __x = _S_right(__x);
73334 else if (_M_impl._M_key_compare(__k, _S_key(__x)))
73335 __y = __x, __x = _S_left(__x);
73336 else
73337 {
73338 _Const_Link_type __xu(__x), __yu(__y);
73339 __y = __x, __x = _S_left(__x);
73340 __xu = _S_right(__xu);
73341 return pair<const_iterator,
73342 const_iterator>(_M_lower_bound(__x, __y, __k),
73343 _M_upper_bound(__xu, __yu, __k));
73344 }
73345 }
73346 return pair<const_iterator, const_iterator>(const_iterator(__y),
73347 const_iterator(__y));
73348 }
73349 template<typename _Key, typename _Val, typename _KeyOfValue,
73350 typename _Compare, typename _Alloc>
73351 void
73352 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73353 swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
73354 {
73355 if (_M_root() == 0)
73356 {
73357 if (__t._M_root() != 0)
73358 {
73359 _M_root() = __t._M_root();
73360 _M_leftmost() = __t._M_leftmost();
73361 _M_rightmost() = __t._M_rightmost();
73362 _M_root()->_M_parent = _M_end();
73363 __t._M_root() = 0;
73364 __t._M_leftmost() = __t._M_end();
73365 __t._M_rightmost() = __t._M_end();
73366 }
73367 }
73368 else if (__t._M_root() == 0)
73369 {
73370 __t._M_root() = _M_root();
73371 __t._M_leftmost() = _M_leftmost();
73372 __t._M_rightmost() = _M_rightmost();
73373 __t._M_root()->_M_parent = __t._M_end();
73374 _M_root() = 0;
73375 _M_leftmost() = _M_end();
73376 _M_rightmost() = _M_end();
73377 }
73378 else
73379 {
73380 std::swap(_M_root(),__t._M_root());
73381 std::swap(_M_leftmost(),__t._M_leftmost());
73382 std::swap(_M_rightmost(),__t._M_rightmost());
73383 _M_root()->_M_parent = _M_end();
73384 __t._M_root()->_M_parent = __t._M_end();
73385 }
73386 std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
73387 std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
73388 std::__alloc_swap<_Node_allocator>::
73389 _S_do_it(_M_get_Node_allocator(), __t._M_get_Node_allocator());
73390 }
73391 template<typename _Key, typename _Val, typename _KeyOfValue,
73392 typename _Compare, typename _Alloc>
73393 pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
73394 _Compare, _Alloc>::iterator, bool>
73395 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73396 _M_insert_unique(const _Val& __v)
73397 {
73398 _Link_type __x = _M_begin();
73399 _Link_type __y = _M_end();
73400 bool __comp = true;
73401 while (__x != 0)
73402 {
73403 __y = __x;
73404 __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x));
73405 __x = __comp ? _S_left(__x) : _S_right(__x);
73406 }
73407 iterator __j = iterator(__y);
73408 if (__comp)
73409 {
73410 if (__j == begin())
73411 return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
73412 else
73413 --__j;
73414 }
73415 if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
73416 return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
73417 return pair<iterator, bool>(__j, false);
73418 }
73419 template<typename _Key, typename _Val, typename _KeyOfValue,
73420 typename _Compare, typename _Alloc>
73421 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
73422 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73423 _M_insert_equal(const _Val& __v)
73424 {
73425 _Link_type __x = _M_begin();
73426 _Link_type __y = _M_end();
73427 while (__x != 0)
73428 {
73429 __y = __x;
73430 __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
73431 _S_left(__x) : _S_right(__x);
73432 }
73433 return _M_insert_(__x, __y, __v);
73434 }
73435 template<typename _Key, typename _Val, typename _KeyOfValue,
73436 typename _Compare, typename _Alloc>
73437 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
73438 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73439 _M_insert_unique_(const_iterator __position, const _Val& __v)
73440 {
73441 if (__position._M_node == _M_end())
73442 {
73443 if (size() > 0
73444 && _M_impl._M_key_compare(_S_key(_M_rightmost()),
73445 _KeyOfValue()(__v)))
73446 return _M_insert_(0, _M_rightmost(), __v);
73447 else
73448 return _M_insert_unique(__v).first;
73449 }
73450 else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
73451 _S_key(__position._M_node)))
73452 {
73453 const_iterator __before = __position;
73454 if (__position._M_node == _M_leftmost())
73455 return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
73456 else if (_M_impl._M_key_compare(_S_key((--__before)._M_node),
73457 _KeyOfValue()(__v)))
73458 {
73459 if (_S_right(__before._M_node) == 0)
73460 return _M_insert_(0, __before._M_node, __v);
73461 else
73462 return _M_insert_(__position._M_node,
73463 __position._M_node, __v);
73464 }
73465 else
73466 return _M_insert_unique(__v).first;
73467 }
73468 else if (_M_impl._M_key_compare(_S_key(__position._M_node),
73469 _KeyOfValue()(__v)))
73470 {
73471 const_iterator __after = __position;
73472 if (__position._M_node == _M_rightmost())
73473 return _M_insert_(0, _M_rightmost(), __v);
73474 else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
73475 _S_key((++__after)._M_node)))
73476 {
73477 if (_S_right(__position._M_node) == 0)
73478 return _M_insert_(0, __position._M_node, __v);
73479 else
73480 return _M_insert_(__after._M_node, __after._M_node, __v);
73481 }
73482 else
73483 return _M_insert_unique(__v).first;
73484 }
73485 else
73486 return iterator(static_cast<_Link_type>
73487 (const_cast<_Base_ptr>(__position._M_node)));
73488 }
73489 template<typename _Key, typename _Val, typename _KeyOfValue,
73490 typename _Compare, typename _Alloc>
73491 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
73492 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73493 _M_insert_equal_(const_iterator __position, const _Val& __v)
73494 {
73495 if (__position._M_node == _M_end())
73496 {
73497 if (size() > 0
73498 && !_M_impl._M_key_compare(_KeyOfValue()(__v),
73499 _S_key(_M_rightmost())))
73500 return _M_insert_(0, _M_rightmost(), __v);
73501 else
73502 return _M_insert_equal(__v);
73503 }
73504 else if (!_M_impl._M_key_compare(_S_key(__position._M_node),
73505 _KeyOfValue()(__v)))
73506 {
73507 const_iterator __before = __position;
73508 if (__position._M_node == _M_leftmost())
73509 return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
73510 else if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
73511 _S_key((--__before)._M_node)))
73512 {
73513 if (_S_right(__before._M_node) == 0)
73514 return _M_insert_(0, __before._M_node, __v);
73515 else
73516 return _M_insert_(__position._M_node,
73517 __position._M_node, __v);
73518 }
73519 else
73520 return _M_insert_equal(__v);
73521 }
73522 else
73523 {
73524 const_iterator __after = __position;
73525 if (__position._M_node == _M_rightmost())
73526 return _M_insert_(0, _M_rightmost(), __v);
73527 else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node),
73528 _KeyOfValue()(__v)))
73529 {
73530 if (_S_right(__position._M_node) == 0)
73531 return _M_insert_(0, __position._M_node, __v);
73532 else
73533 return _M_insert_(__after._M_node, __after._M_node, __v);
73534 }
73535 else
73536 return _M_insert_equal_lower(__v);
73537 }
73538 }
73539 template<typename _Key, typename _Val, typename _KoV,
73540 typename _Cmp, typename _Alloc>
73541 template<class _II>
73542 void
73543 _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
73544 _M_insert_unique(_II __first, _II __last)
73545 {
73546 for (; __first != __last; ++__first)
73547 _M_insert_unique_(end(), *__first);
73548 }
73549 template<typename _Key, typename _Val, typename _KoV,
73550 typename _Cmp, typename _Alloc>
73551 template<class _II>
73552 void
73553 _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
73554 _M_insert_equal(_II __first, _II __last)
73555 {
73556 for (; __first != __last; ++__first)
73557 _M_insert_equal_(end(), *__first);
73558 }
73559 template<typename _Key, typename _Val, typename _KeyOfValue,
73560 typename _Compare, typename _Alloc>
73561 inline void
73562 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73563 erase(iterator __position)
73564 {
73565 _Link_type __y =
73566 static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
73567 (__position._M_node,
73568 this->_M_impl._M_header));
73569 _M_destroy_node(__y);
73570 --_M_impl._M_node_count;
73571 }
73572 template<typename _Key, typename _Val, typename _KeyOfValue,
73573 typename _Compare, typename _Alloc>
73574 inline void
73575 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73576 erase(const_iterator __position)
73577 {
73578 _Link_type __y =
73579 static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
73580 (const_cast<_Base_ptr>(__position._M_node),
73581 this->_M_impl._M_header));
73582 _M_destroy_node(__y);
73583 --_M_impl._M_node_count;
73584 }
73585 template<typename _Key, typename _Val, typename _KeyOfValue,
73586 typename _Compare, typename _Alloc>
73587 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
73588 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73589 erase(const _Key& __x)
73590 {
73591 pair<iterator, iterator> __p = equal_range(__x);
73592 const size_type __old_size = size();
73593 erase(__p.first, __p.second);
73594 return __old_size - size();
73595 }
73596 template<typename _Key, typename _Val, typename _KeyOfValue,
73597 typename _Compare, typename _Alloc>
73598 void
73599 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73600 erase(iterator __first, iterator __last)
73601 {
73602 if (__first == begin() && __last == end())
73603 clear();
73604 else
73605 while (__first != __last)
73606 erase(__first++);
73607 }
73608 template<typename _Key, typename _Val, typename _KeyOfValue,
73609 typename _Compare, typename _Alloc>
73610 void
73611 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73612 erase(const_iterator __first, const_iterator __last)
73613 {
73614 if (__first == begin() && __last == end())
73615 clear();
73616 else
73617 while (__first != __last)
73618 erase(__first++);
73619 }
73620 template<typename _Key, typename _Val, typename _KeyOfValue,
73621 typename _Compare, typename _Alloc>
73622 void
73623 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73624 erase(const _Key* __first, const _Key* __last)
73625 {
73626 while (__first != __last)
73627 erase(*__first++);
73628 }
73629 template<typename _Key, typename _Val, typename _KeyOfValue,
73630 typename _Compare, typename _Alloc>
73631 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73632 _Compare, _Alloc>::iterator
73633 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73634 find(const _Key& __k)
73635 {
73636 iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
73637 return (__j == end()
73638 || _M_impl._M_key_compare(__k,
73639 _S_key(__j._M_node))) ? end() : __j;
73640 }
73641 template<typename _Key, typename _Val, typename _KeyOfValue,
73642 typename _Compare, typename _Alloc>
73643 typename _Rb_tree<_Key, _Val, _KeyOfValue,
73644 _Compare, _Alloc>::const_iterator
73645 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73646 find(const _Key& __k) const
73647 {
73648 const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
73649 return (__j == end()
73650 || _M_impl._M_key_compare(__k,
73651 _S_key(__j._M_node))) ? end() : __j;
73652 }
73653 template<typename _Key, typename _Val, typename _KeyOfValue,
73654 typename _Compare, typename _Alloc>
73655 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
73656 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
73657 count(const _Key& __k) const
73658 {
73659 pair<const_iterator, const_iterator> __p = equal_range(__k);
73660 const size_type __n = std::distance(__p.first, __p.second);
73661 return __n;
73662 }
73663 __attribute__ ((__pure__)) unsigned int
73664 _Rb_tree_black_count(const _Rb_tree_node_base* __node,
73665 const _Rb_tree_node_base* __root) throw ();
73666 template<typename _Key, typename _Val, typename _KeyOfValue,
73667 typename _Compare, typename _Alloc>
73668 bool
73669 _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
73670 {
73671 if (_M_impl._M_node_count == 0 || begin() == end())
73672 return _M_impl._M_node_count == 0 && begin() == end()
73673 && this->_M_impl._M_header._M_left == _M_end()
73674 && this->_M_impl._M_header._M_right == _M_end();
73675 unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
73676 for (const_iterator __it = begin(); __it != end(); ++__it)
73677 {
73678 _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
73679 _Const_Link_type __L = _S_left(__x);
73680 _Const_Link_type __R = _S_right(__x);
73681 if (__x->_M_color == _S_red)
73682 if ((__L && __L->_M_color == _S_red)
73683 || (__R && __R->_M_color == _S_red))
73684 return false;
73685 if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
73686 return false;
73687 if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
73688 return false;
73689 if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
73690 return false;
73691 }
73692 if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
73693 return false;
73694 if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
73695 return false;
73696 return true;
73697 }
73698 }
73699 namespace std __attribute__ ((__visibility__ ("default"))) {
73700 template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
73701 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
73702 class map
73703 {
73704 public:
73705 typedef _Key key_type;
73706 typedef _Tp mapped_type;
73707 typedef std::pair<const _Key, _Tp> value_type;
73708 typedef _Compare key_compare;
73709 typedef _Alloc allocator_type;
73710 private:
73711 typedef typename _Alloc::value_type _Alloc_value_type;
73712
73713
73714
73715 public:
73716 class value_compare
73717 : public std::binary_function<value_type, value_type, bool>
73718 {
73719 friend class map<_Key, _Tp, _Compare, _Alloc>;
73720 protected:
73721 _Compare comp;
73722 value_compare(_Compare __c)
73723 : comp(__c) { }
73724 public:
73725 bool operator()(const value_type& __x, const value_type& __y) const
73726 { return comp(__x.first, __y.first); }
73727 };
73728 private:
73729 typedef typename _Alloc::template rebind<value_type>::other
73730 _Pair_alloc_type;
73731 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
73732 key_compare, _Pair_alloc_type> _Rep_type;
73733 _Rep_type _M_t;
73734 public:
73735 typedef typename _Pair_alloc_type::pointer pointer;
73736 typedef typename _Pair_alloc_type::const_pointer const_pointer;
73737 typedef typename _Pair_alloc_type::reference reference;
73738 typedef typename _Pair_alloc_type::const_reference const_reference;
73739 typedef typename _Rep_type::iterator iterator;
73740 typedef typename _Rep_type::const_iterator const_iterator;
73741 typedef typename _Rep_type::size_type size_type;
73742 typedef typename _Rep_type::difference_type difference_type;
73743 typedef typename _Rep_type::reverse_iterator reverse_iterator;
73744 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
73745 map()
73746 : _M_t() { }
73747 explicit
73748 map(const _Compare& __comp,
73749 const allocator_type& __a = allocator_type())
73750 : _M_t(__comp, __a) { }
73751 map(const map& __x)
73752 : _M_t(__x._M_t) { }
73753 template<typename _InputIterator>
73754 map(_InputIterator __first, _InputIterator __last)
73755 : _M_t()
73756 { _M_t._M_insert_unique(__first, __last); }
73757 template<typename _InputIterator>
73758 map(_InputIterator __first, _InputIterator __last,
73759 const _Compare& __comp,
73760 const allocator_type& __a = allocator_type())
73761 : _M_t(__comp, __a)
73762 { _M_t._M_insert_unique(__first, __last); }
73763 map&
73764 operator=(const map& __x)
73765 {
73766 _M_t = __x._M_t;
73767 return *this;
73768 }
73769 allocator_type
73770 get_allocator() const
73771 { return _M_t.get_allocator(); }
73772 iterator
73773 begin()
73774 { return _M_t.begin(); }
73775 const_iterator
73776 begin() const
73777 { return _M_t.begin(); }
73778 iterator
73779 end()
73780 { return _M_t.end(); }
73781 const_iterator
73782 end() const
73783 { return _M_t.end(); }
73784 reverse_iterator
73785 rbegin()
73786 { return _M_t.rbegin(); }
73787 const_reverse_iterator
73788 rbegin() const
73789 { return _M_t.rbegin(); }
73790 reverse_iterator
73791 rend()
73792 { return _M_t.rend(); }
73793 const_reverse_iterator
73794 rend() const
73795 { return _M_t.rend(); }
73796 bool
73797 empty() const
73798 { return _M_t.empty(); }
73799 size_type
73800 size() const
73801 { return _M_t.size(); }
73802 size_type
73803 max_size() const
73804 { return _M_t.max_size(); }
73805 mapped_type&
73806 operator[](const key_type& __k)
73807 {
73808 iterator __i = lower_bound(__k);
73809 if (__i == end() || key_comp()(__k, (*__i).first))
73810 __i = insert(__i, value_type(__k, mapped_type()));
73811 return (*__i).second;
73812 }
73813 mapped_type&
73814 at(const key_type& __k)
73815 {
73816 iterator __i = lower_bound(__k);
73817 if (__i == end() || key_comp()(__k, (*__i).first))
73818 __throw_out_of_range(("map::at"));
73819 return (*__i).second;
73820 }
73821 const mapped_type&
73822 at(const key_type& __k) const
73823 {
73824 const_iterator __i = lower_bound(__k);
73825 if (__i == end() || key_comp()(__k, (*__i).first))
73826 __throw_out_of_range(("map::at"));
73827 return (*__i).second;
73828 }
73829 std::pair<iterator, bool>
73830 insert(const value_type& __x)
73831 { return _M_t._M_insert_unique(__x); }
73832 iterator
73833 insert(iterator __position, const value_type& __x)
73834 { return _M_t._M_insert_unique_(__position, __x); }
73835 template<typename _InputIterator>
73836 void
73837 insert(_InputIterator __first, _InputIterator __last)
73838 { _M_t._M_insert_unique(__first, __last); }
73839 void
73840 erase(iterator __position)
73841 { _M_t.erase(__position); }
73842 size_type
73843 erase(const key_type& __x)
73844 { return _M_t.erase(__x); }
73845 void
73846 erase(iterator __first, iterator __last)
73847 { _M_t.erase(__first, __last); }
73848 void
73849 swap(map& __x)
73850 { _M_t.swap(__x._M_t); }
73851 void
73852 clear()
73853 { _M_t.clear(); }
73854 key_compare
73855 key_comp() const
73856 { return _M_t.key_comp(); }
73857 value_compare
73858 value_comp() const
73859 { return value_compare(_M_t.key_comp()); }
73860 iterator
73861 find(const key_type& __x)
73862 { return _M_t.find(__x); }
73863 const_iterator
73864 find(const key_type& __x) const
73865 { return _M_t.find(__x); }
73866 size_type
73867 count(const key_type& __x) const
73868 { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
73869 iterator
73870 lower_bound(const key_type& __x)
73871 { return _M_t.lower_bound(__x); }
73872 const_iterator
73873 lower_bound(const key_type& __x) const
73874 { return _M_t.lower_bound(__x); }
73875 iterator
73876 upper_bound(const key_type& __x)
73877 { return _M_t.upper_bound(__x); }
73878 const_iterator
73879 upper_bound(const key_type& __x) const
73880 { return _M_t.upper_bound(__x); }
73881 std::pair<iterator, iterator>
73882 equal_range(const key_type& __x)
73883 { return _M_t.equal_range(__x); }
73884 std::pair<const_iterator, const_iterator>
73885 equal_range(const key_type& __x) const
73886 { return _M_t.equal_range(__x); }
73887 template<typename _K1, typename _T1, typename _C1, typename _A1>
73888 friend bool
73889 operator==(const map<_K1, _T1, _C1, _A1>&,
73890 const map<_K1, _T1, _C1, _A1>&);
73891 template<typename _K1, typename _T1, typename _C1, typename _A1>
73892 friend bool
73893 operator<(const map<_K1, _T1, _C1, _A1>&,
73894 const map<_K1, _T1, _C1, _A1>&);
73895 };
73896 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73897 inline bool
73898 operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
73899 const map<_Key, _Tp, _Compare, _Alloc>& __y)
73900 { return __x._M_t == __y._M_t; }
73901 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73902 inline bool
73903 operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
73904 const map<_Key, _Tp, _Compare, _Alloc>& __y)
73905 { return __x._M_t < __y._M_t; }
73906 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73907 inline bool
73908 operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
73909 const map<_Key, _Tp, _Compare, _Alloc>& __y)
73910 { return !(__x == __y); }
73911 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73912 inline bool
73913 operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
73914 const map<_Key, _Tp, _Compare, _Alloc>& __y)
73915 { return __y < __x; }
73916 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73917 inline bool
73918 operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
73919 const map<_Key, _Tp, _Compare, _Alloc>& __y)
73920 { return !(__y < __x); }
73921 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73922 inline bool
73923 operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
73924 const map<_Key, _Tp, _Compare, _Alloc>& __y)
73925 { return !(__x < __y); }
73926 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
73927 inline void
73928 swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
73929 map<_Key, _Tp, _Compare, _Alloc>& __y)
73930 { __x.swap(__y); }
73931 }
73932 namespace std __attribute__ ((__visibility__ ("default"))) {
73933 template <typename _Key, typename _Tp,
73934 typename _Compare = std::less<_Key>,
73935 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
73936 class multimap
73937 {
73938 public:
73939 typedef _Key key_type;
73940 typedef _Tp mapped_type;
73941 typedef std::pair<const _Key, _Tp> value_type;
73942 typedef _Compare key_compare;
73943 typedef _Alloc allocator_type;
73944 private:
73945 typedef typename _Alloc::value_type _Alloc_value_type;
73946
73947
73948
73949 public:
73950 class value_compare
73951 : public std::binary_function<value_type, value_type, bool>
73952 {
73953 friend class multimap<_Key, _Tp, _Compare, _Alloc>;
73954 protected:
73955 _Compare comp;
73956 value_compare(_Compare __c)
73957 : comp(__c) { }
73958 public:
73959 bool operator()(const value_type& __x, const value_type& __y) const
73960 { return comp(__x.first, __y.first); }
73961 };
73962 private:
73963 typedef typename _Alloc::template rebind<value_type>::other
73964 _Pair_alloc_type;
73965 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
73966 key_compare, _Pair_alloc_type> _Rep_type;
73967 _Rep_type _M_t;
73968 public:
73969 typedef typename _Pair_alloc_type::pointer pointer;
73970 typedef typename _Pair_alloc_type::const_pointer const_pointer;
73971 typedef typename _Pair_alloc_type::reference reference;
73972 typedef typename _Pair_alloc_type::const_reference const_reference;
73973 typedef typename _Rep_type::iterator iterator;
73974 typedef typename _Rep_type::const_iterator const_iterator;
73975 typedef typename _Rep_type::size_type size_type;
73976 typedef typename _Rep_type::difference_type difference_type;
73977 typedef typename _Rep_type::reverse_iterator reverse_iterator;
73978 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
73979 multimap()
73980 : _M_t() { }
73981 explicit
73982 multimap(const _Compare& __comp,
73983 const allocator_type& __a = allocator_type())
73984 : _M_t(__comp, __a) { }
73985 multimap(const multimap& __x)
73986 : _M_t(__x._M_t) { }
73987 template<typename _InputIterator>
73988 multimap(_InputIterator __first, _InputIterator __last)
73989 : _M_t()
73990 { _M_t._M_insert_equal(__first, __last); }
73991 template<typename _InputIterator>
73992 multimap(_InputIterator __first, _InputIterator __last,
73993 const _Compare& __comp,
73994 const allocator_type& __a = allocator_type())
73995 : _M_t(__comp, __a)
73996 { _M_t._M_insert_equal(__first, __last); }
73997 multimap&
73998 operator=(const multimap& __x)
73999 {
74000 _M_t = __x._M_t;
74001 return *this;
74002 }
74003 allocator_type
74004 get_allocator() const
74005 { return _M_t.get_allocator(); }
74006 iterator
74007 begin()
74008 { return _M_t.begin(); }
74009 const_iterator
74010 begin() const
74011 { return _M_t.begin(); }
74012 iterator
74013 end()
74014 { return _M_t.end(); }
74015 const_iterator
74016 end() const
74017 { return _M_t.end(); }
74018 reverse_iterator
74019 rbegin()
74020 { return _M_t.rbegin(); }
74021 const_reverse_iterator
74022 rbegin() const
74023 { return _M_t.rbegin(); }
74024 reverse_iterator
74025 rend()
74026 { return _M_t.rend(); }
74027 const_reverse_iterator
74028 rend() const
74029 { return _M_t.rend(); }
74030 bool
74031 empty() const
74032 { return _M_t.empty(); }
74033 size_type
74034 size() const
74035 { return _M_t.size(); }
74036 size_type
74037 max_size() const
74038 { return _M_t.max_size(); }
74039 iterator
74040 insert(const value_type& __x)
74041 { return _M_t._M_insert_equal(__x); }
74042 iterator
74043 insert(iterator __position, const value_type& __x)
74044 { return _M_t._M_insert_equal_(__position, __x); }
74045 template<typename _InputIterator>
74046 void
74047 insert(_InputIterator __first, _InputIterator __last)
74048 { _M_t._M_insert_equal(__first, __last); }
74049 void
74050 erase(iterator __position)
74051 { _M_t.erase(__position); }
74052 size_type
74053 erase(const key_type& __x)
74054 { return _M_t.erase(__x); }
74055 void
74056 erase(iterator __first, iterator __last)
74057 { _M_t.erase(__first, __last); }
74058 void
74059 swap(multimap& __x)
74060 { _M_t.swap(__x._M_t); }
74061 void
74062 clear()
74063 { _M_t.clear(); }
74064 key_compare
74065 key_comp() const
74066 { return _M_t.key_comp(); }
74067 value_compare
74068 value_comp() const
74069 { return value_compare(_M_t.key_comp()); }
74070 iterator
74071 find(const key_type& __x)
74072 { return _M_t.find(__x); }
74073 const_iterator
74074 find(const key_type& __x) const
74075 { return _M_t.find(__x); }
74076 size_type
74077 count(const key_type& __x) const
74078 { return _M_t.count(__x); }
74079 iterator
74080 lower_bound(const key_type& __x)
74081 { return _M_t.lower_bound(__x); }
74082 const_iterator
74083 lower_bound(const key_type& __x) const
74084 { return _M_t.lower_bound(__x); }
74085 iterator
74086 upper_bound(const key_type& __x)
74087 { return _M_t.upper_bound(__x); }
74088 const_iterator
74089 upper_bound(const key_type& __x) const
74090 { return _M_t.upper_bound(__x); }
74091 std::pair<iterator, iterator>
74092 equal_range(const key_type& __x)
74093 { return _M_t.equal_range(__x); }
74094 std::pair<const_iterator, const_iterator>
74095 equal_range(const key_type& __x) const
74096 { return _M_t.equal_range(__x); }
74097 template<typename _K1, typename _T1, typename _C1, typename _A1>
74098 friend bool
74099 operator==(const multimap<_K1, _T1, _C1, _A1>&,
74100 const multimap<_K1, _T1, _C1, _A1>&);
74101 template<typename _K1, typename _T1, typename _C1, typename _A1>
74102 friend bool
74103 operator<(const multimap<_K1, _T1, _C1, _A1>&,
74104 const multimap<_K1, _T1, _C1, _A1>&);
74105 };
74106 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74107 inline bool
74108 operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74109 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74110 { return __x._M_t == __y._M_t; }
74111 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74112 inline bool
74113 operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74114 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74115 { return __x._M_t < __y._M_t; }
74116 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74117 inline bool
74118 operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74119 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74120 { return !(__x == __y); }
74121 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74122 inline bool
74123 operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74124 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74125 { return __y < __x; }
74126 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74127 inline bool
74128 operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74129 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74130 { return !(__y < __x); }
74131 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74132 inline bool
74133 operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74134 const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74135 { return !(__x < __y); }
74136 template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
74137 inline void
74138 swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
74139 multimap<_Key, _Tp, _Compare, _Alloc>& __y)
74140 { __x.swap(__y); }
74141 }
74142
74143 namespace std __attribute__ ((__visibility__ ("default"))) {
74144 extern istream cin;
74145 extern ostream cout;
74146 extern ostream cerr;
74147 extern ostream clog;
74148 extern wistream wcin;
74149 extern wostream wcout;
74150 extern wostream wcerr;
74151 extern wostream wclog;
74152 static ios_base::Init __ioinit;
74153 }
74154 namespace boost { namespace python { namespace detail {
74155 template <class Proxy>
74156 struct compare_proxy_index
74157 {
74158 template <class Index>
74159 bool operator()(PyObject* prox, Index i) const
74160 {
74161 typedef typename Proxy::policies_type policies_type;
74162 Proxy& proxy = extract<Proxy&>(prox)();
74163 return policies_type::
74164 compare_index(proxy.get_container(), proxy.get_index(), i);
74165 }
74166 };
74167 template <class Proxy>
74168 class proxy_group
74169 {
74170 public:
74171 typedef typename std::vector<PyObject*>::const_iterator const_iterator;
74172 typedef typename std::vector<PyObject*>::iterator iterator;
74173 typedef typename Proxy::index_type index_type;
74174 typedef typename Proxy::policies_type policies_type;
74175 iterator
74176 first_proxy(index_type i)
74177 {
74178 return boost::detail::lower_bound(
74179 proxies.begin(), proxies.end(),
74180 i, compare_proxy_index<Proxy>());
74181 }
74182 void
74183 remove(Proxy& proxy)
74184 {
74185 for (iterator iter = first_proxy(proxy.get_index());
74186 iter != proxies.end(); ++iter)
74187 {
74188 if (&extract<Proxy&>(*iter)() == &proxy)
74189 {
74190 proxies.erase(iter);
74191 break;
74192 }
74193 }
74194 ;
74195 }
74196 void
74197 add(PyObject* prox)
74198 {
74199 ;
74200 proxies.insert(
74201 first_proxy(extract<Proxy&>(prox)().get_index()), prox);
74202 ;
74203 }
74204 void
74205 erase(index_type i, mpl::false_)
74206 {
74207 ;
74208 replace(i, i+1, 0);
74209 ;
74210 }
74211 void
74212 erase(index_type i, mpl::true_)
74213 {
74214 ;
74215 iterator iter = first_proxy(i);
74216 extract<Proxy&> p(*iter);
74217 if (iter != proxies.end() && p().get_index() == i)
74218 {
74219 extract<Proxy&> p(*iter);
74220 p().detach();
74221 proxies.erase(iter);
74222 }
74223 ;
74224 }
74225 void
74226 erase(index_type from, index_type to)
74227 {
74228 ;
74229 replace(from, to, 0);
74230 ;
74231 }
74232 void
74233 replace(
74234 index_type from,
74235 index_type to,
74236 typename std::vector<PyObject*>::size_type len)
74237 {
74238 ;
74239 iterator left = first_proxy(from);
74240 iterator right = proxies.end();
74241 for (iterator iter = left; iter != right; ++iter)
74242 {
74243 if (extract<Proxy&>(*iter)().get_index() > to)
74244 {
74245 right = iter;
74246 break;
74247 }
74248 extract<Proxy&> p(*iter);
74249 p().detach();
74250 }
74251 typename std::vector<PyObject*>::size_type
74252 offset = left-proxies.begin();
74253 proxies.erase(left, right);
74254 right = proxies.begin()+offset;
74255 while (right != proxies.end())
74256 {
74257 typedef typename Proxy::container_type::difference_type difference_type;
74258 extract<Proxy&> p(*right);
74259 p().set_index(
74260 extract<Proxy&>(*right)().get_index()
74261 - (difference_type(to) - from - len)
74262 );
74263 ++right;
74264 }
74265 ;
74266 }
74267 PyObject*
74268 find(index_type i)
74269 {
74270 ;
74271 iterator iter = first_proxy(i);
74272 if (iter != proxies.end()
74273 && extract<Proxy&>(*iter)().get_index() == i)
74274 {
74275 ;
74276 return *iter;
74277 }
74278 ;
74279 return 0;
74280 }
74281 typename std::vector<PyObject*>::size_type
74282 size() const
74283 {
74284 ;
74285 return proxies.size();
74286 }
74287 private:
74288 std::vector<PyObject*> proxies;
74289 };
74290 template <class Proxy, class Container>
74291 class proxy_links
74292 {
74293 public:
74294 typedef std::map<Container*, proxy_group<Proxy> > links_t;
74295 typedef typename Proxy::index_type index_type;
74296 void
74297 remove(Proxy& proxy)
74298 {
74299 typename links_t::iterator r = links.find(&proxy.get_container());
74300 if (r != links.end())
74301 {
74302 r->second.remove(proxy);
74303 if (r->second.size() == 0)
74304 links.erase(r);
74305 }
74306 }
74307 void
74308 add(PyObject* prox, Container& container)
74309 {
74310 links[&container].add(prox);
74311 }
74312 template <class NoSlice>
74313 void erase(Container& container, index_type i, NoSlice no_slice)
74314 {
74315 typename links_t::iterator r = links.find(&container);
74316 if (r != links.end())
74317 {
74318 r->second.erase(i, no_slice);
74319 if (r->second.size() == 0)
74320 links.erase(r);
74321 }
74322 }
74323 void
74324 erase(Container& container, index_type from, index_type to)
74325 {
74326 typename links_t::iterator r = links.find(&container);
74327 if (r != links.end())
74328 {
74329 r->second.erase(from, to);
74330 if (r->second.size() == 0)
74331 links.erase(r);
74332 }
74333 }
74334 void
74335 replace(
74336 Container& container,
74337 index_type from, index_type to, index_type len)
74338 {
74339 typename links_t::iterator r = links.find(&container);
74340 if (r != links.end())
74341 {
74342 r->second.replace(from, to, len);
74343 if (r->second.size() == 0)
74344 links.erase(r);
74345 }
74346 }
74347 PyObject*
74348 find(Container& container, index_type i)
74349 {
74350 typename links_t::iterator r = links.find(&container);
74351 if (r != links.end())
74352 return r->second.find(i);
74353 return 0;
74354 }
74355 private:
74356 links_t links;
74357 };
74358 template <class Container, class Index, class Policies>
74359 class container_element
74360 {
74361 public:
74362 typedef Index index_type;
74363 typedef Container container_type;
74364 typedef typename Policies::data_type element_type;
74365 typedef Policies policies_type;
74366 typedef container_element<Container, Index, Policies> self_t;
74367 typedef proxy_group<self_t> links_type;
74368 container_element(object container, Index index)
74369 : ptr()
74370 , container(container)
74371 , index(index)
74372 {
74373 }
74374 container_element(container_element const& ce)
74375 : ptr(ce.ptr.get() == 0 ? 0 : new element_type(*ce.ptr.get()))
74376 , container(ce.container)
74377 , index(ce.index)
74378 {
74379 }
74380 ~container_element()
74381 {
74382 if (!is_detached())
74383 get_links().remove(*this);
74384 }
74385 element_type& operator*() const
74386 {
74387 if (is_detached())
74388 return *get_pointer(ptr);
74389 return Policies::get_item(get_container(), index);
74390 }
74391 element_type* get() const
74392 {
74393 if (is_detached())
74394 return get_pointer(ptr);
74395 return &Policies::get_item(get_container(), index);
74396 }
74397 void
74398 detach()
74399 {
74400 if (!is_detached())
74401 {
74402 ptr.reset(
74403 new element_type(
74404 Policies::get_item(get_container(), index)));
74405 container = object();
74406 }
74407 }
74408 bool
74409 is_detached() const
74410 {
74411 return get_pointer(ptr) != 0;
74412 }
74413 Container&
74414 get_container() const
74415 {
74416 return extract<Container&>(container)();
74417 }
74418 Index
74419 get_index() const
74420 {
74421 return index;
74422 }
74423 void
74424 set_index(Index i)
74425 {
74426 index = i;
74427 }
74428 static proxy_links<self_t, Container>&
74429 get_links()
74430 {
74431 static proxy_links<self_t, Container> links;
74432 return links;
74433 }
74434 private:
74435 container_element& operator=(container_element const& ce);
74436 scoped_ptr<element_type> ptr;
74437 object container;
74438 Index index;
74439 };
74440 template <
74441 class Container
74442 , class DerivedPolicies
74443 , class ContainerElement
74444 , class Index
74445 >
74446 struct no_proxy_helper
74447 {
74448 static void
74449 register_container_element()
74450 {
74451 }
74452 template <class DataType>
74453 static object
74454 base_get_item_helper(DataType const& p, mpl::true_)
74455 {
74456 return object(ptr(p));
74457 }
74458 template <class DataType>
74459 static object
74460 base_get_item_helper(DataType const& x, mpl::false_)
74461 {
74462 return object(x);
74463 }
74464 static object
74465 base_get_item_(back_reference<Container&> const& container, PyObject* i)
74466 {
74467 return base_get_item_helper(
74468 DerivedPolicies::get_item(
74469 container.get(), DerivedPolicies::
74470 convert_index(container.get(), i))
74471 , is_pointer<typename Container::value_type>()
74472 );
74473 }
74474 static void
74475 base_replace_indexes(
74476 Container& , Index ,
74477 Index , Index )
74478 {
74479 }
74480 template <class NoSlice>
74481 static void
74482 base_erase_index(
74483 Container& , Index , NoSlice )
74484 {
74485 }
74486 static void
74487 base_erase_indexes(Container& , Index , Index )
74488 {
74489 }
74490 };
74491 template <
74492 class Container
74493 , class DerivedPolicies
74494 , class ContainerElement
74495 , class Index
74496 >
74497 struct proxy_helper
74498 {
74499 static void
74500 register_container_element()
74501 {
74502 register_ptr_to_python<ContainerElement>();
74503 }
74504 static object
74505 base_get_item_(back_reference<Container&> const& container, PyObject* i)
74506 {
74507 Index idx = DerivedPolicies::convert_index(container.get(), i);
74508 if (PyObject* shared =
74509 ContainerElement::get_links().find(container.get(), idx))
74510 {
74511 handle<> h(python::borrowed(shared));
74512 return object(h);
74513 }
74514 else
74515 {
74516 object prox(ContainerElement(container.source(), idx));
74517 ContainerElement::
74518 get_links().add(prox.ptr(), container.get());
74519 return prox;
74520 }
74521 }
74522 static void
74523 base_replace_indexes(
74524 Container& container, Index from,
74525 Index to, Index n)
74526 {
74527 ContainerElement::get_links().replace(container, from, to, n);
74528 }
74529 template <class NoSlice>
74530 static void
74531 base_erase_index(
74532 Container& container, Index i, NoSlice no_slice)
74533 {
74534 ContainerElement::get_links().erase(container, i, no_slice);
74535 }
74536 static void
74537 base_erase_indexes(
74538 Container& container, Index from, Index to)
74539 {
74540 ContainerElement::get_links().erase(container, from, to);
74541 }
74542 };
74543 template <
74544 class Container
74545 , class DerivedPolicies
74546 , class ProxyHandler
74547 , class Data
74548 , class Index
74549 >
74550 struct slice_helper
74551 {
74552 static object
74553 base_get_slice(Container& container, PySliceObject* slice)
74554 {
74555 Index from, to;
74556 base_get_slice_data(container, slice, from, to);
74557 return DerivedPolicies::get_slice(container, from, to);
74558 }
74559 static void
74560 base_get_slice_data(
74561 Container& container, PySliceObject* slice, Index& from_, Index& to_)
74562 {
74563 if ((&_Py_NoneStruct) != slice->step) {
74564 PyErr_SetString( PyExc_IndexError, "slice step size not supported.");
74565 throw_error_already_set();
74566 }
74567 Index min_index = DerivedPolicies::get_min_index(container);
74568 Index max_index = DerivedPolicies::get_max_index(container);
74569 if ((&_Py_NoneStruct) == slice->start) {
74570 from_ = min_index;
74571 }
74572 else {
74573 long from = extract<long>( slice->start);
74574 if (from < 0)
74575 from += max_index;
74576 if (from < 0)
74577 from = 0;
74578 from_ = boost::numeric_cast<Index>(from);
74579 if (from_ > max_index)
74580 from_ = max_index;
74581 }
74582 if ((&_Py_NoneStruct) == slice->stop) {
74583 to_ = max_index;
74584 }
74585 else {
74586 long to = extract<long>( slice->stop);
74587 if (to < 0)
74588 to += max_index;
74589 if (to < 0)
74590 to = 0;
74591 to_ = boost::numeric_cast<Index>(to);
74592 if (to_ > max_index)
74593 to_ = max_index;
74594 }
74595 }
74596 static void
74597 base_set_slice(Container& container, PySliceObject* slice, PyObject* v)
74598 {
74599 Index from, to;
74600 base_get_slice_data(container, slice, from, to);
74601 extract<Data&> elem(v);
74602 if (elem.check())
74603 {
74604 ProxyHandler::base_replace_indexes(container, from, to, 1);
74605 DerivedPolicies::set_slice(container, from, to, elem());
74606 }
74607 else
74608 {
74609 extract<Data> elem(v);
74610 if (elem.check())
74611 {
74612 ProxyHandler::base_replace_indexes(container, from, to, 1);
74613 DerivedPolicies::set_slice(container, from, to, elem());
74614 }
74615 else
74616 {
74617 handle<> l_(python::borrowed(v));
74618 object l(l_);
74619 std::vector<Data> temp;
74620 for (int i = 0; i < l.attr("__len__")(); i++)
74621 {
74622 object elem(l[i]);
74623 extract<Data const&> x(elem);
74624 if (x.check())
74625 {
74626 temp.push_back(x());
74627 }
74628 else
74629 {
74630 extract<Data> x(elem);
74631 if (x.check())
74632 {
74633 temp.push_back(x());
74634 }
74635 else
74636 {
74637 PyErr_SetString(PyExc_TypeError,
74638 "Invalid sequence element");
74639 throw_error_already_set();
74640 }
74641 }
74642 }
74643 ProxyHandler::base_replace_indexes(container, from, to,
74644 temp.end()-temp.begin());
74645 DerivedPolicies::set_slice(container, from, to,
74646 temp.begin(), temp.end());
74647 }
74648 }
74649 }
74650 static void
74651 base_delete_slice(Container& container, PySliceObject* slice)
74652 {
74653 Index from, to;
74654 base_get_slice_data(container, slice, from, to);
74655 ProxyHandler::base_erase_indexes(container, from, to);
74656 DerivedPolicies::delete_slice(container, from, to);
74657 }
74658 };
74659 template <
74660 class Container
74661 , class DerivedPolicies
74662 , class ProxyHandler
74663 , class Data
74664 , class Index
74665 >
74666 struct no_slice_helper
74667 {
74668 static void
74669 slicing_not_suported()
74670 {
74671 PyErr_SetString(PyExc_RuntimeError, "Slicing not supported");
74672 throw_error_already_set();
74673 }
74674 static object
74675 base_get_slice(Container& , PySliceObject* )
74676 {
74677 slicing_not_suported();
74678 return object();
74679 }
74680 static void
74681 base_set_slice(Container& , PySliceObject* , PyObject* )
74682 {
74683 slicing_not_suported();
74684 }
74685 static void
74686 base_delete_slice(Container& , PySliceObject* )
74687 {
74688 slicing_not_suported();
74689 }
74690 };
74691 template <class Container, class Index, class Policies>
74692 inline typename Policies::data_type*
74693 get_pointer(
74694 python::detail::container_element<Container, Index, Policies> const& p)
74695 {
74696 return p.get();
74697 }
74698 using boost::python::get_pointer;
74699 using boost::get_pointer;
74700 }}
74701 }
74702 namespace boost { namespace python {
74703 template <
74704 class Container
74705 , class DerivedPolicies
74706 , bool NoProxy = false
74707 , bool NoSlice = false
74708 , class Data = typename Container::value_type
74709 , class Index = typename Container::size_type
74710 , class Key = typename Container::value_type
74711 >
74712 class indexing_suite
74713 : public def_visitor<
74714 indexing_suite<
74715 Container
74716 , DerivedPolicies
74717 , NoProxy
74718 , NoSlice
74719 , Data
74720 , Index
74721 , Key
74722 > >
74723 {
74724 private:
74725 typedef mpl::or_<
74726 mpl::bool_<NoProxy>
74727 , mpl::not_<is_class<Data> >
74728 , typename mpl::or_<
74729 is_same<Data, std::string>
74730 , is_same<Data, std::complex<float> >
74731 , is_same<Data, std::complex<double> >
74732 , is_same<Data, std::complex<long double> > >::type>
74733 no_proxy;
74734 typedef detail::container_element<Container, Index, DerivedPolicies>
74735 container_element_t;
74736 typedef return_internal_reference<> return_policy;
74737 typedef typename mpl::if_<
74738 no_proxy
74739 , iterator<Container>
74740 , iterator<Container, return_policy> >::type
74741 def_iterator;
74742 typedef typename mpl::if_<
74743 no_proxy
74744 , detail::no_proxy_helper<
74745 Container
74746 , DerivedPolicies
74747 , container_element_t
74748 , Index>
74749 , detail::proxy_helper<
74750 Container
74751 , DerivedPolicies
74752 , container_element_t
74753 , Index> >::type
74754 proxy_handler;
74755 typedef typename mpl::if_<
74756 mpl::bool_<NoSlice>
74757 , detail::no_slice_helper<
74758 Container
74759 , DerivedPolicies
74760 , proxy_handler
74761 , Data
74762 , Index>
74763 , detail::slice_helper<
74764 Container
74765 , DerivedPolicies
74766 , proxy_handler
74767 , Data
74768 , Index> >::type
74769 slice_handler;
74770 public:
74771 template <class Class>
74772 void visit(Class& cl) const
74773 {
74774 proxy_handler::register_container_element();
74775 cl
74776 .def("__len__", base_size)
74777 .def("__setitem__", &base_set_item)
74778 .def("__delitem__", &base_delete_item)
74779 .def("__getitem__", &base_get_item)
74780 .def("__contains__", &base_contains)
74781 .def("__iter__", def_iterator())
74782 ;
74783 DerivedPolicies::extension_def(cl);
74784 }
74785 template <class Class>
74786 static void
74787 extension_def(Class& cl)
74788 {
74789 }
74790 private:
74791 static object
74792 base_get_item(back_reference<Container&> container, PyObject* i)
74793 {
74794 if (((((PyObject*)(i))->ob_type) == &PySlice_Type))
74795 return slice_handler::base_get_slice(
74796 container.get(), static_cast<PySliceObject*>(static_cast<void*>(i)));
74797 return proxy_handler::base_get_item_(container, i);
74798 }
74799 static void
74800 base_set_item(Container& container, PyObject* i, PyObject* v)
74801 {
74802 if (((((PyObject*)(i))->ob_type) == &PySlice_Type))
74803 {
74804 slice_handler::base_set_slice(container,
74805 static_cast<PySliceObject*>(static_cast<void*>(i)), v);
74806 }
74807 else
74808 {
74809 extract<Data&> elem(v);
74810 if (elem.check())
74811 {
74812 DerivedPolicies::
74813 set_item(container,
74814 DerivedPolicies::
74815 convert_index(container, i), elem());
74816 }
74817 else
74818 {
74819 extract<Data> elem(v);
74820 if (elem.check())
74821 {
74822 DerivedPolicies::
74823 set_item(container,
74824 DerivedPolicies::
74825 convert_index(container, i), elem());
74826 }
74827 else
74828 {
74829 PyErr_SetString(PyExc_TypeError, "Invalid assignment");
74830 throw_error_already_set();
74831 }
74832 }
74833 }
74834 }
74835 static void
74836 base_delete_item(Container& container, PyObject* i)
74837 {
74838 if (((((PyObject*)(i))->ob_type) == &PySlice_Type))
74839 {
74840 slice_handler::base_delete_slice(
74841 container, static_cast<PySliceObject*>(static_cast<void*>(i)));
74842 return;
74843 }
74844 Index index = DerivedPolicies::convert_index(container, i);
74845 proxy_handler::base_erase_index(container, index, mpl::bool_<NoSlice>());
74846 DerivedPolicies::delete_item(container, index);
74847 }
74848 static size_t
74849 base_size(Container& container)
74850 {
74851 return DerivedPolicies::size(container);
74852 }
74853 static bool
74854 base_contains(Container& container, PyObject* key)
74855 {
74856 extract<Key const&> x(key);
74857 if (x.check())
74858 {
74859 return DerivedPolicies::contains(container, x());
74860 }
74861 else
74862 {
74863 extract<Key> x(key);
74864 if (x.check())
74865 return DerivedPolicies::contains(container, x());
74866 else
74867 return false;
74868 }
74869 }
74870 };
74871 }}
74872
74873 namespace boost
74874 {
74875 namespace range_detail
74876 {
74877 using type_traits::yes_type;
74878 using type_traits::no_type;
74879 yes_type is_string_impl( const char* const );
74880 yes_type is_string_impl( const wchar_t* const );
74881 no_type is_string_impl( ... );
74882 template< std::size_t sz >
74883 yes_type is_char_array_impl( char (&boost_range_array)[sz] );
74884 template< std::size_t sz >
74885 yes_type is_char_array_impl( const char (&boost_range_array)[sz] );
74886 no_type is_char_array_impl( ... );
74887 template< std::size_t sz >
74888 yes_type is_wchar_t_array_impl( wchar_t (&boost_range_array)[sz] );
74889 template< std::size_t sz >
74890 yes_type is_wchar_t_array_impl( const wchar_t (&boost_range_array)[sz] );
74891 no_type is_wchar_t_array_impl( ... );
74892 yes_type is_char_ptr_impl( char* const );
74893 no_type is_char_ptr_impl( ... );
74894 yes_type is_const_char_ptr_impl( const char* const );
74895 no_type is_const_char_ptr_impl( ... );
74896 yes_type is_wchar_t_ptr_impl( wchar_t* const );
74897 no_type is_wchar_t_ptr_impl( ... );
74898 yes_type is_const_wchar_t_ptr_impl( const wchar_t* const );
74899 no_type is_const_wchar_t_ptr_impl( ... );
74900 template< typename Iterator >
74901 yes_type is_pair_impl( const std::pair<Iterator,Iterator>* );
74902 no_type is_pair_impl( ... );
74903 struct char_or_wchar_t_array_tag {};
74904 }
74905 }
74906
74907 namespace boost
74908 {
74909 namespace range_detail
74910 {
74911 typedef mpl::int_<1>::type std_container_;
74912 typedef mpl::int_<2>::type std_pair_;
74913 typedef mpl::int_<3>::type const_std_pair_;
74914 typedef mpl::int_<4>::type array_;
74915 typedef mpl::int_<5>::type const_array_;
74916 typedef mpl::int_<6>::type char_array_;
74917 typedef mpl::int_<7>::type wchar_t_array_;
74918 typedef mpl::int_<8>::type char_ptr_;
74919 typedef mpl::int_<9>::type const_char_ptr_;
74920 typedef mpl::int_<10>::type wchar_t_ptr_;
74921 typedef mpl::int_<11>::type const_wchar_t_ptr_;
74922 typedef mpl::int_<12>::type string_;
74923 template< typename C >
74924 struct range_helper
74925 {
74926 static C* c;
74927 static C ptr;
74928 static const bool is_pair_ = sizeof( boost::range_detail::is_pair_impl( c ) ) == sizeof( yes_type );
74929 static const bool is_char_ptr_ = sizeof( boost::range_detail::is_char_ptr_impl( ptr ) ) == sizeof( yes_type );
74930 static const bool is_const_char_ptr_ = sizeof( boost::range_detail::is_const_char_ptr_impl( ptr ) ) == sizeof( yes_type );
74931 static const bool is_wchar_t_ptr_ = sizeof( boost::range_detail::is_wchar_t_ptr_impl( ptr ) ) == sizeof( yes_type );
74932 static const bool is_const_wchar_t_ptr_ = sizeof( boost::range_detail::is_const_wchar_t_ptr_impl( ptr ) ) == sizeof( yes_type );
74933 static const bool is_char_array_ = sizeof( boost::range_detail::is_char_array_impl( ptr ) ) == sizeof( yes_type );
74934 static const bool is_wchar_t_array_ = sizeof( boost::range_detail::is_wchar_t_array_impl( ptr ) ) == sizeof( yes_type );
74935 static const bool is_string_ = (boost::type_traits::ice_or<is_const_char_ptr_, is_const_wchar_t_ptr_>::value );
74936 static const bool is_array_ = boost::is_array<C>::value;
74937 };
74938 template< typename C >
74939 class range
74940 {
74941 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_pair_,
74942 boost::range_detail::std_pair_,
74943 void >::type pair_t;
74944 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_array_,
74945 boost::range_detail::array_,
74946 pair_t >::type array_t;
74947 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_string_,
74948 boost::range_detail::string_,
74949 array_t >::type string_t;
74950 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_const_char_ptr_,
74951 boost::range_detail::const_char_ptr_,
74952 string_t >::type const_char_ptr_t;
74953 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_char_ptr_,
74954 boost::range_detail::char_ptr_,
74955 const_char_ptr_t >::type char_ptr_t;
74956 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_const_wchar_t_ptr_,
74957 boost::range_detail::const_wchar_t_ptr_,
74958 char_ptr_t >::type const_wchar_ptr_t;
74959 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_wchar_t_ptr_,
74960 boost::range_detail::wchar_t_ptr_,
74961 const_wchar_ptr_t >::type wchar_ptr_t;
74962 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_wchar_t_array_,
74963 boost::range_detail::wchar_t_array_,
74964 wchar_ptr_t >::type wchar_array_t;
74965 typedef typename boost::mpl::if_c< ::boost::range_detail::range_helper<C>::is_char_array_,
74966 boost::range_detail::char_array_,
74967 wchar_array_t >::type char_array_t;
74968 public:
74969 typedef typename boost::mpl::if_c< ::boost::is_void<char_array_t>::value,
74970 boost::range_detail::std_container_,
74971 char_array_t >::type type;
74972 };
74973 }
74974 }
74975
74976 namespace boost
74977 {
74978 namespace range_detail
74979 {
74980 template <typename T>
74981 inline void boost_range_silence_warning( const T& ) { }
74982 inline const char* str_end( const char* s, const char* )
74983 {
74984 return s + strlen( s );
74985 }
74986 inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
74987 {
74988 return s + wcslen( s );
74989 }
74990 template< class Char >
74991 inline Char* str_end( Char* s )
74992 {
74993 return const_cast<Char*>( str_end( s, s ) );
74994 }
74995 template< class T, std::size_t sz >
74996 inline T* array_end( T (&boost_range_array)[sz] )
74997 {
74998 return boost_range_array + sz;
74999 }
75000 template< class T, std::size_t sz >
75001 inline const T* array_end( const T (&boost_range_array)[sz] )
75002 {
75003 return boost_range_array + sz;
75004 }
75005 template< class Char >
75006 inline std::size_t str_size( const Char* const& s )
75007 {
75008 return str_end( s ) - s;
75009 }
75010 template< class T, std::size_t sz >
75011 inline std::size_t array_size( T (&boost_range_array)[sz] )
75012 {
75013 boost_range_silence_warning( boost_range_array );
75014 return sz;
75015 }
75016 template< class T, std::size_t sz >
75017 inline std::size_t array_size( const T (&boost_range_array)[sz] )
75018 {
75019 boost_range_silence_warning( boost_range_array );
75020 return sz;
75021 }
75022 }
75023 }
75024
75025 namespace boost
75026 {
75027 template< typename C >
75028 struct range_mutable_iterator
75029 {
75030 typedef typename C::iterator type;
75031 };
75032 template< typename Iterator >
75033 struct range_mutable_iterator< std::pair<Iterator,Iterator> >
75034 {
75035 typedef Iterator type;
75036 };
75037 template< typename T, std::size_t sz >
75038 struct range_mutable_iterator< T[sz] >
75039 {
75040 typedef T* type;
75041 };
75042 }
75043
75044 namespace boost
75045 {
75046 template< typename C >
75047 struct range_const_iterator
75048 {
75049 typedef typename C::const_iterator type;
75050 };
75051 template< typename Iterator >
75052 struct range_const_iterator< std::pair<Iterator,Iterator> >
75053 {
75054 typedef Iterator type;
75055 };
75056 template< typename T, std::size_t sz >
75057 struct range_const_iterator< T[sz] >
75058 {
75059 typedef const T* type;
75060 };
75061 }
75062 namespace boost
75063 {
75064 template< typename C >
75065 struct range_iterator
75066 {
75067 typedef typename
75068 mpl::eval_if_c< is_const<C>::value,
75069 range_const_iterator< typename remove_const<C>::type >,
75070 range_mutable_iterator<C> >::type type;
75071 };
75072 }
75073 namespace boost
75074 {
75075 namespace range_detail
75076 {
75077 template< typename C >
75078 inline typename range_iterator<C>::type
75079 range_end( C& c )
75080 {
75081 return c.end();
75082 }
75083 template< typename Iterator >
75084 inline Iterator range_end( const std::pair<Iterator,Iterator>& p )
75085 {
75086 return p.second;
75087 }
75088 template< typename Iterator >
75089 inline Iterator range_end( std::pair<Iterator,Iterator>& p )
75090 {
75091 return p.second;
75092 }
75093 template< typename T, std::size_t sz >
75094 inline const T* range_end( const T (&a)[sz] )
75095 {
75096 return range_detail::array_end<T,sz>( a );
75097 }
75098 template< typename T, std::size_t sz >
75099 inline T* range_end( T (&a)[sz] )
75100 {
75101 return range_detail::array_end<T,sz>( a );
75102 }
75103 }
75104 template< class T >
75105 inline typename range_iterator<T>::type end( T& r )
75106 {
75107 using namespace range_detail;
75108 return range_end( r );
75109 }
75110 template< class T >
75111 inline typename range_iterator<const T>::type end( const T& r )
75112 {
75113 using namespace range_detail;
75114 return range_end( r );
75115 }
75116 }
75117 namespace boost
75118 {
75119 template< class T >
75120 inline typename range_iterator<const T>::type
75121 const_end( const T& r )
75122 {
75123 return boost::end( r );
75124 }
75125 }
75126 namespace boost
75127 {
75128 namespace range_detail
75129 {
75130 template< typename C >
75131 inline typename range_iterator<C>::type
75132 range_begin( C& c )
75133 {
75134 return c.begin();
75135 }
75136 template< typename Iterator >
75137 inline Iterator range_begin( const std::pair<Iterator,Iterator>& p )
75138 {
75139 return p.first;
75140 }
75141 template< typename Iterator >
75142 inline Iterator range_begin( std::pair<Iterator,Iterator>& p )
75143 {
75144 return p.first;
75145 }
75146 template< typename T, std::size_t sz >
75147 inline const T* range_begin( const T (&a)[sz] )
75148 {
75149 return a;
75150 }
75151 template< typename T, std::size_t sz >
75152 inline T* range_begin( T (&a)[sz] )
75153 {
75154 return a;
75155 }
75156 }
75157 template< class T >
75158 inline typename range_iterator<T>::type begin( T& r )
75159 {
75160 using namespace range_detail;
75161 return range_begin( r );
75162 }
75163 template< class T >
75164 inline typename range_iterator<const T>::type begin( const T& r )
75165 {
75166 using namespace range_detail;
75167 return range_begin( r );
75168 }
75169 }
75170 namespace boost
75171 {
75172 template< class T >
75173 inline typename range_iterator<const T>::type
75174 const_begin( const T& r )
75175 {
75176 return boost::begin( r );
75177 }
75178 }
75179 namespace boost {
75180 struct no_traversal_tag {};
75181 struct incrementable_traversal_tag
75182 : no_traversal_tag
75183 {
75184 };
75185 struct single_pass_traversal_tag
75186 : incrementable_traversal_tag
75187 {
75188 };
75189 struct forward_traversal_tag
75190 : single_pass_traversal_tag
75191 {
75192 };
75193 struct bidirectional_traversal_tag
75194 : forward_traversal_tag
75195 {
75196 };
75197 struct random_access_traversal_tag
75198 : bidirectional_traversal_tag
75199 {
75200 };
75201 namespace detail
75202 {
75203 template <class Cat>
75204 struct old_category_to_traversal
75205 : mpl::eval_if<
75206 is_convertible<Cat,std::random_access_iterator_tag>
75207 , mpl::identity<random_access_traversal_tag>
75208 , mpl::eval_if<
75209 is_convertible<Cat,std::bidirectional_iterator_tag>
75210 , mpl::identity<bidirectional_traversal_tag>
75211 , mpl::eval_if<
75212 is_convertible<Cat,std::forward_iterator_tag>
75213 , mpl::identity<forward_traversal_tag>
75214 , mpl::eval_if<
75215 is_convertible<Cat,std::input_iterator_tag>
75216 , mpl::identity<single_pass_traversal_tag>
75217 , mpl::eval_if<
75218 is_convertible<Cat,std::output_iterator_tag>
75219 , mpl::identity<incrementable_traversal_tag>
75220 , void
75221 >
75222 >
75223 >
75224 >
75225 >
75226 {};
75227 template <class Traversal>
75228 struct pure_traversal_tag
75229 : mpl::eval_if<
75230 is_convertible<Traversal,random_access_traversal_tag>
75231 , mpl::identity<random_access_traversal_tag>
75232 , mpl::eval_if<
75233 is_convertible<Traversal,bidirectional_traversal_tag>
75234 , mpl::identity<bidirectional_traversal_tag>
75235 , mpl::eval_if<
75236 is_convertible<Traversal,forward_traversal_tag>
75237 , mpl::identity<forward_traversal_tag>
75238 , mpl::eval_if<
75239 is_convertible<Traversal,single_pass_traversal_tag>
75240 , mpl::identity<single_pass_traversal_tag>
75241 , mpl::eval_if<
75242 is_convertible<Traversal,incrementable_traversal_tag>
75243 , mpl::identity<incrementable_traversal_tag>
75244 , void
75245 >
75246 >
75247 >
75248 >
75249 >
75250 {
75251 };
75252 }
75253 template <class Cat>
75254 struct iterator_category_to_traversal
75255 : mpl::eval_if<
75256 is_convertible<Cat,incrementable_traversal_tag>
75257 , mpl::identity<Cat>
75258 , boost::detail::old_category_to_traversal<Cat>
75259 >
75260 {};
75261 template <class Iterator = mpl::_1>
75262 struct iterator_traversal
75263 : iterator_category_to_traversal<
75264 typename boost::detail::iterator_traits<Iterator>::iterator_category
75265 >
75266 {};
75267 }
75268 namespace boost
75269 {
75270 template <typename A, typename B>
75271 struct is_interoperable
75272 : mpl::or_<
75273 is_convertible< A, B >
75274 , is_convertible< B, A > >
75275 {
75276 };
75277 }
75278 namespace boost { struct use_default; }
75279 namespace boost { namespace detail {
75280 struct input_output_iterator_tag
75281 : std::input_iterator_tag
75282 {
75283 operator std::output_iterator_tag() const
75284 {
75285 return std::output_iterator_tag();
75286 }
75287 };
75288 template <class ValueParam, class Reference>
75289 struct iterator_writability_disabled
75290 : mpl::or_<
75291 is_const<Reference>
75292 , boost::detail::indirect_traits::is_reference_to_const<Reference>
75293 , is_const<ValueParam>
75294 >
75295 {};
75296 template <class Traversal, class ValueParam, class Reference>
75297 struct iterator_facade_default_category
75298 : mpl::eval_if<
75299 mpl::and_<
75300 is_reference<Reference>
75301 , is_convertible<Traversal,forward_traversal_tag>
75302 >
75303 , mpl::eval_if<
75304 is_convertible<Traversal,random_access_traversal_tag>
75305 , mpl::identity<std::random_access_iterator_tag>
75306 , mpl::if_<
75307 is_convertible<Traversal,bidirectional_traversal_tag>
75308 , std::bidirectional_iterator_tag
75309 , std::forward_iterator_tag
75310 >
75311 >
75312 , typename mpl::eval_if<
75313 mpl::and_<
75314 is_convertible<Traversal, single_pass_traversal_tag>
75315 , is_convertible<Reference, ValueParam>
75316 >
75317 , mpl::identity<std::input_iterator_tag>
75318 , mpl::identity<Traversal>
75319 >
75320 >
75321 {
75322 };
75323 template <class T>
75324 struct is_iterator_category
75325 : mpl::or_<
75326 is_convertible<T,std::input_iterator_tag>
75327 , is_convertible<T,std::output_iterator_tag>
75328 >
75329 {
75330 };
75331 template <class T>
75332 struct is_iterator_traversal
75333 : is_convertible<T,incrementable_traversal_tag>
75334 {};
75335 template <class Category, class Traversal>
75336 struct iterator_category_with_traversal
75337 : Category, Traversal
75338 {
75339 enum { mpl_assertion_in_line_149 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) ( is_convertible< typename iterator_category_to_traversal<Category>::type , Traversal >))0, 1 ) ) ) }
75340 ;
75341 enum { mpl_assertion_in_line_151 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_arg( (void (*) (is_iterator_category<Category>))0, 1 ) ) ) };
75342 enum { mpl_assertion_in_line_152 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (is_iterator_category<Traversal>))0, 1 ) ) ) };
75343 enum { mpl_assertion_in_line_153 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (is_iterator_traversal<Category>))0, 1 ) ) ) };
75344 enum { mpl_assertion_in_line_155 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_arg( (void (*) (is_iterator_traversal<Traversal>))0, 1 ) ) ) };
75345 };
75346 template <class Traversal, class ValueParam, class Reference>
75347 struct facade_iterator_category_impl
75348 {
75349 enum { mpl_assertion_in_line_166 = sizeof( boost::mpl::assertion_failed<false>( boost::mpl::assert_not_arg( (void (*) (is_iterator_category<Traversal>))0, 1 ) ) ) };
75350 typedef typename iterator_facade_default_category<
75351 Traversal,ValueParam,Reference
75352 >::type category;
75353 typedef typename mpl::if_<
75354 is_same<
75355 Traversal
75356 , typename iterator_category_to_traversal<category>::type
75357 >
75358 , category
75359 , iterator_category_with_traversal<category,Traversal>
75360 >::type type;
75361 };
75362 template <class CategoryOrTraversal, class ValueParam, class Reference>
75363 struct facade_iterator_category
75364 : mpl::eval_if<
75365 is_iterator_category<CategoryOrTraversal>
75366 , mpl::identity<CategoryOrTraversal>
75367 , facade_iterator_category_impl<CategoryOrTraversal,ValueParam,Reference>
75368 >
75369 {
75370 };
75371 }}
75372 namespace boost { namespace mpl {
75373 template< typename Value > struct always
75374 {
75375 template<
75376 typename T
75377 , typename T2 =na , typename T3 =na , typename T4 =na , typename T5 =na
75378 >
75379 struct apply
75380 {
75381 typedef Value type;
75382 };
75383 };
75384 }}
75385 namespace boost
75386 {
75387 template <class I, class V, class TC, class R, class D> class iterator_facade;
75388 namespace detail
75389 {
75390 struct always_bool2
75391 {
75392 template <class T, class U>
75393 struct apply
75394 {
75395 typedef bool type;
75396 };
75397 };
75398 template <
75399 class Facade1
75400 , class Facade2
75401 , class Return
75402 >
75403 struct enable_if_interoperable
75404 : ::boost::iterators::enable_if<
75405 mpl::or_<
75406 is_convertible<Facade1, Facade2>
75407 , is_convertible<Facade2, Facade1>
75408 >
75409 , Return
75410 >
75411 {};
75412 template <
75413 class ValueParam
75414 , class CategoryOrTraversal
75415 , class Reference
75416 , class Difference
75417 >
75418 struct iterator_facade_types
75419 {
75420 typedef typename facade_iterator_category<
75421 CategoryOrTraversal, ValueParam, Reference
75422 >::type iterator_category;
75423 typedef typename remove_const<ValueParam>::type value_type;
75424 typedef typename mpl::eval_if<
75425 boost::detail::iterator_writability_disabled<ValueParam,Reference>
75426 , add_pointer<const value_type>
75427 , add_pointer<value_type>
75428 >::type pointer;
75429 };
75430 template <class Iterator>
75431 class postfix_increment_proxy
75432 {
75433 typedef typename iterator_value<Iterator>::type value_type;
75434 public:
75435 explicit postfix_increment_proxy(Iterator const& x)
75436 : stored_value(*x)
75437 {}
75438 value_type&
75439 operator*() const
75440 {
75441 return this->stored_value;
75442 }
75443 private:
75444 mutable value_type stored_value;
75445 };
75446 template <class Iterator>
75447 class writable_postfix_increment_proxy
75448 {
75449 typedef typename iterator_value<Iterator>::type value_type;
75450 public:
75451 explicit writable_postfix_increment_proxy(Iterator const& x)
75452 : stored_value(*x)
75453 , stored_iterator(x)
75454 {}
75455 writable_postfix_increment_proxy const&
75456 operator*() const
75457 {
75458 return *this;
75459 }
75460 operator value_type&() const
75461 {
75462 return stored_value;
75463 }
75464 template <class T>
75465 T const& operator=(T const& x) const
75466 {
75467 *this->stored_iterator = x;
75468 return x;
75469 }
75470 template <class T>
75471 T& operator=(T& x) const
75472 {
75473 *this->stored_iterator = x;
75474 return x;
75475 }
75476 operator Iterator const&() const
75477 {
75478 return stored_iterator;
75479 }
75480 private:
75481 mutable value_type stored_value;
75482 Iterator stored_iterator;
75483 };
75484 template <class Reference, class Value>
75485 struct is_non_proxy_reference
75486 : is_convertible<
75487 typename remove_reference<Reference>::type
75488 const volatile*
75489 , Value const volatile*
75490 >
75491 {};
75492 template <class Iterator, class Value, class Reference, class CategoryOrTraversal>
75493 struct postfix_increment_result
75494 : mpl::eval_if<
75495 mpl::and_<
75496 is_convertible<Reference,Value const&>
75497 , mpl::not_<
75498 is_convertible<
75499 typename iterator_category_to_traversal<CategoryOrTraversal>::type
75500 , forward_traversal_tag
75501 >
75502 >
75503 >
75504 , mpl::if_<
75505 is_non_proxy_reference<Reference,Value>
75506 , postfix_increment_proxy<Iterator>
75507 , writable_postfix_increment_proxy<Iterator>
75508 >
75509 , mpl::identity<Iterator>
75510 >
75511 {};
75512 template <class T>
75513 struct operator_arrow_proxy
75514 {
75515 operator_arrow_proxy(T const* px) : m_value(*px) {}
75516 T* operator->() const { return &m_value; }
75517 operator T*() const { return &m_value; }
75518 mutable T m_value;
75519 };
75520 template <class ValueType, class Reference, class Pointer>
75521 struct operator_arrow_result
75522 {
75523 typedef typename mpl::if_<
75524 is_reference<Reference>
75525 , Pointer
75526 , operator_arrow_proxy<ValueType>
75527 >::type type;
75528 static type make(Reference x)
75529 {
75530 return implicit_cast<type>(&x);
75531 }
75532 };
75533 template <class Iterator>
75534 class operator_brackets_proxy
75535 {
75536 typedef typename Iterator::reference reference;
75537 typedef typename Iterator::value_type value_type;
75538 public:
75539 operator_brackets_proxy(Iterator const& iter)
75540 : m_iter(iter)
75541 {}
75542 operator reference() const
75543 {
75544 return *m_iter;
75545 }
75546 operator_brackets_proxy& operator=(value_type const& val)
75547 {
75548 *m_iter = val;
75549 return *this;
75550 }
75551 private:
75552 Iterator m_iter;
75553 };
75554 template <class ValueType, class Reference>
75555 struct use_operator_brackets_proxy
75556 : mpl::not_<
75557 mpl::and_<
75558 boost::is_POD<ValueType>
75559 , iterator_writability_disabled<ValueType,Reference>
75560 >
75561 >
75562 {};
75563 template <class Iterator, class Value, class Reference>
75564 struct operator_brackets_result
75565 {
75566 typedef typename mpl::if_<
75567 use_operator_brackets_proxy<Value,Reference>
75568 , operator_brackets_proxy<Iterator>
75569 , Value
75570 >::type type;
75571 };
75572 template <class Iterator>
75573 operator_brackets_proxy<Iterator> make_operator_brackets_result(Iterator const& iter, mpl::true_)
75574 {
75575 return operator_brackets_proxy<Iterator>(iter);
75576 }
75577 template <class Iterator>
75578 typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::false_)
75579 {
75580 return *iter;
75581 }
75582 struct choose_difference_type
75583 {
75584 template <class I1, class I2>
75585 struct apply
75586 :
75587 mpl::eval_if<
75588 is_convertible<I2,I1>
75589 , iterator_difference<I1>
75590 , iterator_difference<I2>
75591 >
75592 {};
75593 };
75594 }
75595 class iterator_core_access
75596 {
75597 template <class I, class V, class TC, class R, class D> friend class iterator_facade;
75598 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator ==( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs);
75599 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator !=( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs);
75600 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator <( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs);
75601 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator >( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs);
75602 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator <=( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs);
75603 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator >=( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs);
75604 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > friend typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::choose_difference_type,Derived1,Derived2>::type >::type operator -( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs)
75605 ;
75606 template <class Derived, class V, class TC, class R, class D> friend inline Derived operator+ (iterator_facade<Derived, V, TC, R, D> const& , typename Derived::difference_type)
75607 ;
75608 template <class Derived, class V, class TC, class R, class D> friend inline Derived operator+ (typename Derived::difference_type , iterator_facade<Derived, V, TC, R, D> const&)
75609 ;
75610 template <class Facade>
75611 static typename Facade::reference dereference(Facade const& f)
75612 {
75613 return f.dereference();
75614 }
75615 template <class Facade>
75616 static void increment(Facade& f)
75617 {
75618 f.increment();
75619 }
75620 template <class Facade>
75621 static void decrement(Facade& f)
75622 {
75623 f.decrement();
75624 }
75625 template <class Facade1, class Facade2>
75626 static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::true_)
75627 {
75628 return f1.equal(f2);
75629 }
75630 template <class Facade1, class Facade2>
75631 static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::false_)
75632 {
75633 return f2.equal(f1);
75634 }
75635 template <class Facade>
75636 static void advance(Facade& f, typename Facade::difference_type n)
75637 {
75638 f.advance(n);
75639 }
75640 template <class Facade1, class Facade2>
75641 static typename Facade1::difference_type distance_from(
75642 Facade1 const& f1, Facade2 const& f2, mpl::true_)
75643 {
75644 return -f1.distance_to(f2);
75645 }
75646 template <class Facade1, class Facade2>
75647 static typename Facade2::difference_type distance_from(
75648 Facade1 const& f1, Facade2 const& f2, mpl::false_)
75649 {
75650 return f2.distance_to(f1);
75651 }
75652 template <class I, class V, class TC, class R, class D>
75653 static I& derived(iterator_facade<I,V,TC,R,D>& facade)
75654 {
75655 return *static_cast<I*>(&facade);
75656 }
75657 template <class I, class V, class TC, class R, class D>
75658 static I const& derived(iterator_facade<I,V,TC,R,D> const& facade)
75659 {
75660 return *static_cast<I const*>(&facade);
75661 }
75662 private:
75663 iterator_core_access();
75664 };
75665 template <
75666 class Derived
75667 , class Value
75668 , class CategoryOrTraversal
75669 , class Reference = Value&
75670 , class Difference = std::ptrdiff_t
75671 >
75672 class iterator_facade
75673 {
75674 private:
75675 Derived& derived()
75676 {
75677 return *static_cast<Derived*>(this);
75678 }
75679 Derived const& derived() const
75680 {
75681 return *static_cast<Derived const*>(this);
75682 }
75683 typedef boost::detail::iterator_facade_types<
75684 Value, CategoryOrTraversal, Reference, Difference
75685 > associated_types;
75686 protected:
75687 typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
75688 public:
75689 typedef typename associated_types::value_type value_type;
75690 typedef Reference reference;
75691 typedef Difference difference_type;
75692 typedef typename associated_types::pointer pointer;
75693 typedef typename associated_types::iterator_category iterator_category;
75694 reference operator*() const
75695 {
75696 return iterator_core_access::dereference(this->derived());
75697 }
75698 typename boost::detail::operator_arrow_result<
75699 value_type
75700 , reference
75701 , pointer
75702 >::type
75703 operator->() const
75704 {
75705 return boost::detail::operator_arrow_result<
75706 value_type
75707 , reference
75708 , pointer
75709 >::make(*this->derived());
75710 }
75711 typename boost::detail::operator_brackets_result<Derived,Value,reference>::type
75712 operator[](difference_type n) const
75713 {
75714 typedef boost::detail::use_operator_brackets_proxy<Value,Reference> use_proxy;
75715 return boost::detail::make_operator_brackets_result<Derived>(
75716 this->derived() + n
75717 , use_proxy()
75718 );
75719 }
75720 Derived& operator++()
75721 {
75722 iterator_core_access::increment(this->derived());
75723 return this->derived();
75724 }
75725 Derived& operator--()
75726 {
75727 iterator_core_access::decrement(this->derived());
75728 return this->derived();
75729 }
75730 Derived operator--(int)
75731 {
75732 Derived tmp(this->derived());
75733 --*this;
75734 return tmp;
75735 }
75736 Derived& operator+=(difference_type n)
75737 {
75738 iterator_core_access::advance(this->derived(), n);
75739 return this->derived();
75740 }
75741 Derived& operator-=(difference_type n)
75742 {
75743 iterator_core_access::advance(this->derived(), -n);
75744 return this->derived();
75745 }
75746 Derived operator-(difference_type x) const
75747 {
75748 Derived result(this->derived());
75749 return result -= x;
75750 }
75751 };
75752 template <class I, class V, class TC, class R, class D>
75753 inline typename boost::detail::postfix_increment_result<I,V,R,TC>::type
75754 operator++(
75755 iterator_facade<I,V,TC,R,D>& i
75756 , int
75757 )
75758 {
75759 typename boost::detail::postfix_increment_result<I,V,R,TC>::type
75760 tmp(*static_cast<I*>(&i));
75761 ++i;
75762 return tmp;
75763 }
75764 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator ==( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)> boost_static_assert_typedef_836; return iterator_core_access::equal( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75765 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator !=( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)> boost_static_assert_typedef_837; return ! iterator_core_access::equal( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75766 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator <( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)> boost_static_assert_typedef_839; return 0 > iterator_core_access::distance_from( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75767 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator >( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)> boost_static_assert_typedef_840; return 0 < iterator_core_access::distance_from( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75768 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator <=( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)> boost_static_assert_typedef_841; return 0 >= iterator_core_access::distance_from( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75769 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::always_bool2,Derived1,Derived2>::type >::type operator >=( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)> boost_static_assert_typedef_842; return 0 <= iterator_core_access::distance_from( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75770 template < class Derived1, class V1, class TC1, class Reference1, class Difference1 , class Derived2, class V2, class TC2, class Reference2, class Difference2 > inline typename boost::detail::enable_if_interoperable< Derived1, Derived2 , typename mpl::apply2<boost::detail::choose_difference_type,Derived1,Derived2>::type >::type operator -( iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) { typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((( is_interoperable< Derived1, Derived2 >::value )) == 0 ? false : true) >)>
75771 boost_static_assert_typedef_851
75772 ; return iterator_core_access::distance_from( *static_cast<Derived1 const*>(&lhs) , *static_cast<Derived2 const*>(&rhs) , is_convertible<Derived2,Derived1>() ); }
75773 template <class Derived, class V, class TC, class R, class D> inline Derived operator+ ( iterator_facade<Derived, V, TC, R, D> const& i , typename Derived::difference_type n ) { Derived tmp(static_cast<Derived const&>(i)); return tmp += n; }
75774 template <class Derived, class V, class TC, class R, class D> inline Derived operator+ ( typename Derived::difference_type n , iterator_facade<Derived, V, TC, R, D> const& i ) { Derived tmp(static_cast<Derived const&>(i)); return tmp += n; }
75775 }
75776 namespace boost
75777 {
75778 struct use_default;
75779 template<class To>
75780 struct is_convertible<use_default,To>
75781 : mpl::false_ {};
75782 namespace detail
75783 {
75784 struct enable_type;
75785 }
75786 template<typename From, typename To>
75787 struct enable_if_convertible
75788 : iterators::enable_if<
75789 is_convertible<From, To>
75790 , boost::detail::enable_type
75791 >
75792 {};
75793 namespace detail
75794 {
75795 template <class T, class DefaultNullaryFn>
75796 struct ia_dflt_help
75797 : mpl::eval_if<
75798 is_same<T, use_default>
75799 , DefaultNullaryFn
75800 , mpl::identity<T>
75801 >
75802 {
75803 };
75804 template <
75805 class Derived
75806 , class Base
75807 , class Value
75808 , class Traversal
75809 , class Reference
75810 , class Difference
75811 >
75812 struct iterator_adaptor_base
75813 {
75814 typedef iterator_facade<
75815 Derived
75816 , typename boost::detail::ia_dflt_help<
75817 Value
75818 , mpl::eval_if<
75819 is_same<Reference,use_default>
75820 , iterator_value<Base>
75821 , remove_reference<Reference>
75822 >
75823 >::type
75824 , typename boost::detail::ia_dflt_help<
75825 Traversal
75826 , iterator_traversal<Base>
75827 >::type
75828 , typename boost::detail::ia_dflt_help<
75829 Reference
75830 , mpl::eval_if<
75831 is_same<Value,use_default>
75832 , iterator_reference<Base>
75833 , add_reference<Value>
75834 >
75835 >::type
75836 , typename boost::detail::ia_dflt_help<
75837 Difference, iterator_difference<Base>
75838 >::type
75839 >
75840 type;
75841 };
75842 template <class Tr1, class Tr2>
75843 inline void iterator_adaptor_assert_traversal ()
75844 {
75845 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< (((is_convertible<Tr1, Tr2>::value)) == 0 ? false : true) >)> boost_static_assert_typedef_230;
75846 }
75847 }
75848 template <
75849 class Derived
75850 , class Base
75851 , class Value = use_default
75852 , class Traversal = use_default
75853 , class Reference = use_default
75854 , class Difference = use_default
75855 >
75856 class iterator_adaptor
75857 : public boost::detail::iterator_adaptor_base<
75858 Derived, Base, Value, Traversal, Reference, Difference
75859 >::type
75860 {
75861 friend class iterator_core_access;
75862 protected:
75863 typedef typename boost::detail::iterator_adaptor_base<
75864 Derived, Base, Value, Traversal, Reference, Difference
75865 >::type super_t;
75866 public:
75867 iterator_adaptor() {}
75868 explicit iterator_adaptor(Base const &iter)
75869 : m_iterator(iter)
75870 {
75871 }
75872 typedef Base base_type;
75873 Base const& base() const
75874 { return m_iterator; }
75875 protected:
75876 typedef iterator_adaptor<Derived,Base,Value,Traversal,Reference,Difference> iterator_adaptor_;
75877 Base const& base_reference() const
75878 { return m_iterator; }
75879 Base& base_reference()
75880 { return m_iterator; }
75881 private:
75882 typename super_t::reference dereference() const
75883 { return *m_iterator; }
75884 template <
75885 class OtherDerived, class OtherIterator, class V, class C, class R, class D
75886 >
75887 bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const
75888 {
75889 return m_iterator == x.base();
75890 }
75891 typedef typename iterator_category_to_traversal<
75892 typename super_t::iterator_category
75893 >::type my_traversal;
75894 void advance(typename super_t::difference_type n)
75895 {
75896 boost::detail::iterator_adaptor_assert_traversal<my_traversal, random_access_traversal_tag>();
75897 m_iterator += n;
75898 }
75899 void increment() { ++m_iterator; }
75900 void decrement()
75901 {
75902 boost::detail::iterator_adaptor_assert_traversal<my_traversal, bidirectional_traversal_tag>();
75903 --m_iterator;
75904 }
75905 template <
75906 class OtherDerived, class OtherIterator, class V, class C, class R, class D
75907 >
75908 typename super_t::difference_type distance_to(
75909 iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const
75910 {
75911 boost::detail::iterator_adaptor_assert_traversal<my_traversal, random_access_traversal_tag>();
75912 return y.base() - m_iterator;
75913 }
75914 private:
75915 Base m_iterator;
75916 };
75917 }
75918 namespace boost
75919 {
75920 template <class Iterator>
75921 class reverse_iterator
75922 : public iterator_adaptor< reverse_iterator<Iterator>, Iterator >
75923 {
75924 typedef iterator_adaptor< reverse_iterator<Iterator>, Iterator > super_t;
75925 friend class iterator_core_access;
75926 public:
75927 reverse_iterator() {}
75928 explicit reverse_iterator(Iterator x)
75929 : super_t(x) {}
75930 template<class OtherIterator>
75931 reverse_iterator(
75932 reverse_iterator<OtherIterator> const& r
75933 , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
75934 )
75935 : super_t(r.base())
75936 {}
75937 private:
75938 typename super_t::reference dereference() const { return *boost::prior(this->base()); }
75939 void increment() { --this->base_reference(); }
75940 void decrement() { ++this->base_reference(); }
75941 void advance(typename super_t::difference_type n)
75942 {
75943 this->base_reference() += -n;
75944 }
75945 template <class OtherIterator>
75946 typename super_t::difference_type
75947 distance_to(reverse_iterator<OtherIterator> const& y) const
75948 {
75949 return this->base_reference() - y.base();
75950 }
75951 };
75952 template <class BidirectionalIterator>
75953 reverse_iterator<BidirectionalIterator> make_reverse_iterator(BidirectionalIterator x)
75954 {
75955 return reverse_iterator<BidirectionalIterator>(x);
75956 }
75957 }
75958 namespace boost
75959 {
75960 template< typename C >
75961 struct range_reverse_iterator
75962 {
75963 typedef reverse_iterator<
75964 typename range_iterator<C>::type > type;
75965 };
75966 }
75967 namespace boost
75968 {
75969 template< class C >
75970 inline typename range_reverse_iterator<C>::type
75971 rend( C& c )
75972 {
75973 typedef typename range_reverse_iterator<C>::type
75974 iter_type;
75975 return iter_type( boost::begin( c ) );
75976 }
75977 template< class C >
75978 inline typename range_reverse_iterator<const C>::type
75979 rend( const C& c )
75980 {
75981 typedef typename range_reverse_iterator<const C>::type
75982 iter_type;
75983 return iter_type( boost::begin( c ) );
75984 }
75985 template< class T >
75986 inline typename range_reverse_iterator<const T>::type
75987 const_rend( const T& r )
75988 {
75989 return boost::rend( r );
75990 }
75991 }
75992 namespace boost
75993 {
75994 template< class C >
75995 inline typename range_reverse_iterator<C>::type
75996 rbegin( C& c )
75997 {
75998 typedef typename range_reverse_iterator<C>::type
75999 iter_type;
76000 return iter_type( boost::end( c ) );
76001 }
76002 template< class C >
76003 inline typename range_reverse_iterator<const C>::type
76004 rbegin( const C& c )
76005 {
76006 typedef typename range_reverse_iterator<const C>::type
76007 iter_type;
76008 return iter_type( boost::end( c ) );
76009 }
76010 template< class T >
76011 inline typename range_reverse_iterator<const T>::type
76012 const_rbegin( const T& r )
76013 {
76014 return boost::rbegin( r );
76015 }
76016 }
76017 enum boost_foreach_argument_dependent_lookup_hack
76018 {
76019 boost_foreach_argument_dependent_lookup_hack_value
76020 };
76021 namespace boost
76022 {
76023 template<typename T>
76024 class iterator_range;
76025 template<typename T>
76026 class sub_range;
76027 namespace
76028 Q_FOREACH
76029 {
76030 template<typename T>
76031 inline std::pair<T, T> in_range(T begin, T end)
76032 {
76033 return std::make_pair(begin, end);
76034 }
76035 typedef boost_foreach_argument_dependent_lookup_hack tag;
76036 template<typename T>
76037 struct is_lightweight_proxy
76038 : boost::mpl::false_
76039 {
76040 };
76041 template<typename T>
76042 struct is_noncopyable
76043 : boost::mpl::or_<
76044 boost::is_abstract<T>
76045 , boost::is_base_and_derived<boost::noncopyable, T>
76046 >
76047 {
76048 };
76049 }
76050 }
76051 template<typename T>
76052 inline boost::
76053 Q_FOREACH
76054 ::is_lightweight_proxy<T> *
76055 boost_foreach_is_lightweight_proxy(T *&, boost::
76056 Q_FOREACH
76057 ::tag) { return 0; }
76058 template<typename T>
76059 inline boost::mpl::true_ *
76060 boost_foreach_is_lightweight_proxy(std::pair<T, T> *&, boost::
76061 Q_FOREACH
76062 ::tag) { return 0; }
76063 template<typename T>
76064 inline boost::mpl::true_ *
76065 boost_foreach_is_lightweight_proxy(boost::iterator_range<T> *&, boost::
76066 Q_FOREACH
76067 ::tag) { return 0; }
76068 template<typename T>
76069 inline boost::mpl::true_ *
76070 boost_foreach_is_lightweight_proxy(boost::sub_range<T> *&, boost::
76071 Q_FOREACH
76072 ::tag) { return 0; }
76073 template<typename T>
76074 inline boost::mpl::true_ *
76075 boost_foreach_is_lightweight_proxy(T **&, boost::
76076 Q_FOREACH
76077 ::tag) { return 0; }
76078 template<typename T>
76079 inline boost::
76080 Q_FOREACH
76081 ::is_noncopyable<T> *
76082 boost_foreach_is_noncopyable(T *&, boost::
76083 Q_FOREACH
76084 ::tag) { return 0; }
76085 namespace boost
76086 {
76087 namespace foreach_detail_
76088 {
76089 template<typename Bool1, typename Bool2>
76090 inline boost::mpl::and_<Bool1, Bool2> *and_(Bool1 *, Bool2 *) { return 0; }
76091 template<typename Bool1, typename Bool2, typename Bool3>
76092 inline boost::mpl::and_<Bool1, Bool2, Bool3> *and_(Bool1 *, Bool2 *, Bool3 *) { return 0; }
76093 template<typename Bool1, typename Bool2>
76094 inline boost::mpl::or_<Bool1, Bool2> *or_(Bool1 *, Bool2 *) { return 0; }
76095 template<typename Bool1, typename Bool2, typename Bool3>
76096 inline boost::mpl::or_<Bool1, Bool2, Bool3> *or_(Bool1 *, Bool2 *, Bool3 *) { return 0; }
76097 template<typename Bool1>
76098 inline boost::mpl::not_<Bool1> *not_(Bool1 *) { return 0; }
76099 template<typename T>
76100 inline boost::mpl::false_ *is_rvalue_(T &, int) { return 0; }
76101 template<typename T>
76102 inline boost::mpl::true_ *is_rvalue_(T const &, ...) { return 0; }
76103 template<typename T>
76104 inline boost::is_array<T> *is_array_(T const &) { return 0; }
76105 template<typename T>
76106 inline boost::is_const<T> *is_const_(T &) { return 0; }
76107 template<typename T>
76108 inline boost::mpl::true_ *is_const_(T const &) { return 0; }
76109 struct auto_any_base
76110 {
76111 operator bool() const
76112 {
76113 return false;
76114 }
76115 };
76116 template<typename T>
76117 struct auto_any : auto_any_base
76118 {
76119 auto_any(T const &t)
76120 : item(t)
76121 {
76122 }
76123 mutable T item;
76124 };
76125 typedef auto_any_base const &auto_any_t;
76126 template<typename T, typename C>
76127 inline typename boost::mpl::if_<C, T const, T>::type &auto_any_cast(auto_any_t a)
76128 {
76129 return static_cast<auto_any<T> const &>(a).item;
76130 }
76131 typedef boost::mpl::true_ const_;
76132 template<typename T, typename C = boost::mpl::false_>
76133 struct type2type
76134 : boost::mpl::if_<C, T const, T>
76135 {
76136 };
76137 template<typename T>
76138 struct wrap_cstr
76139 {
76140 typedef T type;
76141 };
76142 template<>
76143 struct wrap_cstr<char *>
76144 {
76145 typedef wrap_cstr<char *> type;
76146 typedef char *iterator;
76147 typedef char *const_iterator;
76148 };
76149 template<>
76150 struct wrap_cstr<char const *>
76151 {
76152 typedef wrap_cstr<char const *> type;
76153 typedef char const *iterator;
76154 typedef char const *const_iterator;
76155 };
76156 template<>
76157 struct wrap_cstr<wchar_t *>
76158 {
76159 typedef wrap_cstr<wchar_t *> type;
76160 typedef wchar_t *iterator;
76161 typedef wchar_t *const_iterator;
76162 };
76163 template<>
76164 struct wrap_cstr<wchar_t const *>
76165 {
76166 typedef wrap_cstr<wchar_t const *> type;
76167 typedef wchar_t const *iterator;
76168 typedef wchar_t const *const_iterator;
76169 };
76170 template<typename T>
76171 struct is_char_array
76172 : mpl::and_<
76173 is_array<T>
76174 , mpl::or_<
76175 is_convertible<T, char const *>
76176 , is_convertible<T, wchar_t const *>
76177 >
76178 >
76179 {};
76180 template<typename T, typename C = boost::mpl::false_>
76181 struct foreach_iterator
76182 {
76183 struct IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING; typedef struct IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING352 : boost::mpl::assert_ { static boost::mpl::failed ************ (IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING::************ assert_arg()) (T&) { return 0; } } mpl_assert_arg352; enum { mpl_assertion_in_line_352 = sizeof( boost::mpl::assertion_failed<((!is_char_array<T>::value))>( mpl_assert_arg352::assert_arg() ) ) };
76184 typedef typename wrap_cstr<T>::type container;
76185 typedef typename boost::mpl::eval_if<
76186 C
76187 , range_const_iterator<container>
76188 , range_mutable_iterator<container>
76189 >::type type;
76190 };
76191 template<typename T, typename C = boost::mpl::false_>
76192 struct foreach_reverse_iterator
76193 {
76194 struct IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING; typedef struct IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING383 : boost::mpl::assert_ { static boost::mpl::failed ************ (IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING::************ assert_arg()) (T&) { return 0; } } mpl_assert_arg383; enum { mpl_assertion_in_line_383 = sizeof( boost::mpl::assertion_failed<((!is_char_array<T>::value))>( mpl_assert_arg383::assert_arg() ) ) };
76195 typedef typename wrap_cstr<T>::type container;
76196 typedef typename boost::mpl::eval_if<
76197 C
76198 , range_reverse_iterator<container const>
76199 , range_reverse_iterator<container>
76200 >::type type;
76201 };
76202 template<typename T, typename C = boost::mpl::false_>
76203 struct foreach_reference
76204 : iterator_reference<typename foreach_iterator<T, C>::type>
76205 {
76206 };
76207 template<typename T>
76208 inline type2type<T> *encode_type(T &, boost::mpl::false_ *) { return 0; }
76209 template<typename T>
76210 inline type2type<T, const_> *encode_type(T const &, boost::mpl::true_ *) { return 0; }
76211 inline bool set_false(bool &b)
76212 {
76213 b = false;
76214 return false;
76215 }
76216 template<typename T>
76217 inline T *&to_ptr(T const &)
76218 {
76219 static T *t = 0;
76220 return t;
76221 }
76222 template<typename T>
76223 inline T &derefof(T *t)
76224 {
76225 return reinterpret_cast<T &>(
76226 *const_cast<char *>(
76227 reinterpret_cast<char const volatile *>(t)
76228 )
76229 );
76230 }
76231 template<typename T>
76232 struct rvalue_probe
76233 {
76234 struct private_type_ {};
76235 typedef typename boost::mpl::if_<
76236 boost::mpl::or_<boost::is_abstract<T>, boost::is_array<T> >, private_type_, T
76237 >::type value_type;
76238 operator value_type() { return *reinterpret_cast<value_type *>(this); }
76239 operator T &() const { return *reinterpret_cast<T *>(const_cast<rvalue_probe *>(this)); }
76240 };
76241 template<typename T>
76242 rvalue_probe<T> const make_probe(T const &)
76243 {
76244 return rvalue_probe<T>();
76245 }
76246 template<typename T>
76247 inline auto_any<T> contain(T const &t, boost::mpl::true_ *)
76248 {
76249 return t;
76250 }
76251 template<typename T>
76252 inline auto_any<T *> contain(T &t, boost::mpl::false_ *)
76253 {
76254 return boost::addressof(t);
76255 }
76256 template<typename T, typename C>
76257 inline auto_any<typename foreach_iterator<T, C>::type>
76258 begin(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *)
76259 {
76260 return boost::begin(auto_any_cast<T, C>(col));
76261 }
76262 template<typename T, typename C>
76263 inline auto_any<typename foreach_iterator<T, C>::type>
76264 begin(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *)
76265 {
76266 typedef typename type2type<T, C>::type type;
76267 typedef typename foreach_iterator<T, C>::type iterator;
76268 return iterator(boost::begin(derefof(auto_any_cast<type *, boost::mpl::false_>(col))));
76269 }
76270 template<typename T, typename C>
76271 inline auto_any<T *>
76272 begin(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *)
76273 {
76274 return auto_any_cast<T *, boost::mpl::false_>(col);
76275 }
76276 template<typename T, typename C>
76277 inline auto_any<typename foreach_iterator<T, C>::type>
76278 end(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *)
76279 {
76280 return boost::end(auto_any_cast<T, C>(col));
76281 }
76282 template<typename T, typename C>
76283 inline auto_any<typename foreach_iterator<T, C>::type>
76284 end(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *)
76285 {
76286 typedef typename type2type<T, C>::type type;
76287 typedef typename foreach_iterator<T, C>::type iterator;
76288 return iterator(boost::end(derefof(auto_any_cast<type *, boost::mpl::false_>(col))));
76289 }
76290 template<typename T, typename C>
76291 inline auto_any<int>
76292 end(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *)
76293 {
76294 return 0;
76295 }
76296 template<typename T, typename C>
76297 inline bool done(auto_any_t cur, auto_any_t end, type2type<T, C> *)
76298 {
76299 typedef typename foreach_iterator<T, C>::type iter_t;
76300 return auto_any_cast<iter_t, boost::mpl::false_>(cur) == auto_any_cast<iter_t, boost::mpl::false_>(end);
76301 }
76302 template<typename T, typename C>
76303 inline bool done(auto_any_t cur, auto_any_t, type2type<T *, C> *)
76304 {
76305 return ! *auto_any_cast<T *, boost::mpl::false_>(cur);
76306 }
76307 template<typename T, typename C>
76308 inline void next(auto_any_t cur, type2type<T, C> *)
76309 {
76310 typedef typename foreach_iterator<T, C>::type iter_t;
76311 ++auto_any_cast<iter_t, boost::mpl::false_>(cur);
76312 }
76313 template<typename T, typename C>
76314 inline typename foreach_reference<T, C>::type
76315 deref(auto_any_t cur, type2type<T, C> *)
76316 {
76317 typedef typename foreach_iterator<T, C>::type iter_t;
76318 return *auto_any_cast<iter_t, boost::mpl::false_>(cur);
76319 }
76320 template<typename T, typename C>
76321 inline auto_any<typename foreach_reverse_iterator<T, C>::type>
76322 rbegin(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *)
76323 {
76324 return boost::rbegin(auto_any_cast<T, C>(col));
76325 }
76326 template<typename T, typename C>
76327 inline auto_any<typename foreach_reverse_iterator<T, C>::type>
76328 rbegin(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *)
76329 {
76330 typedef typename type2type<T, C>::type type;
76331 typedef typename foreach_reverse_iterator<T, C>::type iterator;
76332 return iterator(boost::rbegin(derefof(auto_any_cast<type *, boost::mpl::false_>(col))));
76333 }
76334 template<typename T, typename C>
76335 inline auto_any<reverse_iterator<T *> >
76336 rbegin(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *)
76337 {
76338 T *p = auto_any_cast<T *, boost::mpl::false_>(col);
76339 while(0 != *p)
76340 ++p;
76341 return reverse_iterator<T *>(p);
76342 }
76343 template<typename T, typename C>
76344 inline auto_any<typename foreach_reverse_iterator<T, C>::type>
76345 rend(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *)
76346 {
76347 return boost::rend(auto_any_cast<T, C>(col));
76348 }
76349 template<typename T, typename C>
76350 inline auto_any<typename foreach_reverse_iterator<T, C>::type>
76351 rend(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *)
76352 {
76353 typedef typename type2type<T, C>::type type;
76354 typedef typename foreach_reverse_iterator<T, C>::type iterator;
76355 return iterator(boost::rend(derefof(auto_any_cast<type *, boost::mpl::false_>(col))));
76356 }
76357 template<typename T, typename C>
76358 inline auto_any<reverse_iterator<T *> >
76359 rend(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *)
76360 {
76361 return reverse_iterator<T *>(auto_any_cast<T *, boost::mpl::false_>(col));
76362 }
76363 template<typename T, typename C>
76364 inline bool rdone(auto_any_t cur, auto_any_t end, type2type<T, C> *)
76365 {
76366 typedef typename foreach_reverse_iterator<T, C>::type iter_t;
76367 return auto_any_cast<iter_t, boost::mpl::false_>(cur) == auto_any_cast<iter_t, boost::mpl::false_>(end);
76368 }
76369 template<typename T, typename C>
76370 inline void rnext(auto_any_t cur, type2type<T, C> *)
76371 {
76372 typedef typename foreach_reverse_iterator<T, C>::type iter_t;
76373 ++auto_any_cast<iter_t, boost::mpl::false_>(cur);
76374 }
76375 template<typename T, typename C>
76376 inline typename foreach_reference<T, C>::type
76377 rderef(auto_any_t cur, type2type<T, C> *)
76378 {
76379 typedef typename foreach_reverse_iterator<T, C>::type iter_t;
76380 return *auto_any_cast<iter_t, boost::mpl::false_>(cur);
76381 }
76382 }
76383 }
76384 namespace boost { namespace python { namespace objects {
76385 struct stl_input_iterator_impl
76386 {
76387 stl_input_iterator_impl();
76388 stl_input_iterator_impl(boost::python::object const &ob);
76389 void increment();
76390 bool equal(stl_input_iterator_impl const &that) const;
76391 boost::python::handle<> const &current() const;
76392 private:
76393 boost::python::object it_;
76394 boost::python::handle<> ob_;
76395 };
76396 }}}
76397 namespace boost { namespace python
76398 {
76399 template<typename ValueT>
76400 struct stl_input_iterator
76401 : boost::iterator_facade<
76402 stl_input_iterator<ValueT>
76403 , ValueT
76404 , std::input_iterator_tag
76405 , ValueT
76406 >
76407 {
76408 stl_input_iterator()
76409 : impl_()
76410 {
76411 }
76412 stl_input_iterator(boost::python::object const &ob)
76413 : impl_(ob)
76414 {
76415 }
76416 private:
76417 friend class boost::iterator_core_access;
76418 void increment()
76419 {
76420 this->impl_.increment();
76421 }
76422 ValueT dereference() const
76423 {
76424 return extract<ValueT>(this->impl_.current().get())();
76425 }
76426 bool equal(stl_input_iterator<ValueT> const &that) const
76427 {
76428 return this->impl_.equal(that.impl_);
76429 }
76430 objects::stl_input_iterator_impl impl_;
76431 };
76432 }}
76433 namespace boost { namespace python { namespace container_utils {
76434 template <typename Container>
76435 void
76436 extend_container(Container& container, object l)
76437 {
76438 typedef typename Container::value_type data_type;
76439 if (boost::foreach_detail_::auto_any_t
76440 _foreach_col30
76441 = boost::foreach_detail_::contain( (std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , (true ? 0 : boost::foreach_detail_::or_( boost::foreach_detail_::and_( boost::foreach_detail_::not_(boost::foreach_detail_::is_array_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))) , (true ? 0 : boost::foreach_detail_::is_rvalue_( (true ? boost::foreach_detail_::make_probe(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) : (std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))), 0))) , boost::foreach_detail_::and_( boost::foreach_detail_::not_(boost_foreach_is_noncopyable( boost::foreach_detail_::to_ptr(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , boost_foreach_argument_dependent_lookup_hack_value)) , boost_foreach_is_lightweight_proxy( boost::foreach_detail_::to_ptr(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , boost_foreach_argument_dependent_lookup_hack_value)))))) {} else if (boost::foreach_detail_::auto_any_t
76442 _foreach_cur30
76443 = boost::foreach_detail_::begin(
76444 _foreach_col30
76445 , (true ? 0 : boost::foreach_detail_::encode_type(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ), boost::foreach_detail_::is_const_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )))) , (true ? 0 : boost::foreach_detail_::or_( boost::foreach_detail_::and_( boost::foreach_detail_::not_(boost::foreach_detail_::is_array_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))) , (true ? 0 : boost::foreach_detail_::is_rvalue_( (true ? boost::foreach_detail_::make_probe(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) : (std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))), 0))) , boost::foreach_detail_::and_( boost::foreach_detail_::not_(boost_foreach_is_noncopyable( boost::foreach_detail_::to_ptr(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , boost_foreach_argument_dependent_lookup_hack_value)) , boost_foreach_is_lightweight_proxy( boost::foreach_detail_::to_ptr(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , boost_foreach_argument_dependent_lookup_hack_value)))))) {} else if (boost::foreach_detail_::auto_any_t
76446 _foreach_end30
76447 = boost::foreach_detail_::end(
76448 _foreach_col30
76449 , (true ? 0 : boost::foreach_detail_::encode_type(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ), boost::foreach_detail_::is_const_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )))) , (true ? 0 : boost::foreach_detail_::or_( boost::foreach_detail_::and_( boost::foreach_detail_::not_(boost::foreach_detail_::is_array_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))) , (true ? 0 : boost::foreach_detail_::is_rvalue_( (true ? boost::foreach_detail_::make_probe(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) : (std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))), 0))) , boost::foreach_detail_::and_( boost::foreach_detail_::not_(boost_foreach_is_noncopyable( boost::foreach_detail_::to_ptr(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , boost_foreach_argument_dependent_lookup_hack_value)) , boost_foreach_is_lightweight_proxy( boost::foreach_detail_::to_ptr(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )) , boost_foreach_argument_dependent_lookup_hack_value)))))) {} else for (bool
76450 _foreach_continue30
76451 = true;
76452 _foreach_continue30
76453 && !boost::foreach_detail_::done(
76454 _foreach_cur30
76455 ,
76456 _foreach_end30
76457 , (true ? 0 : boost::foreach_detail_::encode_type(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ), boost::foreach_detail_::is_const_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() )))));
76458 _foreach_continue30
76459 ? boost::foreach_detail_::next(
76460 _foreach_cur30
76461 , (true ? 0 : boost::foreach_detail_::encode_type(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ), boost::foreach_detail_::is_const_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))))) : (void)0) if (boost::foreach_detail_::set_false(
76462 _foreach_continue30
76463 )) {} else for (object elem = boost::foreach_detail_::deref(
76464 _foreach_cur30
76465 , (true ? 0 : boost::foreach_detail_::encode_type(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ), boost::foreach_detail_::is_const_(std::make_pair( boost::python::stl_input_iterator<object>(l), boost::python::stl_input_iterator<object>() ))))); !
76466 _foreach_continue30
76467 ;
76468 _foreach_continue30
76469 = true)
76470 {
76471 extract<data_type const&> x(elem);
76472 if (x.check())
76473 {
76474 container.push_back(x());
76475 }
76476 else
76477 {
76478 extract<data_type> x(elem);
76479 if (x.check())
76480 {
76481 container.push_back(x());
76482 }
76483 else
76484 {
76485 PyErr_SetString(PyExc_TypeError, "Incompatible Data Type");
76486 throw_error_already_set();
76487 }
76488 }
76489 }
76490 }
76491 }}}
76492 namespace PySide
76493 {
76494 template< typename FLAG >
76495 void __attribute__ ((visibility("internal"))) declare_qflags(const char *flag_name)
76496 {
76497 boost::python::class_< FLAG >(flag_name, boost::python::init<const FLAG&>())
76498 .def(boost::python::init< boost::python::optional< int > >())
76499 .def(boost::python::init< typename FLAG::enum_type >())
76500 .def(boost::python::self & int())
76501 .def(boost::python::self == boost::python::self)
76502 .def(boost::python::self == int())
76503 .def(boost::python::self &= int())
76504 .def(int_(boost::python::self))
76505 .def(~boost::python::self)
76506 .def(boost::python::self |= boost::python::self)
76507 .def(boost::python::self ^= boost::python::self)
76508 .def(boost::python::self != boost::python::self)
76509 .def(!boost::python::self)
76510 .def(boost::python::self | boost::python::self)
76511 .def(boost::python::self ^ boost::python::self)
76512 ;
76513 boost::python::implicitly_convertible<int, FLAG >();
76514 }
76515 template< typename FLAG >
76516 void __attribute__ ((visibility("internal"))) declare_int_qflags(const char *flag_name)
76517 {
76518 boost::python::class_< FLAG >(flag_name, boost::python::init<const FLAG&>())
76519 .def(boost::python::init< boost::python::optional< int > >())
76520 .def(boost::python::init< typename FLAG::enum_type >())
76521 .def(boost::python::self & int())
76522 .def(boost::python::self &= int())
76523 .def(int_(boost::python::self))
76524 .def(~boost::python::self)
76525 .def(boost::python::self |= boost::python::self)
76526 .def(boost::python::self ^= boost::python::self)
76527 .def(!boost::python::self)
76528 .def(boost::python::self | boost::python::self)
76529 .def(boost::python::self ^ boost::python::self)
76530 ;
76531 boost::python::implicitly_convertible<typename FLAG::enum_type, FLAG >();
76532 }
76533 };
76534
76535 namespace PySide
76536 {
76537 class __attribute__ ((visibility("default"))) wrapper
76538 {
76539 public:
76540 PyObject* py_object() { return m_self; }
76541 void keep_cpp_ref();
76542 virtual ~wrapper();
76543 protected:
76544 wrapper(PyObject *self);
76545 boost::python::object get_override(const char* base_class_name, const char* method_name) const;
76546 private:
76547 wrapper() {}
76548 wrapper(wrapper &) {}
76549 PyObject *m_self;
76550 bool m_has_cpp_ref;
76551 };
76552 }
76553 typedef QtValidLicenseForCoreModule QtCoreModule;
76554 class QBitArray;
76555 class QByteArray;
76556 class QString;
76557 class QStringRef;
76558 inline uint qHash(char key) { return uint(key); }
76559 inline uint qHash(uchar key) { return uint(key); }
76560 inline uint qHash(signed char key) { return uint(key); }
76561 inline uint qHash(ushort key) { return uint(key); }
76562 inline uint qHash(short key) { return uint(key); }
76563 inline uint qHash(uint key) { return key; }
76564 inline uint qHash(int key) { return uint(key); }
76565 inline uint qHash(ulong key)
76566 {
76567 if (sizeof(ulong) > sizeof(uint)) {
76568 return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U));
76569 } else {
76570 return uint(key & (~0U));
76571 }
76572 }
76573 inline uint qHash(long key) { return qHash(ulong(key)); }
76574 inline uint qHash(quint64 key)
76575 {
76576 if (sizeof(quint64) > sizeof(uint)) {
76577 return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U));
76578 } else {
76579 return uint(key & (~0U));
76580 }
76581 }
76582 inline uint qHash(qint64 key) { return qHash(quint64(key)); }
76583 inline uint qHash(QChar key) { return qHash(key.unicode()); }
76584 uint qHash(const QByteArray &key);
76585 uint qHash(const QString &key);
76586 uint qHash(const QStringRef &key);
76587 uint qHash(const QBitArray &key);
76588 template <class T> inline uint qHash(const T *key)
76589 {
76590 return qHash(reinterpret_cast<quintptr>(key));
76591 }
76592 template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key)
76593 {
76594 uint h1 = qHash(key.first);
76595 uint h2 = qHash(key.second);
76596 return ((h1 << 16) | (h1 >> 16)) ^ h2;
76597 }
76598 struct QHashData
76599 {
76600 struct Node {
76601 Node *next;
76602 uint h;
76603 };
76604 Node *fakeNext;
76605 Node **buckets;
76606 QBasicAtomicInt ref;
76607 int size;
76608 int nodeSize;
76609 short userNumBits;
76610 short numBits;
76611 int numBuckets;
76612 uint sharable : 1;
76613 uint strictAlignment : 1;
76614 uint reserved : 30;
76615 void *allocateNode();
76616 void *allocateNode(int nodeAlign);
76617 void freeNode(void *node);
76618 QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize);
76619 QHashData *detach_helper2(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *),
76620 int nodeSize, int nodeAlign);
76621 void mightGrow();
76622 bool willGrow();
76623 void hasShrunk();
76624 void rehash(int hint);
76625 void free_helper(void (*node_delete)(Node *));
76626 void destroyAndFree();
76627 Node *firstNode();
76628 static Node *nextNode(Node *node);
76629 static Node *previousNode(Node *node);
76630 static QHashData shared_null;
76631 };
76632 inline void QHashData::mightGrow()
76633 {
76634 if (size >= numBuckets)
76635 rehash(numBits + 1);
76636 }
76637 inline bool QHashData::willGrow()
76638 {
76639 if (size >= numBuckets) {
76640 rehash(numBits + 1);
76641 return true;
76642 } else {
76643 return false;
76644 }
76645 }
76646 inline void QHashData::hasShrunk()
76647 {
76648 if (size <= (numBuckets >> 3) && numBits > userNumBits) {
76649 try {
76650 rehash(qMax(int(numBits) - 2, int(userNumBits)));
76651 } catch (const std::bad_alloc &) {
76652 }
76653 }
76654 }
76655 inline QHashData::Node *QHashData::firstNode()
76656 {
76657 Node *e = reinterpret_cast<Node *>(this);
76658 Node **bucket = buckets;
76659 int n = numBuckets;
76660 while (n--) {
76661 if (*bucket != e)
76662 return *bucket;
76663 ++bucket;
76664 }
76665 return e;
76666 }
76667 struct QHashDummyValue
76668 {
76669 };
76670 inline bool operator==(const QHashDummyValue & , const QHashDummyValue & )
76671 {
76672 return true;
76673 }
76674 template <> class QTypeInfo<QHashDummyValue > { public: enum { isComplex = (((Q_MOVABLE_TYPE | Q_DUMMY_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE | Q_DUMMY_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QHashDummyValue)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE | Q_DUMMY_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QHashDummyValue"; } };
76675 template <class Key, class T>
76676 struct QHashDummyNode
76677 {
76678 QHashDummyNode *next;
76679 uint h;
76680 Key key;
76681 inline QHashDummyNode(const Key &key0) : key(key0) {}
76682 };
76683 template <class Key, class T>
76684 struct QHashNode
76685 {
76686 QHashNode *next;
76687 uint h;
76688 Key key;
76689 T value;
76690 inline QHashNode(const Key &key0) : key(key0) {}
76691 inline QHashNode(const Key &key0, const T &value0) : key(key0), value(value0) {}
76692 inline bool same_key(uint h0, const Key &key0) { return h0 == h && key0 == key; }
76693 };
76694 template <class T> struct QHashDummyNode<short, T> { QHashDummyNode *next; union { uint h; short key; }; inline QHashDummyNode(short ) {} }; template <class T> struct QHashNode<short, T> { QHashNode *next; union { uint h; short key; }; T value; inline QHashNode(short ) {} inline QHashNode(short , const T &value0) : value(value0) {} inline bool same_key(uint h0, short) { return h0 == h; } };
76695 template <class T> struct QHashDummyNode<ushort, T> { QHashDummyNode *next; union { uint h; ushort key; }; inline QHashDummyNode(ushort ) {} }; template <class T> struct QHashNode<ushort, T> { QHashNode *next; union { uint h; ushort key; }; T value; inline QHashNode(ushort ) {} inline QHashNode(ushort , const T &value0) : value(value0) {} inline bool same_key(uint h0, ushort) { return h0 == h; } };
76696 template <class T> struct QHashDummyNode<int, T> { QHashDummyNode *next; union { uint h; int key; }; inline QHashDummyNode(int ) {} }; template <class T> struct QHashNode<int, T> { QHashNode *next; union { uint h; int key; }; T value; inline QHashNode(int ) {} inline QHashNode(int , const T &value0) : value(value0) {} inline bool same_key(uint h0, int) { return h0 == h; } };
76697 template <class T> struct QHashDummyNode<uint, T> { QHashDummyNode *next; union { uint h; uint key; }; inline QHashDummyNode(uint ) {} }; template <class T> struct QHashNode<uint, T> { QHashNode *next; union { uint h; uint key; }; T value; inline QHashNode(uint ) {} inline QHashNode(uint , const T &value0) : value(value0) {} inline bool same_key(uint h0, uint) { return h0 == h; } };
76698 template <class Key, class T>
76699 class QHash
76700 {
76701 typedef QHashDummyNode<Key, T> DummyNode;
76702 typedef QHashNode<Key, T> Node;
76703 union {
76704 QHashData *d;
76705 QHashNode<Key, T> *e;
76706 };
76707 static inline Node *concrete(QHashData::Node *node) {
76708 return reinterpret_cast<Node *>(node);
76709 }
76710 static inline int alignOfNode() { return qMax<int>(sizeof(void*), __alignof__(Node)); }
76711 static inline int alignOfDummyNode() { return qMax<int>(sizeof(void*), __alignof__(DummyNode)); }
76712 public:
76713 inline QHash() : d(&QHashData::shared_null) { d->ref.ref(); }
76714 inline QHash(const QHash<Key, T> &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); }
76715 inline ~QHash() { if (!d->ref.deref()) freeData(d); }
76716 QHash<Key, T> &operator=(const QHash<Key, T> &other);
76717 bool operator==(const QHash<Key, T> &other) const;
76718 inline bool operator!=(const QHash<Key, T> &other) const { return !(*this == other); }
76719 inline int size() const { return d->size; }
76720 inline bool isEmpty() const { return d->size == 0; }
76721 inline int capacity() const { return d->numBuckets; }
76722 void reserve(int size);
76723 inline void squeeze() { reserve(1); }
76724 inline void detach() { if (d->ref != 1) detach_helper(); }
76725 inline bool isDetached() const { return d->ref == 1; }
76726 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
76727 void clear();
76728 int remove(const Key &key);
76729 T take(const Key &key);
76730 bool contains(const Key &key) const;
76731 const Key key(const T &value) const;
76732 const Key key(const T &value, const Key &defaultKey) const;
76733 const T value(const Key &key) const;
76734 const T value(const Key &key, const T &defaultValue) const;
76735 T &operator[](const Key &key);
76736 const T operator[](const Key &key) const;
76737 QList<Key> uniqueKeys() const;
76738 QList<Key> keys() const;
76739 QList<Key> keys(const T &value) const;
76740 QList<T> values() const;
76741 QList<T> values(const Key &key) const;
76742 int count(const Key &key) const;
76743 class const_iterator;
76744 class iterator
76745 {
76746 friend class const_iterator;
76747 QHashData::Node *i;
76748 public:
76749 typedef std::bidirectional_iterator_tag iterator_category;
76750 typedef ptrdiff_t difference_type;
76751 typedef T value_type;
76752 typedef T *pointer;
76753 typedef T &reference;
76754 inline operator Node *() const { return concrete(i); }
76755 inline iterator() : i(0) { }
76756 explicit inline iterator(void *node) : i(reinterpret_cast<QHashData::Node *>(node)) { }
76757 inline const Key &key() const { return concrete(i)->key; }
76758 inline T &value() const { return concrete(i)->value; }
76759 inline T &operator*() const { return concrete(i)->value; }
76760 inline T *operator->() const { return &concrete(i)->value; }
76761 inline bool operator==(const iterator &o) const { return i == o.i; }
76762 inline bool operator!=(const iterator &o) const { return i != o.i; }
76763 inline iterator &operator++() {
76764 i = QHashData::nextNode(i);
76765 return *this;
76766 }
76767 inline iterator operator++(int) {
76768 iterator r = *this;
76769 i = QHashData::nextNode(i);
76770 return r;
76771 }
76772 inline iterator &operator--() {
76773 i = QHashData::previousNode(i);
76774 return *this;
76775 }
76776 inline iterator operator--(int) {
76777 iterator r = *this;
76778 i = QHashData::previousNode(i);
76779 return r;
76780 }
76781 inline iterator operator+(int j) const
76782 { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
76783 inline iterator operator-(int j) const { return operator+(-j); }
76784 inline iterator &operator+=(int j) { return *this = *this + j; }
76785 inline iterator &operator-=(int j) { return *this = *this - j; }
76786 public:
76787 inline bool operator==(const const_iterator &o) const
76788 { return i == o.i; }
76789 inline bool operator!=(const const_iterator &o) const
76790 { return i != o.i; }
76791 private:
76792 inline operator bool() const { return false; }
76793 };
76794 friend class iterator;
76795 class const_iterator
76796 {
76797 friend class iterator;
76798 QHashData::Node *i;
76799 public:
76800 typedef std::bidirectional_iterator_tag iterator_category;
76801 typedef ptrdiff_t difference_type;
76802 typedef T value_type;
76803 typedef const T *pointer;
76804 typedef const T &reference;
76805 inline operator Node *() const { return concrete(i); }
76806 inline const_iterator() : i(0) { }
76807 explicit inline const_iterator(void *node)
76808 : i(reinterpret_cast<QHashData::Node *>(node)) { }
76809 inline const_iterator(const iterator &o)
76810 { i = o.i; }
76811 inline const Key &key() const { return concrete(i)->key; }
76812 inline const T &value() const { return concrete(i)->value; }
76813 inline const T &operator*() const { return concrete(i)->value; }
76814 inline const T *operator->() const { return &concrete(i)->value; }
76815 inline bool operator==(const const_iterator &o) const { return i == o.i; }
76816 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
76817 inline const_iterator &operator++() {
76818 i = QHashData::nextNode(i);
76819 return *this;
76820 }
76821 inline const_iterator operator++(int) {
76822 const_iterator r = *this;
76823 i = QHashData::nextNode(i);
76824 return r;
76825 }
76826 inline const_iterator &operator--() {
76827 i = QHashData::previousNode(i);
76828 return *this;
76829 }
76830 inline const_iterator operator--(int) {
76831 const_iterator r = *this;
76832 i = QHashData::previousNode(i);
76833 return r;
76834 }
76835 inline const_iterator operator+(int j) const
76836 { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
76837 inline const_iterator operator-(int j) const { return operator+(-j); }
76838 inline const_iterator &operator+=(int j) { return *this = *this + j; }
76839 inline const_iterator &operator-=(int j) { return *this = *this - j; }
76840 private:
76841 inline operator bool() const { return false; }
76842 };
76843 friend class const_iterator;
76844 inline iterator begin() { detach(); return iterator(d->firstNode()); }
76845 inline const_iterator begin() const { return const_iterator(d->firstNode()); }
76846 inline const_iterator constBegin() const { return const_iterator(d->firstNode()); }
76847 inline iterator end() { detach(); return iterator(e); }
76848 inline const_iterator end() const { return const_iterator(e); }
76849 inline const_iterator constEnd() const { return const_iterator(e); }
76850 iterator erase(iterator it);
76851 typedef iterator Iterator;
76852 typedef const_iterator ConstIterator;
76853 inline int count() const { return d->size; }
76854 iterator find(const Key &key);
76855 const_iterator find(const Key &key) const;
76856 const_iterator constFind(const Key &key) const;
76857 iterator insert(const Key &key, const T &value);
76858 iterator insertMulti(const Key &key, const T &value);
76859 QHash<Key, T> &unite(const QHash<Key, T> &other);
76860 typedef T mapped_type;
76861 typedef Key key_type;
76862 typedef ptrdiff_t difference_type;
76863 typedef int size_type;
76864 inline bool empty() const { return isEmpty(); }
76865 private:
76866 void detach_helper();
76867 void freeData(QHashData *d);
76868 Node **findNode(const Key &key, uint *hp = 0) const;
76869 Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
76870 void deleteNode(Node *node);
76871 static void deleteNode2(QHashData::Node *node);
76872 static void duplicateNode(QHashData::Node *originalNode, void *newNode);
76873 };
76874 template <class Key, class T>
76875 inline void QHash<Key, T>::deleteNode(Node *node)
76876 {
76877 deleteNode2(reinterpret_cast<QHashData::Node*>(node));
76878 d->freeNode(node);
76879 }
76880 template <class Key, class T>
76881 inline void QHash<Key, T>::deleteNode2(QHashData::Node *node)
76882 {
76883 concrete(node)->~Node();
76884 }
76885 template <class Key, class T>
76886 inline void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
76887 {
76888 Node *concreteNode = concrete(node);
76889 if (QTypeInfo<T>::isDummy) {
76890 (void) new (newNode) DummyNode(concreteNode->key);
76891 } else {
76892 (void) new (newNode) Node(concreteNode->key, concreteNode->value);
76893 }
76894 }
76895 template <class Key, class T>
76896 inline typename QHash<Key, T>::Node *
76897 QHash<Key, T>::createNode(uint ah, const Key &akey, const T &avalue, Node **anextNode)
76898 {
76899 Node *node;
76900 if (QTypeInfo<T>::isDummy) {
76901 node = reinterpret_cast<Node *>(new (d->allocateNode(alignOfDummyNode())) DummyNode(akey));
76902 } else {
76903 node = new (d->allocateNode(alignOfNode())) Node(akey, avalue);
76904 }
76905 node->h = ah;
76906 node->next = *anextNode;
76907 *anextNode = node;
76908 ++d->size;
76909 return node;
76910 }
76911 template <class Key, class T>
76912 inline QHash<Key, T> &QHash<Key, T>::unite(const QHash<Key, T> &other)
76913 {
76914 QHash<Key, T> copy(other);
76915 const_iterator it = copy.constEnd();
76916 while (it != copy.constBegin()) {
76917 --it;
76918 insertMulti(it.key(), it.value());
76919 }
76920 return *this;
76921 }
76922 template <class Key, class T>
76923 void QHash<Key, T>::freeData(QHashData *x)
76924 {
76925 x->free_helper(deleteNode2);
76926 }
76927 template <class Key, class T>
76928 inline void QHash<Key, T>::clear()
76929 {
76930 *this = QHash<Key,T>();
76931 }
76932 template <class Key, class T>
76933 void QHash<Key, T>::detach_helper()
76934 {
76935 QHashData *x = d->detach_helper2(duplicateNode, deleteNode2,
76936 QTypeInfo<T>::isDummy ? sizeof(DummyNode) : sizeof(Node),
76937 QTypeInfo<T>::isDummy ? alignOfDummyNode() : alignOfNode());
76938 if (!d->ref.deref())
76939 freeData(d);
76940 d = x;
76941 }
76942 template <class Key, class T>
76943 inline QHash<Key, T> &QHash<Key, T>::operator=(const QHash<Key, T> &other)
76944 {
76945 if (d != other.d) {
76946 other.d->ref.ref();
76947 if (!d->ref.deref())
76948 freeData(d);
76949 d = other.d;
76950 if (!d->sharable)
76951 detach_helper();
76952 }
76953 return *this;
76954 }
76955 template <class Key, class T>
76956 inline const T QHash<Key, T>::value(const Key &akey) const
76957 {
76958 Node *node;
76959 if (d->size == 0 || (node = *findNode(akey)) == e) {
76960 return T();
76961 } else {
76962 return node->value;
76963 }
76964 }
76965 template <class Key, class T>
76966 inline const T QHash<Key, T>::value(const Key &akey, const T &adefaultValue) const
76967 {
76968 Node *node;
76969 if (d->size == 0 || (node = *findNode(akey)) == e) {
76970 return adefaultValue;
76971 } else {
76972 return node->value;
76973 }
76974 }
76975 template <class Key, class T>
76976 QList<Key> QHash<Key, T>::uniqueKeys() const
76977 {
76978 QList<Key> res;
76979 const_iterator i = begin();
76980 if (i != end()) {
76981 for (;;) {
76982 const Key &aKey = i.key();
76983 res.append(aKey);
76984 do {
76985 if (++i == end())
76986 goto break_out_of_outer_loop;
76987 } while (aKey == i.key());
76988 }
76989 }
76990 break_out_of_outer_loop:
76991 return res;
76992 }
76993 template <class Key, class T>
76994 QList<Key> QHash<Key, T>::keys() const
76995 {
76996 QList<Key> res;
76997 const_iterator i = begin();
76998 while (i != end()) {
76999 res.append(i.key());
77000 ++i;
77001 }
77002 return res;
77003 }
77004 template <class Key, class T>
77005 QList<Key> QHash<Key, T>::keys(const T &avalue) const
77006 {
77007 QList<Key> res;
77008 const_iterator i = begin();
77009 while (i != end()) {
77010 if (i.value() == avalue)
77011 res.append(i.key());
77012 ++i;
77013 }
77014 return res;
77015 }
77016 template <class Key, class T>
77017 const Key QHash<Key, T>::key(const T &avalue) const
77018 {
77019 return key(avalue, Key());
77020 }
77021 template <class Key, class T>
77022 const Key QHash<Key, T>::key(const T &avalue, const Key &defaultValue) const
77023 {
77024 const_iterator i = begin();
77025 while (i != end()) {
77026 if (i.value() == avalue)
77027 return i.key();
77028 ++i;
77029 }
77030 return defaultValue;
77031 }
77032 template <class Key, class T>
77033 QList<T> QHash<Key, T>::values() const
77034 {
77035 QList<T> res;
77036 const_iterator i = begin();
77037 while (i != end()) {
77038 res.append(i.value());
77039 ++i;
77040 }
77041 return res;
77042 }
77043 template <class Key, class T>
77044 QList<T> QHash<Key, T>::values(const Key &akey) const
77045 {
77046 QList<T> res;
77047 Node *node = *findNode(akey);
77048 if (node != e) {
77049 do {
77050 res.append(node->value);
77051 } while ((node = node->next) != e && node->key == akey);
77052 }
77053 return res;
77054 }
77055 template <class Key, class T>
77056 int QHash<Key, T>::count(const Key &akey) const
77057 {
77058 int cnt = 0;
77059 Node *node = *findNode(akey);
77060 if (node != e) {
77061 do {
77062 ++cnt;
77063 } while ((node = node->next) != e && node->key == akey);
77064 }
77065 return cnt;
77066 }
77067 template <class Key, class T>
77068 inline const T QHash<Key, T>::operator[](const Key &akey) const
77069 {
77070 return value(akey);
77071 }
77072 template <class Key, class T>
77073 inline T &QHash<Key, T>::operator[](const Key &akey)
77074 {
77075 detach();
77076 uint h;
77077 Node **node = findNode(akey, &h);
77078 if (*node == e) {
77079 if (d->willGrow())
77080 node = findNode(akey, &h);
77081 return createNode(h, akey, T(), node)->value;
77082 }
77083 return (*node)->value;
77084 }
77085 template <class Key, class T>
77086 inline typename QHash<Key, T>::iterator QHash<Key, T>::insert(const Key &akey,
77087 const T &avalue)
77088 {
77089 detach();
77090 uint h;
77091 Node **node = findNode(akey, &h);
77092 if (*node == e) {
77093 if (d->willGrow())
77094 node = findNode(akey, &h);
77095 return iterator(createNode(h, akey, avalue, node));
77096 }
77097 if (!QTypeInfo<T>::isDummy)
77098 (*node)->value = avalue;
77099 return iterator(*node);
77100 }
77101 template <class Key, class T>
77102 inline typename QHash<Key, T>::iterator QHash<Key, T>::insertMulti(const Key &akey,
77103 const T &avalue)
77104 {
77105 detach();
77106 d->willGrow();
77107 uint h;
77108 Node **nextNode = findNode(akey, &h);
77109 return iterator(createNode(h, akey, avalue, nextNode));
77110 }
77111 template <class Key, class T>
77112 int QHash<Key, T>::remove(const Key &akey)
77113 {
77114 if (isEmpty())
77115 return 0;
77116 detach();
77117 int oldSize = d->size;
77118 Node **node = findNode(akey);
77119 if (*node != e) {
77120 bool deleteNext = true;
77121 do {
77122 Node *next = (*node)->next;
77123 deleteNext = (next != e && next->key == (*node)->key);
77124 deleteNode(*node);
77125 *node = next;
77126 --d->size;
77127 } while (deleteNext);
77128 d->hasShrunk();
77129 }
77130 return oldSize - d->size;
77131 }
77132 template <class Key, class T>
77133 T QHash<Key, T>::take(const Key &akey)
77134 {
77135 if (isEmpty())
77136 return T();
77137 detach();
77138 Node **node = findNode(akey);
77139 if (*node != e) {
77140 T t = (*node)->value;
77141 Node *next = (*node)->next;
77142 deleteNode(*node);
77143 *node = next;
77144 --d->size;
77145 d->hasShrunk();
77146 return t;
77147 }
77148 return T();
77149 }
77150 template <class Key, class T>
77151 typename QHash<Key, T>::iterator QHash<Key, T>::erase(iterator it)
77152 {
77153 if (it == iterator(e))
77154 return it;
77155 iterator ret = it;
77156 ++ret;
77157 Node *node = it;
77158 Node **node_ptr = reinterpret_cast<Node **>(&d->buckets[node->h % d->numBuckets]);
77159 while (*node_ptr != node)
77160 node_ptr = &(*node_ptr)->next;
77161 *node_ptr = node->next;
77162 deleteNode(node);
77163 --d->size;
77164 return ret;
77165 }
77166 template <class Key, class T>
77167 inline void QHash<Key, T>::reserve(int asize)
77168 {
77169 detach();
77170 d->rehash(-qMax(asize, 1));
77171 }
77172 template <class Key, class T>
77173 inline typename QHash<Key, T>::const_iterator QHash<Key, T>::find(const Key &akey) const
77174 {
77175 return const_iterator(*findNode(akey));
77176 }
77177 template <class Key, class T>
77178 inline typename QHash<Key, T>::const_iterator QHash<Key, T>::constFind(const Key &akey) const
77179 {
77180 return const_iterator(*findNode(akey));
77181 }
77182 template <class Key, class T>
77183 inline typename QHash<Key, T>::iterator QHash<Key, T>::find(const Key &akey)
77184 {
77185 detach();
77186 return iterator(*findNode(akey));
77187 }
77188 template <class Key, class T>
77189 inline bool QHash<Key, T>::contains(const Key &akey) const
77190 {
77191 return *findNode(akey) != e;
77192 }
77193 template <class Key, class T>
77194 typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
77195 uint *ahp) const
77196 {
77197 Node **node;
77198 uint h = qHash(akey);
77199 if (d->numBuckets) {
77200 node = reinterpret_cast<Node **>(&d->buckets[h % d->numBuckets]);
77201 ((!(*node == e || (*node)->next)) ? qt_assert("*node == e || (*node)->next","/usr/include/qt4/QtCore/qhash.h",879) : qt_noop());
77202 while (*node != e && !(*node)->same_key(h, akey))
77203 node = &(*node)->next;
77204 } else {
77205 node = const_cast<Node **>(reinterpret_cast<const Node * const *>(&e));
77206 }
77207 if (ahp)
77208 *ahp = h;
77209 return node;
77210 }
77211 template <class Key, class T>
77212 bool QHash<Key, T>::operator==(const QHash<Key, T> &other) const
77213 {
77214 if (size() != other.size())
77215 return false;
77216 if (d == other.d)
77217 return true;
77218 const_iterator it = begin();
77219 while (it != end()) {
77220 const Key &akey = it.key();
77221 const_iterator it2 = other.find(akey);
77222 do {
77223 if (it2 == other.end() || !(it2.key() == akey))
77224 return false;
77225 if (!QTypeInfo<T>::isDummy && !(it.value() == it2.value()))
77226 return false;
77227 ++it;
77228 ++it2;
77229 } while (it != end() && it.key() == akey);
77230 }
77231 return true;
77232 }
77233 template <class Key, class T>
77234 class QMultiHash : public QHash<Key, T>
77235 {
77236 public:
77237 QMultiHash() {}
77238 QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
77239 inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
77240 { return QHash<Key, T>::insert(key, value); }
77241 inline typename QHash<Key, T>::iterator insert(const Key &key, const T &value)
77242 { return QHash<Key, T>::insertMulti(key, value); }
77243 inline QMultiHash &operator+=(const QMultiHash &other)
77244 { unite(other); return *this; }
77245 inline QMultiHash operator+(const QMultiHash &other) const
77246 { QMultiHash result = *this; result += other; return result; }
77247 using QHash<Key, T>::contains;
77248 using QHash<Key, T>::remove;
77249 using QHash<Key, T>::count;
77250 using QHash<Key, T>::find;
77251 using QHash<Key, T>::constFind;
77252 bool contains(const Key &key, const T &value) const;
77253 int remove(const Key &key, const T &value);
77254 int count(const Key &key, const T &value) const;
77255 typename QHash<Key, T>::iterator find(const Key &key, const T &value) {
77256 typename QHash<Key, T>::iterator i(find(key));
77257 typename QHash<Key, T>::iterator end(this->end());
77258 while (i != end && i.key() == key) {
77259 if (i.value() == value)
77260 return i;
77261 ++i;
77262 }
77263 return end;
77264 }
77265 typename QHash<Key, T>::const_iterator find(const Key &key, const T &value) const {
77266 typename QHash<Key, T>::const_iterator i(constFind(key));
77267 typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
77268 while (i != end && i.key() == key) {
77269 if (i.value() == value)
77270 return i;
77271 ++i;
77272 }
77273 return end;
77274 }
77275 typename QHash<Key, T>::const_iterator constFind(const Key &key, const T &value) const
77276 { return find(key, value); }
77277 private:
77278 T &operator[](const Key &key);
77279 const T operator[](const Key &key) const;
77280 };
77281 template <class Key, class T>
77282 inline bool QMultiHash<Key, T>::contains(const Key &key, const T &value) const
77283 {
77284 return constFind(key, value) != QHash<Key, T>::constEnd();
77285 }
77286 template <class Key, class T>
77287 inline int QMultiHash<Key, T>::remove(const Key &key, const T &value)
77288 {
77289 int n = 0;
77290 typename QHash<Key, T>::iterator i(find(key));
77291 typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
77292 while (i != end && i.key() == key) {
77293 if (i.value() == value) {
77294 i = erase(i);
77295 ++n;
77296 } else {
77297 ++i;
77298 }
77299 }
77300 return n;
77301 }
77302 template <class Key, class T>
77303 inline int QMultiHash<Key, T>::count(const Key &key, const T &value) const
77304 {
77305 int n = 0;
77306 typename QHash<Key, T>::const_iterator i(constFind(key));
77307 typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
77308 while (i != end && i.key() == key) {
77309 if (i.value() == value)
77310 ++n;
77311 ++i;
77312 }
77313 return n;
77314 }
77315 template <class Key, class T> class QHashIterator { typedef typename QHash<Key,T>::const_iterator const_iterator; typedef const_iterator Item; QHash<Key,T> c; const_iterator i, n; inline bool item_exists() const { return n != c.constEnd(); } public: inline QHashIterator(const QHash<Key,T> &container) : c(container), i(c.constBegin()), n(c.constEnd()) {} inline QHashIterator &operator=(const QHash<Key,T> &container) { c = container; i = c.constBegin(); n = c.constEnd(); return *this; } inline void toFront() { i = c.constBegin(); n = c.constEnd(); } inline void toBack() { i = c.constEnd(); n = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { const_iterator p = i; return --p; } inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qhash.h",1033) : qt_noop()); return *n; } inline const Key &key() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qhash.h",1033) : qt_noop()); return n.key(); } inline bool findNext(const T &t) { while ((n = i) != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(n = --i) == t) return true; n = c.constEnd(); return false; } };
77316 template <class Key, class T> class QMutableHashIterator { typedef typename QHash<Key,T>::iterator iterator; typedef typename QHash<Key,T>::const_iterator const_iterator; typedef iterator Item; QHash<Key,T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableHashIterator(QHash<Key,T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableHashIterator() { c->setSharable(true); } inline QMutableHashIterator &operator=(QHash<Key,T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = c->end(); } inline bool hasNext() const { return const_iterator(i) != c->constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return const_iterator(i) != c->constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { iterator p = i; return --p; } inline void remove() { if (const_iterator(n) != c->constEnd()) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) { if (const_iterator(n) != c->constEnd()) *n = t; } inline T &value() { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qhash.h",1034) : qt_noop()); return *n; } inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qhash.h",1034) : qt_noop()); return *n; } inline const Key &key() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qhash.h",1034) : qt_noop()); return n.key(); } inline bool findNext(const T &t) { while (const_iterator(n = i) != c->constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (const_iterator(i) != c->constBegin()) if (*(n = --i) == t) return true; n = c->end(); return false; } };
77317 typedef QtValidLicenseForCoreModule QtCoreModule;
77318 struct QMapData
77319 {
77320 struct Node {
77321 Node *backward;
77322 Node *forward[1];
77323 };
77324 enum { LastLevel = 11, Sparseness = 3 };
77325 QMapData *backward;
77326 QMapData *forward[QMapData::LastLevel + 1];
77327 QBasicAtomicInt ref;
77328 int topLevel;
77329 int size;
77330 uint randomBits;
77331 uint insertInOrder : 1;
77332 uint sharable : 1;
77333 uint strictAlignment : 1;
77334 uint reserved : 29;
77335 static QMapData *createData();
77336 static QMapData *createData(int alignment);
77337 void continueFreeData(int offset);
77338 Node *node_create(Node *update[], int offset);
77339 Node *node_create(Node *update[], int offset, int alignment);
77340 void node_delete(Node *update[], int offset, Node *node);
77341 static QMapData shared_null;
77342 };
77343 template <class Key> inline bool qMapLessThanKey(const Key &key1, const Key &key2)
77344 {
77345 return key1 < key2;
77346 }
77347 template <class Ptr> inline bool qMapLessThanKey(Ptr *key1, Ptr *key2)
77348 {
77349 ((!(sizeof(quintptr) == sizeof(Ptr *))) ? qt_assert("sizeof(quintptr) == sizeof(Ptr *)","/usr/include/qt4/QtCore/qmap.h",113) : qt_noop());
77350 return quintptr(key1) < quintptr(key2);
77351 }
77352 template <class Ptr> inline bool qMapLessThanKey(const Ptr *key1, const Ptr *key2)
77353 {
77354 ((!(sizeof(quintptr) == sizeof(const Ptr *))) ? qt_assert("sizeof(quintptr) == sizeof(const Ptr *)","/usr/include/qt4/QtCore/qmap.h",119) : qt_noop());
77355 return quintptr(key1) < quintptr(key2);
77356 }
77357 template <class Key, class T>
77358 struct QMapNode {
77359 Key key;
77360 T value;
77361 QMapData::Node *backward;
77362 QMapData::Node *forward[1];
77363 };
77364 template <class Key, class T>
77365 struct QMapPayloadNode
77366 {
77367 Key key;
77368 T value;
77369 QMapData::Node *backward;
77370 };
77371 template <class Key, class T>
77372 class QMap
77373 {
77374 typedef QMapNode<Key, T> Node;
77375 typedef QMapPayloadNode<Key, T> PayloadNode;
77376 union {
77377 QMapData *d;
77378 QMapData::Node *e;
77379 };
77380 static inline int payload() { return sizeof(PayloadNode) - sizeof(QMapData::Node *); }
77381 static inline int alignment() {
77382 return int(qMax(sizeof(void*), __alignof__(Node)));
77383 }
77384 static inline Node *concrete(QMapData::Node *node) {
77385 return reinterpret_cast<Node *>(reinterpret_cast<char *>(node) - payload());
77386 }
77387 public:
77388 inline QMap() : d(&QMapData::shared_null) { d->ref.ref(); }
77389 inline QMap(const QMap<Key, T> &other) : d(other.d)
77390 { d->ref.ref(); if (!d->sharable) detach(); }
77391 inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }
77392 QMap<Key, T> &operator=(const QMap<Key, T> &other);
77393 explicit QMap(const typename std::map<Key, T> &other);
77394 std::map<Key, T> toStdMap() const;
77395 bool operator==(const QMap<Key, T> &other) const;
77396 inline bool operator!=(const QMap<Key, T> &other) const { return !(*this == other); }
77397 inline int size() const { return d->size; }
77398 inline bool isEmpty() const { return d->size == 0; }
77399 inline void detach() { if (d->ref != 1) detach_helper(); }
77400 inline bool isDetached() const { return d->ref == 1; }
77401 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
77402 inline void setInsertInOrder(bool ordered) { d->insertInOrder = ordered; }
77403 void clear();
77404 int remove(const Key &key);
77405 T take(const Key &key);
77406 bool contains(const Key &key) const;
77407 const Key key(const T &value) const;
77408 const Key key(const T &value, const Key &defaultKey) const;
77409 const T value(const Key &key) const;
77410 const T value(const Key &key, const T &defaultValue) const;
77411 T &operator[](const Key &key);
77412 const T operator[](const Key &key) const;
77413 QList<Key> uniqueKeys() const;
77414 QList<Key> keys() const;
77415 QList<Key> keys(const T &value) const;
77416 QList<T> values() const;
77417 QList<T> values(const Key &key) const;
77418 int count(const Key &key) const;
77419 class const_iterator;
77420 class iterator
77421 {
77422 friend class const_iterator;
77423 QMapData::Node *i;
77424 public:
77425 typedef std::bidirectional_iterator_tag iterator_category;
77426 typedef ptrdiff_t difference_type;
77427 typedef T value_type;
77428 typedef T *pointer;
77429 typedef T &reference;
77430 inline operator QMapData::Node *() const { return i; }
77431 inline iterator() : i(0) { }
77432 inline iterator(QMapData::Node *node) : i(node) { }
77433 inline const Key &key() const { return concrete(i)->key; }
77434 inline T &value() const { return concrete(i)->value; }
77435 inline T &operator*() const { return concrete(i)->value; }
77436 inline T *operator->() const { return &concrete(i)->value; }
77437 inline bool operator==(const iterator &o) const { return i == o.i; }
77438 inline bool operator!=(const iterator &o) const { return i != o.i; }
77439 inline iterator &operator++() {
77440 i = i->forward[0];
77441 return *this;
77442 }
77443 inline iterator operator++(int) {
77444 iterator r = *this;
77445 i = i->forward[0];
77446 return r;
77447 }
77448 inline iterator &operator--() {
77449 i = i->backward;
77450 return *this;
77451 }
77452 inline iterator operator--(int) {
77453 iterator r = *this;
77454 i = i->backward;
77455 return r;
77456 }
77457 inline iterator operator+(int j) const
77458 { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
77459 inline iterator operator-(int j) const { return operator+(-j); }
77460 inline iterator &operator+=(int j) { return *this = *this + j; }
77461 inline iterator &operator-=(int j) { return *this = *this - j; }
77462 public:
77463 inline bool operator==(const const_iterator &o) const
77464 { return i == o.i; }
77465 inline bool operator!=(const const_iterator &o) const
77466 { return i != o.i; }
77467 private:
77468 inline operator bool() const { return false; }
77469 };
77470 friend class iterator;
77471 class const_iterator
77472 {
77473 friend class iterator;
77474 QMapData::Node *i;
77475 public:
77476 typedef std::bidirectional_iterator_tag iterator_category;
77477 typedef ptrdiff_t difference_type;
77478 typedef T value_type;
77479 typedef const T *pointer;
77480 typedef const T &reference;
77481 inline operator QMapData::Node *() const { return i; }
77482 inline const_iterator() : i(0) { }
77483 inline const_iterator(QMapData::Node *node) : i(node) { }
77484 inline const_iterator(const iterator &o)
77485 { i = o.i; }
77486 inline const Key &key() const { return concrete(i)->key; }
77487 inline const T &value() const { return concrete(i)->value; }
77488 inline const T &operator*() const { return concrete(i)->value; }
77489 inline const T *operator->() const { return &concrete(i)->value; }
77490 inline bool operator==(const const_iterator &o) const { return i == o.i; }
77491 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
77492 inline const_iterator &operator++() {
77493 i = i->forward[0];
77494 return *this;
77495 }
77496 inline const_iterator operator++(int) {
77497 const_iterator r = *this;
77498 i = i->forward[0];
77499 return r;
77500 }
77501 inline const_iterator &operator--() {
77502 i = i->backward;
77503 return *this;
77504 }
77505 inline const_iterator operator--(int) {
77506 const_iterator r = *this;
77507 i = i->backward;
77508 return r;
77509 }
77510 inline const_iterator operator+(int j) const
77511 { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; }
77512 inline const_iterator operator-(int j) const { return operator+(-j); }
77513 inline const_iterator &operator+=(int j) { return *this = *this + j; }
77514 inline const_iterator &operator-=(int j) { return *this = *this - j; }
77515 private:
77516 inline operator bool() const { return false; }
77517 };
77518 friend class const_iterator;
77519 inline iterator begin() { detach(); return iterator(e->forward[0]); }
77520 inline const_iterator begin() const { return const_iterator(e->forward[0]); }
77521 inline const_iterator constBegin() const { return const_iterator(e->forward[0]); }
77522 inline iterator end() {
77523 detach();
77524 return iterator(e);
77525 }
77526 inline const_iterator end() const { return const_iterator(e); }
77527 inline const_iterator constEnd() const { return const_iterator(e); }
77528 iterator erase(iterator it);
77529 typedef iterator Iterator;
77530 typedef const_iterator ConstIterator;
77531 inline int count() const { return d->size; }
77532 iterator find(const Key &key);
77533 const_iterator find(const Key &key) const;
77534 const_iterator constFind(const Key &key) const;
77535 iterator lowerBound(const Key &key);
77536 const_iterator lowerBound(const Key &key) const;
77537 iterator upperBound(const Key &key);
77538 const_iterator upperBound(const Key &key) const;
77539 iterator insert(const Key &key, const T &value);
77540 iterator insertMulti(const Key &key, const T &value);
77541 QMap<Key, T> &unite(const QMap<Key, T> &other);
77542 typedef Key key_type;
77543 typedef T mapped_type;
77544 typedef ptrdiff_t difference_type;
77545 typedef int size_type;
77546 inline bool empty() const { return isEmpty(); }
77547 private:
77548 void detach_helper();
77549 void freeData(QMapData *d);
77550 QMapData::Node *findNode(const Key &key) const;
77551 QMapData::Node *mutableFindNode(QMapData::Node *update[], const Key &key) const;
77552 QMapData::Node *node_create(QMapData *d, QMapData::Node *update[], const Key &key,
77553 const T &value);
77554 };
77555 template <class Key, class T>
77556 inline QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
77557 {
77558 if (d != other.d) {
77559 other.d->ref.ref();
77560 if (!d->ref.deref())
77561 freeData(d);
77562 d = other.d;
77563 if (!d->sharable)
77564 detach_helper();
77565 }
77566 return *this;
77567 }
77568 template <class Key, class T>
77569 inline void QMap<Key, T>::clear()
77570 {
77571 *this = QMap<Key, T>();
77572 }
77573 template <class Key, class T>
77574 inline typename QMapData::Node *
77575 QMap<Key, T>::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue)
77576 {
77577 QMapData::Node *abstractNode = adt->node_create(aupdate, payload(), alignment());
77578 try {
77579 Node *concreteNode = concrete(abstractNode);
77580 new (&concreteNode->key) Key(akey);
77581 try {
77582 new (&concreteNode->value) T(avalue);
77583 } catch (...) {
77584 concreteNode->key.~Key();
77585 throw;
77586 }
77587 } catch (...) {
77588 adt->node_delete(aupdate, payload(), abstractNode);
77589 throw;
77590 }
77591 return abstractNode;
77592 }
77593 template <class Key, class T>
77594 inline QMapData::Node *QMap<Key, T>::findNode(const Key &akey) const
77595 {
77596 QMapData::Node *cur = e;
77597 QMapData::Node *next = e;
77598 for (int i = d->topLevel; i >= 0; i--) {
77599 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
77600 cur = next;
77601 }
77602 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
77603 return next;
77604 } else {
77605 return e;
77606 }
77607 }
77608 template <class Key, class T>
77609 inline const T QMap<Key, T>::value(const Key &akey) const
77610 {
77611 QMapData::Node *node;
77612 if (d->size == 0 || (node = findNode(akey)) == e) {
77613 return T();
77614 } else {
77615 return concrete(node)->value;
77616 }
77617 }
77618 template <class Key, class T>
77619 inline const T QMap<Key, T>::value(const Key &akey, const T &adefaultValue) const
77620 {
77621 QMapData::Node *node;
77622 if (d->size == 0 || (node = findNode(akey)) == e) {
77623 return adefaultValue;
77624 } else {
77625 return concrete(node)->value;
77626 }
77627 }
77628 template <class Key, class T>
77629 inline const T QMap<Key, T>::operator[](const Key &akey) const
77630 {
77631 return value(akey);
77632 }
77633 template <class Key, class T>
77634 inline T &QMap<Key, T>::operator[](const Key &akey)
77635 {
77636 detach();
77637 QMapData::Node *update[QMapData::LastLevel + 1];
77638 QMapData::Node *node = mutableFindNode(update, akey);
77639 if (node == e)
77640 node = node_create(d, update, akey, T());
77641 return concrete(node)->value;
77642 }
77643 template <class Key, class T>
77644 inline int QMap<Key, T>::count(const Key &akey) const
77645 {
77646 int cnt = 0;
77647 QMapData::Node *node = findNode(akey);
77648 if (node != e) {
77649 do {
77650 ++cnt;
77651 node = node->forward[0];
77652 } while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key));
77653 }
77654 return cnt;
77655 }
77656 template <class Key, class T>
77657 inline bool QMap<Key, T>::contains(const Key &akey) const
77658 {
77659 return findNode(akey) != e;
77660 }
77661 template <class Key, class T>
77662 inline typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key &akey,
77663 const T &avalue)
77664 {
77665 detach();
77666 QMapData::Node *update[QMapData::LastLevel + 1];
77667 QMapData::Node *node = mutableFindNode(update, akey);
77668 if (node == e) {
77669 node = node_create(d, update, akey, avalue);
77670 } else {
77671 concrete(node)->value = avalue;
77672 }
77673 return iterator(node);
77674 }
77675 template <class Key, class T>
77676 inline typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &akey,
77677 const T &avalue)
77678 {
77679 detach();
77680 QMapData::Node *update[QMapData::LastLevel + 1];
77681 mutableFindNode(update, akey);
77682 return iterator(node_create(d, update, akey, avalue));
77683 }
77684 template <class Key, class T>
77685 inline typename QMap<Key, T>::const_iterator QMap<Key, T>::find(const Key &akey) const
77686 {
77687 return const_iterator(findNode(akey));
77688 }
77689 template <class Key, class T>
77690 inline typename QMap<Key, T>::const_iterator QMap<Key, T>::constFind(const Key &akey) const
77691 {
77692 return const_iterator(findNode(akey));
77693 }
77694 template <class Key, class T>
77695 inline typename QMap<Key, T>::iterator QMap<Key, T>::find(const Key &akey)
77696 {
77697 detach();
77698 return iterator(findNode(akey));
77699 }
77700 template <class Key, class T>
77701 inline QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
77702 {
77703 QMap<Key, T> copy(other);
77704 const_iterator it = copy.constEnd();
77705 const const_iterator b = copy.constBegin();
77706 while (it != b) {
77707 --it;
77708 insertMulti(it.key(), it.value());
77709 }
77710 return *this;
77711 }
77712 template <class Key, class T>
77713 void QMap<Key, T>::freeData(QMapData *x)
77714 {
77715 if (QTypeInfo<Key>::isComplex || QTypeInfo<T>::isComplex) {
77716 QMapData *cur = x;
77717 QMapData *next = cur->forward[0];
77718 while (next != x) {
77719 cur = next;
77720 next = cur->forward[0];
77721 Node *concreteNode = concrete(reinterpret_cast<QMapData::Node *>(cur));
77722 concreteNode->key.~Key();
77723 concreteNode->value.~T();
77724 }
77725 }
77726 x->continueFreeData(payload());
77727 }
77728 template <class Key, class T>
77729 int QMap<Key, T>::remove(const Key &akey)
77730 {
77731 detach();
77732 QMapData::Node *update[QMapData::LastLevel + 1];
77733 QMapData::Node *cur = e;
77734 QMapData::Node *next = e;
77735 int oldSize = d->size;
77736 for (int i = d->topLevel; i >= 0; i--) {
77737 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
77738 cur = next;
77739 update[i] = cur;
77740 }
77741 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
77742 bool deleteNext = true;
77743 do {
77744 cur = next;
77745 next = cur->forward[0];
77746 deleteNext = (next != e && !qMapLessThanKey<Key>(concrete(cur)->key, concrete(next)->key));
77747 concrete(cur)->key.~Key();
77748 concrete(cur)->value.~T();
77749 d->node_delete(update, payload(), cur);
77750 } while (deleteNext);
77751 }
77752 return oldSize - d->size;
77753 }
77754 template <class Key, class T>
77755 T QMap<Key, T>::take(const Key &akey)
77756 {
77757 detach();
77758 QMapData::Node *update[QMapData::LastLevel + 1];
77759 QMapData::Node *cur = e;
77760 QMapData::Node *next = e;
77761 for (int i = d->topLevel; i >= 0; i--) {
77762 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
77763 cur = next;
77764 update[i] = cur;
77765 }
77766 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
77767 T t = concrete(next)->value;
77768 concrete(next)->key.~Key();
77769 concrete(next)->value.~T();
77770 d->node_delete(update, payload(), next);
77771 return t;
77772 }
77773 return T();
77774 }
77775 template <class Key, class T>
77776 typename QMap<Key, T>::iterator QMap<Key, T>::erase(iterator it)
77777 {
77778 QMapData::Node *update[QMapData::LastLevel + 1];
77779 QMapData::Node *cur = e;
77780 QMapData::Node *next = e;
77781 if (it == iterator(e))
77782 return it;
77783 for (int i = d->topLevel; i >= 0; i--) {
77784 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, it.key()))
77785 cur = next;
77786 update[i] = cur;
77787 }
77788 while (next != e) {
77789 cur = next;
77790 next = cur->forward[0];
77791 if (cur == it) {
77792 concrete(cur)->key.~Key();
77793 concrete(cur)->value.~T();
77794 d->node_delete(update, payload(), cur);
77795 return iterator(next);
77796 }
77797 for (int i = 0; i <= d->topLevel; ++i) {
77798 if (update[i]->forward[i] != cur)
77799 break;
77800 update[i] = cur;
77801 }
77802 }
77803 return end();
77804 }
77805 template <class Key, class T>
77806 void QMap<Key, T>::detach_helper()
77807 {
77808 union { QMapData *d; QMapData::Node *e; } x;
77809 x.d = QMapData::createData(alignment());
77810 if (d->size) {
77811 x.d->insertInOrder = true;
77812 QMapData::Node *update[QMapData::LastLevel + 1];
77813 QMapData::Node *cur = e->forward[0];
77814 update[0] = x.e;
77815 while (cur != e) {
77816 try {
77817 Node *concreteNode = concrete(cur);
77818 node_create(x.d, update, concreteNode->key, concreteNode->value);
77819 } catch (...) {
77820 freeData(x.d);
77821 throw;
77822 }
77823 cur = cur->forward[0];
77824 }
77825 x.d->insertInOrder = false;
77826 }
77827 if (!d->ref.deref())
77828 freeData(d);
77829 d = x.d;
77830 }
77831 template <class Key, class T>
77832 QMapData::Node *QMap<Key, T>::mutableFindNode(QMapData::Node *aupdate[],
77833 const Key &akey) const
77834 {
77835 QMapData::Node *cur = e;
77836 QMapData::Node *next = e;
77837 for (int i = d->topLevel; i >= 0; i--) {
77838 while ((next = cur->forward[i]) != e && qMapLessThanKey<Key>(concrete(next)->key, akey))
77839 cur = next;
77840 aupdate[i] = cur;
77841 }
77842 if (next != e && !qMapLessThanKey<Key>(akey, concrete(next)->key)) {
77843 return next;
77844 } else {
77845 return e;
77846 }
77847 }
77848 template <class Key, class T>
77849 QList<Key> QMap<Key, T>::uniqueKeys() const
77850 {
77851 QList<Key> res;
77852 const_iterator i = begin();
77853 if (i != end()) {
77854 for (;;) {
77855 const Key &aKey = i.key();
77856 res.append(aKey);
77857 do {
77858 if (++i == end())
77859 goto break_out_of_outer_loop;
77860 } while (!(aKey < i.key()));
77861 }
77862 }
77863 break_out_of_outer_loop:
77864 return res;
77865 }
77866 template <class Key, class T>
77867 QList<Key> QMap<Key, T>::keys() const
77868 {
77869 QList<Key> res;
77870 const_iterator i = begin();
77871 while (i != end()) {
77872 res.append(i.key());
77873 ++i;
77874 }
77875 return res;
77876 }
77877 template <class Key, class T>
77878 QList<Key> QMap<Key, T>::keys(const T &avalue) const
77879 {
77880 QList<Key> res;
77881 const_iterator i = begin();
77882 while (i != end()) {
77883 if (i.value() == avalue)
77884 res.append(i.key());
77885 ++i;
77886 }
77887 return res;
77888 }
77889 template <class Key, class T>
77890 const Key QMap<Key, T>::key(const T &avalue) const
77891 {
77892 return key(avalue, Key());
77893 }
77894 template <class Key, class T>
77895 const Key QMap<Key, T>::key(const T &avalue, const Key &defaultKey) const
77896 {
77897 const_iterator i = begin();
77898 while (i != end()) {
77899 if (i.value() == avalue)
77900 return i.key();
77901 ++i;
77902 }
77903 return defaultKey;
77904 }
77905 template <class Key, class T>
77906 QList<T> QMap<Key, T>::values() const
77907 {
77908 QList<T> res;
77909 const_iterator i = begin();
77910 while (i != end()) {
77911 res.append(i.value());
77912 ++i;
77913 }
77914 return res;
77915 }
77916 template <class Key, class T>
77917 QList<T> QMap<Key, T>::values(const Key &akey) const
77918 {
77919 QList<T> res;
77920 QMapData::Node *node = findNode(akey);
77921 if (node != e) {
77922 do {
77923 res.append(concrete(node)->value);
77924 node = node->forward[0];
77925 } while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key));
77926 }
77927 return res;
77928 }
77929 template <class Key, class T>
77930 inline typename QMap<Key, T>::const_iterator
77931 QMap<Key, T>::lowerBound(const Key &akey) const
77932 {
77933 QMapData::Node *update[QMapData::LastLevel + 1];
77934 mutableFindNode(update, akey);
77935 return const_iterator(update[0]->forward[0]);
77936 }
77937 template <class Key, class T>
77938 inline typename QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &akey)
77939 {
77940 detach();
77941 return static_cast<QMapData::Node *>(const_cast<const QMap *>(this)->lowerBound(akey));
77942 }
77943 template <class Key, class T>
77944 inline typename QMap<Key, T>::const_iterator
77945 QMap<Key, T>::upperBound(const Key &akey) const
77946 {
77947 QMapData::Node *update[QMapData::LastLevel + 1];
77948 mutableFindNode(update, akey);
77949 QMapData::Node *node = update[0]->forward[0];
77950 while (node != e && !qMapLessThanKey<Key>(akey, concrete(node)->key))
77951 node = node->forward[0];
77952 return const_iterator(node);
77953 }
77954 template <class Key, class T>
77955 inline typename QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &akey)
77956 {
77957 detach();
77958 return static_cast<QMapData::Node *>(const_cast<const QMap *>(this)->upperBound(akey));
77959 }
77960 template <class Key, class T>
77961 bool QMap<Key, T>::operator==(const QMap<Key, T> &other) const
77962 {
77963 if (size() != other.size())
77964 return false;
77965 if (d == other.d)
77966 return true;
77967 const_iterator it1 = begin();
77968 const_iterator it2 = other.begin();
77969 while (it1 != end()) {
77970 if (!(it1.value() == it2.value()) || qMapLessThanKey(it1.key(), it2.key()) || qMapLessThanKey(it2.key(), it1.key()))
77971 return false;
77972 ++it2;
77973 ++it1;
77974 }
77975 return true;
77976 }
77977 template <class Key, class T>
77978 QMap<Key, T>::QMap(const std::map<Key, T> &other)
77979 {
77980 d = QMapData::createData(alignment());
77981 d->insertInOrder = true;
77982 typename std::map<Key,T>::const_iterator it = other.end();
77983 while (it != other.begin()) {
77984 --it;
77985 insert((*it).first, (*it).second);
77986 }
77987 d->insertInOrder = false;
77988 }
77989 template <class Key, class T>
77990 std::map<Key, T> QMap<Key, T>::toStdMap() const
77991 {
77992 std::map<Key, T> map;
77993 const_iterator it = end();
77994 while (it != begin()) {
77995 --it;
77996 map.insert(std::pair<Key, T>(it.key(), it.value()));
77997 }
77998 return map;
77999 }
78000 template <class Key, class T>
78001 class QMultiMap : public QMap<Key, T>
78002 {
78003 public:
78004 QMultiMap() {}
78005 QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
78006 inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
78007 { return QMap<Key, T>::insert(key, value); }
78008 inline typename QMap<Key, T>::iterator insert(const Key &key, const T &value)
78009 { return QMap<Key, T>::insertMulti(key, value); }
78010 inline QMultiMap &operator+=(const QMultiMap &other)
78011 { unite(other); return *this; }
78012 inline QMultiMap operator+(const QMultiMap &other) const
78013 { QMultiMap result = *this; result += other; return result; }
78014 using QMap<Key, T>::contains;
78015 using QMap<Key, T>::remove;
78016 using QMap<Key, T>::count;
78017 using QMap<Key, T>::find;
78018 using QMap<Key, T>::constFind;
78019 bool contains(const Key &key, const T &value) const;
78020 int remove(const Key &key, const T &value);
78021 int count(const Key &key, const T &value) const;
78022 typename QMap<Key, T>::iterator find(const Key &key, const T &value) {
78023 typename QMap<Key, T>::iterator i(find(key));
78024 typename QMap<Key, T>::iterator end(this->end());
78025 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
78026 if (i.value() == value)
78027 return i;
78028 ++i;
78029 }
78030 return end;
78031 }
78032 typename QMap<Key, T>::const_iterator find(const Key &key, const T &value) const {
78033 typename QMap<Key, T>::const_iterator i(constFind(key));
78034 typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
78035 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
78036 if (i.value() == value)
78037 return i;
78038 ++i;
78039 }
78040 return end;
78041 }
78042 typename QMap<Key, T>::const_iterator constFind(const Key &key, const T &value) const
78043 { return find(key, value); }
78044 private:
78045 T &operator[](const Key &key);
78046 const T operator[](const Key &key) const;
78047 };
78048 template <class Key, class T>
78049 inline bool QMultiMap<Key, T>::contains(const Key &key, const T &value) const
78050 {
78051 return constFind(key, value) != QMap<Key, T>::constEnd();
78052 }
78053 template <class Key, class T>
78054 inline int QMultiMap<Key, T>::remove(const Key &key, const T &value)
78055 {
78056 int n = 0;
78057 typename QMap<Key, T>::iterator i(find(key));
78058 typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
78059 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
78060 if (i.value() == value) {
78061 i = erase(i);
78062 ++n;
78063 } else {
78064 ++i;
78065 }
78066 }
78067 return n;
78068 }
78069 template <class Key, class T>
78070 inline int QMultiMap<Key, T>::count(const Key &key, const T &value) const
78071 {
78072 int n = 0;
78073 typename QMap<Key, T>::const_iterator i(constFind(key));
78074 typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
78075 while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
78076 if (i.value() == value)
78077 ++n;
78078 ++i;
78079 }
78080 return n;
78081 }
78082 template <class Key, class T> class QMapIterator { typedef typename QMap<Key,T>::const_iterator const_iterator; typedef const_iterator Item; QMap<Key,T> c; const_iterator i, n; inline bool item_exists() const { return n != c.constEnd(); } public: inline QMapIterator(const QMap<Key,T> &container) : c(container), i(c.constBegin()), n(c.constEnd()) {} inline QMapIterator &operator=(const QMap<Key,T> &container) { c = container; i = c.constBegin(); n = c.constEnd(); return *this; } inline void toFront() { i = c.constBegin(); n = c.constEnd(); } inline void toBack() { i = c.constEnd(); n = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { const_iterator p = i; return --p; } inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qmap.h",1059) : qt_noop()); return *n; } inline const Key &key() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qmap.h",1059) : qt_noop()); return n.key(); } inline bool findNext(const T &t) { while ((n = i) != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(n = --i) == t) return true; n = c.constEnd(); return false; } };
78083 template <class Key, class T> class QMutableMapIterator { typedef typename QMap<Key,T>::iterator iterator; typedef typename QMap<Key,T>::const_iterator const_iterator; typedef iterator Item; QMap<Key,T> *c; iterator i, n; inline bool item_exists() const { return const_iterator(n) != c->constEnd(); } public: inline QMutableMapIterator(QMap<Key,T> &container) : c(&container) { c->setSharable(false); i = c->begin(); n = c->end(); } inline ~QMutableMapIterator() { c->setSharable(true); } inline QMutableMapIterator &operator=(QMap<Key,T> &container) { c->setSharable(true); c = &container; c->setSharable(false); i = c->begin(); n = c->end(); return *this; } inline void toFront() { i = c->begin(); n = c->end(); } inline void toBack() { i = c->end(); n = c->end(); } inline bool hasNext() const { return const_iterator(i) != c->constEnd(); } inline Item next() { n = i++; return n; } inline Item peekNext() const { return i; } inline bool hasPrevious() const { return const_iterator(i) != c->constBegin(); } inline Item previous() { n = --i; return n; } inline Item peekPrevious() const { iterator p = i; return --p; } inline void remove() { if (const_iterator(n) != c->constEnd()) { i = c->erase(n); n = c->end(); } } inline void setValue(const T &t) { if (const_iterator(n) != c->constEnd()) *n = t; } inline T &value() { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qmap.h",1060) : qt_noop()); return *n; } inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qmap.h",1060) : qt_noop()); return *n; } inline const Key &key() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qmap.h",1060) : qt_noop()); return n.key(); } inline bool findNext(const T &t) { while (const_iterator(n = i) != c->constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (const_iterator(i) != c->constBegin()) if (*(n = --i) == t) return true; n = c->end(); return false; } };
78084 typedef QtValidLicenseForCoreModule QtCoreModule;
78085 class QDataStream;
78086 class QDate;
78087 class QDateTime;
78088 class QTime;
78089 class QVariant;
78090 class QTextStream;
78091 class QTextStreamPrivate;
78092 class QLocale;
78093 class QSystemLocale
78094 {
78095 public:
78096 QSystemLocale();
78097 virtual ~QSystemLocale();
78098 enum QueryType {
78099 LanguageId,
78100 CountryId,
78101 DecimalPoint,
78102 GroupSeparator,
78103 ZeroDigit,
78104 NegativeSign,
78105 DateFormatLong,
78106 DateFormatShort,
78107 TimeFormatLong,
78108 TimeFormatShort,
78109 DayNameLong,
78110 DayNameShort,
78111 MonthNameLong,
78112 MonthNameShort,
78113 DateToStringLong,
78114 DateToStringShort,
78115 TimeToStringLong,
78116 TimeToStringShort,
78117 DateTimeFormatLong,
78118 DateTimeFormatShort,
78119 DateTimeToStringLong,
78120 DateTimeToStringShort,
78121 MeasurementSystem,
78122 PositiveSign,
78123 AMText,
78124 PMText
78125 };
78126 virtual QVariant query(QueryType type, QVariant in) const;
78127 virtual QLocale fallbackLocale() const;
78128 private:
78129 QSystemLocale(bool);
78130 friend QSystemLocale *QSystemLocale_globalSystemLocale();
78131 };
78132 struct QLocalePrivate;
78133 class QLocale
78134 {
78135 public: static const QMetaObject staticMetaObject; private:
78136
78137
78138 friend class QString;
78139 friend class QByteArray;
78140 friend class QIntValidator;
78141 friend class QDoubleValidator;
78142 friend class QTextStream;
78143 friend class QTextStreamPrivate;
78144 public:
78145 enum Language {
78146 C = 1,
78147 Abkhazian = 2,
78148 Afan = 3,
78149 Afar = 4,
78150 Afrikaans = 5,
78151 Albanian = 6,
78152 Amharic = 7,
78153 Arabic = 8,
78154 Armenian = 9,
78155 Assamese = 10,
78156 Aymara = 11,
78157 Azerbaijani = 12,
78158 Bashkir = 13,
78159 Basque = 14,
78160 Bengali = 15,
78161 Bhutani = 16,
78162 Bihari = 17,
78163 Bislama = 18,
78164 Breton = 19,
78165 Bulgarian = 20,
78166 Burmese = 21,
78167 Byelorussian = 22,
78168 Cambodian = 23,
78169 Catalan = 24,
78170 Chinese = 25,
78171 Corsican = 26,
78172 Croatian = 27,
78173 Czech = 28,
78174 Danish = 29,
78175 Dutch = 30,
78176 English = 31,
78177 Esperanto = 32,
78178 Estonian = 33,
78179 Faroese = 34,
78180 FijiLanguage = 35,
78181 Finnish = 36,
78182 French = 37,
78183 Frisian = 38,
78184 Gaelic = 39,
78185 Galician = 40,
78186 Georgian = 41,
78187 German = 42,
78188 Greek = 43,
78189 Greenlandic = 44,
78190 Guarani = 45,
78191 Gujarati = 46,
78192 Hausa = 47,
78193 Hebrew = 48,
78194 Hindi = 49,
78195 Hungarian = 50,
78196 Icelandic = 51,
78197 Indonesian = 52,
78198 Interlingua = 53,
78199 Interlingue = 54,
78200 Inuktitut = 55,
78201 Inupiak = 56,
78202 Irish = 57,
78203 Italian = 58,
78204 Japanese = 59,
78205 Javanese = 60,
78206 Kannada = 61,
78207 Kashmiri = 62,
78208 Kazakh = 63,
78209 Kinyarwanda = 64,
78210 Kirghiz = 65,
78211 Korean = 66,
78212 Kurdish = 67,
78213 Kurundi = 68,
78214 Laothian = 69,
78215 Latin = 70,
78216 Latvian = 71,
78217 Lingala = 72,
78218 Lithuanian = 73,
78219 Macedonian = 74,
78220 Malagasy = 75,
78221 Malay = 76,
78222 Malayalam = 77,
78223 Maltese = 78,
78224 Maori = 79,
78225 Marathi = 80,
78226 Moldavian = 81,
78227 Mongolian = 82,
78228 NauruLanguage = 83,
78229 Nepali = 84,
78230 Norwegian = 85,
78231 NorwegianBokmal = Norwegian,
78232 Occitan = 86,
78233 Oriya = 87,
78234 Pashto = 88,
78235 Persian = 89,
78236 Polish = 90,
78237 Portuguese = 91,
78238 Punjabi = 92,
78239 Quechua = 93,
78240 RhaetoRomance = 94,
78241 Romanian = 95,
78242 Russian = 96,
78243 Samoan = 97,
78244 Sangho = 98,
78245 Sanskrit = 99,
78246 Serbian = 100,
78247 SerboCroatian = 101,
78248 Sesotho = 102,
78249 Setswana = 103,
78250 Shona = 104,
78251 Sindhi = 105,
78252 Singhalese = 106,
78253 Siswati = 107,
78254 Slovak = 108,
78255 Slovenian = 109,
78256 Somali = 110,
78257 Spanish = 111,
78258 Sundanese = 112,
78259 Swahili = 113,
78260 Swedish = 114,
78261 Tagalog = 115,
78262 Tajik = 116,
78263 Tamil = 117,
78264 Tatar = 118,
78265 Telugu = 119,
78266 Thai = 120,
78267 Tibetan = 121,
78268 Tigrinya = 122,
78269 TongaLanguage = 123,
78270 Tsonga = 124,
78271 Turkish = 125,
78272 Turkmen = 126,
78273 Twi = 127,
78274 Uigur = 128,
78275 Ukrainian = 129,
78276 Urdu = 130,
78277 Uzbek = 131,
78278 Vietnamese = 132,
78279 Volapuk = 133,
78280 Welsh = 134,
78281 Wolof = 135,
78282 Xhosa = 136,
78283 Yiddish = 137,
78284 Yoruba = 138,
78285 Zhuang = 139,
78286 Zulu = 140,
78287 NorwegianNynorsk = 141,
78288 Nynorsk = NorwegianNynorsk,
78289 Bosnian = 142,
78290 Divehi = 143,
78291 Manx = 144,
78292 Cornish = 145,
78293 Akan = 146,
78294 Konkani = 147,
78295 Ga = 148,
78296 Igbo = 149,
78297 Kamba = 150,
78298 Syriac = 151,
78299 Blin = 152,
78300 Geez = 153,
78301 Koro = 154,
78302 Sidamo = 155,
78303 Atsam = 156,
78304 Tigre = 157,
78305 Jju = 158,
78306 Friulian = 159,
78307 Venda = 160,
78308 Ewe = 161,
78309 Walamo = 162,
78310 Hawaiian = 163,
78311 Tyap = 164,
78312 Chewa = 165,
78313 LastLanguage = Chewa
78314 };
78315 enum Country {
78316 AnyCountry = 0,
78317 Afghanistan = 1,
78318 Albania = 2,
78319 Algeria = 3,
78320 AmericanSamoa = 4,
78321 Andorra = 5,
78322 Angola = 6,
78323 Anguilla = 7,
78324 Antarctica = 8,
78325 AntiguaAndBarbuda = 9,
78326 Argentina = 10,
78327 Armenia = 11,
78328 Aruba = 12,
78329 Australia = 13,
78330 Austria = 14,
78331 Azerbaijan = 15,
78332 Bahamas = 16,
78333 Bahrain = 17,
78334 Bangladesh = 18,
78335 Barbados = 19,
78336 Belarus = 20,
78337 Belgium = 21,
78338 Belize = 22,
78339 Benin = 23,
78340 Bermuda = 24,
78341 Bhutan = 25,
78342 Bolivia = 26,
78343 BosniaAndHerzegowina = 27,
78344 Botswana = 28,
78345 BouvetIsland = 29,
78346 Brazil = 30,
78347 BritishIndianOceanTerritory = 31,
78348 BruneiDarussalam = 32,
78349 Bulgaria = 33,
78350 BurkinaFaso = 34,
78351 Burundi = 35,
78352 Cambodia = 36,
78353 Cameroon = 37,
78354 Canada = 38,
78355 CapeVerde = 39,
78356 CaymanIslands = 40,
78357 CentralAfricanRepublic = 41,
78358 Chad = 42,
78359 Chile = 43,
78360 China = 44,
78361 ChristmasIsland = 45,
78362 CocosIslands = 46,
78363 Colombia = 47,
78364 Comoros = 48,
78365 DemocraticRepublicOfCongo = 49,
78366 PeoplesRepublicOfCongo = 50,
78367 CookIslands = 51,
78368 CostaRica = 52,
78369 IvoryCoast = 53,
78370 Croatia = 54,
78371 Cuba = 55,
78372 Cyprus = 56,
78373 CzechRepublic = 57,
78374 Denmark = 58,
78375 Djibouti = 59,
78376 Dominica = 60,
78377 DominicanRepublic = 61,
78378 EastTimor = 62,
78379 Ecuador = 63,
78380 Egypt = 64,
78381 ElSalvador = 65,
78382 EquatorialGuinea = 66,
78383 Eritrea = 67,
78384 Estonia = 68,
78385 Ethiopia = 69,
78386 FalklandIslands = 70,
78387 FaroeIslands = 71,
78388 FijiCountry = 72,
78389 Finland = 73,
78390 France = 74,
78391 MetropolitanFrance = 75,
78392 FrenchGuiana = 76,
78393 FrenchPolynesia = 77,
78394 FrenchSouthernTerritories = 78,
78395 Gabon = 79,
78396 Gambia = 80,
78397 Georgia = 81,
78398 Germany = 82,
78399 Ghana = 83,
78400 Gibraltar = 84,
78401 Greece = 85,
78402 Greenland = 86,
78403 Grenada = 87,
78404 Guadeloupe = 88,
78405 Guam = 89,
78406 Guatemala = 90,
78407 Guinea = 91,
78408 GuineaBissau = 92,
78409 Guyana = 93,
78410 Haiti = 94,
78411 HeardAndMcDonaldIslands = 95,
78412 Honduras = 96,
78413 HongKong = 97,
78414 Hungary = 98,
78415 Iceland = 99,
78416 India = 100,
78417 Indonesia = 101,
78418 Iran = 102,
78419 Iraq = 103,
78420 Ireland = 104,
78421 Israel = 105,
78422 Italy = 106,
78423 Jamaica = 107,
78424 Japan = 108,
78425 Jordan = 109,
78426 Kazakhstan = 110,
78427 Kenya = 111,
78428 Kiribati = 112,
78429 DemocraticRepublicOfKorea = 113,
78430 RepublicOfKorea = 114,
78431 Kuwait = 115,
78432 Kyrgyzstan = 116,
78433 Lao = 117,
78434 Latvia = 118,
78435 Lebanon = 119,
78436 Lesotho = 120,
78437 Liberia = 121,
78438 LibyanArabJamahiriya = 122,
78439 Liechtenstein = 123,
78440 Lithuania = 124,
78441 Luxembourg = 125,
78442 Macau = 126,
78443 Macedonia = 127,
78444 Madagascar = 128,
78445 Malawi = 129,
78446 Malaysia = 130,
78447 Maldives = 131,
78448 Mali = 132,
78449 Malta = 133,
78450 MarshallIslands = 134,
78451 Martinique = 135,
78452 Mauritania = 136,
78453 Mauritius = 137,
78454 Mayotte = 138,
78455 Mexico = 139,
78456 Micronesia = 140,
78457 Moldova = 141,
78458 Monaco = 142,
78459 Mongolia = 143,
78460 Montserrat = 144,
78461 Morocco = 145,
78462 Mozambique = 146,
78463 Myanmar = 147,
78464 Namibia = 148,
78465 NauruCountry = 149,
78466 Nepal = 150,
78467 Netherlands = 151,
78468 NetherlandsAntilles = 152,
78469 NewCaledonia = 153,
78470 NewZealand = 154,
78471 Nicaragua = 155,
78472 Niger = 156,
78473 Nigeria = 157,
78474 Niue = 158,
78475 NorfolkIsland = 159,
78476 NorthernMarianaIslands = 160,
78477 Norway = 161,
78478 Oman = 162,
78479 Pakistan = 163,
78480 Palau = 164,
78481 PalestinianTerritory = 165,
78482 Panama = 166,
78483 PapuaNewGuinea = 167,
78484 Paraguay = 168,
78485 Peru = 169,
78486 Philippines = 170,
78487 Pitcairn = 171,
78488 Poland = 172,
78489 Portugal = 173,
78490 PuertoRico = 174,
78491 Qatar = 175,
78492 Reunion = 176,
78493 Romania = 177,
78494 RussianFederation = 178,
78495 Rwanda = 179,
78496 SaintKittsAndNevis = 180,
78497 StLucia = 181,
78498 StVincentAndTheGrenadines = 182,
78499 Samoa = 183,
78500 SanMarino = 184,
78501 SaoTomeAndPrincipe = 185,
78502 SaudiArabia = 186,
78503 Senegal = 187,
78504 Seychelles = 188,
78505 SierraLeone = 189,
78506 Singapore = 190,
78507 Slovakia = 191,
78508 Slovenia = 192,
78509 SolomonIslands = 193,
78510 Somalia = 194,
78511 SouthAfrica = 195,
78512 SouthGeorgiaAndTheSouthSandwichIslands = 196,
78513 Spain = 197,
78514 SriLanka = 198,
78515 StHelena = 199,
78516 StPierreAndMiquelon = 200,
78517 Sudan = 201,
78518 Suriname = 202,
78519 SvalbardAndJanMayenIslands = 203,
78520 Swaziland = 204,
78521 Sweden = 205,
78522 Switzerland = 206,
78523 SyrianArabRepublic = 207,
78524 Taiwan = 208,
78525 Tajikistan = 209,
78526 Tanzania = 210,
78527 Thailand = 211,
78528 Togo = 212,
78529 Tokelau = 213,
78530 TongaCountry = 214,
78531 TrinidadAndTobago = 215,
78532 Tunisia = 216,
78533 Turkey = 217,
78534 Turkmenistan = 218,
78535 TurksAndCaicosIslands = 219,
78536 Tuvalu = 220,
78537 Uganda = 221,
78538 Ukraine = 222,
78539 UnitedArabEmirates = 223,
78540 UnitedKingdom = 224,
78541 UnitedStates = 225,
78542 UnitedStatesMinorOutlyingIslands = 226,
78543 Uruguay = 227,
78544 Uzbekistan = 228,
78545 Vanuatu = 229,
78546 VaticanCityState = 230,
78547 Venezuela = 231,
78548 VietNam = 232,
78549 BritishVirginIslands = 233,
78550 USVirginIslands = 234,
78551 WallisAndFutunaIslands = 235,
78552 WesternSahara = 236,
78553 Yemen = 237,
78554 Yugoslavia = 238,
78555 Zambia = 239,
78556 Zimbabwe = 240,
78557 SerbiaAndMontenegro = 241,
78558 LastCountry = SerbiaAndMontenegro
78559 };
78560 enum MeasurementSystem { MetricSystem, ImperialSystem };
78561 enum FormatType { LongFormat, ShortFormat, NarrowFormat };
78562 enum NumberOption {
78563 OmitGroupSeparator = 0x01,
78564 RejectGroupSeparator = 0x02
78565 };
78566 typedef QFlags<NumberOption> NumberOptions;
78567 QLocale();
78568 QLocale(const QString &name);
78569 QLocale(Language language, Country country = AnyCountry);
78570 QLocale(const QLocale &other);
78571 QLocale &operator=(const QLocale &other);
78572 Language language() const;
78573 Country country() const;
78574 QString name() const;
78575 short toShort(const QString &s, bool *ok = 0, int base = 0) const;
78576 ushort toUShort(const QString &s, bool *ok = 0, int base = 0) const;
78577 int toInt(const QString &s, bool *ok = 0, int base = 0) const;
78578 uint toUInt(const QString &s, bool *ok = 0, int base = 0) const;
78579 qlonglong toLongLong(const QString &s, bool *ok = 0, int base = 0) const;
78580 qlonglong toULongLong(const QString &s, bool *ok = 0, int base = 0) const;
78581 float toFloat(const QString &s, bool *ok = 0) const;
78582 double toDouble(const QString &s, bool *ok = 0) const;
78583 QString toString(qlonglong i) const;
78584 QString toString(qulonglong i) const;
78585 inline QString toString(short i) const;
78586 inline QString toString(ushort i) const;
78587 inline QString toString(int i) const;
78588 inline QString toString(uint i) const;
78589 QString toString(double i, char f = 'g', int prec = 6) const;
78590 inline QString toString(float i, char f = 'g', int prec = 6) const;
78591 QString toString(const QDate &date, const QString &formatStr) const;
78592 QString toString(const QDate &date, FormatType format = LongFormat) const;
78593 QString toString(const QTime &time, const QString &formatStr) const;
78594 QString toString(const QTime &time, FormatType format = LongFormat) const;
78595 QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const;
78596 QString toString(const QDateTime &dateTime, const QString &format) const;
78597 QString dateFormat(FormatType format = LongFormat) const;
78598 QString timeFormat(FormatType format = LongFormat) const;
78599 QString dateTimeFormat(FormatType format = LongFormat) const;
78600 QDate toDate(const QString &string, FormatType = LongFormat) const;
78601 QTime toTime(const QString &string, FormatType = LongFormat) const;
78602 QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const;
78603 QDate toDate(const QString &string, const QString &format) const;
78604 QTime toTime(const QString &string, const QString &format) const;
78605 QDateTime toDateTime(const QString &string, const QString &format) const;
78606 QChar decimalPoint() const;
78607 QChar groupSeparator() const;
78608 QChar percent() const;
78609 QChar zeroDigit() const;
78610 QChar negativeSign() const;
78611 QChar positiveSign() const;
78612 QChar exponential() const;
78613 QString monthName(int, FormatType format = LongFormat) const;
78614 QString standaloneMonthName(int, FormatType format = LongFormat) const;
78615 QString dayName(int, FormatType format = LongFormat) const;
78616 QString standaloneDayName(int, FormatType format = LongFormat) const;
78617 QString amText() const;
78618 QString pmText() const;
78619 MeasurementSystem measurementSystem() const;
78620 inline bool operator==(const QLocale &other) const;
78621 inline bool operator!=(const QLocale &other) const;
78622 static QString languageToString(Language language);
78623 static QString countryToString(Country country);
78624 static void setDefault(const QLocale &locale);
78625 static QLocale c() { return QLocale(C); }
78626 static QLocale system();
78627 static QList<Country> countriesForLanguage(Language lang);
78628 void setNumberOptions(NumberOptions options);
78629 NumberOptions numberOptions() const;
78630 struct Data {
78631 quint16 index;
78632 quint16 numberOptions;
78633 }
78634 ;
78635 private:
78636 friend struct QLocalePrivate;
78637 union {
78638 void *v;
78639 Data p;
78640 };
78641 const QLocalePrivate *d() const;
78642 };
78643 template <> class QTypeInfo<QLocale > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QLocale)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QLocale"; } };
78644 inline QFlags<QLocale::NumberOptions::enum_type> operator|(QLocale::NumberOptions::enum_type f1, QLocale::NumberOptions::enum_type f2) { return QFlags<QLocale::NumberOptions::enum_type>(f1) | f2; } inline QFlags<QLocale::NumberOptions::enum_type> operator|(QLocale::NumberOptions::enum_type f1, QFlags<QLocale::NumberOptions::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QLocale::NumberOptions::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
78645 inline QString QLocale::toString(short i) const
78646 { return toString(qlonglong(i)); }
78647 inline QString QLocale::toString(ushort i) const
78648 { return toString(qulonglong(i)); }
78649 inline QString QLocale::toString(int i) const
78650 { return toString(qlonglong(i)); }
78651 inline QString QLocale::toString(uint i) const
78652 { return toString(qulonglong(i)); }
78653 inline QString QLocale::toString(float i, char f, int prec) const
78654 { return toString(double(i), f, prec); }
78655 inline bool QLocale::operator==(const QLocale &other) const
78656 { return d() == other.d() && numberOptions() == other.numberOptions(); }
78657 inline bool QLocale::operator!=(const QLocale &other) const
78658 { return d() != other.d() || numberOptions() != other.numberOptions(); }
78659 QDataStream &operator<<(QDataStream &, const QLocale &);
78660 QDataStream &operator>>(QDataStream &, QLocale &);
78661 typedef QtValidLicenseForCoreModule QtCoreModule;
78662 class QTextCodec;
78663 class QTextDecoder;
78664 class QTextStreamPrivate;
78665 class QTextStream
78666 {
78667 inline QTextStreamPrivate* d_func() { return reinterpret_cast<QTextStreamPrivate *>(qGetPtrHelper(d_ptr)); } inline const QTextStreamPrivate* d_func() const { return reinterpret_cast<const QTextStreamPrivate *>(qGetPtrHelper(d_ptr)); } friend class QTextStreamPrivate;
78668 public:
78669 enum RealNumberNotation {
78670 SmartNotation,
78671 FixedNotation,
78672 ScientificNotation
78673 };
78674 enum FieldAlignment {
78675 AlignLeft,
78676 AlignRight,
78677 AlignCenter,
78678 AlignAccountingStyle
78679 };
78680 enum Status {
78681 Ok,
78682 ReadPastEnd,
78683 ReadCorruptData
78684 };
78685 enum NumberFlag {
78686 ShowBase = 0x1,
78687 ForcePoint = 0x2,
78688 ForceSign = 0x4,
78689 UppercaseBase = 0x8,
78690 UppercaseDigits = 0x10
78691 };
78692 typedef QFlags<NumberFlag> NumberFlags;
78693 QTextStream();
78694 explicit QTextStream(QIODevice *device);
78695 explicit QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
78696 explicit QTextStream(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
78697 explicit QTextStream(QByteArray *array, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
78698 explicit QTextStream(const QByteArray &array, QIODevice::OpenMode openMode = QIODevice::ReadOnly);
78699 virtual ~QTextStream();
78700 void setCodec(QTextCodec *codec);
78701 void setCodec(const char *codecName);
78702 QTextCodec *codec() const;
78703 void setAutoDetectUnicode(bool enabled);
78704 bool autoDetectUnicode() const;
78705 void setGenerateByteOrderMark(bool generate);
78706 bool generateByteOrderMark() const;
78707 void setLocale(const QLocale &locale);
78708 QLocale locale() const;
78709 void setDevice(QIODevice *device);
78710 QIODevice *device() const;
78711 void setString(QString *string, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
78712 QString *string() const;
78713 Status status() const;
78714 void setStatus(Status status);
78715 void resetStatus();
78716 bool atEnd() const;
78717 void reset();
78718 void flush();
78719 bool seek(qint64 pos);
78720 qint64 pos() const;
78721 void skipWhiteSpace();
78722 QString readLine(qint64 maxlen = 0);
78723 QString readAll();
78724 QString read(qint64 maxlen);
78725 void setFieldAlignment(FieldAlignment alignment);
78726 FieldAlignment fieldAlignment() const;
78727 void setPadChar(QChar ch);
78728 QChar padChar() const;
78729 void setFieldWidth(int width);
78730 int fieldWidth() const;
78731 void setNumberFlags(NumberFlags flags);
78732 NumberFlags numberFlags() const;
78733 void setIntegerBase(int base);
78734 int integerBase() const;
78735 void setRealNumberNotation(RealNumberNotation notation);
78736 RealNumberNotation realNumberNotation() const;
78737 void setRealNumberPrecision(int precision);
78738 int realNumberPrecision() const;
78739 QTextStream &operator>>(QChar &ch);
78740 QTextStream &operator>>(char &ch);
78741 QTextStream &operator>>(signed short &i);
78742 QTextStream &operator>>(unsigned short &i);
78743 QTextStream &operator>>(signed int &i);
78744 QTextStream &operator>>(unsigned int &i);
78745 QTextStream &operator>>(signed long &i);
78746 QTextStream &operator>>(unsigned long &i);
78747 QTextStream &operator>>(qlonglong &i);
78748 QTextStream &operator>>(qulonglong &i);
78749 QTextStream &operator>>(float &f);
78750 QTextStream &operator>>(double &f);
78751 QTextStream &operator>>(QString &s);
78752 QTextStream &operator>>(QByteArray &array);
78753 QTextStream &operator>>(char *c);
78754 QTextStream &operator<<(QBool b);
78755 QTextStream &operator<<(QChar ch);
78756 QTextStream &operator<<(char ch);
78757 QTextStream &operator<<(signed short i);
78758 QTextStream &operator<<(unsigned short i);
78759 QTextStream &operator<<(signed int i);
78760 QTextStream &operator<<(unsigned int i);
78761 QTextStream &operator<<(signed long i);
78762 QTextStream &operator<<(unsigned long i);
78763 QTextStream &operator<<(qlonglong i);
78764 QTextStream &operator<<(qulonglong i);
78765 QTextStream &operator<<(float f);
78766 QTextStream &operator<<(double f);
78767 QTextStream &operator<<(const QString &s);
78768 QTextStream &operator<<(const QByteArray &array);
78769 QTextStream &operator<<(const char *c);
78770 QTextStream &operator<<(const void *ptr);
78771 private:
78772 QTextStream(const QTextStream &); QTextStream &operator=(const QTextStream &);
78773 QScopedPointer<QTextStreamPrivate> d_ptr;
78774 };
78775 inline QFlags<QTextStream::NumberFlags::enum_type> operator|(QTextStream::NumberFlags::enum_type f1, QTextStream::NumberFlags::enum_type f2) { return QFlags<QTextStream::NumberFlags::enum_type>(f1) | f2; } inline QFlags<QTextStream::NumberFlags::enum_type> operator|(QTextStream::NumberFlags::enum_type f1, QFlags<QTextStream::NumberFlags::enum_type> f2) { return f2 | f1; } inline QIncompatibleFlag operator|(QTextStream::NumberFlags::enum_type f1, int f2) { return QIncompatibleFlag(int(f1) | f2); }
78776 typedef QTextStream & (*QTextStreamFunction)(QTextStream &);
78777 typedef void (QTextStream::*QTSMFI)(int);
78778 typedef void (QTextStream::*QTSMFC)(QChar);
78779 class QTextStreamManipulator
78780 {
78781 public:
78782 QTextStreamManipulator(QTSMFI m, int a) { mf = m; mc = 0; arg = a; }
78783 QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; arg = -1; }
78784 void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
78785 private:
78786 QTSMFI mf;
78787 QTSMFC mc;
78788 int arg;
78789 QChar ch;
78790 };
78791 inline QTextStream &operator>>(QTextStream &s, QTextStreamFunction f)
78792 { return (*f)(s); }
78793 inline QTextStream &operator<<(QTextStream &s, QTextStreamFunction f)
78794 { return (*f)(s); }
78795 inline QTextStream &operator<<(QTextStream &s, QTextStreamManipulator m)
78796 { m.exec(s); return s; }
78797 QTextStream &bin(QTextStream &s);
78798 QTextStream &oct(QTextStream &s);
78799 QTextStream &dec(QTextStream &s);
78800 QTextStream &hex(QTextStream &s);
78801 QTextStream &showbase(QTextStream &s);
78802 QTextStream &forcesign(QTextStream &s);
78803 QTextStream &forcepoint(QTextStream &s);
78804 QTextStream &noshowbase(QTextStream &s);
78805 QTextStream &noforcesign(QTextStream &s);
78806 QTextStream &noforcepoint(QTextStream &s);
78807 QTextStream &uppercasebase(QTextStream &s);
78808 QTextStream &uppercasedigits(QTextStream &s);
78809 QTextStream &lowercasebase(QTextStream &s);
78810 QTextStream &lowercasedigits(QTextStream &s);
78811 QTextStream &fixed(QTextStream &s);
78812 QTextStream &scientific(QTextStream &s);
78813 QTextStream &left(QTextStream &s);
78814 QTextStream &right(QTextStream &s);
78815 QTextStream &center(QTextStream &s);
78816 QTextStream &endl(QTextStream &s);
78817 QTextStream &flush(QTextStream &s);
78818 QTextStream &reset(QTextStream &s);
78819 QTextStream &bom(QTextStream &s);
78820 QTextStream &ws(QTextStream &s);
78821 inline QTextStreamManipulator qSetFieldWidth(int width)
78822 {
78823 QTSMFI func = &QTextStream::setFieldWidth;
78824 return QTextStreamManipulator(func,width);
78825 }
78826 inline QTextStreamManipulator qSetPadChar(QChar ch)
78827 {
78828 QTSMFC func = &QTextStream::setPadChar;
78829 return QTextStreamManipulator(func, ch);
78830 }
78831 inline QTextStreamManipulator qSetRealNumberPrecision(int precision)
78832 {
78833 QTSMFI func = &QTextStream::setRealNumberPrecision;
78834 return QTextStreamManipulator(func, precision);
78835 }
78836 typedef QtValidLicenseForCoreModule QtCoreModule;
78837 template <class T>
78838 class QSet
78839 {
78840 typedef QHash<T, QHashDummyValue> Hash;
78841 public:
78842 inline QSet() {}
78843 inline QSet(const QSet<T> &other) : q_hash(other.q_hash) {}
78844 inline QSet<T> &operator=(const QSet<T> &other)
78845 { q_hash = other.q_hash; return *this; }
78846 inline bool operator==(const QSet<T> &other) const
78847 { return q_hash == other.q_hash; }
78848 inline bool operator!=(const QSet<T> &other) const
78849 { return q_hash != other.q_hash; }
78850 inline int size() const { return q_hash.size(); }
78851 inline bool isEmpty() const { return q_hash.isEmpty(); }
78852 inline int capacity() const { return q_hash.capacity(); }
78853 inline void reserve(int size);
78854 inline void squeeze() { q_hash.squeeze(); }
78855 inline void detach() { q_hash.detach(); }
78856 inline bool isDetached() const { return q_hash.isDetached(); }
78857 inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
78858 inline void clear() { q_hash.clear(); }
78859 inline bool remove(const T &value) { return q_hash.remove(value) != 0; }
78860 inline bool contains(const T &value) const { return q_hash.contains(value); }
78861 bool contains(const QSet<T> &set) const;
78862 class const_iterator;
78863 class iterator
78864 {
78865 typedef QHash<T, QHashDummyValue> Hash;
78866 typename Hash::iterator i;
78867 friend class const_iterator;
78868 public:
78869 typedef std::bidirectional_iterator_tag iterator_category;
78870 typedef ptrdiff_t difference_type;
78871 typedef T value_type;
78872 typedef const T *pointer;
78873 typedef const T &reference;
78874 inline iterator() {}
78875 inline iterator(typename Hash::iterator o) : i(o) {}
78876 inline iterator(const iterator &o) : i(o.i) {}
78877 inline iterator &operator=(const iterator &o) { i = o.i; return *this; }
78878 inline const T &operator*() const { return i.key(); }
78879 inline const T *operator->() const { return &i.key(); }
78880 inline bool operator==(const iterator &o) const { return i == o.i; }
78881 inline bool operator!=(const iterator &o) const { return i != o.i; }
78882 inline bool operator==(const const_iterator &o) const
78883 { return i == o.i; }
78884 inline bool operator!=(const const_iterator &o) const
78885 { return i != o.i; }
78886 inline iterator &operator++() { ++i; return *this; }
78887 inline iterator operator++(int) { iterator r = *this; ++i; return r; }
78888 inline iterator &operator--() { --i; return *this; }
78889 inline iterator operator--(int) { iterator r = *this; --i; return r; }
78890 inline iterator operator+(int j) const { return i + j; }
78891 inline iterator operator-(int j) const { return i - j; }
78892 inline iterator &operator+=(int j) { i += j; return *this; }
78893 inline iterator &operator-=(int j) { i -= j; return *this; }
78894 };
78895 class const_iterator
78896 {
78897 typedef QHash<T, QHashDummyValue> Hash;
78898 typename Hash::const_iterator i;
78899 friend class iterator;
78900 public:
78901 typedef std::bidirectional_iterator_tag iterator_category;
78902 typedef ptrdiff_t difference_type;
78903 typedef T value_type;
78904 typedef const T *pointer;
78905 typedef const T &reference;
78906 inline const_iterator() {}
78907 inline const_iterator(typename Hash::const_iterator o) : i(o) {}
78908 inline const_iterator(const const_iterator &o) : i(o.i) {}
78909 inline const_iterator(const iterator &o)
78910 : i(o.i) {}
78911 inline const_iterator &operator=(const const_iterator &o) { i = o.i; return *this; }
78912 inline const T &operator*() const { return i.key(); }
78913 inline const T *operator->() const { return &i.key(); }
78914 inline bool operator==(const const_iterator &o) const { return i == o.i; }
78915 inline bool operator!=(const const_iterator &o) const { return i != o.i; }
78916 inline const_iterator &operator++() { ++i; return *this; }
78917 inline const_iterator operator++(int) { const_iterator r = *this; ++i; return r; }
78918 inline const_iterator &operator--() { --i; return *this; }
78919 inline const_iterator operator--(int) { const_iterator r = *this; --i; return r; }
78920 inline const_iterator operator+(int j) const { return i + j; }
78921 inline const_iterator operator-(int j) const { return i - j; }
78922 inline const_iterator &operator+=(int j) { i += j; return *this; }
78923 inline const_iterator &operator-=(int j) { i -= j; return *this; }
78924 };
78925 inline iterator begin() { return q_hash.begin(); }
78926 inline const_iterator begin() const { return q_hash.begin(); }
78927 inline const_iterator constBegin() const { return q_hash.constBegin(); }
78928 inline iterator end() { return q_hash.end(); }
78929 inline const_iterator end() const { return q_hash.end(); }
78930 inline const_iterator constEnd() const { return q_hash.constEnd(); }
78931 iterator erase(iterator i)
78932 { return q_hash.erase(reinterpret_cast<typename Hash::iterator &>(i)); }
78933 typedef iterator Iterator;
78934 typedef const_iterator ConstIterator;
78935 inline int count() const { return q_hash.count(); }
78936 inline const_iterator insert(const T &value)
78937 { return static_cast<typename Hash::const_iterator>(q_hash.insert(value,
78938 QHashDummyValue())); }
78939 iterator find(const T &value) { return q_hash.find(value); }
78940 const_iterator find(const T &value) const { return q_hash.find(value); }
78941 inline const_iterator constFind(const T &value) const { return find(value); }
78942 QSet<T> &unite(const QSet<T> &other);
78943 QSet<T> &intersect(const QSet<T> &other);
78944 QSet<T> &subtract(const QSet<T> &other);
78945 typedef T key_type;
78946 typedef T value_type;
78947 typedef value_type *pointer;
78948 typedef const value_type *const_pointer;
78949 typedef value_type &reference;
78950 typedef const value_type &const_reference;
78951 typedef ptrdiff_t difference_type;
78952 typedef int size_type;
78953 inline bool empty() const { return isEmpty(); }
78954 inline QSet<T> &operator<<(const T &value) { insert(value); return *this; }
78955 inline QSet<T> &operator|=(const QSet<T> &other) { unite(other); return *this; }
78956 inline QSet<T> &operator|=(const T &value) { insert(value); return *this; }
78957 inline QSet<T> &operator&=(const QSet<T> &other) { intersect(other); return *this; }
78958 inline QSet<T> &operator&=(const T &value)
78959 { QSet<T> result; if (contains(value)) result.insert(value); return (*this = result); }
78960 inline QSet<T> &operator+=(const QSet<T> &other) { unite(other); return *this; }
78961 inline QSet<T> &operator+=(const T &value) { insert(value); return *this; }
78962 inline QSet<T> &operator-=(const QSet<T> &other) { subtract(other); return *this; }
78963 inline QSet<T> &operator-=(const T &value) { remove(value); return *this; }
78964 inline QSet<T> operator|(const QSet<T> &other) const
78965 { QSet<T> result = *this; result |= other; return result; }
78966 inline QSet<T> operator&(const QSet<T> &other) const
78967 { QSet<T> result = *this; result &= other; return result; }
78968 inline QSet<T> operator+(const QSet<T> &other) const
78969 { QSet<T> result = *this; result += other; return result; }
78970 inline QSet<T> operator-(const QSet<T> &other) const
78971 { QSet<T> result = *this; result -= other; return result; }
78972 inline QSet<T> operator|(const QSet<T> &other)
78973 { QSet<T> result = *this; result |= other; return result; }
78974 inline QSet<T> operator&(const QSet<T> &other)
78975 { QSet<T> result = *this; result &= other; return result; }
78976 inline QSet<T> operator+(const QSet<T> &other)
78977 { QSet<T> result = *this; result += other; return result; }
78978 inline QSet<T> operator-(const QSet<T> &other)
78979 { QSet<T> result = *this; result -= other; return result; }
78980 QList<T> toList() const;
78981 inline QList<T> values() const { return toList(); }
78982 static QSet<T> fromList(const QList<T> &list);
78983 private:
78984 Hash q_hash;
78985 };
78986 template <class T>
78987 inline void QSet<T>::reserve(int asize) { q_hash.reserve(asize); }
78988 template <class T>
78989 inline QSet<T> &QSet<T>::unite(const QSet<T> &other)
78990 {
78991 QSet<T> copy(other);
78992 typename QSet<T>::const_iterator i = copy.constEnd();
78993 while (i != copy.constBegin()) {
78994 --i;
78995 insert(*i);
78996 }
78997 return *this;
78998 }
78999 template <class T>
79000 inline QSet<T> &QSet<T>::intersect(const QSet<T> &other)
79001 {
79002 QSet<T> copy1(*this);
79003 QSet<T> copy2(other);
79004 typename QSet<T>::const_iterator i = copy1.constEnd();
79005 while (i != copy1.constBegin()) {
79006 --i;
79007 if (!copy2.contains(*i))
79008 remove(*i);
79009 }
79010 return *this;
79011 }
79012 template <class T>
79013 inline QSet<T> &QSet<T>::subtract(const QSet<T> &other)
79014 {
79015 QSet<T> copy1(*this);
79016 QSet<T> copy2(other);
79017 typename QSet<T>::const_iterator i = copy1.constEnd();
79018 while (i != copy1.constBegin()) {
79019 --i;
79020 if (copy2.contains(*i))
79021 remove(*i);
79022 }
79023 return *this;
79024 }
79025 template <class T>
79026 inline bool QSet<T>::contains(const QSet<T> &other) const
79027 {
79028 typename QSet<T>::const_iterator i = other.constBegin();
79029 while (i != other.constEnd()) {
79030 if (!contains(*i))
79031 return false;
79032 ++i;
79033 }
79034 return true;
79035 }
79036 template <typename T>
79037 QList<T> QSet<T>::toList() const
79038 {
79039 QList<T> result;
79040 typename QSet<T>::const_iterator i = constBegin();
79041 while (i != constEnd()) {
79042 result.append(*i);
79043 ++i;
79044 }
79045 return result;
79046 }
79047 template <typename T>
79048 QSet<T> QList<T>::toSet() const
79049 {
79050 QSet<T> result;
79051 result.reserve(size());
79052 for (int i = 0; i < size(); ++i)
79053 result.insert(at(i));
79054 return result;
79055 }
79056 template <typename T>
79057 QSet<T> QSet<T>::fromList(const QList<T> &list)
79058 {
79059 return list.toSet();
79060 }
79061 template <typename T>
79062 QList<T> QList<T>::fromSet(const QSet<T> &set)
79063 {
79064 return set.toList();
79065 }
79066 template <class T> class QSetIterator { typedef typename QSet<T>::const_iterator const_iterator; QSet<T> c; const_iterator i; public: inline QSetIterator(const QSet<T> &container) : c(container), i(c.constBegin()) {} inline QSetIterator &operator=(const QSet<T> &container) { c = container; i = c.constBegin(); return *this; } inline void toFront() { i = c.constBegin(); } inline void toBack() { i = c.constEnd(); } inline bool hasNext() const { return i != c.constEnd(); } inline const T &next() { return *i++; } inline const T &peekNext() const { return *i; } inline bool hasPrevious() const { return i != c.constBegin(); } inline const T &previous() { return *--i; } inline const T &peekPrevious() const { const_iterator p = i; return *--p; } inline bool findNext(const T &t) { while (i != c.constEnd()) if (*i++ == t) return true; return false; } inline bool findPrevious(const T &t) { while (i != c.constBegin()) if (*(--i) == t) return true; return false; } };
79067 template <typename T>
79068 class QMutableSetIterator
79069 {
79070 typedef typename QSet<T>::iterator iterator;
79071 QSet<T> *c;
79072 iterator i, n;
79073 inline bool item_exists() const { return n != c->constEnd(); }
79074 public:
79075 inline QMutableSetIterator(QSet<T> &container)
79076 : c(&container)
79077 { c->setSharable(false); i = c->begin(); n = c->end(); }
79078 inline ~QMutableSetIterator()
79079 { c->setSharable(true); }
79080 inline QMutableSetIterator &operator=(QSet<T> &container)
79081 { c->setSharable(true); c = &container; c->setSharable(false);
79082 i = c->begin(); n = c->end(); return *this; }
79083 inline void toFront() { i = c->begin(); n = c->end(); }
79084 inline void toBack() { i = c->end(); n = i; }
79085 inline bool hasNext() const { return c->constEnd() != i; }
79086 inline const T &next() { n = i++; return *n; }
79087 inline const T &peekNext() const { return *i; }
79088 inline bool hasPrevious() const { return c->constBegin() != i; }
79089 inline const T &previous() { n = --i; return *n; }
79090 inline const T &peekPrevious() const { iterator p = i; return *--p; }
79091 inline void remove()
79092 { if (c->constEnd() != n) { i = c->erase(n); n = c->end(); } }
79093 inline const T &value() const { ((!(item_exists())) ? qt_assert("item_exists()","/usr/include/qt4/QtCore/qset.h",354) : qt_noop()); return *n; }
79094 inline bool findNext(const T &t)
79095 { while (c->constEnd() != (n = i)) if (*i++ == t) return true; return false; }
79096 inline bool findPrevious(const T &t)
79097 { while (c->constBegin() != i) if (*(n = --i) == t) return true;
79098 n = c->end(); return false; }
79099 };
79100 typedef QtValidLicenseForCoreModule QtCoreModule;
79101 struct QContiguousCacheData
79102 {
79103 QBasicAtomicInt ref;
79104 int alloc;
79105 int count;
79106 int start;
79107 int offset;
79108 uint sharable : 1;
79109 uint reserved : 31;
79110 static QContiguousCacheData *allocate(int size, int alignment);
79111 static void free(QContiguousCacheData *data);
79112 };
79113 template <typename T>
79114 struct QContiguousCacheTypedData: private QContiguousCacheData
79115 {
79116 T array[1];
79117 static inline void free(QContiguousCacheTypedData *data) { QContiguousCacheData::free(data); }
79118 };
79119 template<typename T>
79120 class QContiguousCache {
79121 typedef QContiguousCacheTypedData<T> Data;
79122 union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; };
79123 public:
79124 typedef T value_type;
79125 typedef value_type* pointer;
79126 typedef const value_type* const_pointer;
79127 typedef value_type& reference;
79128 typedef const value_type& const_reference;
79129 typedef ptrdiff_t difference_type;
79130 typedef int size_type;
79131 explicit QContiguousCache(int capacity = 0);
79132 QContiguousCache(const QContiguousCache<T> &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }
79133 inline ~QContiguousCache() { if (!d) return; if (!d->ref.deref()) free(p); }
79134 inline void detach() { if (d->ref != 1) detach_helper(); }
79135 inline bool isDetached() const { return d->ref == 1; }
79136 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
79137 QContiguousCache<T> &operator=(const QContiguousCache<T> &other);
79138 bool operator==(const QContiguousCache<T> &other) const;
79139 inline bool operator!=(const QContiguousCache<T> &other) const { return !(*this == other); }
79140 inline int capacity() const {return d->alloc; }
79141 inline int count() const { return d->count; }
79142 inline int size() const { return d->count; }
79143 inline bool isEmpty() const { return d->count == 0; }
79144 inline bool isFull() const { return d->count == d->alloc; }
79145 inline int available() const { return d->alloc - d->count; }
79146 void clear();
79147 void setCapacity(int size);
79148 const T &at(int pos) const;
79149 T &operator[](int i);
79150 const T &operator[](int i) const;
79151 void append(const T &value);
79152 void prepend(const T &value);
79153 void insert(int pos, const T &value);
79154 inline bool containsIndex(int pos) const { return pos >= d->offset && pos - d->offset < d->count; }
79155 inline int firstIndex() const { return d->offset; }
79156 inline int lastIndex() const { return d->offset + d->count - 1; }
79157 inline const T &first() const { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qcontiguouscache.h",139) : qt_noop()); return p->array[d->start]; }
79158 inline const T &last() const { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qcontiguouscache.h",140) : qt_noop()); return p->array[(d->start + d->count -1) % d->alloc]; }
79159 inline T &first() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qcontiguouscache.h",141) : qt_noop()); detach(); return p->array[d->start]; }
79160 inline T &last() { ((!(!isEmpty())) ? qt_assert("!isEmpty()","/usr/include/qt4/QtCore/qcontiguouscache.h",142) : qt_noop()); detach(); return p->array[(d->start + d->count -1) % d->alloc]; }
79161 void removeFirst();
79162 T takeFirst();
79163 void removeLast();
79164 T takeLast();
79165 inline bool areIndexesValid() const
79166 { return d->offset >= 0 && d->offset < 2147483647 - d->count && (d->offset % d->alloc) == d->start; }
79167 inline void normalizeIndexes() { d->offset = d->start; }
79168 private:
79169 void detach_helper();
79170 QContiguousCacheData *malloc(int aalloc);
79171 void free(Data *x);
79172 int sizeOfTypedData() {
79173 return reinterpret_cast<const char *>(&(reinterpret_cast<const Data *>(this))->array[1]) - reinterpret_cast<const char *>(this);
79174 }
79175 int alignOfTypedData() const
79176 {
79177 return qMax<int>(sizeof(void*), __alignof__(Data));
79178 }
79179 };
79180 template <typename T>
79181 void QContiguousCache<T>::detach_helper()
79182 {
79183 union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
79184 x.d = malloc(d->alloc);
79185 x.d->ref = 1;
79186 x.d->count = d->count;
79187 x.d->start = d->start;
79188 x.d->offset = d->offset;
79189 x.d->alloc = d->alloc;
79190 x.d->sharable = true;
79191 x.d->reserved = 0;
79192 T *dest = x.p->array + x.d->start;
79193 T *src = p->array + d->start;
79194 int oldcount = x.d->count;
79195 while (oldcount--) {
79196 if (QTypeInfo<T>::isComplex) {
79197 new (dest) T(*src);
79198 } else {
79199 *dest = *src;
79200 }
79201 dest++;
79202 if (dest == x.p->array + x.d->alloc)
79203 dest = x.p->array;
79204 src++;
79205 if (src == p->array + d->alloc)
79206 src = p->array;
79207 }
79208 if (!d->ref.deref())
79209 free(p);
79210 d = x.d;
79211 }
79212 template <typename T>
79213 void QContiguousCache<T>::setCapacity(int asize)
79214 {
79215 if (asize == d->alloc)
79216 return;
79217 detach();
79218 union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
79219 x.d = malloc(asize);
79220 x.d->alloc = asize;
79221 x.d->count = qMin(d->count, asize);
79222 x.d->offset = d->offset + d->count - x.d->count;
79223 x.d->start = x.d->offset % x.d->alloc;
79224 T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc;
79225 T *src = p->array + (d->start + d->count-1) % d->alloc;
79226 int oldcount = x.d->count;
79227 while (oldcount--) {
79228 if (QTypeInfo<T>::isComplex) {
79229 new (dest) T(*src);
79230 } else {
79231 *dest = *src;
79232 }
79233 if (dest == x.p->array)
79234 dest = x.p->array + x.d->alloc;
79235 dest--;
79236 if (src == p->array)
79237 src = p->array + d->alloc;
79238 src--;
79239 }
79240 free(p);
79241 d = x.d;
79242 }
79243 template <typename T>
79244 void QContiguousCache<T>::clear()
79245 {
79246 if (d->ref == 1) {
79247 if (QTypeInfo<T>::isComplex) {
79248 int oldcount = d->count;
79249 T * i = p->array + d->start;
79250 T * e = p->array + d->alloc;
79251 while (oldcount--) {
79252 i->~T();
79253 i++;
79254 if (i == e)
79255 i = p->array;
79256 }
79257 }
79258 d->count = d->start = d->offset = 0;
79259 } else {
79260 union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
79261 x.d = malloc(d->alloc);
79262 x.d->ref = 1;
79263 x.d->alloc = d->alloc;
79264 x.d->count = x.d->start = x.d->offset = 0;
79265 x.d->sharable = true;
79266 if (!d->ref.deref()) free(p);
79267 d = x.d;
79268 }
79269 }
79270 template <typename T>
79271 inline QContiguousCacheData *QContiguousCache<T>::malloc(int aalloc)
79272 {
79273 return QContiguousCacheData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData());
79274 }
79275 template <typename T>
79276 QContiguousCache<T>::QContiguousCache(int cap)
79277 {
79278 d = malloc(cap);
79279 d->ref = 1;
79280 d->alloc = cap;
79281 d->count = d->start = d->offset = 0;
79282 d->sharable = true;
79283 }
79284 template <typename T>
79285 QContiguousCache<T> &QContiguousCache<T>::operator=(const QContiguousCache<T> &other)
79286 {
79287 other.d->ref.ref();
79288 if (!d->ref.deref())
79289 free(d);
79290 d = other.d;
79291 if (!d->sharable)
79292 detach_helper();
79293 return *this;
79294 }
79295 template <typename T>
79296 bool QContiguousCache<T>::operator==(const QContiguousCache<T> &other) const
79297 {
79298 if (other.d == d)
79299 return true;
79300 if (other.d->start != d->start
79301 || other.d->count != d->count
79302 || other.d->offset != d->offset
79303 || other.d->alloc != d->alloc)
79304 return false;
79305 for (int i = firstIndex(); i <= lastIndex(); ++i)
79306 if (!(at(i) == other.at(i)))
79307 return false;
79308 return true;
79309 }
79310 template <typename T>
79311 void QContiguousCache<T>::free(Data *x)
79312 {
79313 if (QTypeInfo<T>::isComplex) {
79314 int oldcount = d->count;
79315 T * i = p->array + d->start;
79316 T * e = p->array + d->alloc;
79317 while (oldcount--) {
79318 i->~T();
79319 i++;
79320 if (i == e)
79321 i = p->array;
79322 }
79323 }
79324 x->free(x);
79325 }
79326 template <typename T>
79327 void QContiguousCache<T>::append(const T &value)
79328 {
79329 detach();
79330 if (QTypeInfo<T>::isComplex) {
79331 if (d->count == d->alloc)
79332 (p->array + (d->start+d->count) % d->alloc)->~T();
79333 new (p->array + (d->start+d->count) % d->alloc) T(value);
79334 } else {
79335 p->array[(d->start+d->count) % d->alloc] = value;
79336 }
79337 if (d->count == d->alloc) {
79338 d->start++;
79339 d->start %= d->alloc;
79340 d->offset++;
79341 } else {
79342 d->count++;
79343 }
79344 }
79345 template<typename T>
79346 void QContiguousCache<T>::prepend(const T &value)
79347 {
79348 detach();
79349 if (d->start)
79350 d->start--;
79351 else
79352 d->start = d->alloc-1;
79353 d->offset--;
79354 if (d->count != d->alloc)
79355 d->count++;
79356 else
79357 if (d->count == d->alloc)
79358 (p->array + d->start)->~T();
79359 if (QTypeInfo<T>::isComplex)
79360 new (p->array + d->start) T(value);
79361 else
79362 p->array[d->start] = value;
79363 }
79364 template<typename T>
79365 void QContiguousCache<T>::insert(int pos, const T &value)
79366 {
79367 ((!(pos >= 0 && pos < 2147483647)) ? qt_assert_x("QContiguousCache<T>::insert", "index out of range","/usr/include/qt4/QtCore/qcontiguouscache.h",380) : qt_noop());
79368 detach();
79369 if (containsIndex(pos)) {
79370 if(QTypeInfo<T>::isComplex)
79371 new (p->array + pos % d->alloc) T(value);
79372 else
79373 p->array[pos % d->alloc] = value;
79374 } else if (pos == d->offset-1)
79375 prepend(value);
79376 else if (pos == d->offset+d->count)
79377 append(value);
79378 else {
79379 clear();
79380 d->offset = pos;
79381 d->start = pos % d->alloc;
79382 d->count = 1;
79383 if (QTypeInfo<T>::isComplex)
79384 new (p->array + d->start) T(value);
79385 else
79386 p->array[d->start] = value;
79387 }
79388 }
79389 template <typename T>
79390 inline const T &QContiguousCache<T>::at(int pos) const
79391 { ((!(pos >= d->offset && pos - d->offset < d->count)) ? qt_assert_x("QContiguousCache<T>::at", "index out of range","/usr/include/qt4/QtCore/qcontiguouscache.h",406) : qt_noop()); return p->array[pos % d->alloc]; }
79392 template <typename T>
79393 inline const T &QContiguousCache<T>::operator[](int pos) const
79394 { ((!(pos >= d->offset && pos - d->offset < d->count)) ? qt_assert_x("QContiguousCache<T>::at", "index out of range","/usr/include/qt4/QtCore/qcontiguouscache.h",409) : qt_noop()); return p->array[pos % d->alloc]; }
79395 template <typename T>
79396 inline T &QContiguousCache<T>::operator[](int pos)
79397 {
79398 detach();
79399 if (!containsIndex(pos))
79400 insert(pos, T());
79401 return p->array[pos % d->alloc];
79402 }
79403 template <typename T>
79404 inline void QContiguousCache<T>::removeFirst()
79405 {
79406 ((!(d->count > 0)) ? qt_assert("d->count > 0","/usr/include/qt4/QtCore/qcontiguouscache.h",423) : qt_noop());
79407 detach();
79408 d->count--;
79409 if (QTypeInfo<T>::isComplex)
79410 (p->array + d->start)->~T();
79411 d->start = (d->start + 1) % d->alloc;
79412 d->offset++;
79413 }
79414 template <typename T>
79415 inline void QContiguousCache<T>::removeLast()
79416 {
79417 ((!(d->count > 0)) ? qt_assert("d->count > 0","/usr/include/qt4/QtCore/qcontiguouscache.h",435) : qt_noop());
79418 detach();
79419 d->count--;
79420 if (QTypeInfo<T>::isComplex)
79421 (p->array + (d->start + d->count) % d->alloc)->~T();
79422 }
79423 template <typename T>
79424 inline T QContiguousCache<T>::takeFirst()
79425 { T t = first(); removeFirst(); return t; }
79426 template <typename T>
79427 inline T QContiguousCache<T>::takeLast()
79428 { T t = last(); removeLast(); return t; }
79429 typedef QtValidLicenseForCoreModule QtCoreModule;
79430 class QDebug
79431 {
79432 struct Stream {
79433 Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
79434 Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false) {}
79435 Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), space(true), message_output(true) {}
79436 QTextStream ts;
79437 QString buffer;
79438 int ref;
79439 QtMsgType type;
79440 bool space;
79441 bool message_output;
79442 } *stream;
79443 public:
79444 inline QDebug(QIODevice *device) : stream(new Stream(device)) {}
79445 inline QDebug(QString *string) : stream(new Stream(string)) {}
79446 inline QDebug(QtMsgType t) : stream(new Stream(t)) {}
79447 inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
79448 inline QDebug &operator=(const QDebug &other);
79449 inline ~QDebug() {
79450 if (!--stream->ref) {
79451 if(stream->message_output) {
79452 try {
79453 qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
79454 } catch (std::bad_alloc&) { }
79455 }
79456 delete stream;
79457 }
79458 }
79459 inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
79460 inline QDebug &nospace() { stream->space = false; return *this; }
79461 inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
79462 inline QDebug &operator<<(QChar t) { stream->ts << '\'' << t << '\''; return maybeSpace(); }
79463 inline QDebug &operator<<(QBool t) { stream->ts << (bool(t != 0) ? "true" : "false"); return maybeSpace(); }
79464 inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
79465 inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
79466 inline QDebug &operator<<(signed short t) { stream->ts << t; return maybeSpace(); }
79467 inline QDebug &operator<<(unsigned short t) { stream->ts << t; return maybeSpace(); }
79468 inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }
79469 inline QDebug &operator<<(unsigned int t) { stream->ts << t; return maybeSpace(); }
79470 inline QDebug &operator<<(signed long t) { stream->ts << t; return maybeSpace(); }
79471 inline QDebug &operator<<(unsigned long t) { stream->ts << t; return maybeSpace(); }
79472 inline QDebug &operator<<(qint64 t)
79473 { stream->ts << QString::number(t); return maybeSpace(); }
79474 inline QDebug &operator<<(quint64 t)
79475 { stream->ts << QString::number(t); return maybeSpace(); }
79476 inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
79477 inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
79478 inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); }
79479 inline QDebug &operator<<(const QString & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
79480 inline QDebug &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
79481 inline QDebug &operator<<(const QLatin1String &t) { stream->ts << '\"' << t.latin1() << '\"'; return maybeSpace(); }
79482 inline QDebug &operator<<(const QByteArray & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
79483 inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
79484 inline QDebug &operator<<(QTextStreamFunction f) {
79485 stream->ts << f;
79486 return *this;
79487 }
79488 inline QDebug &operator<<(QTextStreamManipulator m)
79489 { stream->ts << m; return *this; }
79490 };
79491 class QNoDebug
79492 {
79493 public:
79494 inline QNoDebug(){}
79495 inline QNoDebug(const QDebug &){}
79496 inline ~QNoDebug(){}
79497 inline QNoDebug &operator<<(QTextStreamFunction) { return *this; }
79498 inline QNoDebug &operator<<(QTextStreamManipulator) { return *this; }
79499 inline QNoDebug &space() { return *this; }
79500 inline QNoDebug &nospace() { return *this; }
79501 inline QNoDebug &maybeSpace() { return *this; }
79502 template<typename T>
79503 inline QNoDebug &operator<<(const T &) { return *this; }
79504 };
79505 inline QDebug qCritical() { return QDebug(QtCriticalMsg); }
79506 inline QDebug &QDebug::operator=(const QDebug &other)
79507 {
79508 if (this != &other) {
79509 QDebug copy(other);
79510 qSwap(stream, copy.stream);
79511 }
79512 return *this;
79513 }
79514 template <class T>
79515 inline QDebug operator<<(QDebug debug, const QList<T> &list)
79516 {
79517 debug.nospace() << '(';
79518 for (typename QList<T>::size_type i = 0; i < list.count(); ++i) {
79519 if (i)
79520 debug << ", ";
79521 debug << list.at(i);
79522 }
79523 debug << ')';
79524 return debug.space();
79525 }
79526 template <typename T>
79527 inline QDebug operator<<(QDebug debug, const QVector<T> &vec)
79528 {
79529 debug.nospace() << "QVector";
79530 return operator<<(debug, vec.toList());
79531 }
79532 template <class aKey, class aT>
79533 inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map)
79534 {
79535 debug.nospace() << "QMap(";
79536 for (typename QMap<aKey, aT>::const_iterator it = map.constBegin();
79537 it != map.constEnd(); ++it) {
79538 debug << '(' << it.key() << ", " << it.value() << ')';
79539 }
79540 debug << ')';
79541 return debug.space();
79542 }
79543 template <class aKey, class aT>
79544 inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash)
79545 {
79546 debug.nospace() << "QHash(";
79547 for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin();
79548 it != hash.constEnd(); ++it)
79549 debug << '(' << it.key() << ", " << it.value() << ')';
79550 debug << ')';
79551 return debug.space();
79552 }
79553 template <class T1, class T2>
79554 inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair)
79555 {
79556 debug.nospace() << "QPair(" << pair.first << ',' << pair.second << ')';
79557 return debug.space();
79558 }
79559 template <typename T>
79560 inline QDebug operator<<(QDebug debug, const QSet<T> &set)
79561 {
79562 debug.nospace() << "QSet";
79563 return operator<<(debug, set.toList());
79564 }
79565 template <class T>
79566 inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
79567 {
79568 debug.nospace() << "QContiguousCache(";
79569 for (int i = cache.firstIndex(); i <= cache.lastIndex(); ++i) {
79570 debug << cache[i];
79571 if (i != cache.lastIndex())
79572 debug << ", ";
79573 }
79574 debug << ')';
79575 return debug.space();
79576 }
79577 inline QDebug qDebug() { return QDebug(QtDebugMsg); }
79578 inline QDebug qWarning() { return QDebug(QtWarningMsg); }
79579 namespace PySide
79580 {
79581 class __attribute__ ((visibility("default"))) qptr_base
79582 {
79583 public:
79584 enum construction_mode {
79585 none = 0x00000000,
79586 check_cache = 0x00000001,
79587 no_check_cache = 0x00000002,
79588 wrapper_pointer = 0x00000004,
79589 no_wrapper_pointer = 0x00000008
79590 };
79591 qptr_base(void* cpp_obj, PyObject *py_obj, void (*deleter)(void*), int mode);
79592 qptr_base(const qptr_base& other);
79593 qptr_base() : m_data(0) {}
79594 virtual ~qptr_base();
79595 static void invalidate(void *cpp_obj, bool cleanup = false);
79596 static bool exists(void *cpp_obj);
79597 bool is_null() const;
79598 qptr_base& operator=(const qptr_base& other);
79599 bool
79600 operator==(const qptr_base& other)
79601 {
79602 return m_data == other.m_data;
79603 }
79604 void acquire_ownership();
79605 void release_ownership();
79606 bool has_ownership();
79607 bool is_wrapper() const;
79608 void add_cpp_ref();
79609 void remove_cpp_ref();
79610 bool has_cpp_ref();
79611 void add_child(qptr_base &child);
79612 void remove_child(qptr_base &child);
79613 void remove_parent();
79614 PyObject* get_pyobject();
79615 void set_pyobject(PyObject *py_obj);
79616 void release();
79617 bool has_parent();
79618 int children_count();
79619 int refcount();
79620 static inline int list_size() { return m_cpp_to_qptrs.size(); }
79621 void* raw_ptr() const;
79622 protected:
79623 bool ptr_assert() const;
79624 void destroy();
79625 void invalidate();
79626 void invalidate(bool invalidate_ptr);
79627 class qptr_base_private;
79628 mutable qptr_base_private* m_data;
79629 static QHash<const volatile void*, qptr_base_private*> m_cpp_to_qptrs;
79630 explicit qptr_base(qptr_base::qptr_base_private* data);
79631 qptr_base_private* create_copy() const;
79632 };
79633 template<typename T>
79634 inline __attribute__ ((visibility("internal")))
79635 void delete_pointer(T *p)
79636 {
79637 delete p;
79638 }
79639 template<typename T>
79640 inline __attribute__ ((visibility("internal")))
79641 void delete_pointer_helper(void* p)
79642 {
79643 T *ptr = reinterpret_cast<T*>(p);
79644 delete_pointer(ptr);
79645 }
79646 template<class T,
79647 int c_mode = (int) qptr_base::check_cache>
79648 class __attribute__ ((visibility("internal"))) qptr : public qptr_base
79649 {
79650 public:
79651 typedef T element_type;
79652 typedef T value_type;
79653 typedef T * pointer;
79654 public:
79655 qptr(T* ptr, int mode = c_mode)
79656 : qptr_base(get_void_pointer(ptr),
79657 (mode & wrapper_pointer ? extract_pyobject(ptr, boost::is_polymorphic<T>()) : 0 ),
79658 &delete_pointer_helper<T>, mode)
79659 {
79660 }
79661 template<typename Y>
79662 qptr(const qptr<Y>& ptr) : qptr_base(ptr)
79663 {
79664 }
79665 qptr(T* ptr, PyObject* py_obj)
79666 : qptr_base(get_void_pointer(ptr), py_obj, &delete_pointer_helper<T>, no_check_cache | no_wrapper_pointer)
79667 {
79668 }
79669 qptr(PyObject* py_obj)
79670 : qptr_base(get_void_pointer(boost::python::extract<T*>(py_obj)), py_obj,
79671 &delete_pointer_helper<T>, c_mode)
79672 {
79673 }
79674 template<typename Y>
79675 qptr&
79676 operator=(const qptr<Y>& ptr)
79677 {
79678 if ( m_data != ptr.m_data ) {
79679 release();
79680 m_data = ptr.create_copy();
79681 }
79682 return *this;
79683 }
79684 inline T&
79685 operator*() const
79686 {
79687 return *get();
79688 }
79689 inline T*
79690 operator->() const
79691 {
79692 return get();
79693 }
79694 inline T*
79695 get() const
79696 {
79697 ptr_assert();
79698 return reinterpret_cast<T*>(raw_ptr());
79699 }
79700 ~qptr()
79701 {
79702 if (!is_null() && refcount() == 1 && has_cpp_ref()) {
79703 notify_ptr_del(reinterpret_cast<T*>(raw_ptr()), boost::is_polymorphic<T>());
79704 }
79705 }
79706 static inline void* get_void_pointer(T* pointer)
79707 {
79708 return get_void_pointer(pointer, boost::is_polymorphic<T>());
79709 }
79710 private:
79711 static inline PyObject*
79712 extract_pyobject(T* ptr, boost::mpl::false_)
79713 {
79714 return 0;
79715 }
79716 static inline PyObject*
79717 extract_pyobject(T* ptr, boost::mpl::true_)
79718 {
79719 PySide::wrapper *w = dynamic_cast<PySide::wrapper*>(ptr);
79720 if (w)
79721 return w->py_object();
79722 else
79723 return 0;
79724 }
79725 static inline void
79726 notify_ptr_del(T* ptr, boost::mpl::false_)
79727 {
79728 }
79729 static inline void
79730 notify_ptr_del(T* ptr, boost::mpl::true_)
79731 {
79732 PySide::wrapper *w = dynamic_cast<PySide::wrapper*>(ptr);
79733 if (w)
79734 w->keep_cpp_ref();
79735 }
79736 static inline void*
79737 get_void_pointer(T* ptr, boost::mpl::false_)
79738 {
79739 return static_cast<void*>(ptr);
79740 }
79741 static inline void*
79742 get_void_pointer(T* ptr, boost::mpl::true_)
79743 {
79744 boost::python::objects::dynamic_id_t base_id =
79745 boost::python::objects::polymorphic_id_generator<T>::execute(ptr);
79746 return base_id.first;
79747 }
79748 };
79749 template<class T, int mode>
79750 inline __attribute__ ((visibility("internal"))) T*
79751 get_pointer(qptr<T, mode> const& p){
79752 return p.get();
79753 }
79754 }
79755 namespace PySide
79756 {
79757 template <
79758 class T
79759 , class BasePolicy_ = boost::python::default_call_policies>
79760 struct __attribute__ ((visibility("internal"))) register_wrapper_object : BasePolicy_
79761 {
79762 template <class ArgumentPackage>
79763 static PyObject*
79764 postcall(ArgumentPackage const& args_, PyObject* result)
79765 {
79766 result = BasePolicy_::postcall(args_, result);
79767 if (result) {
79768 PyObject* py_self =
79769 boost::python::detail::get_prev<1>::execute(args_, result);
79770 qptr<T> ptr_parent(py_self);
79771 }
79772 return result;
79773 }
79774 };
79775 template <
79776 std::size_t parent
79777 , std::size_t child
79778 , class T_PARENT
79779 , class T_CHILD
79780 , class BasePolicy_ = boost::python::default_call_policies
79781 , class T = void>
79782 struct __attribute__ ((visibility("internal"))) parent_policy_add : BasePolicy_
79783 {
79784 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((parent != child) == 0 ? false : true) >)> boost_static_assert_typedef_81;
79785 template <class ArgumentPackage>
79786 static PyObject*
79787 postcall(ArgumentPackage const& args_, PyObject* result)
79788 {
79789 unsigned arity_ = boost::python::detail::arity(args_);
79790 if ((std::max)(parent, child) > arity_) {
79791 return BasePolicy_::postcall(args_, result);
79792 }
79793 result = BasePolicy_::postcall(args_, result);
79794 if (result) {
79795 PyObject* py_parent = (&_Py_NoneStruct);
79796 if (parent <= arity_)
79797 py_parent = boost::python::detail::get_prev<parent>::execute(args_, result);
79798 PyObject* py_child = boost::python::detail::get_prev<child>::execute(args_, result);
79799 if (py_child == (&_Py_NoneStruct)) {
79800 return result;
79801 } else if (py_parent == (&_Py_NoneStruct)) {
79802 qptr<T_CHILD> ptr_child(py_child);
79803 ptr_child.remove_parent();
79804 } else {
79805 qptr<T_PARENT> ptr_parent(py_parent);
79806 qptr<T_CHILD> ptr_child(py_child);
79807 if (ptr_parent.is_wrapper()) {
79808 ptr_parent.add_child(ptr_child);
79809 } else {
79810 ptr_child.add_cpp_ref();
79811 }
79812 }
79813 }
79814 return result;
79815 }
79816 };
79817 template < std::size_t parent
79818 , std::size_t child
79819 , class T_PARENT
79820 , class BasePolicy_
79821 , class T>
79822 struct __attribute__ ((visibility("internal"))) parent_policy_add<parent, child, T_PARENT, QList<T*>, BasePolicy_ > : BasePolicy_
79823 {
79824 template <class ArgumentPackage>
79825 static PyObject*
79826 postcall(ArgumentPackage const& args_, PyObject* result)
79827 {
79828 unsigned arity_ = boost::python::detail::arity(args_);
79829 if ((std::max)(parent, child) > arity_) {
79830 return BasePolicy_::postcall(args_, result);
79831 }
79832 result = BasePolicy_::postcall(args_, result);
79833 if (result) {
79834 PyObject* py_parent = (&_Py_NoneStruct);
79835 if (parent <= arity_)
79836 py_parent = boost::python::detail::get_prev<parent>::execute(args_, result);
79837 PyObject* py_child = boost::python::detail::get_prev<child>::execute(args_, result);
79838 if (py_child == (&_Py_NoneStruct) || !((((((PyObject*)(py_child))->ob_type))->tp_flags & ((1L<<25))) != 0)) {
79839 return result;
79840 } else if (py_parent == (&_Py_NoneStruct)) {
79841 Py_ssize_t max = PyList_Size(py_child);
79842 for (Py_ssize_t i = 0; i < max; ++i) {
79843 qptr<T> ptr_child(PyList_GetItem(py_child, i));
79844 ptr_child.remove_parent();
79845 }
79846 } else {
79847 Py_ssize_t max = PyList_Size(py_child);
79848 qptr<T_PARENT> ptr_parent(py_parent);
79849 for (Py_ssize_t i = 0; i < max; ++i) {
79850 qptr<T> ptr_child(PyList_GetItem(py_child, i));
79851 if (ptr_parent.is_wrapper()) {
79852 ptr_parent.add_child(ptr_child);
79853 } else {
79854 ptr_child.add_cpp_ref();
79855 }
79856 }
79857 }
79858 }
79859 return result;
79860 }
79861 };
79862 template <
79863 std::size_t arg_index
79864 , bool release_ownership
79865 , class T
79866 , class BasePolicy_ = boost::python::default_call_policies>
79867 struct __attribute__ ((visibility("internal"))) transfer_ownership : BasePolicy_
79868 {
79869 template <class ArgumentPackage>
79870 static PyObject*
79871 postcall(ArgumentPackage const& args_, PyObject* result)
79872 {
79873 unsigned arity_ = boost::python::detail::arity(args_);
79874 if (arg_index > arity_) {
79875 PyErr_SetString(PyExc_IndexError,
79876 "PySide::transfer_ownership: argument index out of range");
79877 return 0;
79878 }
79879 result = BasePolicy_::postcall(args_, result);
79880 if (result) {
79881 PyObject* py_arg = boost::python::detail::get_prev<arg_index>::execute(args_, result);
79882 qptr<T> ptr_child(py_arg);
79883 if (release_ownership)
79884 ptr_child.release_ownership();
79885 else
79886 ptr_child.acquire_ownership();
79887 }
79888 return result;
79889 }
79890 };
79891 template <
79892 std::size_t parent
79893 , std::size_t child
79894 , class T_PARENT
79895 , class T_CHILD
79896 , class BasePolicy_ = boost::python::default_call_policies
79897 , class T = void>
79898 struct __attribute__ ((visibility("internal"))) parent_policy_remove : BasePolicy_
79899 {
79900 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((parent != child) == 0 ? false : true) >)> boost_static_assert_typedef_232;
79901 template <class ArgumentPackage>
79902 static PyObject*
79903 postcall(ArgumentPackage const& args_, PyObject* result)
79904 {
79905 unsigned arity_ = boost::python::detail::arity(args_);
79906 if ((std::max)(parent, child) > arity_) {
79907 PyErr_SetString(PyExc_IndexError,
79908 "PyQt::parent_policy_remove: argument index out of range");
79909 return 0;
79910 }
79911 result = BasePolicy_::postcall(args_, result);
79912 if (result) {
79913 PyObject* py_parent = 0;
79914 if (parent <= arity_)
79915 py_parent = boost::python::detail::get_prev<parent>::execute(args_, result);
79916 PyObject* py_child = boost::python::detail::get_prev<child>::execute(args_, result);
79917 qptr<T_PARENT> ptr_parent(py_parent);
79918 qptr<T_CHILD> ptr_child(py_child);
79919 if (ptr_parent.is_wrapper()) {
79920 ptr_child.remove_parent();
79921 } else {
79922 ptr_child.remove_cpp_ref();
79923 }
79924 }
79925 return result;
79926 }
79927 };
79928 template < std::size_t parent
79929 , std::size_t child
79930 , class T_PARENT
79931 , class BasePolicy_
79932 , class T>
79933 struct __attribute__ ((visibility("internal"))) parent_policy_remove<parent, child, T_PARENT, QList<T*>, BasePolicy_> : BasePolicy_
79934 {
79935 typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE< ((parent != child) == 0 ? false : true) >)> boost_static_assert_typedef_274;
79936 template <class ArgumentPackage>
79937 static PyObject*
79938 postcall(ArgumentPackage const& args_, PyObject* result)
79939 {
79940 unsigned arity_ = boost::python::detail::arity(args_);
79941 if ((std::max)(parent, child) > arity_) {
79942 PyErr_SetString(PyExc_IndexError,
79943 "PyQt::parent_policy_remove: argument index out of range");
79944 return 0;
79945 }
79946 result = BasePolicy_::postcall(args_, result);
79947 if (result) {
79948 PyObject* py_parent = 0;
79949 if (parent <= arity_)
79950 py_parent = boost::python::detail::get_prev<parent>::execute(args_, result);
79951 PyObject* py_child = boost::python::detail::get_prev<child>::execute(args_, result);
79952 if (((((((PyObject*)(py_child))->ob_type))->tp_flags & ((1L<<25))) != 0)) {
79953 qptr<T_PARENT> ptr_parent(py_parent);
79954 uint max = PyList_Size(py_child);
79955 for (Py_ssize_t i = 0; i < max; ++i) {
79956 qptr<T> ptr_child(PyList_GetItem(py_child, i));
79957 if (ptr_parent.is_wrapper()) {
79958 ptr_child.remove_parent();
79959 } else {
79960 ptr_child.remove_cpp_ref();
79961 }
79962 }
79963 }
79964 }
79965 return result;
79966 }
79967 };
79968 template<bool cpp_ownership>
79969 struct __attribute__ ((visibility("internal"))) make_ptr_reference_holder
79970 {
79971 template <class T>
79972 static PyObject*
79973 execute(T* p)
79974 {
79975 if(p == 0)
79976 {
79977 return boost::python::incref((&_Py_NoneStruct));
79978 }
79979 qptr<T> ptr(const_cast<T*>(p));
79980 PyObject *ret = ptr.get_pyobject();
79981 if (ret)
79982 return boost::python::incref(ret);
79983 ptr.set_pyobject(execute_impl(p));
79984 if (cpp_ownership) {
79985 ptr.release_ownership();
79986 }
79987 return ptr.get_pyobject();
79988 }
79989 template <class T>
79990 static PyObject*
79991 execute_impl(T* p)
79992 {
79993 typedef qptr<T> smart_pointer;
79994 typedef boost::python::objects::pointer_holder<smart_pointer, T> holder_t;
79995 smart_pointer ptr(const_cast<T*>(p));
79996 PyObject *ret = boost::python::objects::make_ptr_instance<T, holder_t>::execute(ptr);
79997 ptr.set_pyobject(ret);
79998 return ret;
79999 }
80000 };
80001 template <bool cpp_ownership = false>
80002 struct __attribute__ ((visibility("internal"))) return_ptr_object
80003 {
80004 template <class T>
80005 struct apply
80006 {
80007 typedef typename boost::mpl::if_c<
80008 boost::is_pointer<T>::value
80009 , boost::python::to_python_indirect<T, make_ptr_reference_holder<cpp_ownership> >
80010 , boost::python::detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T>
80011 >::type type;
80012 };
80013 };
80014 struct __attribute__ ((visibility("internal"))) reference_ptr_object
80015 {
80016 template <class T>
80017 struct apply
80018 {
80019 static const bool ok = boost::is_pointer<T>::value || boost::is_reference<T>::value
80020 ;
80021 typedef typename boost::mpl::if_c<
80022 ok
80023 , boost::python::to_python_indirect<T, make_ptr_reference_holder<false> >
80024 , boost::python::detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T>
80025 >::type type;
80026 };
80027 };
80028 template < std::size_t parent_arg
80029 , std::size_t child_arg
80030 , class T_PARENT
80031 , class T_CHILD
80032 , class BasePolicy_ = boost::python::default_call_policies
80033 , class T = void >
80034 struct __attribute__ ((visibility("internal"))) return_object
80035 : parent_policy_add<parent_arg, child_arg, T_PARENT, T_CHILD, BasePolicy_, T>
80036 {
80037 private:
80038 static const bool legal = parent_arg > 0;
80039 public:
80040 typedef typename boost::mpl::if_c<
80041 legal
80042 , reference_ptr_object
80043 , boost::python::detail::return_internal_reference_owner_arg_must_be_greater_than_zero<parent_arg>
80044 >::type result_converter;
80045 };
80046 template < std::size_t parent_arg
80047 , std::size_t child_arg
80048 , class T_PARENT
80049 , class BasePolicy_
80050 , class T >
80051 struct __attribute__ ((visibility("internal"))) return_object<parent_arg, child_arg, T_PARENT, QList<T>, BasePolicy_>
80052 : parent_policy_add<parent_arg, child_arg, T_PARENT, QList<T>, BasePolicy_, T>
80053 {
80054 };
80055 template<class T>
80056 inline boost::python::handle<>
80057 ptr(T* data, bool take_ownership = false)
80058 {
80059 if (data == 0)
80060 return boost::python::handle<>(boost::python::incref((&_Py_NoneStruct)));
80061 PyObject *ret;
80062 if (take_ownership) {
80063 boost::python::to_python_indirect<T, make_ptr_reference_holder<false> >
80064 convert;
80065 ret = convert(data);
80066 } else {
80067 boost::python::to_python_indirect<T, make_ptr_reference_holder<true> >
80068 convert;
80069 ret = convert(data);
80070 }
80071 return boost::python::handle<>(ret);
80072 }
80073 }
80074 namespace PySide
80075 {
80076 template <class Container, bool NoProxy, class DerivedPolicies>
80077 class __attribute__ ((visibility("internal"))) qcontainer_indexing_suite;
80078 template <class Container, bool NoProxy>
80079 class __attribute__ ((visibility("internal"))) final_qcontainer_derived_policies
80080 : public qcontainer_indexing_suite<Container, NoProxy,
80081 final_qcontainer_derived_policies<Container, NoProxy> >
80082 {};
80083 template <class Container,
80084 bool NoProxy = false,
80085 class DerivedPolicies = final_qcontainer_derived_policies<Container,
80086 NoProxy> >
80087 class __attribute__ ((visibility("internal"))) qcontainer_indexing_suite
80088 : public boost::python::indexing_suite <Container,
80089 DerivedPolicies,
80090 NoProxy>
80091 {
80092 public:
80093 typedef typename Container::value_type data_type;
80094 typedef typename Container::value_type key_type;
80095 typedef typename Container::size_type index_type;
80096 typedef typename Container::size_type size_type;
80097 typedef typename Container::difference_type difference_type;
80098 static typename boost::mpl::if_<boost::is_class<data_type>,
80099 data_type&,
80100 data_type>::type
80101 get_item(Container& container, index_type i)
80102 {
80103 return container[i];
80104 }
80105 static boost::python::object
80106 get_slice(Container& container, index_type from, index_type to)
80107 {
80108 if (from > to)
80109 return boost::python::object(Container());
80110 return boost::python::object(container.mid(from, to-from));
80111 }
80112 static void
80113 set_item(Container& container, index_type i, data_type const& v)
80114 {
80115 container[i] = v;
80116 }
80117 static void
80118 set_slice(Container& container, index_type from,
80119 index_type to, data_type const& v)
80120 {
80121 if (from > to)
80122 return;
80123 container.erase(container.begin()+from, container.end()+to);
80124 container.insert(container.begin()+from, v);
80125 }
80126 template <class Iter>
80127 static void
80128 set_slice(Container& container, index_type from,
80129 index_type to, Iter first, Iter last)
80130 {
80131 if (from > to) {
80132 std::copy(first, last, container.begin()+from);
80133 } else {
80134 container.erase(container.begin()+from, container.end()+to);
80135 std::copy(first, last, container.begin()+from);
80136 }
80137 }
80138 static void
80139 delete_item(Container& container, index_type i)
80140 {
80141 container.erase(container.begin()+i);
80142 }
80143 static void
80144 delete_slice(Container& container, index_type from, index_type to)
80145 {
80146 if (from > to)
80147 return;
80148 container.erase(container.begin()+from, container.begin()+to);
80149 }
80150 static size_t
80151 size(Container& container)
80152 {
80153 return container.size();
80154 }
80155 static bool
80156 contains(Container& container, key_type const& key)
80157 {
80158 return std::find(container.begin(), container.end(), key)
80159 != container.end();
80160 }
80161 static index_type
80162 convert_index(Container& container, PyObject* i_)
80163 {
80164 boost::python::extract<long> i(i_);
80165 if (i.check()) {
80166 long index = i();
80167 if (index < 0)
80168 index += DerivedPolicies::size(container);
80169 if (index >= long(container.size()) || index < 0) {
80170 PyErr_SetString(PyExc_IndexError, "Index out of range");
80171 boost::python::throw_error_already_set();
80172 }
80173 return index;
80174 }
80175 PyErr_SetString(PyExc_TypeError, "Invalid index type");
80176 boost::python::throw_error_already_set();
80177 return index_type();
80178 }
80179 static index_type
80180 get_min_index(Container& )
80181 {
80182 return 0;
80183 }
80184 static index_type
80185 get_max_index(Container& container)
80186 {
80187 return container.size();
80188 }
80189 static bool
80190 compare_index(Container& , index_type a, index_type b)
80191 {
80192 return a < b;
80193 }
80194 static void
80195 append(Container& container, data_type const& v)
80196 {
80197 container.push_back(v);
80198 }
80199 };
80200 }
80201 namespace PySide
80202 {
80203 class __attribute__ ((visibility("default"))) thread_support
80204 {
80205 private:
80206 static bool m_enabled;
80207 thread_support() {}
80208 public:
80209 static void init();
80210 static void shutdown();
80211 static inline bool enabled();
80212 };
80213 class __attribute__ ((visibility("default"))) thread_locker
80214 {
80215 private:
80216 PyThreadState *m_thread_state;
80217 PyGILState_STATE m_gstate;
80218 public:
80219 thread_locker();
80220 ~thread_locker();
80221 };
80222 class __attribute__ ((visibility("default"))) py_allow_threads
80223 {
80224 private:
80225 PyThreadState *_save;
80226 public:
80227 py_allow_threads();
80228 ~py_allow_threads();
80229 };
80230 }
80231 namespace PySide
80232 {
80233 class __attribute__ ((visibility("internal"))) type_details
80234 {
80235 typedef boost::python::object(*func_cpp_to_python_type)(void*);
80236 typedef QGenericArgument(*func_python_to_cpp_type)(const boost::python::object&, const char*);
80237 typedef void(*func_delete_type)(void*);
80238 type_details() {}
80239 type_details(const type_details&);
80240 type_details& operator=(const type_details&);
80241 public:
80242 template<typename T>
80243 static type_details*
80244 create_object_type_details(const char* type_name) {
80245 type_details* self = new type_details();
80246 self->m_type_name = type_name;
80247 self->m_type_object = boost::python::converter::registry::query(boost::python::type_id<T>())->get_class_object();
80248 self->m_func_cpp_to_python = &objecttype_to_python<T>;
80249 self->m_func_python_to_cpp = &python_to_objecttype<T*>;
80250 self->m_func_delete = 0;
80251 return self;
80252 }
80253 template<typename T>
80254 static type_details*
80255 create_value_type_details(const char* type_name) {
80256 type_details* self = new type_details();
80257 self->m_type_name = type_name;
80258 self->m_type_object = boost::python::converter::registry::query(boost::python::type_id<T>())->get_class_object();
80259 self->m_func_cpp_to_python = &valuetype_to_python<T>;
80260 self->m_func_python_to_cpp = &python_to_value_type<T>;
80261 self->m_func_delete = &func_delete_data<T>;
80262 return self;
80263 }
80264 template<typename T>
80265 static type_details*
80266 create_native_type_details(const char* type_name) {
80267 type_details* self = new type_details();
80268 self->m_type_name = type_name;
80269 self->m_type_object = 0;
80270 self->m_func_cpp_to_python = &native_to_python<T>;
80271 self->m_func_python_to_cpp = &python_to_value_type<T>;
80272 self->m_func_delete = &func_delete_data<T>;
80273 return self;
80274 }
80275 template<typename T>
80276 static type_details*
80277 create_container_type_details(const char* type_name) {
80278 type_details* self = new type_details();
80279 self->m_type_name = type_name;
80280 self->m_type_object = 0;
80281 self->m_func_cpp_to_python = &container_to_python<T>;
80282 self->m_func_python_to_cpp = &python_to_container<T>;
80283 self->m_func_delete = &func_delete_data<T>;
80284 return self;
80285 }
80286 boost::python::object
80287 to_python(void *data) const
80288 {
80289 return m_func_cpp_to_python(data);
80290 }
80291 QGenericArgument
80292 to_cpp(const boost::python::object &obj) const
80293 {
80294 return m_func_python_to_cpp(obj, m_type_name);
80295 }
80296 const PyTypeObject*
80297 get_python_type_object() const
80298 {
80299 return m_type_object;
80300 }
80301 void
80302 delete_data(QGenericArgument &arg) const
80303 {
80304 if (m_func_delete)
80305 m_func_delete(arg.data());
80306 }
80307 private:
80308 const char* m_type_name;
80309 const PyTypeObject *m_type_object;
80310 func_cpp_to_python_type m_func_cpp_to_python;
80311 func_python_to_cpp_type m_func_python_to_cpp;
80312 func_delete_type m_func_delete;
80313 template <class T>
80314 static boost::python::object
80315 objecttype_to_python(void* p)
80316 {
80317 T* obj = *(reinterpret_cast< T*(*)>(p));
80318 boost::python::object py_obj(PySide::ptr(obj));
80319 if (!py_obj.ptr())
80320 {
80321 fprintf(stderr, "Fail to create python object from object in adress: %p\n", obj);
80322 py_obj = boost::python::object();
80323 }
80324 else
80325 {
80326 boost::python::incref(py_obj.ptr());
80327 }
80328 return py_obj;
80329 }
80330 template <class T>
80331 static QGenericArgument
80332 python_to_objecttype(const boost::python::object &obj, const char *type_name)
80333 {
80334 T val = boost::python::extract<T>(obj);
80335 return QGenericArgument(type_name, val);
80336 }
80337 template <class T>
80338 static boost::python::object
80339 valuetype_to_python(void* p)
80340 {
80341 T* val = reinterpret_cast<T*>(p);
80342 return boost::python::object(val);
80343 }
80344 template <class T>
80345 static QGenericArgument
80346 python_to_value_type(const boost::python::object& obj, const char *type_name)
80347 {
80348 T* val = new T(boost::python::extract<T>(obj));
80349 return QGenericArgument(type_name, static_cast<const void*>(val));
80350 }
80351 template <typename T>
80352 static QGenericArgument
80353 python_to_container(const boost::python::object& obj, const char* type_name)
80354 {
80355 T* val = new T(boost::python::extract<T>(obj));
80356 return QGenericArgument(type_name, static_cast<const void*>(val));
80357 }
80358 template <typename T>
80359 static boost::python::object
80360 container_to_python(void* p)
80361 {
80362 return boost::python::object(reinterpret_cast<T*>(p));
80363 }
80364 template<typename T>
80365 static boost::python::object
80366 container_value_to_python(T t)
80367 {
80368 return valuetype_to_python<T>(&t);
80369 }
80370 template<typename T>
80371 static boost::python::object
80372 container_value_to_python(T* t)
80373 {
80374 return objecttype_to_python<T>(&t);
80375 }
80376 template <class T>
80377 static void
80378 func_delete_data(void *data)
80379 {
80380 delete reinterpret_cast<T*>(data);
80381 }
80382 template<typename T>
80383 static boost::python::object
80384 native_to_python(void* p)
80385 {
80386 T* val = new T(*reinterpret_cast<T*>(p));
80387 return boost::python::object(*val);
80388 }
80389 };
80390 }
80391 namespace PySide
80392 {
80393 class __attribute__ ((visibility("default"))) type_manager
80394 {
80395 public:
80396 static type_manager& instance();
80397 ~type_manager();
80398 boost::python::object to_python(const QString &name, void *data);
80399 QGenericArgument to_cpp(const QString &name, const boost::python::object &obj);
80400 void delete_data(QGenericArgument &arg);
80401 template<typename T>
80402 void __attribute__ ((visibility("internal")))
80403 register_object_type(const char* type_name)
80404 {
80405 m_type_map[type_name] = type_details::create_object_type_details<T>(type_name);
80406 }
80407 template<typename T>
80408 void __attribute__ ((visibility("internal")))
80409 register_value_type(const char* type_name)
80410 {
80411 m_type_map[type_name] = type_details::create_value_type_details<T>(type_name);
80412 }
80413 template<typename T>
80414 void __attribute__ ((visibility("internal")))
80415 register_native_type(const char* type_name)
80416 {
80417 m_type_map[type_name] = type_details::create_native_type_details<T>(type_name);
80418 }
80419 template<typename T>
80420 void __attribute__ ((visibility("internal")))
80421 register_container_type(const char* type_name)
80422 {
80423 m_type_map[type_name] = type_details::create_container_type_details<T>(type_name);
80424 }
80425 bool __attribute__ ((visibility("internal")))
80426 register_converter(const char* type_name) {
80427 QString key(type_name);
80428 if (m_registered_converters.contains(key))
80429 return false;
80430 m_registered_converters << key;
80431 return true;
80432 }
80433 const type_details*
80434 get_type_details(const char* type_name)
80435 {
80436 return m_type_map[type_name];
80437 }
80438 private:
80439 QSet<QString> m_registered_converters;
80440 QHash<QString, type_details* > m_type_map;
80441 type_manager();
80442 type_manager(const type_manager&);
80443 };
80444 }
80445 class QObject;
80446 namespace PySide
80447 {
80448 class signal_holder;
80449 class pyqt_signal;
80450 class pyqt_slot;
80451 class trigger;
80452 struct signal_manager_data;
80453 class __attribute__ ((visibility("default"))) signal_manager
80454 {
80455 public:
80456 static signal_manager& instance();
80457 bool connect(QObject* src, const pyqt_signal& signal,
80458 boost::python::object& callable, Qt::ConnectionType type = Qt::AutoConnection);
80459 bool connect(QObject* sender, const pyqt_signal& signal,
80460 QObject* receiver, const pyqt_slot& slot, Qt::ConnectionType type = Qt::AutoConnection);
80461 bool disconnect(QObject* src, const pyqt_signal& signal,
80462 boost::python::object& callable);
80463 bool disconnect(QObject* sender, const pyqt_signal& signal,
80464 QObject* receiver,
80465 const pyqt_slot& slot);
80466 int dynamicsignal_receivers(const QObject *sender,
80467 const pyqt_signal &signal,
80468 int offset) const;
80469 QList<QByteArray> signals_of(const QObject* obj);
80470 void register_dynamic_signal(QObject *src, const pyqt_signal& signal,
80471 trigger* trigger, int slot_id);
80472 QObject* register_dynamic_signal(QObject *parent,
80473 QObject *sender,
80474 const pyqt_signal& signal,
80475 const pyqt_signal& receiver);
80476 QObject* register_dynamic_slot(QObject *parent,
80477 const boost::python::object &callback,
80478 QString &slot_name);
80479 const QMetaObject* get_dynamic_metaobject(QObject* obj);
80480 void unregister_qobj(QObject* obj);
80481 void emit_(QObject *src, const pyqt_signal& signal,
80482 const boost::python::object& args);
80483 ~signal_manager();
80484 void register_sender(QObject* sender);
80485 void unregister_sender();
80486 QObject* sender();
80487 private:
80488 signal_manager_data *m_data;
80489 trigger* find_trigger(QObject* src);
80490 trigger* get_trigger(const QObject *src) const;
80491 void emit_dynamic_signal(QObject *source, const pyqt_signal& signal,
80492 const boost::python::object& args);
80493 void emit_native_signal(QObject *source, int signal_index,
80494 const pyqt_signal& signal,
80495 const boost::python::object& args);
80496 void parse_objects_to_qarguments(const QStringList &args_type,
80497 const boost::python::object &argv,
80498 QList<QGenericArgument> &q_args);
80499 signal_manager();
80500 signal_manager(const signal_manager&);
80501 signal_manager& operator=(const signal_manager&);
80502 };
80503 class __attribute__ ((visibility("internal"))) set_sender
80504 {
80505 signal_manager& m_sm;
80506 public:
80507 set_sender(QObject* sender) : m_sm(signal_manager::instance())
80508 {
80509 m_sm.register_sender(sender);
80510 }
80511 ~set_sender()
80512 {
80513 m_sm.unregister_sender();
80514 }
80515 };
80516 }
80517 using namespace PySide;
80518 class __attribute__ ((visibility("internal"))) qwebpage_extensionoption_wrapper : public QWebPage::ExtensionOption, public PySide::wrapper
80519 {
80520 private:
80521 typedef boost::python::class_< QWebPage::ExtensionOption, PySide::qptr < qwebpage_extensionoption_wrapper, qptr_base::no_check_cache | qptr_base::wrapper_pointer> > class_type;
80522 public:
80523 qwebpage_extensionoption_wrapper(PyObject *py_self, const QWebPage::ExtensionOption& self) : QWebPage::ExtensionOption(self), wrapper(py_self)
80524 {
80525 }
80526 qwebpage_extensionoption_wrapper(PyObject *py_self);
80527 ~qwebpage_extensionoption_wrapper();
80528 static void define_python_class() throw();
80529 };
80530 using namespace boost;
80531 using namespace PySide;
80532 qwebpage_extensionoption_wrapper::qwebpage_extensionoption_wrapper(PyObject *py_self)
80533 : QWebPage::ExtensionOption(), wrapper(py_self)
80534 {
80535 }
80536 qwebpage_extensionoption_wrapper::~qwebpage_extensionoption_wrapper()
80537 {
80538 PySide::qptr_base::invalidate(PySide::qptr<QWebPage::ExtensionOption >::get_void_pointer(this));
80539 }
80540 void qwebpage_extensionoption_wrapper::define_python_class() throw() {
80541 class_type python_cls("ExtensionOption", python::init< > ());
80542 python::scope qwebpage_extensionoption_wrapper_scope(python_cls);
80543 python::implicitly_convertible< PySide::qptr<qwebpage_extensionoption_wrapper>, PySide::qptr<QWebPage::ExtensionOption> >();
80544 python_cls.def(python::init<const QWebPage::ExtensionOption&>());
80545 type_manager::instance().register_value_type<QWebPage::ExtensionOption >("QWebPage::ExtensionOption");
80546 }