Advertisement
dmr195

Preprocessed cregex.cpp from Boost 1.54

Jul 30th, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.17 MB | None | 0 0
  1. #1 "libs/regex/src/cregex.cpp"
  2. #179 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/builtins.h"
  3. typedef unsigned long __builtin_size_t ;
  4. typedef unsigned long __builtin_ptrdiff_t ;
  5. #243
  6. //typedef struct {
  7. //unsigned int __va_gp_offset ;
  8. //unsigned int __va_fp_offset ;
  9. //void * __va_overflow_arg_area ;
  10. //void * __va_reg_sve_area ;
  11. //} __sun_va_list [ 1 ] ;
  12. #270
  13. extern "C" {
  14.  
  15.  
  16.  
  17. void * __builtin_memcpy ( void * __dest , const void * __src , __builtin_size_t __n ) asm ( "memcpy" ) ;
  18. void * __builtin_memset ( void * , int , __builtin_size_t ) asm ( "memset" ) ;
  19. int __builtin_memcmp ( const void * , const void * , __builtin_size_t ) asm ( "memcmp" ) ;
  20. void * __builtin_memchr ( const void * , int , __builtin_size_t ) asm ( "memchr" ) ;
  21. void * __builtin_memmove ( void * __dest , const void * __src , __builtin_size_t __n ) asm ( "memmove" ) ;
  22.  
  23. static inline float __builtin_huge_valf ( ) ;
  24. static inline double __builtin_huge_val ( ) ;
  25. static inline long double __builtin_huge_vall ( ) ;
  26.  
  27. float __builtin_nanf ( const char * s ) asm ( "nanf" ) ;
  28. long double __builtin_nanl ( const char * ) asm ( "nanl" ) ;
  29. double __builtin_nan ( const char * ) asm ( "nan" ) ;
  30.  
  31. float __builtin_nansf ( const char * ) asm ( "nanf" ) ;
  32. long double __builtin_nansl ( const char * ) asm ( "nanl" ) ;
  33. double __builtin_nans ( const char * ) asm ( "nan" ) ;
  34.  
  35. static inline float __builtin_inff ( ) ;
  36. static inline long double __builtin_infl ( ) ;
  37. static inline double __builtin_inf ( ) ;
  38.  
  39.  
  40. extern float __builtin_acosf ( float __x ) asm ( "acosf" ) ;
  41. extern double __builtin_acos ( double __x ) asm ( "acos" ) ;
  42. extern long double __builtin_acosl ( long double __x ) asm ( "acosl" ) ;
  43.  
  44. extern float __builtin_asinf ( float __x ) asm ( "asinf" ) ;
  45. extern double __builtin_asin ( double __x ) asm ( "asin" ) ;
  46. extern long double __builtin_asinl ( long double __x ) asm ( "asinl" ) ;
  47.  
  48. extern float __builtin_atan2f ( float __y , float __x ) asm ( "atan2f" ) ;
  49. extern double __builtin_atan2 ( double __y , double __x ) asm ( "atan2" ) ;
  50. extern long double __builtin_atan2l ( long double __y , long double __x ) asm ( "atan2l" ) ;
  51.  
  52. extern float __builtin_atanf ( float __x ) asm ( "atanf" ) ;
  53. extern double __builtin_atan ( double __x ) asm ( "atan" ) ;
  54. extern long double __builtin_atanl ( long double __x ) asm ( "atanl" ) ;
  55.  
  56. extern float __builtin_cosf ( float __x ) asm ( "cosf" ) ;
  57. extern double __builtin_cos ( double __x ) asm ( "cos" ) ;
  58. extern long double __builtin_cosl ( long double __x ) asm ( "cosl" ) ;
  59.  
  60. extern float __builtin_coshf ( float __x ) asm ( "coshf" ) ;
  61. extern double __builtin_cosh ( double __x ) asm ( "cosh" ) ;
  62. extern long double __builtin_coshl ( long double __x ) asm ( "coshl" ) ;
  63.  
  64. extern float __builtin_acoshf ( float __x ) ;
  65. extern double __builtin_acosh ( double __x ) ;
  66. extern long double __builtin_acoshl ( long double __x ) ;
  67.  
  68. extern float __builtin_sinf ( float __x ) asm ( "sinf" ) ;
  69. extern double __builtin_sin ( double __x ) asm ( "sin" ) ;
  70. extern long double __builtin_sinl ( long double __x ) asm ( "sinl" ) ;
  71.  
  72. extern float __builtin_sinhf ( float __x ) asm ( "sinhf" ) ;
  73. extern double __builtin_sinh ( double __x ) asm ( "sinh" ) ;
  74. extern long double __builtin_sinhl ( long double __x ) asm ( "sinhl" ) ;
  75.  
  76. extern float __builtin_asinhf ( float __x ) ;
  77. extern double __builtin_asinh ( double __x ) ;
  78. extern long double __builtin_asinhl ( long double __x ) ;
  79.  
  80. extern float __builtin_tanf ( float __x ) asm ( "tanf" ) ;
  81. extern double __builtin_tan ( double __x ) asm ( "tan" ) ;
  82. extern long double __builtin_tanl ( long double __x ) asm ( "tanl" ) ;
  83.  
  84. extern float __builtin_tanhf ( float __x ) asm ( "tanhf" ) ;
  85. extern double __builtin_tanh ( double __x ) asm ( "tanh" ) ;
  86. extern long double __builtin_tanhl ( long double __x ) asm ( "tanhl" ) ;
  87.  
  88. extern float __builtin_atanhf ( float __x ) ;
  89. extern double __builtin_atanh ( double __x ) ;
  90. extern long double __builtin_atanhl ( long double __x ) ;
  91.  
  92.  
  93. extern long double __builtin_ceill ( long double __x ) asm ( "ceill" ) ;
  94. extern double __builtin_ceil ( double __x ) asm ( "ceil" ) ;
  95. extern float __builtin_ceilf ( float __x ) asm ( "ceilf" ) ;
  96.  
  97.  
  98. extern long double __builtin_expl ( long double __x ) asm ( "expl" ) ;
  99. extern double __builtin_exp ( double __x ) asm ( "exp" ) ;
  100. extern float __builtin_expf ( float __x ) asm ( "expf" ) ;
  101.  
  102. extern double __builtin_exp2 ( double x ) ;
  103. extern float __builtin_exp2f ( float x ) ;
  104. extern long double __builtin_exp2l ( long double x ) ;
  105.  
  106. extern double __builtin_expm1 ( double x ) ;
  107. extern float __builtin_expm1f ( float x ) ;
  108. extern long double __builtin_expm1l ( long double x ) ;
  109.  
  110. extern long double __builtin_fabsl ( long double __x ) asm ( "fabsl" ) ;
  111. extern double __builtin_fabs ( double __x ) asm ( "fabs" ) ;
  112. extern float __builtin_fabsf ( float __x ) asm ( "fabsf" ) ;
  113.  
  114. extern long double __builtin_floorl ( long double __x ) asm ( "floorl" ) ;
  115. extern double __builtin_floor ( double __x ) asm ( "floor" ) ;
  116. extern float __builtin_floorf ( float __x ) asm ( "floorf" ) ;
  117.  
  118. extern long double __builtin_fmodl ( long double __x , long double __y ) asm ( "fmodl" ) ;
  119. extern double __builtin_fmod ( double __x , double __y ) asm ( "fmod" ) ;
  120. extern float __builtin_fmodf ( float __x , long double __y ) asm ( "fmodf" ) ;
  121.  
  122. extern double __builtin_fdim ( double x , double y ) ;
  123. extern float __builtin_fdimf ( float x , float y ) ;
  124. extern long double __builtin_fdiml ( long double x , long double y ) ;
  125.  
  126. extern double __builtin_fma ( double a , double b , double c ) ;
  127. extern float __builtin_fmaf ( float a , float b , float c ) ;
  128. extern long double __builtin_fmal ( long double a , long double b , long double c ) ;
  129.  
  130. extern double __builtin_fmax ( double x , double y ) ;
  131. extern float __builtin_fmaxf ( float x , float y ) ;
  132. extern long double __builtin_fmaxl ( long double x , long double y ) ;
  133.  
  134. extern double __builtin_fmin ( double x , double y ) ;
  135. extern float __builtin_fminf ( float x , float y ) ;
  136. extern long double __builtin_fminl ( long double x , long double y ) ;
  137.  
  138. extern long double __builtin_frexpl ( long double __x , int * __exponent ) asm ( "frexpl" ) ;
  139. extern double __builtin_frexp ( double __x , int * __exponent ) asm ( "frexp" ) ;
  140. extern float __builtin_frexpf ( float __x , int * __exponent ) asm ( "frexpf" ) ;
  141.  
  142. extern double __builtin_hypot ( double x , double y ) ;
  143. extern float __builtin_hypotf ( float x , float y ) ;
  144. extern long double __builtin_hypotl ( long double x , long double y ) ;
  145.  
  146. extern int __builtin_ilogb ( double x ) ;
  147. extern int __builtin_ilogbf ( float x ) ;
  148. extern int __builtin_ilogbl ( long double x ) ;
  149.  
  150. extern long double __builtin_ldexpl ( long double __x , int __exponent ) asm ( "ldexpl" ) ;
  151. extern double __builtin_ldexp ( double __x , int __exponent ) asm ( "ldexp" ) ;
  152. extern float __builtin_ldexpf ( float __x , int __exponent ) asm ( "ldexpf" ) ;
  153.  
  154. extern long int __builtin_lrint ( double x ) ;
  155. extern long int __builtin_lrintf ( float x ) ;
  156. extern long int __builtin_lrintl ( long double x ) ;
  157.  
  158. extern long int __builtin_lround ( double x ) ;
  159. extern long int __builtin_lroundf ( float x ) ;
  160. extern long int __builtin_lroundl ( long double x ) ;
  161.  
  162. extern long int __builtin_labs ( long ) asm ( "labs" ) ;
  163. extern long long int __builtin_llabs ( long long ) asm ( "llabs" ) ;
  164.  
  165. extern long long int __builtin_llrint ( double x ) ;
  166. extern long long int __builtin_llrintf ( float x ) ;
  167. extern long long int __builtin_llrintl ( long double x ) ;
  168.  
  169. extern long long int __builtin_llround ( double x ) ;
  170. extern long long int __builtin_llroundf ( float x ) ;
  171. extern long long int __builtin_llroundl ( long double x ) ;
  172.  
  173. extern double __builtin_lgamma ( double x ) ;
  174. extern float __builtin_lgammaf ( float x ) ;
  175. extern long double __builtin_lgammal ( long double x ) ;
  176.  
  177. extern long double __builtin_log10l ( long double __x ) asm ( "log10l" ) ;
  178. extern double __builtin_log10 ( double __x ) asm ( "log10" ) ;
  179. extern float __builtin_log10f ( float __x ) asm ( "log10f" ) ;
  180.  
  181. extern long double __builtin_log2l ( long double __x ) ;
  182. extern double __builtin_log2 ( double __x ) ;
  183. extern float __builtin_log2f ( float __x ) ;
  184.  
  185. extern long double __builtin_logbl ( long double __x ) ;
  186. extern double __builtin_logb ( double __x ) ;
  187. extern float __builtin_logbf ( float __x ) ;
  188.  
  189. extern long double __builtin_log1pl ( long double __x ) ;
  190. extern double __builtin_log1p ( double __x ) ;
  191. extern float __builtin_log1pf ( float __x ) ;
  192.  
  193. extern long double __builtin_logl ( long double __x ) asm ( "logl" ) ;
  194. extern double __builtin_log ( double __x ) asm ( "log" ) ;
  195. extern float __builtin_logf ( float __x ) asm ( "logf" ) ;
  196.  
  197. extern long double __builtin_modfl ( long double __x , long double * __iptr ) asm ( "modfl" ) ;
  198. extern double __builtin_modf ( double __x , double * __iptr ) asm ( "modf" ) ;
  199. extern float __builtin_modff ( float __x , float * __iptr ) asm ( "modff" ) ;
  200.  
  201. extern double __builtin_nearbyint ( double x ) ;
  202. extern float __builtin_nearbyintf ( float x ) ;
  203. extern long double __builtin_nearbyintl ( long double x ) ;
  204.  
  205. extern double __builtin_nexttoward ( double x , double y ) ;
  206. extern float __builtin_nexttowardf ( float x , float y ) ;
  207. extern long double __builtin_nexttowardl ( long double x , long double y ) ;
  208.  
  209. extern double __builtin_nextafter ( double x , double y ) ;
  210. extern float __builtin_nextafterf ( float x , float y ) ;
  211. extern long double __builtin_nextafterl ( long double x , long double y ) ;
  212.  
  213. extern double __builtin_remainder ( double x , double y ) ;
  214. extern float __builtin_remainderf ( float x , float y ) ;
  215. extern long double __builtin_remainderl ( long double x , long double y ) ;
  216.  
  217. extern double __builtin_remquo ( double x , double y , int * c ) ;
  218. extern float __builtin_remquof ( float x , float y , int * c ) ;
  219. extern long double __builtin_remquol ( long double x , long double y , int * c ) ;
  220.  
  221. extern long double __builtin_powl ( long double __x , long double __y ) asm ( "powl" ) ;
  222. extern double __builtin_pow ( double __x , double __y ) asm ( "pow" ) ;
  223. extern float __builtin_powf ( float __x , float __y ) asm ( "powf" ) ;
  224.  
  225. extern double __builtin_round ( double x ) ;
  226. extern float __builtin_roundf ( float x ) ;
  227. extern long double __builtin_roundl ( long double x ) ;
  228.  
  229. extern double __builtin_rint ( double x ) ;
  230. extern float __builtin_rintf ( float x ) ;
  231. extern long double __builtin_rintl ( long double x ) ;
  232.  
  233. extern double __builtin_scalb ( double m , double p ) ;
  234. extern float __builtin_scalbf ( float m , float p ) ;
  235. extern long double __builtin_scalbl ( long double m , long double p ) ;
  236.  
  237. extern double __builtin_scalbn ( double m , int p ) ;
  238. extern float __builtin_scalbnf ( float m , int p ) ;
  239. extern long double __builtin_scalbnl ( long double m , int p ) ;
  240.  
  241. extern double __builtin_scalbln ( double m , long p ) ;
  242. extern float __builtin_scalblnf ( float m , long p ) ;
  243. extern long double __builtin_scalblnl ( long double m , long p ) ;
  244.  
  245. extern long double __builtin_sqrtl ( long double __x ) asm ( "sqrtl" ) ;
  246. extern double __builtin_sqrt ( double __x ) asm ( "sqrt" ) ;
  247. extern float __builtin_sqrtf ( float __x ) asm ( "sqrtf" ) ;
  248.  
  249. extern double __builtin_tgamma ( double x ) ;
  250. extern float __builtin_tgammaf ( float x ) ;
  251. extern long double __builtin_tgammal ( long double x ) ;
  252.  
  253. extern double __builtin_trunc ( double x ) ;
  254. extern float __builtin_truncf ( float x ) ;
  255. extern long double __builtin_truncl ( long double x ) ;
  256.  
  257. extern double __builtin_cbrt ( double x ) ;
  258. extern float __builtin_cbrtf ( float x ) ;
  259. extern long double __builtin_cbrtl ( long double x ) ;
  260.  
  261. extern double __builtin_copysign ( double x , double y ) ;
  262. extern float __builtin_copysignf ( float x , float y ) ;
  263. extern long double __builtin_copysignl ( long double x , long double y ) ;
  264.  
  265. extern double __builtin_erf ( double x ) ;
  266. extern float __builtin_erff ( float x ) ;
  267. extern long double __builtin_erfl ( long double x ) ;
  268. extern double __builtin_erfc ( double x ) ;
  269. extern float __builtin_erfcf ( float x ) ;
  270. extern long double __builtin_erfcl ( long double x ) ;
  271.  
  272. char * __builtin_stpncpy ( char * , const char * , __builtin_size_t ) asm ( "stpncpy" ) ;
  273. char * __builtin_stpcpy ( char * , const char * ) asm ( "stpcpy" ) ;
  274. char * __builtin_strcpy ( char * , const char * ) asm ( "strcpy" ) ;
  275. char * __builtin_strncpy ( char * , const char * , __builtin_size_t ) asm ( "strncpy" ) ;
  276. char * __builtin_strcat ( char * , const char * ) asm ( "strcat" ) ;
  277. char * __builtin_strncat ( char * , const char * , __builtin_size_t ) asm ( "strncat" ) ;
  278. int __builtin_strcmp ( const char * , const char * ) asm ( "strcmp" ) ;
  279. int __builtin_strncmp ( const char * , const char * , __builtin_size_t ) asm ( "strncmp" ) ;
  280. char * __builtin_strdup ( const char * ) asm ( "strdup" ) ;
  281. char * __builtin_strndup ( const char * , __builtin_size_t ) asm ( "strndup" ) ;
  282. char * __builtin_strchr ( const char * , int ) asm ( "strchr" ) ;
  283. char * __builtin_strrchr ( const char * , int ) asm ( "strrchr" ) ;
  284. __builtin_size_t __builtin_strcspn ( const char * , const char * ) asm ( "strcspn" ) ;
  285. __builtin_size_t __builtin_strspn ( const char * , const char * ) asm ( "strspn" ) ;
  286. char * __builtin_strpbrk ( const char * , const char * ) asm ( "strpbrk" ) ;
  287. char * __builtin_strstr ( const char * , const char * ) asm ( "strstr" ) ;
  288. __builtin_size_t __builtin_strlen ( const char * __s ) asm ( "strlen" ) ;
  289. int __builtin_strcasecmp ( const char * , const char * ) asm ( "strcasecmp" ) ;
  290. int __builtin_strncasecmp ( const char * , const char * , __builtin_size_t ) asm ( "strncasecmp" ) ;
  291.  
  292.  
  293. extern int __builtin_printf ( const char * , ... ) asm ( "printf" ) ;
  294. extern int __builtin_sprintf ( char * , const char * , ... ) asm ( "sprintf" ) ;
  295. extern int __builtin_vprintf ( const char * , __sun_va_list ) asm ( "vprintf" ) ;
  296. extern int __builtin_vsprintf ( char * , const char * , __sun_va_list ) asm ( "vsprintf" ) ;
  297. extern int __builtin_snprintf ( char * , __builtin_size_t , const char * , ... ) asm ( "snprintf" ) ;
  298. extern int __builtin_vsnprintf ( char * , __builtin_size_t , const char * , __sun_va_list ) asm ( "vsnprintf" ) ;
  299. extern int __builtin_vasprintf ( char * * , const char * __f , __sun_va_list ) asm ( "vasprintf" ) ;
  300. extern int __builtin_asprintf ( char * * , const char * , ... ) asm ( "asprintf" ) ;
  301.  
  302.  
  303.  
  304.  
  305. extern int __builtin_scanf ( const char * , ... ) asm ( "scanf" ) ;
  306. extern int __builtin_sscanf ( const char * , const char * , ... ) asm ( "sscanf" ) ;
  307. extern int __builtin_vscanf ( const char * , __sun_va_list ) asm ( "vscanf" ) ;
  308. extern int __builtin_vsscanf ( const char * , const char * , __sun_va_list ) asm ( "vsscanf" ) ;
  309. #574
  310. extern int __builtin_vfprintf ( void * , const char * , __sun_va_list ) asm ( "vfprintf" ) ;
  311. extern int __builtin_fprintf ( void * , const char * , ... ) asm ( "fprintf" ) ;
  312. extern int __builtin_fscanf ( void * , const char * , ... ) asm ( "fscanf" ) ;
  313. extern int __builtin_vfscanf ( void * , const char * , __sun_va_list ) asm ( "vfscanf" ) ;
  314.  
  315. extern void * __builtin_alloca ( __builtin_size_t ) ;
  316.  
  317.  
  318.  
  319. extern void __builtin_abort ( void ) throw ( ) asm ( "abort" ) ;
  320.  
  321. extern "C" constexpr int __builtin_clz ( unsigned int ) ;
  322. extern "C" constexpr int __builtin_clzl ( unsigned long ) ;
  323. extern "C" constexpr int __builtin_clzll ( unsigned long long ) ;
  324.  
  325. extern "C" constexpr int __builtin_ctz ( unsigned int ) ;
  326. extern "C" constexpr int __builtin_ctzl ( unsigned long ) ;
  327. extern "C" constexpr int __builtin_ctzll ( unsigned long long ) ;
  328.  
  329. extern "C" constexpr int __builtin_popcount ( unsigned int ) ;
  330. extern "C" constexpr int __builtin_popcountl ( unsigned long ) ;
  331. extern "C" constexpr int __builtin_popcountll ( unsigned long long ) ;
  332.  
  333. extern "C" inline double __builtin_powi ( double , int ) ;
  334. extern "C" inline float __builtin_powif ( float , int ) ;
  335. extern "C" inline long double __builtin_powil ( long double , int ) ;
  336.  
  337. extern "C++" inline int __builtin_fpclassify ( int , int , int , int , int , float ) ;
  338. extern "C++" inline int __builtin_fpclassify ( int , int , int , int , int , double ) ;
  339. extern "C++" inline int __builtin_fpclassify ( int , int , int , int , int , long double ) ;
  340. #613
  341. extern "C++" template < typename T >
  342. inline bool __builtin_atomic_compare_exchange_n ( void * , void * , T , bool , int , int ) ;
  343. #621
  344. }
  345.  
  346.  
  347.  
  348. typedef __sun_va_list __builtin_va_list ;
  349. #633
  350. extern "C" void __builtin_va_start ( __sun_va_list , ... ) ;
  351. #1 "./boost/regex.hpp"
  352. #1 "./boost/regex/config.hpp"
  353. #1 "./boost/regex/user.hpp"
  354. #1 "./boost/config.hpp"
  355. #1 "./boost/config/user.hpp"
  356. #1 "./boost/config/select_compiler_config.hpp"
  357. #1 "./boost/config/compiler/sunpro_cc.hpp"
  358. #1 "./boost/config/select_stdlib_config.hpp"
  359. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/cstddef"
  360. #9
  361. namespace std {
  362. typedef decltype ( nullptr ) nullptr_t ;
  363. }
  364. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstddef"
  365. #39
  366. #pragma GCC system_header
  367. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/bits/c++config.h"
  368. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/c++config.h"
  369. #184
  370. namespace std
  371. {
  372. typedef unsigned long size_t ;
  373. typedef long ptrdiff_t ;
  374.  
  375.  
  376. typedef decltype ( nullptr ) nullptr_t ;
  377.  
  378. }
  379. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/os_defines.h"
  380. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/cpu_defines.h"
  381. #1 "/usr/include/stddef.h"
  382. #16
  383. #pragma ident "@(#)stddef.h 1.18    04/09/28 SMI"
  384. #1 "/usr/include/sys/isa_defs.h"
  385. #8
  386. #pragma ident "@(#)isa_defs.h   1.30    11/03/31 SMI"
  387. #193
  388. extern "C" {
  389. #512
  390. }
  391. #1 "/usr/include/iso/stddef_iso.h"
  392. #28
  393. #pragma ident "@(#)stddef_iso.h 1.2 03/03/06 SMI"
  394. #33
  395. extern "C" {
  396.  
  397.  
  398.  
  399. namespace std {
  400. #51
  401. typedef long ptrdiff_t ;
  402. #60
  403. typedef unsigned long size_t ;
  404. #67
  405. }
  406. #77
  407. }
  408. #26 "/usr/include/stddef.h"
  409. using std :: ptrdiff_t ;
  410. using std :: size_t ;
  411.  
  412.  
  413.  
  414. extern "C" {
  415. #49
  416. }
  417. #1 "./boost/config/no_tr1/utility.hpp"
  418. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/utility"
  419. #58
  420. #pragma GCC system_header
  421. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_relops.h"
  422. #67
  423. namespace std
  424. {
  425. namespace rel_ops
  426. {
  427. #85
  428. template < class _Tp >
  429. inline bool
  430. operator != ( const _Tp & __x , const _Tp & __y )
  431. { return ! ( __x == __y ) ; }
  432. #98
  433. template < class _Tp >
  434. inline bool
  435. operator > ( const _Tp & __x , const _Tp & __y )
  436. { return __y < __x ; }
  437. #111
  438. template < class _Tp >
  439. inline bool
  440. operator <= ( const _Tp & __x , const _Tp & __y )
  441. { return ! ( __y < __x ) ; }
  442. #124
  443. template < class _Tp >
  444. inline bool
  445. operator >= ( const _Tp & __x , const _Tp & __y )
  446. { return ! ( __x < __y ) ; }
  447.  
  448.  
  449. }
  450.  
  451. }
  452. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/bits/stl_pair.h"
  453. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/move.h"
  454. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/concept_check.h"
  455. #33
  456. #pragma GCC system_header
  457. #36 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/move.h"
  458. namespace std
  459. {
  460. #45
  461. template < typename _Tp >
  462. inline _Tp *
  463. __addressof ( _Tp & __r ) noexcept
  464. {
  465. return reinterpret_cast < _Tp * >
  466. ( & const_cast < char & > ( reinterpret_cast < const volatile char & > ( __r ) ) ) ;
  467. }
  468.  
  469.  
  470. }
  471. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/type_traits"
  472. #32
  473. #pragma GCC system_header
  474. #40
  475. namespace std
  476. {
  477. #56
  478. template < typename _Tp , _Tp __v >
  479. struct integral_constant
  480. {
  481. static constexpr _Tp value = __v ;
  482. typedef _Tp value_type ;
  483. typedef integral_constant < _Tp , __v > type ;
  484. constexpr operator value_type ( ) { return value ; }
  485. } ;
  486.  
  487. template < typename _Tp , _Tp __v >
  488. constexpr _Tp integral_constant < _Tp , __v > :: value ;
  489.  
  490.  
  491. typedef integral_constant < bool , true > true_type ;
  492.  
  493.  
  494. typedef integral_constant < bool , false > false_type ;
  495.  
  496.  
  497.  
  498. template < bool , typename , typename >
  499. struct conditional ;
  500.  
  501. template < typename ... >
  502. struct __or_ ;
  503.  
  504. template < >
  505. struct __or_ < >
  506. : public false_type
  507. { } ;
  508.  
  509. template < typename _B1 >
  510. struct __or_ < _B1 >
  511. : public _B1
  512. { } ;
  513.  
  514. template < typename _B1 , typename _B2 >
  515. struct __or_ < _B1 , _B2 >
  516. : public conditional < _B1 :: value , _B1 , _B2 > :: type
  517. { } ;
  518.  
  519. template < typename _B1 , typename _B2 , typename _B3 , typename ... _Bn >
  520. struct __or_ < _B1 , _B2 , _B3 , _Bn ... >
  521. : public conditional < _B1 :: value , _B1 , __or_ < _B2 , _B3 , _Bn ... >> :: type
  522. { } ;
  523.  
  524. template < typename ... >
  525. struct __and_ ;
  526.  
  527. template < >
  528. struct __and_ < >
  529. : public true_type
  530. { } ;
  531.  
  532. template < typename _B1 >
  533. struct __and_ < _B1 >
  534. : public _B1
  535. { } ;
  536.  
  537. template < typename _B1 , typename _B2 >
  538. struct __and_ < _B1 , _B2 >
  539. : public conditional < _B1 :: value , _B2 , _B1 > :: type
  540. { } ;
  541.  
  542. template < typename _B1 , typename _B2 , typename _B3 , typename ... _Bn >
  543. struct __and_ < _B1 , _B2 , _B3 , _Bn ... >
  544. : public conditional < _B1 :: value , __and_ < _B2 , _B3 , _Bn ... > , _B1 > :: type
  545. { } ;
  546.  
  547. template < typename _Pp >
  548. struct __not_
  549. : public integral_constant < bool , ! _Pp :: value >
  550. { } ;
  551.  
  552. struct __sfinae_types
  553. {
  554. typedef char __one ;
  555. typedef struct { char __arr [ 2 ] ; } __two ;
  556. } ;
  557. #141
  558. template < typename _Tp >
  559. struct __success_type
  560. { typedef _Tp type ; } ;
  561.  
  562. struct __failure_type
  563. { } ;
  564.  
  565.  
  566.  
  567. template < typename >
  568. struct remove_cv ;
  569.  
  570. template < typename >
  571. struct __is_void_helper
  572. : public false_type { } ;
  573.  
  574. template < >
  575. struct __is_void_helper < void >
  576. : public true_type { } ;
  577.  
  578.  
  579. template < typename _Tp >
  580. struct is_void
  581. : public integral_constant < bool , ( __is_void_helper < typename
  582. remove_cv < _Tp > :: type > :: value ) >
  583. { } ;
  584.  
  585. template < typename >
  586. struct __is_integral_helper
  587. : public false_type { } ;
  588.  
  589. template < >
  590. struct __is_integral_helper < bool >
  591. : public true_type { } ;
  592.  
  593. template < >
  594. struct __is_integral_helper < char >
  595. : public true_type { } ;
  596.  
  597. template < >
  598. struct __is_integral_helper < signed char >
  599. : public true_type { } ;
  600.  
  601. template < >
  602. struct __is_integral_helper < unsigned char >
  603. : public true_type { } ;
  604.  
  605.  
  606. template < >
  607. struct __is_integral_helper < wchar_t >
  608. : public true_type { } ;
  609.  
  610.  
  611. template < >
  612. struct __is_integral_helper < char16_t >
  613. : public true_type { } ;
  614.  
  615. template < >
  616. struct __is_integral_helper < char32_t >
  617. : public true_type { } ;
  618.  
  619. template < >
  620. struct __is_integral_helper < short >
  621. : public true_type { } ;
  622.  
  623. template < >
  624. struct __is_integral_helper < unsigned short >
  625. : public true_type { } ;
  626.  
  627. template < >
  628. struct __is_integral_helper < int >
  629. : public true_type { } ;
  630.  
  631. template < >
  632. struct __is_integral_helper < unsigned int >
  633. : public true_type { } ;
  634.  
  635. template < >
  636. struct __is_integral_helper < long >
  637. : public true_type { } ;
  638.  
  639. template < >
  640. struct __is_integral_helper < unsigned long >
  641. : public true_type { } ;
  642.  
  643. template < >
  644. struct __is_integral_helper < long long >
  645. : public true_type { } ;
  646.  
  647. template < >
  648. struct __is_integral_helper < unsigned long long >
  649. : public true_type { } ;
  650. #245
  651. template < typename _Tp >
  652. struct is_integral
  653. : public integral_constant < bool , ( __is_integral_helper < typename
  654. remove_cv < _Tp > :: type > :: value ) >
  655. { } ;
  656.  
  657. template < typename >
  658. struct __is_floating_point_helper
  659. : public false_type { } ;
  660.  
  661. template < >
  662. struct __is_floating_point_helper < float >
  663. : public true_type { } ;
  664.  
  665. template < >
  666. struct __is_floating_point_helper < double >
  667. : public true_type { } ;
  668.  
  669. template < >
  670. struct __is_floating_point_helper < long double >
  671. : public true_type { } ;
  672. #274
  673. template < typename _Tp >
  674. struct is_floating_point
  675. : public integral_constant < bool , ( __is_floating_point_helper < typename
  676. remove_cv < _Tp > :: type > :: value ) >
  677. { } ;
  678.  
  679.  
  680. template < typename >
  681. struct is_array
  682. : public false_type { } ;
  683.  
  684. template < typename _Tp , std :: size_t _Size >
  685. struct is_array < _Tp [ _Size ] >
  686. : public true_type { } ;
  687.  
  688. template < typename _Tp >
  689. struct is_array < _Tp [ ] >
  690. : public true_type { } ;
  691.  
  692. template < typename >
  693. struct __is_pointer_helper
  694. : public false_type { } ;
  695.  
  696. template < typename _Tp >
  697. struct __is_pointer_helper < _Tp * >
  698. : public true_type { } ;
  699.  
  700.  
  701. template < typename _Tp >
  702. struct is_pointer
  703. : public integral_constant < bool , ( __is_pointer_helper < typename
  704. remove_cv < _Tp > :: type > :: value ) >
  705. { } ;
  706.  
  707.  
  708. template < typename >
  709. struct is_lvalue_reference
  710. : public false_type { } ;
  711.  
  712. template < typename _Tp >
  713. struct is_lvalue_reference < _Tp & >
  714. : public true_type { } ;
  715.  
  716.  
  717. template < typename >
  718. struct is_rvalue_reference
  719. : public false_type { } ;
  720.  
  721. template < typename _Tp >
  722. struct is_rvalue_reference < _Tp && >
  723. : public true_type { } ;
  724.  
  725. template < typename >
  726. struct is_function ;
  727.  
  728. template < typename >
  729. struct __is_member_object_pointer_helper
  730. : public false_type { } ;
  731.  
  732. template < typename _Tp , typename _Cp >
  733. struct __is_member_object_pointer_helper < _Tp _Cp :: * >
  734. : public integral_constant < bool , ! is_function < _Tp > :: value > { } ;
  735.  
  736.  
  737. template < typename _Tp >
  738. struct is_member_object_pointer
  739. : public integral_constant < bool , ( __is_member_object_pointer_helper <
  740. typename remove_cv < _Tp > :: type > :: value ) >
  741. { } ;
  742.  
  743. template < typename >
  744. struct __is_member_function_pointer_helper
  745. : public false_type { } ;
  746.  
  747. template < typename _Tp , typename _Cp >
  748. struct __is_member_function_pointer_helper < _Tp _Cp :: * >
  749. : public integral_constant < bool , is_function < _Tp > :: value > { } ;
  750.  
  751.  
  752. template < typename _Tp >
  753. struct is_member_function_pointer
  754. : public integral_constant < bool , ( __is_member_function_pointer_helper <
  755. typename remove_cv < _Tp > :: type > :: value ) >
  756. { } ;
  757.  
  758.  
  759. template < typename _Tp >
  760. struct is_enum
  761. : public integral_constant < bool , __oracle_is_enum ( _Tp ) >
  762. { } ;
  763.  
  764.  
  765. template < typename _Tp >
  766. struct is_union
  767. : public integral_constant < bool , __oracle_is_union ( _Tp ) >
  768. { } ;
  769.  
  770.  
  771. template < typename _Tp >
  772. struct is_class
  773. : public integral_constant < bool , __oracle_is_class ( _Tp ) >
  774. { } ;
  775.  
  776.  
  777. template < typename >
  778. struct is_function
  779. : public false_type { } ;
  780.  
  781. template < typename _Res , typename ... _ArgTypes >
  782. struct is_function < _Res ( _ArgTypes ... ) >
  783. : public true_type { } ;
  784.  
  785. template < typename _Res , typename ... _ArgTypes >
  786. struct is_function < _Res ( _ArgTypes ... ... ) >
  787. : public true_type { } ;
  788.  
  789. template < typename _Res , typename ... _ArgTypes >
  790. struct is_function < _Res ( _ArgTypes ... ) const >
  791. : public true_type { } ;
  792.  
  793. template < typename _Res , typename ... _ArgTypes >
  794. struct is_function < _Res ( _ArgTypes ... ... ) const >
  795. : public true_type { } ;
  796.  
  797. template < typename _Res , typename ... _ArgTypes >
  798. struct is_function < _Res ( _ArgTypes ... ) volatile >
  799. : public true_type { } ;
  800.  
  801. template < typename _Res , typename ... _ArgTypes >
  802. struct is_function < _Res ( _ArgTypes ... ... ) volatile >
  803. : public true_type { } ;
  804.  
  805. template < typename _Res , typename ... _ArgTypes >
  806. struct is_function < _Res ( _ArgTypes ... ) const volatile >
  807. : public true_type { } ;
  808.  
  809. template < typename _Res , typename ... _ArgTypes >
  810. struct is_function < _Res ( _ArgTypes ... ... ) const volatile >
  811. : public true_type { } ;
  812.  
  813. template < typename >
  814. struct __is_nullptr_t_helper
  815. : public false_type { } ;
  816.  
  817. template < >
  818. struct __is_nullptr_t_helper < std :: nullptr_t >
  819. : public true_type { } ;
  820.  
  821.  
  822. template < typename _Tp >
  823. struct __is_nullptr_t
  824. : public integral_constant < bool , ( __is_nullptr_t_helper < typename
  825. remove_cv < _Tp > :: type > :: value ) >
  826. { } ;
  827.  
  828.  
  829.  
  830.  
  831. template < typename _Tp >
  832. struct is_reference
  833. : public __or_ < is_lvalue_reference < _Tp > ,
  834. is_rvalue_reference < _Tp >> :: type
  835. { } ;
  836.  
  837.  
  838. template < typename _Tp >
  839. struct is_arithmetic
  840. : public __or_ < is_integral < _Tp > , is_floating_point < _Tp >> :: type
  841. { } ;
  842.  
  843.  
  844. template < typename _Tp >
  845. struct is_fundamental
  846. : public __or_ < is_arithmetic < _Tp > , is_void < _Tp > , __is_nullptr_t < _Tp >> :: type
  847. { } ;
  848.  
  849.  
  850. template < typename _Tp >
  851. struct is_object
  852. : public __not_ < __or_ < is_function < _Tp > , is_reference < _Tp > ,
  853. is_void < _Tp >> > :: type
  854. { } ;
  855.  
  856. template < typename >
  857. struct is_member_pointer ;
  858.  
  859.  
  860. template < typename _Tp >
  861. struct is_scalar
  862. : public __or_ < is_arithmetic < _Tp > , is_enum < _Tp > , is_pointer < _Tp > ,
  863. is_member_pointer < _Tp > , __is_nullptr_t < _Tp >> :: type
  864. { } ;
  865.  
  866.  
  867. template < typename _Tp >
  868. struct is_compound
  869. : public integral_constant < bool , ! is_fundamental < _Tp > :: value > { } ;
  870.  
  871. template < typename _Tp >
  872. struct __is_member_pointer_helper
  873. : public false_type { } ;
  874.  
  875. template < typename _Tp , typename _Cp >
  876. struct __is_member_pointer_helper < _Tp _Cp :: * >
  877. : public true_type { } ;
  878.  
  879.  
  880. template < typename _Tp >
  881. struct is_member_pointer
  882. : public integral_constant < bool , ( __is_member_pointer_helper <
  883. typename remove_cv < _Tp > :: type > :: value ) >
  884. { } ;
  885.  
  886.  
  887.  
  888.  
  889. template < typename >
  890. struct is_const
  891. : public false_type { } ;
  892.  
  893. template < typename _Tp >
  894. struct is_const < _Tp const >
  895. : public true_type { } ;
  896.  
  897.  
  898. template < typename >
  899. struct is_volatile
  900. : public false_type { } ;
  901.  
  902. template < typename _Tp >
  903. struct is_volatile < _Tp volatile >
  904. : public true_type { } ;
  905.  
  906.  
  907. template < typename _Tp >
  908. struct is_trivial
  909. : public integral_constant < bool , __oracle_is_trivial ( _Tp ) >
  910. { } ;
  911.  
  912.  
  913.  
  914.  
  915. template < typename _Tp >
  916. struct is_standard_layout
  917. : public integral_constant < bool , __oracle_is_standard_layout ( _Tp ) >
  918. { } ;
  919.  
  920.  
  921.  
  922. template < typename _Tp >
  923. struct is_pod
  924. : public integral_constant < bool , __oracle_is_pod ( _Tp ) >
  925. { } ;
  926.  
  927.  
  928. template < typename _Tp >
  929. struct is_literal_type
  930. : public integral_constant < bool , __oracle_is_literal_type ( _Tp ) >
  931. { } ;
  932.  
  933.  
  934. template < typename _Tp >
  935. struct is_empty
  936. : public integral_constant < bool , __oracle_is_empty ( _Tp ) >
  937. { } ;
  938.  
  939.  
  940. template < typename _Tp >
  941. struct is_polymorphic
  942. : public integral_constant < bool , __oracle_is_polymorphic ( _Tp ) >
  943. { } ;
  944.  
  945.  
  946. template < typename _Tp >
  947. struct is_abstract
  948. : public integral_constant < bool , __oracle_is_abstract ( _Tp ) >
  949. { } ;
  950.  
  951. template < typename _Tp ,
  952. bool = is_integral < _Tp > :: value ,
  953. bool = is_floating_point < _Tp > :: value >
  954. struct __is_signed_helper
  955. : public false_type { } ;
  956.  
  957. template < typename _Tp >
  958. struct __is_signed_helper < _Tp , false , true >
  959. : public true_type { } ;
  960.  
  961. template < typename _Tp >
  962. struct __is_signed_helper < _Tp , true , false >
  963. : public integral_constant < bool , static_cast < bool > ( _Tp ( - 1 ) < _Tp ( 0 ) ) >
  964. { } ;
  965.  
  966.  
  967. template < typename _Tp >
  968. struct is_signed
  969. : public integral_constant < bool , __is_signed_helper < _Tp > :: value >
  970. { } ;
  971.  
  972.  
  973. template < typename _Tp >
  974. struct is_unsigned
  975. : public __and_ < is_arithmetic < _Tp > , __not_ < is_signed < _Tp >> > :: type
  976. { } ;
  977.  
  978.  
  979.  
  980.  
  981. template < typename >
  982. struct add_rvalue_reference ;
  983.  
  984.  
  985.  
  986.  
  987.  
  988. template < typename _Tp >
  989. typename add_rvalue_reference < _Tp > :: type declval ( ) noexcept ;
  990.  
  991. template < typename , unsigned = 0 >
  992. struct extent ;
  993.  
  994. template < typename >
  995. struct remove_all_extents ;
  996.  
  997. template < typename _Tp >
  998. struct __is_array_known_bounds
  999. : public integral_constant < bool , ( extent < _Tp > :: value > 0 ) >
  1000. { } ;
  1001.  
  1002. template < typename _Tp >
  1003. struct __is_array_unknown_bounds
  1004. : public __and_ < is_array < _Tp > , __not_ < extent < _Tp >> > :: type
  1005. { } ;
  1006. #613
  1007. struct __do_is_destructible_impl
  1008. {
  1009. template < typename _Tp , typename = decltype ( declval < _Tp & > ( ) . ~ _Tp ( ) ) >
  1010. static true_type __test ( int ) ;
  1011.  
  1012. template < typename >
  1013. static false_type __test ( ... ) ;
  1014. } ;
  1015.  
  1016. template < typename _Tp >
  1017. struct __is_destructible_impl
  1018. : public __do_is_destructible_impl
  1019. {
  1020. typedef decltype ( __test < _Tp > ( 0 ) ) type ;
  1021. } ;
  1022.  
  1023. template < typename _Tp ,
  1024. bool = __or_ < is_void < _Tp > ,
  1025. __is_array_unknown_bounds < _Tp > ,
  1026. is_function < _Tp >> :: value ,
  1027. bool = __or_ < is_reference < _Tp > , is_scalar < _Tp >> :: value >
  1028. struct __is_destructible_safe ;
  1029.  
  1030. template < typename _Tp >
  1031. struct __is_destructible_safe < _Tp , false , false >
  1032. : public __is_destructible_impl < typename
  1033. remove_all_extents < _Tp > :: type > :: type
  1034. { } ;
  1035.  
  1036. template < typename _Tp >
  1037. struct __is_destructible_safe < _Tp , true , false >
  1038. : public false_type { } ;
  1039.  
  1040. template < typename _Tp >
  1041. struct __is_destructible_safe < _Tp , false , true >
  1042. : public true_type { } ;
  1043.  
  1044.  
  1045. template < typename _Tp >
  1046. struct is_destructible
  1047. : public integral_constant < bool , ( __is_destructible_safe < _Tp > :: value ) >
  1048. { } ;
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054. struct __do_is_nt_destructible_impl
  1055. {
  1056. template < typename _Tp >
  1057. static integral_constant < bool , noexcept ( declval < _Tp & > ( ) . ~ _Tp ( ) ) >
  1058. __test ( int ) ;
  1059.  
  1060. template < typename >
  1061. static false_type __test ( ... ) ;
  1062. } ;
  1063.  
  1064. template < typename _Tp >
  1065. struct __is_nt_destructible_impl
  1066. : public __do_is_nt_destructible_impl
  1067. {
  1068. typedef decltype ( __test < _Tp > ( 0 ) ) type ;
  1069. } ;
  1070.  
  1071. template < typename _Tp ,
  1072. bool = __or_ < is_void < _Tp > ,
  1073. __is_array_unknown_bounds < _Tp > ,
  1074. is_function < _Tp >> :: value ,
  1075. bool = __or_ < is_reference < _Tp > , is_scalar < _Tp >> :: value >
  1076. struct __is_nt_destructible_safe ;
  1077.  
  1078. template < typename _Tp >
  1079. struct __is_nt_destructible_safe < _Tp , false , false >
  1080. : public __is_nt_destructible_impl < typename
  1081. remove_all_extents < _Tp > :: type > :: type
  1082. { } ;
  1083.  
  1084. template < typename _Tp >
  1085. struct __is_nt_destructible_safe < _Tp , true , false >
  1086. : public false_type { } ;
  1087.  
  1088. template < typename _Tp >
  1089. struct __is_nt_destructible_safe < _Tp , false , true >
  1090. : public true_type { } ;
  1091.  
  1092.  
  1093. template < typename _Tp >
  1094. struct is_nothrow_destructible
  1095. : public integral_constant < bool , ( __is_nt_destructible_safe < _Tp > :: value ) >
  1096. { } ;
  1097.  
  1098. struct __do_is_default_constructible_impl
  1099. {
  1100. template < typename _Tp , typename = decltype ( _Tp ( ) ) >
  1101. static true_type __test ( int ) ;
  1102.  
  1103. template < typename >
  1104. static false_type __test ( ... ) ;
  1105. } ;
  1106.  
  1107. template < typename _Tp >
  1108. struct __is_default_constructible_impl
  1109. : public __do_is_default_constructible_impl
  1110. {
  1111. typedef decltype ( __test < _Tp > ( 0 ) ) type ;
  1112. } ;
  1113.  
  1114. template < typename _Tp >
  1115. struct __is_default_constructible_atom
  1116. : public __and_ < __not_ < is_void < _Tp >> ,
  1117. __is_default_constructible_impl < _Tp >> :: type
  1118. { } ;
  1119.  
  1120. template < typename _Tp , bool = is_array < _Tp > :: value >
  1121. struct __is_default_constructible_safe ;
  1122. #734
  1123. template < typename _Tp >
  1124. struct __is_default_constructible_safe < _Tp , true >
  1125. : public __and_ < __is_array_known_bounds < _Tp > ,
  1126. __is_default_constructible_atom < typename
  1127. remove_all_extents < _Tp > :: type >> :: type
  1128. { } ;
  1129.  
  1130. template < typename _Tp >
  1131. struct __is_default_constructible_safe < _Tp , false >
  1132. : public __is_default_constructible_atom < _Tp > :: type
  1133. { } ;
  1134.  
  1135.  
  1136. template < typename _Tp >
  1137. struct is_default_constructible
  1138. : public integral_constant < bool , ( __is_default_constructible_safe <
  1139. _Tp > :: value ) >
  1140. { } ;
  1141. #765
  1142. struct __do_is_static_castable_impl
  1143. {
  1144. template < typename _From , typename _To , typename
  1145. = decltype ( static_cast < _To > ( declval < _From > ( ) ) ) >
  1146. static true_type __test ( int ) ;
  1147.  
  1148. template < typename , typename >
  1149. static false_type __test ( ... ) ;
  1150. } ;
  1151.  
  1152. template < typename _From , typename _To >
  1153. struct __is_static_castable_impl
  1154. : public __do_is_static_castable_impl
  1155. {
  1156. typedef decltype ( __test < _From , _To > ( 0 ) ) type ;
  1157. } ;
  1158.  
  1159. template < typename _From , typename _To >
  1160. struct __is_static_castable_safe
  1161. : public __is_static_castable_impl < _From , _To > :: type
  1162. { } ;
  1163.  
  1164.  
  1165. template < typename _From , typename _To >
  1166. struct __is_static_castable
  1167. : public integral_constant < bool , ( __is_static_castable_safe <
  1168. _From , _To > :: value ) >
  1169. { } ;
  1170. #799
  1171. struct __do_is_direct_constructible_impl
  1172. {
  1173. template < typename _Tp , typename _Arg , typename
  1174. = decltype ( :: new _Tp ( declval < _Arg > ( ) ) ) >
  1175. static true_type __test ( int ) ;
  1176.  
  1177. template < typename , typename >
  1178. static false_type __test ( ... ) ;
  1179. } ;
  1180.  
  1181. template < typename _Tp , typename _Arg >
  1182. struct __is_direct_constructible_impl
  1183. : public __do_is_direct_constructible_impl
  1184. {
  1185. typedef decltype ( __test < _Tp , _Arg > ( 0 ) ) type ;
  1186. } ;
  1187.  
  1188. template < typename _Tp , typename _Arg >
  1189. struct __is_direct_constructible_new_safe
  1190. : public __and_ < is_destructible < _Tp > ,
  1191. __is_direct_constructible_impl < _Tp , _Arg >> :: type
  1192. { } ;
  1193.  
  1194. template < typename , typename >
  1195. struct is_same ;
  1196.  
  1197. template < typename , typename >
  1198. struct is_base_of ;
  1199.  
  1200. template < typename >
  1201. struct remove_reference ;
  1202.  
  1203. template < typename _From , typename _To , bool
  1204. = __not_ < __or_ < is_void < _From > ,
  1205. is_function < _From >> > :: value >
  1206. struct __is_base_to_derived_ref ;
  1207.  
  1208.  
  1209.  
  1210. template < typename _From , typename _To >
  1211. struct __is_base_to_derived_ref < _From , _To , true >
  1212. {
  1213. typedef typename remove_cv < typename remove_reference < _From
  1214. > :: type > :: type __src_t ;
  1215. typedef typename remove_cv < typename remove_reference < _To
  1216. > :: type > :: type __dst_t ;
  1217. typedef __and_ < __not_ < is_same < __src_t , __dst_t >> ,
  1218. is_base_of < __src_t , __dst_t >> type ;
  1219. static constexpr bool value = type :: value ;
  1220. } ;
  1221.  
  1222. template < typename _From , typename _To >
  1223. struct __is_base_to_derived_ref < _From , _To , false >
  1224. : public false_type
  1225. { } ;
  1226.  
  1227. template < typename _From , typename _To , bool
  1228. = __and_ < is_lvalue_reference < _From > ,
  1229. is_rvalue_reference < _To >> :: value >
  1230. struct __is_lvalue_to_rvalue_ref ;
  1231.  
  1232.  
  1233.  
  1234. template < typename _From , typename _To >
  1235. struct __is_lvalue_to_rvalue_ref < _From , _To , true >
  1236. {
  1237. typedef typename remove_cv < typename remove_reference <
  1238. _From > :: type > :: type __src_t ;
  1239. typedef typename remove_cv < typename remove_reference <
  1240. _To > :: type > :: type __dst_t ;
  1241. typedef __and_ < __not_ < is_function < __src_t >> ,
  1242. __or_ < is_same < __src_t , __dst_t > ,
  1243. is_base_of < __dst_t , __src_t >> > type ;
  1244. static constexpr bool value = type :: value ;
  1245. } ;
  1246.  
  1247. template < typename _From , typename _To >
  1248. struct __is_lvalue_to_rvalue_ref < _From , _To , false >
  1249. : public false_type
  1250. { } ;
  1251. #886
  1252. template < typename _Tp , typename _Arg >
  1253. struct __is_direct_constructible_ref_cast
  1254. : public __and_ < __is_static_castable < _Arg , _Tp > ,
  1255. __not_ < __or_ < __is_base_to_derived_ref < _Arg , _Tp > ,
  1256. __is_lvalue_to_rvalue_ref < _Arg , _Tp >
  1257. >> > :: type
  1258. { } ;
  1259.  
  1260. template < typename _Tp , typename _Arg >
  1261. struct __is_direct_constructible_new
  1262. : public conditional < is_reference < _Tp > :: value ,
  1263. __is_direct_constructible_ref_cast < _Tp , _Arg > ,
  1264. __is_direct_constructible_new_safe < _Tp , _Arg >
  1265. > :: type
  1266. { } ;
  1267.  
  1268. template < typename _Tp , typename _Arg >
  1269. struct __is_direct_constructible
  1270. : public integral_constant < bool , ( __is_direct_constructible_new <
  1271. _Tp , _Arg > :: value ) >
  1272. { } ;
  1273. #913
  1274. struct __do_is_nary_constructible_impl
  1275. {
  1276. template < typename _Tp , typename ... _Args , typename
  1277. = decltype ( _Tp ( declval < _Args > ( ) ... ) ) >
  1278. static true_type __test ( int ) ;
  1279.  
  1280. template < typename , typename ... >
  1281. static false_type __test ( ... ) ;
  1282. } ;
  1283.  
  1284. template < typename _Tp , typename ... _Args >
  1285. struct __is_nary_constructible_impl
  1286. : public __do_is_nary_constructible_impl
  1287. {
  1288. typedef decltype ( __test < _Tp , _Args ... > ( 0 ) ) type ;
  1289. } ;
  1290.  
  1291. template < typename _Tp , typename ... _Args >
  1292. struct __is_nary_constructible
  1293. : public __is_nary_constructible_impl < _Tp , _Args ... > :: type
  1294. {
  1295. static_assert ( sizeof ... ( _Args ) > 1 ,
  1296. "Only useful for > 1 arguments" ) ;
  1297. } ;
  1298.  
  1299. template < typename _Tp , typename ... _Args >
  1300. struct __is_constructible_impl
  1301. : public __is_nary_constructible < _Tp , _Args ... >
  1302. { } ;
  1303.  
  1304. template < typename _Tp , typename _Arg >
  1305. struct __is_constructible_impl < _Tp , _Arg >
  1306. : public __is_direct_constructible < _Tp , _Arg >
  1307. { } ;
  1308.  
  1309. template < typename _Tp >
  1310. struct __is_constructible_impl < _Tp >
  1311. : public is_default_constructible < _Tp >
  1312. { } ;
  1313.  
  1314.  
  1315. template < typename _Tp , typename ... _Args >
  1316. struct is_constructible
  1317. : public integral_constant < bool , ( __is_constructible_impl < _Tp ,
  1318. _Args ... > :: value ) >
  1319. { } ;
  1320.  
  1321. template < typename _Tp , bool = is_void < _Tp > :: value >
  1322. struct __is_copy_constructible_impl ;
  1323.  
  1324. template < typename _Tp >
  1325. struct __is_copy_constructible_impl < _Tp , true >
  1326. : public false_type { } ;
  1327.  
  1328. template < typename _Tp >
  1329. struct __is_copy_constructible_impl < _Tp , false >
  1330. : public is_constructible < _Tp , const _Tp & >
  1331. { } ;
  1332.  
  1333.  
  1334. template < typename _Tp >
  1335. struct is_copy_constructible
  1336. : public __is_copy_constructible_impl < _Tp >
  1337. { } ;
  1338.  
  1339. template < typename _Tp , bool = is_void < _Tp > :: value >
  1340. struct __is_move_constructible_impl ;
  1341.  
  1342. template < typename _Tp >
  1343. struct __is_move_constructible_impl < _Tp , true >
  1344. : public false_type { } ;
  1345.  
  1346. template < typename _Tp >
  1347. struct __is_move_constructible_impl < _Tp , false >
  1348. : public is_constructible < _Tp , _Tp && >
  1349. { } ;
  1350.  
  1351.  
  1352. template < typename _Tp >
  1353. struct is_move_constructible
  1354. : public __is_move_constructible_impl < _Tp >
  1355. { } ;
  1356.  
  1357. template < typename _Tp >
  1358. struct __is_nt_default_constructible_atom
  1359. : public integral_constant < bool , noexcept ( _Tp ( ) ) >
  1360. { } ;
  1361.  
  1362. template < typename _Tp , bool = is_array < _Tp > :: value >
  1363. struct __is_nt_default_constructible_impl ;
  1364.  
  1365. template < typename _Tp >
  1366. struct __is_nt_default_constructible_impl < _Tp , true >
  1367. : public __and_ < __is_array_known_bounds < _Tp > ,
  1368. __is_nt_default_constructible_atom < typename
  1369. remove_all_extents < _Tp > :: type >> :: type
  1370. { } ;
  1371.  
  1372. template < typename _Tp >
  1373. struct __is_nt_default_constructible_impl < _Tp , false >
  1374. : public __is_nt_default_constructible_atom < _Tp >
  1375. { } ;
  1376.  
  1377.  
  1378. template < typename _Tp >
  1379. struct is_nothrow_default_constructible
  1380. : public __and_ < is_default_constructible < _Tp > ,
  1381. __is_nt_default_constructible_impl < _Tp >> :: type
  1382. { } ;
  1383.  
  1384. template < typename _Tp , typename ... _Args >
  1385. struct __is_nt_constructible_impl
  1386. : public integral_constant < bool , noexcept ( _Tp ( declval < _Args > ( ) ... ) ) >
  1387. { } ;
  1388.  
  1389. template < typename _Tp , typename _Arg >
  1390. struct __is_nt_constructible_impl < _Tp , _Arg >
  1391. : public integral_constant < bool ,
  1392. noexcept ( static_cast < _Tp > ( declval < _Arg > ( ) ) ) >
  1393. { } ;
  1394.  
  1395. template < typename _Tp >
  1396. struct __is_nt_constructible_impl < _Tp >
  1397. : public is_nothrow_default_constructible < _Tp >
  1398. { } ;
  1399.  
  1400.  
  1401. template < typename _Tp , typename ... _Args >
  1402. struct is_nothrow_constructible
  1403. : public __and_ < is_constructible < _Tp , _Args ... > ,
  1404. __is_nt_constructible_impl < _Tp , _Args ... >> :: type
  1405. { } ;
  1406.  
  1407. template < typename _Tp , bool = is_void < _Tp > :: value >
  1408. struct __is_nothrow_copy_constructible_impl ;
  1409.  
  1410. template < typename _Tp >
  1411. struct __is_nothrow_copy_constructible_impl < _Tp , true >
  1412. : public false_type { } ;
  1413.  
  1414. template < typename _Tp >
  1415. struct __is_nothrow_copy_constructible_impl < _Tp , false >
  1416. : public is_nothrow_constructible < _Tp , const _Tp & >
  1417. { } ;
  1418.  
  1419.  
  1420. template < typename _Tp >
  1421. struct is_nothrow_copy_constructible
  1422. : public __is_nothrow_copy_constructible_impl < _Tp >
  1423. { } ;
  1424.  
  1425. template < typename _Tp , bool = is_void < _Tp > :: value >
  1426. struct __is_nothrow_move_constructible_impl ;
  1427.  
  1428. template < typename _Tp >
  1429. struct __is_nothrow_move_constructible_impl < _Tp , true >
  1430. : public false_type { } ;
  1431.  
  1432. template < typename _Tp >
  1433. struct __is_nothrow_move_constructible_impl < _Tp , false >
  1434. : public is_nothrow_constructible < _Tp , _Tp && >
  1435. { } ;
  1436.  
  1437.  
  1438. template < typename _Tp >
  1439. struct is_nothrow_move_constructible
  1440. : public __is_nothrow_move_constructible_impl < _Tp >
  1441. { } ;
  1442.  
  1443. template < typename _Tp , typename _Up >
  1444. class __is_assignable_helper
  1445. : public __sfinae_types
  1446. {
  1447. template < typename _Tp1 , typename _Up1 >
  1448. static decltype ( declval < _Tp1 > ( ) = declval < _Up1 > ( ) , __one ( ) )
  1449. __test ( int ) ;
  1450.  
  1451. template < typename , typename >
  1452. static __two __test ( ... ) ;
  1453.  
  1454. public :
  1455. static constexpr bool value = sizeof ( __test < _Tp , _Up > ( 0 ) ) == 1 ;
  1456. } ;
  1457.  
  1458.  
  1459. template < typename _Tp , typename _Up >
  1460. struct is_assignable
  1461. : public integral_constant < bool ,
  1462. __is_assignable_helper < _Tp , _Up > :: value >
  1463. { } ;
  1464.  
  1465. template < typename _Tp , bool = is_void < _Tp > :: value >
  1466. struct __is_copy_assignable_impl ;
  1467.  
  1468. template < typename _Tp >
  1469. struct __is_copy_assignable_impl < _Tp , true >
  1470. : public false_type { } ;
  1471.  
  1472. template < typename _Tp >
  1473. struct __is_copy_assignable_impl < _Tp , false >
  1474. : public is_assignable < _Tp & , const _Tp & >
  1475. { } ;
  1476.  
  1477.  
  1478. template < typename _Tp >
  1479. struct is_copy_assignable
  1480. : public __is_copy_assignable_impl < _Tp >
  1481. { } ;
  1482.  
  1483. template < typename _Tp , bool = is_void < _Tp > :: value >
  1484. struct __is_move_assignable_impl ;
  1485.  
  1486. template < typename _Tp >
  1487. struct __is_move_assignable_impl < _Tp , true >
  1488. : public false_type { } ;
  1489.  
  1490. template < typename _Tp >
  1491. struct __is_move_assignable_impl < _Tp , false >
  1492. : public is_assignable < _Tp & , _Tp && >
  1493. { } ;
  1494.  
  1495.  
  1496. template < typename _Tp >
  1497. struct is_move_assignable
  1498. : public __is_move_assignable_impl < _Tp >
  1499. { } ;
  1500.  
  1501. template < typename _Tp , typename _Up >
  1502. struct __is_nt_assignable_impl
  1503. : public integral_constant < bool , noexcept ( declval < _Tp > ( ) = declval < _Up > ( ) ) >
  1504. { } ;
  1505.  
  1506.  
  1507. template < typename _Tp , typename _Up >
  1508. struct is_nothrow_assignable
  1509. : public __and_ < is_assignable < _Tp , _Up > ,
  1510. __is_nt_assignable_impl < _Tp , _Up >> :: type
  1511. { } ;
  1512.  
  1513. template < typename _Tp , bool = is_void < _Tp > :: value >
  1514. struct __is_nt_copy_assignable_impl ;
  1515.  
  1516. template < typename _Tp >
  1517. struct __is_nt_copy_assignable_impl < _Tp , true >
  1518. : public false_type { } ;
  1519.  
  1520. template < typename _Tp >
  1521. struct __is_nt_copy_assignable_impl < _Tp , false >
  1522. : public is_nothrow_assignable < _Tp & , const _Tp & >
  1523. { } ;
  1524.  
  1525.  
  1526. template < typename _Tp >
  1527. struct is_nothrow_copy_assignable
  1528. : public __is_nt_copy_assignable_impl < _Tp >
  1529. { } ;
  1530.  
  1531. template < typename _Tp , bool = is_void < _Tp > :: value >
  1532. struct __is_nt_move_assignable_impl ;
  1533.  
  1534. template < typename _Tp >
  1535. struct __is_nt_move_assignable_impl < _Tp , true >
  1536. : public false_type { } ;
  1537.  
  1538. template < typename _Tp >
  1539. struct __is_nt_move_assignable_impl < _Tp , false >
  1540. : public is_nothrow_assignable < _Tp & , _Tp && >
  1541. { } ;
  1542.  
  1543.  
  1544. template < typename _Tp >
  1545. struct is_nothrow_move_assignable
  1546. : public __is_nt_move_assignable_impl < _Tp >
  1547. { } ;
  1548. #1203
  1549. template < typename _Tp >
  1550. struct is_trivially_destructible
  1551. : public __and_ < is_destructible < _Tp > , integral_constant < bool ,
  1552. __oracle_has_trivial_destructor ( _Tp ) >> :: type
  1553. { } ;
  1554.  
  1555.  
  1556. template < typename _Tp >
  1557. struct has_trivial_default_constructor
  1558. : public integral_constant < bool , __oracle_has_trivial_constructor ( _Tp ) >
  1559. { } ;
  1560.  
  1561.  
  1562. template < typename _Tp >
  1563. struct has_trivial_copy_constructor
  1564. : public integral_constant < bool , __oracle_has_trivial_copy ( _Tp ) >
  1565. { } ;
  1566.  
  1567.  
  1568. template < typename _Tp >
  1569. struct has_trivial_copy_assign
  1570. : public integral_constant < bool , __oracle_has_trivial_assign ( _Tp ) >
  1571. { } ;
  1572.  
  1573.  
  1574. template < typename _Tp >
  1575. struct has_virtual_destructor
  1576. : public integral_constant < bool , __oracle_has_virtual_destructor ( _Tp ) >
  1577. { } ;
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583. template < typename _Tp >
  1584. struct alignment_of
  1585. : public integral_constant < std :: size_t , __alignof ( _Tp ) > { } ;
  1586.  
  1587.  
  1588. template < typename >
  1589. struct rank
  1590. : public integral_constant < std :: size_t , 0 > { } ;
  1591.  
  1592. template < typename _Tp , std :: size_t _Size >
  1593. struct rank < _Tp [ _Size ] >
  1594. : public integral_constant < std :: size_t , 1 + rank < _Tp > :: value > { } ;
  1595.  
  1596. template < typename _Tp >
  1597. struct rank < _Tp [ ] >
  1598. : public integral_constant < std :: size_t , 1 + rank < _Tp > :: value > { } ;
  1599.  
  1600.  
  1601. template < typename , unsigned _Uint >
  1602. struct extent
  1603. : public integral_constant < std :: size_t , 0 > { } ;
  1604.  
  1605. template < typename _Tp , unsigned _Uint , std :: size_t _Size >
  1606. struct extent < _Tp [ _Size ] , _Uint >
  1607. : public integral_constant < std :: size_t ,
  1608. _Uint == 0 ? _Size : extent < _Tp ,
  1609. _Uint - 1 > :: value >
  1610. { } ;
  1611.  
  1612. template < typename _Tp , unsigned _Uint >
  1613. struct extent < _Tp [ ] , _Uint >
  1614. : public integral_constant < std :: size_t ,
  1615. _Uint == 0 ? 0 : extent < _Tp ,
  1616. _Uint - 1 > :: value >
  1617. { } ;
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623. template < typename , typename >
  1624. struct is_same
  1625. : public false_type { } ;
  1626.  
  1627. template < typename _Tp >
  1628. struct is_same < _Tp , _Tp >
  1629. : public true_type { } ;
  1630.  
  1631.  
  1632. template < typename _Base , typename _Derived >
  1633. struct is_base_of
  1634. : public integral_constant < bool , __oracle_is_base_of ( _Base , _Derived ) >
  1635. { } ;
  1636.  
  1637. template < typename _From , typename _To ,
  1638. bool = __or_ < is_void < _From > , is_function < _To > ,
  1639. is_array < _To >> :: value >
  1640. struct __is_convertible_helper
  1641. { static constexpr bool value = is_void < _To > :: value ; } ;
  1642.  
  1643. template < typename _From , typename _To >
  1644. class __is_convertible_helper < _From , _To , false >
  1645. : public __sfinae_types
  1646. {
  1647. template < typename _To1 >
  1648. static void __test_aux ( _To1 ) ;
  1649.  
  1650. template < typename _From1 , typename _To1 >
  1651. static decltype ( __test_aux < _To1 > ( std :: declval < _From1 > ( ) ) , __one ( ) )
  1652. __test ( int ) ;
  1653.  
  1654. template < typename , typename >
  1655. static __two __test ( ... ) ;
  1656.  
  1657. public :
  1658. static constexpr bool value = sizeof ( __test < _From , _To > ( 0 ) ) == 1 ;
  1659. } ;
  1660.  
  1661.  
  1662. template < typename _From , typename _To >
  1663. struct is_convertible
  1664. : public integral_constant < bool ,
  1665. __is_convertible_helper < _From , _To > :: value >
  1666. { } ;
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672. template < typename _Tp >
  1673. struct remove_const
  1674. { typedef _Tp type ; } ;
  1675.  
  1676. template < typename _Tp >
  1677. struct remove_const < _Tp const >
  1678. { typedef _Tp type ; } ;
  1679.  
  1680.  
  1681. template < typename _Tp >
  1682. struct remove_volatile
  1683. { typedef _Tp type ; } ;
  1684.  
  1685. template < typename _Tp >
  1686. struct remove_volatile < _Tp volatile >
  1687. { typedef _Tp type ; } ;
  1688.  
  1689.  
  1690. template < typename _Tp >
  1691. struct remove_cv
  1692. {
  1693. typedef typename
  1694. remove_const < typename remove_volatile < _Tp > :: type > :: type type ;
  1695. } ;
  1696.  
  1697.  
  1698. template < typename _Tp >
  1699. struct add_const
  1700. { typedef _Tp const type ; } ;
  1701.  
  1702.  
  1703. template < typename _Tp >
  1704. struct add_volatile
  1705. { typedef _Tp volatile type ; } ;
  1706.  
  1707.  
  1708. template < typename _Tp >
  1709. struct add_cv
  1710. {
  1711. typedef typename
  1712. add_const < typename add_volatile < _Tp > :: type > :: type type ;
  1713. } ;
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719. template < typename _Tp >
  1720. struct remove_reference
  1721. { typedef _Tp type ; } ;
  1722.  
  1723. template < typename _Tp >
  1724. struct remove_reference < _Tp & >
  1725. { typedef _Tp type ; } ;
  1726.  
  1727. template < typename _Tp >
  1728. struct remove_reference < _Tp && >
  1729. { typedef _Tp type ; } ;
  1730.  
  1731. template < typename _Tp ,
  1732. bool = __and_ < __not_ < is_reference < _Tp >> ,
  1733. __not_ < is_void < _Tp >> > :: value ,
  1734. bool = is_rvalue_reference < _Tp > :: value >
  1735. struct __add_lvalue_reference_helper
  1736. { typedef _Tp type ; } ;
  1737.  
  1738. template < typename _Tp >
  1739. struct __add_lvalue_reference_helper < _Tp , true , false >
  1740. { typedef _Tp & type ; } ;
  1741.  
  1742. template < typename _Tp >
  1743. struct __add_lvalue_reference_helper < _Tp , false , true >
  1744. { typedef typename remove_reference < _Tp > :: type & type ; } ;
  1745.  
  1746.  
  1747. template < typename _Tp >
  1748. struct add_lvalue_reference
  1749. : public __add_lvalue_reference_helper < _Tp >
  1750. { } ;
  1751.  
  1752. template < typename _Tp ,
  1753. bool = __and_ < __not_ < is_reference < _Tp >> ,
  1754. __not_ < is_void < _Tp >> > :: value >
  1755. struct __add_rvalue_reference_helper
  1756. { typedef _Tp type ; } ;
  1757.  
  1758. template < typename _Tp >
  1759. struct __add_rvalue_reference_helper < _Tp , true >
  1760. { typedef _Tp && type ; } ;
  1761.  
  1762.  
  1763. template < typename _Tp >
  1764. struct add_rvalue_reference
  1765. : public __add_rvalue_reference_helper < _Tp >
  1766. { } ;
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772. template < typename _Unqualified , bool _IsConst , bool _IsVol >
  1773. struct __cv_selector ;
  1774.  
  1775. template < typename _Unqualified >
  1776. struct __cv_selector < _Unqualified , false , false >
  1777. { typedef _Unqualified __type ; } ;
  1778.  
  1779. template < typename _Unqualified >
  1780. struct __cv_selector < _Unqualified , false , true >
  1781. { typedef volatile _Unqualified __type ; } ;
  1782.  
  1783. template < typename _Unqualified >
  1784. struct __cv_selector < _Unqualified , true , false >
  1785. { typedef const _Unqualified __type ; } ;
  1786.  
  1787. template < typename _Unqualified >
  1788. struct __cv_selector < _Unqualified , true , true >
  1789. { typedef const volatile _Unqualified __type ; } ;
  1790.  
  1791. template < typename _Qualified , typename _Unqualified ,
  1792. bool _IsConst = is_const < _Qualified > :: value ,
  1793. bool _IsVol = is_volatile < _Qualified > :: value >
  1794. class __match_cv_qualifiers
  1795. {
  1796. typedef __cv_selector < _Unqualified , _IsConst , _IsVol > __match ;
  1797.  
  1798. public :
  1799. typedef typename __match :: __type __type ;
  1800. } ;
  1801.  
  1802.  
  1803. template < typename _Tp >
  1804. struct __make_unsigned
  1805. { typedef _Tp __type ; } ;
  1806.  
  1807. template < >
  1808. struct __make_unsigned < char >
  1809. { typedef unsigned char __type ; } ;
  1810.  
  1811. template < >
  1812. struct __make_unsigned < signed char >
  1813. { typedef unsigned char __type ; } ;
  1814.  
  1815. template < >
  1816. struct __make_unsigned < short >
  1817. { typedef unsigned short __type ; } ;
  1818.  
  1819. template < >
  1820. struct __make_unsigned < int >
  1821. { typedef unsigned int __type ; } ;
  1822.  
  1823. template < >
  1824. struct __make_unsigned < long >
  1825. { typedef unsigned long __type ; } ;
  1826.  
  1827. template < >
  1828. struct __make_unsigned < long long >
  1829. { typedef unsigned long long __type ; } ;
  1830. #1492
  1831. template < typename _Tp ,
  1832. bool _IsInt = is_integral < _Tp > :: value ,
  1833. bool _IsEnum = is_enum < _Tp > :: value >
  1834. class __make_unsigned_selector ;
  1835.  
  1836. template < typename _Tp >
  1837. class __make_unsigned_selector < _Tp , true , false >
  1838. {
  1839. typedef __make_unsigned < typename remove_cv < _Tp > :: type > __unsignedt ;
  1840. typedef typename __unsignedt :: __type __unsigned_type ;
  1841. typedef __match_cv_qualifiers < _Tp , __unsigned_type > __cv_unsigned ;
  1842.  
  1843. public :
  1844. typedef typename __cv_unsigned :: __type __type ;
  1845. } ;
  1846.  
  1847. template < typename _Tp >
  1848. class __make_unsigned_selector < _Tp , false , true >
  1849. {
  1850.  
  1851. typedef unsigned char __smallest ;
  1852. static const bool __b0 = sizeof ( _Tp ) <= sizeof ( __smallest ) ;
  1853. static const bool __b1 = sizeof ( _Tp ) <= sizeof ( unsigned short ) ;
  1854. static const bool __b2 = sizeof ( _Tp ) <= sizeof ( unsigned int ) ;
  1855. typedef conditional < __b2 , unsigned int , unsigned long > __cond2 ;
  1856. typedef typename __cond2 :: type __cond2_type ;
  1857. typedef conditional < __b1 , unsigned short , __cond2_type > __cond1 ;
  1858. typedef typename __cond1 :: type __cond1_type ;
  1859.  
  1860. public :
  1861. typedef typename conditional < __b0 , __smallest , __cond1_type > :: type __type ;
  1862. } ;
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868. template < typename _Tp >
  1869. struct make_unsigned
  1870. { typedef typename __make_unsigned_selector < _Tp > :: __type type ; } ;
  1871.  
  1872.  
  1873. template < >
  1874. struct make_unsigned < bool > ;
  1875.  
  1876.  
  1877.  
  1878. template < typename _Tp >
  1879. struct __make_signed
  1880. { typedef _Tp __type ; } ;
  1881.  
  1882. template < >
  1883. struct __make_signed < char >
  1884. { typedef signed char __type ; } ;
  1885.  
  1886. template < >
  1887. struct __make_signed < unsigned char >
  1888. { typedef signed char __type ; } ;
  1889.  
  1890. template < >
  1891. struct __make_signed < unsigned short >
  1892. { typedef signed short __type ; } ;
  1893.  
  1894. template < >
  1895. struct __make_signed < unsigned int >
  1896. { typedef signed int __type ; } ;
  1897.  
  1898. template < >
  1899. struct __make_signed < unsigned long >
  1900. { typedef signed long __type ; } ;
  1901.  
  1902. template < >
  1903. struct __make_signed < unsigned long long >
  1904. { typedef signed long long __type ; } ;
  1905. #1574
  1906. template < typename _Tp ,
  1907. bool _IsInt = is_integral < _Tp > :: value ,
  1908. bool _IsEnum = is_enum < _Tp > :: value >
  1909. class __make_signed_selector ;
  1910.  
  1911. template < typename _Tp >
  1912. class __make_signed_selector < _Tp , true , false >
  1913. {
  1914. typedef __make_signed < typename remove_cv < _Tp > :: type > __signedt ;
  1915. typedef typename __signedt :: __type __signed_type ;
  1916. typedef __match_cv_qualifiers < _Tp , __signed_type > __cv_signed ;
  1917.  
  1918. public :
  1919. typedef typename __cv_signed :: __type __type ;
  1920. } ;
  1921.  
  1922. template < typename _Tp >
  1923. class __make_signed_selector < _Tp , false , true >
  1924. {
  1925.  
  1926. typedef signed char __smallest ;
  1927. static const bool __b0 = sizeof ( _Tp ) <= sizeof ( __smallest ) ;
  1928. static const bool __b1 = sizeof ( _Tp ) <= sizeof ( signed short ) ;
  1929. static const bool __b2 = sizeof ( _Tp ) <= sizeof ( signed int ) ;
  1930. typedef conditional < __b2 , signed int , signed long > __cond2 ;
  1931. typedef typename __cond2 :: type __cond2_type ;
  1932. typedef conditional < __b1 , signed short , __cond2_type > __cond1 ;
  1933. typedef typename __cond1 :: type __cond1_type ;
  1934.  
  1935. public :
  1936. typedef typename conditional < __b0 , __smallest , __cond1_type > :: type __type ;
  1937. } ;
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943. template < typename _Tp >
  1944. struct make_signed
  1945. { typedef typename __make_signed_selector < _Tp > :: __type type ; } ;
  1946.  
  1947.  
  1948. template < >
  1949. struct make_signed < bool > ;
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955. template < typename _Tp >
  1956. struct remove_extent
  1957. { typedef _Tp type ; } ;
  1958.  
  1959. template < typename _Tp , std :: size_t _Size >
  1960. struct remove_extent < _Tp [ _Size ] >
  1961. { typedef _Tp type ; } ;
  1962.  
  1963. template < typename _Tp >
  1964. struct remove_extent < _Tp [ ] >
  1965. { typedef _Tp type ; } ;
  1966.  
  1967.  
  1968. template < typename _Tp >
  1969. struct remove_all_extents
  1970. { typedef _Tp type ; } ;
  1971.  
  1972. template < typename _Tp , std :: size_t _Size >
  1973. struct remove_all_extents < _Tp [ _Size ] >
  1974. { typedef typename remove_all_extents < _Tp > :: type type ; } ;
  1975.  
  1976. template < typename _Tp >
  1977. struct remove_all_extents < _Tp [ ] >
  1978. { typedef typename remove_all_extents < _Tp > :: type type ; } ;
  1979.  
  1980.  
  1981.  
  1982.  
  1983. template < typename _Tp , typename >
  1984. struct __remove_pointer_helper
  1985. { typedef _Tp type ; } ;
  1986.  
  1987. template < typename _Tp , typename _Up >
  1988. struct __remove_pointer_helper < _Tp , _Up * >
  1989. { typedef _Up type ; } ;
  1990.  
  1991.  
  1992. template < typename _Tp >
  1993. struct remove_pointer
  1994. : public __remove_pointer_helper < _Tp , typename remove_cv < _Tp > :: type >
  1995. { } ;
  1996.  
  1997.  
  1998. template < typename _Tp >
  1999. struct add_pointer
  2000. { typedef typename remove_reference < _Tp > :: type * type ; } ;
  2001.  
  2002.  
  2003. template < std :: size_t _Len >
  2004. struct __aligned_storage_msa
  2005. {
  2006. union __type
  2007. {
  2008. unsigned char __data [ _Len ] ;
  2009. struct __attribute__ ( ( __aligned__ ) ) { } __align ;
  2010. } ;
  2011. } ;
  2012. #1691
  2013. template < std :: size_t _Len , std :: size_t _Align =
  2014. __alignof ( typename __aligned_storage_msa < _Len > :: __type ) >
  2015. struct aligned_storage
  2016. {
  2017. union type
  2018. {
  2019. unsigned char __data [ _Len ] ;
  2020. struct __attribute__ ( ( __aligned__ ( ( _Align ) ) ) ) { } __align ;
  2021. } ;
  2022. } ;
  2023.  
  2024.  
  2025.  
  2026.  
  2027. template < typename _Up ,
  2028. bool _IsArray = is_array < _Up > :: value ,
  2029. bool _IsFunction = is_function < _Up > :: value >
  2030. struct __decay_selector ;
  2031.  
  2032.  
  2033. template < typename _Up >
  2034. struct __decay_selector < _Up , false , false >
  2035. { typedef typename remove_cv < _Up > :: type __type ; } ;
  2036.  
  2037. template < typename _Up >
  2038. struct __decay_selector < _Up , true , false >
  2039. { typedef typename remove_extent < _Up > :: type * __type ; } ;
  2040.  
  2041. template < typename _Up >
  2042. struct __decay_selector < _Up , false , true >
  2043. { typedef typename add_pointer < _Up > :: type __type ; } ;
  2044.  
  2045.  
  2046. template < typename _Tp >
  2047. class decay
  2048. {
  2049. typedef typename remove_reference < _Tp > :: type __remove_type ;
  2050.  
  2051. public :
  2052. typedef typename __decay_selector < __remove_type > :: __type type ;
  2053. } ;
  2054.  
  2055. template < typename _Tp >
  2056. class reference_wrapper ;
  2057.  
  2058.  
  2059. template < typename _Tp >
  2060. struct __strip_reference_wrapper
  2061. {
  2062. typedef _Tp __type ;
  2063. } ;
  2064.  
  2065. template < typename _Tp >
  2066. struct __strip_reference_wrapper < reference_wrapper < _Tp > >
  2067. {
  2068. typedef _Tp & __type ;
  2069. } ;
  2070.  
  2071. template < typename _Tp >
  2072. struct __strip_reference_wrapper < const reference_wrapper < _Tp > >
  2073. {
  2074. typedef _Tp & __type ;
  2075. } ;
  2076.  
  2077. template < typename _Tp >
  2078. struct __decay_and_strip
  2079. {
  2080. typedef typename __strip_reference_wrapper <
  2081. typename decay < _Tp > :: type > :: __type __type ;
  2082. } ;
  2083.  
  2084.  
  2085.  
  2086.  
  2087. template < bool , typename _Tp = void >
  2088. struct enable_if
  2089. { } ;
  2090.  
  2091.  
  2092. template < typename _Tp >
  2093. struct enable_if < true , _Tp >
  2094. { typedef _Tp type ; } ;
  2095.  
  2096. template < typename ... _Cond >
  2097. using _Require = typename enable_if < __and_ < _Cond ... > :: value > :: type ;
  2098.  
  2099.  
  2100.  
  2101. template < bool _Cond , typename _Iftrue , typename _Iffalse >
  2102. struct conditional
  2103. { typedef _Iftrue type ; } ;
  2104.  
  2105.  
  2106. template < typename _Iftrue , typename _Iffalse >
  2107. struct conditional < false , _Iftrue , _Iffalse >
  2108. { typedef _Iffalse type ; } ;
  2109.  
  2110.  
  2111. template < typename ... _Tp >
  2112. struct common_type ;
  2113.  
  2114.  
  2115.  
  2116. struct __do_common_type_impl
  2117. {
  2118. template < typename _Tp , typename _Up >
  2119. static __success_type < typename decay < decltype
  2120. ( true ? std :: declval < _Tp > ( )
  2121. : std :: declval < _Up > ( ) ) > :: type > _S_test ( int ) ;
  2122.  
  2123. template < typename , typename >
  2124. static __failure_type _S_test ( ... ) ;
  2125. } ;
  2126.  
  2127. template < typename _Tp , typename _Up >
  2128. struct __common_type_impl
  2129. : private __do_common_type_impl
  2130. {
  2131. typedef decltype ( _S_test < _Tp , _Up > ( 0 ) ) type ;
  2132. } ;
  2133.  
  2134. struct __do_member_type_wrapper
  2135. {
  2136. template < typename _Tp >
  2137. static __success_type < typename _Tp :: type > _S_test ( int ) ;
  2138.  
  2139. template < typename >
  2140. static __failure_type _S_test ( ... ) ;
  2141. } ;
  2142.  
  2143. template < typename _Tp >
  2144. struct __member_type_wrapper
  2145. : private __do_member_type_wrapper
  2146. {
  2147. typedef decltype ( _S_test < _Tp > ( 0 ) ) type ;
  2148. } ;
  2149.  
  2150. template < typename _CTp , typename ... _Args >
  2151. struct __expanded_common_type_wrapper
  2152. {
  2153. typedef common_type < typename _CTp :: type , _Args ... > type ;
  2154. } ;
  2155.  
  2156. template < typename ... _Args >
  2157. struct __expanded_common_type_wrapper < __failure_type , _Args ... >
  2158. { typedef __failure_type type ; } ;
  2159.  
  2160. template < typename _Tp >
  2161. struct common_type < _Tp >
  2162. { typedef typename decay < _Tp > :: type type ; } ;
  2163.  
  2164. template < typename _Tp , typename _Up >
  2165. struct common_type < _Tp , _Up >
  2166. : public __common_type_impl < _Tp , _Up > :: type
  2167. { } ;
  2168.  
  2169. template < typename _Tp , typename _Up , typename ... _Vp >
  2170. struct common_type < _Tp , _Up , _Vp ... >
  2171. : public __expanded_common_type_wrapper < typename __member_type_wrapper <
  2172. common_type < _Tp , _Up >> :: type , _Vp ... > :: type
  2173. { } ;
  2174.  
  2175.  
  2176. template < typename _Tp >
  2177. struct underlying_type
  2178. {
  2179. typedef __oracle_underlying_type ( _Tp ) type ;
  2180. } ;
  2181.  
  2182. template < typename _Tp >
  2183. struct __declval_protector
  2184. {
  2185. static const bool __stop = false ;
  2186. static typename add_rvalue_reference < _Tp > :: type __delegate ( ) ;
  2187. } ;
  2188.  
  2189. template < typename _Tp >
  2190. inline typename add_rvalue_reference < _Tp > :: type
  2191. declval ( ) noexcept
  2192. {
  2193. static_assert ( __declval_protector < _Tp > :: __stop ,
  2194. "declval() must not be used!" ) ;
  2195. return __declval_protector < _Tp > :: __delegate ( ) ;
  2196. }
  2197.  
  2198.  
  2199. template < typename _Signature >
  2200. class result_of ;
  2201.  
  2202.  
  2203.  
  2204.  
  2205. struct __result_of_memfun_ref_impl
  2206. {
  2207. template < typename _Fp , typename _Tp1 , typename ... _Args >
  2208. static __success_type < decltype (
  2209. ( std :: declval < _Tp1 > ( ) .* std :: declval < _Fp > ( ) ) ( std :: declval < _Args > ( ) ... )
  2210. ) > _S_test ( int ) ;
  2211.  
  2212. template < typename ... >
  2213. static __failure_type _S_test ( ... ) ;
  2214. } ;
  2215.  
  2216. template < typename _MemPtr , typename _Arg , typename ... _Args >
  2217. struct __result_of_memfun_ref
  2218. : private __result_of_memfun_ref_impl
  2219. {
  2220. typedef decltype ( _S_test < _MemPtr , _Arg , _Args ... > ( 0 ) ) type ;
  2221. } ;
  2222.  
  2223.  
  2224. struct __result_of_memfun_deref_impl
  2225. {
  2226. template < typename _Fp , typename _Tp1 , typename ... _Args >
  2227. static __success_type < decltype (
  2228. ( ( * std :: declval < _Tp1 > ( ) ) .* std :: declval < _Fp > ( ) ) ( std :: declval < _Args > ( ) ... )
  2229. ) > _S_test ( int ) ;
  2230.  
  2231. template < typename ... >
  2232. static __failure_type _S_test ( ... ) ;
  2233. } ;
  2234.  
  2235. template < typename _MemPtr , typename _Arg , typename ... _Args >
  2236. struct __result_of_memfun_deref
  2237. : private __result_of_memfun_deref_impl
  2238. {
  2239. typedef decltype ( _S_test < _MemPtr , _Arg , _Args ... > ( 0 ) ) type ;
  2240. } ;
  2241.  
  2242.  
  2243. struct __result_of_memobj_ref_impl
  2244. {
  2245. template < typename _Fp , typename _Tp1 >
  2246. static __success_type < decltype (
  2247. std :: declval < _Tp1 > ( ) .* std :: declval < _Fp > ( )
  2248. ) > _S_test ( int ) ;
  2249.  
  2250. template < typename , typename >
  2251. static __failure_type _S_test ( ... ) ;
  2252. } ;
  2253.  
  2254. template < typename _MemPtr , typename _Arg >
  2255. struct __result_of_memobj_ref
  2256. : private __result_of_memobj_ref_impl
  2257. {
  2258. typedef decltype ( _S_test < _MemPtr , _Arg > ( 0 ) ) type ;
  2259. } ;
  2260.  
  2261.  
  2262. struct __result_of_memobj_deref_impl
  2263. {
  2264. template < typename _Fp , typename _Tp1 >
  2265. static __success_type < decltype (
  2266. ( * std :: declval < _Tp1 > ( ) ) .* std :: declval < _Fp > ( )
  2267. ) > _S_test ( int ) ;
  2268.  
  2269. template < typename , typename >
  2270. static __failure_type _S_test ( ... ) ;
  2271. } ;
  2272.  
  2273. template < typename _MemPtr , typename _Arg >
  2274. struct __result_of_memobj_deref
  2275. : private __result_of_memobj_deref_impl
  2276. {
  2277. typedef decltype ( _S_test < _MemPtr , _Arg > ( 0 ) ) type ;
  2278. } ;
  2279.  
  2280. template < typename _MemPtr , typename _Arg >
  2281. struct __result_of_memobj ;
  2282.  
  2283. template < typename _Res , typename _Class , typename _Arg >
  2284. struct __result_of_memobj < _Res _Class :: * , _Arg >
  2285. {
  2286. typedef typename remove_cv < typename remove_reference <
  2287. _Arg > :: type > :: type _Argval ;
  2288. typedef _Res _Class :: * _MemPtr ;
  2289. typedef typename conditional < __or_ < is_same < _Argval , _Class > ,
  2290. is_base_of < _Class , _Argval >> :: value ,
  2291. __result_of_memobj_ref < _MemPtr , _Arg > ,
  2292. __result_of_memobj_deref < _MemPtr , _Arg >
  2293. > :: type :: type type ;
  2294. } ;
  2295.  
  2296. template < typename _MemPtr , typename _Arg , typename ... _Args >
  2297. struct __result_of_memfun ;
  2298.  
  2299. template < typename _Res , typename _Class , typename _Arg , typename ... _Args >
  2300. struct __result_of_memfun < _Res _Class :: * , _Arg , _Args ... >
  2301. {
  2302. typedef typename remove_cv < typename remove_reference <
  2303. _Arg > :: type > :: type _Argval ;
  2304. typedef _Res _Class :: * _MemPtr ;
  2305. typedef typename conditional < __or_ < is_same < _Argval , _Class > ,
  2306. is_base_of < _Class , _Argval >> :: value ,
  2307. __result_of_memfun_ref < _MemPtr , _Arg , _Args ... > ,
  2308. __result_of_memfun_deref < _MemPtr , _Arg , _Args ... >
  2309. > :: type :: type type ;
  2310. } ;
  2311.  
  2312. template < bool , bool , typename _Functor , typename ... _ArgTypes >
  2313. struct __result_of_impl
  2314. {
  2315. typedef __failure_type type ;
  2316. } ;
  2317.  
  2318. template < typename _MemPtr , typename _Arg >
  2319. struct __result_of_impl < true , false , _MemPtr , _Arg >
  2320. : public __result_of_memobj < typename decay < _MemPtr > :: type , _Arg >
  2321. { } ;
  2322.  
  2323. template < typename _MemPtr , typename _Arg , typename ... _Args >
  2324. struct __result_of_impl < false , true , _MemPtr , _Arg , _Args ... >
  2325. : public __result_of_memfun < typename decay < _MemPtr > :: type , _Arg , _Args ... >
  2326. { } ;
  2327.  
  2328.  
  2329. struct __result_of_other_impl
  2330. {
  2331. template < typename _Fn , typename ... _Args >
  2332. static __success_type < decltype (
  2333. std :: declval < _Fn > ( ) ( std :: declval < _Args > ( ) ... )
  2334. ) > _S_test ( int ) ;
  2335.  
  2336. template < typename ... >
  2337. static __failure_type _S_test ( ... ) ;
  2338. } ;
  2339.  
  2340. template < typename _Functor , typename ... _ArgTypes >
  2341. struct __result_of_impl < false , false , _Functor , _ArgTypes ... >
  2342. : private __result_of_other_impl
  2343. {
  2344. typedef decltype ( _S_test < _Functor , _ArgTypes ... > ( 0 ) ) type ;
  2345. } ;
  2346.  
  2347. template < typename _Functor , typename ... _ArgTypes >
  2348. struct result_of < _Functor ( _ArgTypes ... ) >
  2349. : public __result_of_impl <
  2350. is_member_object_pointer <
  2351. typename remove_reference < _Functor > :: type
  2352. > :: value ,
  2353. is_member_function_pointer <
  2354. typename remove_reference < _Functor > :: type
  2355. > :: value ,
  2356. _Functor , _ArgTypes ...
  2357. > :: type
  2358. { } ;
  2359. #2070
  2360. }
  2361. #59 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/move.h"
  2362. namespace std
  2363. {
  2364. #74
  2365. template < typename _Tp >
  2366. constexpr _Tp &&
  2367. forward ( typename std :: remove_reference < _Tp > :: type & __t ) noexcept
  2368. { return static_cast < _Tp && > ( __t ) ; }
  2369. #85
  2370. template < typename _Tp >
  2371. constexpr _Tp &&
  2372. forward ( typename std :: remove_reference < _Tp > :: type && __t ) noexcept
  2373. {
  2374. static_assert ( ! std :: is_lvalue_reference < _Tp > :: value , "template argument"
  2375. " substituting _Tp is an lvalue reference type" ) ;
  2376. return static_cast < _Tp && > ( __t ) ;
  2377. }
  2378. #99
  2379. template < typename _Tp >
  2380. constexpr typename std :: remove_reference < _Tp > :: type &&
  2381. move ( _Tp && __t ) noexcept
  2382. { return static_cast < typename std :: remove_reference < _Tp > :: type && > ( __t ) ; }
  2383.  
  2384.  
  2385. template < typename _Tp >
  2386. struct __move_if_noexcept_cond
  2387. : public __and_ < __not_ < is_nothrow_move_constructible < _Tp >> ,
  2388. is_copy_constructible < _Tp >> :: type { } ;
  2389. #118
  2390. template < typename _Tp >
  2391. inline constexpr typename
  2392. conditional < __move_if_noexcept_cond < _Tp > :: value , const _Tp & , _Tp && > :: type
  2393. move_if_noexcept ( _Tp & __x ) noexcept
  2394. { return std :: move ( __x ) ; }
  2395. #133
  2396. template < typename _Tp >
  2397. inline _Tp *
  2398. addressof ( _Tp & __r ) noexcept
  2399. { return std :: __addressof ( __r ) ; }
  2400.  
  2401.  
  2402.  
  2403. }
  2404. #149
  2405. namespace std
  2406. {
  2407. #164
  2408. template < typename _Tp >
  2409. inline void
  2410. swap ( _Tp & __a , _Tp & __b )
  2411.  
  2412. noexcept ( __and_ < is_nothrow_move_constructible < _Tp > ,
  2413. is_nothrow_move_assignable < _Tp >> :: value )
  2414.  
  2415. {
  2416.  
  2417.  
  2418.  
  2419. _Tp __tmp = std :: move ( __a ) ;
  2420. __a = std :: move ( __b ) ;
  2421. __b = std :: move ( __tmp ) ;
  2422. }
  2423.  
  2424.  
  2425.  
  2426.  
  2427. template < typename _Tp , size_t _Nm >
  2428. inline void
  2429. swap ( _Tp ( & __a ) [ _Nm ] , _Tp ( & __b ) [ _Nm ] )
  2430.  
  2431. noexcept ( noexcept ( swap ( * __a , * __b ) ) )
  2432.  
  2433. {
  2434. for ( size_t __n = 0 ; __n < _Nm ; ++ __n )
  2435. swap ( __a [ __n ] , __b [ __n ] ) ;
  2436. }
  2437.  
  2438.  
  2439.  
  2440. }
  2441. #73 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/bits/stl_pair.h"
  2442. namespace std
  2443. {
  2444. #84
  2445. struct piecewise_construct_t { } ;
  2446.  
  2447.  
  2448. constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t ( ) ;
  2449.  
  2450.  
  2451. template < typename ... >
  2452. class tuple ;
  2453.  
  2454. template < std :: size_t ... >
  2455. struct _Index_tuple ;
  2456. #103
  2457. template < class _T1 , class _T2 >
  2458. struct pair
  2459. {
  2460. typedef _T1 first_type ;
  2461. typedef _T2 second_type ;
  2462.  
  2463. _T1 first ;
  2464. _T2 second ;
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470. constexpr pair ( )
  2471. : first ( ) , second ( ) { }
  2472.  
  2473.  
  2474. constexpr pair ( const _T1 & __a , const _T2 & __b )
  2475. : first ( __a ) , second ( __b ) { }
  2476. #129
  2477. template < class _U1 , class _U2 , class = typename
  2478. enable_if < __and_ < is_convertible < const _U1 & , _T1 > ,
  2479. is_convertible < const _U2 & , _T2 >> :: value > :: type >
  2480. constexpr pair ( const pair < _U1 , _U2 > & __p )
  2481. : first ( __p . first ) , second ( __p . second ) { }
  2482.  
  2483. constexpr pair ( const pair & ) = default ;
  2484. constexpr pair ( pair && ) = default ;
  2485.  
  2486.  
  2487. template < class _U1 , class = typename
  2488. enable_if < is_convertible < _U1 , _T1 > :: value > :: type >
  2489. constexpr pair ( _U1 && __x , const _T2 & __y )
  2490. : first ( std :: forward < _U1 > ( __x ) ) , second ( __y ) { }
  2491.  
  2492. template < class _U2 , class = typename
  2493. enable_if < is_convertible < _U2 , _T2 > :: value > :: type >
  2494. constexpr pair ( const _T1 & __x , _U2 && __y )
  2495. : first ( __x ) , second ( std :: forward < _U2 > ( __y ) ) { }
  2496.  
  2497. template < class _U1 , class _U2 , class = typename
  2498. enable_if < __and_ < is_convertible < _U1 , _T1 > ,
  2499. is_convertible < _U2 , _T2 >> :: value > :: type >
  2500. constexpr pair ( _U1 && __x , _U2 && __y )
  2501. : first ( std :: forward < _U1 > ( __x ) ) , second ( std :: forward < _U2 > ( __y ) ) { }
  2502.  
  2503. template < class _U1 , class _U2 , class = typename
  2504. enable_if < __and_ < is_convertible < _U1 , _T1 > ,
  2505. is_convertible < _U2 , _T2 >> :: value > :: type >
  2506. constexpr pair ( pair < _U1 , _U2 > && __p )
  2507. : first ( std :: forward < _U1 > ( __p . first ) ) ,
  2508. second ( std :: forward < _U2 > ( __p . second ) ) { }
  2509.  
  2510. template < typename ... _Args1 , typename ... _Args2 >
  2511. pair ( piecewise_construct_t , tuple < _Args1 ... > , tuple < _Args2 ... > ) ;
  2512.  
  2513. pair &
  2514. operator = ( const pair & __p )
  2515. {
  2516. first = __p . first ;
  2517. second = __p . second ;
  2518. return * this ;
  2519. }
  2520.  
  2521. pair &
  2522. operator = ( pair && __p )
  2523. noexcept ( __and_ < is_nothrow_move_assignable < _T1 > ,
  2524. is_nothrow_move_assignable < _T2 >> :: value )
  2525. {
  2526. first = std :: forward < first_type > ( __p . first ) ;
  2527. second = std :: forward < second_type > ( __p . second ) ;
  2528. return * this ;
  2529. }
  2530.  
  2531. template < class _U1 , class _U2 >
  2532. pair &
  2533. operator = ( const pair < _U1 , _U2 > & __p )
  2534. {
  2535. first = __p . first ;
  2536. second = __p . second ;
  2537. return * this ;
  2538. }
  2539.  
  2540. template < class _U1 , class _U2 >
  2541. pair &
  2542. operator = ( pair < _U1 , _U2 > && __p )
  2543. {
  2544. first = std :: forward < _U1 > ( __p . first ) ;
  2545. second = std :: forward < _U2 > ( __p . second ) ;
  2546. return * this ;
  2547. }
  2548.  
  2549. void
  2550. swap ( pair & __p )
  2551. noexcept ( noexcept ( std :: swap ( first , __p . first ) )
  2552. && noexcept ( std :: swap ( second , __p . second ) ) )
  2553. {
  2554. using std :: swap ;
  2555. swap ( first , __p . first ) ;
  2556. swap ( second , __p . second ) ;
  2557. }
  2558.  
  2559. private :
  2560. template < typename ... _Args1 , std :: size_t ... _Indexes1 ,
  2561. typename ... _Args2 , std :: size_t ... _Indexes2 >
  2562. pair ( tuple < _Args1 ... > & , tuple < _Args2 ... > & ,
  2563. _Index_tuple < _Indexes1 ... > , _Index_tuple < _Indexes2 ... > ) ;
  2564.  
  2565. } ;
  2566.  
  2567.  
  2568. template < class _T1 , class _T2 >
  2569. inline constexpr bool
  2570. operator == ( const pair < _T1 , _T2 > & __x , const pair < _T1 , _T2 > & __y )
  2571. { return __x . first == __y . first && __x . second == __y . second ; }
  2572.  
  2573.  
  2574. template < class _T1 , class _T2 >
  2575. inline constexpr bool
  2576. operator < ( const pair < _T1 , _T2 > & __x , const pair < _T1 , _T2 > & __y )
  2577. { return __x . first < __y . first
  2578. || ( ! ( __y . first < __x . first ) && __x . second < __y . second ) ; }
  2579.  
  2580.  
  2581. template < class _T1 , class _T2 >
  2582. inline constexpr bool
  2583. operator != ( const pair < _T1 , _T2 > & __x , const pair < _T1 , _T2 > & __y )
  2584. { return ! ( __x == __y ) ; }
  2585.  
  2586.  
  2587. template < class _T1 , class _T2 >
  2588. inline constexpr bool
  2589. operator > ( const pair < _T1 , _T2 > & __x , const pair < _T1 , _T2 > & __y )
  2590. { return __y < __x ; }
  2591.  
  2592.  
  2593. template < class _T1 , class _T2 >
  2594. inline constexpr bool
  2595. operator <= ( const pair < _T1 , _T2 > & __x , const pair < _T1 , _T2 > & __y )
  2596. { return ! ( __y < __x ) ; }
  2597.  
  2598.  
  2599. template < class _T1 , class _T2 >
  2600. inline constexpr bool
  2601. operator >= ( const pair < _T1 , _T2 > & __x , const pair < _T1 , _T2 > & __y )
  2602. { return ! ( __x < __y ) ; }
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608. template < class _T1 , class _T2 >
  2609. inline void
  2610. swap ( pair < _T1 , _T2 > & __x , pair < _T1 , _T2 > & __y )
  2611. noexcept ( noexcept ( __x . swap ( __y ) ) )
  2612. { __x . swap ( __y ) ; }
  2613. #281
  2614. template < class _T1 , class _T2 >
  2615. constexpr pair < typename __decay_and_strip < _T1 > :: __type ,
  2616. typename __decay_and_strip < _T2 > :: __type >
  2617. make_pair ( _T1 && __x , _T2 && __y )
  2618. {
  2619. typedef typename __decay_and_strip < _T1 > :: __type __ds_type1 ;
  2620. typedef typename __decay_and_strip < _T2 > :: __type __ds_type2 ;
  2621. typedef pair < __ds_type1 , __ds_type2 > __pair_type ;
  2622. return __pair_type ( std :: forward < _T1 > ( __x ) , std :: forward < _T2 > ( __y ) ) ;
  2623. }
  2624. #301
  2625. }
  2626. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/initializer_list"
  2627. #33
  2628. #pragma GCC system_header
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634. #pragma GCC visibility push ( default )
  2635. #43
  2636. namespace std
  2637. {
  2638.  
  2639. template < class _E >
  2640. class initializer_list
  2641. {
  2642. public :
  2643. typedef _E value_type ;
  2644. typedef const _E & reference ;
  2645. typedef const _E & const_reference ;
  2646. typedef size_t size_type ;
  2647. typedef const _E * iterator ;
  2648. typedef const _E * const_iterator ;
  2649.  
  2650. private :
  2651. iterator _M_array ;
  2652. size_type _M_len ;
  2653.  
  2654.  
  2655. constexpr initializer_list ( const_iterator __a , size_type __l )
  2656. : _M_array ( __a ) , _M_len ( __l ) { }
  2657.  
  2658. public :
  2659. constexpr initializer_list ( ) noexcept
  2660. : _M_array ( 0 ) , _M_len ( 0 ) { }
  2661.  
  2662.  
  2663. constexpr size_type
  2664. size ( ) const noexcept { return _M_len ; }
  2665.  
  2666.  
  2667. constexpr const_iterator
  2668. begin ( ) const noexcept { return _M_array ; }
  2669.  
  2670.  
  2671. constexpr const_iterator
  2672. end ( ) const noexcept { return begin ( ) + size ( ) ; }
  2673. } ;
  2674. #87
  2675. template < class _Tp >
  2676. constexpr const _Tp *
  2677. begin ( initializer_list < _Tp > __ils ) noexcept
  2678. { return __ils . begin ( ) ; }
  2679. #97
  2680. template < class _Tp >
  2681. constexpr const _Tp *
  2682. end ( initializer_list < _Tp > __ils ) noexcept
  2683. { return __ils . end ( ) ; }
  2684. }
  2685.  
  2686. #pragma GCC visibility pop
  2687. #76 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/utility"
  2688. namespace std
  2689. {
  2690.  
  2691.  
  2692. template < class _Tp >
  2693. class tuple_size ;
  2694.  
  2695. template < std :: size_t _Int , class _Tp >
  2696. class tuple_element ;
  2697.  
  2698.  
  2699. template < class _Tp1 , class _Tp2 >
  2700. struct tuple_size < std :: pair < _Tp1 , _Tp2 >>
  2701. : public integral_constant < std :: size_t , 2 > { } ;
  2702.  
  2703. template < class _Tp1 , class _Tp2 >
  2704. struct tuple_element < 0 , std :: pair < _Tp1 , _Tp2 >>
  2705. { typedef _Tp1 type ; } ;
  2706.  
  2707. template < class _Tp1 , class _Tp2 >
  2708. struct tuple_element < 1 , std :: pair < _Tp1 , _Tp2 >>
  2709. { typedef _Tp2 type ; } ;
  2710.  
  2711. template < std :: size_t _Int >
  2712. struct __pair_get ;
  2713.  
  2714. template < >
  2715. struct __pair_get < 0 >
  2716. {
  2717. template < typename _Tp1 , typename _Tp2 >
  2718. static constexpr _Tp1 &
  2719. __get ( std :: pair < _Tp1 , _Tp2 > & __pair ) noexcept
  2720. { return __pair . first ; }
  2721.  
  2722. template < typename _Tp1 , typename _Tp2 >
  2723. static constexpr _Tp1 &&
  2724. __move_get ( std :: pair < _Tp1 , _Tp2 > && __pair ) noexcept
  2725. { return std :: forward < _Tp1 > ( __pair . first ) ; }
  2726.  
  2727. template < typename _Tp1 , typename _Tp2 >
  2728. static constexpr const _Tp1 &
  2729. __const_get ( const std :: pair < _Tp1 , _Tp2 > & __pair ) noexcept
  2730. { return __pair . first ; }
  2731. } ;
  2732.  
  2733. template < >
  2734. struct __pair_get < 1 >
  2735. {
  2736. template < typename _Tp1 , typename _Tp2 >
  2737. static constexpr _Tp2 &
  2738. __get ( std :: pair < _Tp1 , _Tp2 > & __pair ) noexcept
  2739. { return __pair . second ; }
  2740.  
  2741. template < typename _Tp1 , typename _Tp2 >
  2742. static constexpr _Tp2 &&
  2743. __move_get ( std :: pair < _Tp1 , _Tp2 > && __pair ) noexcept
  2744. { return std :: forward < _Tp2 > ( __pair . second ) ; }
  2745.  
  2746. template < typename _Tp1 , typename _Tp2 >
  2747. static constexpr const _Tp2 &
  2748. __const_get ( const std :: pair < _Tp1 , _Tp2 > & __pair ) noexcept
  2749. { return __pair . second ; }
  2750. } ;
  2751.  
  2752. template < std :: size_t _Int , class _Tp1 , class _Tp2 >
  2753. constexpr typename tuple_element < _Int , std :: pair < _Tp1 , _Tp2 >> :: type &
  2754. get ( std :: pair < _Tp1 , _Tp2 > & __in ) noexcept
  2755. { return __pair_get < _Int > :: __get ( __in ) ; }
  2756.  
  2757. template < std :: size_t _Int , class _Tp1 , class _Tp2 >
  2758. constexpr typename tuple_element < _Int , std :: pair < _Tp1 , _Tp2 >> :: type &&
  2759. get ( std :: pair < _Tp1 , _Tp2 > && __in ) noexcept
  2760. { return __pair_get < _Int > :: __move_get ( std :: move ( __in ) ) ; }
  2761.  
  2762. template < std :: size_t _Int , class _Tp1 , class _Tp2 >
  2763. constexpr const typename tuple_element < _Int , std :: pair < _Tp1 , _Tp2 >> :: type &
  2764. get ( const std :: pair < _Tp1 , _Tp2 > & __in ) noexcept
  2765. { return __pair_get < _Int > :: __const_get ( __in ) ; }
  2766.  
  2767.  
  2768. }
  2769. #1 "./boost/config/stdlib/libstdcpp3.hpp"
  2770. #1 "/usr/include/unistd.h"
  2771. #16
  2772. #pragma ident "@(#)unistd.h 1.76    06/03/10 SMI"
  2773. #1 "/usr/include/sys/feature_tests.h"
  2774. #8
  2775. #pragma ident "@(#)feature_tests.h  1.26    11/04/12 SMI"
  2776. #1 "/usr/include/sys/ccompile.h"
  2777. #9
  2778. #pragma ident "@(#)ccompile.h   1.2 04/11/08 SMI"
  2779. #17
  2780. extern "C" {
  2781. #103
  2782. }
  2783. #14 "/usr/include/sys/feature_tests.h"
  2784. extern "C" {
  2785. #377
  2786. }
  2787. #1 "/usr/include/sys/types.h"
  2788. #15
  2789. #pragma ident "@(#)types.h  1.88    12/06/11 SMI"
  2790. #1 "/usr/include/sys/machtypes.h"
  2791. #9
  2792. #pragma ident "@(#)machtypes.h  1.11    04/09/28 SMI"
  2793. #1 "/usr/include/ia32/sys/machtypes.h"
  2794. #9
  2795. #pragma ident "@(#)machtypes.h  1.2 04/09/28 SMI"
  2796.  
  2797.  
  2798. extern "C" {
  2799. #25
  2800. typedef struct _label_t { long val [ 8 ] ; } label_t ;
  2801. #32
  2802. typedef unsigned char lock_t ;
  2803.  
  2804.  
  2805. }
  2806. #1 "/usr/include/sys/int_types.h"
  2807. #9
  2808. #pragma ident "@(#)int_types.h  1.10    04/09/28 SMI"
  2809. #37
  2810. extern "C" {
  2811. #54
  2812. typedef char int8_t ;
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818. typedef short int16_t ;
  2819. typedef int int32_t ;
  2820.  
  2821.  
  2822. typedef long int64_t ;
  2823. #72
  2824. typedef unsigned char uint8_t ;
  2825. typedef unsigned short uint16_t ;
  2826. typedef unsigned int uint32_t ;
  2827.  
  2828. typedef unsigned long uint64_t ;
  2829. #88
  2830. typedef int64_t intmax_t ;
  2831. typedef uint64_t uintmax_t ;
  2832. #101
  2833. typedef long intptr_t ;
  2834. typedef unsigned long uintptr_t ;
  2835. #113
  2836. typedef char int_fast8_t ;
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842. typedef int int_fast16_t ;
  2843. typedef int int_fast32_t ;
  2844.  
  2845. typedef long int_fast64_t ;
  2846. #129
  2847. typedef unsigned char uint_fast8_t ;
  2848. typedef unsigned int uint_fast16_t ;
  2849. typedef unsigned int uint_fast32_t ;
  2850.  
  2851. typedef unsigned long uint_fast64_t ;
  2852. #145
  2853. typedef char int_least8_t ;
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859. typedef short int_least16_t ;
  2860. typedef int int_least32_t ;
  2861.  
  2862. typedef long int_least64_t ;
  2863. #161
  2864. typedef unsigned char uint_least8_t ;
  2865. typedef unsigned short uint_least16_t ;
  2866. typedef unsigned int uint_least32_t ;
  2867.  
  2868. typedef unsigned long uint_least64_t ;
  2869. #173
  2870. }
  2871. #43 "/usr/include/sys/types.h"
  2872. extern "C" {
  2873. #52
  2874. typedef long long longlong_t ;
  2875. typedef unsigned long long u_longlong_t ;
  2876. #72
  2877. typedef int32_t t_scalar_t ;
  2878. typedef uint32_t t_uscalar_t ;
  2879. #82
  2880. typedef unsigned char uchar_t ;
  2881. typedef unsigned short ushort_t ;
  2882. typedef unsigned int uint_t ;
  2883. typedef unsigned long ulong_t ;
  2884.  
  2885. typedef char * caddr_t ;
  2886. typedef long daddr_t ;
  2887. typedef short cnt_t ;
  2888.  
  2889.  
  2890.  
  2891.  
  2892. typedef long ptrdiff_t ;
  2893. #103
  2894. typedef ulong_t pfn_t ;
  2895. typedef ulong_t pgcnt_t ;
  2896. typedef long spgcnt_t ;
  2897.  
  2898. typedef uchar_t use_t ;
  2899. typedef short sysid_t ;
  2900. typedef short index_t ;
  2901. typedef void * timeout_id_t ;
  2902. typedef void * bufcall_id_t ;
  2903. #125
  2904. typedef long off_t ;
  2905. #132
  2906. typedef off_t off64_t ;
  2907. #141
  2908. typedef ulong_t ino_t ;
  2909. typedef long blkcnt_t ;
  2910. typedef ulong_t fsblkcnt_t ;
  2911. typedef ulong_t fsfilcnt_t ;
  2912. #154
  2913. typedef ino_t ino64_t ;
  2914. typedef blkcnt_t blkcnt64_t ;
  2915. typedef fsblkcnt_t fsblkcnt64_t ;
  2916. typedef fsfilcnt_t fsfilcnt64_t ;
  2917. #167
  2918. typedef int blksize_t ;
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924. typedef enum { _B_FALSE , _B_TRUE } boolean_t ;
  2925. #191
  2926. typedef int64_t pad64_t ;
  2927. typedef uint64_t upad64_t ;
  2928. #205
  2929. typedef union {
  2930. long double _q ;
  2931. int32_t _l [ 4 ] ;
  2932. } pad128_t ;
  2933.  
  2934. typedef union {
  2935. long double _q ;
  2936. uint32_t _l [ 4 ] ;
  2937. } upad128_t ;
  2938.  
  2939. typedef longlong_t offset_t ;
  2940. typedef u_longlong_t u_offset_t ;
  2941. typedef u_longlong_t len_t ;
  2942. typedef u_longlong_t diskaddr_t ;
  2943. #229
  2944. typedef union {
  2945. offset_t _f ;
  2946. struct {
  2947. int32_t _l ;
  2948. int32_t _u ;
  2949. } _p ;
  2950. } lloff_t ;
  2951. #249
  2952. typedef union {
  2953. longlong_t _f ;
  2954. struct {
  2955. int32_t _l ;
  2956. int32_t _u ;
  2957. } _p ;
  2958. } lldaddr_t ;
  2959. #268
  2960. typedef uint_t k_fltset_t ;
  2961. #280
  2962. typedef int id_t ;
  2963.  
  2964.  
  2965.  
  2966.  
  2967. typedef id_t lgrp_id_t ;
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973. typedef uint_t useconds_t ;
  2974.  
  2975.  
  2976.  
  2977. typedef long suseconds_t ;
  2978. #302
  2979. typedef uint_t major_t ;
  2980. typedef uint_t minor_t ;
  2981. #312
  2982. typedef short pri_t ;
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988. typedef ushort_t cpu_flag_t ;
  2989. #331
  2990. typedef ushort_t o_mode_t ;
  2991. typedef short o_dev_t ;
  2992. typedef ushort_t o_uid_t ;
  2993. typedef o_uid_t o_gid_t ;
  2994. typedef short o_nlink_t ;
  2995. typedef short o_pid_t ;
  2996. typedef ushort_t o_ino_t ;
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002. typedef int key_t ;
  3003.  
  3004. typedef uint_t mode_t ;
  3005. #353
  3006. typedef int uid_t ;
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012. typedef uid_t gid_t ;
  3013.  
  3014. typedef id_t taskid_t ;
  3015. typedef id_t projid_t ;
  3016. typedef id_t poolid_t ;
  3017. typedef id_t zoneid_t ;
  3018. typedef id_t ctid_t ;
  3019. #372
  3020. typedef uint_t pthread_t ;
  3021. typedef uint_t pthread_key_t ;
  3022. #381
  3023. typedef struct _pthread_mutex {
  3024. struct {
  3025. uint16_t __pthread_mutex_flag1 ;
  3026. uint8_t __pthread_mutex_flag2 ;
  3027. uint8_t __pthread_mutex_ceiling ;
  3028. uint16_t __pthread_mutex_type ;
  3029. uint16_t __pthread_mutex_magic ;
  3030. } __pthread_mutex_flags ;
  3031. union {
  3032. struct {
  3033. uint8_t __pthread_mutex_pad [ 8 ] ;
  3034. } __pthread_mutex_lock64 ;
  3035. struct {
  3036. uint32_t __pthread_ownerpid ;
  3037. uint32_t __pthread_lockword ;
  3038. } __pthread_mutex_lock32 ;
  3039. upad64_t __pthread_mutex_owner64 ;
  3040. } __pthread_mutex_lock ;
  3041. upad64_t __pthread_mutex_data ;
  3042. } pthread_mutex_t ;
  3043.  
  3044. typedef struct _pthread_cond {
  3045. struct {
  3046. uint8_t __pthread_cond_flag [ 4 ] ;
  3047. uint16_t __pthread_cond_type ;
  3048. uint16_t __pthread_cond_magic ;
  3049. } __pthread_cond_flags ;
  3050. upad64_t __pthread_cond_data ;
  3051. } pthread_cond_t ;
  3052.  
  3053.  
  3054.  
  3055.  
  3056. typedef struct _pthread_rwlock {
  3057. int32_t __pthread_rwlock_readers ;
  3058. uint16_t __pthread_rwlock_type ;
  3059. uint16_t __pthread_rwlock_magic ;
  3060. pthread_mutex_t __pthread_rwlock_mutex ;
  3061. pthread_cond_t __pthread_rwlock_readercv ;
  3062. pthread_cond_t __pthread_rwlock_writercv ;
  3063. } pthread_rwlock_t ;
  3064.  
  3065.  
  3066.  
  3067.  
  3068. typedef struct {
  3069. uint32_t __pthread_barrier_count ;
  3070. uint32_t __pthread_barrier_current ;
  3071. upad64_t __pthread_barrier_cycle ;
  3072. upad64_t __pthread_barrier_reserved ;
  3073. pthread_mutex_t __pthread_barrier_lock ;
  3074. pthread_cond_t __pthread_barrier_cond ;
  3075. } pthread_barrier_t ;
  3076.  
  3077. typedef pthread_mutex_t pthread_spinlock_t ;
  3078.  
  3079.  
  3080.  
  3081.  
  3082. typedef struct _pthread_attr {
  3083. void * __pthread_attrp ;
  3084. } pthread_attr_t ;
  3085.  
  3086.  
  3087.  
  3088.  
  3089. typedef struct _pthread_mutexattr {
  3090. void * __pthread_mutexattrp ;
  3091. } pthread_mutexattr_t ;
  3092.  
  3093.  
  3094.  
  3095.  
  3096. typedef struct _pthread_condattr {
  3097. void * __pthread_condattrp ;
  3098. } pthread_condattr_t ;
  3099.  
  3100.  
  3101.  
  3102.  
  3103. typedef struct _once {
  3104. upad64_t __pthread_once_pad [ 4 ] ;
  3105. } pthread_once_t ;
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111. typedef struct _pthread_rwlockattr {
  3112. void * __pthread_rwlockattrp ;
  3113. } pthread_rwlockattr_t ;
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119. typedef struct {
  3120. void * __pthread_barrierattrp ;
  3121. } pthread_barrierattr_t ;
  3122.  
  3123. typedef ulong_t dev_t ;
  3124.  
  3125.  
  3126. typedef uint_t nlink_t ;
  3127. typedef int pid_t ;
  3128. #494
  3129. typedef ulong_t size_t ;
  3130. #503
  3131. typedef long ssize_t ;
  3132. #511
  3133. typedef long time_t ;
  3134.  
  3135.  
  3136.  
  3137.  
  3138. typedef long clock_t ;
  3139.  
  3140.  
  3141.  
  3142.  
  3143. typedef int clockid_t ;
  3144.  
  3145.  
  3146.  
  3147.  
  3148. typedef int timer_t ;
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154. typedef unsigned char unchar ;
  3155. typedef unsigned short ushort ;
  3156. typedef unsigned int uint ;
  3157. typedef unsigned long ulong ;
  3158. #594
  3159. typedef unsigned char u_char ;
  3160. typedef unsigned short u_short ;
  3161. typedef unsigned int u_int ;
  3162. typedef unsigned long u_long ;
  3163. typedef struct _quad { int val [ 2 ] ; } quad_t ;
  3164. typedef quad_t quad ;
  3165. #1 "/usr/include/sys/select.h"
  3166. #15
  3167. #pragma ident "@(#)select.h 1.19    04/01/28 SMI"
  3168. #1 "/usr/include/sys/time_impl.h"
  3169. #19
  3170. #pragma ident "@(#)time_impl.h  1.11    05/05/19 SMI"
  3171. #24
  3172. extern "C" {
  3173. #31
  3174. typedef long time_t ;
  3175. #38
  3176. typedef struct timespec {
  3177. time_t tv_sec ;
  3178. long tv_nsec ;
  3179. } timespec_t ;
  3180. #62
  3181. typedef struct timespec timestruc_t ;
  3182. #76
  3183. typedef struct itimerspec {
  3184. struct timespec it_interval ;
  3185. struct timespec it_value ;
  3186. } itimerspec_t ;
  3187. #118
  3188. }
  3189. #1 "/usr/include/sys/time.h"
  3190. #21
  3191. #pragma ident "@(#)time.h   2.78    11/10/14 SMI"
  3192. #31
  3193. extern "C" {
  3194. #40
  3195. typedef long time_t ;
  3196. #48
  3197. struct timeval {
  3198. time_t tv_sec ;
  3199. suseconds_t tv_usec ;
  3200. } ;
  3201. #80
  3202. struct timezone {
  3203. int tz_minuteswest ;
  3204. int tz_dsttime ;
  3205. } ;
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211. }
  3212. #1 "/usr/include/sys/types.h"
  3213. #102 "/usr/include/sys/time.h"
  3214. extern "C" {
  3215. #149
  3216. struct itimerval {
  3217. struct timeval it_interval ;
  3218. struct timeval it_value ;
  3219. } ;
  3220. #196
  3221. typedef longlong_t hrtime_t ;
  3222. #322
  3223. int adjtime ( struct timeval * , struct timeval * ) ;
  3224. #331
  3225. int futimesat ( int , const char * , const struct timeval * ) ;
  3226. #342
  3227. int getitimer ( int , struct itimerval * ) ;
  3228. int utimes ( const char * , const struct timeval * ) ;
  3229.  
  3230. int setitimer ( int , const struct itimerval * ,
  3231. struct itimerval * ) ;
  3232. #380
  3233. int settimeofday ( struct timeval * , void * ) ;
  3234.  
  3235. hrtime_t gethrtime ( void ) ;
  3236. hrtime_t gethrvtime ( void ) ;
  3237. #399
  3238. int gettimeofday ( struct timeval * , void * ) ;
  3239. #1 "/usr/include/time.h"
  3240. #16
  3241. #pragma ident "@(#)time.h   1.45    08/01/09 SMI"
  3242. #1 "/usr/include/iso/time_iso.h"
  3243. #28
  3244. #pragma ident "@(#)time_iso.h   1.4 04/09/07 SMI"
  3245. #33
  3246. extern "C" {
  3247.  
  3248.  
  3249.  
  3250. namespace std {
  3251. #51
  3252. typedef unsigned long size_t ;
  3253. #59
  3254. typedef long clock_t ;
  3255.  
  3256.  
  3257.  
  3258.  
  3259. typedef long time_t ;
  3260.  
  3261.  
  3262.  
  3263.  
  3264. struct tm {
  3265. int tm_sec ;
  3266. int tm_min ;
  3267. int tm_hour ;
  3268. int tm_mday ;
  3269. int tm_mon ;
  3270. int tm_year ;
  3271. int tm_wday ;
  3272. int tm_yday ;
  3273. int tm_isdst ;
  3274. } ;
  3275.  
  3276.  
  3277.  
  3278.  
  3279. extern char * asctime ( const struct tm * ) ;
  3280. extern clock_t clock ( void ) ;
  3281. extern char * ctime ( const time_t * ) ;
  3282. extern double difftime ( time_t , time_t ) ;
  3283. extern struct tm * gmtime ( const time_t * ) ;
  3284. extern struct tm * localtime ( const time_t * ) ;
  3285. extern time_t mktime ( struct tm * ) ;
  3286. extern time_t time ( time_t * ) ;
  3287. extern size_t strftime ( char * , size_t , const char * ,
  3288. const struct tm * ) ;
  3289. #110
  3290. }
  3291.  
  3292.  
  3293.  
  3294. }
  3295. #1 "/usr/include/sys/types.h"
  3296. #31 "/usr/include/time.h"
  3297. using std :: size_t ;
  3298. using std :: clock_t ;
  3299. using std :: time_t ;
  3300. using std :: tm ;
  3301. using std :: asctime ;
  3302. using std :: clock ;
  3303. using std :: ctime ;
  3304. using std :: difftime ;
  3305. using std :: gmtime ;
  3306. using std :: localtime ;
  3307. using std :: mktime ;
  3308. using std :: time ;
  3309. using std :: strftime ;
  3310.  
  3311.  
  3312.  
  3313. extern "C" {
  3314. #65
  3315. extern struct tm * gmtime_r ( const time_t * ,
  3316. struct tm * ) ;
  3317. extern struct tm * localtime_r ( const time_t * ,
  3318. struct tm * ) ;
  3319. #83
  3320. extern char * strptime ( const char * , const char * ,
  3321. struct tm * ) ;
  3322. #103
  3323. union sigval {
  3324. int sival_int ;
  3325. void * sival_ptr ;
  3326. } ;
  3327.  
  3328.  
  3329.  
  3330.  
  3331. struct sigevent {
  3332. int sigev_notify ;
  3333. int sigev_signo ;
  3334. union sigval sigev_value ;
  3335. void ( * sigev_notify_function ) ( union sigval ) ;
  3336. pthread_attr_t * sigev_notify_attributes ;
  3337. int __sigev_pad2 ;
  3338. } ;
  3339.  
  3340.  
  3341. extern int clock_getres ( clockid_t , struct timespec * ) ;
  3342. extern int clock_gettime ( clockid_t , struct timespec * ) ;
  3343. extern int clock_settime ( clockid_t , const struct timespec * ) ;
  3344. extern int timer_create ( clockid_t , struct sigevent * ,
  3345. timer_t * ) ;
  3346. extern int timer_delete ( timer_t ) ;
  3347. extern int timer_getoverrun ( timer_t ) ;
  3348. extern int timer_gettime ( timer_t , struct itimerspec * ) ;
  3349. extern int timer_settime ( timer_t , int , const struct itimerspec * ,
  3350. struct itimerspec * ) ;
  3351.  
  3352. extern int nanosleep ( const struct timespec * , struct timespec * ) ;
  3353. extern int clock_nanosleep ( clockid_t , int ,
  3354. const struct timespec * , struct timespec * ) ;
  3355. #141
  3356. extern void tzset ( void ) ;
  3357. extern char * tzname [ 2 ] ;
  3358.  
  3359.  
  3360.  
  3361.  
  3362. extern long _sysconf ( int ) ;
  3363. #155
  3364. extern long timezone ;
  3365. extern int daylight ;
  3366. #163
  3367. extern int cftime ( char * , char * , const time_t * ) ;
  3368. extern int ascftime ( char * , const char * , const struct tm * ) ;
  3369. extern long altzone ;
  3370.  
  3371.  
  3372.  
  3373.  
  3374. extern struct tm * getdate ( const char * ) ;
  3375.  
  3376.  
  3377.  
  3378. extern int * _getdate_err_addr ( void ) ;
  3379. #265
  3380. #pragma redefine_extname ctime_r __posix_ctime_r
  3381. #pragma redefine_extname asctime_r __posix_asctime_r
  3382. extern char * asctime_r ( const struct tm * , char * ) ;
  3383. extern char * ctime_r ( const time_t * , char * ) ;
  3384. #355
  3385. }
  3386. #1 "/usr/include/sys/select.h"
  3387. #437 "/usr/include/sys/time.h"
  3388. }
  3389. #27 "/usr/include/sys/select.h"
  3390. extern "C" {
  3391. #44
  3392. typedef struct {
  3393. unsigned int __sigbits [ 4 ] ;
  3394. } sigset_t ;
  3395. #88
  3396. typedef long fd_mask ;
  3397.  
  3398. typedef long fds_mask ;
  3399. #116
  3400. typedef struct fd_set {
  3401.  
  3402.  
  3403.  
  3404. long fds_bits [ ( ( ( 65536 ) + ( ( ( sizeof ( fds_mask ) * 8 ) ) - 1 ) ) / ( ( sizeof ( fds_mask ) * 8 ) ) ) ] ;
  3405. } fd_set ;
  3406. #140
  3407. extern int select ( int , fd_set * , fd_set * ,
  3408. fd_set * , struct timeval * ) ;
  3409.  
  3410.  
  3411. extern int pselect ( int , fd_set * , fd_set * ,
  3412. fd_set * , const struct timespec * ,
  3413. const sigset_t * ) ;
  3414. #158
  3415. }
  3416. #631 "/usr/include/sys/types.h"
  3417. typedef struct klgrpset {
  3418. ulong_t klgb [ 3 ] ;
  3419. } klgrpset_t ;
  3420.  
  3421.  
  3422. }
  3423. #1 "/usr/include/sys/unistd.h"
  3424. #23
  3425. #pragma ident "@(#)unistd.h 1.46    12/01/17 SMI"
  3426. #28
  3427. extern "C" {
  3428. #383
  3429. }
  3430. #24 "/usr/include/unistd.h"
  3431. extern "C" {
  3432. #207
  3433. #pragma redefine_extname ftruncate64 ftruncate
  3434. #pragma redefine_extname lseek64 lseek
  3435. #pragma redefine_extname pread64 pread
  3436. #pragma redefine_extname pwrite64 pwrite
  3437. #pragma redefine_extname truncate64 truncate
  3438. #pragma redefine_extname lockf64 lockf
  3439. #pragma redefine_extname tell64 tell
  3440. #227
  3441. extern int access ( const char * , int ) ;
  3442.  
  3443. extern int acct ( const char * ) ;
  3444.  
  3445. extern unsigned alarm ( unsigned ) ;
  3446.  
  3447.  
  3448.  
  3449. extern int brk ( void * ) ;
  3450.  
  3451. extern int chdir ( const char * ) ;
  3452. extern int chown ( const char * , uid_t , gid_t ) ;
  3453.  
  3454.  
  3455.  
  3456. extern int chroot ( const char * ) ;
  3457.  
  3458. extern int close ( int ) ;
  3459.  
  3460. extern size_t confstr ( int , char * , size_t ) ;
  3461. extern char * crypt ( const char * , const char * ) ;
  3462.  
  3463.  
  3464.  
  3465. extern char * ctermid ( char * ) ;
  3466.  
  3467.  
  3468. extern char * ctermid_r ( char * ) ;
  3469.  
  3470.  
  3471.  
  3472. extern char * cuserid ( char * ) ;
  3473.  
  3474. extern int dup ( int ) ;
  3475. extern int dup2 ( int , int ) ;
  3476.  
  3477. extern void encrypt ( char * , int ) ;
  3478.  
  3479.  
  3480. extern void endusershell ( void ) ;
  3481.  
  3482. extern int execl ( const char * , const char * , ... ) ;
  3483. extern int execle ( const char * , const char * , ... ) ;
  3484. extern int execlp ( const char * , const char * , ... ) ;
  3485. extern int execv ( const char * , char * const * ) ;
  3486. extern int execve ( const char * , char * const * , char * const * ) ;
  3487. extern int execvp ( const char * , char * const * ) ;
  3488. extern void _exit ( int )
  3489. ;
  3490. #282
  3491. extern int fattach ( int , const char * ) ;
  3492.  
  3493.  
  3494. extern int fchdir ( int ) ;
  3495. extern int fchown ( int , uid_t , gid_t ) ;
  3496.  
  3497.  
  3498. extern int fchownat ( int , const char * , uid_t , gid_t , int ) ;
  3499.  
  3500.  
  3501.  
  3502. extern int fchroot ( int ) ;
  3503.  
  3504.  
  3505.  
  3506. extern int fdatasync ( int ) ;
  3507. #305
  3508. extern int fdetach ( const char * ) ;
  3509.  
  3510. extern pid_t fork ( void ) ;
  3511.  
  3512. extern pid_t fork1 ( void ) ;
  3513. extern pid_t forkall ( void ) ;
  3514.  
  3515. extern long fpathconf ( int , int ) ;
  3516.  
  3517.  
  3518. extern int fsync ( int ) ;
  3519.  
  3520.  
  3521.  
  3522.  
  3523. extern int ftruncate ( int , off_t ) ;
  3524.  
  3525. extern char * getcwd ( char * , size_t ) ;
  3526.  
  3527.  
  3528. extern int getdtablesize ( void ) ;
  3529.  
  3530. extern gid_t getegid ( void ) ;
  3531. extern uid_t geteuid ( void ) ;
  3532. extern gid_t getgid ( void ) ;
  3533. extern int getgroups ( int , gid_t * ) ;
  3534.  
  3535. extern long gethostid ( void ) ;
  3536.  
  3537.  
  3538. extern int gethostname ( char * , size_t ) ;
  3539.  
  3540.  
  3541.  
  3542. extern char * getlogin ( void ) ;
  3543.  
  3544. extern int getopt ( int , char * const * , const char * ) ;
  3545. extern char * optarg ;
  3546. extern int opterr , optind , optopt ;
  3547.  
  3548.  
  3549. extern char * getpass ( const char * ) ;
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555. extern int getpagesize ( void ) ;
  3556.  
  3557. extern pid_t getpgid ( pid_t ) ;
  3558.  
  3559. extern pid_t getpid ( void ) ;
  3560. extern pid_t getppid ( void ) ;
  3561. extern pid_t getpgrp ( void ) ;
  3562.  
  3563.  
  3564. char * gettxt ( const char * , const char * ) ;
  3565.  
  3566.  
  3567. extern pid_t getsid ( pid_t ) ;
  3568.  
  3569. extern uid_t getuid ( void ) ;
  3570.  
  3571. extern char * getusershell ( void ) ;
  3572.  
  3573.  
  3574. extern char * getwd ( char * ) ;
  3575. #379
  3576. extern int ioctl ( int , int , ... ) ;
  3577. extern int isaexec ( const char * , char * const * , char * const * ) ;
  3578. extern int issetugid ( void ) ;
  3579.  
  3580. extern int isatty ( int ) ;
  3581.  
  3582. extern int lchown ( const char * , uid_t , gid_t ) ;
  3583.  
  3584. extern int link ( const char * , const char * ) ;
  3585.  
  3586. extern offset_t llseek ( int , offset_t , int ) ;
  3587.  
  3588.  
  3589.  
  3590.  
  3591. extern int lockf ( int , int , off_t ) ;
  3592.  
  3593. extern off_t lseek ( int , off_t , int ) ;
  3594.  
  3595.  
  3596. extern int nice ( int ) ;
  3597.  
  3598.  
  3599. extern int mincore ( caddr_t , size_t , char * ) ;
  3600.  
  3601. extern long pathconf ( const char * , int ) ;
  3602. extern int pause ( void ) ;
  3603. extern int pipe ( int * ) ;
  3604.  
  3605.  
  3606.  
  3607. extern ssize_t pread ( int , void * , size_t , off_t ) ;
  3608.  
  3609.  
  3610. extern void profil ( unsigned short * , size_t , unsigned long , unsigned int ) ;
  3611. #425
  3612. extern int pthread_atfork ( void ( * ) ( void ) , void ( * ) ( void ) , void ( * ) ( void ) ) ;
  3613. #434
  3614. extern ssize_t pwrite ( int , const void * , size_t , off_t ) ;
  3615.  
  3616.  
  3617.  
  3618. extern int rcmd_af ( char * * , unsigned short , const char * , const char * ,
  3619. const char * , int * , int ) ;
  3620.  
  3621. extern ssize_t read ( int , void * , size_t ) ;
  3622.  
  3623.  
  3624. extern ssize_t readlink ( const char * , char * ,
  3625. size_t ) ;
  3626.  
  3627.  
  3628.  
  3629. extern int rename ( const char * , const char * ) ;
  3630.  
  3631.  
  3632.  
  3633. extern int renameat ( int , const char * , int , const char * ) ;
  3634.  
  3635.  
  3636. extern int resolvepath ( const char * , char * , size_t ) ;
  3637.  
  3638. extern int rexec_af ( char * * , unsigned short , const char * , const char * ,
  3639. const char * , int * , int ) ;
  3640.  
  3641. extern int rmdir ( const char * ) ;
  3642.  
  3643.  
  3644. extern int rresvport_af ( int * , int ) ;
  3645.  
  3646.  
  3647.  
  3648.  
  3649. extern void * sbrk ( intptr_t ) ;
  3650.  
  3651.  
  3652. extern int setegid ( gid_t ) ;
  3653. extern int seteuid ( uid_t ) ;
  3654.  
  3655. extern int setgid ( gid_t ) ;
  3656.  
  3657. extern int setgroups ( int , const gid_t * ) ;
  3658.  
  3659. extern int setpgid ( pid_t , pid_t ) ;
  3660.  
  3661. extern pid_t setpgrp ( void ) ;
  3662. extern int setregid ( gid_t , gid_t ) ;
  3663. extern int setreuid ( uid_t , uid_t ) ;
  3664.  
  3665. extern pid_t setsid ( void ) ;
  3666. extern int setuid ( uid_t ) ;
  3667.  
  3668. extern void setusershell ( void ) ;
  3669.  
  3670. extern unsigned sleep ( unsigned ) ;
  3671.  
  3672. extern int stime ( const time_t * ) ;
  3673.  
  3674.  
  3675.  
  3676. extern void swab ( const void * , void * , ssize_t ) ;
  3677.  
  3678.  
  3679. extern int symlink ( const char * , const char * ) ;
  3680. extern void sync ( void ) ;
  3681.  
  3682.  
  3683.  
  3684. #pragma redefine_extname sysconf __sysconf_xpg5
  3685.  
  3686.  
  3687.  
  3688.  
  3689. extern long sysconf ( int ) ;
  3690. extern pid_t tcgetpgrp ( int ) ;
  3691. extern int tcsetpgrp ( int , pid_t ) ;
  3692.  
  3693.  
  3694.  
  3695. extern off_t tell ( int ) ;
  3696.  
  3697.  
  3698.  
  3699.  
  3700. extern int truncate ( const char * , off_t ) ;
  3701.  
  3702. extern char * ttyname ( int ) ;
  3703.  
  3704. extern useconds_t ualarm ( useconds_t , useconds_t ) ;
  3705.  
  3706. extern int unlink ( const char * ) ;
  3707.  
  3708.  
  3709. extern int unlinkat ( int , const char * , int ) ;
  3710.  
  3711.  
  3712. extern int usleep ( useconds_t ) ;
  3713.  
  3714.  
  3715. extern pid_t vfork ( void ) ;
  3716.  
  3717.  
  3718. extern void vhangup ( void ) ;
  3719.  
  3720. extern ssize_t write ( int , const void * , size_t ) ;
  3721.  
  3722. extern void yield ( void ) ;
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728. extern int ftruncate64 ( int , off64_t ) ;
  3729. extern off64_t lseek64 ( int , off64_t , int ) ;
  3730. extern ssize_t pread64 ( int , void * , size_t , off64_t ) ;
  3731. extern ssize_t pwrite64 ( int , const void * , size_t , off64_t ) ;
  3732. extern off64_t tell64 ( int ) ;
  3733. extern int truncate64 ( const char * , off64_t ) ;
  3734. extern int lockf64 ( int , int , off64_t ) ;
  3735. #911
  3736. #pragma redefine_extname getlogin_r __posix_getlogin_r
  3737. #pragma redefine_extname ttyname_r __posix_ttyname_r
  3738. extern int getlogin_r ( char * , int ) ;
  3739. extern int ttyname_r ( int , char * , size_t ) ;
  3740. #999
  3741. }
  3742. #1 "./boost/config/select_platform_config.hpp"
  3743. #1 "./boost/config/platform/solaris.hpp"
  3744. #1 "./boost/config/posix_features.hpp"
  3745. #1 "./boost/config/suffix.hpp"
  3746. #482
  3747. namespace boost {
  3748.  
  3749.  
  3750.  
  3751.  
  3752. typedef long long long_long_type ;
  3753. typedef unsigned long long ulong_long_type ;
  3754.  
  3755. }
  3756. #1 "./boost/regex/config/cwchar.hpp"
  3757. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cwchar"
  3758. #39
  3759. #pragma GCC system_header
  3760. #1 "/usr/include/wchar.h"
  3761. #9
  3762. #pragma ident "@(#)wchar.h  1.37    03/12/04 SMI"
  3763. #1 "/usr/include/iso/wchar_iso.h"
  3764. #21
  3765. #pragma ident "@(#)wchar_iso.h  1.8 04/09/28 SMI"
  3766. #1 "/usr/include/stdio_tag.h"
  3767. #9
  3768. #pragma ident "@(#)stdio_tag.h  1.4 04/09/28 SMI"
  3769.  
  3770.  
  3771. extern "C" {
  3772. #21
  3773. typedef struct __FILE __FILE ;
  3774.  
  3775.  
  3776.  
  3777. }
  3778. #1 "/usr/include/wchar_impl.h"
  3779. #9
  3780. #pragma ident "@(#)wchar_impl.h 1.3 99/07/26 SMI"
  3781. #14
  3782. extern "C" {
  3783.  
  3784.  
  3785.  
  3786.  
  3787. typedef struct __mbstate_t {
  3788.  
  3789. long __filler [ 4 ] ;
  3790.  
  3791.  
  3792.  
  3793. } __mbstate_t ;
  3794.  
  3795.  
  3796.  
  3797. }
  3798. #1 "/usr/include/stdio.h"
  3799. #19
  3800. #pragma ident "@(#)stdio.h  1.85    11/01/07 SMI"
  3801. #24
  3802. extern "C" {
  3803. #49
  3804. #pragma redefine_extname fopen64 fopen
  3805. #pragma redefine_extname freopen64 freopen
  3806. #pragma redefine_extname tmpfile64 tmpfile
  3807. #pragma redefine_extname fgetpos64 fgetpos
  3808. #pragma redefine_extname fsetpos64 fsetpos
  3809.  
  3810. #pragma redefine_extname fseeko64 fseeko
  3811. #pragma redefine_extname ftello64 ftello
  3812. #63
  3813. }
  3814. #1 "/usr/include/iso/stdio_iso.h"
  3815. #32
  3816. #pragma ident "@(#)stdio_iso.h  1.8 05/08/16 SMI"
  3817. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/sys/va_list.h"
  3818. #1 "/usr/include/sys/va_list.h"
  3819. #16
  3820. #pragma ident "@(#)va_list.h    1.15    04/11/19 SMI"
  3821. #54
  3822. extern "C" {
  3823. #79
  3824. typedef struct __va_list_element {
  3825. unsigned int __va_gp_offset ;
  3826. unsigned int __va_fp_offset ;
  3827. void * __va_overflow_arg_area ;
  3828. void * __va_reg_sve_area ;
  3829. } __unused_va_list [ 1 ] ;
  3830. #114
  3831. }
  3832. #20 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/sys/va_list.h"
  3833. typedef __builtin_va_list __va_list ;
  3834. #1 "/usr/include/stdio_impl.h"
  3835. #9
  3836. #pragma ident "@(#)stdio_impl.h 1.15    07/03/05 SMI"
  3837. #14
  3838. extern "C" {
  3839. #21
  3840. struct __FILE {
  3841. long __pad [ 16 ] ;
  3842. } ;
  3843. #53
  3844. }
  3845. #48 "/usr/include/iso/stdio_iso.h"
  3846. extern "C" {
  3847. #69
  3848. namespace std {
  3849.  
  3850.  
  3851.  
  3852.  
  3853. typedef __FILE FILE ;
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859. typedef unsigned long size_t ;
  3860. #87
  3861. typedef long fpos_t ;
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867. }
  3868. #146
  3869. extern __FILE __iob [ 20 ] ;
  3870. #158
  3871. namespace std {
  3872. #189
  3873. extern int remove ( const char * ) ;
  3874. extern int rename ( const char * , const char * ) ;
  3875. extern FILE * tmpfile ( void ) ;
  3876. extern char * tmpnam ( char * ) ;
  3877. extern int fclose ( FILE * ) ;
  3878. extern int fflush ( FILE * ) ;
  3879. extern FILE * fopen ( const char * , const char * ) ;
  3880. extern FILE * freopen ( const char * ,
  3881. const char * , FILE * ) ;
  3882. extern void setbuf ( FILE * , char * ) ;
  3883. extern int setvbuf ( FILE * , char * , int ,
  3884. size_t ) ;
  3885.  
  3886. extern int fprintf ( FILE * , const char * , ... ) ;
  3887.  
  3888. extern int fscanf ( FILE * , const char * , ... ) ;
  3889.  
  3890. extern int printf ( const char * , ... ) ;
  3891.  
  3892. extern int scanf ( const char * , ... ) ;
  3893.  
  3894. extern int sprintf ( char * , const char * , ... ) ;
  3895.  
  3896. extern int sscanf ( const char * ,
  3897. const char * , ... ) ;
  3898. extern int vfprintf ( FILE * , const char * ,
  3899. __va_list ) ;
  3900. extern int vprintf ( const char * , __va_list ) ;
  3901. extern int vsprintf ( char * , const char * ,
  3902. __va_list ) ;
  3903. extern int fgetc ( FILE * ) ;
  3904. extern char * fgets ( char * , int , FILE * ) ;
  3905. extern int fputc ( int , FILE * ) ;
  3906. extern int fputs ( const char * , FILE * ) ;
  3907.  
  3908.  
  3909. extern int getc ( FILE * ) ;
  3910. extern int putc ( int , FILE * ) ;
  3911.  
  3912.  
  3913.  
  3914. extern int getchar ( void ) ;
  3915. extern int putchar ( int ) ;
  3916.  
  3917. extern char * gets ( char * ) ;
  3918. extern int puts ( const char * ) ;
  3919. extern int ungetc ( int , FILE * ) ;
  3920. extern size_t fread ( void * , size_t , size_t ,
  3921. FILE * ) ;
  3922. extern size_t fwrite ( const void * , size_t , size_t ,
  3923. FILE * ) ;
  3924.  
  3925. extern int fgetpos ( FILE * , fpos_t * ) ;
  3926. extern int fsetpos ( FILE * , const fpos_t * ) ;
  3927.  
  3928. extern int fseek ( FILE * , long , int ) ;
  3929. extern long ftell ( FILE * ) ;
  3930. extern void rewind ( FILE * ) ;
  3931.  
  3932.  
  3933. extern void clearerr ( FILE * ) ;
  3934. extern int feof ( FILE * ) ;
  3935. extern int ferror ( FILE * ) ;
  3936.  
  3937. extern void perror ( const char * ) ;
  3938. #312
  3939. }
  3940. #372
  3941. }
  3942. #81 "/usr/include/stdio.h"
  3943. using std :: FILE ;
  3944. using std :: size_t ;
  3945. using std :: fpos_t ;
  3946. using std :: remove ;
  3947. using std :: rename ;
  3948. using std :: tmpfile ;
  3949. using std :: tmpnam ;
  3950. using std :: fclose ;
  3951. using std :: fflush ;
  3952. using std :: fopen ;
  3953. using std :: freopen ;
  3954. using std :: setbuf ;
  3955. using std :: setvbuf ;
  3956. using std :: fprintf ;
  3957. using std :: fscanf ;
  3958. using std :: printf ;
  3959. using std :: scanf ;
  3960. using std :: sprintf ;
  3961. using std :: sscanf ;
  3962. using std :: vfprintf ;
  3963. using std :: vprintf ;
  3964. using std :: vsprintf ;
  3965. using std :: fgetc ;
  3966. using std :: fgets ;
  3967. using std :: fputc ;
  3968. using std :: fputs ;
  3969. using std :: getc ;
  3970. using std :: getchar ;
  3971. using std :: gets ;
  3972. using std :: putc ;
  3973. using std :: putchar ;
  3974. using std :: puts ;
  3975. using std :: ungetc ;
  3976. using std :: fread ;
  3977. using std :: fwrite ;
  3978. using std :: fgetpos ;
  3979. using std :: fseek ;
  3980. using std :: fsetpos ;
  3981. using std :: ftell ;
  3982. using std :: rewind ;
  3983. using std :: clearerr ;
  3984. using std :: feof ;
  3985. using std :: ferror ;
  3986. using std :: perror ;
  3987. #1 "/usr/include/iso/stdio_c99.h"
  3988. #20
  3989. #pragma ident "@(#)stdio_c99.h  1.2 04/03/29 SMI"
  3990.  
  3991.  
  3992. extern "C" {
  3993. #54
  3994. extern int vfscanf ( FILE * , const char * , __va_list ) ;
  3995. extern int vscanf ( const char * , __va_list ) ;
  3996. extern int vsscanf ( const char * , const char * ,
  3997. __va_list ) ;
  3998. #68
  3999. extern int snprintf ( char * , size_t , const char * ,
  4000. ... ) ;
  4001. extern int vsnprintf ( char * , size_t , const char * ,
  4002. __va_list ) ;
  4003. #80
  4004. }
  4005. #138 "/usr/include/stdio.h"
  4006. extern "C" {
  4007. #161
  4008. typedef fpos_t fpos64_t ;
  4009. #174
  4010. typedef __va_list va_list ;
  4011. #197
  4012. extern unsigned char _sibuf [ ] , _sobuf [ ] ;
  4013. #253
  4014. extern char * tmpnam_r ( char * ) ;
  4015.  
  4016.  
  4017.  
  4018.  
  4019. extern void setbuffer ( FILE * , char * , size_t ) ;
  4020. extern int setlinebuf ( FILE * ) ;
  4021.  
  4022. extern int asprintf ( char * * , const char * , ... ) ;
  4023.  
  4024. extern int vasprintf ( char * * , const char * , __va_list ) ;
  4025. #272
  4026. extern FILE * fdopen ( int , const char * ) ;
  4027. extern char * ctermid ( char * ) ;
  4028. extern int fileno ( FILE * ) ;
  4029. #283
  4030. extern void flockfile ( FILE * ) ;
  4031. extern int ftrylockfile ( FILE * ) ;
  4032. extern void funlockfile ( FILE * ) ;
  4033. extern int getc_unlocked ( FILE * ) ;
  4034. extern int getchar_unlocked ( void ) ;
  4035. extern int putc_unlocked ( int , FILE * ) ;
  4036. extern int putchar_unlocked ( int ) ;
  4037. #298
  4038. extern FILE * popen ( const char * , const char * ) ;
  4039. extern char * tempnam ( const char * , const char * ) ;
  4040. extern int pclose ( FILE * ) ;
  4041. #307
  4042. extern char * cuserid ( char * ) ;
  4043. extern int getopt ( int , char * const * , const char * ) ;
  4044. extern char * optarg ;
  4045. extern int optind , opterr , optopt ;
  4046. extern int getw ( FILE * ) ;
  4047. extern int putw ( int , FILE * ) ;
  4048. #321
  4049. extern int fseeko ( FILE * , off_t , int ) ;
  4050. extern off_t ftello ( FILE * ) ;
  4051. #331
  4052. extern FILE * fopen64 ( const char * , const char * ) ;
  4053. extern FILE * freopen64 ( const char * , const char * , FILE * ) ;
  4054. extern FILE * tmpfile64 ( void ) ;
  4055. extern int fgetpos64 ( FILE * , fpos64_t * ) ;
  4056. extern int fsetpos64 ( FILE * , const fpos64_t * ) ;
  4057. extern int fseeko64 ( FILE * , off64_t , int ) ;
  4058. extern off64_t ftello64 ( FILE * ) ;
  4059. #445
  4060. }
  4061. #1 "/usr/include/ctype.h"
  4062. #16
  4063. #pragma ident "@(#)ctype.h  1.35    04/09/28 SMI"
  4064. #1 "/usr/include/iso/ctype_iso.h"
  4065. #28
  4066. #pragma ident "@(#)ctype_iso.h  1.3 04/09/28 SMI"
  4067. #33
  4068. extern "C" {
  4069. #78
  4070. namespace std {
  4071.  
  4072.  
  4073. extern int tolower ( int ) ;
  4074. extern int toupper ( int ) ;
  4075.  
  4076.  
  4077. }
  4078.  
  4079.  
  4080. extern unsigned char __ctype [ ] ;
  4081. extern unsigned int * __ctype_mask ;
  4082. extern int * __trans_upper ;
  4083. extern int * __trans_lower ;
  4084.  
  4085.  
  4086.  
  4087.  
  4088. namespace std {
  4089.  
  4090.  
  4091.  
  4092. inline int isalpha ( int c ) { return ( __ctype_mask [ c ] & 0x00004000 ) ; }
  4093. inline int isupper ( int c ) { return ( __ctype_mask [ c ] & 0x00000001 ) ; }
  4094. inline int islower ( int c ) { return ( __ctype_mask [ c ] & 0x00000002 ) ; }
  4095. inline int isdigit ( int c ) { return ( __ctype_mask [ c ] & 0x00000004 ) ; }
  4096. inline int isxdigit ( int c ) { return ( __ctype_mask [ c ] & 0x00000080 ) ; }
  4097. inline int isalnum ( int c ) { return ( __ctype_mask [ c ] & ( 0x00004000 | 0x00000004 ) ) ; }
  4098. inline int isspace ( int c ) { return ( __ctype_mask [ c ] & 0x00000008 ) ; }
  4099. inline int ispunct ( int c ) { return ( __ctype_mask [ c ] & 0x00000010 ) ; }
  4100. inline int isprint ( int c ) { return ( __ctype_mask [ c ] & 0x00008000 ) ; }
  4101. inline int isgraph ( int c ) { return ( __ctype_mask [ c ] & 0x00002000 ) ; }
  4102. inline int iscntrl ( int c ) { return ( __ctype_mask [ c ] & 0x00000020 ) ; }
  4103. #126
  4104. }
  4105. #184
  4106. }
  4107. #1 "/usr/include/iso/ctype_c99.h"
  4108. #20
  4109. #pragma ident "@(#)ctype_c99.h  1.2 04/09/28 SMI"
  4110.  
  4111.  
  4112. extern "C" {
  4113. #38
  4114. extern int isblank ( int ) ;
  4115. #62
  4116. }
  4117. #26 "/usr/include/ctype.h"
  4118. using std :: isalnum ;
  4119. using std :: isalpha ;
  4120. using std :: iscntrl ;
  4121. using std :: isdigit ;
  4122. using std :: isgraph ;
  4123. using std :: islower ;
  4124. using std :: isprint ;
  4125. using std :: ispunct ;
  4126. using std :: isspace ;
  4127. using std :: isupper ;
  4128. using std :: isxdigit ;
  4129. using std :: tolower ;
  4130. using std :: toupper ;
  4131.  
  4132.  
  4133.  
  4134. extern "C" {
  4135. #51
  4136. extern int isascii ( int ) ;
  4137. extern int toascii ( int ) ;
  4138. extern int _tolower ( int ) ;
  4139. extern int _toupper ( int ) ;
  4140. #91
  4141. }
  4142. #42 "/usr/include/iso/wchar_iso.h"
  4143. extern "C" {
  4144.  
  4145.  
  4146.  
  4147. namespace std {
  4148. #76
  4149. typedef int wint_t ;
  4150. #85
  4151. typedef unsigned long size_t ;
  4152. #115
  4153. typedef __mbstate_t mbstate_t ;
  4154.  
  4155.  
  4156.  
  4157.  
  4158. typedef __FILE FILE ;
  4159. #153
  4160. #pragma redefine_extname fgetwc __fgetwc_xpg5
  4161. #pragma redefine_extname getwc __getwc_xpg5
  4162. #pragma redefine_extname getwchar __getwchar_xpg5
  4163. #pragma redefine_extname fputwc __fputwc_xpg5
  4164. #pragma redefine_extname putwc __putwc_xpg5
  4165. #pragma redefine_extname putwchar __putwchar_xpg5
  4166. #pragma redefine_extname fgetws __fgetws_xpg5
  4167. #pragma redefine_extname fputws __fputws_xpg5
  4168. #pragma redefine_extname ungetwc __ungetwc_xpg5
  4169. #200
  4170. extern wint_t fgetwc ( __FILE * ) ;
  4171. extern wchar_t * fgetws ( wchar_t * , int , __FILE * ) ;
  4172. extern wint_t fputwc ( wint_t , __FILE * ) ;
  4173. extern int fputws ( const wchar_t * , __FILE * ) ;
  4174. extern wint_t ungetwc ( wint_t , __FILE * ) ;
  4175. extern wint_t getwc ( __FILE * ) ;
  4176. extern wint_t getwchar ( void ) ;
  4177. extern wint_t putwc ( wint_t , __FILE * ) ;
  4178. extern wint_t putwchar ( wint_t ) ;
  4179. extern double wcstod ( const wchar_t * , wchar_t * * ) ;
  4180. extern long wcstol ( const wchar_t * , wchar_t * * ,
  4181. int ) ;
  4182. extern unsigned long wcstoul ( const wchar_t * ,
  4183. wchar_t * * , int ) ;
  4184. extern wchar_t * wcscat ( wchar_t * , const wchar_t * ) ;
  4185. extern int wcscmp ( const wchar_t * , const wchar_t * ) ;
  4186. extern int wcscoll ( const wchar_t * , const wchar_t * ) ;
  4187. extern wchar_t * wcscpy ( wchar_t * , const wchar_t * ) ;
  4188. extern size_t wcscspn ( const wchar_t * , const wchar_t * ) ;
  4189. extern size_t wcslen ( const wchar_t * ) ;
  4190. extern wchar_t * wcsncat ( wchar_t * , const wchar_t * ,
  4191. size_t ) ;
  4192. extern int wcsncmp ( const wchar_t * , const wchar_t * , size_t ) ;
  4193. extern wchar_t * wcsncpy ( wchar_t * , const wchar_t * ,
  4194. size_t ) ;
  4195. extern size_t wcsspn ( const wchar_t * , const wchar_t * ) ;
  4196. extern size_t wcsxfrm ( wchar_t * , const wchar_t * ,
  4197. size_t ) ;
  4198.  
  4199. extern const wchar_t * wcschr ( const wchar_t * , wchar_t ) ;
  4200. extern "C++" {
  4201. inline wchar_t * wcschr ( wchar_t * __ws , wchar_t __wc ) {
  4202. return ( wchar_t * ) wcschr ( ( const wchar_t * ) __ws , __wc ) ;
  4203. }
  4204. }
  4205. extern const wchar_t * wcspbrk ( const wchar_t * , const wchar_t * ) ;
  4206. extern "C++" {
  4207. inline wchar_t * wcspbrk ( wchar_t * __ws1 , const wchar_t * __ws2 ) {
  4208. return ( wchar_t * ) wcspbrk ( ( const wchar_t * ) __ws1 , __ws2 ) ;
  4209. }
  4210. }
  4211. extern const wchar_t * wcsrchr ( const wchar_t * , wchar_t ) ;
  4212. extern "C++" {
  4213. inline wchar_t * wcsrchr ( wchar_t * __ws , wchar_t __wc ) {
  4214. return ( wchar_t * ) wcsrchr ( ( const wchar_t * ) __ws , __wc ) ;
  4215. }
  4216. }
  4217. #259
  4218. #pragma redefine_extname wcstok __wcstok_xpg5
  4219. #pragma redefine_extname wcsftime __wcsftime_xpg5
  4220. extern wchar_t * wcstok ( wchar_t * , const wchar_t * ,
  4221. wchar_t * * ) ;
  4222. extern size_t wcsftime ( wchar_t * , size_t ,
  4223. const wchar_t * , const struct tm * ) ;
  4224. #278
  4225. extern wint_t btowc ( int ) ;
  4226. extern int fwprintf ( __FILE * , const wchar_t * ,
  4227. ... ) ;
  4228. extern int fwscanf ( __FILE * , const wchar_t * ,
  4229. ... ) ;
  4230. extern int fwide ( __FILE * , int ) ;
  4231. extern int mbsinit ( const mbstate_t * ) ;
  4232. extern size_t mbrlen ( const char * , size_t ,
  4233. mbstate_t * ) ;
  4234. extern size_t mbrtowc ( wchar_t * , const char * ,
  4235. size_t , mbstate_t * ) ;
  4236. extern size_t mbsrtowcs ( wchar_t * , const char * * ,
  4237. size_t , mbstate_t * ) ;
  4238. extern int swprintf ( wchar_t * , size_t ,
  4239. const wchar_t * , ... ) ;
  4240. extern int swscanf ( const wchar_t * ,
  4241. const wchar_t * , ... ) ;
  4242. extern int vfwprintf ( __FILE * , const wchar_t * ,
  4243. __va_list ) ;
  4244. extern int vwprintf ( const wchar_t * , __va_list ) ;
  4245. extern int vswprintf ( wchar_t * , size_t ,
  4246. const wchar_t * , __va_list ) ;
  4247. extern size_t wcrtomb ( char * , wchar_t ,
  4248. mbstate_t * ) ;
  4249. extern size_t wcsrtombs ( char * , const wchar_t * * ,
  4250. size_t , mbstate_t * ) ;
  4251. extern int wctob ( wint_t ) ;
  4252. extern int wmemcmp ( const wchar_t * , const wchar_t * , size_t ) ;
  4253. extern wchar_t * wmemcpy ( wchar_t * ,
  4254. const wchar_t * , size_t ) ;
  4255. extern wchar_t * wmemmove ( wchar_t * , const wchar_t * , size_t ) ;
  4256. extern wchar_t * wmemset ( wchar_t * , wchar_t , size_t ) ;
  4257. extern int wprintf ( const wchar_t * , ... ) ;
  4258. extern int wscanf ( const wchar_t * , ... ) ;
  4259.  
  4260. extern const wchar_t * wcsstr ( const wchar_t * , const wchar_t * ) ;
  4261. extern "C++" {
  4262. inline wchar_t * wcsstr ( wchar_t * __ws1 , const wchar_t * __ws2 ) {
  4263. return ( wchar_t * ) wcsstr ( ( const wchar_t * ) __ws1 , __ws2 ) ;
  4264. }
  4265. }
  4266. extern const wchar_t * wmemchr ( const wchar_t * , wchar_t , size_t ) ;
  4267. extern "C++" {
  4268. inline wchar_t * wmemchr ( wchar_t * __ws , wchar_t __wc , size_t __n ) {
  4269. return ( wchar_t * ) wmemchr ( ( const wchar_t * ) __ws , __wc , __n ) ;
  4270. }
  4271. }
  4272. #412
  4273. }
  4274.  
  4275.  
  4276.  
  4277. }
  4278. #1 "/usr/include/iso/wchar_c99.h"
  4279. #20
  4280. #pragma ident "@(#)wchar_c99.h  1.3 04/03/29 SMI"
  4281.  
  4282.  
  4283. extern "C" {
  4284. #45
  4285. extern int vfwscanf ( __FILE * , const wchar_t * ,
  4286. __va_list ) ;
  4287. extern int vswscanf ( const wchar_t * ,
  4288. const wchar_t * , __va_list ) ;
  4289. extern int vwscanf ( const wchar_t * , __va_list ) ;
  4290. extern float wcstof ( const wchar_t * ,
  4291. wchar_t * * ) ;
  4292.  
  4293. extern long double wcstold ( const wchar_t * ,
  4294. wchar_t * * ) ;
  4295. extern long long wcstoll ( const wchar_t * ,
  4296. wchar_t * * , int ) ;
  4297. extern unsigned long long wcstoull ( const wchar_t * ,
  4298. wchar_t * * , int ) ;
  4299. #78
  4300. }
  4301. #21 "/usr/include/wchar.h"
  4302. using std :: FILE ;
  4303. using std :: wint_t ;
  4304. using std :: clock_t ;
  4305. using std :: size_t ;
  4306. using std :: time_t ;
  4307. using std :: tm ;
  4308. using std :: mbstate_t ;
  4309. using std :: fgetwc ;
  4310. using std :: fgetws ;
  4311. using std :: fputwc ;
  4312. using std :: fputws ;
  4313. using std :: ungetwc ;
  4314. using std :: getwc ;
  4315. using std :: getwchar ;
  4316. using std :: putwc ;
  4317. using std :: putwchar ;
  4318. using std :: wcstod ;
  4319. using std :: wcstol ;
  4320. using std :: wcstoul ;
  4321. using std :: wcscat ;
  4322. using std :: wcschr ;
  4323. using std :: wcscmp ;
  4324. using std :: wcscoll ;
  4325. using std :: wcscpy ;
  4326. using std :: wcscspn ;
  4327. using std :: wcslen ;
  4328. using std :: wcsncat ;
  4329. using std :: wcsncmp ;
  4330. using std :: wcsncpy ;
  4331. using std :: wcspbrk ;
  4332. using std :: wcsrchr ;
  4333. using std :: wcsspn ;
  4334. using std :: wcsxfrm ;
  4335. using std :: wcstok ;
  4336. using std :: wcsftime ;
  4337.  
  4338.  
  4339. using std :: btowc ;
  4340. using std :: fwprintf ;
  4341. using std :: fwscanf ;
  4342. using std :: fwide ;
  4343. using std :: mbsinit ;
  4344. using std :: mbrlen ;
  4345. using std :: mbrtowc ;
  4346. using std :: mbsrtowcs ;
  4347. using std :: swprintf ;
  4348. using std :: swscanf ;
  4349. using std :: vfwprintf ;
  4350. using std :: vwprintf ;
  4351. using std :: vswprintf ;
  4352. using std :: wcrtomb ;
  4353. using std :: wcsrtombs ;
  4354. using std :: wcsstr ;
  4355. using std :: wctob ;
  4356. using std :: wmemchr ;
  4357. using std :: wmemcmp ;
  4358. using std :: wmemcpy ;
  4359. using std :: wmemmove ;
  4360. using std :: wmemset ;
  4361. using std :: wprintf ;
  4362. using std :: wscanf ;
  4363.  
  4364.  
  4365.  
  4366.  
  4367. extern "C" {
  4368.  
  4369.  
  4370.  
  4371.  
  4372.  
  4373. typedef int wctype_t ;
  4374. #108
  4375. extern int iswalpha ( wint_t ) ;
  4376. extern int iswupper ( wint_t ) ;
  4377. extern int iswlower ( wint_t ) ;
  4378. extern int iswdigit ( wint_t ) ;
  4379. extern int iswxdigit ( wint_t ) ;
  4380. extern int iswalnum ( wint_t ) ;
  4381. extern int iswspace ( wint_t ) ;
  4382. extern int iswpunct ( wint_t ) ;
  4383. extern int iswprint ( wint_t ) ;
  4384. extern int iswgraph ( wint_t ) ;
  4385. extern int iswcntrl ( wint_t ) ;
  4386. extern int iswctype ( wint_t , wctype_t ) ;
  4387. extern wint_t towlower ( wint_t ) ;
  4388. extern wint_t towupper ( wint_t ) ;
  4389. extern wchar_t * wcswcs ( const wchar_t * , const wchar_t * ) ;
  4390. extern int wcswidth ( const wchar_t * , size_t ) ;
  4391. extern int wcwidth ( const wchar_t ) ;
  4392. extern wctype_t wctype ( const char * ) ;
  4393. #154
  4394. }
  4395. #62 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cwchar"
  4396. namespace std
  4397. {
  4398. using :: mbstate_t ;
  4399. }
  4400. #135
  4401. namespace std
  4402. {
  4403.  
  4404.  
  4405. using :: wint_t ;
  4406.  
  4407. using :: btowc ;
  4408. using :: fgetwc ;
  4409. using :: fgetws ;
  4410. using :: fputwc ;
  4411. using :: fputws ;
  4412. using :: fwide ;
  4413. using :: fwprintf ;
  4414. using :: fwscanf ;
  4415. using :: getwc ;
  4416. using :: getwchar ;
  4417. using :: mbrlen ;
  4418. using :: mbrtowc ;
  4419. using :: mbsinit ;
  4420. using :: mbsrtowcs ;
  4421. using :: putwc ;
  4422. using :: putwchar ;
  4423.  
  4424. using :: swprintf ;
  4425.  
  4426. using :: swscanf ;
  4427. using :: ungetwc ;
  4428. using :: vfwprintf ;
  4429.  
  4430. using :: vfwscanf ;
  4431.  
  4432.  
  4433. using :: vswprintf ;
  4434.  
  4435.  
  4436. using :: vswscanf ;
  4437.  
  4438. using :: vwprintf ;
  4439.  
  4440. using :: vwscanf ;
  4441.  
  4442. using :: wcrtomb ;
  4443. using :: wcscat ;
  4444. using :: wcscmp ;
  4445. using :: wcscoll ;
  4446. using :: wcscpy ;
  4447. using :: wcscspn ;
  4448. using :: wcsftime ;
  4449. using :: wcslen ;
  4450. using :: wcsncat ;
  4451. using :: wcsncmp ;
  4452. using :: wcsncpy ;
  4453. using :: wcsrtombs ;
  4454. using :: wcsspn ;
  4455. using :: wcstod ;
  4456.  
  4457. using :: wcstof ;
  4458.  
  4459. using :: wcstok ;
  4460. using :: wcstol ;
  4461. using :: wcstoul ;
  4462. using :: wcsxfrm ;
  4463. using :: wctob ;
  4464. using :: wmemcmp ;
  4465. using :: wmemcpy ;
  4466. using :: wmemmove ;
  4467. using :: wmemset ;
  4468. using :: wprintf ;
  4469. using :: wscanf ;
  4470. using :: wcschr ;
  4471. using :: wcspbrk ;
  4472. using :: wcsrchr ;
  4473. using :: wcsstr ;
  4474. using :: wmemchr ;
  4475. #233
  4476. }
  4477. #241
  4478. namespace __gnu_cxx
  4479. {
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485. using :: wcstold ;
  4486. #257
  4487. using :: wcstoll ;
  4488. using :: wcstoull ;
  4489.  
  4490. }
  4491.  
  4492. namespace std
  4493. {
  4494. using :: __gnu_cxx :: wcstold ;
  4495. using :: __gnu_cxx :: wcstoll ;
  4496. using :: __gnu_cxx :: wcstoull ;
  4497. }
  4498. #277
  4499. namespace std
  4500. {
  4501.  
  4502. using std :: wcstof ;
  4503.  
  4504.  
  4505. using std :: vfwscanf ;
  4506.  
  4507.  
  4508. using std :: vswscanf ;
  4509.  
  4510.  
  4511. using std :: vwscanf ;
  4512.  
  4513.  
  4514.  
  4515. using std :: wcstold ;
  4516. using std :: wcstoll ;
  4517. using std :: wcstoull ;
  4518.  
  4519. }
  4520. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cwctype"
  4521. #39
  4522. #pragma GCC system_header
  4523. #1 "/usr/include/wctype.h"
  4524. #13
  4525. #pragma ident "@(#)wctype.h 1.19    03/12/04 SMI"
  4526. #1 "/usr/include/iso/wctype_iso.h"
  4527. #25
  4528. #pragma ident "@(#)wctype_iso.h 1.2 03/12/04 SMI"
  4529. #30
  4530. extern "C" {
  4531.  
  4532.  
  4533.  
  4534. namespace std {
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540. typedef int wint_t ;
  4541. #48
  4542. typedef int wctype_t ;
  4543.  
  4544.  
  4545. typedef unsigned int wctrans_t ;
  4546. #61
  4547. extern int iswalnum ( wint_t ) ;
  4548. extern int iswalpha ( wint_t ) ;
  4549. extern int iswcntrl ( wint_t ) ;
  4550. extern int iswdigit ( wint_t ) ;
  4551. extern int iswgraph ( wint_t ) ;
  4552. extern int iswlower ( wint_t ) ;
  4553. extern int iswprint ( wint_t ) ;
  4554. extern int iswpunct ( wint_t ) ;
  4555. extern int iswspace ( wint_t ) ;
  4556. extern int iswupper ( wint_t ) ;
  4557. extern int iswxdigit ( wint_t ) ;
  4558.  
  4559. extern wint_t towlower ( wint_t ) ;
  4560. extern wint_t towupper ( wint_t ) ;
  4561. extern wctrans_t wctrans ( const char * ) ;
  4562. extern wint_t towctrans ( wint_t , wctrans_t ) ;
  4563. extern int iswctype ( wint_t , wctype_t ) ;
  4564. extern wctype_t wctype ( const char * ) ;
  4565. #129
  4566. }
  4567.  
  4568.  
  4569.  
  4570. }
  4571. #27 "/usr/include/wctype.h"
  4572. using std :: wint_t ;
  4573. using std :: wctrans_t ;
  4574. using std :: iswalnum ;
  4575. using std :: iswalpha ;
  4576. using std :: iswcntrl ;
  4577. using std :: iswdigit ;
  4578. using std :: iswgraph ;
  4579. using std :: iswlower ;
  4580. using std :: iswprint ;
  4581. using std :: iswpunct ;
  4582. using std :: iswspace ;
  4583. using std :: iswupper ;
  4584. using std :: iswxdigit ;
  4585. using std :: towlower ;
  4586. using std :: towupper ;
  4587. using std :: wctrans ;
  4588. using std :: towctrans ;
  4589. using std :: iswctype ;
  4590. using std :: wctype ;
  4591. #1 "/usr/include/iso/wctype_c99.h"
  4592. #20
  4593. #pragma ident "@(#)wctype_c99.h 1.1 03/12/04 SMI"
  4594.  
  4595.  
  4596. extern "C" {
  4597. #48
  4598. extern int iswblank ( wint_t ) ;
  4599. #55
  4600. }
  4601. #56 "/usr/include/wctype.h"
  4602. extern "C" {
  4603. #67
  4604. struct _wctype {
  4605. wchar_t tmin ;
  4606. wchar_t tmax ;
  4607. unsigned char * index ;
  4608. unsigned int * type ;
  4609. wchar_t cmin ;
  4610. wchar_t cmax ;
  4611. wchar_t * code ;
  4612. } ;
  4613. #85
  4614. extern unsigned _iswctype ( wchar_t , int ) ;
  4615. extern wchar_t _trwctype ( wchar_t , int ) ;
  4616.  
  4617. extern int isphonogram ( wint_t ) ;
  4618. extern int isideogram ( wint_t ) ;
  4619. extern int isenglish ( wint_t ) ;
  4620. extern int isnumber ( wint_t ) ;
  4621. extern int isspecial ( wint_t ) ;
  4622. #113
  4623. }
  4624. #80 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cwctype"
  4625. namespace std
  4626. {
  4627. using :: wctrans_t ;
  4628. using :: wctype_t ;
  4629. using :: wint_t ;
  4630.  
  4631. using :: iswalnum ;
  4632. using :: iswalpha ;
  4633.  
  4634. using :: iswblank ;
  4635.  
  4636. using :: iswcntrl ;
  4637. using :: iswctype ;
  4638. using :: iswdigit ;
  4639. using :: iswgraph ;
  4640. using :: iswlower ;
  4641. using :: iswprint ;
  4642. using :: iswpunct ;
  4643. using :: iswspace ;
  4644. using :: iswupper ;
  4645. using :: iswxdigit ;
  4646. using :: towctrans ;
  4647. using :: towlower ;
  4648. using :: towupper ;
  4649. using :: wctrans ;
  4650. using :: wctype ;
  4651. }
  4652. #49 "./boost/regex/config/cwchar.hpp"
  4653. namespace std {
  4654.  
  4655.  
  4656. extern "C" {
  4657. #201
  4658. }
  4659.  
  4660.  
  4661. }
  4662. #390 "./boost/regex/config.hpp"
  4663. namespace boost { namespace re_detail {
  4664.  
  4665. void * get_mem_block ( ) ;
  4666. void put_mem_block ( void * ) ;
  4667.  
  4668. } }
  4669. #1 "./boost/regex/v4/regex.hpp"
  4670. #1 "./boost/regex/v4/regex_workaround.hpp"
  4671. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/new"
  4672. #37
  4673. #pragma GCC system_header
  4674. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/exception"
  4675. #33
  4676. #pragma GCC system_header
  4677.  
  4678. #pragma GCC visibility push ( default )
  4679. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/atomic_lockfree_defines.h"
  4680. #33
  4681. #pragma GCC system_header
  4682. #40 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/exception"
  4683. extern "C++" {
  4684.  
  4685. namespace std
  4686. {
  4687. #60
  4688. class exception
  4689. {
  4690. public :
  4691. exception ( ) noexcept { }
  4692. virtual ~ exception ( ) noexcept ;
  4693.  
  4694.  
  4695.  
  4696. virtual const char * what ( ) const noexcept ;
  4697. } ;
  4698.  
  4699.  
  4700.  
  4701. class bad_exception : public exception
  4702. {
  4703. public :
  4704. bad_exception ( ) noexcept { }
  4705.  
  4706.  
  4707.  
  4708. virtual ~ bad_exception ( ) noexcept ;
  4709.  
  4710.  
  4711. virtual const char * what ( ) const noexcept ;
  4712. } ;
  4713.  
  4714.  
  4715. typedef void ( * terminate_handler ) ( ) ;
  4716.  
  4717.  
  4718. typedef void ( * unexpected_handler ) ( ) ;
  4719.  
  4720.  
  4721. terminate_handler set_terminate ( terminate_handler ) noexcept ;
  4722.  
  4723.  
  4724.  
  4725. void terminate ( ) noexcept __attribute__ ( ( __noreturn__ ) ) ;
  4726.  
  4727.  
  4728. unexpected_handler set_unexpected ( unexpected_handler ) noexcept ;
  4729.  
  4730.  
  4731.  
  4732. void unexpected ( ) __attribute__ ( ( __noreturn__ ) ) ;
  4733. #117
  4734. bool uncaught_exception ( ) noexcept __attribute__ ( ( __pure__ ) ) ;
  4735.  
  4736.  
  4737. }
  4738.  
  4739. namespace __gnu_cxx
  4740. {
  4741. #142
  4742. void __verbose_terminate_handler ( ) ;
  4743.  
  4744.  
  4745. }
  4746.  
  4747. }
  4748.  
  4749. #pragma GCC visibility pop
  4750. #42 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/new"
  4751. #pragma GCC visibility push ( default )
  4752.  
  4753. extern "C++" {
  4754.  
  4755. namespace std
  4756. {
  4757. #54
  4758. class bad_alloc : public exception
  4759. {
  4760. public :
  4761. bad_alloc ( ) throw ( ) { }
  4762.  
  4763.  
  4764.  
  4765. virtual ~ bad_alloc ( ) throw ( ) ;
  4766.  
  4767.  
  4768. virtual const char * what ( ) const throw ( ) ;
  4769. } ;
  4770.  
  4771. struct nothrow_t { } ;
  4772.  
  4773. extern const nothrow_t nothrow ;
  4774.  
  4775.  
  4776.  
  4777. typedef void ( * new_handler ) ( ) ;
  4778.  
  4779.  
  4780.  
  4781. new_handler set_new_handler ( new_handler ) throw ( ) ;
  4782. }
  4783. #91
  4784. void * operator new ( std :: size_t )
  4785. __attribute__ ( ( __externally_visible__ ) ) ;
  4786. void * operator new [ ] ( std :: size_t )
  4787. __attribute__ ( ( __externally_visible__ ) ) ;
  4788. void operator delete ( void * ) noexcept
  4789. __attribute__ ( ( __externally_visible__ ) ) ;
  4790. void operator delete [ ] ( void * ) noexcept
  4791. __attribute__ ( ( __externally_visible__ ) ) ;
  4792. void * operator new ( std :: size_t , const std :: nothrow_t & ) noexcept
  4793. __attribute__ ( ( __externally_visible__ ) ) ;
  4794. void * operator new [ ] ( std :: size_t , const std :: nothrow_t & ) noexcept
  4795. __attribute__ ( ( __externally_visible__ ) ) ;
  4796. void operator delete ( void * , const std :: nothrow_t & ) noexcept
  4797. __attribute__ ( ( __externally_visible__ ) ) ;
  4798. void operator delete [ ] ( void * , const std :: nothrow_t & ) noexcept
  4799. __attribute__ ( ( __externally_visible__ ) ) ;
  4800.  
  4801.  
  4802. inline void * operator new ( std :: size_t , void * __p ) noexcept
  4803. { return __p ; }
  4804. inline void * operator new [ ] ( std :: size_t , void * __p ) noexcept
  4805. { return __p ; }
  4806.  
  4807.  
  4808. inline void operator delete ( void * , void * ) noexcept { }
  4809. inline void operator delete [ ] ( void * , void * ) noexcept { }
  4810.  
  4811. }
  4812.  
  4813. #pragma GCC visibility pop
  4814. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstring"
  4815. #39
  4816. #pragma GCC system_header
  4817. #1 "/usr/include/string.h"
  4818. #16
  4819. #pragma ident "@(#)string.h 1.27    07/01/14 SMI"
  4820. #1 "/usr/include/iso/string_iso.h"
  4821. #28
  4822. #pragma ident "@(#)string_iso.h 1.5 04/06/18 SMI"
  4823. #33
  4824. extern "C" {
  4825.  
  4826.  
  4827.  
  4828. namespace std {
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834. typedef unsigned long size_t ;
  4835. #59
  4836. extern int memcmp ( const void * , const void * , size_t ) ;
  4837. extern void * memcpy ( void * , const void * , size_t ) ;
  4838. extern void * memmove ( void * , const void * , size_t ) ;
  4839. extern void * memset ( void * , int , size_t ) ;
  4840. extern char * strcat ( char * , const char * ) ;
  4841. extern int strcmp ( const char * , const char * ) ;
  4842. extern char * strcpy ( char * , const char * ) ;
  4843. extern int strcoll ( const char * , const char * ) ;
  4844. extern size_t strcspn ( const char * , const char * ) ;
  4845. extern char * strerror ( int ) ;
  4846. extern size_t strlen ( const char * ) ;
  4847. extern char * strncat ( char * , const char * , size_t ) ;
  4848. extern int strncmp ( const char * , const char * , size_t ) ;
  4849. extern char * strncpy ( char * , const char * , size_t ) ;
  4850. extern size_t strspn ( const char * , const char * ) ;
  4851. extern char * strtok ( char * , const char * ) ;
  4852. extern size_t strxfrm ( char * , const char * , size_t ) ;
  4853. #83
  4854. extern const void * memchr ( const void * , int , size_t ) ;
  4855.  
  4856.  
  4857. extern "C++" {
  4858. inline void * memchr ( void * __s , int __c , size_t __n ) {
  4859. return ( void * ) memchr ( ( const void * ) __s , __c , __n ) ;
  4860. }
  4861. }
  4862.  
  4863. extern const char * strchr ( const char * , int ) ;
  4864.  
  4865.  
  4866. extern "C++" {
  4867. inline char * strchr ( char * __s , int __c ) {
  4868. return ( char * ) strchr ( ( const char * ) __s , __c ) ;
  4869. }
  4870. }
  4871.  
  4872. extern const char * strpbrk ( const char * , const char * ) ;
  4873.  
  4874.  
  4875. extern "C++" {
  4876. inline char * strpbrk ( char * __s1 , const char * __s2 ) {
  4877. return ( char * ) strpbrk ( ( const char * ) __s1 , __s2 ) ;
  4878. }
  4879. }
  4880.  
  4881. extern const char * strrchr ( const char * , int ) ;
  4882.  
  4883.  
  4884. extern "C++" {
  4885. inline char * strrchr ( char * __s , int __c ) {
  4886. return ( char * ) strrchr ( ( const char * ) __s , __c ) ;
  4887. }
  4888. }
  4889.  
  4890. extern const char * strstr ( const char * , const char * ) ;
  4891.  
  4892.  
  4893. extern "C++" {
  4894. inline char * strstr ( char * __s1 , const char * __s2 ) {
  4895. return ( char * ) strstr ( ( const char * ) __s1 , __s2 ) ;
  4896. }
  4897. }
  4898. #164
  4899. }
  4900.  
  4901.  
  4902.  
  4903. }
  4904. #25 "/usr/include/string.h"
  4905. using std :: size_t ;
  4906. using std :: memchr ;
  4907. using std :: memcmp ;
  4908. using std :: memcpy ;
  4909. using std :: memmove ;
  4910. using std :: memset ;
  4911. using std :: strcat ;
  4912. using std :: strchr ;
  4913. using std :: strcmp ;
  4914. using std :: strcoll ;
  4915. using std :: strcpy ;
  4916. using std :: strcspn ;
  4917. using std :: strerror ;
  4918. using std :: strlen ;
  4919. using std :: strncat ;
  4920. using std :: strncmp ;
  4921. using std :: strncpy ;
  4922. using std :: strpbrk ;
  4923. using std :: strrchr ;
  4924. using std :: strspn ;
  4925. using std :: strstr ;
  4926. using std :: strtok ;
  4927. using std :: strxfrm ;
  4928.  
  4929.  
  4930.  
  4931. extern "C" {
  4932. #59
  4933. extern int strerror_r ( int , char * , size_t ) ;
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939. extern char * strtok_r ( char * , const char * ,
  4940. char * * ) ;
  4941.  
  4942.  
  4943.  
  4944.  
  4945. extern void * memccpy ( void * , const void * ,
  4946. int , size_t ) ;
  4947.  
  4948.  
  4949.  
  4950.  
  4951. extern int uucopy ( const void * , void * , size_t ) ;
  4952. extern int uucopystr ( const void * , void * , size_t ) ;
  4953. extern char * strsignal ( int ) ;
  4954. extern int ffs ( int ) ;
  4955. extern int strcasecmp ( const char * , const char * ) ;
  4956. extern int strncasecmp ( const char * , const char * , size_t ) ;
  4957. extern size_t strlcpy ( char * , const char * , size_t ) ;
  4958. extern size_t strlcat ( char * , const char * , size_t ) ;
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964. extern char * strdup ( const char * ) ;
  4965. #128
  4966. }
  4967. #71 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstring"
  4968. namespace std
  4969. {
  4970.  
  4971.  
  4972. using :: memchr ;
  4973. using :: memcmp ;
  4974. using :: memcpy ;
  4975. using :: memmove ;
  4976. using :: memset ;
  4977. using :: strcat ;
  4978. using :: strcmp ;
  4979. using :: strcoll ;
  4980. using :: strcpy ;
  4981. using :: strcspn ;
  4982. using :: strerror ;
  4983. using :: strlen ;
  4984. using :: strncat ;
  4985. using :: strncmp ;
  4986. using :: strncpy ;
  4987. using :: strspn ;
  4988. using :: strtok ;
  4989. using :: strxfrm ;
  4990. using :: strchr ;
  4991. using :: strpbrk ;
  4992. using :: strrchr ;
  4993. using :: strstr ;
  4994. #121
  4995. }
  4996. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstdlib"
  4997. #39
  4998. #pragma GCC system_header
  4999. #1 "/usr/include/stdlib.h"
  5000. #15
  5001. #pragma ident "@(#)stdlib.h 1.52    12/08/01 SMI"
  5002. #1 "/usr/include/iso/stdlib_iso.h"
  5003. #28
  5004. #pragma ident "@(#)stdlib_iso.h 1.9 04/09/28 SMI"
  5005. #33
  5006. extern "C" {
  5007.  
  5008.  
  5009.  
  5010. extern unsigned char __ctype [ ] ;
  5011. #45
  5012. namespace std {
  5013.  
  5014.  
  5015. typedef struct {
  5016. int quot ;
  5017. int rem ;
  5018. } div_t ;
  5019.  
  5020. typedef struct {
  5021. long quot ;
  5022. long rem ;
  5023. } ldiv_t ;
  5024.  
  5025.  
  5026.  
  5027.  
  5028. typedef unsigned long size_t ;
  5029. #107
  5030. extern void abort ( void ) ;
  5031. extern int abs ( int ) ;
  5032. extern int atexit ( void ( * ) ( void ) ) ;
  5033. extern double atof ( const char * ) ;
  5034. extern int atoi ( const char * ) ;
  5035. extern long int atol ( const char * ) ;
  5036. extern void * bsearch ( const void * , const void * , size_t , size_t ,
  5037. int ( * ) ( const void * , const void * ) ) ;
  5038.  
  5039. extern "C++" {
  5040. void * bsearch ( const void * , const void * , size_t , size_t ,
  5041. int ( * ) ( const void * , const void * ) ) ;
  5042. }
  5043.  
  5044. extern void * calloc ( size_t , size_t ) ;
  5045. extern div_t div ( int , int ) ;
  5046. extern void exit ( int )
  5047. ;
  5048. extern void free ( void * ) ;
  5049. extern char * getenv ( const char * ) ;
  5050. extern long int labs ( long ) ;
  5051. extern ldiv_t ldiv ( long , long ) ;
  5052. extern void * malloc ( size_t ) ;
  5053. extern int mblen ( const char * , size_t ) ;
  5054. extern size_t mbstowcs ( wchar_t * , const char * ,
  5055. size_t ) ;
  5056. extern int mbtowc ( wchar_t * , const char * , size_t ) ;
  5057. extern void qsort ( void * , size_t , size_t , int ( * ) ( const void * , const void * ) ) ;
  5058.  
  5059. extern "C++" {
  5060. void qsort ( void * , size_t , size_t , int ( * ) ( const void * , const void * ) ) ;
  5061. }
  5062.  
  5063. extern int rand ( void ) ;
  5064. extern void * realloc ( void * , size_t ) ;
  5065. extern void srand ( unsigned int ) ;
  5066. extern double strtod ( const char * , char * * ) ;
  5067. extern long int strtol ( const char * , char * * , int ) ;
  5068. extern unsigned long int strtoul ( const char * ,
  5069. char * * , int ) ;
  5070. extern int system ( const char * ) ;
  5071. extern int wctomb ( char * , wchar_t ) ;
  5072. extern size_t wcstombs ( char * , const wchar_t * ,
  5073. size_t ) ;
  5074.  
  5075.  
  5076. extern "C++" {
  5077. inline long abs ( long _l ) { return labs ( _l ) ; }
  5078. inline ldiv_t div ( long _l1 , long _l2 ) { return ldiv ( _l1 , _l2 ) ; }
  5079. }
  5080. #193
  5081. }
  5082.  
  5083.  
  5084.  
  5085. }
  5086. #1 "/usr/include/iso/stdlib_c99.h"
  5087. #20
  5088. #pragma ident "@(#)stdlib_c99.h 1.2 04/03/29 SMI"
  5089.  
  5090.  
  5091. extern "C" {
  5092. #35
  5093. typedef struct {
  5094. long long quot ;
  5095. long long rem ;
  5096. } lldiv_t ;
  5097. #46
  5098. extern void _Exit ( int ) ;
  5099. extern float strtof ( const char * , char * * ) ;
  5100. extern long double strtold ( const char * , char * * ) ;
  5101.  
  5102.  
  5103. extern long long atoll ( const char * ) ;
  5104. extern long long llabs ( long long ) ;
  5105. extern lldiv_t lldiv ( long long , long long ) ;
  5106. extern long long strtoll ( const char * , char * * ,
  5107. int ) ;
  5108. extern unsigned long long strtoull ( const char * ,
  5109. char * * , int ) ;
  5110. #83
  5111. }
  5112. #1 "/usr/include/sys/wait.h"
  5113. #16
  5114. #pragma ident "@(#)wait.h   1.23    04/06/03 SMI"
  5115. #1 "/usr/include/sys/resource.h"
  5116. #16
  5117. #pragma ident "@(#)resource.h   1.37    07/02/07 SMI"
  5118. #24
  5119. extern "C" {
  5120. #57
  5121. typedef unsigned long rlim_t ;
  5122. #106
  5123. struct rlimit {
  5124. rlim_t rlim_cur ;
  5125. rlim_t rlim_max ;
  5126. } ;
  5127.  
  5128.  
  5129.  
  5130.  
  5131. typedef u_longlong_t rlim64_t ;
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137. struct rlimit64 {
  5138. rlim64_t rlim_cur ;
  5139. rlim64_t rlim_max ;
  5140. } ;
  5141. #145
  5142. struct rusage {
  5143. struct timeval ru_utime ;
  5144. struct timeval ru_stime ;
  5145. long ru_maxrss ;
  5146. long ru_ixrss ;
  5147. long ru_idrss ;
  5148. long ru_isrss ;
  5149. long ru_minflt ;
  5150. long ru_majflt ;
  5151. long ru_nswap ;
  5152. long ru_inblock ;
  5153. long ru_oublock ;
  5154. long ru_msgsnd ;
  5155. long ru_msgrcv ;
  5156. long ru_nsignals ;
  5157. long ru_nvcsw ;
  5158. long ru_nivcsw ;
  5159. } ;
  5160. #226
  5161. #pragma redefine_extname setrlimit64 setrlimit
  5162. #pragma redefine_extname getrlimit64 getrlimit
  5163. #237
  5164. extern int setrlimit ( int , const struct rlimit * ) ;
  5165. extern int getrlimit ( int , struct rlimit * ) ;
  5166.  
  5167.  
  5168.  
  5169.  
  5170. extern int setrlimit64 ( int , const struct rlimit64 * ) ;
  5171. extern int getrlimit64 ( int , struct rlimit64 * ) ;
  5172.  
  5173.  
  5174. extern int getpriority ( int , id_t ) ;
  5175. extern int setpriority ( int , id_t , int ) ;
  5176. extern int getrusage ( int , struct rusage * ) ;
  5177. #272
  5178. }
  5179. #1 "/usr/include/sys/siginfo.h"
  5180. #21
  5181. #pragma ident "@(#)siginfo.h    1.59    04/07/15 SMI"
  5182. #27
  5183. extern "C" {
  5184. #1 "/usr/include/sys/machsig.h"
  5185. #16
  5186. #pragma ident "@(#)machsig.h    1.11    03/09/26 SMI"
  5187. #21
  5188. extern "C" {
  5189. #1 "/usr/include/vm/faultcode.h"
  5190. #37
  5191. #pragma ident "@(#)faultcode.h  1.16    09/07/02 SMI"
  5192.  
  5193.  
  5194. extern "C" {
  5195. #63
  5196. typedef int faultcode_t ;
  5197.  
  5198. extern int fc_decode ( faultcode_t ) ;
  5199.  
  5200.  
  5201.  
  5202.  
  5203. }
  5204. #105 "/usr/include/sys/machsig.h"
  5205. }
  5206. #227 "/usr/include/sys/siginfo.h"
  5207. typedef struct siginfo {
  5208.  
  5209.  
  5210.  
  5211. int si_signo ;
  5212. int si_code ;
  5213. int si_errno ;
  5214.  
  5215. int si_pad ;
  5216.  
  5217. union {
  5218.  
  5219. int __pad [ ( ( 256 / sizeof ( int ) ) - 4 ) ] ;
  5220.  
  5221. struct {
  5222. pid_t __pid ;
  5223. union {
  5224. struct {
  5225. uid_t __uid ;
  5226.  
  5227.  
  5228. union sigval __value ;
  5229.  
  5230.  
  5231.  
  5232. } __kill ;
  5233. struct {
  5234. clock_t __utime ;
  5235. int __status ;
  5236. clock_t __stime ;
  5237. } __cld ;
  5238. } __pdata ;
  5239. ctid_t __ctid ;
  5240. zoneid_t __zoneid ;
  5241. } __proc ;
  5242.  
  5243. struct {
  5244. void * __addr ;
  5245. int __trapno ;
  5246. caddr_t __pc ;
  5247. } __fault ;
  5248.  
  5249. struct {
  5250.  
  5251. int __fd ;
  5252. long __band ;
  5253. } __file ;
  5254.  
  5255. struct {
  5256. caddr_t __faddr ;
  5257.  
  5258. timestruc_t __tstamp ;
  5259.  
  5260.  
  5261.  
  5262. short __syscall ;
  5263. char __nsysarg ;
  5264. char __fault ;
  5265. long __sysarg [ 8 ] ;
  5266. int __mstate [ 10 ] ;
  5267. } __prof ;
  5268.  
  5269. struct {
  5270. int32_t __entity ;
  5271. } __rctl ;
  5272. } __data ;
  5273.  
  5274. } siginfo_t ;
  5275. #369
  5276. typedef struct k_siginfo {
  5277. int si_signo ;
  5278. int si_code ;
  5279. int si_errno ;
  5280.  
  5281. int si_pad ;
  5282.  
  5283. union {
  5284. struct {
  5285. pid_t __pid ;
  5286. union {
  5287. struct {
  5288. uid_t __uid ;
  5289. union sigval __value ;
  5290. } __kill ;
  5291. struct {
  5292. clock_t __utime ;
  5293. int __status ;
  5294. clock_t __stime ;
  5295. } __cld ;
  5296. } __pdata ;
  5297. ctid_t __ctid ;
  5298. zoneid_t __zoneid ;
  5299. } __proc ;
  5300.  
  5301. struct {
  5302. void * __addr ;
  5303. int __trapno ;
  5304. caddr_t __pc ;
  5305. } __fault ;
  5306.  
  5307. struct {
  5308.  
  5309. int __fd ;
  5310. long __band ;
  5311. } __file ;
  5312.  
  5313. struct {
  5314. caddr_t __faddr ;
  5315.  
  5316.  
  5317. timestruc_t __tstamp ;
  5318.  
  5319.  
  5320.  
  5321. short __syscall ;
  5322. char __nsysarg ;
  5323. char __fault ;
  5324.  
  5325.  
  5326.  
  5327. } __prof ;
  5328.  
  5329. struct {
  5330. int32_t __entity ;
  5331. } __rctl ;
  5332.  
  5333. } __data ;
  5334.  
  5335. } k_siginfo_t ;
  5336.  
  5337. typedef struct sigqueue {
  5338. struct sigqueue * sq_next ;
  5339. k_siginfo_t sq_info ;
  5340. void ( * sq_func ) ( struct sigqueue * ) ;
  5341. void * sq_backptr ;
  5342.  
  5343. int sq_external ;
  5344. } sigqueue_t ;
  5345. #478
  5346. }
  5347. #1 "/usr/include/sys/procset.h"
  5348. #15
  5349. #pragma ident "@(#)procset.h    1.26    11/04/18 SMI"
  5350.  
  5351.  
  5352. extern "C" {
  5353. #1 "/usr/include/sys/signal.h"
  5354. #16
  5355. #pragma ident "@(#)signal.h 1.66    04/09/28 SMI"
  5356. #1 "/usr/include/sys/iso/signal_iso.h"
  5357. #28
  5358. #pragma ident "@(#)signal_iso.h 1.6 03/05/02 SMI"
  5359. #33
  5360. extern "C" {
  5361. #83
  5362. extern long _sysconf ( int ) ;
  5363.  
  5364.  
  5365.  
  5366.  
  5367.  
  5368. typedef void SIG_FUNC_TYP ( int ) ;
  5369. typedef SIG_FUNC_TYP * SIG_TYP ;
  5370. #126
  5371. }
  5372. #22 "/usr/include/sys/signal.h"
  5373. extern "C" {
  5374. #56
  5375. typedef struct {
  5376. unsigned int __sigbits [ 2 ] ;
  5377. } k_sigset_t ;
  5378. #74
  5379. struct sigaction {
  5380. int sa_flags ;
  5381. union {
  5382.  
  5383. void ( * _handler ) ( int ) ;
  5384. #85
  5385. void ( * _sigaction ) ( int , siginfo_t * , void * ) ;
  5386.  
  5387. } _funcptr ;
  5388. sigset_t sa_mask ;
  5389.  
  5390.  
  5391.  
  5392. } ;
  5393. #161
  5394. typedef struct sigaltstack {
  5395.  
  5396.  
  5397.  
  5398. void * ss_sp ;
  5399. size_t ss_size ;
  5400. int ss_flags ;
  5401. } stack_t ;
  5402. #190
  5403. typedef struct signotify_id {
  5404. pid_t sn_pid ;
  5405. int sn_index ;
  5406. int sn_pad ;
  5407. } signotify_id_t ;
  5408. #220
  5409. struct sigstack {
  5410. void * ss_sp ;
  5411. int ss_onstack ;
  5412. } ;
  5413. #1 "/usr/include/sys/ucontext.h"
  5414. #15
  5415. #pragma ident "@(#)ucontext.h   1.12    11/02/11 SMI"
  5416. #1 "/usr/include/sys/regset.h"
  5417. #15
  5418. #pragma ident "@(#)regset.h 1.12    11/08/26 SMI"
  5419. #24
  5420. extern "C" {
  5421. #141
  5422. typedef long greg_t ;
  5423. #153
  5424. typedef greg_t gregset_t [ 28 ] ;
  5425. #174
  5426. struct fnsave_state {
  5427. uint16_t f_fcw ;
  5428. uint16_t __f_ign0 ;
  5429. uint16_t f_fsw ;
  5430. uint16_t __f_ign1 ;
  5431. uint16_t f_ftw ;
  5432. uint16_t __f_ign2 ;
  5433. uint32_t f_eip ;
  5434. uint16_t f_cs ;
  5435. uint16_t f_fop ;
  5436. uint32_t f_dp ;
  5437. uint16_t f_ds ;
  5438. uint16_t __f_ign3 ;
  5439. union {
  5440. uint16_t fpr_16 [ 5 ] ;
  5441. } f_st [ 8 ] ;
  5442. } ;
  5443. #197
  5444. struct fxsave_state {
  5445. uint16_t fx_fcw ;
  5446. uint16_t fx_fsw ;
  5447. uint16_t fx_fctw ;
  5448. uint16_t fx_fop ;
  5449.  
  5450. uint64_t fx_rip ;
  5451. uint64_t fx_rdp ;
  5452. #213
  5453. uint32_t fx_mxcsr ;
  5454. uint32_t fx_mxcsr_mask ;
  5455. union {
  5456. uint16_t fpr_16 [ 5 ] ;
  5457. u_longlong_t fpr_mmx ;
  5458. uint32_t __fpr_pad [ 4 ] ;
  5459. } fx_st [ 8 ] ;
  5460.  
  5461. upad128_t fx_xmm [ 16 ] ;
  5462. upad128_t __fx_ign2 [ 6 ] ;
  5463.  
  5464.  
  5465.  
  5466.  
  5467. } ;
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473. struct xsave_state {
  5474. struct fxsave_state xs_fxsave ;
  5475. uint64_t xs_xstate_bv ;
  5476. uint64_t xs_rsv_mbz [ 2 ] ;
  5477. uint64_t xs_reserved [ 5 ] ;
  5478. upad128_t xs_ymm [ 16 ] ;
  5479. } ;
  5480.  
  5481.  
  5482.  
  5483. typedef struct fpu {
  5484. union {
  5485. struct fpchip_state {
  5486. uint16_t cw ;
  5487. uint16_t sw ;
  5488. uint8_t fctw ;
  5489. uint8_t __fx_rsvd ;
  5490. uint16_t fop ;
  5491. uint64_t rip ;
  5492. uint64_t rdp ;
  5493. uint32_t mxcsr ;
  5494. uint32_t mxcsr_mask ;
  5495. union {
  5496. uint16_t fpr_16 [ 5 ] ;
  5497. upad128_t __fpr_pad ;
  5498. } st [ 8 ] ;
  5499. upad128_t xmm [ 16 ] ;
  5500. upad128_t __fx_ign2 [ 6 ] ;
  5501. uint32_t status ;
  5502. uint32_t xstatus ;
  5503. } fpchip_state ;
  5504. uint32_t f_fpregs [ 130 ] ;
  5505. } fp_reg_set ;
  5506. } fpregset_t ;
  5507. #341
  5508. typedef struct {
  5509. union _kfpu_u {
  5510. struct fxsave_state kfpu_fx ;
  5511.  
  5512.  
  5513.  
  5514. struct xsave_state kfpu_xs ;
  5515. } kfpu_u ;
  5516. uint32_t kfpu_status ;
  5517. uint32_t kfpu_xstatus ;
  5518. } kfpu_t ;
  5519. #359
  5520. typedef struct dbregset {
  5521. unsigned long debugreg [ 16 ] ;
  5522. } dbregset_t ;
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528. typedef struct {
  5529. gregset_t gregs ;
  5530. fpregset_t fpregs ;
  5531. } mcontext_t ;
  5532. #487
  5533. typedef struct {
  5534. unsigned long xrs_id ;
  5535. caddr_t xrs_ptr ;
  5536. } xrs_t ;
  5537. #512
  5538. }
  5539. #1 "/usr/include/sys/signal.h"
  5540. #26 "/usr/include/sys/ucontext.h"
  5541. extern "C" {
  5542. #54
  5543. typedef struct ucontext ucontext_t ;
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549. struct ucontext {
  5550.  
  5551.  
  5552.  
  5553. unsigned long uc_flags ;
  5554. ucontext_t * uc_link ;
  5555. sigset_t uc_sigmask ;
  5556. stack_t uc_stack ;
  5557. mcontext_t uc_mcontext ;
  5558.  
  5559. xrs_t uc_xrs ;
  5560.  
  5561.  
  5562.  
  5563. long uc_filler [ 3 ] ;
  5564. } ;
  5565. #137
  5566. }
  5567. #313 "/usr/include/sys/signal.h"
  5568. }
  5569. #41 "/usr/include/sys/procset.h"
  5570. typedef enum
  5571.  
  5572. idtype
  5573.  
  5574. {
  5575. P_PID ,
  5576. P_PPID ,
  5577. P_PGID ,
  5578.  
  5579. P_SID ,
  5580. P_CID ,
  5581. P_UID ,
  5582. P_GID ,
  5583. P_ALL ,
  5584. P_LWPID ,
  5585. P_TASKID ,
  5586. P_PROJID ,
  5587. P_POOLID ,
  5588. P_ZONEID ,
  5589. P_CTID ,
  5590. P_CPUID ,
  5591. P_PSETID
  5592. } idtype_t ;
  5593. #72
  5594. typedef enum idop {
  5595. POP_DIFF ,
  5596.  
  5597.  
  5598. POP_AND ,
  5599.  
  5600.  
  5601. POP_OR ,
  5602.  
  5603.  
  5604. POP_XOR
  5605.  
  5606.  
  5607. } idop_t ;
  5608. #93
  5609. typedef struct procset {
  5610. idop_t p_op ;
  5611.  
  5612.  
  5613.  
  5614.  
  5615. idtype_t p_lidtype ;
  5616.  
  5617.  
  5618. id_t p_lid ;
  5619.  
  5620. idtype_t p_ridtype ;
  5621.  
  5622.  
  5623. id_t p_rid ;
  5624. } procset_t ;
  5625. #138
  5626. }
  5627. #29 "/usr/include/sys/wait.h"
  5628. extern "C" {
  5629. #82
  5630. extern pid_t wait ( int * ) ;
  5631. extern pid_t waitpid ( pid_t , int * , int ) ;
  5632.  
  5633.  
  5634. extern int waitid ( idtype_t , id_t , siginfo_t * , int ) ;
  5635.  
  5636.  
  5637. extern pid_t wait3 ( int * , int , struct rusage * ) ;
  5638.  
  5639.  
  5640.  
  5641.  
  5642. extern pid_t wait4 ( pid_t , int * , int , struct rusage * ) ;
  5643. #117
  5644. }
  5645. #29 "/usr/include/stdlib.h"
  5646. using std :: div_t ;
  5647. using std :: ldiv_t ;
  5648. using std :: size_t ;
  5649. using std :: abort ;
  5650. using std :: abs ;
  5651. using std :: atexit ;
  5652. using std :: atof ;
  5653. using std :: atoi ;
  5654. using std :: atol ;
  5655. using std :: bsearch ;
  5656. using std :: calloc ;
  5657. using std :: div ;
  5658. using std :: exit ;
  5659. using std :: free ;
  5660. using std :: getenv ;
  5661. using std :: labs ;
  5662. using std :: ldiv ;
  5663. using std :: malloc ;
  5664. using std :: mblen ;
  5665. using std :: mbstowcs ;
  5666. using std :: mbtowc ;
  5667. using std :: qsort ;
  5668. using std :: rand ;
  5669. using std :: realloc ;
  5670. using std :: srand ;
  5671. using std :: strtod ;
  5672. using std :: strtol ;
  5673. using std :: strtoul ;
  5674. using std :: system ;
  5675. using std :: wcstombs ;
  5676. using std :: wctomb ;
  5677.  
  5678.  
  5679.  
  5680. extern "C" {
  5681. #92
  5682. #pragma redefine_extname mkstemp64 mkstemp
  5683. #102
  5684. extern int rand_r ( unsigned int * ) ;
  5685.  
  5686.  
  5687. extern void _exithandle ( void ) ;
  5688.  
  5689.  
  5690.  
  5691.  
  5692. extern double drand48 ( void ) ;
  5693. extern double erand48 ( unsigned short * ) ;
  5694. extern long jrand48 ( unsigned short * ) ;
  5695. extern void lcong48 ( unsigned short * ) ;
  5696. extern long lrand48 ( void ) ;
  5697. extern long mrand48 ( void ) ;
  5698. extern long nrand48 ( unsigned short * ) ;
  5699. extern unsigned short * seed48 ( unsigned short * ) ;
  5700. extern void srand48 ( long ) ;
  5701. extern int putenv ( char * ) ;
  5702. extern void setkey ( const char * ) ;
  5703. #149
  5704. extern int mkstemp ( char * ) ;
  5705.  
  5706.  
  5707.  
  5708.  
  5709. extern int mkstemp64 ( char * ) ;
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715. extern long a64l ( const char * ) ;
  5716. extern char * ecvt ( double , int , int * , int * ) ;
  5717. extern char * fcvt ( double , int , int * , int * ) ;
  5718. extern char * gcvt ( double , int , char * ) ;
  5719. extern int getsubopt ( char * * , char * const * , char * * ) ;
  5720. extern int grantpt ( int ) ;
  5721. extern char * initstate ( unsigned , char * , size_t ) ;
  5722. extern char * l64a ( long ) ;
  5723. extern char * mktemp ( char * ) ;
  5724. extern char * ptsname ( int ) ;
  5725. extern long random ( void ) ;
  5726. extern char * realpath ( const char * , char * ) ;
  5727. extern char * setstate ( const char * ) ;
  5728. extern void srandom ( unsigned ) ;
  5729. extern int unlockpt ( int ) ;
  5730.  
  5731.  
  5732. extern int ttyslot ( void ) ;
  5733. extern void * valloc ( size_t ) ;
  5734. #185
  5735. extern int posix_openpt ( int ) ;
  5736. extern int setenv ( const char * , const char * , int ) ;
  5737. extern int unsetenv ( const char * ) ;
  5738.  
  5739.  
  5740.  
  5741.  
  5742. extern void closefrom ( int ) ;
  5743. extern int dup2 ( int , int ) ;
  5744. extern int fdwalk ( int ( * ) ( void * , int ) , void * ) ;
  5745. extern char * qecvt ( long double , int , int * , int * ) ;
  5746. extern char * qfcvt ( long double , int , int * , int * ) ;
  5747. extern char * qgcvt ( long double , int , char * ) ;
  5748. extern char * getcwd ( char * , size_t ) ;
  5749. extern const char * getexecname ( void ) ;
  5750. extern char * getlogin ( void ) ;
  5751. extern int getopt ( int , char * const * , const char * ) ;
  5752. extern char * optarg ;
  5753. extern int optind , opterr , optopt ;
  5754. extern char * getpass ( const char * ) ;
  5755. extern char * getpassphrase ( const char * ) ;
  5756. extern int getpw ( uid_t , char * ) ;
  5757. extern int isatty ( int ) ;
  5758. extern void * memalign ( size_t , size_t ) ;
  5759. extern char * ttyname ( int ) ;
  5760. extern char * mkdtemp ( char * ) ;
  5761.  
  5762.  
  5763. extern char * lltostr ( long long , char * ) ;
  5764. extern char * ulltostr ( unsigned long long , char * ) ;
  5765. #316
  5766. }
  5767. #114 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstdlib"
  5768. namespace std
  5769. {
  5770.  
  5771.  
  5772. using :: div_t ;
  5773. using :: ldiv_t ;
  5774.  
  5775. using :: abort ;
  5776. using :: abs ;
  5777. using :: atexit ;
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783. using :: atof ;
  5784. using :: atoi ;
  5785. using :: atol ;
  5786. using :: bsearch ;
  5787. using :: calloc ;
  5788. using :: div ;
  5789. using :: exit ;
  5790. using :: free ;
  5791. using :: getenv ;
  5792. using :: labs ;
  5793. using :: ldiv ;
  5794. using :: malloc ;
  5795.  
  5796. using :: mblen ;
  5797. using :: mbstowcs ;
  5798. using :: mbtowc ;
  5799.  
  5800. using :: qsort ;
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806. using :: rand ;
  5807. using :: realloc ;
  5808. using :: srand ;
  5809. using :: strtod ;
  5810. using :: strtol ;
  5811. using :: strtoul ;
  5812. using :: system ;
  5813.  
  5814. using :: wcstombs ;
  5815. using :: wctomb ;
  5816. #173
  5817. inline long long
  5818. abs ( long long __x ) { return __builtin_llabs ( __x ) ; }
  5819. #183
  5820. }
  5821. #196
  5822. namespace __gnu_cxx
  5823. {
  5824.  
  5825.  
  5826.  
  5827. using :: lldiv_t ;
  5828.  
  5829.  
  5830.  
  5831.  
  5832.  
  5833. using :: _Exit ;
  5834.  
  5835.  
  5836.  
  5837. using :: llabs ;
  5838.  
  5839. inline lldiv_t
  5840. div ( long long __n , long long __d )
  5841. { lldiv_t __q ; __q . quot = __n / __d ; __q . rem = __n % __d ; return __q ; }
  5842.  
  5843. using :: lldiv ;
  5844. #228
  5845. using :: atoll ;
  5846. using :: strtoll ;
  5847. using :: strtoull ;
  5848.  
  5849. using :: strtof ;
  5850. using :: strtold ;
  5851.  
  5852.  
  5853. }
  5854.  
  5855. namespace std
  5856. {
  5857.  
  5858. using :: __gnu_cxx :: lldiv_t ;
  5859.  
  5860. using :: __gnu_cxx :: _Exit ;
  5861.  
  5862. using :: __gnu_cxx :: llabs ;
  5863. using :: __gnu_cxx :: div ;
  5864. using :: __gnu_cxx :: lldiv ;
  5865.  
  5866. using :: __gnu_cxx :: atoll ;
  5867. using :: __gnu_cxx :: strtof ;
  5868. using :: __gnu_cxx :: strtoll ;
  5869. using :: __gnu_cxx :: strtoull ;
  5870. using :: __gnu_cxx :: strtold ;
  5871. }
  5872. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cassert"
  5873. #41
  5874. #pragma GCC system_header
  5875. #1 "/usr/include/assert.h"
  5876. #16
  5877. #pragma ident "@(#)assert.h 1.10    04/05/18 SMI"
  5878.  
  5879.  
  5880. extern "C" {
  5881. #26
  5882. extern void __assert ( const char * , const char * , int ) ;
  5883. #33
  5884. }
  5885. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstdio"
  5886. #39
  5887. #pragma GCC system_header
  5888. #93
  5889. namespace std
  5890. {
  5891. using :: FILE ;
  5892. using :: fpos_t ;
  5893.  
  5894. using :: clearerr ;
  5895. using :: fclose ;
  5896. using :: feof ;
  5897. using :: ferror ;
  5898. using :: fflush ;
  5899. using :: fgetc ;
  5900. using :: fgetpos ;
  5901. using :: fgets ;
  5902. using :: fopen ;
  5903. using :: fprintf ;
  5904. using :: fputc ;
  5905. using :: fputs ;
  5906. using :: fread ;
  5907. using :: freopen ;
  5908. using :: fscanf ;
  5909. using :: fseek ;
  5910. using :: fsetpos ;
  5911. using :: ftell ;
  5912. using :: fwrite ;
  5913. using :: getc ;
  5914. using :: getchar ;
  5915. using :: gets ;
  5916. using :: perror ;
  5917. using :: printf ;
  5918. using :: putc ;
  5919. using :: putchar ;
  5920. using :: puts ;
  5921. using :: remove ;
  5922. using :: rename ;
  5923. using :: rewind ;
  5924. using :: scanf ;
  5925. using :: setbuf ;
  5926. using :: setvbuf ;
  5927. using :: sprintf ;
  5928. using :: sscanf ;
  5929. using :: tmpfile ;
  5930. using :: tmpnam ;
  5931. using :: ungetc ;
  5932. using :: vfprintf ;
  5933. using :: vprintf ;
  5934. using :: vsprintf ;
  5935. }
  5936. #149
  5937. namespace __gnu_cxx
  5938. {
  5939. #167
  5940. using :: snprintf ;
  5941. using :: vfscanf ;
  5942. using :: vscanf ;
  5943. using :: vsnprintf ;
  5944. using :: vsscanf ;
  5945.  
  5946. }
  5947.  
  5948. namespace std
  5949. {
  5950. using :: __gnu_cxx :: snprintf ;
  5951. using :: __gnu_cxx :: vfscanf ;
  5952. using :: __gnu_cxx :: vscanf ;
  5953. using :: __gnu_cxx :: vsnprintf ;
  5954. using :: __gnu_cxx :: vsscanf ;
  5955. }
  5956. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/climits"
  5957. #39
  5958. #pragma GCC system_header
  5959. #1 "/usr/include/limits.h"
  5960. #15
  5961. #pragma ident "@(#)limits.h 1.60    11/04/12 SMI"
  5962. #1 "/usr/include/iso/limits_iso.h"
  5963. #28
  5964. #pragma ident "@(#)limits_iso.h 1.2 03/12/04 SMI"
  5965.  
  5966.  
  5967. extern "C" {
  5968. #83
  5969. }
  5970. #1 "/usr/include/sys/int_limits.h"
  5971. #9
  5972. #pragma ident "@(#)int_limits.h 1.9 04/09/28 SMI"
  5973. #38
  5974. extern "C" {
  5975. #257
  5976. }
  5977. #35 "/usr/include/limits.h"
  5978. extern "C" {
  5979. #297
  5980. typedef unsigned long size_t ;
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986. extern long _sysconf ( int ) ;
  5987. #313
  5988. }
  5989. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/string"
  5990. #36
  5991. #pragma GCC system_header
  5992. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stringfwd.h"
  5993. #37
  5994. #pragma GCC system_header
  5995. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/memoryfwd.h"
  5996. #46
  5997. #pragma GCC system_header
  5998. #50
  5999. namespace std
  6000. {
  6001. #63
  6002. template < typename >
  6003. class allocator ;
  6004.  
  6005. template < >
  6006. class allocator < void > ;
  6007.  
  6008.  
  6009. template < typename , typename >
  6010. struct uses_allocator ;
  6011.  
  6012.  
  6013.  
  6014.  
  6015. }
  6016. #42 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stringfwd.h"
  6017. namespace std
  6018. {
  6019. #52
  6020. template < class _CharT >
  6021. struct char_traits ;
  6022.  
  6023. template < typename _CharT , typename _Traits = char_traits < _CharT > ,
  6024. typename _Alloc = allocator < _CharT > >
  6025. class basic_string ;
  6026.  
  6027. template < > struct char_traits < char > ;
  6028.  
  6029.  
  6030. typedef basic_string < char > string ;
  6031.  
  6032.  
  6033. template < > struct char_traits < wchar_t > ;
  6034.  
  6035.  
  6036. typedef basic_string < wchar_t > wstring ;
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042. template < > struct char_traits < char16_t > ;
  6043. template < > struct char_traits < char32_t > ;
  6044.  
  6045.  
  6046. typedef basic_string < char16_t > u16string ;
  6047.  
  6048.  
  6049. typedef basic_string < char32_t > u32string ;
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055. }
  6056. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/char_traits.h"
  6057. #37
  6058. #pragma GCC system_header
  6059. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_algobase.h"
  6060. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/functexcept.h"
  6061. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/exception_defines.h"
  6062. #42 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/functexcept.h"
  6063. namespace std
  6064. {
  6065.  
  6066.  
  6067.  
  6068. void
  6069. __throw_bad_exception ( void ) __attribute__ ( ( __noreturn__ ) ) ;
  6070.  
  6071.  
  6072. void
  6073. __throw_bad_alloc ( void ) __attribute__ ( ( __noreturn__ ) ) ;
  6074.  
  6075.  
  6076. void
  6077. __throw_bad_cast ( void ) __attribute__ ( ( __noreturn__ ) ) ;
  6078.  
  6079. void
  6080. __throw_bad_typeid ( void ) __attribute__ ( ( __noreturn__ ) ) ;
  6081.  
  6082.  
  6083. void
  6084. __throw_logic_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6085.  
  6086. void
  6087. __throw_domain_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6088.  
  6089. void
  6090. __throw_invalid_argument ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6091.  
  6092. void
  6093. __throw_length_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6094.  
  6095. void
  6096. __throw_out_of_range ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6097.  
  6098. void
  6099. __throw_runtime_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6100.  
  6101. void
  6102. __throw_range_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6103.  
  6104. void
  6105. __throw_overflow_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6106.  
  6107. void
  6108. __throw_underflow_error ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6109.  
  6110.  
  6111. void
  6112. __throw_ios_failure ( const char * ) __attribute__ ( ( __noreturn__ ) ) ;
  6113.  
  6114. void
  6115. __throw_system_error ( int ) __attribute__ ( ( __noreturn__ ) ) ;
  6116.  
  6117. void
  6118. __throw_future_error ( int ) __attribute__ ( ( __noreturn__ ) ) ;
  6119.  
  6120.  
  6121. void
  6122. __throw_bad_function_call ( ) __attribute__ ( ( __noreturn__ ) ) ;
  6123.  
  6124.  
  6125. }
  6126. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/cpp_type_traits.h"
  6127. #35
  6128. #pragma GCC system_header
  6129. #68
  6130. namespace __gnu_cxx
  6131. {
  6132.  
  6133.  
  6134. template < typename _Iterator , typename _Container >
  6135. class __normal_iterator ;
  6136.  
  6137.  
  6138. }
  6139.  
  6140. namespace std
  6141. {
  6142.  
  6143.  
  6144. struct __true_type { } ;
  6145. struct __false_type { } ;
  6146.  
  6147. template < bool >
  6148. struct __truth_type
  6149. { typedef __false_type __type ; } ;
  6150.  
  6151. template < >
  6152. struct __truth_type < true >
  6153. { typedef __true_type __type ; } ;
  6154.  
  6155.  
  6156.  
  6157. template < class _Sp , class _Tp >
  6158. struct __traitor
  6159. {
  6160. enum { __value = bool ( _Sp :: __value ) || bool ( _Tp :: __value ) } ;
  6161. typedef typename __truth_type < __value > :: __type __type ;
  6162. } ;
  6163.  
  6164.  
  6165. template < typename , typename >
  6166. struct __are_same
  6167. {
  6168. enum { __value = 0 } ;
  6169. typedef __false_type __type ;
  6170. } ;
  6171.  
  6172. template < typename _Tp >
  6173. struct __are_same < _Tp , _Tp >
  6174. {
  6175. enum { __value = 1 } ;
  6176. typedef __true_type __type ;
  6177. } ;
  6178.  
  6179.  
  6180. template < typename _Tp >
  6181. struct __is_void
  6182. {
  6183. enum { __value = 0 } ;
  6184. typedef __false_type __type ;
  6185. } ;
  6186.  
  6187. template < >
  6188. struct __is_void < void >
  6189. {
  6190. enum { __value = 1 } ;
  6191. typedef __true_type __type ;
  6192. } ;
  6193.  
  6194.  
  6195.  
  6196.  
  6197. template < typename _Tp >
  6198. struct __is_integer
  6199. {
  6200. enum { __value = 0 } ;
  6201. typedef __false_type __type ;
  6202. } ;
  6203.  
  6204.  
  6205.  
  6206.  
  6207. template < >
  6208. struct __is_integer < bool >
  6209. {
  6210. enum { __value = 1 } ;
  6211. typedef __true_type __type ;
  6212. } ;
  6213.  
  6214. template < >
  6215. struct __is_integer < char >
  6216. {
  6217. enum { __value = 1 } ;
  6218. typedef __true_type __type ;
  6219. } ;
  6220.  
  6221. template < >
  6222. struct __is_integer < signed char >
  6223. {
  6224. enum { __value = 1 } ;
  6225. typedef __true_type __type ;
  6226. } ;
  6227.  
  6228. template < >
  6229. struct __is_integer < unsigned char >
  6230. {
  6231. enum { __value = 1 } ;
  6232. typedef __true_type __type ;
  6233. } ;
  6234.  
  6235.  
  6236. template < >
  6237. struct __is_integer < wchar_t >
  6238. {
  6239. enum { __value = 1 } ;
  6240. typedef __true_type __type ;
  6241. } ;
  6242.  
  6243.  
  6244.  
  6245. template < >
  6246. struct __is_integer < char16_t >
  6247. {
  6248. enum { __value = 1 } ;
  6249. typedef __true_type __type ;
  6250. } ;
  6251.  
  6252. template < >
  6253. struct __is_integer < char32_t >
  6254. {
  6255. enum { __value = 1 } ;
  6256. typedef __true_type __type ;
  6257. } ;
  6258.  
  6259.  
  6260. template < >
  6261. struct __is_integer < short >
  6262. {
  6263. enum { __value = 1 } ;
  6264. typedef __true_type __type ;
  6265. } ;
  6266.  
  6267. template < >
  6268. struct __is_integer < unsigned short >
  6269. {
  6270. enum { __value = 1 } ;
  6271. typedef __true_type __type ;
  6272. } ;
  6273.  
  6274. template < >
  6275. struct __is_integer < int >
  6276. {
  6277. enum { __value = 1 } ;
  6278. typedef __true_type __type ;
  6279. } ;
  6280.  
  6281. template < >
  6282. struct __is_integer < unsigned int >
  6283. {
  6284. enum { __value = 1 } ;
  6285. typedef __true_type __type ;
  6286. } ;
  6287.  
  6288. template < >
  6289. struct __is_integer < long >
  6290. {
  6291. enum { __value = 1 } ;
  6292. typedef __true_type __type ;
  6293. } ;
  6294.  
  6295. template < >
  6296. struct __is_integer < unsigned long >
  6297. {
  6298. enum { __value = 1 } ;
  6299. typedef __true_type __type ;
  6300. } ;
  6301.  
  6302. template < >
  6303. struct __is_integer < long long >
  6304. {
  6305. enum { __value = 1 } ;
  6306. typedef __true_type __type ;
  6307. } ;
  6308.  
  6309. template < >
  6310. struct __is_integer < unsigned long long >
  6311. {
  6312. enum { __value = 1 } ;
  6313. typedef __true_type __type ;
  6314. } ;
  6315.  
  6316.  
  6317.  
  6318.  
  6319. template < typename _Tp >
  6320. struct __is_floating
  6321. {
  6322. enum { __value = 0 } ;
  6323. typedef __false_type __type ;
  6324. } ;
  6325.  
  6326.  
  6327. template < >
  6328. struct __is_floating < float >
  6329. {
  6330. enum { __value = 1 } ;
  6331. typedef __true_type __type ;
  6332. } ;
  6333.  
  6334. template < >
  6335. struct __is_floating < double >
  6336. {
  6337. enum { __value = 1 } ;
  6338. typedef __true_type __type ;
  6339. } ;
  6340.  
  6341. template < >
  6342. struct __is_floating < long double >
  6343. {
  6344. enum { __value = 1 } ;
  6345. typedef __true_type __type ;
  6346. } ;
  6347.  
  6348.  
  6349.  
  6350.  
  6351. template < typename _Tp >
  6352. struct __is_pointer
  6353. {
  6354. enum { __value = 0 } ;
  6355. typedef __false_type __type ;
  6356. } ;
  6357.  
  6358. template < typename _Tp >
  6359. struct __is_pointer < _Tp * >
  6360. {
  6361. enum { __value = 1 } ;
  6362. typedef __true_type __type ;
  6363. } ;
  6364.  
  6365.  
  6366.  
  6367.  
  6368. template < typename _Tp >
  6369. struct __is_normal_iterator
  6370. {
  6371. enum { __value = 0 } ;
  6372. typedef __false_type __type ;
  6373. } ;
  6374.  
  6375. template < typename _Iterator , typename _Container >
  6376. struct __is_normal_iterator < __gnu_cxx :: __normal_iterator < _Iterator ,
  6377. _Container > >
  6378. {
  6379. enum { __value = 1 } ;
  6380. typedef __true_type __type ;
  6381. } ;
  6382.  
  6383.  
  6384.  
  6385.  
  6386. template < typename _Tp >
  6387. struct __is_arithmetic
  6388. : public __traitor < __is_integer < _Tp > , __is_floating < _Tp > >
  6389. { } ;
  6390.  
  6391.  
  6392.  
  6393.  
  6394. template < typename _Tp >
  6395. struct __is_fundamental
  6396. : public __traitor < __is_void < _Tp > , __is_arithmetic < _Tp > >
  6397. { } ;
  6398.  
  6399.  
  6400.  
  6401.  
  6402. template < typename _Tp >
  6403. struct __is_scalar
  6404. : public __traitor < __is_arithmetic < _Tp > , __is_pointer < _Tp > >
  6405. { } ;
  6406.  
  6407.  
  6408.  
  6409.  
  6410. template < typename _Tp >
  6411. struct __is_char
  6412. {
  6413. enum { __value = 0 } ;
  6414. typedef __false_type __type ;
  6415. } ;
  6416.  
  6417. template < >
  6418. struct __is_char < char >
  6419. {
  6420. enum { __value = 1 } ;
  6421. typedef __true_type __type ;
  6422. } ;
  6423.  
  6424.  
  6425. template < >
  6426. struct __is_char < wchar_t >
  6427. {
  6428. enum { __value = 1 } ;
  6429. typedef __true_type __type ;
  6430. } ;
  6431.  
  6432.  
  6433. template < typename _Tp >
  6434. struct __is_byte
  6435. {
  6436. enum { __value = 0 } ;
  6437. typedef __false_type __type ;
  6438. } ;
  6439.  
  6440. template < >
  6441. struct __is_byte < char >
  6442. {
  6443. enum { __value = 1 } ;
  6444. typedef __true_type __type ;
  6445. } ;
  6446.  
  6447. template < >
  6448. struct __is_byte < signed char >
  6449. {
  6450. enum { __value = 1 } ;
  6451. typedef __true_type __type ;
  6452. } ;
  6453.  
  6454. template < >
  6455. struct __is_byte < unsigned char >
  6456. {
  6457. enum { __value = 1 } ;
  6458. typedef __true_type __type ;
  6459. } ;
  6460.  
  6461.  
  6462.  
  6463.  
  6464. template < typename _Tp >
  6465. struct __is_move_iterator
  6466. {
  6467. enum { __value = 0 } ;
  6468. typedef __false_type __type ;
  6469. } ;
  6470.  
  6471.  
  6472. template < typename _Iterator >
  6473. class move_iterator ;
  6474.  
  6475. template < typename _Iterator >
  6476. struct __is_move_iterator < move_iterator < _Iterator > >
  6477. {
  6478. enum { __value = 1 } ;
  6479. typedef __true_type __type ;
  6480. } ;
  6481.  
  6482.  
  6483.  
  6484. }
  6485. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/type_traits.h"
  6486. #32
  6487. #pragma GCC system_header
  6488. #37
  6489. namespace __gnu_cxx
  6490. {
  6491.  
  6492.  
  6493.  
  6494. template < bool , typename >
  6495. struct __enable_if
  6496. { } ;
  6497.  
  6498. template < typename _Tp >
  6499. struct __enable_if < true , _Tp >
  6500. { typedef _Tp __type ; } ;
  6501.  
  6502.  
  6503.  
  6504. template < bool _Cond , typename _Iftrue , typename _Iffalse >
  6505. struct __conditional_type
  6506. { typedef _Iftrue __type ; } ;
  6507.  
  6508. template < typename _Iftrue , typename _Iffalse >
  6509. struct __conditional_type < false , _Iftrue , _Iffalse >
  6510. { typedef _Iffalse __type ; } ;
  6511.  
  6512.  
  6513.  
  6514. template < typename _Tp >
  6515. struct __add_unsigned
  6516. {
  6517. private :
  6518. typedef __enable_if < std :: __is_integer < _Tp > :: __value , _Tp > __if_type ;
  6519.  
  6520. public :
  6521. typedef typename __if_type :: __type __type ;
  6522. } ;
  6523.  
  6524. template < >
  6525. struct __add_unsigned < char >
  6526. { typedef unsigned char __type ; } ;
  6527.  
  6528. template < >
  6529. struct __add_unsigned < signed char >
  6530. { typedef unsigned char __type ; } ;
  6531.  
  6532. template < >
  6533. struct __add_unsigned < short >
  6534. { typedef unsigned short __type ; } ;
  6535.  
  6536. template < >
  6537. struct __add_unsigned < int >
  6538. { typedef unsigned int __type ; } ;
  6539.  
  6540. template < >
  6541. struct __add_unsigned < long >
  6542. { typedef unsigned long __type ; } ;
  6543.  
  6544. template < >
  6545. struct __add_unsigned < long long >
  6546. { typedef unsigned long long __type ; } ;
  6547.  
  6548.  
  6549. template < >
  6550. struct __add_unsigned < bool > ;
  6551.  
  6552. template < >
  6553. struct __add_unsigned < wchar_t > ;
  6554.  
  6555.  
  6556.  
  6557. template < typename _Tp >
  6558. struct __remove_unsigned
  6559. {
  6560. private :
  6561. typedef __enable_if < std :: __is_integer < _Tp > :: __value , _Tp > __if_type ;
  6562.  
  6563. public :
  6564. typedef typename __if_type :: __type __type ;
  6565. } ;
  6566.  
  6567. template < >
  6568. struct __remove_unsigned < char >
  6569. { typedef signed char __type ; } ;
  6570.  
  6571. template < >
  6572. struct __remove_unsigned < unsigned char >
  6573. { typedef signed char __type ; } ;
  6574.  
  6575. template < >
  6576. struct __remove_unsigned < unsigned short >
  6577. { typedef short __type ; } ;
  6578.  
  6579. template < >
  6580. struct __remove_unsigned < unsigned int >
  6581. { typedef int __type ; } ;
  6582.  
  6583. template < >
  6584. struct __remove_unsigned < unsigned long >
  6585. { typedef long __type ; } ;
  6586.  
  6587. template < >
  6588. struct __remove_unsigned < unsigned long long >
  6589. { typedef long long __type ; } ;
  6590.  
  6591.  
  6592. template < >
  6593. struct __remove_unsigned < bool > ;
  6594.  
  6595. template < >
  6596. struct __remove_unsigned < wchar_t > ;
  6597.  
  6598.  
  6599.  
  6600. template < typename _Type >
  6601. inline bool
  6602. __is_null_pointer ( _Type * __ptr )
  6603. { return __ptr == 0 ; }
  6604.  
  6605. template < typename _Type >
  6606. inline bool
  6607. __is_null_pointer ( _Type )
  6608. { return false ; }
  6609.  
  6610.  
  6611.  
  6612. template < typename _Tp , bool = std :: __is_integer < _Tp > :: __value >
  6613. struct __promote
  6614. { typedef double __type ; } ;
  6615.  
  6616.  
  6617.  
  6618.  
  6619. template < typename _Tp >
  6620. struct __promote < _Tp , false >
  6621. { } ;
  6622.  
  6623. template < >
  6624. struct __promote < long double >
  6625. { typedef long double __type ; } ;
  6626.  
  6627. template < >
  6628. struct __promote < double >
  6629. { typedef double __type ; } ;
  6630.  
  6631. template < >
  6632. struct __promote < float >
  6633. { typedef float __type ; } ;
  6634.  
  6635. template < typename _Tp , typename _Up ,
  6636. typename _Tp2 = typename __promote < _Tp > :: __type ,
  6637. typename _Up2 = typename __promote < _Up > :: __type >
  6638. struct __promote_2
  6639. {
  6640. typedef __typeof__ ( _Tp2 ( ) + _Up2 ( ) ) __type ;
  6641. } ;
  6642.  
  6643. template < typename _Tp , typename _Up , typename _Vp ,
  6644. typename _Tp2 = typename __promote < _Tp > :: __type ,
  6645. typename _Up2 = typename __promote < _Up > :: __type ,
  6646. typename _Vp2 = typename __promote < _Vp > :: __type >
  6647. struct __promote_3
  6648. {
  6649. typedef __typeof__ ( _Tp2 ( ) + _Up2 ( ) + _Vp2 ( ) ) __type ;
  6650. } ;
  6651.  
  6652. template < typename _Tp , typename _Up , typename _Vp , typename _Wp ,
  6653. typename _Tp2 = typename __promote < _Tp > :: __type ,
  6654. typename _Up2 = typename __promote < _Up > :: __type ,
  6655. typename _Vp2 = typename __promote < _Vp > :: __type ,
  6656. typename _Wp2 = typename __promote < _Wp > :: __type >
  6657. struct __promote_4
  6658. {
  6659. typedef __typeof__ ( _Tp2 ( ) + _Up2 ( ) + _Vp2 ( ) + _Wp2 ( ) ) __type ;
  6660. } ;
  6661.  
  6662.  
  6663. }
  6664. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/numeric_traits.h"
  6665. #32
  6666. #pragma GCC system_header
  6667. #37
  6668. namespace __gnu_cxx
  6669. {
  6670. #54
  6671. template < typename _Value >
  6672. struct __numeric_traits_integer
  6673. {
  6674.  
  6675. static const _Value __min = ( ( ( _Value ) ( - 1 ) < 0 ) ? ( _Value ) 1 << ( sizeof ( _Value ) * 8 - ( ( _Value ) ( - 1 )
  6676. #58
  6677. < 0 ) ) : ( _Value ) 0 ) ;
  6678. static const _Value __max = ( ( ( _Value ) ( - 1 ) < 0 ) ? ( ( ( ( ( _Value ) 1 << ( ( sizeof ( _Value ) * 8 - ( ( _Value
  6679. #59
  6680. ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( _Value ) 0 ) ;
  6681.  
  6682.  
  6683.  
  6684. static const bool __is_signed = ( ( _Value ) ( - 1 ) < 0 ) ;
  6685. static const int __digits = ( sizeof ( _Value ) * 8 - ( ( _Value ) ( - 1 ) < 0 ) ) ;
  6686. } ;
  6687.  
  6688. template < typename _Value >
  6689. const _Value __numeric_traits_integer < _Value > :: __min ;
  6690.  
  6691. template < typename _Value >
  6692. const _Value __numeric_traits_integer < _Value > :: __max ;
  6693.  
  6694. template < typename _Value >
  6695. const bool __numeric_traits_integer < _Value > :: __is_signed ;
  6696.  
  6697. template < typename _Value >
  6698. const int __numeric_traits_integer < _Value > :: __digits ;
  6699. #99
  6700. template < typename _Value >
  6701. struct __numeric_traits_floating
  6702. {
  6703.  
  6704. static const int __max_digits10 = ( 2 + ( std :: __are_same < _Value , float > :: __value ? 24 : std :: __are_same < _Value
  6705. #103
  6706. , double > :: __value ? 53 : 64 ) * 643L / 2136 ) ;
  6707.  
  6708.  
  6709. static const bool __is_signed = true ;
  6710. static const int __digits10 = ( std :: __are_same < _Value , float > :: __value ? 6 : std :: __are_same < _Value , double
  6711. #107
  6712. > :: __value ? 15 : 18 ) ;
  6713. static const int __max_exponent10 = ( std :: __are_same < _Value , float > :: __value ? 38 : std :: __are_same < _Value ,
  6714. #108
  6715. double > :: __value ? 308 : 4932 ) ;
  6716. } ;
  6717.  
  6718. template < typename _Value >
  6719. const int __numeric_traits_floating < _Value > :: __max_digits10 ;
  6720.  
  6721. template < typename _Value >
  6722. const bool __numeric_traits_floating < _Value > :: __is_signed ;
  6723.  
  6724. template < typename _Value >
  6725. const int __numeric_traits_floating < _Value > :: __digits10 ;
  6726.  
  6727. template < typename _Value >
  6728. const int __numeric_traits_floating < _Value > :: __max_exponent10 ;
  6729.  
  6730. template < typename _Value >
  6731. struct __numeric_traits
  6732. : public __conditional_type < std :: __is_integer < _Value > :: __value ,
  6733. __numeric_traits_integer < _Value > ,
  6734. __numeric_traits_floating < _Value > > :: __type
  6735. { } ;
  6736.  
  6737.  
  6738. }
  6739. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_iterator_base_types.h"
  6740. #62
  6741. #pragma GCC system_header
  6742. #70
  6743. namespace std
  6744. {
  6745. #89
  6746. struct input_iterator_tag { } ;
  6747.  
  6748.  
  6749. struct output_iterator_tag { } ;
  6750.  
  6751.  
  6752. struct forward_iterator_tag : public input_iterator_tag { } ;
  6753.  
  6754.  
  6755.  
  6756. struct bidirectional_iterator_tag : public forward_iterator_tag { } ;
  6757.  
  6758.  
  6759.  
  6760. struct random_access_iterator_tag : public bidirectional_iterator_tag { } ;
  6761. #116
  6762. template < typename _Category , typename _Tp , typename _Distance = ptrdiff_t ,
  6763. typename _Pointer = _Tp * , typename _Reference = _Tp & >
  6764. struct iterator
  6765. {
  6766.  
  6767. typedef _Category iterator_category ;
  6768.  
  6769. typedef _Tp value_type ;
  6770.  
  6771. typedef _Distance difference_type ;
  6772.  
  6773. typedef _Pointer pointer ;
  6774.  
  6775. typedef _Reference reference ;
  6776. } ;
  6777. #142
  6778. template < typename _Tp > class __has_iterator_category_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  6779. #142
  6780. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: iterator_category > * ) ; template < typename
  6781. #142
  6782. _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1 ; } ; template
  6783. #142
  6784. < typename _Tp > struct __has_iterator_category : integral_constant < bool , __has_iterator_category_helper < typename remove_cv
  6785. #142
  6786. < _Tp > :: type > :: value > { } ;
  6787.  
  6788. template < typename _Iterator ,
  6789. bool = __has_iterator_category < _Iterator > :: value >
  6790. struct __iterator_traits { } ;
  6791.  
  6792. template < typename _Iterator >
  6793. struct __iterator_traits < _Iterator , true >
  6794. {
  6795. typedef typename _Iterator :: iterator_category iterator_category ;
  6796. typedef typename _Iterator :: value_type value_type ;
  6797. typedef typename _Iterator :: difference_type difference_type ;
  6798. typedef typename _Iterator :: pointer pointer ;
  6799. typedef typename _Iterator :: reference reference ;
  6800. } ;
  6801.  
  6802. template < typename _Iterator >
  6803. struct iterator_traits
  6804. : public __iterator_traits < _Iterator > { } ;
  6805. #174
  6806. template < typename _Tp >
  6807. struct iterator_traits < _Tp * >
  6808. {
  6809. typedef random_access_iterator_tag iterator_category ;
  6810. typedef _Tp value_type ;
  6811. typedef ptrdiff_t difference_type ;
  6812. typedef _Tp * pointer ;
  6813. typedef _Tp & reference ;
  6814. } ;
  6815.  
  6816.  
  6817. template < typename _Tp >
  6818. struct iterator_traits < const _Tp * >
  6819. {
  6820. typedef random_access_iterator_tag iterator_category ;
  6821. typedef _Tp value_type ;
  6822. typedef ptrdiff_t difference_type ;
  6823. typedef const _Tp * pointer ;
  6824. typedef const _Tp & reference ;
  6825. } ;
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831. template < typename _Iter >
  6832. inline typename iterator_traits < _Iter > :: iterator_category
  6833. __iterator_category ( const _Iter & )
  6834. { return typename iterator_traits < _Iter > :: iterator_category ( ) ; }
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840. template < typename _Iterator , bool _HasBase >
  6841. struct _Iter_base
  6842. {
  6843. typedef _Iterator iterator_type ;
  6844. static iterator_type _S_base ( _Iterator __it )
  6845. { return __it ; }
  6846. } ;
  6847.  
  6848. template < typename _Iterator >
  6849. struct _Iter_base < _Iterator , true >
  6850. {
  6851. typedef typename _Iterator :: iterator_type iterator_type ;
  6852. static iterator_type _S_base ( _Iterator __it )
  6853. { return __it . base ( ) ; }
  6854. } ;
  6855.  
  6856.  
  6857. template < typename _InIter >
  6858. using _RequireInputIter = typename
  6859. enable_if < is_convertible < typename
  6860. iterator_traits < _InIter > :: iterator_category ,
  6861. input_iterator_tag > :: value > :: type ;
  6862.  
  6863.  
  6864.  
  6865. }
  6866. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_iterator_base_funcs.h"
  6867. #62
  6868. #pragma GCC system_header
  6869. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/debug/debug.h"
  6870. #46
  6871. namespace std
  6872. {
  6873. namespace __debug { }
  6874. }
  6875.  
  6876.  
  6877.  
  6878.  
  6879. namespace __gnu_debug
  6880. {
  6881. using namespace std :: __debug ;
  6882. }
  6883. #67 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_iterator_base_funcs.h"
  6884. namespace std
  6885. {
  6886.  
  6887.  
  6888. template < typename _InputIterator >
  6889. inline typename iterator_traits < _InputIterator > :: difference_type
  6890. __distance ( _InputIterator __first , _InputIterator __last ,
  6891. input_iterator_tag )
  6892. {
  6893.  
  6894.  
  6895.  
  6896. typename iterator_traits < _InputIterator > :: difference_type __n = 0 ;
  6897. while ( __first != __last )
  6898. {
  6899. ++ __first ;
  6900. ++ __n ;
  6901. }
  6902. return __n ;
  6903. }
  6904.  
  6905. template < typename _RandomAccessIterator >
  6906. inline typename iterator_traits < _RandomAccessIterator > :: difference_type
  6907. __distance ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  6908. random_access_iterator_tag )
  6909. {
  6910.  
  6911.  
  6912.  
  6913. return __last - __first ;
  6914. }
  6915. #112
  6916. template < typename _InputIterator >
  6917. inline typename iterator_traits < _InputIterator > :: difference_type
  6918. distance ( _InputIterator __first , _InputIterator __last )
  6919. {
  6920.  
  6921. return std :: __distance ( __first , __last ,
  6922. std :: __iterator_category ( __first ) ) ;
  6923. }
  6924.  
  6925. template < typename _InputIterator , typename _Distance >
  6926. inline void
  6927. __advance ( _InputIterator & __i , _Distance __n , input_iterator_tag )
  6928. {
  6929.  
  6930.  
  6931. ;
  6932. while ( __n -- )
  6933. ++ __i ;
  6934. }
  6935.  
  6936. template < typename _BidirectionalIterator , typename _Distance >
  6937. inline void
  6938. __advance ( _BidirectionalIterator & __i , _Distance __n ,
  6939. bidirectional_iterator_tag )
  6940. {
  6941.  
  6942.  
  6943.  
  6944. if ( __n > 0 )
  6945. while ( __n -- )
  6946. ++ __i ;
  6947. else
  6948. while ( __n ++ )
  6949. -- __i ;
  6950. }
  6951.  
  6952. template < typename _RandomAccessIterator , typename _Distance >
  6953. inline void
  6954. __advance ( _RandomAccessIterator & __i , _Distance __n ,
  6955. random_access_iterator_tag )
  6956. {
  6957.  
  6958.  
  6959.  
  6960. __i += __n ;
  6961. }
  6962. #171
  6963. template < typename _InputIterator , typename _Distance >
  6964. inline void
  6965. advance ( _InputIterator & __i , _Distance __n )
  6966. {
  6967.  
  6968. typename iterator_traits < _InputIterator > :: difference_type __d = __n ;
  6969. std :: __advance ( __i , __d , std :: __iterator_category ( __i ) ) ;
  6970. }
  6971.  
  6972.  
  6973.  
  6974. template < typename _ForwardIterator >
  6975. inline _ForwardIterator
  6976. next ( _ForwardIterator __x , typename
  6977. iterator_traits < _ForwardIterator > :: difference_type __n = 1 )
  6978. {
  6979. std :: advance ( __x , __n ) ;
  6980. return __x ;
  6981. }
  6982.  
  6983. template < typename _BidirectionalIterator >
  6984. inline _BidirectionalIterator
  6985. prev ( _BidirectionalIterator __x , typename
  6986. iterator_traits < _BidirectionalIterator > :: difference_type __n = 1 )
  6987. {
  6988. std :: advance ( __x , - __n ) ;
  6989. return __x ;
  6990. }
  6991.  
  6992.  
  6993.  
  6994.  
  6995. }
  6996. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_iterator.h"
  6997. #67
  6998. namespace std
  6999. {
  7000. #95
  7001. template < typename _Iterator >
  7002. class reverse_iterator
  7003. : public iterator < typename iterator_traits < _Iterator > :: iterator_category ,
  7004. typename iterator_traits < _Iterator > :: value_type ,
  7005. typename iterator_traits < _Iterator > :: difference_type ,
  7006. typename iterator_traits < _Iterator > :: pointer ,
  7007. typename iterator_traits < _Iterator > :: reference >
  7008. {
  7009. protected :
  7010. _Iterator current ;
  7011.  
  7012. typedef iterator_traits < _Iterator > __traits_type ;
  7013.  
  7014. public :
  7015. typedef _Iterator iterator_type ;
  7016. typedef typename __traits_type :: difference_type difference_type ;
  7017. typedef typename __traits_type :: pointer pointer ;
  7018. typedef typename __traits_type :: reference reference ;
  7019. #120
  7020. reverse_iterator ( ) : current ( ) { }
  7021.  
  7022.  
  7023.  
  7024.  
  7025. explicit
  7026. reverse_iterator ( iterator_type __x ) : current ( __x ) { }
  7027.  
  7028.  
  7029.  
  7030.  
  7031. reverse_iterator ( const reverse_iterator & __x )
  7032. : current ( __x . current ) { }
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038. template < typename _Iter >
  7039. reverse_iterator ( const reverse_iterator < _Iter > & __x )
  7040. : current ( __x . base ( ) ) { }
  7041.  
  7042.  
  7043.  
  7044.  
  7045. iterator_type
  7046. base ( ) const
  7047. { return current ; }
  7048. #159
  7049. reference
  7050. operator * ( ) const
  7051. {
  7052. _Iterator __tmp = current ;
  7053. return * -- __tmp ;
  7054. }
  7055. #171
  7056. pointer
  7057. operator -> ( ) const
  7058. { return & ( operator * ( ) ) ; }
  7059. #180
  7060. reverse_iterator &
  7061. operator ++ ( )
  7062. {
  7063. -- current ;
  7064. return * this ;
  7065. }
  7066. #192
  7067. reverse_iterator
  7068. operator ++ ( int )
  7069. {
  7070. reverse_iterator __tmp = * this ;
  7071. -- current ;
  7072. return __tmp ;
  7073. }
  7074. #205
  7075. reverse_iterator &
  7076. operator -- ( )
  7077. {
  7078. ++ current ;
  7079. return * this ;
  7080. }
  7081. #217
  7082. reverse_iterator
  7083. operator -- ( int )
  7084. {
  7085. reverse_iterator __tmp = * this ;
  7086. ++ current ;
  7087. return __tmp ;
  7088. }
  7089. #230
  7090. reverse_iterator
  7091. operator + ( difference_type __n ) const
  7092. { return reverse_iterator ( current - __n ) ; }
  7093. #240
  7094. reverse_iterator &
  7095. operator += ( difference_type __n )
  7096. {
  7097. current -= __n ;
  7098. return * this ;
  7099. }
  7100. #252
  7101. reverse_iterator
  7102. operator - ( difference_type __n ) const
  7103. { return reverse_iterator ( current + __n ) ; }
  7104. #262
  7105. reverse_iterator &
  7106. operator -= ( difference_type __n )
  7107. {
  7108. current += __n ;
  7109. return * this ;
  7110. }
  7111. #274
  7112. reference
  7113. operator [ ] ( difference_type __n ) const
  7114. { return * ( * this + __n ) ; }
  7115. } ;
  7116. #289
  7117. template < typename _Iterator >
  7118. inline bool
  7119. operator == ( const reverse_iterator < _Iterator > & __x ,
  7120. const reverse_iterator < _Iterator > & __y )
  7121. { return __x . base ( ) == __y . base ( ) ; }
  7122.  
  7123. template < typename _Iterator >
  7124. inline bool
  7125. operator < ( const reverse_iterator < _Iterator > & __x ,
  7126. const reverse_iterator < _Iterator > & __y )
  7127. { return __y . base ( ) < __x . base ( ) ; }
  7128.  
  7129. template < typename _Iterator >
  7130. inline bool
  7131. operator != ( const reverse_iterator < _Iterator > & __x ,
  7132. const reverse_iterator < _Iterator > & __y )
  7133. { return ! ( __x == __y ) ; }
  7134.  
  7135. template < typename _Iterator >
  7136. inline bool
  7137. operator > ( const reverse_iterator < _Iterator > & __x ,
  7138. const reverse_iterator < _Iterator > & __y )
  7139. { return __y < __x ; }
  7140.  
  7141. template < typename _Iterator >
  7142. inline bool
  7143. operator <= ( const reverse_iterator < _Iterator > & __x ,
  7144. const reverse_iterator < _Iterator > & __y )
  7145. { return ! ( __y < __x ) ; }
  7146.  
  7147. template < typename _Iterator >
  7148. inline bool
  7149. operator >= ( const reverse_iterator < _Iterator > & __x ,
  7150. const reverse_iterator < _Iterator > & __y )
  7151. { return ! ( __x < __y ) ; }
  7152.  
  7153. template < typename _Iterator >
  7154. inline typename reverse_iterator < _Iterator > :: difference_type
  7155. operator - ( const reverse_iterator < _Iterator > & __x ,
  7156. const reverse_iterator < _Iterator > & __y )
  7157. { return __y . base ( ) - __x . base ( ) ; }
  7158.  
  7159. template < typename _Iterator >
  7160. inline reverse_iterator < _Iterator >
  7161. operator + ( typename reverse_iterator < _Iterator > :: difference_type __n ,
  7162. const reverse_iterator < _Iterator > & __x )
  7163. { return reverse_iterator < _Iterator > ( __x . base ( ) - __n ) ; }
  7164.  
  7165.  
  7166.  
  7167. template < typename _IteratorL , typename _IteratorR >
  7168. inline bool
  7169. operator == ( const reverse_iterator < _IteratorL > & __x ,
  7170. const reverse_iterator < _IteratorR > & __y )
  7171. { return __x . base ( ) == __y . base ( ) ; }
  7172.  
  7173. template < typename _IteratorL , typename _IteratorR >
  7174. inline bool
  7175. operator < ( const reverse_iterator < _IteratorL > & __x ,
  7176. const reverse_iterator < _IteratorR > & __y )
  7177. { return __y . base ( ) < __x . base ( ) ; }
  7178.  
  7179. template < typename _IteratorL , typename _IteratorR >
  7180. inline bool
  7181. operator != ( const reverse_iterator < _IteratorL > & __x ,
  7182. const reverse_iterator < _IteratorR > & __y )
  7183. { return ! ( __x == __y ) ; }
  7184.  
  7185. template < typename _IteratorL , typename _IteratorR >
  7186. inline bool
  7187. operator > ( const reverse_iterator < _IteratorL > & __x ,
  7188. const reverse_iterator < _IteratorR > & __y )
  7189. { return __y < __x ; }
  7190.  
  7191. template < typename _IteratorL , typename _IteratorR >
  7192. inline bool
  7193. operator <= ( const reverse_iterator < _IteratorL > & __x ,
  7194. const reverse_iterator < _IteratorR > & __y )
  7195. { return ! ( __y < __x ) ; }
  7196.  
  7197. template < typename _IteratorL , typename _IteratorR >
  7198. inline bool
  7199. operator >= ( const reverse_iterator < _IteratorL > & __x ,
  7200. const reverse_iterator < _IteratorR > & __y )
  7201. { return ! ( __x < __y ) ; }
  7202.  
  7203. template < typename _IteratorL , typename _IteratorR >
  7204.  
  7205.  
  7206. inline auto
  7207. operator - ( const reverse_iterator < _IteratorL > & __x ,
  7208. const reverse_iterator < _IteratorR > & __y )
  7209. -> decltype ( __y . base ( ) - __x . base ( ) )
  7210.  
  7211.  
  7212.  
  7213.  
  7214.  
  7215. { return __y . base ( ) - __x . base ( ) ; }
  7216. #401
  7217. template < typename _Container >
  7218. class back_insert_iterator
  7219. : public iterator < output_iterator_tag , void , void , void , void >
  7220. {
  7221. protected :
  7222. _Container * container ;
  7223.  
  7224. public :
  7225.  
  7226. typedef _Container container_type ;
  7227.  
  7228.  
  7229. explicit
  7230. back_insert_iterator ( _Container & __x ) : container ( & __x ) { }
  7231. #435
  7232. back_insert_iterator &
  7233. operator = ( const typename _Container :: value_type & __value )
  7234. {
  7235. container -> push_back ( __value ) ;
  7236. return * this ;
  7237. }
  7238.  
  7239. back_insert_iterator &
  7240. operator = ( typename _Container :: value_type && __value )
  7241. {
  7242. container -> push_back ( std :: move ( __value ) ) ;
  7243. return * this ;
  7244. }
  7245.  
  7246.  
  7247.  
  7248. back_insert_iterator &
  7249. operator * ( )
  7250. { return * this ; }
  7251.  
  7252.  
  7253. back_insert_iterator &
  7254. operator ++ ( )
  7255. { return * this ; }
  7256.  
  7257.  
  7258. back_insert_iterator
  7259. operator ++ ( int )
  7260. { return * this ; }
  7261. } ;
  7262. #477
  7263. template < typename _Container >
  7264. inline back_insert_iterator < _Container >
  7265. back_inserter ( _Container & __x )
  7266. { return back_insert_iterator < _Container > ( __x ) ; }
  7267. #492
  7268. template < typename _Container >
  7269. class front_insert_iterator
  7270. : public iterator < output_iterator_tag , void , void , void , void >
  7271. {
  7272. protected :
  7273. _Container * container ;
  7274.  
  7275. public :
  7276.  
  7277. typedef _Container container_type ;
  7278.  
  7279.  
  7280. explicit front_insert_iterator ( _Container & __x ) : container ( & __x ) { }
  7281. #525
  7282. front_insert_iterator &
  7283. operator = ( const typename _Container :: value_type & __value )
  7284. {
  7285. container -> push_front ( __value ) ;
  7286. return * this ;
  7287. }
  7288.  
  7289. front_insert_iterator &
  7290. operator = ( typename _Container :: value_type && __value )
  7291. {
  7292. container -> push_front ( std :: move ( __value ) ) ;
  7293. return * this ;
  7294. }
  7295.  
  7296.  
  7297.  
  7298. front_insert_iterator &
  7299. operator * ( )
  7300. { return * this ; }
  7301.  
  7302.  
  7303. front_insert_iterator &
  7304. operator ++ ( )
  7305. { return * this ; }
  7306.  
  7307.  
  7308. front_insert_iterator
  7309. operator ++ ( int )
  7310. { return * this ; }
  7311. } ;
  7312. #567
  7313. template < typename _Container >
  7314. inline front_insert_iterator < _Container >
  7315. front_inserter ( _Container & __x )
  7316. { return front_insert_iterator < _Container > ( __x ) ; }
  7317. #586
  7318. template < typename _Container >
  7319. class insert_iterator
  7320. : public iterator < output_iterator_tag , void , void , void , void >
  7321. {
  7322. protected :
  7323. _Container * container ;
  7324. typename _Container :: iterator iter ;
  7325.  
  7326. public :
  7327.  
  7328. typedef _Container container_type ;
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334. insert_iterator ( _Container & __x , typename _Container :: iterator __i )
  7335. : container ( & __x ) , iter ( __i ) { }
  7336. #637
  7337. insert_iterator &
  7338. operator = ( const typename _Container :: value_type & __value )
  7339. {
  7340. iter = container -> insert ( iter , __value ) ;
  7341. ++ iter ;
  7342. return * this ;
  7343. }
  7344.  
  7345. insert_iterator &
  7346. operator = ( typename _Container :: value_type && __value )
  7347. {
  7348. iter = container -> insert ( iter , std :: move ( __value ) ) ;
  7349. ++ iter ;
  7350. return * this ;
  7351. }
  7352.  
  7353.  
  7354.  
  7355. insert_iterator &
  7356. operator * ( )
  7357. { return * this ; }
  7358.  
  7359.  
  7360. insert_iterator &
  7361. operator ++ ( )
  7362. { return * this ; }
  7363.  
  7364.  
  7365. insert_iterator &
  7366. operator ++ ( int )
  7367. { return * this ; }
  7368. } ;
  7369. #681
  7370. template < typename _Container , typename _Iterator >
  7371. inline insert_iterator < _Container >
  7372. inserter ( _Container & __x , _Iterator __i )
  7373. {
  7374. return insert_iterator < _Container > ( __x ,
  7375. typename _Container :: iterator ( __i ) ) ;
  7376. }
  7377.  
  7378.  
  7379.  
  7380.  
  7381. }
  7382.  
  7383. namespace __gnu_cxx
  7384. {
  7385. #705
  7386. using std :: iterator_traits ;
  7387. using std :: iterator ;
  7388. template < typename _Iterator , typename _Container >
  7389. class __normal_iterator
  7390. {
  7391. protected :
  7392. _Iterator _M_current ;
  7393.  
  7394. typedef iterator_traits < _Iterator > __traits_type ;
  7395.  
  7396. public :
  7397. typedef _Iterator iterator_type ;
  7398. typedef typename __traits_type :: iterator_category iterator_category ;
  7399. typedef typename __traits_type :: value_type value_type ;
  7400. typedef typename __traits_type :: difference_type difference_type ;
  7401. typedef typename __traits_type :: reference reference ;
  7402. typedef typename __traits_type :: pointer pointer ;
  7403.  
  7404. constexpr __normal_iterator ( ) : _M_current ( _Iterator ( ) ) { }
  7405.  
  7406. explicit
  7407. __normal_iterator ( const _Iterator & __i ) : _M_current ( __i ) { }
  7408.  
  7409.  
  7410. template < typename _Iter >
  7411. __normal_iterator ( const __normal_iterator < _Iter ,
  7412. typename __enable_if <
  7413. ( std :: __are_same < _Iter , typename _Container :: pointer > :: __value ) ,
  7414. _Container > :: __type > & __i )
  7415. : _M_current ( __i . base ( ) ) { }
  7416.  
  7417.  
  7418. reference
  7419. operator * ( ) const
  7420. { return * _M_current ; }
  7421.  
  7422. pointer
  7423. operator -> ( ) const
  7424. { return _M_current ; }
  7425.  
  7426. __normal_iterator &
  7427. operator ++ ( )
  7428. {
  7429. ++ _M_current ;
  7430. return * this ;
  7431. }
  7432.  
  7433. __normal_iterator
  7434. operator ++ ( int )
  7435. { return __normal_iterator ( _M_current ++ ) ; }
  7436.  
  7437.  
  7438. __normal_iterator &
  7439. operator -- ( )
  7440. {
  7441. -- _M_current ;
  7442. return * this ;
  7443. }
  7444.  
  7445. __normal_iterator
  7446. operator -- ( int )
  7447. { return __normal_iterator ( _M_current -- ) ; }
  7448.  
  7449.  
  7450. reference
  7451. operator [ ] ( const difference_type & __n ) const
  7452. { return _M_current [ __n ] ; }
  7453.  
  7454. __normal_iterator &
  7455. operator += ( const difference_type & __n )
  7456. { _M_current += __n ; return * this ; }
  7457.  
  7458. __normal_iterator
  7459. operator + ( const difference_type & __n ) const
  7460. { return __normal_iterator ( _M_current + __n ) ; }
  7461.  
  7462. __normal_iterator &
  7463. operator -= ( const difference_type & __n )
  7464. { _M_current -= __n ; return * this ; }
  7465.  
  7466. __normal_iterator
  7467. operator - ( const difference_type & __n ) const
  7468. { return __normal_iterator ( _M_current - __n ) ; }
  7469.  
  7470. const _Iterator &
  7471. base ( ) const
  7472. { return _M_current ; }
  7473. } ;
  7474. #803
  7475. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7476. inline bool
  7477. operator == ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7478. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7479. { return __lhs . base ( ) == __rhs . base ( ) ; }
  7480.  
  7481. template < typename _Iterator , typename _Container >
  7482. inline bool
  7483. operator == ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7484. const __normal_iterator < _Iterator , _Container > & __rhs )
  7485. { return __lhs . base ( ) == __rhs . base ( ) ; }
  7486.  
  7487. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7488. inline bool
  7489. operator != ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7490. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7491. { return __lhs . base ( ) != __rhs . base ( ) ; }
  7492.  
  7493. template < typename _Iterator , typename _Container >
  7494. inline bool
  7495. operator != ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7496. const __normal_iterator < _Iterator , _Container > & __rhs )
  7497. { return __lhs . base ( ) != __rhs . base ( ) ; }
  7498.  
  7499.  
  7500. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7501. inline bool
  7502. operator < ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7503. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7504. { return __lhs . base ( ) < __rhs . base ( ) ; }
  7505.  
  7506. template < typename _Iterator , typename _Container >
  7507. inline bool
  7508. operator < ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7509. const __normal_iterator < _Iterator , _Container > & __rhs )
  7510. { return __lhs . base ( ) < __rhs . base ( ) ; }
  7511.  
  7512. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7513. inline bool
  7514. operator > ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7515. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7516. { return __lhs . base ( ) > __rhs . base ( ) ; }
  7517.  
  7518. template < typename _Iterator , typename _Container >
  7519. inline bool
  7520. operator > ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7521. const __normal_iterator < _Iterator , _Container > & __rhs )
  7522. { return __lhs . base ( ) > __rhs . base ( ) ; }
  7523.  
  7524. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7525. inline bool
  7526. operator <= ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7527. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7528. { return __lhs . base ( ) <= __rhs . base ( ) ; }
  7529.  
  7530. template < typename _Iterator , typename _Container >
  7531. inline bool
  7532. operator <= ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7533. const __normal_iterator < _Iterator , _Container > & __rhs )
  7534. { return __lhs . base ( ) <= __rhs . base ( ) ; }
  7535.  
  7536. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7537. inline bool
  7538. operator >= ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7539. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7540. { return __lhs . base ( ) >= __rhs . base ( ) ; }
  7541.  
  7542. template < typename _Iterator , typename _Container >
  7543. inline bool
  7544. operator >= ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7545. const __normal_iterator < _Iterator , _Container > & __rhs )
  7546. { return __lhs . base ( ) >= __rhs . base ( ) ; }
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552. template < typename _IteratorL , typename _IteratorR , typename _Container >
  7553.  
  7554.  
  7555. inline auto
  7556. operator - ( const __normal_iterator < _IteratorL , _Container > & __lhs ,
  7557. const __normal_iterator < _IteratorR , _Container > & __rhs )
  7558. -> decltype ( __lhs . base ( ) - __rhs . base ( ) )
  7559.  
  7560.  
  7561.  
  7562.  
  7563.  
  7564. { return __lhs . base ( ) - __rhs . base ( ) ; }
  7565.  
  7566. template < typename _Iterator , typename _Container >
  7567. inline typename __normal_iterator < _Iterator , _Container > :: difference_type
  7568. operator - ( const __normal_iterator < _Iterator , _Container > & __lhs ,
  7569. const __normal_iterator < _Iterator , _Container > & __rhs )
  7570. { return __lhs . base ( ) - __rhs . base ( ) ; }
  7571.  
  7572. template < typename _Iterator , typename _Container >
  7573. inline __normal_iterator < _Iterator , _Container >
  7574. operator + ( typename __normal_iterator < _Iterator , _Container > :: difference_type
  7575. __n , const __normal_iterator < _Iterator , _Container > & __i )
  7576. { return __normal_iterator < _Iterator , _Container > ( __i . base ( ) + __n ) ; }
  7577.  
  7578.  
  7579. }
  7580.  
  7581.  
  7582.  
  7583. namespace std
  7584. {
  7585. #929
  7586. template < typename _Iterator >
  7587. class move_iterator
  7588. {
  7589. protected :
  7590. _Iterator _M_current ;
  7591.  
  7592. typedef iterator_traits < _Iterator > __traits_type ;
  7593.  
  7594. public :
  7595. typedef _Iterator iterator_type ;
  7596. typedef typename __traits_type :: iterator_category iterator_category ;
  7597. typedef typename __traits_type :: value_type value_type ;
  7598. typedef typename __traits_type :: difference_type difference_type ;
  7599.  
  7600. typedef _Iterator pointer ;
  7601. typedef value_type && reference ;
  7602.  
  7603. move_iterator ( )
  7604. : _M_current ( ) { }
  7605.  
  7606. explicit
  7607. move_iterator ( iterator_type __i )
  7608. : _M_current ( __i ) { }
  7609.  
  7610. template < typename _Iter >
  7611. move_iterator ( const move_iterator < _Iter > & __i )
  7612. : _M_current ( __i . base ( ) ) { }
  7613.  
  7614. iterator_type
  7615. base ( ) const
  7616. { return _M_current ; }
  7617.  
  7618. reference
  7619. operator * ( ) const
  7620. { return std :: move ( * _M_current ) ; }
  7621.  
  7622. pointer
  7623. operator -> ( ) const
  7624. { return _M_current ; }
  7625.  
  7626. move_iterator &
  7627. operator ++ ( )
  7628. {
  7629. ++ _M_current ;
  7630. return * this ;
  7631. }
  7632.  
  7633. move_iterator
  7634. operator ++ ( int )
  7635. {
  7636. move_iterator __tmp = * this ;
  7637. ++ _M_current ;
  7638. return __tmp ;
  7639. }
  7640.  
  7641. move_iterator &
  7642. operator -- ( )
  7643. {
  7644. -- _M_current ;
  7645. return * this ;
  7646. }
  7647.  
  7648. move_iterator
  7649. operator -- ( int )
  7650. {
  7651. move_iterator __tmp = * this ;
  7652. -- _M_current ;
  7653. return __tmp ;
  7654. }
  7655.  
  7656. move_iterator
  7657. operator + ( difference_type __n ) const
  7658. { return move_iterator ( _M_current + __n ) ; }
  7659.  
  7660. move_iterator &
  7661. operator += ( difference_type __n )
  7662. {
  7663. _M_current += __n ;
  7664. return * this ;
  7665. }
  7666.  
  7667. move_iterator
  7668. operator - ( difference_type __n ) const
  7669. { return move_iterator ( _M_current - __n ) ; }
  7670.  
  7671. move_iterator &
  7672. operator -= ( difference_type __n )
  7673. {
  7674. _M_current -= __n ;
  7675. return * this ;
  7676. }
  7677.  
  7678. reference
  7679. operator [ ] ( difference_type __n ) const
  7680. { return std :: move ( _M_current [ __n ] ) ; }
  7681. } ;
  7682.  
  7683.  
  7684.  
  7685.  
  7686. template < typename _IteratorL , typename _IteratorR >
  7687. inline bool
  7688. operator == ( const move_iterator < _IteratorL > & __x ,
  7689. const move_iterator < _IteratorR > & __y )
  7690. { return __x . base ( ) == __y . base ( ) ; }
  7691.  
  7692. template < typename _Iterator >
  7693. inline bool
  7694. operator == ( const move_iterator < _Iterator > & __x ,
  7695. const move_iterator < _Iterator > & __y )
  7696. { return __x . base ( ) == __y . base ( ) ; }
  7697.  
  7698. template < typename _IteratorL , typename _IteratorR >
  7699. inline bool
  7700. operator != ( const move_iterator < _IteratorL > & __x ,
  7701. const move_iterator < _IteratorR > & __y )
  7702. { return ! ( __x == __y ) ; }
  7703.  
  7704. template < typename _Iterator >
  7705. inline bool
  7706. operator != ( const move_iterator < _Iterator > & __x ,
  7707. const move_iterator < _Iterator > & __y )
  7708. { return ! ( __x == __y ) ; }
  7709.  
  7710. template < typename _IteratorL , typename _IteratorR >
  7711. inline bool
  7712. operator < ( const move_iterator < _IteratorL > & __x ,
  7713. const move_iterator < _IteratorR > & __y )
  7714. { return __x . base ( ) < __y . base ( ) ; }
  7715.  
  7716. template < typename _Iterator >
  7717. inline bool
  7718. operator < ( const move_iterator < _Iterator > & __x ,
  7719. const move_iterator < _Iterator > & __y )
  7720. { return __x . base ( ) < __y . base ( ) ; }
  7721.  
  7722. template < typename _IteratorL , typename _IteratorR >
  7723. inline bool
  7724. operator <= ( const move_iterator < _IteratorL > & __x ,
  7725. const move_iterator < _IteratorR > & __y )
  7726. { return ! ( __y < __x ) ; }
  7727.  
  7728. template < typename _Iterator >
  7729. inline bool
  7730. operator <= ( const move_iterator < _Iterator > & __x ,
  7731. const move_iterator < _Iterator > & __y )
  7732. { return ! ( __y < __x ) ; }
  7733.  
  7734. template < typename _IteratorL , typename _IteratorR >
  7735. inline bool
  7736. operator > ( const move_iterator < _IteratorL > & __x ,
  7737. const move_iterator < _IteratorR > & __y )
  7738. { return __y < __x ; }
  7739.  
  7740. template < typename _Iterator >
  7741. inline bool
  7742. operator > ( const move_iterator < _Iterator > & __x ,
  7743. const move_iterator < _Iterator > & __y )
  7744. { return __y < __x ; }
  7745.  
  7746. template < typename _IteratorL , typename _IteratorR >
  7747. inline bool
  7748. operator >= ( const move_iterator < _IteratorL > & __x ,
  7749. const move_iterator < _IteratorR > & __y )
  7750. { return ! ( __x < __y ) ; }
  7751.  
  7752. template < typename _Iterator >
  7753. inline bool
  7754. operator >= ( const move_iterator < _Iterator > & __x ,
  7755. const move_iterator < _Iterator > & __y )
  7756. { return ! ( __x < __y ) ; }
  7757.  
  7758.  
  7759. template < typename _IteratorL , typename _IteratorR >
  7760. inline auto
  7761. operator - ( const move_iterator < _IteratorL > & __x ,
  7762. const move_iterator < _IteratorR > & __y )
  7763. -> decltype ( __x . base ( ) - __y . base ( ) )
  7764. { return __x . base ( ) - __y . base ( ) ; }
  7765.  
  7766. template < typename _Iterator >
  7767. inline auto
  7768. operator - ( const move_iterator < _Iterator > & __x ,
  7769. const move_iterator < _Iterator > & __y )
  7770. -> decltype ( __x . base ( ) - __y . base ( ) )
  7771. { return __x . base ( ) - __y . base ( ) ; }
  7772.  
  7773. template < typename _Iterator >
  7774. inline move_iterator < _Iterator >
  7775. operator + ( typename move_iterator < _Iterator > :: difference_type __n ,
  7776. const move_iterator < _Iterator > & __x )
  7777. { return __x + __n ; }
  7778.  
  7779. template < typename _Iterator >
  7780. inline move_iterator < _Iterator >
  7781. make_move_iterator ( _Iterator __i )
  7782. { return move_iterator < _Iterator > ( __i ) ; }
  7783.  
  7784. template < typename _Iterator , typename _ReturnType
  7785. = typename conditional < __move_if_noexcept_cond
  7786. < typename iterator_traits < _Iterator > :: value_type > :: value ,
  7787. _Iterator , move_iterator < _Iterator >> :: type >
  7788. inline _ReturnType
  7789. __make_move_if_noexcept_iterator ( _Iterator __i )
  7790. { return _ReturnType ( __i ) ; }
  7791.  
  7792.  
  7793.  
  7794.  
  7795. }
  7796. #72 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_algobase.h"
  7797. namespace std
  7798. {
  7799. #117
  7800. template < typename _ForwardIterator1 , typename _ForwardIterator2 >
  7801. inline void
  7802. iter_swap ( _ForwardIterator1 __a , _ForwardIterator2 __b )
  7803. {
  7804. #147
  7805. swap ( * __a , * __b ) ;
  7806.  
  7807. }
  7808. #163
  7809. template < typename _ForwardIterator1 , typename _ForwardIterator2 >
  7810. _ForwardIterator2
  7811. swap_ranges ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  7812. _ForwardIterator2 __first2 )
  7813. {
  7814.  
  7815.  
  7816.  
  7817.  
  7818.  
  7819. ;
  7820.  
  7821. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  7822. std :: iter_swap ( __first1 , __first2 ) ;
  7823. return __first2 ;
  7824. }
  7825. #191
  7826. template < typename _Tp >
  7827. inline const _Tp &
  7828. min ( const _Tp & __a , const _Tp & __b )
  7829. {
  7830.  
  7831.  
  7832.  
  7833. if ( __b < __a )
  7834. return __b ;
  7835. return __a ;
  7836. }
  7837. #214
  7838. template < typename _Tp >
  7839. inline const _Tp &
  7840. max ( const _Tp & __a , const _Tp & __b )
  7841. {
  7842.  
  7843.  
  7844.  
  7845. if ( __a < __b )
  7846. return __b ;
  7847. return __a ;
  7848. }
  7849. #237
  7850. template < typename _Tp , typename _Compare >
  7851. inline const _Tp &
  7852. min ( const _Tp & __a , const _Tp & __b , _Compare __comp )
  7853. {
  7854.  
  7855. if ( __comp ( __b , __a ) )
  7856. return __b ;
  7857. return __a ;
  7858. }
  7859. #258
  7860. template < typename _Tp , typename _Compare >
  7861. inline const _Tp &
  7862. max ( const _Tp & __a , const _Tp & __b , _Compare __comp )
  7863. {
  7864.  
  7865. if ( __comp ( __a , __b ) )
  7866. return __b ;
  7867. return __a ;
  7868. }
  7869.  
  7870.  
  7871.  
  7872. template < typename _Iterator >
  7873. struct _Niter_base
  7874. : _Iter_base < _Iterator , __is_normal_iterator < _Iterator > :: __value >
  7875. { } ;
  7876.  
  7877. template < typename _Iterator >
  7878. inline typename _Niter_base < _Iterator > :: iterator_type
  7879. __niter_base ( _Iterator __it )
  7880. { return std :: _Niter_base < _Iterator > :: _S_base ( __it ) ; }
  7881.  
  7882.  
  7883. template < typename _Iterator >
  7884. struct _Miter_base
  7885. : _Iter_base < _Iterator , __is_move_iterator < _Iterator > :: __value >
  7886. { } ;
  7887.  
  7888. template < typename _Iterator >
  7889. inline typename _Miter_base < _Iterator > :: iterator_type
  7890. __miter_base ( _Iterator __it )
  7891. { return std :: _Miter_base < _Iterator > :: _S_base ( __it ) ; }
  7892. #297
  7893. template < bool , bool , typename >
  7894. struct __copy_move
  7895. {
  7896. template < typename _II , typename _OI >
  7897. static _OI
  7898. __copy_m ( _II __first , _II __last , _OI __result )
  7899. {
  7900. for ( ; __first != __last ; ++ __result , ++ __first )
  7901. * __result = * __first ;
  7902. return __result ;
  7903. }
  7904. } ;
  7905.  
  7906.  
  7907. template < typename _Category >
  7908. struct __copy_move < true , false , _Category >
  7909. {
  7910. template < typename _II , typename _OI >
  7911. static _OI
  7912. __copy_m ( _II __first , _II __last , _OI __result )
  7913. {
  7914. for ( ; __first != __last ; ++ __result , ++ __first )
  7915. * __result = std :: move ( * __first ) ;
  7916. return __result ;
  7917. }
  7918. } ;
  7919.  
  7920.  
  7921. template < >
  7922. struct __copy_move < false , false , random_access_iterator_tag >
  7923. {
  7924. template < typename _II , typename _OI >
  7925. static _OI
  7926. __copy_m ( _II __first , _II __last , _OI __result )
  7927. {
  7928. typedef typename iterator_traits < _II > :: difference_type _Distance ;
  7929. for ( _Distance __n = __last - __first ; __n > 0 ; -- __n )
  7930. {
  7931. * __result = * __first ;
  7932. ++ __first ;
  7933. ++ __result ;
  7934. }
  7935. return __result ;
  7936. }
  7937. } ;
  7938.  
  7939.  
  7940. template < >
  7941. struct __copy_move < true , false , random_access_iterator_tag >
  7942. {
  7943. template < typename _II , typename _OI >
  7944. static _OI
  7945. __copy_m ( _II __first , _II __last , _OI __result )
  7946. {
  7947. typedef typename iterator_traits < _II > :: difference_type _Distance ;
  7948. for ( _Distance __n = __last - __first ; __n > 0 ; -- __n )
  7949. {
  7950. * __result = std :: move ( * __first ) ;
  7951. ++ __first ;
  7952. ++ __result ;
  7953. }
  7954. return __result ;
  7955. }
  7956. } ;
  7957.  
  7958.  
  7959. template < bool _IsMove >
  7960. struct __copy_move < _IsMove , true , random_access_iterator_tag >
  7961. {
  7962. template < typename _Tp >
  7963. static _Tp *
  7964. __copy_m ( const _Tp * __first , const _Tp * __last , _Tp * __result )
  7965. {
  7966. const ptrdiff_t _Num = __last - __first ;
  7967. if ( _Num )
  7968. __builtin_memmove ( __result , __first , sizeof ( _Tp ) * _Num ) ;
  7969. return __result + _Num ;
  7970. }
  7971. } ;
  7972.  
  7973. template < bool _IsMove , typename _II , typename _OI >
  7974. inline _OI
  7975. __copy_move_a ( _II __first , _II __last , _OI __result )
  7976. {
  7977. typedef typename iterator_traits < _II > :: value_type _ValueTypeI ;
  7978. typedef typename iterator_traits < _OI > :: value_type _ValueTypeO ;
  7979. typedef typename iterator_traits < _II > :: iterator_category _Category ;
  7980. const bool __simple = ( __oracle_is_trivial ( _ValueTypeI )
  7981. && __is_pointer < _II > :: __value
  7982. && __is_pointer < _OI > :: __value
  7983. && __are_same < _ValueTypeI , _ValueTypeO > :: __value ) ;
  7984.  
  7985. return std :: __copy_move < _IsMove , __simple ,
  7986. _Category > :: __copy_m ( __first , __last , __result ) ;
  7987. }
  7988.  
  7989.  
  7990.  
  7991. template < typename _CharT >
  7992. struct char_traits ;
  7993.  
  7994. template < typename _CharT , typename _Traits >
  7995. class istreambuf_iterator ;
  7996.  
  7997. template < typename _CharT , typename _Traits >
  7998. class ostreambuf_iterator ;
  7999.  
  8000. template < bool _IsMove , typename _CharT >
  8001. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  8002. ostreambuf_iterator < _CharT , char_traits < _CharT > > > :: __type
  8003. __copy_move_a2 ( _CharT * , _CharT * ,
  8004. ostreambuf_iterator < _CharT , char_traits < _CharT > > ) ;
  8005.  
  8006. template < bool _IsMove , typename _CharT >
  8007. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  8008. ostreambuf_iterator < _CharT , char_traits < _CharT > > > :: __type
  8009. __copy_move_a2 ( const _CharT * , const _CharT * ,
  8010. ostreambuf_iterator < _CharT , char_traits < _CharT > > ) ;
  8011.  
  8012. template < bool _IsMove , typename _CharT >
  8013. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  8014. _CharT * > :: __type
  8015. __copy_move_a2 ( istreambuf_iterator < _CharT , char_traits < _CharT > > ,
  8016. istreambuf_iterator < _CharT , char_traits < _CharT > > , _CharT * ) ;
  8017.  
  8018. template < bool _IsMove , typename _II , typename _OI >
  8019. inline _OI
  8020. __copy_move_a2 ( _II __first , _II __last , _OI __result )
  8021. {
  8022. return _OI ( std :: __copy_move_a < _IsMove > ( std :: __niter_base ( __first ) ,
  8023. std :: __niter_base ( __last ) ,
  8024. std :: __niter_base ( __result ) ) ) ;
  8025. }
  8026. #448
  8027. template < typename _II , typename _OI >
  8028. inline _OI
  8029. copy ( _II __first , _II __last , _OI __result )
  8030. {
  8031.  
  8032.  
  8033.  
  8034.  
  8035. ;
  8036.  
  8037. return ( std :: __copy_move_a2 < __is_move_iterator < _II > :: __value >
  8038. ( std :: __miter_base ( __first ) , std :: __miter_base ( __last ) ,
  8039. __result ) ) ;
  8040. }
  8041. #481
  8042. template < typename _II , typename _OI >
  8043. inline _OI
  8044. move ( _II __first , _II __last , _OI __result )
  8045. {
  8046.  
  8047.  
  8048.  
  8049.  
  8050. ;
  8051.  
  8052. return std :: __copy_move_a2 < true > ( std :: __miter_base ( __first ) ,
  8053. std :: __miter_base ( __last ) , __result ) ;
  8054. }
  8055. #500
  8056. template < bool , bool , typename >
  8057. struct __copy_move_backward
  8058. {
  8059. template < typename _BI1 , typename _BI2 >
  8060. static _BI2
  8061. __copy_move_b ( _BI1 __first , _BI1 __last , _BI2 __result )
  8062. {
  8063. while ( __first != __last )
  8064. * -- __result = * -- __last ;
  8065. return __result ;
  8066. }
  8067. } ;
  8068.  
  8069.  
  8070. template < typename _Category >
  8071. struct __copy_move_backward < true , false , _Category >
  8072. {
  8073. template < typename _BI1 , typename _BI2 >
  8074. static _BI2
  8075. __copy_move_b ( _BI1 __first , _BI1 __last , _BI2 __result )
  8076. {
  8077. while ( __first != __last )
  8078. * -- __result = std :: move ( * -- __last ) ;
  8079. return __result ;
  8080. }
  8081. } ;
  8082.  
  8083.  
  8084. template < >
  8085. struct __copy_move_backward < false , false , random_access_iterator_tag >
  8086. {
  8087. template < typename _BI1 , typename _BI2 >
  8088. static _BI2
  8089. __copy_move_b ( _BI1 __first , _BI1 __last , _BI2 __result )
  8090. {
  8091. typename iterator_traits < _BI1 > :: difference_type __n ;
  8092. for ( __n = __last - __first ; __n > 0 ; -- __n )
  8093. * -- __result = * -- __last ;
  8094. return __result ;
  8095. }
  8096. } ;
  8097.  
  8098.  
  8099. template < >
  8100. struct __copy_move_backward < true , false , random_access_iterator_tag >
  8101. {
  8102. template < typename _BI1 , typename _BI2 >
  8103. static _BI2
  8104. __copy_move_b ( _BI1 __first , _BI1 __last , _BI2 __result )
  8105. {
  8106. typename iterator_traits < _BI1 > :: difference_type __n ;
  8107. for ( __n = __last - __first ; __n > 0 ; -- __n )
  8108. * -- __result = std :: move ( * -- __last ) ;
  8109. return __result ;
  8110. }
  8111. } ;
  8112.  
  8113.  
  8114. template < bool _IsMove >
  8115. struct __copy_move_backward < _IsMove , true , random_access_iterator_tag >
  8116. {
  8117. template < typename _Tp >
  8118. static _Tp *
  8119. __copy_move_b ( const _Tp * __first , const _Tp * __last , _Tp * __result )
  8120. {
  8121. const ptrdiff_t _Num = __last - __first ;
  8122. if ( _Num )
  8123. __builtin_memmove ( __result - _Num , __first , sizeof ( _Tp ) * _Num ) ;
  8124. return __result - _Num ;
  8125. }
  8126. } ;
  8127.  
  8128. template < bool _IsMove , typename _BI1 , typename _BI2 >
  8129. inline _BI2
  8130. __copy_move_backward_a ( _BI1 __first , _BI1 __last , _BI2 __result )
  8131. {
  8132. typedef typename iterator_traits < _BI1 > :: value_type _ValueType1 ;
  8133. typedef typename iterator_traits < _BI2 > :: value_type _ValueType2 ;
  8134. typedef typename iterator_traits < _BI1 > :: iterator_category _Category ;
  8135. const bool __simple = ( __oracle_is_trivial ( _ValueType1 )
  8136. && __is_pointer < _BI1 > :: __value
  8137. && __is_pointer < _BI2 > :: __value
  8138. && __are_same < _ValueType1 , _ValueType2 > :: __value ) ;
  8139.  
  8140. return std :: __copy_move_backward < _IsMove , __simple ,
  8141. _Category > :: __copy_move_b ( __first ,
  8142. __last ,
  8143. __result ) ;
  8144. }
  8145.  
  8146. template < bool _IsMove , typename _BI1 , typename _BI2 >
  8147. inline _BI2
  8148. __copy_move_backward_a2 ( _BI1 __first , _BI1 __last , _BI2 __result )
  8149. {
  8150. return _BI2 ( std :: __copy_move_backward_a < _IsMove >
  8151. ( std :: __niter_base ( __first ) , std :: __niter_base ( __last ) ,
  8152. std :: __niter_base ( __result ) ) ) ;
  8153. }
  8154. #617
  8155. template < typename _BI1 , typename _BI2 >
  8156. inline _BI2
  8157. copy_backward ( _BI1 __first , _BI1 __last , _BI2 __result )
  8158. {
  8159. #627
  8160. ;
  8161.  
  8162. return ( std :: __copy_move_backward_a2 < __is_move_iterator < _BI1 > :: __value >
  8163. ( std :: __miter_base ( __first ) , std :: __miter_base ( __last ) ,
  8164. __result ) ) ;
  8165. }
  8166. #653
  8167. template < typename _BI1 , typename _BI2 >
  8168. inline _BI2
  8169. move_backward ( _BI1 __first , _BI1 __last , _BI2 __result )
  8170. {
  8171. #663
  8172. ;
  8173.  
  8174. return std :: __copy_move_backward_a2 < true > ( std :: __miter_base ( __first ) ,
  8175. std :: __miter_base ( __last ) ,
  8176. __result ) ;
  8177. }
  8178. #675
  8179. template < typename _ForwardIterator , typename _Tp >
  8180. inline typename
  8181. __gnu_cxx :: __enable_if < ! __is_scalar < _Tp > :: __value , void > :: __type
  8182. __fill_a ( _ForwardIterator __first , _ForwardIterator __last ,
  8183. const _Tp & __value )
  8184. {
  8185. for ( ; __first != __last ; ++ __first )
  8186. * __first = __value ;
  8187. }
  8188.  
  8189. template < typename _ForwardIterator , typename _Tp >
  8190. inline typename
  8191. __gnu_cxx :: __enable_if < __is_scalar < _Tp > :: __value , void > :: __type
  8192. __fill_a ( _ForwardIterator __first , _ForwardIterator __last ,
  8193. const _Tp & __value )
  8194. {
  8195. const _Tp __tmp = __value ;
  8196. for ( ; __first != __last ; ++ __first )
  8197. * __first = __tmp ;
  8198. }
  8199.  
  8200.  
  8201. template < typename _Tp >
  8202. inline typename
  8203. __gnu_cxx :: __enable_if < __is_byte < _Tp > :: __value , void > :: __type
  8204. __fill_a ( _Tp * __first , _Tp * __last , const _Tp & __c )
  8205. {
  8206. const _Tp __tmp = __c ;
  8207. __builtin_memset ( __first , static_cast < unsigned char > ( __tmp ) ,
  8208. __last - __first ) ;
  8209. }
  8210. #719
  8211. template < typename _ForwardIterator , typename _Tp >
  8212. inline void
  8213. fill ( _ForwardIterator __first , _ForwardIterator __last , const _Tp & __value )
  8214. {
  8215.  
  8216.  
  8217.  
  8218. ;
  8219.  
  8220. std :: __fill_a ( std :: __niter_base ( __first ) , std :: __niter_base ( __last ) ,
  8221. __value ) ;
  8222. }
  8223.  
  8224. template < typename _OutputIterator , typename _Size , typename _Tp >
  8225. inline typename
  8226. __gnu_cxx :: __enable_if < ! __is_scalar < _Tp > :: __value , _OutputIterator > :: __type
  8227. __fill_n_a ( _OutputIterator __first , _Size __n , const _Tp & __value )
  8228. {
  8229. for ( __decltype ( __n + 0 ) __niter = __n ;
  8230. __niter > 0 ; -- __niter , ++ __first )
  8231. * __first = __value ;
  8232. return __first ;
  8233. }
  8234.  
  8235. template < typename _OutputIterator , typename _Size , typename _Tp >
  8236. inline typename
  8237. __gnu_cxx :: __enable_if < __is_scalar < _Tp > :: __value , _OutputIterator > :: __type
  8238. __fill_n_a ( _OutputIterator __first , _Size __n , const _Tp & __value )
  8239. {
  8240. const _Tp __tmp = __value ;
  8241. for ( __decltype ( __n + 0 ) __niter = __n ;
  8242. __niter > 0 ; -- __niter , ++ __first )
  8243. * __first = __tmp ;
  8244. return __first ;
  8245. }
  8246.  
  8247. template < typename _Size , typename _Tp >
  8248. inline typename
  8249. __gnu_cxx :: __enable_if < __is_byte < _Tp > :: __value , _Tp * > :: __type
  8250. __fill_n_a ( _Tp * __first , _Size __n , const _Tp & __c )
  8251. {
  8252. std :: __fill_a ( __first , __first + __n , __c ) ;
  8253. return __first + __n ;
  8254. }
  8255. #779
  8256. template < typename _OI , typename _Size , typename _Tp >
  8257. inline _OI
  8258. fill_n ( _OI __first , _Size __n , const _Tp & __value )
  8259. {
  8260.  
  8261.  
  8262.  
  8263. return _OI ( std :: __fill_n_a ( std :: __niter_base ( __first ) , __n , __value ) ) ;
  8264. }
  8265.  
  8266. template < bool _BoolType >
  8267. struct __equal
  8268. {
  8269. template < typename _II1 , typename _II2 >
  8270. static bool
  8271. equal ( _II1 __first1 , _II1 __last1 , _II2 __first2 )
  8272. {
  8273. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  8274. if ( ! ( * __first1 == * __first2 ) )
  8275. return false ;
  8276. return true ;
  8277. }
  8278. } ;
  8279.  
  8280. template < >
  8281. struct __equal < true >
  8282. {
  8283. template < typename _Tp >
  8284. static bool
  8285. equal ( const _Tp * __first1 , const _Tp * __last1 , const _Tp * __first2 )
  8286. {
  8287. return ! __builtin_memcmp ( __first1 , __first2 , sizeof ( _Tp )
  8288. * ( __last1 - __first1 ) ) ;
  8289. }
  8290. } ;
  8291.  
  8292. template < typename _II1 , typename _II2 >
  8293. inline bool
  8294. __equal_aux ( _II1 __first1 , _II1 __last1 , _II2 __first2 )
  8295. {
  8296. typedef typename iterator_traits < _II1 > :: value_type _ValueType1 ;
  8297. typedef typename iterator_traits < _II2 > :: value_type _ValueType2 ;
  8298. const bool __simple = ( ( __is_integer < _ValueType1 > :: __value
  8299. || __is_pointer < _ValueType1 > :: __value )
  8300. && __is_pointer < _II1 > :: __value
  8301. && __is_pointer < _II2 > :: __value
  8302. && __are_same < _ValueType1 , _ValueType2 > :: __value ) ;
  8303.  
  8304. return std :: __equal < __simple > :: equal ( __first1 , __last1 , __first2 ) ;
  8305. }
  8306.  
  8307.  
  8308. template < typename , typename >
  8309. struct __lc_rai
  8310. {
  8311. template < typename _II1 , typename _II2 >
  8312. static _II1
  8313. __newlast1 ( _II1 , _II1 __last1 , _II2 , _II2 )
  8314. { return __last1 ; }
  8315.  
  8316. template < typename _II >
  8317. static bool
  8318. __cnd2 ( _II __first , _II __last )
  8319. { return __first != __last ; }
  8320. } ;
  8321.  
  8322. template < >
  8323. struct __lc_rai < random_access_iterator_tag , random_access_iterator_tag >
  8324. {
  8325. template < typename _RAI1 , typename _RAI2 >
  8326. static _RAI1
  8327. __newlast1 ( _RAI1 __first1 , _RAI1 __last1 ,
  8328. _RAI2 __first2 , _RAI2 __last2 )
  8329. {
  8330. const typename iterator_traits < _RAI1 > :: difference_type
  8331. __diff1 = __last1 - __first1 ;
  8332. const typename iterator_traits < _RAI2 > :: difference_type
  8333. __diff2 = __last2 - __first2 ;
  8334. return __diff2 < __diff1 ? __first1 + __diff2 : __last1 ;
  8335. }
  8336.  
  8337. template < typename _RAI >
  8338. static bool
  8339. __cnd2 ( _RAI , _RAI )
  8340. { return true ; }
  8341. } ;
  8342.  
  8343. template < bool _BoolType >
  8344. struct __lexicographical_compare
  8345. {
  8346. template < typename _II1 , typename _II2 >
  8347. static bool __lc ( _II1 , _II1 , _II2 , _II2 ) ;
  8348. } ;
  8349.  
  8350. template < bool _BoolType >
  8351. template < typename _II1 , typename _II2 >
  8352. bool
  8353. __lexicographical_compare < _BoolType > ::
  8354. __lc ( _II1 __first1 , _II1 __last1 , _II2 __first2 , _II2 __last2 )
  8355. {
  8356. typedef typename iterator_traits < _II1 > :: iterator_category _Category1 ;
  8357. typedef typename iterator_traits < _II2 > :: iterator_category _Category2 ;
  8358. typedef std :: __lc_rai < _Category1 , _Category2 > __rai_type ;
  8359.  
  8360. __last1 = __rai_type :: __newlast1 ( __first1 , __last1 ,
  8361. __first2 , __last2 ) ;
  8362. for ( ; __first1 != __last1 && __rai_type :: __cnd2 ( __first2 , __last2 ) ;
  8363. ++ __first1 , ++ __first2 )
  8364. {
  8365. if ( * __first1 < * __first2 )
  8366. return true ;
  8367. if ( * __first2 < * __first1 )
  8368. return false ;
  8369. }
  8370. return __first1 == __last1 && __first2 != __last2 ;
  8371. }
  8372.  
  8373. template < >
  8374. struct __lexicographical_compare < true >
  8375. {
  8376. template < typename _Tp , typename _Up >
  8377. static bool
  8378. __lc ( const _Tp * __first1 , const _Tp * __last1 ,
  8379. const _Up * __first2 , const _Up * __last2 )
  8380. {
  8381. const size_t __len1 = __last1 - __first1 ;
  8382. const size_t __len2 = __last2 - __first2 ;
  8383. const int __result = __builtin_memcmp ( __first1 , __first2 ,
  8384. std :: min ( __len1 , __len2 ) ) ;
  8385. return __result != 0 ? __result < 0 : __len1 < __len2 ;
  8386. }
  8387. } ;
  8388.  
  8389. template < typename _II1 , typename _II2 >
  8390. inline bool
  8391. __lexicographical_compare_aux ( _II1 __first1 , _II1 __last1 ,
  8392. _II2 __first2 , _II2 __last2 )
  8393. {
  8394. typedef typename iterator_traits < _II1 > :: value_type _ValueType1 ;
  8395. typedef typename iterator_traits < _II2 > :: value_type _ValueType2 ;
  8396. const bool __simple =
  8397. ( __is_byte < _ValueType1 > :: __value && __is_byte < _ValueType2 > :: __value
  8398. && ! __gnu_cxx :: __numeric_traits < _ValueType1 > :: __is_signed
  8399. && ! __gnu_cxx :: __numeric_traits < _ValueType2 > :: __is_signed
  8400. && __is_pointer < _II1 > :: __value
  8401. && __is_pointer < _II2 > :: __value ) ;
  8402.  
  8403. return std :: __lexicographical_compare < __simple > :: __lc ( __first1 , __last1 ,
  8404. __first2 , __last2 ) ;
  8405. }
  8406. #941
  8407. template < typename _ForwardIterator , typename _Tp >
  8408. _ForwardIterator
  8409. lower_bound ( _ForwardIterator __first , _ForwardIterator __last ,
  8410. const _Tp & __val )
  8411. {
  8412.  
  8413.  
  8414.  
  8415.  
  8416. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  8417. _DistanceType ;
  8418.  
  8419.  
  8420.  
  8421.  
  8422. ;
  8423.  
  8424. _DistanceType __len = std :: distance ( __first , __last ) ;
  8425.  
  8426. while ( __len > 0 )
  8427. {
  8428. _DistanceType __half = __len >> 1 ;
  8429. _ForwardIterator __middle = __first ;
  8430. std :: advance ( __middle , __half ) ;
  8431. if ( * __middle < __val )
  8432. {
  8433. __first = __middle ;
  8434. ++ __first ;
  8435. __len = __len - __half - 1 ;
  8436. }
  8437. else
  8438. __len = __half ;
  8439. }
  8440. return __first ;
  8441. }
  8442.  
  8443.  
  8444.  
  8445. inline constexpr int
  8446. __lg ( int __n )
  8447. { return sizeof ( int ) * 8 - 1 - __builtin_clz ( __n ) ; }
  8448.  
  8449. inline constexpr unsigned
  8450. __lg ( unsigned __n )
  8451. { return sizeof ( int ) * 8 - 1 - __builtin_clz ( __n ) ; }
  8452.  
  8453. inline constexpr long
  8454. __lg ( long __n )
  8455. { return sizeof ( long ) * 8 - 1 - __builtin_clzl ( __n ) ; }
  8456.  
  8457. inline constexpr unsigned long
  8458. __lg ( unsigned long __n )
  8459. { return sizeof ( long ) * 8 - 1 - __builtin_clzl ( __n ) ; }
  8460.  
  8461. inline constexpr long long
  8462. __lg ( long long __n )
  8463. { return sizeof ( long long ) * 8 - 1 - __builtin_clzll ( __n ) ; }
  8464.  
  8465. inline constexpr unsigned long long
  8466. __lg ( unsigned long long __n )
  8467. { return sizeof ( long long ) * 8 - 1 - __builtin_clzll ( __n ) ; }
  8468. #1019
  8469. template < typename _II1 , typename _II2 >
  8470. inline bool
  8471. equal ( _II1 __first1 , _II1 __last1 , _II2 __first2 )
  8472. {
  8473. #1029
  8474. ;
  8475.  
  8476. return std :: __equal_aux ( std :: __niter_base ( __first1 ) ,
  8477. std :: __niter_base ( __last1 ) ,
  8478. std :: __niter_base ( __first2 ) ) ;
  8479. }
  8480. #1051
  8481. template < typename _IIter1 , typename _IIter2 , typename _BinaryPredicate >
  8482. inline bool
  8483. equal ( _IIter1 __first1 , _IIter1 __last1 ,
  8484. _IIter2 __first2 , _BinaryPredicate __binary_pred )
  8485. {
  8486.  
  8487.  
  8488.  
  8489. ;
  8490.  
  8491. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  8492. if ( ! bool ( __binary_pred ( * __first1 , * __first2 ) ) )
  8493. return false ;
  8494. return true ;
  8495. }
  8496. #1082
  8497. template < typename _II1 , typename _II2 >
  8498. inline bool
  8499. lexicographical_compare ( _II1 __first1 , _II1 __last1 ,
  8500. _II2 __first2 , _II2 __last2 )
  8501. {
  8502. #1096
  8503. ;
  8504. ;
  8505.  
  8506. return std :: __lexicographical_compare_aux ( std :: __niter_base ( __first1 ) ,
  8507. std :: __niter_base ( __last1 ) ,
  8508. std :: __niter_base ( __first2 ) ,
  8509. std :: __niter_base ( __last2 ) ) ;
  8510. }
  8511. #1118
  8512. template < typename _II1 , typename _II2 , typename _Compare >
  8513. bool
  8514. lexicographical_compare ( _II1 __first1 , _II1 __last1 ,
  8515. _II2 __first2 , _II2 __last2 , _Compare __comp )
  8516. {
  8517. typedef typename iterator_traits < _II1 > :: iterator_category _Category1 ;
  8518. typedef typename iterator_traits < _II2 > :: iterator_category _Category2 ;
  8519. typedef std :: __lc_rai < _Category1 , _Category2 > __rai_type ;
  8520.  
  8521.  
  8522.  
  8523.  
  8524. ;
  8525. ;
  8526.  
  8527. __last1 = __rai_type :: __newlast1 ( __first1 , __last1 , __first2 , __last2 ) ;
  8528. for ( ; __first1 != __last1 && __rai_type :: __cnd2 ( __first2 , __last2 ) ;
  8529. ++ __first1 , ++ __first2 )
  8530. {
  8531. if ( __comp ( * __first1 , * __first2 ) )
  8532. return true ;
  8533. if ( __comp ( * __first2 , * __first1 ) )
  8534. return false ;
  8535. }
  8536. return __first1 == __last1 && __first2 != __last2 ;
  8537. }
  8538. #1158
  8539. template < typename _InputIterator1 , typename _InputIterator2 >
  8540. pair < _InputIterator1 , _InputIterator2 >
  8541. mismatch ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  8542. _InputIterator2 __first2 )
  8543. {
  8544. #1169
  8545. ;
  8546.  
  8547. while ( __first1 != __last1 && * __first1 == * __first2 )
  8548. {
  8549. ++ __first1 ;
  8550. ++ __first2 ;
  8551. }
  8552. return pair < _InputIterator1 , _InputIterator2 > ( __first1 , __first2 ) ;
  8553. }
  8554. #1195
  8555. template < typename _InputIterator1 , typename _InputIterator2 ,
  8556. typename _BinaryPredicate >
  8557. pair < _InputIterator1 , _InputIterator2 >
  8558. mismatch ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  8559. _InputIterator2 __first2 , _BinaryPredicate __binary_pred )
  8560. {
  8561.  
  8562.  
  8563.  
  8564. ;
  8565.  
  8566. while ( __first1 != __last1 && bool ( __binary_pred ( * __first1 , * __first2 ) ) )
  8567. {
  8568. ++ __first1 ;
  8569. ++ __first2 ;
  8570. }
  8571. return pair < _InputIterator1 , _InputIterator2 > ( __first1 , __first2 ) ;
  8572. }
  8573.  
  8574.  
  8575. }
  8576. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/postypes.h"
  8577. #38
  8578. #pragma GCC system_header
  8579. #68
  8580. namespace std
  8581. {
  8582. #88
  8583. typedef long streamoff ;
  8584. #98
  8585. typedef ptrdiff_t streamsize ;
  8586. #111
  8587. template < typename _StateT >
  8588. class fpos
  8589. {
  8590. private :
  8591. streamoff _M_off ;
  8592. _StateT _M_state ;
  8593.  
  8594. public :
  8595.  
  8596.  
  8597.  
  8598.  
  8599. fpos ( )
  8600. : _M_off ( 0 ) , _M_state ( ) { }
  8601. #133
  8602. fpos ( streamoff __off )
  8603. : _M_off ( __off ) , _M_state ( ) { }
  8604.  
  8605.  
  8606. operator streamoff ( ) const { return _M_off ; }
  8607.  
  8608.  
  8609. void
  8610. state ( _StateT __st )
  8611. { _M_state = __st ; }
  8612.  
  8613.  
  8614. _StateT
  8615. state ( ) const
  8616. { return _M_state ; }
  8617.  
  8618.  
  8619.  
  8620.  
  8621.  
  8622. fpos &
  8623. operator += ( streamoff __off )
  8624. {
  8625. _M_off += __off ;
  8626. return * this ;
  8627. }
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633. fpos &
  8634. operator -= ( streamoff __off )
  8635. {
  8636. _M_off -= __off ;
  8637. return * this ;
  8638. }
  8639. #177
  8640. fpos
  8641. operator + ( streamoff __off ) const
  8642. {
  8643. fpos __pos ( * this ) ;
  8644. __pos += __off ;
  8645. return __pos ;
  8646. }
  8647. #191
  8648. fpos
  8649. operator - ( streamoff __off ) const
  8650. {
  8651. fpos __pos ( * this ) ;
  8652. __pos -= __off ;
  8653. return __pos ;
  8654. }
  8655. #204
  8656. streamoff
  8657. operator - ( const fpos & __other ) const
  8658. { return _M_off - __other . _M_off ; }
  8659. } ;
  8660. #214
  8661. template < typename _StateT >
  8662. inline bool
  8663. operator == ( const fpos < _StateT > & __lhs , const fpos < _StateT > & __rhs )
  8664. { return streamoff ( __lhs ) == streamoff ( __rhs ) ; }
  8665.  
  8666. template < typename _StateT >
  8667. inline bool
  8668. operator != ( const fpos < _StateT > & __lhs , const fpos < _StateT > & __rhs )
  8669. { return streamoff ( __lhs ) != streamoff ( __rhs ) ; }
  8670.  
  8671.  
  8672.  
  8673.  
  8674.  
  8675. typedef fpos < mbstate_t > streampos ;
  8676.  
  8677. typedef fpos < mbstate_t > wstreampos ;
  8678.  
  8679.  
  8680.  
  8681. typedef fpos < mbstate_t > u16streampos ;
  8682.  
  8683. typedef fpos < mbstate_t > u32streampos ;
  8684.  
  8685.  
  8686.  
  8687. }
  8688. #43 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/char_traits.h"
  8689. namespace __gnu_cxx
  8690. {
  8691. #57
  8692. template < typename _CharT >
  8693. struct _Char_types
  8694. {
  8695. typedef unsigned long int_type ;
  8696. typedef std :: streampos pos_type ;
  8697. typedef std :: streamoff off_type ;
  8698. typedef std :: mbstate_t state_type ;
  8699. } ;
  8700. #82
  8701. template < typename _CharT >
  8702. struct char_traits
  8703. {
  8704. typedef _CharT char_type ;
  8705. typedef typename _Char_types < _CharT > :: int_type int_type ;
  8706. typedef typename _Char_types < _CharT > :: pos_type pos_type ;
  8707. typedef typename _Char_types < _CharT > :: off_type off_type ;
  8708. typedef typename _Char_types < _CharT > :: state_type state_type ;
  8709.  
  8710. static void
  8711. assign ( char_type & __c1 , const char_type & __c2 )
  8712. { __c1 = __c2 ; }
  8713.  
  8714. static constexpr bool
  8715. eq ( const char_type & __c1 , const char_type & __c2 )
  8716. { return __c1 == __c2 ; }
  8717.  
  8718. static constexpr bool
  8719. lt ( const char_type & __c1 , const char_type & __c2 )
  8720. { return __c1 < __c2 ; }
  8721.  
  8722. static int
  8723. compare ( const char_type * __s1 , const char_type * __s2 , std :: size_t __n ) ;
  8724.  
  8725. static std :: size_t
  8726. length ( const char_type * __s ) ;
  8727.  
  8728. static const char_type *
  8729. find ( const char_type * __s , std :: size_t __n , const char_type & __a ) ;
  8730.  
  8731. static char_type *
  8732. move ( char_type * __s1 , const char_type * __s2 , std :: size_t __n ) ;
  8733.  
  8734. static char_type *
  8735. copy ( char_type * __s1 , const char_type * __s2 , std :: size_t __n ) ;
  8736.  
  8737. static char_type *
  8738. assign ( char_type * __s , std :: size_t __n , char_type __a ) ;
  8739.  
  8740. static constexpr char_type
  8741. to_char_type ( const int_type & __c )
  8742. { return static_cast < char_type > ( __c ) ; }
  8743.  
  8744. static constexpr int_type
  8745. to_int_type ( const char_type & __c )
  8746. { return static_cast < int_type > ( __c ) ; }
  8747.  
  8748. static constexpr bool
  8749. eq_int_type ( const int_type & __c1 , const int_type & __c2 )
  8750. { return __c1 == __c2 ; }
  8751.  
  8752. static constexpr int_type
  8753. eof ( )
  8754. { return static_cast < int_type > ( - 1 ) ; }
  8755.  
  8756. static constexpr int_type
  8757. not_eof ( const int_type & __c )
  8758. { return ! eq_int_type ( __c , eof ( ) ) ? __c : to_int_type ( char_type ( ) ) ; }
  8759. } ;
  8760.  
  8761. template < typename _CharT >
  8762. int
  8763. char_traits < _CharT > ::
  8764. compare ( const char_type * __s1 , const char_type * __s2 , std :: size_t __n )
  8765. {
  8766. for ( std :: size_t __i = 0 ; __i < __n ; ++ __i )
  8767. if ( lt ( __s1 [ __i ] , __s2 [ __i ] ) )
  8768. return - 1 ;
  8769. else if ( lt ( __s2 [ __i ] , __s1 [ __i ] ) )
  8770. return 1 ;
  8771. return 0 ;
  8772. }
  8773.  
  8774. template < typename _CharT >
  8775. std :: size_t
  8776. char_traits < _CharT > ::
  8777. length ( const char_type * __p )
  8778. {
  8779. std :: size_t __i = 0 ;
  8780. while ( ! eq ( __p [ __i ] , char_type ( ) ) )
  8781. ++ __i ;
  8782. return __i ;
  8783. }
  8784.  
  8785. template < typename _CharT >
  8786. const typename char_traits < _CharT > :: char_type *
  8787. char_traits < _CharT > ::
  8788. find ( const char_type * __s , std :: size_t __n , const char_type & __a )
  8789. {
  8790. for ( std :: size_t __i = 0 ; __i < __n ; ++ __i )
  8791. if ( eq ( __s [ __i ] , __a ) )
  8792. return __s + __i ;
  8793. return 0 ;
  8794. }
  8795.  
  8796. template < typename _CharT >
  8797. typename char_traits < _CharT > :: char_type *
  8798. char_traits < _CharT > ::
  8799. move ( char_type * __s1 , const char_type * __s2 , std :: size_t __n )
  8800. {
  8801. return static_cast < _CharT * > ( __builtin_memmove ( __s1 , __s2 ,
  8802. __n * sizeof ( char_type ) ) ) ;
  8803. }
  8804.  
  8805. template < typename _CharT >
  8806. typename char_traits < _CharT > :: char_type *
  8807. char_traits < _CharT > ::
  8808. copy ( char_type * __s1 , const char_type * __s2 , std :: size_t __n )
  8809. {
  8810.  
  8811. std :: copy ( __s2 , __s2 + __n , __s1 ) ;
  8812. return __s1 ;
  8813. }
  8814.  
  8815. template < typename _CharT >
  8816. typename char_traits < _CharT > :: char_type *
  8817. char_traits < _CharT > ::
  8818. assign ( char_type * __s , std :: size_t __n , char_type __a )
  8819. {
  8820.  
  8821. std :: fill_n ( __s , __n , __a ) ;
  8822. return __s ;
  8823. }
  8824.  
  8825.  
  8826. }
  8827.  
  8828. namespace std
  8829. {
  8830. #226
  8831. template < class _CharT >
  8832. struct char_traits : public __gnu_cxx :: char_traits < _CharT >
  8833. { } ;
  8834.  
  8835.  
  8836.  
  8837. template < >
  8838. struct char_traits < char >
  8839. {
  8840. typedef char char_type ;
  8841. typedef int int_type ;
  8842. typedef streampos pos_type ;
  8843. typedef streamoff off_type ;
  8844. typedef mbstate_t state_type ;
  8845.  
  8846. static void
  8847. assign ( char_type & __c1 , const char_type & __c2 ) noexcept
  8848. { __c1 = __c2 ; }
  8849.  
  8850. static constexpr bool
  8851. eq ( const char_type & __c1 , const char_type & __c2 ) noexcept
  8852. { return __c1 == __c2 ; }
  8853.  
  8854. static constexpr bool
  8855. lt ( const char_type & __c1 , const char_type & __c2 ) noexcept
  8856. { return __c1 < __c2 ; }
  8857.  
  8858. static int
  8859. compare ( const char_type * __s1 , const char_type * __s2 , size_t __n )
  8860. { return __builtin_memcmp ( __s1 , __s2 , __n ) ; }
  8861.  
  8862. static size_t
  8863. length ( const char_type * __s )
  8864. { return __builtin_strlen ( __s ) ; }
  8865.  
  8866. static const char_type *
  8867. find ( const char_type * __s , size_t __n , const char_type & __a )
  8868. { return static_cast < const char_type * > ( __builtin_memchr ( __s , __a , __n ) ) ; }
  8869.  
  8870. static char_type *
  8871. move ( char_type * __s1 , const char_type * __s2 , size_t __n )
  8872. { return static_cast < char_type * > ( __builtin_memmove ( __s1 , __s2 , __n ) ) ; }
  8873.  
  8874. static char_type *
  8875. copy ( char_type * __s1 , const char_type * __s2 , size_t __n )
  8876. { return static_cast < char_type * > ( __builtin_memcpy ( __s1 , __s2 , __n ) ) ; }
  8877.  
  8878. static char_type *
  8879. assign ( char_type * __s , size_t __n , char_type __a )
  8880. { return static_cast < char_type * > ( __builtin_memset ( __s , __a , __n ) ) ; }
  8881.  
  8882. static constexpr char_type
  8883. to_char_type ( const int_type & __c ) noexcept
  8884. { return static_cast < char_type > ( __c ) ; }
  8885.  
  8886.  
  8887.  
  8888. static constexpr int_type
  8889. to_int_type ( const char_type & __c ) noexcept
  8890. { return static_cast < int_type > ( static_cast < unsigned char > ( __c ) ) ; }
  8891.  
  8892. static constexpr bool
  8893. eq_int_type ( const int_type & __c1 , const int_type & __c2 ) noexcept
  8894. { return __c1 == __c2 ; }
  8895.  
  8896. static constexpr int_type
  8897. eof ( ) noexcept
  8898. { return static_cast < int_type > ( - 1 ) ; }
  8899.  
  8900. static constexpr int_type
  8901. not_eof ( const int_type & __c ) noexcept
  8902. { return ( __c == eof ( ) ) ? 0 : __c ; }
  8903. } ;
  8904.  
  8905.  
  8906.  
  8907.  
  8908. template < >
  8909. struct char_traits < wchar_t >
  8910. {
  8911. typedef wchar_t char_type ;
  8912. typedef wint_t int_type ;
  8913. typedef streamoff off_type ;
  8914. typedef wstreampos pos_type ;
  8915. typedef mbstate_t state_type ;
  8916.  
  8917. static void
  8918. assign ( char_type & __c1 , const char_type & __c2 ) noexcept
  8919. { __c1 = __c2 ; }
  8920.  
  8921. static constexpr bool
  8922. eq ( const char_type & __c1 , const char_type & __c2 ) noexcept
  8923. { return __c1 == __c2 ; }
  8924.  
  8925. static constexpr bool
  8926. lt ( const char_type & __c1 , const char_type & __c2 ) noexcept
  8927. { return __c1 < __c2 ; }
  8928.  
  8929. static int
  8930. compare ( const char_type * __s1 , const char_type * __s2 , size_t __n )
  8931. { return wmemcmp ( __s1 , __s2 , __n ) ; }
  8932.  
  8933. static size_t
  8934. length ( const char_type * __s )
  8935. { return wcslen ( __s ) ; }
  8936.  
  8937. static const char_type *
  8938. find ( const char_type * __s , size_t __n , const char_type & __a )
  8939. { return wmemchr ( __s , __a , __n ) ; }
  8940.  
  8941. static char_type *
  8942. move ( char_type * __s1 , const char_type * __s2 , size_t __n )
  8943. { return wmemmove ( __s1 , __s2 , __n ) ; }
  8944.  
  8945. static char_type *
  8946. copy ( char_type * __s1 , const char_type * __s2 , size_t __n )
  8947. { return wmemcpy ( __s1 , __s2 , __n ) ; }
  8948.  
  8949. static char_type *
  8950. assign ( char_type * __s , size_t __n , char_type __a )
  8951. { return wmemset ( __s , __a , __n ) ; }
  8952.  
  8953. static constexpr char_type
  8954. to_char_type ( const int_type & __c ) noexcept
  8955. { return char_type ( __c ) ; }
  8956.  
  8957. static constexpr int_type
  8958. to_int_type ( const char_type & __c ) noexcept
  8959. { return int_type ( __c ) ; }
  8960.  
  8961. static constexpr bool
  8962. eq_int_type ( const int_type & __c1 , const int_type & __c2 ) noexcept
  8963. { return __c1 == __c2 ; }
  8964.  
  8965. static constexpr int_type
  8966. eof ( ) noexcept
  8967. { return static_cast < int_type > ( ( ( wint_t ) ( - 1 ) ) ) ; }
  8968.  
  8969. static constexpr int_type
  8970. not_eof ( const int_type & __c ) noexcept
  8971. { return eq_int_type ( __c , eof ( ) ) ? 0 : __c ; }
  8972. } ;
  8973.  
  8974.  
  8975.  
  8976. }
  8977. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstdint"
  8978. #32
  8979. #pragma GCC system_header
  8980. #1 "/usr/include/stdint.h"
  8981. #9
  8982. #pragma ident "@(#)stdint.h 1.1 03/12/04 SMI"
  8983. #1 "/usr/include/sys/stdint.h"
  8984. #9
  8985. #pragma ident "@(#)stdint.h 1.1 03/12/04 SMI"
  8986. #1 "/usr/include/sys/int_const.h"
  8987. #9
  8988. #pragma ident "@(#)int_const.h  1.5 04/09/28 SMI"
  8989. #36
  8990. extern "C" {
  8991. #111
  8992. }
  8993. #46 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cstdint"
  8994. namespace std
  8995. {
  8996. using :: int8_t ;
  8997. using :: int16_t ;
  8998. using :: int32_t ;
  8999. using :: int64_t ;
  9000.  
  9001. using :: int_fast8_t ;
  9002. using :: int_fast16_t ;
  9003. using :: int_fast32_t ;
  9004. using :: int_fast64_t ;
  9005.  
  9006. using :: int_least8_t ;
  9007. using :: int_least16_t ;
  9008. using :: int_least32_t ;
  9009. using :: int_least64_t ;
  9010.  
  9011. using :: intmax_t ;
  9012. using :: intptr_t ;
  9013.  
  9014. using :: uint8_t ;
  9015. using :: uint16_t ;
  9016. using :: uint32_t ;
  9017. using :: uint64_t ;
  9018.  
  9019. using :: uint_fast8_t ;
  9020. using :: uint_fast16_t ;
  9021. using :: uint_fast32_t ;
  9022. using :: uint_fast64_t ;
  9023.  
  9024. using :: uint_least8_t ;
  9025. using :: uint_least16_t ;
  9026. using :: uint_least32_t ;
  9027. using :: uint_least64_t ;
  9028.  
  9029. using :: uintmax_t ;
  9030. using :: uintptr_t ;
  9031. }
  9032. #378 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/char_traits.h"
  9033. namespace std
  9034. {
  9035.  
  9036.  
  9037. template < >
  9038. struct char_traits < char16_t >
  9039. {
  9040. typedef char16_t char_type ;
  9041. typedef uint_least16_t int_type ;
  9042. typedef streamoff off_type ;
  9043. typedef u16streampos pos_type ;
  9044. typedef mbstate_t state_type ;
  9045.  
  9046. static void
  9047. assign ( char_type & __c1 , const char_type & __c2 ) noexcept
  9048. { __c1 = __c2 ; }
  9049.  
  9050. static constexpr bool
  9051. eq ( const char_type & __c1 , const char_type & __c2 ) noexcept
  9052. { return __c1 == __c2 ; }
  9053.  
  9054. static constexpr bool
  9055. lt ( const char_type & __c1 , const char_type & __c2 ) noexcept
  9056. { return __c1 < __c2 ; }
  9057.  
  9058. static int
  9059. compare ( const char_type * __s1 , const char_type * __s2 , size_t __n )
  9060. {
  9061. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  9062. if ( lt ( __s1 [ __i ] , __s2 [ __i ] ) )
  9063. return - 1 ;
  9064. else if ( lt ( __s2 [ __i ] , __s1 [ __i ] ) )
  9065. return 1 ;
  9066. return 0 ;
  9067. }
  9068.  
  9069. static size_t
  9070. length ( const char_type * __s )
  9071. {
  9072. size_t __i = 0 ;
  9073. while ( ! eq ( __s [ __i ] , char_type ( ) ) )
  9074. ++ __i ;
  9075. return __i ;
  9076. }
  9077.  
  9078. static const char_type *
  9079. find ( const char_type * __s , size_t __n , const char_type & __a )
  9080. {
  9081. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  9082. if ( eq ( __s [ __i ] , __a ) )
  9083. return __s + __i ;
  9084. return 0 ;
  9085. }
  9086.  
  9087. static char_type *
  9088. move ( char_type * __s1 , const char_type * __s2 , size_t __n )
  9089. {
  9090. return ( static_cast < char_type * >
  9091. ( __builtin_memmove ( __s1 , __s2 , __n * sizeof ( char_type ) ) ) ) ;
  9092. }
  9093.  
  9094. static char_type *
  9095. copy ( char_type * __s1 , const char_type * __s2 , size_t __n )
  9096. {
  9097. return ( static_cast < char_type * >
  9098. ( __builtin_memcpy ( __s1 , __s2 , __n * sizeof ( char_type ) ) ) ) ;
  9099. }
  9100.  
  9101. static char_type *
  9102. assign ( char_type * __s , size_t __n , char_type __a )
  9103. {
  9104. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  9105. assign ( __s [ __i ] , __a ) ;
  9106. return __s ;
  9107. }
  9108.  
  9109. static constexpr char_type
  9110. to_char_type ( const int_type & __c ) noexcept
  9111. { return char_type ( __c ) ; }
  9112.  
  9113. static constexpr int_type
  9114. to_int_type ( const char_type & __c ) noexcept
  9115. { return int_type ( __c ) ; }
  9116.  
  9117. static constexpr bool
  9118. eq_int_type ( const int_type & __c1 , const int_type & __c2 ) noexcept
  9119. { return __c1 == __c2 ; }
  9120.  
  9121. static constexpr int_type
  9122. eof ( ) noexcept
  9123. { return static_cast < int_type > ( - 1 ) ; }
  9124.  
  9125. static constexpr int_type
  9126. not_eof ( const int_type & __c ) noexcept
  9127. { return eq_int_type ( __c , eof ( ) ) ? 0 : __c ; }
  9128. } ;
  9129.  
  9130. template < >
  9131. struct char_traits < char32_t >
  9132. {
  9133. typedef char32_t char_type ;
  9134. typedef uint_least32_t int_type ;
  9135. typedef streamoff off_type ;
  9136. typedef u32streampos pos_type ;
  9137. typedef mbstate_t state_type ;
  9138.  
  9139. static void
  9140. assign ( char_type & __c1 , const char_type & __c2 ) noexcept
  9141. { __c1 = __c2 ; }
  9142.  
  9143. static constexpr bool
  9144. eq ( const char_type & __c1 , const char_type & __c2 ) noexcept
  9145. { return __c1 == __c2 ; }
  9146.  
  9147. static constexpr bool
  9148. lt ( const char_type & __c1 , const char_type & __c2 ) noexcept
  9149. { return __c1 < __c2 ; }
  9150.  
  9151. static int
  9152. compare ( const char_type * __s1 , const char_type * __s2 , size_t __n )
  9153. {
  9154. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  9155. if ( lt ( __s1 [ __i ] , __s2 [ __i ] ) )
  9156. return - 1 ;
  9157. else if ( lt ( __s2 [ __i ] , __s1 [ __i ] ) )
  9158. return 1 ;
  9159. return 0 ;
  9160. }
  9161.  
  9162. static size_t
  9163. length ( const char_type * __s )
  9164. {
  9165. size_t __i = 0 ;
  9166. while ( ! eq ( __s [ __i ] , char_type ( ) ) )
  9167. ++ __i ;
  9168. return __i ;
  9169. }
  9170.  
  9171. static const char_type *
  9172. find ( const char_type * __s , size_t __n , const char_type & __a )
  9173. {
  9174. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  9175. if ( eq ( __s [ __i ] , __a ) )
  9176. return __s + __i ;
  9177. return 0 ;
  9178. }
  9179.  
  9180. static char_type *
  9181. move ( char_type * __s1 , const char_type * __s2 , size_t __n )
  9182. {
  9183. return ( static_cast < char_type * >
  9184. ( __builtin_memmove ( __s1 , __s2 , __n * sizeof ( char_type ) ) ) ) ;
  9185. }
  9186.  
  9187. static char_type *
  9188. copy ( char_type * __s1 , const char_type * __s2 , size_t __n )
  9189. {
  9190. return ( static_cast < char_type * >
  9191. ( __builtin_memcpy ( __s1 , __s2 , __n * sizeof ( char_type ) ) ) ) ;
  9192. }
  9193.  
  9194. static char_type *
  9195. assign ( char_type * __s , size_t __n , char_type __a )
  9196. {
  9197. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  9198. assign ( __s [ __i ] , __a ) ;
  9199. return __s ;
  9200. }
  9201.  
  9202. static constexpr char_type
  9203. to_char_type ( const int_type & __c ) noexcept
  9204. { return char_type ( __c ) ; }
  9205.  
  9206. static constexpr int_type
  9207. to_int_type ( const char_type & __c ) noexcept
  9208. { return int_type ( __c ) ; }
  9209.  
  9210. static constexpr bool
  9211. eq_int_type ( const int_type & __c1 , const int_type & __c2 ) noexcept
  9212. { return __c1 == __c2 ; }
  9213.  
  9214. static constexpr int_type
  9215. eof ( ) noexcept
  9216. { return static_cast < int_type > ( - 1 ) ; }
  9217.  
  9218. static constexpr int_type
  9219. not_eof ( const int_type & __c ) noexcept
  9220. { return eq_int_type ( __c , eof ( ) ) ? 0 : __c ; }
  9221. } ;
  9222.  
  9223.  
  9224. }
  9225. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/allocator.h"
  9226. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/c++allocator.h"
  9227. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/new_allocator.h"
  9228. #40
  9229. namespace __gnu_cxx
  9230. {
  9231.  
  9232.  
  9233. using std :: size_t ;
  9234. using std :: ptrdiff_t ;
  9235. #57
  9236. template < typename _Tp >
  9237. class new_allocator
  9238. {
  9239. public :
  9240. typedef size_t size_type ;
  9241. typedef ptrdiff_t difference_type ;
  9242. typedef _Tp * pointer ;
  9243. typedef const _Tp * const_pointer ;
  9244. typedef _Tp & reference ;
  9245. typedef const _Tp & const_reference ;
  9246. typedef _Tp value_type ;
  9247.  
  9248. template < typename _Tp1 >
  9249. struct rebind
  9250. { typedef new_allocator < _Tp1 > other ; } ;
  9251.  
  9252.  
  9253.  
  9254.  
  9255. typedef std :: true_type propagate_on_container_move_assignment ;
  9256.  
  9257.  
  9258. new_allocator ( ) noexcept { }
  9259.  
  9260. new_allocator ( const new_allocator & ) noexcept { }
  9261.  
  9262. template < typename _Tp1 >
  9263. new_allocator ( const new_allocator < _Tp1 > & ) noexcept { }
  9264.  
  9265. ~ new_allocator ( ) noexcept { }
  9266.  
  9267. pointer
  9268. address ( reference __x ) const noexcept
  9269. { return std :: __addressof ( __x ) ; }
  9270.  
  9271. const_pointer
  9272. address ( const_reference __x ) const noexcept
  9273. { return std :: __addressof ( __x ) ; }
  9274.  
  9275.  
  9276.  
  9277. pointer
  9278. allocate ( size_type __n , const void * = 0 )
  9279. {
  9280. if ( __n > this -> max_size ( ) )
  9281. std :: __throw_bad_alloc ( ) ;
  9282.  
  9283. return static_cast < _Tp * > ( :: operator new ( __n * sizeof ( _Tp ) ) ) ;
  9284. }
  9285.  
  9286.  
  9287. void
  9288. deallocate ( pointer __p , size_type )
  9289. { :: operator delete ( __p ) ; }
  9290.  
  9291. size_type
  9292. max_size ( ) const noexcept
  9293. { return size_t ( - 1 ) / sizeof ( _Tp ) ; }
  9294.  
  9295.  
  9296. template < typename _Up , typename ... _Args >
  9297. void
  9298. construct ( _Up * __p , _Args && ... __args )
  9299. { :: new ( ( void * ) __p ) _Up ( std :: forward < _Args > ( __args ) ... ) ; }
  9300.  
  9301. template < typename _Up >
  9302. void
  9303. destroy ( _Up * __p ) { __p -> ~ _Up ( ) ; }
  9304. #135
  9305. } ;
  9306.  
  9307. template < typename _Tp >
  9308. inline bool
  9309. operator == ( const new_allocator < _Tp > & , const new_allocator < _Tp > & )
  9310. { return true ; }
  9311.  
  9312. template < typename _Tp >
  9313. inline bool
  9314. operator != ( const new_allocator < _Tp > & , const new_allocator < _Tp > & )
  9315. { return false ; }
  9316.  
  9317.  
  9318. }
  9319. #36 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/c++allocator.h"
  9320. namespace std
  9321. {
  9322. #47
  9323. template < typename _Tp >
  9324. using __allocator_base = __gnu_cxx :: new_allocator < _Tp > ;
  9325. }
  9326. #52 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/allocator.h"
  9327. namespace std
  9328. {
  9329. #62
  9330. template < >
  9331. class allocator < void >
  9332. {
  9333. public :
  9334. typedef size_t size_type ;
  9335. typedef ptrdiff_t difference_type ;
  9336. typedef void * pointer ;
  9337. typedef const void * const_pointer ;
  9338. typedef void value_type ;
  9339.  
  9340. template < typename _Tp1 >
  9341. struct rebind
  9342. { typedef allocator < _Tp1 > other ; } ;
  9343.  
  9344.  
  9345.  
  9346.  
  9347. typedef true_type propagate_on_container_move_assignment ;
  9348.  
  9349. } ;
  9350. #91
  9351. template < typename _Tp >
  9352. class allocator : public __allocator_base < _Tp >
  9353. {
  9354. public :
  9355. typedef size_t size_type ;
  9356. typedef ptrdiff_t difference_type ;
  9357. typedef _Tp * pointer ;
  9358. typedef const _Tp * const_pointer ;
  9359. typedef _Tp & reference ;
  9360. typedef const _Tp & const_reference ;
  9361. typedef _Tp value_type ;
  9362.  
  9363. template < typename _Tp1 >
  9364. struct rebind
  9365. { typedef allocator < _Tp1 > other ; } ;
  9366.  
  9367.  
  9368.  
  9369.  
  9370. typedef true_type propagate_on_container_move_assignment ;
  9371.  
  9372.  
  9373. allocator ( ) throw ( ) { }
  9374.  
  9375. allocator ( const allocator & __a ) throw ( )
  9376. : __allocator_base < _Tp > ( __a ) { }
  9377.  
  9378. template < typename _Tp1 >
  9379. allocator ( const allocator < _Tp1 > & ) throw ( ) { }
  9380.  
  9381. ~ allocator ( ) throw ( ) { }
  9382.  
  9383.  
  9384. } ;
  9385.  
  9386. template < typename _T1 , typename _T2 >
  9387. inline bool
  9388. operator == ( const allocator < _T1 > & , const allocator < _T2 > & )
  9389. { return true ; }
  9390.  
  9391. template < typename _Tp >
  9392. inline bool
  9393. operator == ( const allocator < _Tp > & , const allocator < _Tp > & )
  9394. { return true ; }
  9395.  
  9396. template < typename _T1 , typename _T2 >
  9397. inline bool
  9398. operator != ( const allocator < _T1 > & , const allocator < _T2 > & )
  9399. { return false ; }
  9400.  
  9401. template < typename _Tp >
  9402. inline bool
  9403. operator != ( const allocator < _Tp > & , const allocator < _Tp > & )
  9404. { return false ; }
  9405. #151
  9406. extern template class allocator < char > ;
  9407. extern template class allocator < wchar_t > ;
  9408. #159
  9409. template < typename _Alloc , bool = __oracle_is_empty ( _Alloc ) >
  9410. struct __alloc_swap
  9411. { static void _S_do_it ( _Alloc & , _Alloc & ) { } } ;
  9412.  
  9413. template < typename _Alloc >
  9414. struct __alloc_swap < _Alloc , false >
  9415. {
  9416. static void
  9417. _S_do_it ( _Alloc & __one , _Alloc & __two )
  9418. {
  9419.  
  9420. if ( __one != __two )
  9421. swap ( __one , __two ) ;
  9422. }
  9423. } ;
  9424.  
  9425.  
  9426. template < typename _Alloc , bool = __oracle_is_empty ( _Alloc ) >
  9427. struct __alloc_neq
  9428. {
  9429. static bool
  9430. _S_do_it ( const _Alloc & , const _Alloc & )
  9431. { return false ; }
  9432. } ;
  9433.  
  9434. template < typename _Alloc >
  9435. struct __alloc_neq < _Alloc , false >
  9436. {
  9437. static bool
  9438. _S_do_it ( const _Alloc & __one , const _Alloc & __two )
  9439. { return __one != __two ; }
  9440. } ;
  9441.  
  9442.  
  9443. template < typename _Tp , bool
  9444. = __or_ < is_copy_constructible < typename _Tp :: value_type > ,
  9445. is_nothrow_move_constructible < typename _Tp :: value_type >> :: value >
  9446. struct __shrink_to_fit_aux
  9447. { static bool _S_do_it ( _Tp & ) { return false ; } } ;
  9448.  
  9449. template < typename _Tp >
  9450. struct __shrink_to_fit_aux < _Tp , true >
  9451. {
  9452. static bool
  9453. _S_do_it ( _Tp & __c )
  9454. {
  9455. try
  9456. {
  9457. _Tp ( __make_move_if_noexcept_iterator ( __c . begin ( ) ) ,
  9458. __make_move_if_noexcept_iterator ( __c . end ( ) ) ,
  9459. __c . get_allocator ( ) ) . swap ( __c ) ;
  9460. return true ;
  9461. }
  9462. catch ( ... )
  9463. { return false ; }
  9464. }
  9465. } ;
  9466.  
  9467.  
  9468.  
  9469. }
  9470. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/localefwd.h"
  9471. #37
  9472. #pragma GCC system_header
  9473. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/c++locale.h"
  9474. #39
  9475. #pragma GCC system_header
  9476. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/clocale"
  9477. #39
  9478. #pragma GCC system_header
  9479. #1 "/usr/include/locale.h"
  9480. #9
  9481. #pragma ident "@(#)locale.h 1.20    03/12/04 SMI"
  9482. #1 "/usr/include/iso/locale_iso.h"
  9483. #45
  9484. #pragma ident "@(#)locale_iso.h 1.3 03/12/04 SMI"
  9485. #50
  9486. extern "C" {
  9487.  
  9488.  
  9489.  
  9490. namespace std {
  9491.  
  9492.  
  9493. struct lconv {
  9494. char * decimal_point ;
  9495. char * thousands_sep ;
  9496. char * grouping ;
  9497. char * int_curr_symbol ;
  9498. char * currency_symbol ;
  9499. char * mon_decimal_point ;
  9500. char * mon_thousands_sep ;
  9501. char * mon_grouping ;
  9502. char * positive_sign ;
  9503. char * negative_sign ;
  9504. char int_frac_digits ;
  9505. char frac_digits ;
  9506. char p_cs_precedes ;
  9507. char p_sep_by_space ;
  9508. char n_cs_precedes ;
  9509. char n_sep_by_space ;
  9510. char p_sign_posn ;
  9511. char n_sign_posn ;
  9512. #91
  9513. } ;
  9514. #110
  9515. extern char * setlocale ( int , const char * ) ;
  9516. extern struct lconv * localeconv ( void ) ;
  9517. #118
  9518. }
  9519.  
  9520.  
  9521.  
  9522. }
  9523. #1 "/usr/include/libintl.h"
  9524. #11
  9525. #pragma ident "@(#)libintl.h    1.16    04/09/28 SMI"
  9526. #16
  9527. extern "C" {
  9528. #48
  9529. extern char * dcgettext ( const char * , const char * , const int ) ;
  9530. extern char * dgettext ( const char * , const char * ) ;
  9531. extern char * gettext ( const char * ) ;
  9532. extern char * textdomain ( const char * ) ;
  9533. extern char * bindtextdomain ( const char * , const char * ) ;
  9534.  
  9535.  
  9536.  
  9537.  
  9538.  
  9539. extern char * dcngettext ( const char * , const char * ,
  9540. const char * , unsigned long int , int ) ;
  9541. extern char * dngettext ( const char * , const char * ,
  9542. const char * , unsigned long int ) ;
  9543. extern char * ngettext ( const char * , const char * , unsigned long int ) ;
  9544. extern char * bind_textdomain_codeset ( const char * , const char * ) ;
  9545.  
  9546.  
  9547.  
  9548. extern int wdinit ( void ) ;
  9549. extern int wdchkind ( wchar_t ) ;
  9550. extern int wdbindf ( wchar_t , wchar_t , int ) ;
  9551. extern wchar_t * wddelim ( wchar_t , wchar_t , int ) ;
  9552. extern wchar_t mcfiller ( void ) ;
  9553. extern int mcwrap ( void ) ;
  9554. #102
  9555. }
  9556. #58 "/usr/include/locale.h"
  9557. using std :: lconv ;
  9558. using std :: setlocale ;
  9559. using std :: localeconv ;
  9560.  
  9561.  
  9562.  
  9563. extern "C" {
  9564. #74
  9565. }
  9566. #51 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/clocale"
  9567. namespace std
  9568. {
  9569. using :: lconv ;
  9570. using :: setlocale ;
  9571. using :: localeconv ;
  9572. }
  9573. #45 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/c++locale.h"
  9574. namespace std
  9575. {
  9576.  
  9577.  
  9578. typedef int * __c_locale ;
  9579.  
  9580.  
  9581.  
  9582.  
  9583.  
  9584. inline int
  9585. __convert_from_v ( const __c_locale & , char * __out ,
  9586. const int __size __attribute__ ( ( __unused__ ) ) ,
  9587. const char * __fmt , ... )
  9588. {
  9589. char * __old = std :: setlocale ( 1 , 0 ) ;
  9590. char * __sav = 0 ;
  9591. if ( __builtin_strcmp ( __old , "C" ) )
  9592. {
  9593. const size_t __len = __builtin_strlen ( __old ) + 1 ;
  9594. __sav = new char [ __len ] ;
  9595. __builtin_memcpy ( __sav , __old , __len ) ;
  9596. std :: setlocale ( 1 , "C" ) ;
  9597. }
  9598.  
  9599. __builtin_va_list __args ;
  9600. __builtin_va_start ( __args , __fmt ) ;
  9601.  
  9602.  
  9603. const int __ret = __builtin_vsnprintf ( __out , __size , __fmt , __args ) ;
  9604.  
  9605.  
  9606.  
  9607.  
  9608. ( ( void ) 0 ) ;
  9609.  
  9610. if ( __sav )
  9611. {
  9612. std :: setlocale ( 1 , __sav ) ;
  9613. delete [ ] __sav ;
  9614. }
  9615. return __ret ;
  9616. }
  9617.  
  9618.  
  9619. }
  9620. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/iosfwd"
  9621. #36
  9622. #pragma GCC system_header
  9623. #42
  9624. namespace std
  9625. {
  9626. #74
  9627. class ios_base ;
  9628.  
  9629. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9630. class basic_ios ;
  9631.  
  9632. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9633. class basic_streambuf ;
  9634.  
  9635. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9636. class basic_istream ;
  9637.  
  9638. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9639. class basic_ostream ;
  9640.  
  9641. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9642. class basic_iostream ;
  9643.  
  9644. template < typename _CharT , typename _Traits = char_traits < _CharT > ,
  9645. typename _Alloc = allocator < _CharT > >
  9646. class basic_stringbuf ;
  9647.  
  9648. template < typename _CharT , typename _Traits = char_traits < _CharT > ,
  9649. typename _Alloc = allocator < _CharT > >
  9650. class basic_istringstream ;
  9651.  
  9652. template < typename _CharT , typename _Traits = char_traits < _CharT > ,
  9653. typename _Alloc = allocator < _CharT > >
  9654. class basic_ostringstream ;
  9655.  
  9656. template < typename _CharT , typename _Traits = char_traits < _CharT > ,
  9657. typename _Alloc = allocator < _CharT > >
  9658. class basic_stringstream ;
  9659.  
  9660. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9661. class basic_filebuf ;
  9662.  
  9663. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9664. class basic_ifstream ;
  9665.  
  9666. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9667. class basic_ofstream ;
  9668.  
  9669. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9670. class basic_fstream ;
  9671.  
  9672. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9673. class istreambuf_iterator ;
  9674.  
  9675. template < typename _CharT , typename _Traits = char_traits < _CharT > >
  9676. class ostreambuf_iterator ;
  9677.  
  9678.  
  9679.  
  9680. typedef basic_ios < char > ios ;
  9681.  
  9682.  
  9683. typedef basic_streambuf < char > streambuf ;
  9684.  
  9685.  
  9686. typedef basic_istream < char > istream ;
  9687.  
  9688.  
  9689. typedef basic_ostream < char > ostream ;
  9690.  
  9691.  
  9692. typedef basic_iostream < char > iostream ;
  9693.  
  9694.  
  9695. typedef basic_stringbuf < char > stringbuf ;
  9696.  
  9697.  
  9698. typedef basic_istringstream < char > istringstream ;
  9699.  
  9700.  
  9701. typedef basic_ostringstream < char > ostringstream ;
  9702.  
  9703.  
  9704. typedef basic_stringstream < char > stringstream ;
  9705.  
  9706.  
  9707. typedef basic_filebuf < char > filebuf ;
  9708.  
  9709.  
  9710. typedef basic_ifstream < char > ifstream ;
  9711.  
  9712.  
  9713. typedef basic_ofstream < char > ofstream ;
  9714.  
  9715.  
  9716. typedef basic_fstream < char > fstream ;
  9717.  
  9718.  
  9719.  
  9720. typedef basic_ios < wchar_t > wios ;
  9721.  
  9722.  
  9723. typedef basic_streambuf < wchar_t > wstreambuf ;
  9724.  
  9725.  
  9726. typedef basic_istream < wchar_t > wistream ;
  9727.  
  9728.  
  9729. typedef basic_ostream < wchar_t > wostream ;
  9730.  
  9731.  
  9732. typedef basic_iostream < wchar_t > wiostream ;
  9733.  
  9734.  
  9735. typedef basic_stringbuf < wchar_t > wstringbuf ;
  9736.  
  9737.  
  9738. typedef basic_istringstream < wchar_t > wistringstream ;
  9739.  
  9740.  
  9741. typedef basic_ostringstream < wchar_t > wostringstream ;
  9742.  
  9743.  
  9744. typedef basic_stringstream < wchar_t > wstringstream ;
  9745.  
  9746.  
  9747. typedef basic_filebuf < wchar_t > wfilebuf ;
  9748.  
  9749.  
  9750. typedef basic_ifstream < wchar_t > wifstream ;
  9751.  
  9752.  
  9753. typedef basic_ofstream < wchar_t > wofstream ;
  9754.  
  9755.  
  9756. typedef basic_fstream < wchar_t > wfstream ;
  9757.  
  9758.  
  9759.  
  9760.  
  9761. }
  9762. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cctype"
  9763. #39
  9764. #pragma GCC system_header
  9765. #62
  9766. namespace std
  9767. {
  9768. using :: isalnum ;
  9769. using :: isalpha ;
  9770. using :: iscntrl ;
  9771. using :: isdigit ;
  9772. using :: isgraph ;
  9773. using :: islower ;
  9774. using :: isprint ;
  9775. using :: ispunct ;
  9776. using :: isspace ;
  9777. using :: isupper ;
  9778. using :: isxdigit ;
  9779. using :: tolower ;
  9780. using :: toupper ;
  9781. }
  9782. #85
  9783. namespace std
  9784. {
  9785. using :: isblank ;
  9786. }
  9787. #44 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/localefwd.h"
  9788. namespace std
  9789. {
  9790. #55
  9791. class locale ;
  9792.  
  9793. template < typename _Facet >
  9794. bool
  9795. has_facet ( const locale & ) throw ( ) ;
  9796.  
  9797. template < typename _Facet >
  9798. const _Facet &
  9799. use_facet ( const locale & ) ;
  9800.  
  9801.  
  9802. template < typename _CharT >
  9803. bool
  9804. isspace ( _CharT , const locale & ) ;
  9805.  
  9806. template < typename _CharT >
  9807. bool
  9808. isprint ( _CharT , const locale & ) ;
  9809.  
  9810. template < typename _CharT >
  9811. bool
  9812. iscntrl ( _CharT , const locale & ) ;
  9813.  
  9814. template < typename _CharT >
  9815. bool
  9816. isupper ( _CharT , const locale & ) ;
  9817.  
  9818. template < typename _CharT >
  9819. bool
  9820. islower ( _CharT , const locale & ) ;
  9821.  
  9822. template < typename _CharT >
  9823. bool
  9824. isalpha ( _CharT , const locale & ) ;
  9825.  
  9826. template < typename _CharT >
  9827. bool
  9828. isdigit ( _CharT , const locale & ) ;
  9829.  
  9830. template < typename _CharT >
  9831. bool
  9832. ispunct ( _CharT , const locale & ) ;
  9833.  
  9834. template < typename _CharT >
  9835. bool
  9836. isxdigit ( _CharT , const locale & ) ;
  9837.  
  9838. template < typename _CharT >
  9839. bool
  9840. isalnum ( _CharT , const locale & ) ;
  9841.  
  9842. template < typename _CharT >
  9843. bool
  9844. isgraph ( _CharT , const locale & ) ;
  9845.  
  9846. template < typename _CharT >
  9847. _CharT
  9848. toupper ( _CharT , const locale & ) ;
  9849.  
  9850. template < typename _CharT >
  9851. _CharT
  9852. tolower ( _CharT , const locale & ) ;
  9853.  
  9854.  
  9855. class ctype_base ;
  9856. template < typename _CharT >
  9857. class ctype ;
  9858. template < > class ctype < char > ;
  9859.  
  9860. template < > class ctype < wchar_t > ;
  9861.  
  9862. template < typename _CharT >
  9863. class ctype_byname ;
  9864.  
  9865.  
  9866. class codecvt_base ;
  9867. template < typename _InternT , typename _ExternT , typename _StateT >
  9868. class codecvt ;
  9869. template < > class codecvt < char , char , mbstate_t > ;
  9870.  
  9871. template < > class codecvt < wchar_t , char , mbstate_t > ;
  9872.  
  9873. template < typename _InternT , typename _ExternT , typename _StateT >
  9874. class codecvt_byname ;
  9875.  
  9876.  
  9877.  
  9878. template < typename _CharT , typename _InIter = istreambuf_iterator < _CharT > >
  9879. class num_get ;
  9880. template < typename _CharT , typename _OutIter = ostreambuf_iterator < _CharT > >
  9881. class num_put ;
  9882.  
  9883. template < typename _CharT > class numpunct ;
  9884. template < typename _CharT > class numpunct_byname ;
  9885.  
  9886.  
  9887. template < typename _CharT >
  9888. class collate ;
  9889. template < typename _CharT > class
  9890. collate_byname ;
  9891.  
  9892.  
  9893. class time_base ;
  9894. template < typename _CharT , typename _InIter = istreambuf_iterator < _CharT > >
  9895. class time_get ;
  9896. template < typename _CharT , typename _InIter = istreambuf_iterator < _CharT > >
  9897. class time_get_byname ;
  9898. template < typename _CharT , typename _OutIter = ostreambuf_iterator < _CharT > >
  9899. class time_put ;
  9900. template < typename _CharT , typename _OutIter = ostreambuf_iterator < _CharT > >
  9901. class time_put_byname ;
  9902.  
  9903.  
  9904. class money_base ;
  9905.  
  9906. template < typename _CharT , typename _InIter = istreambuf_iterator < _CharT > >
  9907. class money_get ;
  9908. template < typename _CharT , typename _OutIter = ostreambuf_iterator < _CharT > >
  9909. class money_put ;
  9910.  
  9911. template < typename _CharT , bool _Intl = false >
  9912. class moneypunct ;
  9913. template < typename _CharT , bool _Intl = false >
  9914. class moneypunct_byname ;
  9915.  
  9916.  
  9917. class messages_base ;
  9918. template < typename _CharT >
  9919. class messages ;
  9920. template < typename _CharT >
  9921. class messages_byname ;
  9922.  
  9923.  
  9924. }
  9925. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/ostream_insert.h"
  9926. #33
  9927. #pragma GCC system_header
  9928. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/cxxabi_forced.h"
  9929. #34
  9930. #pragma GCC system_header
  9931.  
  9932. #pragma GCC visibility push ( default )
  9933.  
  9934.  
  9935. namespace __cxxabiv1
  9936. {
  9937. #48
  9938. class __forced_unwind
  9939. {
  9940. virtual ~ __forced_unwind ( ) throw ( ) ;
  9941.  
  9942.  
  9943. virtual void __pure_dummy ( ) = 0 ;
  9944. } ;
  9945. }
  9946.  
  9947.  
  9948. #pragma GCC visibility pop
  9949. #38 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/ostream_insert.h"
  9950. namespace std
  9951. {
  9952.  
  9953.  
  9954. template < typename _CharT , typename _Traits >
  9955. inline void
  9956. __ostream_write ( basic_ostream < _CharT , _Traits > & __out ,
  9957. const _CharT * __s , streamsize __n )
  9958. {
  9959. typedef basic_ostream < _CharT , _Traits > __ostream_type ;
  9960. typedef typename __ostream_type :: ios_base __ios_base ;
  9961.  
  9962. const streamsize __put = __out . rdbuf ( ) -> sputn ( __s , __n ) ;
  9963. if ( __put != __n )
  9964. __out . setstate ( __ios_base :: badbit ) ;
  9965. }
  9966.  
  9967. template < typename _CharT , typename _Traits >
  9968. inline void
  9969. __ostream_fill ( basic_ostream < _CharT , _Traits > & __out , streamsize __n )
  9970. {
  9971. typedef basic_ostream < _CharT , _Traits > __ostream_type ;
  9972. typedef typename __ostream_type :: ios_base __ios_base ;
  9973.  
  9974. const _CharT __c = __out . fill ( ) ;
  9975. for ( ; __n > 0 ; -- __n )
  9976. {
  9977. const typename _Traits :: int_type __put = __out . rdbuf ( ) -> sputc ( __c ) ;
  9978. if ( _Traits :: eq_int_type ( __put , _Traits :: eof ( ) ) )
  9979. {
  9980. __out . setstate ( __ios_base :: badbit ) ;
  9981. break ;
  9982. }
  9983. }
  9984. }
  9985.  
  9986. template < typename _CharT , typename _Traits >
  9987. basic_ostream < _CharT , _Traits > &
  9988. __ostream_insert ( basic_ostream < _CharT , _Traits > & __out ,
  9989. const _CharT * __s , streamsize __n )
  9990. {
  9991. typedef basic_ostream < _CharT , _Traits > __ostream_type ;
  9992. typedef typename __ostream_type :: ios_base __ios_base ;
  9993.  
  9994. typename __ostream_type :: sentry __cerb ( __out ) ;
  9995. if ( __cerb )
  9996. {
  9997. try
  9998. {
  9999. const streamsize __w = __out . width ( ) ;
  10000. if ( __w > __n )
  10001. {
  10002. const bool __left = ( ( __out . flags ( )
  10003. & __ios_base :: adjustfield )
  10004. == __ios_base :: left ) ;
  10005. if ( ! __left )
  10006. __ostream_fill ( __out , __w - __n ) ;
  10007. if ( __out . good ( ) )
  10008. __ostream_write ( __out , __s , __n ) ;
  10009. if ( __left && __out . good ( ) )
  10010. __ostream_fill ( __out , __w - __n ) ;
  10011. }
  10012. else
  10013. __ostream_write ( __out , __s , __n ) ;
  10014. __out . width ( 0 ) ;
  10015. }
  10016. catch ( __cxxabiv1 :: __forced_unwind & )
  10017. {
  10018. __out . _M_setstate ( __ios_base :: badbit ) ;
  10019. throw ;
  10020. }
  10021. catch ( ... )
  10022. { __out . _M_setstate ( __ios_base :: badbit ) ; }
  10023. }
  10024. return __out ;
  10025. }
  10026.  
  10027.  
  10028.  
  10029.  
  10030. extern template ostream & __ostream_insert ( ostream & , const char * , streamsize ) ;
  10031.  
  10032.  
  10033. extern template wostream & __ostream_insert ( wostream & , const wchar_t * ,
  10034. streamsize ) ;
  10035.  
  10036.  
  10037.  
  10038.  
  10039. }
  10040. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_function.h"
  10041. #59
  10042. namespace std
  10043. {
  10044. #100
  10045. template < typename _Arg , typename _Result >
  10046. struct unary_function
  10047. {
  10048.  
  10049. typedef _Arg argument_type ;
  10050.  
  10051.  
  10052. typedef _Result result_type ;
  10053. } ;
  10054.  
  10055.  
  10056.  
  10057.  
  10058. template < typename _Arg1 , typename _Arg2 , typename _Result >
  10059. struct binary_function
  10060. {
  10061.  
  10062. typedef _Arg1 first_argument_type ;
  10063.  
  10064.  
  10065. typedef _Arg2 second_argument_type ;
  10066.  
  10067.  
  10068. typedef _Result result_type ;
  10069. } ;
  10070. #139
  10071. template < typename _Tp >
  10072. struct plus : public binary_function < _Tp , _Tp , _Tp >
  10073. {
  10074. _Tp
  10075. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10076. { return __x + __y ; }
  10077. } ;
  10078.  
  10079.  
  10080. template < typename _Tp >
  10081. struct minus : public binary_function < _Tp , _Tp , _Tp >
  10082. {
  10083. _Tp
  10084. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10085. { return __x - __y ; }
  10086. } ;
  10087.  
  10088.  
  10089. template < typename _Tp >
  10090. struct multiplies : public binary_function < _Tp , _Tp , _Tp >
  10091. {
  10092. _Tp
  10093. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10094. { return __x * __y ; }
  10095. } ;
  10096.  
  10097.  
  10098. template < typename _Tp >
  10099. struct divides : public binary_function < _Tp , _Tp , _Tp >
  10100. {
  10101. _Tp
  10102. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10103. { return __x / __y ; }
  10104. } ;
  10105.  
  10106.  
  10107. template < typename _Tp >
  10108. struct modulus : public binary_function < _Tp , _Tp , _Tp >
  10109. {
  10110. _Tp
  10111. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10112. { return __x % __y ; }
  10113. } ;
  10114.  
  10115.  
  10116. template < typename _Tp >
  10117. struct negate : public unary_function < _Tp , _Tp >
  10118. {
  10119. _Tp
  10120. operator ( ) ( const _Tp & __x ) const
  10121. { return - __x ; }
  10122. } ;
  10123. #203
  10124. template < typename _Tp >
  10125. struct equal_to : public binary_function < _Tp , _Tp , bool >
  10126. {
  10127. bool
  10128. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10129. { return __x == __y ; }
  10130. } ;
  10131.  
  10132.  
  10133. template < typename _Tp >
  10134. struct not_equal_to : public binary_function < _Tp , _Tp , bool >
  10135. {
  10136. bool
  10137. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10138. { return __x != __y ; }
  10139. } ;
  10140.  
  10141.  
  10142. template < typename _Tp >
  10143. struct greater : public binary_function < _Tp , _Tp , bool >
  10144. {
  10145. bool
  10146. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10147. { return __x > __y ; }
  10148. } ;
  10149.  
  10150.  
  10151. template < typename _Tp >
  10152. struct less : public binary_function < _Tp , _Tp , bool >
  10153. {
  10154. bool
  10155. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10156. { return __x < __y ; }
  10157. } ;
  10158.  
  10159.  
  10160. template < typename _Tp >
  10161. struct greater_equal : public binary_function < _Tp , _Tp , bool >
  10162. {
  10163. bool
  10164. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10165. { return __x >= __y ; }
  10166. } ;
  10167.  
  10168.  
  10169. template < typename _Tp >
  10170. struct less_equal : public binary_function < _Tp , _Tp , bool >
  10171. {
  10172. bool
  10173. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10174. { return __x <= __y ; }
  10175. } ;
  10176. #267
  10177. template < typename _Tp >
  10178. struct logical_and : public binary_function < _Tp , _Tp , bool >
  10179. {
  10180. bool
  10181. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10182. { return __x && __y ; }
  10183. } ;
  10184.  
  10185.  
  10186. template < typename _Tp >
  10187. struct logical_or : public binary_function < _Tp , _Tp , bool >
  10188. {
  10189. bool
  10190. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10191. { return __x || __y ; }
  10192. } ;
  10193.  
  10194.  
  10195. template < typename _Tp >
  10196. struct logical_not : public unary_function < _Tp , bool >
  10197. {
  10198. bool
  10199. operator ( ) ( const _Tp & __x ) const
  10200. { return ! __x ; }
  10201. } ;
  10202.  
  10203.  
  10204.  
  10205.  
  10206. template < typename _Tp >
  10207. struct bit_and : public binary_function < _Tp , _Tp , _Tp >
  10208. {
  10209. _Tp
  10210. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10211. { return __x & __y ; }
  10212. } ;
  10213.  
  10214. template < typename _Tp >
  10215. struct bit_or : public binary_function < _Tp , _Tp , _Tp >
  10216. {
  10217. _Tp
  10218. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10219. { return __x | __y ; }
  10220. } ;
  10221.  
  10222. template < typename _Tp >
  10223. struct bit_xor : public binary_function < _Tp , _Tp , _Tp >
  10224. {
  10225. _Tp
  10226. operator ( ) ( const _Tp & __x , const _Tp & __y ) const
  10227. { return __x ^ __y ; }
  10228. } ;
  10229. #350
  10230. template < typename _Predicate >
  10231. class unary_negate
  10232. : public unary_function < typename _Predicate :: argument_type , bool >
  10233. {
  10234. protected :
  10235. _Predicate _M_pred ;
  10236.  
  10237. public :
  10238. explicit
  10239. unary_negate ( const _Predicate & __x ) : _M_pred ( __x ) { }
  10240.  
  10241. bool
  10242. operator ( ) ( const typename _Predicate :: argument_type & __x ) const
  10243. { return ! _M_pred ( __x ) ; }
  10244. } ;
  10245.  
  10246.  
  10247. template < typename _Predicate >
  10248. inline unary_negate < _Predicate >
  10249. not1 ( const _Predicate & __pred )
  10250. { return unary_negate < _Predicate > ( __pred ) ; }
  10251.  
  10252.  
  10253. template < typename _Predicate >
  10254. class binary_negate
  10255. : public binary_function < typename _Predicate :: first_argument_type ,
  10256. typename _Predicate :: second_argument_type , bool >
  10257. {
  10258. protected :
  10259. _Predicate _M_pred ;
  10260.  
  10261. public :
  10262. explicit
  10263. binary_negate ( const _Predicate & __x ) : _M_pred ( __x ) { }
  10264.  
  10265. bool
  10266. operator ( ) ( const typename _Predicate :: first_argument_type & __x ,
  10267. const typename _Predicate :: second_argument_type & __y ) const
  10268. { return ! _M_pred ( __x , __y ) ; }
  10269. } ;
  10270.  
  10271.  
  10272. template < typename _Predicate >
  10273. inline binary_negate < _Predicate >
  10274. not2 ( const _Predicate & __pred )
  10275. { return binary_negate < _Predicate > ( __pred ) ; }
  10276. #421
  10277. template < typename _Arg , typename _Result >
  10278. class pointer_to_unary_function : public unary_function < _Arg , _Result >
  10279. {
  10280. protected :
  10281. _Result ( * _M_ptr ) ( _Arg ) ;
  10282.  
  10283. public :
  10284. pointer_to_unary_function ( ) { }
  10285.  
  10286. explicit
  10287. pointer_to_unary_function ( _Result ( * __x ) ( _Arg ) )
  10288. : _M_ptr ( __x ) { }
  10289.  
  10290. _Result
  10291. operator ( ) ( _Arg __x ) const
  10292. { return _M_ptr ( __x ) ; }
  10293. } ;
  10294.  
  10295.  
  10296. template < typename _Arg , typename _Result >
  10297. inline pointer_to_unary_function < _Arg , _Result >
  10298. ptr_fun ( _Result ( * __x ) ( _Arg ) )
  10299. { return pointer_to_unary_function < _Arg , _Result > ( __x ) ; }
  10300.  
  10301.  
  10302. template < typename _Arg1 , typename _Arg2 , typename _Result >
  10303. class pointer_to_binary_function
  10304. : public binary_function < _Arg1 , _Arg2 , _Result >
  10305. {
  10306. protected :
  10307. _Result ( * _M_ptr ) ( _Arg1 , _Arg2 ) ;
  10308.  
  10309. public :
  10310. pointer_to_binary_function ( ) { }
  10311.  
  10312. explicit
  10313. pointer_to_binary_function ( _Result ( * __x ) ( _Arg1 , _Arg2 ) )
  10314. : _M_ptr ( __x ) { }
  10315.  
  10316. _Result
  10317. operator ( ) ( _Arg1 __x , _Arg2 __y ) const
  10318. { return _M_ptr ( __x , __y ) ; }
  10319. } ;
  10320.  
  10321.  
  10322. template < typename _Arg1 , typename _Arg2 , typename _Result >
  10323. inline pointer_to_binary_function < _Arg1 , _Arg2 , _Result >
  10324. ptr_fun ( _Result ( * __x ) ( _Arg1 , _Arg2 ) )
  10325. { return pointer_to_binary_function < _Arg1 , _Arg2 , _Result > ( __x ) ; }
  10326.  
  10327.  
  10328. template < typename _Tp >
  10329. struct _Identity
  10330. : public unary_function < _Tp , _Tp >
  10331. {
  10332. _Tp &
  10333. operator ( ) ( _Tp & __x ) const
  10334. { return __x ; }
  10335.  
  10336. const _Tp &
  10337. operator ( ) ( const _Tp & __x ) const
  10338. { return __x ; }
  10339. } ;
  10340.  
  10341. template < typename _Pair >
  10342. struct _Select1st
  10343. : public unary_function < _Pair , typename _Pair :: first_type >
  10344. {
  10345. typename _Pair :: first_type &
  10346. operator ( ) ( _Pair & __x ) const
  10347. { return __x . first ; }
  10348.  
  10349. const typename _Pair :: first_type &
  10350. operator ( ) ( const _Pair & __x ) const
  10351. { return __x . first ; }
  10352.  
  10353.  
  10354. template < typename _Pair2 >
  10355. typename _Pair2 :: first_type &
  10356. operator ( ) ( _Pair2 & __x ) const
  10357. { return __x . first ; }
  10358.  
  10359. template < typename _Pair2 >
  10360. const typename _Pair2 :: first_type &
  10361. operator ( ) ( const _Pair2 & __x ) const
  10362. { return __x . first ; }
  10363.  
  10364. } ;
  10365.  
  10366. template < typename _Pair >
  10367. struct _Select2nd
  10368. : public unary_function < _Pair , typename _Pair :: second_type >
  10369. {
  10370. typename _Pair :: second_type &
  10371. operator ( ) ( _Pair & __x ) const
  10372. { return __x . second ; }
  10373.  
  10374. const typename _Pair :: second_type &
  10375. operator ( ) ( const _Pair & __x ) const
  10376. { return __x . second ; }
  10377. } ;
  10378. #541
  10379. template < typename _Ret , typename _Tp >
  10380. class mem_fun_t : public unary_function < _Tp * , _Ret >
  10381. {
  10382. public :
  10383. explicit
  10384. mem_fun_t ( _Ret ( _Tp :: * __pf ) ( ) )
  10385. : _M_f ( __pf ) { }
  10386.  
  10387. _Ret
  10388. operator ( ) ( _Tp * __p ) const
  10389. { return ( __p ->* _M_f ) ( ) ; }
  10390.  
  10391. private :
  10392. _Ret ( _Tp :: * _M_f ) ( ) ;
  10393. } ;
  10394.  
  10395.  
  10396.  
  10397. template < typename _Ret , typename _Tp >
  10398. class const_mem_fun_t : public unary_function < const _Tp * , _Ret >
  10399. {
  10400. public :
  10401. explicit
  10402. const_mem_fun_t ( _Ret ( _Tp :: * __pf ) ( ) const )
  10403. : _M_f ( __pf ) { }
  10404.  
  10405. _Ret
  10406. operator ( ) ( const _Tp * __p ) const
  10407. { return ( __p ->* _M_f ) ( ) ; }
  10408.  
  10409. private :
  10410. _Ret ( _Tp :: * _M_f ) ( ) const ;
  10411. } ;
  10412.  
  10413.  
  10414.  
  10415. template < typename _Ret , typename _Tp >
  10416. class mem_fun_ref_t : public unary_function < _Tp , _Ret >
  10417. {
  10418. public :
  10419. explicit
  10420. mem_fun_ref_t ( _Ret ( _Tp :: * __pf ) ( ) )
  10421. : _M_f ( __pf ) { }
  10422.  
  10423. _Ret
  10424. operator ( ) ( _Tp & __r ) const
  10425. { return ( __r .* _M_f ) ( ) ; }
  10426.  
  10427. private :
  10428. _Ret ( _Tp :: * _M_f ) ( ) ;
  10429. } ;
  10430.  
  10431.  
  10432.  
  10433. template < typename _Ret , typename _Tp >
  10434. class const_mem_fun_ref_t : public unary_function < _Tp , _Ret >
  10435. {
  10436. public :
  10437. explicit
  10438. const_mem_fun_ref_t ( _Ret ( _Tp :: * __pf ) ( ) const )
  10439. : _M_f ( __pf ) { }
  10440.  
  10441. _Ret
  10442. operator ( ) ( const _Tp & __r ) const
  10443. { return ( __r .* _M_f ) ( ) ; }
  10444.  
  10445. private :
  10446. _Ret ( _Tp :: * _M_f ) ( ) const ;
  10447. } ;
  10448.  
  10449.  
  10450.  
  10451. template < typename _Ret , typename _Tp , typename _Arg >
  10452. class mem_fun1_t : public binary_function < _Tp * , _Arg , _Ret >
  10453. {
  10454. public :
  10455. explicit
  10456. mem_fun1_t ( _Ret ( _Tp :: * __pf ) ( _Arg ) )
  10457. : _M_f ( __pf ) { }
  10458.  
  10459. _Ret
  10460. operator ( ) ( _Tp * __p , _Arg __x ) const
  10461. { return ( __p ->* _M_f ) ( __x ) ; }
  10462.  
  10463. private :
  10464. _Ret ( _Tp :: * _M_f ) ( _Arg ) ;
  10465. } ;
  10466.  
  10467.  
  10468.  
  10469. template < typename _Ret , typename _Tp , typename _Arg >
  10470. class const_mem_fun1_t : public binary_function < const _Tp * , _Arg , _Ret >
  10471. {
  10472. public :
  10473. explicit
  10474. const_mem_fun1_t ( _Ret ( _Tp :: * __pf ) ( _Arg ) const )
  10475. : _M_f ( __pf ) { }
  10476.  
  10477. _Ret
  10478. operator ( ) ( const _Tp * __p , _Arg __x ) const
  10479. { return ( __p ->* _M_f ) ( __x ) ; }
  10480.  
  10481. private :
  10482. _Ret ( _Tp :: * _M_f ) ( _Arg ) const ;
  10483. } ;
  10484.  
  10485.  
  10486.  
  10487. template < typename _Ret , typename _Tp , typename _Arg >
  10488. class mem_fun1_ref_t : public binary_function < _Tp , _Arg , _Ret >
  10489. {
  10490. public :
  10491. explicit
  10492. mem_fun1_ref_t ( _Ret ( _Tp :: * __pf ) ( _Arg ) )
  10493. : _M_f ( __pf ) { }
  10494.  
  10495. _Ret
  10496. operator ( ) ( _Tp & __r , _Arg __x ) const
  10497. { return ( __r .* _M_f ) ( __x ) ; }
  10498.  
  10499. private :
  10500. _Ret ( _Tp :: * _M_f ) ( _Arg ) ;
  10501. } ;
  10502.  
  10503.  
  10504.  
  10505. template < typename _Ret , typename _Tp , typename _Arg >
  10506. class const_mem_fun1_ref_t : public binary_function < _Tp , _Arg , _Ret >
  10507. {
  10508. public :
  10509. explicit
  10510. const_mem_fun1_ref_t ( _Ret ( _Tp :: * __pf ) ( _Arg ) const )
  10511. : _M_f ( __pf ) { }
  10512.  
  10513. _Ret
  10514. operator ( ) ( const _Tp & __r , _Arg __x ) const
  10515. { return ( __r .* _M_f ) ( __x ) ; }
  10516.  
  10517. private :
  10518. _Ret ( _Tp :: * _M_f ) ( _Arg ) const ;
  10519. } ;
  10520.  
  10521.  
  10522.  
  10523. template < typename _Ret , typename _Tp >
  10524. inline mem_fun_t < _Ret , _Tp >
  10525. mem_fun ( _Ret ( _Tp :: * __f ) ( ) )
  10526. { return mem_fun_t < _Ret , _Tp > ( __f ) ; }
  10527.  
  10528. template < typename _Ret , typename _Tp >
  10529. inline const_mem_fun_t < _Ret , _Tp >
  10530. mem_fun ( _Ret ( _Tp :: * __f ) ( ) const )
  10531. { return const_mem_fun_t < _Ret , _Tp > ( __f ) ; }
  10532.  
  10533. template < typename _Ret , typename _Tp >
  10534. inline mem_fun_ref_t < _Ret , _Tp >
  10535. mem_fun_ref ( _Ret ( _Tp :: * __f ) ( ) )
  10536. { return mem_fun_ref_t < _Ret , _Tp > ( __f ) ; }
  10537.  
  10538. template < typename _Ret , typename _Tp >
  10539. inline const_mem_fun_ref_t < _Ret , _Tp >
  10540. mem_fun_ref ( _Ret ( _Tp :: * __f ) ( ) const )
  10541. { return const_mem_fun_ref_t < _Ret , _Tp > ( __f ) ; }
  10542.  
  10543. template < typename _Ret , typename _Tp , typename _Arg >
  10544. inline mem_fun1_t < _Ret , _Tp , _Arg >
  10545. mem_fun ( _Ret ( _Tp :: * __f ) ( _Arg ) )
  10546. { return mem_fun1_t < _Ret , _Tp , _Arg > ( __f ) ; }
  10547.  
  10548. template < typename _Ret , typename _Tp , typename _Arg >
  10549. inline const_mem_fun1_t < _Ret , _Tp , _Arg >
  10550. mem_fun ( _Ret ( _Tp :: * __f ) ( _Arg ) const )
  10551. { return const_mem_fun1_t < _Ret , _Tp , _Arg > ( __f ) ; }
  10552.  
  10553. template < typename _Ret , typename _Tp , typename _Arg >
  10554. inline mem_fun1_ref_t < _Ret , _Tp , _Arg >
  10555. mem_fun_ref ( _Ret ( _Tp :: * __f ) ( _Arg ) )
  10556. { return mem_fun1_ref_t < _Ret , _Tp , _Arg > ( __f ) ; }
  10557.  
  10558. template < typename _Ret , typename _Tp , typename _Arg >
  10559. inline const_mem_fun1_ref_t < _Ret , _Tp , _Arg >
  10560. mem_fun_ref ( _Ret ( _Tp :: * __f ) ( _Arg ) const )
  10561. { return const_mem_fun1_ref_t < _Ret , _Tp , _Arg > ( __f ) ; }
  10562.  
  10563.  
  10564.  
  10565.  
  10566. }
  10567. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/backward/binders.h"
  10568. #59
  10569. namespace std
  10570. {
  10571. #103
  10572. template < typename _Operation >
  10573. class binder1st
  10574. : public unary_function < typename _Operation :: second_argument_type ,
  10575. typename _Operation :: result_type >
  10576. {
  10577. protected :
  10578. _Operation op ;
  10579. typename _Operation :: first_argument_type value ;
  10580.  
  10581. public :
  10582. binder1st ( const _Operation & __x ,
  10583. const typename _Operation :: first_argument_type & __y )
  10584. : op ( __x ) , value ( __y ) { }
  10585.  
  10586. typename _Operation :: result_type
  10587. operator ( ) ( const typename _Operation :: second_argument_type & __x ) const
  10588. { return op ( value , __x ) ; }
  10589.  
  10590.  
  10591.  
  10592. typename _Operation :: result_type
  10593. operator ( ) ( typename _Operation :: second_argument_type & __x ) const
  10594. { return op ( value , __x ) ; }
  10595. } __attribute__ ( ( __deprecated__ ) ) ;
  10596.  
  10597.  
  10598. template < typename _Operation , typename _Tp >
  10599. inline binder1st < _Operation >
  10600. bind1st ( const _Operation & __fn , const _Tp & __x )
  10601. {
  10602. typedef typename _Operation :: first_argument_type _Arg1_type ;
  10603. return binder1st < _Operation > ( __fn , _Arg1_type ( __x ) ) ;
  10604. }
  10605.  
  10606.  
  10607. template < typename _Operation >
  10608. class binder2nd
  10609. : public unary_function < typename _Operation :: first_argument_type ,
  10610. typename _Operation :: result_type >
  10611. {
  10612. protected :
  10613. _Operation op ;
  10614. typename _Operation :: second_argument_type value ;
  10615.  
  10616. public :
  10617. binder2nd ( const _Operation & __x ,
  10618. const typename _Operation :: second_argument_type & __y )
  10619. : op ( __x ) , value ( __y ) { }
  10620.  
  10621. typename _Operation :: result_type
  10622. operator ( ) ( const typename _Operation :: first_argument_type & __x ) const
  10623. { return op ( __x , value ) ; }
  10624.  
  10625.  
  10626.  
  10627. typename _Operation :: result_type
  10628. operator ( ) ( typename _Operation :: first_argument_type & __x ) const
  10629. { return op ( __x , value ) ; }
  10630. } __attribute__ ( ( __deprecated__ ) ) ;
  10631.  
  10632.  
  10633. template < typename _Operation , typename _Tp >
  10634. inline binder2nd < _Operation >
  10635. bind2nd ( const _Operation & __fn , const _Tp & __x )
  10636. {
  10637. typedef typename _Operation :: second_argument_type _Arg2_type ;
  10638. return binder2nd < _Operation > ( __fn , _Arg2_type ( __x ) ) ;
  10639. }
  10640.  
  10641.  
  10642.  
  10643. }
  10644. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/range_access.h"
  10645. #33
  10646. #pragma GCC system_header
  10647.  
  10648.  
  10649.  
  10650. namespace std
  10651. {
  10652. #46
  10653. template < class _Container >
  10654. inline auto
  10655. begin ( _Container & __cont ) -> decltype ( __cont . begin ( ) )
  10656. { return __cont . begin ( ) ; }
  10657. #56
  10658. template < class _Container >
  10659. inline auto
  10660. begin ( const _Container & __cont ) -> decltype ( __cont . begin ( ) )
  10661. { return __cont . begin ( ) ; }
  10662. #66
  10663. template < class _Container >
  10664. inline auto
  10665. end ( _Container & __cont ) -> decltype ( __cont . end ( ) )
  10666. { return __cont . end ( ) ; }
  10667. #76
  10668. template < class _Container >
  10669. inline auto
  10670. end ( const _Container & __cont ) -> decltype ( __cont . end ( ) )
  10671. { return __cont . end ( ) ; }
  10672.  
  10673.  
  10674.  
  10675.  
  10676.  
  10677. template < class _Tp , size_t _Nm >
  10678. inline _Tp *
  10679. begin ( _Tp ( & __arr ) [ _Nm ] )
  10680. { return __arr ; }
  10681. #95
  10682. template < class _Tp , size_t _Nm >
  10683. inline _Tp *
  10684. end ( _Tp ( & __arr ) [ _Nm ] )
  10685. { return __arr + _Nm ; }
  10686.  
  10687.  
  10688. }
  10689. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_string.h"
  10690. #37
  10691. #pragma GCC system_header
  10692. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/atomicity.h"
  10693. #32
  10694. #pragma GCC system_header
  10695. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/gthr.h"
  10696. #30
  10697. #pragma GCC visibility push ( default )
  10698. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/gthr-default.h"
  10699. #1 "/usr/include/pthread.h"
  10700. #9
  10701. #pragma ident "@(#)pthread.h    1.37    04/09/28 SMI"
  10702. #1 "/usr/include/sched.h"
  10703. #9
  10704. #pragma ident "@(#)sched.h  1.10    03/03/06 SMI"
  10705. #15
  10706. extern "C" {
  10707.  
  10708.  
  10709. struct sched_param {
  10710. int sched_priority ;
  10711. int sched_nicelim ;
  10712. int sched_nice ;
  10713. int sched_pad [ 6 ] ;
  10714.  
  10715.  
  10716.  
  10717. } ;
  10718. #42
  10719. int sched_getparam ( pid_t , struct sched_param * ) ;
  10720. int sched_setparam ( pid_t , const struct sched_param * ) ;
  10721. int sched_getscheduler ( pid_t ) ;
  10722. int sched_setscheduler ( pid_t , int , const struct sched_param * ) ;
  10723. int sched_yield ( void ) ;
  10724. int sched_get_priority_max ( int ) ;
  10725. int sched_get_priority_min ( int ) ;
  10726. int sched_rr_get_interval ( pid_t , struct timespec * ) ;
  10727. #62
  10728. }
  10729. #20 "/usr/include/pthread.h"
  10730. extern "C" {
  10731. #120
  10732. typedef struct _cleanup {
  10733. uintptr_t pthread_cleanup_pad [ 4 ] ;
  10734. } _cleanup_t ;
  10735.  
  10736.  
  10737.  
  10738. void __pthread_cleanup_push ( void ( * ) ( void * ) , void * , caddr_t , _cleanup_t * ) ;
  10739. void __pthread_cleanup_pop ( int , _cleanup_t * ) ;
  10740. caddr_t _getfp ( void ) ;
  10741. #139
  10742. extern "C" {
  10743.  
  10744.  
  10745. typedef void ( * _Voidfp ) ( void * ) ;
  10746.  
  10747.  
  10748. }
  10749. #170
  10750. extern int pthread_atfork ( void ( * ) ( void ) , void ( * ) ( void ) , void ( * ) ( void ) ) ;
  10751. extern int pthread_attr_init ( pthread_attr_t * ) ;
  10752. extern int pthread_attr_destroy ( pthread_attr_t * ) ;
  10753. extern int pthread_attr_setstack ( pthread_attr_t * , void * , size_t ) ;
  10754. extern int pthread_attr_getstack ( const pthread_attr_t * ,
  10755. void * * , size_t * ) ;
  10756. extern int pthread_attr_setstacksize ( pthread_attr_t * , size_t ) ;
  10757. extern int pthread_attr_getstacksize ( const pthread_attr_t * ,
  10758. size_t * ) ;
  10759. extern int pthread_attr_setstackaddr ( pthread_attr_t * , void * ) ;
  10760. extern int pthread_attr_getstackaddr ( const pthread_attr_t * ,
  10761. void * * ) ;
  10762. extern int pthread_attr_setdetachstate ( pthread_attr_t * , int ) ;
  10763. extern int pthread_attr_getdetachstate ( const pthread_attr_t * , int * ) ;
  10764. extern int pthread_attr_setscope ( pthread_attr_t * , int ) ;
  10765. extern int pthread_attr_getscope ( const pthread_attr_t * ,
  10766. int * ) ;
  10767. extern int pthread_attr_setinheritsched ( pthread_attr_t * , int ) ;
  10768. extern int pthread_attr_getinheritsched ( const pthread_attr_t * ,
  10769. int * ) ;
  10770. extern int pthread_attr_setschedpolicy ( pthread_attr_t * , int ) ;
  10771. extern int pthread_attr_getschedpolicy ( const pthread_attr_t * ,
  10772. int * ) ;
  10773. extern int pthread_attr_setschedparam ( pthread_attr_t * ,
  10774. const struct sched_param * ) ;
  10775. extern int pthread_attr_getschedparam ( const pthread_attr_t * ,
  10776. struct sched_param * ) ;
  10777. extern int pthread_create ( pthread_t * ,
  10778. const pthread_attr_t * , void * ( * ) ( void * ) ,
  10779. void * ) ;
  10780. extern int pthread_once ( pthread_once_t * , void ( * ) ( void ) ) ;
  10781. extern int pthread_join ( pthread_t , void * * ) ;
  10782. extern int pthread_detach ( pthread_t ) ;
  10783. extern void pthread_exit ( void * ) ;
  10784. extern int pthread_cancel ( pthread_t ) ;
  10785. extern int pthread_setschedparam ( pthread_t , int , const struct sched_param * ) ;
  10786. extern int pthread_getschedparam ( pthread_t , int * ,
  10787. struct sched_param * ) ;
  10788. extern int pthread_setschedprio ( pthread_t , int ) ;
  10789. extern int pthread_setcancelstate ( int , int * ) ;
  10790. extern int pthread_setcanceltype ( int , int * ) ;
  10791. extern void pthread_testcancel ( void ) ;
  10792. extern int pthread_equal ( pthread_t , pthread_t ) ;
  10793. extern int pthread_key_create ( pthread_key_t * , void ( * ) ( void * ) ) ;
  10794. extern int pthread_key_delete ( pthread_key_t ) ;
  10795. extern int pthread_setspecific ( pthread_key_t , const void * ) ;
  10796. extern void * pthread_getspecific ( pthread_key_t ) ;
  10797. extern pthread_t pthread_self ( void ) ;
  10798.  
  10799.  
  10800.  
  10801.  
  10802. extern int pthread_mutexattr_init ( pthread_mutexattr_t * ) ;
  10803. extern int pthread_mutexattr_destroy ( pthread_mutexattr_t * ) ;
  10804. extern int pthread_mutexattr_setpshared ( pthread_mutexattr_t * , int ) ;
  10805. extern int pthread_mutexattr_getpshared (
  10806. const pthread_mutexattr_t * , int * ) ;
  10807. extern int pthread_mutexattr_setprotocol ( pthread_mutexattr_t * , int ) ;
  10808. extern int pthread_mutexattr_getprotocol (
  10809. const pthread_mutexattr_t * , int * ) ;
  10810. extern int pthread_mutexattr_setprioceiling ( pthread_mutexattr_t * , int ) ;
  10811. extern int pthread_mutexattr_getprioceiling (
  10812. const pthread_mutexattr_t * , int * ) ;
  10813. extern int pthread_mutexattr_setrobust_np ( pthread_mutexattr_t * , int ) ;
  10814. extern int pthread_mutexattr_getrobust_np (
  10815. const pthread_mutexattr_t * , int * ) ;
  10816. extern int pthread_mutex_init ( pthread_mutex_t * ,
  10817. const pthread_mutexattr_t * ) ;
  10818. extern int pthread_mutex_consistent_np ( pthread_mutex_t * ) ;
  10819. extern int pthread_mutex_destroy ( pthread_mutex_t * ) ;
  10820. extern int pthread_mutex_lock ( pthread_mutex_t * ) ;
  10821. extern int pthread_mutex_timedlock ( pthread_mutex_t * ,
  10822. const struct timespec * ) ;
  10823. extern int pthread_mutex_reltimedlock_np ( pthread_mutex_t * ,
  10824. const struct timespec * ) ;
  10825. extern int pthread_mutex_unlock ( pthread_mutex_t * ) ;
  10826. extern int pthread_mutex_trylock ( pthread_mutex_t * ) ;
  10827. extern int pthread_mutex_setprioceiling ( pthread_mutex_t * ,
  10828. int , int * ) ;
  10829. extern int pthread_mutex_getprioceiling ( const pthread_mutex_t * ,
  10830. int * ) ;
  10831. extern int pthread_condattr_init ( pthread_condattr_t * ) ;
  10832. extern int pthread_condattr_destroy ( pthread_condattr_t * ) ;
  10833. extern int pthread_condattr_setclock ( pthread_condattr_t * , clockid_t ) ;
  10834. extern int pthread_condattr_getclock ( const pthread_condattr_t * ,
  10835. clockid_t * ) ;
  10836. extern int pthread_condattr_setpshared ( pthread_condattr_t * , int ) ;
  10837. extern int pthread_condattr_getpshared ( const pthread_condattr_t * ,
  10838. int * ) ;
  10839. extern int pthread_cond_init ( pthread_cond_t * ,
  10840. const pthread_condattr_t * ) ;
  10841. extern int pthread_cond_destroy ( pthread_cond_t * ) ;
  10842. extern int pthread_cond_broadcast ( pthread_cond_t * ) ;
  10843. extern int pthread_cond_signal ( pthread_cond_t * ) ;
  10844. extern int pthread_cond_wait ( pthread_cond_t * ,
  10845. pthread_mutex_t * ) ;
  10846. extern int pthread_cond_timedwait ( pthread_cond_t * ,
  10847. pthread_mutex_t * , const struct timespec * ) ;
  10848. extern int pthread_cond_reltimedwait_np ( pthread_cond_t * ,
  10849. pthread_mutex_t * , const struct timespec * ) ;
  10850. extern int pthread_attr_getguardsize ( const pthread_attr_t * ,
  10851. size_t * ) ;
  10852. extern int pthread_attr_setguardsize ( pthread_attr_t * , size_t ) ;
  10853. extern int pthread_getconcurrency ( void ) ;
  10854. extern int pthread_setconcurrency ( int ) ;
  10855. extern int pthread_mutexattr_settype ( pthread_mutexattr_t * , int ) ;
  10856. extern int pthread_mutexattr_gettype ( const pthread_mutexattr_t * ,
  10857. int * ) ;
  10858. extern int pthread_rwlock_init ( pthread_rwlock_t * ,
  10859. const pthread_rwlockattr_t * ) ;
  10860. extern int pthread_rwlock_destroy ( pthread_rwlock_t * ) ;
  10861. extern int pthread_rwlock_rdlock ( pthread_rwlock_t * ) ;
  10862. extern int pthread_rwlock_timedrdlock ( pthread_rwlock_t * ,
  10863. const struct timespec * ) ;
  10864. extern int pthread_rwlock_reltimedrdlock_np ( pthread_rwlock_t * ,
  10865. const struct timespec * ) ;
  10866. extern int pthread_rwlock_tryrdlock ( pthread_rwlock_t * ) ;
  10867. extern int pthread_rwlock_wrlock ( pthread_rwlock_t * ) ;
  10868. extern int pthread_rwlock_timedwrlock ( pthread_rwlock_t * ,
  10869. const struct timespec * ) ;
  10870. extern int pthread_rwlock_reltimedwrlock_np ( pthread_rwlock_t * ,
  10871. const struct timespec * ) ;
  10872. extern int pthread_rwlock_trywrlock ( pthread_rwlock_t * ) ;
  10873. extern int pthread_rwlock_unlock ( pthread_rwlock_t * ) ;
  10874. extern int pthread_rwlockattr_init ( pthread_rwlockattr_t * ) ;
  10875. extern int pthread_rwlockattr_destroy ( pthread_rwlockattr_t * ) ;
  10876. extern int pthread_rwlockattr_getpshared (
  10877. const pthread_rwlockattr_t * , int * ) ;
  10878. extern int pthread_rwlockattr_setpshared ( pthread_rwlockattr_t * , int ) ;
  10879. extern int pthread_spin_init ( pthread_spinlock_t * , int ) ;
  10880. extern int pthread_spin_destroy ( pthread_spinlock_t * ) ;
  10881. extern int pthread_spin_lock ( pthread_spinlock_t * ) ;
  10882. extern int pthread_spin_trylock ( pthread_spinlock_t * ) ;
  10883. extern int pthread_spin_unlock ( pthread_spinlock_t * ) ;
  10884. extern int pthread_barrierattr_init ( pthread_barrierattr_t * ) ;
  10885. extern int pthread_barrierattr_destroy ( pthread_barrierattr_t * ) ;
  10886. extern int pthread_barrierattr_setpshared ( pthread_barrierattr_t * , int ) ;
  10887. extern int pthread_barrierattr_getpshared (
  10888. const pthread_barrierattr_t * , int * ) ;
  10889. extern int pthread_barrier_init ( pthread_barrier_t * ,
  10890. const pthread_barrierattr_t * , uint_t ) ;
  10891. extern int pthread_barrier_destroy ( pthread_barrier_t * ) ;
  10892. extern int pthread_barrier_wait ( pthread_barrier_t * ) ;
  10893. #427
  10894. }
  10895. #47 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/gthr-default.h"
  10896. typedef pthread_t __gthread_t ;
  10897. typedef pthread_key_t __gthread_key_t ;
  10898. typedef pthread_once_t __gthread_once_t ;
  10899. typedef pthread_mutex_t __gthread_mutex_t ;
  10900. typedef pthread_mutex_t __gthread_recursive_mutex_t ;
  10901. typedef pthread_cond_t __gthread_cond_t ;
  10902. typedef struct timespec __gthread_time_t ;
  10903. #101
  10904. static __typeof ( pthread_once ) __gthrw_pthread_once __attribute__ ( ( __weakref__ ( "pthread_once" ) ) ) ;
  10905. static __typeof ( pthread_getspecific ) __gthrw_pthread_getspecific __attribute__ ( ( __weakref__ ( "pthread_getspecific"
  10906. #102
  10907. ) ) ) ;
  10908. static __typeof ( pthread_setspecific ) __gthrw_pthread_setspecific __attribute__ ( ( __weakref__ ( "pthread_setspecific"
  10909. #103
  10910. ) ) ) ;
  10911.  
  10912. static __typeof ( pthread_create ) __gthrw_pthread_create __attribute__ ( ( __weakref__ ( "pthread_create" ) ) ) ;
  10913. static __typeof ( pthread_join ) __gthrw_pthread_join __attribute__ ( ( __weakref__ ( "pthread_join" ) ) ) ;
  10914. static __typeof ( pthread_equal ) __gthrw_pthread_equal __attribute__ ( ( __weakref__ ( "pthread_equal" ) ) ) ;
  10915. static __typeof ( pthread_self ) __gthrw_pthread_self __attribute__ ( ( __weakref__ ( "pthread_self" ) ) ) ;
  10916. static __typeof ( pthread_detach ) __gthrw_pthread_detach __attribute__ ( ( __weakref__ ( "pthread_detach" ) ) ) ;
  10917.  
  10918. static __typeof ( pthread_cancel ) __gthrw_pthread_cancel __attribute__ ( ( __weakref__ ( "pthread_cancel" ) ) ) ;
  10919.  
  10920. static __typeof ( sched_yield ) __gthrw_sched_yield __attribute__ ( ( __weakref__ ( "sched_yield" ) ) ) ;
  10921.  
  10922. static __typeof ( pthread_mutex_lock ) __gthrw_pthread_mutex_lock __attribute__ ( ( __weakref__ ( "pthread_mutex_lock" )
  10923. #115
  10924. ) ) ;
  10925. static __typeof ( pthread_mutex_trylock ) __gthrw_pthread_mutex_trylock __attribute__ ( ( __weakref__ ( "pthread_mutex_trylock"
  10926. #116
  10927. ) ) ) ;
  10928.  
  10929. static __typeof ( pthread_mutex_timedlock ) __gthrw_pthread_mutex_timedlock __attribute__ ( ( __weakref__ ( "pthread_mutex_timedlock"
  10930. #118
  10931. ) ) ) ;
  10932.  
  10933. static __typeof ( pthread_mutex_unlock ) __gthrw_pthread_mutex_unlock __attribute__ ( ( __weakref__ ( "pthread_mutex_unlock"
  10934. #120
  10935. ) ) ) ;
  10936. static __typeof ( pthread_mutex_init ) __gthrw_pthread_mutex_init __attribute__ ( ( __weakref__ ( "pthread_mutex_init" )
  10937. #121
  10938. ) ) ;
  10939. static __typeof ( pthread_mutex_destroy ) __gthrw_pthread_mutex_destroy __attribute__ ( ( __weakref__ ( "pthread_mutex_destroy"
  10940. #122
  10941. ) ) ) ;
  10942.  
  10943. static __typeof ( pthread_cond_init ) __gthrw_pthread_cond_init __attribute__ ( ( __weakref__ ( "pthread_cond_init" ) ) )
  10944. #124
  10945. ;
  10946. static __typeof ( pthread_cond_broadcast ) __gthrw_pthread_cond_broadcast __attribute__ ( ( __weakref__ ( "pthread_cond_broadcast"
  10947. #125
  10948. ) ) ) ;
  10949. static __typeof ( pthread_cond_signal ) __gthrw_pthread_cond_signal __attribute__ ( ( __weakref__ ( "pthread_cond_signal"
  10950. #126
  10951. ) ) ) ;
  10952. static __typeof ( pthread_cond_wait ) __gthrw_pthread_cond_wait __attribute__ ( ( __weakref__ ( "pthread_cond_wait" ) ) )
  10953. #127
  10954. ;
  10955. static __typeof ( pthread_cond_timedwait ) __gthrw_pthread_cond_timedwait __attribute__ ( ( __weakref__ ( "pthread_cond_timedwait"
  10956. #128
  10957. ) ) ) ;
  10958. static __typeof ( pthread_cond_destroy ) __gthrw_pthread_cond_destroy __attribute__ ( ( __weakref__ ( "pthread_cond_destroy"
  10959. #129
  10960. ) ) ) ;
  10961.  
  10962. static __typeof ( pthread_key_create ) __gthrw_pthread_key_create __attribute__ ( ( __weakref__ ( "pthread_key_create" )
  10963. #131
  10964. ) ) ;
  10965. static __typeof ( pthread_key_delete ) __gthrw_pthread_key_delete __attribute__ ( ( __weakref__ ( "pthread_key_delete" )
  10966. #132
  10967. ) ) ;
  10968. static __typeof ( pthread_mutexattr_init ) __gthrw_pthread_mutexattr_init __attribute__ ( ( __weakref__ ( "pthread_mutexattr_init"
  10969. #133
  10970. ) ) ) ;
  10971. static __typeof ( pthread_mutexattr_settype ) __gthrw_pthread_mutexattr_settype __attribute__ ( ( __weakref__ ( "pthread_mutexattr_settype"
  10972. #134
  10973. ) ) ) ;
  10974. static __typeof ( pthread_mutexattr_destroy ) __gthrw_pthread_mutexattr_destroy __attribute__ ( ( __weakref__ ( "pthread_mutexattr_destroy"
  10975. #135
  10976. ) ) ) ;
  10977. #246
  10978. static inline int
  10979. __gthread_active_p ( void )
  10980. {
  10981. static void * const __gthread_active_ptr
  10982. = ( void * ) & __gthrw_pthread_cancel ;
  10983. return __gthread_active_ptr != 0 ;
  10984. }
  10985. #658
  10986. static inline int
  10987. __gthread_create ( __gthread_t * __threadid , void * ( * __func ) ( void * ) ,
  10988. void * __args )
  10989. {
  10990. return __gthrw_pthread_create ( __threadid , 0L , __func , __args ) ;
  10991. }
  10992.  
  10993. static inline int
  10994. __gthread_join ( __gthread_t __threadid , void * * __value_ptr )
  10995. {
  10996. return __gthrw_pthread_join ( __threadid , __value_ptr ) ;
  10997. }
  10998.  
  10999. static inline int
  11000. __gthread_detach ( __gthread_t __threadid )
  11001. {
  11002. return __gthrw_pthread_detach ( __threadid ) ;
  11003. }
  11004.  
  11005. static inline int
  11006. __gthread_equal ( __gthread_t __t1 , __gthread_t __t2 )
  11007. {
  11008. return __gthrw_pthread_equal ( __t1 , __t2 ) ;
  11009. }
  11010.  
  11011. static inline __gthread_t
  11012. __gthread_self ( void )
  11013. {
  11014. return __gthrw_pthread_self ( ) ;
  11015. }
  11016.  
  11017. static inline int
  11018. __gthread_yield ( void )
  11019. {
  11020. return __gthrw_sched_yield ( ) ;
  11021. }
  11022.  
  11023. static inline int
  11024. __gthread_once ( __gthread_once_t * __once , void ( * __func ) ( void ) )
  11025. {
  11026. if ( __gthread_active_p ( ) )
  11027. return __gthrw_pthread_once ( __once , __func ) ;
  11028. else
  11029. return - 1 ;
  11030. }
  11031.  
  11032. static inline int
  11033. __gthread_key_create ( __gthread_key_t * __key , void ( * __dtor ) ( void * ) )
  11034. {
  11035. return __gthrw_pthread_key_create ( __key , __dtor ) ;
  11036. }
  11037.  
  11038. static inline int
  11039. __gthread_key_delete ( __gthread_key_t __key )
  11040. {
  11041. return __gthrw_pthread_key_delete ( __key ) ;
  11042. }
  11043.  
  11044. static inline void *
  11045. __gthread_getspecific ( __gthread_key_t __key )
  11046. {
  11047. return __gthrw_pthread_getspecific ( __key ) ;
  11048. }
  11049.  
  11050. static inline int
  11051. __gthread_setspecific ( __gthread_key_t __key , const void * __ptr )
  11052. {
  11053. return __gthrw_pthread_setspecific ( __key , __ptr ) ;
  11054. }
  11055.  
  11056. static inline void
  11057. __gthread_mutex_init_function ( __gthread_mutex_t * __mutex )
  11058. {
  11059. if ( __gthread_active_p ( ) )
  11060. __gthrw_pthread_mutex_init ( __mutex , 0L ) ;
  11061. }
  11062.  
  11063. static inline int
  11064. __gthread_mutex_destroy ( __gthread_mutex_t * __mutex )
  11065. {
  11066. if ( __gthread_active_p ( ) )
  11067. return __gthrw_pthread_mutex_destroy ( __mutex ) ;
  11068. else
  11069. return 0 ;
  11070. }
  11071.  
  11072. static inline int
  11073. __gthread_mutex_lock ( __gthread_mutex_t * __mutex )
  11074. {
  11075. if ( __gthread_active_p ( ) )
  11076. return __gthrw_pthread_mutex_lock ( __mutex ) ;
  11077. else
  11078. return 0 ;
  11079. }
  11080.  
  11081. static inline int
  11082. __gthread_mutex_trylock ( __gthread_mutex_t * __mutex )
  11083. {
  11084. if ( __gthread_active_p ( ) )
  11085. return __gthrw_pthread_mutex_trylock ( __mutex ) ;
  11086. else
  11087. return 0 ;
  11088. }
  11089.  
  11090.  
  11091. static inline int
  11092. __gthread_mutex_timedlock ( __gthread_mutex_t * __mutex ,
  11093. const __gthread_time_t * __abs_timeout )
  11094. {
  11095. if ( __gthread_active_p ( ) )
  11096. return __gthrw_pthread_mutex_timedlock ( __mutex , __abs_timeout ) ;
  11097. else
  11098. return 0 ;
  11099. }
  11100.  
  11101.  
  11102. static inline int
  11103. __gthread_mutex_unlock ( __gthread_mutex_t * __mutex )
  11104. {
  11105. if ( __gthread_active_p ( ) )
  11106. return __gthrw_pthread_mutex_unlock ( __mutex ) ;
  11107. else
  11108. return 0 ;
  11109. }
  11110.  
  11111.  
  11112.  
  11113. static inline int
  11114. __gthread_recursive_mutex_init_function ( __gthread_recursive_mutex_t * __mutex )
  11115. {
  11116. if ( __gthread_active_p ( ) )
  11117. {
  11118. pthread_mutexattr_t __attr ;
  11119. int __r ;
  11120.  
  11121. __r = __gthrw_pthread_mutexattr_init ( & __attr ) ;
  11122. if ( ! __r )
  11123. __r = __gthrw_pthread_mutexattr_settype ( & __attr ,
  11124. 0x4 ) ;
  11125. if ( ! __r )
  11126. __r = __gthrw_pthread_mutex_init ( __mutex , & __attr ) ;
  11127. if ( ! __r )
  11128. __r = __gthrw_pthread_mutexattr_destroy ( & __attr ) ;
  11129. return __r ;
  11130. }
  11131. return 0 ;
  11132. }
  11133.  
  11134.  
  11135. static inline int
  11136. __gthread_recursive_mutex_lock ( __gthread_recursive_mutex_t * __mutex )
  11137. {
  11138. return __gthread_mutex_lock ( __mutex ) ;
  11139. }
  11140.  
  11141. static inline int
  11142. __gthread_recursive_mutex_trylock ( __gthread_recursive_mutex_t * __mutex )
  11143. {
  11144. return __gthread_mutex_trylock ( __mutex ) ;
  11145. }
  11146.  
  11147.  
  11148. static inline int
  11149. __gthread_recursive_mutex_timedlock ( __gthread_recursive_mutex_t * __mutex ,
  11150. const __gthread_time_t * __abs_timeout )
  11151. {
  11152. return __gthread_mutex_timedlock ( __mutex , __abs_timeout ) ;
  11153. }
  11154.  
  11155.  
  11156. static inline int
  11157. __gthread_recursive_mutex_unlock ( __gthread_recursive_mutex_t * __mutex )
  11158. {
  11159. return __gthread_mutex_unlock ( __mutex ) ;
  11160. }
  11161.  
  11162. static inline int
  11163. __gthread_recursive_mutex_destroy ( __gthread_recursive_mutex_t * __mutex )
  11164. {
  11165. return __gthread_mutex_destroy ( __mutex ) ;
  11166. }
  11167.  
  11168.  
  11169. static inline void
  11170. __gthread_cond_init_function ( __gthread_cond_t * __cond )
  11171. {
  11172. if ( __gthread_active_p ( ) )
  11173. __gthrw_pthread_cond_init ( __cond , 0L ) ;
  11174. }
  11175.  
  11176.  
  11177. static inline int
  11178. __gthread_cond_broadcast ( __gthread_cond_t * __cond )
  11179. {
  11180. return __gthrw_pthread_cond_broadcast ( __cond ) ;
  11181. }
  11182.  
  11183. static inline int
  11184. __gthread_cond_signal ( __gthread_cond_t * __cond )
  11185. {
  11186. return __gthrw_pthread_cond_signal ( __cond ) ;
  11187. }
  11188.  
  11189. static inline int
  11190. __gthread_cond_wait ( __gthread_cond_t * __cond , __gthread_mutex_t * __mutex )
  11191. {
  11192. return __gthrw_pthread_cond_wait ( __cond , __mutex ) ;
  11193. }
  11194.  
  11195. static inline int
  11196. __gthread_cond_timedwait ( __gthread_cond_t * __cond , __gthread_mutex_t * __mutex ,
  11197. const __gthread_time_t * __abs_timeout )
  11198. {
  11199. return __gthrw_pthread_cond_timedwait ( __cond , __mutex , __abs_timeout ) ;
  11200. }
  11201.  
  11202. static inline int
  11203. __gthread_cond_wait_recursive ( __gthread_cond_t * __cond ,
  11204. __gthread_recursive_mutex_t * __mutex )
  11205. {
  11206. return __gthread_cond_wait ( __cond , __mutex ) ;
  11207. }
  11208.  
  11209. static inline int
  11210. __gthread_cond_destroy ( __gthread_cond_t * __cond )
  11211. {
  11212. return __gthrw_pthread_cond_destroy ( __cond ) ;
  11213. }
  11214. #151 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/gthr.h"
  11215. #pragma GCC visibility pop
  11216. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/atomic_word.h"
  11217. #32
  11218. typedef int _Atomic_word ;
  11219. #38 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/atomicity.h"
  11220. namespace __gnu_cxx
  11221. {
  11222. #55
  11223. _Atomic_word
  11224. __attribute__ ( ( __unused__ ) )
  11225. __exchange_and_add ( volatile _Atomic_word * , int ) throw ( ) ;
  11226.  
  11227. void
  11228. __attribute__ ( ( __unused__ ) )
  11229. __atomic_add ( volatile _Atomic_word * , int ) throw ( ) ;
  11230.  
  11231.  
  11232. static inline _Atomic_word
  11233. __exchange_and_add_single ( _Atomic_word * __mem , int __val )
  11234. {
  11235. _Atomic_word __result = * __mem ;
  11236. * __mem += __val ;
  11237. return __result ;
  11238. }
  11239.  
  11240. static inline void
  11241. __atomic_add_single ( _Atomic_word * __mem , int __val )
  11242. { * __mem += __val ; }
  11243.  
  11244. static inline _Atomic_word
  11245. __attribute__ ( ( __unused__ ) )
  11246. __exchange_and_add_dispatch ( _Atomic_word * __mem , int __val )
  11247. {
  11248.  
  11249. if ( __gthread_active_p ( ) )
  11250. return __exchange_and_add ( __mem , __val ) ;
  11251. else
  11252. return __exchange_and_add_single ( __mem , __val ) ;
  11253.  
  11254.  
  11255.  
  11256. }
  11257.  
  11258. static inline void
  11259. __attribute__ ( ( __unused__ ) )
  11260. __atomic_add_dispatch ( _Atomic_word * __mem , int __val )
  11261. {
  11262.  
  11263. if ( __gthread_active_p ( ) )
  11264. __atomic_add ( __mem , __val ) ;
  11265. else
  11266. __atomic_add_single ( __mem , __val ) ;
  11267.  
  11268.  
  11269.  
  11270. }
  11271.  
  11272.  
  11273. }
  11274. #45 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_string.h"
  11275. namespace std
  11276. {
  11277. #111
  11278. template < typename _CharT , typename _Traits , typename _Alloc >
  11279. class basic_string
  11280. {
  11281. typedef typename _Alloc :: template rebind < _CharT > :: other _CharT_alloc_type ;
  11282.  
  11283.  
  11284. public :
  11285. typedef _Traits traits_type ;
  11286. typedef typename _Traits :: char_type value_type ;
  11287. typedef _Alloc allocator_type ;
  11288. typedef typename _CharT_alloc_type :: size_type size_type ;
  11289. typedef typename _CharT_alloc_type :: difference_type difference_type ;
  11290. typedef typename _CharT_alloc_type :: reference reference ;
  11291. typedef typename _CharT_alloc_type :: const_reference const_reference ;
  11292. typedef typename _CharT_alloc_type :: pointer pointer ;
  11293. typedef typename _CharT_alloc_type :: const_pointer const_pointer ;
  11294. typedef __gnu_cxx :: __normal_iterator < pointer , basic_string > iterator ;
  11295. typedef __gnu_cxx :: __normal_iterator < const_pointer , basic_string >
  11296. const_iterator ;
  11297. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  11298. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  11299.  
  11300. private :
  11301. #148
  11302. struct _Rep_base
  11303. {
  11304. size_type _M_length ;
  11305. size_type _M_capacity ;
  11306. _Atomic_word _M_refcount ;
  11307. } ;
  11308.  
  11309. struct _Rep : _Rep_base
  11310. {
  11311.  
  11312. typedef typename _Alloc :: template rebind < char > :: other _Raw_bytes_alloc ;
  11313. #173
  11314. static const size_type _S_max_size ;
  11315. static const _CharT _S_terminal ;
  11316.  
  11317.  
  11318.  
  11319. static size_type _S_empty_rep_storage [ ] ;
  11320.  
  11321. static _Rep &
  11322. _S_empty_rep ( )
  11323. {
  11324.  
  11325.  
  11326.  
  11327. void * __p = reinterpret_cast < void * > ( & _S_empty_rep_storage ) ;
  11328. return * reinterpret_cast < _Rep * > ( __p ) ;
  11329. }
  11330.  
  11331. bool
  11332. _M_is_leaked ( ) const
  11333. { return this -> _M_refcount < 0 ; }
  11334.  
  11335. bool
  11336. _M_is_shared ( ) const
  11337. { return this -> _M_refcount > 0 ; }
  11338.  
  11339. void
  11340. _M_set_leaked ( )
  11341. { this -> _M_refcount = - 1 ; }
  11342.  
  11343. void
  11344. _M_set_sharable ( )
  11345. { this -> _M_refcount = 0 ; }
  11346.  
  11347. void
  11348. _M_set_length_and_sharable ( size_type __n )
  11349. {
  11350.  
  11351. if ( this != & _S_empty_rep ( ) )
  11352.  
  11353. {
  11354. this -> _M_set_sharable ( ) ;
  11355. this -> _M_length = __n ;
  11356. traits_type :: assign ( this -> _M_refdata ( ) [ __n ] , _S_terminal ) ;
  11357.  
  11358.  
  11359. }
  11360. }
  11361.  
  11362. _CharT *
  11363. _M_refdata ( ) throw ( )
  11364. { return reinterpret_cast < _CharT * > ( this + 1 ) ; }
  11365.  
  11366. _CharT *
  11367. _M_grab ( const _Alloc & __alloc1 , const _Alloc & __alloc2 )
  11368. {
  11369. return ( ! _M_is_leaked ( ) && __alloc1 == __alloc2 )
  11370. ? _M_refcopy ( ) : _M_clone ( __alloc1 ) ;
  11371. }
  11372.  
  11373.  
  11374. static _Rep *
  11375. _S_create ( size_type , size_type , const _Alloc & ) ;
  11376.  
  11377. void
  11378. _M_dispose ( const _Alloc & __a )
  11379. {
  11380.  
  11381. if ( this != & _S_empty_rep ( ) )
  11382.  
  11383. {
  11384.  
  11385. ;
  11386. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & this -> _M_refcount ,
  11387. - 1 ) <= 0 )
  11388. {
  11389. ;
  11390. _M_destroy ( __a ) ;
  11391. }
  11392. }
  11393. }
  11394.  
  11395. void
  11396. _M_destroy ( const _Alloc & ) throw ( ) ;
  11397.  
  11398. _CharT *
  11399. _M_refcopy ( ) throw ( )
  11400. {
  11401.  
  11402. if ( this != & _S_empty_rep ( ) )
  11403.  
  11404. __gnu_cxx :: __atomic_add_dispatch ( & this -> _M_refcount , 1 ) ;
  11405. return _M_refdata ( ) ;
  11406. }
  11407.  
  11408. _CharT *
  11409. _M_clone ( const _Alloc & , size_type __res = 0 ) ;
  11410. } ;
  11411.  
  11412.  
  11413. struct _Alloc_hider : _Alloc
  11414. {
  11415. _Alloc_hider ( _CharT * __dat , const _Alloc & __a )
  11416. : _Alloc ( __a ) , _M_p ( __dat ) { }
  11417.  
  11418. _CharT * _M_p ;
  11419. } ;
  11420.  
  11421. public :
  11422.  
  11423.  
  11424.  
  11425.  
  11426. static const size_type npos = static_cast < size_type > ( - 1 ) ;
  11427.  
  11428. private :
  11429.  
  11430. mutable _Alloc_hider _M_dataplus ;
  11431.  
  11432. _CharT *
  11433. _M_data ( ) const
  11434. { return _M_dataplus . _M_p ; }
  11435.  
  11436. _CharT *
  11437. _M_data ( _CharT * __p )
  11438. { return ( _M_dataplus . _M_p = __p ) ; }
  11439.  
  11440. _Rep *
  11441. _M_rep ( ) const
  11442. { return & ( ( reinterpret_cast < _Rep * > ( _M_data ( ) ) ) [ - 1 ] ) ; }
  11443.  
  11444.  
  11445.  
  11446. iterator
  11447. _M_ibegin ( ) const
  11448. { return iterator ( _M_data ( ) ) ; }
  11449.  
  11450. iterator
  11451. _M_iend ( ) const
  11452. { return iterator ( _M_data ( ) + this -> size ( ) ) ; }
  11453.  
  11454. void
  11455. _M_leak ( )
  11456. {
  11457. if ( ! _M_rep ( ) -> _M_is_leaked ( ) )
  11458. _M_leak_hard ( ) ;
  11459. }
  11460.  
  11461. size_type
  11462. _M_check ( size_type __pos , const char * __s ) const
  11463. {
  11464. if ( __pos > this -> size ( ) )
  11465. __throw_out_of_range ( ( __s ) ) ;
  11466. return __pos ;
  11467. }
  11468.  
  11469. void
  11470. _M_check_length ( size_type __n1 , size_type __n2 , const char * __s ) const
  11471. {
  11472. if ( this -> max_size ( ) - ( this -> size ( ) - __n1 ) < __n2 )
  11473. __throw_length_error ( ( __s ) ) ;
  11474. }
  11475.  
  11476.  
  11477. size_type
  11478. _M_limit ( size_type __pos , size_type __off ) const
  11479. {
  11480. const bool __testoff = __off < this -> size ( ) - __pos ;
  11481. return __testoff ? __off : this -> size ( ) - __pos ;
  11482. }
  11483.  
  11484.  
  11485. bool
  11486. _M_disjunct ( const _CharT * __s ) const
  11487. {
  11488. return ( less < const _CharT * > ( ) ( __s , _M_data ( ) )
  11489. || less < const _CharT * > ( ) ( _M_data ( ) + this -> size ( ) , __s ) ) ;
  11490. }
  11491.  
  11492.  
  11493.  
  11494. static void
  11495. _M_copy ( _CharT * __d , const _CharT * __s , size_type __n )
  11496. {
  11497. if ( __n == 1 )
  11498. traits_type :: assign ( * __d , * __s ) ;
  11499. else
  11500. traits_type :: copy ( __d , __s , __n ) ;
  11501. }
  11502.  
  11503. static void
  11504. _M_move ( _CharT * __d , const _CharT * __s , size_type __n )
  11505. {
  11506. if ( __n == 1 )
  11507. traits_type :: assign ( * __d , * __s ) ;
  11508. else
  11509. traits_type :: move ( __d , __s , __n ) ;
  11510. }
  11511.  
  11512. static void
  11513. _M_assign ( _CharT * __d , size_type __n , _CharT __c )
  11514. {
  11515. if ( __n == 1 )
  11516. traits_type :: assign ( * __d , __c ) ;
  11517. else
  11518. traits_type :: assign ( __d , __n , __c ) ;
  11519. }
  11520.  
  11521.  
  11522.  
  11523. template < class _Iterator >
  11524. static void
  11525. _S_copy_chars ( _CharT * __p , _Iterator __k1 , _Iterator __k2 )
  11526. {
  11527. for ( ; __k1 != __k2 ; ++ __k1 , ++ __p )
  11528. traits_type :: assign ( * __p , * __k1 ) ;
  11529. }
  11530.  
  11531. static void
  11532. _S_copy_chars ( _CharT * __p , iterator __k1 , iterator __k2 )
  11533. { _S_copy_chars ( __p , __k1 . base ( ) , __k2 . base ( ) ) ; }
  11534.  
  11535. static void
  11536. _S_copy_chars ( _CharT * __p , const_iterator __k1 , const_iterator __k2 )
  11537. { _S_copy_chars ( __p , __k1 . base ( ) , __k2 . base ( ) ) ; }
  11538.  
  11539. static void
  11540. _S_copy_chars ( _CharT * __p , _CharT * __k1 , _CharT * __k2 )
  11541. { _M_copy ( __p , __k1 , __k2 - __k1 ) ; }
  11542.  
  11543. static void
  11544. _S_copy_chars ( _CharT * __p , const _CharT * __k1 , const _CharT * __k2 )
  11545. { _M_copy ( __p , __k1 , __k2 - __k1 ) ; }
  11546.  
  11547. static int
  11548. _S_compare ( size_type __n1 , size_type __n2 )
  11549. {
  11550. const difference_type __d = difference_type ( __n1 - __n2 ) ;
  11551.  
  11552. if ( __d > __gnu_cxx :: __numeric_traits < int > :: __max )
  11553. return __gnu_cxx :: __numeric_traits < int > :: __max ;
  11554. else if ( __d < __gnu_cxx :: __numeric_traits < int > :: __min )
  11555. return __gnu_cxx :: __numeric_traits < int > :: __min ;
  11556. else
  11557. return int ( __d ) ;
  11558. }
  11559.  
  11560. void
  11561. _M_mutate ( size_type __pos , size_type __len1 , size_type __len2 ) ;
  11562.  
  11563. void
  11564. _M_leak_hard ( ) ;
  11565.  
  11566. static _Rep &
  11567. _S_empty_rep ( )
  11568. { return _Rep :: _S_empty_rep ( ) ; }
  11569.  
  11570. public :
  11571. #437
  11572. basic_string ( )
  11573.  
  11574. : _M_dataplus ( _S_empty_rep ( ) . _M_refdata ( ) , _Alloc ( ) ) { }
  11575. #447
  11576. explicit
  11577. basic_string ( const _Alloc & __a ) ;
  11578. #455
  11579. basic_string ( const basic_string & __str ) ;
  11580. #462
  11581. basic_string ( const basic_string & __str , size_type __pos ,
  11582. size_type __n = npos ) ;
  11583. #471
  11584. basic_string ( const basic_string & __str , size_type __pos ,
  11585. size_type __n , const _Alloc & __a ) ;
  11586. #483
  11587. basic_string ( const _CharT * __s , size_type __n ,
  11588. const _Alloc & __a = _Alloc ( ) ) ;
  11589.  
  11590.  
  11591.  
  11592.  
  11593.  
  11594. basic_string ( const _CharT * __s , const _Alloc & __a = _Alloc ( ) ) ;
  11595. #497
  11596. basic_string ( size_type __n , _CharT __c , const _Alloc & __a = _Alloc ( ) ) ;
  11597. #507
  11598. basic_string ( basic_string && __str ) noexcept
  11599. : _M_dataplus ( __str . _M_dataplus )
  11600. {
  11601.  
  11602. __str . _M_data ( _S_empty_rep ( ) . _M_refdata ( ) ) ;
  11603.  
  11604.  
  11605.  
  11606. }
  11607. #522
  11608. basic_string ( initializer_list < _CharT > __l , const _Alloc & __a = _Alloc ( ) ) ;
  11609. #531
  11610. template < class _InputIterator >
  11611. basic_string ( _InputIterator __beg , _InputIterator __end ,
  11612. const _Alloc & __a = _Alloc ( ) ) ;
  11613.  
  11614.  
  11615.  
  11616.  
  11617. ~ basic_string ( ) noexcept
  11618. { _M_rep ( ) -> _M_dispose ( this -> get_allocator ( ) ) ; }
  11619.  
  11620.  
  11621.  
  11622.  
  11623.  
  11624. basic_string &
  11625. operator = ( const basic_string & __str )
  11626. { return this -> assign ( __str ) ; }
  11627.  
  11628.  
  11629.  
  11630.  
  11631.  
  11632. basic_string &
  11633. operator = ( const _CharT * __s )
  11634. { return this -> assign ( __s ) ; }
  11635. #564
  11636. basic_string &
  11637. operator = ( _CharT __c )
  11638. {
  11639. this -> assign ( 1 , __c ) ;
  11640. return * this ;
  11641. }
  11642. #579
  11643. basic_string &
  11644. operator = ( basic_string && __str )
  11645. {
  11646.  
  11647. this -> swap ( __str ) ;
  11648. return * this ;
  11649. }
  11650.  
  11651.  
  11652.  
  11653.  
  11654.  
  11655. basic_string &
  11656. operator = ( initializer_list < _CharT > __l )
  11657. {
  11658. this -> assign ( __l . begin ( ) , __l . size ( ) ) ;
  11659. return * this ;
  11660. }
  11661. #604
  11662. iterator
  11663. begin ( ) noexcept
  11664. {
  11665. _M_leak ( ) ;
  11666. return iterator ( _M_data ( ) ) ;
  11667. }
  11668.  
  11669.  
  11670.  
  11671.  
  11672.  
  11673. const_iterator
  11674. begin ( ) const noexcept
  11675. { return const_iterator ( _M_data ( ) ) ; }
  11676.  
  11677.  
  11678.  
  11679.  
  11680.  
  11681. iterator
  11682. end ( ) noexcept
  11683. {
  11684. _M_leak ( ) ;
  11685. return iterator ( _M_data ( ) + this -> size ( ) ) ;
  11686. }
  11687.  
  11688.  
  11689.  
  11690.  
  11691.  
  11692. const_iterator
  11693. end ( ) const noexcept
  11694. { return const_iterator ( _M_data ( ) + this -> size ( ) ) ; }
  11695. #643
  11696. reverse_iterator
  11697. rbegin ( ) noexcept
  11698. { return reverse_iterator ( this -> end ( ) ) ; }
  11699. #652
  11700. const_reverse_iterator
  11701. rbegin ( ) const noexcept
  11702. { return const_reverse_iterator ( this -> end ( ) ) ; }
  11703. #661
  11704. reverse_iterator
  11705. rend ( ) noexcept
  11706. { return reverse_iterator ( this -> begin ( ) ) ; }
  11707. #670
  11708. const_reverse_iterator
  11709. rend ( ) const noexcept
  11710. { return const_reverse_iterator ( this -> begin ( ) ) ; }
  11711. #679
  11712. const_iterator
  11713. cbegin ( ) const noexcept
  11714. { return const_iterator ( this -> _M_data ( ) ) ; }
  11715.  
  11716.  
  11717.  
  11718.  
  11719.  
  11720. const_iterator
  11721. cend ( ) const noexcept
  11722. { return const_iterator ( this -> _M_data ( ) + this -> size ( ) ) ; }
  11723. #696
  11724. const_reverse_iterator
  11725. crbegin ( ) const noexcept
  11726. { return const_reverse_iterator ( this -> end ( ) ) ; }
  11727. #705
  11728. const_reverse_iterator
  11729. crend ( ) const noexcept
  11730. { return const_reverse_iterator ( this -> begin ( ) ) ; }
  11731.  
  11732.  
  11733. public :
  11734.  
  11735.  
  11736.  
  11737. size_type
  11738. size ( ) const noexcept
  11739. { return _M_rep ( ) -> _M_length ; }
  11740.  
  11741.  
  11742.  
  11743. size_type
  11744. length ( ) const noexcept
  11745. { return _M_rep ( ) -> _M_length ; }
  11746.  
  11747.  
  11748. size_type
  11749. max_size ( ) const noexcept
  11750. { return _Rep :: _S_max_size ; }
  11751. #739
  11752. void
  11753. resize ( size_type __n , _CharT __c ) ;
  11754. #752
  11755. void
  11756. resize ( size_type __n )
  11757. { this -> resize ( __n , _CharT ( ) ) ; }
  11758.  
  11759.  
  11760.  
  11761. void
  11762. shrink_to_fit ( )
  11763. {
  11764. if ( capacity ( ) > size ( ) )
  11765. {
  11766. try
  11767. { reserve ( 0 ) ; }
  11768. catch ( ... )
  11769. { }
  11770. }
  11771. }
  11772. #775
  11773. size_type
  11774. capacity ( ) const noexcept
  11775. { return _M_rep ( ) -> _M_capacity ; }
  11776. #796
  11777. void
  11778. reserve ( size_type __res_arg = 0 ) ;
  11779.  
  11780.  
  11781.  
  11782.  
  11783. void
  11784. clear ( ) noexcept
  11785. { _M_mutate ( 0 , this -> size ( ) , 0 ) ; }
  11786.  
  11787.  
  11788.  
  11789.  
  11790.  
  11791. bool
  11792. empty ( ) const noexcept
  11793. { return this -> size ( ) == 0 ; }
  11794. #825
  11795. const_reference
  11796. operator [ ] ( size_type __pos ) const
  11797. {
  11798. ;
  11799. return _M_data ( ) [ __pos ] ;
  11800. }
  11801. #842
  11802. reference
  11803. operator [ ] ( size_type __pos )
  11804. {
  11805.  
  11806. ;
  11807.  
  11808. ;
  11809. _M_leak ( ) ;
  11810. return _M_data ( ) [ __pos ] ;
  11811. }
  11812. #863
  11813. const_reference
  11814. at ( size_type __n ) const
  11815. {
  11816. if ( __n >= this -> size ( ) )
  11817. __throw_out_of_range ( ( "basic_string::at" ) ) ;
  11818. return _M_data ( ) [ __n ] ;
  11819. }
  11820. #882
  11821. reference
  11822. at ( size_type __n )
  11823. {
  11824. if ( __n >= size ( ) )
  11825. __throw_out_of_range ( ( "basic_string::at" ) ) ;
  11826. _M_leak ( ) ;
  11827. return _M_data ( ) [ __n ] ;
  11828. }
  11829. #896
  11830. reference
  11831. front ( )
  11832. { return operator [ ] ( 0 ) ; }
  11833.  
  11834.  
  11835.  
  11836.  
  11837.  
  11838. const_reference
  11839. front ( ) const
  11840. { return operator [ ] ( 0 ) ; }
  11841.  
  11842.  
  11843.  
  11844.  
  11845.  
  11846. reference
  11847. back ( )
  11848. { return operator [ ] ( this -> size ( ) - 1 ) ; }
  11849.  
  11850.  
  11851.  
  11852.  
  11853.  
  11854. const_reference
  11855. back ( ) const
  11856. { return operator [ ] ( this -> size ( ) - 1 ) ; }
  11857. #931
  11858. basic_string &
  11859. operator += ( const basic_string & __str )
  11860. { return this -> append ( __str ) ; }
  11861. #940
  11862. basic_string &
  11863. operator += ( const _CharT * __s )
  11864. { return this -> append ( __s ) ; }
  11865. #949
  11866. basic_string &
  11867. operator += ( _CharT __c )
  11868. {
  11869. this -> push_back ( __c ) ;
  11870. return * this ;
  11871. }
  11872. #962
  11873. basic_string &
  11874. operator += ( initializer_list < _CharT > __l )
  11875. { return this -> append ( __l . begin ( ) , __l . size ( ) ) ; }
  11876. #972
  11877. basic_string &
  11878. append ( const basic_string & __str ) ;
  11879. #988
  11880. basic_string &
  11881. append ( const basic_string & __str , size_type __pos , size_type __n ) ;
  11882. #997
  11883. basic_string &
  11884. append ( const _CharT * __s , size_type __n ) ;
  11885. #1005
  11886. basic_string &
  11887. append ( const _CharT * __s )
  11888. {
  11889. ;
  11890. return this -> append ( __s , traits_type :: length ( __s ) ) ;
  11891. }
  11892. #1020
  11893. basic_string &
  11894. append ( size_type __n , _CharT __c ) ;
  11895. #1029
  11896. basic_string &
  11897. append ( initializer_list < _CharT > __l )
  11898. { return this -> append ( __l . begin ( ) , __l . size ( ) ) ; }
  11899. #1042
  11900. template < class _InputIterator >
  11901. basic_string &
  11902. append ( _InputIterator __first , _InputIterator __last )
  11903. { return this -> replace ( _M_iend ( ) , _M_iend ( ) , __first , __last ) ; }
  11904.  
  11905.  
  11906.  
  11907.  
  11908.  
  11909. void
  11910. push_back ( _CharT __c )
  11911. {
  11912. const size_type __len = 1 + this -> size ( ) ;
  11913. if ( __len > this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  11914. this -> reserve ( __len ) ;
  11915. traits_type :: assign ( _M_data ( ) [ this -> size ( ) ] , __c ) ;
  11916. _M_rep ( ) -> _M_set_length_and_sharable ( __len ) ;
  11917. }
  11918. #1066
  11919. basic_string &
  11920. assign ( const basic_string & __str ) ;
  11921. #1078
  11922. basic_string &
  11923. assign ( basic_string && __str )
  11924. {
  11925. this -> swap ( __str ) ;
  11926. return * this ;
  11927. }
  11928. #1099
  11929. basic_string &
  11930. assign ( const basic_string & __str , size_type __pos , size_type __n )
  11931. { return this -> assign ( __str . _M_data ( )
  11932. + __str . _M_check ( __pos , "basic_string::assign" ) ,
  11933. __str . _M_limit ( __pos , __n ) ) ; }
  11934. #1115
  11935. basic_string &
  11936. assign ( const _CharT * __s , size_type __n ) ;
  11937. #1127
  11938. basic_string &
  11939. assign ( const _CharT * __s )
  11940. {
  11941. ;
  11942. return this -> assign ( __s , traits_type :: length ( __s ) ) ;
  11943. }
  11944. #1143
  11945. basic_string &
  11946. assign ( size_type __n , _CharT __c )
  11947. { return _M_replace_aux ( size_type ( 0 ) , this -> size ( ) , __n , __c ) ; }
  11948. #1155
  11949. template < class _InputIterator >
  11950. basic_string &
  11951. assign ( _InputIterator __first , _InputIterator __last )
  11952. { return this -> replace ( _M_ibegin ( ) , _M_iend ( ) , __first , __last ) ; }
  11953. #1166
  11954. basic_string &
  11955. assign ( initializer_list < _CharT > __l )
  11956. { return this -> assign ( __l . begin ( ) , __l . size ( ) ) ; }
  11957. #1184
  11958. void
  11959. insert ( iterator __p , size_type __n , _CharT __c )
  11960. { this -> replace ( __p , __p , __n , __c ) ; }
  11961. #1200
  11962. template < class _InputIterator >
  11963. void
  11964. insert ( iterator __p , _InputIterator __beg , _InputIterator __end )
  11965. { this -> replace ( __p , __p , __beg , __end ) ; }
  11966. #1212
  11967. void
  11968. insert ( iterator __p , initializer_list < _CharT > __l )
  11969. {
  11970. ;
  11971. this -> insert ( __p - _M_ibegin ( ) , __l . begin ( ) , __l . size ( ) ) ;
  11972. }
  11973. #1232
  11974. basic_string &
  11975. insert ( size_type __pos1 , const basic_string & __str )
  11976. { return this -> insert ( __pos1 , __str , size_type ( 0 ) , __str . size ( ) ) ; }
  11977. #1254
  11978. basic_string &
  11979. insert ( size_type __pos1 , const basic_string & __str ,
  11980. size_type __pos2 , size_type __n )
  11981. { return this -> insert ( __pos1 , __str . _M_data ( )
  11982. + __str . _M_check ( __pos2 , "basic_string::insert" ) ,
  11983. __str . _M_limit ( __pos2 , __n ) ) ; }
  11984. #1277
  11985. basic_string &
  11986. insert ( size_type __pos , const _CharT * __s , size_type __n ) ;
  11987. #1295
  11988. basic_string &
  11989. insert ( size_type __pos , const _CharT * __s )
  11990. {
  11991. ;
  11992. return this -> insert ( __pos , __s , traits_type :: length ( __s ) ) ;
  11993. }
  11994. #1318
  11995. basic_string &
  11996. insert ( size_type __pos , size_type __n , _CharT __c )
  11997. { return _M_replace_aux ( _M_check ( __pos , "basic_string::insert" ) ,
  11998. size_type ( 0 ) , __n , __c ) ; }
  11999. #1336
  12000. iterator
  12001. insert ( iterator __p , _CharT __c )
  12002. {
  12003. ;
  12004. const size_type __pos = __p - _M_ibegin ( ) ;
  12005. _M_replace_aux ( __pos , size_type ( 0 ) , size_type ( 1 ) , __c ) ;
  12006. _M_rep ( ) -> _M_set_leaked ( ) ;
  12007. return iterator ( _M_data ( ) + __pos ) ;
  12008. }
  12009. #1361
  12010. basic_string &
  12011. erase ( size_type __pos = 0 , size_type __n = npos )
  12012. {
  12013. _M_mutate ( _M_check ( __pos , "basic_string::erase" ) ,
  12014. _M_limit ( __pos , __n ) , size_type ( 0 ) ) ;
  12015. return * this ;
  12016. }
  12017. #1377
  12018. iterator
  12019. erase ( iterator __position )
  12020. {
  12021.  
  12022. ;
  12023. const size_type __pos = __position - _M_ibegin ( ) ;
  12024. _M_mutate ( __pos , size_type ( 1 ) , size_type ( 0 ) ) ;
  12025. _M_rep ( ) -> _M_set_leaked ( ) ;
  12026. return iterator ( _M_data ( ) + __pos ) ;
  12027. }
  12028. #1397
  12029. iterator
  12030. erase ( iterator __first , iterator __last ) ;
  12031. #1406
  12032. void
  12033. pop_back ( )
  12034. { erase ( size ( ) - 1 , 1 ) ; }
  12035. #1428
  12036. basic_string &
  12037. replace ( size_type __pos , size_type __n , const basic_string & __str )
  12038. { return this -> replace ( __pos , __n , __str . _M_data ( ) , __str . size ( ) ) ; }
  12039. #1450
  12040. basic_string &
  12041. replace ( size_type __pos1 , size_type __n1 , const basic_string & __str ,
  12042. size_type __pos2 , size_type __n2 )
  12043. { return this -> replace ( __pos1 , __n1 , __str . _M_data ( )
  12044. + __str . _M_check ( __pos2 , "basic_string::replace" ) ,
  12045. __str . _M_limit ( __pos2 , __n2 ) ) ; }
  12046. #1475
  12047. basic_string &
  12048. replace ( size_type __pos , size_type __n1 , const _CharT * __s ,
  12049. size_type __n2 ) ;
  12050. #1495
  12051. basic_string &
  12052. replace ( size_type __pos , size_type __n1 , const _CharT * __s )
  12053. {
  12054. ;
  12055. return this -> replace ( __pos , __n1 , __s , traits_type :: length ( __s ) ) ;
  12056. }
  12057. #1519
  12058. basic_string &
  12059. replace ( size_type __pos , size_type __n1 , size_type __n2 , _CharT __c )
  12060. { return _M_replace_aux ( _M_check ( __pos , "basic_string::replace" ) ,
  12061. _M_limit ( __pos , __n1 ) , __n2 , __c ) ; }
  12062. #1537
  12063. basic_string &
  12064. replace ( iterator __i1 , iterator __i2 , const basic_string & __str )
  12065. { return this -> replace ( __i1 , __i2 , __str . _M_data ( ) , __str . size ( ) ) ; }
  12066. #1556
  12067. basic_string &
  12068. replace ( iterator __i1 , iterator __i2 , const _CharT * __s , size_type __n )
  12069. {
  12070.  
  12071. ;
  12072. return this -> replace ( __i1 - _M_ibegin ( ) , __i2 - __i1 , __s , __n ) ;
  12073. }
  12074. #1577
  12075. basic_string &
  12076. replace ( iterator __i1 , iterator __i2 , const _CharT * __s )
  12077. {
  12078. ;
  12079. return this -> replace ( __i1 , __i2 , __s , traits_type :: length ( __s ) ) ;
  12080. }
  12081. #1598
  12082. basic_string &
  12083. replace ( iterator __i1 , iterator __i2 , size_type __n , _CharT __c )
  12084. {
  12085.  
  12086. ;
  12087. return _M_replace_aux ( __i1 - _M_ibegin ( ) , __i2 - __i1 , __n , __c ) ;
  12088. }
  12089. #1621
  12090. template < class _InputIterator >
  12091. basic_string &
  12092. replace ( iterator __i1 , iterator __i2 ,
  12093. _InputIterator __k1 , _InputIterator __k2 )
  12094. {
  12095.  
  12096. ;
  12097. ;
  12098. typedef typename std :: __is_integer < _InputIterator > :: __type _Integral ;
  12099. return _M_replace_dispatch ( __i1 , __i2 , __k1 , __k2 , _Integral ( ) ) ;
  12100. }
  12101.  
  12102.  
  12103.  
  12104. basic_string &
  12105. replace ( iterator __i1 , iterator __i2 , _CharT * __k1 , _CharT * __k2 )
  12106. {
  12107.  
  12108. ;
  12109. ;
  12110. return this -> replace ( __i1 - _M_ibegin ( ) , __i2 - __i1 ,
  12111. __k1 , __k2 - __k1 ) ;
  12112. }
  12113.  
  12114. basic_string &
  12115. replace ( iterator __i1 , iterator __i2 ,
  12116. const _CharT * __k1 , const _CharT * __k2 )
  12117. {
  12118.  
  12119. ;
  12120. ;
  12121. return this -> replace ( __i1 - _M_ibegin ( ) , __i2 - __i1 ,
  12122. __k1 , __k2 - __k1 ) ;
  12123. }
  12124.  
  12125. basic_string &
  12126. replace ( iterator __i1 , iterator __i2 , iterator __k1 , iterator __k2 )
  12127. {
  12128.  
  12129. ;
  12130. ;
  12131. return this -> replace ( __i1 - _M_ibegin ( ) , __i2 - __i1 ,
  12132. __k1 . base ( ) , __k2 - __k1 ) ;
  12133. }
  12134.  
  12135. basic_string &
  12136. replace ( iterator __i1 , iterator __i2 ,
  12137. const_iterator __k1 , const_iterator __k2 )
  12138. {
  12139.  
  12140. ;
  12141. ;
  12142. return this -> replace ( __i1 - _M_ibegin ( ) , __i2 - __i1 ,
  12143. __k1 . base ( ) , __k2 - __k1 ) ;
  12144. }
  12145. #1692
  12146. basic_string & replace ( iterator __i1 , iterator __i2 ,
  12147. initializer_list < _CharT > __l )
  12148. { return this -> replace ( __i1 , __i2 , __l . begin ( ) , __l . end ( ) ) ; }
  12149.  
  12150.  
  12151. private :
  12152. template < class _Integer >
  12153. basic_string &
  12154. _M_replace_dispatch ( iterator __i1 , iterator __i2 , _Integer __n ,
  12155. _Integer __val , __true_type )
  12156. { return _M_replace_aux ( __i1 - _M_ibegin ( ) , __i2 - __i1 , __n , __val ) ; }
  12157.  
  12158. template < class _InputIterator >
  12159. basic_string &
  12160. _M_replace_dispatch ( iterator __i1 , iterator __i2 , _InputIterator __k1 ,
  12161. _InputIterator __k2 , __false_type ) ;
  12162.  
  12163. basic_string &
  12164. _M_replace_aux ( size_type __pos1 , size_type __n1 , size_type __n2 ,
  12165. _CharT __c ) ;
  12166.  
  12167. basic_string &
  12168. _M_replace_safe ( size_type __pos1 , size_type __n1 , const _CharT * __s ,
  12169. size_type __n2 ) ;
  12170.  
  12171.  
  12172.  
  12173. template < class _InIterator >
  12174. static _CharT *
  12175. _S_construct_aux ( _InIterator __beg , _InIterator __end ,
  12176. const _Alloc & __a , __false_type )
  12177. {
  12178. typedef typename iterator_traits < _InIterator > :: iterator_category _Tag ;
  12179. return _S_construct ( __beg , __end , __a , _Tag ( ) ) ;
  12180. }
  12181.  
  12182.  
  12183.  
  12184. template < class _Integer >
  12185. static _CharT *
  12186. _S_construct_aux ( _Integer __beg , _Integer __end ,
  12187. const _Alloc & __a , __true_type )
  12188. { return _S_construct_aux_2 ( static_cast < size_type > ( __beg ) ,
  12189. __end , __a ) ; }
  12190.  
  12191. static _CharT *
  12192. _S_construct_aux_2 ( size_type __req , _CharT __c , const _Alloc & __a )
  12193. { return _S_construct ( __req , __c , __a ) ; }
  12194.  
  12195. template < class _InIterator >
  12196. static _CharT *
  12197. _S_construct ( _InIterator __beg , _InIterator __end , const _Alloc & __a )
  12198. {
  12199. typedef typename std :: __is_integer < _InIterator > :: __type _Integral ;
  12200. return _S_construct_aux ( __beg , __end , __a , _Integral ( ) ) ;
  12201. }
  12202.  
  12203.  
  12204. template < class _InIterator >
  12205. static _CharT *
  12206. _S_construct ( _InIterator __beg , _InIterator __end , const _Alloc & __a ,
  12207. input_iterator_tag ) ;
  12208.  
  12209.  
  12210.  
  12211. template < class _FwdIterator >
  12212. static _CharT *
  12213. _S_construct ( _FwdIterator __beg , _FwdIterator __end , const _Alloc & __a ,
  12214. forward_iterator_tag ) ;
  12215.  
  12216. static _CharT *
  12217. _S_construct ( size_type __req , _CharT __c , const _Alloc & __a ) ;
  12218.  
  12219. public :
  12220. #1779
  12221. size_type
  12222. copy ( _CharT * __s , size_type __n , size_type __pos = 0 ) const ;
  12223. #1789
  12224. void
  12225. swap ( basic_string & __s ) ;
  12226. #1799
  12227. const _CharT *
  12228. c_str ( ) const noexcept
  12229. { return _M_data ( ) ; }
  12230. #1809
  12231. const _CharT *
  12232. data ( ) const noexcept
  12233. { return _M_data ( ) ; }
  12234.  
  12235.  
  12236.  
  12237.  
  12238. allocator_type
  12239. get_allocator ( ) const noexcept
  12240. { return _M_dataplus ; }
  12241. #1832
  12242. size_type
  12243. find ( const _CharT * __s , size_type __pos , size_type __n ) const ;
  12244. #1845
  12245. size_type
  12246. find ( const basic_string & __str , size_type __pos = 0 ) const
  12247. noexcept
  12248. { return this -> find ( __str . data ( ) , __pos , __str . size ( ) ) ; }
  12249. #1860
  12250. size_type
  12251. find ( const _CharT * __s , size_type __pos = 0 ) const
  12252. {
  12253. ;
  12254. return this -> find ( __s , __pos , traits_type :: length ( __s ) ) ;
  12255. }
  12256. #1877
  12257. size_type
  12258. find ( _CharT __c , size_type __pos = 0 ) const noexcept ;
  12259. #1890
  12260. size_type
  12261. rfind ( const basic_string & __str , size_type __pos = npos ) const
  12262. noexcept
  12263. { return this -> rfind ( __str . data ( ) , __pos , __str . size ( ) ) ; }
  12264. #1907
  12265. size_type
  12266. rfind ( const _CharT * __s , size_type __pos , size_type __n ) const ;
  12267. #1920
  12268. size_type
  12269. rfind ( const _CharT * __s , size_type __pos = npos ) const
  12270. {
  12271. ;
  12272. return this -> rfind ( __s , __pos , traits_type :: length ( __s ) ) ;
  12273. }
  12274. #1937
  12275. size_type
  12276. rfind ( _CharT __c , size_type __pos = npos ) const noexcept ;
  12277. #1951
  12278. size_type
  12279. find_first_of ( const basic_string & __str , size_type __pos = 0 ) const
  12280. noexcept
  12281. { return this -> find_first_of ( __str . data ( ) , __pos , __str . size ( ) ) ; }
  12282. #1968
  12283. size_type
  12284. find_first_of ( const _CharT * __s , size_type __pos , size_type __n ) const ;
  12285. #1981
  12286. size_type
  12287. find_first_of ( const _CharT * __s , size_type __pos = 0 ) const
  12288. {
  12289. ;
  12290. return this -> find_first_of ( __s , __pos , traits_type :: length ( __s ) ) ;
  12291. }
  12292. #2000
  12293. size_type
  12294. find_first_of ( _CharT __c , size_type __pos = 0 ) const noexcept
  12295. { return this -> find ( __c , __pos ) ; }
  12296. #2015
  12297. size_type
  12298. find_last_of ( const basic_string & __str , size_type __pos = npos ) const
  12299. noexcept
  12300. { return this -> find_last_of ( __str . data ( ) , __pos , __str . size ( ) ) ; }
  12301. #2032
  12302. size_type
  12303. find_last_of ( const _CharT * __s , size_type __pos , size_type __n ) const ;
  12304. #2045
  12305. size_type
  12306. find_last_of ( const _CharT * __s , size_type __pos = npos ) const
  12307. {
  12308. ;
  12309. return this -> find_last_of ( __s , __pos , traits_type :: length ( __s ) ) ;
  12310. }
  12311. #2064
  12312. size_type
  12313. find_last_of ( _CharT __c , size_type __pos = npos ) const noexcept
  12314. { return this -> rfind ( __c , __pos ) ; }
  12315. #2078
  12316. size_type
  12317. find_first_not_of ( const basic_string & __str , size_type __pos = 0 ) const
  12318. noexcept
  12319. { return this -> find_first_not_of ( __str . data ( ) , __pos , __str . size ( ) ) ; }
  12320. #2095
  12321. size_type
  12322. find_first_not_of ( const _CharT * __s , size_type __pos ,
  12323. size_type __n ) const ;
  12324. #2109
  12325. size_type
  12326. find_first_not_of ( const _CharT * __s , size_type __pos = 0 ) const
  12327. {
  12328. ;
  12329. return this -> find_first_not_of ( __s , __pos , traits_type :: length ( __s ) ) ;
  12330. }
  12331. #2126
  12332. size_type
  12333. find_first_not_of ( _CharT __c , size_type __pos = 0 ) const
  12334. noexcept ;
  12335. #2141
  12336. size_type
  12337. find_last_not_of ( const basic_string & __str , size_type __pos = npos ) const
  12338. noexcept
  12339. { return this -> find_last_not_of ( __str . data ( ) , __pos , __str . size ( ) ) ; }
  12340. #2158
  12341. size_type
  12342. find_last_not_of ( const _CharT * __s , size_type __pos ,
  12343. size_type __n ) const ;
  12344. #2172
  12345. size_type
  12346. find_last_not_of ( const _CharT * __s , size_type __pos = npos ) const
  12347. {
  12348. ;
  12349. return this -> find_last_not_of ( __s , __pos , traits_type :: length ( __s ) ) ;
  12350. }
  12351. #2189
  12352. size_type
  12353. find_last_not_of ( _CharT __c , size_type __pos = npos ) const
  12354. noexcept ;
  12355. #2205
  12356. basic_string
  12357. substr ( size_type __pos = 0 , size_type __n = npos ) const
  12358. { return basic_string ( * this ,
  12359. _M_check ( __pos , "basic_string::substr" ) , __n ) ; }
  12360. #2224
  12361. int
  12362. compare ( const basic_string & __str ) const
  12363. {
  12364. const size_type __size = this -> size ( ) ;
  12365. const size_type __osize = __str . size ( ) ;
  12366. const size_type __len = std :: min ( __size , __osize ) ;
  12367.  
  12368. int __r = traits_type :: compare ( _M_data ( ) , __str . data ( ) , __len ) ;
  12369. if ( ! __r )
  12370. __r = _S_compare ( __size , __osize ) ;
  12371. return __r ;
  12372. }
  12373. #2256
  12374. int
  12375. compare ( size_type __pos , size_type __n , const basic_string & __str ) const ;
  12376. #2282
  12377. int
  12378. compare ( size_type __pos1 , size_type __n1 , const basic_string & __str ,
  12379. size_type __pos2 , size_type __n2 ) const ;
  12380. #2300
  12381. int
  12382. compare ( const _CharT * __s ) const ;
  12383. #2324
  12384. int
  12385. compare ( size_type __pos , size_type __n1 , const _CharT * __s ) const ;
  12386. #2351
  12387. int
  12388. compare ( size_type __pos , size_type __n1 , const _CharT * __s ,
  12389. size_type __n2 ) const ;
  12390. } ;
  12391. #2363
  12392. template < typename _CharT , typename _Traits , typename _Alloc >
  12393. basic_string < _CharT , _Traits , _Alloc >
  12394. operator + ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12395. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12396. {
  12397. basic_string < _CharT , _Traits , _Alloc > __str ( __lhs ) ;
  12398. __str . append ( __rhs ) ;
  12399. return __str ;
  12400. }
  12401. #2379
  12402. template < typename _CharT , typename _Traits , typename _Alloc >
  12403. basic_string < _CharT , _Traits , _Alloc >
  12404. operator + ( const _CharT * __lhs ,
  12405. const basic_string < _CharT , _Traits , _Alloc > & __rhs ) ;
  12406. #2390
  12407. template < typename _CharT , typename _Traits , typename _Alloc >
  12408. basic_string < _CharT , _Traits , _Alloc >
  12409. operator + ( _CharT __lhs , const basic_string < _CharT , _Traits , _Alloc > & __rhs ) ;
  12410. #2400
  12411. template < typename _CharT , typename _Traits , typename _Alloc >
  12412. inline basic_string < _CharT , _Traits , _Alloc >
  12413. operator + ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12414. const _CharT * __rhs )
  12415. {
  12416. basic_string < _CharT , _Traits , _Alloc > __str ( __lhs ) ;
  12417. __str . append ( __rhs ) ;
  12418. return __str ;
  12419. }
  12420. #2416
  12421. template < typename _CharT , typename _Traits , typename _Alloc >
  12422. inline basic_string < _CharT , _Traits , _Alloc >
  12423. operator + ( const basic_string < _CharT , _Traits , _Alloc > & __lhs , _CharT __rhs )
  12424. {
  12425. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  12426. typedef typename __string_type :: size_type __size_type ;
  12427. __string_type __str ( __lhs ) ;
  12428. __str . append ( __size_type ( 1 ) , __rhs ) ;
  12429. return __str ;
  12430. }
  12431.  
  12432.  
  12433. template < typename _CharT , typename _Traits , typename _Alloc >
  12434. inline basic_string < _CharT , _Traits , _Alloc >
  12435. operator + ( basic_string < _CharT , _Traits , _Alloc > && __lhs ,
  12436. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12437. { return std :: move ( __lhs . append ( __rhs ) ) ; }
  12438.  
  12439. template < typename _CharT , typename _Traits , typename _Alloc >
  12440. inline basic_string < _CharT , _Traits , _Alloc >
  12441. operator + ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12442. basic_string < _CharT , _Traits , _Alloc > && __rhs )
  12443. { return std :: move ( __rhs . insert ( 0 , __lhs ) ) ; }
  12444.  
  12445. template < typename _CharT , typename _Traits , typename _Alloc >
  12446. inline basic_string < _CharT , _Traits , _Alloc >
  12447. operator + ( basic_string < _CharT , _Traits , _Alloc > && __lhs ,
  12448. basic_string < _CharT , _Traits , _Alloc > && __rhs )
  12449. {
  12450. const auto __size = __lhs . size ( ) + __rhs . size ( ) ;
  12451. const bool __cond = ( __size > __lhs . capacity ( )
  12452. && __size <= __rhs . capacity ( ) ) ;
  12453. return __cond ? std :: move ( __rhs . insert ( 0 , __lhs ) )
  12454. : std :: move ( __lhs . append ( __rhs ) ) ;
  12455. }
  12456.  
  12457. template < typename _CharT , typename _Traits , typename _Alloc >
  12458. inline basic_string < _CharT , _Traits , _Alloc >
  12459. operator + ( const _CharT * __lhs ,
  12460. basic_string < _CharT , _Traits , _Alloc > && __rhs )
  12461. { return std :: move ( __rhs . insert ( 0 , __lhs ) ) ; }
  12462.  
  12463. template < typename _CharT , typename _Traits , typename _Alloc >
  12464. inline basic_string < _CharT , _Traits , _Alloc >
  12465. operator + ( _CharT __lhs ,
  12466. basic_string < _CharT , _Traits , _Alloc > && __rhs )
  12467. { return std :: move ( __rhs . insert ( 0 , 1 , __lhs ) ) ; }
  12468.  
  12469. template < typename _CharT , typename _Traits , typename _Alloc >
  12470. inline basic_string < _CharT , _Traits , _Alloc >
  12471. operator + ( basic_string < _CharT , _Traits , _Alloc > && __lhs ,
  12472. const _CharT * __rhs )
  12473. { return std :: move ( __lhs . append ( __rhs ) ) ; }
  12474.  
  12475. template < typename _CharT , typename _Traits , typename _Alloc >
  12476. inline basic_string < _CharT , _Traits , _Alloc >
  12477. operator + ( basic_string < _CharT , _Traits , _Alloc > && __lhs ,
  12478. _CharT __rhs )
  12479. { return std :: move ( __lhs . append ( 1 , __rhs ) ) ; }
  12480. #2484
  12481. template < typename _CharT , typename _Traits , typename _Alloc >
  12482. inline bool
  12483. operator == ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12484. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12485. { return __lhs . compare ( __rhs ) == 0 ; }
  12486.  
  12487. template < typename _CharT >
  12488. inline
  12489. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value , bool > :: __type
  12490. operator == ( const basic_string < _CharT > & __lhs ,
  12491. const basic_string < _CharT > & __rhs )
  12492. { return ( __lhs . size ( ) == __rhs . size ( )
  12493. && ! std :: char_traits < _CharT > :: compare ( __lhs . data ( ) , __rhs . data ( ) ,
  12494. __lhs . size ( ) ) ) ; }
  12495. #2505
  12496. template < typename _CharT , typename _Traits , typename _Alloc >
  12497. inline bool
  12498. operator == ( const _CharT * __lhs ,
  12499. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12500. { return __rhs . compare ( __lhs ) == 0 ; }
  12501. #2517
  12502. template < typename _CharT , typename _Traits , typename _Alloc >
  12503. inline bool
  12504. operator == ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12505. const _CharT * __rhs )
  12506. { return __lhs . compare ( __rhs ) == 0 ; }
  12507. #2530
  12508. template < typename _CharT , typename _Traits , typename _Alloc >
  12509. inline bool
  12510. operator != ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12511. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12512. { return ! ( __lhs == __rhs ) ; }
  12513. #2542
  12514. template < typename _CharT , typename _Traits , typename _Alloc >
  12515. inline bool
  12516. operator != ( const _CharT * __lhs ,
  12517. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12518. { return ! ( __lhs == __rhs ) ; }
  12519. #2554
  12520. template < typename _CharT , typename _Traits , typename _Alloc >
  12521. inline bool
  12522. operator != ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12523. const _CharT * __rhs )
  12524. { return ! ( __lhs == __rhs ) ; }
  12525. #2567
  12526. template < typename _CharT , typename _Traits , typename _Alloc >
  12527. inline bool
  12528. operator < ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12529. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12530. { return __lhs . compare ( __rhs ) < 0 ; }
  12531. #2579
  12532. template < typename _CharT , typename _Traits , typename _Alloc >
  12533. inline bool
  12534. operator < ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12535. const _CharT * __rhs )
  12536. { return __lhs . compare ( __rhs ) < 0 ; }
  12537. #2591
  12538. template < typename _CharT , typename _Traits , typename _Alloc >
  12539. inline bool
  12540. operator < ( const _CharT * __lhs ,
  12541. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12542. { return __rhs . compare ( __lhs ) > 0 ; }
  12543. #2604
  12544. template < typename _CharT , typename _Traits , typename _Alloc >
  12545. inline bool
  12546. operator > ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12547. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12548. { return __lhs . compare ( __rhs ) > 0 ; }
  12549. #2616
  12550. template < typename _CharT , typename _Traits , typename _Alloc >
  12551. inline bool
  12552. operator > ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12553. const _CharT * __rhs )
  12554. { return __lhs . compare ( __rhs ) > 0 ; }
  12555. #2628
  12556. template < typename _CharT , typename _Traits , typename _Alloc >
  12557. inline bool
  12558. operator > ( const _CharT * __lhs ,
  12559. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12560. { return __rhs . compare ( __lhs ) < 0 ; }
  12561. #2641
  12562. template < typename _CharT , typename _Traits , typename _Alloc >
  12563. inline bool
  12564. operator <= ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12565. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12566. { return __lhs . compare ( __rhs ) <= 0 ; }
  12567. #2653
  12568. template < typename _CharT , typename _Traits , typename _Alloc >
  12569. inline bool
  12570. operator <= ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12571. const _CharT * __rhs )
  12572. { return __lhs . compare ( __rhs ) <= 0 ; }
  12573. #2665
  12574. template < typename _CharT , typename _Traits , typename _Alloc >
  12575. inline bool
  12576. operator <= ( const _CharT * __lhs ,
  12577. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12578. { return __rhs . compare ( __lhs ) >= 0 ; }
  12579. #2678
  12580. template < typename _CharT , typename _Traits , typename _Alloc >
  12581. inline bool
  12582. operator >= ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12583. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12584. { return __lhs . compare ( __rhs ) >= 0 ; }
  12585. #2690
  12586. template < typename _CharT , typename _Traits , typename _Alloc >
  12587. inline bool
  12588. operator >= ( const basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12589. const _CharT * __rhs )
  12590. { return __lhs . compare ( __rhs ) >= 0 ; }
  12591. #2702
  12592. template < typename _CharT , typename _Traits , typename _Alloc >
  12593. inline bool
  12594. operator >= ( const _CharT * __lhs ,
  12595. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12596. { return __rhs . compare ( __lhs ) <= 0 ; }
  12597. #2715
  12598. template < typename _CharT , typename _Traits , typename _Alloc >
  12599. inline void
  12600. swap ( basic_string < _CharT , _Traits , _Alloc > & __lhs ,
  12601. basic_string < _CharT , _Traits , _Alloc > & __rhs )
  12602. { __lhs . swap ( __rhs ) ; }
  12603. #2733
  12604. template < typename _CharT , typename _Traits , typename _Alloc >
  12605. basic_istream < _CharT , _Traits > &
  12606. operator >> ( basic_istream < _CharT , _Traits > & __is ,
  12607. basic_string < _CharT , _Traits , _Alloc > & __str ) ;
  12608.  
  12609. template < >
  12610. basic_istream < char > &
  12611. operator >> ( basic_istream < char > & __is , basic_string < char > & __str ) ;
  12612. #2751
  12613. template < typename _CharT , typename _Traits , typename _Alloc >
  12614. inline basic_ostream < _CharT , _Traits > &
  12615. operator << ( basic_ostream < _CharT , _Traits > & __os ,
  12616. const basic_string < _CharT , _Traits , _Alloc > & __str )
  12617. {
  12618.  
  12619.  
  12620. return __ostream_insert ( __os , __str . data ( ) , __str . size ( ) ) ;
  12621. }
  12622. #2774
  12623. template < typename _CharT , typename _Traits , typename _Alloc >
  12624. basic_istream < _CharT , _Traits > &
  12625. getline ( basic_istream < _CharT , _Traits > & __is ,
  12626. basic_string < _CharT , _Traits , _Alloc > & __str , _CharT __delim ) ;
  12627. #2791
  12628. template < typename _CharT , typename _Traits , typename _Alloc >
  12629. inline basic_istream < _CharT , _Traits > &
  12630. getline ( basic_istream < _CharT , _Traits > & __is ,
  12631. basic_string < _CharT , _Traits , _Alloc > & __str )
  12632. { return getline ( __is , __str , __is . widen ( '\n' ) ) ; }
  12633.  
  12634. template < >
  12635. basic_istream < char > &
  12636. getline ( basic_istream < char > & __in , basic_string < char > & __str ,
  12637. char __delim ) ;
  12638.  
  12639.  
  12640. template < >
  12641. basic_istream < wchar_t > &
  12642. getline ( basic_istream < wchar_t > & __in , basic_string < wchar_t > & __str ,
  12643. wchar_t __delim ) ;
  12644.  
  12645.  
  12646.  
  12647. }
  12648. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/string_conversions.h"
  12649. #32
  12650. #pragma GCC system_header
  12651. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cerrno"
  12652. #39
  12653. #pragma GCC system_header
  12654. #1 "/usr/include/errno.h"
  12655. #17
  12656. #pragma ident "@(#)errno.h  1.17    03/01/03 SMI"
  12657. #1 "/usr/include/sys/errno.h"
  12658. #9
  12659. #pragma ident "@(#)errno.h  1.20    00/01/12 SMI"
  12660. #40
  12661. extern "C" {
  12662. #197
  12663. }
  12664. #26 "/usr/include/errno.h"
  12665. extern "C" {
  12666. #37
  12667. extern int * ___errno ( ) ;
  12668. #48
  12669. }
  12670. #46 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/string_conversions.h"
  12671. namespace __gnu_cxx
  12672. {
  12673.  
  12674.  
  12675.  
  12676. template < typename _TRet , typename _Ret = _TRet , typename _CharT ,
  12677. typename ... _Base >
  12678. _Ret
  12679. __stoa ( _TRet ( * __convf ) ( const _CharT * , _CharT * * , _Base ... ) ,
  12680. const char * __name , const _CharT * __str , std :: size_t * __idx ,
  12681. _Base ... __base )
  12682. {
  12683. _Ret __ret ;
  12684.  
  12685. _CharT * __endptr ;
  12686. ( * ( ___errno ( ) ) ) = 0 ;
  12687. const _TRet __tmp = __convf ( __str , & __endptr , __base ... ) ;
  12688.  
  12689. if ( __endptr == __str )
  12690. std :: __throw_invalid_argument ( __name ) ;
  12691. else if ( ( * ( ___errno ( ) ) ) == 34
  12692. || ( std :: __are_same < _Ret , int > :: __value
  12693. && ( __tmp < __numeric_traits < int > :: __min
  12694. || __tmp > __numeric_traits < int > :: __max ) ) )
  12695. std :: __throw_out_of_range ( __name ) ;
  12696. else
  12697. __ret = __tmp ;
  12698.  
  12699. if ( __idx )
  12700. * __idx = __endptr - __str ;
  12701.  
  12702. return __ret ;
  12703. }
  12704.  
  12705.  
  12706. template < typename _String , typename _CharT = typename _String :: value_type >
  12707. _String
  12708. __to_xstring ( int ( * __convf ) ( _CharT * , std :: size_t , const _CharT * ,
  12709. __builtin_va_list ) , std :: size_t __n ,
  12710. const _CharT * __fmt , ... )
  12711. {
  12712.  
  12713.  
  12714. _CharT * __s = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  12715. * __n ) ) ;
  12716.  
  12717. __builtin_va_list __args ;
  12718. __builtin_va_start ( __args , __fmt ) ;
  12719.  
  12720. const int __len = __convf ( __s , __n , __fmt , __args ) ;
  12721.  
  12722. ( ( void ) 0 ) ;
  12723.  
  12724. return _String ( __s , __s + __len ) ;
  12725. }
  12726.  
  12727.  
  12728. }
  12729. #2817 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_string.h"
  12730. namespace std
  12731. {
  12732.  
  12733.  
  12734.  
  12735. inline int
  12736. stoi ( const string & __str , size_t * __idx = 0 , int __base = 10 )
  12737. { return __gnu_cxx :: __stoa < long , int > ( & std :: strtol , "stoi" , __str . c_str ( ) ,
  12738. __idx , __base ) ; }
  12739.  
  12740. inline long
  12741. stol ( const string & __str , size_t * __idx = 0 , int __base = 10 )
  12742. { return __gnu_cxx :: __stoa ( & std :: strtol , "stol" , __str . c_str ( ) ,
  12743. __idx , __base ) ; }
  12744.  
  12745. inline unsigned long
  12746. stoul ( const string & __str , size_t * __idx = 0 , int __base = 10 )
  12747. { return __gnu_cxx :: __stoa ( & std :: strtoul , "stoul" , __str . c_str ( ) ,
  12748. __idx , __base ) ; }
  12749.  
  12750. inline long long
  12751. stoll ( const string & __str , size_t * __idx = 0 , int __base = 10 )
  12752. { return __gnu_cxx :: __stoa ( & std :: strtoll , "stoll" , __str . c_str ( ) ,
  12753. __idx , __base ) ; }
  12754.  
  12755. inline unsigned long long
  12756. stoull ( const string & __str , size_t * __idx = 0 , int __base = 10 )
  12757. { return __gnu_cxx :: __stoa ( & std :: strtoull , "stoull" , __str . c_str ( ) ,
  12758. __idx , __base ) ; }
  12759.  
  12760.  
  12761. inline float
  12762. stof ( const string & __str , size_t * __idx = 0 )
  12763. { return __gnu_cxx :: __stoa ( & std :: strtof , "stof" , __str . c_str ( ) , __idx ) ; }
  12764.  
  12765. inline double
  12766. stod ( const string & __str , size_t * __idx = 0 )
  12767. { return __gnu_cxx :: __stoa ( & std :: strtod , "stod" , __str . c_str ( ) , __idx ) ; }
  12768.  
  12769. inline long double
  12770. stold ( const string & __str , size_t * __idx = 0 )
  12771. { return __gnu_cxx :: __stoa ( & std :: strtold , "stold" , __str . c_str ( ) , __idx ) ; }
  12772.  
  12773.  
  12774.  
  12775.  
  12776. inline string
  12777. to_string ( int __val )
  12778. { return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf , 4 * sizeof ( int ) ,
  12779. "%d" , __val ) ; }
  12780.  
  12781. inline string
  12782. to_string ( unsigned __val )
  12783. { return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf ,
  12784. 4 * sizeof ( unsigned ) ,
  12785. "%u" , __val ) ; }
  12786.  
  12787. inline string
  12788. to_string ( long __val )
  12789. { return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf , 4 * sizeof ( long ) ,
  12790. "%ld" , __val ) ; }
  12791.  
  12792. inline string
  12793. to_string ( unsigned long __val )
  12794. { return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf ,
  12795. 4 * sizeof ( unsigned long ) ,
  12796. "%lu" , __val ) ; }
  12797.  
  12798. inline string
  12799. to_string ( long long __val )
  12800. { return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf ,
  12801. 4 * sizeof ( long long ) ,
  12802. "%lld" , __val ) ; }
  12803.  
  12804. inline string
  12805. to_string ( unsigned long long __val )
  12806. { return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf ,
  12807. 4 * sizeof ( unsigned long long ) ,
  12808. "%llu" , __val ) ; }
  12809.  
  12810. inline string
  12811. to_string ( float __val )
  12812. {
  12813. const int __n =
  12814. __gnu_cxx :: __numeric_traits < float > :: __max_exponent10 + 20 ;
  12815. return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf , __n ,
  12816. "%f" , __val ) ;
  12817. }
  12818.  
  12819. inline string
  12820. to_string ( double __val )
  12821. {
  12822. const int __n =
  12823. __gnu_cxx :: __numeric_traits < double > :: __max_exponent10 + 20 ;
  12824. return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf , __n ,
  12825. "%f" , __val ) ;
  12826. }
  12827.  
  12828. inline string
  12829. to_string ( long double __val )
  12830. {
  12831. const int __n =
  12832. __gnu_cxx :: __numeric_traits < long double > :: __max_exponent10 + 20 ;
  12833. return __gnu_cxx :: __to_xstring < string > ( & std :: vsnprintf , __n ,
  12834. "%Lf" , __val ) ;
  12835. }
  12836.  
  12837.  
  12838. inline int
  12839. stoi ( const wstring & __str , size_t * __idx = 0 , int __base = 10 )
  12840. { return __gnu_cxx :: __stoa < long , int > ( & std :: wcstol , "stoi" , __str . c_str ( ) ,
  12841. __idx , __base ) ; }
  12842.  
  12843. inline long
  12844. stol ( const wstring & __str , size_t * __idx = 0 , int __base = 10 )
  12845. { return __gnu_cxx :: __stoa ( & std :: wcstol , "stol" , __str . c_str ( ) ,
  12846. __idx , __base ) ; }
  12847.  
  12848. inline unsigned long
  12849. stoul ( const wstring & __str , size_t * __idx = 0 , int __base = 10 )
  12850. { return __gnu_cxx :: __stoa ( & std :: wcstoul , "stoul" , __str . c_str ( ) ,
  12851. __idx , __base ) ; }
  12852.  
  12853. inline long long
  12854. stoll ( const wstring & __str , size_t * __idx = 0 , int __base = 10 )
  12855. { return __gnu_cxx :: __stoa ( & std :: wcstoll , "stoll" , __str . c_str ( ) ,
  12856. __idx , __base ) ; }
  12857.  
  12858. inline unsigned long long
  12859. stoull ( const wstring & __str , size_t * __idx = 0 , int __base = 10 )
  12860. { return __gnu_cxx :: __stoa ( & std :: wcstoull , "stoull" , __str . c_str ( ) ,
  12861. __idx , __base ) ; }
  12862.  
  12863.  
  12864. inline float
  12865. stof ( const wstring & __str , size_t * __idx = 0 )
  12866. { return __gnu_cxx :: __stoa ( & std :: wcstof , "stof" , __str . c_str ( ) , __idx ) ; }
  12867.  
  12868. inline double
  12869. stod ( const wstring & __str , size_t * __idx = 0 )
  12870. { return __gnu_cxx :: __stoa ( & std :: wcstod , "stod" , __str . c_str ( ) , __idx ) ; }
  12871.  
  12872. inline long double
  12873. stold ( const wstring & __str , size_t * __idx = 0 )
  12874. { return __gnu_cxx :: __stoa ( & std :: wcstold , "stold" , __str . c_str ( ) , __idx ) ; }
  12875.  
  12876.  
  12877. inline wstring
  12878. to_wstring ( int __val )
  12879. { return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf , 4 * sizeof ( int ) ,
  12880. L"%d" , __val ) ; }
  12881.  
  12882. inline wstring
  12883. to_wstring ( unsigned __val )
  12884. { return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf ,
  12885. 4 * sizeof ( unsigned ) ,
  12886. L"%u" , __val ) ; }
  12887.  
  12888. inline wstring
  12889. to_wstring ( long __val )
  12890. { return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf , 4 * sizeof ( long ) ,
  12891. L"%ld" , __val ) ; }
  12892.  
  12893. inline wstring
  12894. to_wstring ( unsigned long __val )
  12895. { return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf ,
  12896. 4 * sizeof ( unsigned long ) ,
  12897. L"%lu" , __val ) ; }
  12898.  
  12899. inline wstring
  12900. to_wstring ( long long __val )
  12901. { return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf ,
  12902. 4 * sizeof ( long long ) ,
  12903. L"%lld" , __val ) ; }
  12904.  
  12905. inline wstring
  12906. to_wstring ( unsigned long long __val )
  12907. { return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf ,
  12908. 4 * sizeof ( unsigned long long ) ,
  12909. L"%llu" , __val ) ; }
  12910.  
  12911. inline wstring
  12912. to_wstring ( float __val )
  12913. {
  12914. const int __n =
  12915. __gnu_cxx :: __numeric_traits < float > :: __max_exponent10 + 20 ;
  12916. return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf , __n ,
  12917. L"%f" , __val ) ;
  12918. }
  12919.  
  12920. inline wstring
  12921. to_wstring ( double __val )
  12922. {
  12923. const int __n =
  12924. __gnu_cxx :: __numeric_traits < double > :: __max_exponent10 + 20 ;
  12925. return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf , __n ,
  12926. L"%f" , __val ) ;
  12927. }
  12928.  
  12929. inline wstring
  12930. to_wstring ( long double __val )
  12931. {
  12932. const int __n =
  12933. __gnu_cxx :: __numeric_traits < long double > :: __max_exponent10 + 20 ;
  12934. return __gnu_cxx :: __to_xstring < wstring > ( & std :: vswprintf , __n ,
  12935. L"%Lf" , __val ) ;
  12936. }
  12937.  
  12938.  
  12939.  
  12940. }
  12941. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/functional_hash.h"
  12942. #33
  12943. #pragma GCC system_header
  12944. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/hash_bytes.h"
  12945. #33
  12946. #pragma GCC system_header
  12947. #37
  12948. namespace std
  12949. {
  12950. #46
  12951. size_t
  12952. _Hash_bytes ( const void * __ptr , size_t __len , size_t __seed ) ;
  12953.  
  12954.  
  12955.  
  12956.  
  12957.  
  12958. size_t
  12959. _Fnv_hash_bytes ( const void * __ptr , size_t __len , size_t __seed ) ;
  12960.  
  12961.  
  12962. }
  12963. #37 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/functional_hash.h"
  12964. namespace std
  12965. {
  12966. #49
  12967. template < typename _Result , typename _Arg >
  12968. struct __hash_base
  12969. {
  12970. typedef _Result result_type ;
  12971. typedef _Arg argument_type ;
  12972. } ;
  12973.  
  12974.  
  12975. template < typename _Tp >
  12976. struct hash ;
  12977.  
  12978.  
  12979. template < typename _Tp >
  12980. struct hash < _Tp * > : public __hash_base < size_t , _Tp * >
  12981. {
  12982. size_t
  12983. operator ( ) ( _Tp * __p ) const noexcept
  12984. { return reinterpret_cast < size_t > ( __p ) ; }
  12985. } ;
  12986. #80
  12987. template < > struct hash < bool > : public __hash_base < size_t , bool > { size_t operator ( ) ( bool __val ) const noexcept
  12988. #80
  12989. { return static_cast < size_t > ( __val ) ; } } ;
  12990.  
  12991.  
  12992. template < > struct hash < char > : public __hash_base < size_t , char > { size_t operator ( ) ( char __val ) const noexcept
  12993. #83
  12994. { return static_cast < size_t > ( __val ) ; } } ;
  12995.  
  12996.  
  12997. template < > struct hash < signed char > : public __hash_base < size_t , signed char > { size_t operator ( ) ( signed char
  12998. #86
  12999. __val ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13000.  
  13001.  
  13002. template < > struct hash < unsigned char > : public __hash_base < size_t , unsigned char > { size_t operator ( ) ( unsigned
  13003. #89
  13004. char __val ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13005.  
  13006.  
  13007. template < > struct hash < wchar_t > : public __hash_base < size_t , wchar_t > { size_t operator ( ) ( wchar_t __val ) const
  13008. #92
  13009. noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13010.  
  13011.  
  13012. template < > struct hash < char16_t > : public __hash_base < size_t , char16_t > { size_t operator ( ) ( char16_t __val )
  13013. #95
  13014. const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13015.  
  13016.  
  13017. template < > struct hash < char32_t > : public __hash_base < size_t , char32_t > { size_t operator ( ) ( char32_t __val )
  13018. #98
  13019. const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13020.  
  13021.  
  13022. template < > struct hash < short > : public __hash_base < size_t , short > { size_t operator ( ) ( short __val ) const noexcept
  13023. #101
  13024. { return static_cast < size_t > ( __val ) ; } } ;
  13025.  
  13026.  
  13027. template < > struct hash < int > : public __hash_base < size_t , int > { size_t operator ( ) ( int __val ) const noexcept
  13028. #104
  13029. { return static_cast < size_t > ( __val ) ; } } ;
  13030.  
  13031.  
  13032. template < > struct hash < long > : public __hash_base < size_t , long > { size_t operator ( ) ( long __val ) const noexcept
  13033. #107
  13034. { return static_cast < size_t > ( __val ) ; } } ;
  13035.  
  13036.  
  13037. template < > struct hash < long long > : public __hash_base < size_t , long long > { size_t operator ( ) ( long long __val
  13038. #110
  13039. ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13040.  
  13041.  
  13042. template < > struct hash < unsigned short > : public __hash_base < size_t , unsigned short > { size_t operator ( ) ( unsigned
  13043. #113
  13044. short __val ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13045.  
  13046.  
  13047. template < > struct hash < unsigned int > : public __hash_base < size_t , unsigned int > { size_t operator ( ) ( unsigned
  13048. #116
  13049. int __val ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13050.  
  13051.  
  13052. template < > struct hash < unsigned long > : public __hash_base < size_t , unsigned long > { size_t operator ( ) ( unsigned
  13053. #119
  13054. long __val ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13055.  
  13056.  
  13057. template < > struct hash < unsigned long long > : public __hash_base < size_t , unsigned long long > { size_t operator (
  13058. #122
  13059. ) ( unsigned long long __val ) const noexcept { return static_cast < size_t > ( __val ) ; } } ;
  13060.  
  13061.  
  13062.  
  13063. struct _Hash_impl
  13064. {
  13065. static size_t
  13066. hash ( const void * __ptr , size_t __clength ,
  13067. size_t __seed = static_cast < size_t > ( 0xc70f6907UL ) )
  13068. { return _Hash_bytes ( __ptr , __clength , __seed ) ; }
  13069.  
  13070. template < typename _Tp >
  13071. static size_t
  13072. hash ( const _Tp & __val )
  13073. { return hash ( & __val , sizeof ( __val ) ) ; }
  13074.  
  13075. template < typename _Tp >
  13076. static size_t
  13077. __hash_combine ( const _Tp & __val , size_t __hash )
  13078. { return hash ( & __val , sizeof ( __val ) , __hash ) ; }
  13079. } ;
  13080.  
  13081. struct _Fnv_hash_impl
  13082. {
  13083. static size_t
  13084. hash ( const void * __ptr , size_t __clength ,
  13085. size_t __seed = static_cast < size_t > ( 2166136261UL ) )
  13086. { return _Fnv_hash_bytes ( __ptr , __clength , __seed ) ; }
  13087.  
  13088. template < typename _Tp >
  13089. static size_t
  13090. hash ( const _Tp & __val )
  13091. { return hash ( & __val , sizeof ( __val ) ) ; }
  13092.  
  13093. template < typename _Tp >
  13094. static size_t
  13095. __hash_combine ( const _Tp & __val , size_t __hash )
  13096. { return hash ( & __val , sizeof ( __val ) , __hash ) ; }
  13097. } ;
  13098.  
  13099.  
  13100. template < >
  13101. struct hash < float > : public __hash_base < size_t , float >
  13102. {
  13103. size_t
  13104. operator ( ) ( float __val ) const noexcept
  13105. {
  13106.  
  13107. return __val != 0.0f ? std :: _Hash_impl :: hash ( __val ) : 0 ;
  13108. }
  13109. } ;
  13110.  
  13111.  
  13112. template < >
  13113. struct hash < double > : public __hash_base < size_t , double >
  13114. {
  13115. size_t
  13116. operator ( ) ( double __val ) const noexcept
  13117. {
  13118.  
  13119. return __val != 0.0 ? std :: _Hash_impl :: hash ( __val ) : 0 ;
  13120. }
  13121. } ;
  13122.  
  13123.  
  13124. template < >
  13125. struct hash < long double >
  13126. : public __hash_base < size_t , long double >
  13127. {
  13128. __attribute__ ( ( __pure__ ) ) size_t
  13129. operator ( ) ( long double __val ) const noexcept ;
  13130. } ;
  13131. #201
  13132. template < typename _Hash >
  13133. struct __is_fast_hash : public std :: true_type
  13134. { } ;
  13135.  
  13136. template < >
  13137. struct __is_fast_hash < hash < long double >> : public std :: false_type
  13138. { } ;
  13139.  
  13140.  
  13141. }
  13142. #3035 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_string.h"
  13143. namespace std
  13144. {
  13145. #3043
  13146. template < >
  13147. struct hash < string >
  13148. : public __hash_base < size_t , string >
  13149. {
  13150. size_t
  13151. operator ( ) ( const string & __s ) const noexcept
  13152. { return std :: _Hash_impl :: hash ( __s . data ( ) , __s . length ( ) ) ; }
  13153. } ;
  13154.  
  13155. template < >
  13156. struct __is_fast_hash < hash < string >> : std :: false_type
  13157. { } ;
  13158.  
  13159.  
  13160.  
  13161. template < >
  13162. struct hash < wstring >
  13163. : public __hash_base < size_t , wstring >
  13164. {
  13165. size_t
  13166. operator ( ) ( const wstring & __s ) const noexcept
  13167. { return std :: _Hash_impl :: hash ( __s . data ( ) ,
  13168. __s . length ( ) * sizeof ( wchar_t ) ) ; }
  13169. } ;
  13170.  
  13171. template < >
  13172. struct __is_fast_hash < hash < wstring >> : std :: false_type
  13173. { } ;
  13174.  
  13175.  
  13176.  
  13177.  
  13178.  
  13179. template < >
  13180. struct hash < u16string >
  13181. : public __hash_base < size_t , u16string >
  13182. {
  13183. size_t
  13184. operator ( ) ( const u16string & __s ) const noexcept
  13185. { return std :: _Hash_impl :: hash ( __s . data ( ) ,
  13186. __s . length ( ) * sizeof ( char16_t ) ) ; }
  13187. } ;
  13188.  
  13189. template < >
  13190. struct __is_fast_hash < hash < u16string >> : std :: false_type
  13191. { } ;
  13192.  
  13193.  
  13194. template < >
  13195. struct hash < u32string >
  13196. : public __hash_base < size_t , u32string >
  13197. {
  13198. size_t
  13199. operator ( ) ( const u32string & __s ) const noexcept
  13200. { return std :: _Hash_impl :: hash ( __s . data ( ) ,
  13201. __s . length ( ) * sizeof ( char32_t ) ) ; }
  13202. } ;
  13203.  
  13204. template < >
  13205. struct __is_fast_hash < hash < u32string >> : std :: false_type
  13206. { } ;
  13207.  
  13208.  
  13209.  
  13210. }
  13211. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_string.tcc"
  13212. #40
  13213. #pragma GCC system_header
  13214. #44
  13215. namespace std
  13216. {
  13217.  
  13218.  
  13219. template < typename _CharT , typename _Traits , typename _Alloc >
  13220. const typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13221. basic_string < _CharT , _Traits , _Alloc > ::
  13222. _Rep :: _S_max_size = ( ( ( npos - sizeof ( _Rep_base ) ) / sizeof ( _CharT ) ) - 1 ) / 4 ;
  13223.  
  13224. template < typename _CharT , typename _Traits , typename _Alloc >
  13225. const _CharT
  13226. basic_string < _CharT , _Traits , _Alloc > ::
  13227. _Rep :: _S_terminal = _CharT ( ) ;
  13228.  
  13229. template < typename _CharT , typename _Traits , typename _Alloc >
  13230. const typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13231. basic_string < _CharT , _Traits , _Alloc > :: npos ;
  13232.  
  13233.  
  13234.  
  13235. template < typename _CharT , typename _Traits , typename _Alloc >
  13236. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13237. basic_string < _CharT , _Traits , _Alloc > :: _Rep :: _S_empty_rep_storage [
  13238. ( sizeof ( _Rep_base ) + sizeof ( _CharT ) + sizeof ( size_type ) - 1 ) /
  13239. sizeof ( size_type ) ] ;
  13240.  
  13241.  
  13242.  
  13243.  
  13244.  
  13245. template < typename _CharT , typename _Traits , typename _Alloc >
  13246. template < typename _InIterator >
  13247. _CharT *
  13248. basic_string < _CharT , _Traits , _Alloc > ::
  13249. _S_construct ( _InIterator __beg , _InIterator __end , const _Alloc & __a ,
  13250. input_iterator_tag )
  13251. {
  13252.  
  13253. if ( __beg == __end && __a == _Alloc ( ) )
  13254. return _S_empty_rep ( ) . _M_refdata ( ) ;
  13255.  
  13256.  
  13257. _CharT __buf [ 128 ] ;
  13258. size_type __len = 0 ;
  13259. while ( __beg != __end && __len < sizeof ( __buf ) / sizeof ( _CharT ) )
  13260. {
  13261. __buf [ __len ++ ] = * __beg ;
  13262. ++ __beg ;
  13263. }
  13264. _Rep * __r = _Rep :: _S_create ( __len , size_type ( 0 ) , __a ) ;
  13265. _M_copy ( __r -> _M_refdata ( ) , __buf , __len ) ;
  13266. try
  13267. {
  13268. while ( __beg != __end )
  13269. {
  13270. if ( __len == __r -> _M_capacity )
  13271. {
  13272.  
  13273. _Rep * __another = _Rep :: _S_create ( __len + 1 , __len , __a ) ;
  13274. _M_copy ( __another -> _M_refdata ( ) , __r -> _M_refdata ( ) , __len ) ;
  13275. __r -> _M_destroy ( __a ) ;
  13276. __r = __another ;
  13277. }
  13278. __r -> _M_refdata ( ) [ __len ++ ] = * __beg ;
  13279. ++ __beg ;
  13280. }
  13281. }
  13282. catch ( ... )
  13283. {
  13284. __r -> _M_destroy ( __a ) ;
  13285. throw ;
  13286. }
  13287. __r -> _M_set_length_and_sharable ( __len ) ;
  13288. return __r -> _M_refdata ( ) ;
  13289. }
  13290.  
  13291. template < typename _CharT , typename _Traits , typename _Alloc >
  13292. template < typename _InIterator >
  13293. _CharT *
  13294. basic_string < _CharT , _Traits , _Alloc > ::
  13295. _S_construct ( _InIterator __beg , _InIterator __end , const _Alloc & __a ,
  13296. forward_iterator_tag )
  13297. {
  13298.  
  13299. if ( __beg == __end && __a == _Alloc ( ) )
  13300. return _S_empty_rep ( ) . _M_refdata ( ) ;
  13301.  
  13302.  
  13303. if ( __gnu_cxx :: __is_null_pointer ( __beg ) && __beg != __end )
  13304. __throw_logic_error ( ( "basic_string::_S_construct null not valid" ) ) ;
  13305.  
  13306. const size_type __dnew = static_cast < size_type > ( std :: distance ( __beg ,
  13307. __end ) ) ;
  13308.  
  13309. _Rep * __r = _Rep :: _S_create ( __dnew , size_type ( 0 ) , __a ) ;
  13310. try
  13311. { _S_copy_chars ( __r -> _M_refdata ( ) , __beg , __end ) ; }
  13312. catch ( ... )
  13313. {
  13314. __r -> _M_destroy ( __a ) ;
  13315. throw ;
  13316. }
  13317. __r -> _M_set_length_and_sharable ( __dnew ) ;
  13318. return __r -> _M_refdata ( ) ;
  13319. }
  13320.  
  13321. template < typename _CharT , typename _Traits , typename _Alloc >
  13322. _CharT *
  13323. basic_string < _CharT , _Traits , _Alloc > ::
  13324. _S_construct ( size_type __n , _CharT __c , const _Alloc & __a )
  13325. {
  13326.  
  13327. if ( __n == 0 && __a == _Alloc ( ) )
  13328. return _S_empty_rep ( ) . _M_refdata ( ) ;
  13329.  
  13330.  
  13331. _Rep * __r = _Rep :: _S_create ( __n , size_type ( 0 ) , __a ) ;
  13332. if ( __n )
  13333. _M_assign ( __r -> _M_refdata ( ) , __n , __c ) ;
  13334.  
  13335. __r -> _M_set_length_and_sharable ( __n ) ;
  13336. return __r -> _M_refdata ( ) ;
  13337. }
  13338.  
  13339. template < typename _CharT , typename _Traits , typename _Alloc >
  13340. basic_string < _CharT , _Traits , _Alloc > ::
  13341. basic_string ( const basic_string & __str )
  13342. : _M_dataplus ( __str . _M_rep ( ) -> _M_grab ( _Alloc ( __str . get_allocator ( ) ) ,
  13343. __str . get_allocator ( ) ) ,
  13344. __str . get_allocator ( ) )
  13345. { }
  13346.  
  13347. template < typename _CharT , typename _Traits , typename _Alloc >
  13348. basic_string < _CharT , _Traits , _Alloc > ::
  13349. basic_string ( const _Alloc & __a )
  13350. : _M_dataplus ( _S_construct ( size_type ( ) , _CharT ( ) , __a ) , __a )
  13351. { }
  13352.  
  13353. template < typename _CharT , typename _Traits , typename _Alloc >
  13354. basic_string < _CharT , _Traits , _Alloc > ::
  13355. basic_string ( const basic_string & __str , size_type __pos , size_type __n )
  13356. : _M_dataplus ( _S_construct ( __str . _M_data ( )
  13357. + __str . _M_check ( __pos ,
  13358. "basic_string::basic_string" ) ,
  13359. __str . _M_data ( ) + __str . _M_limit ( __pos , __n )
  13360. + __pos , _Alloc ( ) ) , _Alloc ( ) )
  13361. { }
  13362.  
  13363. template < typename _CharT , typename _Traits , typename _Alloc >
  13364. basic_string < _CharT , _Traits , _Alloc > ::
  13365. basic_string ( const basic_string & __str , size_type __pos ,
  13366. size_type __n , const _Alloc & __a )
  13367. : _M_dataplus ( _S_construct ( __str . _M_data ( )
  13368. + __str . _M_check ( __pos ,
  13369. "basic_string::basic_string" ) ,
  13370. __str . _M_data ( ) + __str . _M_limit ( __pos , __n )
  13371. + __pos , __a ) , __a )
  13372. { }
  13373.  
  13374.  
  13375. template < typename _CharT , typename _Traits , typename _Alloc >
  13376. basic_string < _CharT , _Traits , _Alloc > ::
  13377. basic_string ( const _CharT * __s , size_type __n , const _Alloc & __a )
  13378. : _M_dataplus ( _S_construct ( __s , __s + __n , __a ) , __a )
  13379. { }
  13380.  
  13381.  
  13382. template < typename _CharT , typename _Traits , typename _Alloc >
  13383. basic_string < _CharT , _Traits , _Alloc > ::
  13384. basic_string ( const _CharT * __s , const _Alloc & __a )
  13385. : _M_dataplus ( _S_construct ( __s , __s ? __s + traits_type :: length ( __s ) :
  13386. __s + npos , __a ) , __a )
  13387. { }
  13388.  
  13389. template < typename _CharT , typename _Traits , typename _Alloc >
  13390. basic_string < _CharT , _Traits , _Alloc > ::
  13391. basic_string ( size_type __n , _CharT __c , const _Alloc & __a )
  13392. : _M_dataplus ( _S_construct ( __n , __c , __a ) , __a )
  13393. { }
  13394.  
  13395.  
  13396. template < typename _CharT , typename _Traits , typename _Alloc >
  13397. template < typename _InputIterator >
  13398. basic_string < _CharT , _Traits , _Alloc > ::
  13399. basic_string ( _InputIterator __beg , _InputIterator __end , const _Alloc & __a )
  13400. : _M_dataplus ( _S_construct ( __beg , __end , __a ) , __a )
  13401. { }
  13402.  
  13403.  
  13404. template < typename _CharT , typename _Traits , typename _Alloc >
  13405. basic_string < _CharT , _Traits , _Alloc > ::
  13406. basic_string ( initializer_list < _CharT > __l , const _Alloc & __a )
  13407. : _M_dataplus ( _S_construct ( __l . begin ( ) , __l . end ( ) , __a ) , __a )
  13408. { }
  13409.  
  13410.  
  13411. template < typename _CharT , typename _Traits , typename _Alloc >
  13412. basic_string < _CharT , _Traits , _Alloc > &
  13413. basic_string < _CharT , _Traits , _Alloc > ::
  13414. assign ( const basic_string & __str )
  13415. {
  13416. if ( _M_rep ( ) != __str . _M_rep ( ) )
  13417. {
  13418.  
  13419. const allocator_type __a = this -> get_allocator ( ) ;
  13420. _CharT * __tmp = __str . _M_rep ( ) -> _M_grab ( __a , __str . get_allocator ( ) ) ;
  13421. _M_rep ( ) -> _M_dispose ( __a ) ;
  13422. _M_data ( __tmp ) ;
  13423. }
  13424. return * this ;
  13425. }
  13426.  
  13427. template < typename _CharT , typename _Traits , typename _Alloc >
  13428. basic_string < _CharT , _Traits , _Alloc > &
  13429. basic_string < _CharT , _Traits , _Alloc > ::
  13430. assign ( const _CharT * __s , size_type __n )
  13431. {
  13432. ;
  13433. _M_check_length ( this -> size ( ) , __n , "basic_string::assign" ) ;
  13434. if ( _M_disjunct ( __s ) || _M_rep ( ) -> _M_is_shared ( ) )
  13435. return _M_replace_safe ( size_type ( 0 ) , this -> size ( ) , __s , __n ) ;
  13436. else
  13437. {
  13438.  
  13439. const size_type __pos = __s - _M_data ( ) ;
  13440. if ( __pos >= __n )
  13441. _M_copy ( _M_data ( ) , __s , __n ) ;
  13442. else if ( __pos )
  13443. _M_move ( _M_data ( ) , __s , __n ) ;
  13444. _M_rep ( ) -> _M_set_length_and_sharable ( __n ) ;
  13445. return * this ;
  13446. }
  13447. }
  13448.  
  13449. template < typename _CharT , typename _Traits , typename _Alloc >
  13450. basic_string < _CharT , _Traits , _Alloc > &
  13451. basic_string < _CharT , _Traits , _Alloc > ::
  13452. append ( size_type __n , _CharT __c )
  13453. {
  13454. if ( __n )
  13455. {
  13456. _M_check_length ( size_type ( 0 ) , __n , "basic_string::append" ) ;
  13457. const size_type __len = __n + this -> size ( ) ;
  13458. if ( __len > this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  13459. this -> reserve ( __len ) ;
  13460. _M_assign ( _M_data ( ) + this -> size ( ) , __n , __c ) ;
  13461. _M_rep ( ) -> _M_set_length_and_sharable ( __len ) ;
  13462. }
  13463. return * this ;
  13464. }
  13465.  
  13466. template < typename _CharT , typename _Traits , typename _Alloc >
  13467. basic_string < _CharT , _Traits , _Alloc > &
  13468. basic_string < _CharT , _Traits , _Alloc > ::
  13469. append ( const _CharT * __s , size_type __n )
  13470. {
  13471. ;
  13472. if ( __n )
  13473. {
  13474. _M_check_length ( size_type ( 0 ) , __n , "basic_string::append" ) ;
  13475. const size_type __len = __n + this -> size ( ) ;
  13476. if ( __len > this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  13477. {
  13478. if ( _M_disjunct ( __s ) )
  13479. this -> reserve ( __len ) ;
  13480. else
  13481. {
  13482. const size_type __off = __s - _M_data ( ) ;
  13483. this -> reserve ( __len ) ;
  13484. __s = _M_data ( ) + __off ;
  13485. }
  13486. }
  13487. _M_copy ( _M_data ( ) + this -> size ( ) , __s , __n ) ;
  13488. _M_rep ( ) -> _M_set_length_and_sharable ( __len ) ;
  13489. }
  13490. return * this ;
  13491. }
  13492.  
  13493. template < typename _CharT , typename _Traits , typename _Alloc >
  13494. basic_string < _CharT , _Traits , _Alloc > &
  13495. basic_string < _CharT , _Traits , _Alloc > ::
  13496. append ( const basic_string & __str )
  13497. {
  13498. const size_type __size = __str . size ( ) ;
  13499. if ( __size )
  13500. {
  13501. const size_type __len = __size + this -> size ( ) ;
  13502. if ( __len > this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  13503. this -> reserve ( __len ) ;
  13504. _M_copy ( _M_data ( ) + this -> size ( ) , __str . _M_data ( ) , __size ) ;
  13505. _M_rep ( ) -> _M_set_length_and_sharable ( __len ) ;
  13506. }
  13507. return * this ;
  13508. }
  13509.  
  13510. template < typename _CharT , typename _Traits , typename _Alloc >
  13511. basic_string < _CharT , _Traits , _Alloc > &
  13512. basic_string < _CharT , _Traits , _Alloc > ::
  13513. append ( const basic_string & __str , size_type __pos , size_type __n )
  13514. {
  13515. __str . _M_check ( __pos , "basic_string::append" ) ;
  13516. __n = __str . _M_limit ( __pos , __n ) ;
  13517. if ( __n )
  13518. {
  13519. const size_type __len = __n + this -> size ( ) ;
  13520. if ( __len > this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  13521. this -> reserve ( __len ) ;
  13522. _M_copy ( _M_data ( ) + this -> size ( ) , __str . _M_data ( ) + __pos , __n ) ;
  13523. _M_rep ( ) -> _M_set_length_and_sharable ( __len ) ;
  13524. }
  13525. return * this ;
  13526. }
  13527.  
  13528. template < typename _CharT , typename _Traits , typename _Alloc >
  13529. basic_string < _CharT , _Traits , _Alloc > &
  13530. basic_string < _CharT , _Traits , _Alloc > ::
  13531. insert ( size_type __pos , const _CharT * __s , size_type __n )
  13532. {
  13533. ;
  13534. _M_check ( __pos , "basic_string::insert" ) ;
  13535. _M_check_length ( size_type ( 0 ) , __n , "basic_string::insert" ) ;
  13536. if ( _M_disjunct ( __s ) || _M_rep ( ) -> _M_is_shared ( ) )
  13537. return _M_replace_safe ( __pos , size_type ( 0 ) , __s , __n ) ;
  13538. else
  13539. {
  13540.  
  13541. const size_type __off = __s - _M_data ( ) ;
  13542. _M_mutate ( __pos , 0 , __n ) ;
  13543. __s = _M_data ( ) + __off ;
  13544. _CharT * __p = _M_data ( ) + __pos ;
  13545. if ( __s + __n <= __p )
  13546. _M_copy ( __p , __s , __n ) ;
  13547. else if ( __s >= __p )
  13548. _M_copy ( __p , __s + __n , __n ) ;
  13549. else
  13550. {
  13551. const size_type __nleft = __p - __s ;
  13552. _M_copy ( __p , __s , __nleft ) ;
  13553. _M_copy ( __p + __nleft , __p + __n , __n - __nleft ) ;
  13554. }
  13555. return * this ;
  13556. }
  13557. }
  13558.  
  13559. template < typename _CharT , typename _Traits , typename _Alloc >
  13560. typename basic_string < _CharT , _Traits , _Alloc > :: iterator
  13561. basic_string < _CharT , _Traits , _Alloc > ::
  13562. erase ( iterator __first , iterator __last )
  13563. {
  13564.  
  13565. ;
  13566.  
  13567.  
  13568.  
  13569.  
  13570. const size_type __size = __last - __first ;
  13571. if ( __size )
  13572. {
  13573. const size_type __pos = __first - _M_ibegin ( ) ;
  13574. _M_mutate ( __pos , __size , size_type ( 0 ) ) ;
  13575. _M_rep ( ) -> _M_set_leaked ( ) ;
  13576. return iterator ( _M_data ( ) + __pos ) ;
  13577. }
  13578. else
  13579. return __first ;
  13580. }
  13581.  
  13582. template < typename _CharT , typename _Traits , typename _Alloc >
  13583. basic_string < _CharT , _Traits , _Alloc > &
  13584. basic_string < _CharT , _Traits , _Alloc > ::
  13585. replace ( size_type __pos , size_type __n1 , const _CharT * __s ,
  13586. size_type __n2 )
  13587. {
  13588. ;
  13589. _M_check ( __pos , "basic_string::replace" ) ;
  13590. __n1 = _M_limit ( __pos , __n1 ) ;
  13591. _M_check_length ( __n1 , __n2 , "basic_string::replace" ) ;
  13592. bool __left ;
  13593. if ( _M_disjunct ( __s ) || _M_rep ( ) -> _M_is_shared ( ) )
  13594. return _M_replace_safe ( __pos , __n1 , __s , __n2 ) ;
  13595. else if ( ( __left = __s + __n2 <= _M_data ( ) + __pos )
  13596. || _M_data ( ) + __pos + __n1 <= __s )
  13597. {
  13598.  
  13599. size_type __off = __s - _M_data ( ) ;
  13600. __left ? __off : ( __off += __n2 - __n1 ) ;
  13601. _M_mutate ( __pos , __n1 , __n2 ) ;
  13602. _M_copy ( _M_data ( ) + __pos , _M_data ( ) + __off , __n2 ) ;
  13603. return * this ;
  13604. }
  13605. else
  13606. {
  13607.  
  13608. const basic_string __tmp ( __s , __n2 ) ;
  13609. return _M_replace_safe ( __pos , __n1 , __tmp . _M_data ( ) , __n2 ) ;
  13610. }
  13611. }
  13612.  
  13613. template < typename _CharT , typename _Traits , typename _Alloc >
  13614. void
  13615. basic_string < _CharT , _Traits , _Alloc > :: _Rep ::
  13616. _M_destroy ( const _Alloc & __a ) throw ( )
  13617. {
  13618. const size_type __size = sizeof ( _Rep_base ) +
  13619. ( this -> _M_capacity + 1 ) * sizeof ( _CharT ) ;
  13620. _Raw_bytes_alloc ( __a ) . deallocate ( reinterpret_cast < char * > ( this ) , __size ) ;
  13621. }
  13622.  
  13623. template < typename _CharT , typename _Traits , typename _Alloc >
  13624. void
  13625. basic_string < _CharT , _Traits , _Alloc > ::
  13626. _M_leak_hard ( )
  13627. {
  13628.  
  13629. if ( _M_rep ( ) == & _S_empty_rep ( ) )
  13630. return ;
  13631.  
  13632. if ( _M_rep ( ) -> _M_is_shared ( ) )
  13633. _M_mutate ( 0 , 0 , 0 ) ;
  13634. _M_rep ( ) -> _M_set_leaked ( ) ;
  13635. }
  13636.  
  13637. template < typename _CharT , typename _Traits , typename _Alloc >
  13638. void
  13639. basic_string < _CharT , _Traits , _Alloc > ::
  13640. _M_mutate ( size_type __pos , size_type __len1 , size_type __len2 )
  13641. {
  13642. const size_type __old_size = this -> size ( ) ;
  13643. const size_type __new_size = __old_size + __len2 - __len1 ;
  13644. const size_type __how_much = __old_size - __pos - __len1 ;
  13645.  
  13646. if ( __new_size > this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  13647. {
  13648.  
  13649. const allocator_type __a = get_allocator ( ) ;
  13650. _Rep * __r = _Rep :: _S_create ( __new_size , this -> capacity ( ) , __a ) ;
  13651.  
  13652. if ( __pos )
  13653. _M_copy ( __r -> _M_refdata ( ) , _M_data ( ) , __pos ) ;
  13654. if ( __how_much )
  13655. _M_copy ( __r -> _M_refdata ( ) + __pos + __len2 ,
  13656. _M_data ( ) + __pos + __len1 , __how_much ) ;
  13657.  
  13658. _M_rep ( ) -> _M_dispose ( __a ) ;
  13659. _M_data ( __r -> _M_refdata ( ) ) ;
  13660. }
  13661. else if ( __how_much && __len1 != __len2 )
  13662. {
  13663.  
  13664. _M_move ( _M_data ( ) + __pos + __len2 ,
  13665. _M_data ( ) + __pos + __len1 , __how_much ) ;
  13666. }
  13667. _M_rep ( ) -> _M_set_length_and_sharable ( __new_size ) ;
  13668. }
  13669.  
  13670. template < typename _CharT , typename _Traits , typename _Alloc >
  13671. void
  13672. basic_string < _CharT , _Traits , _Alloc > ::
  13673. reserve ( size_type __res )
  13674. {
  13675. if ( __res != this -> capacity ( ) || _M_rep ( ) -> _M_is_shared ( ) )
  13676. {
  13677.  
  13678. if ( __res < this -> size ( ) )
  13679. __res = this -> size ( ) ;
  13680. const allocator_type __a = get_allocator ( ) ;
  13681. _CharT * __tmp = _M_rep ( ) -> _M_clone ( __a , __res - this -> size ( ) ) ;
  13682. _M_rep ( ) -> _M_dispose ( __a ) ;
  13683. _M_data ( __tmp ) ;
  13684. }
  13685. }
  13686.  
  13687. template < typename _CharT , typename _Traits , typename _Alloc >
  13688. void
  13689. basic_string < _CharT , _Traits , _Alloc > ::
  13690. swap ( basic_string & __s )
  13691. {
  13692. if ( _M_rep ( ) -> _M_is_leaked ( ) )
  13693. _M_rep ( ) -> _M_set_sharable ( ) ;
  13694. if ( __s . _M_rep ( ) -> _M_is_leaked ( ) )
  13695. __s . _M_rep ( ) -> _M_set_sharable ( ) ;
  13696. if ( this -> get_allocator ( ) == __s . get_allocator ( ) )
  13697. {
  13698. _CharT * __tmp = _M_data ( ) ;
  13699. _M_data ( __s . _M_data ( ) ) ;
  13700. __s . _M_data ( __tmp ) ;
  13701. }
  13702.  
  13703. else
  13704. {
  13705. const basic_string __tmp1 ( _M_ibegin ( ) , _M_iend ( ) ,
  13706. __s . get_allocator ( ) ) ;
  13707. const basic_string __tmp2 ( __s . _M_ibegin ( ) , __s . _M_iend ( ) ,
  13708. this -> get_allocator ( ) ) ;
  13709. * this = __tmp2 ;
  13710. __s = __tmp1 ;
  13711. }
  13712. }
  13713.  
  13714. template < typename _CharT , typename _Traits , typename _Alloc >
  13715. typename basic_string < _CharT , _Traits , _Alloc > :: _Rep *
  13716. basic_string < _CharT , _Traits , _Alloc > :: _Rep ::
  13717. _S_create ( size_type __capacity , size_type __old_capacity ,
  13718. const _Alloc & __alloc )
  13719. {
  13720.  
  13721.  
  13722. if ( __capacity > _S_max_size )
  13723. __throw_length_error ( ( "basic_string::_S_create" ) ) ;
  13724. #577
  13725. const size_type __pagesize = 4096 ;
  13726. const size_type __malloc_header_size = 4 * sizeof ( void * ) ;
  13727. #586
  13728. if ( __capacity > __old_capacity && __capacity < 2 * __old_capacity )
  13729. __capacity = 2 * __old_capacity ;
  13730.  
  13731.  
  13732.  
  13733.  
  13734. size_type __size = ( __capacity + 1 ) * sizeof ( _CharT ) + sizeof ( _Rep ) ;
  13735.  
  13736. const size_type __adj_size = __size + __malloc_header_size ;
  13737. if ( __adj_size > __pagesize && __capacity > __old_capacity )
  13738. {
  13739. const size_type __extra = __pagesize - __adj_size % __pagesize ;
  13740. __capacity += __extra / sizeof ( _CharT ) ;
  13741.  
  13742. if ( __capacity > _S_max_size )
  13743. __capacity = _S_max_size ;
  13744. __size = ( __capacity + 1 ) * sizeof ( _CharT ) + sizeof ( _Rep ) ;
  13745. }
  13746.  
  13747.  
  13748.  
  13749. void * __place = _Raw_bytes_alloc ( __alloc ) . allocate ( __size ) ;
  13750. _Rep * __p = new ( __place ) _Rep ;
  13751. __p -> _M_capacity = __capacity ;
  13752. #617
  13753. __p -> _M_set_sharable ( ) ;
  13754. return __p ;
  13755. }
  13756.  
  13757. template < typename _CharT , typename _Traits , typename _Alloc >
  13758. _CharT *
  13759. basic_string < _CharT , _Traits , _Alloc > :: _Rep ::
  13760. _M_clone ( const _Alloc & __alloc , size_type __res )
  13761. {
  13762.  
  13763. const size_type __requested_cap = this -> _M_length + __res ;
  13764. _Rep * __r = _Rep :: _S_create ( __requested_cap , this -> _M_capacity ,
  13765. __alloc ) ;
  13766. if ( this -> _M_length )
  13767. _M_copy ( __r -> _M_refdata ( ) , _M_refdata ( ) , this -> _M_length ) ;
  13768.  
  13769. __r -> _M_set_length_and_sharable ( this -> _M_length ) ;
  13770. return __r -> _M_refdata ( ) ;
  13771. }
  13772.  
  13773. template < typename _CharT , typename _Traits , typename _Alloc >
  13774. void
  13775. basic_string < _CharT , _Traits , _Alloc > ::
  13776. resize ( size_type __n , _CharT __c )
  13777. {
  13778. const size_type __size = this -> size ( ) ;
  13779. _M_check_length ( __size , __n , "basic_string::resize" ) ;
  13780. if ( __size < __n )
  13781. this -> append ( __n - __size , __c ) ;
  13782. else if ( __n < __size )
  13783. this -> erase ( __n ) ;
  13784.  
  13785. }
  13786.  
  13787. template < typename _CharT , typename _Traits , typename _Alloc >
  13788. template < typename _InputIterator >
  13789. basic_string < _CharT , _Traits , _Alloc > &
  13790. basic_string < _CharT , _Traits , _Alloc > ::
  13791. _M_replace_dispatch ( iterator __i1 , iterator __i2 , _InputIterator __k1 ,
  13792. _InputIterator __k2 , __false_type )
  13793. {
  13794. const basic_string __s ( __k1 , __k2 ) ;
  13795. const size_type __n1 = __i2 - __i1 ;
  13796. _M_check_length ( __n1 , __s . size ( ) , "basic_string::_M_replace_dispatch" ) ;
  13797. return _M_replace_safe ( __i1 - _M_ibegin ( ) , __n1 , __s . _M_data ( ) ,
  13798. __s . size ( ) ) ;
  13799. }
  13800.  
  13801. template < typename _CharT , typename _Traits , typename _Alloc >
  13802. basic_string < _CharT , _Traits , _Alloc > &
  13803. basic_string < _CharT , _Traits , _Alloc > ::
  13804. _M_replace_aux ( size_type __pos1 , size_type __n1 , size_type __n2 ,
  13805. _CharT __c )
  13806. {
  13807. _M_check_length ( __n1 , __n2 , "basic_string::_M_replace_aux" ) ;
  13808. _M_mutate ( __pos1 , __n1 , __n2 ) ;
  13809. if ( __n2 )
  13810. _M_assign ( _M_data ( ) + __pos1 , __n2 , __c ) ;
  13811. return * this ;
  13812. }
  13813.  
  13814. template < typename _CharT , typename _Traits , typename _Alloc >
  13815. basic_string < _CharT , _Traits , _Alloc > &
  13816. basic_string < _CharT , _Traits , _Alloc > ::
  13817. _M_replace_safe ( size_type __pos1 , size_type __n1 , const _CharT * __s ,
  13818. size_type __n2 )
  13819. {
  13820. _M_mutate ( __pos1 , __n1 , __n2 ) ;
  13821. if ( __n2 )
  13822. _M_copy ( _M_data ( ) + __pos1 , __s , __n2 ) ;
  13823. return * this ;
  13824. }
  13825.  
  13826. template < typename _CharT , typename _Traits , typename _Alloc >
  13827. basic_string < _CharT , _Traits , _Alloc >
  13828. operator + ( const _CharT * __lhs ,
  13829. const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  13830. {
  13831. ;
  13832. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  13833. typedef typename __string_type :: size_type __size_type ;
  13834. const __size_type __len = _Traits :: length ( __lhs ) ;
  13835. __string_type __str ;
  13836. __str . reserve ( __len + __rhs . size ( ) ) ;
  13837. __str . append ( __lhs , __len ) ;
  13838. __str . append ( __rhs ) ;
  13839. return __str ;
  13840. }
  13841.  
  13842. template < typename _CharT , typename _Traits , typename _Alloc >
  13843. basic_string < _CharT , _Traits , _Alloc >
  13844. operator + ( _CharT __lhs , const basic_string < _CharT , _Traits , _Alloc > & __rhs )
  13845. {
  13846. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  13847. typedef typename __string_type :: size_type __size_type ;
  13848. __string_type __str ;
  13849. const __size_type __len = __rhs . size ( ) ;
  13850. __str . reserve ( __len + 1 ) ;
  13851. __str . append ( __size_type ( 1 ) , __lhs ) ;
  13852. __str . append ( __rhs ) ;
  13853. return __str ;
  13854. }
  13855.  
  13856. template < typename _CharT , typename _Traits , typename _Alloc >
  13857. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13858. basic_string < _CharT , _Traits , _Alloc > ::
  13859. copy ( _CharT * __s , size_type __n , size_type __pos ) const
  13860. {
  13861. _M_check ( __pos , "basic_string::copy" ) ;
  13862. __n = _M_limit ( __pos , __n ) ;
  13863. ;
  13864. if ( __n )
  13865. _M_copy ( __s , _M_data ( ) + __pos , __n ) ;
  13866.  
  13867. return __n ;
  13868. }
  13869.  
  13870. template < typename _CharT , typename _Traits , typename _Alloc >
  13871. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13872. basic_string < _CharT , _Traits , _Alloc > ::
  13873. find ( const _CharT * __s , size_type __pos , size_type __n ) const
  13874. {
  13875. ;
  13876. const size_type __size = this -> size ( ) ;
  13877. const _CharT * __data = _M_data ( ) ;
  13878.  
  13879. if ( __n == 0 )
  13880. return __pos <= __size ? __pos : npos ;
  13881.  
  13882. if ( __n <= __size )
  13883. {
  13884. for ( ; __pos <= __size - __n ; ++ __pos )
  13885. if ( traits_type :: eq ( __data [ __pos ] , __s [ 0 ] )
  13886. && traits_type :: compare ( __data + __pos + 1 ,
  13887. __s + 1 , __n - 1 ) == 0 )
  13888. return __pos ;
  13889. }
  13890. return npos ;
  13891. }
  13892.  
  13893. template < typename _CharT , typename _Traits , typename _Alloc >
  13894. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13895. basic_string < _CharT , _Traits , _Alloc > ::
  13896. find ( _CharT __c , size_type __pos ) const noexcept
  13897. {
  13898. size_type __ret = npos ;
  13899. const size_type __size = this -> size ( ) ;
  13900. if ( __pos < __size )
  13901. {
  13902. const _CharT * __data = _M_data ( ) ;
  13903. const size_type __n = __size - __pos ;
  13904. const _CharT * __p = traits_type :: find ( __data + __pos , __n , __c ) ;
  13905. if ( __p )
  13906. __ret = __p - __data ;
  13907. }
  13908. return __ret ;
  13909. }
  13910.  
  13911. template < typename _CharT , typename _Traits , typename _Alloc >
  13912. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13913. basic_string < _CharT , _Traits , _Alloc > ::
  13914. rfind ( const _CharT * __s , size_type __pos , size_type __n ) const
  13915. {
  13916. ;
  13917. const size_type __size = this -> size ( ) ;
  13918. if ( __n <= __size )
  13919. {
  13920. __pos = std :: min ( size_type ( __size - __n ) , __pos ) ;
  13921. const _CharT * __data = _M_data ( ) ;
  13922. do
  13923. {
  13924. if ( traits_type :: compare ( __data + __pos , __s , __n ) == 0 )
  13925. return __pos ;
  13926. }
  13927. while ( __pos -- > 0 ) ;
  13928. }
  13929. return npos ;
  13930. }
  13931.  
  13932. template < typename _CharT , typename _Traits , typename _Alloc >
  13933. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13934. basic_string < _CharT , _Traits , _Alloc > ::
  13935. rfind ( _CharT __c , size_type __pos ) const noexcept
  13936. {
  13937. size_type __size = this -> size ( ) ;
  13938. if ( __size )
  13939. {
  13940. if ( -- __size > __pos )
  13941. __size = __pos ;
  13942. for ( ++ __size ; __size -- > 0 ; )
  13943. if ( traits_type :: eq ( _M_data ( ) [ __size ] , __c ) )
  13944. return __size ;
  13945. }
  13946. return npos ;
  13947. }
  13948.  
  13949. template < typename _CharT , typename _Traits , typename _Alloc >
  13950. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13951. basic_string < _CharT , _Traits , _Alloc > ::
  13952. find_first_of ( const _CharT * __s , size_type __pos , size_type __n ) const
  13953. {
  13954. ;
  13955. for ( ; __n && __pos < this -> size ( ) ; ++ __pos )
  13956. {
  13957. const _CharT * __p = traits_type :: find ( __s , __n , _M_data ( ) [ __pos ] ) ;
  13958. if ( __p )
  13959. return __pos ;
  13960. }
  13961. return npos ;
  13962. }
  13963.  
  13964. template < typename _CharT , typename _Traits , typename _Alloc >
  13965. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13966. basic_string < _CharT , _Traits , _Alloc > ::
  13967. find_last_of ( const _CharT * __s , size_type __pos , size_type __n ) const
  13968. {
  13969. ;
  13970. size_type __size = this -> size ( ) ;
  13971. if ( __size && __n )
  13972. {
  13973. if ( -- __size > __pos )
  13974. __size = __pos ;
  13975. do
  13976. {
  13977. if ( traits_type :: find ( __s , __n , _M_data ( ) [ __size ] ) )
  13978. return __size ;
  13979. }
  13980. while ( __size -- != 0 ) ;
  13981. }
  13982. return npos ;
  13983. }
  13984.  
  13985. template < typename _CharT , typename _Traits , typename _Alloc >
  13986. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13987. basic_string < _CharT , _Traits , _Alloc > ::
  13988. find_first_not_of ( const _CharT * __s , size_type __pos , size_type __n ) const
  13989. {
  13990. ;
  13991. for ( ; __pos < this -> size ( ) ; ++ __pos )
  13992. if ( ! traits_type :: find ( __s , __n , _M_data ( ) [ __pos ] ) )
  13993. return __pos ;
  13994. return npos ;
  13995. }
  13996.  
  13997. template < typename _CharT , typename _Traits , typename _Alloc >
  13998. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  13999. basic_string < _CharT , _Traits , _Alloc > ::
  14000. find_first_not_of ( _CharT __c , size_type __pos ) const noexcept
  14001. {
  14002. for ( ; __pos < this -> size ( ) ; ++ __pos )
  14003. if ( ! traits_type :: eq ( _M_data ( ) [ __pos ] , __c ) )
  14004. return __pos ;
  14005. return npos ;
  14006. }
  14007.  
  14008. template < typename _CharT , typename _Traits , typename _Alloc >
  14009. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  14010. basic_string < _CharT , _Traits , _Alloc > ::
  14011. find_last_not_of ( const _CharT * __s , size_type __pos , size_type __n ) const
  14012. {
  14013. ;
  14014. size_type __size = this -> size ( ) ;
  14015. if ( __size )
  14016. {
  14017. if ( -- __size > __pos )
  14018. __size = __pos ;
  14019. do
  14020. {
  14021. if ( ! traits_type :: find ( __s , __n , _M_data ( ) [ __size ] ) )
  14022. return __size ;
  14023. }
  14024. while ( __size -- ) ;
  14025. }
  14026. return npos ;
  14027. }
  14028.  
  14029. template < typename _CharT , typename _Traits , typename _Alloc >
  14030. typename basic_string < _CharT , _Traits , _Alloc > :: size_type
  14031. basic_string < _CharT , _Traits , _Alloc > ::
  14032. find_last_not_of ( _CharT __c , size_type __pos ) const noexcept
  14033. {
  14034. size_type __size = this -> size ( ) ;
  14035. if ( __size )
  14036. {
  14037. if ( -- __size > __pos )
  14038. __size = __pos ;
  14039. do
  14040. {
  14041. if ( ! traits_type :: eq ( _M_data ( ) [ __size ] , __c ) )
  14042. return __size ;
  14043. }
  14044. while ( __size -- ) ;
  14045. }
  14046. return npos ;
  14047. }
  14048.  
  14049. template < typename _CharT , typename _Traits , typename _Alloc >
  14050. int
  14051. basic_string < _CharT , _Traits , _Alloc > ::
  14052. compare ( size_type __pos , size_type __n , const basic_string & __str ) const
  14053. {
  14054. _M_check ( __pos , "basic_string::compare" ) ;
  14055. __n = _M_limit ( __pos , __n ) ;
  14056. const size_type __osize = __str . size ( ) ;
  14057. const size_type __len = std :: min ( __n , __osize ) ;
  14058. int __r = traits_type :: compare ( _M_data ( ) + __pos , __str . data ( ) , __len ) ;
  14059. if ( ! __r )
  14060. __r = _S_compare ( __n , __osize ) ;
  14061. return __r ;
  14062. }
  14063.  
  14064. template < typename _CharT , typename _Traits , typename _Alloc >
  14065. int
  14066. basic_string < _CharT , _Traits , _Alloc > ::
  14067. compare ( size_type __pos1 , size_type __n1 , const basic_string & __str ,
  14068. size_type __pos2 , size_type __n2 ) const
  14069. {
  14070. _M_check ( __pos1 , "basic_string::compare" ) ;
  14071. __str . _M_check ( __pos2 , "basic_string::compare" ) ;
  14072. __n1 = _M_limit ( __pos1 , __n1 ) ;
  14073. __n2 = __str . _M_limit ( __pos2 , __n2 ) ;
  14074. const size_type __len = std :: min ( __n1 , __n2 ) ;
  14075. int __r = traits_type :: compare ( _M_data ( ) + __pos1 ,
  14076. __str . data ( ) + __pos2 , __len ) ;
  14077. if ( ! __r )
  14078. __r = _S_compare ( __n1 , __n2 ) ;
  14079. return __r ;
  14080. }
  14081.  
  14082. template < typename _CharT , typename _Traits , typename _Alloc >
  14083. int
  14084. basic_string < _CharT , _Traits , _Alloc > ::
  14085. compare ( const _CharT * __s ) const
  14086. {
  14087. ;
  14088. const size_type __size = this -> size ( ) ;
  14089. const size_type __osize = traits_type :: length ( __s ) ;
  14090. const size_type __len = std :: min ( __size , __osize ) ;
  14091. int __r = traits_type :: compare ( _M_data ( ) , __s , __len ) ;
  14092. if ( ! __r )
  14093. __r = _S_compare ( __size , __osize ) ;
  14094. return __r ;
  14095. }
  14096.  
  14097. template < typename _CharT , typename _Traits , typename _Alloc >
  14098. int
  14099. basic_string < _CharT , _Traits , _Alloc > ::
  14100. compare ( size_type __pos , size_type __n1 , const _CharT * __s ) const
  14101. {
  14102. ;
  14103. _M_check ( __pos , "basic_string::compare" ) ;
  14104. __n1 = _M_limit ( __pos , __n1 ) ;
  14105. const size_type __osize = traits_type :: length ( __s ) ;
  14106. const size_type __len = std :: min ( __n1 , __osize ) ;
  14107. int __r = traits_type :: compare ( _M_data ( ) + __pos , __s , __len ) ;
  14108. if ( ! __r )
  14109. __r = _S_compare ( __n1 , __osize ) ;
  14110. return __r ;
  14111. }
  14112.  
  14113. template < typename _CharT , typename _Traits , typename _Alloc >
  14114. int
  14115. basic_string < _CharT , _Traits , _Alloc > ::
  14116. compare ( size_type __pos , size_type __n1 , const _CharT * __s ,
  14117. size_type __n2 ) const
  14118. {
  14119. ;
  14120. _M_check ( __pos , "basic_string::compare" ) ;
  14121. __n1 = _M_limit ( __pos , __n1 ) ;
  14122. const size_type __len = std :: min ( __n1 , __n2 ) ;
  14123. int __r = traits_type :: compare ( _M_data ( ) + __pos , __s , __len ) ;
  14124. if ( ! __r )
  14125. __r = _S_compare ( __n1 , __n2 ) ;
  14126. return __r ;
  14127. }
  14128.  
  14129.  
  14130. template < typename _CharT , typename _Traits , typename _Alloc >
  14131. basic_istream < _CharT , _Traits > &
  14132. operator >> ( basic_istream < _CharT , _Traits > & __in ,
  14133. basic_string < _CharT , _Traits , _Alloc > & __str )
  14134. {
  14135. typedef basic_istream < _CharT , _Traits > __istream_type ;
  14136. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  14137. typedef typename __istream_type :: ios_base __ios_base ;
  14138. typedef typename __istream_type :: int_type __int_type ;
  14139. typedef typename __string_type :: size_type __size_type ;
  14140. typedef ctype < _CharT > __ctype_type ;
  14141. typedef typename __ctype_type :: ctype_base __ctype_base ;
  14142.  
  14143. __size_type __extracted = 0 ;
  14144. typename __ios_base :: iostate __err = __ios_base :: goodbit ;
  14145. typename __istream_type :: sentry __cerb ( __in , false ) ;
  14146. if ( __cerb )
  14147. {
  14148. try
  14149. {
  14150.  
  14151. __str . erase ( ) ;
  14152. _CharT __buf [ 128 ] ;
  14153. __size_type __len = 0 ;
  14154. const streamsize __w = __in . width ( ) ;
  14155. const __size_type __n = __w > 0 ? static_cast < __size_type > ( __w )
  14156. : __str . max_size ( ) ;
  14157. const __ctype_type & __ct = use_facet < __ctype_type > ( __in . getloc ( ) ) ;
  14158. const __int_type __eof = _Traits :: eof ( ) ;
  14159. __int_type __c = __in . rdbuf ( ) -> sgetc ( ) ;
  14160.  
  14161. while ( __extracted < __n
  14162. && ! _Traits :: eq_int_type ( __c , __eof )
  14163. && ! __ct . is ( __ctype_base :: space ,
  14164. _Traits :: to_char_type ( __c ) ) )
  14165. {
  14166. if ( __len == sizeof ( __buf ) / sizeof ( _CharT ) )
  14167. {
  14168. __str . append ( __buf , sizeof ( __buf ) / sizeof ( _CharT ) ) ;
  14169. __len = 0 ;
  14170. }
  14171. __buf [ __len ++ ] = _Traits :: to_char_type ( __c ) ;
  14172. ++ __extracted ;
  14173. __c = __in . rdbuf ( ) -> snextc ( ) ;
  14174. }
  14175. __str . append ( __buf , __len ) ;
  14176.  
  14177. if ( _Traits :: eq_int_type ( __c , __eof ) )
  14178. __err |= __ios_base :: eofbit ;
  14179. __in . width ( 0 ) ;
  14180. }
  14181. catch ( __cxxabiv1 :: __forced_unwind & )
  14182. {
  14183. __in . _M_setstate ( __ios_base :: badbit ) ;
  14184. throw ;
  14185. }
  14186. catch ( ... )
  14187. {
  14188.  
  14189.  
  14190.  
  14191. __in . _M_setstate ( __ios_base :: badbit ) ;
  14192. }
  14193. }
  14194.  
  14195. if ( ! __extracted )
  14196. __err |= __ios_base :: failbit ;
  14197. if ( __err )
  14198. __in . setstate ( __err ) ;
  14199. return __in ;
  14200. }
  14201.  
  14202. template < typename _CharT , typename _Traits , typename _Alloc >
  14203. basic_istream < _CharT , _Traits > &
  14204. getline ( basic_istream < _CharT , _Traits > & __in ,
  14205. basic_string < _CharT , _Traits , _Alloc > & __str , _CharT __delim )
  14206. {
  14207. typedef basic_istream < _CharT , _Traits > __istream_type ;
  14208. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  14209. typedef typename __istream_type :: ios_base __ios_base ;
  14210. typedef typename __istream_type :: int_type __int_type ;
  14211. typedef typename __string_type :: size_type __size_type ;
  14212.  
  14213. __size_type __extracted = 0 ;
  14214. const __size_type __n = __str . max_size ( ) ;
  14215. typename __ios_base :: iostate __err = __ios_base :: goodbit ;
  14216. typename __istream_type :: sentry __cerb ( __in , true ) ;
  14217. if ( __cerb )
  14218. {
  14219. try
  14220. {
  14221. __str . erase ( ) ;
  14222. const __int_type __idelim = _Traits :: to_int_type ( __delim ) ;
  14223. const __int_type __eof = _Traits :: eof ( ) ;
  14224. __int_type __c = __in . rdbuf ( ) -> sgetc ( ) ;
  14225.  
  14226. while ( __extracted < __n
  14227. && ! _Traits :: eq_int_type ( __c , __eof )
  14228. && ! _Traits :: eq_int_type ( __c , __idelim ) )
  14229. {
  14230. __str += _Traits :: to_char_type ( __c ) ;
  14231. ++ __extracted ;
  14232. __c = __in . rdbuf ( ) -> snextc ( ) ;
  14233. }
  14234.  
  14235. if ( _Traits :: eq_int_type ( __c , __eof ) )
  14236. __err |= __ios_base :: eofbit ;
  14237. else if ( _Traits :: eq_int_type ( __c , __idelim ) )
  14238. {
  14239. ++ __extracted ;
  14240. __in . rdbuf ( ) -> sbumpc ( ) ;
  14241. }
  14242. else
  14243. __err |= __ios_base :: failbit ;
  14244. }
  14245. catch ( __cxxabiv1 :: __forced_unwind & )
  14246. {
  14247. __in . _M_setstate ( __ios_base :: badbit ) ;
  14248. throw ;
  14249. }
  14250. catch ( ... )
  14251. {
  14252.  
  14253.  
  14254.  
  14255. __in . _M_setstate ( __ios_base :: badbit ) ;
  14256. }
  14257. }
  14258. if ( ! __extracted )
  14259. __err |= __ios_base :: failbit ;
  14260. if ( __err )
  14261. __in . setstate ( __err ) ;
  14262. return __in ;
  14263. }
  14264.  
  14265.  
  14266.  
  14267.  
  14268. extern template class basic_string < char > ;
  14269. extern template
  14270. basic_istream < char > &
  14271. operator >> ( basic_istream < char > & , string & ) ;
  14272. extern template
  14273. basic_ostream < char > &
  14274. operator << ( basic_ostream < char > & , const string & ) ;
  14275. extern template
  14276. basic_istream < char > &
  14277. getline ( basic_istream < char > & , string & , char ) ;
  14278. extern template
  14279. basic_istream < char > &
  14280. getline ( basic_istream < char > & , string & ) ;
  14281.  
  14282.  
  14283. extern template class basic_string < wchar_t > ;
  14284. extern template
  14285. basic_istream < wchar_t > &
  14286. operator >> ( basic_istream < wchar_t > & , wstring & ) ;
  14287. extern template
  14288. basic_ostream < wchar_t > &
  14289. operator << ( basic_ostream < wchar_t > & , const wstring & ) ;
  14290. extern template
  14291. basic_istream < wchar_t > &
  14292. getline ( basic_istream < wchar_t > & , wstring & , wchar_t ) ;
  14293. extern template
  14294. basic_istream < wchar_t > &
  14295. getline ( basic_istream < wchar_t > & , wstring & ) ;
  14296.  
  14297.  
  14298.  
  14299.  
  14300. }
  14301. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/stdexcept"
  14302. #36
  14303. #pragma GCC system_header
  14304. #41
  14305. namespace std
  14306. {
  14307. #55
  14308. class logic_error : public exception
  14309. {
  14310. string _M_msg ;
  14311.  
  14312. public :
  14313.  
  14314. explicit
  14315. logic_error ( const string & __arg ) ;
  14316.  
  14317. virtual ~ logic_error ( ) noexcept ;
  14318.  
  14319.  
  14320.  
  14321. virtual const char *
  14322. what ( ) const noexcept ;
  14323. } ;
  14324.  
  14325.  
  14326.  
  14327. class domain_error : public logic_error
  14328. {
  14329. public :
  14330. explicit domain_error ( const string & __arg ) ;
  14331. virtual ~ domain_error ( ) noexcept ;
  14332. } ;
  14333.  
  14334.  
  14335. class invalid_argument : public logic_error
  14336. {
  14337. public :
  14338. explicit invalid_argument ( const string & __arg ) ;
  14339. virtual ~ invalid_argument ( ) noexcept ;
  14340. } ;
  14341.  
  14342.  
  14343.  
  14344. class length_error : public logic_error
  14345. {
  14346. public :
  14347. explicit length_error ( const string & __arg ) ;
  14348. virtual ~ length_error ( ) noexcept ;
  14349. } ;
  14350.  
  14351.  
  14352.  
  14353. class out_of_range : public logic_error
  14354. {
  14355. public :
  14356. explicit out_of_range ( const string & __arg ) ;
  14357. virtual ~ out_of_range ( ) noexcept ;
  14358. } ;
  14359. #112
  14360. class runtime_error : public exception
  14361. {
  14362. string _M_msg ;
  14363.  
  14364. public :
  14365.  
  14366. explicit
  14367. runtime_error ( const string & __arg ) ;
  14368.  
  14369. virtual ~ runtime_error ( ) noexcept ;
  14370.  
  14371.  
  14372.  
  14373. virtual const char *
  14374. what ( ) const noexcept ;
  14375. } ;
  14376.  
  14377.  
  14378. class range_error : public runtime_error
  14379. {
  14380. public :
  14381. explicit range_error ( const string & __arg ) ;
  14382. virtual ~ range_error ( ) noexcept ;
  14383. } ;
  14384.  
  14385.  
  14386. class overflow_error : public runtime_error
  14387. {
  14388. public :
  14389. explicit overflow_error ( const string & __arg ) ;
  14390. virtual ~ overflow_error ( ) noexcept ;
  14391. } ;
  14392.  
  14393.  
  14394. class underflow_error : public runtime_error
  14395. {
  14396. public :
  14397. explicit underflow_error ( const string & __arg ) ;
  14398. virtual ~ underflow_error ( ) noexcept ;
  14399. } ;
  14400.  
  14401.  
  14402.  
  14403.  
  14404. }
  14405. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/iterator"
  14406. #58
  14407. #pragma GCC system_header
  14408. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ostream"
  14409. #36
  14410. #pragma GCC system_header
  14411. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ios"
  14412. #36
  14413. #pragma GCC system_header
  14414. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/ios_base.h"
  14415. #37
  14416. #pragma GCC system_header
  14417. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_classes.h"
  14418. #37
  14419. #pragma GCC system_header
  14420. #43
  14421. namespace std
  14422. {
  14423. #62
  14424. class locale
  14425. {
  14426. public :
  14427.  
  14428.  
  14429. typedef int category ;
  14430.  
  14431.  
  14432. class facet ;
  14433. class id ;
  14434. class _Impl ;
  14435.  
  14436. friend class facet ;
  14437. friend class _Impl ;
  14438.  
  14439. template < typename _Facet >
  14440. friend bool
  14441. has_facet ( const locale & ) throw ( ) ;
  14442.  
  14443. template < typename _Facet >
  14444. friend const _Facet &
  14445. use_facet ( const locale & ) ;
  14446.  
  14447. template < typename _Cache >
  14448. friend struct __use_cache ;
  14449. #98
  14450. static const category none = 0 ;
  14451. static const category ctype = 1L << 0 ;
  14452. static const category numeric = 1L << 1 ;
  14453. static const category collate = 1L << 2 ;
  14454. static const category time = 1L << 3 ;
  14455. static const category monetary = 1L << 4 ;
  14456. static const category messages = 1L << 5 ;
  14457. static const category all = ( ctype | numeric | collate |
  14458. time | monetary | messages ) ;
  14459. #117
  14460. locale ( ) throw ( ) ;
  14461. #126
  14462. locale ( const locale & __other ) throw ( ) ;
  14463. #136
  14464. explicit
  14465. locale ( const char * __s ) ;
  14466. #151
  14467. locale ( const locale & __base , const char * __s , category __cat ) ;
  14468. #164
  14469. locale ( const locale & __base , const locale & __add , category __cat ) ;
  14470. #177
  14471. template < typename _Facet >
  14472. locale ( const locale & __other , _Facet * __f ) ;
  14473.  
  14474.  
  14475. ~ locale ( ) throw ( ) ;
  14476. #191
  14477. const locale &
  14478. operator = ( const locale & __other ) throw ( ) ;
  14479. #206
  14480. template < typename _Facet >
  14481. locale
  14482. combine ( const locale & __other ) const ;
  14483. #215
  14484. string
  14485. name ( ) const ;
  14486. #225
  14487. bool
  14488. operator == ( const locale & __other ) const throw ( ) ;
  14489. #234
  14490. bool
  14491. operator != ( const locale & __other ) const throw ( )
  14492. { return ! ( this -> operator == ( __other ) ) ; }
  14493. #253
  14494. template < typename _Char , typename _Traits , typename _Alloc >
  14495. bool
  14496. operator ( ) ( const basic_string < _Char , _Traits , _Alloc > & __s1 ,
  14497. const basic_string < _Char , _Traits , _Alloc > & __s2 ) const ;
  14498. #269
  14499. static locale
  14500. global ( const locale & __loc ) ;
  14501.  
  14502.  
  14503.  
  14504.  
  14505. static const locale &
  14506. classic ( ) ;
  14507.  
  14508. private :
  14509.  
  14510. _Impl * _M_impl ;
  14511.  
  14512.  
  14513. static _Impl * _S_classic ;
  14514.  
  14515.  
  14516. static _Impl * _S_global ;
  14517.  
  14518.  
  14519.  
  14520.  
  14521.  
  14522. static const char * const * const _S_categories ;
  14523. #304
  14524. enum { _S_categories_size = 6 + 0 } ;
  14525.  
  14526.  
  14527. static __gthread_once_t _S_once ;
  14528.  
  14529.  
  14530. explicit
  14531. locale ( _Impl * ) throw ( ) ;
  14532.  
  14533. static void
  14534. _S_initialize ( ) ;
  14535.  
  14536. static void
  14537. _S_initialize_once ( ) throw ( ) ;
  14538.  
  14539. static category
  14540. _S_normalize_category ( category ) ;
  14541.  
  14542. void
  14543. _M_coalesce ( const locale & __base , const locale & __add , category __cat ) ;
  14544. } ;
  14545. #338
  14546. class locale :: facet
  14547. {
  14548. private :
  14549. friend class locale ;
  14550. friend class locale :: _Impl ;
  14551.  
  14552. mutable _Atomic_word _M_refcount ;
  14553.  
  14554.  
  14555. static __c_locale _S_c_locale ;
  14556.  
  14557.  
  14558. static const char _S_c_name [ 2 ] ;
  14559.  
  14560.  
  14561. static __gthread_once_t _S_once ;
  14562.  
  14563.  
  14564. static void
  14565. _S_initialize_once ( ) ;
  14566.  
  14567. protected :
  14568. #369
  14569. explicit
  14570. facet ( size_t __refs = 0 ) throw ( ) : _M_refcount ( __refs ? 1 : 0 )
  14571. { }
  14572.  
  14573.  
  14574. virtual
  14575. ~ facet ( ) ;
  14576.  
  14577. static void
  14578. _S_create_c_locale ( __c_locale & __cloc , const char * __s ,
  14579. __c_locale __old = 0 ) ;
  14580.  
  14581. static __c_locale
  14582. _S_clone_c_locale ( __c_locale & __cloc ) throw ( ) ;
  14583.  
  14584. static void
  14585. _S_destroy_c_locale ( __c_locale & __cloc ) ;
  14586.  
  14587. static __c_locale
  14588. _S_lc_ctype_c_locale ( __c_locale __cloc , const char * __s ) ;
  14589.  
  14590.  
  14591.  
  14592. static __c_locale
  14593. _S_get_c_locale ( ) ;
  14594.  
  14595. __attribute__ ( ( __const__ ) ) static const char *
  14596. _S_get_c_name ( ) throw ( ) ;
  14597.  
  14598. private :
  14599. void
  14600. _M_add_reference ( ) const throw ( )
  14601. { __gnu_cxx :: __atomic_add_dispatch ( & _M_refcount , 1 ) ; }
  14602.  
  14603. void
  14604. _M_remove_reference ( ) const throw ( )
  14605. {
  14606.  
  14607. ;
  14608. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_refcount , - 1 ) == 1 )
  14609. {
  14610. ;
  14611. try
  14612. { delete this ; }
  14613. catch ( ... )
  14614. { }
  14615. }
  14616. }
  14617.  
  14618. facet ( const facet & ) ;
  14619.  
  14620. facet &
  14621. operator = ( const facet & ) ;
  14622. } ;
  14623. #436
  14624. class locale :: id
  14625. {
  14626. private :
  14627. friend class locale ;
  14628. friend class locale :: _Impl ;
  14629.  
  14630. template < typename _Facet >
  14631. friend const _Facet &
  14632. use_facet ( const locale & ) ;
  14633.  
  14634. template < typename _Facet >
  14635. friend bool
  14636. has_facet ( const locale & ) throw ( ) ;
  14637.  
  14638.  
  14639.  
  14640.  
  14641. mutable size_t _M_index ;
  14642.  
  14643.  
  14644. static _Atomic_word _S_refcount ;
  14645.  
  14646. void
  14647. operator = ( const id & ) ;
  14648.  
  14649. id ( const id & ) ;
  14650.  
  14651. public :
  14652.  
  14653.  
  14654.  
  14655. id ( ) { }
  14656.  
  14657. size_t
  14658. _M_id ( ) const throw ( ) ;
  14659. } ;
  14660.  
  14661.  
  14662.  
  14663. class locale :: _Impl
  14664. {
  14665. public :
  14666.  
  14667. friend class locale ;
  14668. friend class locale :: facet ;
  14669.  
  14670. template < typename _Facet >
  14671. friend bool
  14672. has_facet ( const locale & ) throw ( ) ;
  14673.  
  14674. template < typename _Facet >
  14675. friend const _Facet &
  14676. use_facet ( const locale & ) ;
  14677.  
  14678. template < typename _Cache >
  14679. friend struct __use_cache ;
  14680.  
  14681. private :
  14682.  
  14683. _Atomic_word _M_refcount ;
  14684. const facet * * _M_facets ;
  14685. size_t _M_facets_size ;
  14686. const facet * * _M_caches ;
  14687. char * * _M_names ;
  14688. static const locale :: id * const _S_id_ctype [ ] ;
  14689. static const locale :: id * const _S_id_numeric [ ] ;
  14690. static const locale :: id * const _S_id_collate [ ] ;
  14691. static const locale :: id * const _S_id_time [ ] ;
  14692. static const locale :: id * const _S_id_monetary [ ] ;
  14693. static const locale :: id * const _S_id_messages [ ] ;
  14694. static const locale :: id * const * const _S_facet_categories [ ] ;
  14695.  
  14696. void
  14697. _M_add_reference ( ) throw ( )
  14698. { __gnu_cxx :: __atomic_add_dispatch ( & _M_refcount , 1 ) ; }
  14699.  
  14700. void
  14701. _M_remove_reference ( ) throw ( )
  14702. {
  14703.  
  14704. ;
  14705. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_refcount , - 1 ) == 1 )
  14706. {
  14707. ;
  14708. try
  14709. { delete this ; }
  14710. catch ( ... )
  14711. { }
  14712. }
  14713. }
  14714.  
  14715. _Impl ( const _Impl & , size_t ) ;
  14716. _Impl ( const char * , size_t ) ;
  14717. _Impl ( size_t ) throw ( ) ;
  14718.  
  14719. ~ _Impl ( ) throw ( ) ;
  14720.  
  14721. _Impl ( const _Impl & ) ;
  14722.  
  14723. void
  14724. operator = ( const _Impl & ) ;
  14725.  
  14726. bool
  14727. _M_check_same_name ( )
  14728. {
  14729. bool __ret = true ;
  14730. if ( _M_names [ 1 ] )
  14731.  
  14732. for ( size_t __i = 0 ; __ret && __i < _S_categories_size - 1 ; ++ __i )
  14733. __ret = __builtin_strcmp ( _M_names [ __i ] , _M_names [ __i + 1 ] ) == 0 ;
  14734. return __ret ;
  14735. }
  14736.  
  14737. void
  14738. _M_replace_categories ( const _Impl * , category ) ;
  14739.  
  14740. void
  14741. _M_replace_category ( const _Impl * , const locale :: id * const * ) ;
  14742.  
  14743. void
  14744. _M_replace_facet ( const _Impl * , const locale :: id * ) ;
  14745.  
  14746. void
  14747. _M_install_facet ( const locale :: id * , const facet * ) ;
  14748.  
  14749. template < typename _Facet >
  14750. void
  14751. _M_init_facet ( _Facet * __facet )
  14752. { _M_install_facet ( & _Facet :: id , __facet ) ; }
  14753.  
  14754. void
  14755. _M_install_cache ( const facet * , size_t ) ;
  14756. } ;
  14757. #583
  14758. template < typename _CharT >
  14759. class collate : public locale :: facet
  14760. {
  14761. public :
  14762.  
  14763.  
  14764.  
  14765. typedef _CharT char_type ;
  14766. typedef basic_string < _CharT > string_type ;
  14767.  
  14768.  
  14769. protected :
  14770.  
  14771.  
  14772. __c_locale _M_c_locale_collate ;
  14773.  
  14774. public :
  14775.  
  14776. static locale :: id id ;
  14777. #610
  14778. explicit
  14779. collate ( size_t __refs = 0 )
  14780. : facet ( __refs ) , _M_c_locale_collate ( _S_get_c_locale ( ) )
  14781. { }
  14782. #624
  14783. explicit
  14784. collate ( __c_locale __cloc , size_t __refs = 0 )
  14785. : facet ( __refs ) , _M_c_locale_collate ( _S_clone_c_locale ( __cloc ) )
  14786. { }
  14787. #641
  14788. int
  14789. compare ( const _CharT * __lo1 , const _CharT * __hi1 ,
  14790. const _CharT * __lo2 , const _CharT * __hi2 ) const
  14791. { return this -> do_compare ( __lo1 , __hi1 , __lo2 , __hi2 ) ; }
  14792. #660
  14793. string_type
  14794. transform ( const _CharT * __lo , const _CharT * __hi ) const
  14795. { return this -> do_transform ( __lo , __hi ) ; }
  14796. #674
  14797. long
  14798. hash ( const _CharT * __lo , const _CharT * __hi ) const
  14799. { return this -> do_hash ( __lo , __hi ) ; }
  14800.  
  14801.  
  14802. int
  14803. _M_compare ( const _CharT * , const _CharT * ) const throw ( ) ;
  14804.  
  14805. size_t
  14806. _M_transform ( _CharT * , const _CharT * , size_t ) const throw ( ) ;
  14807.  
  14808. protected :
  14809.  
  14810. virtual
  14811. ~ collate ( )
  14812. { _S_destroy_c_locale ( _M_c_locale_collate ) ; }
  14813. #703
  14814. virtual int
  14815. do_compare ( const _CharT * __lo1 , const _CharT * __hi1 ,
  14816. const _CharT * __lo2 , const _CharT * __hi2 ) const ;
  14817. #717
  14818. virtual string_type
  14819. do_transform ( const _CharT * __lo , const _CharT * __hi ) const ;
  14820. #730
  14821. virtual long
  14822. do_hash ( const _CharT * __lo , const _CharT * __hi ) const ;
  14823. } ;
  14824.  
  14825. template < typename _CharT >
  14826. locale :: id collate < _CharT > :: id ;
  14827.  
  14828.  
  14829. template < >
  14830. int
  14831. collate < char > :: _M_compare ( const char * , const char * ) const throw ( ) ;
  14832.  
  14833. template < >
  14834. size_t
  14835. collate < char > :: _M_transform ( char * , const char * , size_t ) const throw ( ) ;
  14836.  
  14837.  
  14838. template < >
  14839. int
  14840. collate < wchar_t > :: _M_compare ( const wchar_t * , const wchar_t * ) const throw ( ) ;
  14841.  
  14842. template < >
  14843. size_t
  14844. collate < wchar_t > :: _M_transform ( wchar_t * , const wchar_t * , size_t ) const throw ( ) ;
  14845.  
  14846.  
  14847.  
  14848. template < typename _CharT >
  14849. class collate_byname : public collate < _CharT >
  14850. {
  14851. public :
  14852.  
  14853.  
  14854. typedef _CharT char_type ;
  14855. typedef basic_string < _CharT > string_type ;
  14856.  
  14857.  
  14858. explicit
  14859. collate_byname ( const char * __s , size_t __refs = 0 )
  14860. : collate < _CharT > ( __refs )
  14861. {
  14862. if ( __builtin_strcmp ( __s , "C" ) != 0
  14863. && __builtin_strcmp ( __s , "POSIX" ) != 0 )
  14864. {
  14865. this -> _S_destroy_c_locale ( this -> _M_c_locale_collate ) ;
  14866. this -> _S_create_c_locale ( this -> _M_c_locale_collate , __s ) ;
  14867. }
  14868. }
  14869.  
  14870. protected :
  14871. virtual
  14872. ~ collate_byname ( ) { }
  14873. } ;
  14874.  
  14875.  
  14876. }
  14877. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_classes.tcc"
  14878. #37
  14879. #pragma GCC system_header
  14880.  
  14881. namespace std
  14882. {
  14883.  
  14884.  
  14885. template < typename _Facet >
  14886. locale ::
  14887. locale ( const locale & __other , _Facet * __f )
  14888. {
  14889. _M_impl = new _Impl ( * __other . _M_impl , 1 ) ;
  14890.  
  14891. try
  14892. { _M_impl -> _M_install_facet ( & _Facet :: id , __f ) ; }
  14893. catch ( ... )
  14894. {
  14895. _M_impl -> _M_remove_reference ( ) ;
  14896. throw ;
  14897. }
  14898. delete [ ] _M_impl -> _M_names [ 0 ] ;
  14899. _M_impl -> _M_names [ 0 ] = 0 ;
  14900. }
  14901.  
  14902. template < typename _Facet >
  14903. locale
  14904. locale ::
  14905. combine ( const locale & __other ) const
  14906. {
  14907. _Impl * __tmp = new _Impl ( * _M_impl , 1 ) ;
  14908. try
  14909. {
  14910. __tmp -> _M_replace_facet ( __other . _M_impl , & _Facet :: id ) ;
  14911. }
  14912. catch ( ... )
  14913. {
  14914. __tmp -> _M_remove_reference ( ) ;
  14915. throw ;
  14916. }
  14917. return locale ( __tmp ) ;
  14918. }
  14919.  
  14920. template < typename _CharT , typename _Traits , typename _Alloc >
  14921. bool
  14922. locale ::
  14923. operator ( ) ( const basic_string < _CharT , _Traits , _Alloc > & __s1 ,
  14924. const basic_string < _CharT , _Traits , _Alloc > & __s2 ) const
  14925. {
  14926. typedef std :: collate < _CharT > __collate_type ;
  14927. const __collate_type & __collate = use_facet < __collate_type > ( * this ) ;
  14928. return ( __collate . compare ( __s1 . data ( ) , __s1 . data ( ) + __s1 . length ( ) ,
  14929. __s2 . data ( ) , __s2 . data ( ) + __s2 . length ( ) ) < 0 ) ;
  14930. }
  14931. #102
  14932. template < typename _Facet >
  14933. bool
  14934. has_facet ( const locale & __loc ) throw ( )
  14935. {
  14936. const size_t __i = _Facet :: id . _M_id ( ) ;
  14937. const locale :: facet * * __facets = __loc . _M_impl -> _M_facets ;
  14938. return ( __i < __loc . _M_impl -> _M_facets_size
  14939.  
  14940.  
  14941.  
  14942. && static_cast < const _Facet * > ( __facets [ __i ] ) ) ;
  14943.  
  14944. }
  14945. #130
  14946. template < typename _Facet >
  14947. const _Facet &
  14948. use_facet ( const locale & __loc )
  14949. {
  14950. const size_t __i = _Facet :: id . _M_id ( ) ;
  14951. const locale :: facet * * __facets = __loc . _M_impl -> _M_facets ;
  14952. if ( __i >= __loc . _M_impl -> _M_facets_size || ! __facets [ __i ] )
  14953. __throw_bad_cast ( ) ;
  14954.  
  14955.  
  14956.  
  14957. return static_cast < const _Facet & > ( * __facets [ __i ] ) ;
  14958.  
  14959. }
  14960.  
  14961.  
  14962.  
  14963. template < typename _CharT >
  14964. int
  14965. collate < _CharT > :: _M_compare ( const _CharT * , const _CharT * ) const throw ( )
  14966. { return 0 ; }
  14967.  
  14968.  
  14969. template < typename _CharT >
  14970. size_t
  14971. collate < _CharT > :: _M_transform ( _CharT * , const _CharT * , size_t ) const throw ( )
  14972. { return 0 ; }
  14973.  
  14974. template < typename _CharT >
  14975. int
  14976. collate < _CharT > ::
  14977. do_compare ( const _CharT * __lo1 , const _CharT * __hi1 ,
  14978. const _CharT * __lo2 , const _CharT * __hi2 ) const
  14979. {
  14980.  
  14981.  
  14982. const string_type __one ( __lo1 , __hi1 ) ;
  14983. const string_type __two ( __lo2 , __hi2 ) ;
  14984.  
  14985. const _CharT * __p = __one . c_str ( ) ;
  14986. const _CharT * __pend = __one . data ( ) + __one . length ( ) ;
  14987. const _CharT * __q = __two . c_str ( ) ;
  14988. const _CharT * __qend = __two . data ( ) + __two . length ( ) ;
  14989.  
  14990.  
  14991.  
  14992.  
  14993. for ( ; ; )
  14994. {
  14995. const int __res = _M_compare ( __p , __q ) ;
  14996. if ( __res )
  14997. return __res ;
  14998.  
  14999. __p += char_traits < _CharT > :: length ( __p ) ;
  15000. __q += char_traits < _CharT > :: length ( __q ) ;
  15001. if ( __p == __pend && __q == __qend )
  15002. return 0 ;
  15003. else if ( __p == __pend )
  15004. return - 1 ;
  15005. else if ( __q == __qend )
  15006. return 1 ;
  15007.  
  15008. __p ++ ;
  15009. __q ++ ;
  15010. }
  15011. }
  15012.  
  15013. template < typename _CharT >
  15014. typename collate < _CharT > :: string_type
  15015. collate < _CharT > ::
  15016. do_transform ( const _CharT * __lo , const _CharT * __hi ) const
  15017. {
  15018. string_type __ret ;
  15019.  
  15020.  
  15021. const string_type __str ( __lo , __hi ) ;
  15022.  
  15023. const _CharT * __p = __str . c_str ( ) ;
  15024. const _CharT * __pend = __str . data ( ) + __str . length ( ) ;
  15025.  
  15026. size_t __len = ( __hi - __lo ) * 2 ;
  15027.  
  15028. _CharT * __c = new _CharT [ __len ] ;
  15029.  
  15030. try
  15031. {
  15032.  
  15033.  
  15034.  
  15035. for ( ; ; )
  15036. {
  15037.  
  15038. size_t __res = _M_transform ( __c , __p , __len ) ;
  15039.  
  15040.  
  15041. if ( __res >= __len )
  15042. {
  15043. __len = __res + 1 ;
  15044. delete [ ] __c , __c = 0 ;
  15045. __c = new _CharT [ __len ] ;
  15046. __res = _M_transform ( __c , __p , __len ) ;
  15047. }
  15048.  
  15049. __ret . append ( __c , __res ) ;
  15050. __p += char_traits < _CharT > :: length ( __p ) ;
  15051. if ( __p == __pend )
  15052. break ;
  15053.  
  15054. __p ++ ;
  15055. __ret . push_back ( _CharT ( ) ) ;
  15056. }
  15057. }
  15058. catch ( ... )
  15059. {
  15060. delete [ ] __c ;
  15061. throw ;
  15062. }
  15063.  
  15064. delete [ ] __c ;
  15065.  
  15066. return __ret ;
  15067. }
  15068.  
  15069. template < typename _CharT >
  15070. long
  15071. collate < _CharT > ::
  15072. do_hash ( const _CharT * __lo , const _CharT * __hi ) const
  15073. {
  15074. unsigned long __val = 0 ;
  15075. for ( ; __lo < __hi ; ++ __lo )
  15076. __val =
  15077. * __lo + ( ( __val << 7 )
  15078. | ( __val >> ( __gnu_cxx :: __numeric_traits < unsigned long > ::
  15079. __digits - 7 ) ) ) ;
  15080. return static_cast < long > ( __val ) ;
  15081. }
  15082.  
  15083.  
  15084.  
  15085.  
  15086. extern template class collate < char > ;
  15087. extern template class collate_byname < char > ;
  15088.  
  15089. extern template
  15090. const collate < char > &
  15091. use_facet < collate < char > > ( const locale & ) ;
  15092.  
  15093. extern template
  15094. bool
  15095. has_facet < collate < char > > ( const locale & ) ;
  15096.  
  15097.  
  15098. extern template class collate < wchar_t > ;
  15099. extern template class collate_byname < wchar_t > ;
  15100.  
  15101. extern template
  15102. const collate < wchar_t > &
  15103. use_facet < collate < wchar_t > > ( const locale & ) ;
  15104.  
  15105. extern template
  15106. bool
  15107. has_facet < collate < wchar_t > > ( const locale & ) ;
  15108.  
  15109.  
  15110.  
  15111.  
  15112. }
  15113. #43 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/ios_base.h"
  15114. namespace std
  15115. {
  15116. #51
  15117. enum _Ios_Fmtflags
  15118. {
  15119. _S_boolalpha = 1L << 0 ,
  15120. _S_dec = 1L << 1 ,
  15121. _S_fixed = 1L << 2 ,
  15122. _S_hex = 1L << 3 ,
  15123. _S_internal = 1L << 4 ,
  15124. _S_left = 1L << 5 ,
  15125. _S_oct = 1L << 6 ,
  15126. _S_right = 1L << 7 ,
  15127. _S_scientific = 1L << 8 ,
  15128. _S_showbase = 1L << 9 ,
  15129. _S_showpoint = 1L << 10 ,
  15130. _S_showpos = 1L << 11 ,
  15131. _S_skipws = 1L << 12 ,
  15132. _S_unitbuf = 1L << 13 ,
  15133. _S_uppercase = 1L << 14 ,
  15134. _S_adjustfield = _S_left | _S_right | _S_internal ,
  15135. _S_basefield = _S_dec | _S_oct | _S_hex ,
  15136. _S_floatfield = _S_scientific | _S_fixed ,
  15137. _S_ios_fmtflags_end = 1L << 16
  15138. } ;
  15139.  
  15140. inline constexpr _Ios_Fmtflags
  15141. operator & ( _Ios_Fmtflags __a , _Ios_Fmtflags __b )
  15142. { return _Ios_Fmtflags ( static_cast < int > ( __a ) & static_cast < int > ( __b ) ) ; }
  15143.  
  15144. inline constexpr _Ios_Fmtflags
  15145. operator | ( _Ios_Fmtflags __a , _Ios_Fmtflags __b )
  15146. { return _Ios_Fmtflags ( static_cast < int > ( __a ) | static_cast < int > ( __b ) ) ; }
  15147.  
  15148. inline constexpr _Ios_Fmtflags
  15149. operator ^ ( _Ios_Fmtflags __a , _Ios_Fmtflags __b )
  15150. { return _Ios_Fmtflags ( static_cast < int > ( __a ) ^ static_cast < int > ( __b ) ) ; }
  15151.  
  15152. inline constexpr _Ios_Fmtflags
  15153. operator ~ ( _Ios_Fmtflags __a )
  15154. { return _Ios_Fmtflags ( ~ static_cast < int > ( __a ) ) ; }
  15155.  
  15156. inline const _Ios_Fmtflags &
  15157. operator |= ( _Ios_Fmtflags & __a , _Ios_Fmtflags __b )
  15158. { return __a = __a | __b ; }
  15159.  
  15160. inline const _Ios_Fmtflags &
  15161. operator &= ( _Ios_Fmtflags & __a , _Ios_Fmtflags __b )
  15162. { return __a = __a & __b ; }
  15163.  
  15164. inline const _Ios_Fmtflags &
  15165. operator ^= ( _Ios_Fmtflags & __a , _Ios_Fmtflags __b )
  15166. { return __a = __a ^ __b ; }
  15167.  
  15168.  
  15169. enum _Ios_Openmode
  15170. {
  15171. _S_app = 1L << 0 ,
  15172. _S_ate = 1L << 1 ,
  15173. _S_bin = 1L << 2 ,
  15174. _S_in = 1L << 3 ,
  15175. _S_out = 1L << 4 ,
  15176. _S_trunc = 1L << 5 ,
  15177. _S_ios_openmode_end = 1L << 16
  15178. } ;
  15179.  
  15180. inline constexpr _Ios_Openmode
  15181. operator & ( _Ios_Openmode __a , _Ios_Openmode __b )
  15182. { return _Ios_Openmode ( static_cast < int > ( __a ) & static_cast < int > ( __b ) ) ; }
  15183.  
  15184. inline constexpr _Ios_Openmode
  15185. operator | ( _Ios_Openmode __a , _Ios_Openmode __b )
  15186. { return _Ios_Openmode ( static_cast < int > ( __a ) | static_cast < int > ( __b ) ) ; }
  15187.  
  15188. inline constexpr _Ios_Openmode
  15189. operator ^ ( _Ios_Openmode __a , _Ios_Openmode __b )
  15190. { return _Ios_Openmode ( static_cast < int > ( __a ) ^ static_cast < int > ( __b ) ) ; }
  15191.  
  15192. inline constexpr _Ios_Openmode
  15193. operator ~ ( _Ios_Openmode __a )
  15194. { return _Ios_Openmode ( ~ static_cast < int > ( __a ) ) ; }
  15195.  
  15196. inline const _Ios_Openmode &
  15197. operator |= ( _Ios_Openmode & __a , _Ios_Openmode __b )
  15198. { return __a = __a | __b ; }
  15199.  
  15200. inline const _Ios_Openmode &
  15201. operator &= ( _Ios_Openmode & __a , _Ios_Openmode __b )
  15202. { return __a = __a & __b ; }
  15203.  
  15204. inline const _Ios_Openmode &
  15205. operator ^= ( _Ios_Openmode & __a , _Ios_Openmode __b )
  15206. { return __a = __a ^ __b ; }
  15207.  
  15208.  
  15209. enum _Ios_Iostate
  15210. {
  15211. _S_goodbit = 0 ,
  15212. _S_badbit = 1L << 0 ,
  15213. _S_eofbit = 1L << 1 ,
  15214. _S_failbit = 1L << 2 ,
  15215. _S_ios_iostate_end = 1L << 16
  15216. } ;
  15217.  
  15218. inline constexpr _Ios_Iostate
  15219. operator & ( _Ios_Iostate __a , _Ios_Iostate __b )
  15220. { return _Ios_Iostate ( static_cast < int > ( __a ) & static_cast < int > ( __b ) ) ; }
  15221.  
  15222. inline constexpr _Ios_Iostate
  15223. operator | ( _Ios_Iostate __a , _Ios_Iostate __b )
  15224. { return _Ios_Iostate ( static_cast < int > ( __a ) | static_cast < int > ( __b ) ) ; }
  15225.  
  15226. inline constexpr _Ios_Iostate
  15227. operator ^ ( _Ios_Iostate __a , _Ios_Iostate __b )
  15228. { return _Ios_Iostate ( static_cast < int > ( __a ) ^ static_cast < int > ( __b ) ) ; }
  15229.  
  15230. inline constexpr _Ios_Iostate
  15231. operator ~ ( _Ios_Iostate __a )
  15232. { return _Ios_Iostate ( ~ static_cast < int > ( __a ) ) ; }
  15233.  
  15234. inline const _Ios_Iostate &
  15235. operator |= ( _Ios_Iostate & __a , _Ios_Iostate __b )
  15236. { return __a = __a | __b ; }
  15237.  
  15238. inline const _Ios_Iostate &
  15239. operator &= ( _Ios_Iostate & __a , _Ios_Iostate __b )
  15240. { return __a = __a & __b ; }
  15241.  
  15242. inline const _Ios_Iostate &
  15243. operator ^= ( _Ios_Iostate & __a , _Ios_Iostate __b )
  15244. { return __a = __a ^ __b ; }
  15245.  
  15246.  
  15247. enum _Ios_Seekdir
  15248. {
  15249. _S_beg = 0 ,
  15250. _S_cur = 1 ,
  15251. _S_end = 2 ,
  15252. _S_ios_seekdir_end = 1L << 16
  15253. } ;
  15254. #199
  15255. class ios_base
  15256. {
  15257. public :
  15258. #209
  15259. class failure : public exception
  15260. {
  15261. public :
  15262.  
  15263.  
  15264. explicit
  15265. failure ( const string & __str ) throw ( ) ;
  15266.  
  15267.  
  15268.  
  15269. virtual
  15270. ~ failure ( ) throw ( ) ;
  15271.  
  15272. virtual const char *
  15273. what ( ) const throw ( ) ;
  15274.  
  15275. private :
  15276. string _M_msg ;
  15277. } ;
  15278. #255
  15279. typedef _Ios_Fmtflags fmtflags ;
  15280.  
  15281.  
  15282. static const fmtflags boolalpha = _S_boolalpha ;
  15283.  
  15284.  
  15285. static const fmtflags dec = _S_dec ;
  15286.  
  15287.  
  15288. static const fmtflags fixed = _S_fixed ;
  15289.  
  15290.  
  15291. static const fmtflags hex = _S_hex ;
  15292.  
  15293.  
  15294.  
  15295.  
  15296. static const fmtflags internal = _S_internal ;
  15297.  
  15298.  
  15299.  
  15300. static const fmtflags left = _S_left ;
  15301.  
  15302.  
  15303. static const fmtflags oct = _S_oct ;
  15304.  
  15305.  
  15306.  
  15307. static const fmtflags right = _S_right ;
  15308.  
  15309.  
  15310. static const fmtflags scientific = _S_scientific ;
  15311.  
  15312.  
  15313.  
  15314. static const fmtflags showbase = _S_showbase ;
  15315.  
  15316.  
  15317.  
  15318. static const fmtflags showpoint = _S_showpoint ;
  15319.  
  15320.  
  15321. static const fmtflags showpos = _S_showpos ;
  15322.  
  15323.  
  15324. static const fmtflags skipws = _S_skipws ;
  15325.  
  15326.  
  15327. static const fmtflags unitbuf = _S_unitbuf ;
  15328.  
  15329.  
  15330.  
  15331. static const fmtflags uppercase = _S_uppercase ;
  15332.  
  15333.  
  15334. static const fmtflags adjustfield = _S_adjustfield ;
  15335.  
  15336.  
  15337. static const fmtflags basefield = _S_basefield ;
  15338.  
  15339.  
  15340. static const fmtflags floatfield = _S_floatfield ;
  15341. #330
  15342. typedef _Ios_Iostate iostate ;
  15343.  
  15344.  
  15345.  
  15346. static const iostate badbit = _S_badbit ;
  15347.  
  15348.  
  15349. static const iostate eofbit = _S_eofbit ;
  15350.  
  15351.  
  15352.  
  15353.  
  15354. static const iostate failbit = _S_failbit ;
  15355.  
  15356.  
  15357. static const iostate goodbit = _S_goodbit ;
  15358. #361
  15359. typedef _Ios_Openmode openmode ;
  15360.  
  15361.  
  15362. static const openmode app = _S_app ;
  15363.  
  15364.  
  15365. static const openmode ate = _S_ate ;
  15366.  
  15367.  
  15368.  
  15369.  
  15370. static const openmode binary = _S_bin ;
  15371.  
  15372.  
  15373. static const openmode in = _S_in ;
  15374.  
  15375.  
  15376. static const openmode out = _S_out ;
  15377.  
  15378.  
  15379. static const openmode trunc = _S_trunc ;
  15380. #393
  15381. typedef _Ios_Seekdir seekdir ;
  15382.  
  15383.  
  15384. static const seekdir beg = _S_beg ;
  15385.  
  15386.  
  15387. static const seekdir cur = _S_cur ;
  15388.  
  15389.  
  15390. static const seekdir end = _S_end ;
  15391.  
  15392.  
  15393. typedef int io_state ;
  15394. typedef int open_mode ;
  15395. typedef int seek_dir ;
  15396.  
  15397. typedef std :: streampos streampos ;
  15398. typedef std :: streamoff streamoff ;
  15399. #419
  15400. enum event
  15401. {
  15402. erase_event ,
  15403. imbue_event ,
  15404. copyfmt_event
  15405. } ;
  15406. #436
  15407. typedef void ( * event_callback ) ( event __e , ios_base & __b , int __i ) ;
  15408. #448
  15409. void
  15410. register_callback ( event_callback __fn , int __index ) ;
  15411.  
  15412. protected :
  15413. streamsize _M_precision ;
  15414. streamsize _M_width ;
  15415. fmtflags _M_flags ;
  15416. iostate _M_exception ;
  15417. iostate _M_streambuf_state ;
  15418.  
  15419.  
  15420.  
  15421. struct _Callback_list
  15422. {
  15423.  
  15424. _Callback_list * _M_next ;
  15425. ios_base :: event_callback _M_fn ;
  15426. int _M_index ;
  15427. _Atomic_word _M_refcount ;
  15428.  
  15429. _Callback_list ( ios_base :: event_callback __fn , int __index ,
  15430. _Callback_list * __cb )
  15431. : _M_next ( __cb ) , _M_fn ( __fn ) , _M_index ( __index ) , _M_refcount ( 0 ) { }
  15432.  
  15433. void
  15434. _M_add_reference ( ) { __gnu_cxx :: __atomic_add_dispatch ( & _M_refcount , 1 ) ; }
  15435.  
  15436.  
  15437. int
  15438. _M_remove_reference ( )
  15439. {
  15440.  
  15441. ;
  15442. int __res = __gnu_cxx :: __exchange_and_add_dispatch ( & _M_refcount , - 1 ) ;
  15443. if ( __res == 0 )
  15444. {
  15445. ;
  15446. }
  15447. return __res ;
  15448. }
  15449. } ;
  15450.  
  15451. _Callback_list * _M_callbacks ;
  15452.  
  15453. void
  15454. _M_call_callbacks ( event __ev ) throw ( ) ;
  15455.  
  15456. void
  15457. _M_dispose_callbacks ( void ) throw ( ) ;
  15458.  
  15459.  
  15460. struct _Words
  15461. {
  15462. void * _M_pword ;
  15463. long _M_iword ;
  15464. _Words ( ) : _M_pword ( 0 ) , _M_iword ( 0 ) { }
  15465. } ;
  15466.  
  15467.  
  15468. _Words _M_word_zero ;
  15469.  
  15470.  
  15471.  
  15472. enum { _S_local_word_size = 8 } ;
  15473. _Words _M_local_word [ _S_local_word_size ] ;
  15474.  
  15475.  
  15476. int _M_word_size ;
  15477. _Words * _M_word ;
  15478.  
  15479. _Words &
  15480. _M_grow_words ( int __index , bool __iword ) ;
  15481.  
  15482.  
  15483. locale _M_ios_locale ;
  15484.  
  15485. void
  15486. _M_init ( ) throw ( ) ;
  15487.  
  15488. public :
  15489.  
  15490.  
  15491.  
  15492.  
  15493.  
  15494. class Init
  15495. {
  15496. friend class ios_base ;
  15497. public :
  15498. Init ( ) ;
  15499. ~ Init ( ) ;
  15500.  
  15501. private :
  15502. static _Atomic_word _S_refcount ;
  15503. static bool _S_synced_with_stdio ;
  15504. } ;
  15505. #550
  15506. fmtflags
  15507. flags ( ) const
  15508. { return _M_flags ; }
  15509. #561
  15510. fmtflags
  15511. flags ( fmtflags __fmtfl )
  15512. {
  15513. fmtflags __old = _M_flags ;
  15514. _M_flags = __fmtfl ;
  15515. return __old ;
  15516. }
  15517. #577
  15518. fmtflags
  15519. setf ( fmtflags __fmtfl )
  15520. {
  15521. fmtflags __old = _M_flags ;
  15522. _M_flags |= __fmtfl ;
  15523. return __old ;
  15524. }
  15525. #594
  15526. fmtflags
  15527. setf ( fmtflags __fmtfl , fmtflags __mask )
  15528. {
  15529. fmtflags __old = _M_flags ;
  15530. _M_flags &= ~ __mask ;
  15531. _M_flags |= ( __fmtfl & __mask ) ;
  15532. return __old ;
  15533. }
  15534. #609
  15535. void
  15536. unsetf ( fmtflags __mask )
  15537. { _M_flags &= ~ __mask ; }
  15538. #620
  15539. streamsize
  15540. precision ( ) const
  15541. { return _M_precision ; }
  15542. #629
  15543. streamsize
  15544. precision ( streamsize __prec )
  15545. {
  15546. streamsize __old = _M_precision ;
  15547. _M_precision = __prec ;
  15548. return __old ;
  15549. }
  15550. #643
  15551. streamsize
  15552. width ( ) const
  15553. { return _M_width ; }
  15554. #652
  15555. streamsize
  15556. width ( streamsize __wide )
  15557. {
  15558. streamsize __old = _M_width ;
  15559. _M_width = __wide ;
  15560. return __old ;
  15561. }
  15562. #671
  15563. static bool
  15564. sync_with_stdio ( bool __sync = true ) ;
  15565. #683
  15566. locale
  15567. imbue ( const locale & __loc ) throw ( ) ;
  15568. #694
  15569. locale
  15570. getloc ( ) const
  15571. { return _M_ios_locale ; }
  15572. #705
  15573. const locale &
  15574. _M_getloc ( ) const
  15575. { return _M_ios_locale ; }
  15576. #724
  15577. static int
  15578. xalloc ( ) throw ( ) ;
  15579. #740
  15580. long &
  15581. iword ( int __ix )
  15582. {
  15583. _Words & __word = ( __ix < _M_word_size )
  15584. ? _M_word [ __ix ] : _M_grow_words ( __ix , true ) ;
  15585. return __word . _M_iword ;
  15586. }
  15587. #761
  15588. void * &
  15589. pword ( int __ix )
  15590. {
  15591. _Words & __word = ( __ix < _M_word_size )
  15592. ? _M_word [ __ix ] : _M_grow_words ( __ix , false ) ;
  15593. return __word . _M_pword ;
  15594. }
  15595. #778
  15596. virtual ~ ios_base ( ) ;
  15597.  
  15598. protected :
  15599. ios_base ( ) throw ( ) ;
  15600.  
  15601.  
  15602.  
  15603. private :
  15604. ios_base ( const ios_base & ) ;
  15605.  
  15606. ios_base &
  15607. operator = ( const ios_base & ) ;
  15608. } ;
  15609.  
  15610.  
  15611.  
  15612. inline ios_base &
  15613. boolalpha ( ios_base & __base )
  15614. {
  15615. __base . setf ( ios_base :: boolalpha ) ;
  15616. return __base ;
  15617. }
  15618.  
  15619.  
  15620. inline ios_base &
  15621. noboolalpha ( ios_base & __base )
  15622. {
  15623. __base . unsetf ( ios_base :: boolalpha ) ;
  15624. return __base ;
  15625. }
  15626.  
  15627.  
  15628. inline ios_base &
  15629. showbase ( ios_base & __base )
  15630. {
  15631. __base . setf ( ios_base :: showbase ) ;
  15632. return __base ;
  15633. }
  15634.  
  15635.  
  15636. inline ios_base &
  15637. noshowbase ( ios_base & __base )
  15638. {
  15639. __base . unsetf ( ios_base :: showbase ) ;
  15640. return __base ;
  15641. }
  15642.  
  15643.  
  15644. inline ios_base &
  15645. showpoint ( ios_base & __base )
  15646. {
  15647. __base . setf ( ios_base :: showpoint ) ;
  15648. return __base ;
  15649. }
  15650.  
  15651.  
  15652. inline ios_base &
  15653. noshowpoint ( ios_base & __base )
  15654. {
  15655. __base . unsetf ( ios_base :: showpoint ) ;
  15656. return __base ;
  15657. }
  15658.  
  15659.  
  15660. inline ios_base &
  15661. showpos ( ios_base & __base )
  15662. {
  15663. __base . setf ( ios_base :: showpos ) ;
  15664. return __base ;
  15665. }
  15666.  
  15667.  
  15668. inline ios_base &
  15669. noshowpos ( ios_base & __base )
  15670. {
  15671. __base . unsetf ( ios_base :: showpos ) ;
  15672. return __base ;
  15673. }
  15674.  
  15675.  
  15676. inline ios_base &
  15677. skipws ( ios_base & __base )
  15678. {
  15679. __base . setf ( ios_base :: skipws ) ;
  15680. return __base ;
  15681. }
  15682.  
  15683.  
  15684. inline ios_base &
  15685. noskipws ( ios_base & __base )
  15686. {
  15687. __base . unsetf ( ios_base :: skipws ) ;
  15688. return __base ;
  15689. }
  15690.  
  15691.  
  15692. inline ios_base &
  15693. uppercase ( ios_base & __base )
  15694. {
  15695. __base . setf ( ios_base :: uppercase ) ;
  15696. return __base ;
  15697. }
  15698.  
  15699.  
  15700. inline ios_base &
  15701. nouppercase ( ios_base & __base )
  15702. {
  15703. __base . unsetf ( ios_base :: uppercase ) ;
  15704. return __base ;
  15705. }
  15706.  
  15707.  
  15708. inline ios_base &
  15709. unitbuf ( ios_base & __base )
  15710. {
  15711. __base . setf ( ios_base :: unitbuf ) ;
  15712. return __base ;
  15713. }
  15714.  
  15715.  
  15716. inline ios_base &
  15717. nounitbuf ( ios_base & __base )
  15718. {
  15719. __base . unsetf ( ios_base :: unitbuf ) ;
  15720. return __base ;
  15721. }
  15722.  
  15723.  
  15724.  
  15725. inline ios_base &
  15726. internal ( ios_base & __base )
  15727. {
  15728. __base . setf ( ios_base :: internal , ios_base :: adjustfield ) ;
  15729. return __base ;
  15730. }
  15731.  
  15732.  
  15733. inline ios_base &
  15734. left ( ios_base & __base )
  15735. {
  15736. __base . setf ( ios_base :: left , ios_base :: adjustfield ) ;
  15737. return __base ;
  15738. }
  15739.  
  15740.  
  15741. inline ios_base &
  15742. right ( ios_base & __base )
  15743. {
  15744. __base . setf ( ios_base :: right , ios_base :: adjustfield ) ;
  15745. return __base ;
  15746. }
  15747.  
  15748.  
  15749.  
  15750. inline ios_base &
  15751. dec ( ios_base & __base )
  15752. {
  15753. __base . setf ( ios_base :: dec , ios_base :: basefield ) ;
  15754. return __base ;
  15755. }
  15756.  
  15757.  
  15758. inline ios_base &
  15759. hex ( ios_base & __base )
  15760. {
  15761. __base . setf ( ios_base :: hex , ios_base :: basefield ) ;
  15762. return __base ;
  15763. }
  15764.  
  15765.  
  15766. inline ios_base &
  15767. oct ( ios_base & __base )
  15768. {
  15769. __base . setf ( ios_base :: oct , ios_base :: basefield ) ;
  15770. return __base ;
  15771. }
  15772.  
  15773.  
  15774.  
  15775. inline ios_base &
  15776. fixed ( ios_base & __base )
  15777. {
  15778. __base . setf ( ios_base :: fixed , ios_base :: floatfield ) ;
  15779. return __base ;
  15780. }
  15781.  
  15782.  
  15783. inline ios_base &
  15784. scientific ( ios_base & __base )
  15785. {
  15786. __base . setf ( ios_base :: scientific , ios_base :: floatfield ) ;
  15787. return __base ;
  15788. }
  15789.  
  15790.  
  15791. }
  15792. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/streambuf"
  15793. #36
  15794. #pragma GCC system_header
  15795. #45
  15796. namespace std
  15797. {
  15798.  
  15799.  
  15800. template < typename _CharT , typename _Traits >
  15801. streamsize
  15802. __copy_streambufs_eof ( basic_streambuf < _CharT , _Traits > * ,
  15803. basic_streambuf < _CharT , _Traits > * , bool & ) ;
  15804. #119
  15805. template < typename _CharT , typename _Traits >
  15806. class basic_streambuf
  15807. {
  15808. public :
  15809. #129
  15810. typedef _CharT char_type ;
  15811. typedef _Traits traits_type ;
  15812. typedef typename traits_type :: int_type int_type ;
  15813. typedef typename traits_type :: pos_type pos_type ;
  15814. typedef typename traits_type :: off_type off_type ;
  15815.  
  15816.  
  15817.  
  15818.  
  15819. typedef basic_streambuf < char_type , traits_type > __streambuf_type ;
  15820.  
  15821.  
  15822. friend class basic_ios < char_type , traits_type > ;
  15823. friend class basic_istream < char_type , traits_type > ;
  15824. friend class basic_ostream < char_type , traits_type > ;
  15825. friend class istreambuf_iterator < char_type , traits_type > ;
  15826. friend class ostreambuf_iterator < char_type , traits_type > ;
  15827.  
  15828. friend streamsize
  15829. __copy_streambufs_eof < > ( basic_streambuf * , basic_streambuf * , bool & ) ;
  15830.  
  15831. template < bool _IsMove , typename _CharT2 >
  15832. friend typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value ,
  15833. _CharT2 * > :: __type
  15834. __copy_move_a2 ( istreambuf_iterator < _CharT2 > ,
  15835. istreambuf_iterator < _CharT2 > , _CharT2 * ) ;
  15836.  
  15837. template < typename _CharT2 >
  15838. friend typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value ,
  15839. istreambuf_iterator < _CharT2 > > :: __type
  15840. find ( istreambuf_iterator < _CharT2 > , istreambuf_iterator < _CharT2 > ,
  15841. const _CharT2 & ) ;
  15842.  
  15843. template < typename _CharT2 , typename _Traits2 >
  15844. friend basic_istream < _CharT2 , _Traits2 > &
  15845. operator >> ( basic_istream < _CharT2 , _Traits2 > & , _CharT2 * ) ;
  15846.  
  15847. template < typename _CharT2 , typename _Traits2 , typename _Alloc >
  15848. friend basic_istream < _CharT2 , _Traits2 > &
  15849. operator >> ( basic_istream < _CharT2 , _Traits2 > & ,
  15850. basic_string < _CharT2 , _Traits2 , _Alloc > & ) ;
  15851.  
  15852. template < typename _CharT2 , typename _Traits2 , typename _Alloc >
  15853. friend basic_istream < _CharT2 , _Traits2 > &
  15854. getline ( basic_istream < _CharT2 , _Traits2 > & ,
  15855. basic_string < _CharT2 , _Traits2 , _Alloc > & , _CharT2 ) ;
  15856.  
  15857. protected :
  15858. #184
  15859. char_type * _M_in_beg ;
  15860. char_type * _M_in_cur ;
  15861. char_type * _M_in_end ;
  15862. char_type * _M_out_beg ;
  15863. char_type * _M_out_cur ;
  15864. char_type * _M_out_end ;
  15865.  
  15866.  
  15867. locale _M_buf_locale ;
  15868.  
  15869. public :
  15870.  
  15871. virtual
  15872. ~ basic_streambuf ( )
  15873. { }
  15874. #208
  15875. locale
  15876. pubimbue ( const locale & __loc )
  15877. {
  15878. locale __tmp ( this -> getloc ( ) ) ;
  15879. this -> imbue ( __loc ) ;
  15880. _M_buf_locale = __loc ;
  15881. return __tmp ;
  15882. }
  15883. #225
  15884. locale
  15885. getloc ( ) const
  15886. { return _M_buf_locale ; }
  15887. #238
  15888. basic_streambuf *
  15889. pubsetbuf ( char_type * __s , streamsize __n )
  15890. { return this -> setbuf ( __s , __n ) ; }
  15891. #250
  15892. pos_type
  15893. pubseekoff ( off_type __off , ios_base :: seekdir __way ,
  15894. ios_base :: openmode __mode = ios_base :: in | ios_base :: out )
  15895. { return this -> seekoff ( __off , __way , __mode ) ; }
  15896. #262
  15897. pos_type
  15898. pubseekpos ( pos_type __sp ,
  15899. ios_base :: openmode __mode = ios_base :: in | ios_base :: out )
  15900. { return this -> seekpos ( __sp , __mode ) ; }
  15901.  
  15902.  
  15903.  
  15904.  
  15905. int
  15906. pubsync ( ) { return this -> sync ( ) ; }
  15907. #283
  15908. streamsize
  15909. in_avail ( )
  15910. {
  15911. const streamsize __ret = this -> egptr ( ) - this -> gptr ( ) ;
  15912. return __ret ? __ret : this -> showmanyc ( ) ;
  15913. }
  15914. #297
  15915. int_type
  15916. snextc ( )
  15917. {
  15918. int_type __ret = traits_type :: eof ( ) ;
  15919. if (
  15920. ! traits_type :: eq_int_type ( this -> sbumpc ( ) , __ret ) )
  15921. __ret = this -> sgetc ( ) ;
  15922. return __ret ;
  15923. }
  15924. #315
  15925. int_type
  15926. sbumpc ( )
  15927. {
  15928. int_type __ret ;
  15929. if ( this -> gptr ( ) < this -> egptr ( ) )
  15930. {
  15931. __ret = traits_type :: to_int_type ( * this -> gptr ( ) ) ;
  15932. this -> gbump ( 1 ) ;
  15933. }
  15934. else
  15935. __ret = this -> uflow ( ) ;
  15936. return __ret ;
  15937. }
  15938. #337
  15939. int_type
  15940. sgetc ( )
  15941. {
  15942. int_type __ret ;
  15943. if ( this -> gptr ( ) < this -> egptr ( ) )
  15944. __ret = traits_type :: to_int_type ( * this -> gptr ( ) ) ;
  15945. else
  15946. __ret = this -> underflow ( ) ;
  15947. return __ret ;
  15948. }
  15949. #356
  15950. streamsize
  15951. sgetn ( char_type * __s , streamsize __n )
  15952. { return this -> xsgetn ( __s , __n ) ; }
  15953. #371
  15954. int_type
  15955. sputbackc ( char_type __c )
  15956. {
  15957. int_type __ret ;
  15958. const bool __testpos = this -> eback ( ) < this -> gptr ( ) ;
  15959. if (
  15960. ! __testpos || ! traits_type :: eq ( __c , this -> gptr ( ) [ - 1 ] ) )
  15961. __ret = this -> pbackfail ( traits_type :: to_int_type ( __c ) ) ;
  15962. else
  15963. {
  15964. this -> gbump ( - 1 ) ;
  15965. __ret = traits_type :: to_int_type ( * this -> gptr ( ) ) ;
  15966. }
  15967. return __ret ;
  15968. }
  15969. #396
  15970. int_type
  15971. sungetc ( )
  15972. {
  15973. int_type __ret ;
  15974. if ( this -> eback ( ) < this -> gptr ( ) )
  15975. {
  15976. this -> gbump ( - 1 ) ;
  15977. __ret = traits_type :: to_int_type ( * this -> gptr ( ) ) ;
  15978. }
  15979. else
  15980. __ret = this -> pbackfail ( ) ;
  15981. return __ret ;
  15982. }
  15983. #423
  15984. int_type
  15985. sputc ( char_type __c )
  15986. {
  15987. int_type __ret ;
  15988. if ( this -> pptr ( ) < this -> epptr ( ) )
  15989. {
  15990. * this -> pptr ( ) = __c ;
  15991. this -> pbump ( 1 ) ;
  15992. __ret = traits_type :: to_int_type ( __c ) ;
  15993. }
  15994. else
  15995. __ret = this -> overflow ( traits_type :: to_int_type ( __c ) ) ;
  15996. return __ret ;
  15997. }
  15998. #449
  15999. streamsize
  16000. sputn ( const char_type * __s , streamsize __n )
  16001. { return this -> xsputn ( __s , __n ) ; }
  16002.  
  16003. protected :
  16004. #463
  16005. basic_streambuf ( )
  16006. : _M_in_beg ( 0 ) , _M_in_cur ( 0 ) , _M_in_end ( 0 ) ,
  16007. _M_out_beg ( 0 ) , _M_out_cur ( 0 ) , _M_out_end ( 0 ) ,
  16008. _M_buf_locale ( locale ( ) )
  16009. { }
  16010. #481
  16011. char_type *
  16012. eback ( ) const { return _M_in_beg ; }
  16013.  
  16014. char_type *
  16015. gptr ( ) const { return _M_in_cur ; }
  16016.  
  16017. char_type *
  16018. egptr ( ) const { return _M_in_end ; }
  16019. #497
  16020. void
  16021. gbump ( int __n ) { _M_in_cur += __n ; }
  16022. #508
  16023. void
  16024. setg ( char_type * __gbeg , char_type * __gnext , char_type * __gend )
  16025. {
  16026. _M_in_beg = __gbeg ;
  16027. _M_in_cur = __gnext ;
  16028. _M_in_end = __gend ;
  16029. }
  16030. #528
  16031. char_type *
  16032. pbase ( ) const { return _M_out_beg ; }
  16033.  
  16034. char_type *
  16035. pptr ( ) const { return _M_out_cur ; }
  16036.  
  16037. char_type *
  16038. epptr ( ) const { return _M_out_end ; }
  16039. #544
  16040. void
  16041. pbump ( int __n ) { _M_out_cur += __n ; }
  16042. #554
  16043. void
  16044. setp ( char_type * __pbeg , char_type * __pend )
  16045. {
  16046. _M_out_beg = _M_out_cur = __pbeg ;
  16047. _M_out_end = __pend ;
  16048. }
  16049. #575
  16050. virtual void
  16051. imbue ( const locale & __loc )
  16052. { }
  16053. #590
  16054. virtual basic_streambuf < char_type , _Traits > *
  16055. setbuf ( char_type * , streamsize )
  16056. { return this ; }
  16057. #601
  16058. virtual pos_type
  16059. seekoff ( off_type , ios_base :: seekdir ,
  16060. ios_base :: openmode = ios_base :: in | ios_base :: out )
  16061. { return pos_type ( off_type ( - 1 ) ) ; }
  16062. #613
  16063. virtual pos_type
  16064. seekpos ( pos_type ,
  16065. ios_base :: openmode = ios_base :: in | ios_base :: out )
  16066. { return pos_type ( off_type ( - 1 ) ) ; }
  16067. #626
  16068. virtual int
  16069. sync ( ) { return 0 ; }
  16070. #648
  16071. virtual streamsize
  16072. showmanyc ( ) { return 0 ; }
  16073. #664
  16074. virtual streamsize
  16075. xsgetn ( char_type * __s , streamsize __n ) ;
  16076. #686
  16077. virtual int_type
  16078. underflow ( )
  16079. { return traits_type :: eof ( ) ; }
  16080. #699
  16081. virtual int_type
  16082. uflow ( )
  16083. {
  16084. int_type __ret = traits_type :: eof ( ) ;
  16085. const bool __testeof = traits_type :: eq_int_type ( this -> underflow ( ) ,
  16086. __ret ) ;
  16087. if ( ! __testeof )
  16088. {
  16089. __ret = traits_type :: to_int_type ( * this -> gptr ( ) ) ;
  16090. this -> gbump ( 1 ) ;
  16091. }
  16092. return __ret ;
  16093. }
  16094. #723
  16095. virtual int_type
  16096. pbackfail ( int_type __c = traits_type :: eof ( ) )
  16097. { return traits_type :: eof ( ) ; }
  16098. #741
  16099. virtual streamsize
  16100. xsputn ( const char_type * __s , streamsize __n ) ;
  16101. #767
  16102. virtual int_type
  16103. overflow ( int_type __c = traits_type :: eof ( ) )
  16104. { return traits_type :: eof ( ) ; }
  16105.  
  16106.  
  16107.  
  16108. public :
  16109. #782
  16110. void
  16111. stossc ( )
  16112. {
  16113. if ( this -> gptr ( ) < this -> egptr ( ) )
  16114. this -> gbump ( 1 ) ;
  16115. else
  16116. this -> uflow ( ) ;
  16117. }
  16118.  
  16119.  
  16120.  
  16121. void
  16122. __safe_gbump ( streamsize __n ) { _M_in_cur += __n ; }
  16123.  
  16124. void
  16125. __safe_pbump ( streamsize __n ) { _M_out_cur += __n ; }
  16126.  
  16127. private :
  16128.  
  16129.  
  16130. basic_streambuf ( const basic_streambuf & __sb )
  16131. : _M_in_beg ( __sb . _M_in_beg ) , _M_in_cur ( __sb . _M_in_cur ) ,
  16132. _M_in_end ( __sb . _M_in_end ) , _M_out_beg ( __sb . _M_out_beg ) ,
  16133. _M_out_cur ( __sb . _M_out_cur ) , _M_out_end ( __sb . _M_out_cur ) ,
  16134. _M_buf_locale ( __sb . _M_buf_locale )
  16135. { }
  16136.  
  16137. basic_streambuf &
  16138. operator = ( const basic_streambuf & ) { return * this ; } ;
  16139. } ;
  16140.  
  16141.  
  16142. template < >
  16143. streamsize
  16144. __copy_streambufs_eof ( basic_streambuf < char > * __sbin ,
  16145. basic_streambuf < char > * __sbout , bool & __ineof ) ;
  16146.  
  16147. template < >
  16148. streamsize
  16149. __copy_streambufs_eof ( basic_streambuf < wchar_t > * __sbin ,
  16150. basic_streambuf < wchar_t > * __sbout , bool & __ineof ) ;
  16151.  
  16152.  
  16153.  
  16154. }
  16155. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/streambuf.tcc"
  16156. #37
  16157. #pragma GCC system_header
  16158.  
  16159. namespace std
  16160. {
  16161.  
  16162.  
  16163. template < typename _CharT , typename _Traits >
  16164. streamsize
  16165. basic_streambuf < _CharT , _Traits > ::
  16166. xsgetn ( char_type * __s , streamsize __n )
  16167. {
  16168. streamsize __ret = 0 ;
  16169. while ( __ret < __n )
  16170. {
  16171. const streamsize __buf_len = this -> egptr ( ) - this -> gptr ( ) ;
  16172. if ( __buf_len )
  16173. {
  16174. const streamsize __remaining = __n - __ret ;
  16175. const streamsize __len = std :: min ( __buf_len , __remaining ) ;
  16176. traits_type :: copy ( __s , this -> gptr ( ) , __len ) ;
  16177. __ret += __len ;
  16178. __s += __len ;
  16179. this -> __safe_gbump ( __len ) ;
  16180. }
  16181.  
  16182. if ( __ret < __n )
  16183. {
  16184. const int_type __c = this -> uflow ( ) ;
  16185. if ( ! traits_type :: eq_int_type ( __c , traits_type :: eof ( ) ) )
  16186. {
  16187. traits_type :: assign ( * __s ++ , traits_type :: to_char_type ( __c ) ) ;
  16188. ++ __ret ;
  16189. }
  16190. else
  16191. break ;
  16192. }
  16193. }
  16194. return __ret ;
  16195. }
  16196.  
  16197. template < typename _CharT , typename _Traits >
  16198. streamsize
  16199. basic_streambuf < _CharT , _Traits > ::
  16200. xsputn ( const char_type * __s , streamsize __n )
  16201. {
  16202. streamsize __ret = 0 ;
  16203. while ( __ret < __n )
  16204. {
  16205. const streamsize __buf_len = this -> epptr ( ) - this -> pptr ( ) ;
  16206. if ( __buf_len )
  16207. {
  16208. const streamsize __remaining = __n - __ret ;
  16209. const streamsize __len = std :: min ( __buf_len , __remaining ) ;
  16210. traits_type :: copy ( this -> pptr ( ) , __s , __len ) ;
  16211. __ret += __len ;
  16212. __s += __len ;
  16213. this -> __safe_pbump ( __len ) ;
  16214. }
  16215.  
  16216. if ( __ret < __n )
  16217. {
  16218. int_type __c = this -> overflow ( traits_type :: to_int_type ( * __s ) ) ;
  16219. if ( ! traits_type :: eq_int_type ( __c , traits_type :: eof ( ) ) )
  16220. {
  16221. ++ __ret ;
  16222. ++ __s ;
  16223. }
  16224. else
  16225. break ;
  16226. }
  16227. }
  16228. return __ret ;
  16229. }
  16230.  
  16231.  
  16232.  
  16233.  
  16234. template < typename _CharT , typename _Traits >
  16235. streamsize
  16236. __copy_streambufs_eof ( basic_streambuf < _CharT , _Traits > * __sbin ,
  16237. basic_streambuf < _CharT , _Traits > * __sbout ,
  16238. bool & __ineof )
  16239. {
  16240. streamsize __ret = 0 ;
  16241. __ineof = true ;
  16242. typename _Traits :: int_type __c = __sbin -> sgetc ( ) ;
  16243. while ( ! _Traits :: eq_int_type ( __c , _Traits :: eof ( ) ) )
  16244. {
  16245. __c = __sbout -> sputc ( _Traits :: to_char_type ( __c ) ) ;
  16246. if ( _Traits :: eq_int_type ( __c , _Traits :: eof ( ) ) )
  16247. {
  16248. __ineof = false ;
  16249. break ;
  16250. }
  16251. ++ __ret ;
  16252. __c = __sbin -> snextc ( ) ;
  16253. }
  16254. return __ret ;
  16255. }
  16256.  
  16257. template < typename _CharT , typename _Traits >
  16258. inline streamsize
  16259. __copy_streambufs ( basic_streambuf < _CharT , _Traits > * __sbin ,
  16260. basic_streambuf < _CharT , _Traits > * __sbout )
  16261. {
  16262. bool __ineof ;
  16263. return __copy_streambufs_eof ( __sbin , __sbout , __ineof ) ;
  16264. }
  16265.  
  16266.  
  16267.  
  16268.  
  16269. extern template class basic_streambuf < char > ;
  16270. extern template
  16271. streamsize
  16272. __copy_streambufs ( basic_streambuf < char > * ,
  16273. basic_streambuf < char > * ) ;
  16274. extern template
  16275. streamsize
  16276. __copy_streambufs_eof ( basic_streambuf < char > * ,
  16277. basic_streambuf < char > * , bool & ) ;
  16278.  
  16279.  
  16280. extern template class basic_streambuf < wchar_t > ;
  16281. extern template
  16282. streamsize
  16283. __copy_streambufs ( basic_streambuf < wchar_t > * ,
  16284. basic_streambuf < wchar_t > * ) ;
  16285. extern template
  16286. streamsize
  16287. __copy_streambufs_eof ( basic_streambuf < wchar_t > * ,
  16288. basic_streambuf < wchar_t > * , bool & ) ;
  16289.  
  16290.  
  16291.  
  16292.  
  16293. }
  16294. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_ios.h"
  16295. #33
  16296. #pragma GCC system_header
  16297. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets.h"
  16298. #37
  16299. #pragma GCC system_header
  16300. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/ctype_base.h"
  16301. #33
  16302. namespace std
  16303. {
  16304.  
  16305.  
  16306.  
  16307. struct ctype_base
  16308. {
  16309.  
  16310. typedef int * __to_type ;
  16311.  
  16312.  
  16313.  
  16314. typedef unsigned int mask ;
  16315. static const mask upper = 0x00000001 ;
  16316. static const mask lower = 0x00000002 ;
  16317. static const mask alpha = 0x00004000 ;
  16318. static const mask digit = 0x00000004 ;
  16319. static const mask xdigit = 0x00000080 ;
  16320. static const mask space = 0x00000008 ;
  16321. static const mask print = 0x00008000 ;
  16322. static const mask graph = 0x00004000 | 0x00000004 | 0x00000010 ;
  16323. static const mask cntrl = 0x00000020 ;
  16324. static const mask punct = 0x00000010 ;
  16325. static const mask alnum = 0x00004000 | 0x00000004 ;
  16326. } ;
  16327.  
  16328.  
  16329. }
  16330. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/streambuf_iterator.h"
  16331. #33
  16332. #pragma GCC system_header
  16333. #38
  16334. namespace std
  16335. {
  16336. #49
  16337. template < typename _CharT , typename _Traits >
  16338. class istreambuf_iterator
  16339. : public iterator < input_iterator_tag , _CharT , typename _Traits :: off_type ,
  16340. _CharT * ,
  16341.  
  16342.  
  16343. _CharT >
  16344.  
  16345.  
  16346.  
  16347. {
  16348. public :
  16349.  
  16350.  
  16351.  
  16352. typedef _CharT char_type ;
  16353. typedef _Traits traits_type ;
  16354. typedef typename _Traits :: int_type int_type ;
  16355. typedef basic_streambuf < _CharT , _Traits > streambuf_type ;
  16356. typedef basic_istream < _CharT , _Traits > istream_type ;
  16357.  
  16358.  
  16359. template < typename _CharT2 >
  16360. friend typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value ,
  16361. ostreambuf_iterator < _CharT2 > > :: __type
  16362. copy ( istreambuf_iterator < _CharT2 > , istreambuf_iterator < _CharT2 > ,
  16363. ostreambuf_iterator < _CharT2 > ) ;
  16364.  
  16365. template < bool _IsMove , typename _CharT2 >
  16366. friend typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value ,
  16367. _CharT2 * > :: __type
  16368. __copy_move_a2 ( istreambuf_iterator < _CharT2 > ,
  16369. istreambuf_iterator < _CharT2 > , _CharT2 * ) ;
  16370.  
  16371. template < typename _CharT2 >
  16372. friend typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value ,
  16373. istreambuf_iterator < _CharT2 > > :: __type
  16374. find ( istreambuf_iterator < _CharT2 > , istreambuf_iterator < _CharT2 > ,
  16375. const _CharT2 & ) ;
  16376.  
  16377. private :
  16378. #97
  16379. mutable streambuf_type * _M_sbuf ;
  16380. mutable int_type _M_c ;
  16381.  
  16382. public :
  16383.  
  16384. constexpr istreambuf_iterator ( ) noexcept
  16385. : _M_sbuf ( 0 ) , _M_c ( traits_type :: eof ( ) ) { }
  16386.  
  16387.  
  16388. istreambuf_iterator ( const istreambuf_iterator & ) noexcept = default ;
  16389.  
  16390. ~ istreambuf_iterator ( ) = default ;
  16391.  
  16392.  
  16393.  
  16394. istreambuf_iterator ( istream_type & __s ) noexcept
  16395. : _M_sbuf ( __s . rdbuf ( ) ) , _M_c ( traits_type :: eof ( ) ) { }
  16396.  
  16397.  
  16398. istreambuf_iterator ( streambuf_type * __s ) noexcept
  16399. : _M_sbuf ( __s ) , _M_c ( traits_type :: eof ( ) ) { }
  16400.  
  16401.  
  16402.  
  16403.  
  16404. char_type
  16405. operator * ( ) const
  16406. {
  16407. #132
  16408. return traits_type :: to_char_type ( _M_get ( ) ) ;
  16409. }
  16410.  
  16411.  
  16412. istreambuf_iterator &
  16413. operator ++ ( )
  16414. {
  16415.  
  16416.  
  16417. ;
  16418. if ( _M_sbuf )
  16419. {
  16420. _M_sbuf -> sbumpc ( ) ;
  16421. _M_c = traits_type :: eof ( ) ;
  16422. }
  16423. return * this ;
  16424. }
  16425.  
  16426.  
  16427. istreambuf_iterator
  16428. operator ++ ( int )
  16429. {
  16430.  
  16431.  
  16432. ;
  16433.  
  16434. istreambuf_iterator __old = * this ;
  16435. if ( _M_sbuf )
  16436. {
  16437. __old . _M_c = _M_sbuf -> sbumpc ( ) ;
  16438. _M_c = traits_type :: eof ( ) ;
  16439. }
  16440. return __old ;
  16441. }
  16442.  
  16443.  
  16444.  
  16445.  
  16446.  
  16447. bool
  16448. equal ( const istreambuf_iterator & __b ) const
  16449. { return _M_at_eof ( ) == __b . _M_at_eof ( ) ; }
  16450.  
  16451. private :
  16452. int_type
  16453. _M_get ( ) const
  16454. {
  16455. const int_type __eof = traits_type :: eof ( ) ;
  16456. int_type __ret = __eof ;
  16457. if ( _M_sbuf )
  16458. {
  16459. if ( ! traits_type :: eq_int_type ( _M_c , __eof ) )
  16460. __ret = _M_c ;
  16461. else if ( ! traits_type :: eq_int_type ( ( __ret = _M_sbuf -> sgetc ( ) ) ,
  16462. __eof ) )
  16463. _M_c = __ret ;
  16464. else
  16465. _M_sbuf = 0 ;
  16466. }
  16467. return __ret ;
  16468. }
  16469.  
  16470. bool
  16471. _M_at_eof ( ) const
  16472. {
  16473. const int_type __eof = traits_type :: eof ( ) ;
  16474. return traits_type :: eq_int_type ( _M_get ( ) , __eof ) ;
  16475. }
  16476. } ;
  16477.  
  16478. template < typename _CharT , typename _Traits >
  16479. inline bool
  16480. operator == ( const istreambuf_iterator < _CharT , _Traits > & __a ,
  16481. const istreambuf_iterator < _CharT , _Traits > & __b )
  16482. { return __a . equal ( __b ) ; }
  16483.  
  16484. template < typename _CharT , typename _Traits >
  16485. inline bool
  16486. operator != ( const istreambuf_iterator < _CharT , _Traits > & __a ,
  16487. const istreambuf_iterator < _CharT , _Traits > & __b )
  16488. { return ! __a . equal ( __b ) ; }
  16489.  
  16490.  
  16491. template < typename _CharT , typename _Traits >
  16492. class ostreambuf_iterator
  16493. : public iterator < output_iterator_tag , void , void , void , void >
  16494. {
  16495. public :
  16496.  
  16497.  
  16498.  
  16499. typedef _CharT char_type ;
  16500. typedef _Traits traits_type ;
  16501. typedef basic_streambuf < _CharT , _Traits > streambuf_type ;
  16502. typedef basic_ostream < _CharT , _Traits > ostream_type ;
  16503.  
  16504.  
  16505. template < typename _CharT2 >
  16506. friend typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value ,
  16507. ostreambuf_iterator < _CharT2 > > :: __type
  16508. copy ( istreambuf_iterator < _CharT2 > , istreambuf_iterator < _CharT2 > ,
  16509. ostreambuf_iterator < _CharT2 > ) ;
  16510.  
  16511. private :
  16512. streambuf_type * _M_sbuf ;
  16513. bool _M_failed ;
  16514.  
  16515. public :
  16516.  
  16517. ostreambuf_iterator ( ostream_type & __s ) noexcept
  16518. : _M_sbuf ( __s . rdbuf ( ) ) , _M_failed ( ! _M_sbuf ) { }
  16519.  
  16520.  
  16521. ostreambuf_iterator ( streambuf_type * __s ) noexcept
  16522. : _M_sbuf ( __s ) , _M_failed ( ! _M_sbuf ) { }
  16523.  
  16524.  
  16525. ostreambuf_iterator &
  16526. operator = ( _CharT __c )
  16527. {
  16528. if ( ! _M_failed &&
  16529. _Traits :: eq_int_type ( _M_sbuf -> sputc ( __c ) , _Traits :: eof ( ) ) )
  16530. _M_failed = true ;
  16531. return * this ;
  16532. }
  16533.  
  16534.  
  16535. ostreambuf_iterator &
  16536. operator * ( )
  16537. { return * this ; }
  16538.  
  16539.  
  16540. ostreambuf_iterator &
  16541. operator ++ ( int )
  16542. { return * this ; }
  16543.  
  16544.  
  16545. ostreambuf_iterator &
  16546. operator ++ ( )
  16547. { return * this ; }
  16548.  
  16549.  
  16550. bool
  16551. failed ( ) const noexcept
  16552. { return _M_failed ; }
  16553.  
  16554. ostreambuf_iterator &
  16555. _M_put ( const _CharT * __ws , streamsize __len )
  16556. {
  16557. if ( ! _M_failed
  16558. &&
  16559. this -> _M_sbuf -> sputn ( __ws , __len ) != __len )
  16560. _M_failed = true ;
  16561. return * this ;
  16562. }
  16563. } ;
  16564.  
  16565.  
  16566. template < typename _CharT >
  16567. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  16568. ostreambuf_iterator < _CharT > > :: __type
  16569. copy ( istreambuf_iterator < _CharT > __first ,
  16570. istreambuf_iterator < _CharT > __last ,
  16571. ostreambuf_iterator < _CharT > __result )
  16572. {
  16573. if ( __first . _M_sbuf && ! __last . _M_sbuf && ! __result . _M_failed )
  16574. {
  16575. bool __ineof ;
  16576. __copy_streambufs_eof ( __first . _M_sbuf , __result . _M_sbuf , __ineof ) ;
  16577. if ( ! __ineof )
  16578. __result . _M_failed = true ;
  16579. }
  16580. return __result ;
  16581. }
  16582.  
  16583. template < bool _IsMove , typename _CharT >
  16584. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  16585. ostreambuf_iterator < _CharT > > :: __type
  16586. __copy_move_a2 ( _CharT * __first , _CharT * __last ,
  16587. ostreambuf_iterator < _CharT > __result )
  16588. {
  16589. const streamsize __num = __last - __first ;
  16590. if ( __num > 0 )
  16591. __result . _M_put ( __first , __num ) ;
  16592. return __result ;
  16593. }
  16594.  
  16595. template < bool _IsMove , typename _CharT >
  16596. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  16597. ostreambuf_iterator < _CharT > > :: __type
  16598. __copy_move_a2 ( const _CharT * __first , const _CharT * __last ,
  16599. ostreambuf_iterator < _CharT > __result )
  16600. {
  16601. const streamsize __num = __last - __first ;
  16602. if ( __num > 0 )
  16603. __result . _M_put ( __first , __num ) ;
  16604. return __result ;
  16605. }
  16606.  
  16607. template < bool _IsMove , typename _CharT >
  16608. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  16609. _CharT * > :: __type
  16610. __copy_move_a2 ( istreambuf_iterator < _CharT > __first ,
  16611. istreambuf_iterator < _CharT > __last , _CharT * __result )
  16612. {
  16613. typedef istreambuf_iterator < _CharT > __is_iterator_type ;
  16614. typedef typename __is_iterator_type :: traits_type traits_type ;
  16615. typedef typename __is_iterator_type :: streambuf_type streambuf_type ;
  16616. typedef typename traits_type :: int_type int_type ;
  16617.  
  16618. if ( __first . _M_sbuf && ! __last . _M_sbuf )
  16619. {
  16620. streambuf_type * __sb = __first . _M_sbuf ;
  16621. int_type __c = __sb -> sgetc ( ) ;
  16622. while ( ! traits_type :: eq_int_type ( __c , traits_type :: eof ( ) ) )
  16623. {
  16624. const streamsize __n = __sb -> egptr ( ) - __sb -> gptr ( ) ;
  16625. if ( __n > 1 )
  16626. {
  16627. traits_type :: copy ( __result , __sb -> gptr ( ) , __n ) ;
  16628. __sb -> __safe_gbump ( __n ) ;
  16629. __result += __n ;
  16630. __c = __sb -> underflow ( ) ;
  16631. }
  16632. else
  16633. {
  16634. * __result ++ = traits_type :: to_char_type ( __c ) ;
  16635. __c = __sb -> snextc ( ) ;
  16636. }
  16637. }
  16638. }
  16639. return __result ;
  16640. }
  16641.  
  16642. template < typename _CharT >
  16643. typename __gnu_cxx :: __enable_if < __is_char < _CharT > :: __value ,
  16644. istreambuf_iterator < _CharT > > :: __type
  16645. find ( istreambuf_iterator < _CharT > __first ,
  16646. istreambuf_iterator < _CharT > __last , const _CharT & __val )
  16647. {
  16648. typedef istreambuf_iterator < _CharT > __is_iterator_type ;
  16649. typedef typename __is_iterator_type :: traits_type traits_type ;
  16650. typedef typename __is_iterator_type :: streambuf_type streambuf_type ;
  16651. typedef typename traits_type :: int_type int_type ;
  16652.  
  16653. if ( __first . _M_sbuf && ! __last . _M_sbuf )
  16654. {
  16655. const int_type __ival = traits_type :: to_int_type ( __val ) ;
  16656. streambuf_type * __sb = __first . _M_sbuf ;
  16657. int_type __c = __sb -> sgetc ( ) ;
  16658. while ( ! traits_type :: eq_int_type ( __c , traits_type :: eof ( ) )
  16659. && ! traits_type :: eq_int_type ( __c , __ival ) )
  16660. {
  16661. streamsize __n = __sb -> egptr ( ) - __sb -> gptr ( ) ;
  16662. if ( __n > 1 )
  16663. {
  16664. const _CharT * __p = traits_type :: find ( __sb -> gptr ( ) ,
  16665. __n , __val ) ;
  16666. if ( __p )
  16667. __n = __p - __sb -> gptr ( ) ;
  16668. __sb -> __safe_gbump ( __n ) ;
  16669. __c = __sb -> sgetc ( ) ;
  16670. }
  16671. else
  16672. __c = __sb -> snextc ( ) ;
  16673. }
  16674.  
  16675. if ( ! traits_type :: eq_int_type ( __c , traits_type :: eof ( ) ) )
  16676. __first . _M_c = __c ;
  16677. else
  16678. __first . _M_sbuf = 0 ;
  16679. }
  16680. return __first ;
  16681. }
  16682.  
  16683.  
  16684.  
  16685.  
  16686. }
  16687. #50 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets.h"
  16688. namespace std
  16689. {
  16690. #64
  16691. template < typename _Tp >
  16692. void
  16693. __convert_to_v ( const char * , _Tp & , ios_base :: iostate & ,
  16694. const __c_locale & ) throw ( ) ;
  16695.  
  16696.  
  16697. template < >
  16698. void
  16699. __convert_to_v ( const char * , float & , ios_base :: iostate & ,
  16700. const __c_locale & ) throw ( ) ;
  16701.  
  16702. template < >
  16703. void
  16704. __convert_to_v ( const char * , double & , ios_base :: iostate & ,
  16705. const __c_locale & ) throw ( ) ;
  16706.  
  16707. template < >
  16708. void
  16709. __convert_to_v ( const char * , long double & , ios_base :: iostate & ,
  16710. const __c_locale & ) throw ( ) ;
  16711.  
  16712.  
  16713.  
  16714. template < typename _CharT , typename _Traits >
  16715. struct __pad
  16716. {
  16717. static void
  16718. _S_pad ( ios_base & __io , _CharT __fill , _CharT * __news ,
  16719. const _CharT * __olds , streamsize __newlen , streamsize __oldlen ) ;
  16720. } ;
  16721. #100
  16722. template < typename _CharT >
  16723. _CharT *
  16724. __add_grouping ( _CharT * __s , _CharT __sep ,
  16725. const char * __gbeg , size_t __gsize ,
  16726. const _CharT * __first , const _CharT * __last ) ;
  16727.  
  16728.  
  16729.  
  16730.  
  16731. template < typename _CharT >
  16732. inline
  16733. ostreambuf_iterator < _CharT >
  16734. __write ( ostreambuf_iterator < _CharT > __s , const _CharT * __ws , int __len )
  16735. {
  16736. __s . _M_put ( __ws , __len ) ;
  16737. return __s ;
  16738. }
  16739.  
  16740.  
  16741. template < typename _CharT , typename _OutIter >
  16742. inline
  16743. _OutIter
  16744. __write ( _OutIter __s , const _CharT * __ws , int __len )
  16745. {
  16746. for ( int __j = 0 ; __j < __len ; __j ++ , ++ __s )
  16747. * __s = __ws [ __j ] ;
  16748. return __s ;
  16749. }
  16750. #142
  16751. template < typename _CharT >
  16752. class __ctype_abstract_base : public locale :: facet , public ctype_base
  16753. {
  16754. public :
  16755.  
  16756.  
  16757. typedef _CharT char_type ;
  16758. #161
  16759. bool
  16760. is ( mask __m , char_type __c ) const
  16761. { return this -> do_is ( __m , __c ) ; }
  16762. #178
  16763. const char_type *
  16764. is ( const char_type * __lo , const char_type * __hi , mask * __vec ) const
  16765. { return this -> do_is ( __lo , __hi , __vec ) ; }
  16766. #194
  16767. const char_type *
  16768. scan_is ( mask __m , const char_type * __lo , const char_type * __hi ) const
  16769. { return this -> do_scan_is ( __m , __lo , __hi ) ; }
  16770. #210
  16771. const char_type *
  16772. scan_not ( mask __m , const char_type * __lo , const char_type * __hi ) const
  16773. { return this -> do_scan_not ( __m , __lo , __hi ) ; }
  16774. #224
  16775. char_type
  16776. toupper ( char_type __c ) const
  16777. { return this -> do_toupper ( __c ) ; }
  16778. #239
  16779. const char_type *
  16780. toupper ( char_type * __lo , const char_type * __hi ) const
  16781. { return this -> do_toupper ( __lo , __hi ) ; }
  16782. #253
  16783. char_type
  16784. tolower ( char_type __c ) const
  16785. { return this -> do_tolower ( __c ) ; }
  16786. #268
  16787. const char_type *
  16788. tolower ( char_type * __lo , const char_type * __hi ) const
  16789. { return this -> do_tolower ( __lo , __hi ) ; }
  16790. #285
  16791. char_type
  16792. widen ( char __c ) const
  16793. { return this -> do_widen ( __c ) ; }
  16794. #304
  16795. const char *
  16796. widen ( const char * __lo , const char * __hi , char_type * __to ) const
  16797. { return this -> do_widen ( __lo , __hi , __to ) ; }
  16798. #323
  16799. char
  16800. narrow ( char_type __c , char __dfault ) const
  16801. { return this -> do_narrow ( __c , __dfault ) ; }
  16802. #345
  16803. const char_type *
  16804. narrow ( const char_type * __lo , const char_type * __hi ,
  16805. char __dfault , char * __to ) const
  16806. { return this -> do_narrow ( __lo , __hi , __dfault , __to ) ; }
  16807.  
  16808. protected :
  16809. explicit
  16810. __ctype_abstract_base ( size_t __refs = 0 ) : facet ( __refs ) { }
  16811.  
  16812. virtual
  16813. ~ __ctype_abstract_base ( ) { }
  16814. #370
  16815. virtual bool
  16816. do_is ( mask __m , char_type __c ) const = 0 ;
  16817. #389
  16818. virtual const char_type *
  16819. do_is ( const char_type * __lo , const char_type * __hi ,
  16820. mask * __vec ) const = 0 ;
  16821. #408
  16822. virtual const char_type *
  16823. do_scan_is ( mask __m , const char_type * __lo ,
  16824. const char_type * __hi ) const = 0 ;
  16825. #427
  16826. virtual const char_type *
  16827. do_scan_not ( mask __m , const char_type * __lo ,
  16828. const char_type * __hi ) const = 0 ;
  16829. #445
  16830. virtual char_type
  16831. do_toupper ( char_type __c ) const = 0 ;
  16832. #462
  16833. virtual const char_type *
  16834. do_toupper ( char_type * __lo , const char_type * __hi ) const = 0 ;
  16835. #478
  16836. virtual char_type
  16837. do_tolower ( char_type __c ) const = 0 ;
  16838. #495
  16839. virtual const char_type *
  16840. do_tolower ( char_type * __lo , const char_type * __hi ) const = 0 ;
  16841. #514
  16842. virtual char_type
  16843. do_widen ( char __c ) const = 0 ;
  16844. #535
  16845. virtual const char *
  16846. do_widen ( const char * __lo , const char * __hi , char_type * __to ) const = 0 ;
  16847. #556
  16848. virtual char
  16849. do_narrow ( char_type __c , char __dfault ) const = 0 ;
  16850. #581
  16851. virtual const char_type *
  16852. do_narrow ( const char_type * __lo , const char_type * __hi ,
  16853. char __dfault , char * __to ) const = 0 ;
  16854. } ;
  16855. #604
  16856. template < typename _CharT >
  16857. class ctype : public __ctype_abstract_base < _CharT >
  16858. {
  16859. public :
  16860.  
  16861. typedef _CharT char_type ;
  16862. typedef typename __ctype_abstract_base < _CharT > :: mask mask ;
  16863.  
  16864.  
  16865. static locale :: id id ;
  16866.  
  16867. explicit
  16868. ctype ( size_t __refs = 0 ) : __ctype_abstract_base < _CharT > ( __refs ) { }
  16869.  
  16870. protected :
  16871. virtual
  16872. ~ ctype ( ) ;
  16873.  
  16874. virtual bool
  16875. do_is ( mask __m , char_type __c ) const ;
  16876.  
  16877. virtual const char_type *
  16878. do_is ( const char_type * __lo , const char_type * __hi , mask * __vec ) const ;
  16879.  
  16880. virtual const char_type *
  16881. do_scan_is ( mask __m , const char_type * __lo , const char_type * __hi ) const ;
  16882.  
  16883. virtual const char_type *
  16884. do_scan_not ( mask __m , const char_type * __lo ,
  16885. const char_type * __hi ) const ;
  16886.  
  16887. virtual char_type
  16888. do_toupper ( char_type __c ) const ;
  16889.  
  16890. virtual const char_type *
  16891. do_toupper ( char_type * __lo , const char_type * __hi ) const ;
  16892.  
  16893. virtual char_type
  16894. do_tolower ( char_type __c ) const ;
  16895.  
  16896. virtual const char_type *
  16897. do_tolower ( char_type * __lo , const char_type * __hi ) const ;
  16898.  
  16899. virtual char_type
  16900. do_widen ( char __c ) const ;
  16901.  
  16902. virtual const char *
  16903. do_widen ( const char * __lo , const char * __hi , char_type * __dest ) const ;
  16904.  
  16905. virtual char
  16906. do_narrow ( char_type , char __dfault ) const ;
  16907.  
  16908. virtual const char_type *
  16909. do_narrow ( const char_type * __lo , const char_type * __hi ,
  16910. char __dfault , char * __to ) const ;
  16911. } ;
  16912.  
  16913. template < typename _CharT >
  16914. locale :: id ctype < _CharT > :: id ;
  16915. #673
  16916. template < >
  16917. class ctype < char > : public locale :: facet , public ctype_base
  16918. {
  16919. public :
  16920.  
  16921.  
  16922. typedef char char_type ;
  16923.  
  16924. protected :
  16925.  
  16926. __c_locale _M_c_locale_ctype ;
  16927. bool _M_del ;
  16928. __to_type _M_toupper ;
  16929. __to_type _M_tolower ;
  16930. const mask * _M_table ;
  16931. mutable char _M_widen_ok ;
  16932. mutable char _M_widen [ 1 + static_cast < unsigned char > ( - 1 ) ] ;
  16933. mutable char _M_narrow [ 1 + static_cast < unsigned char > ( - 1 ) ] ;
  16934. mutable char _M_narrow_ok ;
  16935.  
  16936.  
  16937. public :
  16938.  
  16939. static locale :: id id ;
  16940.  
  16941. static const size_t table_size = 1 + static_cast < unsigned char > ( - 1 ) ;
  16942. #710
  16943. explicit
  16944. ctype ( const mask * __table = 0 , bool __del = false , size_t __refs = 0 ) ;
  16945. #723
  16946. explicit
  16947. ctype ( __c_locale __cloc , const mask * __table = 0 , bool __del = false ,
  16948. size_t __refs = 0 ) ;
  16949. #736
  16950. inline bool
  16951. is ( mask __m , char __c ) const ;
  16952. #751
  16953. inline const char *
  16954. is ( const char * __lo , const char * __hi , mask * __vec ) const ;
  16955. #765
  16956. inline const char *
  16957. scan_is ( mask __m , const char * __lo , const char * __hi ) const ;
  16958. #779
  16959. inline const char *
  16960. scan_not ( mask __m , const char * __lo , const char * __hi ) const ;
  16961. #794
  16962. char_type
  16963. toupper ( char_type __c ) const
  16964. { return this -> do_toupper ( __c ) ; }
  16965. #811
  16966. const char_type *
  16967. toupper ( char_type * __lo , const char_type * __hi ) const
  16968. { return this -> do_toupper ( __lo , __hi ) ; }
  16969. #827
  16970. char_type
  16971. tolower ( char_type __c ) const
  16972. { return this -> do_tolower ( __c ) ; }
  16973. #844
  16974. const char_type *
  16975. tolower ( char_type * __lo , const char_type * __hi ) const
  16976. { return this -> do_tolower ( __lo , __hi ) ; }
  16977. #864
  16978. char_type
  16979. widen ( char __c ) const
  16980. {
  16981. if ( _M_widen_ok )
  16982. return _M_widen [ static_cast < unsigned char > ( __c ) ] ;
  16983. this -> _M_widen_init ( ) ;
  16984. return this -> do_widen ( __c ) ;
  16985. }
  16986. #891
  16987. const char *
  16988. widen ( const char * __lo , const char * __hi , char_type * __to ) const
  16989. {
  16990. if ( _M_widen_ok == 1 )
  16991. {
  16992. __builtin_memcpy ( __to , __lo , __hi - __lo ) ;
  16993. return __hi ;
  16994. }
  16995. if ( ! _M_widen_ok )
  16996. _M_widen_init ( ) ;
  16997. return this -> do_widen ( __lo , __hi , __to ) ;
  16998. }
  16999. #922
  17000. char
  17001. narrow ( char_type __c , char __dfault ) const
  17002. {
  17003. if ( _M_narrow [ static_cast < unsigned char > ( __c ) ] )
  17004. return _M_narrow [ static_cast < unsigned char > ( __c ) ] ;
  17005. const char __t = do_narrow ( __c , __dfault ) ;
  17006. if ( __t != __dfault )
  17007. _M_narrow [ static_cast < unsigned char > ( __c ) ] = __t ;
  17008. return __t ;
  17009. }
  17010. #955
  17011. const char_type *
  17012. narrow ( const char_type * __lo , const char_type * __hi ,
  17013. char __dfault , char * __to ) const
  17014. {
  17015. if ( _M_narrow_ok == 1 )
  17016. {
  17017. __builtin_memcpy ( __to , __lo , __hi - __lo ) ;
  17018. return __hi ;
  17019. }
  17020. if ( ! _M_narrow_ok )
  17021. _M_narrow_init ( ) ;
  17022. return this -> do_narrow ( __lo , __hi , __dfault , __to ) ;
  17023. }
  17024.  
  17025.  
  17026.  
  17027.  
  17028.  
  17029. const mask *
  17030. table ( ) const throw ( )
  17031. { return _M_table ; }
  17032.  
  17033.  
  17034. static const mask *
  17035. classic_table ( ) throw ( ) ;
  17036. protected :
  17037. #988
  17038. virtual
  17039. ~ ctype ( ) ;
  17040. #1004
  17041. virtual char_type
  17042. do_toupper ( char_type __c ) const ;
  17043. #1021
  17044. virtual const char_type *
  17045. do_toupper ( char_type * __lo , const char_type * __hi ) const ;
  17046. #1037
  17047. virtual char_type
  17048. do_tolower ( char_type __c ) const ;
  17049. #1054
  17050. virtual const char_type *
  17051. do_tolower ( char_type * __lo , const char_type * __hi ) const ;
  17052. #1074
  17053. virtual char_type
  17054. do_widen ( char __c ) const
  17055. { return __c ; }
  17056. #1097
  17057. virtual const char *
  17058. do_widen ( const char * __lo , const char * __hi , char_type * __to ) const
  17059. {
  17060. __builtin_memcpy ( __to , __lo , __hi - __lo ) ;
  17061. return __hi ;
  17062. }
  17063. #1123
  17064. virtual char
  17065. do_narrow ( char_type __c , char __dfault ) const
  17066. { return __c ; }
  17067. #1149
  17068. virtual const char_type *
  17069. do_narrow ( const char_type * __lo , const char_type * __hi ,
  17070. char __dfault , char * __to ) const
  17071. {
  17072. __builtin_memcpy ( __to , __lo , __hi - __lo ) ;
  17073. return __hi ;
  17074. }
  17075.  
  17076. private :
  17077. void _M_narrow_init ( ) const ;
  17078. void _M_widen_init ( ) const ;
  17079. } ;
  17080. #1174
  17081. template < >
  17082. class ctype < wchar_t > : public __ctype_abstract_base < wchar_t >
  17083. {
  17084. public :
  17085.  
  17086.  
  17087. typedef wchar_t char_type ;
  17088. typedef wctype_t __wmask_type ;
  17089.  
  17090. protected :
  17091. __c_locale _M_c_locale_ctype ;
  17092.  
  17093.  
  17094. bool _M_narrow_ok ;
  17095. char _M_narrow [ 128 ] ;
  17096. wint_t _M_widen [ 1 + static_cast < unsigned char > ( - 1 ) ] ;
  17097.  
  17098.  
  17099. mask _M_bit [ 16 ] ;
  17100. __wmask_type _M_wmask [ 16 ] ;
  17101.  
  17102. public :
  17103.  
  17104.  
  17105. static locale :: id id ;
  17106. #1207
  17107. explicit
  17108. ctype ( size_t __refs = 0 ) ;
  17109. #1218
  17110. explicit
  17111. ctype ( __c_locale __cloc , size_t __refs = 0 ) ;
  17112.  
  17113. protected :
  17114. __wmask_type
  17115. _M_convert_to_wmask ( const mask __m ) const throw ( ) ;
  17116.  
  17117.  
  17118. virtual
  17119. ~ ctype ( ) ;
  17120. #1242
  17121. virtual bool
  17122. do_is ( mask __m , char_type __c ) const ;
  17123. #1261
  17124. virtual const char_type *
  17125. do_is ( const char_type * __lo , const char_type * __hi , mask * __vec ) const ;
  17126. #1279
  17127. virtual const char_type *
  17128. do_scan_is ( mask __m , const char_type * __lo , const char_type * __hi ) const ;
  17129. #1297
  17130. virtual const char_type *
  17131. do_scan_not ( mask __m , const char_type * __lo ,
  17132. const char_type * __hi ) const ;
  17133. #1314
  17134. virtual char_type
  17135. do_toupper ( char_type __c ) const ;
  17136. #1331
  17137. virtual const char_type *
  17138. do_toupper ( char_type * __lo , const char_type * __hi ) const ;
  17139. #1347
  17140. virtual char_type
  17141. do_tolower ( char_type __c ) const ;
  17142. #1364
  17143. virtual const char_type *
  17144. do_tolower ( char_type * __lo , const char_type * __hi ) const ;
  17145. #1384
  17146. virtual char_type
  17147. do_widen ( char __c ) const ;
  17148. #1406
  17149. virtual const char *
  17150. do_widen ( const char * __lo , const char * __hi , char_type * __to ) const ;
  17151. #1429
  17152. virtual char
  17153. do_narrow ( char_type __c , char __dfault ) const ;
  17154. #1455
  17155. virtual const char_type *
  17156. do_narrow ( const char_type * __lo , const char_type * __hi ,
  17157. char __dfault , char * __to ) const ;
  17158.  
  17159.  
  17160. void
  17161. _M_initialize_ctype ( ) throw ( ) ;
  17162. } ;
  17163.  
  17164.  
  17165.  
  17166. template < typename _CharT >
  17167. class ctype_byname : public ctype < _CharT >
  17168. {
  17169. public :
  17170. typedef typename ctype < _CharT > :: mask mask ;
  17171.  
  17172. explicit
  17173. ctype_byname ( const char * __s , size_t __refs = 0 ) ;
  17174.  
  17175. protected :
  17176. virtual
  17177. ~ ctype_byname ( ) { } ;
  17178. } ;
  17179.  
  17180.  
  17181. template < >
  17182. class ctype_byname < char > : public ctype < char >
  17183. {
  17184. public :
  17185. explicit
  17186. ctype_byname ( const char * __s , size_t __refs = 0 ) ;
  17187.  
  17188. protected :
  17189. virtual
  17190. ~ ctype_byname ( ) ;
  17191. } ;
  17192.  
  17193.  
  17194. template < >
  17195. class ctype_byname < wchar_t > : public ctype < wchar_t >
  17196. {
  17197. public :
  17198. explicit
  17199. ctype_byname ( const char * __s , size_t __refs = 0 ) ;
  17200.  
  17201. protected :
  17202. virtual
  17203. ~ ctype_byname ( ) ;
  17204. } ;
  17205.  
  17206.  
  17207.  
  17208. }
  17209. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/ctype_inline.h"
  17210. #37
  17211. namespace std
  17212. {
  17213.  
  17214.  
  17215. bool
  17216. ctype < char > ::
  17217. is ( mask __m , char __c ) const
  17218. { return _M_table [ static_cast < unsigned char > ( __c ) ] & __m ; }
  17219.  
  17220. const char *
  17221. ctype < char > ::
  17222. is ( const char * __low , const char * __high , mask * __vec ) const
  17223. {
  17224. while ( __low < __high )
  17225. * __vec ++ = _M_table [ static_cast < unsigned char > ( * __low ++ ) ] ;
  17226. return __high ;
  17227. }
  17228.  
  17229. const char *
  17230. ctype < char > ::
  17231. scan_is ( mask __m , const char * __low , const char * __high ) const
  17232. {
  17233. while ( __low < __high
  17234. && ! ( _M_table [ static_cast < unsigned char > ( * __low ) ] & __m ) )
  17235. ++ __low ;
  17236. return __low ;
  17237. }
  17238.  
  17239. const char *
  17240. ctype < char > ::
  17241. scan_not ( mask __m , const char * __low , const char * __high ) const
  17242. {
  17243. while ( __low < __high
  17244. && ( _M_table [ static_cast < unsigned char > ( * __low ) ] & __m ) != 0 )
  17245. ++ __low ;
  17246. return __low ;
  17247. }
  17248.  
  17249.  
  17250. }
  17251. #1513 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets.h"
  17252. namespace std
  17253. {
  17254.  
  17255.  
  17256.  
  17257. class __num_base
  17258. {
  17259. public :
  17260.  
  17261.  
  17262. enum
  17263. {
  17264. _S_ominus ,
  17265. _S_oplus ,
  17266. _S_ox ,
  17267. _S_oX ,
  17268. _S_odigits ,
  17269. _S_odigits_end = _S_odigits + 16 ,
  17270. _S_oudigits = _S_odigits_end ,
  17271. _S_oudigits_end = _S_oudigits + 16 ,
  17272. _S_oe = _S_odigits + 14 ,
  17273. _S_oE = _S_oudigits + 14 ,
  17274. _S_oend = _S_oudigits_end
  17275. } ;
  17276. #1543
  17277. static const char * _S_atoms_out ;
  17278.  
  17279.  
  17280.  
  17281. static const char * _S_atoms_in ;
  17282.  
  17283. enum
  17284. {
  17285. _S_iminus ,
  17286. _S_iplus ,
  17287. _S_ix ,
  17288. _S_iX ,
  17289. _S_izero ,
  17290. _S_ie = _S_izero + 14 ,
  17291. _S_iE = _S_izero + 20 ,
  17292. _S_iend = 26
  17293. } ;
  17294.  
  17295.  
  17296.  
  17297. static void
  17298. _S_format_float ( const ios_base & __io , char * __fptr , char __mod ) throw ( ) ;
  17299. } ;
  17300.  
  17301. template < typename _CharT >
  17302. struct __numpunct_cache : public locale :: facet
  17303. {
  17304. const char * _M_grouping ;
  17305. size_t _M_grouping_size ;
  17306. bool _M_use_grouping ;
  17307. const _CharT * _M_truename ;
  17308. size_t _M_truename_size ;
  17309. const _CharT * _M_falsename ;
  17310. size_t _M_falsename_size ;
  17311. _CharT _M_decimal_point ;
  17312. _CharT _M_thousands_sep ;
  17313.  
  17314.  
  17315.  
  17316.  
  17317.  
  17318. _CharT _M_atoms_out [ __num_base :: _S_oend ] ;
  17319.  
  17320.  
  17321.  
  17322.  
  17323.  
  17324. _CharT _M_atoms_in [ __num_base :: _S_iend ] ;
  17325.  
  17326. bool _M_allocated ;
  17327.  
  17328. __numpunct_cache ( size_t __refs = 0 )
  17329. : facet ( __refs ) , _M_grouping ( 0 ) , _M_grouping_size ( 0 ) ,
  17330. _M_use_grouping ( false ) ,
  17331. _M_truename ( 0 ) , _M_truename_size ( 0 ) , _M_falsename ( 0 ) ,
  17332. _M_falsename_size ( 0 ) , _M_decimal_point ( _CharT ( ) ) ,
  17333. _M_thousands_sep ( _CharT ( ) ) , _M_allocated ( false )
  17334. { }
  17335.  
  17336. ~ __numpunct_cache ( ) ;
  17337.  
  17338. void
  17339. _M_cache ( const locale & __loc ) ;
  17340.  
  17341. private :
  17342. __numpunct_cache &
  17343. operator = ( const __numpunct_cache & ) ;
  17344.  
  17345. explicit
  17346. __numpunct_cache ( const __numpunct_cache & ) ;
  17347. } ;
  17348.  
  17349. template < typename _CharT >
  17350. __numpunct_cache < _CharT > :: ~ __numpunct_cache ( )
  17351. {
  17352. if ( _M_allocated )
  17353. {
  17354. delete [ ] _M_grouping ;
  17355. delete [ ] _M_truename ;
  17356. delete [ ] _M_falsename ;
  17357. }
  17358. }
  17359. #1640
  17360. template < typename _CharT >
  17361. class numpunct : public locale :: facet
  17362. {
  17363. public :
  17364.  
  17365.  
  17366.  
  17367. typedef _CharT char_type ;
  17368. typedef basic_string < _CharT > string_type ;
  17369.  
  17370. typedef __numpunct_cache < _CharT > __cache_type ;
  17371.  
  17372. protected :
  17373. __cache_type * _M_data ;
  17374.  
  17375. public :
  17376.  
  17377. static locale :: id id ;
  17378. #1664
  17379. explicit
  17380. numpunct ( size_t __refs = 0 )
  17381. : facet ( __refs ) , _M_data ( 0 )
  17382. { _M_initialize_numpunct ( ) ; }
  17383. #1678
  17384. explicit
  17385. numpunct ( __cache_type * __cache , size_t __refs = 0 )
  17386. : facet ( __refs ) , _M_data ( __cache )
  17387. { _M_initialize_numpunct ( ) ; }
  17388. #1692
  17389. explicit
  17390. numpunct ( __c_locale __cloc , size_t __refs = 0 )
  17391. : facet ( __refs ) , _M_data ( 0 )
  17392. { _M_initialize_numpunct ( __cloc ) ; }
  17393. #1706
  17394. char_type
  17395. decimal_point ( ) const
  17396. { return this -> do_decimal_point ( ) ; }
  17397. #1719
  17398. char_type
  17399. thousands_sep ( ) const
  17400. { return this -> do_thousands_sep ( ) ; }
  17401. #1750
  17402. string
  17403. grouping ( ) const
  17404. { return this -> do_grouping ( ) ; }
  17405. #1763
  17406. string_type
  17407. truename ( ) const
  17408. { return this -> do_truename ( ) ; }
  17409. #1776
  17410. string_type
  17411. falsename ( ) const
  17412. { return this -> do_falsename ( ) ; }
  17413.  
  17414. protected :
  17415.  
  17416. virtual
  17417. ~ numpunct ( ) ;
  17418. #1793
  17419. virtual char_type
  17420. do_decimal_point ( ) const
  17421. { return _M_data -> _M_decimal_point ; }
  17422. #1805
  17423. virtual char_type
  17424. do_thousands_sep ( ) const
  17425. { return _M_data -> _M_thousands_sep ; }
  17426. #1818
  17427. virtual string
  17428. do_grouping ( ) const
  17429. { return _M_data -> _M_grouping ; }
  17430. #1831
  17431. virtual string_type
  17432. do_truename ( ) const
  17433. { return _M_data -> _M_truename ; }
  17434. #1844
  17435. virtual string_type
  17436. do_falsename ( ) const
  17437. { return _M_data -> _M_falsename ; }
  17438.  
  17439.  
  17440. void
  17441. _M_initialize_numpunct ( __c_locale __cloc = 0 ) ;
  17442. } ;
  17443.  
  17444. template < typename _CharT >
  17445. locale :: id numpunct < _CharT > :: id ;
  17446.  
  17447. template < >
  17448. numpunct < char > :: ~ numpunct ( ) ;
  17449.  
  17450. template < >
  17451. void
  17452. numpunct < char > :: _M_initialize_numpunct ( __c_locale __cloc ) ;
  17453.  
  17454.  
  17455. template < >
  17456. numpunct < wchar_t > :: ~ numpunct ( ) ;
  17457.  
  17458. template < >
  17459. void
  17460. numpunct < wchar_t > :: _M_initialize_numpunct ( __c_locale __cloc ) ;
  17461.  
  17462.  
  17463.  
  17464. template < typename _CharT >
  17465. class numpunct_byname : public numpunct < _CharT >
  17466. {
  17467. public :
  17468. typedef _CharT char_type ;
  17469. typedef basic_string < _CharT > string_type ;
  17470.  
  17471. explicit
  17472. numpunct_byname ( const char * __s , size_t __refs = 0 )
  17473. : numpunct < _CharT > ( __refs )
  17474. {
  17475. if ( __builtin_strcmp ( __s , "C" ) != 0
  17476. && __builtin_strcmp ( __s , "POSIX" ) != 0 )
  17477. {
  17478. __c_locale __tmp ;
  17479. this -> _S_create_c_locale ( __tmp , __s ) ;
  17480. this -> _M_initialize_numpunct ( __tmp ) ;
  17481. this -> _S_destroy_c_locale ( __tmp ) ;
  17482. }
  17483. }
  17484.  
  17485. protected :
  17486. virtual
  17487. ~ numpunct_byname ( ) { }
  17488. } ;
  17489. #1914
  17490. template < typename _CharT , typename _InIter >
  17491. class num_get : public locale :: facet
  17492. {
  17493. public :
  17494.  
  17495.  
  17496.  
  17497. typedef _CharT char_type ;
  17498. typedef _InIter iter_type ;
  17499.  
  17500.  
  17501.  
  17502. static locale :: id id ;
  17503. #1935
  17504. explicit
  17505. num_get ( size_t __refs = 0 ) : facet ( __refs ) { }
  17506. #1961
  17507. iter_type
  17508. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17509. ios_base :: iostate & __err , bool & __v ) const
  17510. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17511. #1998
  17512. iter_type
  17513. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17514. ios_base :: iostate & __err , long & __v ) const
  17515. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17516.  
  17517. iter_type
  17518. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17519. ios_base :: iostate & __err , unsigned short & __v ) const
  17520. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17521.  
  17522. iter_type
  17523. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17524. ios_base :: iostate & __err , unsigned int & __v ) const
  17525. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17526.  
  17527. iter_type
  17528. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17529. ios_base :: iostate & __err , unsigned long & __v ) const
  17530. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17531.  
  17532.  
  17533. iter_type
  17534. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17535. ios_base :: iostate & __err , long long & __v ) const
  17536. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17537.  
  17538. iter_type
  17539. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17540. ios_base :: iostate & __err , unsigned long long & __v ) const
  17541. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17542. #2058
  17543. iter_type
  17544. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17545. ios_base :: iostate & __err , float & __v ) const
  17546. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17547.  
  17548. iter_type
  17549. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17550. ios_base :: iostate & __err , double & __v ) const
  17551. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17552.  
  17553. iter_type
  17554. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17555. ios_base :: iostate & __err , long double & __v ) const
  17556. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17557. #2101
  17558. iter_type
  17559. get ( iter_type __in , iter_type __end , ios_base & __io ,
  17560. ios_base :: iostate & __err , void * & __v ) const
  17561. { return this -> do_get ( __in , __end , __io , __err , __v ) ; }
  17562.  
  17563. protected :
  17564.  
  17565. virtual ~ num_get ( ) { }
  17566.  
  17567. iter_type
  17568. _M_extract_float ( iter_type , iter_type , ios_base & , ios_base :: iostate & ,
  17569. string & ) const ;
  17570.  
  17571. template < typename _ValueT >
  17572. iter_type
  17573. _M_extract_int ( iter_type , iter_type , ios_base & , ios_base :: iostate & ,
  17574. _ValueT & ) const ;
  17575.  
  17576. template < typename _CharT2 >
  17577. typename __gnu_cxx :: __enable_if < __is_char < _CharT2 > :: __value , int > :: __type
  17578. _M_find ( const _CharT2 * , size_t __len , _CharT2 __c ) const
  17579. {
  17580. int __ret = - 1 ;
  17581. if ( __len <= 10 )
  17582. {
  17583. if ( __c >= _CharT2 ( '0' ) && __c < _CharT2 ( _CharT2 ( '0' ) + __len ) )
  17584. __ret = __c - _CharT2 ( '0' ) ;
  17585. }
  17586. else
  17587. {
  17588. if ( __c >= _CharT2 ( '0' ) && __c <= _CharT2 ( '9' ) )
  17589. __ret = __c - _CharT2 ( '0' ) ;
  17590. else if ( __c >= _CharT2 ( 'a' ) && __c <= _CharT2 ( 'f' ) )
  17591. __ret = 10 + ( __c - _CharT2 ( 'a' ) ) ;
  17592. else if ( __c >= _CharT2 ( 'A' ) && __c <= _CharT2 ( 'F' ) )
  17593. __ret = 10 + ( __c - _CharT2 ( 'A' ) ) ;
  17594. }
  17595. return __ret ;
  17596. }
  17597.  
  17598. template < typename _CharT2 >
  17599. typename __gnu_cxx :: __enable_if < ! __is_char < _CharT2 > :: __value ,
  17600. int > :: __type
  17601. _M_find ( const _CharT2 * __zero , size_t __len , _CharT2 __c ) const
  17602. {
  17603. int __ret = - 1 ;
  17604. const char_type * __q = char_traits < _CharT2 > :: find ( __zero , __len , __c ) ;
  17605. if ( __q )
  17606. {
  17607. __ret = __q - __zero ;
  17608. if ( __ret > 15 )
  17609. __ret -= 6 ;
  17610. }
  17611. return __ret ;
  17612. }
  17613. #2172
  17614. virtual iter_type
  17615. do_get ( iter_type , iter_type , ios_base & , ios_base :: iostate & , bool & ) const ;
  17616.  
  17617. virtual iter_type
  17618. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  17619. ios_base :: iostate & __err , long & __v ) const
  17620. { return _M_extract_int ( __beg , __end , __io , __err , __v ) ; }
  17621.  
  17622. virtual iter_type
  17623. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  17624. ios_base :: iostate & __err , unsigned short & __v ) const
  17625. { return _M_extract_int ( __beg , __end , __io , __err , __v ) ; }
  17626.  
  17627. virtual iter_type
  17628. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  17629. ios_base :: iostate & __err , unsigned int & __v ) const
  17630. { return _M_extract_int ( __beg , __end , __io , __err , __v ) ; }
  17631.  
  17632. virtual iter_type
  17633. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  17634. ios_base :: iostate & __err , unsigned long & __v ) const
  17635. { return _M_extract_int ( __beg , __end , __io , __err , __v ) ; }
  17636.  
  17637.  
  17638. virtual iter_type
  17639. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  17640. ios_base :: iostate & __err , long long & __v ) const
  17641. { return _M_extract_int ( __beg , __end , __io , __err , __v ) ; }
  17642.  
  17643. virtual iter_type
  17644. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  17645. ios_base :: iostate & __err , unsigned long long & __v ) const
  17646. { return _M_extract_int ( __beg , __end , __io , __err , __v ) ; }
  17647.  
  17648.  
  17649. virtual iter_type
  17650. do_get ( iter_type , iter_type , ios_base & , ios_base :: iostate & , float & ) const ;
  17651.  
  17652. virtual iter_type
  17653. do_get ( iter_type , iter_type , ios_base & , ios_base :: iostate & ,
  17654. double & ) const ;
  17655. #2220
  17656. virtual iter_type
  17657. do_get ( iter_type , iter_type , ios_base & , ios_base :: iostate & ,
  17658. long double & ) const ;
  17659.  
  17660.  
  17661. virtual iter_type
  17662. do_get ( iter_type , iter_type , ios_base & , ios_base :: iostate & , void * & ) const ;
  17663. #2235
  17664. } ;
  17665.  
  17666. template < typename _CharT , typename _InIter >
  17667. locale :: id num_get < _CharT , _InIter > :: id ;
  17668. #2253
  17669. template < typename _CharT , typename _OutIter >
  17670. class num_put : public locale :: facet
  17671. {
  17672. public :
  17673.  
  17674.  
  17675.  
  17676. typedef _CharT char_type ;
  17677. typedef _OutIter iter_type ;
  17678.  
  17679.  
  17680.  
  17681. static locale :: id id ;
  17682. #2274
  17683. explicit
  17684. num_put ( size_t __refs = 0 ) : facet ( __refs ) { }
  17685. #2292
  17686. iter_type
  17687. put ( iter_type __s , ios_base & __io , char_type __fill , bool __v ) const
  17688. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17689. #2334
  17690. iter_type
  17691. put ( iter_type __s , ios_base & __io , char_type __fill , long __v ) const
  17692. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17693.  
  17694. iter_type
  17695. put ( iter_type __s , ios_base & __io , char_type __fill ,
  17696. unsigned long __v ) const
  17697. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17698.  
  17699.  
  17700. iter_type
  17701. put ( iter_type __s , ios_base & __io , char_type __fill , long long __v ) const
  17702. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17703.  
  17704. iter_type
  17705. put ( iter_type __s , ios_base & __io , char_type __fill ,
  17706. unsigned long long __v ) const
  17707. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17708. #2397
  17709. iter_type
  17710. put ( iter_type __s , ios_base & __io , char_type __fill , double __v ) const
  17711. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17712.  
  17713. iter_type
  17714. put ( iter_type __s , ios_base & __io , char_type __fill ,
  17715. long double __v ) const
  17716. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17717. #2422
  17718. iter_type
  17719. put ( iter_type __s , ios_base & __io , char_type __fill ,
  17720. const void * __v ) const
  17721. { return this -> do_put ( __s , __io , __fill , __v ) ; }
  17722.  
  17723. protected :
  17724. template < typename _ValueT >
  17725. iter_type
  17726. _M_insert_float ( iter_type , ios_base & __io , char_type __fill ,
  17727. char __mod , _ValueT __v ) const ;
  17728.  
  17729. void
  17730. _M_group_float ( const char * __grouping , size_t __grouping_size ,
  17731. char_type __sep , const char_type * __p , char_type * __new ,
  17732. char_type * __cs , int & __len ) const ;
  17733.  
  17734. template < typename _ValueT >
  17735. iter_type
  17736. _M_insert_int ( iter_type , ios_base & __io , char_type __fill ,
  17737. _ValueT __v ) const ;
  17738.  
  17739. void
  17740. _M_group_int ( const char * __grouping , size_t __grouping_size ,
  17741. char_type __sep , ios_base & __io , char_type * __new ,
  17742. char_type * __cs , int & __len ) const ;
  17743.  
  17744. void
  17745. _M_pad ( char_type __fill , streamsize __w , ios_base & __io ,
  17746. char_type * __new , const char_type * __cs , int & __len ) const ;
  17747.  
  17748.  
  17749. virtual
  17750. ~ num_put ( ) { } ;
  17751. #2470
  17752. virtual iter_type
  17753. do_put ( iter_type __s , ios_base & __io , char_type __fill , bool __v ) const ;
  17754.  
  17755. virtual iter_type
  17756. do_put ( iter_type __s , ios_base & __io , char_type __fill , long __v ) const
  17757. { return _M_insert_int ( __s , __io , __fill , __v ) ; }
  17758.  
  17759. virtual iter_type
  17760. do_put ( iter_type __s , ios_base & __io , char_type __fill ,
  17761. unsigned long __v ) const
  17762. { return _M_insert_int ( __s , __io , __fill , __v ) ; }
  17763.  
  17764.  
  17765. virtual iter_type
  17766. do_put ( iter_type __s , ios_base & __io , char_type __fill ,
  17767. long long __v ) const
  17768. { return _M_insert_int ( __s , __io , __fill , __v ) ; }
  17769.  
  17770. virtual iter_type
  17771. do_put ( iter_type __s , ios_base & __io , char_type __fill ,
  17772. unsigned long long __v ) const
  17773. { return _M_insert_int ( __s , __io , __fill , __v ) ; }
  17774.  
  17775.  
  17776. virtual iter_type
  17777. do_put ( iter_type , ios_base & , char_type , double ) const ;
  17778. #2502
  17779. virtual iter_type
  17780. do_put ( iter_type , ios_base & , char_type , long double ) const ;
  17781.  
  17782.  
  17783. virtual iter_type
  17784. do_put ( iter_type , ios_base & , char_type , const void * ) const ;
  17785. #2515
  17786. } ;
  17787.  
  17788. template < typename _CharT , typename _OutIter >
  17789. locale :: id num_put < _CharT , _OutIter > :: id ;
  17790. #2528
  17791. template < typename _CharT >
  17792. inline bool
  17793. isspace ( _CharT __c , const locale & __loc )
  17794. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: space , __c ) ; }
  17795.  
  17796.  
  17797. template < typename _CharT >
  17798. inline bool
  17799. isprint ( _CharT __c , const locale & __loc )
  17800. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: print , __c ) ; }
  17801.  
  17802.  
  17803. template < typename _CharT >
  17804. inline bool
  17805. iscntrl ( _CharT __c , const locale & __loc )
  17806. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: cntrl , __c ) ; }
  17807.  
  17808.  
  17809. template < typename _CharT >
  17810. inline bool
  17811. isupper ( _CharT __c , const locale & __loc )
  17812. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: upper , __c ) ; }
  17813.  
  17814.  
  17815. template < typename _CharT >
  17816. inline bool
  17817. islower ( _CharT __c , const locale & __loc )
  17818. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: lower , __c ) ; }
  17819.  
  17820.  
  17821. template < typename _CharT >
  17822. inline bool
  17823. isalpha ( _CharT __c , const locale & __loc )
  17824. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: alpha , __c ) ; }
  17825.  
  17826.  
  17827. template < typename _CharT >
  17828. inline bool
  17829. isdigit ( _CharT __c , const locale & __loc )
  17830. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: digit , __c ) ; }
  17831.  
  17832.  
  17833. template < typename _CharT >
  17834. inline bool
  17835. ispunct ( _CharT __c , const locale & __loc )
  17836. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: punct , __c ) ; }
  17837.  
  17838.  
  17839. template < typename _CharT >
  17840. inline bool
  17841. isxdigit ( _CharT __c , const locale & __loc )
  17842. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: xdigit , __c ) ; }
  17843.  
  17844.  
  17845. template < typename _CharT >
  17846. inline bool
  17847. isalnum ( _CharT __c , const locale & __loc )
  17848. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: alnum , __c ) ; }
  17849.  
  17850.  
  17851. template < typename _CharT >
  17852. inline bool
  17853. isgraph ( _CharT __c , const locale & __loc )
  17854. { return use_facet < ctype < _CharT > > ( __loc ) . is ( ctype_base :: graph , __c ) ; }
  17855.  
  17856.  
  17857. template < typename _CharT >
  17858. inline _CharT
  17859. toupper ( _CharT __c , const locale & __loc )
  17860. { return use_facet < ctype < _CharT > > ( __loc ) . toupper ( __c ) ; }
  17861.  
  17862.  
  17863. template < typename _CharT >
  17864. inline _CharT
  17865. tolower ( _CharT __c , const locale & __loc )
  17866. { return use_facet < ctype < _CharT > > ( __loc ) . tolower ( __c ) ; }
  17867.  
  17868.  
  17869. }
  17870. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets.tcc"
  17871. #33
  17872. #pragma GCC system_header
  17873.  
  17874. namespace std
  17875. {
  17876.  
  17877.  
  17878.  
  17879.  
  17880. template < typename _Facet >
  17881. struct __use_cache
  17882. {
  17883. const _Facet *
  17884. operator ( ) ( const locale & __loc ) const ;
  17885. } ;
  17886.  
  17887.  
  17888. template < typename _CharT >
  17889. struct __use_cache < __numpunct_cache < _CharT > >
  17890. {
  17891. const __numpunct_cache < _CharT > *
  17892. operator ( ) ( const locale & __loc ) const
  17893. {
  17894. const size_t __i = numpunct < _CharT > :: id . _M_id ( ) ;
  17895. const locale :: facet * * __caches = __loc . _M_impl -> _M_caches ;
  17896. if ( ! __caches [ __i ] )
  17897. {
  17898. __numpunct_cache < _CharT > * __tmp = 0 ;
  17899. try
  17900. {
  17901. __tmp = new __numpunct_cache < _CharT > ;
  17902. __tmp -> _M_cache ( __loc ) ;
  17903. }
  17904. catch ( ... )
  17905. {
  17906. delete __tmp ;
  17907. throw ;
  17908. }
  17909. __loc . _M_impl -> _M_install_cache ( __tmp , __i ) ;
  17910. }
  17911. return static_cast < const __numpunct_cache < _CharT > * > ( __caches [ __i ] ) ;
  17912. }
  17913. } ;
  17914.  
  17915. template < typename _CharT >
  17916. void
  17917. __numpunct_cache < _CharT > :: _M_cache ( const locale & __loc )
  17918. {
  17919. _M_allocated = true ;
  17920.  
  17921. const numpunct < _CharT > & __np = use_facet < numpunct < _CharT > > ( __loc ) ;
  17922.  
  17923. char * __grouping = 0 ;
  17924. _CharT * __truename = 0 ;
  17925. _CharT * __falsename = 0 ;
  17926. try
  17927. {
  17928. _M_grouping_size = __np . grouping ( ) . size ( ) ;
  17929. __grouping = new char [ _M_grouping_size ] ;
  17930. __np . grouping ( ) . copy ( __grouping , _M_grouping_size ) ;
  17931. _M_grouping = __grouping ;
  17932. _M_use_grouping = ( _M_grouping_size
  17933. && static_cast < signed char > ( _M_grouping [ 0 ] ) > 0
  17934. && ( _M_grouping [ 0 ]
  17935. != __gnu_cxx :: __numeric_traits < char > :: __max ) ) ;
  17936.  
  17937. _M_truename_size = __np . truename ( ) . size ( ) ;
  17938. __truename = new _CharT [ _M_truename_size ] ;
  17939. __np . truename ( ) . copy ( __truename , _M_truename_size ) ;
  17940. _M_truename = __truename ;
  17941.  
  17942. _M_falsename_size = __np . falsename ( ) . size ( ) ;
  17943. __falsename = new _CharT [ _M_falsename_size ] ;
  17944. __np . falsename ( ) . copy ( __falsename , _M_falsename_size ) ;
  17945. _M_falsename = __falsename ;
  17946.  
  17947. _M_decimal_point = __np . decimal_point ( ) ;
  17948. _M_thousands_sep = __np . thousands_sep ( ) ;
  17949.  
  17950. const ctype < _CharT > & __ct = use_facet < ctype < _CharT > > ( __loc ) ;
  17951. __ct . widen ( __num_base :: _S_atoms_out ,
  17952. __num_base :: _S_atoms_out
  17953. + __num_base :: _S_oend , _M_atoms_out ) ;
  17954. __ct . widen ( __num_base :: _S_atoms_in ,
  17955. __num_base :: _S_atoms_in
  17956. + __num_base :: _S_iend , _M_atoms_in ) ;
  17957. }
  17958. catch ( ... )
  17959. {
  17960. delete [ ] __grouping ;
  17961. delete [ ] __truename ;
  17962. delete [ ] __falsename ;
  17963. throw ;
  17964. }
  17965. }
  17966. #136
  17967. __attribute__ ( ( __pure__ ) ) bool
  17968. __verify_grouping ( const char * __grouping , size_t __grouping_size ,
  17969. const string & __grouping_tmp ) throw ( ) ;
  17970.  
  17971.  
  17972.  
  17973. template < typename _CharT , typename _InIter >
  17974. _InIter
  17975. num_get < _CharT , _InIter > ::
  17976. _M_extract_float ( _InIter __beg , _InIter __end , ios_base & __io ,
  17977. ios_base :: iostate & __err , string & __xtrc ) const
  17978. {
  17979. typedef char_traits < _CharT > __traits_type ;
  17980. typedef __numpunct_cache < _CharT > __cache_type ;
  17981. __use_cache < __cache_type > __uc ;
  17982. const locale & __loc = __io . _M_getloc ( ) ;
  17983. const __cache_type * __lc = __uc ( __loc ) ;
  17984. const _CharT * __lit = __lc -> _M_atoms_in ;
  17985. char_type __c = char_type ( ) ;
  17986.  
  17987.  
  17988. bool __testeof = __beg == __end ;
  17989.  
  17990.  
  17991. if ( ! __testeof )
  17992. {
  17993. __c = * __beg ;
  17994. const bool __plus = __c == __lit [ __num_base :: _S_iplus ] ;
  17995. if ( ( __plus || __c == __lit [ __num_base :: _S_iminus ] )
  17996. && ! ( __lc -> _M_use_grouping && __c == __lc -> _M_thousands_sep )
  17997. && ! ( __c == __lc -> _M_decimal_point ) )
  17998. {
  17999. __xtrc += __plus ? '+' : '-' ;
  18000. if ( ++ __beg != __end )
  18001. __c = * __beg ;
  18002. else
  18003. __testeof = true ;
  18004. }
  18005. }
  18006.  
  18007.  
  18008. bool __found_mantissa = false ;
  18009. int __sep_pos = 0 ;
  18010. while ( ! __testeof )
  18011. {
  18012. if ( ( __lc -> _M_use_grouping && __c == __lc -> _M_thousands_sep )
  18013. || __c == __lc -> _M_decimal_point )
  18014. break ;
  18015. else if ( __c == __lit [ __num_base :: _S_izero ] )
  18016. {
  18017. if ( ! __found_mantissa )
  18018. {
  18019. __xtrc += '0' ;
  18020. __found_mantissa = true ;
  18021. }
  18022. ++ __sep_pos ;
  18023.  
  18024. if ( ++ __beg != __end )
  18025. __c = * __beg ;
  18026. else
  18027. __testeof = true ;
  18028. }
  18029. else
  18030. break ;
  18031. }
  18032.  
  18033.  
  18034. bool __found_dec = false ;
  18035. bool __found_sci = false ;
  18036. string __found_grouping ;
  18037. if ( __lc -> _M_use_grouping )
  18038. __found_grouping . reserve ( 32 ) ;
  18039. const char_type * __lit_zero = __lit + __num_base :: _S_izero ;
  18040.  
  18041. if ( ! __lc -> _M_allocated )
  18042.  
  18043. while ( ! __testeof )
  18044. {
  18045. const int __digit = _M_find ( __lit_zero , 10 , __c ) ;
  18046. if ( __digit != - 1 )
  18047. {
  18048. __xtrc += '0' + __digit ;
  18049. __found_mantissa = true ;
  18050. }
  18051. else if ( __c == __lc -> _M_decimal_point
  18052. && ! __found_dec && ! __found_sci )
  18053. {
  18054. __xtrc += '.' ;
  18055. __found_dec = true ;
  18056. }
  18057. else if ( ( __c == __lit [ __num_base :: _S_ie ]
  18058. || __c == __lit [ __num_base :: _S_iE ] )
  18059. && ! __found_sci && __found_mantissa )
  18060. {
  18061.  
  18062. __xtrc += 'e' ;
  18063. __found_sci = true ;
  18064.  
  18065.  
  18066. if ( ++ __beg != __end )
  18067. {
  18068. __c = * __beg ;
  18069. const bool __plus = __c == __lit [ __num_base :: _S_iplus ] ;
  18070. if ( __plus || __c == __lit [ __num_base :: _S_iminus ] )
  18071. __xtrc += __plus ? '+' : '-' ;
  18072. else
  18073. continue ;
  18074. }
  18075. else
  18076. {
  18077. __testeof = true ;
  18078. break ;
  18079. }
  18080. }
  18081. else
  18082. break ;
  18083.  
  18084. if ( ++ __beg != __end )
  18085. __c = * __beg ;
  18086. else
  18087. __testeof = true ;
  18088. }
  18089. else
  18090. while ( ! __testeof )
  18091. {
  18092.  
  18093.  
  18094. if ( __lc -> _M_use_grouping && __c == __lc -> _M_thousands_sep )
  18095. {
  18096. if ( ! __found_dec && ! __found_sci )
  18097. {
  18098.  
  18099.  
  18100. if ( __sep_pos )
  18101. {
  18102. __found_grouping += static_cast < char > ( __sep_pos ) ;
  18103. __sep_pos = 0 ;
  18104. }
  18105. else
  18106. {
  18107.  
  18108.  
  18109. __xtrc . clear ( ) ;
  18110. break ;
  18111. }
  18112. }
  18113. else
  18114. break ;
  18115. }
  18116. else if ( __c == __lc -> _M_decimal_point )
  18117. {
  18118. if ( ! __found_dec && ! __found_sci )
  18119. {
  18120.  
  18121.  
  18122.  
  18123. if ( __found_grouping . size ( ) )
  18124. __found_grouping += static_cast < char > ( __sep_pos ) ;
  18125. __xtrc += '.' ;
  18126. __found_dec = true ;
  18127. }
  18128. else
  18129. break ;
  18130. }
  18131. else
  18132. {
  18133. const char_type * __q =
  18134. __traits_type :: find ( __lit_zero , 10 , __c ) ;
  18135. if ( __q )
  18136. {
  18137. __xtrc += '0' + ( __q - __lit_zero ) ;
  18138. __found_mantissa = true ;
  18139. ++ __sep_pos ;
  18140. }
  18141. else if ( ( __c == __lit [ __num_base :: _S_ie ]
  18142. || __c == __lit [ __num_base :: _S_iE ] )
  18143. && ! __found_sci && __found_mantissa )
  18144. {
  18145.  
  18146. if ( __found_grouping . size ( ) && ! __found_dec )
  18147. __found_grouping += static_cast < char > ( __sep_pos ) ;
  18148. __xtrc += 'e' ;
  18149. __found_sci = true ;
  18150.  
  18151.  
  18152. if ( ++ __beg != __end )
  18153. {
  18154. __c = * __beg ;
  18155. const bool __plus = __c == __lit [ __num_base :: _S_iplus ] ;
  18156. if ( ( __plus || __c == __lit [ __num_base :: _S_iminus ] )
  18157. && ! ( __lc -> _M_use_grouping
  18158. && __c == __lc -> _M_thousands_sep )
  18159. && ! ( __c == __lc -> _M_decimal_point ) )
  18160. __xtrc += __plus ? '+' : '-' ;
  18161. else
  18162. continue ;
  18163. }
  18164. else
  18165. {
  18166. __testeof = true ;
  18167. break ;
  18168. }
  18169. }
  18170. else
  18171. break ;
  18172. }
  18173.  
  18174. if ( ++ __beg != __end )
  18175. __c = * __beg ;
  18176. else
  18177. __testeof = true ;
  18178. }
  18179.  
  18180.  
  18181.  
  18182. if ( __found_grouping . size ( ) )
  18183. {
  18184.  
  18185. if ( ! __found_dec && ! __found_sci )
  18186. __found_grouping += static_cast < char > ( __sep_pos ) ;
  18187.  
  18188. if ( ! std :: __verify_grouping ( __lc -> _M_grouping ,
  18189. __lc -> _M_grouping_size ,
  18190. __found_grouping ) )
  18191. __err = ios_base :: failbit ;
  18192. }
  18193.  
  18194. return __beg ;
  18195. }
  18196.  
  18197. template < typename _CharT , typename _InIter >
  18198. template < typename _ValueT >
  18199. _InIter
  18200. num_get < _CharT , _InIter > ::
  18201. _M_extract_int ( _InIter __beg , _InIter __end , ios_base & __io ,
  18202. ios_base :: iostate & __err , _ValueT & __v ) const
  18203. {
  18204. typedef char_traits < _CharT > __traits_type ;
  18205. using __gnu_cxx :: __add_unsigned ;
  18206. typedef typename __add_unsigned < _ValueT > :: __type __unsigned_type ;
  18207. typedef __numpunct_cache < _CharT > __cache_type ;
  18208. __use_cache < __cache_type > __uc ;
  18209. const locale & __loc = __io . _M_getloc ( ) ;
  18210. const __cache_type * __lc = __uc ( __loc ) ;
  18211. const _CharT * __lit = __lc -> _M_atoms_in ;
  18212. char_type __c = char_type ( ) ;
  18213.  
  18214.  
  18215. const ios_base :: fmtflags __basefield = __io . flags ( )
  18216. & ios_base :: basefield ;
  18217. const bool __oct = __basefield == ios_base :: oct ;
  18218. int __base = __oct ? 8 : ( __basefield == ios_base :: hex ? 16 : 10 ) ;
  18219.  
  18220.  
  18221. bool __testeof = __beg == __end ;
  18222.  
  18223.  
  18224. bool __negative = false ;
  18225. if ( ! __testeof )
  18226. {
  18227. __c = * __beg ;
  18228. __negative = __c == __lit [ __num_base :: _S_iminus ] ;
  18229. if ( ( __negative || __c == __lit [ __num_base :: _S_iplus ] )
  18230. && ! ( __lc -> _M_use_grouping && __c == __lc -> _M_thousands_sep )
  18231. && ! ( __c == __lc -> _M_decimal_point ) )
  18232. {
  18233. if ( ++ __beg != __end )
  18234. __c = * __beg ;
  18235. else
  18236. __testeof = true ;
  18237. }
  18238. }
  18239.  
  18240.  
  18241.  
  18242. bool __found_zero = false ;
  18243. int __sep_pos = 0 ;
  18244. while ( ! __testeof )
  18245. {
  18246. if ( ( __lc -> _M_use_grouping && __c == __lc -> _M_thousands_sep )
  18247. || __c == __lc -> _M_decimal_point )
  18248. break ;
  18249. else if ( __c == __lit [ __num_base :: _S_izero ]
  18250. && ( ! __found_zero || __base == 10 ) )
  18251. {
  18252. __found_zero = true ;
  18253. ++ __sep_pos ;
  18254. if ( __basefield == 0 )
  18255. __base = 8 ;
  18256. if ( __base == 8 )
  18257. __sep_pos = 0 ;
  18258. }
  18259. else if ( __found_zero
  18260. && ( __c == __lit [ __num_base :: _S_ix ]
  18261. || __c == __lit [ __num_base :: _S_iX ] ) )
  18262. {
  18263. if ( __basefield == 0 )
  18264. __base = 16 ;
  18265. if ( __base == 16 )
  18266. {
  18267. __found_zero = false ;
  18268. __sep_pos = 0 ;
  18269. }
  18270. else
  18271. break ;
  18272. }
  18273. else
  18274. break ;
  18275.  
  18276. if ( ++ __beg != __end )
  18277. {
  18278. __c = * __beg ;
  18279. if ( ! __found_zero )
  18280. break ;
  18281. }
  18282. else
  18283. __testeof = true ;
  18284. }
  18285.  
  18286.  
  18287.  
  18288. const size_t __len = ( __base == 16 ? __num_base :: _S_iend
  18289. - __num_base :: _S_izero : __base ) ;
  18290.  
  18291.  
  18292. string __found_grouping ;
  18293. if ( __lc -> _M_use_grouping )
  18294. __found_grouping . reserve ( 32 ) ;
  18295. bool __testfail = false ;
  18296. bool __testoverflow = false ;
  18297. const __unsigned_type __max =
  18298. ( __negative && __gnu_cxx :: __numeric_traits < _ValueT > :: __is_signed )
  18299. ? - __gnu_cxx :: __numeric_traits < _ValueT > :: __min
  18300. : __gnu_cxx :: __numeric_traits < _ValueT > :: __max ;
  18301. const __unsigned_type __smax = __max / __base ;
  18302. __unsigned_type __result = 0 ;
  18303. int __digit = 0 ;
  18304. const char_type * __lit_zero = __lit + __num_base :: _S_izero ;
  18305.  
  18306. if ( ! __lc -> _M_allocated )
  18307.  
  18308. while ( ! __testeof )
  18309. {
  18310. __digit = _M_find ( __lit_zero , __len , __c ) ;
  18311. if ( __digit == - 1 )
  18312. break ;
  18313.  
  18314. if ( __result > __smax )
  18315. __testoverflow = true ;
  18316. else
  18317. {
  18318. __result *= __base ;
  18319. __testoverflow |= __result > __max - __digit ;
  18320. __result += __digit ;
  18321. ++ __sep_pos ;
  18322. }
  18323.  
  18324. if ( ++ __beg != __end )
  18325. __c = * __beg ;
  18326. else
  18327. __testeof = true ;
  18328. }
  18329. else
  18330. while ( ! __testeof )
  18331. {
  18332.  
  18333.  
  18334. if ( __lc -> _M_use_grouping && __c == __lc -> _M_thousands_sep )
  18335. {
  18336.  
  18337.  
  18338. if ( __sep_pos )
  18339. {
  18340. __found_grouping += static_cast < char > ( __sep_pos ) ;
  18341. __sep_pos = 0 ;
  18342. }
  18343. else
  18344. {
  18345. __testfail = true ;
  18346. break ;
  18347. }
  18348. }
  18349. else if ( __c == __lc -> _M_decimal_point )
  18350. break ;
  18351. else
  18352. {
  18353. const char_type * __q =
  18354. __traits_type :: find ( __lit_zero , __len , __c ) ;
  18355. if ( ! __q )
  18356. break ;
  18357.  
  18358. __digit = __q - __lit_zero ;
  18359. if ( __digit > 15 )
  18360. __digit -= 6 ;
  18361. if ( __result > __smax )
  18362. __testoverflow = true ;
  18363. else
  18364. {
  18365. __result *= __base ;
  18366. __testoverflow |= __result > __max - __digit ;
  18367. __result += __digit ;
  18368. ++ __sep_pos ;
  18369. }
  18370. }
  18371.  
  18372. if ( ++ __beg != __end )
  18373. __c = * __beg ;
  18374. else
  18375. __testeof = true ;
  18376. }
  18377.  
  18378.  
  18379.  
  18380. if ( __found_grouping . size ( ) )
  18381. {
  18382.  
  18383. __found_grouping += static_cast < char > ( __sep_pos ) ;
  18384.  
  18385. if ( ! std :: __verify_grouping ( __lc -> _M_grouping ,
  18386. __lc -> _M_grouping_size ,
  18387. __found_grouping ) )
  18388. __err = ios_base :: failbit ;
  18389. }
  18390.  
  18391.  
  18392.  
  18393. if ( ( ! __sep_pos && ! __found_zero && ! __found_grouping . size ( ) )
  18394. || __testfail )
  18395. {
  18396. __v = 0 ;
  18397. __err = ios_base :: failbit ;
  18398. }
  18399. else if ( __testoverflow )
  18400. {
  18401. if ( __negative
  18402. && __gnu_cxx :: __numeric_traits < _ValueT > :: __is_signed )
  18403. __v = __gnu_cxx :: __numeric_traits < _ValueT > :: __min ;
  18404. else
  18405. __v = __gnu_cxx :: __numeric_traits < _ValueT > :: __max ;
  18406. __err = ios_base :: failbit ;
  18407. }
  18408. else
  18409. __v = __negative ? - __result : __result ;
  18410.  
  18411. if ( __testeof )
  18412. __err |= ios_base :: eofbit ;
  18413. return __beg ;
  18414. }
  18415.  
  18416.  
  18417.  
  18418. template < typename _CharT , typename _InIter >
  18419. _InIter
  18420. num_get < _CharT , _InIter > ::
  18421. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  18422. ios_base :: iostate & __err , bool & __v ) const
  18423. {
  18424. if ( ! ( __io . flags ( ) & ios_base :: boolalpha ) )
  18425. {
  18426.  
  18427.  
  18428.  
  18429. long __l = - 1 ;
  18430. __beg = _M_extract_int ( __beg , __end , __io , __err , __l ) ;
  18431. if ( __l == 0 || __l == 1 )
  18432. __v = bool ( __l ) ;
  18433. else
  18434. {
  18435.  
  18436.  
  18437. __v = true ;
  18438. __err = ios_base :: failbit ;
  18439. if ( __beg == __end )
  18440. __err |= ios_base :: eofbit ;
  18441. }
  18442. }
  18443. else
  18444. {
  18445.  
  18446. typedef __numpunct_cache < _CharT > __cache_type ;
  18447. __use_cache < __cache_type > __uc ;
  18448. const locale & __loc = __io . _M_getloc ( ) ;
  18449. const __cache_type * __lc = __uc ( __loc ) ;
  18450.  
  18451. bool __testf = true ;
  18452. bool __testt = true ;
  18453. bool __donef = __lc -> _M_falsename_size == 0 ;
  18454. bool __donet = __lc -> _M_truename_size == 0 ;
  18455. bool __testeof = false ;
  18456. size_t __n = 0 ;
  18457. while ( ! __donef || ! __donet )
  18458. {
  18459. if ( __beg == __end )
  18460. {
  18461. __testeof = true ;
  18462. break ;
  18463. }
  18464.  
  18465. const char_type __c = * __beg ;
  18466.  
  18467. if ( ! __donef )
  18468. __testf = __c == __lc -> _M_falsename [ __n ] ;
  18469.  
  18470. if ( ! __testf && __donet )
  18471. break ;
  18472.  
  18473. if ( ! __donet )
  18474. __testt = __c == __lc -> _M_truename [ __n ] ;
  18475.  
  18476. if ( ! __testt && __donef )
  18477. break ;
  18478.  
  18479. if ( ! __testt && ! __testf )
  18480. break ;
  18481.  
  18482. ++ __n ;
  18483. ++ __beg ;
  18484.  
  18485. __donef = ! __testf || __n >= __lc -> _M_falsename_size ;
  18486. __donet = ! __testt || __n >= __lc -> _M_truename_size ;
  18487. }
  18488. if ( __testf && __n == __lc -> _M_falsename_size && __n )
  18489. {
  18490. __v = false ;
  18491. if ( __testt && __n == __lc -> _M_truename_size )
  18492. __err = ios_base :: failbit ;
  18493. else
  18494. __err = __testeof ? ios_base :: eofbit : ios_base :: goodbit ;
  18495. }
  18496. else if ( __testt && __n == __lc -> _M_truename_size && __n )
  18497. {
  18498. __v = true ;
  18499. __err = __testeof ? ios_base :: eofbit : ios_base :: goodbit ;
  18500. }
  18501. else
  18502. {
  18503.  
  18504.  
  18505. __v = false ;
  18506. __err = ios_base :: failbit ;
  18507. if ( __testeof )
  18508. __err |= ios_base :: eofbit ;
  18509. }
  18510. }
  18511. return __beg ;
  18512. }
  18513.  
  18514. template < typename _CharT , typename _InIter >
  18515. _InIter
  18516. num_get < _CharT , _InIter > ::
  18517. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  18518. ios_base :: iostate & __err , float & __v ) const
  18519. {
  18520. string __xtrc ;
  18521. __xtrc . reserve ( 32 ) ;
  18522. __beg = _M_extract_float ( __beg , __end , __io , __err , __xtrc ) ;
  18523. std :: __convert_to_v ( __xtrc . c_str ( ) , __v , __err , _S_get_c_locale ( ) ) ;
  18524. if ( __beg == __end )
  18525. __err |= ios_base :: eofbit ;
  18526. return __beg ;
  18527. }
  18528.  
  18529. template < typename _CharT , typename _InIter >
  18530. _InIter
  18531. num_get < _CharT , _InIter > ::
  18532. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  18533. ios_base :: iostate & __err , double & __v ) const
  18534. {
  18535. string __xtrc ;
  18536. __xtrc . reserve ( 32 ) ;
  18537. __beg = _M_extract_float ( __beg , __end , __io , __err , __xtrc ) ;
  18538. std :: __convert_to_v ( __xtrc . c_str ( ) , __v , __err , _S_get_c_locale ( ) ) ;
  18539. if ( __beg == __end )
  18540. __err |= ios_base :: eofbit ;
  18541. return __beg ;
  18542. }
  18543. #730
  18544. template < typename _CharT , typename _InIter >
  18545. _InIter
  18546. num_get < _CharT , _InIter > ::
  18547. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  18548. ios_base :: iostate & __err , long double & __v ) const
  18549. {
  18550. string __xtrc ;
  18551. __xtrc . reserve ( 32 ) ;
  18552. __beg = _M_extract_float ( __beg , __end , __io , __err , __xtrc ) ;
  18553. std :: __convert_to_v ( __xtrc . c_str ( ) , __v , __err , _S_get_c_locale ( ) ) ;
  18554. if ( __beg == __end )
  18555. __err |= ios_base :: eofbit ;
  18556. return __beg ;
  18557. }
  18558.  
  18559. template < typename _CharT , typename _InIter >
  18560. _InIter
  18561. num_get < _CharT , _InIter > ::
  18562. do_get ( iter_type __beg , iter_type __end , ios_base & __io ,
  18563. ios_base :: iostate & __err , void * & __v ) const
  18564. {
  18565.  
  18566. typedef ios_base :: fmtflags fmtflags ;
  18567. const fmtflags __fmt = __io . flags ( ) ;
  18568. __io . flags ( ( __fmt & ~ ios_base :: basefield ) | ios_base :: hex ) ;
  18569.  
  18570. typedef __gnu_cxx :: __conditional_type < ( sizeof ( void * )
  18571. <= sizeof ( unsigned long ) ) ,
  18572. unsigned long , unsigned long long > :: __type _UIntPtrType ;
  18573.  
  18574. _UIntPtrType __ul ;
  18575. __beg = _M_extract_int ( __beg , __end , __io , __err , __ul ) ;
  18576.  
  18577.  
  18578. __io . flags ( __fmt ) ;
  18579.  
  18580. __v = reinterpret_cast < void * > ( __ul ) ;
  18581. return __beg ;
  18582. }
  18583.  
  18584.  
  18585.  
  18586. template < typename _CharT , typename _OutIter >
  18587. void
  18588. num_put < _CharT , _OutIter > ::
  18589. _M_pad ( _CharT __fill , streamsize __w , ios_base & __io ,
  18590. _CharT * __new , const _CharT * __cs , int & __len ) const
  18591. {
  18592.  
  18593.  
  18594. __pad < _CharT , char_traits < _CharT > > :: _S_pad ( __io , __fill , __new ,
  18595. __cs , __w , __len ) ;
  18596. __len = static_cast < int > ( __w ) ;
  18597. }
  18598.  
  18599.  
  18600.  
  18601. template < typename _CharT , typename _ValueT >
  18602. int
  18603. __int_to_char ( _CharT * __bufend , _ValueT __v , const _CharT * __lit ,
  18604. ios_base :: fmtflags __flags , bool __dec )
  18605. {
  18606. _CharT * __buf = __bufend ;
  18607. if ( __dec )
  18608. {
  18609.  
  18610. do
  18611. {
  18612. * -- __buf = __lit [ ( __v % 10 ) + __num_base :: _S_odigits ] ;
  18613. __v /= 10 ;
  18614. }
  18615. while ( __v != 0 ) ;
  18616. }
  18617. else if ( ( __flags & ios_base :: basefield ) == ios_base :: oct )
  18618. {
  18619.  
  18620. do
  18621. {
  18622. * -- __buf = __lit [ ( __v & 0x7 ) + __num_base :: _S_odigits ] ;
  18623. __v >>= 3 ;
  18624. }
  18625. while ( __v != 0 ) ;
  18626. }
  18627. else
  18628. {
  18629.  
  18630. const bool __uppercase = __flags & ios_base :: uppercase ;
  18631. const int __case_offset = __uppercase ? __num_base :: _S_oudigits
  18632. : __num_base :: _S_odigits ;
  18633. do
  18634. {
  18635. * -- __buf = __lit [ ( __v & 0xf ) + __case_offset ] ;
  18636. __v >>= 4 ;
  18637. }
  18638. while ( __v != 0 ) ;
  18639. }
  18640. return __bufend - __buf ;
  18641. }
  18642.  
  18643.  
  18644.  
  18645. template < typename _CharT , typename _OutIter >
  18646. void
  18647. num_put < _CharT , _OutIter > ::
  18648. _M_group_int ( const char * __grouping , size_t __grouping_size , _CharT __sep ,
  18649. ios_base & , _CharT * __new , _CharT * __cs , int & __len ) const
  18650. {
  18651. _CharT * __p = std :: __add_grouping ( __new , __sep , __grouping ,
  18652. __grouping_size , __cs , __cs + __len ) ;
  18653. __len = __p - __new ;
  18654. }
  18655.  
  18656. template < typename _CharT , typename _OutIter >
  18657. template < typename _ValueT >
  18658. _OutIter
  18659. num_put < _CharT , _OutIter > ::
  18660. _M_insert_int ( _OutIter __s , ios_base & __io , _CharT __fill ,
  18661. _ValueT __v ) const
  18662. {
  18663. using __gnu_cxx :: __add_unsigned ;
  18664. typedef typename __add_unsigned < _ValueT > :: __type __unsigned_type ;
  18665. typedef __numpunct_cache < _CharT > __cache_type ;
  18666. __use_cache < __cache_type > __uc ;
  18667. const locale & __loc = __io . _M_getloc ( ) ;
  18668. const __cache_type * __lc = __uc ( __loc ) ;
  18669. const _CharT * __lit = __lc -> _M_atoms_out ;
  18670. const ios_base :: fmtflags __flags = __io . flags ( ) ;
  18671.  
  18672.  
  18673. const int __ilen = 5 * sizeof ( _ValueT ) ;
  18674. _CharT * __cs = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18675. * __ilen ) ) ;
  18676.  
  18677.  
  18678.  
  18679. const ios_base :: fmtflags __basefield = __flags & ios_base :: basefield ;
  18680. const bool __dec = ( __basefield != ios_base :: oct
  18681. && __basefield != ios_base :: hex ) ;
  18682. const __unsigned_type __u = ( ( __v > 0 || ! __dec )
  18683. ? __unsigned_type ( __v )
  18684. : - __unsigned_type ( __v ) ) ;
  18685. int __len = __int_to_char ( __cs + __ilen , __u , __lit , __flags , __dec ) ;
  18686. __cs += __ilen - __len ;
  18687.  
  18688.  
  18689. if ( __lc -> _M_use_grouping )
  18690. {
  18691.  
  18692.  
  18693. _CharT * __cs2 = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18694. * ( __len + 1 )
  18695. * 2 ) ) ;
  18696. _M_group_int ( __lc -> _M_grouping , __lc -> _M_grouping_size ,
  18697. __lc -> _M_thousands_sep , __io , __cs2 + 2 , __cs , __len ) ;
  18698. __cs = __cs2 + 2 ;
  18699. }
  18700.  
  18701.  
  18702. if ( __dec )
  18703. {
  18704.  
  18705. if ( __v >= 0 )
  18706. {
  18707. if ( bool ( __flags & ios_base :: showpos )
  18708. && __gnu_cxx :: __numeric_traits < _ValueT > :: __is_signed )
  18709. * -- __cs = __lit [ __num_base :: _S_oplus ] , ++ __len ;
  18710. }
  18711. else
  18712. * -- __cs = __lit [ __num_base :: _S_ominus ] , ++ __len ;
  18713. }
  18714. else if ( bool ( __flags & ios_base :: showbase ) && __v )
  18715. {
  18716. if ( __basefield == ios_base :: oct )
  18717. * -- __cs = __lit [ __num_base :: _S_odigits ] , ++ __len ;
  18718. else
  18719. {
  18720.  
  18721. const bool __uppercase = __flags & ios_base :: uppercase ;
  18722. * -- __cs = __lit [ __num_base :: _S_ox + __uppercase ] ;
  18723.  
  18724. * -- __cs = __lit [ __num_base :: _S_odigits ] ;
  18725. __len += 2 ;
  18726. }
  18727. }
  18728.  
  18729.  
  18730. const streamsize __w = __io . width ( ) ;
  18731. if ( __w > static_cast < streamsize > ( __len ) )
  18732. {
  18733. _CharT * __cs3 = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18734. * __w ) ) ;
  18735. _M_pad ( __fill , __w , __io , __cs3 , __cs , __len ) ;
  18736. __cs = __cs3 ;
  18737. }
  18738. __io . width ( 0 ) ;
  18739.  
  18740.  
  18741.  
  18742. return std :: __write ( __s , __cs , __len ) ;
  18743. }
  18744.  
  18745. template < typename _CharT , typename _OutIter >
  18746. void
  18747. num_put < _CharT , _OutIter > ::
  18748. _M_group_float ( const char * __grouping , size_t __grouping_size ,
  18749. _CharT __sep , const _CharT * __p , _CharT * __new ,
  18750. _CharT * __cs , int & __len ) const
  18751. {
  18752.  
  18753.  
  18754.  
  18755. const int __declen = __p ? __p - __cs : __len ;
  18756. _CharT * __p2 = std :: __add_grouping ( __new , __sep , __grouping ,
  18757. __grouping_size ,
  18758. __cs , __cs + __declen ) ;
  18759.  
  18760.  
  18761. int __newlen = __p2 - __new ;
  18762. if ( __p )
  18763. {
  18764. char_traits < _CharT > :: copy ( __p2 , __p , __len - __declen ) ;
  18765. __newlen += __len - __declen ;
  18766. }
  18767. __len = __newlen ;
  18768. }
  18769. #966
  18770. template < typename _CharT , typename _OutIter >
  18771. template < typename _ValueT >
  18772. _OutIter
  18773. num_put < _CharT , _OutIter > ::
  18774. _M_insert_float ( _OutIter __s , ios_base & __io , _CharT __fill , char __mod ,
  18775. _ValueT __v ) const
  18776. {
  18777. typedef __numpunct_cache < _CharT > __cache_type ;
  18778. __use_cache < __cache_type > __uc ;
  18779. const locale & __loc = __io . _M_getloc ( ) ;
  18780. const __cache_type * __lc = __uc ( __loc ) ;
  18781.  
  18782.  
  18783. const streamsize __prec = __io . precision ( ) < 0 ? 6 : __io . precision ( ) ;
  18784.  
  18785. const int __max_digits =
  18786. __gnu_cxx :: __numeric_traits < _ValueT > :: __digits10 ;
  18787.  
  18788.  
  18789. int __len ;
  18790.  
  18791. char __fbuf [ 16 ] ;
  18792. __num_base :: _S_format_float ( __io , __fbuf , __mod ) ;
  18793.  
  18794.  
  18795.  
  18796.  
  18797. int __cs_size = __max_digits * 3 ;
  18798. char * __cs = static_cast < char * > ( __builtin_alloca ( __cs_size ) ) ;
  18799. __len = std :: __convert_from_v ( _S_get_c_locale ( ) , __cs , __cs_size ,
  18800. __fbuf , __prec , __v ) ;
  18801.  
  18802.  
  18803. if ( __len >= __cs_size )
  18804. {
  18805. __cs_size = __len + 1 ;
  18806. __cs = static_cast < char * > ( __builtin_alloca ( __cs_size ) ) ;
  18807. __len = std :: __convert_from_v ( _S_get_c_locale ( ) , __cs , __cs_size ,
  18808. __fbuf , __prec , __v ) ;
  18809. }
  18810. #1027
  18811. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  18812.  
  18813. _CharT * __ws = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18814. * __len ) ) ;
  18815. __ctype . widen ( __cs , __cs + __len , __ws ) ;
  18816.  
  18817.  
  18818. _CharT * __wp = 0 ;
  18819. const char * __p = char_traits < char > :: find ( __cs , __len , '.' ) ;
  18820. if ( __p )
  18821. {
  18822. __wp = __ws + ( __p - __cs ) ;
  18823. * __wp = __lc -> _M_decimal_point ;
  18824. }
  18825.  
  18826.  
  18827.  
  18828.  
  18829. if ( __lc -> _M_use_grouping
  18830. && ( __wp || __len < 3 || ( __cs [ 1 ] <= '9' && __cs [ 2 ] <= '9'
  18831. && __cs [ 1 ] >= '0' && __cs [ 2 ] >= '0' ) ) )
  18832. {
  18833.  
  18834.  
  18835. _CharT * __ws2 = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18836. * __len * 2 ) ) ;
  18837.  
  18838. streamsize __off = 0 ;
  18839. if ( __cs [ 0 ] == '-' || __cs [ 0 ] == '+' )
  18840. {
  18841. __off = 1 ;
  18842. __ws2 [ 0 ] = __ws [ 0 ] ;
  18843. __len -= 1 ;
  18844. }
  18845.  
  18846. _M_group_float ( __lc -> _M_grouping , __lc -> _M_grouping_size ,
  18847. __lc -> _M_thousands_sep , __wp , __ws2 + __off ,
  18848. __ws + __off , __len ) ;
  18849. __len += __off ;
  18850.  
  18851. __ws = __ws2 ;
  18852. }
  18853.  
  18854.  
  18855. const streamsize __w = __io . width ( ) ;
  18856. if ( __w > static_cast < streamsize > ( __len ) )
  18857. {
  18858. _CharT * __ws3 = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18859. * __w ) ) ;
  18860. _M_pad ( __fill , __w , __io , __ws3 , __ws , __len ) ;
  18861. __ws = __ws3 ;
  18862. }
  18863. __io . width ( 0 ) ;
  18864.  
  18865.  
  18866.  
  18867. return std :: __write ( __s , __ws , __len ) ;
  18868. }
  18869.  
  18870. template < typename _CharT , typename _OutIter >
  18871. _OutIter
  18872. num_put < _CharT , _OutIter > ::
  18873. do_put ( iter_type __s , ios_base & __io , char_type __fill , bool __v ) const
  18874. {
  18875. const ios_base :: fmtflags __flags = __io . flags ( ) ;
  18876. if ( ( __flags & ios_base :: boolalpha ) == 0 )
  18877. {
  18878. const long __l = __v ;
  18879. __s = _M_insert_int ( __s , __io , __fill , __l ) ;
  18880. }
  18881. else
  18882. {
  18883. typedef __numpunct_cache < _CharT > __cache_type ;
  18884. __use_cache < __cache_type > __uc ;
  18885. const locale & __loc = __io . _M_getloc ( ) ;
  18886. const __cache_type * __lc = __uc ( __loc ) ;
  18887.  
  18888. const _CharT * __name = __v ? __lc -> _M_truename
  18889. : __lc -> _M_falsename ;
  18890. int __len = __v ? __lc -> _M_truename_size
  18891. : __lc -> _M_falsename_size ;
  18892.  
  18893. const streamsize __w = __io . width ( ) ;
  18894. if ( __w > static_cast < streamsize > ( __len ) )
  18895. {
  18896. const streamsize __plen = __w - __len ;
  18897. _CharT * __ps
  18898. = static_cast < _CharT * > ( __builtin_alloca ( sizeof ( _CharT )
  18899. * __plen ) ) ;
  18900.  
  18901. char_traits < _CharT > :: assign ( __ps , __plen , __fill ) ;
  18902. __io . width ( 0 ) ;
  18903.  
  18904. if ( ( __flags & ios_base :: adjustfield ) == ios_base :: left )
  18905. {
  18906. __s = std :: __write ( __s , __name , __len ) ;
  18907. __s = std :: __write ( __s , __ps , __plen ) ;
  18908. }
  18909. else
  18910. {
  18911. __s = std :: __write ( __s , __ps , __plen ) ;
  18912. __s = std :: __write ( __s , __name , __len ) ;
  18913. }
  18914. return __s ;
  18915. }
  18916. __io . width ( 0 ) ;
  18917. __s = std :: __write ( __s , __name , __len ) ;
  18918. }
  18919. return __s ;
  18920. }
  18921.  
  18922. template < typename _CharT , typename _OutIter >
  18923. _OutIter
  18924. num_put < _CharT , _OutIter > ::
  18925. do_put ( iter_type __s , ios_base & __io , char_type __fill , double __v ) const
  18926. { return _M_insert_float ( __s , __io , __fill , char ( ) , __v ) ; }
  18927. #1152
  18928. template < typename _CharT , typename _OutIter >
  18929. _OutIter
  18930. num_put < _CharT , _OutIter > ::
  18931. do_put ( iter_type __s , ios_base & __io , char_type __fill ,
  18932. long double __v ) const
  18933. { return _M_insert_float ( __s , __io , __fill , 'L' , __v ) ; }
  18934.  
  18935. template < typename _CharT , typename _OutIter >
  18936. _OutIter
  18937. num_put < _CharT , _OutIter > ::
  18938. do_put ( iter_type __s , ios_base & __io , char_type __fill ,
  18939. const void * __v ) const
  18940. {
  18941. const ios_base :: fmtflags __flags = __io . flags ( ) ;
  18942. const ios_base :: fmtflags __fmt = ~ ( ios_base :: basefield
  18943. | ios_base :: uppercase ) ;
  18944. __io . flags ( ( __flags & __fmt ) | ( ios_base :: hex | ios_base :: showbase ) ) ;
  18945.  
  18946. typedef __gnu_cxx :: __conditional_type < ( sizeof ( const void * )
  18947. <= sizeof ( unsigned long ) ) ,
  18948. unsigned long , unsigned long long > :: __type _UIntPtrType ;
  18949.  
  18950. __s = _M_insert_int ( __s , __io , __fill ,
  18951. reinterpret_cast < _UIntPtrType > ( __v ) ) ;
  18952. __io . flags ( __flags ) ;
  18953. return __s ;
  18954. }
  18955. #1189
  18956. template < typename _CharT , typename _Traits >
  18957. void
  18958. __pad < _CharT , _Traits > :: _S_pad ( ios_base & __io , _CharT __fill ,
  18959. _CharT * __news , const _CharT * __olds ,
  18960. streamsize __newlen , streamsize __oldlen )
  18961. {
  18962. const size_t __plen = static_cast < size_t > ( __newlen - __oldlen ) ;
  18963. const ios_base :: fmtflags __adjust = __io . flags ( ) & ios_base :: adjustfield ;
  18964.  
  18965.  
  18966. if ( __adjust == ios_base :: left )
  18967. {
  18968. _Traits :: copy ( __news , __olds , __oldlen ) ;
  18969. _Traits :: assign ( __news + __oldlen , __plen , __fill ) ;
  18970. return ;
  18971. }
  18972.  
  18973. size_t __mod = 0 ;
  18974. if ( __adjust == ios_base :: internal )
  18975. {
  18976.  
  18977.  
  18978.  
  18979. const locale & __loc = __io . _M_getloc ( ) ;
  18980. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  18981.  
  18982. if ( __ctype . widen ( '-' ) == __olds [ 0 ]
  18983. || __ctype . widen ( '+' ) == __olds [ 0 ] )
  18984. {
  18985. __news [ 0 ] = __olds [ 0 ] ;
  18986. __mod = 1 ;
  18987. ++ __news ;
  18988. }
  18989. else if ( __ctype . widen ( '0' ) == __olds [ 0 ]
  18990. && __oldlen > 1
  18991. && ( __ctype . widen ( 'x' ) == __olds [ 1 ]
  18992. || __ctype . widen ( 'X' ) == __olds [ 1 ] ) )
  18993. {
  18994. __news [ 0 ] = __olds [ 0 ] ;
  18995. __news [ 1 ] = __olds [ 1 ] ;
  18996. __mod = 2 ;
  18997. __news += 2 ;
  18998. }
  18999.  
  19000. }
  19001. _Traits :: assign ( __news , __plen , __fill ) ;
  19002. _Traits :: copy ( __news + __plen , __olds + __mod , __oldlen - __mod ) ;
  19003. }
  19004.  
  19005. template < typename _CharT >
  19006. _CharT *
  19007. __add_grouping ( _CharT * __s , _CharT __sep ,
  19008. const char * __gbeg , size_t __gsize ,
  19009. const _CharT * __first , const _CharT * __last )
  19010. {
  19011. size_t __idx = 0 ;
  19012. size_t __ctr = 0 ;
  19013.  
  19014. while ( __last - __first > __gbeg [ __idx ]
  19015. && static_cast < signed char > ( __gbeg [ __idx ] ) > 0
  19016. && __gbeg [ __idx ] != __gnu_cxx :: __numeric_traits < char > :: __max )
  19017. {
  19018. __last -= __gbeg [ __idx ] ;
  19019. __idx < __gsize - 1 ? ++ __idx : ++ __ctr ;
  19020. }
  19021.  
  19022. while ( __first != __last )
  19023. * __s ++ = * __first ++ ;
  19024.  
  19025. while ( __ctr -- )
  19026. {
  19027. * __s ++ = __sep ;
  19028. for ( char __i = __gbeg [ __idx ] ; __i > 0 ; -- __i )
  19029. * __s ++ = * __first ++ ;
  19030. }
  19031.  
  19032. while ( __idx -- )
  19033. {
  19034. * __s ++ = __sep ;
  19035. for ( char __i = __gbeg [ __idx ] ; __i > 0 ; -- __i )
  19036. * __s ++ = * __first ++ ;
  19037. }
  19038.  
  19039. return __s ;
  19040. }
  19041.  
  19042.  
  19043.  
  19044.  
  19045. extern template class numpunct < char > ;
  19046. extern template class numpunct_byname < char > ;
  19047. extern template class num_get < char > ;
  19048. extern template class num_put < char > ;
  19049. extern template class ctype_byname < char > ;
  19050.  
  19051. extern template
  19052. const ctype < char > &
  19053. use_facet < ctype < char > > ( const locale & ) ;
  19054.  
  19055. extern template
  19056. const numpunct < char > &
  19057. use_facet < numpunct < char > > ( const locale & ) ;
  19058.  
  19059. extern template
  19060. const num_put < char > &
  19061. use_facet < num_put < char > > ( const locale & ) ;
  19062.  
  19063. extern template
  19064. const num_get < char > &
  19065. use_facet < num_get < char > > ( const locale & ) ;
  19066.  
  19067. extern template
  19068. bool
  19069. has_facet < ctype < char > > ( const locale & ) ;
  19070.  
  19071. extern template
  19072. bool
  19073. has_facet < numpunct < char > > ( const locale & ) ;
  19074.  
  19075. extern template
  19076. bool
  19077. has_facet < num_put < char > > ( const locale & ) ;
  19078.  
  19079. extern template
  19080. bool
  19081. has_facet < num_get < char > > ( const locale & ) ;
  19082.  
  19083.  
  19084. extern template class numpunct < wchar_t > ;
  19085. extern template class numpunct_byname < wchar_t > ;
  19086. extern template class num_get < wchar_t > ;
  19087. extern template class num_put < wchar_t > ;
  19088. extern template class ctype_byname < wchar_t > ;
  19089.  
  19090. extern template
  19091. const ctype < wchar_t > &
  19092. use_facet < ctype < wchar_t > > ( const locale & ) ;
  19093.  
  19094. extern template
  19095. const numpunct < wchar_t > &
  19096. use_facet < numpunct < wchar_t > > ( const locale & ) ;
  19097.  
  19098. extern template
  19099. const num_put < wchar_t > &
  19100. use_facet < num_put < wchar_t > > ( const locale & ) ;
  19101.  
  19102. extern template
  19103. const num_get < wchar_t > &
  19104. use_facet < num_get < wchar_t > > ( const locale & ) ;
  19105.  
  19106. extern template
  19107. bool
  19108. has_facet < ctype < wchar_t > > ( const locale & ) ;
  19109.  
  19110. extern template
  19111. bool
  19112. has_facet < numpunct < wchar_t > > ( const locale & ) ;
  19113.  
  19114. extern template
  19115. bool
  19116. has_facet < num_put < wchar_t > > ( const locale & ) ;
  19117.  
  19118. extern template
  19119. bool
  19120. has_facet < num_get < wchar_t > > ( const locale & ) ;
  19121.  
  19122.  
  19123.  
  19124.  
  19125. }
  19126. #40 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_ios.h"
  19127. namespace std
  19128. {
  19129.  
  19130.  
  19131. template < typename _Facet >
  19132. inline const _Facet &
  19133. __check_facet ( const _Facet * __f )
  19134. {
  19135. if ( ! __f )
  19136. __throw_bad_cast ( ) ;
  19137. return * __f ;
  19138. }
  19139. #65
  19140. template < typename _CharT , typename _Traits >
  19141. class basic_ios : public ios_base
  19142. {
  19143. public :
  19144. #75
  19145. typedef _CharT char_type ;
  19146. typedef typename _Traits :: int_type int_type ;
  19147. typedef typename _Traits :: pos_type pos_type ;
  19148. typedef typename _Traits :: off_type off_type ;
  19149. typedef _Traits traits_type ;
  19150. #86
  19151. typedef ctype < _CharT > __ctype_type ;
  19152. typedef num_put < _CharT , ostreambuf_iterator < _CharT , _Traits > >
  19153. __num_put_type ;
  19154. typedef num_get < _CharT , istreambuf_iterator < _CharT , _Traits > >
  19155. __num_get_type ;
  19156.  
  19157.  
  19158.  
  19159. protected :
  19160. basic_ostream < _CharT , _Traits > * _M_tie ;
  19161. mutable char_type _M_fill ;
  19162. mutable bool _M_fill_init ;
  19163. basic_streambuf < _CharT , _Traits > * _M_streambuf ;
  19164.  
  19165.  
  19166. const __ctype_type * _M_ctype ;
  19167.  
  19168. const __num_put_type * _M_num_put ;
  19169.  
  19170. const __num_get_type * _M_num_get ;
  19171.  
  19172. public :
  19173. #115
  19174. operator void * ( ) const
  19175. { return this -> fail ( ) ? 0 : const_cast < basic_ios * > ( this ) ; }
  19176.  
  19177. bool
  19178. operator ! ( ) const
  19179. { return this -> fail ( ) ; }
  19180. #130
  19181. iostate
  19182. rdstate ( ) const
  19183. { return _M_streambuf_state ; }
  19184. #141
  19185. void
  19186. clear ( iostate __state = goodbit ) ;
  19187. #150
  19188. void
  19189. setstate ( iostate __state )
  19190. { this -> clear ( this -> rdstate ( ) | __state ) ; }
  19191.  
  19192.  
  19193.  
  19194.  
  19195. void
  19196. _M_setstate ( iostate __state )
  19197. {
  19198.  
  19199.  
  19200. _M_streambuf_state |= __state ;
  19201. if ( this -> exceptions ( ) & __state )
  19202. throw ;
  19203. }
  19204. #173
  19205. bool
  19206. good ( ) const
  19207. { return this -> rdstate ( ) == 0 ; }
  19208. #183
  19209. bool
  19210. eof ( ) const
  19211. { return ( this -> rdstate ( ) & eofbit ) != 0 ; }
  19212. #194
  19213. bool
  19214. fail ( ) const
  19215. { return ( this -> rdstate ( ) & ( badbit | failbit ) ) != 0 ; }
  19216. #204
  19217. bool
  19218. bad ( ) const
  19219. { return ( this -> rdstate ( ) & badbit ) != 0 ; }
  19220. #215
  19221. iostate
  19222. exceptions ( ) const
  19223. { return _M_exception ; }
  19224. #250
  19225. void
  19226. exceptions ( iostate __except )
  19227. {
  19228. _M_exception = __except ;
  19229. this -> clear ( _M_streambuf_state ) ;
  19230. }
  19231. #263
  19232. explicit
  19233. basic_ios ( basic_streambuf < _CharT , _Traits > * __sb )
  19234. : ios_base ( ) , _M_tie ( 0 ) , _M_fill ( ) , _M_fill_init ( false ) , _M_streambuf ( 0 ) ,
  19235. _M_ctype ( 0 ) , _M_num_put ( 0 ) , _M_num_get ( 0 )
  19236. { this -> init ( __sb ) ; }
  19237. #275
  19238. virtual
  19239. ~ basic_ios ( ) { }
  19240. #288
  19241. basic_ostream < _CharT , _Traits > *
  19242. tie ( ) const
  19243. { return _M_tie ; }
  19244. #300
  19245. basic_ostream < _CharT , _Traits > *
  19246. tie ( basic_ostream < _CharT , _Traits > * __tiestr )
  19247. {
  19248. basic_ostream < _CharT , _Traits > * __old = _M_tie ;
  19249. _M_tie = __tiestr ;
  19250. return __old ;
  19251. }
  19252. #314
  19253. basic_streambuf < _CharT , _Traits > *
  19254. rdbuf ( ) const
  19255. { return _M_streambuf ; }
  19256. #340
  19257. basic_streambuf < _CharT , _Traits > *
  19258. rdbuf ( basic_streambuf < _CharT , _Traits > * __sb ) ;
  19259. #354
  19260. basic_ios &
  19261. copyfmt ( const basic_ios & __rhs ) ;
  19262. #363
  19263. char_type
  19264. fill ( ) const
  19265. {
  19266. if ( ! _M_fill_init )
  19267. {
  19268. _M_fill = this -> widen ( ' ' ) ;
  19269. _M_fill_init = true ;
  19270. }
  19271. return _M_fill ;
  19272. }
  19273. #383
  19274. char_type
  19275. fill ( char_type __ch )
  19276. {
  19277. char_type __old = this -> fill ( ) ;
  19278. _M_fill = __ch ;
  19279. return __old ;
  19280. }
  19281. #403
  19282. locale
  19283. imbue ( const locale & __loc ) ;
  19284. #423
  19285. char
  19286. narrow ( char_type __c , char __dfault ) const
  19287. { return __check_facet ( _M_ctype ) . narrow ( __c , __dfault ) ; }
  19288. #442
  19289. char_type
  19290. widen ( char __c ) const
  19291. { return __check_facet ( _M_ctype ) . widen ( __c ) ; }
  19292.  
  19293. protected :
  19294. #454
  19295. basic_ios ( )
  19296. : ios_base ( ) , _M_tie ( 0 ) , _M_fill ( char_type ( ) ) , _M_fill_init ( false ) ,
  19297. _M_streambuf ( 0 ) , _M_ctype ( 0 ) , _M_num_put ( 0 ) , _M_num_get ( 0 )
  19298. { }
  19299. #465
  19300. void
  19301. init ( basic_streambuf < _CharT , _Traits > * __sb ) ;
  19302.  
  19303. void
  19304. _M_cache_locale ( const locale & __loc ) ;
  19305. } ;
  19306.  
  19307.  
  19308. }
  19309. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_ios.tcc"
  19310. #33
  19311. #pragma GCC system_header
  19312.  
  19313. namespace std
  19314. {
  19315.  
  19316.  
  19317. template < typename _CharT , typename _Traits >
  19318. void
  19319. basic_ios < _CharT , _Traits > :: clear ( iostate __state )
  19320. {
  19321. if ( this -> rdbuf ( ) )
  19322. _M_streambuf_state = __state ;
  19323. else
  19324. _M_streambuf_state = __state | badbit ;
  19325. if ( this -> exceptions ( ) & this -> rdstate ( ) )
  19326. __throw_ios_failure ( ( "basic_ios::clear" ) ) ;
  19327. }
  19328.  
  19329. template < typename _CharT , typename _Traits >
  19330. basic_streambuf < _CharT , _Traits > *
  19331. basic_ios < _CharT , _Traits > :: rdbuf ( basic_streambuf < _CharT , _Traits > * __sb )
  19332. {
  19333. basic_streambuf < _CharT , _Traits > * __old = _M_streambuf ;
  19334. _M_streambuf = __sb ;
  19335. this -> clear ( ) ;
  19336. return __old ;
  19337. }
  19338.  
  19339. template < typename _CharT , typename _Traits >
  19340. basic_ios < _CharT , _Traits > &
  19341. basic_ios < _CharT , _Traits > :: copyfmt ( const basic_ios & __rhs )
  19342. {
  19343.  
  19344.  
  19345. if ( this != & __rhs )
  19346. {
  19347.  
  19348.  
  19349.  
  19350.  
  19351. _Words * __words = ( __rhs . _M_word_size <= _S_local_word_size ) ?
  19352. _M_local_word : new _Words [ __rhs . _M_word_size ] ;
  19353.  
  19354.  
  19355. _Callback_list * __cb = __rhs . _M_callbacks ;
  19356. if ( __cb )
  19357. __cb -> _M_add_reference ( ) ;
  19358. _M_call_callbacks ( erase_event ) ;
  19359. if ( _M_word != _M_local_word )
  19360. {
  19361. delete [ ] _M_word ;
  19362. _M_word = 0 ;
  19363. }
  19364. _M_dispose_callbacks ( ) ;
  19365.  
  19366.  
  19367. _M_callbacks = __cb ;
  19368. for ( int __i = 0 ; __i < __rhs . _M_word_size ; ++ __i )
  19369. __words [ __i ] = __rhs . _M_word [ __i ] ;
  19370. _M_word = __words ;
  19371. _M_word_size = __rhs . _M_word_size ;
  19372.  
  19373. this -> flags ( __rhs . flags ( ) ) ;
  19374. this -> width ( __rhs . width ( ) ) ;
  19375. this -> precision ( __rhs . precision ( ) ) ;
  19376. this -> tie ( __rhs . tie ( ) ) ;
  19377. this -> fill ( __rhs . fill ( ) ) ;
  19378. _M_ios_locale = __rhs . getloc ( ) ;
  19379. _M_cache_locale ( _M_ios_locale ) ;
  19380.  
  19381. _M_call_callbacks ( copyfmt_event ) ;
  19382.  
  19383.  
  19384. this -> exceptions ( __rhs . exceptions ( ) ) ;
  19385. }
  19386. return * this ;
  19387. }
  19388.  
  19389.  
  19390. template < typename _CharT , typename _Traits >
  19391. locale
  19392. basic_ios < _CharT , _Traits > :: imbue ( const locale & __loc )
  19393. {
  19394. locale __old ( this -> getloc ( ) ) ;
  19395. ios_base :: imbue ( __loc ) ;
  19396. _M_cache_locale ( __loc ) ;
  19397. if ( this -> rdbuf ( ) != 0 )
  19398. this -> rdbuf ( ) -> pubimbue ( __loc ) ;
  19399. return __old ;
  19400. }
  19401.  
  19402. template < typename _CharT , typename _Traits >
  19403. void
  19404. basic_ios < _CharT , _Traits > :: init ( basic_streambuf < _CharT , _Traits > * __sb )
  19405. {
  19406.  
  19407. ios_base :: _M_init ( ) ;
  19408.  
  19409.  
  19410. _M_cache_locale ( _M_ios_locale ) ;
  19411. #146
  19412. _M_fill = _CharT ( ) ;
  19413. _M_fill_init = false ;
  19414.  
  19415. _M_tie = 0 ;
  19416. _M_exception = goodbit ;
  19417. _M_streambuf = __sb ;
  19418. _M_streambuf_state = __sb ? goodbit : badbit ;
  19419. }
  19420.  
  19421. template < typename _CharT , typename _Traits >
  19422. void
  19423. basic_ios < _CharT , _Traits > :: _M_cache_locale ( const locale & __loc )
  19424. {
  19425. if ( has_facet < __ctype_type > ( __loc ) )
  19426. _M_ctype = & use_facet < __ctype_type > ( __loc ) ;
  19427. else
  19428. _M_ctype = 0 ;
  19429.  
  19430. if ( has_facet < __num_put_type > ( __loc ) )
  19431. _M_num_put = & use_facet < __num_put_type > ( __loc ) ;
  19432. else
  19433. _M_num_put = 0 ;
  19434.  
  19435. if ( has_facet < __num_get_type > ( __loc ) )
  19436. _M_num_get = & use_facet < __num_get_type > ( __loc ) ;
  19437. else
  19438. _M_num_get = 0 ;
  19439. }
  19440.  
  19441.  
  19442.  
  19443.  
  19444. extern template class basic_ios < char > ;
  19445.  
  19446.  
  19447. extern template class basic_ios < wchar_t > ;
  19448.  
  19449.  
  19450.  
  19451.  
  19452. }
  19453. #41 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ostream"
  19454. namespace std
  19455. {
  19456. #57
  19457. template < typename _CharT , typename _Traits >
  19458. class basic_ostream : virtual public basic_ios < _CharT , _Traits >
  19459. {
  19460. public :
  19461.  
  19462. typedef _CharT char_type ;
  19463. typedef typename _Traits :: int_type int_type ;
  19464. typedef typename _Traits :: pos_type pos_type ;
  19465. typedef typename _Traits :: off_type off_type ;
  19466. typedef _Traits traits_type ;
  19467.  
  19468.  
  19469. typedef basic_streambuf < _CharT , _Traits > __streambuf_type ;
  19470. typedef basic_ios < _CharT , _Traits > __ios_type ;
  19471. typedef basic_ostream < _CharT , _Traits > __ostream_type ;
  19472. typedef num_put < _CharT , ostreambuf_iterator < _CharT , _Traits > >
  19473. __num_put_type ;
  19474. typedef ctype < _CharT > __ctype_type ;
  19475. #83
  19476. explicit
  19477. basic_ostream ( __streambuf_type * __sb )
  19478. { this -> init ( __sb ) ; }
  19479. #92
  19480. virtual
  19481. ~ basic_ostream ( ) { }
  19482.  
  19483.  
  19484. class sentry ;
  19485. friend class sentry ;
  19486. #107
  19487. __ostream_type &
  19488. operator << ( __ostream_type & ( * __pf ) ( __ostream_type & ) )
  19489. {
  19490.  
  19491.  
  19492.  
  19493. return __pf ( * this ) ;
  19494. }
  19495.  
  19496. __ostream_type &
  19497. operator << ( __ios_type & ( * __pf ) ( __ios_type & ) )
  19498. {
  19499.  
  19500.  
  19501.  
  19502. __pf ( * this ) ;
  19503. return * this ;
  19504. }
  19505.  
  19506. __ostream_type &
  19507. operator << ( ios_base & ( * __pf ) ( ios_base & ) )
  19508. {
  19509.  
  19510.  
  19511.  
  19512. __pf ( * this ) ;
  19513. return * this ;
  19514. }
  19515. #165
  19516. __ostream_type &
  19517. operator << ( long __n )
  19518. { return _M_insert ( __n ) ; }
  19519.  
  19520. __ostream_type &
  19521. operator << ( unsigned long __n )
  19522. { return _M_insert ( __n ) ; }
  19523.  
  19524. __ostream_type &
  19525. operator << ( bool __n )
  19526. { return _M_insert ( __n ) ; }
  19527.  
  19528. __ostream_type &
  19529. operator << ( short __n ) ;
  19530.  
  19531. __ostream_type &
  19532. operator << ( unsigned short __n )
  19533. {
  19534.  
  19535.  
  19536. return _M_insert ( static_cast < unsigned long > ( __n ) ) ;
  19537. }
  19538.  
  19539. __ostream_type &
  19540. operator << ( int __n ) ;
  19541.  
  19542. __ostream_type &
  19543. operator << ( unsigned int __n )
  19544. {
  19545.  
  19546.  
  19547. return _M_insert ( static_cast < unsigned long > ( __n ) ) ;
  19548. }
  19549.  
  19550.  
  19551. __ostream_type &
  19552. operator << ( long long __n )
  19553. { return _M_insert ( __n ) ; }
  19554.  
  19555. __ostream_type &
  19556. operator << ( unsigned long long __n )
  19557. { return _M_insert ( __n ) ; }
  19558. #219
  19559. __ostream_type &
  19560. operator << ( double __f )
  19561. { return _M_insert ( __f ) ; }
  19562.  
  19563. __ostream_type &
  19564. operator << ( float __f )
  19565. {
  19566.  
  19567.  
  19568. return _M_insert ( static_cast < double > ( __f ) ) ;
  19569. }
  19570.  
  19571. __ostream_type &
  19572. operator << ( long double __f )
  19573. { return _M_insert ( __f ) ; }
  19574. #244
  19575. __ostream_type &
  19576. operator << ( const void * __p )
  19577. { return _M_insert ( __p ) ; }
  19578. #269
  19579. __ostream_type &
  19580. operator << ( __streambuf_type * __sb ) ;
  19581. #302
  19582. __ostream_type &
  19583. put ( char_type __c ) ;
  19584. #310
  19585. void
  19586. _M_write ( const char_type * __s , streamsize __n )
  19587. {
  19588. const streamsize __put = this -> rdbuf ( ) -> sputn ( __s , __n ) ;
  19589. if ( __put != __n )
  19590. this -> setstate ( ios_base :: badbit ) ;
  19591. }
  19592. #334
  19593. __ostream_type &
  19594. write ( const char_type * __s , streamsize __n ) ;
  19595. #347
  19596. __ostream_type &
  19597. flush ( ) ;
  19598. #357
  19599. pos_type
  19600. tellp ( ) ;
  19601. #368
  19602. __ostream_type &
  19603. seekp ( pos_type ) ;
  19604. #380
  19605. __ostream_type &
  19606. seekp ( off_type , ios_base :: seekdir ) ;
  19607.  
  19608. protected :
  19609. basic_ostream ( )
  19610. { this -> init ( 0 ) ; }
  19611.  
  19612. template < typename _ValueT >
  19613. __ostream_type &
  19614. _M_insert ( _ValueT __v ) ;
  19615. } ;
  19616. #399
  19617. template < typename _CharT , typename _Traits >
  19618. class basic_ostream < _CharT , _Traits > :: sentry
  19619. {
  19620.  
  19621. bool _M_ok ;
  19622. basic_ostream < _CharT , _Traits > & _M_os ;
  19623.  
  19624. public :
  19625. #418
  19626. explicit
  19627. sentry ( basic_ostream < _CharT , _Traits > & __os ) ;
  19628. #428
  19629. ~ sentry ( )
  19630. {
  19631.  
  19632. if ( bool ( _M_os . flags ( ) & ios_base :: unitbuf ) && ! uncaught_exception ( ) )
  19633. {
  19634.  
  19635. if ( _M_os . rdbuf ( ) && _M_os . rdbuf ( ) -> pubsync ( ) == - 1 )
  19636. _M_os . setstate ( ios_base :: badbit ) ;
  19637. }
  19638. }
  19639. #447
  19640. explicit
  19641.  
  19642. operator bool ( ) const
  19643. { return _M_ok ; }
  19644. } ;
  19645. #469
  19646. template < typename _CharT , typename _Traits >
  19647. inline basic_ostream < _CharT , _Traits > &
  19648. operator << ( basic_ostream < _CharT , _Traits > & __out , _CharT __c )
  19649. { return __ostream_insert ( __out , & __c , 1 ) ; }
  19650.  
  19651. template < typename _CharT , typename _Traits >
  19652. inline basic_ostream < _CharT , _Traits > &
  19653. operator << ( basic_ostream < _CharT , _Traits > & __out , char __c )
  19654. { return ( __out << __out . widen ( __c ) ) ; }
  19655.  
  19656.  
  19657. template < class _Traits >
  19658. inline basic_ostream < char , _Traits > &
  19659. operator << ( basic_ostream < char , _Traits > & __out , char __c )
  19660. { return __ostream_insert ( __out , & __c , 1 ) ; }
  19661.  
  19662.  
  19663. template < class _Traits >
  19664. inline basic_ostream < char , _Traits > &
  19665. operator << ( basic_ostream < char , _Traits > & __out , signed char __c )
  19666. { return ( __out << static_cast < char > ( __c ) ) ; }
  19667.  
  19668. template < class _Traits >
  19669. inline basic_ostream < char , _Traits > &
  19670. operator << ( basic_ostream < char , _Traits > & __out , unsigned char __c )
  19671. { return ( __out << static_cast < char > ( __c ) ) ; }
  19672. #511
  19673. template < typename _CharT , typename _Traits >
  19674. inline basic_ostream < _CharT , _Traits > &
  19675. operator << ( basic_ostream < _CharT , _Traits > & __out , const _CharT * __s )
  19676. {
  19677. if ( ! __s )
  19678. __out . setstate ( ios_base :: badbit ) ;
  19679. else
  19680. __ostream_insert ( __out , __s ,
  19681. static_cast < streamsize > ( _Traits :: length ( __s ) ) ) ;
  19682. return __out ;
  19683. }
  19684.  
  19685. template < typename _CharT , typename _Traits >
  19686. basic_ostream < _CharT , _Traits > &
  19687. operator << ( basic_ostream < _CharT , _Traits > & __out , const char * __s ) ;
  19688.  
  19689.  
  19690. template < class _Traits >
  19691. inline basic_ostream < char , _Traits > &
  19692. operator << ( basic_ostream < char , _Traits > & __out , const char * __s )
  19693. {
  19694. if ( ! __s )
  19695. __out . setstate ( ios_base :: badbit ) ;
  19696. else
  19697. __ostream_insert ( __out , __s ,
  19698. static_cast < streamsize > ( _Traits :: length ( __s ) ) ) ;
  19699. return __out ;
  19700. }
  19701.  
  19702.  
  19703. template < class _Traits >
  19704. inline basic_ostream < char , _Traits > &
  19705. operator << ( basic_ostream < char , _Traits > & __out , const signed char * __s )
  19706. { return ( __out << reinterpret_cast < const char * > ( __s ) ) ; }
  19707.  
  19708. template < class _Traits >
  19709. inline basic_ostream < char , _Traits > &
  19710. operator << ( basic_ostream < char , _Traits > & __out , const unsigned char * __s )
  19711. { return ( __out << reinterpret_cast < const char * > ( __s ) ) ; }
  19712. #562
  19713. template < typename _CharT , typename _Traits >
  19714. inline basic_ostream < _CharT , _Traits > &
  19715. endl ( basic_ostream < _CharT , _Traits > & __os )
  19716. { return flush ( __os . put ( __os . widen ( '\n' ) ) ) ; }
  19717. #574
  19718. template < typename _CharT , typename _Traits >
  19719. inline basic_ostream < _CharT , _Traits > &
  19720. ends ( basic_ostream < _CharT , _Traits > & __os )
  19721. { return __os . put ( _CharT ( ) ) ; }
  19722. #584
  19723. template < typename _CharT , typename _Traits >
  19724. inline basic_ostream < _CharT , _Traits > &
  19725. flush ( basic_ostream < _CharT , _Traits > & __os )
  19726. { return __os . flush ( ) ; }
  19727. #600
  19728. template < typename _CharT , typename _Traits , typename _Tp >
  19729. inline basic_ostream < _CharT , _Traits > &
  19730. operator << ( basic_ostream < _CharT , _Traits > && __os , const _Tp & __x )
  19731. { return ( __os << __x ) ; }
  19732.  
  19733.  
  19734.  
  19735. }
  19736. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/ostream.tcc"
  19737. #37
  19738. #pragma GCC system_header
  19739. #41
  19740. namespace std
  19741. {
  19742.  
  19743.  
  19744. template < typename _CharT , typename _Traits >
  19745. basic_ostream < _CharT , _Traits > :: sentry ::
  19746. sentry ( basic_ostream < _CharT , _Traits > & __os )
  19747. : _M_ok ( false ) , _M_os ( __os )
  19748. {
  19749.  
  19750. if ( __os . tie ( ) && __os . good ( ) )
  19751. __os . tie ( ) -> flush ( ) ;
  19752.  
  19753. if ( __os . good ( ) )
  19754. _M_ok = true ;
  19755. else
  19756. __os . setstate ( ios_base :: failbit ) ;
  19757. }
  19758.  
  19759. template < typename _CharT , typename _Traits >
  19760. template < typename _ValueT >
  19761. basic_ostream < _CharT , _Traits > &
  19762. basic_ostream < _CharT , _Traits > ::
  19763. _M_insert ( _ValueT __v )
  19764. {
  19765. sentry __cerb ( * this ) ;
  19766. if ( __cerb )
  19767. {
  19768. ios_base :: iostate __err = ios_base :: goodbit ;
  19769. try
  19770. {
  19771. const __num_put_type & __np = __check_facet ( this -> _M_num_put ) ;
  19772. if ( __np . put ( * this , * this , this -> fill ( ) , __v ) . failed ( ) )
  19773. __err |= ios_base :: badbit ;
  19774. }
  19775. catch ( __cxxabiv1 :: __forced_unwind & )
  19776. {
  19777. this -> _M_setstate ( ios_base :: badbit ) ;
  19778. throw ;
  19779. }
  19780. catch ( ... )
  19781. { this -> _M_setstate ( ios_base :: badbit ) ; }
  19782. if ( __err )
  19783. this -> setstate ( __err ) ;
  19784. }
  19785. return * this ;
  19786. }
  19787.  
  19788. template < typename _CharT , typename _Traits >
  19789. basic_ostream < _CharT , _Traits > &
  19790. basic_ostream < _CharT , _Traits > ::
  19791. operator << ( short __n )
  19792. {
  19793.  
  19794.  
  19795. const ios_base :: fmtflags __fmt = this -> flags ( ) & ios_base :: basefield ;
  19796. if ( __fmt == ios_base :: oct || __fmt == ios_base :: hex )
  19797. return _M_insert ( static_cast < long > ( static_cast < unsigned short > ( __n ) ) ) ;
  19798. else
  19799. return _M_insert ( static_cast < long > ( __n ) ) ;
  19800. }
  19801.  
  19802. template < typename _CharT , typename _Traits >
  19803. basic_ostream < _CharT , _Traits > &
  19804. basic_ostream < _CharT , _Traits > ::
  19805. operator << ( int __n )
  19806. {
  19807.  
  19808.  
  19809. const ios_base :: fmtflags __fmt = this -> flags ( ) & ios_base :: basefield ;
  19810. if ( __fmt == ios_base :: oct || __fmt == ios_base :: hex )
  19811. return _M_insert ( static_cast < long > ( static_cast < unsigned int > ( __n ) ) ) ;
  19812. else
  19813. return _M_insert ( static_cast < long > ( __n ) ) ;
  19814. }
  19815.  
  19816. template < typename _CharT , typename _Traits >
  19817. basic_ostream < _CharT , _Traits > &
  19818. basic_ostream < _CharT , _Traits > ::
  19819. operator << ( __streambuf_type * __sbin )
  19820. {
  19821. ios_base :: iostate __err = ios_base :: goodbit ;
  19822. sentry __cerb ( * this ) ;
  19823. if ( __cerb && __sbin )
  19824. {
  19825. try
  19826. {
  19827. if ( ! __copy_streambufs ( __sbin , this -> rdbuf ( ) ) )
  19828. __err |= ios_base :: failbit ;
  19829. }
  19830. catch ( __cxxabiv1 :: __forced_unwind & )
  19831. {
  19832. this -> _M_setstate ( ios_base :: badbit ) ;
  19833. throw ;
  19834. }
  19835. catch ( ... )
  19836. { this -> _M_setstate ( ios_base :: failbit ) ; }
  19837. }
  19838. else if ( ! __sbin )
  19839. __err |= ios_base :: badbit ;
  19840. if ( __err )
  19841. this -> setstate ( __err ) ;
  19842. return * this ;
  19843. }
  19844.  
  19845. template < typename _CharT , typename _Traits >
  19846. basic_ostream < _CharT , _Traits > &
  19847. basic_ostream < _CharT , _Traits > ::
  19848. put ( char_type __c )
  19849. {
  19850. #157
  19851. sentry __cerb ( * this ) ;
  19852. if ( __cerb )
  19853. {
  19854. ios_base :: iostate __err = ios_base :: goodbit ;
  19855. try
  19856. {
  19857. const int_type __put = this -> rdbuf ( ) -> sputc ( __c ) ;
  19858. if ( traits_type :: eq_int_type ( __put , traits_type :: eof ( ) ) )
  19859. __err |= ios_base :: badbit ;
  19860. }
  19861. catch ( __cxxabiv1 :: __forced_unwind & )
  19862. {
  19863. this -> _M_setstate ( ios_base :: badbit ) ;
  19864. throw ;
  19865. }
  19866. catch ( ... )
  19867. { this -> _M_setstate ( ios_base :: badbit ) ; }
  19868. if ( __err )
  19869. this -> setstate ( __err ) ;
  19870. }
  19871. return * this ;
  19872. }
  19873.  
  19874. template < typename _CharT , typename _Traits >
  19875. basic_ostream < _CharT , _Traits > &
  19876. basic_ostream < _CharT , _Traits > ::
  19877. write ( const _CharT * __s , streamsize __n )
  19878. {
  19879. #192
  19880. sentry __cerb ( * this ) ;
  19881. if ( __cerb )
  19882. {
  19883. try
  19884. { _M_write ( __s , __n ) ; }
  19885. catch ( __cxxabiv1 :: __forced_unwind & )
  19886. {
  19887. this -> _M_setstate ( ios_base :: badbit ) ;
  19888. throw ;
  19889. }
  19890. catch ( ... )
  19891. { this -> _M_setstate ( ios_base :: badbit ) ; }
  19892. }
  19893. return * this ;
  19894. }
  19895.  
  19896. template < typename _CharT , typename _Traits >
  19897. basic_ostream < _CharT , _Traits > &
  19898. basic_ostream < _CharT , _Traits > ::
  19899. flush ( )
  19900. {
  19901.  
  19902.  
  19903.  
  19904. ios_base :: iostate __err = ios_base :: goodbit ;
  19905. try
  19906. {
  19907. if ( this -> rdbuf ( ) && this -> rdbuf ( ) -> pubsync ( ) == - 1 )
  19908. __err |= ios_base :: badbit ;
  19909. }
  19910. catch ( __cxxabiv1 :: __forced_unwind & )
  19911. {
  19912. this -> _M_setstate ( ios_base :: badbit ) ;
  19913. throw ;
  19914. }
  19915. catch ( ... )
  19916. { this -> _M_setstate ( ios_base :: badbit ) ; }
  19917. if ( __err )
  19918. this -> setstate ( __err ) ;
  19919. return * this ;
  19920. }
  19921.  
  19922. template < typename _CharT , typename _Traits >
  19923. typename basic_ostream < _CharT , _Traits > :: pos_type
  19924. basic_ostream < _CharT , _Traits > ::
  19925. tellp ( )
  19926. {
  19927. pos_type __ret = pos_type ( - 1 ) ;
  19928. try
  19929. {
  19930. if ( ! this -> fail ( ) )
  19931. __ret = this -> rdbuf ( ) -> pubseekoff ( 0 , ios_base :: cur , ios_base :: out ) ;
  19932. }
  19933. catch ( __cxxabiv1 :: __forced_unwind & )
  19934. {
  19935. this -> _M_setstate ( ios_base :: badbit ) ;
  19936. throw ;
  19937. }
  19938. catch ( ... )
  19939. { this -> _M_setstate ( ios_base :: badbit ) ; }
  19940. return __ret ;
  19941. }
  19942.  
  19943. template < typename _CharT , typename _Traits >
  19944. basic_ostream < _CharT , _Traits > &
  19945. basic_ostream < _CharT , _Traits > ::
  19946. seekp ( pos_type __pos )
  19947. {
  19948. ios_base :: iostate __err = ios_base :: goodbit ;
  19949. try
  19950. {
  19951. if ( ! this -> fail ( ) )
  19952. {
  19953.  
  19954.  
  19955. const pos_type __p = this -> rdbuf ( ) -> pubseekpos ( __pos ,
  19956. ios_base :: out ) ;
  19957.  
  19958.  
  19959. if ( __p == pos_type ( off_type ( - 1 ) ) )
  19960. __err |= ios_base :: failbit ;
  19961. }
  19962. }
  19963. catch ( __cxxabiv1 :: __forced_unwind & )
  19964. {
  19965. this -> _M_setstate ( ios_base :: badbit ) ;
  19966. throw ;
  19967. }
  19968. catch ( ... )
  19969. { this -> _M_setstate ( ios_base :: badbit ) ; }
  19970. if ( __err )
  19971. this -> setstate ( __err ) ;
  19972. return * this ;
  19973. }
  19974.  
  19975. template < typename _CharT , typename _Traits >
  19976. basic_ostream < _CharT , _Traits > &
  19977. basic_ostream < _CharT , _Traits > ::
  19978. seekp ( off_type __off , ios_base :: seekdir __dir )
  19979. {
  19980. ios_base :: iostate __err = ios_base :: goodbit ;
  19981. try
  19982. {
  19983. if ( ! this -> fail ( ) )
  19984. {
  19985.  
  19986.  
  19987. const pos_type __p = this -> rdbuf ( ) -> pubseekoff ( __off , __dir ,
  19988. ios_base :: out ) ;
  19989.  
  19990.  
  19991. if ( __p == pos_type ( off_type ( - 1 ) ) )
  19992. __err |= ios_base :: failbit ;
  19993. }
  19994. }
  19995. catch ( __cxxabiv1 :: __forced_unwind & )
  19996. {
  19997. this -> _M_setstate ( ios_base :: badbit ) ;
  19998. throw ;
  19999. }
  20000. catch ( ... )
  20001. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20002. if ( __err )
  20003. this -> setstate ( __err ) ;
  20004. return * this ;
  20005. }
  20006.  
  20007. template < typename _CharT , typename _Traits >
  20008. basic_ostream < _CharT , _Traits > &
  20009. operator << ( basic_ostream < _CharT , _Traits > & __out , const char * __s )
  20010. {
  20011. if ( ! __s )
  20012. __out . setstate ( ios_base :: badbit ) ;
  20013. else
  20014. {
  20015.  
  20016.  
  20017. const size_t __clen = char_traits < char > :: length ( __s ) ;
  20018. try
  20019. {
  20020. struct __ptr_guard
  20021. {
  20022. _CharT * __p ;
  20023. __ptr_guard ( _CharT * __ip ) : __p ( __ip ) { }
  20024. ~ __ptr_guard ( ) { delete [ ] __p ; }
  20025. _CharT * __get ( ) { return __p ; }
  20026. } __pg ( new _CharT [ __clen ] ) ;
  20027.  
  20028. _CharT * __ws = __pg . __get ( ) ;
  20029. for ( size_t __i = 0 ; __i < __clen ; ++ __i )
  20030. __ws [ __i ] = __out . widen ( __s [ __i ] ) ;
  20031. __ostream_insert ( __out , __ws , __clen ) ;
  20032. }
  20033. catch ( __cxxabiv1 :: __forced_unwind & )
  20034. {
  20035. __out . _M_setstate ( ios_base :: badbit ) ;
  20036. throw ;
  20037. }
  20038. catch ( ... )
  20039. { __out . _M_setstate ( ios_base :: badbit ) ; }
  20040. }
  20041. return __out ;
  20042. }
  20043.  
  20044.  
  20045.  
  20046.  
  20047. extern template class basic_ostream < char > ;
  20048. extern template ostream & endl ( ostream & ) ;
  20049. extern template ostream & ends ( ostream & ) ;
  20050. extern template ostream & flush ( ostream & ) ;
  20051. extern template ostream & operator << ( ostream & , char ) ;
  20052. extern template ostream & operator << ( ostream & , unsigned char ) ;
  20053. extern template ostream & operator << ( ostream & , signed char ) ;
  20054. extern template ostream & operator << ( ostream & , const char * ) ;
  20055. extern template ostream & operator << ( ostream & , const unsigned char * ) ;
  20056. extern template ostream & operator << ( ostream & , const signed char * ) ;
  20057.  
  20058. extern template ostream & ostream :: _M_insert ( long ) ;
  20059. extern template ostream & ostream :: _M_insert ( unsigned long ) ;
  20060. extern template ostream & ostream :: _M_insert ( bool ) ;
  20061.  
  20062. extern template ostream & ostream :: _M_insert ( long long ) ;
  20063. extern template ostream & ostream :: _M_insert ( unsigned long long ) ;
  20064.  
  20065. extern template ostream & ostream :: _M_insert ( double ) ;
  20066. extern template ostream & ostream :: _M_insert ( long double ) ;
  20067. extern template ostream & ostream :: _M_insert ( const void * ) ;
  20068.  
  20069.  
  20070. extern template class basic_ostream < wchar_t > ;
  20071. extern template wostream & endl ( wostream & ) ;
  20072. extern template wostream & ends ( wostream & ) ;
  20073. extern template wostream & flush ( wostream & ) ;
  20074. extern template wostream & operator << ( wostream & , wchar_t ) ;
  20075. extern template wostream & operator << ( wostream & , char ) ;
  20076. extern template wostream & operator << ( wostream & , const wchar_t * ) ;
  20077. extern template wostream & operator << ( wostream & , const char * ) ;
  20078.  
  20079. extern template wostream & wostream :: _M_insert ( long ) ;
  20080. extern template wostream & wostream :: _M_insert ( unsigned long ) ;
  20081. extern template wostream & wostream :: _M_insert ( bool ) ;
  20082.  
  20083. extern template wostream & wostream :: _M_insert ( long long ) ;
  20084. extern template wostream & wostream :: _M_insert ( unsigned long long ) ;
  20085.  
  20086. extern template wostream & wostream :: _M_insert ( double ) ;
  20087. extern template wostream & wostream :: _M_insert ( long double ) ;
  20088. extern template wostream & wostream :: _M_insert ( const void * ) ;
  20089.  
  20090.  
  20091.  
  20092.  
  20093. }
  20094. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/istream"
  20095. #36
  20096. #pragma GCC system_header
  20097. #41
  20098. namespace std
  20099. {
  20100. #57
  20101. template < typename _CharT , typename _Traits >
  20102. class basic_istream : virtual public basic_ios < _CharT , _Traits >
  20103. {
  20104. public :
  20105.  
  20106. typedef _CharT char_type ;
  20107. typedef typename _Traits :: int_type int_type ;
  20108. typedef typename _Traits :: pos_type pos_type ;
  20109. typedef typename _Traits :: off_type off_type ;
  20110. typedef _Traits traits_type ;
  20111.  
  20112.  
  20113. typedef basic_streambuf < _CharT , _Traits > __streambuf_type ;
  20114. typedef basic_ios < _CharT , _Traits > __ios_type ;
  20115. typedef basic_istream < _CharT , _Traits > __istream_type ;
  20116. typedef num_get < _CharT , istreambuf_iterator < _CharT , _Traits > >
  20117. __num_get_type ;
  20118. typedef ctype < _CharT > __ctype_type ;
  20119.  
  20120. protected :
  20121.  
  20122.  
  20123.  
  20124.  
  20125.  
  20126. streamsize _M_gcount ;
  20127.  
  20128. public :
  20129. #92
  20130. explicit
  20131. basic_istream ( __streambuf_type * __sb )
  20132. : _M_gcount ( streamsize ( 0 ) )
  20133. { this -> init ( __sb ) ; }
  20134. #102
  20135. virtual
  20136. ~ basic_istream ( )
  20137. { _M_gcount = streamsize ( 0 ) ; }
  20138.  
  20139.  
  20140. class sentry ;
  20141. friend class sentry ;
  20142. #119
  20143. __istream_type &
  20144. operator >> ( __istream_type & ( * __pf ) ( __istream_type & ) )
  20145. { return __pf ( * this ) ; }
  20146.  
  20147. __istream_type &
  20148. operator >> ( __ios_type & ( * __pf ) ( __ios_type & ) )
  20149. {
  20150. __pf ( * this ) ;
  20151. return * this ;
  20152. }
  20153.  
  20154. __istream_type &
  20155. operator >> ( ios_base & ( * __pf ) ( ios_base & ) )
  20156. {
  20157. __pf ( * this ) ;
  20158. return * this ;
  20159. }
  20160. #167
  20161. __istream_type &
  20162. operator >> ( bool & __n )
  20163. { return _M_extract ( __n ) ; }
  20164.  
  20165. __istream_type &
  20166. operator >> ( short & __n ) ;
  20167.  
  20168. __istream_type &
  20169. operator >> ( unsigned short & __n )
  20170. { return _M_extract ( __n ) ; }
  20171.  
  20172. __istream_type &
  20173. operator >> ( int & __n ) ;
  20174.  
  20175. __istream_type &
  20176. operator >> ( unsigned int & __n )
  20177. { return _M_extract ( __n ) ; }
  20178.  
  20179. __istream_type &
  20180. operator >> ( long & __n )
  20181. { return _M_extract ( __n ) ; }
  20182.  
  20183. __istream_type &
  20184. operator >> ( unsigned long & __n )
  20185. { return _M_extract ( __n ) ; }
  20186.  
  20187.  
  20188. __istream_type &
  20189. operator >> ( long long & __n )
  20190. { return _M_extract ( __n ) ; }
  20191.  
  20192. __istream_type &
  20193. operator >> ( unsigned long long & __n )
  20194. { return _M_extract ( __n ) ; }
  20195. #213
  20196. __istream_type &
  20197. operator >> ( float & __f )
  20198. { return _M_extract ( __f ) ; }
  20199.  
  20200. __istream_type &
  20201. operator >> ( double & __f )
  20202. { return _M_extract ( __f ) ; }
  20203.  
  20204. __istream_type &
  20205. operator >> ( long double & __f )
  20206. { return _M_extract ( __f ) ; }
  20207. #234
  20208. __istream_type &
  20209. operator >> ( void * & __p )
  20210. { return _M_extract ( __p ) ; }
  20211. #258
  20212. __istream_type &
  20213. operator >> ( __streambuf_type * __sb ) ;
  20214. #268
  20215. streamsize
  20216. gcount ( ) const
  20217. { return _M_gcount ; }
  20218. #301
  20219. int_type
  20220. get ( ) ;
  20221. #315
  20222. __istream_type &
  20223. get ( char_type & __c ) ;
  20224. #342
  20225. __istream_type &
  20226. get ( char_type * __s , streamsize __n , char_type __delim ) ;
  20227. #353
  20228. __istream_type &
  20229. get ( char_type * __s , streamsize __n )
  20230. { return this -> get ( __s , __n , this -> widen ( '\n' ) ) ; }
  20231. #376
  20232. __istream_type &
  20233. get ( __streambuf_type & __sb , char_type __delim ) ;
  20234. #386
  20235. __istream_type &
  20236. get ( __streambuf_type & __sb )
  20237. { return this -> get ( __sb , this -> widen ( '\n' ) ) ; }
  20238. #415
  20239. __istream_type &
  20240. getline ( char_type * __s , streamsize __n , char_type __delim ) ;
  20241. #426
  20242. __istream_type &
  20243. getline ( char_type * __s , streamsize __n )
  20244. { return this -> getline ( __s , __n , this -> widen ( '\n' ) ) ; }
  20245. #450
  20246. __istream_type &
  20247. ignore ( streamsize __n , int_type __delim ) ;
  20248.  
  20249. __istream_type &
  20250. ignore ( streamsize __n ) ;
  20251.  
  20252. __istream_type &
  20253. ignore ( ) ;
  20254. #467
  20255. int_type
  20256. peek ( ) ;
  20257. #485
  20258. __istream_type &
  20259. read ( char_type * __s , streamsize __n ) ;
  20260. #504
  20261. streamsize
  20262. readsome ( char_type * __s , streamsize __n ) ;
  20263. #521
  20264. __istream_type &
  20265. putback ( char_type __c ) ;
  20266. #537
  20267. __istream_type &
  20268. unget ( ) ;
  20269. #555
  20270. int
  20271. sync ( ) ;
  20272. #570
  20273. pos_type
  20274. tellg ( ) ;
  20275. #585
  20276. __istream_type &
  20277. seekg ( pos_type ) ;
  20278. #601
  20279. __istream_type &
  20280. seekg ( off_type , ios_base :: seekdir ) ;
  20281.  
  20282.  
  20283. protected :
  20284. basic_istream ( )
  20285. : _M_gcount ( streamsize ( 0 ) )
  20286. { this -> init ( 0 ) ; }
  20287.  
  20288. template < typename _ValueT >
  20289. __istream_type &
  20290. _M_extract ( _ValueT & __v ) ;
  20291. } ;
  20292.  
  20293.  
  20294. template < >
  20295. basic_istream < char > &
  20296. basic_istream < char > ::
  20297. getline ( char_type * __s , streamsize __n , char_type __delim ) ;
  20298.  
  20299. template < >
  20300. basic_istream < char > &
  20301. basic_istream < char > ::
  20302. ignore ( streamsize __n ) ;
  20303.  
  20304. template < >
  20305. basic_istream < char > &
  20306. basic_istream < char > ::
  20307. ignore ( streamsize __n , int_type __delim ) ;
  20308.  
  20309.  
  20310. template < >
  20311. basic_istream < wchar_t > &
  20312. basic_istream < wchar_t > ::
  20313. getline ( char_type * __s , streamsize __n , char_type __delim ) ;
  20314.  
  20315. template < >
  20316. basic_istream < wchar_t > &
  20317. basic_istream < wchar_t > ::
  20318. ignore ( streamsize __n ) ;
  20319.  
  20320. template < >
  20321. basic_istream < wchar_t > &
  20322. basic_istream < wchar_t > ::
  20323. ignore ( streamsize __n , int_type __delim ) ;
  20324. #656
  20325. template < typename _CharT , typename _Traits >
  20326. class basic_istream < _CharT , _Traits > :: sentry
  20327. {
  20328.  
  20329. bool _M_ok ;
  20330.  
  20331. public :
  20332.  
  20333. typedef _Traits traits_type ;
  20334. typedef basic_streambuf < _CharT , _Traits > __streambuf_type ;
  20335. typedef basic_istream < _CharT , _Traits > __istream_type ;
  20336. typedef typename __istream_type :: __ctype_type __ctype_type ;
  20337. typedef typename _Traits :: int_type __int_type ;
  20338. #692
  20339. explicit
  20340. sentry ( basic_istream < _CharT , _Traits > & __is , bool __noskipws = false ) ;
  20341. #703
  20342. explicit
  20343.  
  20344. operator bool ( ) const
  20345. { return _M_ok ; }
  20346. } ;
  20347. #721
  20348. template < typename _CharT , typename _Traits >
  20349. basic_istream < _CharT , _Traits > &
  20350. operator >> ( basic_istream < _CharT , _Traits > & __in , _CharT & __c ) ;
  20351.  
  20352. template < class _Traits >
  20353. inline basic_istream < char , _Traits > &
  20354. operator >> ( basic_istream < char , _Traits > & __in , unsigned char & __c )
  20355. { return ( __in >> reinterpret_cast < char & > ( __c ) ) ; }
  20356.  
  20357. template < class _Traits >
  20358. inline basic_istream < char , _Traits > &
  20359. operator >> ( basic_istream < char , _Traits > & __in , signed char & __c )
  20360. { return ( __in >> reinterpret_cast < char & > ( __c ) ) ; }
  20361. #763
  20362. template < typename _CharT , typename _Traits >
  20363. basic_istream < _CharT , _Traits > &
  20364. operator >> ( basic_istream < _CharT , _Traits > & __in , _CharT * __s ) ;
  20365.  
  20366.  
  20367. template < >
  20368. basic_istream < char > &
  20369. operator >> ( basic_istream < char > & __in , char * __s ) ;
  20370.  
  20371. template < class _Traits >
  20372. inline basic_istream < char , _Traits > &
  20373. operator >> ( basic_istream < char , _Traits > & __in , unsigned char * __s )
  20374. { return ( __in >> reinterpret_cast < char * > ( __s ) ) ; }
  20375.  
  20376. template < class _Traits >
  20377. inline basic_istream < char , _Traits > &
  20378. operator >> ( basic_istream < char , _Traits > & __in , signed char * __s )
  20379. { return ( __in >> reinterpret_cast < char * > ( __s ) ) ; }
  20380. #794
  20381. template < typename _CharT , typename _Traits >
  20382. class basic_iostream
  20383. : public basic_istream < _CharT , _Traits > ,
  20384. public basic_ostream < _CharT , _Traits >
  20385. {
  20386. public :
  20387.  
  20388.  
  20389.  
  20390. typedef _CharT char_type ;
  20391. typedef typename _Traits :: int_type int_type ;
  20392. typedef typename _Traits :: pos_type pos_type ;
  20393. typedef typename _Traits :: off_type off_type ;
  20394. typedef _Traits traits_type ;
  20395.  
  20396.  
  20397. typedef basic_istream < _CharT , _Traits > __istream_type ;
  20398. typedef basic_ostream < _CharT , _Traits > __ostream_type ;
  20399. #819
  20400. explicit
  20401. basic_iostream ( basic_streambuf < _CharT , _Traits > * __sb )
  20402. : __istream_type ( __sb ) , __ostream_type ( __sb ) { }
  20403.  
  20404.  
  20405.  
  20406.  
  20407. virtual
  20408. ~ basic_iostream ( ) { }
  20409.  
  20410. protected :
  20411. basic_iostream ( )
  20412. : __istream_type ( ) , __ostream_type ( ) { }
  20413. } ;
  20414. #854
  20415. template < typename _CharT , typename _Traits >
  20416. basic_istream < _CharT , _Traits > &
  20417. ws ( basic_istream < _CharT , _Traits > & __is ) ;
  20418. #870
  20419. template < typename _CharT , typename _Traits , typename _Tp >
  20420. inline basic_istream < _CharT , _Traits > &
  20421. operator >> ( basic_istream < _CharT , _Traits > && __is , _Tp & __x )
  20422. { return ( __is >> __x ) ; }
  20423.  
  20424.  
  20425.  
  20426. }
  20427. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/istream.tcc"
  20428. #37
  20429. #pragma GCC system_header
  20430. #41
  20431. namespace std
  20432. {
  20433.  
  20434.  
  20435. template < typename _CharT , typename _Traits >
  20436. basic_istream < _CharT , _Traits > :: sentry ::
  20437. sentry ( basic_istream < _CharT , _Traits > & __in , bool __noskip ) : _M_ok ( false )
  20438. {
  20439. ios_base :: iostate __err = ios_base :: goodbit ;
  20440. if ( __in . good ( ) )
  20441. {
  20442. if ( __in . tie ( ) )
  20443. __in . tie ( ) -> flush ( ) ;
  20444. if ( ! __noskip && bool ( __in . flags ( ) & ios_base :: skipws ) )
  20445. {
  20446. const __int_type __eof = traits_type :: eof ( ) ;
  20447. __streambuf_type * __sb = __in . rdbuf ( ) ;
  20448. __int_type __c = __sb -> sgetc ( ) ;
  20449.  
  20450. const __ctype_type & __ct = __check_facet ( __in . _M_ctype ) ;
  20451. while ( ! traits_type :: eq_int_type ( __c , __eof )
  20452. && __ct . is ( ctype_base :: space ,
  20453. traits_type :: to_char_type ( __c ) ) )
  20454. __c = __sb -> snextc ( ) ;
  20455.  
  20456.  
  20457.  
  20458.  
  20459. if ( traits_type :: eq_int_type ( __c , __eof ) )
  20460. __err |= ios_base :: eofbit ;
  20461. }
  20462. }
  20463.  
  20464. if ( __in . good ( ) && __err == ios_base :: goodbit )
  20465. _M_ok = true ;
  20466. else
  20467. {
  20468. __err |= ios_base :: failbit ;
  20469. __in . setstate ( __err ) ;
  20470. }
  20471. }
  20472.  
  20473. template < typename _CharT , typename _Traits >
  20474. template < typename _ValueT >
  20475. basic_istream < _CharT , _Traits > &
  20476. basic_istream < _CharT , _Traits > ::
  20477. _M_extract ( _ValueT & __v )
  20478. {
  20479. sentry __cerb ( * this , false ) ;
  20480. if ( __cerb )
  20481. {
  20482. ios_base :: iostate __err = ios_base :: goodbit ;
  20483. try
  20484. {
  20485. const __num_get_type & __ng = __check_facet ( this -> _M_num_get ) ;
  20486. __ng . get ( * this , 0 , * this , __err , __v ) ;
  20487. }
  20488. catch ( __cxxabiv1 :: __forced_unwind & )
  20489. {
  20490. this -> _M_setstate ( ios_base :: badbit ) ;
  20491. throw ;
  20492. }
  20493. catch ( ... )
  20494. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20495. if ( __err )
  20496. this -> setstate ( __err ) ;
  20497. }
  20498. return * this ;
  20499. }
  20500.  
  20501. template < typename _CharT , typename _Traits >
  20502. basic_istream < _CharT , _Traits > &
  20503. basic_istream < _CharT , _Traits > ::
  20504. operator >> ( short & __n )
  20505. {
  20506.  
  20507.  
  20508. sentry __cerb ( * this , false ) ;
  20509. if ( __cerb )
  20510. {
  20511. ios_base :: iostate __err = ios_base :: goodbit ;
  20512. try
  20513. {
  20514. long __l ;
  20515. const __num_get_type & __ng = __check_facet ( this -> _M_num_get ) ;
  20516. __ng . get ( * this , 0 , * this , __err , __l ) ;
  20517.  
  20518.  
  20519.  
  20520. if ( __l < __gnu_cxx :: __numeric_traits < short > :: __min )
  20521. {
  20522. __err |= ios_base :: failbit ;
  20523. __n = __gnu_cxx :: __numeric_traits < short > :: __min ;
  20524. }
  20525. else if ( __l > __gnu_cxx :: __numeric_traits < short > :: __max )
  20526. {
  20527. __err |= ios_base :: failbit ;
  20528. __n = __gnu_cxx :: __numeric_traits < short > :: __max ;
  20529. }
  20530. else
  20531. __n = short ( __l ) ;
  20532. }
  20533. catch ( __cxxabiv1 :: __forced_unwind & )
  20534. {
  20535. this -> _M_setstate ( ios_base :: badbit ) ;
  20536. throw ;
  20537. }
  20538. catch ( ... )
  20539. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20540. if ( __err )
  20541. this -> setstate ( __err ) ;
  20542. }
  20543. return * this ;
  20544. }
  20545.  
  20546. template < typename _CharT , typename _Traits >
  20547. basic_istream < _CharT , _Traits > &
  20548. basic_istream < _CharT , _Traits > ::
  20549. operator >> ( int & __n )
  20550. {
  20551.  
  20552.  
  20553. sentry __cerb ( * this , false ) ;
  20554. if ( __cerb )
  20555. {
  20556. ios_base :: iostate __err = ios_base :: goodbit ;
  20557. try
  20558. {
  20559. long __l ;
  20560. const __num_get_type & __ng = __check_facet ( this -> _M_num_get ) ;
  20561. __ng . get ( * this , 0 , * this , __err , __l ) ;
  20562.  
  20563.  
  20564.  
  20565. if ( __l < __gnu_cxx :: __numeric_traits < int > :: __min )
  20566. {
  20567. __err |= ios_base :: failbit ;
  20568. __n = __gnu_cxx :: __numeric_traits < int > :: __min ;
  20569. }
  20570. else if ( __l > __gnu_cxx :: __numeric_traits < int > :: __max )
  20571. {
  20572. __err |= ios_base :: failbit ;
  20573. __n = __gnu_cxx :: __numeric_traits < int > :: __max ;
  20574. }
  20575. else
  20576. __n = int ( __l ) ;
  20577. }
  20578. catch ( __cxxabiv1 :: __forced_unwind & )
  20579. {
  20580. this -> _M_setstate ( ios_base :: badbit ) ;
  20581. throw ;
  20582. }
  20583. catch ( ... )
  20584. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20585. if ( __err )
  20586. this -> setstate ( __err ) ;
  20587. }
  20588. return * this ;
  20589. }
  20590.  
  20591. template < typename _CharT , typename _Traits >
  20592. basic_istream < _CharT , _Traits > &
  20593. basic_istream < _CharT , _Traits > ::
  20594. operator >> ( __streambuf_type * __sbout )
  20595. {
  20596. ios_base :: iostate __err = ios_base :: goodbit ;
  20597. sentry __cerb ( * this , false ) ;
  20598. if ( __cerb && __sbout )
  20599. {
  20600. try
  20601. {
  20602. bool __ineof ;
  20603. if ( ! __copy_streambufs_eof ( this -> rdbuf ( ) , __sbout , __ineof ) )
  20604. __err |= ios_base :: failbit ;
  20605. if ( __ineof )
  20606. __err |= ios_base :: eofbit ;
  20607. }
  20608. catch ( __cxxabiv1 :: __forced_unwind & )
  20609. {
  20610. this -> _M_setstate ( ios_base :: failbit ) ;
  20611. throw ;
  20612. }
  20613. catch ( ... )
  20614. { this -> _M_setstate ( ios_base :: failbit ) ; }
  20615. }
  20616. else if ( ! __sbout )
  20617. __err |= ios_base :: failbit ;
  20618. if ( __err )
  20619. this -> setstate ( __err ) ;
  20620. return * this ;
  20621. }
  20622.  
  20623. template < typename _CharT , typename _Traits >
  20624. typename basic_istream < _CharT , _Traits > :: int_type
  20625. basic_istream < _CharT , _Traits > ::
  20626. get ( void )
  20627. {
  20628. const int_type __eof = traits_type :: eof ( ) ;
  20629. int_type __c = __eof ;
  20630. _M_gcount = 0 ;
  20631. ios_base :: iostate __err = ios_base :: goodbit ;
  20632. sentry __cerb ( * this , true ) ;
  20633. if ( __cerb )
  20634. {
  20635. try
  20636. {
  20637. __c = this -> rdbuf ( ) -> sbumpc ( ) ;
  20638.  
  20639. if ( ! traits_type :: eq_int_type ( __c , __eof ) )
  20640. _M_gcount = 1 ;
  20641. else
  20642. __err |= ios_base :: eofbit ;
  20643. }
  20644. catch ( __cxxabiv1 :: __forced_unwind & )
  20645. {
  20646. this -> _M_setstate ( ios_base :: badbit ) ;
  20647. throw ;
  20648. }
  20649. catch ( ... )
  20650. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20651. }
  20652. if ( ! _M_gcount )
  20653. __err |= ios_base :: failbit ;
  20654. if ( __err )
  20655. this -> setstate ( __err ) ;
  20656. return __c ;
  20657. }
  20658.  
  20659. template < typename _CharT , typename _Traits >
  20660. basic_istream < _CharT , _Traits > &
  20661. basic_istream < _CharT , _Traits > ::
  20662. get ( char_type & __c )
  20663. {
  20664. _M_gcount = 0 ;
  20665. ios_base :: iostate __err = ios_base :: goodbit ;
  20666. sentry __cerb ( * this , true ) ;
  20667. if ( __cerb )
  20668. {
  20669. try
  20670. {
  20671. const int_type __cb = this -> rdbuf ( ) -> sbumpc ( ) ;
  20672.  
  20673. if ( ! traits_type :: eq_int_type ( __cb , traits_type :: eof ( ) ) )
  20674. {
  20675. _M_gcount = 1 ;
  20676. __c = traits_type :: to_char_type ( __cb ) ;
  20677. }
  20678. else
  20679. __err |= ios_base :: eofbit ;
  20680. }
  20681. catch ( __cxxabiv1 :: __forced_unwind & )
  20682. {
  20683. this -> _M_setstate ( ios_base :: badbit ) ;
  20684. throw ;
  20685. }
  20686. catch ( ... )
  20687. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20688. }
  20689. if ( ! _M_gcount )
  20690. __err |= ios_base :: failbit ;
  20691. if ( __err )
  20692. this -> setstate ( __err ) ;
  20693. return * this ;
  20694. }
  20695.  
  20696. template < typename _CharT , typename _Traits >
  20697. basic_istream < _CharT , _Traits > &
  20698. basic_istream < _CharT , _Traits > ::
  20699. get ( char_type * __s , streamsize __n , char_type __delim )
  20700. {
  20701. _M_gcount = 0 ;
  20702. ios_base :: iostate __err = ios_base :: goodbit ;
  20703. sentry __cerb ( * this , true ) ;
  20704. if ( __cerb )
  20705. {
  20706. try
  20707. {
  20708. const int_type __idelim = traits_type :: to_int_type ( __delim ) ;
  20709. const int_type __eof = traits_type :: eof ( ) ;
  20710. __streambuf_type * __sb = this -> rdbuf ( ) ;
  20711. int_type __c = __sb -> sgetc ( ) ;
  20712.  
  20713. while ( _M_gcount + 1 < __n
  20714. && ! traits_type :: eq_int_type ( __c , __eof )
  20715. && ! traits_type :: eq_int_type ( __c , __idelim ) )
  20716. {
  20717. * __s ++ = traits_type :: to_char_type ( __c ) ;
  20718. ++ _M_gcount ;
  20719. __c = __sb -> snextc ( ) ;
  20720. }
  20721. if ( traits_type :: eq_int_type ( __c , __eof ) )
  20722. __err |= ios_base :: eofbit ;
  20723. }
  20724. catch ( __cxxabiv1 :: __forced_unwind & )
  20725. {
  20726. this -> _M_setstate ( ios_base :: badbit ) ;
  20727. throw ;
  20728. }
  20729. catch ( ... )
  20730. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20731. }
  20732.  
  20733.  
  20734. if ( __n > 0 )
  20735. * __s = char_type ( ) ;
  20736. if ( ! _M_gcount )
  20737. __err |= ios_base :: failbit ;
  20738. if ( __err )
  20739. this -> setstate ( __err ) ;
  20740. return * this ;
  20741. }
  20742.  
  20743. template < typename _CharT , typename _Traits >
  20744. basic_istream < _CharT , _Traits > &
  20745. basic_istream < _CharT , _Traits > ::
  20746. get ( __streambuf_type & __sb , char_type __delim )
  20747. {
  20748. _M_gcount = 0 ;
  20749. ios_base :: iostate __err = ios_base :: goodbit ;
  20750. sentry __cerb ( * this , true ) ;
  20751. if ( __cerb )
  20752. {
  20753. try
  20754. {
  20755. const int_type __idelim = traits_type :: to_int_type ( __delim ) ;
  20756. const int_type __eof = traits_type :: eof ( ) ;
  20757. __streambuf_type * __this_sb = this -> rdbuf ( ) ;
  20758. int_type __c = __this_sb -> sgetc ( ) ;
  20759. char_type __c2 = traits_type :: to_char_type ( __c ) ;
  20760.  
  20761. while ( ! traits_type :: eq_int_type ( __c , __eof )
  20762. && ! traits_type :: eq_int_type ( __c , __idelim )
  20763. && ! traits_type :: eq_int_type ( __sb . sputc ( __c2 ) , __eof ) )
  20764. {
  20765. ++ _M_gcount ;
  20766. __c = __this_sb -> snextc ( ) ;
  20767. __c2 = traits_type :: to_char_type ( __c ) ;
  20768. }
  20769. if ( traits_type :: eq_int_type ( __c , __eof ) )
  20770. __err |= ios_base :: eofbit ;
  20771. }
  20772. catch ( __cxxabiv1 :: __forced_unwind & )
  20773. {
  20774. this -> _M_setstate ( ios_base :: badbit ) ;
  20775. throw ;
  20776. }
  20777. catch ( ... )
  20778. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20779. }
  20780. if ( ! _M_gcount )
  20781. __err |= ios_base :: failbit ;
  20782. if ( __err )
  20783. this -> setstate ( __err ) ;
  20784. return * this ;
  20785. }
  20786.  
  20787. template < typename _CharT , typename _Traits >
  20788. basic_istream < _CharT , _Traits > &
  20789. basic_istream < _CharT , _Traits > ::
  20790. getline ( char_type * __s , streamsize __n , char_type __delim )
  20791. {
  20792. _M_gcount = 0 ;
  20793. ios_base :: iostate __err = ios_base :: goodbit ;
  20794. sentry __cerb ( * this , true ) ;
  20795. if ( __cerb )
  20796. {
  20797. try
  20798. {
  20799. const int_type __idelim = traits_type :: to_int_type ( __delim ) ;
  20800. const int_type __eof = traits_type :: eof ( ) ;
  20801. __streambuf_type * __sb = this -> rdbuf ( ) ;
  20802. int_type __c = __sb -> sgetc ( ) ;
  20803.  
  20804. while ( _M_gcount + 1 < __n
  20805. && ! traits_type :: eq_int_type ( __c , __eof )
  20806. && ! traits_type :: eq_int_type ( __c , __idelim ) )
  20807. {
  20808. * __s ++ = traits_type :: to_char_type ( __c ) ;
  20809. __c = __sb -> snextc ( ) ;
  20810. ++ _M_gcount ;
  20811. }
  20812. if ( traits_type :: eq_int_type ( __c , __eof ) )
  20813. __err |= ios_base :: eofbit ;
  20814. else
  20815. {
  20816. if ( traits_type :: eq_int_type ( __c , __idelim ) )
  20817. {
  20818. __sb -> sbumpc ( ) ;
  20819. ++ _M_gcount ;
  20820. }
  20821. else
  20822. __err |= ios_base :: failbit ;
  20823. }
  20824. }
  20825. catch ( __cxxabiv1 :: __forced_unwind & )
  20826. {
  20827. this -> _M_setstate ( ios_base :: badbit ) ;
  20828. throw ;
  20829. }
  20830. catch ( ... )
  20831. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20832. }
  20833.  
  20834.  
  20835. if ( __n > 0 )
  20836. * __s = char_type ( ) ;
  20837. if ( ! _M_gcount )
  20838. __err |= ios_base :: failbit ;
  20839. if ( __err )
  20840. this -> setstate ( __err ) ;
  20841. return * this ;
  20842. }
  20843.  
  20844.  
  20845.  
  20846.  
  20847. template < typename _CharT , typename _Traits >
  20848. basic_istream < _CharT , _Traits > &
  20849. basic_istream < _CharT , _Traits > ::
  20850. ignore ( void )
  20851. {
  20852. _M_gcount = 0 ;
  20853. sentry __cerb ( * this , true ) ;
  20854. if ( __cerb )
  20855. {
  20856. ios_base :: iostate __err = ios_base :: goodbit ;
  20857. try
  20858. {
  20859. const int_type __eof = traits_type :: eof ( ) ;
  20860. __streambuf_type * __sb = this -> rdbuf ( ) ;
  20861.  
  20862. if ( traits_type :: eq_int_type ( __sb -> sbumpc ( ) , __eof ) )
  20863. __err |= ios_base :: eofbit ;
  20864. else
  20865. _M_gcount = 1 ;
  20866. }
  20867. catch ( __cxxabiv1 :: __forced_unwind & )
  20868. {
  20869. this -> _M_setstate ( ios_base :: badbit ) ;
  20870. throw ;
  20871. }
  20872. catch ( ... )
  20873. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20874. if ( __err )
  20875. this -> setstate ( __err ) ;
  20876. }
  20877. return * this ;
  20878. }
  20879.  
  20880. template < typename _CharT , typename _Traits >
  20881. basic_istream < _CharT , _Traits > &
  20882. basic_istream < _CharT , _Traits > ::
  20883. ignore ( streamsize __n )
  20884. {
  20885. _M_gcount = 0 ;
  20886. sentry __cerb ( * this , true ) ;
  20887. if ( __cerb && __n > 0 )
  20888. {
  20889. ios_base :: iostate __err = ios_base :: goodbit ;
  20890. try
  20891. {
  20892. const int_type __eof = traits_type :: eof ( ) ;
  20893. __streambuf_type * __sb = this -> rdbuf ( ) ;
  20894. int_type __c = __sb -> sgetc ( ) ;
  20895. #513
  20896. bool __large_ignore = false ;
  20897. while ( true )
  20898. {
  20899. while ( _M_gcount < __n
  20900. && ! traits_type :: eq_int_type ( __c , __eof ) )
  20901. {
  20902. ++ _M_gcount ;
  20903. __c = __sb -> snextc ( ) ;
  20904. }
  20905. if ( __n == __gnu_cxx :: __numeric_traits < streamsize > :: __max
  20906. && ! traits_type :: eq_int_type ( __c , __eof ) )
  20907. {
  20908. _M_gcount =
  20909. __gnu_cxx :: __numeric_traits < streamsize > :: __min ;
  20910. __large_ignore = true ;
  20911. }
  20912. else
  20913. break ;
  20914. }
  20915.  
  20916. if ( __large_ignore )
  20917. _M_gcount = __gnu_cxx :: __numeric_traits < streamsize > :: __max ;
  20918.  
  20919. if ( traits_type :: eq_int_type ( __c , __eof ) )
  20920. __err |= ios_base :: eofbit ;
  20921. }
  20922. catch ( __cxxabiv1 :: __forced_unwind & )
  20923. {
  20924. this -> _M_setstate ( ios_base :: badbit ) ;
  20925. throw ;
  20926. }
  20927. catch ( ... )
  20928. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20929. if ( __err )
  20930. this -> setstate ( __err ) ;
  20931. }
  20932. return * this ;
  20933. }
  20934.  
  20935. template < typename _CharT , typename _Traits >
  20936. basic_istream < _CharT , _Traits > &
  20937. basic_istream < _CharT , _Traits > ::
  20938. ignore ( streamsize __n , int_type __delim )
  20939. {
  20940. _M_gcount = 0 ;
  20941. sentry __cerb ( * this , true ) ;
  20942. if ( __cerb && __n > 0 )
  20943. {
  20944. ios_base :: iostate __err = ios_base :: goodbit ;
  20945. try
  20946. {
  20947. const int_type __eof = traits_type :: eof ( ) ;
  20948. __streambuf_type * __sb = this -> rdbuf ( ) ;
  20949. int_type __c = __sb -> sgetc ( ) ;
  20950.  
  20951.  
  20952. bool __large_ignore = false ;
  20953. while ( true )
  20954. {
  20955. while ( _M_gcount < __n
  20956. && ! traits_type :: eq_int_type ( __c , __eof )
  20957. && ! traits_type :: eq_int_type ( __c , __delim ) )
  20958. {
  20959. ++ _M_gcount ;
  20960. __c = __sb -> snextc ( ) ;
  20961. }
  20962. if ( __n == __gnu_cxx :: __numeric_traits < streamsize > :: __max
  20963. && ! traits_type :: eq_int_type ( __c , __eof )
  20964. && ! traits_type :: eq_int_type ( __c , __delim ) )
  20965. {
  20966. _M_gcount =
  20967. __gnu_cxx :: __numeric_traits < streamsize > :: __min ;
  20968. __large_ignore = true ;
  20969. }
  20970. else
  20971. break ;
  20972. }
  20973.  
  20974. if ( __large_ignore )
  20975. _M_gcount = __gnu_cxx :: __numeric_traits < streamsize > :: __max ;
  20976.  
  20977. if ( traits_type :: eq_int_type ( __c , __eof ) )
  20978. __err |= ios_base :: eofbit ;
  20979. else if ( traits_type :: eq_int_type ( __c , __delim ) )
  20980. {
  20981. if ( _M_gcount
  20982. < __gnu_cxx :: __numeric_traits < streamsize > :: __max )
  20983. ++ _M_gcount ;
  20984. __sb -> sbumpc ( ) ;
  20985. }
  20986. }
  20987. catch ( __cxxabiv1 :: __forced_unwind & )
  20988. {
  20989. this -> _M_setstate ( ios_base :: badbit ) ;
  20990. throw ;
  20991. }
  20992. catch ( ... )
  20993. { this -> _M_setstate ( ios_base :: badbit ) ; }
  20994. if ( __err )
  20995. this -> setstate ( __err ) ;
  20996. }
  20997. return * this ;
  20998. }
  20999.  
  21000. template < typename _CharT , typename _Traits >
  21001. typename basic_istream < _CharT , _Traits > :: int_type
  21002. basic_istream < _CharT , _Traits > ::
  21003. peek ( void )
  21004. {
  21005. int_type __c = traits_type :: eof ( ) ;
  21006. _M_gcount = 0 ;
  21007. sentry __cerb ( * this , true ) ;
  21008. if ( __cerb )
  21009. {
  21010. ios_base :: iostate __err = ios_base :: goodbit ;
  21011. try
  21012. {
  21013. __c = this -> rdbuf ( ) -> sgetc ( ) ;
  21014. if ( traits_type :: eq_int_type ( __c , traits_type :: eof ( ) ) )
  21015. __err |= ios_base :: eofbit ;
  21016. }
  21017. catch ( __cxxabiv1 :: __forced_unwind & )
  21018. {
  21019. this -> _M_setstate ( ios_base :: badbit ) ;
  21020. throw ;
  21021. }
  21022. catch ( ... )
  21023. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21024. if ( __err )
  21025. this -> setstate ( __err ) ;
  21026. }
  21027. return __c ;
  21028. }
  21029.  
  21030. template < typename _CharT , typename _Traits >
  21031. basic_istream < _CharT , _Traits > &
  21032. basic_istream < _CharT , _Traits > ::
  21033. read ( char_type * __s , streamsize __n )
  21034. {
  21035. _M_gcount = 0 ;
  21036. sentry __cerb ( * this , true ) ;
  21037. if ( __cerb )
  21038. {
  21039. ios_base :: iostate __err = ios_base :: goodbit ;
  21040. try
  21041. {
  21042. _M_gcount = this -> rdbuf ( ) -> sgetn ( __s , __n ) ;
  21043. if ( _M_gcount != __n )
  21044. __err |= ( ios_base :: eofbit | ios_base :: failbit ) ;
  21045. }
  21046. catch ( __cxxabiv1 :: __forced_unwind & )
  21047. {
  21048. this -> _M_setstate ( ios_base :: badbit ) ;
  21049. throw ;
  21050. }
  21051. catch ( ... )
  21052. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21053. if ( __err )
  21054. this -> setstate ( __err ) ;
  21055. }
  21056. return * this ;
  21057. }
  21058.  
  21059. template < typename _CharT , typename _Traits >
  21060. streamsize
  21061. basic_istream < _CharT , _Traits > ::
  21062. readsome ( char_type * __s , streamsize __n )
  21063. {
  21064. _M_gcount = 0 ;
  21065. sentry __cerb ( * this , true ) ;
  21066. if ( __cerb )
  21067. {
  21068. ios_base :: iostate __err = ios_base :: goodbit ;
  21069. try
  21070. {
  21071.  
  21072. const streamsize __num = this -> rdbuf ( ) -> in_avail ( ) ;
  21073. if ( __num > 0 )
  21074. _M_gcount = this -> rdbuf ( ) -> sgetn ( __s , std :: min ( __num , __n ) ) ;
  21075. else if ( __num == - 1 )
  21076. __err |= ios_base :: eofbit ;
  21077. }
  21078. catch ( __cxxabiv1 :: __forced_unwind & )
  21079. {
  21080. this -> _M_setstate ( ios_base :: badbit ) ;
  21081. throw ;
  21082. }
  21083. catch ( ... )
  21084. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21085. if ( __err )
  21086. this -> setstate ( __err ) ;
  21087. }
  21088. return _M_gcount ;
  21089. }
  21090.  
  21091. template < typename _CharT , typename _Traits >
  21092. basic_istream < _CharT , _Traits > &
  21093. basic_istream < _CharT , _Traits > ::
  21094. putback ( char_type __c )
  21095. {
  21096.  
  21097.  
  21098. _M_gcount = 0 ;
  21099.  
  21100. this -> clear ( this -> rdstate ( ) & ~ ios_base :: eofbit ) ;
  21101. sentry __cerb ( * this , true ) ;
  21102. if ( __cerb )
  21103. {
  21104. ios_base :: iostate __err = ios_base :: goodbit ;
  21105. try
  21106. {
  21107. const int_type __eof = traits_type :: eof ( ) ;
  21108. __streambuf_type * __sb = this -> rdbuf ( ) ;
  21109. if ( ! __sb
  21110. || traits_type :: eq_int_type ( __sb -> sputbackc ( __c ) , __eof ) )
  21111. __err |= ios_base :: badbit ;
  21112. }
  21113. catch ( __cxxabiv1 :: __forced_unwind & )
  21114. {
  21115. this -> _M_setstate ( ios_base :: badbit ) ;
  21116. throw ;
  21117. }
  21118. catch ( ... )
  21119. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21120. if ( __err )
  21121. this -> setstate ( __err ) ;
  21122. }
  21123. return * this ;
  21124. }
  21125.  
  21126. template < typename _CharT , typename _Traits >
  21127. basic_istream < _CharT , _Traits > &
  21128. basic_istream < _CharT , _Traits > ::
  21129. unget ( void )
  21130. {
  21131.  
  21132.  
  21133. _M_gcount = 0 ;
  21134.  
  21135. this -> clear ( this -> rdstate ( ) & ~ ios_base :: eofbit ) ;
  21136. sentry __cerb ( * this , true ) ;
  21137. if ( __cerb )
  21138. {
  21139. ios_base :: iostate __err = ios_base :: goodbit ;
  21140. try
  21141. {
  21142. const int_type __eof = traits_type :: eof ( ) ;
  21143. __streambuf_type * __sb = this -> rdbuf ( ) ;
  21144. if ( ! __sb
  21145. || traits_type :: eq_int_type ( __sb -> sungetc ( ) , __eof ) )
  21146. __err |= ios_base :: badbit ;
  21147. }
  21148. catch ( __cxxabiv1 :: __forced_unwind & )
  21149. {
  21150. this -> _M_setstate ( ios_base :: badbit ) ;
  21151. throw ;
  21152. }
  21153. catch ( ... )
  21154. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21155. if ( __err )
  21156. this -> setstate ( __err ) ;
  21157. }
  21158. return * this ;
  21159. }
  21160.  
  21161. template < typename _CharT , typename _Traits >
  21162. int
  21163. basic_istream < _CharT , _Traits > ::
  21164. sync ( void )
  21165. {
  21166.  
  21167.  
  21168. int __ret = - 1 ;
  21169. sentry __cerb ( * this , true ) ;
  21170. if ( __cerb )
  21171. {
  21172. ios_base :: iostate __err = ios_base :: goodbit ;
  21173. try
  21174. {
  21175. __streambuf_type * __sb = this -> rdbuf ( ) ;
  21176. if ( __sb )
  21177. {
  21178. if ( __sb -> pubsync ( ) == - 1 )
  21179. __err |= ios_base :: badbit ;
  21180. else
  21181. __ret = 0 ;
  21182. }
  21183. }
  21184. catch ( __cxxabiv1 :: __forced_unwind & )
  21185. {
  21186. this -> _M_setstate ( ios_base :: badbit ) ;
  21187. throw ;
  21188. }
  21189. catch ( ... )
  21190. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21191. if ( __err )
  21192. this -> setstate ( __err ) ;
  21193. }
  21194. return __ret ;
  21195. }
  21196.  
  21197. template < typename _CharT , typename _Traits >
  21198. typename basic_istream < _CharT , _Traits > :: pos_type
  21199. basic_istream < _CharT , _Traits > ::
  21200. tellg ( void )
  21201. {
  21202.  
  21203.  
  21204. pos_type __ret = pos_type ( - 1 ) ;
  21205. sentry __cerb ( * this , true ) ;
  21206. if ( __cerb )
  21207. {
  21208. try
  21209. {
  21210. if ( ! this -> fail ( ) )
  21211. __ret = this -> rdbuf ( ) -> pubseekoff ( 0 , ios_base :: cur ,
  21212. ios_base :: in ) ;
  21213. }
  21214. catch ( __cxxabiv1 :: __forced_unwind & )
  21215. {
  21216. this -> _M_setstate ( ios_base :: badbit ) ;
  21217. throw ;
  21218. }
  21219. catch ( ... )
  21220. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21221. }
  21222. return __ret ;
  21223. }
  21224.  
  21225. template < typename _CharT , typename _Traits >
  21226. basic_istream < _CharT , _Traits > &
  21227. basic_istream < _CharT , _Traits > ::
  21228. seekg ( pos_type __pos )
  21229. {
  21230.  
  21231.  
  21232.  
  21233. this -> clear ( this -> rdstate ( ) & ~ ios_base :: eofbit ) ;
  21234. sentry __cerb ( * this , true ) ;
  21235. if ( __cerb )
  21236. {
  21237. ios_base :: iostate __err = ios_base :: goodbit ;
  21238. try
  21239. {
  21240. if ( ! this -> fail ( ) )
  21241. {
  21242.  
  21243. const pos_type __p = this -> rdbuf ( ) -> pubseekpos ( __pos ,
  21244. ios_base :: in ) ;
  21245.  
  21246.  
  21247. if ( __p == pos_type ( off_type ( - 1 ) ) )
  21248. __err |= ios_base :: failbit ;
  21249. }
  21250. }
  21251. catch ( __cxxabiv1 :: __forced_unwind & )
  21252. {
  21253. this -> _M_setstate ( ios_base :: badbit ) ;
  21254. throw ;
  21255. }
  21256. catch ( ... )
  21257. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21258. if ( __err )
  21259. this -> setstate ( __err ) ;
  21260. }
  21261. return * this ;
  21262. }
  21263.  
  21264. template < typename _CharT , typename _Traits >
  21265. basic_istream < _CharT , _Traits > &
  21266. basic_istream < _CharT , _Traits > ::
  21267. seekg ( off_type __off , ios_base :: seekdir __dir )
  21268. {
  21269.  
  21270.  
  21271.  
  21272. this -> clear ( this -> rdstate ( ) & ~ ios_base :: eofbit ) ;
  21273. sentry __cerb ( * this , true ) ;
  21274. if ( __cerb )
  21275. {
  21276. ios_base :: iostate __err = ios_base :: goodbit ;
  21277. try
  21278. {
  21279. if ( ! this -> fail ( ) )
  21280. {
  21281.  
  21282. const pos_type __p = this -> rdbuf ( ) -> pubseekoff ( __off , __dir ,
  21283. ios_base :: in ) ;
  21284.  
  21285.  
  21286. if ( __p == pos_type ( off_type ( - 1 ) ) )
  21287. __err |= ios_base :: failbit ;
  21288. }
  21289. }
  21290. catch ( __cxxabiv1 :: __forced_unwind & )
  21291. {
  21292. this -> _M_setstate ( ios_base :: badbit ) ;
  21293. throw ;
  21294. }
  21295. catch ( ... )
  21296. { this -> _M_setstate ( ios_base :: badbit ) ; }
  21297. if ( __err )
  21298. this -> setstate ( __err ) ;
  21299. }
  21300. return * this ;
  21301. }
  21302.  
  21303.  
  21304. template < typename _CharT , typename _Traits >
  21305. basic_istream < _CharT , _Traits > &
  21306. operator >> ( basic_istream < _CharT , _Traits > & __in , _CharT & __c )
  21307. {
  21308. typedef basic_istream < _CharT , _Traits > __istream_type ;
  21309. typedef typename __istream_type :: int_type __int_type ;
  21310.  
  21311. typename __istream_type :: sentry __cerb ( __in , false ) ;
  21312. if ( __cerb )
  21313. {
  21314. ios_base :: iostate __err = ios_base :: goodbit ;
  21315. try
  21316. {
  21317. const __int_type __cb = __in . rdbuf ( ) -> sbumpc ( ) ;
  21318. if ( ! _Traits :: eq_int_type ( __cb , _Traits :: eof ( ) ) )
  21319. __c = _Traits :: to_char_type ( __cb ) ;
  21320. else
  21321. __err |= ( ios_base :: eofbit | ios_base :: failbit ) ;
  21322. }
  21323. catch ( __cxxabiv1 :: __forced_unwind & )
  21324. {
  21325. __in . _M_setstate ( ios_base :: badbit ) ;
  21326. throw ;
  21327. }
  21328. catch ( ... )
  21329. { __in . _M_setstate ( ios_base :: badbit ) ; }
  21330. if ( __err )
  21331. __in . setstate ( __err ) ;
  21332. }
  21333. return __in ;
  21334. }
  21335.  
  21336. template < typename _CharT , typename _Traits >
  21337. basic_istream < _CharT , _Traits > &
  21338. operator >> ( basic_istream < _CharT , _Traits > & __in , _CharT * __s )
  21339. {
  21340. typedef basic_istream < _CharT , _Traits > __istream_type ;
  21341. typedef basic_streambuf < _CharT , _Traits > __streambuf_type ;
  21342. typedef typename _Traits :: int_type int_type ;
  21343. typedef _CharT char_type ;
  21344. typedef ctype < _CharT > __ctype_type ;
  21345.  
  21346. streamsize __extracted = 0 ;
  21347. ios_base :: iostate __err = ios_base :: goodbit ;
  21348. typename __istream_type :: sentry __cerb ( __in , false ) ;
  21349. if ( __cerb )
  21350. {
  21351. try
  21352. {
  21353.  
  21354. streamsize __num = __in . width ( ) ;
  21355. if ( __num <= 0 )
  21356. __num = __gnu_cxx :: __numeric_traits < streamsize > :: __max ;
  21357.  
  21358. const __ctype_type & __ct = use_facet < __ctype_type > ( __in . getloc ( ) ) ;
  21359.  
  21360. const int_type __eof = _Traits :: eof ( ) ;
  21361. __streambuf_type * __sb = __in . rdbuf ( ) ;
  21362. int_type __c = __sb -> sgetc ( ) ;
  21363.  
  21364. while ( __extracted < __num - 1
  21365. && ! _Traits :: eq_int_type ( __c , __eof )
  21366. && ! __ct . is ( ctype_base :: space ,
  21367. _Traits :: to_char_type ( __c ) ) )
  21368. {
  21369. * __s ++ = _Traits :: to_char_type ( __c ) ;
  21370. ++ __extracted ;
  21371. __c = __sb -> snextc ( ) ;
  21372. }
  21373. if ( _Traits :: eq_int_type ( __c , __eof ) )
  21374. __err |= ios_base :: eofbit ;
  21375.  
  21376.  
  21377.  
  21378. * __s = char_type ( ) ;
  21379. __in . width ( 0 ) ;
  21380. }
  21381. catch ( __cxxabiv1 :: __forced_unwind & )
  21382. {
  21383. __in . _M_setstate ( ios_base :: badbit ) ;
  21384. throw ;
  21385. }
  21386. catch ( ... )
  21387. { __in . _M_setstate ( ios_base :: badbit ) ; }
  21388. }
  21389. if ( ! __extracted )
  21390. __err |= ios_base :: failbit ;
  21391. if ( __err )
  21392. __in . setstate ( __err ) ;
  21393. return __in ;
  21394. }
  21395.  
  21396.  
  21397. template < typename _CharT , typename _Traits >
  21398. basic_istream < _CharT , _Traits > &
  21399. ws ( basic_istream < _CharT , _Traits > & __in )
  21400. {
  21401. typedef basic_istream < _CharT , _Traits > __istream_type ;
  21402. typedef basic_streambuf < _CharT , _Traits > __streambuf_type ;
  21403. typedef typename __istream_type :: int_type __int_type ;
  21404. typedef ctype < _CharT > __ctype_type ;
  21405.  
  21406. const __ctype_type & __ct = use_facet < __ctype_type > ( __in . getloc ( ) ) ;
  21407. const __int_type __eof = _Traits :: eof ( ) ;
  21408. __streambuf_type * __sb = __in . rdbuf ( ) ;
  21409. __int_type __c = __sb -> sgetc ( ) ;
  21410.  
  21411. while ( ! _Traits :: eq_int_type ( __c , __eof )
  21412. && __ct . is ( ctype_base :: space , _Traits :: to_char_type ( __c ) ) )
  21413. __c = __sb -> snextc ( ) ;
  21414.  
  21415. if ( _Traits :: eq_int_type ( __c , __eof ) )
  21416. __in . setstate ( ios_base :: eofbit ) ;
  21417. return __in ;
  21418. }
  21419.  
  21420.  
  21421.  
  21422.  
  21423. extern template class basic_istream < char > ;
  21424. extern template istream & ws ( istream & ) ;
  21425. extern template istream & operator >> ( istream & , char & ) ;
  21426. extern template istream & operator >> ( istream & , char * ) ;
  21427. extern template istream & operator >> ( istream & , unsigned char & ) ;
  21428. extern template istream & operator >> ( istream & , signed char & ) ;
  21429. extern template istream & operator >> ( istream & , unsigned char * ) ;
  21430. extern template istream & operator >> ( istream & , signed char * ) ;
  21431.  
  21432. extern template istream & istream :: _M_extract ( unsigned short & ) ;
  21433. extern template istream & istream :: _M_extract ( unsigned int & ) ;
  21434. extern template istream & istream :: _M_extract ( long & ) ;
  21435. extern template istream & istream :: _M_extract ( unsigned long & ) ;
  21436. extern template istream & istream :: _M_extract ( bool & ) ;
  21437.  
  21438. extern template istream & istream :: _M_extract ( long long & ) ;
  21439. extern template istream & istream :: _M_extract ( unsigned long long & ) ;
  21440.  
  21441. extern template istream & istream :: _M_extract ( float & ) ;
  21442. extern template istream & istream :: _M_extract ( double & ) ;
  21443. extern template istream & istream :: _M_extract ( long double & ) ;
  21444. extern template istream & istream :: _M_extract ( void * & ) ;
  21445.  
  21446. extern template class basic_iostream < char > ;
  21447.  
  21448.  
  21449. extern template class basic_istream < wchar_t > ;
  21450. extern template wistream & ws ( wistream & ) ;
  21451. extern template wistream & operator >> ( wistream & , wchar_t & ) ;
  21452. extern template wistream & operator >> ( wistream & , wchar_t * ) ;
  21453.  
  21454. extern template wistream & wistream :: _M_extract ( unsigned short & ) ;
  21455. extern template wistream & wistream :: _M_extract ( unsigned int & ) ;
  21456. extern template wistream & wistream :: _M_extract ( long & ) ;
  21457. extern template wistream & wistream :: _M_extract ( unsigned long & ) ;
  21458. extern template wistream & wistream :: _M_extract ( bool & ) ;
  21459.  
  21460. extern template wistream & wistream :: _M_extract ( long long & ) ;
  21461. extern template wistream & wistream :: _M_extract ( unsigned long long & ) ;
  21462.  
  21463. extern template wistream & wistream :: _M_extract ( float & ) ;
  21464. extern template wistream & wistream :: _M_extract ( double & ) ;
  21465. extern template wistream & wistream :: _M_extract ( long double & ) ;
  21466. extern template wistream & wistream :: _M_extract ( void * & ) ;
  21467.  
  21468. extern template class basic_iostream < wchar_t > ;
  21469.  
  21470.  
  21471.  
  21472.  
  21473. }
  21474. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stream_iterator.h"
  21475. #33
  21476. #pragma GCC system_header
  21477. #37
  21478. namespace std
  21479. {
  21480. #47
  21481. template < typename _Tp , typename _CharT = char ,
  21482. typename _Traits = char_traits < _CharT > , typename _Dist = ptrdiff_t >
  21483. class istream_iterator
  21484. : public iterator < input_iterator_tag , _Tp , _Dist , const _Tp * , const _Tp & >
  21485. {
  21486. public :
  21487. typedef _CharT char_type ;
  21488. typedef _Traits traits_type ;
  21489. typedef basic_istream < _CharT , _Traits > istream_type ;
  21490.  
  21491. private :
  21492. istream_type * _M_stream ;
  21493. _Tp _M_value ;
  21494. bool _M_ok ;
  21495.  
  21496. public :
  21497.  
  21498. constexpr istream_iterator ( )
  21499. : _M_stream ( 0 ) , _M_value ( ) , _M_ok ( false ) { }
  21500.  
  21501.  
  21502. istream_iterator ( istream_type & __s )
  21503. : _M_stream ( & __s )
  21504. { _M_read ( ) ; }
  21505.  
  21506. istream_iterator ( const istream_iterator & __obj )
  21507. : _M_stream ( __obj . _M_stream ) , _M_value ( __obj . _M_value ) ,
  21508. _M_ok ( __obj . _M_ok )
  21509. { }
  21510.  
  21511. const _Tp &
  21512. operator * ( ) const
  21513. {
  21514.  
  21515.  
  21516. ;
  21517. return _M_value ;
  21518. }
  21519.  
  21520. const _Tp *
  21521. operator -> ( ) const { return & ( operator * ( ) ) ; }
  21522.  
  21523. istream_iterator &
  21524. operator ++ ( )
  21525. {
  21526.  
  21527.  
  21528. ;
  21529. _M_read ( ) ;
  21530. return * this ;
  21531. }
  21532.  
  21533. istream_iterator
  21534. operator ++ ( int )
  21535. {
  21536.  
  21537.  
  21538. ;
  21539. istream_iterator __tmp = * this ;
  21540. _M_read ( ) ;
  21541. return __tmp ;
  21542. }
  21543.  
  21544. bool
  21545. _M_equal ( const istream_iterator & __x ) const
  21546. { return ( _M_ok == __x . _M_ok ) && ( ! _M_ok || _M_stream == __x . _M_stream ) ; }
  21547.  
  21548. private :
  21549. void
  21550. _M_read ( )
  21551. {
  21552. _M_ok = ( _M_stream && * _M_stream ) ? true : false ;
  21553. if ( _M_ok )
  21554. {
  21555. * _M_stream >> _M_value ;
  21556. _M_ok = * _M_stream ? true : false ;
  21557. }
  21558. }
  21559. } ;
  21560.  
  21561.  
  21562. template < typename _Tp , typename _CharT , typename _Traits , typename _Dist >
  21563. inline bool
  21564. operator == ( const istream_iterator < _Tp , _CharT , _Traits , _Dist > & __x ,
  21565. const istream_iterator < _Tp , _CharT , _Traits , _Dist > & __y )
  21566. { return __x . _M_equal ( __y ) ; }
  21567.  
  21568.  
  21569. template < class _Tp , class _CharT , class _Traits , class _Dist >
  21570. inline bool
  21571. operator != ( const istream_iterator < _Tp , _CharT , _Traits , _Dist > & __x ,
  21572. const istream_iterator < _Tp , _CharT , _Traits , _Dist > & __y )
  21573. { return ! __x . _M_equal ( __y ) ; }
  21574. #152
  21575. template < typename _Tp , typename _CharT = char ,
  21576. typename _Traits = char_traits < _CharT > >
  21577. class ostream_iterator
  21578. : public iterator < output_iterator_tag , void , void , void , void >
  21579. {
  21580. public :
  21581.  
  21582.  
  21583. typedef _CharT char_type ;
  21584. typedef _Traits traits_type ;
  21585. typedef basic_ostream < _CharT , _Traits > ostream_type ;
  21586.  
  21587.  
  21588. private :
  21589. ostream_type * _M_stream ;
  21590. const _CharT * _M_string ;
  21591.  
  21592. public :
  21593.  
  21594. ostream_iterator ( ostream_type & __s ) : _M_stream ( & __s ) , _M_string ( 0 ) { }
  21595. #183
  21596. ostream_iterator ( ostream_type & __s , const _CharT * __c )
  21597. : _M_stream ( & __s ) , _M_string ( __c ) { }
  21598.  
  21599.  
  21600. ostream_iterator ( const ostream_iterator & __obj )
  21601. : _M_stream ( __obj . _M_stream ) , _M_string ( __obj . _M_string ) { }
  21602.  
  21603.  
  21604.  
  21605. ostream_iterator &
  21606. operator = ( const _Tp & __value )
  21607. {
  21608.  
  21609.  
  21610. ;
  21611. * _M_stream << __value ;
  21612. if ( _M_string ) * _M_stream << _M_string ;
  21613. return * this ;
  21614. }
  21615.  
  21616. ostream_iterator &
  21617. operator * ( )
  21618. { return * this ; }
  21619.  
  21620. ostream_iterator &
  21621. operator ++ ( )
  21622. { return * this ; }
  21623.  
  21624. ostream_iterator &
  21625. operator ++ ( int )
  21626. { return * this ; }
  21627. } ;
  21628.  
  21629.  
  21630.  
  21631.  
  21632. }
  21633. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/algorithm"
  21634. #58
  21635. #pragma GCC system_header
  21636. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_algo.h"
  21637. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/algorithmfwd.h"
  21638. #33
  21639. #pragma GCC system_header
  21640. #42
  21641. namespace std
  21642. {
  21643. #194
  21644. template < typename _IIter , typename _Predicate >
  21645. bool
  21646. all_of ( _IIter , _IIter , _Predicate ) ;
  21647.  
  21648. template < typename _IIter , typename _Predicate >
  21649. bool
  21650. any_of ( _IIter , _IIter , _Predicate ) ;
  21651.  
  21652.  
  21653. template < typename _FIter , typename _Tp >
  21654. bool
  21655. binary_search ( _FIter , _FIter , const _Tp & ) ;
  21656.  
  21657. template < typename _FIter , typename _Tp , typename _Compare >
  21658. bool
  21659. binary_search ( _FIter , _FIter , const _Tp & , _Compare ) ;
  21660.  
  21661. template < typename _IIter , typename _OIter >
  21662. _OIter
  21663. copy ( _IIter , _IIter , _OIter ) ;
  21664.  
  21665. template < typename _BIter1 , typename _BIter2 >
  21666. _BIter2
  21667. copy_backward ( _BIter1 , _BIter1 , _BIter2 ) ;
  21668.  
  21669.  
  21670. template < typename _IIter , typename _OIter , typename _Predicate >
  21671. _OIter
  21672. copy_if ( _IIter , _IIter , _OIter , _Predicate ) ;
  21673.  
  21674. template < typename _IIter , typename _Size , typename _OIter >
  21675. _OIter
  21676. copy_n ( _IIter , _Size , _OIter ) ;
  21677.  
  21678.  
  21679.  
  21680.  
  21681.  
  21682. template < typename _FIter , typename _Tp >
  21683. pair < _FIter , _FIter >
  21684. equal_range ( _FIter , _FIter , const _Tp & ) ;
  21685.  
  21686. template < typename _FIter , typename _Tp , typename _Compare >
  21687. pair < _FIter , _FIter >
  21688. equal_range ( _FIter , _FIter , const _Tp & , _Compare ) ;
  21689.  
  21690. template < typename _FIter , typename _Tp >
  21691. void
  21692. fill ( _FIter , _FIter , const _Tp & ) ;
  21693.  
  21694. template < typename _OIter , typename _Size , typename _Tp >
  21695. _OIter
  21696. fill_n ( _OIter , _Size , const _Tp & ) ;
  21697.  
  21698.  
  21699.  
  21700. template < typename _FIter1 , typename _FIter2 >
  21701. _FIter1
  21702. find_end ( _FIter1 , _FIter1 , _FIter2 , _FIter2 ) ;
  21703.  
  21704. template < typename _FIter1 , typename _FIter2 , typename _BinaryPredicate >
  21705. _FIter1
  21706. find_end ( _FIter1 , _FIter1 , _FIter2 , _FIter2 , _BinaryPredicate ) ;
  21707.  
  21708.  
  21709.  
  21710.  
  21711.  
  21712. template < typename _IIter , typename _Predicate >
  21713. _IIter
  21714. find_if_not ( _IIter , _IIter , _Predicate ) ;
  21715. #271
  21716. template < typename _IIter1 , typename _IIter2 >
  21717. bool
  21718. includes ( _IIter1 , _IIter1 , _IIter2 , _IIter2 ) ;
  21719.  
  21720. template < typename _IIter1 , typename _IIter2 , typename _Compare >
  21721. bool
  21722. includes ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _Compare ) ;
  21723.  
  21724. template < typename _BIter >
  21725. void
  21726. inplace_merge ( _BIter , _BIter , _BIter ) ;
  21727.  
  21728. template < typename _BIter , typename _Compare >
  21729. void
  21730. inplace_merge ( _BIter , _BIter , _BIter , _Compare ) ;
  21731.  
  21732.  
  21733. template < typename _RAIter >
  21734. bool
  21735. is_heap ( _RAIter , _RAIter ) ;
  21736.  
  21737. template < typename _RAIter , typename _Compare >
  21738. bool
  21739. is_heap ( _RAIter , _RAIter , _Compare ) ;
  21740.  
  21741. template < typename _RAIter >
  21742. _RAIter
  21743. is_heap_until ( _RAIter , _RAIter ) ;
  21744.  
  21745. template < typename _RAIter , typename _Compare >
  21746. _RAIter
  21747. is_heap_until ( _RAIter , _RAIter , _Compare ) ;
  21748.  
  21749. template < typename _IIter , typename _Predicate >
  21750. bool
  21751. is_partitioned ( _IIter , _IIter , _Predicate ) ;
  21752.  
  21753. template < typename _FIter1 , typename _FIter2 >
  21754. bool
  21755. is_permutation ( _FIter1 , _FIter1 , _FIter2 ) ;
  21756.  
  21757. template < typename _FIter1 , typename _FIter2 ,
  21758. typename _BinaryPredicate >
  21759. bool
  21760. is_permutation ( _FIter1 , _FIter1 , _FIter2 , _BinaryPredicate ) ;
  21761.  
  21762. template < typename _FIter >
  21763. bool
  21764. is_sorted ( _FIter , _FIter ) ;
  21765.  
  21766. template < typename _FIter , typename _Compare >
  21767. bool
  21768. is_sorted ( _FIter , _FIter , _Compare ) ;
  21769.  
  21770. template < typename _FIter >
  21771. _FIter
  21772. is_sorted_until ( _FIter , _FIter ) ;
  21773.  
  21774. template < typename _FIter , typename _Compare >
  21775. _FIter
  21776. is_sorted_until ( _FIter , _FIter , _Compare ) ;
  21777.  
  21778.  
  21779. template < typename _FIter1 , typename _FIter2 >
  21780. void
  21781. iter_swap ( _FIter1 , _FIter2 ) ;
  21782.  
  21783. template < typename _FIter , typename _Tp >
  21784. _FIter
  21785. lower_bound ( _FIter , _FIter , const _Tp & ) ;
  21786.  
  21787. template < typename _FIter , typename _Tp , typename _Compare >
  21788. _FIter
  21789. lower_bound ( _FIter , _FIter , const _Tp & , _Compare ) ;
  21790.  
  21791. template < typename _RAIter >
  21792. void
  21793. make_heap ( _RAIter , _RAIter ) ;
  21794.  
  21795. template < typename _RAIter , typename _Compare >
  21796. void
  21797. make_heap ( _RAIter , _RAIter , _Compare ) ;
  21798.  
  21799. template < typename _Tp >
  21800. const _Tp &
  21801. max ( const _Tp & , const _Tp & ) ;
  21802.  
  21803. template < typename _Tp , typename _Compare >
  21804. const _Tp &
  21805. max ( const _Tp & , const _Tp & , _Compare ) ;
  21806.  
  21807.  
  21808.  
  21809.  
  21810. template < typename _Tp >
  21811. const _Tp &
  21812. min ( const _Tp & , const _Tp & ) ;
  21813.  
  21814. template < typename _Tp , typename _Compare >
  21815. const _Tp &
  21816. min ( const _Tp & , const _Tp & , _Compare ) ;
  21817.  
  21818.  
  21819.  
  21820.  
  21821. template < typename _Tp >
  21822. pair < const _Tp & , const _Tp & >
  21823. minmax ( const _Tp & , const _Tp & ) ;
  21824.  
  21825. template < typename _Tp , typename _Compare >
  21826. pair < const _Tp & , const _Tp & >
  21827. minmax ( const _Tp & , const _Tp & , _Compare ) ;
  21828.  
  21829. template < typename _FIter >
  21830. pair < _FIter , _FIter >
  21831. minmax_element ( _FIter , _FIter ) ;
  21832.  
  21833. template < typename _FIter , typename _Compare >
  21834. pair < _FIter , _FIter >
  21835. minmax_element ( _FIter , _FIter , _Compare ) ;
  21836.  
  21837. template < typename _Tp >
  21838. _Tp
  21839. min ( initializer_list < _Tp > ) ;
  21840.  
  21841. template < typename _Tp , typename _Compare >
  21842. _Tp
  21843. min ( initializer_list < _Tp > , _Compare ) ;
  21844.  
  21845. template < typename _Tp >
  21846. _Tp
  21847. max ( initializer_list < _Tp > ) ;
  21848.  
  21849. template < typename _Tp , typename _Compare >
  21850. _Tp
  21851. max ( initializer_list < _Tp > , _Compare ) ;
  21852.  
  21853. template < typename _Tp >
  21854. pair < _Tp , _Tp >
  21855. minmax ( initializer_list < _Tp > ) ;
  21856.  
  21857. template < typename _Tp , typename _Compare >
  21858. pair < _Tp , _Tp >
  21859. minmax ( initializer_list < _Tp > , _Compare ) ;
  21860.  
  21861.  
  21862.  
  21863.  
  21864. template < typename _BIter >
  21865. bool
  21866. next_permutation ( _BIter , _BIter ) ;
  21867.  
  21868. template < typename _BIter , typename _Compare >
  21869. bool
  21870. next_permutation ( _BIter , _BIter , _Compare ) ;
  21871.  
  21872.  
  21873. template < typename _IIter , typename _Predicate >
  21874. bool
  21875. none_of ( _IIter , _IIter , _Predicate ) ;
  21876.  
  21877.  
  21878.  
  21879.  
  21880.  
  21881. template < typename _IIter , typename _RAIter >
  21882. _RAIter
  21883. partial_sort_copy ( _IIter , _IIter , _RAIter , _RAIter ) ;
  21884.  
  21885. template < typename _IIter , typename _RAIter , typename _Compare >
  21886. _RAIter
  21887. partial_sort_copy ( _IIter , _IIter , _RAIter , _RAIter , _Compare ) ;
  21888.  
  21889.  
  21890.  
  21891.  
  21892. template < typename _IIter , typename _OIter1 ,
  21893. typename _OIter2 , typename _Predicate >
  21894. pair < _OIter1 , _OIter2 >
  21895. partition_copy ( _IIter , _IIter , _OIter1 , _OIter2 , _Predicate ) ;
  21896.  
  21897. template < typename _FIter , typename _Predicate >
  21898. _FIter
  21899. partition_point ( _FIter , _FIter , _Predicate ) ;
  21900.  
  21901.  
  21902. template < typename _RAIter >
  21903. void
  21904. pop_heap ( _RAIter , _RAIter ) ;
  21905.  
  21906. template < typename _RAIter , typename _Compare >
  21907. void
  21908. pop_heap ( _RAIter , _RAIter , _Compare ) ;
  21909.  
  21910. template < typename _BIter >
  21911. bool
  21912. prev_permutation ( _BIter , _BIter ) ;
  21913.  
  21914. template < typename _BIter , typename _Compare >
  21915. bool
  21916. prev_permutation ( _BIter , _BIter , _Compare ) ;
  21917.  
  21918. template < typename _RAIter >
  21919. void
  21920. push_heap ( _RAIter , _RAIter ) ;
  21921.  
  21922. template < typename _RAIter , typename _Compare >
  21923. void
  21924. push_heap ( _RAIter , _RAIter , _Compare ) ;
  21925.  
  21926.  
  21927.  
  21928. template < typename _FIter , typename _Tp >
  21929. _FIter
  21930. remove ( _FIter , _FIter , const _Tp & ) ;
  21931.  
  21932. template < typename _FIter , typename _Predicate >
  21933. _FIter
  21934. remove_if ( _FIter , _FIter , _Predicate ) ;
  21935.  
  21936. template < typename _IIter , typename _OIter , typename _Tp >
  21937. _OIter
  21938. remove_copy ( _IIter , _IIter , _OIter , const _Tp & ) ;
  21939.  
  21940. template < typename _IIter , typename _OIter , typename _Predicate >
  21941. _OIter
  21942. remove_copy_if ( _IIter , _IIter , _OIter , _Predicate ) ;
  21943.  
  21944.  
  21945.  
  21946. template < typename _IIter , typename _OIter , typename _Tp >
  21947. _OIter
  21948. replace_copy ( _IIter , _IIter , _OIter , const _Tp & , const _Tp & ) ;
  21949.  
  21950. template < typename _Iter , typename _OIter , typename _Predicate , typename _Tp >
  21951. _OIter
  21952. replace_copy_if ( _Iter , _Iter , _OIter , _Predicate , const _Tp & ) ;
  21953.  
  21954.  
  21955.  
  21956. template < typename _BIter >
  21957. void
  21958. reverse ( _BIter , _BIter ) ;
  21959.  
  21960. template < typename _BIter , typename _OIter >
  21961. _OIter
  21962. reverse_copy ( _BIter , _BIter , _OIter ) ;
  21963.  
  21964. template < typename _FIter >
  21965. void
  21966. rotate ( _FIter , _FIter , _FIter ) ;
  21967.  
  21968. template < typename _FIter , typename _OIter >
  21969. _OIter
  21970. rotate_copy ( _FIter , _FIter , _FIter , _OIter ) ;
  21971. #535
  21972. template < typename _RAIter , typename _UGenerator >
  21973. void
  21974. shuffle ( _RAIter , _RAIter , _UGenerator && ) ;
  21975.  
  21976.  
  21977. template < typename _RAIter >
  21978. void
  21979. sort_heap ( _RAIter , _RAIter ) ;
  21980.  
  21981. template < typename _RAIter , typename _Compare >
  21982. void
  21983. sort_heap ( _RAIter , _RAIter , _Compare ) ;
  21984.  
  21985. template < typename _BIter , typename _Predicate >
  21986. _BIter
  21987. stable_partition ( _BIter , _BIter , _Predicate ) ;
  21988.  
  21989. template < typename _Tp >
  21990. void
  21991. swap ( _Tp & , _Tp & )
  21992.  
  21993. noexcept ( __and_ < is_nothrow_move_constructible < _Tp > ,
  21994. is_nothrow_move_assignable < _Tp >> :: value )
  21995.  
  21996. ;
  21997.  
  21998. template < typename _Tp , size_t _Nm >
  21999. void
  22000. swap ( _Tp ( & __a ) [ _Nm ] , _Tp ( & __b ) [ _Nm ] )
  22001.  
  22002. noexcept ( noexcept ( swap ( * __a , * __b ) ) )
  22003.  
  22004. ;
  22005.  
  22006. template < typename _FIter1 , typename _FIter2 >
  22007. _FIter2
  22008. swap_ranges ( _FIter1 , _FIter1 , _FIter2 ) ;
  22009.  
  22010.  
  22011.  
  22012. template < typename _FIter >
  22013. _FIter
  22014. unique ( _FIter , _FIter ) ;
  22015.  
  22016. template < typename _FIter , typename _BinaryPredicate >
  22017. _FIter
  22018. unique ( _FIter , _FIter , _BinaryPredicate ) ;
  22019.  
  22020.  
  22021.  
  22022. template < typename _FIter , typename _Tp >
  22023. _FIter
  22024. upper_bound ( _FIter , _FIter , const _Tp & ) ;
  22025.  
  22026. template < typename _FIter , typename _Tp , typename _Compare >
  22027. _FIter
  22028. upper_bound ( _FIter , _FIter , const _Tp & , _Compare ) ;
  22029.  
  22030.  
  22031.  
  22032.  
  22033.  
  22034. template < typename _FIter >
  22035. _FIter
  22036. adjacent_find ( _FIter , _FIter ) ;
  22037.  
  22038. template < typename _FIter , typename _BinaryPredicate >
  22039. _FIter
  22040. adjacent_find ( _FIter , _FIter , _BinaryPredicate ) ;
  22041.  
  22042. template < typename _IIter , typename _Tp >
  22043. typename iterator_traits < _IIter > :: difference_type
  22044. count ( _IIter , _IIter , const _Tp & ) ;
  22045.  
  22046. template < typename _IIter , typename _Predicate >
  22047. typename iterator_traits < _IIter > :: difference_type
  22048. count_if ( _IIter , _IIter , _Predicate ) ;
  22049.  
  22050. template < typename _IIter1 , typename _IIter2 >
  22051. bool
  22052. equal ( _IIter1 , _IIter1 , _IIter2 ) ;
  22053.  
  22054. template < typename _IIter1 , typename _IIter2 , typename _BinaryPredicate >
  22055. bool
  22056. equal ( _IIter1 , _IIter1 , _IIter2 , _BinaryPredicate ) ;
  22057.  
  22058. template < typename _IIter , typename _Tp >
  22059. _IIter
  22060. find ( _IIter , _IIter , const _Tp & ) ;
  22061.  
  22062. template < typename _FIter1 , typename _FIter2 >
  22063. _FIter1
  22064. find_first_of ( _FIter1 , _FIter1 , _FIter2 , _FIter2 ) ;
  22065.  
  22066. template < typename _FIter1 , typename _FIter2 , typename _BinaryPredicate >
  22067. _FIter1
  22068. find_first_of ( _FIter1 , _FIter1 , _FIter2 , _FIter2 , _BinaryPredicate ) ;
  22069.  
  22070. template < typename _IIter , typename _Predicate >
  22071. _IIter
  22072. find_if ( _IIter , _IIter , _Predicate ) ;
  22073.  
  22074. template < typename _IIter , typename _Funct >
  22075. _Funct
  22076. for_each ( _IIter , _IIter , _Funct ) ;
  22077.  
  22078. template < typename _FIter , typename _Generator >
  22079. void
  22080. generate ( _FIter , _FIter , _Generator ) ;
  22081.  
  22082. template < typename _OIter , typename _Size , typename _Generator >
  22083. _OIter
  22084. generate_n ( _OIter , _Size , _Generator ) ;
  22085.  
  22086. template < typename _IIter1 , typename _IIter2 >
  22087. bool
  22088. lexicographical_compare ( _IIter1 , _IIter1 , _IIter2 , _IIter2 ) ;
  22089.  
  22090. template < typename _IIter1 , typename _IIter2 , typename _Compare >
  22091. bool
  22092. lexicographical_compare ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _Compare ) ;
  22093.  
  22094. template < typename _FIter >
  22095. _FIter
  22096. max_element ( _FIter , _FIter ) ;
  22097.  
  22098. template < typename _FIter , typename _Compare >
  22099. _FIter
  22100. max_element ( _FIter , _FIter , _Compare ) ;
  22101.  
  22102. template < typename _IIter1 , typename _IIter2 , typename _OIter >
  22103. _OIter
  22104. merge ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter ) ;
  22105.  
  22106. template < typename _IIter1 , typename _IIter2 , typename _OIter ,
  22107. typename _Compare >
  22108. _OIter
  22109. merge ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter , _Compare ) ;
  22110.  
  22111. template < typename _FIter >
  22112. _FIter
  22113. min_element ( _FIter , _FIter ) ;
  22114.  
  22115. template < typename _FIter , typename _Compare >
  22116. _FIter
  22117. min_element ( _FIter , _FIter , _Compare ) ;
  22118.  
  22119. template < typename _IIter1 , typename _IIter2 >
  22120. pair < _IIter1 , _IIter2 >
  22121. mismatch ( _IIter1 , _IIter1 , _IIter2 ) ;
  22122.  
  22123. template < typename _IIter1 , typename _IIter2 , typename _BinaryPredicate >
  22124. pair < _IIter1 , _IIter2 >
  22125. mismatch ( _IIter1 , _IIter1 , _IIter2 , _BinaryPredicate ) ;
  22126.  
  22127. template < typename _RAIter >
  22128. void
  22129. nth_element ( _RAIter , _RAIter , _RAIter ) ;
  22130.  
  22131. template < typename _RAIter , typename _Compare >
  22132. void
  22133. nth_element ( _RAIter , _RAIter , _RAIter , _Compare ) ;
  22134.  
  22135. template < typename _RAIter >
  22136. void
  22137. partial_sort ( _RAIter , _RAIter , _RAIter ) ;
  22138.  
  22139. template < typename _RAIter , typename _Compare >
  22140. void
  22141. partial_sort ( _RAIter , _RAIter , _RAIter , _Compare ) ;
  22142.  
  22143. template < typename _BIter , typename _Predicate >
  22144. _BIter
  22145. partition ( _BIter , _BIter , _Predicate ) ;
  22146.  
  22147. template < typename _RAIter >
  22148. void
  22149. random_shuffle ( _RAIter , _RAIter ) ;
  22150.  
  22151. template < typename _RAIter , typename _Generator >
  22152. void
  22153. random_shuffle ( _RAIter , _RAIter ,
  22154.  
  22155. _Generator && ) ;
  22156.  
  22157.  
  22158.  
  22159.  
  22160. template < typename _FIter , typename _Tp >
  22161. void
  22162. replace ( _FIter , _FIter , const _Tp & , const _Tp & ) ;
  22163.  
  22164. template < typename _FIter , typename _Predicate , typename _Tp >
  22165. void
  22166. replace_if ( _FIter , _FIter , _Predicate , const _Tp & ) ;
  22167.  
  22168. template < typename _FIter1 , typename _FIter2 >
  22169. _FIter1
  22170. search ( _FIter1 , _FIter1 , _FIter2 , _FIter2 ) ;
  22171.  
  22172. template < typename _FIter1 , typename _FIter2 , typename _BinaryPredicate >
  22173. _FIter1
  22174. search ( _FIter1 , _FIter1 , _FIter2 , _FIter2 , _BinaryPredicate ) ;
  22175.  
  22176. template < typename _FIter , typename _Size , typename _Tp >
  22177. _FIter
  22178. search_n ( _FIter , _FIter , _Size , const _Tp & ) ;
  22179.  
  22180. template < typename _FIter , typename _Size , typename _Tp ,
  22181. typename _BinaryPredicate >
  22182. _FIter
  22183. search_n ( _FIter , _FIter , _Size , const _Tp & , _BinaryPredicate ) ;
  22184.  
  22185. template < typename _IIter1 , typename _IIter2 , typename _OIter >
  22186. _OIter
  22187. set_difference ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter ) ;
  22188.  
  22189. template < typename _IIter1 , typename _IIter2 , typename _OIter ,
  22190. typename _Compare >
  22191. _OIter
  22192. set_difference ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter , _Compare ) ;
  22193.  
  22194. template < typename _IIter1 , typename _IIter2 , typename _OIter >
  22195. _OIter
  22196. set_intersection ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter ) ;
  22197.  
  22198. template < typename _IIter1 , typename _IIter2 , typename _OIter ,
  22199. typename _Compare >
  22200. _OIter
  22201. set_intersection ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter , _Compare ) ;
  22202.  
  22203. template < typename _IIter1 , typename _IIter2 , typename _OIter >
  22204. _OIter
  22205. set_symmetric_difference ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter ) ;
  22206.  
  22207. template < typename _IIter1 , typename _IIter2 , typename _OIter ,
  22208. typename _Compare >
  22209. _OIter
  22210. set_symmetric_difference ( _IIter1 , _IIter1 , _IIter2 , _IIter2 ,
  22211. _OIter , _Compare ) ;
  22212.  
  22213. template < typename _IIter1 , typename _IIter2 , typename _OIter >
  22214. _OIter
  22215. set_union ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter ) ;
  22216.  
  22217. template < typename _IIter1 , typename _IIter2 , typename _OIter ,
  22218. typename _Compare >
  22219. _OIter
  22220. set_union ( _IIter1 , _IIter1 , _IIter2 , _IIter2 , _OIter , _Compare ) ;
  22221.  
  22222. template < typename _RAIter >
  22223. void
  22224. sort ( _RAIter , _RAIter ) ;
  22225.  
  22226. template < typename _RAIter , typename _Compare >
  22227. void
  22228. sort ( _RAIter , _RAIter , _Compare ) ;
  22229.  
  22230. template < typename _RAIter >
  22231. void
  22232. stable_sort ( _RAIter , _RAIter ) ;
  22233.  
  22234. template < typename _RAIter , typename _Compare >
  22235. void
  22236. stable_sort ( _RAIter , _RAIter , _Compare ) ;
  22237.  
  22238. template < typename _IIter , typename _OIter , typename _UnaryOperation >
  22239. _OIter
  22240. transform ( _IIter , _IIter , _OIter , _UnaryOperation ) ;
  22241.  
  22242. template < typename _IIter1 , typename _IIter2 , typename _OIter ,
  22243. typename _BinaryOperation >
  22244. _OIter
  22245. transform ( _IIter1 , _IIter1 , _IIter2 , _OIter , _BinaryOperation ) ;
  22246.  
  22247. template < typename _IIter , typename _OIter >
  22248. _OIter
  22249. unique_copy ( _IIter , _IIter , _OIter ) ;
  22250.  
  22251. template < typename _IIter , typename _OIter , typename _BinaryPredicate >
  22252. _OIter
  22253. unique_copy ( _IIter , _IIter , _OIter , _BinaryPredicate ) ;
  22254.  
  22255.  
  22256. }
  22257. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_heap.h"
  22258. #61
  22259. namespace std
  22260. {
  22261. #70
  22262. template < typename _RandomAccessIterator , typename _Distance >
  22263. _Distance
  22264. __is_heap_until ( _RandomAccessIterator __first , _Distance __n )
  22265. {
  22266. _Distance __parent = 0 ;
  22267. for ( _Distance __child = 1 ; __child < __n ; ++ __child )
  22268. {
  22269. if ( __first [ __parent ] < __first [ __child ] )
  22270. return __child ;
  22271. if ( ( __child & 1 ) == 0 )
  22272. ++ __parent ;
  22273. }
  22274. return __n ;
  22275. }
  22276.  
  22277. template < typename _RandomAccessIterator , typename _Distance ,
  22278. typename _Compare >
  22279. _Distance
  22280. __is_heap_until ( _RandomAccessIterator __first , _Distance __n ,
  22281. _Compare __comp )
  22282. {
  22283. _Distance __parent = 0 ;
  22284. for ( _Distance __child = 1 ; __child < __n ; ++ __child )
  22285. {
  22286. if ( __comp ( __first [ __parent ] , __first [ __child ] ) )
  22287. return __child ;
  22288. if ( ( __child & 1 ) == 0 )
  22289. ++ __parent ;
  22290. }
  22291. return __n ;
  22292. }
  22293.  
  22294.  
  22295.  
  22296. template < typename _RandomAccessIterator , typename _Distance >
  22297. inline bool
  22298. __is_heap ( _RandomAccessIterator __first , _Distance __n )
  22299. { return std :: __is_heap_until ( __first , __n ) == __n ; }
  22300.  
  22301. template < typename _RandomAccessIterator , typename _Compare ,
  22302. typename _Distance >
  22303. inline bool
  22304. __is_heap ( _RandomAccessIterator __first , _Compare __comp , _Distance __n )
  22305. { return std :: __is_heap_until ( __first , __n , __comp ) == __n ; }
  22306.  
  22307. template < typename _RandomAccessIterator >
  22308. inline bool
  22309. __is_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22310. { return std :: __is_heap ( __first , std :: distance ( __first , __last ) ) ; }
  22311.  
  22312. template < typename _RandomAccessIterator , typename _Compare >
  22313. inline bool
  22314. __is_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22315. _Compare __comp )
  22316. { return std :: __is_heap ( __first , __comp , std :: distance ( __first , __last ) ) ; }
  22317.  
  22318.  
  22319.  
  22320.  
  22321. template < typename _RandomAccessIterator , typename _Distance , typename _Tp >
  22322. void
  22323. __push_heap ( _RandomAccessIterator __first ,
  22324. _Distance __holeIndex , _Distance __topIndex , _Tp __value )
  22325. {
  22326. _Distance __parent = ( __holeIndex - 1 ) / 2 ;
  22327. while ( __holeIndex > __topIndex && * ( __first + __parent ) < __value )
  22328. {
  22329. * ( __first + __holeIndex ) = std :: move ( * ( __first + __parent ) ) ;
  22330. __holeIndex = __parent ;
  22331. __parent = ( __holeIndex - 1 ) / 2 ;
  22332. }
  22333. * ( __first + __holeIndex ) = std :: move ( __value ) ;
  22334. }
  22335. #154
  22336. template < typename _RandomAccessIterator >
  22337. inline void
  22338. push_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22339. {
  22340. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22341. _ValueType ;
  22342. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  22343. _DistanceType ;
  22344.  
  22345.  
  22346.  
  22347.  
  22348.  
  22349. ;
  22350. ;
  22351.  
  22352. _ValueType __value = std :: move ( * ( __last - 1 ) ) ;
  22353. std :: __push_heap ( __first , _DistanceType ( ( __last - __first ) - 1 ) ,
  22354. _DistanceType ( 0 ) , std :: move ( __value ) ) ;
  22355. }
  22356.  
  22357. template < typename _RandomAccessIterator , typename _Distance , typename _Tp ,
  22358. typename _Compare >
  22359. void
  22360. __push_heap ( _RandomAccessIterator __first , _Distance __holeIndex ,
  22361. _Distance __topIndex , _Tp __value , _Compare __comp )
  22362. {
  22363. _Distance __parent = ( __holeIndex - 1 ) / 2 ;
  22364. while ( __holeIndex > __topIndex
  22365. && __comp ( * ( __first + __parent ) , __value ) )
  22366. {
  22367. * ( __first + __holeIndex ) = std :: move ( * ( __first + __parent ) ) ;
  22368. __holeIndex = __parent ;
  22369. __parent = ( __holeIndex - 1 ) / 2 ;
  22370. }
  22371. * ( __first + __holeIndex ) = std :: move ( __value ) ;
  22372. }
  22373. #204
  22374. template < typename _RandomAccessIterator , typename _Compare >
  22375. inline void
  22376. push_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22377. _Compare __comp )
  22378. {
  22379. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22380. _ValueType ;
  22381. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  22382. _DistanceType ;
  22383.  
  22384.  
  22385.  
  22386.  
  22387. ;
  22388. ;
  22389.  
  22390. _ValueType __value = std :: move ( * ( __last - 1 ) ) ;
  22391. std :: __push_heap ( __first , _DistanceType ( ( __last - __first ) - 1 ) ,
  22392. _DistanceType ( 0 ) , std :: move ( __value ) , __comp ) ;
  22393. }
  22394.  
  22395. template < typename _RandomAccessIterator , typename _Distance , typename _Tp >
  22396. void
  22397. __adjust_heap ( _RandomAccessIterator __first , _Distance __holeIndex ,
  22398. _Distance __len , _Tp __value )
  22399. {
  22400. const _Distance __topIndex = __holeIndex ;
  22401. _Distance __secondChild = __holeIndex ;
  22402. while ( __secondChild < ( __len - 1 ) / 2 )
  22403. {
  22404. __secondChild = 2 * ( __secondChild + 1 ) ;
  22405. if ( * ( __first + __secondChild ) < * ( __first + ( __secondChild - 1 ) ) )
  22406. __secondChild -- ;
  22407. * ( __first + __holeIndex ) = std :: move ( * ( __first + __secondChild ) ) ;
  22408. __holeIndex = __secondChild ;
  22409. }
  22410. if ( ( __len & 1 ) == 0 && __secondChild == ( __len - 2 ) / 2 )
  22411. {
  22412. __secondChild = 2 * ( __secondChild + 1 ) ;
  22413. * ( __first + __holeIndex ) =
  22414. std :: move ( * ( __first + ( __secondChild - 1 ) ) ) ;
  22415. __holeIndex = __secondChild - 1 ;
  22416. }
  22417. std :: __push_heap ( __first , __holeIndex , __topIndex ,
  22418. std :: move ( __value ) ) ;
  22419. }
  22420.  
  22421. template < typename _RandomAccessIterator >
  22422. inline void
  22423. __pop_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22424. _RandomAccessIterator __result )
  22425. {
  22426. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22427. _ValueType ;
  22428. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  22429. _DistanceType ;
  22430.  
  22431. _ValueType __value = std :: move ( * __result ) ;
  22432. * __result = std :: move ( * __first ) ;
  22433. std :: __adjust_heap ( __first , _DistanceType ( 0 ) ,
  22434. _DistanceType ( __last - __first ) ,
  22435. std :: move ( __value ) ) ;
  22436. }
  22437. #279
  22438. template < typename _RandomAccessIterator >
  22439. inline void
  22440. pop_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22441. {
  22442. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22443. _ValueType ;
  22444.  
  22445.  
  22446.  
  22447.  
  22448.  
  22449. ;
  22450. ;
  22451. ;
  22452.  
  22453. if ( __last - __first > 1 )
  22454. {
  22455. -- __last ;
  22456. std :: __pop_heap ( __first , __last , __last ) ;
  22457. }
  22458. }
  22459.  
  22460. template < typename _RandomAccessIterator , typename _Distance ,
  22461. typename _Tp , typename _Compare >
  22462. void
  22463. __adjust_heap ( _RandomAccessIterator __first , _Distance __holeIndex ,
  22464. _Distance __len , _Tp __value , _Compare __comp )
  22465. {
  22466. const _Distance __topIndex = __holeIndex ;
  22467. _Distance __secondChild = __holeIndex ;
  22468. while ( __secondChild < ( __len - 1 ) / 2 )
  22469. {
  22470. __secondChild = 2 * ( __secondChild + 1 ) ;
  22471. if ( __comp ( * ( __first + __secondChild ) ,
  22472. * ( __first + ( __secondChild - 1 ) ) ) )
  22473. __secondChild -- ;
  22474. * ( __first + __holeIndex ) = std :: move ( * ( __first + __secondChild ) ) ;
  22475. __holeIndex = __secondChild ;
  22476. }
  22477. if ( ( __len & 1 ) == 0 && __secondChild == ( __len - 2 ) / 2 )
  22478. {
  22479. __secondChild = 2 * ( __secondChild + 1 ) ;
  22480. * ( __first + __holeIndex ) =
  22481. std :: move ( * ( __first + ( __secondChild - 1 ) ) ) ;
  22482. __holeIndex = __secondChild - 1 ;
  22483. }
  22484. std :: __push_heap ( __first , __holeIndex , __topIndex ,
  22485. std :: move ( __value ) , __comp ) ;
  22486. }
  22487.  
  22488. template < typename _RandomAccessIterator , typename _Compare >
  22489. inline void
  22490. __pop_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22491. _RandomAccessIterator __result , _Compare __comp )
  22492. {
  22493. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22494. _ValueType ;
  22495. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  22496. _DistanceType ;
  22497.  
  22498. _ValueType __value = std :: move ( * __result ) ;
  22499. * __result = std :: move ( * __first ) ;
  22500. std :: __adjust_heap ( __first , _DistanceType ( 0 ) ,
  22501. _DistanceType ( __last - __first ) ,
  22502. std :: move ( __value ) , __comp ) ;
  22503. }
  22504. #357
  22505. template < typename _RandomAccessIterator , typename _Compare >
  22506. inline void
  22507. pop_heap ( _RandomAccessIterator __first ,
  22508. _RandomAccessIterator __last , _Compare __comp )
  22509. {
  22510.  
  22511.  
  22512.  
  22513. ;
  22514. ;
  22515. ;
  22516.  
  22517. if ( __last - __first > 1 )
  22518. {
  22519. -- __last ;
  22520. std :: __pop_heap ( __first , __last , __last , __comp ) ;
  22521. }
  22522. }
  22523. #384
  22524. template < typename _RandomAccessIterator >
  22525. void
  22526. make_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22527. {
  22528. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22529. _ValueType ;
  22530. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  22531. _DistanceType ;
  22532.  
  22533.  
  22534.  
  22535.  
  22536.  
  22537. ;
  22538.  
  22539. if ( __last - __first < 2 )
  22540. return ;
  22541.  
  22542. const _DistanceType __len = __last - __first ;
  22543. _DistanceType __parent = ( __len - 2 ) / 2 ;
  22544. while ( true )
  22545. {
  22546. _ValueType __value = std :: move ( * ( __first + __parent ) ) ;
  22547. std :: __adjust_heap ( __first , __parent , __len , std :: move ( __value ) ) ;
  22548. if ( __parent == 0 )
  22549. return ;
  22550. __parent -- ;
  22551. }
  22552. }
  22553. #424
  22554. template < typename _RandomAccessIterator , typename _Compare >
  22555. void
  22556. make_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22557. _Compare __comp )
  22558. {
  22559. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  22560. _ValueType ;
  22561. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  22562. _DistanceType ;
  22563.  
  22564.  
  22565.  
  22566.  
  22567. ;
  22568.  
  22569. if ( __last - __first < 2 )
  22570. return ;
  22571.  
  22572. const _DistanceType __len = __last - __first ;
  22573. _DistanceType __parent = ( __len - 2 ) / 2 ;
  22574. while ( true )
  22575. {
  22576. _ValueType __value = std :: move ( * ( __first + __parent ) ) ;
  22577. std :: __adjust_heap ( __first , __parent , __len , std :: move ( __value ) ,
  22578. __comp ) ;
  22579. if ( __parent == 0 )
  22580. return ;
  22581. __parent -- ;
  22582. }
  22583. }
  22584. #463
  22585. template < typename _RandomAccessIterator >
  22586. void
  22587. sort_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22588. {
  22589.  
  22590.  
  22591.  
  22592.  
  22593.  
  22594. ;
  22595. ;
  22596.  
  22597. while ( __last - __first > 1 )
  22598. {
  22599. -- __last ;
  22600. std :: __pop_heap ( __first , __last , __last ) ;
  22601. }
  22602. }
  22603. #492
  22604. template < typename _RandomAccessIterator , typename _Compare >
  22605. void
  22606. sort_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22607. _Compare __comp )
  22608. {
  22609.  
  22610.  
  22611.  
  22612. ;
  22613. ;
  22614.  
  22615. while ( __last - __first > 1 )
  22616. {
  22617. -- __last ;
  22618. std :: __pop_heap ( __first , __last , __last , __comp ) ;
  22619. }
  22620. }
  22621. #521
  22622. template < typename _RandomAccessIterator >
  22623. inline _RandomAccessIterator
  22624. is_heap_until ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22625. {
  22626.  
  22627.  
  22628.  
  22629.  
  22630.  
  22631. ;
  22632.  
  22633. return __first + std :: __is_heap_until ( __first , std :: distance ( __first ,
  22634. __last ) ) ;
  22635. }
  22636. #547
  22637. template < typename _RandomAccessIterator , typename _Compare >
  22638. inline _RandomAccessIterator
  22639. is_heap_until ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22640. _Compare __comp )
  22641. {
  22642.  
  22643.  
  22644.  
  22645. ;
  22646.  
  22647. return __first + std :: __is_heap_until ( __first , std :: distance ( __first ,
  22648. __last ) ,
  22649. __comp ) ;
  22650. }
  22651. #569
  22652. template < typename _RandomAccessIterator >
  22653. inline bool
  22654. is_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  22655. { return std :: is_heap_until ( __first , __last ) == __last ; }
  22656. #582
  22657. template < typename _RandomAccessIterator , typename _Compare >
  22658. inline bool
  22659. is_heap ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  22660. _Compare __comp )
  22661. { return std :: is_heap_until ( __first , __last , __comp ) == __last ; }
  22662.  
  22663.  
  22664.  
  22665. }
  22666. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_tempbuf.h"
  22667. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_construct.h"
  22668. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/alloc_traits.h"
  22669. #32
  22670. #pragma GCC system_header
  22671. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/alloc_traits.h"
  22672. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/ptr_traits.h"
  22673. #37
  22674. namespace std
  22675. {
  22676.  
  22677.  
  22678. template < typename _Tp > class __has_element_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  22679. #41
  22680. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: element_type > * ) ; template < typename
  22681. #41
  22682. _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1 ; } ; template
  22683. #41
  22684. < typename _Tp > struct __has_element_type : integral_constant < bool , __has_element_type_helper < typename remove_cv <
  22685. #41
  22686. _Tp > :: type > :: value > { } ;
  22687. template < typename _Tp > class __has_difference_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  22688. #42
  22689. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: difference_type > * ) ; template < typename
  22690. #42
  22691. _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1 ; } ; template
  22692. #42
  22693. < typename _Tp > struct __has_difference_type : integral_constant < bool , __has_difference_type_helper < typename remove_cv
  22694. #42
  22695. < _Tp > :: type > :: value > { } ;
  22696.  
  22697. template < typename _Tp , bool = __has_element_type < _Tp > :: value >
  22698. struct __ptrtr_elt_type ;
  22699.  
  22700. template < typename _Tp >
  22701. struct __ptrtr_elt_type < _Tp , true >
  22702. {
  22703. typedef typename _Tp :: element_type __type ;
  22704. } ;
  22705.  
  22706. template < template < typename , typename ... > class _SomePtr , typename _Tp ,
  22707. typename ... _Args >
  22708. struct __ptrtr_elt_type < _SomePtr < _Tp , _Args ... > , false >
  22709. {
  22710. typedef _Tp __type ;
  22711. } ;
  22712.  
  22713. template < typename _Tp , bool = __has_difference_type < _Tp > :: value >
  22714. struct __ptrtr_diff_type
  22715. {
  22716. typedef typename _Tp :: difference_type __type ;
  22717. } ;
  22718.  
  22719. template < typename _Tp >
  22720. struct __ptrtr_diff_type < _Tp , false >
  22721. {
  22722. typedef ptrdiff_t __type ;
  22723. } ;
  22724.  
  22725. template < typename _Ptr , typename _Up >
  22726. class __ptrtr_rebind_helper
  22727. {
  22728. template < typename _Ptr2 , typename _Up2 >
  22729. static constexpr bool
  22730. _S_chk ( typename _Ptr2 :: template rebind < _Up2 > * )
  22731. { return true ; }
  22732.  
  22733. template < typename , typename >
  22734. static constexpr bool
  22735. _S_chk ( ... )
  22736. { return false ; }
  22737.  
  22738. public :
  22739. static const bool __value = _S_chk < _Ptr , _Up > ( nullptr ) ;
  22740. } ;
  22741.  
  22742. template < typename _Ptr , typename _Up >
  22743. const bool __ptrtr_rebind_helper < _Ptr , _Up > :: __value ;
  22744.  
  22745. template < typename _Tp , typename _Up ,
  22746. bool = __ptrtr_rebind_helper < _Tp , _Up > :: __value >
  22747. struct __ptrtr_rebind ;
  22748.  
  22749. template < typename _Tp , typename _Up >
  22750. struct __ptrtr_rebind < _Tp , _Up , true >
  22751. {
  22752. typedef typename _Tp :: template rebind < _Up > __type ;
  22753. } ;
  22754.  
  22755. template < template < typename , typename ... > class _SomePtr , typename _Up ,
  22756. typename _Tp , typename ... _Args >
  22757. struct __ptrtr_rebind < _SomePtr < _Tp , _Args ... > , _Up , false >
  22758. {
  22759. typedef _SomePtr < _Up , _Args ... > __type ;
  22760. } ;
  22761.  
  22762. template < typename _Tp , typename = typename remove_cv < _Tp > :: type >
  22763. struct __ptrtr_not_void
  22764. {
  22765. typedef _Tp __type ;
  22766. } ;
  22767.  
  22768. template < typename _Tp >
  22769. struct __ptrtr_not_void < _Tp , void >
  22770. {
  22771. struct __type { } ;
  22772. } ;
  22773.  
  22774. template < typename _Ptr >
  22775. class __ptrtr_pointer_to
  22776. {
  22777. typedef typename __ptrtr_elt_type < _Ptr > :: __type __orig_type ;
  22778. typedef typename __ptrtr_not_void < __orig_type > :: __type __element_type ;
  22779.  
  22780. public :
  22781. static _Ptr pointer_to ( __element_type & __e )
  22782. { return _Ptr :: pointer_to ( __e ) ; }
  22783. } ;
  22784.  
  22785.  
  22786.  
  22787.  
  22788.  
  22789. template < typename _Ptr >
  22790. struct pointer_traits : __ptrtr_pointer_to < _Ptr >
  22791. {
  22792.  
  22793. typedef _Ptr pointer ;
  22794.  
  22795. typedef typename __ptrtr_elt_type < _Ptr > :: __type element_type ;
  22796.  
  22797. typedef typename __ptrtr_diff_type < _Ptr > :: __type difference_type ;
  22798.  
  22799. template < typename _Up >
  22800. using rebind = typename __ptrtr_rebind < _Ptr , _Up > :: __type ;
  22801. } ;
  22802.  
  22803.  
  22804.  
  22805.  
  22806.  
  22807. template < typename _Tp >
  22808. struct pointer_traits < _Tp * >
  22809. {
  22810.  
  22811. typedef _Tp * pointer ;
  22812.  
  22813. typedef _Tp element_type ;
  22814.  
  22815. typedef ptrdiff_t difference_type ;
  22816.  
  22817. template < typename _Up >
  22818. using rebind = _Up * ;
  22819. #172
  22820. static pointer
  22821. pointer_to ( typename __ptrtr_not_void < element_type > :: __type & __r ) noexcept
  22822. { return std :: addressof ( __r ) ; }
  22823. } ;
  22824.  
  22825.  
  22826. }
  22827. #39 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/alloc_traits.h"
  22828. namespace std
  22829. {
  22830.  
  22831.  
  22832. template < typename _Alloc , typename _Tp >
  22833. class __alloctr_rebind_helper
  22834. {
  22835. template < typename _Alloc2 , typename _Tp2 >
  22836. static constexpr bool
  22837. _S_chk ( typename _Alloc2 :: template rebind < _Tp2 > :: other * )
  22838. { return true ; }
  22839.  
  22840. template < typename , typename >
  22841. static constexpr bool
  22842. _S_chk ( ... )
  22843. { return false ; }
  22844.  
  22845. public :
  22846. static const bool __value = _S_chk < _Alloc , _Tp > ( nullptr ) ;
  22847. } ;
  22848.  
  22849. template < typename _Alloc , typename _Tp >
  22850. const bool __alloctr_rebind_helper < _Alloc , _Tp > :: __value ;
  22851.  
  22852. template < typename _Alloc , typename _Tp ,
  22853. bool = __alloctr_rebind_helper < _Alloc , _Tp > :: __value >
  22854. struct __alloctr_rebind ;
  22855.  
  22856. template < typename _Alloc , typename _Tp >
  22857. struct __alloctr_rebind < _Alloc , _Tp , true >
  22858. {
  22859. typedef typename _Alloc :: template rebind < _Tp > :: other __type ;
  22860. } ;
  22861.  
  22862. template < template < typename , typename ... > class _Alloc , typename _Tp ,
  22863. typename _Up , typename ... _Args >
  22864. struct __alloctr_rebind < _Alloc < _Up , _Args ... > , _Tp , false >
  22865. {
  22866. typedef _Alloc < _Tp , _Args ... > __type ;
  22867. } ;
  22868.  
  22869.  
  22870.  
  22871.  
  22872.  
  22873. template < typename _Alloc >
  22874. struct allocator_traits
  22875. {
  22876.  
  22877. typedef _Alloc allocator_type ;
  22878.  
  22879. typedef typename _Alloc :: value_type value_type ;
  22880. #100
  22881. private : template < typename _Tp > static typename _Tp :: pointer _S_pointer_helper ( _Tp * ) ; static value_type * _S_pointer_helper
  22882. #100
  22883. ( ... ) ; typedef decltype ( _S_pointer_helper ( ( _Alloc * ) 0 ) ) __pointer ; public :
  22884. #107
  22885. typedef __pointer pointer ;
  22886.  
  22887.  
  22888. private : template < typename _Tp > static typename _Tp :: const_pointer _S_const_pointer_helper ( _Tp * ) ; static typename
  22889. #110
  22890. pointer_traits < pointer > :: template rebind < const value_type > _S_const_pointer_helper ( ... ) ; typedef decltype ( _S_const_pointer_helper
  22891. #110
  22892. ( ( _Alloc * ) 0 ) ) __const_pointer ; public :
  22893. #118
  22894. typedef __const_pointer const_pointer ;
  22895.  
  22896.  
  22897. private : template < typename _Tp > static typename _Tp :: void_pointer _S_void_pointer_helper ( _Tp * ) ; static typename
  22898. #121
  22899. pointer_traits < pointer > :: template rebind < void > _S_void_pointer_helper ( ... ) ; typedef decltype ( _S_void_pointer_helper
  22900. #121
  22901. ( ( _Alloc * ) 0 ) ) __void_pointer ; public :
  22902. #129
  22903. typedef __void_pointer void_pointer ;
  22904.  
  22905.  
  22906. private : template < typename _Tp > static typename _Tp :: const_void_pointer _S_const_void_pointer_helper ( _Tp * ) ; static
  22907. #132
  22908. typename pointer_traits < pointer > :: template rebind < const void > _S_const_void_pointer_helper ( ... ) ; typedef decltype
  22909. #132
  22910. ( _S_const_void_pointer_helper ( ( _Alloc * ) 0 ) ) __const_void_pointer ; public :
  22911. #140
  22912. typedef __const_void_pointer const_void_pointer ;
  22913.  
  22914.  
  22915. private : template < typename _Tp > static typename _Tp :: difference_type _S_difference_type_helper ( _Tp * ) ; static typename
  22916. #143
  22917. pointer_traits < pointer > :: difference_type _S_difference_type_helper ( ... ) ; typedef decltype ( _S_difference_type_helper
  22918. #143
  22919. ( ( _Alloc * ) 0 ) ) __difference_type ; public :
  22920. #151
  22921. typedef __difference_type difference_type ;
  22922.  
  22923.  
  22924. private : template < typename _Tp > static typename _Tp :: size_type _S_size_type_helper ( _Tp * ) ; static typename make_unsigned
  22925. #154
  22926. < difference_type > :: type _S_size_type_helper ( ... ) ; typedef decltype ( _S_size_type_helper ( ( _Alloc * ) 0 ) ) __size_type
  22927. #154
  22928. ; public :
  22929. #162
  22930. typedef __size_type size_type ;
  22931.  
  22932.  
  22933. private : template < typename _Tp > static typename _Tp :: propagate_on_container_copy_assignment _S_propagate_on_container_copy_assignment_helper
  22934. #165
  22935. ( _Tp * ) ; static false_type _S_propagate_on_container_copy_assignment_helper ( ... ) ; typedef decltype ( _S_propagate_on_container_copy_assignment_helper
  22936. #165
  22937. ( ( _Alloc * ) 0 ) ) __propagate_on_container_copy_assignment ; public :
  22938. #173
  22939. typedef __propagate_on_container_copy_assignment
  22940. propagate_on_container_copy_assignment ;
  22941.  
  22942.  
  22943. private : template < typename _Tp > static typename _Tp :: propagate_on_container_move_assignment _S_propagate_on_container_move_assignment_helper
  22944. #177
  22945. ( _Tp * ) ; static false_type _S_propagate_on_container_move_assignment_helper ( ... ) ; typedef decltype ( _S_propagate_on_container_move_assignment_helper
  22946. #177
  22947. ( ( _Alloc * ) 0 ) ) __propagate_on_container_move_assignment ; public :
  22948. #185
  22949. typedef __propagate_on_container_move_assignment
  22950. propagate_on_container_move_assignment ;
  22951.  
  22952.  
  22953. private : template < typename _Tp > static typename _Tp :: propagate_on_container_swap _S_propagate_on_container_swap_helper
  22954. #189
  22955. ( _Tp * ) ; static false_type _S_propagate_on_container_swap_helper ( ... ) ; typedef decltype ( _S_propagate_on_container_swap_helper
  22956. #189
  22957. ( ( _Alloc * ) 0 ) ) __propagate_on_container_swap ; public :
  22958. #197
  22959. typedef __propagate_on_container_swap propagate_on_container_swap ;
  22960.  
  22961.  
  22962.  
  22963. template < typename _Tp >
  22964. using rebind_alloc = typename __alloctr_rebind < _Alloc , _Tp > :: __type ;
  22965. template < typename _Tp >
  22966. using rebind_traits = allocator_traits < rebind_alloc < _Tp >> ;
  22967.  
  22968. private :
  22969. template < typename _Alloc2 >
  22970. struct __allocate_helper
  22971. {
  22972. template < typename _Alloc3 ,
  22973. typename = decltype ( std :: declval < _Alloc3 * > ( ) -> allocate (
  22974. std :: declval < size_type > ( ) ,
  22975. std :: declval < const_void_pointer > ( ) ) ) >
  22976. static true_type __test ( int ) ;
  22977.  
  22978. template < typename >
  22979. static false_type __test ( ... ) ;
  22980.  
  22981. typedef decltype ( __test < _Alloc > ( 0 ) ) type ;
  22982. static const bool value = type :: value ;
  22983. } ;
  22984.  
  22985. template < typename _Alloc2 >
  22986. static typename
  22987. enable_if < __allocate_helper < _Alloc2 > :: value , pointer > :: type
  22988. _S_allocate ( _Alloc2 & __a , size_type __n , const_void_pointer __hint )
  22989. { return __a . allocate ( __n , __hint ) ; }
  22990.  
  22991. template < typename _Alloc2 >
  22992. static typename
  22993. enable_if < ! __allocate_helper < _Alloc2 > :: value , pointer > :: type
  22994. _S_allocate ( _Alloc2 & __a , size_type __n , ... )
  22995. { return __a . allocate ( __n ) ; }
  22996.  
  22997. template < typename _Tp , typename ... _Args >
  22998. struct __construct_helper
  22999. {
  23000. template < typename _Alloc2 ,
  23001. typename = decltype ( std :: declval < _Alloc2 * > ( ) -> construct (
  23002. std :: declval < _Tp * > ( ) , std :: declval < _Args > ( ) ... ) ) >
  23003. static true_type __test ( int ) ;
  23004.  
  23005. template < typename >
  23006. static false_type __test ( ... ) ;
  23007.  
  23008. typedef decltype ( __test < _Alloc > ( 0 ) ) type ;
  23009. static const bool value = type :: value ;
  23010. } ;
  23011.  
  23012. template < typename _Tp , typename ... _Args >
  23013. static typename
  23014. enable_if < __construct_helper < _Tp , _Args ... > :: value , void > :: type
  23015. _S_construct ( _Alloc & __a , _Tp * __p , _Args && ... __args )
  23016. { __a . construct ( __p , std :: forward < _Args > ( __args ) ... ) ; }
  23017.  
  23018. template < typename _Tp , typename ... _Args >
  23019. static typename
  23020. enable_if < __and_ < __not_ < __construct_helper < _Tp , _Args ... >> ,
  23021. is_constructible < _Tp , _Args ... >> :: value , void > :: type
  23022. _S_construct ( _Alloc & , _Tp * __p , _Args && ... __args )
  23023. { :: new ( ( void * ) __p ) _Tp ( std :: forward < _Args > ( __args ) ... ) ; }
  23024.  
  23025. template < typename _Tp >
  23026. struct __destroy_helper
  23027. {
  23028. template < typename _Alloc2 ,
  23029. typename = decltype ( std :: declval < _Alloc2 * > ( ) -> destroy (
  23030. std :: declval < _Tp * > ( ) ) ) >
  23031. static true_type __test ( int ) ;
  23032.  
  23033. template < typename >
  23034. static false_type __test ( ... ) ;
  23035.  
  23036. typedef decltype ( __test < _Alloc > ( 0 ) ) type ;
  23037. static const bool value = type :: value ;
  23038. } ;
  23039.  
  23040. template < typename _Tp >
  23041. static typename enable_if < __destroy_helper < _Tp > :: value , void > :: type
  23042. _S_destroy ( _Alloc & __a , _Tp * __p )
  23043. { __a . destroy ( __p ) ; }
  23044.  
  23045. template < typename _Tp >
  23046. static typename enable_if < ! __destroy_helper < _Tp > :: value , void > :: type
  23047. _S_destroy ( _Alloc & , _Tp * __p )
  23048. { __p -> ~ _Tp ( ) ; }
  23049.  
  23050. template < typename _Alloc2 >
  23051. struct __maxsize_helper
  23052. {
  23053. template < typename _Alloc3 ,
  23054. typename = decltype ( std :: declval < _Alloc3 * > ( ) -> max_size ( ) ) >
  23055. static true_type __test ( int ) ;
  23056.  
  23057. template < typename >
  23058. static false_type __test ( ... ) ;
  23059.  
  23060. typedef decltype ( __test < _Alloc2 > ( 0 ) ) type ;
  23061. static const bool value = type :: value ;
  23062. } ;
  23063.  
  23064. template < typename _Alloc2 >
  23065. static typename
  23066. enable_if < __maxsize_helper < _Alloc2 > :: value , size_type > :: type
  23067. _S_max_size ( _Alloc2 & __a )
  23068. { return __a . max_size ( ) ; }
  23069.  
  23070. template < typename _Alloc2 >
  23071. static typename
  23072. enable_if < ! __maxsize_helper < _Alloc2 > :: value , size_type > :: type
  23073. _S_max_size ( _Alloc2 & )
  23074. { return __gnu_cxx :: __numeric_traits < size_type > :: __max ; }
  23075.  
  23076. template < typename _Alloc2 >
  23077. struct __select_helper
  23078. {
  23079. template < typename _Alloc3 , typename
  23080. = decltype ( std :: declval < _Alloc3 * > ( )
  23081. -> select_on_container_copy_construction ( ) ) >
  23082. static true_type __test ( int ) ;
  23083.  
  23084. template < typename >
  23085. static false_type __test ( ... ) ;
  23086.  
  23087. typedef decltype ( __test < _Alloc2 > ( 0 ) ) type ;
  23088. static const bool value = type :: value ;
  23089. } ;
  23090. template < typename _Alloc2 >
  23091. static typename
  23092. enable_if < __select_helper < _Alloc2 > :: value , _Alloc2 > :: type
  23093. _S_select ( _Alloc2 & __a )
  23094. { return __a . select_on_container_copy_construction ( ) ; }
  23095.  
  23096. template < typename _Alloc2 >
  23097. static typename
  23098. enable_if < ! __select_helper < _Alloc2 > :: value , _Alloc2 > :: type
  23099. _S_select ( _Alloc2 & __a )
  23100. { return __a ; }
  23101.  
  23102. public :
  23103. #349
  23104. static pointer
  23105. allocate ( _Alloc & __a , size_type __n )
  23106. { return __a . allocate ( __n ) ; }
  23107. #364
  23108. static pointer
  23109. allocate ( _Alloc & __a , size_type __n , const_void_pointer __hint )
  23110. { return _S_allocate ( __a , __n , __hint ) ; }
  23111. #376
  23112. static void deallocate ( _Alloc & __a , pointer __p , size_type __n )
  23113. { __a . deallocate ( __p , __n ) ; }
  23114. #390
  23115. template < typename _Tp , typename ... _Args >
  23116. static auto construct ( _Alloc & __a , _Tp * __p , _Args && ... __args )
  23117. -> decltype ( _S_construct ( __a , __p , std :: forward < _Args > ( __args ) ... ) )
  23118. { _S_construct ( __a , __p , std :: forward < _Args > ( __args ) ... ) ; }
  23119. #403
  23120. template < class _Tp >
  23121. static void destroy ( _Alloc & __a , _Tp * __p )
  23122. { _S_destroy ( __a , __p ) ; }
  23123. #415
  23124. static size_type max_size ( const _Alloc & __a )
  23125. { return _S_max_size ( __a ) ; }
  23126. #426
  23127. static _Alloc
  23128. select_on_container_copy_construction ( const _Alloc & __rhs )
  23129. { return _S_select ( __rhs ) ; }
  23130. } ;
  23131.  
  23132. template < typename _Alloc >
  23133. template < typename _Alloc2 >
  23134. const bool allocator_traits < _Alloc > :: __allocate_helper < _Alloc2 > :: value ;
  23135.  
  23136. template < typename _Alloc >
  23137. template < typename _Tp , typename ... _Args >
  23138. const bool
  23139. allocator_traits < _Alloc > :: __construct_helper < _Tp , _Args ... > :: value ;
  23140.  
  23141. template < typename _Alloc >
  23142. template < typename _Tp >
  23143. const bool allocator_traits < _Alloc > :: __destroy_helper < _Tp > :: value ;
  23144.  
  23145. template < typename _Alloc >
  23146. template < typename _Alloc2 >
  23147. const bool allocator_traits < _Alloc > :: __maxsize_helper < _Alloc2 > :: value ;
  23148.  
  23149. template < typename _Alloc >
  23150. template < typename _Alloc2 >
  23151. const bool allocator_traits < _Alloc > :: __select_helper < _Alloc2 > :: value ;
  23152.  
  23153. template < typename _Alloc >
  23154. inline void
  23155. __do_alloc_on_copy ( _Alloc & __one , const _Alloc & __two , true_type )
  23156. { __one = __two ; }
  23157.  
  23158. template < typename _Alloc >
  23159. inline void
  23160. __do_alloc_on_copy ( _Alloc & , const _Alloc & , false_type )
  23161. { }
  23162.  
  23163. template < typename _Alloc >
  23164. inline void __alloc_on_copy ( _Alloc & __one , const _Alloc & __two )
  23165. {
  23166. typedef allocator_traits < _Alloc > __traits ;
  23167. typedef typename __traits :: propagate_on_container_copy_assignment __pocca ;
  23168. __do_alloc_on_copy ( __one , __two , __pocca ( ) ) ;
  23169. }
  23170.  
  23171. template < typename _Alloc >
  23172. inline _Alloc __alloc_on_copy ( const _Alloc & __a )
  23173. {
  23174. typedef allocator_traits < _Alloc > __traits ;
  23175. return __traits :: select_on_container_copy_construction ( __a ) ;
  23176. }
  23177.  
  23178. template < typename _Alloc >
  23179. inline void __do_alloc_on_move ( _Alloc & __one , _Alloc & __two , true_type )
  23180. { __one = std :: move ( __two ) ; }
  23181.  
  23182. template < typename _Alloc >
  23183. inline void __do_alloc_on_move ( _Alloc & , _Alloc & , false_type )
  23184. { }
  23185.  
  23186. template < typename _Alloc >
  23187. inline void __alloc_on_move ( _Alloc & __one , _Alloc & __two )
  23188. {
  23189. typedef allocator_traits < _Alloc > __traits ;
  23190. typedef typename __traits :: propagate_on_container_move_assignment __pocma ;
  23191. __do_alloc_on_move ( __one , __two , __pocma ( ) ) ;
  23192. }
  23193.  
  23194. template < typename _Alloc >
  23195. inline void __do_alloc_on_swap ( _Alloc & __one , _Alloc & __two , true_type )
  23196. {
  23197. using std :: swap ;
  23198. swap ( __one , __two ) ;
  23199. }
  23200.  
  23201. template < typename _Alloc >
  23202. inline void __do_alloc_on_swap ( _Alloc & , _Alloc & , false_type )
  23203. { }
  23204.  
  23205. template < typename _Alloc >
  23206. inline void __alloc_on_swap ( _Alloc & __one , _Alloc & __two )
  23207. {
  23208. typedef allocator_traits < _Alloc > __traits ;
  23209. typedef typename __traits :: propagate_on_container_swap __pocs ;
  23210. __do_alloc_on_swap ( __one , __two , __pocs ( ) ) ;
  23211. }
  23212.  
  23213. template < typename _Alloc >
  23214. class __is_copy_insertable_impl
  23215. {
  23216. typedef allocator_traits < _Alloc > _Traits ;
  23217.  
  23218. template < typename _Up , typename
  23219. = decltype ( _Traits :: construct ( std :: declval < _Alloc & > ( ) ,
  23220. std :: declval < _Up * > ( ) ,
  23221. std :: declval < const _Up & > ( ) ) ) >
  23222. static true_type
  23223. _M_select ( int ) ;
  23224.  
  23225. template < typename _Up >
  23226. static false_type
  23227. _M_select ( ... ) ;
  23228.  
  23229. public :
  23230. typedef decltype ( _M_select < typename _Alloc :: value_type > ( 0 ) ) type ;
  23231. } ;
  23232.  
  23233.  
  23234. template < typename _Alloc >
  23235. struct __is_copy_insertable
  23236. : __is_copy_insertable_impl < _Alloc > :: type
  23237. { } ;
  23238.  
  23239.  
  23240. template < typename _Tp >
  23241. struct __is_copy_insertable < allocator < _Tp >>
  23242. : is_copy_constructible < _Tp >
  23243. { } ;
  23244.  
  23245.  
  23246. template < bool > struct __allow_copy_cons { } ;
  23247.  
  23248.  
  23249. template < >
  23250. struct __allow_copy_cons < false >
  23251. {
  23252. __allow_copy_cons ( ) = default ;
  23253. __allow_copy_cons ( const __allow_copy_cons & ) = delete ;
  23254. __allow_copy_cons ( __allow_copy_cons && ) = default ;
  23255. __allow_copy_cons & operator = ( const __allow_copy_cons & ) = default ;
  23256. __allow_copy_cons & operator = ( __allow_copy_cons && ) = default ;
  23257. } ;
  23258.  
  23259. template < typename _Alloc >
  23260. using __check_copy_constructible
  23261. = __allow_copy_cons < __is_copy_insertable < _Alloc > :: value > ;
  23262.  
  23263.  
  23264. }
  23265. #41 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/alloc_traits.h"
  23266. namespace __gnu_cxx
  23267. {
  23268.  
  23269.  
  23270.  
  23271. template < typename _Alloc >
  23272. struct __allocator_always_compares_equal
  23273. { static const bool value = false ; } ;
  23274.  
  23275. template < typename _Alloc >
  23276. const bool __allocator_always_compares_equal < _Alloc > :: value ;
  23277.  
  23278. template < typename _Tp >
  23279. struct __allocator_always_compares_equal < std :: allocator < _Tp >>
  23280. { static const bool value = true ; } ;
  23281.  
  23282. template < typename _Tp >
  23283. const bool __allocator_always_compares_equal < std :: allocator < _Tp >> :: value ;
  23284.  
  23285. template < typename , typename > struct array_allocator ;
  23286.  
  23287. template < typename _Tp , typename _Array >
  23288. struct __allocator_always_compares_equal < array_allocator < _Tp , _Array >>
  23289. { static const bool value = true ; } ;
  23290.  
  23291. template < typename _Tp , typename _Array >
  23292. const bool
  23293. __allocator_always_compares_equal < array_allocator < _Tp , _Array >> :: value ;
  23294.  
  23295. template < typename > struct bitmap_allocator ;
  23296.  
  23297. template < typename _Tp >
  23298. struct __allocator_always_compares_equal < bitmap_allocator < _Tp >>
  23299. { static const bool value = true ; } ;
  23300.  
  23301. template < typename _Tp >
  23302. const bool __allocator_always_compares_equal < bitmap_allocator < _Tp >> :: value ;
  23303.  
  23304. template < typename > struct malloc_allocator ;
  23305.  
  23306. template < typename _Tp >
  23307. struct __allocator_always_compares_equal < malloc_allocator < _Tp >>
  23308. { static const bool value = true ; } ;
  23309.  
  23310. template < typename _Tp >
  23311. const bool __allocator_always_compares_equal < malloc_allocator < _Tp >> :: value ;
  23312.  
  23313. template < typename > struct mt_allocator ;
  23314.  
  23315. template < typename _Tp >
  23316. struct __allocator_always_compares_equal < mt_allocator < _Tp >>
  23317. { static const bool value = true ; } ;
  23318.  
  23319. template < typename _Tp >
  23320. const bool __allocator_always_compares_equal < mt_allocator < _Tp >> :: value ;
  23321.  
  23322. template < typename > struct new_allocator ;
  23323.  
  23324. template < typename _Tp >
  23325. struct __allocator_always_compares_equal < new_allocator < _Tp >>
  23326. { static const bool value = true ; } ;
  23327.  
  23328. template < typename _Tp >
  23329. const bool __allocator_always_compares_equal < new_allocator < _Tp >> :: value ;
  23330.  
  23331. template < typename > struct pool_allocator ;
  23332.  
  23333. template < typename _Tp >
  23334. struct __allocator_always_compares_equal < pool_allocator < _Tp >>
  23335. { static const bool value = true ; } ;
  23336.  
  23337. template < typename _Tp >
  23338. const bool __allocator_always_compares_equal < pool_allocator < _Tp >> :: value ;
  23339. #120
  23340. template < typename _Alloc >
  23341. struct __alloc_traits
  23342.  
  23343. : std :: allocator_traits < _Alloc >
  23344.  
  23345. {
  23346. typedef _Alloc allocator_type ;
  23347.  
  23348. typedef std :: allocator_traits < _Alloc > _Base_type ;
  23349. typedef typename _Base_type :: value_type value_type ;
  23350. typedef typename _Base_type :: pointer pointer ;
  23351. typedef typename _Base_type :: const_pointer const_pointer ;
  23352. typedef typename _Base_type :: size_type size_type ;
  23353. typedef typename _Base_type :: difference_type difference_type ;
  23354.  
  23355. typedef value_type & reference ;
  23356. typedef const value_type & const_reference ;
  23357. using _Base_type :: allocate ;
  23358. using _Base_type :: deallocate ;
  23359. using _Base_type :: construct ;
  23360. using _Base_type :: destroy ;
  23361. using _Base_type :: max_size ;
  23362.  
  23363. private :
  23364. template < typename _Ptr >
  23365. struct __is_custom_pointer
  23366. : std :: integral_constant < bool , std :: is_same < pointer , _Ptr > :: value
  23367. && ! std :: is_pointer < _Ptr > :: value >
  23368. { } ;
  23369.  
  23370. public :
  23371.  
  23372. template < typename _Ptr , typename ... _Args >
  23373. static typename std :: enable_if < __is_custom_pointer < _Ptr > :: value > :: type
  23374. construct ( _Alloc & __a , _Ptr __p , _Args && ... __args )
  23375. {
  23376. _Base_type :: construct ( __a , std :: addressof ( * __p ) ,
  23377. std :: forward < _Args > ( __args ) ... ) ;
  23378. }
  23379.  
  23380.  
  23381. template < typename _Ptr >
  23382. static typename std :: enable_if < __is_custom_pointer < _Ptr > :: value > :: type
  23383. destroy ( _Alloc & __a , _Ptr __p )
  23384. { _Base_type :: destroy ( __a , std :: addressof ( * __p ) ) ; }
  23385.  
  23386. static _Alloc _S_select_on_copy ( const _Alloc & __a )
  23387. { return _Base_type :: select_on_container_copy_construction ( __a ) ; }
  23388.  
  23389. static void _S_on_swap ( _Alloc & __a , _Alloc & __b )
  23390. { std :: __alloc_on_swap ( __a , __b ) ; }
  23391.  
  23392. static constexpr bool _S_propagate_on_copy_assign ( )
  23393. { return _Base_type :: propagate_on_container_copy_assignment :: value ; }
  23394.  
  23395. static constexpr bool _S_propagate_on_move_assign ( )
  23396. { return _Base_type :: propagate_on_container_move_assignment :: value ; }
  23397.  
  23398. static constexpr bool _S_propagate_on_swap ( )
  23399. { return _Base_type :: propagate_on_container_swap :: value ; }
  23400.  
  23401. static constexpr bool _S_always_equal ( )
  23402. { return __allocator_always_compares_equal < _Alloc > :: value ; }
  23403.  
  23404. static constexpr bool _S_nothrow_move ( )
  23405. { return _S_propagate_on_move_assign ( ) || _S_always_equal ( ) ; }
  23406.  
  23407. static constexpr bool _S_nothrow_swap ( )
  23408. {
  23409. using std :: swap ;
  23410. return ! _S_propagate_on_swap ( )
  23411. || noexcept ( swap ( std :: declval < _Alloc & > ( ) , std :: declval < _Alloc & > ( ) ) ) ;
  23412. }
  23413.  
  23414. template < typename _Tp >
  23415. struct rebind
  23416. { typedef typename _Base_type :: template rebind_alloc < _Tp > other ; } ;
  23417. #237
  23418. } ;
  23419.  
  23420.  
  23421. }
  23422. #63 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_construct.h"
  23423. namespace std
  23424. {
  23425. #72
  23426. template < typename _T1 , typename ... _Args >
  23427. inline void
  23428. _Construct ( _T1 * __p , _Args && ... __args )
  23429. { :: new ( static_cast < void * > ( __p ) ) _T1 ( std :: forward < _Args > ( __args ) ... ) ; }
  23430. #90
  23431. template < typename _Tp >
  23432. inline void
  23433. _Destroy ( _Tp * __pointer )
  23434. { __pointer -> ~ _Tp ( ) ; }
  23435.  
  23436. template < bool >
  23437. struct _Destroy_aux
  23438. {
  23439. template < typename _ForwardIterator >
  23440. static void
  23441. __destroy ( _ForwardIterator __first , _ForwardIterator __last )
  23442. {
  23443. for ( ; __first != __last ; ++ __first )
  23444. std :: _Destroy ( std :: __addressof ( * __first ) ) ;
  23445. }
  23446. } ;
  23447.  
  23448. template < >
  23449. struct _Destroy_aux < true >
  23450. {
  23451. template < typename _ForwardIterator >
  23452. static void
  23453. __destroy ( _ForwardIterator , _ForwardIterator ) { }
  23454. } ;
  23455. #120
  23456. template < typename _ForwardIterator >
  23457. inline void
  23458. _Destroy ( _ForwardIterator __first , _ForwardIterator __last )
  23459. {
  23460. typedef typename iterator_traits < _ForwardIterator > :: value_type
  23461. _Value_type ;
  23462. std :: _Destroy_aux < __oracle_has_trivial_destructor ( _Value_type ) > ::
  23463. __destroy ( __first , __last ) ;
  23464. }
  23465. #136
  23466. template < typename _ForwardIterator , typename _Allocator >
  23467. void
  23468. _Destroy ( _ForwardIterator __first , _ForwardIterator __last ,
  23469. _Allocator & __alloc )
  23470. {
  23471. typedef __gnu_cxx :: __alloc_traits < _Allocator > __traits ;
  23472. for ( ; __first != __last ; ++ __first )
  23473. __traits :: destroy ( __alloc , std :: __addressof ( * __first ) ) ;
  23474. }
  23475.  
  23476. template < typename _ForwardIterator , typename _Tp >
  23477. inline void
  23478. _Destroy ( _ForwardIterator __first , _ForwardIterator __last ,
  23479. allocator < _Tp > & )
  23480. {
  23481. _Destroy ( __first , __last ) ;
  23482. }
  23483.  
  23484.  
  23485. }
  23486. #62 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_tempbuf.h"
  23487. namespace std
  23488. {
  23489. #83
  23490. template < typename _Tp >
  23491. pair < _Tp * , ptrdiff_t >
  23492. get_temporary_buffer ( ptrdiff_t __len ) noexcept
  23493. {
  23494. const ptrdiff_t __max =
  23495. __gnu_cxx :: __numeric_traits < ptrdiff_t > :: __max / sizeof ( _Tp ) ;
  23496. if ( __len > __max )
  23497. __len = __max ;
  23498.  
  23499. while ( __len > 0 )
  23500. {
  23501. _Tp * __tmp = static_cast < _Tp * > ( :: operator new ( __len * sizeof ( _Tp ) ,
  23502. std :: nothrow ) ) ;
  23503. if ( __tmp != 0 )
  23504. return std :: pair < _Tp * , ptrdiff_t > ( __tmp , __len ) ;
  23505. __len /= 2 ;
  23506. }
  23507. return std :: pair < _Tp * , ptrdiff_t > ( static_cast < _Tp * > ( 0 ) , 0 ) ;
  23508. }
  23509. #110
  23510. template < typename _Tp >
  23511. inline void
  23512. return_temporary_buffer ( _Tp * __p )
  23513. { :: operator delete ( __p , std :: nothrow ) ; }
  23514. #121
  23515. template < typename _ForwardIterator , typename _Tp >
  23516. class _Temporary_buffer
  23517. {
  23518.  
  23519.  
  23520.  
  23521. public :
  23522. typedef _Tp value_type ;
  23523. typedef value_type * pointer ;
  23524. typedef pointer iterator ;
  23525. typedef ptrdiff_t size_type ;
  23526.  
  23527. protected :
  23528. size_type _M_original_len ;
  23529. size_type _M_len ;
  23530. pointer _M_buffer ;
  23531.  
  23532. public :
  23533.  
  23534. size_type
  23535. size ( ) const
  23536. { return _M_len ; }
  23537.  
  23538.  
  23539. size_type
  23540. requested_size ( ) const
  23541. { return _M_original_len ; }
  23542.  
  23543.  
  23544. iterator
  23545. begin ( )
  23546. { return _M_buffer ; }
  23547.  
  23548.  
  23549. iterator
  23550. end ( )
  23551. { return _M_buffer + _M_len ; }
  23552.  
  23553.  
  23554.  
  23555.  
  23556.  
  23557. _Temporary_buffer ( _ForwardIterator __first , _ForwardIterator __last ) ;
  23558.  
  23559. ~ _Temporary_buffer ( )
  23560. {
  23561. std :: _Destroy ( _M_buffer , _M_buffer + _M_len ) ;
  23562. std :: return_temporary_buffer ( _M_buffer ) ;
  23563. }
  23564.  
  23565. private :
  23566.  
  23567. _Temporary_buffer ( const _Temporary_buffer & ) ;
  23568.  
  23569. void
  23570. operator = ( const _Temporary_buffer & ) ;
  23571. } ;
  23572.  
  23573.  
  23574. template < bool >
  23575. struct __uninitialized_construct_buf_dispatch
  23576. {
  23577. template < typename _Pointer , typename _ForwardIterator >
  23578. static void
  23579. __ucr ( _Pointer __first , _Pointer __last ,
  23580. _ForwardIterator __seed )
  23581. {
  23582. if ( __first == __last )
  23583. return ;
  23584.  
  23585. _Pointer __cur = __first ;
  23586. try
  23587. {
  23588. std :: _Construct ( std :: __addressof ( * __first ) ,
  23589. std :: move ( * __seed ) ) ;
  23590. _Pointer __prev = __cur ;
  23591. ++ __cur ;
  23592. for ( ; __cur != __last ; ++ __cur , ++ __prev )
  23593. std :: _Construct ( std :: __addressof ( * __cur ) ,
  23594. std :: move ( * __prev ) ) ;
  23595. * __seed = std :: move ( * __prev ) ;
  23596. }
  23597. catch ( ... )
  23598. {
  23599. std :: _Destroy ( __first , __cur ) ;
  23600. throw ;
  23601. }
  23602. }
  23603. } ;
  23604.  
  23605. template < >
  23606. struct __uninitialized_construct_buf_dispatch < true >
  23607. {
  23608. template < typename _Pointer , typename _ForwardIterator >
  23609. static void
  23610. __ucr ( _Pointer , _Pointer , _ForwardIterator ) { }
  23611. } ;
  23612. #229
  23613. template < typename _Pointer , typename _ForwardIterator >
  23614. inline void
  23615. __uninitialized_construct_buf ( _Pointer __first , _Pointer __last ,
  23616. _ForwardIterator __seed )
  23617. {
  23618. typedef typename std :: iterator_traits < _Pointer > :: value_type
  23619. _ValueType ;
  23620.  
  23621. std :: __uninitialized_construct_buf_dispatch <
  23622. __oracle_has_trivial_constructor ( _ValueType ) > ::
  23623. __ucr ( __first , __last , __seed ) ;
  23624. }
  23625.  
  23626. template < typename _ForwardIterator , typename _Tp >
  23627. _Temporary_buffer < _ForwardIterator , _Tp > ::
  23628. _Temporary_buffer ( _ForwardIterator __first , _ForwardIterator __last )
  23629. : _M_original_len ( std :: distance ( __first , __last ) ) ,
  23630. _M_len ( 0 ) , _M_buffer ( 0 )
  23631. {
  23632. try
  23633. {
  23634. std :: pair < pointer , size_type > __p ( std :: get_temporary_buffer <
  23635. value_type > ( _M_original_len ) ) ;
  23636. _M_buffer = __p . first ;
  23637. _M_len = __p . second ;
  23638. if ( _M_buffer )
  23639. std :: __uninitialized_construct_buf ( _M_buffer , _M_buffer + _M_len ,
  23640. __first ) ;
  23641. }
  23642. catch ( ... )
  23643. {
  23644. std :: return_temporary_buffer ( _M_buffer ) ;
  23645. _M_buffer = 0 ;
  23646. _M_len = 0 ;
  23647. throw ;
  23648. }
  23649. }
  23650.  
  23651.  
  23652. }
  23653. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/random"
  23654. #32
  23655. #pragma GCC system_header
  23656. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cmath"
  23657. #39
  23658. #pragma GCC system_header
  23659. #1 "/usr/include/math.h"
  23660. #9
  23661. #pragma ident "@(#)math.h   2.25    09/05/19 SMI"
  23662. #1 "/usr/include/iso/math_iso.h"
  23663. #9
  23664. #pragma ident "@(#)math_iso.h   1.9 04/10/23 SMI"
  23665. #14
  23666. extern "C" {
  23667. #26
  23668. typedef union _h_val {
  23669. unsigned long _i [ sizeof ( double ) / sizeof ( unsigned long ) ] ;
  23670. double _d ;
  23671. } _h_val ;
  23672.  
  23673.  
  23674. extern const _h_val __huge_val ;
  23675. #41
  23676. namespace std {
  23677.  
  23678.  
  23679. extern double acos ( double ) ;
  23680. extern double asin ( double ) ;
  23681. extern double atan ( double ) ;
  23682. extern double atan2 ( double , double ) ;
  23683. extern double cos ( double ) ;
  23684. extern double sin ( double ) ;
  23685. extern double tan ( double ) ;
  23686.  
  23687. extern double cosh ( double ) ;
  23688. extern double sinh ( double ) ;
  23689. extern double tanh ( double ) ;
  23690.  
  23691. extern double exp ( double ) ;
  23692. extern double frexp ( double , int * ) ;
  23693. extern double ldexp ( double , int ) ;
  23694. extern double log ( double ) ;
  23695. extern double log10 ( double ) ;
  23696. extern double modf ( double , double * ) ;
  23697.  
  23698. extern double pow ( double , double ) ;
  23699. extern double sqrt ( double ) ;
  23700.  
  23701. extern double ceil ( double ) ;
  23702. extern double fabs ( double ) ;
  23703. extern double floor ( double ) ;
  23704. extern double fmod ( double , double ) ;
  23705. #90
  23706. extern float __acosf ( float ) ;
  23707. extern float __asinf ( float ) ;
  23708. extern float __atanf ( float ) ;
  23709. extern float __atan2f ( float , float ) ;
  23710. extern float __ceilf ( float ) ;
  23711. extern float __cosf ( float ) ;
  23712. extern float __coshf ( float ) ;
  23713. extern float __expf ( float ) ;
  23714. extern float __fabsf ( float ) ;
  23715. extern float __floorf ( float ) ;
  23716. extern float __fmodf ( float , float ) ;
  23717. extern float __frexpf ( float , int * ) ;
  23718. extern float __ldexpf ( float , int ) ;
  23719. extern float __logf ( float ) ;
  23720. extern float __log10f ( float ) ;
  23721. extern float __modff ( float , float * ) ;
  23722. extern float __powf ( float , float ) ;
  23723. extern float __sinf ( float ) ;
  23724. extern float __sinhf ( float ) ;
  23725. extern float __sqrtf ( float ) ;
  23726. extern float __tanf ( float ) ;
  23727. extern float __tanhf ( float ) ;
  23728.  
  23729. extern long double __acosl ( long double ) ;
  23730. extern long double __asinl ( long double ) ;
  23731. extern long double __atanl ( long double ) ;
  23732. extern long double __atan2l ( long double , long double ) ;
  23733. extern long double __ceill ( long double ) ;
  23734. extern long double __cosl ( long double ) ;
  23735. extern long double __coshl ( long double ) ;
  23736. extern long double __expl ( long double ) ;
  23737. extern long double __fabsl ( long double ) ;
  23738. extern long double __floorl ( long double ) ;
  23739. extern long double __fmodl ( long double , long double ) ;
  23740. extern long double __frexpl ( long double , int * ) ;
  23741. extern long double __ldexpl ( long double , int ) ;
  23742. extern long double __logl ( long double ) ;
  23743. extern long double __log10l ( long double ) ;
  23744. extern long double __modfl ( long double , long double * ) ;
  23745. extern long double __powl ( long double , long double ) ;
  23746. extern long double __sinl ( long double ) ;
  23747. extern long double __sinhl ( long double ) ;
  23748. extern long double __sqrtl ( long double ) ;
  23749. extern long double __tanl ( long double ) ;
  23750. extern long double __tanhl ( long double ) ;
  23751.  
  23752. extern "C++" {
  23753.  
  23754.  
  23755. inline double abs ( double __X ) { return fabs ( __X ) ; }
  23756. inline double pow ( double __X , int __Y ) { return
  23757. pow ( __X , ( double ) ( __Y ) ) ; }
  23758.  
  23759. inline float abs ( float __X ) { return __fabsf ( __X ) ; }
  23760. inline float acos ( float __X ) { return __acosf ( __X ) ; }
  23761. inline float asin ( float __X ) { return __asinf ( __X ) ; }
  23762. inline float atan ( float __X ) { return __atanf ( __X ) ; }
  23763. inline float atan2 ( float __X , float __Y ) { return __atan2f ( __X , __Y ) ; }
  23764. inline float ceil ( float __X ) { return __ceilf ( __X ) ; }
  23765. inline float cos ( float __X ) { return __cosf ( __X ) ; }
  23766. inline float cosh ( float __X ) { return __coshf ( __X ) ; }
  23767. inline float exp ( float __X ) { return __expf ( __X ) ; }
  23768. inline float fabs ( float __X ) { return __fabsf ( __X ) ; }
  23769. inline float floor ( float __X ) { return __floorf ( __X ) ; }
  23770. inline float fmod ( float __X , float __Y ) { return __fmodf ( __X , __Y ) ; }
  23771. inline float frexp ( float __X , int * __Y ) { return __frexpf ( __X , __Y ) ; }
  23772. inline float ldexp ( float __X , int __Y ) { return __ldexpf ( __X , __Y ) ; }
  23773. inline float log ( float __X ) { return __logf ( __X ) ; }
  23774. inline float log10 ( float __X ) { return __log10f ( __X ) ; }
  23775. inline float modf ( float __X , float * __Y ) { return __modff ( __X , __Y ) ; }
  23776. inline float pow ( float __X , float __Y ) { return __powf ( __X , __Y ) ; }
  23777. inline float pow ( float __X , int __Y ) { return
  23778. pow ( ( double ) ( __X ) , ( double ) ( __Y ) ) ; }
  23779. inline float sin ( float __X ) { return __sinf ( __X ) ; }
  23780. inline float sinh ( float __X ) { return __sinhf ( __X ) ; }
  23781. inline float sqrt ( float __X ) { return __sqrtf ( __X ) ; }
  23782. inline float tan ( float __X ) { return __tanf ( __X ) ; }
  23783. inline float tanh ( float __X ) { return __tanhf ( __X ) ; }
  23784.  
  23785. inline long double abs ( long double __X ) { return __fabsl ( __X ) ; }
  23786. inline long double acos ( long double __X ) { return __acosl ( __X ) ; }
  23787. inline long double asin ( long double __X ) { return __asinl ( __X ) ; }
  23788. inline long double atan ( long double __X ) { return __atanl ( __X ) ; }
  23789. inline long double atan2 ( long double __X , long double __Y ) { return
  23790. __atan2l ( __X , __Y ) ; }
  23791. inline long double ceil ( long double __X ) { return __ceill ( __X ) ; }
  23792. inline long double cos ( long double __X ) { return __cosl ( __X ) ; }
  23793. inline long double cosh ( long double __X ) { return __coshl ( __X ) ; }
  23794. inline long double exp ( long double __X ) { return __expl ( __X ) ; }
  23795. inline long double fabs ( long double __X ) { return __fabsl ( __X ) ; }
  23796. inline long double floor ( long double __X ) { return __floorl ( __X ) ; }
  23797. inline long double fmod ( long double __X , long double __Y ) { return
  23798. __fmodl ( __X , __Y ) ; }
  23799. inline long double frexp ( long double __X , int * __Y ) { return
  23800. __frexpl ( __X , __Y ) ; }
  23801. inline long double ldexp ( long double __X , int __Y ) { return
  23802. __ldexpl ( __X , __Y ) ; }
  23803. inline long double log ( long double __X ) { return __logl ( __X ) ; }
  23804. inline long double log10 ( long double __X ) { return __log10l ( __X ) ; }
  23805. inline long double modf ( long double __X , long double * __Y ) { return
  23806. __modfl ( __X , __Y ) ; }
  23807. inline long double pow ( long double __X , long double __Y ) { return
  23808. __powl ( __X , __Y ) ; }
  23809. inline long double pow ( long double __X , int __Y ) { return
  23810. __powl ( __X , ( long double ) ( __Y ) ) ; }
  23811. inline long double sin ( long double __X ) { return __sinl ( __X ) ; }
  23812. inline long double sinh ( long double __X ) { return __sinhl ( __X ) ; }
  23813. inline long double sqrt ( long double __X ) { return __sqrtl ( __X ) ; }
  23814. inline long double tan ( long double __X ) { return __tanl ( __X ) ; }
  23815. inline long double tanh ( long double __X ) { return __tanhl ( __X ) ; }
  23816. }
  23817.  
  23818.  
  23819.  
  23820. }
  23821.  
  23822.  
  23823.  
  23824. }
  23825. #1 "/usr/include/iso/math_c99.h"
  23826. #9
  23827. #pragma ident "@(#)math_c99.h   1.10    09/05/19 SMI"
  23828. #14
  23829. extern "C" {
  23830. #154
  23831. typedef float float_t ;
  23832. typedef double double_t ;
  23833. #206
  23834. extern double acosh ( double ) ;
  23835. extern double asinh ( double ) ;
  23836. extern double atanh ( double ) ;
  23837.  
  23838. extern double exp2 ( double ) ;
  23839. extern double expm1 ( double ) ;
  23840. extern int ilogb ( double ) ;
  23841. extern double log1p ( double ) ;
  23842. extern double log2 ( double ) ;
  23843. extern double logb ( double ) ;
  23844. extern double scalbn ( double , int ) ;
  23845. extern double scalbln ( double , long int ) ;
  23846.  
  23847. extern double cbrt ( double ) ;
  23848. extern double hypot ( double , double ) ;
  23849.  
  23850. extern double erf ( double ) ;
  23851. extern double erfc ( double ) ;
  23852. extern double lgamma ( double ) ;
  23853. extern double tgamma ( double ) ;
  23854.  
  23855. extern double nearbyint ( double ) ;
  23856. extern double rint ( double ) ;
  23857. extern long int lrint ( double ) ;
  23858. extern double round ( double ) ;
  23859. extern long int lround ( double ) ;
  23860. extern double trunc ( double ) ;
  23861.  
  23862. extern double remainder ( double , double ) ;
  23863. extern double remquo ( double , double , int * ) ;
  23864.  
  23865. extern double copysign ( double , double ) ;
  23866. extern double nan ( const char * ) ;
  23867. extern double nextafter ( double , double ) ;
  23868. extern double nexttoward ( double , long double ) ;
  23869.  
  23870. extern double fdim ( double , double ) ;
  23871. extern double fmax ( double , double ) ;
  23872. extern double fmin ( double , double ) ;
  23873.  
  23874. extern double fma ( double , double , double ) ;
  23875.  
  23876. extern float acosf ( float ) ;
  23877. extern float asinf ( float ) ;
  23878. extern float atanf ( float ) ;
  23879. extern float atan2f ( float , float ) ;
  23880. extern float cosf ( float ) ;
  23881. extern float sinf ( float ) ;
  23882. extern float tanf ( float ) ;
  23883.  
  23884. extern float acoshf ( float ) ;
  23885. extern float asinhf ( float ) ;
  23886. extern float atanhf ( float ) ;
  23887. extern float coshf ( float ) ;
  23888. extern float sinhf ( float ) ;
  23889. extern float tanhf ( float ) ;
  23890.  
  23891. extern float expf ( float ) ;
  23892. extern float exp2f ( float ) ;
  23893. extern float expm1f ( float ) ;
  23894. extern float frexpf ( float , int * ) ;
  23895. extern int ilogbf ( float ) ;
  23896. extern float ldexpf ( float , int ) ;
  23897. extern float logf ( float ) ;
  23898. extern float log10f ( float ) ;
  23899. extern float log1pf ( float ) ;
  23900. extern float log2f ( float ) ;
  23901. extern float logbf ( float ) ;
  23902. extern float modff ( float , float * ) ;
  23903. extern float scalbnf ( float , int ) ;
  23904. extern float scalblnf ( float , long int ) ;
  23905.  
  23906. extern float cbrtf ( float ) ;
  23907. extern float fabsf ( float ) ;
  23908. extern float hypotf ( float , float ) ;
  23909. extern float powf ( float , float ) ;
  23910. extern float sqrtf ( float ) ;
  23911.  
  23912. extern float erff ( float ) ;
  23913. extern float erfcf ( float ) ;
  23914. extern float lgammaf ( float ) ;
  23915. extern float tgammaf ( float ) ;
  23916.  
  23917. extern float ceilf ( float ) ;
  23918. extern float floorf ( float ) ;
  23919. extern float nearbyintf ( float ) ;
  23920. extern float rintf ( float ) ;
  23921. extern long int lrintf ( float ) ;
  23922. extern float roundf ( float ) ;
  23923. extern long int lroundf ( float ) ;
  23924. extern float truncf ( float ) ;
  23925.  
  23926. extern float fmodf ( float , float ) ;
  23927. extern float remainderf ( float , float ) ;
  23928. extern float remquof ( float , float , int * ) ;
  23929.  
  23930. extern float copysignf ( float , float ) ;
  23931. extern float nanf ( const char * ) ;
  23932. extern float nextafterf ( float , float ) ;
  23933. extern float nexttowardf ( float , long double ) ;
  23934.  
  23935. extern float fdimf ( float , float ) ;
  23936. extern float fmaxf ( float , float ) ;
  23937. extern float fminf ( float , float ) ;
  23938.  
  23939. extern float fmaf ( float , float , float ) ;
  23940.  
  23941. extern long double acosl ( long double ) ;
  23942. extern long double asinl ( long double ) ;
  23943. extern long double atanl ( long double ) ;
  23944. extern long double atan2l ( long double , long double ) ;
  23945. extern long double cosl ( long double ) ;
  23946. extern long double sinl ( long double ) ;
  23947. extern long double tanl ( long double ) ;
  23948.  
  23949. extern long double acoshl ( long double ) ;
  23950. extern long double asinhl ( long double ) ;
  23951. extern long double atanhl ( long double ) ;
  23952. extern long double coshl ( long double ) ;
  23953. extern long double sinhl ( long double ) ;
  23954. extern long double tanhl ( long double ) ;
  23955.  
  23956. extern long double expl ( long double ) ;
  23957. extern long double exp2l ( long double ) ;
  23958. extern long double expm1l ( long double ) ;
  23959. extern long double frexpl ( long double , int * ) ;
  23960. extern int ilogbl ( long double ) ;
  23961. extern long double ldexpl ( long double , int ) ;
  23962. extern long double logl ( long double ) ;
  23963. extern long double log10l ( long double ) ;
  23964. extern long double log1pl ( long double ) ;
  23965. extern long double log2l ( long double ) ;
  23966. extern long double logbl ( long double ) ;
  23967. extern long double modfl ( long double , long double * ) ;
  23968. extern long double scalbnl ( long double , int ) ;
  23969. extern long double scalblnl ( long double , long int ) ;
  23970.  
  23971. extern long double cbrtl ( long double ) ;
  23972. extern long double fabsl ( long double ) ;
  23973. extern long double hypotl ( long double , long double ) ;
  23974. extern long double powl ( long double , long double ) ;
  23975. extern long double sqrtl ( long double ) ;
  23976.  
  23977. extern long double erfl ( long double ) ;
  23978. extern long double erfcl ( long double ) ;
  23979. extern long double lgammal ( long double ) ;
  23980. extern long double tgammal ( long double ) ;
  23981.  
  23982. extern long double ceill ( long double ) ;
  23983. extern long double floorl ( long double ) ;
  23984. extern long double nearbyintl ( long double ) ;
  23985. extern long double rintl ( long double ) ;
  23986. extern long int lrintl ( long double ) ;
  23987. extern long double roundl ( long double ) ;
  23988. extern long int lroundl ( long double ) ;
  23989. extern long double truncl ( long double ) ;
  23990.  
  23991. extern long double fmodl ( long double , long double ) ;
  23992. extern long double remainderl ( long double , long double ) ;
  23993. extern long double remquol ( long double , long double , int * ) ;
  23994.  
  23995. extern long double copysignl ( long double , long double ) ;
  23996. extern long double nanl ( const char * ) ;
  23997. extern long double nextafterl ( long double , long double ) ;
  23998. extern long double nexttowardl ( long double , long double ) ;
  23999.  
  24000. extern long double fdiml ( long double , long double ) ;
  24001. extern long double fmaxl ( long double , long double ) ;
  24002. extern long double fminl ( long double , long double ) ;
  24003.  
  24004. extern long double fmal ( long double , long double , long double ) ;
  24005.  
  24006.  
  24007.  
  24008. extern long long int llrint ( double ) ;
  24009. extern long long int llround ( double ) ;
  24010.  
  24011. extern long long int llrintf ( float ) ;
  24012. extern long long int llroundf ( float ) ;
  24013.  
  24014. extern long long int llrintl ( long double ) ;
  24015. extern long long int llroundl ( long double ) ;
  24016. #517
  24017. }
  24018. #15 "/usr/include/math.h"
  24019. using std :: abs ;
  24020. using std :: acos ;
  24021. using std :: asin ;
  24022. using std :: atan2 ;
  24023. using std :: atan ;
  24024. using std :: ceil ;
  24025. using std :: cos ;
  24026. using std :: cosh ;
  24027. using std :: exp ;
  24028. using std :: fabs ;
  24029. using std :: floor ;
  24030. using std :: fmod ;
  24031. using std :: frexp ;
  24032. using std :: ldexp ;
  24033. using std :: log10 ;
  24034. using std :: log ;
  24035. using std :: modf ;
  24036. using std :: pow ;
  24037. using std :: sin ;
  24038. using std :: sinh ;
  24039. using std :: sqrt ;
  24040. using std :: tan ;
  24041. using std :: tanh ;
  24042.  
  24043.  
  24044.  
  24045. extern "C" {
  24046. #76
  24047. extern int signgam ;
  24048. #84
  24049. enum version { libm_ieee = - 1 , c_issue_4 , ansi_1 , strict_ansi } ;
  24050.  
  24051.  
  24052. extern const enum version _lib_version ;
  24053.  
  24054.  
  24055.  
  24056.  
  24057. struct exception {
  24058. int type ;
  24059. char * name ;
  24060. double arg1 ;
  24061. double arg2 ;
  24062. double retval ;
  24063. } ;
  24064. #130
  24065. extern double erf ( double ) ;
  24066. extern double erfc ( double ) ;
  24067. extern double hypot ( double , double ) ;
  24068. extern double lgamma ( double ) ;
  24069. #142
  24070. extern int isnan ( double ) ;
  24071.  
  24072. #pragma does_not_read_global_data ( isnan )
  24073. #pragma does_not_write_global_data ( isnan )
  24074. #pragma no_side_effect ( isnan )
  24075.  
  24076.  
  24077.  
  24078.  
  24079. extern double gamma ( double ) ;
  24080.  
  24081. extern double j0 ( double ) ;
  24082. extern double j1 ( double ) ;
  24083. extern double jn ( int , double ) ;
  24084. extern double y0 ( double ) ;
  24085. extern double y1 ( double ) ;
  24086. extern double yn ( int , double ) ;
  24087. #171
  24088. extern double scalb ( double , double ) ;
  24089. #180
  24090. extern double acosh ( double ) ;
  24091. extern double asinh ( double ) ;
  24092. extern double atanh ( double ) ;
  24093. extern double cbrt ( double ) ;
  24094. extern double logb ( double ) ;
  24095. extern double nextafter ( double , double ) ;
  24096. extern double remainder ( double , double ) ;
  24097.  
  24098.  
  24099.  
  24100.  
  24101. extern double expm1 ( double ) ;
  24102. extern int ilogb ( double ) ;
  24103. extern double log1p ( double ) ;
  24104. extern double rint ( double ) ;
  24105. #214
  24106. extern int matherr ( struct exception * ) ;
  24107.  
  24108.  
  24109.  
  24110.  
  24111. extern double significand ( double ) ;
  24112. #227
  24113. extern int signgamf ;
  24114. extern int signgaml ;
  24115.  
  24116. extern int isnanf ( float ) ;
  24117. extern int isnanl ( long double ) ;
  24118. extern float gammaf ( float ) ;
  24119. extern float gammaf_r ( float , int * ) ;
  24120. extern float j0f ( float ) ;
  24121. extern float j1f ( float ) ;
  24122. extern float jnf ( int , float ) ;
  24123. extern float lgammaf_r ( float , int * ) ;
  24124. extern float scalbf ( float , float ) ;
  24125. extern float significandf ( float ) ;
  24126. extern float y0f ( float ) ;
  24127. extern float y1f ( float ) ;
  24128. extern float ynf ( int , float ) ;
  24129. extern long double gammal ( long double ) ;
  24130. extern long double gammal_r ( long double , int * ) ;
  24131. extern long double j0l ( long double ) ;
  24132. extern long double j1l ( long double ) ;
  24133. extern long double jnl ( int , long double ) ;
  24134. extern long double lgammal_r ( long double , int * ) ;
  24135. extern long double scalbl ( long double , long double ) ;
  24136. extern long double significandl ( long double ) ;
  24137. extern long double y0l ( long double ) ;
  24138. extern long double y1l ( long double ) ;
  24139. extern long double ynl ( int , long double ) ;
  24140. #276
  24141. extern void sincos ( double , double * , double * ) ;
  24142. extern void sincosf ( float , float * , float * ) ;
  24143. extern void sincosl ( long double , long double * , long double * ) ;
  24144. #288
  24145. extern double copysign ( double , double ) ;
  24146. extern double scalbn ( double , int ) ;
  24147. #302
  24148. extern double gamma_r ( double , int * ) ;
  24149. extern double lgamma_r ( double , int * ) ;
  24150. #310
  24151. extern float modff ( float , float * ) ;
  24152. #1 "/usr/include/floatingpoint.h"
  24153. #16
  24154. #pragma ident "@(#)floatingpoint.h  2.10    09/05/19 SMI"
  24155. #1 "/usr/include/sys/ieeefp.h"
  24156. #9
  24157. #pragma ident "@(#)ieeefp.h 2.12    04/10/23 SMI"
  24158.  
  24159.  
  24160. extern "C" {
  24161. #51
  24162. enum fp_direction_type {
  24163. fp_nearest = 0 ,
  24164. fp_negative = 1 ,
  24165. fp_positive = 2 ,
  24166. fp_tozero = 3
  24167. } ;
  24168.  
  24169. enum fp_precision_type {
  24170. fp_single = 0 ,
  24171. fp_precision_3 = 1 ,
  24172. fp_double = 2 ,
  24173. fp_extended = 3
  24174. } ;
  24175.  
  24176. enum fp_exception_type {
  24177. fp_invalid = 0 ,
  24178. fp_denormalized = 1 ,
  24179. fp_division = 2 ,
  24180. fp_overflow = 3 ,
  24181. fp_underflow = 4 ,
  24182. fp_inexact = 5
  24183. } ;
  24184.  
  24185. enum fp_trap_enable_type {
  24186. fp_trap_invalid = 0 ,
  24187. fp_trap_denormalized = 1 ,
  24188. fp_trap_division = 2 ,
  24189. fp_trap_overflow = 3 ,
  24190. fp_trap_underflow = 4 ,
  24191. fp_trap_inexact = 5
  24192. } ;
  24193.  
  24194.  
  24195. enum fp_class_type {
  24196. fp_zero = 0 ,
  24197. fp_subnormal = 1 ,
  24198. fp_normal = 2 ,
  24199. fp_infinity = 3 ,
  24200. fp_quiet = 4 ,
  24201. fp_signaling = 5
  24202. } ;
  24203.  
  24204.  
  24205. }
  24206. #21 "/usr/include/floatingpoint.h"
  24207. extern "C" {
  24208. #48
  24209. namespace std {
  24210.  
  24211.  
  24212.  
  24213. typedef __FILE FILE ;
  24214.  
  24215.  
  24216. }
  24217. #64
  24218. typedef int sigfpe_code_type ;
  24219.  
  24220. typedef void ( * sigfpe_handler_type ) ( ) ;
  24221.  
  24222.  
  24223.  
  24224.  
  24225.  
  24226. extern sigfpe_handler_type sigfpe ( sigfpe_code_type , sigfpe_handler_type ) ;
  24227.  
  24228.  
  24229.  
  24230.  
  24231. typedef float single ;
  24232.  
  24233.  
  24234.  
  24235. typedef unsigned extended [ 3 ] ;
  24236.  
  24237.  
  24238. typedef long double quadruple ;
  24239.  
  24240. typedef unsigned fp_exception_field_type ;
  24241. #96
  24242. typedef char decimal_string [ 512 ] ;
  24243.  
  24244.  
  24245. typedef struct {
  24246. enum fp_class_type fpclass ;
  24247. int sign ;
  24248. int exponent ;
  24249. decimal_string ds ;
  24250.  
  24251.  
  24252. int more ;
  24253.  
  24254.  
  24255. int ndigits ;
  24256.  
  24257.  
  24258. } decimal_record ;
  24259.  
  24260. enum decimal_form {
  24261. fixed_form ,
  24262.  
  24263.  
  24264.  
  24265. floating_form
  24266.  
  24267. } ;
  24268.  
  24269. typedef struct {
  24270. enum fp_direction_type rd ;
  24271.  
  24272. enum decimal_form df ;
  24273.  
  24274. int ndigits ;
  24275. } decimal_mode ;
  24276.  
  24277. enum decimal_string_form {
  24278. invalid_form ,
  24279. whitespace_form ,
  24280. fixed_int_form ,
  24281. fixed_intdot_form ,
  24282. fixed_dotfrac_form ,
  24283. fixed_intdotfrac_form ,
  24284. floating_int_form ,
  24285. floating_intdot_form ,
  24286. floating_dotfrac_form ,
  24287. floating_intdotfrac_form ,
  24288. inf_form ,
  24289. infinity_form ,
  24290. nan_form ,
  24291. nanstring_form
  24292. } ;
  24293.  
  24294. extern void single_to_decimal
  24295. ( single * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24296. extern void double_to_decimal
  24297. ( double * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24298. extern void extended_to_decimal
  24299. ( extended * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24300. extern void quadruple_to_decimal
  24301. ( quadruple * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24302.  
  24303. extern void decimal_to_single
  24304. ( single * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24305. extern void decimal_to_double
  24306. ( double * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24307. extern void decimal_to_extended
  24308. ( extended * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24309. extern void decimal_to_quadruple
  24310. ( quadruple * , decimal_mode * , decimal_record * , fp_exception_field_type * ) ;
  24311.  
  24312. extern void string_to_decimal
  24313. ( char * * , int , int , decimal_record * , enum decimal_string_form * , char * * ) ;
  24314. extern void func_to_decimal
  24315.  
  24316. ( char * * , int , int , decimal_record * , enum decimal_string_form * , char * * , int ( * ) ( void ) , int * , int ( *
  24317. #170
  24318. ) ( int ) ) ;
  24319. extern void file_to_decimal
  24320.  
  24321. ( char * * , int , int , decimal_record * , enum decimal_string_form * , char * * , std :: FILE * , int * ) ;
  24322.  
  24323. extern char * seconvert ( single * , int , int * , int * , char * ) ;
  24324. extern char * sfconvert ( single * , int , int * , int * , char * ) ;
  24325. extern char * sgconvert ( single * , int , int , char * ) ;
  24326. extern char * econvert ( double , int , int * , int * , char * ) ;
  24327. extern char * fconvert ( double , int , int * , int * , char * ) ;
  24328. extern char * gconvert ( double , int , int , char * ) ;
  24329. extern char * qeconvert ( quadruple * , int , int * , int * , char * ) ;
  24330. extern char * qfconvert ( quadruple * , int , int * , int * , char * ) ;
  24331. extern char * qgconvert ( quadruple * , int , int , char * ) ;
  24332.  
  24333. extern char * ecvt ( double , int , int * , int * ) ;
  24334. extern char * fcvt ( double , int , int * , int * ) ;
  24335. extern char * gcvt ( double , int , char * ) ;
  24336.  
  24337.  
  24338.  
  24339.  
  24340.  
  24341. extern double atof ( const char * ) ;
  24342. extern double strtod ( const char * , char * * ) ;
  24343.  
  24344.  
  24345.  
  24346.  
  24347. }
  24348. #329 "/usr/include/math.h"
  24349. }
  24350. #75 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cmath"
  24351. namespace std
  24352. {
  24353. #95
  24354. template < typename _Tp >
  24355. inline constexpr
  24356. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24357. double > :: __type
  24358. abs ( _Tp __x )
  24359. { return __builtin_fabs ( __x ) ; }
  24360.  
  24361. using :: acos ;
  24362. #114
  24363. template < typename _Tp >
  24364. inline constexpr
  24365. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24366. double > :: __type
  24367. acos ( _Tp __x )
  24368. { return __builtin_acos ( __x ) ; }
  24369.  
  24370. using :: asin ;
  24371. #133
  24372. template < typename _Tp >
  24373. inline constexpr
  24374. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24375. double > :: __type
  24376. asin ( _Tp __x )
  24377. { return __builtin_asin ( __x ) ; }
  24378.  
  24379. using :: atan ;
  24380. #152
  24381. template < typename _Tp >
  24382. inline constexpr
  24383. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24384. double > :: __type
  24385. atan ( _Tp __x )
  24386. { return __builtin_atan ( __x ) ; }
  24387.  
  24388. using :: atan2 ;
  24389. #171
  24390. template < typename _Tp , typename _Up >
  24391. inline constexpr
  24392. typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  24393. atan2 ( _Tp __y , _Up __x )
  24394. {
  24395. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24396. return atan2 ( __type ( __y ) , __type ( __x ) ) ;
  24397. }
  24398.  
  24399. using :: ceil ;
  24400. #192
  24401. template < typename _Tp >
  24402. inline constexpr
  24403. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24404. double > :: __type
  24405. ceil ( _Tp __x )
  24406. { return __builtin_ceil ( __x ) ; }
  24407.  
  24408. using :: cos ;
  24409. #211
  24410. template < typename _Tp >
  24411. inline constexpr
  24412. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24413. double > :: __type
  24414. cos ( _Tp __x )
  24415. { return __builtin_cos ( __x ) ; }
  24416.  
  24417. using :: cosh ;
  24418. #230
  24419. template < typename _Tp >
  24420. inline constexpr
  24421. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24422. double > :: __type
  24423. cosh ( _Tp __x )
  24424. { return __builtin_cosh ( __x ) ; }
  24425.  
  24426. using :: exp ;
  24427. #249
  24428. template < typename _Tp >
  24429. inline constexpr
  24430. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24431. double > :: __type
  24432. exp ( _Tp __x )
  24433. { return __builtin_exp ( __x ) ; }
  24434.  
  24435. using :: fabs ;
  24436. #268
  24437. template < typename _Tp >
  24438. inline constexpr
  24439. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24440. double > :: __type
  24441. fabs ( _Tp __x )
  24442. { return __builtin_fabs ( __x ) ; }
  24443.  
  24444. using :: floor ;
  24445. #287
  24446. template < typename _Tp >
  24447. inline constexpr
  24448. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24449. double > :: __type
  24450. floor ( _Tp __x )
  24451. { return __builtin_floor ( __x ) ; }
  24452.  
  24453. using :: fmod ;
  24454. #306
  24455. template < typename _Tp , typename _Up >
  24456. inline constexpr
  24457. typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  24458. fmod ( _Tp __x , _Up __y )
  24459. {
  24460. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24461. return fmod ( __type ( __x ) , __type ( __y ) ) ;
  24462. }
  24463.  
  24464. using :: frexp ;
  24465. #327
  24466. template < typename _Tp >
  24467. inline constexpr
  24468. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24469. double > :: __type
  24470. frexp ( _Tp __x , int * __exp )
  24471. { return __builtin_frexp ( __x , __exp ) ; }
  24472.  
  24473. using :: ldexp ;
  24474. #346
  24475. template < typename _Tp >
  24476. inline constexpr
  24477. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24478. double > :: __type
  24479. ldexp ( _Tp __x , int __exp )
  24480. { return __builtin_ldexp ( __x , __exp ) ; }
  24481.  
  24482. using :: log ;
  24483. #365
  24484. template < typename _Tp >
  24485. inline constexpr
  24486. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24487. double > :: __type
  24488. log ( _Tp __x )
  24489. { return __builtin_log ( __x ) ; }
  24490.  
  24491. using :: log10 ;
  24492. #384
  24493. template < typename _Tp >
  24494. inline constexpr
  24495. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24496. double > :: __type
  24497. log10 ( _Tp __x )
  24498. { return __builtin_log10 ( __x ) ; }
  24499.  
  24500. using :: modf ;
  24501. #403
  24502. using :: pow ;
  24503. #431
  24504. template < typename _Tp , typename _Up >
  24505. inline constexpr
  24506. typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  24507. pow ( _Tp __x , _Up __y )
  24508. {
  24509. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24510. return pow ( __type ( __x ) , __type ( __y ) ) ;
  24511. }
  24512.  
  24513. using :: sin ;
  24514. #452
  24515. template < typename _Tp >
  24516. inline constexpr
  24517. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24518. double > :: __type
  24519. sin ( _Tp __x )
  24520. { return __builtin_sin ( __x ) ; }
  24521.  
  24522. using :: sinh ;
  24523. #471
  24524. template < typename _Tp >
  24525. inline constexpr
  24526. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24527. double > :: __type
  24528. sinh ( _Tp __x )
  24529. { return __builtin_sinh ( __x ) ; }
  24530.  
  24531. using :: sqrt ;
  24532. #490
  24533. template < typename _Tp >
  24534. inline constexpr
  24535. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24536. double > :: __type
  24537. sqrt ( _Tp __x )
  24538. { return __builtin_sqrt ( __x ) ; }
  24539.  
  24540. using :: tan ;
  24541. #509
  24542. template < typename _Tp >
  24543. inline constexpr
  24544. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24545. double > :: __type
  24546. tan ( _Tp __x )
  24547. { return __builtin_tan ( __x ) ; }
  24548.  
  24549. using :: tanh ;
  24550. #528
  24551. template < typename _Tp >
  24552. inline constexpr
  24553. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24554. double > :: __type
  24555. tanh ( _Tp __x )
  24556. { return __builtin_tanh ( __x ) ; }
  24557.  
  24558.  
  24559. }
  24560. #555
  24561. namespace std
  24562. {
  24563.  
  24564.  
  24565.  
  24566. constexpr int
  24567. fpclassify ( float __x )
  24568. { return __builtin_fpclassify ( 4 , 3 , 2 ,
  24569. 1 , 0 , __x ) ; }
  24570.  
  24571. constexpr int
  24572. fpclassify ( double __x )
  24573. { return __builtin_fpclassify ( 4 , 3 , 2 ,
  24574. 1 , 0 , __x ) ; }
  24575.  
  24576. constexpr int
  24577. fpclassify ( long double __x )
  24578. { return __builtin_fpclassify ( 4 , 3 , 2 ,
  24579. 1 , 0 , __x ) ; }
  24580.  
  24581. template < typename _Tp >
  24582. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24583. int > :: __type
  24584. fpclassify ( _Tp __x )
  24585. { return __x != 0 ? 2 : 0 ; }
  24586.  
  24587. constexpr bool
  24588. isfinite ( float __x )
  24589. { return __oracle_builtin_isfinite ( __x ) ; }
  24590.  
  24591. constexpr bool
  24592. isfinite ( double __x )
  24593. { return __oracle_builtin_isfinite ( __x ) ; }
  24594.  
  24595. constexpr bool
  24596. isfinite ( long double __x )
  24597. { return __oracle_builtin_isfinite ( __x ) ; }
  24598.  
  24599. template < typename _Tp >
  24600. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24601. bool > :: __type
  24602. isfinite ( _Tp __x )
  24603. { return true ; }
  24604.  
  24605. constexpr bool
  24606. isinf ( float __x )
  24607. { return __oracle_builtin_isinf ( __x ) ; }
  24608.  
  24609. constexpr bool
  24610. isinf ( double __x )
  24611. { return __oracle_builtin_isinf ( __x ) ; }
  24612.  
  24613. constexpr bool
  24614. isinf ( long double __x )
  24615. { return __oracle_builtin_isinf ( __x ) ; }
  24616.  
  24617. template < typename _Tp >
  24618. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24619. bool > :: __type
  24620. isinf ( _Tp __x )
  24621. { return false ; }
  24622.  
  24623. constexpr bool
  24624. isnan ( float __x )
  24625. { return __oracle_builtin_isnan ( __x ) ; }
  24626.  
  24627. constexpr bool
  24628. isnan ( double __x )
  24629. { return __oracle_builtin_isnan ( __x ) ; }
  24630.  
  24631. constexpr bool
  24632. isnan ( long double __x )
  24633. { return __oracle_builtin_isnan ( __x ) ; }
  24634.  
  24635. template < typename _Tp >
  24636. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24637. bool > :: __type
  24638. isnan ( _Tp __x )
  24639. { return false ; }
  24640.  
  24641. constexpr bool
  24642. isnormal ( float __x )
  24643. { return __oracle_builtin_isnormal ( __x ) ; }
  24644.  
  24645. constexpr bool
  24646. isnormal ( double __x )
  24647. { return __oracle_builtin_isnormal ( __x ) ; }
  24648.  
  24649. constexpr bool
  24650. isnormal ( long double __x )
  24651. { return __oracle_builtin_isnormal ( __x ) ; }
  24652.  
  24653. template < typename _Tp >
  24654. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24655. bool > :: __type
  24656. isnormal ( _Tp __x )
  24657. { return __x != 0 ? true : false ; }
  24658.  
  24659. constexpr bool
  24660. signbit ( float __x )
  24661. { return __oracle_builtin_signbit ( __x ) ; }
  24662.  
  24663. constexpr bool
  24664. signbit ( double __x )
  24665. { return __oracle_builtin_signbit ( __x ) ; }
  24666.  
  24667. constexpr bool
  24668. signbit ( long double __x )
  24669. { return __oracle_builtin_signbit ( __x ) ; }
  24670.  
  24671. template < typename _Tp >
  24672. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24673. bool > :: __type
  24674. signbit ( _Tp __x )
  24675. { return __x < 0 ? true : false ; }
  24676.  
  24677. constexpr bool
  24678. isgreater ( float __x , float __y )
  24679. { return __oracle_builtin_isgreater ( __x , __y ) ; }
  24680.  
  24681. constexpr bool
  24682. isgreater ( double __x , double __y )
  24683. { return __oracle_builtin_isgreater ( __x , __y ) ; }
  24684.  
  24685. constexpr bool
  24686. isgreater ( long double __x , long double __y )
  24687. { return __oracle_builtin_isgreater ( __x , __y ) ; }
  24688.  
  24689. template < typename _Tp , typename _Up >
  24690. constexpr typename
  24691. __gnu_cxx :: __enable_if < ( __is_arithmetic < _Tp > :: __value
  24692. && __is_arithmetic < _Up > :: __value ) , bool > :: __type
  24693. isgreater ( _Tp __x , _Up __y )
  24694. {
  24695. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24696. return __oracle_builtin_isgreater ( __type ( __x ) , __type ( __y ) ) ;
  24697. }
  24698.  
  24699. constexpr bool
  24700. isgreaterequal ( float __x , float __y )
  24701. { return __oracle_builtin_isgreaterequal ( __x , __y ) ; }
  24702.  
  24703. constexpr bool
  24704. isgreaterequal ( double __x , double __y )
  24705. { return __oracle_builtin_isgreaterequal ( __x , __y ) ; }
  24706.  
  24707. constexpr bool
  24708. isgreaterequal ( long double __x , long double __y )
  24709. { return __oracle_builtin_isgreaterequal ( __x , __y ) ; }
  24710.  
  24711. template < typename _Tp , typename _Up >
  24712. constexpr typename
  24713. __gnu_cxx :: __enable_if < ( __is_arithmetic < _Tp > :: __value
  24714. && __is_arithmetic < _Up > :: __value ) , bool > :: __type
  24715. isgreaterequal ( _Tp __x , _Up __y )
  24716. {
  24717. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24718. return __oracle_builtin_isgreaterequal ( __type ( __x ) , __type ( __y ) ) ;
  24719. }
  24720.  
  24721. constexpr bool
  24722. isless ( float __x , float __y )
  24723. { return __oracle_builtin_isless ( __x , __y ) ; }
  24724.  
  24725. constexpr bool
  24726. isless ( double __x , double __y )
  24727. { return __oracle_builtin_isless ( __x , __y ) ; }
  24728.  
  24729. constexpr bool
  24730. isless ( long double __x , long double __y )
  24731. { return __oracle_builtin_isless ( __x , __y ) ; }
  24732.  
  24733. template < typename _Tp , typename _Up >
  24734. constexpr typename
  24735. __gnu_cxx :: __enable_if < ( __is_arithmetic < _Tp > :: __value
  24736. && __is_arithmetic < _Up > :: __value ) , bool > :: __type
  24737. isless ( _Tp __x , _Up __y )
  24738. {
  24739. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24740. return __oracle_builtin_isless ( __type ( __x ) , __type ( __y ) ) ;
  24741. }
  24742.  
  24743. constexpr bool
  24744. islessequal ( float __x , float __y )
  24745. { return __oracle_builtin_islessequal ( __x , __y ) ; }
  24746.  
  24747. constexpr bool
  24748. islessequal ( double __x , double __y )
  24749. { return __oracle_builtin_islessequal ( __x , __y ) ; }
  24750.  
  24751. constexpr bool
  24752. islessequal ( long double __x , long double __y )
  24753. { return __oracle_builtin_islessequal ( __x , __y ) ; }
  24754.  
  24755. template < typename _Tp , typename _Up >
  24756. constexpr typename
  24757. __gnu_cxx :: __enable_if < ( __is_arithmetic < _Tp > :: __value
  24758. && __is_arithmetic < _Up > :: __value ) , bool > :: __type
  24759. islessequal ( _Tp __x , _Up __y )
  24760. {
  24761. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24762. return __oracle_builtin_islessequal ( __type ( __x ) , __type ( __y ) ) ;
  24763. }
  24764.  
  24765. constexpr bool
  24766. islessgreater ( float __x , float __y )
  24767. { return __oracle_builtin_islessgreater ( __x , __y ) ; }
  24768.  
  24769. constexpr bool
  24770. islessgreater ( double __x , double __y )
  24771. { return __oracle_builtin_islessgreater ( __x , __y ) ; }
  24772.  
  24773. constexpr bool
  24774. islessgreater ( long double __x , long double __y )
  24775. { return __oracle_builtin_islessgreater ( __x , __y ) ; }
  24776.  
  24777. template < typename _Tp , typename _Up >
  24778. constexpr typename
  24779. __gnu_cxx :: __enable_if < ( __is_arithmetic < _Tp > :: __value
  24780. && __is_arithmetic < _Up > :: __value ) , bool > :: __type
  24781. islessgreater ( _Tp __x , _Up __y )
  24782. {
  24783. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24784. return __oracle_builtin_islessgreater ( __type ( __x ) , __type ( __y ) ) ;
  24785. }
  24786.  
  24787. constexpr bool
  24788. isunordered ( float __x , float __y )
  24789. { return __oracle_builtin_isunordered ( __x , __y ) ; }
  24790.  
  24791. constexpr bool
  24792. isunordered ( double __x , double __y )
  24793. { return __oracle_builtin_isunordered ( __x , __y ) ; }
  24794.  
  24795. constexpr bool
  24796. isunordered ( long double __x , long double __y )
  24797. { return __oracle_builtin_isunordered ( __x , __y ) ; }
  24798.  
  24799. template < typename _Tp , typename _Up >
  24800. constexpr typename
  24801. __gnu_cxx :: __enable_if < ( __is_arithmetic < _Tp > :: __value
  24802. && __is_arithmetic < _Up > :: __value ) , bool > :: __type
  24803. isunordered ( _Tp __x , _Up __y )
  24804. {
  24805. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  24806. return __oracle_builtin_isunordered ( __type ( __x ) , __type ( __y ) ) ;
  24807. }
  24808. #917
  24809. }
  24810. #1032
  24811. namespace std
  24812. {
  24813.  
  24814.  
  24815.  
  24816. using :: double_t ;
  24817. using :: float_t ;
  24818.  
  24819.  
  24820. using :: acosh ;
  24821. using :: acoshf ;
  24822. using :: acoshl ;
  24823.  
  24824. using :: asinh ;
  24825. using :: asinhf ;
  24826. using :: asinhl ;
  24827.  
  24828. using :: atanh ;
  24829. using :: atanhf ;
  24830. using :: atanhl ;
  24831.  
  24832. using :: cbrt ;
  24833. using :: cbrtf ;
  24834. using :: cbrtl ;
  24835.  
  24836. using :: copysign ;
  24837. using :: copysignf ;
  24838. using :: copysignl ;
  24839.  
  24840. using :: erf ;
  24841. using :: erff ;
  24842. using :: erfl ;
  24843.  
  24844. using :: erfc ;
  24845. using :: erfcf ;
  24846. using :: erfcl ;
  24847.  
  24848. using :: exp2 ;
  24849. using :: exp2f ;
  24850. using :: exp2l ;
  24851.  
  24852. using :: expm1 ;
  24853. using :: expm1f ;
  24854. using :: expm1l ;
  24855.  
  24856. using :: fdim ;
  24857. using :: fdimf ;
  24858. using :: fdiml ;
  24859.  
  24860. using :: fma ;
  24861. using :: fmaf ;
  24862. using :: fmal ;
  24863.  
  24864. using :: fmax ;
  24865. using :: fmaxf ;
  24866. using :: fmaxl ;
  24867.  
  24868. using :: fmin ;
  24869. using :: fminf ;
  24870. using :: fminl ;
  24871.  
  24872. using :: hypot ;
  24873. using :: hypotf ;
  24874. using :: hypotl ;
  24875.  
  24876. using :: ilogb ;
  24877. using :: ilogbf ;
  24878. using :: ilogbl ;
  24879.  
  24880. using :: lgamma ;
  24881. using :: lgammaf ;
  24882. using :: lgammal ;
  24883.  
  24884. using :: llrint ;
  24885. using :: llrintf ;
  24886. using :: llrintl ;
  24887.  
  24888. using :: llround ;
  24889. using :: llroundf ;
  24890. using :: llroundl ;
  24891.  
  24892. using :: log1p ;
  24893. using :: log1pf ;
  24894. using :: log1pl ;
  24895.  
  24896. using :: log2 ;
  24897. using :: log2f ;
  24898. using :: log2l ;
  24899.  
  24900. using :: logb ;
  24901. using :: logbf ;
  24902. using :: logbl ;
  24903.  
  24904. using :: lrint ;
  24905. using :: lrintf ;
  24906. using :: lrintl ;
  24907.  
  24908. using :: lround ;
  24909. using :: lroundf ;
  24910. using :: lroundl ;
  24911.  
  24912. using :: nan ;
  24913. using :: nanf ;
  24914. using :: nanl ;
  24915.  
  24916. using :: nearbyint ;
  24917. using :: nearbyintf ;
  24918. using :: nearbyintl ;
  24919.  
  24920. using :: nextafter ;
  24921. using :: nextafterf ;
  24922. using :: nextafterl ;
  24923.  
  24924. using :: nexttoward ;
  24925. using :: nexttowardf ;
  24926. using :: nexttowardl ;
  24927.  
  24928. using :: remainder ;
  24929. using :: remainderf ;
  24930. using :: remainderl ;
  24931.  
  24932. using :: remquo ;
  24933. using :: remquof ;
  24934. using :: remquol ;
  24935.  
  24936. using :: rint ;
  24937. using :: rintf ;
  24938. using :: rintl ;
  24939.  
  24940. using :: round ;
  24941. using :: roundf ;
  24942. using :: roundl ;
  24943.  
  24944. using :: scalbln ;
  24945. using :: scalblnf ;
  24946. using :: scalblnl ;
  24947.  
  24948. using :: scalbn ;
  24949. using :: scalbnf ;
  24950. using :: scalbnl ;
  24951.  
  24952. using :: tgamma ;
  24953. using :: tgammaf ;
  24954. using :: tgammal ;
  24955.  
  24956. using :: trunc ;
  24957. using :: truncf ;
  24958. using :: truncl ;
  24959.  
  24960.  
  24961. constexpr float
  24962. acosh ( float __x )
  24963. { return __builtin_acoshf ( __x ) ; }
  24964.  
  24965. constexpr long double
  24966. acosh ( long double __x )
  24967. { return __builtin_acoshl ( __x ) ; }
  24968.  
  24969. template < typename _Tp >
  24970. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24971. double > :: __type
  24972. acosh ( _Tp __x )
  24973. { return __builtin_acosh ( __x ) ; }
  24974.  
  24975. constexpr float
  24976. asinh ( float __x )
  24977. { return __builtin_asinhf ( __x ) ; }
  24978.  
  24979. constexpr long double
  24980. asinh ( long double __x )
  24981. { return __builtin_asinhl ( __x ) ; }
  24982.  
  24983. template < typename _Tp >
  24984. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24985. double > :: __type
  24986. asinh ( _Tp __x )
  24987. { return __builtin_asinh ( __x ) ; }
  24988.  
  24989. constexpr float
  24990. atanh ( float __x )
  24991. { return __builtin_atanhf ( __x ) ; }
  24992.  
  24993. constexpr long double
  24994. atanh ( long double __x )
  24995. { return __builtin_atanhl ( __x ) ; }
  24996.  
  24997. template < typename _Tp >
  24998. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  24999. double > :: __type
  25000. atanh ( _Tp __x )
  25001. { return __builtin_atanh ( __x ) ; }
  25002.  
  25003. constexpr float
  25004. cbrt ( float __x )
  25005. { return __builtin_cbrtf ( __x ) ; }
  25006.  
  25007. constexpr long double
  25008. cbrt ( long double __x )
  25009. { return __builtin_cbrtl ( __x ) ; }
  25010.  
  25011. template < typename _Tp >
  25012. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25013. double > :: __type
  25014. cbrt ( _Tp __x )
  25015. { return __builtin_cbrt ( __x ) ; }
  25016.  
  25017. constexpr float
  25018. copysign ( float __x , float __y )
  25019. { return __builtin_copysignf ( __x , __y ) ; }
  25020.  
  25021. constexpr long double
  25022. copysign ( long double __x , long double __y )
  25023. { return __builtin_copysignl ( __x , __y ) ; }
  25024.  
  25025. template < typename _Tp , typename _Up >
  25026. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25027. copysign ( _Tp __x , _Up __y )
  25028. {
  25029. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25030. return copysign ( __type ( __x ) , __type ( __y ) ) ;
  25031. }
  25032.  
  25033. constexpr float
  25034. erf ( float __x )
  25035. { return __builtin_erff ( __x ) ; }
  25036.  
  25037. constexpr long double
  25038. erf ( long double __x )
  25039. { return __builtin_erfl ( __x ) ; }
  25040.  
  25041. template < typename _Tp >
  25042. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25043. double > :: __type
  25044. erf ( _Tp __x )
  25045. { return __builtin_erf ( __x ) ; }
  25046.  
  25047. constexpr float
  25048. erfc ( float __x )
  25049. { return __builtin_erfcf ( __x ) ; }
  25050.  
  25051. constexpr long double
  25052. erfc ( long double __x )
  25053. { return __builtin_erfcl ( __x ) ; }
  25054.  
  25055. template < typename _Tp >
  25056. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25057. double > :: __type
  25058. erfc ( _Tp __x )
  25059. { return __builtin_erfc ( __x ) ; }
  25060.  
  25061. constexpr float
  25062. exp2 ( float __x )
  25063. { return __builtin_exp2f ( __x ) ; }
  25064.  
  25065. constexpr long double
  25066. exp2 ( long double __x )
  25067. { return __builtin_exp2l ( __x ) ; }
  25068.  
  25069. template < typename _Tp >
  25070. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25071. double > :: __type
  25072. exp2 ( _Tp __x )
  25073. { return __builtin_exp2 ( __x ) ; }
  25074.  
  25075. constexpr float
  25076. expm1 ( float __x )
  25077. { return __builtin_expm1f ( __x ) ; }
  25078.  
  25079. constexpr long double
  25080. expm1 ( long double __x )
  25081. { return __builtin_expm1l ( __x ) ; }
  25082.  
  25083. template < typename _Tp >
  25084. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25085. double > :: __type
  25086. expm1 ( _Tp __x )
  25087. { return __builtin_expm1 ( __x ) ; }
  25088.  
  25089. constexpr float
  25090. fdim ( float __x , float __y )
  25091. { return __builtin_fdimf ( __x , __y ) ; }
  25092.  
  25093. constexpr long double
  25094. fdim ( long double __x , long double __y )
  25095. { return __builtin_fdiml ( __x , __y ) ; }
  25096.  
  25097. template < typename _Tp , typename _Up >
  25098. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25099. fdim ( _Tp __x , _Up __y )
  25100. {
  25101. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25102. return fdim ( __type ( __x ) , __type ( __y ) ) ;
  25103. }
  25104.  
  25105. constexpr float
  25106. fma ( float __x , float __y , float __z )
  25107. { return __builtin_fmaf ( __x , __y , __z ) ; }
  25108.  
  25109. constexpr long double
  25110. fma ( long double __x , long double __y , long double __z )
  25111. { return __builtin_fmal ( __x , __y , __z ) ; }
  25112.  
  25113. template < typename _Tp , typename _Up , typename _Vp >
  25114. constexpr typename __gnu_cxx :: __promote_3 < _Tp , _Up , _Vp > :: __type
  25115. fma ( _Tp __x , _Up __y , _Vp __z )
  25116. {
  25117. typedef typename __gnu_cxx :: __promote_3 < _Tp , _Up , _Vp > :: __type __type ;
  25118. return fma ( __type ( __x ) , __type ( __y ) , __type ( __z ) ) ;
  25119. }
  25120.  
  25121. constexpr float
  25122. fmax ( float __x , float __y )
  25123. { return __builtin_fmaxf ( __x , __y ) ; }
  25124.  
  25125. constexpr long double
  25126. fmax ( long double __x , long double __y )
  25127. { return __builtin_fmaxl ( __x , __y ) ; }
  25128.  
  25129. template < typename _Tp , typename _Up >
  25130. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25131. fmax ( _Tp __x , _Up __y )
  25132. {
  25133. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25134. return fmax ( __type ( __x ) , __type ( __y ) ) ;
  25135. }
  25136.  
  25137. constexpr float
  25138. fmin ( float __x , float __y )
  25139. { return __builtin_fminf ( __x , __y ) ; }
  25140.  
  25141. constexpr long double
  25142. fmin ( long double __x , long double __y )
  25143. { return __builtin_fminl ( __x , __y ) ; }
  25144.  
  25145. template < typename _Tp , typename _Up >
  25146. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25147. fmin ( _Tp __x , _Up __y )
  25148. {
  25149. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25150. return fmin ( __type ( __x ) , __type ( __y ) ) ;
  25151. }
  25152.  
  25153. constexpr float
  25154. hypot ( float __x , float __y )
  25155. { return __builtin_hypotf ( __x , __y ) ; }
  25156.  
  25157. constexpr long double
  25158. hypot ( long double __x , long double __y )
  25159. { return __builtin_hypotl ( __x , __y ) ; }
  25160.  
  25161. template < typename _Tp , typename _Up >
  25162. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25163. hypot ( _Tp __x , _Up __y )
  25164. {
  25165. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25166. return hypot ( __type ( __x ) , __type ( __y ) ) ;
  25167. }
  25168.  
  25169. constexpr int
  25170. ilogb ( float __x )
  25171. { return __builtin_ilogbf ( __x ) ; }
  25172.  
  25173. constexpr int
  25174. ilogb ( long double __x )
  25175. { return __builtin_ilogbl ( __x ) ; }
  25176.  
  25177. template < typename _Tp >
  25178. constexpr
  25179. typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25180. int > :: __type
  25181. ilogb ( _Tp __x )
  25182. { return __builtin_ilogb ( __x ) ; }
  25183.  
  25184. constexpr float
  25185. lgamma ( float __x )
  25186. { return __builtin_lgammaf ( __x ) ; }
  25187.  
  25188. constexpr long double
  25189. lgamma ( long double __x )
  25190. { return __builtin_lgammal ( __x ) ; }
  25191.  
  25192. template < typename _Tp >
  25193. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25194. double > :: __type
  25195. lgamma ( _Tp __x )
  25196. { return __builtin_lgamma ( __x ) ; }
  25197.  
  25198. constexpr long long
  25199. llrint ( float __x )
  25200. { return __builtin_llrintf ( __x ) ; }
  25201.  
  25202. constexpr long long
  25203. llrint ( long double __x )
  25204. { return __builtin_llrintl ( __x ) ; }
  25205.  
  25206. template < typename _Tp >
  25207. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25208. long long > :: __type
  25209. llrint ( _Tp __x )
  25210. { return __builtin_llrint ( __x ) ; }
  25211.  
  25212. constexpr long long
  25213. llround ( float __x )
  25214. { return __builtin_llroundf ( __x ) ; }
  25215.  
  25216. constexpr long long
  25217. llround ( long double __x )
  25218. { return __builtin_llroundl ( __x ) ; }
  25219.  
  25220. template < typename _Tp >
  25221. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25222. long long > :: __type
  25223. llround ( _Tp __x )
  25224. { return __builtin_llround ( __x ) ; }
  25225.  
  25226. constexpr float
  25227. log1p ( float __x )
  25228. { return __builtin_log1pf ( __x ) ; }
  25229.  
  25230. constexpr long double
  25231. log1p ( long double __x )
  25232. { return __builtin_log1pl ( __x ) ; }
  25233.  
  25234. template < typename _Tp >
  25235. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25236. double > :: __type
  25237. log1p ( _Tp __x )
  25238. { return __builtin_log1p ( __x ) ; }
  25239.  
  25240.  
  25241. constexpr float
  25242. log2 ( float __x )
  25243. { return __builtin_log2f ( __x ) ; }
  25244.  
  25245. constexpr long double
  25246. log2 ( long double __x )
  25247. { return __builtin_log2l ( __x ) ; }
  25248.  
  25249. template < typename _Tp >
  25250. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25251. double > :: __type
  25252. log2 ( _Tp __x )
  25253. { return __builtin_log2 ( __x ) ; }
  25254.  
  25255. constexpr float
  25256. logb ( float __x )
  25257. { return __builtin_logbf ( __x ) ; }
  25258.  
  25259. constexpr long double
  25260. logb ( long double __x )
  25261. { return __builtin_logbl ( __x ) ; }
  25262.  
  25263. template < typename _Tp >
  25264. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25265. double > :: __type
  25266. logb ( _Tp __x )
  25267. { return __builtin_logb ( __x ) ; }
  25268.  
  25269. constexpr long
  25270. lrint ( float __x )
  25271. { return __builtin_lrintf ( __x ) ; }
  25272.  
  25273. constexpr long
  25274. lrint ( long double __x )
  25275. { return __builtin_lrintl ( __x ) ; }
  25276.  
  25277. template < typename _Tp >
  25278. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25279. long > :: __type
  25280. lrint ( _Tp __x )
  25281. { return __builtin_lrint ( __x ) ; }
  25282.  
  25283. constexpr long
  25284. lround ( float __x )
  25285. { return __builtin_lroundf ( __x ) ; }
  25286.  
  25287. constexpr long
  25288. lround ( long double __x )
  25289. { return __builtin_lroundl ( __x ) ; }
  25290.  
  25291. template < typename _Tp >
  25292. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25293. long > :: __type
  25294. lround ( _Tp __x )
  25295. { return __builtin_lround ( __x ) ; }
  25296.  
  25297. constexpr float
  25298. nearbyint ( float __x )
  25299. { return __builtin_nearbyintf ( __x ) ; }
  25300.  
  25301. constexpr long double
  25302. nearbyint ( long double __x )
  25303. { return __builtin_nearbyintl ( __x ) ; }
  25304.  
  25305. template < typename _Tp >
  25306. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25307. double > :: __type
  25308. nearbyint ( _Tp __x )
  25309. { return __builtin_nearbyint ( __x ) ; }
  25310.  
  25311. constexpr float
  25312. nextafter ( float __x , float __y )
  25313. { return __builtin_nextafterf ( __x , __y ) ; }
  25314.  
  25315. constexpr long double
  25316. nextafter ( long double __x , long double __y )
  25317. { return __builtin_nextafterl ( __x , __y ) ; }
  25318.  
  25319. template < typename _Tp , typename _Up >
  25320. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25321. nextafter ( _Tp __x , _Up __y )
  25322. {
  25323. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25324. return nextafter ( __type ( __x ) , __type ( __y ) ) ;
  25325. }
  25326.  
  25327. constexpr float
  25328. nexttoward ( float __x , long double __y )
  25329. { return __builtin_nexttowardf ( __x , __y ) ; }
  25330.  
  25331. constexpr long double
  25332. nexttoward ( long double __x , long double __y )
  25333. { return __builtin_nexttowardl ( __x , __y ) ; }
  25334.  
  25335. template < typename _Tp >
  25336. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25337. double > :: __type
  25338. nexttoward ( _Tp __x , long double __y )
  25339. { return __builtin_nexttoward ( __x , __y ) ; }
  25340.  
  25341. constexpr float
  25342. remainder ( float __x , float __y )
  25343. { return __builtin_remainderf ( __x , __y ) ; }
  25344.  
  25345. constexpr long double
  25346. remainder ( long double __x , long double __y )
  25347. { return __builtin_remainderl ( __x , __y ) ; }
  25348.  
  25349. template < typename _Tp , typename _Up >
  25350. constexpr typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25351. remainder ( _Tp __x , _Up __y )
  25352. {
  25353. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25354. return remainder ( __type ( __x ) , __type ( __y ) ) ;
  25355. }
  25356.  
  25357. inline float
  25358. remquo ( float __x , float __y , int * __pquo )
  25359. { return __builtin_remquof ( __x , __y , __pquo ) ; }
  25360.  
  25361. inline long double
  25362. remquo ( long double __x , long double __y , int * __pquo )
  25363. { return __builtin_remquol ( __x , __y , __pquo ) ; }
  25364.  
  25365. template < typename _Tp , typename _Up >
  25366. inline typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type
  25367. remquo ( _Tp __x , _Up __y , int * __pquo )
  25368. {
  25369. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  25370. return remquo ( __type ( __x ) , __type ( __y ) , __pquo ) ;
  25371. }
  25372.  
  25373. constexpr float
  25374. rint ( float __x )
  25375. { return __builtin_rintf ( __x ) ; }
  25376.  
  25377. constexpr long double
  25378. rint ( long double __x )
  25379. { return __builtin_rintl ( __x ) ; }
  25380.  
  25381. template < typename _Tp >
  25382. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25383. double > :: __type
  25384. rint ( _Tp __x )
  25385. { return __builtin_rint ( __x ) ; }
  25386.  
  25387. constexpr float
  25388. round ( float __x )
  25389. { return __builtin_roundf ( __x ) ; }
  25390.  
  25391. constexpr long double
  25392. round ( long double __x )
  25393. { return __builtin_roundl ( __x ) ; }
  25394.  
  25395. template < typename _Tp >
  25396. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25397. double > :: __type
  25398. round ( _Tp __x )
  25399. { return __builtin_round ( __x ) ; }
  25400.  
  25401. constexpr float
  25402. scalbln ( float __x , long __ex )
  25403. { return __builtin_scalblnf ( __x , __ex ) ; }
  25404.  
  25405. constexpr long double
  25406. scalbln ( long double __x , long __ex )
  25407. { return __builtin_scalblnl ( __x , __ex ) ; }
  25408.  
  25409. template < typename _Tp >
  25410. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25411. double > :: __type
  25412. scalbln ( _Tp __x , long __ex )
  25413. { return __builtin_scalbln ( __x , __ex ) ; }
  25414.  
  25415. constexpr float
  25416. scalbn ( float __x , int __ex )
  25417. { return __builtin_scalbnf ( __x , __ex ) ; }
  25418.  
  25419. constexpr long double
  25420. scalbn ( long double __x , int __ex )
  25421. { return __builtin_scalbnl ( __x , __ex ) ; }
  25422.  
  25423. template < typename _Tp >
  25424. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25425. double > :: __type
  25426. scalbn ( _Tp __x , int __ex )
  25427. { return __builtin_scalbn ( __x , __ex ) ; }
  25428.  
  25429. constexpr float
  25430. tgamma ( float __x )
  25431. { return __builtin_tgammaf ( __x ) ; }
  25432.  
  25433. constexpr long double
  25434. tgamma ( long double __x )
  25435. { return __builtin_tgammal ( __x ) ; }
  25436.  
  25437. template < typename _Tp >
  25438. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25439. double > :: __type
  25440. tgamma ( _Tp __x )
  25441. { return __builtin_tgamma ( __x ) ; }
  25442.  
  25443. constexpr float
  25444. trunc ( float __x )
  25445. { return __builtin_truncf ( __x ) ; }
  25446.  
  25447. constexpr long double
  25448. trunc ( long double __x )
  25449. { return __builtin_truncl ( __x ) ; }
  25450.  
  25451. template < typename _Tp >
  25452. constexpr typename __gnu_cxx :: __enable_if < __is_integer < _Tp > :: __value ,
  25453. double > :: __type
  25454. trunc ( _Tp __x )
  25455. { return __builtin_trunc ( __x ) ; }
  25456.  
  25457.  
  25458. }
  25459. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/limits"
  25460. #40
  25461. #pragma GCC system_header
  25462. #147
  25463. namespace std
  25464. {
  25465. #156
  25466. enum float_round_style
  25467. {
  25468. round_indeterminate = - 1 ,
  25469. round_toward_zero = 0 ,
  25470. round_to_nearest = 1 ,
  25471. round_toward_infinity = 2 ,
  25472. round_toward_neg_infinity = 3
  25473. } ;
  25474. #171
  25475. enum float_denorm_style
  25476. {
  25477.  
  25478. denorm_indeterminate = - 1 ,
  25479.  
  25480. denorm_absent = 0 ,
  25481.  
  25482. denorm_present = 1
  25483. } ;
  25484. #191
  25485. struct __numeric_limits_base
  25486. {
  25487.  
  25488.  
  25489. static constexpr bool is_specialized = false ;
  25490.  
  25491.  
  25492.  
  25493.  
  25494. static constexpr int digits = 0 ;
  25495.  
  25496.  
  25497. static constexpr int digits10 = 0 ;
  25498.  
  25499.  
  25500.  
  25501.  
  25502. static constexpr int max_digits10 = 0 ;
  25503.  
  25504.  
  25505.  
  25506. static constexpr bool is_signed = false ;
  25507.  
  25508.  
  25509. static constexpr bool is_integer = false ;
  25510.  
  25511.  
  25512.  
  25513.  
  25514. static constexpr bool is_exact = false ;
  25515.  
  25516.  
  25517.  
  25518. static constexpr int radix = 0 ;
  25519.  
  25520.  
  25521.  
  25522. static constexpr int min_exponent = 0 ;
  25523.  
  25524.  
  25525.  
  25526. static constexpr int min_exponent10 = 0 ;
  25527.  
  25528.  
  25529.  
  25530.  
  25531. static constexpr int max_exponent = 0 ;
  25532.  
  25533.  
  25534.  
  25535. static constexpr int max_exponent10 = 0 ;
  25536.  
  25537.  
  25538. static constexpr bool has_infinity = false ;
  25539.  
  25540.  
  25541.  
  25542. static constexpr bool has_quiet_NaN = false ;
  25543.  
  25544.  
  25545.  
  25546. static constexpr bool has_signaling_NaN = false ;
  25547.  
  25548.  
  25549. static constexpr float_denorm_style has_denorm = denorm_absent ;
  25550.  
  25551.  
  25552.  
  25553. static constexpr bool has_denorm_loss = false ;
  25554.  
  25555.  
  25556.  
  25557. static constexpr bool is_iec559 = false ;
  25558.  
  25559.  
  25560.  
  25561.  
  25562. static constexpr bool is_bounded = false ;
  25563. #277
  25564. static constexpr bool is_modulo = false ;
  25565.  
  25566.  
  25567. static constexpr bool traps = false ;
  25568.  
  25569.  
  25570. static constexpr bool tinyness_before = false ;
  25571.  
  25572.  
  25573.  
  25574.  
  25575. static constexpr float_round_style round_style =
  25576. round_toward_zero ;
  25577. } ;
  25578. #303
  25579. template < typename _Tp >
  25580. struct numeric_limits : public __numeric_limits_base
  25581. {
  25582.  
  25583.  
  25584. static constexpr _Tp
  25585. min ( ) noexcept { return _Tp ( ) ; }
  25586.  
  25587.  
  25588. static constexpr _Tp
  25589. max ( ) noexcept { return _Tp ( ) ; }
  25590.  
  25591.  
  25592.  
  25593.  
  25594. static constexpr _Tp
  25595. lowest ( ) noexcept { return _Tp ( ) ; }
  25596.  
  25597.  
  25598.  
  25599.  
  25600. static constexpr _Tp
  25601. epsilon ( ) noexcept { return _Tp ( ) ; }
  25602.  
  25603.  
  25604. static constexpr _Tp
  25605. round_error ( ) noexcept { return _Tp ( ) ; }
  25606.  
  25607.  
  25608. static constexpr _Tp
  25609. infinity ( ) noexcept { return _Tp ( ) ; }
  25610.  
  25611.  
  25612.  
  25613. static constexpr _Tp
  25614. quiet_NaN ( ) noexcept { return _Tp ( ) ; }
  25615.  
  25616.  
  25617.  
  25618. static constexpr _Tp
  25619. signaling_NaN ( ) noexcept { return _Tp ( ) ; }
  25620.  
  25621.  
  25622.  
  25623.  
  25624. static constexpr _Tp
  25625. denorm_min ( ) noexcept { return _Tp ( ) ; }
  25626. } ;
  25627.  
  25628.  
  25629. template < typename _Tp >
  25630. struct numeric_limits < const _Tp >
  25631. : public numeric_limits < _Tp > { } ;
  25632.  
  25633. template < typename _Tp >
  25634. struct numeric_limits < volatile _Tp >
  25635. : public numeric_limits < _Tp > { } ;
  25636.  
  25637. template < typename _Tp >
  25638. struct numeric_limits < const volatile _Tp >
  25639. : public numeric_limits < _Tp > { } ;
  25640. #370
  25641. template < >
  25642. struct numeric_limits < bool >
  25643. {
  25644. static constexpr bool is_specialized = true ;
  25645.  
  25646. static constexpr bool
  25647. min ( ) noexcept { return false ; }
  25648.  
  25649. static constexpr bool
  25650. max ( ) noexcept { return true ; }
  25651.  
  25652.  
  25653. static constexpr bool
  25654. lowest ( ) noexcept { return min ( ) ; }
  25655.  
  25656. static constexpr int digits = 1 ;
  25657. static constexpr int digits10 = 0 ;
  25658.  
  25659. static constexpr int max_digits10 = 0 ;
  25660.  
  25661. static constexpr bool is_signed = false ;
  25662. static constexpr bool is_integer = true ;
  25663. static constexpr bool is_exact = true ;
  25664. static constexpr int radix = 2 ;
  25665.  
  25666. static constexpr bool
  25667. epsilon ( ) noexcept { return false ; }
  25668.  
  25669. static constexpr bool
  25670. round_error ( ) noexcept { return false ; }
  25671.  
  25672. static constexpr int min_exponent = 0 ;
  25673. static constexpr int min_exponent10 = 0 ;
  25674. static constexpr int max_exponent = 0 ;
  25675. static constexpr int max_exponent10 = 0 ;
  25676.  
  25677. static constexpr bool has_infinity = false ;
  25678. static constexpr bool has_quiet_NaN = false ;
  25679. static constexpr bool has_signaling_NaN = false ;
  25680. static constexpr float_denorm_style has_denorm
  25681. = denorm_absent ;
  25682. static constexpr bool has_denorm_loss = false ;
  25683.  
  25684. static constexpr bool
  25685. infinity ( ) noexcept { return false ; }
  25686.  
  25687. static constexpr bool
  25688. quiet_NaN ( ) noexcept { return false ; }
  25689.  
  25690. static constexpr bool
  25691. signaling_NaN ( ) noexcept { return false ; }
  25692.  
  25693. static constexpr bool
  25694. denorm_min ( ) noexcept { return false ; }
  25695.  
  25696. static constexpr bool is_iec559 = false ;
  25697. static constexpr bool is_bounded = true ;
  25698. static constexpr bool is_modulo = false ;
  25699.  
  25700.  
  25701.  
  25702.  
  25703. static constexpr bool traps = true ;
  25704. static constexpr bool tinyness_before = false ;
  25705. static constexpr float_round_style round_style
  25706. = round_toward_zero ;
  25707. } ;
  25708.  
  25709.  
  25710. template < >
  25711. struct numeric_limits < char >
  25712. {
  25713. static constexpr bool is_specialized = true ;
  25714.  
  25715. static constexpr char
  25716. min ( ) noexcept { return ( ( ( char ) ( - 1 ) < 0 ) ? - ( ( ( char ) ( - 1 ) < 0 ) ? ( ( ( ( ( char ) 1 << ( ( sizeof (
  25717. #445
  25718. char ) * 8 - ( ( char ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( char ) 0 ) - 1 : ( char ) 0 ) ; }
  25719.  
  25720. static constexpr char
  25721. max ( ) noexcept { return ( ( ( char ) ( - 1 ) < 0 ) ? ( ( ( ( ( char ) 1 << ( ( sizeof ( char ) * 8 - ( ( char ) ( - 1 )
  25722. #448
  25723. < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( char ) 0 ) ; }
  25724.  
  25725.  
  25726. static constexpr char
  25727. lowest ( ) noexcept { return min ( ) ; }
  25728.  
  25729.  
  25730. static constexpr int digits = ( sizeof ( char ) * 8 - ( ( char ) ( - 1 ) < 0 ) ) ;
  25731. static constexpr int digits10 = ( ( sizeof ( char ) * 8 - ( ( char ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  25732.  
  25733. static constexpr int max_digits10 = 0 ;
  25734.  
  25735. static constexpr bool is_signed = ( ( char ) ( - 1 ) < 0 ) ;
  25736. static constexpr bool is_integer = true ;
  25737. static constexpr bool is_exact = true ;
  25738. static constexpr int radix = 2 ;
  25739.  
  25740. static constexpr char
  25741. epsilon ( ) noexcept { return 0 ; }
  25742.  
  25743. static constexpr char
  25744. round_error ( ) noexcept { return 0 ; }
  25745.  
  25746. static constexpr int min_exponent = 0 ;
  25747. static constexpr int min_exponent10 = 0 ;
  25748. static constexpr int max_exponent = 0 ;
  25749. static constexpr int max_exponent10 = 0 ;
  25750.  
  25751. static constexpr bool has_infinity = false ;
  25752. static constexpr bool has_quiet_NaN = false ;
  25753. static constexpr bool has_signaling_NaN = false ;
  25754. static constexpr float_denorm_style has_denorm
  25755. = denorm_absent ;
  25756. static constexpr bool has_denorm_loss = false ;
  25757.  
  25758. static constexpr
  25759. char infinity ( ) noexcept { return char ( ) ; }
  25760.  
  25761. static constexpr char
  25762. quiet_NaN ( ) noexcept { return char ( ) ; }
  25763.  
  25764. static constexpr char
  25765. signaling_NaN ( ) noexcept { return char ( ) ; }
  25766.  
  25767. static constexpr char
  25768. denorm_min ( ) noexcept { return static_cast < char > ( 0 ) ; }
  25769.  
  25770. static constexpr bool is_iec559 = false ;
  25771. static constexpr bool is_bounded = true ;
  25772. static constexpr bool is_modulo = ! is_signed ;
  25773.  
  25774. static constexpr bool traps = true ;
  25775. static constexpr bool tinyness_before = false ;
  25776. static constexpr float_round_style round_style
  25777. = round_toward_zero ;
  25778. } ;
  25779.  
  25780.  
  25781. template < >
  25782. struct numeric_limits < signed char >
  25783. {
  25784. static constexpr bool is_specialized = true ;
  25785.  
  25786. static constexpr signed char
  25787. min ( ) noexcept { return - 127 - 1 ; }
  25788.  
  25789. static constexpr signed char
  25790. max ( ) noexcept { return 127 ; }
  25791.  
  25792.  
  25793. static constexpr signed char
  25794. lowest ( ) noexcept { return min ( ) ; }
  25795.  
  25796.  
  25797. static constexpr int digits = ( sizeof ( signed char ) * 8 - ( ( signed char ) ( - 1 ) < 0 ) ) ;
  25798. static constexpr int digits10
  25799. = ( ( sizeof ( signed char ) * 8 - ( ( signed char ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  25800.  
  25801. static constexpr int max_digits10 = 0 ;
  25802.  
  25803. static constexpr bool is_signed = true ;
  25804. static constexpr bool is_integer = true ;
  25805. static constexpr bool is_exact = true ;
  25806. static constexpr int radix = 2 ;
  25807.  
  25808. static constexpr signed char
  25809. epsilon ( ) noexcept { return 0 ; }
  25810.  
  25811. static constexpr signed char
  25812. round_error ( ) noexcept { return 0 ; }
  25813.  
  25814. static constexpr int min_exponent = 0 ;
  25815. static constexpr int min_exponent10 = 0 ;
  25816. static constexpr int max_exponent = 0 ;
  25817. static constexpr int max_exponent10 = 0 ;
  25818.  
  25819. static constexpr bool has_infinity = false ;
  25820. static constexpr bool has_quiet_NaN = false ;
  25821. static constexpr bool has_signaling_NaN = false ;
  25822. static constexpr float_denorm_style has_denorm
  25823. = denorm_absent ;
  25824. static constexpr bool has_denorm_loss = false ;
  25825.  
  25826. static constexpr signed char
  25827. infinity ( ) noexcept { return static_cast < signed char > ( 0 ) ; }
  25828.  
  25829. static constexpr signed char
  25830. quiet_NaN ( ) noexcept { return static_cast < signed char > ( 0 ) ; }
  25831.  
  25832. static constexpr signed char
  25833. signaling_NaN ( ) noexcept
  25834. { return static_cast < signed char > ( 0 ) ; }
  25835.  
  25836. static constexpr signed char
  25837. denorm_min ( ) noexcept
  25838. { return static_cast < signed char > ( 0 ) ; }
  25839.  
  25840. static constexpr bool is_iec559 = false ;
  25841. static constexpr bool is_bounded = true ;
  25842. static constexpr bool is_modulo = false ;
  25843.  
  25844. static constexpr bool traps = true ;
  25845. static constexpr bool tinyness_before = false ;
  25846. static constexpr float_round_style round_style
  25847. = round_toward_zero ;
  25848. } ;
  25849.  
  25850.  
  25851. template < >
  25852. struct numeric_limits < unsigned char >
  25853. {
  25854. static constexpr bool is_specialized = true ;
  25855.  
  25856. static constexpr unsigned char
  25857. min ( ) noexcept { return 0 ; }
  25858.  
  25859. static constexpr unsigned char
  25860. max ( ) noexcept { return 127 * 2U + 1 ; }
  25861.  
  25862.  
  25863. static constexpr unsigned char
  25864. lowest ( ) noexcept { return min ( ) ; }
  25865.  
  25866.  
  25867. static constexpr int digits
  25868. = ( sizeof ( unsigned char ) * 8 - ( ( unsigned char ) ( - 1 ) < 0 ) ) ;
  25869. static constexpr int digits10
  25870. = ( ( sizeof ( unsigned char ) * 8 - ( ( unsigned char ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  25871.  
  25872. static constexpr int max_digits10 = 0 ;
  25873.  
  25874. static constexpr bool is_signed = false ;
  25875. static constexpr bool is_integer = true ;
  25876. static constexpr bool is_exact = true ;
  25877. static constexpr int radix = 2 ;
  25878.  
  25879. static constexpr unsigned char
  25880. epsilon ( ) noexcept { return 0 ; }
  25881.  
  25882. static constexpr unsigned char
  25883. round_error ( ) noexcept { return 0 ; }
  25884.  
  25885. static constexpr int min_exponent = 0 ;
  25886. static constexpr int min_exponent10 = 0 ;
  25887. static constexpr int max_exponent = 0 ;
  25888. static constexpr int max_exponent10 = 0 ;
  25889.  
  25890. static constexpr bool has_infinity = false ;
  25891. static constexpr bool has_quiet_NaN = false ;
  25892. static constexpr bool has_signaling_NaN = false ;
  25893. static constexpr float_denorm_style has_denorm
  25894. = denorm_absent ;
  25895. static constexpr bool has_denorm_loss = false ;
  25896.  
  25897. static constexpr unsigned char
  25898. infinity ( ) noexcept
  25899. { return static_cast < unsigned char > ( 0 ) ; }
  25900.  
  25901. static constexpr unsigned char
  25902. quiet_NaN ( ) noexcept
  25903. { return static_cast < unsigned char > ( 0 ) ; }
  25904.  
  25905. static constexpr unsigned char
  25906. signaling_NaN ( ) noexcept
  25907. { return static_cast < unsigned char > ( 0 ) ; }
  25908.  
  25909. static constexpr unsigned char
  25910. denorm_min ( ) noexcept
  25911. { return static_cast < unsigned char > ( 0 ) ; }
  25912.  
  25913. static constexpr bool is_iec559 = false ;
  25914. static constexpr bool is_bounded = true ;
  25915. static constexpr bool is_modulo = true ;
  25916.  
  25917. static constexpr bool traps = true ;
  25918. static constexpr bool tinyness_before = false ;
  25919. static constexpr float_round_style round_style
  25920. = round_toward_zero ;
  25921. } ;
  25922.  
  25923.  
  25924. template < >
  25925. struct numeric_limits < wchar_t >
  25926. {
  25927. static constexpr bool is_specialized = true ;
  25928.  
  25929. static constexpr wchar_t
  25930. min ( ) noexcept { return ( ( ( wchar_t ) ( - 1 ) < 0 ) ? - ( ( ( wchar_t ) ( - 1 ) < 0 ) ? ( ( ( ( ( wchar_t ) 1 << ( (
  25931. #655
  25932. sizeof ( wchar_t ) * 8 - ( ( wchar_t ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( wchar_t ) 0 ) - 1 : ( wchar_t ) 0
  25933. #655
  25934. ) ; }
  25935.  
  25936. static constexpr wchar_t
  25937. max ( ) noexcept { return ( ( ( wchar_t ) ( - 1 ) < 0 ) ? ( ( ( ( ( wchar_t ) 1 << ( ( sizeof ( wchar_t ) * 8 - ( ( wchar_t
  25938. #658
  25939. ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( wchar_t ) 0 ) ; }
  25940.  
  25941.  
  25942. static constexpr wchar_t
  25943. lowest ( ) noexcept { return min ( ) ; }
  25944.  
  25945.  
  25946. static constexpr int digits = ( sizeof ( wchar_t ) * 8 - ( ( wchar_t ) ( - 1 ) < 0 ) ) ;
  25947. static constexpr int digits10
  25948. = ( ( sizeof ( wchar_t ) * 8 - ( ( wchar_t ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  25949.  
  25950. static constexpr int max_digits10 = 0 ;
  25951.  
  25952. static constexpr bool is_signed = ( ( wchar_t ) ( - 1 ) < 0 ) ;
  25953. static constexpr bool is_integer = true ;
  25954. static constexpr bool is_exact = true ;
  25955. static constexpr int radix = 2 ;
  25956.  
  25957. static constexpr wchar_t
  25958. epsilon ( ) noexcept { return 0 ; }
  25959.  
  25960. static constexpr wchar_t
  25961. round_error ( ) noexcept { return 0 ; }
  25962.  
  25963. static constexpr int min_exponent = 0 ;
  25964. static constexpr int min_exponent10 = 0 ;
  25965. static constexpr int max_exponent = 0 ;
  25966. static constexpr int max_exponent10 = 0 ;
  25967.  
  25968. static constexpr bool has_infinity = false ;
  25969. static constexpr bool has_quiet_NaN = false ;
  25970. static constexpr bool has_signaling_NaN = false ;
  25971. static constexpr float_denorm_style has_denorm
  25972. = denorm_absent ;
  25973. static constexpr bool has_denorm_loss = false ;
  25974.  
  25975. static constexpr wchar_t
  25976. infinity ( ) noexcept { return wchar_t ( ) ; }
  25977.  
  25978. static constexpr wchar_t
  25979. quiet_NaN ( ) noexcept { return wchar_t ( ) ; }
  25980.  
  25981. static constexpr wchar_t
  25982. signaling_NaN ( ) noexcept { return wchar_t ( ) ; }
  25983.  
  25984. static constexpr wchar_t
  25985. denorm_min ( ) noexcept { return wchar_t ( ) ; }
  25986.  
  25987. static constexpr bool is_iec559 = false ;
  25988. static constexpr bool is_bounded = true ;
  25989. static constexpr bool is_modulo = ! is_signed ;
  25990.  
  25991. static constexpr bool traps = true ;
  25992. static constexpr bool tinyness_before = false ;
  25993. static constexpr float_round_style round_style
  25994. = round_toward_zero ;
  25995. } ;
  25996.  
  25997.  
  25998.  
  25999. template < >
  26000. struct numeric_limits < char16_t >
  26001. {
  26002. static constexpr bool is_specialized = true ;
  26003.  
  26004. static constexpr char16_t
  26005. min ( ) noexcept { return ( ( ( char16_t ) ( - 1 ) < 0 ) ? - ( ( ( char16_t ) ( - 1 ) < 0 ) ? ( ( ( ( ( char16_t ) 1 << (
  26006. #724
  26007. ( sizeof ( char16_t ) * 8 - ( ( char16_t ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( char16_t ) 0 ) - 1 : ( char16_t
  26008. #724
  26009. ) 0 ) ; }
  26010.  
  26011. static constexpr char16_t
  26012. max ( ) noexcept { return ( ( ( char16_t ) ( - 1 ) < 0 ) ? ( ( ( ( ( char16_t ) 1 << ( ( sizeof ( char16_t ) * 8 - ( ( char16_t
  26013. #727
  26014. ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( char16_t ) 0 ) ; }
  26015.  
  26016. static constexpr char16_t
  26017. lowest ( ) noexcept { return min ( ) ; }
  26018.  
  26019. static constexpr int digits = ( sizeof ( char16_t ) * 8 - ( ( char16_t ) ( - 1 ) < 0 ) ) ;
  26020. static constexpr int digits10 = ( ( sizeof ( char16_t ) * 8 - ( ( char16_t ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26021. static constexpr int max_digits10 = 0 ;
  26022. static constexpr bool is_signed = ( ( char16_t ) ( - 1 ) < 0 ) ;
  26023. static constexpr bool is_integer = true ;
  26024. static constexpr bool is_exact = true ;
  26025. static constexpr int radix = 2 ;
  26026.  
  26027. static constexpr char16_t
  26028. epsilon ( ) noexcept { return 0 ; }
  26029.  
  26030. static constexpr char16_t
  26031. round_error ( ) noexcept { return 0 ; }
  26032.  
  26033. static constexpr int min_exponent = 0 ;
  26034. static constexpr int min_exponent10 = 0 ;
  26035. static constexpr int max_exponent = 0 ;
  26036. static constexpr int max_exponent10 = 0 ;
  26037.  
  26038. static constexpr bool has_infinity = false ;
  26039. static constexpr bool has_quiet_NaN = false ;
  26040. static constexpr bool has_signaling_NaN = false ;
  26041. static constexpr float_denorm_style has_denorm = denorm_absent ;
  26042. static constexpr bool has_denorm_loss = false ;
  26043.  
  26044. static constexpr char16_t
  26045. infinity ( ) noexcept { return char16_t ( ) ; }
  26046.  
  26047. static constexpr char16_t
  26048. quiet_NaN ( ) noexcept { return char16_t ( ) ; }
  26049.  
  26050. static constexpr char16_t
  26051. signaling_NaN ( ) noexcept { return char16_t ( ) ; }
  26052.  
  26053. static constexpr char16_t
  26054. denorm_min ( ) noexcept { return char16_t ( ) ; }
  26055.  
  26056. static constexpr bool is_iec559 = false ;
  26057. static constexpr bool is_bounded = true ;
  26058. static constexpr bool is_modulo = ! is_signed ;
  26059.  
  26060. static constexpr bool traps = true ;
  26061. static constexpr bool tinyness_before = false ;
  26062. static constexpr float_round_style round_style = round_toward_zero ;
  26063. } ;
  26064.  
  26065.  
  26066. template < >
  26067. struct numeric_limits < char32_t >
  26068. {
  26069. static constexpr bool is_specialized = true ;
  26070.  
  26071. static constexpr char32_t
  26072. min ( ) noexcept { return ( ( ( char32_t ) ( - 1 ) < 0 ) ? - ( ( ( char32_t ) ( - 1 ) < 0 ) ? ( ( ( ( ( char32_t ) 1 << (
  26073. #785
  26074. ( sizeof ( char32_t ) * 8 - ( ( char32_t ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( char32_t ) 0 ) - 1 : ( char32_t
  26075. #785
  26076. ) 0 ) ; }
  26077.  
  26078. static constexpr char32_t
  26079. max ( ) noexcept { return ( ( ( char32_t ) ( - 1 ) < 0 ) ? ( ( ( ( ( char32_t ) 1 << ( ( sizeof ( char32_t ) * 8 - ( ( char32_t
  26080. #788
  26081. ) ( - 1 ) < 0 ) ) - 1 ) ) - 1 ) << 1 ) + 1 ) : ~ ( char32_t ) 0 ) ; }
  26082.  
  26083. static constexpr char32_t
  26084. lowest ( ) noexcept { return min ( ) ; }
  26085.  
  26086. static constexpr int digits = ( sizeof ( char32_t ) * 8 - ( ( char32_t ) ( - 1 ) < 0 ) ) ;
  26087. static constexpr int digits10 = ( ( sizeof ( char32_t ) * 8 - ( ( char32_t ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26088. static constexpr int max_digits10 = 0 ;
  26089. static constexpr bool is_signed = ( ( char32_t ) ( - 1 ) < 0 ) ;
  26090. static constexpr bool is_integer = true ;
  26091. static constexpr bool is_exact = true ;
  26092. static constexpr int radix = 2 ;
  26093.  
  26094. static constexpr char32_t
  26095. epsilon ( ) noexcept { return 0 ; }
  26096.  
  26097. static constexpr char32_t
  26098. round_error ( ) noexcept { return 0 ; }
  26099.  
  26100. static constexpr int min_exponent = 0 ;
  26101. static constexpr int min_exponent10 = 0 ;
  26102. static constexpr int max_exponent = 0 ;
  26103. static constexpr int max_exponent10 = 0 ;
  26104.  
  26105. static constexpr bool has_infinity = false ;
  26106. static constexpr bool has_quiet_NaN = false ;
  26107. static constexpr bool has_signaling_NaN = false ;
  26108. static constexpr float_denorm_style has_denorm = denorm_absent ;
  26109. static constexpr bool has_denorm_loss = false ;
  26110.  
  26111. static constexpr char32_t
  26112. infinity ( ) noexcept { return char32_t ( ) ; }
  26113.  
  26114. static constexpr char32_t
  26115. quiet_NaN ( ) noexcept { return char32_t ( ) ; }
  26116.  
  26117. static constexpr char32_t
  26118. signaling_NaN ( ) noexcept { return char32_t ( ) ; }
  26119.  
  26120. static constexpr char32_t
  26121. denorm_min ( ) noexcept { return char32_t ( ) ; }
  26122.  
  26123. static constexpr bool is_iec559 = false ;
  26124. static constexpr bool is_bounded = true ;
  26125. static constexpr bool is_modulo = ! is_signed ;
  26126.  
  26127. static constexpr bool traps = true ;
  26128. static constexpr bool tinyness_before = false ;
  26129. static constexpr float_round_style round_style = round_toward_zero ;
  26130. } ;
  26131.  
  26132.  
  26133.  
  26134. template < >
  26135. struct numeric_limits < short >
  26136. {
  26137. static constexpr bool is_specialized = true ;
  26138.  
  26139. static constexpr short
  26140. min ( ) noexcept { return - 32767 - 1 ; }
  26141.  
  26142. static constexpr short
  26143. max ( ) noexcept { return 32767 ; }
  26144.  
  26145.  
  26146. static constexpr short
  26147. lowest ( ) noexcept { return min ( ) ; }
  26148.  
  26149.  
  26150. static constexpr int digits = ( sizeof ( short ) * 8 - ( ( short ) ( - 1 ) < 0 ) ) ;
  26151. static constexpr int digits10 = ( ( sizeof ( short ) * 8 - ( ( short ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26152.  
  26153. static constexpr int max_digits10 = 0 ;
  26154.  
  26155. static constexpr bool is_signed = true ;
  26156. static constexpr bool is_integer = true ;
  26157. static constexpr bool is_exact = true ;
  26158. static constexpr int radix = 2 ;
  26159.  
  26160. static constexpr short
  26161. epsilon ( ) noexcept { return 0 ; }
  26162.  
  26163. static constexpr short
  26164. round_error ( ) noexcept { return 0 ; }
  26165.  
  26166. static constexpr int min_exponent = 0 ;
  26167. static constexpr int min_exponent10 = 0 ;
  26168. static constexpr int max_exponent = 0 ;
  26169. static constexpr int max_exponent10 = 0 ;
  26170.  
  26171. static constexpr bool has_infinity = false ;
  26172. static constexpr bool has_quiet_NaN = false ;
  26173. static constexpr bool has_signaling_NaN = false ;
  26174. static constexpr float_denorm_style has_denorm
  26175. = denorm_absent ;
  26176. static constexpr bool has_denorm_loss = false ;
  26177.  
  26178. static constexpr short
  26179. infinity ( ) noexcept { return short ( ) ; }
  26180.  
  26181. static constexpr short
  26182. quiet_NaN ( ) noexcept { return short ( ) ; }
  26183.  
  26184. static constexpr short
  26185. signaling_NaN ( ) noexcept { return short ( ) ; }
  26186.  
  26187. static constexpr short
  26188. denorm_min ( ) noexcept { return short ( ) ; }
  26189.  
  26190. static constexpr bool is_iec559 = false ;
  26191. static constexpr bool is_bounded = true ;
  26192. static constexpr bool is_modulo = false ;
  26193.  
  26194. static constexpr bool traps = true ;
  26195. static constexpr bool tinyness_before = false ;
  26196. static constexpr float_round_style round_style
  26197. = round_toward_zero ;
  26198. } ;
  26199.  
  26200.  
  26201. template < >
  26202. struct numeric_limits < unsigned short >
  26203. {
  26204. static constexpr bool is_specialized = true ;
  26205.  
  26206. static constexpr unsigned short
  26207. min ( ) noexcept { return 0 ; }
  26208.  
  26209. static constexpr unsigned short
  26210. max ( ) noexcept { return 32767 * 2U + 1 ; }
  26211.  
  26212.  
  26213. static constexpr unsigned short
  26214. lowest ( ) noexcept { return min ( ) ; }
  26215.  
  26216.  
  26217. static constexpr int digits
  26218. = ( sizeof ( unsigned short ) * 8 - ( ( unsigned short ) ( - 1 ) < 0 ) ) ;
  26219. static constexpr int digits10
  26220. = ( ( sizeof ( unsigned short ) * 8 - ( ( unsigned short ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26221.  
  26222. static constexpr int max_digits10 = 0 ;
  26223.  
  26224. static constexpr bool is_signed = false ;
  26225. static constexpr bool is_integer = true ;
  26226. static constexpr bool is_exact = true ;
  26227. static constexpr int radix = 2 ;
  26228.  
  26229. static constexpr unsigned short
  26230. epsilon ( ) noexcept { return 0 ; }
  26231.  
  26232. static constexpr unsigned short
  26233. round_error ( ) noexcept { return 0 ; }
  26234.  
  26235. static constexpr int min_exponent = 0 ;
  26236. static constexpr int min_exponent10 = 0 ;
  26237. static constexpr int max_exponent = 0 ;
  26238. static constexpr int max_exponent10 = 0 ;
  26239.  
  26240. static constexpr bool has_infinity = false ;
  26241. static constexpr bool has_quiet_NaN = false ;
  26242. static constexpr bool has_signaling_NaN = false ;
  26243. static constexpr float_denorm_style has_denorm
  26244. = denorm_absent ;
  26245. static constexpr bool has_denorm_loss = false ;
  26246.  
  26247. static constexpr unsigned short
  26248. infinity ( ) noexcept
  26249. { return static_cast < unsigned short > ( 0 ) ; }
  26250.  
  26251. static constexpr unsigned short
  26252. quiet_NaN ( ) noexcept
  26253. { return static_cast < unsigned short > ( 0 ) ; }
  26254.  
  26255. static constexpr unsigned short
  26256. signaling_NaN ( ) noexcept
  26257. { return static_cast < unsigned short > ( 0 ) ; }
  26258.  
  26259. static constexpr unsigned short
  26260. denorm_min ( ) noexcept
  26261. { return static_cast < unsigned short > ( 0 ) ; }
  26262.  
  26263. static constexpr bool is_iec559 = false ;
  26264. static constexpr bool is_bounded = true ;
  26265. static constexpr bool is_modulo = true ;
  26266.  
  26267. static constexpr bool traps = true ;
  26268. static constexpr bool tinyness_before = false ;
  26269. static constexpr float_round_style round_style
  26270. = round_toward_zero ;
  26271. } ;
  26272.  
  26273.  
  26274. template < >
  26275. struct numeric_limits < int >
  26276. {
  26277. static constexpr bool is_specialized = true ;
  26278.  
  26279. static constexpr int
  26280. min ( ) noexcept { return - 2147483647 - 1 ; }
  26281.  
  26282. static constexpr int
  26283. max ( ) noexcept { return 2147483647 ; }
  26284.  
  26285.  
  26286. static constexpr int
  26287. lowest ( ) noexcept { return min ( ) ; }
  26288.  
  26289.  
  26290. static constexpr int digits = ( sizeof ( int ) * 8 - ( ( int ) ( - 1 ) < 0 ) ) ;
  26291. static constexpr int digits10 = ( ( sizeof ( int ) * 8 - ( ( int ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26292.  
  26293. static constexpr int max_digits10 = 0 ;
  26294.  
  26295. static constexpr bool is_signed = true ;
  26296. static constexpr bool is_integer = true ;
  26297. static constexpr bool is_exact = true ;
  26298. static constexpr int radix = 2 ;
  26299.  
  26300. static constexpr int
  26301. epsilon ( ) noexcept { return 0 ; }
  26302.  
  26303. static constexpr int
  26304. round_error ( ) noexcept { return 0 ; }
  26305.  
  26306. static constexpr int min_exponent = 0 ;
  26307. static constexpr int min_exponent10 = 0 ;
  26308. static constexpr int max_exponent = 0 ;
  26309. static constexpr int max_exponent10 = 0 ;
  26310.  
  26311. static constexpr bool has_infinity = false ;
  26312. static constexpr bool has_quiet_NaN = false ;
  26313. static constexpr bool has_signaling_NaN = false ;
  26314. static constexpr float_denorm_style has_denorm
  26315. = denorm_absent ;
  26316. static constexpr bool has_denorm_loss = false ;
  26317.  
  26318. static constexpr int
  26319. infinity ( ) noexcept { return static_cast < int > ( 0 ) ; }
  26320.  
  26321. static constexpr int
  26322. quiet_NaN ( ) noexcept { return static_cast < int > ( 0 ) ; }
  26323.  
  26324. static constexpr int
  26325. signaling_NaN ( ) noexcept { return static_cast < int > ( 0 ) ; }
  26326.  
  26327. static constexpr int
  26328. denorm_min ( ) noexcept { return static_cast < int > ( 0 ) ; }
  26329.  
  26330. static constexpr bool is_iec559 = false ;
  26331. static constexpr bool is_bounded = true ;
  26332. static constexpr bool is_modulo = false ;
  26333.  
  26334. static constexpr bool traps = true ;
  26335. static constexpr bool tinyness_before = false ;
  26336. static constexpr float_round_style round_style
  26337. = round_toward_zero ;
  26338. } ;
  26339.  
  26340.  
  26341. template < >
  26342. struct numeric_limits < unsigned int >
  26343. {
  26344. static constexpr bool is_specialized = true ;
  26345.  
  26346. static constexpr unsigned int
  26347. min ( ) noexcept { return 0 ; }
  26348.  
  26349. static constexpr unsigned int
  26350. max ( ) noexcept { return 2147483647 * 2U + 1 ; }
  26351.  
  26352.  
  26353. static constexpr unsigned int
  26354. lowest ( ) noexcept { return min ( ) ; }
  26355.  
  26356.  
  26357. static constexpr int digits
  26358. = ( sizeof ( unsigned int ) * 8 - ( ( unsigned int ) ( - 1 ) < 0 ) ) ;
  26359. static constexpr int digits10
  26360. = ( ( sizeof ( unsigned int ) * 8 - ( ( unsigned int ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26361.  
  26362. static constexpr int max_digits10 = 0 ;
  26363.  
  26364. static constexpr bool is_signed = false ;
  26365. static constexpr bool is_integer = true ;
  26366. static constexpr bool is_exact = true ;
  26367. static constexpr int radix = 2 ;
  26368.  
  26369. static constexpr unsigned int
  26370. epsilon ( ) noexcept { return 0 ; }
  26371.  
  26372. static constexpr unsigned int
  26373. round_error ( ) noexcept { return 0 ; }
  26374.  
  26375. static constexpr int min_exponent = 0 ;
  26376. static constexpr int min_exponent10 = 0 ;
  26377. static constexpr int max_exponent = 0 ;
  26378. static constexpr int max_exponent10 = 0 ;
  26379.  
  26380. static constexpr bool has_infinity = false ;
  26381. static constexpr bool has_quiet_NaN = false ;
  26382. static constexpr bool has_signaling_NaN = false ;
  26383. static constexpr float_denorm_style has_denorm
  26384. = denorm_absent ;
  26385. static constexpr bool has_denorm_loss = false ;
  26386.  
  26387. static constexpr unsigned int
  26388. infinity ( ) noexcept { return static_cast < unsigned int > ( 0 ) ; }
  26389.  
  26390. static constexpr unsigned int
  26391. quiet_NaN ( ) noexcept
  26392. { return static_cast < unsigned int > ( 0 ) ; }
  26393.  
  26394. static constexpr unsigned int
  26395. signaling_NaN ( ) noexcept
  26396. { return static_cast < unsigned int > ( 0 ) ; }
  26397.  
  26398. static constexpr unsigned int
  26399. denorm_min ( ) noexcept
  26400. { return static_cast < unsigned int > ( 0 ) ; }
  26401.  
  26402. static constexpr bool is_iec559 = false ;
  26403. static constexpr bool is_bounded = true ;
  26404. static constexpr bool is_modulo = true ;
  26405.  
  26406. static constexpr bool traps = true ;
  26407. static constexpr bool tinyness_before = false ;
  26408. static constexpr float_round_style round_style
  26409. = round_toward_zero ;
  26410. } ;
  26411.  
  26412.  
  26413. template < >
  26414. struct numeric_limits < long >
  26415. {
  26416. static constexpr bool is_specialized = true ;
  26417.  
  26418. static constexpr long
  26419. min ( ) noexcept { return - 9223372036854775807L - 1 ; }
  26420.  
  26421. static constexpr long
  26422. max ( ) noexcept { return 9223372036854775807L ; }
  26423.  
  26424.  
  26425. static constexpr long
  26426. lowest ( ) noexcept { return min ( ) ; }
  26427.  
  26428.  
  26429. static constexpr int digits = ( sizeof ( long ) * 8 - ( ( long ) ( - 1 ) < 0 ) ) ;
  26430. static constexpr int digits10 = ( ( sizeof ( long ) * 8 - ( ( long ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26431.  
  26432. static constexpr int max_digits10 = 0 ;
  26433.  
  26434. static constexpr bool is_signed = true ;
  26435. static constexpr bool is_integer = true ;
  26436. static constexpr bool is_exact = true ;
  26437. static constexpr int radix = 2 ;
  26438.  
  26439. static constexpr long
  26440. epsilon ( ) noexcept { return 0 ; }
  26441.  
  26442. static constexpr long
  26443. round_error ( ) noexcept { return 0 ; }
  26444.  
  26445. static constexpr int min_exponent = 0 ;
  26446. static constexpr int min_exponent10 = 0 ;
  26447. static constexpr int max_exponent = 0 ;
  26448. static constexpr int max_exponent10 = 0 ;
  26449.  
  26450. static constexpr bool has_infinity = false ;
  26451. static constexpr bool has_quiet_NaN = false ;
  26452. static constexpr bool has_signaling_NaN = false ;
  26453. static constexpr float_denorm_style has_denorm
  26454. = denorm_absent ;
  26455. static constexpr bool has_denorm_loss = false ;
  26456.  
  26457. static constexpr long
  26458. infinity ( ) noexcept { return static_cast < long > ( 0 ) ; }
  26459.  
  26460. static constexpr long
  26461. quiet_NaN ( ) noexcept { return static_cast < long > ( 0 ) ; }
  26462.  
  26463. static constexpr long
  26464. signaling_NaN ( ) noexcept { return static_cast < long > ( 0 ) ; }
  26465.  
  26466. static constexpr long
  26467. denorm_min ( ) noexcept { return static_cast < long > ( 0 ) ; }
  26468.  
  26469. static constexpr bool is_iec559 = false ;
  26470. static constexpr bool is_bounded = true ;
  26471. static constexpr bool is_modulo = false ;
  26472.  
  26473. static constexpr bool traps = true ;
  26474. static constexpr bool tinyness_before = false ;
  26475. static constexpr float_round_style round_style
  26476. = round_toward_zero ;
  26477. } ;
  26478.  
  26479.  
  26480. template < >
  26481. struct numeric_limits < unsigned long >
  26482. {
  26483. static constexpr bool is_specialized = true ;
  26484.  
  26485. static constexpr unsigned long
  26486. min ( ) noexcept { return 0 ; }
  26487.  
  26488. static constexpr unsigned long
  26489. max ( ) noexcept { return 9223372036854775807L * 2UL + 1 ; }
  26490.  
  26491.  
  26492. static constexpr unsigned long
  26493. lowest ( ) noexcept { return min ( ) ; }
  26494.  
  26495.  
  26496. static constexpr int digits
  26497. = ( sizeof ( unsigned long ) * 8 - ( ( unsigned long ) ( - 1 ) < 0 ) ) ;
  26498. static constexpr int digits10
  26499. = ( ( sizeof ( unsigned long ) * 8 - ( ( unsigned long ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26500.  
  26501. static constexpr int max_digits10 = 0 ;
  26502.  
  26503. static constexpr bool is_signed = false ;
  26504. static constexpr bool is_integer = true ;
  26505. static constexpr bool is_exact = true ;
  26506. static constexpr int radix = 2 ;
  26507.  
  26508. static constexpr unsigned long
  26509. epsilon ( ) noexcept { return 0 ; }
  26510.  
  26511. static constexpr unsigned long
  26512. round_error ( ) noexcept { return 0 ; }
  26513.  
  26514. static constexpr int min_exponent = 0 ;
  26515. static constexpr int min_exponent10 = 0 ;
  26516. static constexpr int max_exponent = 0 ;
  26517. static constexpr int max_exponent10 = 0 ;
  26518.  
  26519. static constexpr bool has_infinity = false ;
  26520. static constexpr bool has_quiet_NaN = false ;
  26521. static constexpr bool has_signaling_NaN = false ;
  26522. static constexpr float_denorm_style has_denorm
  26523. = denorm_absent ;
  26524. static constexpr bool has_denorm_loss = false ;
  26525.  
  26526. static constexpr unsigned long
  26527. infinity ( ) noexcept
  26528. { return static_cast < unsigned long > ( 0 ) ; }
  26529.  
  26530. static constexpr unsigned long
  26531. quiet_NaN ( ) noexcept
  26532. { return static_cast < unsigned long > ( 0 ) ; }
  26533.  
  26534. static constexpr unsigned long
  26535. signaling_NaN ( ) noexcept
  26536. { return static_cast < unsigned long > ( 0 ) ; }
  26537.  
  26538. static constexpr unsigned long
  26539. denorm_min ( ) noexcept
  26540. { return static_cast < unsigned long > ( 0 ) ; }
  26541.  
  26542. static constexpr bool is_iec559 = false ;
  26543. static constexpr bool is_bounded = true ;
  26544. static constexpr bool is_modulo = true ;
  26545.  
  26546. static constexpr bool traps = true ;
  26547. static constexpr bool tinyness_before = false ;
  26548. static constexpr float_round_style round_style
  26549. = round_toward_zero ;
  26550. } ;
  26551.  
  26552.  
  26553. template < >
  26554. struct numeric_limits < long long >
  26555. {
  26556. static constexpr bool is_specialized = true ;
  26557.  
  26558. static constexpr long long
  26559. min ( ) noexcept { return - 9223372036854775807LL - 1 ; }
  26560.  
  26561. static constexpr long long
  26562. max ( ) noexcept { return 9223372036854775807LL ; }
  26563.  
  26564.  
  26565. static constexpr long long
  26566. lowest ( ) noexcept { return min ( ) ; }
  26567.  
  26568.  
  26569. static constexpr int digits
  26570. = ( sizeof ( long long ) * 8 - ( ( long long ) ( - 1 ) < 0 ) ) ;
  26571. static constexpr int digits10
  26572. = ( ( sizeof ( long long ) * 8 - ( ( long long ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26573.  
  26574. static constexpr int max_digits10 = 0 ;
  26575.  
  26576. static constexpr bool is_signed = true ;
  26577. static constexpr bool is_integer = true ;
  26578. static constexpr bool is_exact = true ;
  26579. static constexpr int radix = 2 ;
  26580.  
  26581. static constexpr long long
  26582. epsilon ( ) noexcept { return 0 ; }
  26583.  
  26584. static constexpr long long
  26585. round_error ( ) noexcept { return 0 ; }
  26586.  
  26587. static constexpr int min_exponent = 0 ;
  26588. static constexpr int min_exponent10 = 0 ;
  26589. static constexpr int max_exponent = 0 ;
  26590. static constexpr int max_exponent10 = 0 ;
  26591.  
  26592. static constexpr bool has_infinity = false ;
  26593. static constexpr bool has_quiet_NaN = false ;
  26594. static constexpr bool has_signaling_NaN = false ;
  26595. static constexpr float_denorm_style has_denorm
  26596. = denorm_absent ;
  26597. static constexpr bool has_denorm_loss = false ;
  26598.  
  26599. static constexpr long long
  26600. infinity ( ) noexcept { return static_cast < long long > ( 0 ) ; }
  26601.  
  26602. static constexpr long long
  26603. quiet_NaN ( ) noexcept { return static_cast < long long > ( 0 ) ; }
  26604.  
  26605. static constexpr long long
  26606. signaling_NaN ( ) noexcept
  26607. { return static_cast < long long > ( 0 ) ; }
  26608.  
  26609. static constexpr long long
  26610. denorm_min ( ) noexcept { return static_cast < long long > ( 0 ) ; }
  26611.  
  26612. static constexpr bool is_iec559 = false ;
  26613. static constexpr bool is_bounded = true ;
  26614. static constexpr bool is_modulo = false ;
  26615.  
  26616. static constexpr bool traps = true ;
  26617. static constexpr bool tinyness_before = false ;
  26618. static constexpr float_round_style round_style
  26619. = round_toward_zero ;
  26620. } ;
  26621.  
  26622.  
  26623. template < >
  26624. struct numeric_limits < unsigned long long >
  26625. {
  26626. static constexpr bool is_specialized = true ;
  26627.  
  26628. static constexpr unsigned long long
  26629. min ( ) noexcept { return 0 ; }
  26630.  
  26631. static constexpr unsigned long long
  26632. max ( ) noexcept { return 9223372036854775807LL * 2ULL + 1 ; }
  26633.  
  26634.  
  26635. static constexpr unsigned long long
  26636. lowest ( ) noexcept { return min ( ) ; }
  26637.  
  26638.  
  26639. static constexpr int digits
  26640. = ( sizeof ( unsigned long long ) * 8 - ( ( unsigned long long ) ( - 1 ) < 0 ) ) ;
  26641. static constexpr int digits10
  26642. = ( ( sizeof ( unsigned long long ) * 8 - ( ( unsigned long long ) ( - 1 ) < 0 ) ) * 643L / 2136 ) ;
  26643.  
  26644. static constexpr int max_digits10 = 0 ;
  26645.  
  26646. static constexpr bool is_signed = false ;
  26647. static constexpr bool is_integer = true ;
  26648. static constexpr bool is_exact = true ;
  26649. static constexpr int radix = 2 ;
  26650.  
  26651. static constexpr unsigned long long
  26652. epsilon ( ) noexcept { return 0 ; }
  26653.  
  26654. static constexpr unsigned long long
  26655. round_error ( ) noexcept { return 0 ; }
  26656.  
  26657. static constexpr int min_exponent = 0 ;
  26658. static constexpr int min_exponent10 = 0 ;
  26659. static constexpr int max_exponent = 0 ;
  26660. static constexpr int max_exponent10 = 0 ;
  26661.  
  26662. static constexpr bool has_infinity = false ;
  26663. static constexpr bool has_quiet_NaN = false ;
  26664. static constexpr bool has_signaling_NaN = false ;
  26665. static constexpr float_denorm_style has_denorm
  26666. = denorm_absent ;
  26667. static constexpr bool has_denorm_loss = false ;
  26668.  
  26669. static constexpr unsigned long long
  26670. infinity ( ) noexcept
  26671. { return static_cast < unsigned long long > ( 0 ) ; }
  26672.  
  26673. static constexpr unsigned long long
  26674. quiet_NaN ( ) noexcept
  26675. { return static_cast < unsigned long long > ( 0 ) ; }
  26676.  
  26677. static constexpr unsigned long long
  26678. signaling_NaN ( ) noexcept
  26679. { return static_cast < unsigned long long > ( 0 ) ; }
  26680.  
  26681. static constexpr unsigned long long
  26682. denorm_min ( ) noexcept
  26683. { return static_cast < unsigned long long > ( 0 ) ; }
  26684.  
  26685. static constexpr bool is_iec559 = false ;
  26686. static constexpr bool is_bounded = true ;
  26687. static constexpr bool is_modulo = true ;
  26688.  
  26689. static constexpr bool traps = true ;
  26690. static constexpr bool tinyness_before = false ;
  26691. static constexpr float_round_style round_style
  26692. = round_toward_zero ;
  26693. } ;
  26694. #1552
  26695. template < >
  26696. struct numeric_limits < float >
  26697. {
  26698. static constexpr bool is_specialized = true ;
  26699.  
  26700. static constexpr float
  26701. min ( ) noexcept { return 1.17549435e-38F ; }
  26702.  
  26703. static constexpr float
  26704. max ( ) noexcept { return 3.40282347e+38F ; }
  26705.  
  26706.  
  26707. static constexpr float
  26708. lowest ( ) noexcept { return - 3.40282347e+38F ; }
  26709.  
  26710.  
  26711. static constexpr int digits = 24 ;
  26712. static constexpr int digits10 = 6 ;
  26713.  
  26714. static constexpr int max_digits10
  26715. = ( 2 + ( 24 ) * 643L / 2136 ) ;
  26716.  
  26717. static constexpr bool is_signed = true ;
  26718. static constexpr bool is_integer = false ;
  26719. static constexpr bool is_exact = false ;
  26720. static constexpr int radix = 2 ;
  26721.  
  26722. static constexpr float
  26723. epsilon ( ) noexcept { return 1.19209290e-7F ; }
  26724.  
  26725. static constexpr float
  26726. round_error ( ) noexcept { return 0.5F ; }
  26727.  
  26728. static constexpr int min_exponent = ( - 125 ) ;
  26729. static constexpr int min_exponent10 = ( - 37 ) ;
  26730. static constexpr int max_exponent = 128 ;
  26731. static constexpr int max_exponent10 = 38 ;
  26732.  
  26733. static constexpr bool has_infinity = 1 ;
  26734. static constexpr bool has_quiet_NaN = 1 ;
  26735. static constexpr bool has_signaling_NaN = has_quiet_NaN ;
  26736. static constexpr float_denorm_style has_denorm
  26737. = bool ( 1 ) ? denorm_present : denorm_absent ;
  26738. static constexpr bool has_denorm_loss
  26739. = false ;
  26740.  
  26741. static constexpr float
  26742. infinity ( ) noexcept { return __builtin_huge_valf ( ) ; }
  26743.  
  26744. static constexpr float
  26745. quiet_NaN ( ) noexcept { return __builtin_nanf ( "" ) ; }
  26746.  
  26747. static constexpr float
  26748. signaling_NaN ( ) noexcept { return __builtin_nansf ( "" ) ; }
  26749.  
  26750. static constexpr float
  26751. denorm_min ( ) noexcept { return 1.40129846e-45F ; }
  26752.  
  26753. static constexpr bool is_iec559
  26754. = has_infinity && has_quiet_NaN && has_denorm == denorm_present ;
  26755. static constexpr bool is_bounded = true ;
  26756. static constexpr bool is_modulo = false ;
  26757.  
  26758. static constexpr bool traps = false ;
  26759. static constexpr bool tinyness_before
  26760. = false ;
  26761. static constexpr float_round_style round_style
  26762. = round_to_nearest ;
  26763. } ;
  26764. #1627
  26765. template < >
  26766. struct numeric_limits < double >
  26767. {
  26768. static constexpr bool is_specialized = true ;
  26769.  
  26770. static constexpr double
  26771. min ( ) noexcept { return 2.2250738585072014e-308 ; }
  26772.  
  26773. static constexpr double
  26774. max ( ) noexcept { return 1.7976931348623157e+308 ; }
  26775.  
  26776.  
  26777. static constexpr double
  26778. lowest ( ) noexcept { return - 1.7976931348623157e+308 ; }
  26779.  
  26780.  
  26781. static constexpr int digits = 53 ;
  26782. static constexpr int digits10 = 15 ;
  26783.  
  26784. static constexpr int max_digits10
  26785. = ( 2 + ( 53 ) * 643L / 2136 ) ;
  26786.  
  26787. static constexpr bool is_signed = true ;
  26788. static constexpr bool is_integer = false ;
  26789. static constexpr bool is_exact = false ;
  26790. static constexpr int radix = 2 ;
  26791.  
  26792. static constexpr double
  26793. epsilon ( ) noexcept { return 2.2204460492503131e-16 ; }
  26794.  
  26795. static constexpr double
  26796. round_error ( ) noexcept { return 0.5 ; }
  26797.  
  26798. static constexpr int min_exponent = ( - 1021 ) ;
  26799. static constexpr int min_exponent10 = ( - 307 ) ;
  26800. static constexpr int max_exponent = 1024 ;
  26801. static constexpr int max_exponent10 = 308 ;
  26802.  
  26803. static constexpr bool has_infinity = 1 ;
  26804. static constexpr bool has_quiet_NaN = 1 ;
  26805. static constexpr bool has_signaling_NaN = has_quiet_NaN ;
  26806. static constexpr float_denorm_style has_denorm
  26807. = bool ( 1 ) ? denorm_present : denorm_absent ;
  26808. static constexpr bool has_denorm_loss
  26809. = false ;
  26810.  
  26811. static constexpr double
  26812. infinity ( ) noexcept { return __builtin_huge_val ( ) ; }
  26813.  
  26814. static constexpr double
  26815. quiet_NaN ( ) noexcept { return __builtin_nan ( "" ) ; }
  26816.  
  26817. static constexpr double
  26818. signaling_NaN ( ) noexcept { return __builtin_nans ( "" ) ; }
  26819.  
  26820. static constexpr double
  26821. denorm_min ( ) noexcept { return 4.9406564584124654e-324 ; }
  26822.  
  26823. static constexpr bool is_iec559
  26824. = has_infinity && has_quiet_NaN && has_denorm == denorm_present ;
  26825. static constexpr bool is_bounded = true ;
  26826. static constexpr bool is_modulo = false ;
  26827.  
  26828. static constexpr bool traps = false ;
  26829. static constexpr bool tinyness_before
  26830. = false ;
  26831. static constexpr float_round_style round_style
  26832. = round_to_nearest ;
  26833. } ;
  26834. #1702
  26835. template < >
  26836. struct numeric_limits < long double >
  26837. {
  26838. static constexpr bool is_specialized = true ;
  26839.  
  26840. static constexpr long double
  26841. min ( ) noexcept { return 3.36210314311209350626e-4932L ; }
  26842.  
  26843. static constexpr long double
  26844. max ( ) noexcept { return 1.18973149535723176502e+4932L ; }
  26845.  
  26846.  
  26847. static constexpr long double
  26848. lowest ( ) noexcept { return - 1.18973149535723176502e+4932L ; }
  26849.  
  26850.  
  26851. static constexpr int digits = 64 ;
  26852. static constexpr int digits10 = 18 ;
  26853.  
  26854. static constexpr int max_digits10
  26855. = ( 2 + ( 64 ) * 643L / 2136 ) ;
  26856.  
  26857. static constexpr bool is_signed = true ;
  26858. static constexpr bool is_integer = false ;
  26859. static constexpr bool is_exact = false ;
  26860. static constexpr int radix = 2 ;
  26861.  
  26862. static constexpr long double
  26863. epsilon ( ) noexcept { return 1.08420217248550443401e-19L ; }
  26864.  
  26865. static constexpr long double
  26866. round_error ( ) noexcept { return 0.5L ; }
  26867.  
  26868. static constexpr int min_exponent = ( - 16381 ) ;
  26869. static constexpr int min_exponent10 = ( - 4931 ) ;
  26870. static constexpr int max_exponent = 16384 ;
  26871. static constexpr int max_exponent10 = 4932 ;
  26872.  
  26873. static constexpr bool has_infinity = 1 ;
  26874. static constexpr bool has_quiet_NaN = 1 ;
  26875. static constexpr bool has_signaling_NaN = has_quiet_NaN ;
  26876. static constexpr float_denorm_style has_denorm
  26877. = bool ( 1 ) ? denorm_present : denorm_absent ;
  26878. static constexpr bool has_denorm_loss
  26879. = false ;
  26880.  
  26881. static constexpr long double
  26882. infinity ( ) noexcept { return __builtin_huge_vall ( ) ; }
  26883.  
  26884. static constexpr long double
  26885. quiet_NaN ( ) noexcept { return __builtin_nanl ( "" ) ; }
  26886.  
  26887. static constexpr long double
  26888. signaling_NaN ( ) noexcept { return __builtin_nansl ( "" ) ; }
  26889.  
  26890. static constexpr long double
  26891. denorm_min ( ) noexcept { return 3.64519953188247460253e-4951L ; }
  26892.  
  26893. static constexpr bool is_iec559
  26894. = has_infinity && has_quiet_NaN && has_denorm == denorm_present ;
  26895. static constexpr bool is_bounded = true ;
  26896. static constexpr bool is_modulo = false ;
  26897.  
  26898. static constexpr bool traps = false ;
  26899. static constexpr bool tinyness_before =
  26900. false ;
  26901. static constexpr float_round_style round_style =
  26902. round_to_nearest ;
  26903. } ;
  26904. #1777
  26905. }
  26906. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/random.h"
  26907. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/vector"
  26908. #58
  26909. #pragma GCC system_header
  26910. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_uninitialized.h"
  26911. #59
  26912. namespace std
  26913. {
  26914.  
  26915.  
  26916. template < bool _TrivialValueTypes >
  26917. struct __uninitialized_copy
  26918. {
  26919. template < typename _InputIterator , typename _ForwardIterator >
  26920. static _ForwardIterator
  26921. __uninit_copy ( _InputIterator __first , _InputIterator __last ,
  26922. _ForwardIterator __result )
  26923. {
  26924. _ForwardIterator __cur = __result ;
  26925. try
  26926. {
  26927. for ( ; __first != __last ; ++ __first , ++ __cur )
  26928. std :: _Construct ( std :: __addressof ( * __cur ) , * __first ) ;
  26929. return __cur ;
  26930. }
  26931. catch ( ... )
  26932. {
  26933. std :: _Destroy ( __result , __cur ) ;
  26934. throw ;
  26935. }
  26936. }
  26937. } ;
  26938.  
  26939. template < >
  26940. struct __uninitialized_copy < true >
  26941. {
  26942. template < typename _InputIterator , typename _ForwardIterator >
  26943. static _ForwardIterator
  26944. __uninit_copy ( _InputIterator __first , _InputIterator __last ,
  26945. _ForwardIterator __result )
  26946. { return std :: copy ( __first , __last , __result ) ; }
  26947. } ;
  26948. #105
  26949. template < typename _InputIterator , typename _ForwardIterator >
  26950. inline _ForwardIterator
  26951. uninitialized_copy ( _InputIterator __first , _InputIterator __last ,
  26952. _ForwardIterator __result )
  26953. {
  26954. typedef typename iterator_traits < _InputIterator > :: value_type
  26955. _ValueType1 ;
  26956. typedef typename iterator_traits < _ForwardIterator > :: value_type
  26957. _ValueType2 ;
  26958.  
  26959. return std :: __uninitialized_copy < ( __oracle_is_trivial ( _ValueType1 )
  26960. && __oracle_is_trivial ( _ValueType2 ) ) > ::
  26961. __uninit_copy ( __first , __last , __result ) ;
  26962. }
  26963.  
  26964.  
  26965. template < bool _TrivialValueType >
  26966. struct __uninitialized_fill
  26967. {
  26968. template < typename _ForwardIterator , typename _Tp >
  26969. static void
  26970. __uninit_fill ( _ForwardIterator __first , _ForwardIterator __last ,
  26971. const _Tp & __x )
  26972. {
  26973. _ForwardIterator __cur = __first ;
  26974. try
  26975. {
  26976. for ( ; __cur != __last ; ++ __cur )
  26977. std :: _Construct ( std :: __addressof ( * __cur ) , __x ) ;
  26978. }
  26979. catch ( ... )
  26980. {
  26981. std :: _Destroy ( __first , __cur ) ;
  26982. throw ;
  26983. }
  26984. }
  26985. } ;
  26986.  
  26987. template < >
  26988. struct __uninitialized_fill < true >
  26989. {
  26990. template < typename _ForwardIterator , typename _Tp >
  26991. static void
  26992. __uninit_fill ( _ForwardIterator __first , _ForwardIterator __last ,
  26993. const _Tp & __x )
  26994. { std :: fill ( __first , __last , __x ) ; }
  26995. } ;
  26996. #162
  26997. template < typename _ForwardIterator , typename _Tp >
  26998. inline void
  26999. uninitialized_fill ( _ForwardIterator __first , _ForwardIterator __last ,
  27000. const _Tp & __x )
  27001. {
  27002. typedef typename iterator_traits < _ForwardIterator > :: value_type
  27003. _ValueType ;
  27004.  
  27005. std :: __uninitialized_fill < __oracle_is_trivial ( _ValueType ) > ::
  27006. __uninit_fill ( __first , __last , __x ) ;
  27007. }
  27008.  
  27009.  
  27010. template < bool _TrivialValueType >
  27011. struct __uninitialized_fill_n
  27012. {
  27013. template < typename _ForwardIterator , typename _Size , typename _Tp >
  27014. static void
  27015. __uninit_fill_n ( _ForwardIterator __first , _Size __n ,
  27016. const _Tp & __x )
  27017. {
  27018. _ForwardIterator __cur = __first ;
  27019. try
  27020. {
  27021. for ( ; __n > 0 ; -- __n , ++ __cur )
  27022. std :: _Construct ( std :: __addressof ( * __cur ) , __x ) ;
  27023. }
  27024. catch ( ... )
  27025. {
  27026. std :: _Destroy ( __first , __cur ) ;
  27027. throw ;
  27028. }
  27029. }
  27030. } ;
  27031.  
  27032. template < >
  27033. struct __uninitialized_fill_n < true >
  27034. {
  27035. template < typename _ForwardIterator , typename _Size , typename _Tp >
  27036. static void
  27037. __uninit_fill_n ( _ForwardIterator __first , _Size __n ,
  27038. const _Tp & __x )
  27039. { std :: fill_n ( __first , __n , __x ) ; }
  27040. } ;
  27041. #216
  27042. template < typename _ForwardIterator , typename _Size , typename _Tp >
  27043. inline void
  27044. uninitialized_fill_n ( _ForwardIterator __first , _Size __n , const _Tp & __x )
  27045. {
  27046. typedef typename iterator_traits < _ForwardIterator > :: value_type
  27047. _ValueType ;
  27048.  
  27049. std :: __uninitialized_fill_n < __oracle_is_trivial ( _ValueType ) > ::
  27050. __uninit_fill_n ( __first , __n , __x ) ;
  27051. }
  27052. #233
  27053. template < typename _InputIterator , typename _ForwardIterator ,
  27054. typename _Allocator >
  27055. _ForwardIterator
  27056. __uninitialized_copy_a ( _InputIterator __first , _InputIterator __last ,
  27057. _ForwardIterator __result , _Allocator & __alloc )
  27058. {
  27059. _ForwardIterator __cur = __result ;
  27060. try
  27061. {
  27062. typedef __gnu_cxx :: __alloc_traits < _Allocator > __traits ;
  27063. for ( ; __first != __last ; ++ __first , ++ __cur )
  27064. __traits :: construct ( __alloc , std :: __addressof ( * __cur ) , * __first ) ;
  27065. return __cur ;
  27066. }
  27067. catch ( ... )
  27068. {
  27069. std :: _Destroy ( __result , __cur , __alloc ) ;
  27070. throw ;
  27071. }
  27072. }
  27073.  
  27074. template < typename _InputIterator , typename _ForwardIterator , typename _Tp >
  27075. inline _ForwardIterator
  27076. __uninitialized_copy_a ( _InputIterator __first , _InputIterator __last ,
  27077. _ForwardIterator __result , allocator < _Tp > & )
  27078. { return std :: uninitialized_copy ( __first , __last , __result ) ; }
  27079.  
  27080. template < typename _InputIterator , typename _ForwardIterator ,
  27081. typename _Allocator >
  27082. inline _ForwardIterator
  27083. __uninitialized_move_a ( _InputIterator __first , _InputIterator __last ,
  27084. _ForwardIterator __result , _Allocator & __alloc )
  27085. {
  27086. return std :: __uninitialized_copy_a ( std :: make_move_iterator ( __first ) ,
  27087. std :: make_move_iterator ( __last ) ,
  27088. __result , __alloc ) ;
  27089. }
  27090.  
  27091. template < typename _InputIterator , typename _ForwardIterator ,
  27092. typename _Allocator >
  27093. inline _ForwardIterator
  27094. __uninitialized_move_if_noexcept_a ( _InputIterator __first ,
  27095. _InputIterator __last ,
  27096. _ForwardIterator __result ,
  27097. _Allocator & __alloc )
  27098. {
  27099. return std :: __uninitialized_copy_a
  27100. ( std :: __make_move_if_noexcept_iterator ( __first ) ,
  27101. std :: __make_move_if_noexcept_iterator ( __last ) , __result , __alloc ) ;
  27102. }
  27103.  
  27104. template < typename _ForwardIterator , typename _Tp , typename _Allocator >
  27105. void
  27106. __uninitialized_fill_a ( _ForwardIterator __first , _ForwardIterator __last ,
  27107. const _Tp & __x , _Allocator & __alloc )
  27108. {
  27109. _ForwardIterator __cur = __first ;
  27110. try
  27111. {
  27112. typedef __gnu_cxx :: __alloc_traits < _Allocator > __traits ;
  27113. for ( ; __cur != __last ; ++ __cur )
  27114. __traits :: construct ( __alloc , std :: __addressof ( * __cur ) , __x ) ;
  27115. }
  27116. catch ( ... )
  27117. {
  27118. std :: _Destroy ( __first , __cur , __alloc ) ;
  27119. throw ;
  27120. }
  27121. }
  27122.  
  27123. template < typename _ForwardIterator , typename _Tp , typename _Tp2 >
  27124. inline void
  27125. __uninitialized_fill_a ( _ForwardIterator __first , _ForwardIterator __last ,
  27126. const _Tp & __x , allocator < _Tp2 > & )
  27127. { std :: uninitialized_fill ( __first , __last , __x ) ; }
  27128.  
  27129. template < typename _ForwardIterator , typename _Size , typename _Tp ,
  27130. typename _Allocator >
  27131. void
  27132. __uninitialized_fill_n_a ( _ForwardIterator __first , _Size __n ,
  27133. const _Tp & __x , _Allocator & __alloc )
  27134. {
  27135. _ForwardIterator __cur = __first ;
  27136. try
  27137. {
  27138. typedef __gnu_cxx :: __alloc_traits < _Allocator > __traits ;
  27139. for ( ; __n > 0 ; -- __n , ++ __cur )
  27140. __traits :: construct ( __alloc , std :: __addressof ( * __cur ) , __x ) ;
  27141. }
  27142. catch ( ... )
  27143. {
  27144. std :: _Destroy ( __first , __cur , __alloc ) ;
  27145. throw ;
  27146. }
  27147. }
  27148.  
  27149. template < typename _ForwardIterator , typename _Size , typename _Tp ,
  27150. typename _Tp2 >
  27151. inline void
  27152. __uninitialized_fill_n_a ( _ForwardIterator __first , _Size __n ,
  27153. const _Tp & __x , allocator < _Tp2 > & )
  27154. { std :: uninitialized_fill_n ( __first , __n , __x ) ; }
  27155. #346
  27156. template < typename _InputIterator1 , typename _InputIterator2 ,
  27157. typename _ForwardIterator , typename _Allocator >
  27158. inline _ForwardIterator
  27159. __uninitialized_copy_move ( _InputIterator1 __first1 ,
  27160. _InputIterator1 __last1 ,
  27161. _InputIterator2 __first2 ,
  27162. _InputIterator2 __last2 ,
  27163. _ForwardIterator __result ,
  27164. _Allocator & __alloc )
  27165. {
  27166. _ForwardIterator __mid = std :: __uninitialized_copy_a ( __first1 , __last1 ,
  27167. __result ,
  27168. __alloc ) ;
  27169. try
  27170. {
  27171. return std :: __uninitialized_move_a ( __first2 , __last2 , __mid , __alloc ) ;
  27172. }
  27173. catch ( ... )
  27174. {
  27175. std :: _Destroy ( __result , __mid , __alloc ) ;
  27176. throw ;
  27177. }
  27178. }
  27179.  
  27180.  
  27181.  
  27182.  
  27183.  
  27184. template < typename _InputIterator1 , typename _InputIterator2 ,
  27185. typename _ForwardIterator , typename _Allocator >
  27186. inline _ForwardIterator
  27187. __uninitialized_move_copy ( _InputIterator1 __first1 ,
  27188. _InputIterator1 __last1 ,
  27189. _InputIterator2 __first2 ,
  27190. _InputIterator2 __last2 ,
  27191. _ForwardIterator __result ,
  27192. _Allocator & __alloc )
  27193. {
  27194. _ForwardIterator __mid = std :: __uninitialized_move_a ( __first1 , __last1 ,
  27195. __result ,
  27196. __alloc ) ;
  27197. try
  27198. {
  27199. return std :: __uninitialized_copy_a ( __first2 , __last2 , __mid , __alloc ) ;
  27200. }
  27201. catch ( ... )
  27202. {
  27203. std :: _Destroy ( __result , __mid , __alloc ) ;
  27204. throw ;
  27205. }
  27206. }
  27207.  
  27208.  
  27209.  
  27210.  
  27211. template < typename _ForwardIterator , typename _Tp , typename _InputIterator ,
  27212. typename _Allocator >
  27213. inline _ForwardIterator
  27214. __uninitialized_fill_move ( _ForwardIterator __result , _ForwardIterator __mid ,
  27215. const _Tp & __x , _InputIterator __first ,
  27216. _InputIterator __last , _Allocator & __alloc )
  27217. {
  27218. std :: __uninitialized_fill_a ( __result , __mid , __x , __alloc ) ;
  27219. try
  27220. {
  27221. return std :: __uninitialized_move_a ( __first , __last , __mid , __alloc ) ;
  27222. }
  27223. catch ( ... )
  27224. {
  27225. std :: _Destroy ( __result , __mid , __alloc ) ;
  27226. throw ;
  27227. }
  27228. }
  27229.  
  27230.  
  27231.  
  27232.  
  27233. template < typename _InputIterator , typename _ForwardIterator , typename _Tp ,
  27234. typename _Allocator >
  27235. inline void
  27236. __uninitialized_move_fill ( _InputIterator __first1 , _InputIterator __last1 ,
  27237. _ForwardIterator __first2 ,
  27238. _ForwardIterator __last2 , const _Tp & __x ,
  27239. _Allocator & __alloc )
  27240. {
  27241. _ForwardIterator __mid2 = std :: __uninitialized_move_a ( __first1 , __last1 ,
  27242. __first2 ,
  27243. __alloc ) ;
  27244. try
  27245. {
  27246. std :: __uninitialized_fill_a ( __mid2 , __last2 , __x , __alloc ) ;
  27247. }
  27248. catch ( ... )
  27249. {
  27250. std :: _Destroy ( __first2 , __mid2 , __alloc ) ;
  27251. throw ;
  27252. }
  27253. }
  27254.  
  27255.  
  27256.  
  27257.  
  27258.  
  27259. template < bool _TrivialValueType >
  27260. struct __uninitialized_default_1
  27261. {
  27262. template < typename _ForwardIterator >
  27263. static void
  27264. __uninit_default ( _ForwardIterator __first , _ForwardIterator __last )
  27265. {
  27266. _ForwardIterator __cur = __first ;
  27267. try
  27268. {
  27269. for ( ; __cur != __last ; ++ __cur )
  27270. std :: _Construct ( std :: __addressof ( * __cur ) ) ;
  27271. }
  27272. catch ( ... )
  27273. {
  27274. std :: _Destroy ( __first , __cur ) ;
  27275. throw ;
  27276. }
  27277. }
  27278. } ;
  27279.  
  27280. template < >
  27281. struct __uninitialized_default_1 < true >
  27282. {
  27283. template < typename _ForwardIterator >
  27284. static void
  27285. __uninit_default ( _ForwardIterator __first , _ForwardIterator __last )
  27286. {
  27287. typedef typename iterator_traits < _ForwardIterator > :: value_type
  27288. _ValueType ;
  27289.  
  27290. std :: fill ( __first , __last , _ValueType ( ) ) ;
  27291. }
  27292. } ;
  27293.  
  27294. template < bool _TrivialValueType >
  27295. struct __uninitialized_default_n_1
  27296. {
  27297. template < typename _ForwardIterator , typename _Size >
  27298. static void
  27299. __uninit_default_n ( _ForwardIterator __first , _Size __n )
  27300. {
  27301. _ForwardIterator __cur = __first ;
  27302. try
  27303. {
  27304. for ( ; __n > 0 ; -- __n , ++ __cur )
  27305. std :: _Construct ( std :: __addressof ( * __cur ) ) ;
  27306. }
  27307. catch ( ... )
  27308. {
  27309. std :: _Destroy ( __first , __cur ) ;
  27310. throw ;
  27311. }
  27312. }
  27313. } ;
  27314.  
  27315. template < >
  27316. struct __uninitialized_default_n_1 < true >
  27317. {
  27318. template < typename _ForwardIterator , typename _Size >
  27319. static void
  27320. __uninit_default_n ( _ForwardIterator __first , _Size __n )
  27321. {
  27322. typedef typename iterator_traits < _ForwardIterator > :: value_type
  27323. _ValueType ;
  27324.  
  27325. std :: fill_n ( __first , __n , _ValueType ( ) ) ;
  27326. }
  27327. } ;
  27328.  
  27329.  
  27330.  
  27331.  
  27332. template < typename _ForwardIterator >
  27333. inline void
  27334. __uninitialized_default ( _ForwardIterator __first ,
  27335. _ForwardIterator __last )
  27336. {
  27337. typedef typename iterator_traits < _ForwardIterator > :: value_type
  27338. _ValueType ;
  27339.  
  27340. std :: __uninitialized_default_1 < __oracle_is_trivial ( _ValueType ) > ::
  27341. __uninit_default ( __first , __last ) ;
  27342. }
  27343.  
  27344.  
  27345.  
  27346. template < typename _ForwardIterator , typename _Size >
  27347. inline void
  27348. __uninitialized_default_n ( _ForwardIterator __first , _Size __n )
  27349. {
  27350. typedef typename iterator_traits < _ForwardIterator > :: value_type
  27351. _ValueType ;
  27352.  
  27353. std :: __uninitialized_default_n_1 < __oracle_is_trivial ( _ValueType ) > ::
  27354. __uninit_default_n ( __first , __n ) ;
  27355. }
  27356.  
  27357.  
  27358.  
  27359.  
  27360.  
  27361. template < typename _ForwardIterator , typename _Allocator >
  27362. void
  27363. __uninitialized_default_a ( _ForwardIterator __first ,
  27364. _ForwardIterator __last ,
  27365. _Allocator & __alloc )
  27366. {
  27367. _ForwardIterator __cur = __first ;
  27368. try
  27369. {
  27370. typedef __gnu_cxx :: __alloc_traits < _Allocator > __traits ;
  27371. for ( ; __cur != __last ; ++ __cur )
  27372. __traits :: construct ( __alloc , std :: __addressof ( * __cur ) ) ;
  27373. }
  27374. catch ( ... )
  27375. {
  27376. std :: _Destroy ( __first , __cur , __alloc ) ;
  27377. throw ;
  27378. }
  27379. }
  27380.  
  27381. template < typename _ForwardIterator , typename _Tp >
  27382. inline void
  27383. __uninitialized_default_a ( _ForwardIterator __first ,
  27384. _ForwardIterator __last ,
  27385. allocator < _Tp > & )
  27386. { std :: __uninitialized_default ( __first , __last ) ; }
  27387.  
  27388.  
  27389.  
  27390.  
  27391.  
  27392. template < typename _ForwardIterator , typename _Size , typename _Allocator >
  27393. void
  27394. __uninitialized_default_n_a ( _ForwardIterator __first , _Size __n ,
  27395. _Allocator & __alloc )
  27396. {
  27397. _ForwardIterator __cur = __first ;
  27398. try
  27399. {
  27400. typedef __gnu_cxx :: __alloc_traits < _Allocator > __traits ;
  27401. for ( ; __n > 0 ; -- __n , ++ __cur )
  27402. __traits :: construct ( __alloc , std :: __addressof ( * __cur ) ) ;
  27403. }
  27404. catch ( ... )
  27405. {
  27406. std :: _Destroy ( __first , __cur , __alloc ) ;
  27407. throw ;
  27408. }
  27409. }
  27410.  
  27411. template < typename _ForwardIterator , typename _Size , typename _Tp >
  27412. inline void
  27413. __uninitialized_default_n_a ( _ForwardIterator __first , _Size __n ,
  27414. allocator < _Tp > & )
  27415. { std :: __uninitialized_default_n ( __first , __n ) ; }
  27416.  
  27417.  
  27418. template < typename _InputIterator , typename _Size ,
  27419. typename _ForwardIterator >
  27420. _ForwardIterator
  27421. __uninitialized_copy_n ( _InputIterator __first , _Size __n ,
  27422. _ForwardIterator __result , input_iterator_tag )
  27423. {
  27424. _ForwardIterator __cur = __result ;
  27425. try
  27426. {
  27427. for ( ; __n > 0 ; -- __n , ++ __first , ++ __cur )
  27428. std :: _Construct ( std :: __addressof ( * __cur ) , * __first ) ;
  27429. return __cur ;
  27430. }
  27431. catch ( ... )
  27432. {
  27433. std :: _Destroy ( __result , __cur ) ;
  27434. throw ;
  27435. }
  27436. }
  27437.  
  27438. template < typename _RandomAccessIterator , typename _Size ,
  27439. typename _ForwardIterator >
  27440. inline _ForwardIterator
  27441. __uninitialized_copy_n ( _RandomAccessIterator __first , _Size __n ,
  27442. _ForwardIterator __result ,
  27443. random_access_iterator_tag )
  27444. { return std :: uninitialized_copy ( __first , __first + __n , __result ) ; }
  27445. #645
  27446. template < typename _InputIterator , typename _Size , typename _ForwardIterator >
  27447. inline _ForwardIterator
  27448. uninitialized_copy_n ( _InputIterator __first , _Size __n ,
  27449. _ForwardIterator __result )
  27450. { return std :: __uninitialized_copy_n ( __first , __n , __result ,
  27451. std :: __iterator_category ( __first ) ) ; }
  27452.  
  27453.  
  27454.  
  27455. }
  27456. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_vector.h"
  27457. #66
  27458. namespace std
  27459. {
  27460.  
  27461.  
  27462.  
  27463. template < typename _Tp , typename _Alloc >
  27464. struct _Vector_base
  27465. {
  27466. typedef typename __gnu_cxx :: __alloc_traits < _Alloc > :: template
  27467. rebind < _Tp > :: other _Tp_alloc_type ;
  27468. typedef typename __gnu_cxx :: __alloc_traits < _Tp_alloc_type > :: pointer
  27469. pointer ;
  27470.  
  27471. struct _Vector_impl
  27472. : public _Tp_alloc_type
  27473. {
  27474. pointer _M_start ;
  27475. pointer _M_finish ;
  27476. pointer _M_end_of_storage ;
  27477.  
  27478. _Vector_impl ( )
  27479. : _Tp_alloc_type ( ) , _M_start ( 0 ) , _M_finish ( 0 ) , _M_end_of_storage ( 0 )
  27480. { }
  27481.  
  27482. _Vector_impl ( _Tp_alloc_type const & __a )
  27483. : _Tp_alloc_type ( __a ) , _M_start ( 0 ) , _M_finish ( 0 ) , _M_end_of_storage ( 0 )
  27484. { }
  27485.  
  27486.  
  27487. _Vector_impl ( _Tp_alloc_type && __a )
  27488. : _Tp_alloc_type ( std :: move ( __a ) ) ,
  27489. _M_start ( 0 ) , _M_finish ( 0 ) , _M_end_of_storage ( 0 )
  27490. { }
  27491.  
  27492.  
  27493. void _M_swap_data ( _Vector_impl & __x )
  27494. {
  27495. std :: swap ( _M_start , __x . _M_start ) ;
  27496. std :: swap ( _M_finish , __x . _M_finish ) ;
  27497. std :: swap ( _M_end_of_storage , __x . _M_end_of_storage ) ;
  27498. }
  27499. } ;
  27500.  
  27501. public :
  27502. typedef _Alloc allocator_type ;
  27503.  
  27504. _Tp_alloc_type &
  27505. _M_get_Tp_allocator ( ) noexcept
  27506. { return * static_cast < _Tp_alloc_type * > ( & this -> _M_impl ) ; }
  27507.  
  27508. const _Tp_alloc_type &
  27509. _M_get_Tp_allocator ( ) const noexcept
  27510. { return * static_cast < const _Tp_alloc_type * > ( & this -> _M_impl ) ; }
  27511.  
  27512. allocator_type
  27513. get_allocator ( ) const noexcept
  27514. { return allocator_type ( _M_get_Tp_allocator ( ) ) ; }
  27515.  
  27516. _Vector_base ( )
  27517. : _M_impl ( ) { }
  27518.  
  27519. _Vector_base ( const allocator_type & __a )
  27520. : _M_impl ( __a ) { }
  27521.  
  27522. _Vector_base ( size_t __n )
  27523. : _M_impl ( )
  27524. { _M_create_storage ( __n ) ; }
  27525.  
  27526. _Vector_base ( size_t __n , const allocator_type & __a )
  27527. : _M_impl ( __a )
  27528. { _M_create_storage ( __n ) ; }
  27529.  
  27530.  
  27531. _Vector_base ( _Tp_alloc_type && __a )
  27532. : _M_impl ( std :: move ( __a ) ) { }
  27533.  
  27534. _Vector_base ( _Vector_base && __x )
  27535. : _M_impl ( std :: move ( __x . _M_get_Tp_allocator ( ) ) )
  27536. { this -> _M_impl . _M_swap_data ( __x . _M_impl ) ; }
  27537.  
  27538. _Vector_base ( _Vector_base && __x , const allocator_type & __a )
  27539. : _M_impl ( __a )
  27540. {
  27541. if ( __x . get_allocator ( ) == __a )
  27542. this -> _M_impl . _M_swap_data ( __x . _M_impl ) ;
  27543. else
  27544. {
  27545. size_t __n = __x . _M_impl . _M_finish - __x . _M_impl . _M_start ;
  27546. _M_create_storage ( __n ) ;
  27547. }
  27548. }
  27549.  
  27550.  
  27551. ~ _Vector_base ( )
  27552. { _M_deallocate ( this -> _M_impl . _M_start , this -> _M_impl . _M_end_of_storage
  27553. - this -> _M_impl . _M_start ) ; }
  27554.  
  27555. public :
  27556. _Vector_impl _M_impl ;
  27557.  
  27558. pointer
  27559. _M_allocate ( size_t __n )
  27560. { return __n != 0 ? _M_impl . allocate ( __n ) : 0 ; }
  27561.  
  27562. void
  27563. _M_deallocate ( pointer __p , size_t __n )
  27564. {
  27565. if ( __p )
  27566. _M_impl . deallocate ( __p , __n ) ;
  27567. }
  27568.  
  27569. private :
  27570. void
  27571. _M_create_storage ( size_t __n )
  27572. {
  27573. this -> _M_impl . _M_start = this -> _M_allocate ( __n ) ;
  27574. this -> _M_impl . _M_finish = this -> _M_impl . _M_start ;
  27575. this -> _M_impl . _M_end_of_storage = this -> _M_impl . _M_start + __n ;
  27576. }
  27577. } ;
  27578. #209
  27579. template < typename _Tp , typename _Alloc = std :: allocator < _Tp > >
  27580. class vector : protected _Vector_base < _Tp , _Alloc >
  27581. {
  27582.  
  27583. typedef typename _Alloc :: value_type _Alloc_value_type ;
  27584.  
  27585.  
  27586.  
  27587. typedef _Vector_base < _Tp , _Alloc > _Base ;
  27588. typedef typename _Base :: _Tp_alloc_type _Tp_alloc_type ;
  27589. typedef __gnu_cxx :: __alloc_traits < _Tp_alloc_type > _Alloc_traits ;
  27590.  
  27591. public :
  27592. typedef _Tp value_type ;
  27593. typedef typename _Base :: pointer pointer ;
  27594. typedef typename _Alloc_traits :: const_pointer const_pointer ;
  27595. typedef typename _Alloc_traits :: reference reference ;
  27596. typedef typename _Alloc_traits :: const_reference const_reference ;
  27597. typedef __gnu_cxx :: __normal_iterator < pointer , vector > iterator ;
  27598. typedef __gnu_cxx :: __normal_iterator < const_pointer , vector >
  27599. const_iterator ;
  27600. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  27601. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  27602. typedef size_t size_type ;
  27603. typedef ptrdiff_t difference_type ;
  27604. typedef _Alloc allocator_type ;
  27605.  
  27606. protected :
  27607. using _Base :: _M_allocate ;
  27608. using _Base :: _M_deallocate ;
  27609. using _Base :: _M_impl ;
  27610. using _Base :: _M_get_Tp_allocator ;
  27611.  
  27612. public :
  27613.  
  27614.  
  27615.  
  27616.  
  27617.  
  27618. vector ( )
  27619. : _Base ( ) { }
  27620.  
  27621.  
  27622.  
  27623.  
  27624.  
  27625. explicit
  27626. vector ( const allocator_type & __a )
  27627. : _Base ( __a ) { }
  27628. #268
  27629. explicit
  27630. vector ( size_type __n , const allocator_type & __a = allocator_type ( ) )
  27631. : _Base ( __n , __a )
  27632. { _M_default_initialize ( __n ) ; }
  27633. #281
  27634. vector ( size_type __n , const value_type & __value ,
  27635. const allocator_type & __a = allocator_type ( ) )
  27636. : _Base ( __n , __a )
  27637. { _M_fill_initialize ( __n , __value ) ; }
  27638. #310
  27639. vector ( const vector & __x )
  27640. : _Base ( __x . size ( ) ,
  27641. _Alloc_traits :: _S_select_on_copy ( __x . _M_get_Tp_allocator ( ) ) )
  27642. { this -> _M_impl . _M_finish =
  27643. std :: __uninitialized_copy_a ( __x . begin ( ) , __x . end ( ) ,
  27644. this -> _M_impl . _M_start ,
  27645. _M_get_Tp_allocator ( ) ) ;
  27646. }
  27647. #327
  27648. vector ( vector && __x ) noexcept
  27649. : _Base ( std :: move ( __x ) ) { }
  27650.  
  27651.  
  27652. vector ( const vector & __x , const allocator_type & __a )
  27653. : _Base ( __x . size ( ) , __a )
  27654. { this -> _M_impl . _M_finish =
  27655. std :: __uninitialized_copy_a ( __x . begin ( ) , __x . end ( ) ,
  27656. this -> _M_impl . _M_start ,
  27657. _M_get_Tp_allocator ( ) ) ;
  27658. }
  27659.  
  27660.  
  27661. vector ( vector && __rv , const allocator_type & __m )
  27662. : _Base ( std :: move ( __rv ) , __m )
  27663. {
  27664. if ( __rv . get_allocator ( ) != __m )
  27665. {
  27666. this -> _M_impl . _M_finish =
  27667. std :: __uninitialized_move_a ( __rv . begin ( ) , __rv . end ( ) ,
  27668. this -> _M_impl . _M_start ,
  27669. _M_get_Tp_allocator ( ) ) ;
  27670. __rv . clear ( ) ;
  27671. }
  27672. }
  27673. #364
  27674. vector ( initializer_list < value_type > __l ,
  27675. const allocator_type & __a = allocator_type ( ) )
  27676. : _Base ( __a )
  27677. {
  27678. _M_range_initialize ( __l . begin ( ) , __l . end ( ) ,
  27679. random_access_iterator_tag ( ) ) ;
  27680. }
  27681. #390
  27682. template < typename _InputIterator ,
  27683. typename = std :: _RequireInputIter < _InputIterator >>
  27684. vector ( _InputIterator __first , _InputIterator __last ,
  27685. const allocator_type & __a = allocator_type ( ) )
  27686. : _Base ( __a )
  27687. { _M_initialize_dispatch ( __first , __last , __false_type ( ) ) ; }
  27688. #414
  27689. ~ vector ( ) noexcept
  27690. { std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  27691. _M_get_Tp_allocator ( ) ) ; }
  27692. #426
  27693. vector &
  27694. operator = ( const vector & __x ) ;
  27695. #438
  27696. vector &
  27697. operator = ( vector && __x ) noexcept ( _Alloc_traits :: _S_nothrow_move ( ) )
  27698. {
  27699. constexpr bool __move_storage =
  27700. _Alloc_traits :: _S_propagate_on_move_assign ( )
  27701. || _Alloc_traits :: _S_always_equal ( ) ;
  27702. _M_move_assign ( std :: move ( __x ) ,
  27703. integral_constant < bool , __move_storage > ( ) ) ;
  27704. return * this ;
  27705. }
  27706. #460
  27707. vector &
  27708. operator = ( initializer_list < value_type > __l )
  27709. {
  27710. this -> assign ( __l . begin ( ) , __l . end ( ) ) ;
  27711. return * this ;
  27712. }
  27713. #478
  27714. void
  27715. assign ( size_type __n , const value_type & __val )
  27716. { _M_fill_assign ( __n , __val ) ; }
  27717. #495
  27718. template < typename _InputIterator ,
  27719. typename = std :: _RequireInputIter < _InputIterator >>
  27720. void
  27721. assign ( _InputIterator __first , _InputIterator __last )
  27722. { _M_assign_dispatch ( __first , __last , __false_type ( ) ) ; }
  27723. #523
  27724. void
  27725. assign ( initializer_list < value_type > __l )
  27726. { this -> assign ( __l . begin ( ) , __l . end ( ) ) ; }
  27727.  
  27728.  
  27729.  
  27730. using _Base :: get_allocator ;
  27731. #537
  27732. iterator
  27733. begin ( ) noexcept
  27734. { return iterator ( this -> _M_impl . _M_start ) ; }
  27735. #546
  27736. const_iterator
  27737. begin ( ) const noexcept
  27738. { return const_iterator ( this -> _M_impl . _M_start ) ; }
  27739. #555
  27740. iterator
  27741. end ( ) noexcept
  27742. { return iterator ( this -> _M_impl . _M_finish ) ; }
  27743. #564
  27744. const_iterator
  27745. end ( ) const noexcept
  27746. { return const_iterator ( this -> _M_impl . _M_finish ) ; }
  27747. #573
  27748. reverse_iterator
  27749. rbegin ( ) noexcept
  27750. { return reverse_iterator ( end ( ) ) ; }
  27751. #582
  27752. const_reverse_iterator
  27753. rbegin ( ) const noexcept
  27754. { return const_reverse_iterator ( end ( ) ) ; }
  27755. #591
  27756. reverse_iterator
  27757. rend ( ) noexcept
  27758. { return reverse_iterator ( begin ( ) ) ; }
  27759. #600
  27760. const_reverse_iterator
  27761. rend ( ) const noexcept
  27762. { return const_reverse_iterator ( begin ( ) ) ; }
  27763. #610
  27764. const_iterator
  27765. cbegin ( ) const noexcept
  27766. { return const_iterator ( this -> _M_impl . _M_start ) ; }
  27767. #619
  27768. const_iterator
  27769. cend ( ) const noexcept
  27770. { return const_iterator ( this -> _M_impl . _M_finish ) ; }
  27771. #628
  27772. const_reverse_iterator
  27773. crbegin ( ) const noexcept
  27774. { return const_reverse_iterator ( end ( ) ) ; }
  27775. #637
  27776. const_reverse_iterator
  27777. crend ( ) const noexcept
  27778. { return const_reverse_iterator ( begin ( ) ) ; }
  27779.  
  27780.  
  27781.  
  27782.  
  27783. size_type
  27784. size ( ) const noexcept
  27785. { return size_type ( this -> _M_impl . _M_finish - this -> _M_impl . _M_start ) ; }
  27786.  
  27787.  
  27788. size_type
  27789. max_size ( ) const noexcept
  27790. { return _Alloc_traits :: max_size ( _M_get_Tp_allocator ( ) ) ; }
  27791. #663
  27792. void
  27793. resize ( size_type __new_size )
  27794. {
  27795. if ( __new_size > size ( ) )
  27796. _M_default_append ( __new_size - size ( ) ) ;
  27797. else if ( __new_size < size ( ) )
  27798. _M_erase_at_end ( this -> _M_impl . _M_start + __new_size ) ;
  27799. }
  27800. #683
  27801. void
  27802. resize ( size_type __new_size , const value_type & __x )
  27803. {
  27804. if ( __new_size > size ( ) )
  27805. insert ( end ( ) , __new_size - size ( ) , __x ) ;
  27806. else if ( __new_size < size ( ) )
  27807. _M_erase_at_end ( this -> _M_impl . _M_start + __new_size ) ;
  27808. }
  27809. #715
  27810. void
  27811. shrink_to_fit ( )
  27812. { _M_shrink_to_fit ( ) ; }
  27813. #724
  27814. size_type
  27815. capacity ( ) const noexcept
  27816. { return size_type ( this -> _M_impl . _M_end_of_storage
  27817. - this -> _M_impl . _M_start ) ; }
  27818.  
  27819.  
  27820.  
  27821.  
  27822.  
  27823. bool
  27824. empty ( ) const noexcept
  27825. { return begin ( ) == end ( ) ; }
  27826. #754
  27827. void
  27828. reserve ( size_type __n ) ;
  27829. #769
  27830. reference
  27831. operator [ ] ( size_type __n )
  27832. { return * ( this -> _M_impl . _M_start + __n ) ; }
  27833. #784
  27834. const_reference
  27835. operator [ ] ( size_type __n ) const
  27836. { return * ( this -> _M_impl . _M_start + __n ) ; }
  27837.  
  27838. protected :
  27839.  
  27840. void
  27841. _M_range_check ( size_type __n ) const
  27842. {
  27843. if ( __n >= this -> size ( ) )
  27844. __throw_out_of_range ( ( "vector::_M_range_check" ) ) ;
  27845. }
  27846.  
  27847. public :
  27848. #809
  27849. reference
  27850. at ( size_type __n )
  27851. {
  27852. _M_range_check ( __n ) ;
  27853. return ( * this ) [ __n ] ;
  27854. }
  27855. #827
  27856. const_reference
  27857. at ( size_type __n ) const
  27858. {
  27859. _M_range_check ( __n ) ;
  27860. return ( * this ) [ __n ] ;
  27861. }
  27862.  
  27863.  
  27864.  
  27865.  
  27866.  
  27867. reference
  27868. front ( )
  27869. { return * begin ( ) ; }
  27870.  
  27871.  
  27872.  
  27873.  
  27874.  
  27875. const_reference
  27876. front ( ) const
  27877. { return * begin ( ) ; }
  27878.  
  27879.  
  27880.  
  27881.  
  27882.  
  27883. reference
  27884. back ( )
  27885. { return * ( end ( ) - 1 ) ; }
  27886.  
  27887.  
  27888.  
  27889.  
  27890.  
  27891. const_reference
  27892. back ( ) const
  27893. { return * ( end ( ) - 1 ) ; }
  27894. #874
  27895. _Tp *
  27896.  
  27897.  
  27898.  
  27899. data ( ) noexcept
  27900. { return std :: __addressof ( front ( ) ) ; }
  27901.  
  27902.  
  27903. const _Tp *
  27904.  
  27905.  
  27906.  
  27907. data ( ) const noexcept
  27908. { return std :: __addressof ( front ( ) ) ; }
  27909. #900
  27910. void
  27911. push_back ( const value_type & __x )
  27912. {
  27913. if ( this -> _M_impl . _M_finish != this -> _M_impl . _M_end_of_storage )
  27914. {
  27915. _Alloc_traits :: construct ( this -> _M_impl , this -> _M_impl . _M_finish ,
  27916. __x ) ;
  27917. ++ this -> _M_impl . _M_finish ;
  27918. }
  27919. else
  27920.  
  27921. _M_emplace_back_aux ( __x ) ;
  27922.  
  27923.  
  27924.  
  27925. }
  27926.  
  27927.  
  27928. void
  27929. push_back ( value_type && __x )
  27930. { emplace_back ( std :: move ( __x ) ) ; }
  27931.  
  27932. template < typename ... _Args >
  27933. void
  27934. emplace_back ( _Args && ... __args ) ;
  27935. #936
  27936. void
  27937. pop_back ( )
  27938. {
  27939. -- this -> _M_impl . _M_finish ;
  27940. _Alloc_traits :: destroy ( this -> _M_impl , this -> _M_impl . _M_finish ) ;
  27941. }
  27942. #956
  27943. template < typename ... _Args >
  27944. iterator
  27945. emplace ( iterator __position , _Args && ... __args ) ;
  27946. #972
  27947. iterator
  27948. insert ( iterator __position , const value_type & __x ) ;
  27949. #987
  27950. iterator
  27951. insert ( iterator __position , value_type && __x )
  27952. { return emplace ( __position , std :: move ( __x ) ) ; }
  27953. #1004
  27954. void
  27955. insert ( iterator __position , initializer_list < value_type > __l )
  27956. { this -> insert ( __position , __l . begin ( ) , __l . end ( ) ) ; }
  27957. #1022
  27958. void
  27959. insert ( iterator __position , size_type __n , const value_type & __x )
  27960. { _M_fill_insert ( __position , __n , __x ) ; }
  27961. #1041
  27962. template < typename _InputIterator ,
  27963. typename = std :: _RequireInputIter < _InputIterator >>
  27964. void
  27965. insert ( iterator __position , _InputIterator __first ,
  27966. _InputIterator __last )
  27967. { _M_insert_dispatch ( __position , __first , __last , __false_type ( ) ) ; }
  27968. #1074
  27969. iterator
  27970. erase ( iterator __position ) ;
  27971. #1095
  27972. iterator
  27973. erase ( iterator __first , iterator __last ) ;
  27974. #1107
  27975. void
  27976. swap ( vector & __x )
  27977.  
  27978. noexcept ( _Alloc_traits :: _S_nothrow_swap ( ) )
  27979.  
  27980. {
  27981. this -> _M_impl . _M_swap_data ( __x . _M_impl ) ;
  27982. _Alloc_traits :: _S_on_swap ( _M_get_Tp_allocator ( ) ,
  27983. __x . _M_get_Tp_allocator ( ) ) ;
  27984. }
  27985. #1124
  27986. void
  27987. clear ( ) noexcept
  27988. { _M_erase_at_end ( this -> _M_impl . _M_start ) ; }
  27989.  
  27990. protected :
  27991.  
  27992.  
  27993.  
  27994.  
  27995. template < typename _ForwardIterator >
  27996. pointer
  27997. _M_allocate_and_copy ( size_type __n ,
  27998. _ForwardIterator __first , _ForwardIterator __last )
  27999. {
  28000. pointer __result = this -> _M_allocate ( __n ) ;
  28001. try
  28002. {
  28003. std :: __uninitialized_copy_a ( __first , __last , __result ,
  28004. _M_get_Tp_allocator ( ) ) ;
  28005. return __result ;
  28006. }
  28007. catch ( ... )
  28008. {
  28009. _M_deallocate ( __result , __n ) ;
  28010. throw ;
  28011. }
  28012. }
  28013. #1159
  28014. template < typename _Integer >
  28015. void
  28016. _M_initialize_dispatch ( _Integer __n , _Integer __value , __true_type )
  28017. {
  28018. this -> _M_impl . _M_start = _M_allocate ( static_cast < size_type > ( __n ) ) ;
  28019. this -> _M_impl . _M_end_of_storage =
  28020. this -> _M_impl . _M_start + static_cast < size_type > ( __n ) ;
  28021. _M_fill_initialize ( static_cast < size_type > ( __n ) , __value ) ;
  28022. }
  28023.  
  28024.  
  28025. template < typename _InputIterator >
  28026. void
  28027. _M_initialize_dispatch ( _InputIterator __first , _InputIterator __last ,
  28028. __false_type )
  28029. {
  28030. typedef typename std :: iterator_traits < _InputIterator > ::
  28031. iterator_category _IterCategory ;
  28032. _M_range_initialize ( __first , __last , _IterCategory ( ) ) ;
  28033. }
  28034.  
  28035.  
  28036. template < typename _InputIterator >
  28037. void
  28038. _M_range_initialize ( _InputIterator __first ,
  28039. _InputIterator __last , std :: input_iterator_tag )
  28040. {
  28041. for ( ; __first != __last ; ++ __first )
  28042.  
  28043. emplace_back ( * __first ) ;
  28044.  
  28045.  
  28046.  
  28047. }
  28048.  
  28049.  
  28050. template < typename _ForwardIterator >
  28051. void
  28052. _M_range_initialize ( _ForwardIterator __first ,
  28053. _ForwardIterator __last , std :: forward_iterator_tag )
  28054. {
  28055. const size_type __n = std :: distance ( __first , __last ) ;
  28056. this -> _M_impl . _M_start = this -> _M_allocate ( __n ) ;
  28057. this -> _M_impl . _M_end_of_storage = this -> _M_impl . _M_start + __n ;
  28058. this -> _M_impl . _M_finish =
  28059. std :: __uninitialized_copy_a ( __first , __last ,
  28060. this -> _M_impl . _M_start ,
  28061. _M_get_Tp_allocator ( ) ) ;
  28062. }
  28063.  
  28064.  
  28065.  
  28066. void
  28067. _M_fill_initialize ( size_type __n , const value_type & __value )
  28068. {
  28069. std :: __uninitialized_fill_n_a ( this -> _M_impl . _M_start , __n , __value ,
  28070. _M_get_Tp_allocator ( ) ) ;
  28071. this -> _M_impl . _M_finish = this -> _M_impl . _M_end_of_storage ;
  28072. }
  28073.  
  28074.  
  28075.  
  28076. void
  28077. _M_default_initialize ( size_type __n )
  28078. {
  28079. std :: __uninitialized_default_n_a ( this -> _M_impl . _M_start , __n ,
  28080. _M_get_Tp_allocator ( ) ) ;
  28081. this -> _M_impl . _M_finish = this -> _M_impl . _M_end_of_storage ;
  28082. }
  28083. #1237
  28084. template < typename _Integer >
  28085. void
  28086. _M_assign_dispatch ( _Integer __n , _Integer __val , __true_type )
  28087. { _M_fill_assign ( __n , __val ) ; }
  28088.  
  28089.  
  28090. template < typename _InputIterator >
  28091. void
  28092. _M_assign_dispatch ( _InputIterator __first , _InputIterator __last ,
  28093. __false_type )
  28094. {
  28095. typedef typename std :: iterator_traits < _InputIterator > ::
  28096. iterator_category _IterCategory ;
  28097. _M_assign_aux ( __first , __last , _IterCategory ( ) ) ;
  28098. }
  28099.  
  28100.  
  28101. template < typename _InputIterator >
  28102. void
  28103. _M_assign_aux ( _InputIterator __first , _InputIterator __last ,
  28104. std :: input_iterator_tag ) ;
  28105.  
  28106.  
  28107. template < typename _ForwardIterator >
  28108. void
  28109. _M_assign_aux ( _ForwardIterator __first , _ForwardIterator __last ,
  28110. std :: forward_iterator_tag ) ;
  28111.  
  28112.  
  28113.  
  28114. void
  28115. _M_fill_assign ( size_type __n , const value_type & __val ) ;
  28116. #1277
  28117. template < typename _Integer >
  28118. void
  28119. _M_insert_dispatch ( iterator __pos , _Integer __n , _Integer __val ,
  28120. __true_type )
  28121. { _M_fill_insert ( __pos , __n , __val ) ; }
  28122.  
  28123.  
  28124. template < typename _InputIterator >
  28125. void
  28126. _M_insert_dispatch ( iterator __pos , _InputIterator __first ,
  28127. _InputIterator __last , __false_type )
  28128. {
  28129. typedef typename std :: iterator_traits < _InputIterator > ::
  28130. iterator_category _IterCategory ;
  28131. _M_range_insert ( __pos , __first , __last , _IterCategory ( ) ) ;
  28132. }
  28133.  
  28134.  
  28135. template < typename _InputIterator >
  28136. void
  28137. _M_range_insert ( iterator __pos , _InputIterator __first ,
  28138. _InputIterator __last , std :: input_iterator_tag ) ;
  28139.  
  28140.  
  28141. template < typename _ForwardIterator >
  28142. void
  28143. _M_range_insert ( iterator __pos , _ForwardIterator __first ,
  28144. _ForwardIterator __last , std :: forward_iterator_tag ) ;
  28145.  
  28146.  
  28147.  
  28148. void
  28149. _M_fill_insert ( iterator __pos , size_type __n , const value_type & __x ) ;
  28150.  
  28151.  
  28152.  
  28153. void
  28154. _M_default_append ( size_type __n ) ;
  28155.  
  28156. bool
  28157. _M_shrink_to_fit ( ) ;
  28158. #1325
  28159. template < typename ... _Args >
  28160. void
  28161. _M_insert_aux ( iterator __position , _Args && ... __args ) ;
  28162.  
  28163. template < typename ... _Args >
  28164. void
  28165. _M_emplace_back_aux ( _Args && ... __args ) ;
  28166.  
  28167.  
  28168.  
  28169. size_type
  28170. _M_check_len ( size_type __n , const char * __s ) const
  28171. {
  28172. if ( max_size ( ) - size ( ) < __n )
  28173. __throw_length_error ( ( __s ) ) ;
  28174.  
  28175. const size_type __len = size ( ) + std :: max ( size ( ) , __n ) ;
  28176. return ( __len < size ( ) || __len > max_size ( ) ) ? max_size ( ) : __len ;
  28177. }
  28178.  
  28179.  
  28180.  
  28181.  
  28182.  
  28183. void
  28184. _M_erase_at_end ( pointer __pos )
  28185. {
  28186. std :: _Destroy ( __pos , this -> _M_impl . _M_finish , _M_get_Tp_allocator ( ) ) ;
  28187. this -> _M_impl . _M_finish = __pos ;
  28188. }
  28189.  
  28190.  
  28191. private :
  28192.  
  28193.  
  28194.  
  28195. void
  28196. _M_move_assign ( vector && __x , std :: true_type ) noexcept
  28197. {
  28198. const vector __tmp ( std :: move ( * this ) ) ;
  28199. this -> _M_impl . _M_swap_data ( __x . _M_impl ) ;
  28200. if ( _Alloc_traits :: _S_propagate_on_move_assign ( ) )
  28201. std :: __alloc_on_move ( _M_get_Tp_allocator ( ) ,
  28202. __x . _M_get_Tp_allocator ( ) ) ;
  28203. }
  28204.  
  28205.  
  28206.  
  28207. void
  28208. _M_move_assign ( vector && __x , std :: false_type )
  28209. {
  28210. if ( __x . _M_get_Tp_allocator ( ) == this -> _M_get_Tp_allocator ( ) )
  28211. _M_move_assign ( std :: move ( __x ) , std :: true_type ( ) ) ;
  28212. else
  28213. {
  28214.  
  28215.  
  28216. this -> assign ( std :: __make_move_if_noexcept_iterator ( __x . begin ( ) ) ,
  28217. std :: __make_move_if_noexcept_iterator ( __x . end ( ) ) ) ;
  28218. __x . clear ( ) ;
  28219. }
  28220. }
  28221.  
  28222. } ;
  28223. #1401
  28224. template < typename _Tp , typename _Alloc >
  28225. inline bool
  28226. operator == ( const vector < _Tp , _Alloc > & __x , const vector < _Tp , _Alloc > & __y )
  28227. { return ( __x . size ( ) == __y . size ( )
  28228. && std :: equal ( __x . begin ( ) , __x . end ( ) , __y . begin ( ) ) ) ; }
  28229. #1418
  28230. template < typename _Tp , typename _Alloc >
  28231. inline bool
  28232. operator < ( const vector < _Tp , _Alloc > & __x , const vector < _Tp , _Alloc > & __y )
  28233. { return std :: lexicographical_compare ( __x . begin ( ) , __x . end ( ) ,
  28234. __y . begin ( ) , __y . end ( ) ) ; }
  28235.  
  28236.  
  28237. template < typename _Tp , typename _Alloc >
  28238. inline bool
  28239. operator != ( const vector < _Tp , _Alloc > & __x , const vector < _Tp , _Alloc > & __y )
  28240. { return ! ( __x == __y ) ; }
  28241.  
  28242.  
  28243. template < typename _Tp , typename _Alloc >
  28244. inline bool
  28245. operator > ( const vector < _Tp , _Alloc > & __x , const vector < _Tp , _Alloc > & __y )
  28246. { return __y < __x ; }
  28247.  
  28248.  
  28249. template < typename _Tp , typename _Alloc >
  28250. inline bool
  28251. operator <= ( const vector < _Tp , _Alloc > & __x , const vector < _Tp , _Alloc > & __y )
  28252. { return ! ( __y < __x ) ; }
  28253.  
  28254.  
  28255. template < typename _Tp , typename _Alloc >
  28256. inline bool
  28257. operator >= ( const vector < _Tp , _Alloc > & __x , const vector < _Tp , _Alloc > & __y )
  28258. { return ! ( __x < __y ) ; }
  28259.  
  28260.  
  28261. template < typename _Tp , typename _Alloc >
  28262. inline void
  28263. swap ( vector < _Tp , _Alloc > & __x , vector < _Tp , _Alloc > & __y )
  28264. { __x . swap ( __y ) ; }
  28265.  
  28266.  
  28267. }
  28268. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_bvector.h"
  28269. #63
  28270. namespace std
  28271. {
  28272.  
  28273.  
  28274. typedef unsigned long _Bit_type ;
  28275. enum { _S_word_bit = int ( 8 * sizeof ( _Bit_type ) ) } ;
  28276.  
  28277. struct _Bit_reference
  28278. {
  28279. _Bit_type * _M_p ;
  28280. _Bit_type _M_mask ;
  28281.  
  28282. _Bit_reference ( _Bit_type * __x , _Bit_type __y )
  28283. : _M_p ( __x ) , _M_mask ( __y ) { }
  28284.  
  28285. _Bit_reference ( ) noexcept : _M_p ( 0 ) , _M_mask ( 0 ) { }
  28286.  
  28287. operator bool ( ) const noexcept
  28288. { return ! ! ( * _M_p & _M_mask ) ; }
  28289.  
  28290. _Bit_reference &
  28291. operator = ( bool __x ) noexcept
  28292. {
  28293. if ( __x )
  28294. * _M_p |= _M_mask ;
  28295. else
  28296. * _M_p &= ~ _M_mask ;
  28297. return * this ;
  28298. }
  28299.  
  28300. _Bit_reference &
  28301. operator = ( const _Bit_reference & __x ) noexcept
  28302. { return * this = bool ( __x ) ; }
  28303.  
  28304. bool
  28305. operator == ( const _Bit_reference & __x ) const
  28306. { return bool ( * this ) == bool ( __x ) ; }
  28307.  
  28308. bool
  28309. operator < ( const _Bit_reference & __x ) const
  28310. { return ! bool ( * this ) && bool ( __x ) ; }
  28311.  
  28312. void
  28313. flip ( ) noexcept
  28314. { * _M_p ^= _M_mask ; }
  28315. } ;
  28316.  
  28317.  
  28318. inline void
  28319. swap ( _Bit_reference __x , _Bit_reference __y ) noexcept
  28320. {
  28321. bool __tmp = __x ;
  28322. __x = __y ;
  28323. __y = __tmp ;
  28324. }
  28325.  
  28326. inline void
  28327. swap ( _Bit_reference __x , bool & __y ) noexcept
  28328. {
  28329. bool __tmp = __x ;
  28330. __x = __y ;
  28331. __y = __tmp ;
  28332. }
  28333.  
  28334. inline void
  28335. swap ( bool & __x , _Bit_reference __y ) noexcept
  28336. {
  28337. bool __tmp = __x ;
  28338. __x = __y ;
  28339. __y = __tmp ;
  28340. }
  28341.  
  28342.  
  28343. struct _Bit_iterator_base
  28344. : public std :: iterator < std :: random_access_iterator_tag , bool >
  28345. {
  28346. _Bit_type * _M_p ;
  28347. unsigned int _M_offset ;
  28348.  
  28349. _Bit_iterator_base ( _Bit_type * __x , unsigned int __y )
  28350. : _M_p ( __x ) , _M_offset ( __y ) { }
  28351.  
  28352. void
  28353. _M_bump_up ( )
  28354. {
  28355. if ( _M_offset ++ == int ( _S_word_bit ) - 1 )
  28356. {
  28357. _M_offset = 0 ;
  28358. ++ _M_p ;
  28359. }
  28360. }
  28361.  
  28362. void
  28363. _M_bump_down ( )
  28364. {
  28365. if ( _M_offset -- == 0 )
  28366. {
  28367. _M_offset = int ( _S_word_bit ) - 1 ;
  28368. -- _M_p ;
  28369. }
  28370. }
  28371.  
  28372. void
  28373. _M_incr ( ptrdiff_t __i )
  28374. {
  28375. difference_type __n = __i + _M_offset ;
  28376. _M_p += __n / int ( _S_word_bit ) ;
  28377. __n = __n % int ( _S_word_bit ) ;
  28378. if ( __n < 0 )
  28379. {
  28380. __n += int ( _S_word_bit ) ;
  28381. -- _M_p ;
  28382. }
  28383. _M_offset = static_cast < unsigned int > ( __n ) ;
  28384. }
  28385.  
  28386. bool
  28387. operator == ( const _Bit_iterator_base & __i ) const
  28388. { return _M_p == __i . _M_p && _M_offset == __i . _M_offset ; }
  28389.  
  28390. bool
  28391. operator < ( const _Bit_iterator_base & __i ) const
  28392. {
  28393. return _M_p < __i . _M_p
  28394. || ( _M_p == __i . _M_p && _M_offset < __i . _M_offset ) ;
  28395. }
  28396.  
  28397. bool
  28398. operator != ( const _Bit_iterator_base & __i ) const
  28399. { return ! ( * this == __i ) ; }
  28400.  
  28401. bool
  28402. operator > ( const _Bit_iterator_base & __i ) const
  28403. { return __i < * this ; }
  28404.  
  28405. bool
  28406. operator <= ( const _Bit_iterator_base & __i ) const
  28407. { return ! ( __i < * this ) ; }
  28408.  
  28409. bool
  28410. operator >= ( const _Bit_iterator_base & __i ) const
  28411. { return ! ( * this < __i ) ; }
  28412. } ;
  28413.  
  28414. inline ptrdiff_t
  28415. operator - ( const _Bit_iterator_base & __x , const _Bit_iterator_base & __y )
  28416. {
  28417. return ( int ( _S_word_bit ) * ( __x . _M_p - __y . _M_p )
  28418. + __x . _M_offset - __y . _M_offset ) ;
  28419. }
  28420.  
  28421. struct _Bit_iterator : public _Bit_iterator_base
  28422. {
  28423. typedef _Bit_reference reference ;
  28424. typedef _Bit_reference * pointer ;
  28425. typedef _Bit_iterator iterator ;
  28426.  
  28427. _Bit_iterator ( ) : _Bit_iterator_base ( 0 , 0 ) { }
  28428.  
  28429. _Bit_iterator ( _Bit_type * __x , unsigned int __y )
  28430. : _Bit_iterator_base ( __x , __y ) { }
  28431.  
  28432. reference
  28433. operator * ( ) const
  28434. { return reference ( _M_p , 1UL << _M_offset ) ; }
  28435.  
  28436. iterator &
  28437. operator ++ ( )
  28438. {
  28439. _M_bump_up ( ) ;
  28440. return * this ;
  28441. }
  28442.  
  28443. iterator
  28444. operator ++ ( int )
  28445. {
  28446. iterator __tmp = * this ;
  28447. _M_bump_up ( ) ;
  28448. return __tmp ;
  28449. }
  28450.  
  28451. iterator &
  28452. operator -- ( )
  28453. {
  28454. _M_bump_down ( ) ;
  28455. return * this ;
  28456. }
  28457.  
  28458. iterator
  28459. operator -- ( int )
  28460. {
  28461. iterator __tmp = * this ;
  28462. _M_bump_down ( ) ;
  28463. return __tmp ;
  28464. }
  28465.  
  28466. iterator &
  28467. operator += ( difference_type __i )
  28468. {
  28469. _M_incr ( __i ) ;
  28470. return * this ;
  28471. }
  28472.  
  28473. iterator &
  28474. operator -= ( difference_type __i )
  28475. {
  28476. * this += - __i ;
  28477. return * this ;
  28478. }
  28479.  
  28480. iterator
  28481. operator + ( difference_type __i ) const
  28482. {
  28483. iterator __tmp = * this ;
  28484. return __tmp += __i ;
  28485. }
  28486.  
  28487. iterator
  28488. operator - ( difference_type __i ) const
  28489. {
  28490. iterator __tmp = * this ;
  28491. return __tmp -= __i ;
  28492. }
  28493.  
  28494. reference
  28495. operator [ ] ( difference_type __i ) const
  28496. { return * ( * this + __i ) ; }
  28497. } ;
  28498.  
  28499. inline _Bit_iterator
  28500. operator + ( ptrdiff_t __n , const _Bit_iterator & __x )
  28501. { return __x + __n ; }
  28502.  
  28503. struct _Bit_const_iterator : public _Bit_iterator_base
  28504. {
  28505. typedef bool reference ;
  28506. typedef bool const_reference ;
  28507. typedef const bool * pointer ;
  28508. typedef _Bit_const_iterator const_iterator ;
  28509.  
  28510. _Bit_const_iterator ( ) : _Bit_iterator_base ( 0 , 0 ) { }
  28511.  
  28512. _Bit_const_iterator ( _Bit_type * __x , unsigned int __y )
  28513. : _Bit_iterator_base ( __x , __y ) { }
  28514.  
  28515. _Bit_const_iterator ( const _Bit_iterator & __x )
  28516. : _Bit_iterator_base ( __x . _M_p , __x . _M_offset ) { }
  28517.  
  28518. const_reference
  28519. operator * ( ) const
  28520. { return _Bit_reference ( _M_p , 1UL << _M_offset ) ; }
  28521.  
  28522. const_iterator &
  28523. operator ++ ( )
  28524. {
  28525. _M_bump_up ( ) ;
  28526. return * this ;
  28527. }
  28528.  
  28529. const_iterator
  28530. operator ++ ( int )
  28531. {
  28532. const_iterator __tmp = * this ;
  28533. _M_bump_up ( ) ;
  28534. return __tmp ;
  28535. }
  28536.  
  28537. const_iterator &
  28538. operator -- ( )
  28539. {
  28540. _M_bump_down ( ) ;
  28541. return * this ;
  28542. }
  28543.  
  28544. const_iterator
  28545. operator -- ( int )
  28546. {
  28547. const_iterator __tmp = * this ;
  28548. _M_bump_down ( ) ;
  28549. return __tmp ;
  28550. }
  28551.  
  28552. const_iterator &
  28553. operator += ( difference_type __i )
  28554. {
  28555. _M_incr ( __i ) ;
  28556. return * this ;
  28557. }
  28558.  
  28559. const_iterator &
  28560. operator -= ( difference_type __i )
  28561. {
  28562. * this += - __i ;
  28563. return * this ;
  28564. }
  28565.  
  28566. const_iterator
  28567. operator + ( difference_type __i ) const
  28568. {
  28569. const_iterator __tmp = * this ;
  28570. return __tmp += __i ;
  28571. }
  28572.  
  28573. const_iterator
  28574. operator - ( difference_type __i ) const
  28575. {
  28576. const_iterator __tmp = * this ;
  28577. return __tmp -= __i ;
  28578. }
  28579.  
  28580. const_reference
  28581. operator [ ] ( difference_type __i ) const
  28582. { return * ( * this + __i ) ; }
  28583. } ;
  28584.  
  28585. inline _Bit_const_iterator
  28586. operator + ( ptrdiff_t __n , const _Bit_const_iterator & __x )
  28587. { return __x + __n ; }
  28588.  
  28589. inline void
  28590. __fill_bvector ( _Bit_iterator __first , _Bit_iterator __last , bool __x )
  28591. {
  28592. for ( ; __first != __last ; ++ __first )
  28593. * __first = __x ;
  28594. }
  28595.  
  28596. inline void
  28597. fill ( _Bit_iterator __first , _Bit_iterator __last , const bool & __x )
  28598. {
  28599. if ( __first . _M_p != __last . _M_p )
  28600. {
  28601. std :: fill ( __first . _M_p + 1 , __last . _M_p , __x ? ~ 0 : 0 ) ;
  28602. __fill_bvector ( __first , _Bit_iterator ( __first . _M_p + 1 , 0 ) , __x ) ;
  28603. __fill_bvector ( _Bit_iterator ( __last . _M_p , 0 ) , __last , __x ) ;
  28604. }
  28605. else
  28606. __fill_bvector ( __first , __last , __x ) ;
  28607. }
  28608.  
  28609. template < typename _Alloc >
  28610. struct _Bvector_base
  28611. {
  28612. typedef typename _Alloc :: template rebind < _Bit_type > :: other
  28613. _Bit_alloc_type ;
  28614.  
  28615. struct _Bvector_impl
  28616. : public _Bit_alloc_type
  28617. {
  28618. _Bit_iterator _M_start ;
  28619. _Bit_iterator _M_finish ;
  28620. _Bit_type * _M_end_of_storage ;
  28621.  
  28622. _Bvector_impl ( )
  28623. : _Bit_alloc_type ( ) , _M_start ( ) , _M_finish ( ) , _M_end_of_storage ( 0 )
  28624. { }
  28625.  
  28626. _Bvector_impl ( const _Bit_alloc_type & __a )
  28627. : _Bit_alloc_type ( __a ) , _M_start ( ) , _M_finish ( ) , _M_end_of_storage ( 0 )
  28628. { }
  28629.  
  28630.  
  28631. _Bvector_impl ( _Bit_alloc_type && __a )
  28632. : _Bit_alloc_type ( std :: move ( __a ) ) , _M_start ( ) , _M_finish ( ) ,
  28633. _M_end_of_storage ( 0 )
  28634. { }
  28635.  
  28636. } ;
  28637.  
  28638. public :
  28639. typedef _Alloc allocator_type ;
  28640.  
  28641. _Bit_alloc_type &
  28642. _M_get_Bit_allocator ( ) noexcept
  28643. { return * static_cast < _Bit_alloc_type * > ( & this -> _M_impl ) ; }
  28644.  
  28645. const _Bit_alloc_type &
  28646. _M_get_Bit_allocator ( ) const noexcept
  28647. { return * static_cast < const _Bit_alloc_type * > ( & this -> _M_impl ) ; }
  28648.  
  28649. allocator_type
  28650. get_allocator ( ) const noexcept
  28651. { return allocator_type ( _M_get_Bit_allocator ( ) ) ; }
  28652.  
  28653. _Bvector_base ( )
  28654. : _M_impl ( ) { }
  28655.  
  28656. _Bvector_base ( const allocator_type & __a )
  28657. : _M_impl ( __a ) { }
  28658.  
  28659.  
  28660. _Bvector_base ( _Bvector_base && __x ) noexcept
  28661. : _M_impl ( std :: move ( __x . _M_get_Bit_allocator ( ) ) )
  28662. {
  28663. this -> _M_impl . _M_start = __x . _M_impl . _M_start ;
  28664. this -> _M_impl . _M_finish = __x . _M_impl . _M_finish ;
  28665. this -> _M_impl . _M_end_of_storage = __x . _M_impl . _M_end_of_storage ;
  28666. __x . _M_impl . _M_start = _Bit_iterator ( ) ;
  28667. __x . _M_impl . _M_finish = _Bit_iterator ( ) ;
  28668. __x . _M_impl . _M_end_of_storage = 0 ;
  28669. }
  28670.  
  28671.  
  28672. ~ _Bvector_base ( )
  28673. { this -> _M_deallocate ( ) ; }
  28674.  
  28675. protected :
  28676. _Bvector_impl _M_impl ;
  28677.  
  28678. _Bit_type *
  28679. _M_allocate ( size_t __n )
  28680. { return _M_impl . allocate ( _S_nword ( __n ) ) ; }
  28681.  
  28682. void
  28683. _M_deallocate ( )
  28684. {
  28685. if ( _M_impl . _M_start . _M_p )
  28686. _M_impl . deallocate ( _M_impl . _M_start . _M_p ,
  28687. _M_impl . _M_end_of_storage - _M_impl . _M_start . _M_p ) ;
  28688. }
  28689.  
  28690. static size_t
  28691. _S_nword ( size_t __n )
  28692. { return ( __n + int ( _S_word_bit ) - 1 ) / int ( _S_word_bit ) ; }
  28693. } ;
  28694.  
  28695.  
  28696. }
  28697. #494
  28698. namespace std
  28699. {
  28700. #517
  28701. template < typename _Alloc >
  28702. class vector < bool , _Alloc > : protected _Bvector_base < _Alloc >
  28703. {
  28704. typedef _Bvector_base < _Alloc > _Base ;
  28705.  
  28706.  
  28707. template < typename > friend struct hash ;
  28708.  
  28709.  
  28710. public :
  28711. typedef bool value_type ;
  28712. typedef size_t size_type ;
  28713. typedef ptrdiff_t difference_type ;
  28714. typedef _Bit_reference reference ;
  28715. typedef bool const_reference ;
  28716. typedef _Bit_reference * pointer ;
  28717. typedef const bool * const_pointer ;
  28718. typedef _Bit_iterator iterator ;
  28719. typedef _Bit_const_iterator const_iterator ;
  28720. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  28721. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  28722. typedef _Alloc allocator_type ;
  28723.  
  28724. allocator_type get_allocator ( ) const
  28725. { return _Base :: get_allocator ( ) ; }
  28726.  
  28727. protected :
  28728. using _Base :: _M_allocate ;
  28729. using _Base :: _M_deallocate ;
  28730. using _Base :: _S_nword ;
  28731. using _Base :: _M_get_Bit_allocator ;
  28732.  
  28733. public :
  28734. vector ( )
  28735. : _Base ( ) { }
  28736.  
  28737. explicit
  28738. vector ( const allocator_type & __a )
  28739. : _Base ( __a ) { }
  28740.  
  28741.  
  28742. explicit
  28743. vector ( size_type __n , const allocator_type & __a = allocator_type ( ) )
  28744. : vector ( __n , false , __a )
  28745. { }
  28746.  
  28747. vector ( size_type __n , const bool & __value ,
  28748. const allocator_type & __a = allocator_type ( ) )
  28749. : _Base ( __a )
  28750. {
  28751. _M_initialize ( __n ) ;
  28752. std :: fill ( this -> _M_impl . _M_start . _M_p , this -> _M_impl . _M_end_of_storage ,
  28753. __value ? ~ 0 : 0 ) ;
  28754. }
  28755. #583
  28756. vector ( const vector & __x )
  28757. : _Base ( __x . _M_get_Bit_allocator ( ) )
  28758. {
  28759. _M_initialize ( __x . size ( ) ) ;
  28760. _M_copy_aligned ( __x . begin ( ) , __x . end ( ) , this -> _M_impl . _M_start ) ;
  28761. }
  28762.  
  28763.  
  28764. vector ( vector && __x ) noexcept
  28765. : _Base ( std :: move ( __x ) ) { }
  28766.  
  28767. vector ( initializer_list < bool > __l ,
  28768. const allocator_type & __a = allocator_type ( ) )
  28769. : _Base ( __a )
  28770. {
  28771. _M_initialize_range ( __l . begin ( ) , __l . end ( ) ,
  28772. random_access_iterator_tag ( ) ) ;
  28773. }
  28774.  
  28775.  
  28776.  
  28777. template < typename _InputIterator ,
  28778. typename = std :: _RequireInputIter < _InputIterator >>
  28779. vector ( _InputIterator __first , _InputIterator __last ,
  28780. const allocator_type & __a = allocator_type ( ) )
  28781. : _Base ( __a )
  28782. { _M_initialize_dispatch ( __first , __last , __false_type ( ) ) ; }
  28783. #621
  28784. ~ vector ( ) noexcept { }
  28785.  
  28786. vector &
  28787. operator = ( const vector & __x )
  28788. {
  28789. if ( & __x == this )
  28790. return * this ;
  28791. if ( __x . size ( ) > capacity ( ) )
  28792. {
  28793. this -> _M_deallocate ( ) ;
  28794. _M_initialize ( __x . size ( ) ) ;
  28795. }
  28796. this -> _M_impl . _M_finish = _M_copy_aligned ( __x . begin ( ) , __x . end ( ) ,
  28797. begin ( ) ) ;
  28798. return * this ;
  28799. }
  28800.  
  28801.  
  28802. vector &
  28803. operator = ( vector && __x )
  28804. {
  28805.  
  28806.  
  28807. this -> clear ( ) ;
  28808. this -> swap ( __x ) ;
  28809. return * this ;
  28810. }
  28811.  
  28812. vector &
  28813. operator = ( initializer_list < bool > __l )
  28814. {
  28815. this -> assign ( __l . begin ( ) , __l . end ( ) ) ;
  28816. return * this ;
  28817. }
  28818. #661
  28819. void
  28820. assign ( size_type __n , const bool & __x )
  28821. { _M_fill_assign ( __n , __x ) ; }
  28822.  
  28823.  
  28824. template < typename _InputIterator ,
  28825. typename = std :: _RequireInputIter < _InputIterator >>
  28826. void
  28827. assign ( _InputIterator __first , _InputIterator __last )
  28828. { _M_assign_dispatch ( __first , __last , __false_type ( ) ) ; }
  28829. #682
  28830. void
  28831. assign ( initializer_list < bool > __l )
  28832. { this -> assign ( __l . begin ( ) , __l . end ( ) ) ; }
  28833.  
  28834.  
  28835. iterator
  28836. begin ( ) noexcept
  28837. { return this -> _M_impl . _M_start ; }
  28838.  
  28839. const_iterator
  28840. begin ( ) const noexcept
  28841. { return this -> _M_impl . _M_start ; }
  28842.  
  28843. iterator
  28844. end ( ) noexcept
  28845. { return this -> _M_impl . _M_finish ; }
  28846.  
  28847. const_iterator
  28848. end ( ) const noexcept
  28849. { return this -> _M_impl . _M_finish ; }
  28850.  
  28851. reverse_iterator
  28852. rbegin ( ) noexcept
  28853. { return reverse_iterator ( end ( ) ) ; }
  28854.  
  28855. const_reverse_iterator
  28856. rbegin ( ) const noexcept
  28857. { return const_reverse_iterator ( end ( ) ) ; }
  28858.  
  28859. reverse_iterator
  28860. rend ( ) noexcept
  28861. { return reverse_iterator ( begin ( ) ) ; }
  28862.  
  28863. const_reverse_iterator
  28864. rend ( ) const noexcept
  28865. { return const_reverse_iterator ( begin ( ) ) ; }
  28866.  
  28867.  
  28868. const_iterator
  28869. cbegin ( ) const noexcept
  28870. { return this -> _M_impl . _M_start ; }
  28871.  
  28872. const_iterator
  28873. cend ( ) const noexcept
  28874. { return this -> _M_impl . _M_finish ; }
  28875.  
  28876. const_reverse_iterator
  28877. crbegin ( ) const noexcept
  28878. { return const_reverse_iterator ( end ( ) ) ; }
  28879.  
  28880. const_reverse_iterator
  28881. crend ( ) const noexcept
  28882. { return const_reverse_iterator ( begin ( ) ) ; }
  28883.  
  28884.  
  28885. size_type
  28886. size ( ) const noexcept
  28887. { return size_type ( end ( ) - begin ( ) ) ; }
  28888.  
  28889. size_type
  28890. max_size ( ) const noexcept
  28891. {
  28892. const size_type __isize =
  28893. __gnu_cxx :: __numeric_traits < difference_type > :: __max
  28894. - int ( _S_word_bit ) + 1 ;
  28895. const size_type __asize = _M_get_Bit_allocator ( ) . max_size ( ) ;
  28896. return ( __asize <= __isize / int ( _S_word_bit )
  28897. ? __asize * int ( _S_word_bit ) : __isize ) ;
  28898. }
  28899.  
  28900. size_type
  28901. capacity ( ) const noexcept
  28902. { return size_type ( const_iterator ( this -> _M_impl . _M_end_of_storage , 0 )
  28903. - begin ( ) ) ; }
  28904.  
  28905. bool
  28906. empty ( ) const noexcept
  28907. { return begin ( ) == end ( ) ; }
  28908.  
  28909. reference
  28910. operator [ ] ( size_type __n )
  28911. {
  28912. return * iterator ( this -> _M_impl . _M_start . _M_p
  28913. + __n / int ( _S_word_bit ) , __n % int ( _S_word_bit ) ) ;
  28914. }
  28915.  
  28916. const_reference
  28917. operator [ ] ( size_type __n ) const
  28918. {
  28919. return * const_iterator ( this -> _M_impl . _M_start . _M_p
  28920. + __n / int ( _S_word_bit ) , __n % int ( _S_word_bit ) ) ;
  28921. }
  28922.  
  28923. protected :
  28924. void
  28925. _M_range_check ( size_type __n ) const
  28926. {
  28927. if ( __n >= this -> size ( ) )
  28928. __throw_out_of_range ( ( "vector<bool>::_M_range_check" ) ) ;
  28929. }
  28930.  
  28931. public :
  28932. reference
  28933. at ( size_type __n )
  28934. { _M_range_check ( __n ) ; return ( * this ) [ __n ] ; }
  28935.  
  28936. const_reference
  28937. at ( size_type __n ) const
  28938. { _M_range_check ( __n ) ; return ( * this ) [ __n ] ; }
  28939.  
  28940. void
  28941. reserve ( size_type __n )
  28942. {
  28943. if ( __n > max_size ( ) )
  28944. __throw_length_error ( ( "vector::reserve" ) ) ;
  28945. if ( capacity ( ) < __n )
  28946. _M_reallocate ( __n ) ;
  28947. }
  28948.  
  28949. reference
  28950. front ( )
  28951. { return * begin ( ) ; }
  28952.  
  28953. const_reference
  28954. front ( ) const
  28955. { return * begin ( ) ; }
  28956.  
  28957. reference
  28958. back ( )
  28959. { return * ( end ( ) - 1 ) ; }
  28960.  
  28961. const_reference
  28962. back ( ) const
  28963. { return * ( end ( ) - 1 ) ; }
  28964. #822
  28965. void
  28966. data ( ) noexcept { }
  28967.  
  28968. void
  28969. push_back ( bool __x )
  28970. {
  28971. if ( this -> _M_impl . _M_finish . _M_p != this -> _M_impl . _M_end_of_storage )
  28972. * this -> _M_impl . _M_finish ++ = __x ;
  28973. else
  28974. _M_insert_aux ( end ( ) , __x ) ;
  28975. }
  28976.  
  28977. void
  28978. swap ( vector & __x )
  28979. {
  28980. std :: swap ( this -> _M_impl . _M_start , __x . _M_impl . _M_start ) ;
  28981. std :: swap ( this -> _M_impl . _M_finish , __x . _M_impl . _M_finish ) ;
  28982. std :: swap ( this -> _M_impl . _M_end_of_storage ,
  28983. __x . _M_impl . _M_end_of_storage ) ;
  28984.  
  28985.  
  28986.  
  28987. std :: __alloc_swap < typename _Base :: _Bit_alloc_type > ::
  28988. _S_do_it ( _M_get_Bit_allocator ( ) , __x . _M_get_Bit_allocator ( ) ) ;
  28989. }
  28990.  
  28991.  
  28992. static void
  28993. swap ( reference __x , reference __y ) noexcept
  28994. {
  28995. bool __tmp = __x ;
  28996. __x = __y ;
  28997. __y = __tmp ;
  28998. }
  28999.  
  29000. iterator
  29001. insert ( iterator __position , const bool & __x = bool ( ) )
  29002. {
  29003. const difference_type __n = __position - begin ( ) ;
  29004. if ( this -> _M_impl . _M_finish . _M_p != this -> _M_impl . _M_end_of_storage
  29005. && __position == end ( ) )
  29006. * this -> _M_impl . _M_finish ++ = __x ;
  29007. else
  29008. _M_insert_aux ( __position , __x ) ;
  29009. return begin ( ) + __n ;
  29010. }
  29011.  
  29012.  
  29013. template < typename _InputIterator ,
  29014. typename = std :: _RequireInputIter < _InputIterator >>
  29015. void
  29016. insert ( iterator __position ,
  29017. _InputIterator __first , _InputIterator __last )
  29018. { _M_insert_dispatch ( __position , __first , __last , __false_type ( ) ) ; }
  29019. #887
  29020. void
  29021. insert ( iterator __position , size_type __n , const bool & __x )
  29022. { _M_fill_insert ( __position , __n , __x ) ; }
  29023.  
  29024.  
  29025. void insert ( iterator __p , initializer_list < bool > __l )
  29026. { this -> insert ( __p , __l . begin ( ) , __l . end ( ) ) ; }
  29027.  
  29028.  
  29029. void
  29030. pop_back ( )
  29031. { -- this -> _M_impl . _M_finish ; }
  29032.  
  29033. iterator
  29034. erase ( iterator __position )
  29035. {
  29036. if ( __position + 1 != end ( ) )
  29037. std :: copy ( __position + 1 , end ( ) , __position ) ;
  29038. -- this -> _M_impl . _M_finish ;
  29039. return __position ;
  29040. }
  29041.  
  29042. iterator
  29043. erase ( iterator __first , iterator __last )
  29044. {
  29045. if ( __first != __last )
  29046. _M_erase_at_end ( std :: copy ( __last , end ( ) , __first ) ) ;
  29047. return __first ;
  29048. }
  29049.  
  29050. void
  29051. resize ( size_type __new_size , bool __x = bool ( ) )
  29052. {
  29053. if ( __new_size < size ( ) )
  29054. _M_erase_at_end ( begin ( ) + difference_type ( __new_size ) ) ;
  29055. else
  29056. insert ( end ( ) , __new_size - size ( ) , __x ) ;
  29057. }
  29058.  
  29059.  
  29060. void
  29061. shrink_to_fit ( )
  29062. { _M_shrink_to_fit ( ) ; }
  29063.  
  29064.  
  29065. void
  29066. flip ( ) noexcept
  29067. {
  29068. for ( _Bit_type * __p = this -> _M_impl . _M_start . _M_p ;
  29069. __p != this -> _M_impl . _M_end_of_storage ; ++ __p )
  29070. * __p = ~ * __p ;
  29071. }
  29072.  
  29073. void
  29074. clear ( ) noexcept
  29075. { _M_erase_at_end ( begin ( ) ) ; }
  29076.  
  29077.  
  29078. protected :
  29079.  
  29080. iterator
  29081. _M_copy_aligned ( const_iterator __first , const_iterator __last ,
  29082. iterator __result )
  29083. {
  29084. _Bit_type * __q = std :: copy ( __first . _M_p , __last . _M_p , __result . _M_p ) ;
  29085. return std :: copy ( const_iterator ( __last . _M_p , 0 ) , __last ,
  29086. iterator ( __q , 0 ) ) ;
  29087. }
  29088.  
  29089. void
  29090. _M_initialize ( size_type __n )
  29091. {
  29092. _Bit_type * __q = this -> _M_allocate ( __n ) ;
  29093. this -> _M_impl . _M_end_of_storage = __q + _S_nword ( __n ) ;
  29094. this -> _M_impl . _M_start = iterator ( __q , 0 ) ;
  29095. this -> _M_impl . _M_finish = this -> _M_impl . _M_start + difference_type ( __n ) ;
  29096. }
  29097.  
  29098. void
  29099. _M_reallocate ( size_type __n ) ;
  29100.  
  29101.  
  29102. bool
  29103. _M_shrink_to_fit ( ) ;
  29104. #977
  29105. template < typename _Integer >
  29106. void
  29107. _M_initialize_dispatch ( _Integer __n , _Integer __x , __true_type )
  29108. {
  29109. _M_initialize ( static_cast < size_type > ( __n ) ) ;
  29110. std :: fill ( this -> _M_impl . _M_start . _M_p ,
  29111. this -> _M_impl . _M_end_of_storage , __x ? ~ 0 : 0 ) ;
  29112. }
  29113.  
  29114. template < typename _InputIterator >
  29115. void
  29116. _M_initialize_dispatch ( _InputIterator __first , _InputIterator __last ,
  29117. __false_type )
  29118. { _M_initialize_range ( __first , __last ,
  29119. std :: __iterator_category ( __first ) ) ; }
  29120.  
  29121. template < typename _InputIterator >
  29122. void
  29123. _M_initialize_range ( _InputIterator __first , _InputIterator __last ,
  29124. std :: input_iterator_tag )
  29125. {
  29126. for ( ; __first != __last ; ++ __first )
  29127. push_back ( * __first ) ;
  29128. }
  29129.  
  29130. template < typename _ForwardIterator >
  29131. void
  29132. _M_initialize_range ( _ForwardIterator __first , _ForwardIterator __last ,
  29133. std :: forward_iterator_tag )
  29134. {
  29135. const size_type __n = std :: distance ( __first , __last ) ;
  29136. _M_initialize ( __n ) ;
  29137. std :: copy ( __first , __last , this -> _M_impl . _M_start ) ;
  29138. }
  29139.  
  29140.  
  29141.  
  29142. template < typename _Integer >
  29143. void
  29144. _M_assign_dispatch ( _Integer __n , _Integer __val , __true_type )
  29145. { _M_fill_assign ( __n , __val ) ; }
  29146.  
  29147. template < class _InputIterator >
  29148. void
  29149. _M_assign_dispatch ( _InputIterator __first , _InputIterator __last ,
  29150. __false_type )
  29151. { _M_assign_aux ( __first , __last , std :: __iterator_category ( __first ) ) ; }
  29152.  
  29153. void
  29154. _M_fill_assign ( size_t __n , bool __x )
  29155. {
  29156. if ( __n > size ( ) )
  29157. {
  29158. std :: fill ( this -> _M_impl . _M_start . _M_p ,
  29159. this -> _M_impl . _M_end_of_storage , __x ? ~ 0 : 0 ) ;
  29160. insert ( end ( ) , __n - size ( ) , __x ) ;
  29161. }
  29162. else
  29163. {
  29164. _M_erase_at_end ( begin ( ) + __n ) ;
  29165. std :: fill ( this -> _M_impl . _M_start . _M_p ,
  29166. this -> _M_impl . _M_end_of_storage , __x ? ~ 0 : 0 ) ;
  29167. }
  29168. }
  29169.  
  29170. template < typename _InputIterator >
  29171. void
  29172. _M_assign_aux ( _InputIterator __first , _InputIterator __last ,
  29173. std :: input_iterator_tag )
  29174. {
  29175. iterator __cur = begin ( ) ;
  29176. for ( ; __first != __last && __cur != end ( ) ; ++ __cur , ++ __first )
  29177. * __cur = * __first ;
  29178. if ( __first == __last )
  29179. _M_erase_at_end ( __cur ) ;
  29180. else
  29181. insert ( end ( ) , __first , __last ) ;
  29182. }
  29183.  
  29184. template < typename _ForwardIterator >
  29185. void
  29186. _M_assign_aux ( _ForwardIterator __first , _ForwardIterator __last ,
  29187. std :: forward_iterator_tag )
  29188. {
  29189. const size_type __len = std :: distance ( __first , __last ) ;
  29190. if ( __len < size ( ) )
  29191. _M_erase_at_end ( std :: copy ( __first , __last , begin ( ) ) ) ;
  29192. else
  29193. {
  29194. _ForwardIterator __mid = __first ;
  29195. std :: advance ( __mid , size ( ) ) ;
  29196. std :: copy ( __first , __mid , begin ( ) ) ;
  29197. insert ( end ( ) , __mid , __last ) ;
  29198. }
  29199. }
  29200.  
  29201.  
  29202.  
  29203.  
  29204.  
  29205. template < typename _Integer >
  29206. void
  29207. _M_insert_dispatch ( iterator __pos , _Integer __n , _Integer __x ,
  29208. __true_type )
  29209. { _M_fill_insert ( __pos , __n , __x ) ; }
  29210.  
  29211. template < typename _InputIterator >
  29212. void
  29213. _M_insert_dispatch ( iterator __pos ,
  29214. _InputIterator __first , _InputIterator __last ,
  29215. __false_type )
  29216. { _M_insert_range ( __pos , __first , __last ,
  29217. std :: __iterator_category ( __first ) ) ; }
  29218.  
  29219. void
  29220. _M_fill_insert ( iterator __position , size_type __n , bool __x ) ;
  29221.  
  29222. template < typename _InputIterator >
  29223. void
  29224. _M_insert_range ( iterator __pos , _InputIterator __first ,
  29225. _InputIterator __last , std :: input_iterator_tag )
  29226. {
  29227. for ( ; __first != __last ; ++ __first )
  29228. {
  29229. __pos = insert ( __pos , * __first ) ;
  29230. ++ __pos ;
  29231. }
  29232. }
  29233.  
  29234. template < typename _ForwardIterator >
  29235. void
  29236. _M_insert_range ( iterator __position , _ForwardIterator __first ,
  29237. _ForwardIterator __last , std :: forward_iterator_tag ) ;
  29238.  
  29239. void
  29240. _M_insert_aux ( iterator __position , bool __x ) ;
  29241.  
  29242. size_type
  29243. _M_check_len ( size_type __n , const char * __s ) const
  29244. {
  29245. if ( max_size ( ) - size ( ) < __n )
  29246. __throw_length_error ( ( __s ) ) ;
  29247.  
  29248. const size_type __len = size ( ) + std :: max ( size ( ) , __n ) ;
  29249. return ( __len < size ( ) || __len > max_size ( ) ) ? max_size ( ) : __len ;
  29250. }
  29251.  
  29252. void
  29253. _M_erase_at_end ( iterator __pos )
  29254. { this -> _M_impl . _M_finish = __pos ; }
  29255. } ;
  29256.  
  29257.  
  29258. }
  29259. #1136
  29260. namespace std
  29261. {
  29262.  
  29263.  
  29264.  
  29265.  
  29266. template < typename _Alloc >
  29267. struct hash < std :: vector < bool , _Alloc >>
  29268. : public __hash_base < size_t , std :: vector < bool , _Alloc >>
  29269. {
  29270. size_t
  29271. operator ( ) ( const std :: vector < bool , _Alloc > & ) const noexcept ;
  29272. } ;
  29273.  
  29274.  
  29275. }
  29276. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/vector.tcc"
  29277. #59
  29278. namespace std
  29279. {
  29280.  
  29281.  
  29282. template < typename _Tp , typename _Alloc >
  29283. void
  29284. vector < _Tp , _Alloc > ::
  29285. reserve ( size_type __n )
  29286. {
  29287. if ( __n > this -> max_size ( ) )
  29288. __throw_length_error ( ( "vector::reserve" ) ) ;
  29289. if ( this -> capacity ( ) < __n )
  29290. {
  29291. const size_type __old_size = size ( ) ;
  29292. pointer __tmp = _M_allocate_and_copy ( __n ,
  29293. std :: __make_move_if_noexcept_iterator ( this -> _M_impl . _M_start ) ,
  29294. std :: __make_move_if_noexcept_iterator ( this -> _M_impl . _M_finish ) ) ;
  29295. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29296. _M_get_Tp_allocator ( ) ) ;
  29297. _M_deallocate ( this -> _M_impl . _M_start ,
  29298. this -> _M_impl . _M_end_of_storage
  29299. - this -> _M_impl . _M_start ) ;
  29300. this -> _M_impl . _M_start = __tmp ;
  29301. this -> _M_impl . _M_finish = __tmp + __old_size ;
  29302. this -> _M_impl . _M_end_of_storage = this -> _M_impl . _M_start + __n ;
  29303. }
  29304. }
  29305.  
  29306.  
  29307. template < typename _Tp , typename _Alloc >
  29308. template < typename ... _Args >
  29309. void
  29310. vector < _Tp , _Alloc > ::
  29311. emplace_back ( _Args && ... __args )
  29312. {
  29313. if ( this -> _M_impl . _M_finish != this -> _M_impl . _M_end_of_storage )
  29314. {
  29315. _Alloc_traits :: construct ( this -> _M_impl , this -> _M_impl . _M_finish ,
  29316. std :: forward < _Args > ( __args ) ... ) ;
  29317. ++ this -> _M_impl . _M_finish ;
  29318. }
  29319. else
  29320. _M_emplace_back_aux ( std :: forward < _Args > ( __args ) ... ) ;
  29321. }
  29322.  
  29323.  
  29324. template < typename _Tp , typename _Alloc >
  29325. typename vector < _Tp , _Alloc > :: iterator
  29326. vector < _Tp , _Alloc > ::
  29327. insert ( iterator __position , const value_type & __x )
  29328. {
  29329. const size_type __n = __position - begin ( ) ;
  29330. if ( this -> _M_impl . _M_finish != this -> _M_impl . _M_end_of_storage
  29331. && __position == end ( ) )
  29332. {
  29333. _Alloc_traits :: construct ( this -> _M_impl , this -> _M_impl . _M_finish , __x ) ;
  29334. ++ this -> _M_impl . _M_finish ;
  29335. }
  29336. else
  29337. {
  29338.  
  29339. if ( this -> _M_impl . _M_finish != this -> _M_impl . _M_end_of_storage )
  29340. {
  29341. _Tp __x_copy = __x ;
  29342. _M_insert_aux ( __position , std :: move ( __x_copy ) ) ;
  29343. }
  29344. else
  29345.  
  29346. _M_insert_aux ( __position , __x ) ;
  29347. }
  29348. return iterator ( this -> _M_impl . _M_start + __n ) ;
  29349. }
  29350.  
  29351. template < typename _Tp , typename _Alloc >
  29352. typename vector < _Tp , _Alloc > :: iterator
  29353. vector < _Tp , _Alloc > ::
  29354. erase ( iterator __position )
  29355. {
  29356. if ( __position + 1 != end ( ) )
  29357. std :: move ( __position + 1 , end ( ) , __position ) ;
  29358. -- this -> _M_impl . _M_finish ;
  29359. _Alloc_traits :: destroy ( this -> _M_impl , this -> _M_impl . _M_finish ) ;
  29360. return __position ;
  29361. }
  29362.  
  29363. template < typename _Tp , typename _Alloc >
  29364. typename vector < _Tp , _Alloc > :: iterator
  29365. vector < _Tp , _Alloc > ::
  29366. erase ( iterator __first , iterator __last )
  29367. {
  29368. if ( __first != __last )
  29369. {
  29370. if ( __last != end ( ) )
  29371. std :: move ( __last , end ( ) , __first ) ;
  29372. _M_erase_at_end ( __first . base ( ) + ( end ( ) - __last ) ) ;
  29373. }
  29374. return __first ;
  29375. }
  29376.  
  29377. template < typename _Tp , typename _Alloc >
  29378. vector < _Tp , _Alloc > &
  29379. vector < _Tp , _Alloc > ::
  29380. operator = ( const vector < _Tp , _Alloc > & __x )
  29381. {
  29382. if ( & __x != this )
  29383. {
  29384.  
  29385. if ( _Alloc_traits :: _S_propagate_on_copy_assign ( ) )
  29386. {
  29387. if ( ! _Alloc_traits :: _S_always_equal ( )
  29388. && _M_get_Tp_allocator ( ) != __x . _M_get_Tp_allocator ( ) )
  29389. {
  29390.  
  29391. this -> clear ( ) ;
  29392. _M_deallocate ( this -> _M_impl . _M_start ,
  29393. this -> _M_impl . _M_end_of_storage
  29394. - this -> _M_impl . _M_start ) ;
  29395. this -> _M_impl . _M_start = nullptr ;
  29396. this -> _M_impl . _M_finish = nullptr ;
  29397. this -> _M_impl . _M_end_of_storage = nullptr ;
  29398. }
  29399. std :: __alloc_on_copy ( _M_get_Tp_allocator ( ) ,
  29400. __x . _M_get_Tp_allocator ( ) ) ;
  29401. }
  29402.  
  29403. const size_type __xlen = __x . size ( ) ;
  29404. if ( __xlen > capacity ( ) )
  29405. {
  29406. pointer __tmp = _M_allocate_and_copy ( __xlen , __x . begin ( ) ,
  29407. __x . end ( ) ) ;
  29408. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29409. _M_get_Tp_allocator ( ) ) ;
  29410. _M_deallocate ( this -> _M_impl . _M_start ,
  29411. this -> _M_impl . _M_end_of_storage
  29412. - this -> _M_impl . _M_start ) ;
  29413. this -> _M_impl . _M_start = __tmp ;
  29414. this -> _M_impl . _M_end_of_storage = this -> _M_impl . _M_start + __xlen ;
  29415. }
  29416. else if ( size ( ) >= __xlen )
  29417. {
  29418. std :: _Destroy ( std :: copy ( __x . begin ( ) , __x . end ( ) , begin ( ) ) ,
  29419. end ( ) , _M_get_Tp_allocator ( ) ) ;
  29420. }
  29421. else
  29422. {
  29423. std :: copy ( __x . _M_impl . _M_start , __x . _M_impl . _M_start + size ( ) ,
  29424. this -> _M_impl . _M_start ) ;
  29425. std :: __uninitialized_copy_a ( __x . _M_impl . _M_start + size ( ) ,
  29426. __x . _M_impl . _M_finish ,
  29427. this -> _M_impl . _M_finish ,
  29428. _M_get_Tp_allocator ( ) ) ;
  29429. }
  29430. this -> _M_impl . _M_finish = this -> _M_impl . _M_start + __xlen ;
  29431. }
  29432. return * this ;
  29433. }
  29434.  
  29435. template < typename _Tp , typename _Alloc >
  29436. void
  29437. vector < _Tp , _Alloc > ::
  29438. _M_fill_assign ( size_t __n , const value_type & __val )
  29439. {
  29440. if ( __n > capacity ( ) )
  29441. {
  29442. vector __tmp ( __n , __val , _M_get_Tp_allocator ( ) ) ;
  29443. __tmp . swap ( * this ) ;
  29444. }
  29445. else if ( __n > size ( ) )
  29446. {
  29447. std :: fill ( begin ( ) , end ( ) , __val ) ;
  29448. std :: __uninitialized_fill_n_a ( this -> _M_impl . _M_finish ,
  29449. __n - size ( ) , __val ,
  29450. _M_get_Tp_allocator ( ) ) ;
  29451. this -> _M_impl . _M_finish += __n - size ( ) ;
  29452. }
  29453. else
  29454. _M_erase_at_end ( std :: fill_n ( this -> _M_impl . _M_start , __n , __val ) ) ;
  29455. }
  29456.  
  29457. template < typename _Tp , typename _Alloc >
  29458. template < typename _InputIterator >
  29459. void
  29460. vector < _Tp , _Alloc > ::
  29461. _M_assign_aux ( _InputIterator __first , _InputIterator __last ,
  29462. std :: input_iterator_tag )
  29463. {
  29464. pointer __cur ( this -> _M_impl . _M_start ) ;
  29465. for ( ; __first != __last && __cur != this -> _M_impl . _M_finish ;
  29466. ++ __cur , ++ __first )
  29467. * __cur = * __first ;
  29468. if ( __first == __last )
  29469. _M_erase_at_end ( __cur ) ;
  29470. else
  29471. insert ( end ( ) , __first , __last ) ;
  29472. }
  29473.  
  29474. template < typename _Tp , typename _Alloc >
  29475. template < typename _ForwardIterator >
  29476. void
  29477. vector < _Tp , _Alloc > ::
  29478. _M_assign_aux ( _ForwardIterator __first , _ForwardIterator __last ,
  29479. std :: forward_iterator_tag )
  29480. {
  29481. const size_type __len = std :: distance ( __first , __last ) ;
  29482.  
  29483. if ( __len > capacity ( ) )
  29484. {
  29485. pointer __tmp ( _M_allocate_and_copy ( __len , __first , __last ) ) ;
  29486. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29487. _M_get_Tp_allocator ( ) ) ;
  29488. _M_deallocate ( this -> _M_impl . _M_start ,
  29489. this -> _M_impl . _M_end_of_storage
  29490. - this -> _M_impl . _M_start ) ;
  29491. this -> _M_impl . _M_start = __tmp ;
  29492. this -> _M_impl . _M_finish = this -> _M_impl . _M_start + __len ;
  29493. this -> _M_impl . _M_end_of_storage = this -> _M_impl . _M_finish ;
  29494. }
  29495. else if ( size ( ) >= __len )
  29496. _M_erase_at_end ( std :: copy ( __first , __last , this -> _M_impl . _M_start ) ) ;
  29497. else
  29498. {
  29499. _ForwardIterator __mid = __first ;
  29500. std :: advance ( __mid , size ( ) ) ;
  29501. std :: copy ( __first , __mid , this -> _M_impl . _M_start ) ;
  29502. this -> _M_impl . _M_finish =
  29503. std :: __uninitialized_copy_a ( __mid , __last ,
  29504. this -> _M_impl . _M_finish ,
  29505. _M_get_Tp_allocator ( ) ) ;
  29506. }
  29507. }
  29508.  
  29509.  
  29510. template < typename _Tp , typename _Alloc >
  29511. template < typename ... _Args >
  29512. typename vector < _Tp , _Alloc > :: iterator
  29513. vector < _Tp , _Alloc > ::
  29514. emplace ( iterator __position , _Args && ... __args )
  29515. {
  29516. const size_type __n = __position - begin ( ) ;
  29517. if ( this -> _M_impl . _M_finish != this -> _M_impl . _M_end_of_storage
  29518. && __position == end ( ) )
  29519. {
  29520. _Alloc_traits :: construct ( this -> _M_impl , this -> _M_impl . _M_finish ,
  29521. std :: forward < _Args > ( __args ) ... ) ;
  29522. ++ this -> _M_impl . _M_finish ;
  29523. }
  29524. else
  29525. _M_insert_aux ( __position , std :: forward < _Args > ( __args ) ... ) ;
  29526. return iterator ( this -> _M_impl . _M_start + __n ) ;
  29527. }
  29528.  
  29529. template < typename _Tp , typename _Alloc >
  29530. template < typename ... _Args >
  29531. void
  29532. vector < _Tp , _Alloc > ::
  29533. _M_insert_aux ( iterator __position , _Args && ... __args )
  29534. #321
  29535. {
  29536. if ( this -> _M_impl . _M_finish != this -> _M_impl . _M_end_of_storage )
  29537. {
  29538. _Alloc_traits :: construct ( this -> _M_impl , this -> _M_impl . _M_finish ,
  29539.  
  29540. std :: move ( * ( this -> _M_impl . _M_finish - 1 ) ) ) ;
  29541. ++ this -> _M_impl . _M_finish ;
  29542.  
  29543.  
  29544.  
  29545.  
  29546.  
  29547. std :: move_backward ( __position . base ( ) , this -> _M_impl . _M_finish - 2 , this -> _M_impl . _M_finish - 1 ) ;
  29548.  
  29549.  
  29550.  
  29551. * __position = _Tp ( std :: forward < _Args > ( __args ) ... ) ;
  29552.  
  29553. }
  29554. else
  29555. {
  29556. const size_type __len =
  29557. _M_check_len ( size_type ( 1 ) , "vector::_M_insert_aux" ) ;
  29558. const size_type __elems_before = __position - begin ( ) ;
  29559. pointer __new_start ( this -> _M_allocate ( __len ) ) ;
  29560. pointer __new_finish ( __new_start ) ;
  29561. try
  29562. {
  29563.  
  29564.  
  29565.  
  29566.  
  29567. _Alloc_traits :: construct ( this -> _M_impl ,
  29568. __new_start + __elems_before ,
  29569.  
  29570. std :: forward < _Args > ( __args ) ... ) ;
  29571.  
  29572.  
  29573.  
  29574. __new_finish = 0 ;
  29575.  
  29576. __new_finish
  29577. = std :: __uninitialized_move_if_noexcept_a
  29578. ( this -> _M_impl . _M_start , __position . base ( ) ,
  29579. __new_start , _M_get_Tp_allocator ( ) ) ;
  29580.  
  29581. ++ __new_finish ;
  29582.  
  29583. __new_finish
  29584. = std :: __uninitialized_move_if_noexcept_a
  29585. ( __position . base ( ) , this -> _M_impl . _M_finish ,
  29586. __new_finish , _M_get_Tp_allocator ( ) ) ;
  29587. }
  29588. catch ( ... )
  29589. {
  29590. if ( ! __new_finish )
  29591. _Alloc_traits :: destroy ( this -> _M_impl ,
  29592. __new_start + __elems_before ) ;
  29593. else
  29594. std :: _Destroy ( __new_start , __new_finish , _M_get_Tp_allocator ( ) ) ;
  29595. _M_deallocate ( __new_start , __len ) ;
  29596. throw ;
  29597. }
  29598. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29599. _M_get_Tp_allocator ( ) ) ;
  29600. _M_deallocate ( this -> _M_impl . _M_start ,
  29601. this -> _M_impl . _M_end_of_storage
  29602. - this -> _M_impl . _M_start ) ;
  29603. this -> _M_impl . _M_start = __new_start ;
  29604. this -> _M_impl . _M_finish = __new_finish ;
  29605. this -> _M_impl . _M_end_of_storage = __new_start + __len ;
  29606. }
  29607. }
  29608.  
  29609.  
  29610. template < typename _Tp , typename _Alloc >
  29611. template < typename ... _Args >
  29612. void
  29613. vector < _Tp , _Alloc > ::
  29614. _M_emplace_back_aux ( _Args && ... __args )
  29615. {
  29616. const size_type __len =
  29617. _M_check_len ( size_type ( 1 ) , "vector::_M_emplace_back_aux" ) ;
  29618. pointer __new_start ( this -> _M_allocate ( __len ) ) ;
  29619. pointer __new_finish ( __new_start ) ;
  29620. try
  29621. {
  29622. _Alloc_traits :: construct ( this -> _M_impl , __new_start + size ( ) ,
  29623. std :: forward < _Args > ( __args ) ... ) ;
  29624. __new_finish = 0 ;
  29625.  
  29626. __new_finish
  29627. = std :: __uninitialized_move_if_noexcept_a
  29628. ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29629. __new_start , _M_get_Tp_allocator ( ) ) ;
  29630.  
  29631. ++ __new_finish ;
  29632. }
  29633. catch ( ... )
  29634. {
  29635. if ( ! __new_finish )
  29636. _Alloc_traits :: destroy ( this -> _M_impl , __new_start + size ( ) ) ;
  29637. else
  29638. std :: _Destroy ( __new_start , __new_finish , _M_get_Tp_allocator ( ) ) ;
  29639. _M_deallocate ( __new_start , __len ) ;
  29640. throw ;
  29641. }
  29642. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29643. _M_get_Tp_allocator ( ) ) ;
  29644. _M_deallocate ( this -> _M_impl . _M_start ,
  29645. this -> _M_impl . _M_end_of_storage
  29646. - this -> _M_impl . _M_start ) ;
  29647. this -> _M_impl . _M_start = __new_start ;
  29648. this -> _M_impl . _M_finish = __new_finish ;
  29649. this -> _M_impl . _M_end_of_storage = __new_start + __len ;
  29650. }
  29651.  
  29652.  
  29653. template < typename _Tp , typename _Alloc >
  29654. void
  29655. vector < _Tp , _Alloc > ::
  29656. _M_fill_insert ( iterator __position , size_type __n , const value_type & __x )
  29657. {
  29658. if ( __n != 0 )
  29659. {
  29660. if ( size_type ( this -> _M_impl . _M_end_of_storage
  29661. - this -> _M_impl . _M_finish ) >= __n )
  29662. {
  29663. value_type __x_copy = __x ;
  29664. const size_type __elems_after = end ( ) - __position ;
  29665. pointer __old_finish ( this -> _M_impl . _M_finish ) ;
  29666. if ( __elems_after > __n )
  29667. {
  29668. std :: __uninitialized_move_a ( this -> _M_impl . _M_finish - __n ,
  29669. this -> _M_impl . _M_finish ,
  29670. this -> _M_impl . _M_finish ,
  29671. _M_get_Tp_allocator ( ) ) ;
  29672. this -> _M_impl . _M_finish += __n ;
  29673.  
  29674. std :: move_backward ( __position . base ( ) , __old_finish - __n , __old_finish ) ;
  29675. std :: fill ( __position . base ( ) , __position . base ( ) + __n ,
  29676. __x_copy ) ;
  29677. }
  29678. else
  29679. {
  29680. std :: __uninitialized_fill_n_a ( this -> _M_impl . _M_finish ,
  29681. __n - __elems_after ,
  29682. __x_copy ,
  29683. _M_get_Tp_allocator ( ) ) ;
  29684. this -> _M_impl . _M_finish += __n - __elems_after ;
  29685. std :: __uninitialized_move_a ( __position . base ( ) , __old_finish ,
  29686. this -> _M_impl . _M_finish ,
  29687. _M_get_Tp_allocator ( ) ) ;
  29688. this -> _M_impl . _M_finish += __elems_after ;
  29689. std :: fill ( __position . base ( ) , __old_finish , __x_copy ) ;
  29690. }
  29691. }
  29692. else
  29693. {
  29694. const size_type __len =
  29695. _M_check_len ( __n , "vector::_M_fill_insert" ) ;
  29696. const size_type __elems_before = __position - begin ( ) ;
  29697. pointer __new_start ( this -> _M_allocate ( __len ) ) ;
  29698. pointer __new_finish ( __new_start ) ;
  29699. try
  29700. {
  29701.  
  29702. std :: __uninitialized_fill_n_a ( __new_start + __elems_before ,
  29703. __n , __x ,
  29704. _M_get_Tp_allocator ( ) ) ;
  29705. __new_finish = 0 ;
  29706.  
  29707. __new_finish
  29708. = std :: __uninitialized_move_if_noexcept_a
  29709. ( this -> _M_impl . _M_start , __position . base ( ) ,
  29710. __new_start , _M_get_Tp_allocator ( ) ) ;
  29711.  
  29712. __new_finish += __n ;
  29713.  
  29714. __new_finish
  29715. = std :: __uninitialized_move_if_noexcept_a
  29716. ( __position . base ( ) , this -> _M_impl . _M_finish ,
  29717. __new_finish , _M_get_Tp_allocator ( ) ) ;
  29718. }
  29719. catch ( ... )
  29720. {
  29721. if ( ! __new_finish )
  29722. std :: _Destroy ( __new_start + __elems_before ,
  29723. __new_start + __elems_before + __n ,
  29724. _M_get_Tp_allocator ( ) ) ;
  29725. else
  29726. std :: _Destroy ( __new_start , __new_finish ,
  29727. _M_get_Tp_allocator ( ) ) ;
  29728. _M_deallocate ( __new_start , __len ) ;
  29729. throw ;
  29730. }
  29731. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29732. _M_get_Tp_allocator ( ) ) ;
  29733. _M_deallocate ( this -> _M_impl . _M_start ,
  29734. this -> _M_impl . _M_end_of_storage
  29735. - this -> _M_impl . _M_start ) ;
  29736. this -> _M_impl . _M_start = __new_start ;
  29737. this -> _M_impl . _M_finish = __new_finish ;
  29738. this -> _M_impl . _M_end_of_storage = __new_start + __len ;
  29739. }
  29740. }
  29741. }
  29742.  
  29743.  
  29744. template < typename _Tp , typename _Alloc >
  29745. void
  29746. vector < _Tp , _Alloc > ::
  29747. _M_default_append ( size_type __n )
  29748. {
  29749. if ( __n != 0 )
  29750. {
  29751. if ( size_type ( this -> _M_impl . _M_end_of_storage
  29752. - this -> _M_impl . _M_finish ) >= __n )
  29753. {
  29754. std :: __uninitialized_default_n_a ( this -> _M_impl . _M_finish ,
  29755. __n , _M_get_Tp_allocator ( ) ) ;
  29756. this -> _M_impl . _M_finish += __n ;
  29757. }
  29758. else
  29759. {
  29760. const size_type __len =
  29761. _M_check_len ( __n , "vector::_M_default_append" ) ;
  29762. const size_type __old_size = this -> size ( ) ;
  29763. pointer __new_start ( this -> _M_allocate ( __len ) ) ;
  29764. pointer __new_finish ( __new_start ) ;
  29765. try
  29766. {
  29767. __new_finish
  29768. = std :: __uninitialized_move_if_noexcept_a
  29769. ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29770. __new_start , _M_get_Tp_allocator ( ) ) ;
  29771. std :: __uninitialized_default_n_a ( __new_finish , __n ,
  29772. _M_get_Tp_allocator ( ) ) ;
  29773. __new_finish += __n ;
  29774. }
  29775. catch ( ... )
  29776. {
  29777. std :: _Destroy ( __new_start , __new_finish ,
  29778. _M_get_Tp_allocator ( ) ) ;
  29779. _M_deallocate ( __new_start , __len ) ;
  29780. throw ;
  29781. }
  29782. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29783. _M_get_Tp_allocator ( ) ) ;
  29784. _M_deallocate ( this -> _M_impl . _M_start ,
  29785. this -> _M_impl . _M_end_of_storage
  29786. - this -> _M_impl . _M_start ) ;
  29787. this -> _M_impl . _M_start = __new_start ;
  29788. this -> _M_impl . _M_finish = __new_finish ;
  29789. this -> _M_impl . _M_end_of_storage = __new_start + __len ;
  29790. }
  29791. }
  29792. }
  29793.  
  29794. template < typename _Tp , typename _Alloc >
  29795. bool
  29796. vector < _Tp , _Alloc > ::
  29797. _M_shrink_to_fit ( )
  29798. {
  29799. if ( capacity ( ) == size ( ) )
  29800. return false ;
  29801. return std :: __shrink_to_fit_aux < vector > :: _S_do_it ( * this ) ;
  29802. }
  29803.  
  29804.  
  29805. template < typename _Tp , typename _Alloc >
  29806. template < typename _InputIterator >
  29807. void
  29808. vector < _Tp , _Alloc > ::
  29809. _M_range_insert ( iterator __pos , _InputIterator __first ,
  29810. _InputIterator __last , std :: input_iterator_tag )
  29811. {
  29812. for ( ; __first != __last ; ++ __first )
  29813. {
  29814. __pos = insert ( __pos , * __first ) ;
  29815. ++ __pos ;
  29816. }
  29817. }
  29818.  
  29819. template < typename _Tp , typename _Alloc >
  29820. template < typename _ForwardIterator >
  29821. void
  29822. vector < _Tp , _Alloc > ::
  29823. _M_range_insert ( iterator __position , _ForwardIterator __first ,
  29824. _ForwardIterator __last , std :: forward_iterator_tag )
  29825. {
  29826. if ( __first != __last )
  29827. {
  29828. const size_type __n = std :: distance ( __first , __last ) ;
  29829. if ( size_type ( this -> _M_impl . _M_end_of_storage
  29830. - this -> _M_impl . _M_finish ) >= __n )
  29831. {
  29832. const size_type __elems_after = end ( ) - __position ;
  29833. pointer __old_finish ( this -> _M_impl . _M_finish ) ;
  29834. if ( __elems_after > __n )
  29835. {
  29836. std :: __uninitialized_move_a ( this -> _M_impl . _M_finish - __n ,
  29837. this -> _M_impl . _M_finish ,
  29838. this -> _M_impl . _M_finish ,
  29839. _M_get_Tp_allocator ( ) ) ;
  29840. this -> _M_impl . _M_finish += __n ;
  29841.  
  29842. std :: move_backward ( __position . base ( ) , __old_finish - __n , __old_finish ) ;
  29843. std :: copy ( __first , __last , __position ) ;
  29844. }
  29845. else
  29846. {
  29847. _ForwardIterator __mid = __first ;
  29848. std :: advance ( __mid , __elems_after ) ;
  29849. std :: __uninitialized_copy_a ( __mid , __last ,
  29850. this -> _M_impl . _M_finish ,
  29851. _M_get_Tp_allocator ( ) ) ;
  29852. this -> _M_impl . _M_finish += __n - __elems_after ;
  29853. std :: __uninitialized_move_a ( __position . base ( ) ,
  29854. __old_finish ,
  29855. this -> _M_impl . _M_finish ,
  29856. _M_get_Tp_allocator ( ) ) ;
  29857. this -> _M_impl . _M_finish += __elems_after ;
  29858. std :: copy ( __first , __mid , __position ) ;
  29859. }
  29860. }
  29861. else
  29862. {
  29863. const size_type __len =
  29864. _M_check_len ( __n , "vector::_M_range_insert" ) ;
  29865. pointer __new_start ( this -> _M_allocate ( __len ) ) ;
  29866. pointer __new_finish ( __new_start ) ;
  29867. try
  29868. {
  29869. __new_finish
  29870. = std :: __uninitialized_move_if_noexcept_a
  29871. ( this -> _M_impl . _M_start , __position . base ( ) ,
  29872. __new_start , _M_get_Tp_allocator ( ) ) ;
  29873. __new_finish
  29874. = std :: __uninitialized_copy_a ( __first , __last ,
  29875. __new_finish ,
  29876. _M_get_Tp_allocator ( ) ) ;
  29877. __new_finish
  29878. = std :: __uninitialized_move_if_noexcept_a
  29879. ( __position . base ( ) , this -> _M_impl . _M_finish ,
  29880. __new_finish , _M_get_Tp_allocator ( ) ) ;
  29881. }
  29882. catch ( ... )
  29883. {
  29884. std :: _Destroy ( __new_start , __new_finish ,
  29885. _M_get_Tp_allocator ( ) ) ;
  29886. _M_deallocate ( __new_start , __len ) ;
  29887. throw ;
  29888. }
  29889. std :: _Destroy ( this -> _M_impl . _M_start , this -> _M_impl . _M_finish ,
  29890. _M_get_Tp_allocator ( ) ) ;
  29891. _M_deallocate ( this -> _M_impl . _M_start ,
  29892. this -> _M_impl . _M_end_of_storage
  29893. - this -> _M_impl . _M_start ) ;
  29894. this -> _M_impl . _M_start = __new_start ;
  29895. this -> _M_impl . _M_finish = __new_finish ;
  29896. this -> _M_impl . _M_end_of_storage = __new_start + __len ;
  29897. }
  29898. }
  29899. }
  29900.  
  29901.  
  29902.  
  29903. template < typename _Alloc >
  29904. void
  29905. vector < bool , _Alloc > ::
  29906. _M_reallocate ( size_type __n )
  29907. {
  29908. _Bit_type * __q = this -> _M_allocate ( __n ) ;
  29909. this -> _M_impl . _M_finish = _M_copy_aligned ( begin ( ) , end ( ) ,
  29910. iterator ( __q , 0 ) ) ;
  29911. this -> _M_deallocate ( ) ;
  29912. this -> _M_impl . _M_start = iterator ( __q , 0 ) ;
  29913. this -> _M_impl . _M_end_of_storage = __q + _S_nword ( __n ) ;
  29914. }
  29915.  
  29916. template < typename _Alloc >
  29917. void
  29918. vector < bool , _Alloc > ::
  29919. _M_fill_insert ( iterator __position , size_type __n , bool __x )
  29920. {
  29921. if ( __n == 0 )
  29922. return ;
  29923. if ( capacity ( ) - size ( ) >= __n )
  29924. {
  29925. std :: copy_backward ( __position , end ( ) ,
  29926. this -> _M_impl . _M_finish + difference_type ( __n ) ) ;
  29927. std :: fill ( __position , __position + difference_type ( __n ) , __x ) ;
  29928. this -> _M_impl . _M_finish += difference_type ( __n ) ;
  29929. }
  29930. else
  29931. {
  29932. const size_type __len =
  29933. _M_check_len ( __n , "vector<bool>::_M_fill_insert" ) ;
  29934. _Bit_type * __q = this -> _M_allocate ( __len ) ;
  29935. iterator __i = _M_copy_aligned ( begin ( ) , __position ,
  29936. iterator ( __q , 0 ) ) ;
  29937. std :: fill ( __i , __i + difference_type ( __n ) , __x ) ;
  29938. this -> _M_impl . _M_finish = std :: copy ( __position , end ( ) ,
  29939. __i + difference_type ( __n ) ) ;
  29940. this -> _M_deallocate ( ) ;
  29941. this -> _M_impl . _M_end_of_storage = __q + _S_nword ( __len ) ;
  29942. this -> _M_impl . _M_start = iterator ( __q , 0 ) ;
  29943. }
  29944. }
  29945.  
  29946. template < typename _Alloc >
  29947. template < typename _ForwardIterator >
  29948. void
  29949. vector < bool , _Alloc > ::
  29950. _M_insert_range ( iterator __position , _ForwardIterator __first ,
  29951. _ForwardIterator __last , std :: forward_iterator_tag )
  29952. {
  29953. if ( __first != __last )
  29954. {
  29955. size_type __n = std :: distance ( __first , __last ) ;
  29956. if ( capacity ( ) - size ( ) >= __n )
  29957. {
  29958. std :: copy_backward ( __position , end ( ) ,
  29959. this -> _M_impl . _M_finish
  29960. + difference_type ( __n ) ) ;
  29961. std :: copy ( __first , __last , __position ) ;
  29962. this -> _M_impl . _M_finish += difference_type ( __n ) ;
  29963. }
  29964. else
  29965. {
  29966. const size_type __len =
  29967. _M_check_len ( __n , "vector<bool>::_M_insert_range" ) ;
  29968. _Bit_type * __q = this -> _M_allocate ( __len ) ;
  29969. iterator __i = _M_copy_aligned ( begin ( ) , __position ,
  29970. iterator ( __q , 0 ) ) ;
  29971. __i = std :: copy ( __first , __last , __i ) ;
  29972. this -> _M_impl . _M_finish = std :: copy ( __position , end ( ) , __i ) ;
  29973. this -> _M_deallocate ( ) ;
  29974. this -> _M_impl . _M_end_of_storage = __q + _S_nword ( __len ) ;
  29975. this -> _M_impl . _M_start = iterator ( __q , 0 ) ;
  29976. }
  29977. }
  29978. }
  29979.  
  29980. template < typename _Alloc >
  29981. void
  29982. vector < bool , _Alloc > ::
  29983. _M_insert_aux ( iterator __position , bool __x )
  29984. {
  29985. if ( this -> _M_impl . _M_finish . _M_p != this -> _M_impl . _M_end_of_storage )
  29986. {
  29987. std :: copy_backward ( __position , this -> _M_impl . _M_finish ,
  29988. this -> _M_impl . _M_finish + 1 ) ;
  29989. * __position = __x ;
  29990. ++ this -> _M_impl . _M_finish ;
  29991. }
  29992. else
  29993. {
  29994. const size_type __len =
  29995. _M_check_len ( size_type ( 1 ) , "vector<bool>::_M_insert_aux" ) ;
  29996. _Bit_type * __q = this -> _M_allocate ( __len ) ;
  29997. iterator __i = _M_copy_aligned ( begin ( ) , __position ,
  29998. iterator ( __q , 0 ) ) ;
  29999. * __i ++ = __x ;
  30000. this -> _M_impl . _M_finish = std :: copy ( __position , end ( ) , __i ) ;
  30001. this -> _M_deallocate ( ) ;
  30002. this -> _M_impl . _M_end_of_storage = __q + _S_nword ( __len ) ;
  30003. this -> _M_impl . _M_start = iterator ( __q , 0 ) ;
  30004. }
  30005. }
  30006.  
  30007.  
  30008. template < typename _Alloc >
  30009. bool
  30010. vector < bool , _Alloc > ::
  30011. _M_shrink_to_fit ( )
  30012. {
  30013. if ( capacity ( ) - size ( ) < int ( _S_word_bit ) )
  30014. return false ;
  30015. try
  30016. {
  30017. _M_reallocate ( size ( ) ) ;
  30018. return true ;
  30019. }
  30020. catch ( ... )
  30021. { return false ; }
  30022. }
  30023.  
  30024.  
  30025.  
  30026. }
  30027.  
  30028.  
  30029.  
  30030. namespace std
  30031. {
  30032.  
  30033.  
  30034. template < typename _Alloc >
  30035. size_t
  30036. hash < std :: vector < bool , _Alloc >> ::
  30037. operator ( ) ( const std :: vector < bool , _Alloc > & __b ) const noexcept
  30038. {
  30039. size_t __hash = 0 ;
  30040. using std :: _S_word_bit ;
  30041. using std :: _Bit_type ;
  30042.  
  30043. const size_t __words = __b . size ( ) / _S_word_bit ;
  30044. if ( __words )
  30045. {
  30046. const size_t __clength = __words * sizeof ( _Bit_type ) ;
  30047. __hash = std :: _Hash_impl :: hash ( __b . _M_impl . _M_start . _M_p , __clength ) ;
  30048. }
  30049.  
  30050. const size_t __extrabits = __b . size ( ) % _S_word_bit ;
  30051. if ( __extrabits )
  30052. {
  30053. _Bit_type __hiword = * __b . _M_impl . _M_finish . _M_p ;
  30054. __hiword &= ~ ( ( ~ static_cast < _Bit_type > ( 0 ) ) << __extrabits ) ;
  30055.  
  30056. const size_t __clength
  30057. = ( __extrabits + 8 - 1 ) / 8 ;
  30058. if ( __words )
  30059. __hash = std :: _Hash_impl :: hash ( & __hiword , __clength , __hash ) ;
  30060. else
  30061. __hash = std :: _Hash_impl :: hash ( & __hiword , __clength ) ;
  30062. }
  30063.  
  30064. return __hash ;
  30065. }
  30066.  
  30067.  
  30068. }
  30069. #36 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/random.h"
  30070. namespace std
  30071. {
  30072. #55
  30073. template < typename _RealType , size_t __bits ,
  30074. typename _UniformRandomNumberGenerator >
  30075. _RealType
  30076. generate_canonical ( _UniformRandomNumberGenerator & __g ) ;
  30077. #65
  30078. namespace __detail
  30079. {
  30080.  
  30081.  
  30082. template < typename _UIntType , size_t __w ,
  30083. bool = __w < static_cast < size_t >
  30084. ( std :: numeric_limits < _UIntType > :: digits ) >
  30085. struct _Shift
  30086. { static const _UIntType __value = 0 ; } ;
  30087.  
  30088. template < typename _UIntType , size_t __w >
  30089. struct _Shift < _UIntType , __w , true >
  30090. { static const _UIntType __value = _UIntType ( 1 ) << __w ; } ;
  30091.  
  30092. template < int __s ,
  30093. int __which = ( ( __s <= 8 * sizeof ( int ) )
  30094. + ( __s <= 8 * sizeof ( long ) )
  30095. + ( __s <= 8 * sizeof ( long long ) )
  30096.  
  30097. + ( __s <= 128 ) ) >
  30098. struct _Select_uint_least_t
  30099. {
  30100. static_assert ( __which < 0 ,
  30101. "sorry, would be too much trouble for a slow result" ) ;
  30102. } ;
  30103.  
  30104. template < int __s >
  30105. struct _Select_uint_least_t < __s , 4 >
  30106. { typedef unsigned int type ; } ;
  30107.  
  30108. template < int __s >
  30109. struct _Select_uint_least_t < __s , 3 >
  30110. { typedef unsigned long type ; } ;
  30111.  
  30112. template < int __s >
  30113. struct _Select_uint_least_t < __s , 2 >
  30114. { typedef unsigned long long type ; } ;
  30115. #110
  30116. template < typename _Tp , _Tp __m , _Tp __a , _Tp __c ,
  30117. bool __big_enough = ( ! ( __m & ( __m - 1 ) )
  30118. || ( _Tp ( - 1 ) - __c ) / __a >= __m - 1 ) ,
  30119. bool __schrage_ok = __m % __a < __m / __a >
  30120. struct _Mod
  30121. {
  30122. typedef typename _Select_uint_least_t < std :: __lg ( __a )
  30123. + std :: __lg ( __m ) + 2 > :: type _Tp2 ;
  30124. static _Tp
  30125. __calc ( _Tp __x )
  30126. { return static_cast < _Tp > ( ( _Tp2 ( __a ) * __x + __c ) % __m ) ; }
  30127. } ;
  30128.  
  30129.  
  30130. template < typename _Tp , _Tp __m , _Tp __a , _Tp __c >
  30131. struct _Mod < _Tp , __m , __a , __c , false , true >
  30132. {
  30133. static _Tp
  30134. __calc ( _Tp __x ) ;
  30135. } ;
  30136.  
  30137.  
  30138.  
  30139.  
  30140. template < typename _Tp , _Tp __m , _Tp __a , _Tp __c , bool __s >
  30141. struct _Mod < _Tp , __m , __a , __c , true , __s >
  30142. {
  30143. static _Tp
  30144. __calc ( _Tp __x )
  30145. {
  30146. _Tp __res = __a * __x + __c ;
  30147. if ( __m )
  30148. __res %= __m ;
  30149. return __res ;
  30150. }
  30151. } ;
  30152.  
  30153. template < typename _Tp , _Tp __m , _Tp __a = 1 , _Tp __c = 0 >
  30154. inline _Tp
  30155. __mod ( _Tp __x )
  30156. { return _Mod < _Tp , __m , __a , __c > :: __calc ( __x ) ; }
  30157.  
  30158.  
  30159. template < typename _Tp >
  30160. inline bool
  30161. _Power_of_2 ( _Tp __x )
  30162. {
  30163. return ( ( __x - 1 ) & __x ) == 0 ;
  30164. } ;
  30165.  
  30166.  
  30167.  
  30168.  
  30169.  
  30170. template < typename _Engine , typename _DInputType >
  30171. struct _Adaptor
  30172. {
  30173.  
  30174. public :
  30175. _Adaptor ( _Engine & __g )
  30176. : _M_g ( __g ) { }
  30177.  
  30178. _DInputType
  30179. min ( ) const
  30180. { return _DInputType ( 0 ) ; }
  30181.  
  30182. _DInputType
  30183. max ( ) const
  30184. { return _DInputType ( 1 ) ; }
  30185. #185
  30186. _DInputType
  30187. operator ( ) ( )
  30188. {
  30189. return std :: generate_canonical < _DInputType ,
  30190. std :: numeric_limits < _DInputType > :: digits ,
  30191. _Engine > ( _M_g ) ;
  30192. }
  30193.  
  30194. private :
  30195. _Engine & _M_g ;
  30196. } ;
  30197.  
  30198.  
  30199. }
  30200. #240
  30201. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  30202. class linear_congruential_engine
  30203. {
  30204. static_assert ( std :: is_unsigned < _UIntType > :: value , "template argument "
  30205. "substituting _UIntType not an unsigned integral type" ) ;
  30206. static_assert ( __m == 0u || ( __a < __m && __c < __m ) ,
  30207. "template argument substituting __m out of bounds" ) ;
  30208.  
  30209. public :
  30210.  
  30211. typedef _UIntType result_type ;
  30212.  
  30213.  
  30214. static constexpr result_type multiplier = __a ;
  30215.  
  30216. static constexpr result_type increment = __c ;
  30217.  
  30218. static constexpr result_type modulus = __m ;
  30219. static constexpr result_type default_seed = 1u ;
  30220. #267
  30221. explicit
  30222. linear_congruential_engine ( result_type __s = default_seed )
  30223. { seed ( __s ) ; }
  30224. #277
  30225. template < typename _Sseq , typename = typename
  30226. std :: enable_if < ! std :: is_same < _Sseq , linear_congruential_engine > :: value >
  30227. :: type >
  30228. explicit
  30229. linear_congruential_engine ( _Sseq & __q )
  30230. { seed ( __q ) ; }
  30231. #290
  30232. void
  30233. seed ( result_type __s = default_seed ) ;
  30234. #300
  30235. template < typename _Sseq >
  30236. typename std :: enable_if < std :: is_class < _Sseq > :: value > :: type
  30237. seed ( _Sseq & __q ) ;
  30238. #310
  30239. static constexpr result_type
  30240. min ( )
  30241. { return __c == 0u ? 1u : 0u ; }
  30242.  
  30243.  
  30244.  
  30245.  
  30246. static constexpr result_type
  30247. max ( )
  30248. { return __m - 1u ; }
  30249.  
  30250.  
  30251.  
  30252.  
  30253. void
  30254. discard ( unsigned long long __z )
  30255. {
  30256. for ( ; __z != 0ULL ; -- __z )
  30257. ( * this ) ( ) ;
  30258. }
  30259.  
  30260.  
  30261.  
  30262.  
  30263. result_type
  30264. operator ( ) ( )
  30265. {
  30266. _M_x = __detail :: __mod < _UIntType , __m , __a , __c > ( _M_x ) ;
  30267. return _M_x ;
  30268. }
  30269. #352
  30270. friend bool
  30271. operator == ( const linear_congruential_engine & __lhs ,
  30272. const linear_congruential_engine & __rhs )
  30273. { return __lhs . _M_x == __rhs . _M_x ; }
  30274. #365
  30275. template < typename _UIntType1 , _UIntType1 __a1 , _UIntType1 __c1 ,
  30276. _UIntType1 __m1 , typename _CharT , typename _Traits >
  30277. friend std :: basic_ostream < _CharT , _Traits > &
  30278. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  30279. const std :: linear_congruential_engine < _UIntType1 ,
  30280. __a1 , __c1 , __m1 > & __lcr ) ;
  30281. #385
  30282. template < typename _UIntType1 , _UIntType1 __a1 , _UIntType1 __c1 ,
  30283. _UIntType1 __m1 , typename _CharT , typename _Traits >
  30284. friend std :: basic_istream < _CharT , _Traits > &
  30285. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  30286. std :: linear_congruential_engine < _UIntType1 , __a1 ,
  30287. __c1 , __m1 > & __lcr ) ;
  30288.  
  30289. private :
  30290. _UIntType _M_x ;
  30291. } ;
  30292. #407
  30293. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  30294. inline bool
  30295. operator != ( const std :: linear_congruential_engine < _UIntType , __a ,
  30296. __c , __m > & __lhs ,
  30297. const std :: linear_congruential_engine < _UIntType , __a ,
  30298. __c , __m > & __rhs )
  30299. { return ! ( __lhs == __rhs ) ; }
  30300. #444
  30301. template < typename _UIntType , size_t __w ,
  30302. size_t __n , size_t __m , size_t __r ,
  30303. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  30304. _UIntType __b , size_t __t ,
  30305. _UIntType __c , size_t __l , _UIntType __f >
  30306. class mersenne_twister_engine
  30307. {
  30308. static_assert ( std :: is_unsigned < _UIntType > :: value , "template argument "
  30309. "substituting _UIntType not an unsigned integral type" ) ;
  30310. static_assert ( 1u <= __m && __m <= __n ,
  30311. "template argument substituting __m out of bounds" ) ;
  30312. static_assert ( __r <= __w , "template argument substituting "
  30313. "__r out of bound" ) ;
  30314. static_assert ( __u <= __w , "template argument substituting "
  30315. "__u out of bound" ) ;
  30316. static_assert ( __s <= __w , "template argument substituting "
  30317. "__s out of bound" ) ;
  30318. static_assert ( __t <= __w , "template argument substituting "
  30319. "__t out of bound" ) ;
  30320. static_assert ( __l <= __w , "template argument substituting "
  30321. "__l out of bound" ) ;
  30322. static_assert ( __w <= std :: numeric_limits < _UIntType > :: digits ,
  30323. "template argument substituting __w out of bound" ) ;
  30324. static_assert ( __a <= ( __detail :: _Shift < _UIntType , __w > :: __value - 1 ) ,
  30325. "template argument substituting __a out of bound" ) ;
  30326. static_assert ( __b <= ( __detail :: _Shift < _UIntType , __w > :: __value - 1 ) ,
  30327. "template argument substituting __b out of bound" ) ;
  30328. static_assert ( __c <= ( __detail :: _Shift < _UIntType , __w > :: __value - 1 ) ,
  30329. "template argument substituting __c out of bound" ) ;
  30330. static_assert ( __d <= ( __detail :: _Shift < _UIntType , __w > :: __value - 1 ) ,
  30331. "template argument substituting __d out of bound" ) ;
  30332. static_assert ( __f <= ( __detail :: _Shift < _UIntType , __w > :: __value - 1 ) ,
  30333. "template argument substituting __f out of bound" ) ;
  30334.  
  30335. public :
  30336.  
  30337. typedef _UIntType result_type ;
  30338.  
  30339.  
  30340. static constexpr size_t word_size = __w ;
  30341. static constexpr size_t state_size = __n ;
  30342. static constexpr size_t shift_size = __m ;
  30343. static constexpr size_t mask_bits = __r ;
  30344. static constexpr result_type xor_mask = __a ;
  30345. static constexpr size_t tempering_u = __u ;
  30346. static constexpr result_type tempering_d = __d ;
  30347. static constexpr size_t tempering_s = __s ;
  30348. static constexpr result_type tempering_b = __b ;
  30349. static constexpr size_t tempering_t = __t ;
  30350. static constexpr result_type tempering_c = __c ;
  30351. static constexpr size_t tempering_l = __l ;
  30352. static constexpr result_type initialization_multiplier = __f ;
  30353. static constexpr result_type default_seed = 5489u ;
  30354.  
  30355.  
  30356. explicit
  30357. mersenne_twister_engine ( result_type __sd = default_seed )
  30358. { seed ( __sd ) ; }
  30359. #509
  30360. template < typename _Sseq , typename = typename
  30361. std :: enable_if < ! std :: is_same < _Sseq , mersenne_twister_engine > :: value >
  30362. :: type >
  30363. explicit
  30364. mersenne_twister_engine ( _Sseq & __q )
  30365. { seed ( __q ) ; }
  30366.  
  30367. void
  30368. seed ( result_type __sd = default_seed ) ;
  30369.  
  30370. template < typename _Sseq >
  30371. typename std :: enable_if < std :: is_class < _Sseq > :: value > :: type
  30372. seed ( _Sseq & __q ) ;
  30373.  
  30374.  
  30375.  
  30376.  
  30377. static constexpr result_type
  30378. min ( )
  30379. { return 0 ; } ;
  30380.  
  30381.  
  30382.  
  30383.  
  30384. static constexpr result_type
  30385. max ( )
  30386. { return __detail :: _Shift < _UIntType , __w > :: __value - 1 ; }
  30387.  
  30388.  
  30389.  
  30390.  
  30391. void
  30392. discard ( unsigned long long __z ) ;
  30393.  
  30394. result_type
  30395. operator ( ) ( ) ;
  30396. #558
  30397. friend bool
  30398. operator == ( const mersenne_twister_engine & __lhs ,
  30399. const mersenne_twister_engine & __rhs )
  30400. { return ( std :: equal ( __lhs . _M_x , __lhs . _M_x + state_size , __rhs . _M_x )
  30401. && __lhs . _M_p == __rhs . _M_p ) ; }
  30402. #576
  30403. template < typename _UIntType1 ,
  30404. size_t __w1 , size_t __n1 ,
  30405. size_t __m1 , size_t __r1 ,
  30406. _UIntType1 __a1 , size_t __u1 ,
  30407. _UIntType1 __d1 , size_t __s1 ,
  30408. _UIntType1 __b1 , size_t __t1 ,
  30409. _UIntType1 __c1 , size_t __l1 , _UIntType1 __f1 ,
  30410. typename _CharT , typename _Traits >
  30411. friend std :: basic_ostream < _CharT , _Traits > &
  30412. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  30413. const std :: mersenne_twister_engine < _UIntType1 , __w1 , __n1 ,
  30414. __m1 , __r1 , __a1 , __u1 , __d1 , __s1 , __b1 , __t1 , __c1 ,
  30415. __l1 , __f1 > & __x ) ;
  30416. #602
  30417. template < typename _UIntType1 ,
  30418. size_t __w1 , size_t __n1 ,
  30419. size_t __m1 , size_t __r1 ,
  30420. _UIntType1 __a1 , size_t __u1 ,
  30421. _UIntType1 __d1 , size_t __s1 ,
  30422. _UIntType1 __b1 , size_t __t1 ,
  30423. _UIntType1 __c1 , size_t __l1 , _UIntType1 __f1 ,
  30424. typename _CharT , typename _Traits >
  30425. friend std :: basic_istream < _CharT , _Traits > &
  30426. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  30427. std :: mersenne_twister_engine < _UIntType1 , __w1 , __n1 , __m1 ,
  30428. __r1 , __a1 , __u1 , __d1 , __s1 , __b1 , __t1 , __c1 ,
  30429. __l1 , __f1 > & __x ) ;
  30430.  
  30431. private :
  30432. void _M_gen_rand ( ) ;
  30433.  
  30434. _UIntType _M_x [ state_size ] ;
  30435. size_t _M_p ;
  30436. } ;
  30437. #635
  30438. template < typename _UIntType , size_t __w ,
  30439. size_t __n , size_t __m , size_t __r ,
  30440. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  30441. _UIntType __b , size_t __t ,
  30442. _UIntType __c , size_t __l , _UIntType __f >
  30443. inline bool
  30444. operator != ( const std :: mersenne_twister_engine < _UIntType , __w , __n , __m ,
  30445. __r , __a , __u , __d , __s , __b , __t , __c , __l , __f > & __lhs ,
  30446. const std :: mersenne_twister_engine < _UIntType , __w , __n , __m ,
  30447. __r , __a , __u , __d , __s , __b , __t , __c , __l , __f > & __rhs )
  30448. { return ! ( __lhs == __rhs ) ; }
  30449. #667
  30450. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  30451. class subtract_with_carry_engine
  30452. {
  30453. static_assert ( std :: is_unsigned < _UIntType > :: value , "template argument "
  30454. "substituting _UIntType not an unsigned integral type" ) ;
  30455. static_assert ( 0u < __s && __s < __r ,
  30456. "template argument substituting __s out of bounds" ) ;
  30457. static_assert ( 0u < __w && __w <= std :: numeric_limits < _UIntType > :: digits ,
  30458. "template argument substituting __w out of bounds" ) ;
  30459.  
  30460. public :
  30461.  
  30462. typedef _UIntType result_type ;
  30463.  
  30464.  
  30465. static constexpr size_t word_size = __w ;
  30466. static constexpr size_t short_lag = __s ;
  30467. static constexpr size_t long_lag = __r ;
  30468. static constexpr result_type default_seed = 19780503u ;
  30469.  
  30470.  
  30471.  
  30472.  
  30473.  
  30474. explicit
  30475. subtract_with_carry_engine ( result_type __sd = default_seed )
  30476. { seed ( __sd ) ; }
  30477. #701
  30478. template < typename _Sseq , typename = typename
  30479. std :: enable_if < ! std :: is_same < _Sseq , subtract_with_carry_engine > :: value >
  30480. :: type >
  30481. explicit
  30482. subtract_with_carry_engine ( _Sseq & __q )
  30483. { seed ( __q ) ; }
  30484. #720
  30485. void
  30486. seed ( result_type __sd = default_seed ) ;
  30487.  
  30488.  
  30489.  
  30490.  
  30491.  
  30492. template < typename _Sseq >
  30493. typename std :: enable_if < std :: is_class < _Sseq > :: value > :: type
  30494. seed ( _Sseq & __q ) ;
  30495.  
  30496.  
  30497.  
  30498.  
  30499.  
  30500. static constexpr result_type
  30501. min ( )
  30502. { return 0 ; }
  30503.  
  30504.  
  30505.  
  30506.  
  30507.  
  30508. static constexpr result_type
  30509. max ( )
  30510. { return __detail :: _Shift < _UIntType , __w > :: __value - 1 ; }
  30511.  
  30512.  
  30513.  
  30514.  
  30515. void
  30516. discard ( unsigned long long __z )
  30517. {
  30518. for ( ; __z != 0ULL ; -- __z )
  30519. ( * this ) ( ) ;
  30520. }
  30521.  
  30522.  
  30523.  
  30524.  
  30525. result_type
  30526. operator ( ) ( ) ;
  30527. #775
  30528. friend bool
  30529. operator == ( const subtract_with_carry_engine & __lhs ,
  30530. const subtract_with_carry_engine & __rhs )
  30531. { return ( std :: equal ( __lhs . _M_x , __lhs . _M_x + long_lag , __rhs . _M_x )
  30532. && __lhs . _M_carry == __rhs . _M_carry
  30533. && __lhs . _M_p == __rhs . _M_p ) ; }
  30534. #794
  30535. template < typename _UIntType1 , size_t __w1 , size_t __s1 , size_t __r1 ,
  30536. typename _CharT , typename _Traits >
  30537. friend std :: basic_ostream < _CharT , _Traits > &
  30538. operator << ( std :: basic_ostream < _CharT , _Traits > & ,
  30539. const std :: subtract_with_carry_engine < _UIntType1 , __w1 ,
  30540. __s1 , __r1 > & ) ;
  30541. #813
  30542. template < typename _UIntType1 , size_t __w1 , size_t __s1 , size_t __r1 ,
  30543. typename _CharT , typename _Traits >
  30544. friend std :: basic_istream < _CharT , _Traits > &
  30545. operator >> ( std :: basic_istream < _CharT , _Traits > & ,
  30546. std :: subtract_with_carry_engine < _UIntType1 , __w1 ,
  30547. __s1 , __r1 > & ) ;
  30548.  
  30549. private :
  30550. _UIntType _M_x [ long_lag ] ;
  30551. _UIntType _M_carry ;
  30552. size_t _M_p ;
  30553. } ;
  30554. #838
  30555. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  30556. inline bool
  30557. operator != ( const std :: subtract_with_carry_engine < _UIntType , __w ,
  30558. __s , __r > & __lhs ,
  30559. const std :: subtract_with_carry_engine < _UIntType , __w ,
  30560. __s , __r > & __rhs )
  30561. { return ! ( __lhs == __rhs ) ; }
  30562. #853
  30563. template < typename _RandomNumberEngine , size_t __p , size_t __r >
  30564. class discard_block_engine
  30565. {
  30566. static_assert ( 1 <= __r && __r <= __p ,
  30567. "template argument substituting __r out of bounds" ) ;
  30568.  
  30569. public :
  30570.  
  30571. typedef typename _RandomNumberEngine :: result_type result_type ;
  30572.  
  30573.  
  30574. static constexpr size_t block_size = __p ;
  30575. static constexpr size_t used_block = __r ;
  30576. #872
  30577. discard_block_engine ( )
  30578. : _M_b ( ) , _M_n ( 0 ) { }
  30579. #881
  30580. explicit
  30581. discard_block_engine ( const _RandomNumberEngine & __rng )
  30582. : _M_b ( __rng ) , _M_n ( 0 ) { }
  30583. #891
  30584. explicit
  30585. discard_block_engine ( _RandomNumberEngine && __rng )
  30586. : _M_b ( std :: move ( __rng ) ) , _M_n ( 0 ) { }
  30587. #901
  30588. explicit
  30589. discard_block_engine ( result_type __s )
  30590. : _M_b ( __s ) , _M_n ( 0 ) { }
  30591. #910
  30592. template < typename _Sseq , typename = typename
  30593. std :: enable_if < ! std :: is_same < _Sseq , discard_block_engine > :: value
  30594. && ! std :: is_same < _Sseq , _RandomNumberEngine > :: value >
  30595. :: type >
  30596. explicit
  30597. discard_block_engine ( _Sseq & __q )
  30598. : _M_b ( __q ) , _M_n ( 0 )
  30599. { }
  30600.  
  30601.  
  30602.  
  30603.  
  30604.  
  30605. void
  30606. seed ( )
  30607. {
  30608. _M_b . seed ( ) ;
  30609. _M_n = 0 ;
  30610. }
  30611.  
  30612.  
  30613.  
  30614.  
  30615.  
  30616. void
  30617. seed ( result_type __s )
  30618. {
  30619. _M_b . seed ( __s ) ;
  30620. _M_n = 0 ;
  30621. }
  30622. #946
  30623. template < typename _Sseq >
  30624. void
  30625. seed ( _Sseq & __q )
  30626. {
  30627. _M_b . seed ( __q ) ;
  30628. _M_n = 0 ;
  30629. }
  30630.  
  30631.  
  30632.  
  30633.  
  30634.  
  30635. const _RandomNumberEngine &
  30636. base ( ) const noexcept
  30637. { return _M_b ; }
  30638.  
  30639.  
  30640.  
  30641.  
  30642. static constexpr result_type
  30643. min ( )
  30644. { return _RandomNumberEngine :: min ( ) ; }
  30645.  
  30646.  
  30647.  
  30648.  
  30649. static constexpr result_type
  30650. max ( )
  30651. { return _RandomNumberEngine :: max ( ) ; }
  30652.  
  30653.  
  30654.  
  30655.  
  30656. void
  30657. discard ( unsigned long long __z )
  30658. {
  30659. for ( ; __z != 0ULL ; -- __z )
  30660. ( * this ) ( ) ;
  30661. }
  30662.  
  30663.  
  30664.  
  30665.  
  30666. result_type
  30667. operator ( ) ( ) ;
  30668. #1003
  30669. friend bool
  30670. operator == ( const discard_block_engine & __lhs ,
  30671. const discard_block_engine & __rhs )
  30672. { return __lhs . _M_b == __rhs . _M_b && __lhs . _M_n == __rhs . _M_n ; }
  30673. #1019
  30674. template < typename _RandomNumberEngine1 , size_t __p1 , size_t __r1 ,
  30675. typename _CharT , typename _Traits >
  30676. friend std :: basic_ostream < _CharT , _Traits > &
  30677. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  30678. const std :: discard_block_engine < _RandomNumberEngine1 ,
  30679. __p1 , __r1 > & __x ) ;
  30680. #1037
  30681. template < typename _RandomNumberEngine1 , size_t __p1 , size_t __r1 ,
  30682. typename _CharT , typename _Traits >
  30683. friend std :: basic_istream < _CharT , _Traits > &
  30684. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  30685. std :: discard_block_engine < _RandomNumberEngine1 ,
  30686. __p1 , __r1 > & __x ) ;
  30687.  
  30688. private :
  30689. _RandomNumberEngine _M_b ;
  30690. size_t _M_n ;
  30691. } ;
  30692. #1060
  30693. template < typename _RandomNumberEngine , size_t __p , size_t __r >
  30694. inline bool
  30695. operator != ( const std :: discard_block_engine < _RandomNumberEngine , __p ,
  30696. __r > & __lhs ,
  30697. const std :: discard_block_engine < _RandomNumberEngine , __p ,
  30698. __r > & __rhs )
  30699. { return ! ( __lhs == __rhs ) ; }
  30700. #1073
  30701. template < typename _RandomNumberEngine , size_t __w , typename _UIntType >
  30702. class independent_bits_engine
  30703. {
  30704. static_assert ( std :: is_unsigned < _UIntType > :: value , "template argument "
  30705. "substituting _UIntType not an unsigned integral type" ) ;
  30706. static_assert ( 0u < __w && __w <= std :: numeric_limits < _UIntType > :: digits ,
  30707. "template argument substituting __w out of bounds" ) ;
  30708.  
  30709. public :
  30710.  
  30711. typedef _UIntType result_type ;
  30712. #1090
  30713. independent_bits_engine ( )
  30714. : _M_b ( ) { }
  30715. #1099
  30716. explicit
  30717. independent_bits_engine ( const _RandomNumberEngine & __rng )
  30718. : _M_b ( __rng ) { }
  30719. #1109
  30720. explicit
  30721. independent_bits_engine ( _RandomNumberEngine && __rng )
  30722. : _M_b ( std :: move ( __rng ) ) { }
  30723. #1119
  30724. explicit
  30725. independent_bits_engine ( result_type __s )
  30726. : _M_b ( __s ) { }
  30727. #1128
  30728. template < typename _Sseq , typename = typename
  30729. std :: enable_if < ! std :: is_same < _Sseq , independent_bits_engine > :: value
  30730. && ! std :: is_same < _Sseq , _RandomNumberEngine > :: value >
  30731. :: type >
  30732. explicit
  30733. independent_bits_engine ( _Sseq & __q )
  30734. : _M_b ( __q )
  30735. { }
  30736.  
  30737.  
  30738.  
  30739.  
  30740.  
  30741. void
  30742. seed ( )
  30743. { _M_b . seed ( ) ; }
  30744.  
  30745.  
  30746.  
  30747.  
  30748.  
  30749. void
  30750. seed ( result_type __s )
  30751. { _M_b . seed ( __s ) ; }
  30752. #1158
  30753. template < typename _Sseq >
  30754. void
  30755. seed ( _Sseq & __q )
  30756. { _M_b . seed ( __q ) ; }
  30757.  
  30758.  
  30759.  
  30760.  
  30761.  
  30762. const _RandomNumberEngine &
  30763. base ( ) const noexcept
  30764. { return _M_b ; }
  30765.  
  30766.  
  30767.  
  30768.  
  30769. static constexpr result_type
  30770. min ( )
  30771. { return 0U ; }
  30772.  
  30773.  
  30774.  
  30775.  
  30776. static constexpr result_type
  30777. max ( )
  30778. { return __detail :: _Shift < _UIntType , __w > :: __value - 1 ; }
  30779.  
  30780.  
  30781.  
  30782.  
  30783. void
  30784. discard ( unsigned long long __z )
  30785. {
  30786. for ( ; __z != 0ULL ; -- __z )
  30787. ( * this ) ( ) ;
  30788. }
  30789.  
  30790.  
  30791.  
  30792.  
  30793. result_type
  30794. operator ( ) ( ) ;
  30795. #1213
  30796. friend bool
  30797. operator == ( const independent_bits_engine & __lhs ,
  30798. const independent_bits_engine & __rhs )
  30799. { return __lhs . _M_b == __rhs . _M_b ; }
  30800. #1230
  30801. template < typename _CharT , typename _Traits >
  30802. friend std :: basic_istream < _CharT , _Traits > &
  30803. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  30804. std :: independent_bits_engine < _RandomNumberEngine ,
  30805. __w , _UIntType > & __x )
  30806. {
  30807. __is >> __x . _M_b ;
  30808. return __is ;
  30809. }
  30810.  
  30811. private :
  30812. _RandomNumberEngine _M_b ;
  30813. } ;
  30814. #1256
  30815. template < typename _RandomNumberEngine , size_t __w , typename _UIntType >
  30816. inline bool
  30817. operator != ( const std :: independent_bits_engine < _RandomNumberEngine , __w ,
  30818. _UIntType > & __lhs ,
  30819. const std :: independent_bits_engine < _RandomNumberEngine , __w ,
  30820. _UIntType > & __rhs )
  30821. { return ! ( __lhs == __rhs ) ; }
  30822. #1274
  30823. template < typename _RandomNumberEngine , size_t __w , typename _UIntType ,
  30824. typename _CharT , typename _Traits >
  30825. std :: basic_ostream < _CharT , _Traits > &
  30826. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  30827. const std :: independent_bits_engine < _RandomNumberEngine ,
  30828. __w , _UIntType > & __x )
  30829. {
  30830. __os << __x . base ( ) ;
  30831. return __os ;
  30832. }
  30833. #1291
  30834. template < typename _RandomNumberEngine , size_t __k >
  30835. class shuffle_order_engine
  30836. {
  30837. static_assert ( 1u <= __k , "template argument substituting "
  30838. "__k out of bound" ) ;
  30839.  
  30840. public :
  30841.  
  30842. typedef typename _RandomNumberEngine :: result_type result_type ;
  30843.  
  30844. static constexpr size_t table_size = __k ;
  30845. #1308
  30846. shuffle_order_engine ( )
  30847. : _M_b ( )
  30848. { _M_initialize ( ) ; }
  30849. #1318
  30850. explicit
  30851. shuffle_order_engine ( const _RandomNumberEngine & __rng )
  30852. : _M_b ( __rng )
  30853. { _M_initialize ( ) ; }
  30854. #1329
  30855. explicit
  30856. shuffle_order_engine ( _RandomNumberEngine && __rng )
  30857. : _M_b ( std :: move ( __rng ) )
  30858. { _M_initialize ( ) ; }
  30859. #1340
  30860. explicit
  30861. shuffle_order_engine ( result_type __s )
  30862. : _M_b ( __s )
  30863. { _M_initialize ( ) ; }
  30864. #1350
  30865. template < typename _Sseq , typename = typename
  30866. std :: enable_if < ! std :: is_same < _Sseq , shuffle_order_engine > :: value
  30867. && ! std :: is_same < _Sseq , _RandomNumberEngine > :: value >
  30868. :: type >
  30869. explicit
  30870. shuffle_order_engine ( _Sseq & __q )
  30871. : _M_b ( __q )
  30872. { _M_initialize ( ) ; }
  30873.  
  30874.  
  30875.  
  30876.  
  30877.  
  30878. void
  30879. seed ( )
  30880. {
  30881. _M_b . seed ( ) ;
  30882. _M_initialize ( ) ;
  30883. }
  30884.  
  30885.  
  30886.  
  30887.  
  30888.  
  30889. void
  30890. seed ( result_type __s )
  30891. {
  30892. _M_b . seed ( __s ) ;
  30893. _M_initialize ( ) ;
  30894. }
  30895. #1386
  30896. template < typename _Sseq >
  30897. void
  30898. seed ( _Sseq & __q )
  30899. {
  30900. _M_b . seed ( __q ) ;
  30901. _M_initialize ( ) ;
  30902. }
  30903.  
  30904.  
  30905.  
  30906.  
  30907. const _RandomNumberEngine &
  30908. base ( ) const noexcept
  30909. { return _M_b ; }
  30910.  
  30911.  
  30912.  
  30913.  
  30914. static constexpr result_type
  30915. min ( )
  30916. { return _RandomNumberEngine :: min ( ) ; }
  30917.  
  30918.  
  30919.  
  30920.  
  30921. static constexpr result_type
  30922. max ( )
  30923. { return _RandomNumberEngine :: max ( ) ; }
  30924.  
  30925.  
  30926.  
  30927.  
  30928. void
  30929. discard ( unsigned long long __z )
  30930. {
  30931. for ( ; __z != 0ULL ; -- __z )
  30932. ( * this ) ( ) ;
  30933. }
  30934.  
  30935.  
  30936.  
  30937.  
  30938. result_type
  30939. operator ( ) ( ) ;
  30940. #1442
  30941. friend bool
  30942. operator == ( const shuffle_order_engine & __lhs ,
  30943. const shuffle_order_engine & __rhs )
  30944. { return ( __lhs . _M_b == __rhs . _M_b
  30945. && std :: equal ( __lhs . _M_v , __lhs . _M_v + __k , __rhs . _M_v )
  30946. && __lhs . _M_y == __rhs . _M_y ) ; }
  30947. #1460
  30948. template < typename _RandomNumberEngine1 , size_t __k1 ,
  30949. typename _CharT , typename _Traits >
  30950. friend std :: basic_ostream < _CharT , _Traits > &
  30951. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  30952. const std :: shuffle_order_engine < _RandomNumberEngine1 ,
  30953. __k1 > & __x ) ;
  30954. #1478
  30955. template < typename _RandomNumberEngine1 , size_t __k1 ,
  30956. typename _CharT , typename _Traits >
  30957. friend std :: basic_istream < _CharT , _Traits > &
  30958. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  30959. std :: shuffle_order_engine < _RandomNumberEngine1 , __k1 > & __x ) ;
  30960.  
  30961. private :
  30962. void _M_initialize ( )
  30963. {
  30964. for ( size_t __i = 0 ; __i < __k ; ++ __i )
  30965. _M_v [ __i ] = _M_b ( ) ;
  30966. _M_y = _M_b ( ) ;
  30967. }
  30968.  
  30969. _RandomNumberEngine _M_b ;
  30970. result_type _M_v [ __k ] ;
  30971. result_type _M_y ;
  30972. } ;
  30973. #1508
  30974. template < typename _RandomNumberEngine , size_t __k >
  30975. inline bool
  30976. operator != ( const std :: shuffle_order_engine < _RandomNumberEngine ,
  30977. __k > & __lhs ,
  30978. const std :: shuffle_order_engine < _RandomNumberEngine ,
  30979. __k > & __rhs )
  30980. { return ! ( __lhs == __rhs ) ; }
  30981.  
  30982.  
  30983.  
  30984.  
  30985.  
  30986. typedef linear_congruential_engine < uint_fast32_t , 16807UL , 0UL , 2147483647UL >
  30987. minstd_rand0 ;
  30988.  
  30989.  
  30990.  
  30991.  
  30992. typedef linear_congruential_engine < uint_fast32_t , 48271UL , 0UL , 2147483647UL >
  30993. minstd_rand ;
  30994. #1537
  30995. typedef mersenne_twister_engine <
  30996. uint_fast32_t ,
  30997. 32 , 624 , 397 , 31 ,
  30998. 0x9908b0dfUL , 11 ,
  30999. 0xffffffffUL , 7 ,
  31000. 0x9d2c5680UL , 15 ,
  31001. 0xefc60000UL , 18 , 1812433253UL > mt19937 ;
  31002.  
  31003.  
  31004.  
  31005.  
  31006. typedef mersenne_twister_engine <
  31007. uint_fast64_t ,
  31008. 64 , 312 , 156 , 31 ,
  31009. 0xb5026f5aa96619e9ULL , 29 ,
  31010. 0x5555555555555555ULL , 17 ,
  31011. 0x71d67fffeda60000ULL , 37 ,
  31012. 0xfff7eee000000000ULL , 43 ,
  31013. 6364136223846793005ULL > mt19937_64 ;
  31014.  
  31015. typedef subtract_with_carry_engine < uint_fast32_t , 24 , 10 , 24 >
  31016. ranlux24_base ;
  31017.  
  31018. typedef subtract_with_carry_engine < uint_fast64_t , 48 , 5 , 12 >
  31019. ranlux48_base ;
  31020.  
  31021. typedef discard_block_engine < ranlux24_base , 223 , 23 > ranlux24 ;
  31022.  
  31023. typedef discard_block_engine < ranlux48_base , 389 , 11 > ranlux48 ;
  31024.  
  31025. typedef shuffle_order_engine < minstd_rand0 , 256 > knuth_b ;
  31026.  
  31027. typedef minstd_rand0 default_random_engine ;
  31028.  
  31029.  
  31030.  
  31031.  
  31032.  
  31033. class random_device
  31034. {
  31035. public :
  31036.  
  31037. typedef unsigned int result_type ;
  31038.  
  31039.  
  31040.  
  31041.  
  31042.  
  31043. explicit
  31044. random_device ( const std :: string & __token = "default" )
  31045. {
  31046. _M_init ( __token ) ;
  31047. }
  31048.  
  31049. ~ random_device ( )
  31050. { _M_fini ( ) ; }
  31051. #1604
  31052. static constexpr result_type
  31053. min ( )
  31054. { return std :: numeric_limits < result_type > :: min ( ) ; }
  31055.  
  31056. static constexpr result_type
  31057. max ( )
  31058. { return std :: numeric_limits < result_type > :: max ( ) ; }
  31059.  
  31060. double
  31061. entropy ( ) const noexcept
  31062. { return 0.0 ; }
  31063.  
  31064. result_type
  31065. operator ( ) ( )
  31066. {
  31067.  
  31068. return this -> _M_getval ( ) ;
  31069.  
  31070.  
  31071.  
  31072. }
  31073.  
  31074.  
  31075. random_device ( const random_device & ) = delete ;
  31076. void operator = ( const random_device & ) = delete ;
  31077.  
  31078. private :
  31079.  
  31080. void _M_init ( const std :: string & __token ) ;
  31081. void _M_init_pretr1 ( const std :: string & __token ) ;
  31082. void _M_fini ( ) ;
  31083.  
  31084. result_type _M_getval ( ) ;
  31085. result_type _M_getval_pretr1 ( ) ;
  31086.  
  31087. union
  31088. {
  31089. FILE * _M_file ;
  31090. mt19937 _M_mt ;
  31091. } ;
  31092. } ;
  31093. #1665
  31094. template < typename _IntType = int >
  31095. class uniform_int_distribution
  31096. {
  31097. static_assert ( std :: is_integral < _IntType > :: value ,
  31098. "template argument not an integral type" ) ;
  31099.  
  31100. public :
  31101.  
  31102. typedef _IntType result_type ;
  31103.  
  31104. struct param_type
  31105. {
  31106. typedef uniform_int_distribution < _IntType > distribution_type ;
  31107.  
  31108. explicit
  31109. param_type ( _IntType __a = 0 ,
  31110. _IntType __b = std :: numeric_limits < _IntType > :: max ( ) )
  31111. : _M_a ( __a ) , _M_b ( __b )
  31112. {
  31113. ;
  31114. }
  31115.  
  31116. result_type
  31117. a ( ) const
  31118. { return _M_a ; }
  31119.  
  31120. result_type
  31121. b ( ) const
  31122. { return _M_b ; }
  31123.  
  31124. friend bool
  31125. operator == ( const param_type & __p1 , const param_type & __p2 )
  31126. { return __p1 . _M_a == __p2 . _M_a && __p1 . _M_b == __p2 . _M_b ; }
  31127.  
  31128. private :
  31129. _IntType _M_a ;
  31130. _IntType _M_b ;
  31131. } ;
  31132.  
  31133. public :
  31134.  
  31135.  
  31136.  
  31137. explicit
  31138. uniform_int_distribution ( _IntType __a = 0 ,
  31139. _IntType __b = std :: numeric_limits < _IntType > :: max ( ) )
  31140. : _M_param ( __a , __b )
  31141. { }
  31142.  
  31143. explicit
  31144. uniform_int_distribution ( const param_type & __p )
  31145. : _M_param ( __p )
  31146. { }
  31147. #1724
  31148. void
  31149. reset ( ) { }
  31150.  
  31151. result_type
  31152. a ( ) const
  31153. { return _M_param . a ( ) ; }
  31154.  
  31155. result_type
  31156. b ( ) const
  31157. { return _M_param . b ( ) ; }
  31158.  
  31159.  
  31160.  
  31161.  
  31162. param_type
  31163. param ( ) const
  31164. { return _M_param ; }
  31165.  
  31166.  
  31167.  
  31168.  
  31169.  
  31170. void
  31171. param ( const param_type & __param )
  31172. { _M_param = __param ; }
  31173.  
  31174.  
  31175.  
  31176.  
  31177. result_type
  31178. min ( ) const
  31179. { return this -> a ( ) ; }
  31180.  
  31181.  
  31182.  
  31183.  
  31184. result_type
  31185. max ( ) const
  31186. { return this -> b ( ) ; }
  31187.  
  31188.  
  31189.  
  31190.  
  31191. template < typename _UniformRandomNumberGenerator >
  31192. result_type
  31193. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  31194. { return this -> operator ( ) ( __urng , _M_param ) ; }
  31195.  
  31196. template < typename _UniformRandomNumberGenerator >
  31197. result_type
  31198. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  31199. const param_type & __p ) ;
  31200.  
  31201. template < typename _ForwardIterator ,
  31202. typename _UniformRandomNumberGenerator >
  31203. void
  31204. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31205. _UniformRandomNumberGenerator & __urng )
  31206. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  31207.  
  31208. template < typename _ForwardIterator ,
  31209. typename _UniformRandomNumberGenerator >
  31210. void
  31211. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31212. _UniformRandomNumberGenerator & __urng ,
  31213. const param_type & __p )
  31214. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31215.  
  31216. template < typename _UniformRandomNumberGenerator >
  31217. void
  31218. __generate ( result_type * __f , result_type * __t ,
  31219. _UniformRandomNumberGenerator & __urng ,
  31220. const param_type & __p )
  31221. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31222.  
  31223.  
  31224.  
  31225.  
  31226.  
  31227. friend bool
  31228. operator == ( const uniform_int_distribution & __d1 ,
  31229. const uniform_int_distribution & __d2 )
  31230. { return __d1 . _M_param == __d2 . _M_param ; }
  31231.  
  31232. private :
  31233. template < typename _ForwardIterator ,
  31234. typename _UniformRandomNumberGenerator >
  31235. void
  31236. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  31237. _UniformRandomNumberGenerator & __urng ,
  31238. const param_type & __p ) ;
  31239.  
  31240. param_type _M_param ;
  31241. } ;
  31242.  
  31243.  
  31244.  
  31245.  
  31246.  
  31247. template < typename _IntType >
  31248. inline bool
  31249. operator != ( const std :: uniform_int_distribution < _IntType > & __d1 ,
  31250. const std :: uniform_int_distribution < _IntType > & __d2 )
  31251. { return ! ( __d1 == __d2 ) ; }
  31252. #1839
  31253. template < typename _IntType , typename _CharT , typename _Traits >
  31254. std :: basic_ostream < _CharT , _Traits > &
  31255. operator << ( std :: basic_ostream < _CharT , _Traits > & ,
  31256. const std :: uniform_int_distribution < _IntType > & ) ;
  31257. #1853
  31258. template < typename _IntType , typename _CharT , typename _Traits >
  31259. std :: basic_istream < _CharT , _Traits > &
  31260. operator >> ( std :: basic_istream < _CharT , _Traits > & ,
  31261. std :: uniform_int_distribution < _IntType > & ) ;
  31262. #1866
  31263. template < typename _RealType = double >
  31264. class uniform_real_distribution
  31265. {
  31266. static_assert ( std :: is_floating_point < _RealType > :: value ,
  31267. "template argument not a floating point type" ) ;
  31268.  
  31269. public :
  31270.  
  31271. typedef _RealType result_type ;
  31272.  
  31273. struct param_type
  31274. {
  31275. typedef uniform_real_distribution < _RealType > distribution_type ;
  31276.  
  31277. explicit
  31278. param_type ( _RealType __a = _RealType ( 0 ) ,
  31279. _RealType __b = _RealType ( 1 ) )
  31280. : _M_a ( __a ) , _M_b ( __b )
  31281. {
  31282. ;
  31283. }
  31284.  
  31285. result_type
  31286. a ( ) const
  31287. { return _M_a ; }
  31288.  
  31289. result_type
  31290. b ( ) const
  31291. { return _M_b ; }
  31292.  
  31293. friend bool
  31294. operator == ( const param_type & __p1 , const param_type & __p2 )
  31295. { return __p1 . _M_a == __p2 . _M_a && __p1 . _M_b == __p2 . _M_b ; }
  31296.  
  31297. private :
  31298. _RealType _M_a ;
  31299. _RealType _M_b ;
  31300. } ;
  31301.  
  31302. public :
  31303. #1912
  31304. explicit
  31305. uniform_real_distribution ( _RealType __a = _RealType ( 0 ) ,
  31306. _RealType __b = _RealType ( 1 ) )
  31307. : _M_param ( __a , __b )
  31308. { }
  31309.  
  31310. explicit
  31311. uniform_real_distribution ( const param_type & __p )
  31312. : _M_param ( __p )
  31313. { }
  31314. #1928
  31315. void
  31316. reset ( ) { }
  31317.  
  31318. result_type
  31319. a ( ) const
  31320. { return _M_param . a ( ) ; }
  31321.  
  31322. result_type
  31323. b ( ) const
  31324. { return _M_param . b ( ) ; }
  31325.  
  31326.  
  31327.  
  31328.  
  31329. param_type
  31330. param ( ) const
  31331. { return _M_param ; }
  31332.  
  31333.  
  31334.  
  31335.  
  31336.  
  31337. void
  31338. param ( const param_type & __param )
  31339. { _M_param = __param ; }
  31340.  
  31341.  
  31342.  
  31343.  
  31344. result_type
  31345. min ( ) const
  31346. { return this -> a ( ) ; }
  31347.  
  31348.  
  31349.  
  31350.  
  31351. result_type
  31352. max ( ) const
  31353. { return this -> b ( ) ; }
  31354.  
  31355.  
  31356.  
  31357.  
  31358. template < typename _UniformRandomNumberGenerator >
  31359. result_type
  31360. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  31361. { return this -> operator ( ) ( __urng , _M_param ) ; }
  31362.  
  31363. template < typename _UniformRandomNumberGenerator >
  31364. result_type
  31365. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  31366. const param_type & __p )
  31367. {
  31368. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  31369. __aurng ( __urng ) ;
  31370. return ( __aurng ( ) * ( __p . b ( ) - __p . a ( ) ) ) + __p . a ( ) ;
  31371. }
  31372.  
  31373. template < typename _ForwardIterator ,
  31374. typename _UniformRandomNumberGenerator >
  31375. void
  31376. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31377. _UniformRandomNumberGenerator & __urng )
  31378. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  31379.  
  31380. template < typename _ForwardIterator ,
  31381. typename _UniformRandomNumberGenerator >
  31382. void
  31383. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31384. _UniformRandomNumberGenerator & __urng ,
  31385. const param_type & __p )
  31386. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31387.  
  31388. template < typename _UniformRandomNumberGenerator >
  31389. void
  31390. __generate ( result_type * __f , result_type * __t ,
  31391. _UniformRandomNumberGenerator & __urng ,
  31392. const param_type & __p )
  31393. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31394.  
  31395.  
  31396.  
  31397.  
  31398.  
  31399. friend bool
  31400. operator == ( const uniform_real_distribution & __d1 ,
  31401. const uniform_real_distribution & __d2 )
  31402. { return __d1 . _M_param == __d2 . _M_param ; }
  31403.  
  31404. private :
  31405. template < typename _ForwardIterator ,
  31406. typename _UniformRandomNumberGenerator >
  31407. void
  31408. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  31409. _UniformRandomNumberGenerator & __urng ,
  31410. const param_type & __p ) ;
  31411.  
  31412. param_type _M_param ;
  31413. } ;
  31414.  
  31415.  
  31416.  
  31417.  
  31418.  
  31419. template < typename _IntType >
  31420. inline bool
  31421. operator != ( const std :: uniform_real_distribution < _IntType > & __d1 ,
  31422. const std :: uniform_real_distribution < _IntType > & __d2 )
  31423. { return ! ( __d1 == __d2 ) ; }
  31424. #2048
  31425. template < typename _RealType , typename _CharT , typename _Traits >
  31426. std :: basic_ostream < _CharT , _Traits > &
  31427. operator << ( std :: basic_ostream < _CharT , _Traits > & ,
  31428. const std :: uniform_real_distribution < _RealType > & ) ;
  31429. #2062
  31430. template < typename _RealType , typename _CharT , typename _Traits >
  31431. std :: basic_istream < _CharT , _Traits > &
  31432. operator >> ( std :: basic_istream < _CharT , _Traits > & ,
  31433. std :: uniform_real_distribution < _RealType > & ) ;
  31434. #2084
  31435. template < typename _RealType = double >
  31436. class normal_distribution
  31437. {
  31438. static_assert ( std :: is_floating_point < _RealType > :: value ,
  31439. "template argument not a floating point type" ) ;
  31440.  
  31441. public :
  31442.  
  31443. typedef _RealType result_type ;
  31444.  
  31445. struct param_type
  31446. {
  31447. typedef normal_distribution < _RealType > distribution_type ;
  31448.  
  31449. explicit
  31450. param_type ( _RealType __mean = _RealType ( 0 ) ,
  31451. _RealType __stddev = _RealType ( 1 ) )
  31452. : _M_mean ( __mean ) , _M_stddev ( __stddev )
  31453. {
  31454. ;
  31455. }
  31456.  
  31457. _RealType
  31458. mean ( ) const
  31459. { return _M_mean ; }
  31460.  
  31461. _RealType
  31462. stddev ( ) const
  31463. { return _M_stddev ; }
  31464.  
  31465. friend bool
  31466. operator == ( const param_type & __p1 , const param_type & __p2 )
  31467. { return ( __p1 . _M_mean == __p2 . _M_mean
  31468. && __p1 . _M_stddev == __p2 . _M_stddev ) ; }
  31469.  
  31470. private :
  31471. _RealType _M_mean ;
  31472. _RealType _M_stddev ;
  31473. } ;
  31474.  
  31475. public :
  31476.  
  31477.  
  31478.  
  31479.  
  31480. explicit
  31481. normal_distribution ( result_type __mean = result_type ( 0 ) ,
  31482. result_type __stddev = result_type ( 1 ) )
  31483. : _M_param ( __mean , __stddev ) , _M_saved_available ( false )
  31484. { }
  31485.  
  31486. explicit
  31487. normal_distribution ( const param_type & __p )
  31488. : _M_param ( __p ) , _M_saved_available ( false )
  31489. { }
  31490.  
  31491.  
  31492.  
  31493.  
  31494. void
  31495. reset ( )
  31496. { _M_saved_available = false ; }
  31497.  
  31498.  
  31499.  
  31500.  
  31501. _RealType
  31502. mean ( ) const
  31503. { return _M_param . mean ( ) ; }
  31504.  
  31505.  
  31506.  
  31507.  
  31508. _RealType
  31509. stddev ( ) const
  31510. { return _M_param . stddev ( ) ; }
  31511.  
  31512.  
  31513.  
  31514.  
  31515. param_type
  31516. param ( ) const
  31517. { return _M_param ; }
  31518.  
  31519.  
  31520.  
  31521.  
  31522.  
  31523. void
  31524. param ( const param_type & __param )
  31525. { _M_param = __param ; }
  31526.  
  31527.  
  31528.  
  31529.  
  31530. result_type
  31531. min ( ) const
  31532. { return std :: numeric_limits < result_type > :: lowest ( ) ; }
  31533.  
  31534.  
  31535.  
  31536.  
  31537. result_type
  31538. max ( ) const
  31539. { return std :: numeric_limits < result_type > :: max ( ) ; }
  31540.  
  31541.  
  31542.  
  31543.  
  31544. template < typename _UniformRandomNumberGenerator >
  31545. result_type
  31546. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  31547. { return this -> operator ( ) ( __urng , _M_param ) ; }
  31548.  
  31549. template < typename _UniformRandomNumberGenerator >
  31550. result_type
  31551. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  31552. const param_type & __p ) ;
  31553.  
  31554. template < typename _ForwardIterator ,
  31555. typename _UniformRandomNumberGenerator >
  31556. void
  31557. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31558. _UniformRandomNumberGenerator & __urng )
  31559. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  31560.  
  31561. template < typename _ForwardIterator ,
  31562. typename _UniformRandomNumberGenerator >
  31563. void
  31564. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31565. _UniformRandomNumberGenerator & __urng ,
  31566. const param_type & __p )
  31567. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31568.  
  31569. template < typename _UniformRandomNumberGenerator >
  31570. void
  31571. __generate ( result_type * __f , result_type * __t ,
  31572. _UniformRandomNumberGenerator & __urng ,
  31573. const param_type & __p )
  31574. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31575. #2230
  31576. template < typename _RealType1 >
  31577. friend bool
  31578. operator == ( const std :: normal_distribution < _RealType1 > & __d1 ,
  31579. const std :: normal_distribution < _RealType1 > & __d2 ) ;
  31580. #2245
  31581. template < typename _RealType1 , typename _CharT , typename _Traits >
  31582. friend std :: basic_ostream < _CharT , _Traits > &
  31583. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  31584. const std :: normal_distribution < _RealType1 > & __x ) ;
  31585. #2260
  31586. template < typename _RealType1 , typename _CharT , typename _Traits >
  31587. friend std :: basic_istream < _CharT , _Traits > &
  31588. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  31589. std :: normal_distribution < _RealType1 > & __x ) ;
  31590.  
  31591. private :
  31592. template < typename _ForwardIterator ,
  31593. typename _UniformRandomNumberGenerator >
  31594. void
  31595. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  31596. _UniformRandomNumberGenerator & __urng ,
  31597. const param_type & __p ) ;
  31598.  
  31599. param_type _M_param ;
  31600. result_type _M_saved ;
  31601. bool _M_saved_available ;
  31602. } ;
  31603.  
  31604.  
  31605.  
  31606.  
  31607. template < typename _RealType >
  31608. inline bool
  31609. operator != ( const std :: normal_distribution < _RealType > & __d1 ,
  31610. const std :: normal_distribution < _RealType > & __d2 )
  31611. { return ! ( __d1 == __d2 ) ; }
  31612. #2297
  31613. template < typename _RealType = double >
  31614. class lognormal_distribution
  31615. {
  31616. static_assert ( std :: is_floating_point < _RealType > :: value ,
  31617. "template argument not a floating point type" ) ;
  31618.  
  31619. public :
  31620.  
  31621. typedef _RealType result_type ;
  31622.  
  31623. struct param_type
  31624. {
  31625. typedef lognormal_distribution < _RealType > distribution_type ;
  31626.  
  31627. explicit
  31628. param_type ( _RealType __m = _RealType ( 0 ) ,
  31629. _RealType __s = _RealType ( 1 ) )
  31630. : _M_m ( __m ) , _M_s ( __s )
  31631. { }
  31632.  
  31633. _RealType
  31634. m ( ) const
  31635. { return _M_m ; }
  31636.  
  31637. _RealType
  31638. s ( ) const
  31639. { return _M_s ; }
  31640.  
  31641. friend bool
  31642. operator == ( const param_type & __p1 , const param_type & __p2 )
  31643. { return __p1 . _M_m == __p2 . _M_m && __p1 . _M_s == __p2 . _M_s ; }
  31644.  
  31645. private :
  31646. _RealType _M_m ;
  31647. _RealType _M_s ;
  31648. } ;
  31649.  
  31650. explicit
  31651. lognormal_distribution ( _RealType __m = _RealType ( 0 ) ,
  31652. _RealType __s = _RealType ( 1 ) )
  31653. : _M_param ( __m , __s ) , _M_nd ( )
  31654. { }
  31655.  
  31656. explicit
  31657. lognormal_distribution ( const param_type & __p )
  31658. : _M_param ( __p ) , _M_nd ( )
  31659. { }
  31660.  
  31661.  
  31662.  
  31663.  
  31664. void
  31665. reset ( )
  31666. { _M_nd . reset ( ) ; }
  31667.  
  31668.  
  31669.  
  31670.  
  31671. _RealType
  31672. m ( ) const
  31673. { return _M_param . m ( ) ; }
  31674.  
  31675. _RealType
  31676. s ( ) const
  31677. { return _M_param . s ( ) ; }
  31678.  
  31679.  
  31680.  
  31681.  
  31682. param_type
  31683. param ( ) const
  31684. { return _M_param ; }
  31685.  
  31686.  
  31687.  
  31688.  
  31689.  
  31690. void
  31691. param ( const param_type & __param )
  31692. { _M_param = __param ; }
  31693.  
  31694.  
  31695.  
  31696.  
  31697. result_type
  31698. min ( ) const
  31699. { return result_type ( 0 ) ; }
  31700.  
  31701.  
  31702.  
  31703.  
  31704. result_type
  31705. max ( ) const
  31706. { return std :: numeric_limits < result_type > :: max ( ) ; }
  31707.  
  31708.  
  31709.  
  31710.  
  31711. template < typename _UniformRandomNumberGenerator >
  31712. result_type
  31713. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  31714. { return this -> operator ( ) ( __urng , _M_param ) ; }
  31715.  
  31716. template < typename _UniformRandomNumberGenerator >
  31717. result_type
  31718. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  31719. const param_type & __p )
  31720. { return std :: exp ( __p . s ( ) * _M_nd ( __urng ) + __p . m ( ) ) ; }
  31721.  
  31722. template < typename _ForwardIterator ,
  31723. typename _UniformRandomNumberGenerator >
  31724. void
  31725. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31726. _UniformRandomNumberGenerator & __urng )
  31727. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  31728.  
  31729. template < typename _ForwardIterator ,
  31730. typename _UniformRandomNumberGenerator >
  31731. void
  31732. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31733. _UniformRandomNumberGenerator & __urng ,
  31734. const param_type & __p )
  31735. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31736.  
  31737. template < typename _UniformRandomNumberGenerator >
  31738. void
  31739. __generate ( result_type * __f , result_type * __t ,
  31740. _UniformRandomNumberGenerator & __urng ,
  31741. const param_type & __p )
  31742. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31743. #2433
  31744. friend bool
  31745. operator == ( const lognormal_distribution & __d1 ,
  31746. const lognormal_distribution & __d2 )
  31747. { return ( __d1 . _M_param == __d2 . _M_param
  31748. && __d1 . _M_nd == __d2 . _M_nd ) ; }
  31749. #2449
  31750. template < typename _RealType1 , typename _CharT , typename _Traits >
  31751. friend std :: basic_ostream < _CharT , _Traits > &
  31752. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  31753. const std :: lognormal_distribution < _RealType1 > & __x ) ;
  31754. #2464
  31755. template < typename _RealType1 , typename _CharT , typename _Traits >
  31756. friend std :: basic_istream < _CharT , _Traits > &
  31757. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  31758. std :: lognormal_distribution < _RealType1 > & __x ) ;
  31759.  
  31760. private :
  31761. template < typename _ForwardIterator ,
  31762. typename _UniformRandomNumberGenerator >
  31763. void
  31764. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  31765. _UniformRandomNumberGenerator & __urng ,
  31766. const param_type & __p ) ;
  31767.  
  31768. param_type _M_param ;
  31769.  
  31770. std :: normal_distribution < result_type > _M_nd ;
  31771. } ;
  31772.  
  31773.  
  31774.  
  31775.  
  31776. template < typename _RealType >
  31777. inline bool
  31778. operator != ( const std :: lognormal_distribution < _RealType > & __d1 ,
  31779. const std :: lognormal_distribution < _RealType > & __d2 )
  31780. { return ! ( __d1 == __d2 ) ; }
  31781. #2501
  31782. template < typename _RealType = double >
  31783. class gamma_distribution
  31784. {
  31785. static_assert ( std :: is_floating_point < _RealType > :: value ,
  31786. "template argument not a floating point type" ) ;
  31787.  
  31788. public :
  31789.  
  31790. typedef _RealType result_type ;
  31791.  
  31792. struct param_type
  31793. {
  31794. typedef gamma_distribution < _RealType > distribution_type ;
  31795. friend class gamma_distribution < _RealType > ;
  31796.  
  31797. explicit
  31798. param_type ( _RealType __alpha_val = _RealType ( 1 ) ,
  31799. _RealType __beta_val = _RealType ( 1 ) )
  31800. : _M_alpha ( __alpha_val ) , _M_beta ( __beta_val )
  31801. {
  31802. ;
  31803. _M_initialize ( ) ;
  31804. }
  31805.  
  31806. _RealType
  31807. alpha ( ) const
  31808. { return _M_alpha ; }
  31809.  
  31810. _RealType
  31811. beta ( ) const
  31812. { return _M_beta ; }
  31813.  
  31814. friend bool
  31815. operator == ( const param_type & __p1 , const param_type & __p2 )
  31816. { return ( __p1 . _M_alpha == __p2 . _M_alpha
  31817. && __p1 . _M_beta == __p2 . _M_beta ) ; }
  31818.  
  31819. private :
  31820. void
  31821. _M_initialize ( ) ;
  31822.  
  31823. _RealType _M_alpha ;
  31824. _RealType _M_beta ;
  31825.  
  31826. _RealType _M_malpha , _M_a2 ;
  31827. } ;
  31828.  
  31829. public :
  31830.  
  31831.  
  31832.  
  31833.  
  31834. explicit
  31835. gamma_distribution ( _RealType __alpha_val = _RealType ( 1 ) ,
  31836. _RealType __beta_val = _RealType ( 1 ) )
  31837. : _M_param ( __alpha_val , __beta_val ) , _M_nd ( )
  31838. { }
  31839.  
  31840. explicit
  31841. gamma_distribution ( const param_type & __p )
  31842. : _M_param ( __p ) , _M_nd ( )
  31843. { }
  31844.  
  31845.  
  31846.  
  31847.  
  31848. void
  31849. reset ( )
  31850. { _M_nd . reset ( ) ; }
  31851.  
  31852.  
  31853.  
  31854.  
  31855. _RealType
  31856. alpha ( ) const
  31857. { return _M_param . alpha ( ) ; }
  31858.  
  31859.  
  31860.  
  31861.  
  31862. _RealType
  31863. beta ( ) const
  31864. { return _M_param . beta ( ) ; }
  31865.  
  31866.  
  31867.  
  31868.  
  31869. param_type
  31870. param ( ) const
  31871. { return _M_param ; }
  31872.  
  31873.  
  31874.  
  31875.  
  31876.  
  31877. void
  31878. param ( const param_type & __param )
  31879. { _M_param = __param ; }
  31880.  
  31881.  
  31882.  
  31883.  
  31884. result_type
  31885. min ( ) const
  31886. { return result_type ( 0 ) ; }
  31887.  
  31888.  
  31889.  
  31890.  
  31891. result_type
  31892. max ( ) const
  31893. { return std :: numeric_limits < result_type > :: max ( ) ; }
  31894.  
  31895.  
  31896.  
  31897.  
  31898. template < typename _UniformRandomNumberGenerator >
  31899. result_type
  31900. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  31901. { return this -> operator ( ) ( __urng , _M_param ) ; }
  31902.  
  31903. template < typename _UniformRandomNumberGenerator >
  31904. result_type
  31905. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  31906. const param_type & __p ) ;
  31907.  
  31908. template < typename _ForwardIterator ,
  31909. typename _UniformRandomNumberGenerator >
  31910. void
  31911. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31912. _UniformRandomNumberGenerator & __urng )
  31913. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  31914.  
  31915. template < typename _ForwardIterator ,
  31916. typename _UniformRandomNumberGenerator >
  31917. void
  31918. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  31919. _UniformRandomNumberGenerator & __urng ,
  31920. const param_type & __p )
  31921. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31922.  
  31923. template < typename _UniformRandomNumberGenerator >
  31924. void
  31925. __generate ( result_type * __f , result_type * __t ,
  31926. _UniformRandomNumberGenerator & __urng ,
  31927. const param_type & __p )
  31928. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  31929. #2654
  31930. friend bool
  31931. operator == ( const gamma_distribution & __d1 ,
  31932. const gamma_distribution & __d2 )
  31933. { return ( __d1 . _M_param == __d2 . _M_param
  31934. && __d1 . _M_nd == __d2 . _M_nd ) ; }
  31935. #2670
  31936. template < typename _RealType1 , typename _CharT , typename _Traits >
  31937. friend std :: basic_ostream < _CharT , _Traits > &
  31938. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  31939. const std :: gamma_distribution < _RealType1 > & __x ) ;
  31940. #2684
  31941. template < typename _RealType1 , typename _CharT , typename _Traits >
  31942. friend std :: basic_istream < _CharT , _Traits > &
  31943. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  31944. std :: gamma_distribution < _RealType1 > & __x ) ;
  31945.  
  31946. private :
  31947. template < typename _ForwardIterator ,
  31948. typename _UniformRandomNumberGenerator >
  31949. void
  31950. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  31951. _UniformRandomNumberGenerator & __urng ,
  31952. const param_type & __p ) ;
  31953.  
  31954. param_type _M_param ;
  31955.  
  31956. std :: normal_distribution < result_type > _M_nd ;
  31957. } ;
  31958.  
  31959.  
  31960.  
  31961.  
  31962. template < typename _RealType >
  31963. inline bool
  31964. operator != ( const std :: gamma_distribution < _RealType > & __d1 ,
  31965. const std :: gamma_distribution < _RealType > & __d2 )
  31966. { return ! ( __d1 == __d2 ) ; }
  31967. #2718
  31968. template < typename _RealType = double >
  31969. class chi_squared_distribution
  31970. {
  31971. static_assert ( std :: is_floating_point < _RealType > :: value ,
  31972. "template argument not a floating point type" ) ;
  31973.  
  31974. public :
  31975.  
  31976. typedef _RealType result_type ;
  31977.  
  31978. struct param_type
  31979. {
  31980. typedef chi_squared_distribution < _RealType > distribution_type ;
  31981.  
  31982. explicit
  31983. param_type ( _RealType __n = _RealType ( 1 ) )
  31984. : _M_n ( __n )
  31985. { }
  31986.  
  31987. _RealType
  31988. n ( ) const
  31989. { return _M_n ; }
  31990.  
  31991. friend bool
  31992. operator == ( const param_type & __p1 , const param_type & __p2 )
  31993. { return __p1 . _M_n == __p2 . _M_n ; }
  31994.  
  31995. private :
  31996. _RealType _M_n ;
  31997. } ;
  31998.  
  31999. explicit
  32000. chi_squared_distribution ( _RealType __n = _RealType ( 1 ) )
  32001. : _M_param ( __n ) , _M_gd ( __n / 2 )
  32002. { }
  32003.  
  32004. explicit
  32005. chi_squared_distribution ( const param_type & __p )
  32006. : _M_param ( __p ) , _M_gd ( __p . n ( ) / 2 )
  32007. { }
  32008.  
  32009.  
  32010.  
  32011.  
  32012. void
  32013. reset ( )
  32014. { _M_gd . reset ( ) ; }
  32015.  
  32016.  
  32017.  
  32018.  
  32019. _RealType
  32020. n ( ) const
  32021. { return _M_param . n ( ) ; }
  32022.  
  32023.  
  32024.  
  32025.  
  32026. param_type
  32027. param ( ) const
  32028. { return _M_param ; }
  32029.  
  32030.  
  32031.  
  32032.  
  32033.  
  32034. void
  32035. param ( const param_type & __param )
  32036. { _M_param = __param ; }
  32037.  
  32038.  
  32039.  
  32040.  
  32041. result_type
  32042. min ( ) const
  32043. { return result_type ( 0 ) ; }
  32044.  
  32045.  
  32046.  
  32047.  
  32048. result_type
  32049. max ( ) const
  32050. { return std :: numeric_limits < result_type > :: max ( ) ; }
  32051.  
  32052.  
  32053.  
  32054.  
  32055. template < typename _UniformRandomNumberGenerator >
  32056. result_type
  32057. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  32058. { return 2 * _M_gd ( __urng ) ; }
  32059.  
  32060. template < typename _UniformRandomNumberGenerator >
  32061. result_type
  32062. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  32063. const param_type & __p )
  32064. {
  32065. typedef typename std :: gamma_distribution < result_type > :: param_type
  32066. param_type ;
  32067. return 2 * _M_gd ( __urng , param_type ( __p . n ( ) / 2 ) ) ;
  32068. }
  32069.  
  32070. template < typename _ForwardIterator ,
  32071. typename _UniformRandomNumberGenerator >
  32072. void
  32073. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32074. _UniformRandomNumberGenerator & __urng )
  32075. { this -> __generate_impl ( __f , __t , __urng ) ; }
  32076.  
  32077. template < typename _ForwardIterator ,
  32078. typename _UniformRandomNumberGenerator >
  32079. void
  32080. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32081. _UniformRandomNumberGenerator & __urng ,
  32082. const param_type & __p )
  32083. { typename std :: gamma_distribution < result_type > :: param_type
  32084. __p2 ( __p . n ( ) / 2 ) ;
  32085. this -> __generate_impl ( __f , __t , __urng , __p2 ) ; }
  32086.  
  32087. template < typename _UniformRandomNumberGenerator >
  32088. void
  32089. __generate ( result_type * __f , result_type * __t ,
  32090. _UniformRandomNumberGenerator & __urng )
  32091. { this -> __generate_impl ( __f , __t , __urng ) ; }
  32092.  
  32093. template < typename _UniformRandomNumberGenerator >
  32094. void
  32095. __generate ( result_type * __f , result_type * __t ,
  32096. _UniformRandomNumberGenerator & __urng ,
  32097. const param_type & __p )
  32098. { typename std :: gamma_distribution < result_type > :: param_type
  32099. __p2 ( __p . n ( ) / 2 ) ;
  32100. this -> __generate_impl ( __f , __t , __urng , __p2 ) ; }
  32101. #2857
  32102. friend bool
  32103. operator == ( const chi_squared_distribution & __d1 ,
  32104. const chi_squared_distribution & __d2 )
  32105. { return __d1 . _M_param == __d2 . _M_param && __d1 . _M_gd == __d2 . _M_gd ; }
  32106. #2872
  32107. template < typename _RealType1 , typename _CharT , typename _Traits >
  32108. friend std :: basic_ostream < _CharT , _Traits > &
  32109. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  32110. const std :: chi_squared_distribution < _RealType1 > & __x ) ;
  32111. #2887
  32112. template < typename _RealType1 , typename _CharT , typename _Traits >
  32113. friend std :: basic_istream < _CharT , _Traits > &
  32114. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  32115. std :: chi_squared_distribution < _RealType1 > & __x ) ;
  32116.  
  32117. private :
  32118. template < typename _ForwardIterator ,
  32119. typename _UniformRandomNumberGenerator >
  32120. void
  32121. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32122. _UniformRandomNumberGenerator & __urng ) ;
  32123.  
  32124. template < typename _ForwardIterator ,
  32125. typename _UniformRandomNumberGenerator >
  32126. void
  32127. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32128. _UniformRandomNumberGenerator & __urng ,
  32129. const typename
  32130. std :: gamma_distribution < result_type > :: param_type & __p ) ;
  32131.  
  32132. param_type _M_param ;
  32133.  
  32134. std :: gamma_distribution < result_type > _M_gd ;
  32135. } ;
  32136.  
  32137.  
  32138.  
  32139.  
  32140. template < typename _RealType >
  32141. inline bool
  32142. operator != ( const std :: chi_squared_distribution < _RealType > & __d1 ,
  32143. const std :: chi_squared_distribution < _RealType > & __d2 )
  32144. { return ! ( __d1 == __d2 ) ; }
  32145. #2928
  32146. template < typename _RealType = double >
  32147. class cauchy_distribution
  32148. {
  32149. static_assert ( std :: is_floating_point < _RealType > :: value ,
  32150. "template argument not a floating point type" ) ;
  32151.  
  32152. public :
  32153.  
  32154. typedef _RealType result_type ;
  32155.  
  32156. struct param_type
  32157. {
  32158. typedef cauchy_distribution < _RealType > distribution_type ;
  32159.  
  32160. explicit
  32161. param_type ( _RealType __a = _RealType ( 0 ) ,
  32162. _RealType __b = _RealType ( 1 ) )
  32163. : _M_a ( __a ) , _M_b ( __b )
  32164. { }
  32165.  
  32166. _RealType
  32167. a ( ) const
  32168. { return _M_a ; }
  32169.  
  32170. _RealType
  32171. b ( ) const
  32172. { return _M_b ; }
  32173.  
  32174. friend bool
  32175. operator == ( const param_type & __p1 , const param_type & __p2 )
  32176. { return __p1 . _M_a == __p2 . _M_a && __p1 . _M_b == __p2 . _M_b ; }
  32177.  
  32178. private :
  32179. _RealType _M_a ;
  32180. _RealType _M_b ;
  32181. } ;
  32182.  
  32183. explicit
  32184. cauchy_distribution ( _RealType __a = _RealType ( 0 ) ,
  32185. _RealType __b = _RealType ( 1 ) )
  32186. : _M_param ( __a , __b )
  32187. { }
  32188.  
  32189. explicit
  32190. cauchy_distribution ( const param_type & __p )
  32191. : _M_param ( __p )
  32192. { }
  32193.  
  32194.  
  32195.  
  32196.  
  32197. void
  32198. reset ( )
  32199. { }
  32200.  
  32201.  
  32202.  
  32203.  
  32204. _RealType
  32205. a ( ) const
  32206. { return _M_param . a ( ) ; }
  32207.  
  32208. _RealType
  32209. b ( ) const
  32210. { return _M_param . b ( ) ; }
  32211.  
  32212.  
  32213.  
  32214.  
  32215. param_type
  32216. param ( ) const
  32217. { return _M_param ; }
  32218.  
  32219.  
  32220.  
  32221.  
  32222.  
  32223. void
  32224. param ( const param_type & __param )
  32225. { _M_param = __param ; }
  32226.  
  32227.  
  32228.  
  32229.  
  32230. result_type
  32231. min ( ) const
  32232. { return std :: numeric_limits < result_type > :: lowest ( ) ; }
  32233.  
  32234.  
  32235.  
  32236.  
  32237. result_type
  32238. max ( ) const
  32239. { return std :: numeric_limits < result_type > :: max ( ) ; }
  32240.  
  32241.  
  32242.  
  32243.  
  32244. template < typename _UniformRandomNumberGenerator >
  32245. result_type
  32246. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  32247. { return this -> operator ( ) ( __urng , _M_param ) ; }
  32248.  
  32249. template < typename _UniformRandomNumberGenerator >
  32250. result_type
  32251. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  32252. const param_type & __p ) ;
  32253.  
  32254. template < typename _ForwardIterator ,
  32255. typename _UniformRandomNumberGenerator >
  32256. void
  32257. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32258. _UniformRandomNumberGenerator & __urng )
  32259. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  32260.  
  32261. template < typename _ForwardIterator ,
  32262. typename _UniformRandomNumberGenerator >
  32263. void
  32264. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32265. _UniformRandomNumberGenerator & __urng ,
  32266. const param_type & __p )
  32267. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32268.  
  32269. template < typename _UniformRandomNumberGenerator >
  32270. void
  32271. __generate ( result_type * __f , result_type * __t ,
  32272. _UniformRandomNumberGenerator & __urng ,
  32273. const param_type & __p )
  32274. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32275.  
  32276.  
  32277.  
  32278.  
  32279.  
  32280. friend bool
  32281. operator == ( const cauchy_distribution & __d1 ,
  32282. const cauchy_distribution & __d2 )
  32283. { return __d1 . _M_param == __d2 . _M_param ; }
  32284.  
  32285. private :
  32286. template < typename _ForwardIterator ,
  32287. typename _UniformRandomNumberGenerator >
  32288. void
  32289. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32290. _UniformRandomNumberGenerator & __urng ,
  32291. const param_type & __p ) ;
  32292.  
  32293. param_type _M_param ;
  32294. } ;
  32295.  
  32296.  
  32297.  
  32298.  
  32299.  
  32300. template < typename _RealType >
  32301. inline bool
  32302. operator != ( const std :: cauchy_distribution < _RealType > & __d1 ,
  32303. const std :: cauchy_distribution < _RealType > & __d2 )
  32304. { return ! ( __d1 == __d2 ) ; }
  32305. #3098
  32306. template < typename _RealType , typename _CharT , typename _Traits >
  32307. std :: basic_ostream < _CharT , _Traits > &
  32308. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  32309. const std :: cauchy_distribution < _RealType > & __x ) ;
  32310. #3113
  32311. template < typename _RealType , typename _CharT , typename _Traits >
  32312. std :: basic_istream < _CharT , _Traits > &
  32313. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  32314. std :: cauchy_distribution < _RealType > & __x ) ;
  32315. #3129
  32316. template < typename _RealType = double >
  32317. class fisher_f_distribution
  32318. {
  32319. static_assert ( std :: is_floating_point < _RealType > :: value ,
  32320. "template argument not a floating point type" ) ;
  32321.  
  32322. public :
  32323.  
  32324. typedef _RealType result_type ;
  32325.  
  32326. struct param_type
  32327. {
  32328. typedef fisher_f_distribution < _RealType > distribution_type ;
  32329.  
  32330. explicit
  32331. param_type ( _RealType __m = _RealType ( 1 ) ,
  32332. _RealType __n = _RealType ( 1 ) )
  32333. : _M_m ( __m ) , _M_n ( __n )
  32334. { }
  32335.  
  32336. _RealType
  32337. m ( ) const
  32338. { return _M_m ; }
  32339.  
  32340. _RealType
  32341. n ( ) const
  32342. { return _M_n ; }
  32343.  
  32344. friend bool
  32345. operator == ( const param_type & __p1 , const param_type & __p2 )
  32346. { return __p1 . _M_m == __p2 . _M_m && __p1 . _M_n == __p2 . _M_n ; }
  32347.  
  32348. private :
  32349. _RealType _M_m ;
  32350. _RealType _M_n ;
  32351. } ;
  32352.  
  32353. explicit
  32354. fisher_f_distribution ( _RealType __m = _RealType ( 1 ) ,
  32355. _RealType __n = _RealType ( 1 ) )
  32356. : _M_param ( __m , __n ) , _M_gd_x ( __m / 2 ) , _M_gd_y ( __n / 2 )
  32357. { }
  32358.  
  32359. explicit
  32360. fisher_f_distribution ( const param_type & __p )
  32361. : _M_param ( __p ) , _M_gd_x ( __p . m ( ) / 2 ) , _M_gd_y ( __p . n ( ) / 2 )
  32362. { }
  32363.  
  32364.  
  32365.  
  32366.  
  32367. void
  32368. reset ( )
  32369. {
  32370. _M_gd_x . reset ( ) ;
  32371. _M_gd_y . reset ( ) ;
  32372. }
  32373.  
  32374.  
  32375.  
  32376.  
  32377. _RealType
  32378. m ( ) const
  32379. { return _M_param . m ( ) ; }
  32380.  
  32381. _RealType
  32382. n ( ) const
  32383. { return _M_param . n ( ) ; }
  32384.  
  32385.  
  32386.  
  32387.  
  32388. param_type
  32389. param ( ) const
  32390. { return _M_param ; }
  32391.  
  32392.  
  32393.  
  32394.  
  32395.  
  32396. void
  32397. param ( const param_type & __param )
  32398. { _M_param = __param ; }
  32399.  
  32400.  
  32401.  
  32402.  
  32403. result_type
  32404. min ( ) const
  32405. { return result_type ( 0 ) ; }
  32406.  
  32407.  
  32408.  
  32409.  
  32410. result_type
  32411. max ( ) const
  32412. { return std :: numeric_limits < result_type > :: max ( ) ; }
  32413.  
  32414.  
  32415.  
  32416.  
  32417. template < typename _UniformRandomNumberGenerator >
  32418. result_type
  32419. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  32420. { return ( _M_gd_x ( __urng ) * n ( ) ) / ( _M_gd_y ( __urng ) * m ( ) ) ; }
  32421.  
  32422. template < typename _UniformRandomNumberGenerator >
  32423. result_type
  32424. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  32425. const param_type & __p )
  32426. {
  32427. typedef typename std :: gamma_distribution < result_type > :: param_type
  32428. param_type ;
  32429. return ( ( _M_gd_x ( __urng , param_type ( __p . m ( ) / 2 ) ) * n ( ) )
  32430. / ( _M_gd_y ( __urng , param_type ( __p . n ( ) / 2 ) ) * m ( ) ) ) ;
  32431. }
  32432.  
  32433. template < typename _ForwardIterator ,
  32434. typename _UniformRandomNumberGenerator >
  32435. void
  32436. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32437. _UniformRandomNumberGenerator & __urng )
  32438. { this -> __generate_impl ( __f , __t , __urng ) ; }
  32439.  
  32440. template < typename _ForwardIterator ,
  32441. typename _UniformRandomNumberGenerator >
  32442. void
  32443. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32444. _UniformRandomNumberGenerator & __urng ,
  32445. const param_type & __p )
  32446. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32447.  
  32448. template < typename _UniformRandomNumberGenerator >
  32449. void
  32450. __generate ( result_type * __f , result_type * __t ,
  32451. _UniformRandomNumberGenerator & __urng )
  32452. { this -> __generate_impl ( __f , __t , __urng ) ; }
  32453.  
  32454. template < typename _UniformRandomNumberGenerator >
  32455. void
  32456. __generate ( result_type * __f , result_type * __t ,
  32457. _UniformRandomNumberGenerator & __urng ,
  32458. const param_type & __p )
  32459. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32460. #3279
  32461. friend bool
  32462. operator == ( const fisher_f_distribution & __d1 ,
  32463. const fisher_f_distribution & __d2 )
  32464. { return ( __d1 . _M_param == __d2 . _M_param
  32465. && __d1 . _M_gd_x == __d2 . _M_gd_x
  32466. && __d1 . _M_gd_y == __d2 . _M_gd_y ) ; }
  32467. #3296
  32468. template < typename _RealType1 , typename _CharT , typename _Traits >
  32469. friend std :: basic_ostream < _CharT , _Traits > &
  32470. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  32471. const std :: fisher_f_distribution < _RealType1 > & __x ) ;
  32472. #3311
  32473. template < typename _RealType1 , typename _CharT , typename _Traits >
  32474. friend std :: basic_istream < _CharT , _Traits > &
  32475. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  32476. std :: fisher_f_distribution < _RealType1 > & __x ) ;
  32477.  
  32478. private :
  32479. template < typename _ForwardIterator ,
  32480. typename _UniformRandomNumberGenerator >
  32481. void
  32482. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32483. _UniformRandomNumberGenerator & __urng ) ;
  32484.  
  32485. template < typename _ForwardIterator ,
  32486. typename _UniformRandomNumberGenerator >
  32487. void
  32488. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32489. _UniformRandomNumberGenerator & __urng ,
  32490. const param_type & __p ) ;
  32491.  
  32492. param_type _M_param ;
  32493.  
  32494. std :: gamma_distribution < result_type > _M_gd_x , _M_gd_y ;
  32495. } ;
  32496.  
  32497.  
  32498.  
  32499.  
  32500. template < typename _RealType >
  32501. inline bool
  32502. operator != ( const std :: fisher_f_distribution < _RealType > & __d1 ,
  32503. const std :: fisher_f_distribution < _RealType > & __d2 )
  32504. { return ! ( __d1 == __d2 ) ; }
  32505. #3353
  32506. template < typename _RealType = double >
  32507. class student_t_distribution
  32508. {
  32509. static_assert ( std :: is_floating_point < _RealType > :: value ,
  32510. "template argument not a floating point type" ) ;
  32511.  
  32512. public :
  32513.  
  32514. typedef _RealType result_type ;
  32515.  
  32516. struct param_type
  32517. {
  32518. typedef student_t_distribution < _RealType > distribution_type ;
  32519.  
  32520. explicit
  32521. param_type ( _RealType __n = _RealType ( 1 ) )
  32522. : _M_n ( __n )
  32523. { }
  32524.  
  32525. _RealType
  32526. n ( ) const
  32527. { return _M_n ; }
  32528.  
  32529. friend bool
  32530. operator == ( const param_type & __p1 , const param_type & __p2 )
  32531. { return __p1 . _M_n == __p2 . _M_n ; }
  32532.  
  32533. private :
  32534. _RealType _M_n ;
  32535. } ;
  32536.  
  32537. explicit
  32538. student_t_distribution ( _RealType __n = _RealType ( 1 ) )
  32539. : _M_param ( __n ) , _M_nd ( ) , _M_gd ( __n / 2 , 2 )
  32540. { }
  32541.  
  32542. explicit
  32543. student_t_distribution ( const param_type & __p )
  32544. : _M_param ( __p ) , _M_nd ( ) , _M_gd ( __p . n ( ) / 2 , 2 )
  32545. { }
  32546.  
  32547.  
  32548.  
  32549.  
  32550. void
  32551. reset ( )
  32552. {
  32553. _M_nd . reset ( ) ;
  32554. _M_gd . reset ( ) ;
  32555. }
  32556.  
  32557.  
  32558.  
  32559.  
  32560. _RealType
  32561. n ( ) const
  32562. { return _M_param . n ( ) ; }
  32563.  
  32564.  
  32565.  
  32566.  
  32567. param_type
  32568. param ( ) const
  32569. { return _M_param ; }
  32570.  
  32571.  
  32572.  
  32573.  
  32574.  
  32575. void
  32576. param ( const param_type & __param )
  32577. { _M_param = __param ; }
  32578.  
  32579.  
  32580.  
  32581.  
  32582. result_type
  32583. min ( ) const
  32584. { return std :: numeric_limits < result_type > :: lowest ( ) ; }
  32585.  
  32586.  
  32587.  
  32588.  
  32589. result_type
  32590. max ( ) const
  32591. { return std :: numeric_limits < result_type > :: max ( ) ; }
  32592.  
  32593.  
  32594.  
  32595.  
  32596. template < typename _UniformRandomNumberGenerator >
  32597. result_type
  32598. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  32599. { return _M_nd ( __urng ) * std :: sqrt ( n ( ) / _M_gd ( __urng ) ) ; }
  32600.  
  32601. template < typename _UniformRandomNumberGenerator >
  32602. result_type
  32603. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  32604. const param_type & __p )
  32605. {
  32606. typedef typename std :: gamma_distribution < result_type > :: param_type
  32607. param_type ;
  32608.  
  32609. const result_type __g = _M_gd ( __urng , param_type ( __p . n ( ) / 2 , 2 ) ) ;
  32610. return _M_nd ( __urng ) * std :: sqrt ( __p . n ( ) / __g ) ;
  32611. }
  32612.  
  32613. template < typename _ForwardIterator ,
  32614. typename _UniformRandomNumberGenerator >
  32615. void
  32616. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32617. _UniformRandomNumberGenerator & __urng )
  32618. { this -> __generate_impl ( __f , __t , __urng ) ; }
  32619.  
  32620. template < typename _ForwardIterator ,
  32621. typename _UniformRandomNumberGenerator >
  32622. void
  32623. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32624. _UniformRandomNumberGenerator & __urng ,
  32625. const param_type & __p )
  32626. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32627.  
  32628. template < typename _UniformRandomNumberGenerator >
  32629. void
  32630. __generate ( result_type * __f , result_type * __t ,
  32631. _UniformRandomNumberGenerator & __urng )
  32632. { this -> __generate_impl ( __f , __t , __urng ) ; }
  32633.  
  32634. template < typename _UniformRandomNumberGenerator >
  32635. void
  32636. __generate ( result_type * __f , result_type * __t ,
  32637. _UniformRandomNumberGenerator & __urng ,
  32638. const param_type & __p )
  32639. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32640. #3493
  32641. friend bool
  32642. operator == ( const student_t_distribution & __d1 ,
  32643. const student_t_distribution & __d2 )
  32644. { return ( __d1 . _M_param == __d2 . _M_param
  32645. && __d1 . _M_nd == __d2 . _M_nd && __d1 . _M_gd == __d2 . _M_gd ) ; }
  32646. #3509
  32647. template < typename _RealType1 , typename _CharT , typename _Traits >
  32648. friend std :: basic_ostream < _CharT , _Traits > &
  32649. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  32650. const std :: student_t_distribution < _RealType1 > & __x ) ;
  32651. #3524
  32652. template < typename _RealType1 , typename _CharT , typename _Traits >
  32653. friend std :: basic_istream < _CharT , _Traits > &
  32654. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  32655. std :: student_t_distribution < _RealType1 > & __x ) ;
  32656.  
  32657. private :
  32658. template < typename _ForwardIterator ,
  32659. typename _UniformRandomNumberGenerator >
  32660. void
  32661. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32662. _UniformRandomNumberGenerator & __urng ) ;
  32663. template < typename _ForwardIterator ,
  32664. typename _UniformRandomNumberGenerator >
  32665. void
  32666. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32667. _UniformRandomNumberGenerator & __urng ,
  32668. const param_type & __p ) ;
  32669.  
  32670. param_type _M_param ;
  32671.  
  32672. std :: normal_distribution < result_type > _M_nd ;
  32673. std :: gamma_distribution < result_type > _M_gd ;
  32674. } ;
  32675.  
  32676.  
  32677.  
  32678.  
  32679. template < typename _RealType >
  32680. inline bool
  32681. operator != ( const std :: student_t_distribution < _RealType > & __d1 ,
  32682. const std :: student_t_distribution < _RealType > & __d2 )
  32683. { return ! ( __d1 == __d2 ) ; }
  32684. #3572
  32685. class bernoulli_distribution
  32686. {
  32687. public :
  32688.  
  32689. typedef bool result_type ;
  32690.  
  32691. struct param_type
  32692. {
  32693. typedef bernoulli_distribution distribution_type ;
  32694.  
  32695. explicit
  32696. param_type ( double __p = 0.5 )
  32697. : _M_p ( __p )
  32698. {
  32699. ;
  32700. }
  32701.  
  32702. double
  32703. p ( ) const
  32704. { return _M_p ; }
  32705.  
  32706. friend bool
  32707. operator == ( const param_type & __p1 , const param_type & __p2 )
  32708. { return __p1 . _M_p == __p2 . _M_p ; }
  32709.  
  32710. private :
  32711. double _M_p ;
  32712. } ;
  32713.  
  32714. public :
  32715. #3608
  32716. explicit
  32717. bernoulli_distribution ( double __p = 0.5 )
  32718. : _M_param ( __p )
  32719. { }
  32720.  
  32721. explicit
  32722. bernoulli_distribution ( const param_type & __p )
  32723. : _M_param ( __p )
  32724. { }
  32725. #3623
  32726. void
  32727. reset ( ) { }
  32728.  
  32729.  
  32730.  
  32731.  
  32732. double
  32733. p ( ) const
  32734. { return _M_param . p ( ) ; }
  32735.  
  32736.  
  32737.  
  32738.  
  32739. param_type
  32740. param ( ) const
  32741. { return _M_param ; }
  32742.  
  32743.  
  32744.  
  32745.  
  32746.  
  32747. void
  32748. param ( const param_type & __param )
  32749. { _M_param = __param ; }
  32750.  
  32751.  
  32752.  
  32753.  
  32754. result_type
  32755. min ( ) const
  32756. { return std :: numeric_limits < result_type > :: min ( ) ; }
  32757.  
  32758.  
  32759.  
  32760.  
  32761. result_type
  32762. max ( ) const
  32763. { return std :: numeric_limits < result_type > :: max ( ) ; }
  32764.  
  32765.  
  32766.  
  32767.  
  32768. template < typename _UniformRandomNumberGenerator >
  32769. result_type
  32770. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  32771. { return this -> operator ( ) ( __urng , _M_param ) ; }
  32772.  
  32773. template < typename _UniformRandomNumberGenerator >
  32774. result_type
  32775. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  32776. const param_type & __p )
  32777. {
  32778. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  32779. __aurng ( __urng ) ;
  32780. if ( ( __aurng ( ) - __aurng . min ( ) )
  32781. < __p . p ( ) * ( __aurng . max ( ) - __aurng . min ( ) ) )
  32782. return true ;
  32783. return false ;
  32784. }
  32785.  
  32786. template < typename _ForwardIterator ,
  32787. typename _UniformRandomNumberGenerator >
  32788. void
  32789. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32790. _UniformRandomNumberGenerator & __urng )
  32791. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  32792.  
  32793. template < typename _ForwardIterator ,
  32794. typename _UniformRandomNumberGenerator >
  32795. void
  32796. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32797. _UniformRandomNumberGenerator & __urng , const param_type & __p )
  32798. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32799.  
  32800. template < typename _UniformRandomNumberGenerator >
  32801. void
  32802. __generate ( result_type * __f , result_type * __t ,
  32803. _UniformRandomNumberGenerator & __urng ,
  32804. const param_type & __p )
  32805. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32806.  
  32807.  
  32808.  
  32809.  
  32810.  
  32811. friend bool
  32812. operator == ( const bernoulli_distribution & __d1 ,
  32813. const bernoulli_distribution & __d2 )
  32814. { return __d1 . _M_param == __d2 . _M_param ; }
  32815.  
  32816. private :
  32817. template < typename _ForwardIterator ,
  32818. typename _UniformRandomNumberGenerator >
  32819. void
  32820. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  32821. _UniformRandomNumberGenerator & __urng ,
  32822. const param_type & __p ) ;
  32823.  
  32824. param_type _M_param ;
  32825. } ;
  32826.  
  32827.  
  32828.  
  32829.  
  32830.  
  32831. inline bool
  32832. operator != ( const std :: bernoulli_distribution & __d1 ,
  32833. const std :: bernoulli_distribution & __d2 )
  32834. { return ! ( __d1 == __d2 ) ; }
  32835. #3743
  32836. template < typename _CharT , typename _Traits >
  32837. std :: basic_ostream < _CharT , _Traits > &
  32838. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  32839. const std :: bernoulli_distribution & __x ) ;
  32840. #3757
  32841. template < typename _CharT , typename _Traits >
  32842. std :: basic_istream < _CharT , _Traits > &
  32843. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  32844. std :: bernoulli_distribution & __x )
  32845. {
  32846. double __p ;
  32847. __is >> __p ;
  32848. __x . param ( bernoulli_distribution :: param_type ( __p ) ) ;
  32849. return __is ;
  32850. }
  32851. #3776
  32852. template < typename _IntType = int >
  32853. class binomial_distribution
  32854. {
  32855. static_assert ( std :: is_integral < _IntType > :: value ,
  32856. "template argument not an integral type" ) ;
  32857.  
  32858. public :
  32859.  
  32860. typedef _IntType result_type ;
  32861.  
  32862. struct param_type
  32863. {
  32864. typedef binomial_distribution < _IntType > distribution_type ;
  32865. friend class binomial_distribution < _IntType > ;
  32866.  
  32867. explicit
  32868. param_type ( _IntType __t = _IntType ( 1 ) , double __p = 0.5 )
  32869. : _M_t ( __t ) , _M_p ( __p )
  32870. {
  32871.  
  32872.  
  32873. ;
  32874. _M_initialize ( ) ;
  32875. }
  32876.  
  32877. _IntType
  32878. t ( ) const
  32879. { return _M_t ; }
  32880.  
  32881. double
  32882. p ( ) const
  32883. { return _M_p ; }
  32884.  
  32885. friend bool
  32886. operator == ( const param_type & __p1 , const param_type & __p2 )
  32887. { return __p1 . _M_t == __p2 . _M_t && __p1 . _M_p == __p2 . _M_p ; }
  32888.  
  32889. private :
  32890. void
  32891. _M_initialize ( ) ;
  32892.  
  32893. _IntType _M_t ;
  32894. double _M_p ;
  32895.  
  32896. double _M_q ;
  32897.  
  32898. double _M_d1 , _M_d2 , _M_s1 , _M_s2 , _M_c ,
  32899. _M_a1 , _M_a123 , _M_s , _M_lf , _M_lp1p ;
  32900.  
  32901. bool _M_easy ;
  32902. } ;
  32903.  
  32904.  
  32905. explicit
  32906. binomial_distribution ( _IntType __t = _IntType ( 1 ) ,
  32907. double __p = 0.5 )
  32908. : _M_param ( __t , __p ) , _M_nd ( )
  32909. { }
  32910.  
  32911. explicit
  32912. binomial_distribution ( const param_type & __p )
  32913. : _M_param ( __p ) , _M_nd ( )
  32914. { }
  32915.  
  32916.  
  32917.  
  32918.  
  32919. void
  32920. reset ( )
  32921. { _M_nd . reset ( ) ; }
  32922.  
  32923.  
  32924.  
  32925.  
  32926. _IntType
  32927. t ( ) const
  32928. { return _M_param . t ( ) ; }
  32929.  
  32930.  
  32931.  
  32932.  
  32933. double
  32934. p ( ) const
  32935. { return _M_param . p ( ) ; }
  32936.  
  32937.  
  32938.  
  32939.  
  32940. param_type
  32941. param ( ) const
  32942. { return _M_param ; }
  32943.  
  32944.  
  32945.  
  32946.  
  32947.  
  32948. void
  32949. param ( const param_type & __param )
  32950. { _M_param = __param ; }
  32951.  
  32952.  
  32953.  
  32954.  
  32955. result_type
  32956. min ( ) const
  32957. { return 0 ; }
  32958.  
  32959.  
  32960.  
  32961.  
  32962. result_type
  32963. max ( ) const
  32964. { return _M_param . t ( ) ; }
  32965.  
  32966.  
  32967.  
  32968.  
  32969. template < typename _UniformRandomNumberGenerator >
  32970. result_type
  32971. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  32972. { return this -> operator ( ) ( __urng , _M_param ) ; }
  32973.  
  32974. template < typename _UniformRandomNumberGenerator >
  32975. result_type
  32976. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  32977. const param_type & __p ) ;
  32978.  
  32979. template < typename _ForwardIterator ,
  32980. typename _UniformRandomNumberGenerator >
  32981. void
  32982. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32983. _UniformRandomNumberGenerator & __urng )
  32984. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  32985.  
  32986. template < typename _ForwardIterator ,
  32987. typename _UniformRandomNumberGenerator >
  32988. void
  32989. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  32990. _UniformRandomNumberGenerator & __urng ,
  32991. const param_type & __p )
  32992. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  32993.  
  32994. template < typename _UniformRandomNumberGenerator >
  32995. void
  32996. __generate ( result_type * __f , result_type * __t ,
  32997. _UniformRandomNumberGenerator & __urng ,
  32998. const param_type & __p )
  32999. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33000. #3930
  33001. friend bool
  33002. operator == ( const binomial_distribution & __d1 ,
  33003. const binomial_distribution & __d2 )
  33004.  
  33005. { return __d1 . _M_param == __d2 . _M_param && __d1 . _M_nd == __d2 . _M_nd ; }
  33006. #3949
  33007. template < typename _IntType1 ,
  33008. typename _CharT , typename _Traits >
  33009. friend std :: basic_ostream < _CharT , _Traits > &
  33010. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  33011. const std :: binomial_distribution < _IntType1 > & __x ) ;
  33012. #3965
  33013. template < typename _IntType1 ,
  33014. typename _CharT , typename _Traits >
  33015. friend std :: basic_istream < _CharT , _Traits > &
  33016. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  33017. std :: binomial_distribution < _IntType1 > & __x ) ;
  33018.  
  33019. private :
  33020. template < typename _ForwardIterator ,
  33021. typename _UniformRandomNumberGenerator >
  33022. void
  33023. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33024. _UniformRandomNumberGenerator & __urng ,
  33025. const param_type & __p ) ;
  33026.  
  33027. template < typename _UniformRandomNumberGenerator >
  33028. result_type
  33029. _M_waiting ( _UniformRandomNumberGenerator & __urng ,
  33030. _IntType __t , double __q ) ;
  33031.  
  33032. param_type _M_param ;
  33033.  
  33034.  
  33035. std :: normal_distribution < double > _M_nd ;
  33036. } ;
  33037.  
  33038.  
  33039.  
  33040.  
  33041. template < typename _IntType >
  33042. inline bool
  33043. operator != ( const std :: binomial_distribution < _IntType > & __d1 ,
  33044. const std :: binomial_distribution < _IntType > & __d2 )
  33045. { return ! ( __d1 == __d2 ) ; }
  33046. #4007
  33047. template < typename _IntType = int >
  33048. class geometric_distribution
  33049. {
  33050. static_assert ( std :: is_integral < _IntType > :: value ,
  33051. "template argument not an integral type" ) ;
  33052.  
  33053. public :
  33054.  
  33055. typedef _IntType result_type ;
  33056.  
  33057. struct param_type
  33058. {
  33059. typedef geometric_distribution < _IntType > distribution_type ;
  33060. friend class geometric_distribution < _IntType > ;
  33061.  
  33062. explicit
  33063. param_type ( double __p = 0.5 )
  33064. : _M_p ( __p )
  33065. {
  33066. ;
  33067. _M_initialize ( ) ;
  33068. }
  33069.  
  33070. double
  33071. p ( ) const
  33072. { return _M_p ; }
  33073.  
  33074. friend bool
  33075. operator == ( const param_type & __p1 , const param_type & __p2 )
  33076. { return __p1 . _M_p == __p2 . _M_p ; }
  33077.  
  33078. private :
  33079. void
  33080. _M_initialize ( )
  33081. { _M_log_1_p = std :: log ( 1.0 - _M_p ) ; }
  33082.  
  33083. double _M_p ;
  33084.  
  33085. double _M_log_1_p ;
  33086. } ;
  33087.  
  33088.  
  33089. explicit
  33090. geometric_distribution ( double __p = 0.5 )
  33091. : _M_param ( __p )
  33092. { }
  33093.  
  33094. explicit
  33095. geometric_distribution ( const param_type & __p )
  33096. : _M_param ( __p )
  33097. { }
  33098. #4064
  33099. void
  33100. reset ( ) { }
  33101.  
  33102.  
  33103.  
  33104.  
  33105. double
  33106. p ( ) const
  33107. { return _M_param . p ( ) ; }
  33108.  
  33109.  
  33110.  
  33111.  
  33112. param_type
  33113. param ( ) const
  33114. { return _M_param ; }
  33115.  
  33116.  
  33117.  
  33118.  
  33119.  
  33120. void
  33121. param ( const param_type & __param )
  33122. { _M_param = __param ; }
  33123.  
  33124.  
  33125.  
  33126.  
  33127. result_type
  33128. min ( ) const
  33129. { return 0 ; }
  33130.  
  33131.  
  33132.  
  33133.  
  33134. result_type
  33135. max ( ) const
  33136. { return std :: numeric_limits < result_type > :: max ( ) ; }
  33137.  
  33138.  
  33139.  
  33140.  
  33141. template < typename _UniformRandomNumberGenerator >
  33142. result_type
  33143. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  33144. { return this -> operator ( ) ( __urng , _M_param ) ; }
  33145.  
  33146. template < typename _UniformRandomNumberGenerator >
  33147. result_type
  33148. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  33149. const param_type & __p ) ;
  33150.  
  33151. template < typename _ForwardIterator ,
  33152. typename _UniformRandomNumberGenerator >
  33153. void
  33154. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33155. _UniformRandomNumberGenerator & __urng )
  33156. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  33157.  
  33158. template < typename _ForwardIterator ,
  33159. typename _UniformRandomNumberGenerator >
  33160. void
  33161. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33162. _UniformRandomNumberGenerator & __urng ,
  33163. const param_type & __p )
  33164. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33165.  
  33166. template < typename _UniformRandomNumberGenerator >
  33167. void
  33168. __generate ( result_type * __f , result_type * __t ,
  33169. _UniformRandomNumberGenerator & __urng ,
  33170. const param_type & __p )
  33171. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33172.  
  33173.  
  33174.  
  33175.  
  33176.  
  33177. friend bool
  33178. operator == ( const geometric_distribution & __d1 ,
  33179. const geometric_distribution & __d2 )
  33180. { return __d1 . _M_param == __d2 . _M_param ; }
  33181.  
  33182. private :
  33183. template < typename _ForwardIterator ,
  33184. typename _UniformRandomNumberGenerator >
  33185. void
  33186. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33187. _UniformRandomNumberGenerator & __urng ,
  33188. const param_type & __p ) ;
  33189.  
  33190. param_type _M_param ;
  33191. } ;
  33192.  
  33193.  
  33194.  
  33195.  
  33196.  
  33197. template < typename _IntType >
  33198. inline bool
  33199. operator != ( const std :: geometric_distribution < _IntType > & __d1 ,
  33200. const std :: geometric_distribution < _IntType > & __d2 )
  33201. { return ! ( __d1 == __d2 ) ; }
  33202. #4178
  33203. template < typename _IntType ,
  33204. typename _CharT , typename _Traits >
  33205. std :: basic_ostream < _CharT , _Traits > &
  33206. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  33207. const std :: geometric_distribution < _IntType > & __x ) ;
  33208. #4193
  33209. template < typename _IntType ,
  33210. typename _CharT , typename _Traits >
  33211. std :: basic_istream < _CharT , _Traits > &
  33212. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  33213. std :: geometric_distribution < _IntType > & __x ) ;
  33214. #4207
  33215. template < typename _IntType = int >
  33216. class negative_binomial_distribution
  33217. {
  33218. static_assert ( std :: is_integral < _IntType > :: value ,
  33219. "template argument not an integral type" ) ;
  33220.  
  33221. public :
  33222.  
  33223. typedef _IntType result_type ;
  33224.  
  33225. struct param_type
  33226. {
  33227. typedef negative_binomial_distribution < _IntType > distribution_type ;
  33228.  
  33229. explicit
  33230. param_type ( _IntType __k = 1 , double __p = 0.5 )
  33231. : _M_k ( __k ) , _M_p ( __p )
  33232. {
  33233. ;
  33234. }
  33235.  
  33236. _IntType
  33237. k ( ) const
  33238. { return _M_k ; }
  33239.  
  33240. double
  33241. p ( ) const
  33242. { return _M_p ; }
  33243.  
  33244. friend bool
  33245. operator == ( const param_type & __p1 , const param_type & __p2 )
  33246. { return __p1 . _M_k == __p2 . _M_k && __p1 . _M_p == __p2 . _M_p ; }
  33247.  
  33248. private :
  33249. _IntType _M_k ;
  33250. double _M_p ;
  33251. } ;
  33252.  
  33253. explicit
  33254. negative_binomial_distribution ( _IntType __k = 1 , double __p = 0.5 )
  33255. : _M_param ( __k , __p ) , _M_gd ( __k , ( 1.0 - __p ) / __p )
  33256. { }
  33257.  
  33258. explicit
  33259. negative_binomial_distribution ( const param_type & __p )
  33260. : _M_param ( __p ) , _M_gd ( __p . k ( ) , ( 1.0 - __p . p ( ) ) / __p . p ( ) )
  33261. { }
  33262.  
  33263.  
  33264.  
  33265.  
  33266. void
  33267. reset ( )
  33268. { _M_gd . reset ( ) ; }
  33269.  
  33270.  
  33271.  
  33272.  
  33273. _IntType
  33274. k ( ) const
  33275. { return _M_param . k ( ) ; }
  33276.  
  33277.  
  33278.  
  33279.  
  33280. double
  33281. p ( ) const
  33282. { return _M_param . p ( ) ; }
  33283.  
  33284.  
  33285.  
  33286.  
  33287. param_type
  33288. param ( ) const
  33289. { return _M_param ; }
  33290.  
  33291.  
  33292.  
  33293.  
  33294.  
  33295. void
  33296. param ( const param_type & __param )
  33297. { _M_param = __param ; }
  33298.  
  33299.  
  33300.  
  33301.  
  33302. result_type
  33303. min ( ) const
  33304. { return result_type ( 0 ) ; }
  33305.  
  33306.  
  33307.  
  33308.  
  33309. result_type
  33310. max ( ) const
  33311. { return std :: numeric_limits < result_type > :: max ( ) ; }
  33312.  
  33313.  
  33314.  
  33315.  
  33316. template < typename _UniformRandomNumberGenerator >
  33317. result_type
  33318. operator ( ) ( _UniformRandomNumberGenerator & __urng ) ;
  33319.  
  33320. template < typename _UniformRandomNumberGenerator >
  33321. result_type
  33322. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  33323. const param_type & __p ) ;
  33324.  
  33325. template < typename _ForwardIterator ,
  33326. typename _UniformRandomNumberGenerator >
  33327. void
  33328. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33329. _UniformRandomNumberGenerator & __urng )
  33330. { this -> __generate_impl ( __f , __t , __urng ) ; }
  33331.  
  33332. template < typename _ForwardIterator ,
  33333. typename _UniformRandomNumberGenerator >
  33334. void
  33335. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33336. _UniformRandomNumberGenerator & __urng ,
  33337. const param_type & __p )
  33338. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33339.  
  33340. template < typename _UniformRandomNumberGenerator >
  33341. void
  33342. __generate ( result_type * __f , result_type * __t ,
  33343. _UniformRandomNumberGenerator & __urng )
  33344. { this -> __generate_impl ( __f , __t , __urng ) ; }
  33345.  
  33346. template < typename _UniformRandomNumberGenerator >
  33347. void
  33348. __generate ( result_type * __f , result_type * __t ,
  33349. _UniformRandomNumberGenerator & __urng ,
  33350. const param_type & __p )
  33351. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33352. #4350
  33353. friend bool
  33354. operator == ( const negative_binomial_distribution & __d1 ,
  33355. const negative_binomial_distribution & __d2 )
  33356. { return __d1 . _M_param == __d2 . _M_param && __d1 . _M_gd == __d2 . _M_gd ; }
  33357. #4366
  33358. template < typename _IntType1 , typename _CharT , typename _Traits >
  33359. friend std :: basic_ostream < _CharT , _Traits > &
  33360. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  33361. const std :: negative_binomial_distribution < _IntType1 > & __x ) ;
  33362. #4381
  33363. template < typename _IntType1 , typename _CharT , typename _Traits >
  33364. friend std :: basic_istream < _CharT , _Traits > &
  33365. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  33366. std :: negative_binomial_distribution < _IntType1 > & __x ) ;
  33367.  
  33368. private :
  33369. template < typename _ForwardIterator ,
  33370. typename _UniformRandomNumberGenerator >
  33371. void
  33372. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33373. _UniformRandomNumberGenerator & __urng ) ;
  33374. template < typename _ForwardIterator ,
  33375. typename _UniformRandomNumberGenerator >
  33376. void
  33377. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33378. _UniformRandomNumberGenerator & __urng ,
  33379. const param_type & __p ) ;
  33380.  
  33381. param_type _M_param ;
  33382.  
  33383. std :: gamma_distribution < double > _M_gd ;
  33384. } ;
  33385.  
  33386.  
  33387.  
  33388.  
  33389. template < typename _IntType >
  33390. inline bool
  33391. operator != ( const std :: negative_binomial_distribution < _IntType > & __d1 ,
  33392. const std :: negative_binomial_distribution < _IntType > & __d2 )
  33393. { return ! ( __d1 == __d2 ) ; }
  33394. #4429
  33395. template < typename _IntType = int >
  33396. class poisson_distribution
  33397. {
  33398. static_assert ( std :: is_integral < _IntType > :: value ,
  33399. "template argument not an integral type" ) ;
  33400.  
  33401. public :
  33402.  
  33403. typedef _IntType result_type ;
  33404.  
  33405. struct param_type
  33406. {
  33407. typedef poisson_distribution < _IntType > distribution_type ;
  33408. friend class poisson_distribution < _IntType > ;
  33409.  
  33410. explicit
  33411. param_type ( double __mean = 1.0 )
  33412. : _M_mean ( __mean )
  33413. {
  33414. ;
  33415. _M_initialize ( ) ;
  33416. }
  33417.  
  33418. double
  33419. mean ( ) const
  33420. { return _M_mean ; }
  33421.  
  33422. friend bool
  33423. operator == ( const param_type & __p1 , const param_type & __p2 )
  33424. { return __p1 . _M_mean == __p2 . _M_mean ; }
  33425.  
  33426. private :
  33427.  
  33428. void
  33429. _M_initialize ( ) ;
  33430.  
  33431. double _M_mean ;
  33432.  
  33433. double _M_lm_thr ;
  33434.  
  33435. double _M_lfm , _M_sm , _M_d , _M_scx , _M_1cx , _M_c2b , _M_cb ;
  33436.  
  33437. } ;
  33438.  
  33439.  
  33440. explicit
  33441. poisson_distribution ( double __mean = 1.0 )
  33442. : _M_param ( __mean ) , _M_nd ( )
  33443. { }
  33444.  
  33445. explicit
  33446. poisson_distribution ( const param_type & __p )
  33447. : _M_param ( __p ) , _M_nd ( )
  33448. { }
  33449.  
  33450.  
  33451.  
  33452.  
  33453. void
  33454. reset ( )
  33455. { _M_nd . reset ( ) ; }
  33456.  
  33457.  
  33458.  
  33459.  
  33460. double
  33461. mean ( ) const
  33462. { return _M_param . mean ( ) ; }
  33463.  
  33464.  
  33465.  
  33466.  
  33467. param_type
  33468. param ( ) const
  33469. { return _M_param ; }
  33470.  
  33471.  
  33472.  
  33473.  
  33474.  
  33475. void
  33476. param ( const param_type & __param )
  33477. { _M_param = __param ; }
  33478.  
  33479.  
  33480.  
  33481.  
  33482. result_type
  33483. min ( ) const
  33484. { return 0 ; }
  33485.  
  33486.  
  33487.  
  33488.  
  33489. result_type
  33490. max ( ) const
  33491. { return std :: numeric_limits < result_type > :: max ( ) ; }
  33492.  
  33493.  
  33494.  
  33495.  
  33496. template < typename _UniformRandomNumberGenerator >
  33497. result_type
  33498. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  33499. { return this -> operator ( ) ( __urng , _M_param ) ; }
  33500.  
  33501. template < typename _UniformRandomNumberGenerator >
  33502. result_type
  33503. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  33504. const param_type & __p ) ;
  33505.  
  33506. template < typename _ForwardIterator ,
  33507. typename _UniformRandomNumberGenerator >
  33508. void
  33509. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33510. _UniformRandomNumberGenerator & __urng )
  33511. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  33512.  
  33513. template < typename _ForwardIterator ,
  33514. typename _UniformRandomNumberGenerator >
  33515. void
  33516. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33517. _UniformRandomNumberGenerator & __urng ,
  33518. const param_type & __p )
  33519. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33520.  
  33521. template < typename _UniformRandomNumberGenerator >
  33522. void
  33523. __generate ( result_type * __f , result_type * __t ,
  33524. _UniformRandomNumberGenerator & __urng ,
  33525. const param_type & __p )
  33526. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33527. #4567
  33528. friend bool
  33529. operator == ( const poisson_distribution & __d1 ,
  33530. const poisson_distribution & __d2 )
  33531.  
  33532. { return __d1 . _M_param == __d2 . _M_param && __d1 . _M_nd == __d2 . _M_nd ; }
  33533. #4586
  33534. template < typename _IntType1 , typename _CharT , typename _Traits >
  33535. friend std :: basic_ostream < _CharT , _Traits > &
  33536. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  33537. const std :: poisson_distribution < _IntType1 > & __x ) ;
  33538. #4601
  33539. template < typename _IntType1 , typename _CharT , typename _Traits >
  33540. friend std :: basic_istream < _CharT , _Traits > &
  33541. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  33542. std :: poisson_distribution < _IntType1 > & __x ) ;
  33543.  
  33544. private :
  33545. template < typename _ForwardIterator ,
  33546. typename _UniformRandomNumberGenerator >
  33547. void
  33548. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33549. _UniformRandomNumberGenerator & __urng ,
  33550. const param_type & __p ) ;
  33551.  
  33552. param_type _M_param ;
  33553.  
  33554.  
  33555. std :: normal_distribution < double > _M_nd ;
  33556. } ;
  33557.  
  33558.  
  33559.  
  33560.  
  33561. template < typename _IntType >
  33562. inline bool
  33563. operator != ( const std :: poisson_distribution < _IntType > & __d1 ,
  33564. const std :: poisson_distribution < _IntType > & __d2 )
  33565. { return ! ( __d1 == __d2 ) ; }
  33566. #4645
  33567. template < typename _RealType = double >
  33568. class exponential_distribution
  33569. {
  33570. static_assert ( std :: is_floating_point < _RealType > :: value ,
  33571. "template argument not a floating point type" ) ;
  33572.  
  33573. public :
  33574.  
  33575. typedef _RealType result_type ;
  33576.  
  33577. struct param_type
  33578. {
  33579. typedef exponential_distribution < _RealType > distribution_type ;
  33580.  
  33581. explicit
  33582. param_type ( _RealType __lambda = _RealType ( 1 ) )
  33583. : _M_lambda ( __lambda )
  33584. {
  33585. ;
  33586. }
  33587.  
  33588. _RealType
  33589. lambda ( ) const
  33590. { return _M_lambda ; }
  33591.  
  33592. friend bool
  33593. operator == ( const param_type & __p1 , const param_type & __p2 )
  33594. { return __p1 . _M_lambda == __p2 . _M_lambda ; }
  33595.  
  33596. private :
  33597. _RealType _M_lambda ;
  33598. } ;
  33599.  
  33600. public :
  33601.  
  33602.  
  33603.  
  33604.  
  33605. explicit
  33606. exponential_distribution ( const result_type & __lambda = result_type ( 1 ) )
  33607. : _M_param ( __lambda )
  33608. { }
  33609.  
  33610. explicit
  33611. exponential_distribution ( const param_type & __p )
  33612. : _M_param ( __p )
  33613. { }
  33614. #4698
  33615. void
  33616. reset ( ) { }
  33617.  
  33618.  
  33619.  
  33620.  
  33621. _RealType
  33622. lambda ( ) const
  33623. { return _M_param . lambda ( ) ; }
  33624.  
  33625.  
  33626.  
  33627.  
  33628. param_type
  33629. param ( ) const
  33630. { return _M_param ; }
  33631.  
  33632.  
  33633.  
  33634.  
  33635.  
  33636. void
  33637. param ( const param_type & __param )
  33638. { _M_param = __param ; }
  33639.  
  33640.  
  33641.  
  33642.  
  33643. result_type
  33644. min ( ) const
  33645. { return result_type ( 0 ) ; }
  33646.  
  33647.  
  33648.  
  33649.  
  33650. result_type
  33651. max ( ) const
  33652. { return std :: numeric_limits < result_type > :: max ( ) ; }
  33653.  
  33654.  
  33655.  
  33656.  
  33657. template < typename _UniformRandomNumberGenerator >
  33658. result_type
  33659. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  33660. { return this -> operator ( ) ( __urng , _M_param ) ; }
  33661.  
  33662. template < typename _UniformRandomNumberGenerator >
  33663. result_type
  33664. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  33665. const param_type & __p )
  33666. {
  33667. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  33668. __aurng ( __urng ) ;
  33669. return - std :: log ( result_type ( 1 ) - __aurng ( ) ) / __p . lambda ( ) ;
  33670. }
  33671.  
  33672. template < typename _ForwardIterator ,
  33673. typename _UniformRandomNumberGenerator >
  33674. void
  33675. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33676. _UniformRandomNumberGenerator & __urng )
  33677. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  33678.  
  33679. template < typename _ForwardIterator ,
  33680. typename _UniformRandomNumberGenerator >
  33681. void
  33682. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33683. _UniformRandomNumberGenerator & __urng ,
  33684. const param_type & __p )
  33685. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33686.  
  33687. template < typename _UniformRandomNumberGenerator >
  33688. void
  33689. __generate ( result_type * __f , result_type * __t ,
  33690. _UniformRandomNumberGenerator & __urng ,
  33691. const param_type & __p )
  33692. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33693.  
  33694.  
  33695.  
  33696.  
  33697.  
  33698. friend bool
  33699. operator == ( const exponential_distribution & __d1 ,
  33700. const exponential_distribution & __d2 )
  33701. { return __d1 . _M_param == __d2 . _M_param ; }
  33702.  
  33703. private :
  33704. template < typename _ForwardIterator ,
  33705. typename _UniformRandomNumberGenerator >
  33706. void
  33707. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33708. _UniformRandomNumberGenerator & __urng ,
  33709. const param_type & __p ) ;
  33710.  
  33711. param_type _M_param ;
  33712. } ;
  33713.  
  33714.  
  33715.  
  33716.  
  33717.  
  33718. template < typename _RealType >
  33719. inline bool
  33720. operator != ( const std :: exponential_distribution < _RealType > & __d1 ,
  33721. const std :: exponential_distribution < _RealType > & __d2 )
  33722. { return ! ( __d1 == __d2 ) ; }
  33723. #4817
  33724. template < typename _RealType , typename _CharT , typename _Traits >
  33725. std :: basic_ostream < _CharT , _Traits > &
  33726. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  33727. const std :: exponential_distribution < _RealType > & __x ) ;
  33728. #4832
  33729. template < typename _RealType , typename _CharT , typename _Traits >
  33730. std :: basic_istream < _CharT , _Traits > &
  33731. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  33732. std :: exponential_distribution < _RealType > & __x ) ;
  33733. #4847
  33734. template < typename _RealType = double >
  33735. class weibull_distribution
  33736. {
  33737. static_assert ( std :: is_floating_point < _RealType > :: value ,
  33738. "template argument not a floating point type" ) ;
  33739.  
  33740. public :
  33741.  
  33742. typedef _RealType result_type ;
  33743.  
  33744. struct param_type
  33745. {
  33746. typedef weibull_distribution < _RealType > distribution_type ;
  33747.  
  33748. explicit
  33749. param_type ( _RealType __a = _RealType ( 1 ) ,
  33750. _RealType __b = _RealType ( 1 ) )
  33751. : _M_a ( __a ) , _M_b ( __b )
  33752. { }
  33753.  
  33754. _RealType
  33755. a ( ) const
  33756. { return _M_a ; }
  33757.  
  33758. _RealType
  33759. b ( ) const
  33760. { return _M_b ; }
  33761.  
  33762. friend bool
  33763. operator == ( const param_type & __p1 , const param_type & __p2 )
  33764. { return __p1 . _M_a == __p2 . _M_a && __p1 . _M_b == __p2 . _M_b ; }
  33765.  
  33766. private :
  33767. _RealType _M_a ;
  33768. _RealType _M_b ;
  33769. } ;
  33770.  
  33771. explicit
  33772. weibull_distribution ( _RealType __a = _RealType ( 1 ) ,
  33773. _RealType __b = _RealType ( 1 ) )
  33774. : _M_param ( __a , __b )
  33775. { }
  33776.  
  33777. explicit
  33778. weibull_distribution ( const param_type & __p )
  33779. : _M_param ( __p )
  33780. { }
  33781.  
  33782.  
  33783.  
  33784.  
  33785. void
  33786. reset ( )
  33787. { }
  33788.  
  33789.  
  33790.  
  33791.  
  33792. _RealType
  33793. a ( ) const
  33794. { return _M_param . a ( ) ; }
  33795.  
  33796.  
  33797.  
  33798.  
  33799. _RealType
  33800. b ( ) const
  33801. { return _M_param . b ( ) ; }
  33802.  
  33803.  
  33804.  
  33805.  
  33806. param_type
  33807. param ( ) const
  33808. { return _M_param ; }
  33809.  
  33810.  
  33811.  
  33812.  
  33813.  
  33814. void
  33815. param ( const param_type & __param )
  33816. { _M_param = __param ; }
  33817.  
  33818.  
  33819.  
  33820.  
  33821. result_type
  33822. min ( ) const
  33823. { return result_type ( 0 ) ; }
  33824.  
  33825.  
  33826.  
  33827.  
  33828. result_type
  33829. max ( ) const
  33830. { return std :: numeric_limits < result_type > :: max ( ) ; }
  33831.  
  33832.  
  33833.  
  33834.  
  33835. template < typename _UniformRandomNumberGenerator >
  33836. result_type
  33837. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  33838. { return this -> operator ( ) ( __urng , _M_param ) ; }
  33839.  
  33840. template < typename _UniformRandomNumberGenerator >
  33841. result_type
  33842. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  33843. const param_type & __p ) ;
  33844.  
  33845. template < typename _ForwardIterator ,
  33846. typename _UniformRandomNumberGenerator >
  33847. void
  33848. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33849. _UniformRandomNumberGenerator & __urng )
  33850. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  33851.  
  33852. template < typename _ForwardIterator ,
  33853. typename _UniformRandomNumberGenerator >
  33854. void
  33855. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  33856. _UniformRandomNumberGenerator & __urng ,
  33857. const param_type & __p )
  33858. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33859.  
  33860. template < typename _UniformRandomNumberGenerator >
  33861. void
  33862. __generate ( result_type * __f , result_type * __t ,
  33863. _UniformRandomNumberGenerator & __urng ,
  33864. const param_type & __p )
  33865. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  33866.  
  33867.  
  33868.  
  33869.  
  33870.  
  33871. friend bool
  33872. operator == ( const weibull_distribution & __d1 ,
  33873. const weibull_distribution & __d2 )
  33874. { return __d1 . _M_param == __d2 . _M_param ; }
  33875.  
  33876. private :
  33877. template < typename _ForwardIterator ,
  33878. typename _UniformRandomNumberGenerator >
  33879. void
  33880. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  33881. _UniformRandomNumberGenerator & __urng ,
  33882. const param_type & __p ) ;
  33883.  
  33884. param_type _M_param ;
  33885. } ;
  33886.  
  33887.  
  33888.  
  33889.  
  33890.  
  33891. template < typename _RealType >
  33892. inline bool
  33893. operator != ( const std :: weibull_distribution < _RealType > & __d1 ,
  33894. const std :: weibull_distribution < _RealType > & __d2 )
  33895. { return ! ( __d1 == __d2 ) ; }
  33896. #5020
  33897. template < typename _RealType , typename _CharT , typename _Traits >
  33898. std :: basic_ostream < _CharT , _Traits > &
  33899. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  33900. const std :: weibull_distribution < _RealType > & __x ) ;
  33901. #5035
  33902. template < typename _RealType , typename _CharT , typename _Traits >
  33903. std :: basic_istream < _CharT , _Traits > &
  33904. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  33905. std :: weibull_distribution < _RealType > & __x ) ;
  33906. #5050
  33907. template < typename _RealType = double >
  33908. class extreme_value_distribution
  33909. {
  33910. static_assert ( std :: is_floating_point < _RealType > :: value ,
  33911. "template argument not a floating point type" ) ;
  33912.  
  33913. public :
  33914.  
  33915. typedef _RealType result_type ;
  33916.  
  33917. struct param_type
  33918. {
  33919. typedef extreme_value_distribution < _RealType > distribution_type ;
  33920.  
  33921. explicit
  33922. param_type ( _RealType __a = _RealType ( 0 ) ,
  33923. _RealType __b = _RealType ( 1 ) )
  33924. : _M_a ( __a ) , _M_b ( __b )
  33925. { }
  33926.  
  33927. _RealType
  33928. a ( ) const
  33929. { return _M_a ; }
  33930.  
  33931. _RealType
  33932. b ( ) const
  33933. { return _M_b ; }
  33934.  
  33935. friend bool
  33936. operator == ( const param_type & __p1 , const param_type & __p2 )
  33937. { return __p1 . _M_a == __p2 . _M_a && __p1 . _M_b == __p2 . _M_b ; }
  33938.  
  33939. private :
  33940. _RealType _M_a ;
  33941. _RealType _M_b ;
  33942. } ;
  33943.  
  33944. explicit
  33945. extreme_value_distribution ( _RealType __a = _RealType ( 0 ) ,
  33946. _RealType __b = _RealType ( 1 ) )
  33947. : _M_param ( __a , __b )
  33948. { }
  33949.  
  33950. explicit
  33951. extreme_value_distribution ( const param_type & __p )
  33952. : _M_param ( __p )
  33953. { }
  33954.  
  33955.  
  33956.  
  33957.  
  33958. void
  33959. reset ( )
  33960. { }
  33961.  
  33962.  
  33963.  
  33964.  
  33965. _RealType
  33966. a ( ) const
  33967. { return _M_param . a ( ) ; }
  33968.  
  33969.  
  33970.  
  33971.  
  33972. _RealType
  33973. b ( ) const
  33974. { return _M_param . b ( ) ; }
  33975.  
  33976.  
  33977.  
  33978.  
  33979. param_type
  33980. param ( ) const
  33981. { return _M_param ; }
  33982.  
  33983.  
  33984.  
  33985.  
  33986.  
  33987. void
  33988. param ( const param_type & __param )
  33989. { _M_param = __param ; }
  33990.  
  33991.  
  33992.  
  33993.  
  33994. result_type
  33995. min ( ) const
  33996. { return std :: numeric_limits < result_type > :: lowest ( ) ; }
  33997.  
  33998.  
  33999.  
  34000.  
  34001. result_type
  34002. max ( ) const
  34003. { return std :: numeric_limits < result_type > :: max ( ) ; }
  34004.  
  34005.  
  34006.  
  34007.  
  34008. template < typename _UniformRandomNumberGenerator >
  34009. result_type
  34010. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  34011. { return this -> operator ( ) ( __urng , _M_param ) ; }
  34012.  
  34013. template < typename _UniformRandomNumberGenerator >
  34014. result_type
  34015. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  34016. const param_type & __p ) ;
  34017.  
  34018. template < typename _ForwardIterator ,
  34019. typename _UniformRandomNumberGenerator >
  34020. void
  34021. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34022. _UniformRandomNumberGenerator & __urng )
  34023. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  34024.  
  34025. template < typename _ForwardIterator ,
  34026. typename _UniformRandomNumberGenerator >
  34027. void
  34028. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34029. _UniformRandomNumberGenerator & __urng ,
  34030. const param_type & __p )
  34031. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34032.  
  34033. template < typename _UniformRandomNumberGenerator >
  34034. void
  34035. __generate ( result_type * __f , result_type * __t ,
  34036. _UniformRandomNumberGenerator & __urng ,
  34037. const param_type & __p )
  34038. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34039.  
  34040.  
  34041.  
  34042.  
  34043.  
  34044. friend bool
  34045. operator == ( const extreme_value_distribution & __d1 ,
  34046. const extreme_value_distribution & __d2 )
  34047. { return __d1 . _M_param == __d2 . _M_param ; }
  34048.  
  34049. private :
  34050. template < typename _ForwardIterator ,
  34051. typename _UniformRandomNumberGenerator >
  34052. void
  34053. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  34054. _UniformRandomNumberGenerator & __urng ,
  34055. const param_type & __p ) ;
  34056.  
  34057. param_type _M_param ;
  34058. } ;
  34059.  
  34060.  
  34061.  
  34062.  
  34063.  
  34064. template < typename _RealType >
  34065. inline bool
  34066. operator != ( const std :: extreme_value_distribution < _RealType > & __d1 ,
  34067. const std :: extreme_value_distribution < _RealType > & __d2 )
  34068. { return ! ( __d1 == __d2 ) ; }
  34069. #5223
  34070. template < typename _RealType , typename _CharT , typename _Traits >
  34071. std :: basic_ostream < _CharT , _Traits > &
  34072. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  34073. const std :: extreme_value_distribution < _RealType > & __x ) ;
  34074. #5238
  34075. template < typename _RealType , typename _CharT , typename _Traits >
  34076. std :: basic_istream < _CharT , _Traits > &
  34077. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  34078. std :: extreme_value_distribution < _RealType > & __x ) ;
  34079. #5250
  34080. template < typename _IntType = int >
  34081. class discrete_distribution
  34082. {
  34083. static_assert ( std :: is_integral < _IntType > :: value ,
  34084. "template argument not an integral type" ) ;
  34085.  
  34086. public :
  34087.  
  34088. typedef _IntType result_type ;
  34089.  
  34090. struct param_type
  34091. {
  34092. typedef discrete_distribution < _IntType > distribution_type ;
  34093. friend class discrete_distribution < _IntType > ;
  34094.  
  34095. param_type ( )
  34096. : _M_prob ( ) , _M_cp ( )
  34097. { }
  34098.  
  34099. template < typename _InputIterator >
  34100. param_type ( _InputIterator __wbegin ,
  34101. _InputIterator __wend )
  34102. : _M_prob ( __wbegin , __wend ) , _M_cp ( )
  34103. { _M_initialize ( ) ; }
  34104.  
  34105. param_type ( initializer_list < double > __wil )
  34106. : _M_prob ( __wil . begin ( ) , __wil . end ( ) ) , _M_cp ( )
  34107. { _M_initialize ( ) ; }
  34108.  
  34109. template < typename _Func >
  34110. param_type ( size_t __nw , double __xmin , double __xmax ,
  34111. _Func __fw ) ;
  34112.  
  34113.  
  34114. param_type ( const param_type & ) = default ;
  34115. param_type & operator = ( const param_type & ) = default ;
  34116.  
  34117. std :: vector < double >
  34118. probabilities ( ) const
  34119. { return _M_prob . empty ( ) ? std :: vector < double > ( 1 , 1.0 ) : _M_prob ; }
  34120.  
  34121. friend bool
  34122. operator == ( const param_type & __p1 , const param_type & __p2 )
  34123. { return __p1 . _M_prob == __p2 . _M_prob ; }
  34124.  
  34125. private :
  34126. void
  34127. _M_initialize ( ) ;
  34128.  
  34129. std :: vector < double > _M_prob ;
  34130. std :: vector < double > _M_cp ;
  34131. } ;
  34132.  
  34133. discrete_distribution ( )
  34134. : _M_param ( )
  34135. { }
  34136.  
  34137. template < typename _InputIterator >
  34138. discrete_distribution ( _InputIterator __wbegin ,
  34139. _InputIterator __wend )
  34140. : _M_param ( __wbegin , __wend )
  34141. { }
  34142.  
  34143. discrete_distribution ( initializer_list < double > __wl )
  34144. : _M_param ( __wl )
  34145. { }
  34146.  
  34147. template < typename _Func >
  34148. discrete_distribution ( size_t __nw , double __xmin , double __xmax ,
  34149. _Func __fw )
  34150. : _M_param ( __nw , __xmin , __xmax , __fw )
  34151. { }
  34152.  
  34153. explicit
  34154. discrete_distribution ( const param_type & __p )
  34155. : _M_param ( __p )
  34156. { }
  34157.  
  34158.  
  34159.  
  34160.  
  34161. void
  34162. reset ( )
  34163. { }
  34164.  
  34165.  
  34166.  
  34167.  
  34168. std :: vector < double >
  34169. probabilities ( ) const
  34170. {
  34171. return _M_param . _M_prob . empty ( )
  34172. ? std :: vector < double > ( 1 , 1.0 ) : _M_param . _M_prob ;
  34173. }
  34174.  
  34175.  
  34176.  
  34177.  
  34178. param_type
  34179. param ( ) const
  34180. { return _M_param ; }
  34181.  
  34182.  
  34183.  
  34184.  
  34185.  
  34186. void
  34187. param ( const param_type & __param )
  34188. { _M_param = __param ; }
  34189.  
  34190.  
  34191.  
  34192.  
  34193. result_type
  34194. min ( ) const
  34195. { return result_type ( 0 ) ; }
  34196.  
  34197.  
  34198.  
  34199.  
  34200. result_type
  34201. max ( ) const
  34202. {
  34203. return _M_param . _M_prob . empty ( )
  34204. ? result_type ( 0 ) : result_type ( _M_param . _M_prob . size ( ) - 1 ) ;
  34205. }
  34206.  
  34207.  
  34208.  
  34209.  
  34210. template < typename _UniformRandomNumberGenerator >
  34211. result_type
  34212. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  34213. { return this -> operator ( ) ( __urng , _M_param ) ; }
  34214.  
  34215. template < typename _UniformRandomNumberGenerator >
  34216. result_type
  34217. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  34218. const param_type & __p ) ;
  34219.  
  34220. template < typename _ForwardIterator ,
  34221. typename _UniformRandomNumberGenerator >
  34222. void
  34223. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34224. _UniformRandomNumberGenerator & __urng )
  34225. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  34226.  
  34227. template < typename _ForwardIterator ,
  34228. typename _UniformRandomNumberGenerator >
  34229. void
  34230. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34231. _UniformRandomNumberGenerator & __urng ,
  34232. const param_type & __p )
  34233. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34234.  
  34235. template < typename _UniformRandomNumberGenerator >
  34236. void
  34237. __generate ( result_type * __f , result_type * __t ,
  34238. _UniformRandomNumberGenerator & __urng ,
  34239. const param_type & __p )
  34240. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34241.  
  34242.  
  34243.  
  34244.  
  34245.  
  34246. friend bool
  34247. operator == ( const discrete_distribution & __d1 ,
  34248. const discrete_distribution & __d2 )
  34249. { return __d1 . _M_param == __d2 . _M_param ; }
  34250. #5431
  34251. template < typename _IntType1 , typename _CharT , typename _Traits >
  34252. friend std :: basic_ostream < _CharT , _Traits > &
  34253. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  34254. const std :: discrete_distribution < _IntType1 > & __x ) ;
  34255. #5447
  34256. template < typename _IntType1 , typename _CharT , typename _Traits >
  34257. friend std :: basic_istream < _CharT , _Traits > &
  34258. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  34259. std :: discrete_distribution < _IntType1 > & __x ) ;
  34260.  
  34261. private :
  34262. template < typename _ForwardIterator ,
  34263. typename _UniformRandomNumberGenerator >
  34264. void
  34265. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  34266. _UniformRandomNumberGenerator & __urng ,
  34267. const param_type & __p ) ;
  34268.  
  34269. param_type _M_param ;
  34270. } ;
  34271.  
  34272.  
  34273.  
  34274.  
  34275.  
  34276. template < typename _IntType >
  34277. inline bool
  34278. operator != ( const std :: discrete_distribution < _IntType > & __d1 ,
  34279. const std :: discrete_distribution < _IntType > & __d2 )
  34280. { return ! ( __d1 == __d2 ) ; }
  34281. #5480
  34282. template < typename _RealType = double >
  34283. class piecewise_constant_distribution
  34284. {
  34285. static_assert ( std :: is_floating_point < _RealType > :: value ,
  34286. "template argument not a floating point type" ) ;
  34287.  
  34288. public :
  34289.  
  34290. typedef _RealType result_type ;
  34291.  
  34292. struct param_type
  34293. {
  34294. typedef piecewise_constant_distribution < _RealType > distribution_type ;
  34295. friend class piecewise_constant_distribution < _RealType > ;
  34296.  
  34297. param_type ( )
  34298. : _M_int ( ) , _M_den ( ) , _M_cp ( )
  34299. { }
  34300.  
  34301. template < typename _InputIteratorB , typename _InputIteratorW >
  34302. param_type ( _InputIteratorB __bfirst ,
  34303. _InputIteratorB __bend ,
  34304. _InputIteratorW __wbegin ) ;
  34305.  
  34306. template < typename _Func >
  34307. param_type ( initializer_list < _RealType > __bi , _Func __fw ) ;
  34308.  
  34309. template < typename _Func >
  34310. param_type ( size_t __nw , _RealType __xmin , _RealType __xmax ,
  34311. _Func __fw ) ;
  34312.  
  34313.  
  34314. param_type ( const param_type & ) = default ;
  34315. param_type & operator = ( const param_type & ) = default ;
  34316.  
  34317. std :: vector < _RealType >
  34318. intervals ( ) const
  34319. {
  34320. if ( _M_int . empty ( ) )
  34321. {
  34322. std :: vector < _RealType > __tmp ( 2 ) ;
  34323. __tmp [ 1 ] = _RealType ( 1 ) ;
  34324. return __tmp ;
  34325. }
  34326. else
  34327. return _M_int ;
  34328. }
  34329.  
  34330. std :: vector < double >
  34331. densities ( ) const
  34332. { return _M_den . empty ( ) ? std :: vector < double > ( 1 , 1.0 ) : _M_den ; }
  34333.  
  34334. friend bool
  34335. operator == ( const param_type & __p1 , const param_type & __p2 )
  34336. { return __p1 . _M_int == __p2 . _M_int && __p1 . _M_den == __p2 . _M_den ; }
  34337.  
  34338. private :
  34339. void
  34340. _M_initialize ( ) ;
  34341.  
  34342. std :: vector < _RealType > _M_int ;
  34343. std :: vector < double > _M_den ;
  34344. std :: vector < double > _M_cp ;
  34345. } ;
  34346.  
  34347. explicit
  34348. piecewise_constant_distribution ( )
  34349. : _M_param ( )
  34350. { }
  34351.  
  34352. template < typename _InputIteratorB , typename _InputIteratorW >
  34353. piecewise_constant_distribution ( _InputIteratorB __bfirst ,
  34354. _InputIteratorB __bend ,
  34355. _InputIteratorW __wbegin )
  34356. : _M_param ( __bfirst , __bend , __wbegin )
  34357. { }
  34358.  
  34359. template < typename _Func >
  34360. piecewise_constant_distribution ( initializer_list < _RealType > __bl ,
  34361. _Func __fw )
  34362. : _M_param ( __bl , __fw )
  34363. { }
  34364.  
  34365. template < typename _Func >
  34366. piecewise_constant_distribution ( size_t __nw ,
  34367. _RealType __xmin , _RealType __xmax ,
  34368. _Func __fw )
  34369. : _M_param ( __nw , __xmin , __xmax , __fw )
  34370. { }
  34371.  
  34372. explicit
  34373. piecewise_constant_distribution ( const param_type & __p )
  34374. : _M_param ( __p )
  34375. { }
  34376.  
  34377.  
  34378.  
  34379.  
  34380. void
  34381. reset ( )
  34382. { }
  34383.  
  34384.  
  34385.  
  34386.  
  34387. std :: vector < _RealType >
  34388. intervals ( ) const
  34389. {
  34390. if ( _M_param . _M_int . empty ( ) )
  34391. {
  34392. std :: vector < _RealType > __tmp ( 2 ) ;
  34393. __tmp [ 1 ] = _RealType ( 1 ) ;
  34394. return __tmp ;
  34395. }
  34396. else
  34397. return _M_param . _M_int ;
  34398. }
  34399.  
  34400.  
  34401.  
  34402.  
  34403. std :: vector < double >
  34404. densities ( ) const
  34405. {
  34406. return _M_param . _M_den . empty ( )
  34407. ? std :: vector < double > ( 1 , 1.0 ) : _M_param . _M_den ;
  34408. }
  34409.  
  34410.  
  34411.  
  34412.  
  34413. param_type
  34414. param ( ) const
  34415. { return _M_param ; }
  34416.  
  34417.  
  34418.  
  34419.  
  34420.  
  34421. void
  34422. param ( const param_type & __param )
  34423. { _M_param = __param ; }
  34424.  
  34425.  
  34426.  
  34427.  
  34428. result_type
  34429. min ( ) const
  34430. {
  34431. return _M_param . _M_int . empty ( )
  34432. ? result_type ( 0 ) : _M_param . _M_int . front ( ) ;
  34433. }
  34434.  
  34435.  
  34436.  
  34437.  
  34438. result_type
  34439. max ( ) const
  34440. {
  34441. return _M_param . _M_int . empty ( )
  34442. ? result_type ( 1 ) : _M_param . _M_int . back ( ) ;
  34443. }
  34444.  
  34445.  
  34446.  
  34447.  
  34448. template < typename _UniformRandomNumberGenerator >
  34449. result_type
  34450. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  34451. { return this -> operator ( ) ( __urng , _M_param ) ; }
  34452.  
  34453. template < typename _UniformRandomNumberGenerator >
  34454. result_type
  34455. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  34456. const param_type & __p ) ;
  34457.  
  34458. template < typename _ForwardIterator ,
  34459. typename _UniformRandomNumberGenerator >
  34460. void
  34461. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34462. _UniformRandomNumberGenerator & __urng )
  34463. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  34464.  
  34465. template < typename _ForwardIterator ,
  34466. typename _UniformRandomNumberGenerator >
  34467. void
  34468. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34469. _UniformRandomNumberGenerator & __urng ,
  34470. const param_type & __p )
  34471. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34472.  
  34473. template < typename _UniformRandomNumberGenerator >
  34474. void
  34475. __generate ( result_type * __f , result_type * __t ,
  34476. _UniformRandomNumberGenerator & __urng ,
  34477. const param_type & __p )
  34478. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34479.  
  34480.  
  34481.  
  34482.  
  34483.  
  34484. friend bool
  34485. operator == ( const piecewise_constant_distribution & __d1 ,
  34486. const piecewise_constant_distribution & __d2 )
  34487. { return __d1 . _M_param == __d2 . _M_param ; }
  34488. #5698
  34489. template < typename _RealType1 , typename _CharT , typename _Traits >
  34490. friend std :: basic_ostream < _CharT , _Traits > &
  34491. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  34492. const std :: piecewise_constant_distribution < _RealType1 > & __x ) ;
  34493. #5714
  34494. template < typename _RealType1 , typename _CharT , typename _Traits >
  34495. friend std :: basic_istream < _CharT , _Traits > &
  34496. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  34497. std :: piecewise_constant_distribution < _RealType1 > & __x ) ;
  34498.  
  34499. private :
  34500. template < typename _ForwardIterator ,
  34501. typename _UniformRandomNumberGenerator >
  34502. void
  34503. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  34504. _UniformRandomNumberGenerator & __urng ,
  34505. const param_type & __p ) ;
  34506.  
  34507. param_type _M_param ;
  34508. } ;
  34509.  
  34510.  
  34511.  
  34512.  
  34513.  
  34514. template < typename _RealType >
  34515. inline bool
  34516. operator != ( const std :: piecewise_constant_distribution < _RealType > & __d1 ,
  34517. const std :: piecewise_constant_distribution < _RealType > & __d2 )
  34518. { return ! ( __d1 == __d2 ) ; }
  34519. #5747
  34520. template < typename _RealType = double >
  34521. class piecewise_linear_distribution
  34522. {
  34523. static_assert ( std :: is_floating_point < _RealType > :: value ,
  34524. "template argument not a floating point type" ) ;
  34525.  
  34526. public :
  34527.  
  34528. typedef _RealType result_type ;
  34529.  
  34530. struct param_type
  34531. {
  34532. typedef piecewise_linear_distribution < _RealType > distribution_type ;
  34533. friend class piecewise_linear_distribution < _RealType > ;
  34534.  
  34535. param_type ( )
  34536. : _M_int ( ) , _M_den ( ) , _M_cp ( ) , _M_m ( )
  34537. { }
  34538.  
  34539. template < typename _InputIteratorB , typename _InputIteratorW >
  34540. param_type ( _InputIteratorB __bfirst ,
  34541. _InputIteratorB __bend ,
  34542. _InputIteratorW __wbegin ) ;
  34543.  
  34544. template < typename _Func >
  34545. param_type ( initializer_list < _RealType > __bl , _Func __fw ) ;
  34546.  
  34547. template < typename _Func >
  34548. param_type ( size_t __nw , _RealType __xmin , _RealType __xmax ,
  34549. _Func __fw ) ;
  34550.  
  34551.  
  34552. param_type ( const param_type & ) = default ;
  34553. param_type & operator = ( const param_type & ) = default ;
  34554.  
  34555. std :: vector < _RealType >
  34556. intervals ( ) const
  34557. {
  34558. if ( _M_int . empty ( ) )
  34559. {
  34560. std :: vector < _RealType > __tmp ( 2 ) ;
  34561. __tmp [ 1 ] = _RealType ( 1 ) ;
  34562. return __tmp ;
  34563. }
  34564. else
  34565. return _M_int ;
  34566. }
  34567.  
  34568. std :: vector < double >
  34569. densities ( ) const
  34570. { return _M_den . empty ( ) ? std :: vector < double > ( 2 , 1.0 ) : _M_den ; }
  34571.  
  34572. friend bool
  34573. operator == ( const param_type & __p1 , const param_type & __p2 )
  34574. { return ( __p1 . _M_int == __p2 . _M_int
  34575. && __p1 . _M_den == __p2 . _M_den ) ; }
  34576.  
  34577. private :
  34578. void
  34579. _M_initialize ( ) ;
  34580.  
  34581. std :: vector < _RealType > _M_int ;
  34582. std :: vector < double > _M_den ;
  34583. std :: vector < double > _M_cp ;
  34584. std :: vector < double > _M_m ;
  34585. } ;
  34586.  
  34587. explicit
  34588. piecewise_linear_distribution ( )
  34589. : _M_param ( )
  34590. { }
  34591.  
  34592. template < typename _InputIteratorB , typename _InputIteratorW >
  34593. piecewise_linear_distribution ( _InputIteratorB __bfirst ,
  34594. _InputIteratorB __bend ,
  34595. _InputIteratorW __wbegin )
  34596. : _M_param ( __bfirst , __bend , __wbegin )
  34597. { }
  34598.  
  34599. template < typename _Func >
  34600. piecewise_linear_distribution ( initializer_list < _RealType > __bl ,
  34601. _Func __fw )
  34602. : _M_param ( __bl , __fw )
  34603. { }
  34604.  
  34605. template < typename _Func >
  34606. piecewise_linear_distribution ( size_t __nw ,
  34607. _RealType __xmin , _RealType __xmax ,
  34608. _Func __fw )
  34609. : _M_param ( __nw , __xmin , __xmax , __fw )
  34610. { }
  34611.  
  34612. explicit
  34613. piecewise_linear_distribution ( const param_type & __p )
  34614. : _M_param ( __p )
  34615. { }
  34616.  
  34617.  
  34618.  
  34619.  
  34620. void
  34621. reset ( )
  34622. { }
  34623.  
  34624.  
  34625.  
  34626.  
  34627. std :: vector < _RealType >
  34628. intervals ( ) const
  34629. {
  34630. if ( _M_param . _M_int . empty ( ) )
  34631. {
  34632. std :: vector < _RealType > __tmp ( 2 ) ;
  34633. __tmp [ 1 ] = _RealType ( 1 ) ;
  34634. return __tmp ;
  34635. }
  34636. else
  34637. return _M_param . _M_int ;
  34638. }
  34639.  
  34640.  
  34641.  
  34642.  
  34643.  
  34644. std :: vector < double >
  34645. densities ( ) const
  34646. {
  34647. return _M_param . _M_den . empty ( )
  34648. ? std :: vector < double > ( 2 , 1.0 ) : _M_param . _M_den ;
  34649. }
  34650.  
  34651.  
  34652.  
  34653.  
  34654. param_type
  34655. param ( ) const
  34656. { return _M_param ; }
  34657.  
  34658.  
  34659.  
  34660.  
  34661.  
  34662. void
  34663. param ( const param_type & __param )
  34664. { _M_param = __param ; }
  34665.  
  34666.  
  34667.  
  34668.  
  34669. result_type
  34670. min ( ) const
  34671. {
  34672. return _M_param . _M_int . empty ( )
  34673. ? result_type ( 0 ) : _M_param . _M_int . front ( ) ;
  34674. }
  34675.  
  34676.  
  34677.  
  34678.  
  34679. result_type
  34680. max ( ) const
  34681. {
  34682. return _M_param . _M_int . empty ( )
  34683. ? result_type ( 1 ) : _M_param . _M_int . back ( ) ;
  34684. }
  34685.  
  34686.  
  34687.  
  34688.  
  34689. template < typename _UniformRandomNumberGenerator >
  34690. result_type
  34691. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  34692. { return this -> operator ( ) ( __urng , _M_param ) ; }
  34693.  
  34694. template < typename _UniformRandomNumberGenerator >
  34695. result_type
  34696. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  34697. const param_type & __p ) ;
  34698.  
  34699. template < typename _ForwardIterator ,
  34700. typename _UniformRandomNumberGenerator >
  34701. void
  34702. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34703. _UniformRandomNumberGenerator & __urng )
  34704. { this -> __generate ( __f , __t , __urng , _M_param ) ; }
  34705.  
  34706. template < typename _ForwardIterator ,
  34707. typename _UniformRandomNumberGenerator >
  34708. void
  34709. __generate ( _ForwardIterator __f , _ForwardIterator __t ,
  34710. _UniformRandomNumberGenerator & __urng ,
  34711. const param_type & __p )
  34712. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34713.  
  34714. template < typename _UniformRandomNumberGenerator >
  34715. void
  34716. __generate ( result_type * __f , result_type * __t ,
  34717. _UniformRandomNumberGenerator & __urng ,
  34718. const param_type & __p )
  34719. { this -> __generate_impl ( __f , __t , __urng , __p ) ; }
  34720.  
  34721.  
  34722.  
  34723.  
  34724.  
  34725. friend bool
  34726. operator == ( const piecewise_linear_distribution & __d1 ,
  34727. const piecewise_linear_distribution & __d2 )
  34728. { return __d1 . _M_param == __d2 . _M_param ; }
  34729. #5968
  34730. template < typename _RealType1 , typename _CharT , typename _Traits >
  34731. friend std :: basic_ostream < _CharT , _Traits > &
  34732. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  34733. const std :: piecewise_linear_distribution < _RealType1 > & __x ) ;
  34734. #5984
  34735. template < typename _RealType1 , typename _CharT , typename _Traits >
  34736. friend std :: basic_istream < _CharT , _Traits > &
  34737. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  34738. std :: piecewise_linear_distribution < _RealType1 > & __x ) ;
  34739.  
  34740. private :
  34741. template < typename _ForwardIterator ,
  34742. typename _UniformRandomNumberGenerator >
  34743. void
  34744. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  34745. _UniformRandomNumberGenerator & __urng ,
  34746. const param_type & __p ) ;
  34747.  
  34748. param_type _M_param ;
  34749. } ;
  34750.  
  34751.  
  34752.  
  34753.  
  34754.  
  34755. template < typename _RealType >
  34756. inline bool
  34757. operator != ( const std :: piecewise_linear_distribution < _RealType > & __d1 ,
  34758. const std :: piecewise_linear_distribution < _RealType > & __d2 )
  34759. { return ! ( __d1 == __d2 ) ; }
  34760. #6025
  34761. class seed_seq
  34762. {
  34763.  
  34764. public :
  34765.  
  34766. typedef uint_least32_t result_type ;
  34767.  
  34768.  
  34769. seed_seq ( )
  34770. : _M_v ( )
  34771. { }
  34772.  
  34773. template < typename _IntType >
  34774. seed_seq ( std :: initializer_list < _IntType > il ) ;
  34775.  
  34776. template < typename _InputIterator >
  34777. seed_seq ( _InputIterator __begin , _InputIterator __end ) ;
  34778.  
  34779.  
  34780. template < typename _RandomAccessIterator >
  34781. void
  34782. generate ( _RandomAccessIterator __begin , _RandomAccessIterator __end ) ;
  34783.  
  34784.  
  34785. size_t size ( ) const
  34786. { return _M_v . size ( ) ; }
  34787.  
  34788. template < typename OutputIterator >
  34789. void
  34790. param ( OutputIterator __dest ) const
  34791. { std :: copy ( _M_v . begin ( ) , _M_v . end ( ) , __dest ) ; }
  34792.  
  34793. private :
  34794.  
  34795. std :: vector < result_type > _M_v ;
  34796. } ;
  34797. #6067
  34798. }
  34799. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/opt_random.h"
  34800. #33
  34801. #pragma GCC system_header
  34802. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/random.tcc"
  34803. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/numeric"
  34804. #58
  34805. #pragma GCC system_header
  34806. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_numeric.h"
  34807. #65
  34808. namespace std
  34809. {
  34810. #80
  34811. template < typename _ForwardIterator , typename _Tp >
  34812. void
  34813. iota ( _ForwardIterator __first , _ForwardIterator __last , _Tp __value )
  34814. {
  34815.  
  34816.  
  34817.  
  34818.  
  34819.  
  34820. ;
  34821.  
  34822. for ( ; __first != __last ; ++ __first )
  34823. {
  34824. * __first = __value ;
  34825. ++ __value ;
  34826. }
  34827. }
  34828.  
  34829.  
  34830. }
  34831.  
  34832.  
  34833.  
  34834. namespace std
  34835. {
  34836. #118
  34837. template < typename _InputIterator , typename _Tp >
  34838. inline _Tp
  34839. accumulate ( _InputIterator __first , _InputIterator __last , _Tp __init )
  34840. {
  34841.  
  34842.  
  34843. ;
  34844.  
  34845. for ( ; __first != __last ; ++ __first )
  34846. __init = __init + * __first ;
  34847. return __init ;
  34848. }
  34849. #144
  34850. template < typename _InputIterator , typename _Tp , typename _BinaryOperation >
  34851. inline _Tp
  34852. accumulate ( _InputIterator __first , _InputIterator __last , _Tp __init ,
  34853. _BinaryOperation __binary_op )
  34854. {
  34855.  
  34856.  
  34857. ;
  34858.  
  34859. for ( ; __first != __last ; ++ __first )
  34860. __init = __binary_op ( __init , * __first ) ;
  34861. return __init ;
  34862. }
  34863. #172
  34864. template < typename _InputIterator1 , typename _InputIterator2 , typename _Tp >
  34865. inline _Tp
  34866. inner_product ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  34867. _InputIterator2 __first2 , _Tp __init )
  34868. {
  34869.  
  34870.  
  34871.  
  34872. ;
  34873.  
  34874. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  34875. __init = __init + ( * __first1 * * __first2 ) ;
  34876. return __init ;
  34877. }
  34878. #203
  34879. template < typename _InputIterator1 , typename _InputIterator2 , typename _Tp ,
  34880. typename _BinaryOperation1 , typename _BinaryOperation2 >
  34881. inline _Tp
  34882. inner_product ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  34883. _InputIterator2 __first2 , _Tp __init ,
  34884. _BinaryOperation1 __binary_op1 ,
  34885. _BinaryOperation2 __binary_op2 )
  34886. {
  34887.  
  34888.  
  34889.  
  34890. ;
  34891.  
  34892. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  34893. __init = __binary_op1 ( __init , __binary_op2 ( * __first1 , * __first2 ) ) ;
  34894. return __init ;
  34895. }
  34896. #235
  34897. template < typename _InputIterator , typename _OutputIterator >
  34898. _OutputIterator
  34899. partial_sum ( _InputIterator __first , _InputIterator __last ,
  34900. _OutputIterator __result )
  34901. {
  34902. typedef typename iterator_traits < _InputIterator > :: value_type _ValueType ;
  34903.  
  34904.  
  34905.  
  34906.  
  34907.  
  34908. ;
  34909.  
  34910. if ( __first == __last )
  34911. return __result ;
  34912. _ValueType __value = * __first ;
  34913. * __result = __value ;
  34914. while ( ++ __first != __last )
  34915. {
  34916. __value = __value + * __first ;
  34917. * ++ __result = __value ;
  34918. }
  34919. return ++ __result ;
  34920. }
  34921. #275
  34922. template < typename _InputIterator , typename _OutputIterator ,
  34923. typename _BinaryOperation >
  34924. _OutputIterator
  34925. partial_sum ( _InputIterator __first , _InputIterator __last ,
  34926. _OutputIterator __result , _BinaryOperation __binary_op )
  34927. {
  34928. typedef typename iterator_traits < _InputIterator > :: value_type _ValueType ;
  34929.  
  34930.  
  34931.  
  34932.  
  34933.  
  34934. ;
  34935.  
  34936. if ( __first == __last )
  34937. return __result ;
  34938. _ValueType __value = * __first ;
  34939. * __result = __value ;
  34940. while ( ++ __first != __last )
  34941. {
  34942. __value = __binary_op ( __value , * __first ) ;
  34943. * ++ __result = __value ;
  34944. }
  34945. return ++ __result ;
  34946. }
  34947. #315
  34948. template < typename _InputIterator , typename _OutputIterator >
  34949. _OutputIterator
  34950. adjacent_difference ( _InputIterator __first ,
  34951. _InputIterator __last , _OutputIterator __result )
  34952. {
  34953. typedef typename iterator_traits < _InputIterator > :: value_type _ValueType ;
  34954.  
  34955.  
  34956.  
  34957.  
  34958.  
  34959. ;
  34960.  
  34961. if ( __first == __last )
  34962. return __result ;
  34963. _ValueType __value = * __first ;
  34964. * __result = __value ;
  34965. while ( ++ __first != __last )
  34966. {
  34967. _ValueType __tmp = * __first ;
  34968. * ++ __result = __tmp - __value ;
  34969. __value = std :: move ( __tmp ) ;
  34970. }
  34971. return ++ __result ;
  34972. }
  34973. #357
  34974. template < typename _InputIterator , typename _OutputIterator ,
  34975. typename _BinaryOperation >
  34976. _OutputIterator
  34977. adjacent_difference ( _InputIterator __first , _InputIterator __last ,
  34978. _OutputIterator __result , _BinaryOperation __binary_op )
  34979. {
  34980. typedef typename iterator_traits < _InputIterator > :: value_type _ValueType ;
  34981.  
  34982.  
  34983.  
  34984.  
  34985.  
  34986. ;
  34987.  
  34988. if ( __first == __last )
  34989. return __result ;
  34990. _ValueType __value = * __first ;
  34991. * __result = __value ;
  34992. while ( ++ __first != __last )
  34993. {
  34994. _ValueType __tmp = * __first ;
  34995. * ++ __result = __binary_op ( __tmp , __value ) ;
  34996. __value = std :: move ( __tmp ) ;
  34997. }
  34998. return ++ __result ;
  34999. }
  35000.  
  35001.  
  35002. }
  35003. #35 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/random.tcc"
  35004. namespace std
  35005. {
  35006.  
  35007.  
  35008.  
  35009. namespace __detail
  35010. {
  35011. #50
  35012. template < typename _Tp , _Tp __m , _Tp __a , _Tp __c >
  35013. _Tp
  35014. _Mod < _Tp , __m , __a , __c , false , true > ::
  35015. __calc ( _Tp __x )
  35016. {
  35017. if ( __a == 1 )
  35018. __x %= __m ;
  35019. else
  35020. {
  35021. static const _Tp __q = __m / __a ;
  35022. static const _Tp __r = __m % __a ;
  35023.  
  35024. _Tp __t1 = __a * ( __x % __q ) ;
  35025. _Tp __t2 = __r * ( __x / __q ) ;
  35026. if ( __t1 >= __t2 )
  35027. __x = __t1 - __t2 ;
  35028. else
  35029. __x = __m - __t2 + __t1 ;
  35030. }
  35031.  
  35032. if ( __c != 0 )
  35033. {
  35034. const _Tp __d = __m - __x ;
  35035. if ( __d > __c )
  35036. __x += __c ;
  35037. else
  35038. __x = __c - __d ;
  35039. }
  35040. return __x ;
  35041. }
  35042.  
  35043. template < typename _InputIterator , typename _OutputIterator ,
  35044. typename _Tp >
  35045. _OutputIterator
  35046. __normalize ( _InputIterator __first , _InputIterator __last ,
  35047. _OutputIterator __result , const _Tp & __factor )
  35048. {
  35049. for ( ; __first != __last ; ++ __first , ++ __result )
  35050. * __result = * __first / __factor ;
  35051. return __result ;
  35052. }
  35053.  
  35054.  
  35055. }
  35056.  
  35057.  
  35058.  
  35059. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  35060. constexpr _UIntType
  35061. linear_congruential_engine < _UIntType , __a , __c , __m > :: multiplier ;
  35062.  
  35063. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  35064. constexpr _UIntType
  35065. linear_congruential_engine < _UIntType , __a , __c , __m > :: increment ;
  35066.  
  35067. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  35068. constexpr _UIntType
  35069. linear_congruential_engine < _UIntType , __a , __c , __m > :: modulus ;
  35070.  
  35071. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  35072. constexpr _UIntType
  35073. linear_congruential_engine < _UIntType , __a , __c , __m > :: default_seed ;
  35074.  
  35075.  
  35076.  
  35077.  
  35078.  
  35079. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  35080. void
  35081. linear_congruential_engine < _UIntType , __a , __c , __m > ::
  35082. seed ( result_type __s )
  35083. {
  35084. if ( ( __detail :: __mod < _UIntType , __m > ( __c ) == 0 )
  35085. && ( __detail :: __mod < _UIntType , __m > ( __s ) == 0 ) )
  35086. _M_x = 1 ;
  35087. else
  35088. _M_x = __detail :: __mod < _UIntType , __m > ( __s ) ;
  35089. }
  35090.  
  35091.  
  35092.  
  35093.  
  35094. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m >
  35095. template < typename _Sseq >
  35096. typename std :: enable_if < std :: is_class < _Sseq > :: value > :: type
  35097. linear_congruential_engine < _UIntType , __a , __c , __m > ::
  35098. seed ( _Sseq & __q )
  35099. {
  35100. const _UIntType __k0 = __m == 0 ? std :: numeric_limits < _UIntType > :: digits
  35101. : std :: __lg ( __m ) ;
  35102. const _UIntType __k = ( __k0 + 31 ) / 32 ;
  35103. uint_least32_t __arr [ __k + 3 ] ;
  35104. __q . generate ( __arr + 0 , __arr + __k + 3 ) ;
  35105. _UIntType __factor = 1u ;
  35106. _UIntType __sum = 0u ;
  35107. for ( size_t __j = 0 ; __j < __k ; ++ __j )
  35108. {
  35109. __sum += __arr [ __j + 3 ] * __factor ;
  35110. __factor *= __detail :: _Shift < _UIntType , 32 > :: __value ;
  35111. }
  35112. seed ( __sum ) ;
  35113. }
  35114.  
  35115. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m ,
  35116. typename _CharT , typename _Traits >
  35117. std :: basic_ostream < _CharT , _Traits > &
  35118. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  35119. const linear_congruential_engine < _UIntType ,
  35120. __a , __c , __m > & __lcr )
  35121. {
  35122. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  35123. typedef typename __ostream_type :: ios_base __ios_base ;
  35124.  
  35125. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  35126. const _CharT __fill = __os . fill ( ) ;
  35127. __os . flags ( __ios_base :: dec | __ios_base :: fixed | __ios_base :: left ) ;
  35128. __os . fill ( __os . widen ( ' ' ) ) ;
  35129.  
  35130. __os << __lcr . _M_x ;
  35131.  
  35132. __os . flags ( __flags ) ;
  35133. __os . fill ( __fill ) ;
  35134. return __os ;
  35135. }
  35136.  
  35137. template < typename _UIntType , _UIntType __a , _UIntType __c , _UIntType __m ,
  35138. typename _CharT , typename _Traits >
  35139. std :: basic_istream < _CharT , _Traits > &
  35140. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  35141. linear_congruential_engine < _UIntType , __a , __c , __m > & __lcr )
  35142. {
  35143. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  35144. typedef typename __istream_type :: ios_base __ios_base ;
  35145.  
  35146. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  35147. __is . flags ( __ios_base :: dec ) ;
  35148.  
  35149. __is >> __lcr . _M_x ;
  35150.  
  35151. __is . flags ( __flags ) ;
  35152. return __is ;
  35153. }
  35154.  
  35155.  
  35156. template < typename _UIntType ,
  35157. size_t __w , size_t __n , size_t __m , size_t __r ,
  35158. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35159. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35160. _UIntType __f >
  35161. constexpr size_t
  35162. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35163. __s , __b , __t , __c , __l , __f > :: word_size ;
  35164.  
  35165. template < typename _UIntType ,
  35166. size_t __w , size_t __n , size_t __m , size_t __r ,
  35167. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35168. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35169. _UIntType __f >
  35170. constexpr size_t
  35171. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35172. __s , __b , __t , __c , __l , __f > :: state_size ;
  35173.  
  35174. template < typename _UIntType ,
  35175. size_t __w , size_t __n , size_t __m , size_t __r ,
  35176. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35177. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35178. _UIntType __f >
  35179. constexpr size_t
  35180. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35181. __s , __b , __t , __c , __l , __f > :: shift_size ;
  35182.  
  35183. template < typename _UIntType ,
  35184. size_t __w , size_t __n , size_t __m , size_t __r ,
  35185. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35186. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35187. _UIntType __f >
  35188. constexpr size_t
  35189. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35190. __s , __b , __t , __c , __l , __f > :: mask_bits ;
  35191.  
  35192. template < typename _UIntType ,
  35193. size_t __w , size_t __n , size_t __m , size_t __r ,
  35194. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35195. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35196. _UIntType __f >
  35197. constexpr _UIntType
  35198. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35199. __s , __b , __t , __c , __l , __f > :: xor_mask ;
  35200.  
  35201. template < typename _UIntType ,
  35202. size_t __w , size_t __n , size_t __m , size_t __r ,
  35203. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35204. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35205. _UIntType __f >
  35206. constexpr size_t
  35207. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35208. __s , __b , __t , __c , __l , __f > :: tempering_u ;
  35209.  
  35210. template < typename _UIntType ,
  35211. size_t __w , size_t __n , size_t __m , size_t __r ,
  35212. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35213. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35214. _UIntType __f >
  35215. constexpr _UIntType
  35216. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35217. __s , __b , __t , __c , __l , __f > :: tempering_d ;
  35218.  
  35219. template < typename _UIntType ,
  35220. size_t __w , size_t __n , size_t __m , size_t __r ,
  35221. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35222. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35223. _UIntType __f >
  35224. constexpr size_t
  35225. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35226. __s , __b , __t , __c , __l , __f > :: tempering_s ;
  35227.  
  35228. template < typename _UIntType ,
  35229. size_t __w , size_t __n , size_t __m , size_t __r ,
  35230. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35231. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35232. _UIntType __f >
  35233. constexpr _UIntType
  35234. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35235. __s , __b , __t , __c , __l , __f > :: tempering_b ;
  35236.  
  35237. template < typename _UIntType ,
  35238. size_t __w , size_t __n , size_t __m , size_t __r ,
  35239. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35240. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35241. _UIntType __f >
  35242. constexpr size_t
  35243. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35244. __s , __b , __t , __c , __l , __f > :: tempering_t ;
  35245.  
  35246. template < typename _UIntType ,
  35247. size_t __w , size_t __n , size_t __m , size_t __r ,
  35248. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35249. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35250. _UIntType __f >
  35251. constexpr _UIntType
  35252. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35253. __s , __b , __t , __c , __l , __f > :: tempering_c ;
  35254.  
  35255. template < typename _UIntType ,
  35256. size_t __w , size_t __n , size_t __m , size_t __r ,
  35257. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35258. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35259. _UIntType __f >
  35260. constexpr size_t
  35261. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35262. __s , __b , __t , __c , __l , __f > :: tempering_l ;
  35263.  
  35264. template < typename _UIntType ,
  35265. size_t __w , size_t __n , size_t __m , size_t __r ,
  35266. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35267. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35268. _UIntType __f >
  35269. constexpr _UIntType
  35270. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35271. __s , __b , __t , __c , __l , __f > ::
  35272. initialization_multiplier ;
  35273.  
  35274. template < typename _UIntType ,
  35275. size_t __w , size_t __n , size_t __m , size_t __r ,
  35276. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35277. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35278. _UIntType __f >
  35279. constexpr _UIntType
  35280. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35281. __s , __b , __t , __c , __l , __f > :: default_seed ;
  35282.  
  35283. template < typename _UIntType ,
  35284. size_t __w , size_t __n , size_t __m , size_t __r ,
  35285. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35286. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35287. _UIntType __f >
  35288. void
  35289. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35290. __s , __b , __t , __c , __l , __f > ::
  35291. seed ( result_type __sd )
  35292. {
  35293. _M_x [ 0 ] = __detail :: __mod < _UIntType ,
  35294. __detail :: _Shift < _UIntType , __w > :: __value > ( __sd ) ;
  35295.  
  35296. for ( size_t __i = 1 ; __i < state_size ; ++ __i )
  35297. {
  35298. _UIntType __x = _M_x [ __i - 1 ] ;
  35299. __x ^= __x >> ( __w - 2 ) ;
  35300. __x *= __f ;
  35301. __x += __detail :: __mod < _UIntType , __n > ( __i ) ;
  35302. _M_x [ __i ] = __detail :: __mod < _UIntType ,
  35303. __detail :: _Shift < _UIntType , __w > :: __value > ( __x ) ;
  35304. }
  35305. _M_p = state_size ;
  35306. }
  35307.  
  35308. template < typename _UIntType ,
  35309. size_t __w , size_t __n , size_t __m , size_t __r ,
  35310. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35311. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35312. _UIntType __f >
  35313. template < typename _Sseq >
  35314. typename std :: enable_if < std :: is_class < _Sseq > :: value > :: type
  35315. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35316. __s , __b , __t , __c , __l , __f > ::
  35317. seed ( _Sseq & __q )
  35318. {
  35319. const _UIntType __upper_mask = ( ~ _UIntType ( ) ) << __r ;
  35320. const size_t __k = ( __w + 31 ) / 32 ;
  35321. uint_least32_t __arr [ __n * __k ] ;
  35322. __q . generate ( __arr + 0 , __arr + __n * __k ) ;
  35323.  
  35324. bool __zero = true ;
  35325. for ( size_t __i = 0 ; __i < state_size ; ++ __i )
  35326. {
  35327. _UIntType __factor = 1u ;
  35328. _UIntType __sum = 0u ;
  35329. for ( size_t __j = 0 ; __j < __k ; ++ __j )
  35330. {
  35331. __sum += __arr [ __k * __i + __j ] * __factor ;
  35332. __factor *= __detail :: _Shift < _UIntType , 32 > :: __value ;
  35333. }
  35334. _M_x [ __i ] = __detail :: __mod < _UIntType ,
  35335. __detail :: _Shift < _UIntType , __w > :: __value > ( __sum ) ;
  35336.  
  35337. if ( __zero )
  35338. {
  35339. if ( __i == 0 )
  35340. {
  35341. if ( ( _M_x [ 0 ] & __upper_mask ) != 0u )
  35342. __zero = false ;
  35343. }
  35344. else if ( _M_x [ __i ] != 0u )
  35345. __zero = false ;
  35346. }
  35347. }
  35348. if ( __zero )
  35349. _M_x [ 0 ] = __detail :: _Shift < _UIntType , __w - 1 > :: __value ;
  35350. _M_p = state_size ;
  35351. }
  35352.  
  35353. template < typename _UIntType , size_t __w ,
  35354. size_t __n , size_t __m , size_t __r ,
  35355. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35356. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35357. _UIntType __f >
  35358. void
  35359. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35360. __s , __b , __t , __c , __l , __f > ::
  35361. _M_gen_rand ( void )
  35362. {
  35363. const _UIntType __upper_mask = ( ~ _UIntType ( ) ) << __r ;
  35364. const _UIntType __lower_mask = ~ __upper_mask ;
  35365.  
  35366. for ( size_t __k = 0 ; __k < ( __n - __m ) ; ++ __k )
  35367. {
  35368. _UIntType __y = ( ( _M_x [ __k ] & __upper_mask )
  35369. | ( _M_x [ __k + 1 ] & __lower_mask ) ) ;
  35370. _M_x [ __k ] = ( _M_x [ __k + __m ] ^ ( __y >> 1 )
  35371. ^ ( ( __y & 0x01 ) ? __a : 0 ) ) ;
  35372. }
  35373.  
  35374. for ( size_t __k = ( __n - __m ) ; __k < ( __n - 1 ) ; ++ __k )
  35375. {
  35376. _UIntType __y = ( ( _M_x [ __k ] & __upper_mask )
  35377. | ( _M_x [ __k + 1 ] & __lower_mask ) ) ;
  35378. _M_x [ __k ] = ( _M_x [ __k + ( __m - __n ) ] ^ ( __y >> 1 )
  35379. ^ ( ( __y & 0x01 ) ? __a : 0 ) ) ;
  35380. }
  35381.  
  35382. _UIntType __y = ( ( _M_x [ __n - 1 ] & __upper_mask )
  35383. | ( _M_x [ 0 ] & __lower_mask ) ) ;
  35384. _M_x [ __n - 1 ] = ( _M_x [ __m - 1 ] ^ ( __y >> 1 )
  35385. ^ ( ( __y & 0x01 ) ? __a : 0 ) ) ;
  35386. _M_p = 0 ;
  35387. }
  35388.  
  35389. template < typename _UIntType , size_t __w ,
  35390. size_t __n , size_t __m , size_t __r ,
  35391. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35392. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35393. _UIntType __f >
  35394. void
  35395. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35396. __s , __b , __t , __c , __l , __f > ::
  35397. discard ( unsigned long long __z )
  35398. {
  35399. while ( __z > state_size - _M_p )
  35400. {
  35401. __z -= state_size - _M_p ;
  35402. _M_gen_rand ( ) ;
  35403. }
  35404. _M_p += __z ;
  35405. }
  35406.  
  35407. template < typename _UIntType , size_t __w ,
  35408. size_t __n , size_t __m , size_t __r ,
  35409. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35410. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35411. _UIntType __f >
  35412. typename
  35413. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35414. __s , __b , __t , __c , __l , __f > :: result_type
  35415. mersenne_twister_engine < _UIntType , __w , __n , __m , __r , __a , __u , __d ,
  35416. __s , __b , __t , __c , __l , __f > ::
  35417. operator ( ) ( )
  35418. {
  35419.  
  35420. if ( _M_p >= state_size )
  35421. _M_gen_rand ( ) ;
  35422.  
  35423.  
  35424. result_type __z = _M_x [ _M_p ++ ] ;
  35425. __z ^= ( __z >> __u ) & __d ;
  35426. __z ^= ( __z << __s ) & __b ;
  35427. __z ^= ( __z << __t ) & __c ;
  35428. __z ^= ( __z >> __l ) ;
  35429.  
  35430. return __z ;
  35431. }
  35432.  
  35433. template < typename _UIntType , size_t __w ,
  35434. size_t __n , size_t __m , size_t __r ,
  35435. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35436. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35437. _UIntType __f , typename _CharT , typename _Traits >
  35438. std :: basic_ostream < _CharT , _Traits > &
  35439. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  35440. const mersenne_twister_engine < _UIntType , __w , __n , __m ,
  35441. __r , __a , __u , __d , __s , __b , __t , __c , __l , __f > & __x )
  35442. {
  35443. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  35444. typedef typename __ostream_type :: ios_base __ios_base ;
  35445.  
  35446. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  35447. const _CharT __fill = __os . fill ( ) ;
  35448. const _CharT __space = __os . widen ( ' ' ) ;
  35449. __os . flags ( __ios_base :: dec | __ios_base :: fixed | __ios_base :: left ) ;
  35450. __os . fill ( __space ) ;
  35451.  
  35452. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  35453. __os << __x . _M_x [ __i ] << __space ;
  35454. __os << __x . _M_p ;
  35455.  
  35456. __os . flags ( __flags ) ;
  35457. __os . fill ( __fill ) ;
  35458. return __os ;
  35459. }
  35460.  
  35461. template < typename _UIntType , size_t __w ,
  35462. size_t __n , size_t __m , size_t __r ,
  35463. _UIntType __a , size_t __u , _UIntType __d , size_t __s ,
  35464. _UIntType __b , size_t __t , _UIntType __c , size_t __l ,
  35465. _UIntType __f , typename _CharT , typename _Traits >
  35466. std :: basic_istream < _CharT , _Traits > &
  35467. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  35468. mersenne_twister_engine < _UIntType , __w , __n , __m ,
  35469. __r , __a , __u , __d , __s , __b , __t , __c , __l , __f > & __x )
  35470. {
  35471. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  35472. typedef typename __istream_type :: ios_base __ios_base ;
  35473.  
  35474. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  35475. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  35476.  
  35477. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  35478. __is >> __x . _M_x [ __i ] ;
  35479. __is >> __x . _M_p ;
  35480.  
  35481. __is . flags ( __flags ) ;
  35482. return __is ;
  35483. }
  35484.  
  35485.  
  35486. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35487. constexpr size_t
  35488. subtract_with_carry_engine < _UIntType , __w , __s , __r > :: word_size ;
  35489.  
  35490. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35491. constexpr size_t
  35492. subtract_with_carry_engine < _UIntType , __w , __s , __r > :: short_lag ;
  35493.  
  35494. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35495. constexpr size_t
  35496. subtract_with_carry_engine < _UIntType , __w , __s , __r > :: long_lag ;
  35497.  
  35498. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35499. constexpr _UIntType
  35500. subtract_with_carry_engine < _UIntType , __w , __s , __r > :: default_seed ;
  35501.  
  35502. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35503. void
  35504. subtract_with_carry_engine < _UIntType , __w , __s , __r > ::
  35505. seed ( result_type __value )
  35506. {
  35507. std :: linear_congruential_engine < result_type , 40014u , 0u , 2147483563u >
  35508. __lcg ( __value == 0u ? default_seed : __value ) ;
  35509.  
  35510. const size_t __n = ( __w + 31 ) / 32 ;
  35511.  
  35512. for ( size_t __i = 0 ; __i < long_lag ; ++ __i )
  35513. {
  35514. _UIntType __sum = 0u ;
  35515. _UIntType __factor = 1u ;
  35516. for ( size_t __j = 0 ; __j < __n ; ++ __j )
  35517. {
  35518. __sum += __detail :: __mod < uint_least32_t ,
  35519. __detail :: _Shift < uint_least32_t , 32 > :: __value >
  35520. ( __lcg ( ) ) * __factor ;
  35521. __factor *= __detail :: _Shift < _UIntType , 32 > :: __value ;
  35522. }
  35523. _M_x [ __i ] = __detail :: __mod < _UIntType ,
  35524. __detail :: _Shift < _UIntType , __w > :: __value > ( __sum ) ;
  35525. }
  35526. _M_carry = ( _M_x [ long_lag - 1 ] == 0 ) ? 1 : 0 ;
  35527. _M_p = 0 ;
  35528. }
  35529.  
  35530. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35531. template < typename _Sseq >
  35532. typename std :: enable_if < std :: is_class < _Sseq > :: value > :: type
  35533. subtract_with_carry_engine < _UIntType , __w , __s , __r > ::
  35534. seed ( _Sseq & __q )
  35535. {
  35536. const size_t __k = ( __w + 31 ) / 32 ;
  35537. uint_least32_t __arr [ __r * __k ] ;
  35538. __q . generate ( __arr + 0 , __arr + __r * __k ) ;
  35539.  
  35540. for ( size_t __i = 0 ; __i < long_lag ; ++ __i )
  35541. {
  35542. _UIntType __sum = 0u ;
  35543. _UIntType __factor = 1u ;
  35544. for ( size_t __j = 0 ; __j < __k ; ++ __j )
  35545. {
  35546. __sum += __arr [ __k * __i + __j ] * __factor ;
  35547. __factor *= __detail :: _Shift < _UIntType , 32 > :: __value ;
  35548. }
  35549. _M_x [ __i ] = __detail :: __mod < _UIntType ,
  35550. __detail :: _Shift < _UIntType , __w > :: __value > ( __sum ) ;
  35551. }
  35552. _M_carry = ( _M_x [ long_lag - 1 ] == 0 ) ? 1 : 0 ;
  35553. _M_p = 0 ;
  35554. }
  35555.  
  35556. template < typename _UIntType , size_t __w , size_t __s , size_t __r >
  35557. typename subtract_with_carry_engine < _UIntType , __w , __s , __r > ::
  35558. result_type
  35559. subtract_with_carry_engine < _UIntType , __w , __s , __r > ::
  35560. operator ( ) ( )
  35561. {
  35562.  
  35563. long __ps = _M_p - short_lag ;
  35564. if ( __ps < 0 )
  35565. __ps += long_lag ;
  35566.  
  35567.  
  35568.  
  35569.  
  35570. _UIntType __xi ;
  35571. if ( _M_x [ __ps ] >= _M_x [ _M_p ] + _M_carry )
  35572. {
  35573. __xi = _M_x [ __ps ] - _M_x [ _M_p ] - _M_carry ;
  35574. _M_carry = 0 ;
  35575. }
  35576. else
  35577. {
  35578. __xi = ( __detail :: _Shift < _UIntType , __w > :: __value
  35579. - _M_x [ _M_p ] - _M_carry + _M_x [ __ps ] ) ;
  35580. _M_carry = 1 ;
  35581. }
  35582. _M_x [ _M_p ] = __xi ;
  35583.  
  35584.  
  35585. if ( ++ _M_p >= long_lag )
  35586. _M_p = 0 ;
  35587.  
  35588. return __xi ;
  35589. }
  35590.  
  35591. template < typename _UIntType , size_t __w , size_t __s , size_t __r ,
  35592. typename _CharT , typename _Traits >
  35593. std :: basic_ostream < _CharT , _Traits > &
  35594. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  35595. const subtract_with_carry_engine < _UIntType ,
  35596. __w , __s , __r > & __x )
  35597. {
  35598. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  35599. typedef typename __ostream_type :: ios_base __ios_base ;
  35600.  
  35601. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  35602. const _CharT __fill = __os . fill ( ) ;
  35603. const _CharT __space = __os . widen ( ' ' ) ;
  35604. __os . flags ( __ios_base :: dec | __ios_base :: fixed | __ios_base :: left ) ;
  35605. __os . fill ( __space ) ;
  35606.  
  35607. for ( size_t __i = 0 ; __i < __r ; ++ __i )
  35608. __os << __x . _M_x [ __i ] << __space ;
  35609. __os << __x . _M_carry << __space << __x . _M_p ;
  35610.  
  35611. __os . flags ( __flags ) ;
  35612. __os . fill ( __fill ) ;
  35613. return __os ;
  35614. }
  35615.  
  35616. template < typename _UIntType , size_t __w , size_t __s , size_t __r ,
  35617. typename _CharT , typename _Traits >
  35618. std :: basic_istream < _CharT , _Traits > &
  35619. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  35620. subtract_with_carry_engine < _UIntType , __w , __s , __r > & __x )
  35621. {
  35622. typedef std :: basic_ostream < _CharT , _Traits > __istream_type ;
  35623. typedef typename __istream_type :: ios_base __ios_base ;
  35624.  
  35625. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  35626. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  35627.  
  35628. for ( size_t __i = 0 ; __i < __r ; ++ __i )
  35629. __is >> __x . _M_x [ __i ] ;
  35630. __is >> __x . _M_carry ;
  35631. __is >> __x . _M_p ;
  35632.  
  35633. __is . flags ( __flags ) ;
  35634. return __is ;
  35635. }
  35636.  
  35637.  
  35638. template < typename _RandomNumberEngine , size_t __p , size_t __r >
  35639. constexpr size_t
  35640. discard_block_engine < _RandomNumberEngine , __p , __r > :: block_size ;
  35641.  
  35642. template < typename _RandomNumberEngine , size_t __p , size_t __r >
  35643. constexpr size_t
  35644. discard_block_engine < _RandomNumberEngine , __p , __r > :: used_block ;
  35645.  
  35646. template < typename _RandomNumberEngine , size_t __p , size_t __r >
  35647. typename discard_block_engine < _RandomNumberEngine ,
  35648. __p , __r > :: result_type
  35649. discard_block_engine < _RandomNumberEngine , __p , __r > ::
  35650. operator ( ) ( )
  35651. {
  35652. if ( _M_n >= used_block )
  35653. {
  35654. _M_b . discard ( block_size - _M_n ) ;
  35655. _M_n = 0 ;
  35656. }
  35657. ++ _M_n ;
  35658. return _M_b ( ) ;
  35659. }
  35660.  
  35661. template < typename _RandomNumberEngine , size_t __p , size_t __r ,
  35662. typename _CharT , typename _Traits >
  35663. std :: basic_ostream < _CharT , _Traits > &
  35664. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  35665. const discard_block_engine < _RandomNumberEngine ,
  35666. __p , __r > & __x )
  35667. {
  35668. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  35669. typedef typename __ostream_type :: ios_base __ios_base ;
  35670.  
  35671. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  35672. const _CharT __fill = __os . fill ( ) ;
  35673. const _CharT __space = __os . widen ( ' ' ) ;
  35674. __os . flags ( __ios_base :: dec | __ios_base :: fixed | __ios_base :: left ) ;
  35675. __os . fill ( __space ) ;
  35676.  
  35677. __os << __x . base ( ) << __space << __x . _M_n ;
  35678.  
  35679. __os . flags ( __flags ) ;
  35680. __os . fill ( __fill ) ;
  35681. return __os ;
  35682. }
  35683.  
  35684. template < typename _RandomNumberEngine , size_t __p , size_t __r ,
  35685. typename _CharT , typename _Traits >
  35686. std :: basic_istream < _CharT , _Traits > &
  35687. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  35688. discard_block_engine < _RandomNumberEngine , __p , __r > & __x )
  35689. {
  35690. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  35691. typedef typename __istream_type :: ios_base __ios_base ;
  35692.  
  35693. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  35694. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  35695.  
  35696. __is >> __x . _M_b >> __x . _M_n ;
  35697.  
  35698. __is . flags ( __flags ) ;
  35699. return __is ;
  35700. }
  35701.  
  35702.  
  35703. template < typename _RandomNumberEngine , size_t __w , typename _UIntType >
  35704. typename independent_bits_engine < _RandomNumberEngine , __w , _UIntType > ::
  35705. result_type
  35706. independent_bits_engine < _RandomNumberEngine , __w , _UIntType > ::
  35707. operator ( ) ( )
  35708. {
  35709. typedef typename _RandomNumberEngine :: result_type _Eresult_type ;
  35710. const _Eresult_type __r
  35711. = ( _M_b . max ( ) - _M_b . min ( ) < std :: numeric_limits < _Eresult_type > :: max ( )
  35712. ? _M_b . max ( ) - _M_b . min ( ) + 1 : 0 ) ;
  35713. const unsigned __edig = std :: numeric_limits < _Eresult_type > :: digits ;
  35714. const unsigned __m = __r ? std :: __lg ( __r ) : __edig ;
  35715.  
  35716. typedef typename std :: common_type < _Eresult_type , result_type > :: type
  35717. __ctype ;
  35718. const unsigned __cdig = std :: numeric_limits < __ctype > :: digits ;
  35719.  
  35720. unsigned __n , __n0 ;
  35721. __ctype __s0 , __s1 , __y0 , __y1 ;
  35722.  
  35723. for ( size_t __i = 0 ; __i < 2 ; ++ __i )
  35724. {
  35725. __n = ( __w + __m - 1 ) / __m + __i ;
  35726. __n0 = __n - __w % __n ;
  35727. const unsigned __w0 = __w / __n ;
  35728.  
  35729. __s0 = 0 ;
  35730. __s1 = 0 ;
  35731. if ( __w0 < __cdig )
  35732. {
  35733. __s0 = __ctype ( 1 ) << __w0 ;
  35734. __s1 = __s0 << 1 ;
  35735. }
  35736.  
  35737. __y0 = 0 ;
  35738. __y1 = 0 ;
  35739. if ( __r )
  35740. {
  35741. __y0 = __s0 * ( __r / __s0 ) ;
  35742. if ( __s1 )
  35743. __y1 = __s1 * ( __r / __s1 ) ;
  35744.  
  35745. if ( __r - __y0 <= __y0 / __n )
  35746. break ;
  35747. }
  35748. else
  35749. break ;
  35750. }
  35751.  
  35752. result_type __sum = 0 ;
  35753. for ( size_t __k = 0 ; __k < __n0 ; ++ __k )
  35754. {
  35755. __ctype __u ;
  35756. do
  35757. __u = _M_b ( ) - _M_b . min ( ) ;
  35758. while ( __y0 && __u >= __y0 ) ;
  35759. __sum = __s0 * __sum + ( __s0 ? __u % __s0 : __u ) ;
  35760. }
  35761. for ( size_t __k = __n0 ; __k < __n ; ++ __k )
  35762. {
  35763. __ctype __u ;
  35764. do
  35765. __u = _M_b ( ) - _M_b . min ( ) ;
  35766. while ( __y1 && __u >= __y1 ) ;
  35767. __sum = __s1 * __sum + ( __s1 ? __u % __s1 : __u ) ;
  35768. }
  35769. return __sum ;
  35770. }
  35771.  
  35772.  
  35773. template < typename _RandomNumberEngine , size_t __k >
  35774. constexpr size_t
  35775. shuffle_order_engine < _RandomNumberEngine , __k > :: table_size ;
  35776.  
  35777. template < typename _RandomNumberEngine , size_t __k >
  35778. typename shuffle_order_engine < _RandomNumberEngine , __k > :: result_type
  35779. shuffle_order_engine < _RandomNumberEngine , __k > ::
  35780. operator ( ) ( )
  35781. {
  35782. size_t __j = __k * ( ( _M_y - _M_b . min ( ) )
  35783. / ( _M_b . max ( ) - _M_b . min ( ) + 1.0L ) ) ;
  35784. _M_y = _M_v [ __j ] ;
  35785. _M_v [ __j ] = _M_b ( ) ;
  35786.  
  35787. return _M_y ;
  35788. }
  35789.  
  35790. template < typename _RandomNumberEngine , size_t __k ,
  35791. typename _CharT , typename _Traits >
  35792. std :: basic_ostream < _CharT , _Traits > &
  35793. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  35794. const shuffle_order_engine < _RandomNumberEngine , __k > & __x )
  35795. {
  35796. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  35797. typedef typename __ostream_type :: ios_base __ios_base ;
  35798.  
  35799. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  35800. const _CharT __fill = __os . fill ( ) ;
  35801. const _CharT __space = __os . widen ( ' ' ) ;
  35802. __os . flags ( __ios_base :: dec | __ios_base :: fixed | __ios_base :: left ) ;
  35803. __os . fill ( __space ) ;
  35804.  
  35805. __os << __x . base ( ) ;
  35806. for ( size_t __i = 0 ; __i < __k ; ++ __i )
  35807. __os << __space << __x . _M_v [ __i ] ;
  35808. __os << __space << __x . _M_y ;
  35809.  
  35810. __os . flags ( __flags ) ;
  35811. __os . fill ( __fill ) ;
  35812. return __os ;
  35813. }
  35814.  
  35815. template < typename _RandomNumberEngine , size_t __k ,
  35816. typename _CharT , typename _Traits >
  35817. std :: basic_istream < _CharT , _Traits > &
  35818. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  35819. shuffle_order_engine < _RandomNumberEngine , __k > & __x )
  35820. {
  35821. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  35822. typedef typename __istream_type :: ios_base __ios_base ;
  35823.  
  35824. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  35825. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  35826.  
  35827. __is >> __x . _M_b ;
  35828. for ( size_t __i = 0 ; __i < __k ; ++ __i )
  35829. __is >> __x . _M_v [ __i ] ;
  35830. __is >> __x . _M_y ;
  35831.  
  35832. __is . flags ( __flags ) ;
  35833. return __is ;
  35834. }
  35835.  
  35836.  
  35837. template < typename _IntType >
  35838. template < typename _UniformRandomNumberGenerator >
  35839. typename uniform_int_distribution < _IntType > :: result_type
  35840. uniform_int_distribution < _IntType > ::
  35841. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  35842. const param_type & __param )
  35843. {
  35844. typedef typename _UniformRandomNumberGenerator :: result_type
  35845. _Gresult_type ;
  35846. typedef typename std :: make_unsigned < result_type > :: type __utype ;
  35847. typedef typename std :: common_type < _Gresult_type , __utype > :: type
  35848. __uctype ;
  35849.  
  35850. const __uctype __urngmin = __urng . min ( ) ;
  35851. const __uctype __urngmax = __urng . max ( ) ;
  35852. const __uctype __urngrange = __urngmax - __urngmin ;
  35853. const __uctype __urange
  35854. = __uctype ( __param . b ( ) ) - __uctype ( __param . a ( ) ) ;
  35855.  
  35856. __uctype __ret ;
  35857.  
  35858. if ( __urngrange > __urange )
  35859. {
  35860.  
  35861. const __uctype __uerange = __urange + 1 ;
  35862. const __uctype __scaling = __urngrange / __uerange ;
  35863. const __uctype __past = __uerange * __scaling ;
  35864. do
  35865. __ret = __uctype ( __urng ( ) ) - __urngmin ;
  35866. while ( __ret >= __past ) ;
  35867. __ret /= __scaling ;
  35868. }
  35869. else if ( __urngrange < __urange )
  35870. {
  35871. #924
  35872. __uctype __tmp ;
  35873. do
  35874. {
  35875. const __uctype __uerngrange = __urngrange + 1 ;
  35876. __tmp = ( __uerngrange * operator ( )
  35877. ( __urng , param_type ( 0 , __urange / __uerngrange ) ) ) ;
  35878. __ret = __tmp + ( __uctype ( __urng ( ) ) - __urngmin ) ;
  35879. }
  35880. while ( __ret > __urange || __ret < __tmp ) ;
  35881. }
  35882. else
  35883. __ret = __uctype ( __urng ( ) ) - __urngmin ;
  35884.  
  35885. return __ret + __param . a ( ) ;
  35886. }
  35887.  
  35888.  
  35889. template < typename _IntType >
  35890. template < typename _ForwardIterator ,
  35891. typename _UniformRandomNumberGenerator >
  35892. void
  35893. uniform_int_distribution < _IntType > ::
  35894. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  35895. _UniformRandomNumberGenerator & __urng ,
  35896. const param_type & __param )
  35897. {
  35898.  
  35899. typedef typename _UniformRandomNumberGenerator :: result_type
  35900. _Gresult_type ;
  35901. typedef typename std :: make_unsigned < result_type > :: type __utype ;
  35902. typedef typename std :: common_type < _Gresult_type , __utype > :: type
  35903. __uctype ;
  35904.  
  35905. const __uctype __urngmin = __urng . min ( ) ;
  35906. const __uctype __urngmax = __urng . max ( ) ;
  35907. const __uctype __urngrange = __urngmax - __urngmin ;
  35908. const __uctype __urange
  35909. = __uctype ( __param . b ( ) ) - __uctype ( __param . a ( ) ) ;
  35910.  
  35911. __uctype __ret ;
  35912.  
  35913. if ( __urngrange > __urange )
  35914. {
  35915. if ( __detail :: _Power_of_2 ( __urngrange + 1 )
  35916. && __detail :: _Power_of_2 ( __urange + 1 ) )
  35917. {
  35918. while ( __f != __t )
  35919. {
  35920. __ret = __uctype ( __urng ( ) ) - __urngmin ;
  35921. * __f ++ = ( __ret & __urange ) + __param . a ( ) ;
  35922. }
  35923. }
  35924. else
  35925. {
  35926.  
  35927. const __uctype __uerange = __urange + 1 ;
  35928. const __uctype __scaling = __urngrange / __uerange ;
  35929. const __uctype __past = __uerange * __scaling ;
  35930. while ( __f != __t )
  35931. {
  35932. do
  35933. __ret = __uctype ( __urng ( ) ) - __urngmin ;
  35934. while ( __ret >= __past ) ;
  35935. * __f ++ = __ret / __scaling + __param . a ( ) ;
  35936. }
  35937. }
  35938. }
  35939. else if ( __urngrange < __urange )
  35940. {
  35941. #1008
  35942. __uctype __tmp ;
  35943. while ( __f != __t )
  35944. {
  35945. do
  35946. {
  35947. const __uctype __uerngrange = __urngrange + 1 ;
  35948. __tmp = ( __uerngrange * operator ( )
  35949. ( __urng , param_type ( 0 , __urange / __uerngrange ) ) ) ;
  35950. __ret = __tmp + ( __uctype ( __urng ( ) ) - __urngmin ) ;
  35951. }
  35952. while ( __ret > __urange || __ret < __tmp ) ;
  35953. * __f ++ = __ret ;
  35954. }
  35955. }
  35956. else
  35957. while ( __f != __t )
  35958. * __f ++ = __uctype ( __urng ( ) ) - __urngmin + __param . a ( ) ;
  35959. }
  35960.  
  35961. template < typename _IntType , typename _CharT , typename _Traits >
  35962. std :: basic_ostream < _CharT , _Traits > &
  35963. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  35964. const uniform_int_distribution < _IntType > & __x )
  35965. {
  35966. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  35967. typedef typename __ostream_type :: ios_base __ios_base ;
  35968.  
  35969. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  35970. const _CharT __fill = __os . fill ( ) ;
  35971. const _CharT __space = __os . widen ( ' ' ) ;
  35972. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  35973. __os . fill ( __space ) ;
  35974.  
  35975. __os << __x . a ( ) << __space << __x . b ( ) ;
  35976.  
  35977. __os . flags ( __flags ) ;
  35978. __os . fill ( __fill ) ;
  35979. return __os ;
  35980. }
  35981.  
  35982. template < typename _IntType , typename _CharT , typename _Traits >
  35983. std :: basic_istream < _CharT , _Traits > &
  35984. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  35985. uniform_int_distribution < _IntType > & __x )
  35986. {
  35987. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  35988. typedef typename __istream_type :: ios_base __ios_base ;
  35989.  
  35990. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  35991. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  35992.  
  35993. _IntType __a , __b ;
  35994. __is >> __a >> __b ;
  35995. __x . param ( typename uniform_int_distribution < _IntType > ::
  35996. param_type ( __a , __b ) ) ;
  35997.  
  35998. __is . flags ( __flags ) ;
  35999. return __is ;
  36000. }
  36001.  
  36002.  
  36003. template < typename _RealType >
  36004. template < typename _ForwardIterator ,
  36005. typename _UniformRandomNumberGenerator >
  36006. void
  36007. uniform_real_distribution < _RealType > ::
  36008. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36009. _UniformRandomNumberGenerator & __urng ,
  36010. const param_type & __p )
  36011. {
  36012.  
  36013. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  36014. __aurng ( __urng ) ;
  36015. auto __range = __p . b ( ) - __p . a ( ) ;
  36016. while ( __f != __t )
  36017. * __f ++ = __aurng ( ) * __range + __p . a ( ) ;
  36018. }
  36019.  
  36020. template < typename _RealType , typename _CharT , typename _Traits >
  36021. std :: basic_ostream < _CharT , _Traits > &
  36022. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36023. const uniform_real_distribution < _RealType > & __x )
  36024. {
  36025. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36026. typedef typename __ostream_type :: ios_base __ios_base ;
  36027.  
  36028. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36029. const _CharT __fill = __os . fill ( ) ;
  36030. const std :: streamsize __precision = __os . precision ( ) ;
  36031. const _CharT __space = __os . widen ( ' ' ) ;
  36032. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36033. __os . fill ( __space ) ;
  36034. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  36035.  
  36036. __os << __x . a ( ) << __space << __x . b ( ) ;
  36037.  
  36038. __os . flags ( __flags ) ;
  36039. __os . fill ( __fill ) ;
  36040. __os . precision ( __precision ) ;
  36041. return __os ;
  36042. }
  36043.  
  36044. template < typename _RealType , typename _CharT , typename _Traits >
  36045. std :: basic_istream < _CharT , _Traits > &
  36046. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36047. uniform_real_distribution < _RealType > & __x )
  36048. {
  36049. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36050. typedef typename __istream_type :: ios_base __ios_base ;
  36051.  
  36052. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36053. __is . flags ( __ios_base :: skipws ) ;
  36054.  
  36055. _RealType __a , __b ;
  36056. __is >> __a >> __b ;
  36057. __x . param ( typename uniform_real_distribution < _RealType > ::
  36058. param_type ( __a , __b ) ) ;
  36059.  
  36060. __is . flags ( __flags ) ;
  36061. return __is ;
  36062. }
  36063.  
  36064.  
  36065. template < typename _ForwardIterator ,
  36066. typename _UniformRandomNumberGenerator >
  36067. void
  36068. std :: bernoulli_distribution ::
  36069. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36070. _UniformRandomNumberGenerator & __urng ,
  36071. const param_type & __p )
  36072. {
  36073.  
  36074. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  36075. __aurng ( __urng ) ;
  36076. auto __limit = __p . p ( ) * ( __aurng . max ( ) - __aurng . min ( ) ) ;
  36077.  
  36078. while ( __f != __t )
  36079. * __f ++ = ( __aurng ( ) - __aurng . min ( ) ) < __limit ;
  36080. }
  36081.  
  36082. template < typename _CharT , typename _Traits >
  36083. std :: basic_ostream < _CharT , _Traits > &
  36084. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36085. const bernoulli_distribution & __x )
  36086. {
  36087. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36088. typedef typename __ostream_type :: ios_base __ios_base ;
  36089.  
  36090. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36091. const _CharT __fill = __os . fill ( ) ;
  36092. const std :: streamsize __precision = __os . precision ( ) ;
  36093. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36094. __os . fill ( __os . widen ( ' ' ) ) ;
  36095. __os . precision ( std :: numeric_limits < double > :: max_digits10 ) ;
  36096.  
  36097. __os << __x . p ( ) ;
  36098.  
  36099. __os . flags ( __flags ) ;
  36100. __os . fill ( __fill ) ;
  36101. __os . precision ( __precision ) ;
  36102. return __os ;
  36103. }
  36104.  
  36105.  
  36106. template < typename _IntType >
  36107. template < typename _UniformRandomNumberGenerator >
  36108. typename geometric_distribution < _IntType > :: result_type
  36109. geometric_distribution < _IntType > ::
  36110. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  36111. const param_type & __param )
  36112. {
  36113.  
  36114.  
  36115. const double __naf =
  36116. ( 1 - std :: numeric_limits < double > :: epsilon ( ) ) / 2 ;
  36117.  
  36118. const double __thr =
  36119. std :: numeric_limits < _IntType > :: max ( ) + __naf ;
  36120. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  36121. __aurng ( __urng ) ;
  36122.  
  36123. double __cand ;
  36124. do
  36125. __cand = std :: floor ( std :: log ( 1.0 - __aurng ( ) ) / __param . _M_log_1_p ) ;
  36126. while ( __cand >= __thr ) ;
  36127.  
  36128. return result_type ( __cand + __naf ) ;
  36129. }
  36130.  
  36131. template < typename _IntType >
  36132. template < typename _ForwardIterator ,
  36133. typename _UniformRandomNumberGenerator >
  36134. void
  36135. geometric_distribution < _IntType > ::
  36136. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36137. _UniformRandomNumberGenerator & __urng ,
  36138. const param_type & __param )
  36139. {
  36140.  
  36141.  
  36142.  
  36143. const double __naf =
  36144. ( 1 - std :: numeric_limits < double > :: epsilon ( ) ) / 2 ;
  36145.  
  36146. const double __thr =
  36147. std :: numeric_limits < _IntType > :: max ( ) + __naf ;
  36148. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  36149. __aurng ( __urng ) ;
  36150.  
  36151. while ( __f != __t )
  36152. {
  36153. double __cand ;
  36154. do
  36155. __cand = std :: floor ( std :: log ( 1.0 - __aurng ( ) )
  36156. / __param . _M_log_1_p ) ;
  36157. while ( __cand >= __thr ) ;
  36158.  
  36159. * __f ++ = __cand + __naf ;
  36160. }
  36161. }
  36162.  
  36163. template < typename _IntType ,
  36164. typename _CharT , typename _Traits >
  36165. std :: basic_ostream < _CharT , _Traits > &
  36166. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36167. const geometric_distribution < _IntType > & __x )
  36168. {
  36169. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36170. typedef typename __ostream_type :: ios_base __ios_base ;
  36171.  
  36172. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36173. const _CharT __fill = __os . fill ( ) ;
  36174. const std :: streamsize __precision = __os . precision ( ) ;
  36175. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36176. __os . fill ( __os . widen ( ' ' ) ) ;
  36177. __os . precision ( std :: numeric_limits < double > :: max_digits10 ) ;
  36178.  
  36179. __os << __x . p ( ) ;
  36180.  
  36181. __os . flags ( __flags ) ;
  36182. __os . fill ( __fill ) ;
  36183. __os . precision ( __precision ) ;
  36184. return __os ;
  36185. }
  36186.  
  36187. template < typename _IntType ,
  36188. typename _CharT , typename _Traits >
  36189. std :: basic_istream < _CharT , _Traits > &
  36190. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36191. geometric_distribution < _IntType > & __x )
  36192. {
  36193. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36194. typedef typename __istream_type :: ios_base __ios_base ;
  36195.  
  36196. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36197. __is . flags ( __ios_base :: skipws ) ;
  36198.  
  36199. double __p ;
  36200. __is >> __p ;
  36201. __x . param ( typename geometric_distribution < _IntType > :: param_type ( __p ) ) ;
  36202.  
  36203. __is . flags ( __flags ) ;
  36204. return __is ;
  36205. }
  36206.  
  36207.  
  36208. template < typename _IntType >
  36209. template < typename _UniformRandomNumberGenerator >
  36210. typename negative_binomial_distribution < _IntType > :: result_type
  36211. negative_binomial_distribution < _IntType > ::
  36212. operator ( ) ( _UniformRandomNumberGenerator & __urng )
  36213. {
  36214. const double __y = _M_gd ( __urng ) ;
  36215.  
  36216.  
  36217. std :: poisson_distribution < result_type > __poisson ( __y ) ;
  36218. return __poisson ( __urng ) ;
  36219. }
  36220.  
  36221. template < typename _IntType >
  36222. template < typename _UniformRandomNumberGenerator >
  36223. typename negative_binomial_distribution < _IntType > :: result_type
  36224. negative_binomial_distribution < _IntType > ::
  36225. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  36226. const param_type & __p )
  36227. {
  36228. typedef typename std :: gamma_distribution < double > :: param_type
  36229. param_type ;
  36230.  
  36231. const double __y =
  36232. _M_gd ( __urng , param_type ( __p . k ( ) , ( 1.0 - __p . p ( ) ) / __p . p ( ) ) ) ;
  36233.  
  36234. std :: poisson_distribution < result_type > __poisson ( __y ) ;
  36235. return __poisson ( __urng ) ;
  36236. }
  36237.  
  36238. template < typename _IntType >
  36239. template < typename _ForwardIterator ,
  36240. typename _UniformRandomNumberGenerator >
  36241. void
  36242. negative_binomial_distribution < _IntType > ::
  36243. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36244. _UniformRandomNumberGenerator & __urng )
  36245. {
  36246.  
  36247. while ( __f != __t )
  36248. {
  36249. const double __y = _M_gd ( __urng ) ;
  36250.  
  36251.  
  36252. std :: poisson_distribution < result_type > __poisson ( __y ) ;
  36253. * __f ++ = __poisson ( __urng ) ;
  36254. }
  36255. }
  36256.  
  36257. template < typename _IntType >
  36258. template < typename _ForwardIterator ,
  36259. typename _UniformRandomNumberGenerator >
  36260. void
  36261. negative_binomial_distribution < _IntType > ::
  36262. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36263. _UniformRandomNumberGenerator & __urng ,
  36264. const param_type & __p )
  36265. {
  36266.  
  36267. typename std :: gamma_distribution < result_type > :: param_type
  36268. __p2 ( __p . k ( ) , ( 1.0 - __p . p ( ) ) / __p . p ( ) ) ;
  36269.  
  36270. while ( __f != __t )
  36271. {
  36272. const double __y = _M_gd ( __urng , __p2 ) ;
  36273.  
  36274. std :: poisson_distribution < result_type > __poisson ( __y ) ;
  36275. * __f ++ = __poisson ( __urng ) ;
  36276. }
  36277. }
  36278.  
  36279. template < typename _IntType , typename _CharT , typename _Traits >
  36280. std :: basic_ostream < _CharT , _Traits > &
  36281. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36282. const negative_binomial_distribution < _IntType > & __x )
  36283. {
  36284. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36285. typedef typename __ostream_type :: ios_base __ios_base ;
  36286.  
  36287. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36288. const _CharT __fill = __os . fill ( ) ;
  36289. const std :: streamsize __precision = __os . precision ( ) ;
  36290. const _CharT __space = __os . widen ( ' ' ) ;
  36291. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36292. __os . fill ( __os . widen ( ' ' ) ) ;
  36293. __os . precision ( std :: numeric_limits < double > :: max_digits10 ) ;
  36294.  
  36295. __os << __x . k ( ) << __space << __x . p ( )
  36296. << __space << __x . _M_gd ;
  36297.  
  36298. __os . flags ( __flags ) ;
  36299. __os . fill ( __fill ) ;
  36300. __os . precision ( __precision ) ;
  36301. return __os ;
  36302. }
  36303.  
  36304. template < typename _IntType , typename _CharT , typename _Traits >
  36305. std :: basic_istream < _CharT , _Traits > &
  36306. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36307. negative_binomial_distribution < _IntType > & __x )
  36308. {
  36309. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36310. typedef typename __istream_type :: ios_base __ios_base ;
  36311.  
  36312. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36313. __is . flags ( __ios_base :: skipws ) ;
  36314.  
  36315. _IntType __k ;
  36316. double __p ;
  36317. __is >> __k >> __p >> __x . _M_gd ;
  36318. __x . param ( typename negative_binomial_distribution < _IntType > ::
  36319. param_type ( __k , __p ) ) ;
  36320.  
  36321. __is . flags ( __flags ) ;
  36322. return __is ;
  36323. }
  36324.  
  36325.  
  36326. template < typename _IntType >
  36327. void
  36328. poisson_distribution < _IntType > :: param_type ::
  36329. _M_initialize ( )
  36330. {
  36331.  
  36332. if ( _M_mean >= 12 )
  36333. {
  36334. const double __m = std :: floor ( _M_mean ) ;
  36335. _M_lm_thr = std :: log ( _M_mean ) ;
  36336. _M_lfm = std :: lgamma ( __m + 1 ) ;
  36337. _M_sm = std :: sqrt ( __m ) ;
  36338.  
  36339. const double __pi_4 = 0.7853981633974483096156608458198757L ;
  36340. const double __dx = std :: sqrt ( 2 * __m * std :: log ( 32 * __m
  36341. / __pi_4 ) ) ;
  36342. _M_d = std :: round ( std :: max ( 6.0 , std :: min ( __m , __dx ) ) ) ;
  36343. const double __cx = 2 * __m + _M_d ;
  36344. _M_scx = std :: sqrt ( __cx / 2 ) ;
  36345. _M_1cx = 1 / __cx ;
  36346.  
  36347. _M_c2b = std :: sqrt ( __pi_4 * __cx ) * std :: exp ( _M_1cx ) ;
  36348. _M_cb = 2 * __cx * std :: exp ( - _M_d * _M_1cx * ( 1 + _M_d / 2 ) )
  36349. / _M_d ;
  36350. }
  36351. else
  36352.  
  36353. _M_lm_thr = std :: exp ( - _M_mean ) ;
  36354. }
  36355. #1432
  36356. template < typename _IntType >
  36357. template < typename _UniformRandomNumberGenerator >
  36358. typename poisson_distribution < _IntType > :: result_type
  36359. poisson_distribution < _IntType > ::
  36360. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  36361. const param_type & __param )
  36362. {
  36363. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  36364. __aurng ( __urng ) ;
  36365.  
  36366. if ( __param . mean ( ) >= 12 )
  36367. {
  36368. double __x ;
  36369.  
  36370.  
  36371. const double __naf =
  36372. ( 1 - std :: numeric_limits < double > :: epsilon ( ) ) / 2 ;
  36373. const double __thr =
  36374. std :: numeric_limits < _IntType > :: max ( ) + __naf ;
  36375.  
  36376. const double __m = std :: floor ( __param . mean ( ) ) ;
  36377.  
  36378. const double __spi_2 = 1.2533141373155002512078826424055226L ;
  36379. const double __c1 = __param . _M_sm * __spi_2 ;
  36380. const double __c2 = __param . _M_c2b + __c1 ;
  36381. const double __c3 = __c2 + 1 ;
  36382. const double __c4 = __c3 + 1 ;
  36383.  
  36384. const double __e178 = 1.0129030479320018583185514777512983L ;
  36385. const double __c5 = __c4 + __e178 ;
  36386. const double __c = __param . _M_cb + __c5 ;
  36387. const double __2cx = 2 * ( 2 * __m + __param . _M_d ) ;
  36388.  
  36389. bool __reject = true ;
  36390. do
  36391. {
  36392. const double __u = __c * __aurng ( ) ;
  36393. const double __e = - std :: log ( 1.0 - __aurng ( ) ) ;
  36394.  
  36395. double __w = 0.0 ;
  36396.  
  36397. if ( __u <= __c1 )
  36398. {
  36399. const double __n = _M_nd ( __urng ) ;
  36400. const double __y = - std :: abs ( __n ) * __param . _M_sm - 1 ;
  36401. __x = std :: floor ( __y ) ;
  36402. __w = - __n * __n / 2 ;
  36403. if ( __x < - __m )
  36404. continue ;
  36405. }
  36406. else if ( __u <= __c2 )
  36407. {
  36408. const double __n = _M_nd ( __urng ) ;
  36409. const double __y = 1 + std :: abs ( __n ) * __param . _M_scx ;
  36410. __x = std :: ceil ( __y ) ;
  36411. __w = __y * ( 2 - __y ) * __param . _M_1cx ;
  36412. if ( __x > __param . _M_d )
  36413. continue ;
  36414. }
  36415. else if ( __u <= __c3 )
  36416.  
  36417.  
  36418. __x = - 1 ;
  36419. else if ( __u <= __c4 )
  36420. __x = 0 ;
  36421. else if ( __u <= __c5 )
  36422. __x = 1 ;
  36423. else
  36424. {
  36425. const double __v = - std :: log ( 1.0 - __aurng ( ) ) ;
  36426. const double __y = __param . _M_d
  36427. + __v * __2cx / __param . _M_d ;
  36428. __x = std :: ceil ( __y ) ;
  36429. __w = - __param . _M_d * __param . _M_1cx * ( 1 + __y / 2 ) ;
  36430. }
  36431.  
  36432. __reject = ( __w - __e - __x * __param . _M_lm_thr
  36433. > __param . _M_lfm - std :: lgamma ( __x + __m + 1 ) ) ;
  36434.  
  36435. __reject |= __x + __m >= __thr ;
  36436.  
  36437. } while ( __reject ) ;
  36438.  
  36439. return result_type ( __x + __m + __naf ) ;
  36440. }
  36441. else
  36442.  
  36443. {
  36444. _IntType __x = 0 ;
  36445. double __prod = 1.0 ;
  36446.  
  36447. do
  36448. {
  36449. __prod *= __aurng ( ) ;
  36450. __x += 1 ;
  36451. }
  36452. while ( __prod > __param . _M_lm_thr ) ;
  36453.  
  36454. return __x - 1 ;
  36455. }
  36456. }
  36457.  
  36458. template < typename _IntType >
  36459. template < typename _ForwardIterator ,
  36460. typename _UniformRandomNumberGenerator >
  36461. void
  36462. poisson_distribution < _IntType > ::
  36463. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36464. _UniformRandomNumberGenerator & __urng ,
  36465. const param_type & __param )
  36466. {
  36467.  
  36468.  
  36469. while ( __f != __t )
  36470. * __f ++ = this -> operator ( ) ( __urng , __param ) ;
  36471. }
  36472.  
  36473. template < typename _IntType ,
  36474. typename _CharT , typename _Traits >
  36475. std :: basic_ostream < _CharT , _Traits > &
  36476. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36477. const poisson_distribution < _IntType > & __x )
  36478. {
  36479. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36480. typedef typename __ostream_type :: ios_base __ios_base ;
  36481.  
  36482. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36483. const _CharT __fill = __os . fill ( ) ;
  36484. const std :: streamsize __precision = __os . precision ( ) ;
  36485. const _CharT __space = __os . widen ( ' ' ) ;
  36486. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36487. __os . fill ( __space ) ;
  36488. __os . precision ( std :: numeric_limits < double > :: max_digits10 ) ;
  36489.  
  36490. __os << __x . mean ( ) << __space << __x . _M_nd ;
  36491.  
  36492. __os . flags ( __flags ) ;
  36493. __os . fill ( __fill ) ;
  36494. __os . precision ( __precision ) ;
  36495. return __os ;
  36496. }
  36497.  
  36498. template < typename _IntType ,
  36499. typename _CharT , typename _Traits >
  36500. std :: basic_istream < _CharT , _Traits > &
  36501. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36502. poisson_distribution < _IntType > & __x )
  36503. {
  36504. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36505. typedef typename __istream_type :: ios_base __ios_base ;
  36506.  
  36507. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36508. __is . flags ( __ios_base :: skipws ) ;
  36509.  
  36510. double __mean ;
  36511. __is >> __mean >> __x . _M_nd ;
  36512. __x . param ( typename poisson_distribution < _IntType > :: param_type ( __mean ) ) ;
  36513.  
  36514. __is . flags ( __flags ) ;
  36515. return __is ;
  36516. }
  36517.  
  36518.  
  36519. template < typename _IntType >
  36520. void
  36521. binomial_distribution < _IntType > :: param_type ::
  36522. _M_initialize ( )
  36523. {
  36524. const double __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p ;
  36525.  
  36526. _M_easy = true ;
  36527.  
  36528.  
  36529. if ( _M_t * __p12 >= 8 )
  36530. {
  36531. _M_easy = false ;
  36532. const double __np = std :: floor ( _M_t * __p12 ) ;
  36533. const double __pa = __np / _M_t ;
  36534. const double __1p = 1 - __pa ;
  36535.  
  36536. const double __pi_4 = 0.7853981633974483096156608458198757L ;
  36537. const double __d1x =
  36538. std :: sqrt ( __np * __1p * std :: log ( 32 * __np
  36539. / ( 81 * __pi_4 * __1p ) ) ) ;
  36540. _M_d1 = std :: round ( std :: max ( 1.0 , __d1x ) ) ;
  36541. const double __d2x =
  36542. std :: sqrt ( __np * __1p * std :: log ( 32 * _M_t * __1p
  36543. / ( __pi_4 * __pa ) ) ) ;
  36544. _M_d2 = std :: round ( std :: max ( 1.0 , __d2x ) ) ;
  36545.  
  36546.  
  36547. const double __spi_2 = 1.2533141373155002512078826424055226L ;
  36548. _M_s1 = std :: sqrt ( __np * __1p ) * ( 1 + _M_d1 / ( 4 * __np ) ) ;
  36549. _M_s2 = std :: sqrt ( __np * __1p ) * ( 1 + _M_d2 / ( 4 * _M_t * __1p ) ) ;
  36550. _M_c = 2 * _M_d1 / __np ;
  36551. _M_a1 = std :: exp ( _M_c ) * _M_s1 * __spi_2 ;
  36552. const double __a12 = _M_a1 + _M_s2 * __spi_2 ;
  36553. const double __s1s = _M_s1 * _M_s1 ;
  36554. _M_a123 = __a12 + ( std :: exp ( _M_d1 / ( _M_t * __1p ) )
  36555. * 2 * __s1s / _M_d1
  36556. * std :: exp ( - _M_d1 * _M_d1 / ( 2 * __s1s ) ) ) ;
  36557. const double __s2s = _M_s2 * _M_s2 ;
  36558. _M_s = ( _M_a123 + 2 * __s2s / _M_d2
  36559. * std :: exp ( - _M_d2 * _M_d2 / ( 2 * __s2s ) ) ) ;
  36560. _M_lf = ( std :: lgamma ( __np + 1 )
  36561. + std :: lgamma ( _M_t - __np + 1 ) ) ;
  36562. _M_lp1p = std :: log ( __pa / __1p ) ;
  36563.  
  36564. _M_q = - std :: log ( 1 - ( __p12 - __pa ) / __1p ) ;
  36565. }
  36566. else
  36567.  
  36568. _M_q = - std :: log ( 1 - __p12 ) ;
  36569. }
  36570.  
  36571. template < typename _IntType >
  36572. template < typename _UniformRandomNumberGenerator >
  36573. typename binomial_distribution < _IntType > :: result_type
  36574. binomial_distribution < _IntType > ::
  36575. _M_waiting ( _UniformRandomNumberGenerator & __urng ,
  36576. _IntType __t , double __q )
  36577. {
  36578. _IntType __x = 0 ;
  36579. double __sum = 0.0 ;
  36580. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  36581. __aurng ( __urng ) ;
  36582.  
  36583. do
  36584. {
  36585. if ( __t == __x )
  36586. return __x ;
  36587. const double __e = - std :: log ( 1.0 - __aurng ( ) ) ;
  36588. __sum += __e / ( __t - __x ) ;
  36589. __x += 1 ;
  36590. }
  36591. while ( __sum <= __q ) ;
  36592.  
  36593. return __x - 1 ;
  36594. }
  36595. #1682
  36596. template < typename _IntType >
  36597. template < typename _UniformRandomNumberGenerator >
  36598. typename binomial_distribution < _IntType > :: result_type
  36599. binomial_distribution < _IntType > ::
  36600. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  36601. const param_type & __param )
  36602. {
  36603. result_type __ret ;
  36604. const _IntType __t = __param . t ( ) ;
  36605. const double __p = __param . p ( ) ;
  36606. const double __p12 = __p <= 0.5 ? __p : 1.0 - __p ;
  36607. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  36608. __aurng ( __urng ) ;
  36609.  
  36610.  
  36611. if ( ! __param . _M_easy )
  36612. {
  36613. double __x ;
  36614.  
  36615.  
  36616. const double __naf =
  36617. ( 1 - std :: numeric_limits < double > :: epsilon ( ) ) / 2 ;
  36618. const double __thr =
  36619. std :: numeric_limits < _IntType > :: max ( ) + __naf ;
  36620.  
  36621. const double __np = std :: floor ( __t * __p12 ) ;
  36622.  
  36623.  
  36624. const double __spi_2 = 1.2533141373155002512078826424055226L ;
  36625. const double __a1 = __param . _M_a1 ;
  36626. const double __a12 = __a1 + __param . _M_s2 * __spi_2 ;
  36627. const double __a123 = __param . _M_a123 ;
  36628. const double __s1s = __param . _M_s1 * __param . _M_s1 ;
  36629. const double __s2s = __param . _M_s2 * __param . _M_s2 ;
  36630.  
  36631. bool __reject ;
  36632. do
  36633. {
  36634. const double __u = __param . _M_s * __aurng ( ) ;
  36635.  
  36636. double __v ;
  36637.  
  36638. if ( __u <= __a1 )
  36639. {
  36640. const double __n = _M_nd ( __urng ) ;
  36641. const double __y = __param . _M_s1 * std :: abs ( __n ) ;
  36642. __reject = __y >= __param . _M_d1 ;
  36643. if ( ! __reject )
  36644. {
  36645. const double __e = - std :: log ( 1.0 - __aurng ( ) ) ;
  36646. __x = std :: floor ( __y ) ;
  36647. __v = - __e - __n * __n / 2 + __param . _M_c ;
  36648. }
  36649. }
  36650. else if ( __u <= __a12 )
  36651. {
  36652. const double __n = _M_nd ( __urng ) ;
  36653. const double __y = __param . _M_s2 * std :: abs ( __n ) ;
  36654. __reject = __y >= __param . _M_d2 ;
  36655. if ( ! __reject )
  36656. {
  36657. const double __e = - std :: log ( 1.0 - __aurng ( ) ) ;
  36658. __x = std :: floor ( - __y ) ;
  36659. __v = - __e - __n * __n / 2 ;
  36660. }
  36661. }
  36662. else if ( __u <= __a123 )
  36663. {
  36664. const double __e1 = - std :: log ( 1.0 - __aurng ( ) ) ;
  36665. const double __e2 = - std :: log ( 1.0 - __aurng ( ) ) ;
  36666.  
  36667. const double __y = __param . _M_d1
  36668. + 2 * __s1s * __e1 / __param . _M_d1 ;
  36669. __x = std :: floor ( __y ) ;
  36670. __v = ( - __e2 + __param . _M_d1 * ( 1 / ( __t - __np )
  36671. - __y / ( 2 * __s1s ) ) ) ;
  36672. __reject = false ;
  36673. }
  36674. else
  36675. {
  36676. const double __e1 = - std :: log ( 1.0 - __aurng ( ) ) ;
  36677. const double __e2 = - std :: log ( 1.0 - __aurng ( ) ) ;
  36678.  
  36679. const double __y = __param . _M_d2
  36680. + 2 * __s2s * __e1 / __param . _M_d2 ;
  36681. __x = std :: floor ( - __y ) ;
  36682. __v = - __e2 - __param . _M_d2 * __y / ( 2 * __s2s ) ;
  36683. __reject = false ;
  36684. }
  36685.  
  36686. __reject = __reject || __x < - __np || __x > __t - __np ;
  36687. if ( ! __reject )
  36688. {
  36689. const double __lfx =
  36690. std :: lgamma ( __np + __x + 1 )
  36691. + std :: lgamma ( __t - ( __np + __x ) + 1 ) ;
  36692. __reject = __v > __param . _M_lf - __lfx
  36693. + __x * __param . _M_lp1p ;
  36694. }
  36695.  
  36696. __reject |= __x + __np >= __thr ;
  36697. }
  36698. while ( __reject ) ;
  36699.  
  36700. __x += __np + __naf ;
  36701.  
  36702. const _IntType __z = _M_waiting ( __urng , __t - _IntType ( __x ) ,
  36703. __param . _M_q ) ;
  36704. __ret = _IntType ( __x ) + __z ;
  36705. }
  36706. else
  36707.  
  36708. __ret = _M_waiting ( __urng , __t , __param . _M_q ) ;
  36709.  
  36710. if ( __p12 != __p )
  36711. __ret = __t - __ret ;
  36712. return __ret ;
  36713. }
  36714.  
  36715. template < typename _IntType >
  36716. template < typename _ForwardIterator ,
  36717. typename _UniformRandomNumberGenerator >
  36718. void
  36719. binomial_distribution < _IntType > ::
  36720. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36721. _UniformRandomNumberGenerator & __urng ,
  36722. const param_type & __param )
  36723. {
  36724.  
  36725.  
  36726. while ( __f != __t )
  36727. * __f ++ = this -> operator ( ) ( __urng , __param ) ;
  36728. }
  36729.  
  36730. template < typename _IntType ,
  36731. typename _CharT , typename _Traits >
  36732. std :: basic_ostream < _CharT , _Traits > &
  36733. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36734. const binomial_distribution < _IntType > & __x )
  36735. {
  36736. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36737. typedef typename __ostream_type :: ios_base __ios_base ;
  36738.  
  36739. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36740. const _CharT __fill = __os . fill ( ) ;
  36741. const std :: streamsize __precision = __os . precision ( ) ;
  36742. const _CharT __space = __os . widen ( ' ' ) ;
  36743. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36744. __os . fill ( __space ) ;
  36745. __os . precision ( std :: numeric_limits < double > :: max_digits10 ) ;
  36746.  
  36747. __os << __x . t ( ) << __space << __x . p ( )
  36748. << __space << __x . _M_nd ;
  36749.  
  36750. __os . flags ( __flags ) ;
  36751. __os . fill ( __fill ) ;
  36752. __os . precision ( __precision ) ;
  36753. return __os ;
  36754. }
  36755.  
  36756. template < typename _IntType ,
  36757. typename _CharT , typename _Traits >
  36758. std :: basic_istream < _CharT , _Traits > &
  36759. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36760. binomial_distribution < _IntType > & __x )
  36761. {
  36762. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36763. typedef typename __istream_type :: ios_base __ios_base ;
  36764.  
  36765. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36766. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  36767.  
  36768. _IntType __t ;
  36769. double __p ;
  36770. __is >> __t >> __p >> __x . _M_nd ;
  36771. __x . param ( typename binomial_distribution < _IntType > ::
  36772. param_type ( __t , __p ) ) ;
  36773.  
  36774. __is . flags ( __flags ) ;
  36775. return __is ;
  36776. }
  36777.  
  36778.  
  36779. template < typename _RealType >
  36780. template < typename _ForwardIterator ,
  36781. typename _UniformRandomNumberGenerator >
  36782. void
  36783. std :: exponential_distribution < _RealType > ::
  36784. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36785. _UniformRandomNumberGenerator & __urng ,
  36786. const param_type & __p )
  36787. {
  36788.  
  36789. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  36790. __aurng ( __urng ) ;
  36791. while ( __f != __t )
  36792. * __f ++ = - std :: log ( result_type ( 1 ) - __aurng ( ) ) / __p . lambda ( ) ;
  36793. }
  36794.  
  36795. template < typename _RealType , typename _CharT , typename _Traits >
  36796. std :: basic_ostream < _CharT , _Traits > &
  36797. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36798. const exponential_distribution < _RealType > & __x )
  36799. {
  36800. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36801. typedef typename __ostream_type :: ios_base __ios_base ;
  36802.  
  36803. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36804. const _CharT __fill = __os . fill ( ) ;
  36805. const std :: streamsize __precision = __os . precision ( ) ;
  36806. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36807. __os . fill ( __os . widen ( ' ' ) ) ;
  36808. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  36809.  
  36810. __os << __x . lambda ( ) ;
  36811.  
  36812. __os . flags ( __flags ) ;
  36813. __os . fill ( __fill ) ;
  36814. __os . precision ( __precision ) ;
  36815. return __os ;
  36816. }
  36817.  
  36818. template < typename _RealType , typename _CharT , typename _Traits >
  36819. std :: basic_istream < _CharT , _Traits > &
  36820. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36821. exponential_distribution < _RealType > & __x )
  36822. {
  36823. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36824. typedef typename __istream_type :: ios_base __ios_base ;
  36825.  
  36826. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36827. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  36828.  
  36829. _RealType __lambda ;
  36830. __is >> __lambda ;
  36831. __x . param ( typename exponential_distribution < _RealType > ::
  36832. param_type ( __lambda ) ) ;
  36833.  
  36834. __is . flags ( __flags ) ;
  36835. return __is ;
  36836. }
  36837. #1931
  36838. template < typename _RealType >
  36839. template < typename _UniformRandomNumberGenerator >
  36840. typename normal_distribution < _RealType > :: result_type
  36841. normal_distribution < _RealType > ::
  36842. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  36843. const param_type & __param )
  36844. {
  36845. result_type __ret ;
  36846. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  36847. __aurng ( __urng ) ;
  36848.  
  36849. if ( _M_saved_available )
  36850. {
  36851. _M_saved_available = false ;
  36852. __ret = _M_saved ;
  36853. }
  36854. else
  36855. {
  36856. result_type __x , __y , __r2 ;
  36857. do
  36858. {
  36859. __x = result_type ( 2.0 ) * __aurng ( ) - 1.0 ;
  36860. __y = result_type ( 2.0 ) * __aurng ( ) - 1.0 ;
  36861. __r2 = __x * __x + __y * __y ;
  36862. }
  36863. while ( __r2 > 1.0 || __r2 == 0.0 ) ;
  36864.  
  36865. const result_type __mult = std :: sqrt ( - 2 * std :: log ( __r2 ) / __r2 ) ;
  36866. _M_saved = __x * __mult ;
  36867. _M_saved_available = true ;
  36868. __ret = __y * __mult ;
  36869. }
  36870.  
  36871. __ret = __ret * __param . stddev ( ) + __param . mean ( ) ;
  36872. return __ret ;
  36873. }
  36874.  
  36875. template < typename _RealType >
  36876. template < typename _ForwardIterator ,
  36877. typename _UniformRandomNumberGenerator >
  36878. void
  36879. normal_distribution < _RealType > ::
  36880. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  36881. _UniformRandomNumberGenerator & __urng ,
  36882. const param_type & __param )
  36883. {
  36884.  
  36885.  
  36886. if ( __f == __t )
  36887. return ;
  36888.  
  36889. if ( _M_saved_available )
  36890. {
  36891. _M_saved_available = false ;
  36892. * __f ++ = _M_saved * __param . stddev ( ) + __param . mean ( ) ;
  36893.  
  36894. if ( __f == __t )
  36895. return ;
  36896. }
  36897.  
  36898. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  36899. __aurng ( __urng ) ;
  36900.  
  36901. while ( __f + 1 < __t )
  36902. {
  36903. result_type __x , __y , __r2 ;
  36904. do
  36905. {
  36906. __x = result_type ( 2.0 ) * __aurng ( ) - 1.0 ;
  36907. __y = result_type ( 2.0 ) * __aurng ( ) - 1.0 ;
  36908. __r2 = __x * __x + __y * __y ;
  36909. }
  36910. while ( __r2 > 1.0 || __r2 == 0.0 ) ;
  36911.  
  36912. const result_type __mult = std :: sqrt ( - 2 * std :: log ( __r2 ) / __r2 ) ;
  36913. * __f ++ = __y * __mult * __param . stddev ( ) + __param . mean ( ) ;
  36914. * __f ++ = __x * __mult * __param . stddev ( ) + __param . mean ( ) ;
  36915. }
  36916.  
  36917. if ( __f != __t )
  36918. {
  36919. result_type __x , __y , __r2 ;
  36920. do
  36921. {
  36922. __x = result_type ( 2.0 ) * __aurng ( ) - 1.0 ;
  36923. __y = result_type ( 2.0 ) * __aurng ( ) - 1.0 ;
  36924. __r2 = __x * __x + __y * __y ;
  36925. }
  36926. while ( __r2 > 1.0 || __r2 == 0.0 ) ;
  36927.  
  36928. const result_type __mult = std :: sqrt ( - 2 * std :: log ( __r2 ) / __r2 ) ;
  36929. _M_saved = __x * __mult ;
  36930. _M_saved_available = true ;
  36931. * __f = __y * __mult * __param . stddev ( ) + __param . mean ( ) ;
  36932. }
  36933. }
  36934.  
  36935. template < typename _RealType >
  36936. bool
  36937. operator == ( const std :: normal_distribution < _RealType > & __d1 ,
  36938. const std :: normal_distribution < _RealType > & __d2 )
  36939. {
  36940. if ( __d1 . _M_param == __d2 . _M_param
  36941. && __d1 . _M_saved_available == __d2 . _M_saved_available )
  36942. {
  36943. if ( __d1 . _M_saved_available
  36944. && __d1 . _M_saved == __d2 . _M_saved )
  36945. return true ;
  36946. else if ( ! __d1 . _M_saved_available )
  36947. return true ;
  36948. else
  36949. return false ;
  36950. }
  36951. else
  36952. return false ;
  36953. }
  36954.  
  36955. template < typename _RealType , typename _CharT , typename _Traits >
  36956. std :: basic_ostream < _CharT , _Traits > &
  36957. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  36958. const normal_distribution < _RealType > & __x )
  36959. {
  36960. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  36961. typedef typename __ostream_type :: ios_base __ios_base ;
  36962.  
  36963. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  36964. const _CharT __fill = __os . fill ( ) ;
  36965. const std :: streamsize __precision = __os . precision ( ) ;
  36966. const _CharT __space = __os . widen ( ' ' ) ;
  36967. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  36968. __os . fill ( __space ) ;
  36969. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  36970.  
  36971. __os << __x . mean ( ) << __space << __x . stddev ( )
  36972. << __space << __x . _M_saved_available ;
  36973. if ( __x . _M_saved_available )
  36974. __os << __space << __x . _M_saved ;
  36975.  
  36976. __os . flags ( __flags ) ;
  36977. __os . fill ( __fill ) ;
  36978. __os . precision ( __precision ) ;
  36979. return __os ;
  36980. }
  36981.  
  36982. template < typename _RealType , typename _CharT , typename _Traits >
  36983. std :: basic_istream < _CharT , _Traits > &
  36984. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  36985. normal_distribution < _RealType > & __x )
  36986. {
  36987. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  36988. typedef typename __istream_type :: ios_base __ios_base ;
  36989.  
  36990. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  36991. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  36992.  
  36993. double __mean , __stddev ;
  36994. __is >> __mean >> __stddev
  36995. >> __x . _M_saved_available ;
  36996. if ( __x . _M_saved_available )
  36997. __is >> __x . _M_saved ;
  36998. __x . param ( typename normal_distribution < _RealType > ::
  36999. param_type ( __mean , __stddev ) ) ;
  37000.  
  37001. __is . flags ( __flags ) ;
  37002. return __is ;
  37003. }
  37004.  
  37005.  
  37006. template < typename _RealType >
  37007. template < typename _ForwardIterator ,
  37008. typename _UniformRandomNumberGenerator >
  37009. void
  37010. lognormal_distribution < _RealType > ::
  37011. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37012. _UniformRandomNumberGenerator & __urng ,
  37013. const param_type & __p )
  37014. {
  37015.  
  37016. while ( __f != __t )
  37017. * __f ++ = std :: exp ( __p . s ( ) * _M_nd ( __urng ) + __p . m ( ) ) ;
  37018. }
  37019.  
  37020. template < typename _RealType , typename _CharT , typename _Traits >
  37021. std :: basic_ostream < _CharT , _Traits > &
  37022. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37023. const lognormal_distribution < _RealType > & __x )
  37024. {
  37025. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37026. typedef typename __ostream_type :: ios_base __ios_base ;
  37027.  
  37028. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37029. const _CharT __fill = __os . fill ( ) ;
  37030. const std :: streamsize __precision = __os . precision ( ) ;
  37031. const _CharT __space = __os . widen ( ' ' ) ;
  37032. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37033. __os . fill ( __space ) ;
  37034. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37035.  
  37036. __os << __x . m ( ) << __space << __x . s ( )
  37037. << __space << __x . _M_nd ;
  37038.  
  37039. __os . flags ( __flags ) ;
  37040. __os . fill ( __fill ) ;
  37041. __os . precision ( __precision ) ;
  37042. return __os ;
  37043. }
  37044.  
  37045. template < typename _RealType , typename _CharT , typename _Traits >
  37046. std :: basic_istream < _CharT , _Traits > &
  37047. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37048. lognormal_distribution < _RealType > & __x )
  37049. {
  37050. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37051. typedef typename __istream_type :: ios_base __ios_base ;
  37052.  
  37053. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37054. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37055.  
  37056. _RealType __m , __s ;
  37057. __is >> __m >> __s >> __x . _M_nd ;
  37058. __x . param ( typename lognormal_distribution < _RealType > ::
  37059. param_type ( __m , __s ) ) ;
  37060.  
  37061. __is . flags ( __flags ) ;
  37062. return __is ;
  37063. }
  37064.  
  37065. template < typename _RealType >
  37066. template < typename _ForwardIterator ,
  37067. typename _UniformRandomNumberGenerator >
  37068. void
  37069. std :: chi_squared_distribution < _RealType > ::
  37070. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37071. _UniformRandomNumberGenerator & __urng )
  37072. {
  37073.  
  37074. while ( __f != __t )
  37075. * __f ++ = 2 * _M_gd ( __urng ) ;
  37076. }
  37077.  
  37078. template < typename _RealType >
  37079. template < typename _ForwardIterator ,
  37080. typename _UniformRandomNumberGenerator >
  37081. void
  37082. std :: chi_squared_distribution < _RealType > ::
  37083. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37084. _UniformRandomNumberGenerator & __urng ,
  37085. const typename
  37086. std :: gamma_distribution < result_type > :: param_type & __p )
  37087. {
  37088.  
  37089. while ( __f != __t )
  37090. * __f ++ = 2 * _M_gd ( __urng , __p ) ;
  37091. }
  37092.  
  37093. template < typename _RealType , typename _CharT , typename _Traits >
  37094. std :: basic_ostream < _CharT , _Traits > &
  37095. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37096. const chi_squared_distribution < _RealType > & __x )
  37097. {
  37098. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37099. typedef typename __ostream_type :: ios_base __ios_base ;
  37100.  
  37101. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37102. const _CharT __fill = __os . fill ( ) ;
  37103. const std :: streamsize __precision = __os . precision ( ) ;
  37104. const _CharT __space = __os . widen ( ' ' ) ;
  37105. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37106. __os . fill ( __space ) ;
  37107. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37108.  
  37109. __os << __x . n ( ) << __space << __x . _M_gd ;
  37110.  
  37111. __os . flags ( __flags ) ;
  37112. __os . fill ( __fill ) ;
  37113. __os . precision ( __precision ) ;
  37114. return __os ;
  37115. }
  37116.  
  37117. template < typename _RealType , typename _CharT , typename _Traits >
  37118. std :: basic_istream < _CharT , _Traits > &
  37119. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37120. chi_squared_distribution < _RealType > & __x )
  37121. {
  37122. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37123. typedef typename __istream_type :: ios_base __ios_base ;
  37124.  
  37125. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37126. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37127.  
  37128. _RealType __n ;
  37129. __is >> __n >> __x . _M_gd ;
  37130. __x . param ( typename chi_squared_distribution < _RealType > ::
  37131. param_type ( __n ) ) ;
  37132.  
  37133. __is . flags ( __flags ) ;
  37134. return __is ;
  37135. }
  37136.  
  37137.  
  37138. template < typename _RealType >
  37139. template < typename _UniformRandomNumberGenerator >
  37140. typename cauchy_distribution < _RealType > :: result_type
  37141. cauchy_distribution < _RealType > ::
  37142. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  37143. const param_type & __p )
  37144. {
  37145. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37146. __aurng ( __urng ) ;
  37147. _RealType __u ;
  37148. do
  37149. __u = __aurng ( ) ;
  37150. while ( __u == 0.5 ) ;
  37151.  
  37152. const _RealType __pi = 3.1415926535897932384626433832795029L ;
  37153. return __p . a ( ) + __p . b ( ) * std :: tan ( __pi * __u ) ;
  37154. }
  37155.  
  37156. template < typename _RealType >
  37157. template < typename _ForwardIterator ,
  37158. typename _UniformRandomNumberGenerator >
  37159. void
  37160. cauchy_distribution < _RealType > ::
  37161. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37162. _UniformRandomNumberGenerator & __urng ,
  37163. const param_type & __p )
  37164. {
  37165.  
  37166. const _RealType __pi = 3.1415926535897932384626433832795029L ;
  37167. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37168. __aurng ( __urng ) ;
  37169. while ( __f != __t )
  37170. {
  37171. _RealType __u ;
  37172. do
  37173. __u = __aurng ( ) ;
  37174. while ( __u == 0.5 ) ;
  37175.  
  37176. * __f ++ = __p . a ( ) + __p . b ( ) * std :: tan ( __pi * __u ) ;
  37177. }
  37178. }
  37179.  
  37180. template < typename _RealType , typename _CharT , typename _Traits >
  37181. std :: basic_ostream < _CharT , _Traits > &
  37182. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37183. const cauchy_distribution < _RealType > & __x )
  37184. {
  37185. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37186. typedef typename __ostream_type :: ios_base __ios_base ;
  37187.  
  37188. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37189. const _CharT __fill = __os . fill ( ) ;
  37190. const std :: streamsize __precision = __os . precision ( ) ;
  37191. const _CharT __space = __os . widen ( ' ' ) ;
  37192. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37193. __os . fill ( __space ) ;
  37194. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37195.  
  37196. __os << __x . a ( ) << __space << __x . b ( ) ;
  37197.  
  37198. __os . flags ( __flags ) ;
  37199. __os . fill ( __fill ) ;
  37200. __os . precision ( __precision ) ;
  37201. return __os ;
  37202. }
  37203.  
  37204. template < typename _RealType , typename _CharT , typename _Traits >
  37205. std :: basic_istream < _CharT , _Traits > &
  37206. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37207. cauchy_distribution < _RealType > & __x )
  37208. {
  37209. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37210. typedef typename __istream_type :: ios_base __ios_base ;
  37211.  
  37212. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37213. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37214.  
  37215. _RealType __a , __b ;
  37216. __is >> __a >> __b ;
  37217. __x . param ( typename cauchy_distribution < _RealType > ::
  37218. param_type ( __a , __b ) ) ;
  37219.  
  37220. __is . flags ( __flags ) ;
  37221. return __is ;
  37222. }
  37223.  
  37224.  
  37225. template < typename _RealType >
  37226. template < typename _ForwardIterator ,
  37227. typename _UniformRandomNumberGenerator >
  37228. void
  37229. std :: fisher_f_distribution < _RealType > ::
  37230. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37231. _UniformRandomNumberGenerator & __urng )
  37232. {
  37233.  
  37234. while ( __f != __t )
  37235. * __f ++ = ( ( _M_gd_x ( __urng ) * n ( ) ) / ( _M_gd_y ( __urng ) * m ( ) ) ) ;
  37236. }
  37237.  
  37238. template < typename _RealType >
  37239. template < typename _ForwardIterator ,
  37240. typename _UniformRandomNumberGenerator >
  37241. void
  37242. std :: fisher_f_distribution < _RealType > ::
  37243. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37244. _UniformRandomNumberGenerator & __urng ,
  37245. const param_type & __p )
  37246. {
  37247.  
  37248. typedef typename std :: gamma_distribution < result_type > :: param_type
  37249. param_type ;
  37250. param_type __p1 ( __p . m ( ) / 2 ) ;
  37251. param_type __p2 ( __p . n ( ) / 2 ) ;
  37252. while ( __f != __t )
  37253. * __f ++ = ( ( _M_gd_x ( __urng , __p1 ) * n ( ) )
  37254. / ( _M_gd_y ( __urng , __p2 ) * m ( ) ) ) ;
  37255. }
  37256.  
  37257. template < typename _RealType , typename _CharT , typename _Traits >
  37258. std :: basic_ostream < _CharT , _Traits > &
  37259. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37260. const fisher_f_distribution < _RealType > & __x )
  37261. {
  37262. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37263. typedef typename __ostream_type :: ios_base __ios_base ;
  37264.  
  37265. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37266. const _CharT __fill = __os . fill ( ) ;
  37267. const std :: streamsize __precision = __os . precision ( ) ;
  37268. const _CharT __space = __os . widen ( ' ' ) ;
  37269. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37270. __os . fill ( __space ) ;
  37271. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37272.  
  37273. __os << __x . m ( ) << __space << __x . n ( )
  37274. << __space << __x . _M_gd_x << __space << __x . _M_gd_y ;
  37275.  
  37276. __os . flags ( __flags ) ;
  37277. __os . fill ( __fill ) ;
  37278. __os . precision ( __precision ) ;
  37279. return __os ;
  37280. }
  37281.  
  37282. template < typename _RealType , typename _CharT , typename _Traits >
  37283. std :: basic_istream < _CharT , _Traits > &
  37284. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37285. fisher_f_distribution < _RealType > & __x )
  37286. {
  37287. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37288. typedef typename __istream_type :: ios_base __ios_base ;
  37289.  
  37290. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37291. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37292.  
  37293. _RealType __m , __n ;
  37294. __is >> __m >> __n >> __x . _M_gd_x >> __x . _M_gd_y ;
  37295. __x . param ( typename fisher_f_distribution < _RealType > ::
  37296. param_type ( __m , __n ) ) ;
  37297.  
  37298. __is . flags ( __flags ) ;
  37299. return __is ;
  37300. }
  37301.  
  37302.  
  37303. template < typename _RealType >
  37304. template < typename _ForwardIterator ,
  37305. typename _UniformRandomNumberGenerator >
  37306. void
  37307. std :: student_t_distribution < _RealType > ::
  37308. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37309. _UniformRandomNumberGenerator & __urng )
  37310. {
  37311.  
  37312. while ( __f != __t )
  37313. * __f ++ = _M_nd ( __urng ) * std :: sqrt ( n ( ) / _M_gd ( __urng ) ) ;
  37314. }
  37315.  
  37316. template < typename _RealType >
  37317. template < typename _ForwardIterator ,
  37318. typename _UniformRandomNumberGenerator >
  37319. void
  37320. std :: student_t_distribution < _RealType > ::
  37321. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37322. _UniformRandomNumberGenerator & __urng ,
  37323. const param_type & __p )
  37324. {
  37325.  
  37326. typename std :: gamma_distribution < result_type > :: param_type
  37327. __p2 ( __p . n ( ) / 2 , 2 ) ;
  37328. while ( __f != __t )
  37329. * __f ++ = _M_nd ( __urng ) * std :: sqrt ( __p . n ( ) / _M_gd ( __urng , __p2 ) ) ;
  37330. }
  37331.  
  37332. template < typename _RealType , typename _CharT , typename _Traits >
  37333. std :: basic_ostream < _CharT , _Traits > &
  37334. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37335. const student_t_distribution < _RealType > & __x )
  37336. {
  37337. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37338. typedef typename __ostream_type :: ios_base __ios_base ;
  37339.  
  37340. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37341. const _CharT __fill = __os . fill ( ) ;
  37342. const std :: streamsize __precision = __os . precision ( ) ;
  37343. const _CharT __space = __os . widen ( ' ' ) ;
  37344. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37345. __os . fill ( __space ) ;
  37346. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37347.  
  37348. __os << __x . n ( ) << __space << __x . _M_nd << __space << __x . _M_gd ;
  37349.  
  37350. __os . flags ( __flags ) ;
  37351. __os . fill ( __fill ) ;
  37352. __os . precision ( __precision ) ;
  37353. return __os ;
  37354. }
  37355.  
  37356. template < typename _RealType , typename _CharT , typename _Traits >
  37357. std :: basic_istream < _CharT , _Traits > &
  37358. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37359. student_t_distribution < _RealType > & __x )
  37360. {
  37361. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37362. typedef typename __istream_type :: ios_base __ios_base ;
  37363.  
  37364. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37365. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37366.  
  37367. _RealType __n ;
  37368. __is >> __n >> __x . _M_nd >> __x . _M_gd ;
  37369. __x . param ( typename student_t_distribution < _RealType > :: param_type ( __n ) ) ;
  37370.  
  37371. __is . flags ( __flags ) ;
  37372. return __is ;
  37373. }
  37374.  
  37375.  
  37376. template < typename _RealType >
  37377. void
  37378. gamma_distribution < _RealType > :: param_type ::
  37379. _M_initialize ( )
  37380. {
  37381. _M_malpha = _M_alpha < 1.0 ? _M_alpha + _RealType ( 1.0 ) : _M_alpha ;
  37382.  
  37383. const _RealType __a1 = _M_malpha - _RealType ( 1.0 ) / _RealType ( 3.0 ) ;
  37384. _M_a2 = _RealType ( 1.0 ) / std :: sqrt ( _RealType ( 9.0 ) * __a1 ) ;
  37385. }
  37386. #2485
  37387. template < typename _RealType >
  37388. template < typename _UniformRandomNumberGenerator >
  37389. typename gamma_distribution < _RealType > :: result_type
  37390. gamma_distribution < _RealType > ::
  37391. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  37392. const param_type & __param )
  37393. {
  37394. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37395. __aurng ( __urng ) ;
  37396.  
  37397. result_type __u , __v , __n ;
  37398. const result_type __a1 = ( __param . _M_malpha
  37399. - _RealType ( 1.0 ) / _RealType ( 3.0 ) ) ;
  37400.  
  37401. do
  37402. {
  37403. do
  37404. {
  37405. __n = _M_nd ( __urng ) ;
  37406. __v = result_type ( 1.0 ) + __param . _M_a2 * __n ;
  37407. }
  37408. while ( __v <= 0.0 ) ;
  37409.  
  37410. __v = __v * __v * __v ;
  37411. __u = __aurng ( ) ;
  37412. }
  37413. while ( __u > result_type ( 1.0 ) - 0.331 * __n * __n * __n * __n
  37414. && ( std :: log ( __u ) > ( 0.5 * __n * __n + __a1
  37415. * ( 1.0 - __v + std :: log ( __v ) ) ) ) ) ;
  37416.  
  37417. if ( __param . alpha ( ) == __param . _M_malpha )
  37418. return __a1 * __v * __param . beta ( ) ;
  37419. else
  37420. {
  37421. do
  37422. __u = __aurng ( ) ;
  37423. while ( __u == 0.0 ) ;
  37424.  
  37425. return ( std :: pow ( __u , result_type ( 1.0 ) / __param . alpha ( ) )
  37426. * __a1 * __v * __param . beta ( ) ) ;
  37427. }
  37428. }
  37429.  
  37430. template < typename _RealType >
  37431. template < typename _ForwardIterator ,
  37432. typename _UniformRandomNumberGenerator >
  37433. void
  37434. gamma_distribution < _RealType > ::
  37435. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37436. _UniformRandomNumberGenerator & __urng ,
  37437. const param_type & __param )
  37438. {
  37439.  
  37440. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37441. __aurng ( __urng ) ;
  37442.  
  37443. result_type __u , __v , __n ;
  37444. const result_type __a1 = ( __param . _M_malpha
  37445. - _RealType ( 1.0 ) / _RealType ( 3.0 ) ) ;
  37446.  
  37447. if ( __param . alpha ( ) == __param . _M_malpha )
  37448. while ( __f != __t )
  37449. {
  37450. do
  37451. {
  37452. do
  37453. {
  37454. __n = _M_nd ( __urng ) ;
  37455. __v = result_type ( 1.0 ) + __param . _M_a2 * __n ;
  37456. }
  37457. while ( __v <= 0.0 ) ;
  37458.  
  37459. __v = __v * __v * __v ;
  37460. __u = __aurng ( ) ;
  37461. }
  37462. while ( __u > result_type ( 1.0 ) - 0.331 * __n * __n * __n * __n
  37463. && ( std :: log ( __u ) > ( 0.5 * __n * __n + __a1
  37464. * ( 1.0 - __v + std :: log ( __v ) ) ) ) ) ;
  37465.  
  37466. * __f ++ = __a1 * __v * __param . beta ( ) ;
  37467. }
  37468. else
  37469. while ( __f != __t )
  37470. {
  37471. do
  37472. {
  37473. do
  37474. {
  37475. __n = _M_nd ( __urng ) ;
  37476. __v = result_type ( 1.0 ) + __param . _M_a2 * __n ;
  37477. }
  37478. while ( __v <= 0.0 ) ;
  37479.  
  37480. __v = __v * __v * __v ;
  37481. __u = __aurng ( ) ;
  37482. }
  37483. while ( __u > result_type ( 1.0 ) - 0.331 * __n * __n * __n * __n
  37484. && ( std :: log ( __u ) > ( 0.5 * __n * __n + __a1
  37485. * ( 1.0 - __v + std :: log ( __v ) ) ) ) ) ;
  37486.  
  37487. do
  37488. __u = __aurng ( ) ;
  37489. while ( __u == 0.0 ) ;
  37490.  
  37491. * __f ++ = ( std :: pow ( __u , result_type ( 1.0 ) / __param . alpha ( ) )
  37492. * __a1 * __v * __param . beta ( ) ) ;
  37493. }
  37494. }
  37495.  
  37496. template < typename _RealType , typename _CharT , typename _Traits >
  37497. std :: basic_ostream < _CharT , _Traits > &
  37498. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37499. const gamma_distribution < _RealType > & __x )
  37500. {
  37501. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37502. typedef typename __ostream_type :: ios_base __ios_base ;
  37503.  
  37504. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37505. const _CharT __fill = __os . fill ( ) ;
  37506. const std :: streamsize __precision = __os . precision ( ) ;
  37507. const _CharT __space = __os . widen ( ' ' ) ;
  37508. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37509. __os . fill ( __space ) ;
  37510. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37511.  
  37512. __os << __x . alpha ( ) << __space << __x . beta ( )
  37513. << __space << __x . _M_nd ;
  37514.  
  37515. __os . flags ( __flags ) ;
  37516. __os . fill ( __fill ) ;
  37517. __os . precision ( __precision ) ;
  37518. return __os ;
  37519. }
  37520.  
  37521. template < typename _RealType , typename _CharT , typename _Traits >
  37522. std :: basic_istream < _CharT , _Traits > &
  37523. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37524. gamma_distribution < _RealType > & __x )
  37525. {
  37526. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37527. typedef typename __istream_type :: ios_base __ios_base ;
  37528.  
  37529. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37530. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37531.  
  37532. _RealType __alpha_val , __beta_val ;
  37533. __is >> __alpha_val >> __beta_val >> __x . _M_nd ;
  37534. __x . param ( typename gamma_distribution < _RealType > ::
  37535. param_type ( __alpha_val , __beta_val ) ) ;
  37536.  
  37537. __is . flags ( __flags ) ;
  37538. return __is ;
  37539. }
  37540.  
  37541.  
  37542. template < typename _RealType >
  37543. template < typename _UniformRandomNumberGenerator >
  37544. typename weibull_distribution < _RealType > :: result_type
  37545. weibull_distribution < _RealType > ::
  37546. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  37547. const param_type & __p )
  37548. {
  37549. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37550. __aurng ( __urng ) ;
  37551. return __p . b ( ) * std :: pow ( - std :: log ( result_type ( 1 ) - __aurng ( ) ) ,
  37552. result_type ( 1 ) / __p . a ( ) ) ;
  37553. }
  37554.  
  37555. template < typename _RealType >
  37556. template < typename _ForwardIterator ,
  37557. typename _UniformRandomNumberGenerator >
  37558. void
  37559. weibull_distribution < _RealType > ::
  37560. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37561. _UniformRandomNumberGenerator & __urng ,
  37562. const param_type & __p )
  37563. {
  37564.  
  37565. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37566. __aurng ( __urng ) ;
  37567. auto __inv_a = result_type ( 1 ) / __p . a ( ) ;
  37568.  
  37569. while ( __f != __t )
  37570. * __f ++ = __p . b ( ) * std :: pow ( - std :: log ( result_type ( 1 ) - __aurng ( ) ) ,
  37571. __inv_a ) ;
  37572. }
  37573.  
  37574. template < typename _RealType , typename _CharT , typename _Traits >
  37575. std :: basic_ostream < _CharT , _Traits > &
  37576. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37577. const weibull_distribution < _RealType > & __x )
  37578. {
  37579. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37580. typedef typename __ostream_type :: ios_base __ios_base ;
  37581.  
  37582. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37583. const _CharT __fill = __os . fill ( ) ;
  37584. const std :: streamsize __precision = __os . precision ( ) ;
  37585. const _CharT __space = __os . widen ( ' ' ) ;
  37586. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37587. __os . fill ( __space ) ;
  37588. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37589.  
  37590. __os << __x . a ( ) << __space << __x . b ( ) ;
  37591.  
  37592. __os . flags ( __flags ) ;
  37593. __os . fill ( __fill ) ;
  37594. __os . precision ( __precision ) ;
  37595. return __os ;
  37596. }
  37597.  
  37598. template < typename _RealType , typename _CharT , typename _Traits >
  37599. std :: basic_istream < _CharT , _Traits > &
  37600. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37601. weibull_distribution < _RealType > & __x )
  37602. {
  37603. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37604. typedef typename __istream_type :: ios_base __ios_base ;
  37605.  
  37606. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37607. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37608.  
  37609. _RealType __a , __b ;
  37610. __is >> __a >> __b ;
  37611. __x . param ( typename weibull_distribution < _RealType > ::
  37612. param_type ( __a , __b ) ) ;
  37613.  
  37614. __is . flags ( __flags ) ;
  37615. return __is ;
  37616. }
  37617.  
  37618.  
  37619. template < typename _RealType >
  37620. template < typename _UniformRandomNumberGenerator >
  37621. typename extreme_value_distribution < _RealType > :: result_type
  37622. extreme_value_distribution < _RealType > ::
  37623. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  37624. const param_type & __p )
  37625. {
  37626. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37627. __aurng ( __urng ) ;
  37628. return __p . a ( ) - __p . b ( ) * std :: log ( - std :: log ( result_type ( 1 )
  37629. - __aurng ( ) ) ) ;
  37630. }
  37631.  
  37632. template < typename _RealType >
  37633. template < typename _ForwardIterator ,
  37634. typename _UniformRandomNumberGenerator >
  37635. void
  37636. extreme_value_distribution < _RealType > ::
  37637. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37638. _UniformRandomNumberGenerator & __urng ,
  37639. const param_type & __p )
  37640. {
  37641.  
  37642. __detail :: _Adaptor < _UniformRandomNumberGenerator , result_type >
  37643. __aurng ( __urng ) ;
  37644.  
  37645. while ( __f != __t )
  37646. * __f ++ = __p . a ( ) - __p . b ( ) * std :: log ( - std :: log ( result_type ( 1 )
  37647. - __aurng ( ) ) ) ;
  37648. }
  37649.  
  37650. template < typename _RealType , typename _CharT , typename _Traits >
  37651. std :: basic_ostream < _CharT , _Traits > &
  37652. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37653. const extreme_value_distribution < _RealType > & __x )
  37654. {
  37655. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37656. typedef typename __ostream_type :: ios_base __ios_base ;
  37657.  
  37658. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37659. const _CharT __fill = __os . fill ( ) ;
  37660. const std :: streamsize __precision = __os . precision ( ) ;
  37661. const _CharT __space = __os . widen ( ' ' ) ;
  37662. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37663. __os . fill ( __space ) ;
  37664. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  37665.  
  37666. __os << __x . a ( ) << __space << __x . b ( ) ;
  37667.  
  37668. __os . flags ( __flags ) ;
  37669. __os . fill ( __fill ) ;
  37670. __os . precision ( __precision ) ;
  37671. return __os ;
  37672. }
  37673.  
  37674. template < typename _RealType , typename _CharT , typename _Traits >
  37675. std :: basic_istream < _CharT , _Traits > &
  37676. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37677. extreme_value_distribution < _RealType > & __x )
  37678. {
  37679. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37680. typedef typename __istream_type :: ios_base __ios_base ;
  37681.  
  37682. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37683. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37684.  
  37685. _RealType __a , __b ;
  37686. __is >> __a >> __b ;
  37687. __x . param ( typename extreme_value_distribution < _RealType > ::
  37688. param_type ( __a , __b ) ) ;
  37689.  
  37690. __is . flags ( __flags ) ;
  37691. return __is ;
  37692. }
  37693.  
  37694.  
  37695. template < typename _IntType >
  37696. void
  37697. discrete_distribution < _IntType > :: param_type ::
  37698. _M_initialize ( )
  37699. {
  37700. if ( _M_prob . size ( ) < 2 )
  37701. {
  37702. _M_prob . clear ( ) ;
  37703. return ;
  37704. }
  37705.  
  37706. const double __sum = std :: accumulate ( _M_prob . begin ( ) ,
  37707. _M_prob . end ( ) , 0.0 ) ;
  37708.  
  37709. __detail :: __normalize ( _M_prob . begin ( ) , _M_prob . end ( ) , _M_prob . begin ( ) ,
  37710. __sum ) ;
  37711.  
  37712. _M_cp . reserve ( _M_prob . size ( ) ) ;
  37713. std :: partial_sum ( _M_prob . begin ( ) , _M_prob . end ( ) ,
  37714. std :: back_inserter ( _M_cp ) ) ;
  37715.  
  37716. _M_cp [ _M_cp . size ( ) - 1 ] = 1.0 ;
  37717. }
  37718.  
  37719. template < typename _IntType >
  37720. template < typename _Func >
  37721. discrete_distribution < _IntType > :: param_type ::
  37722. param_type ( size_t __nw , double __xmin , double __xmax , _Func __fw )
  37723. : _M_prob ( ) , _M_cp ( )
  37724. {
  37725. const size_t __n = __nw == 0 ? 1 : __nw ;
  37726. const double __delta = ( __xmax - __xmin ) / __n ;
  37727.  
  37728. _M_prob . reserve ( __n ) ;
  37729. for ( size_t __k = 0 ; __k < __nw ; ++ __k )
  37730. _M_prob . push_back ( __fw ( __xmin + __k * __delta + 0.5 * __delta ) ) ;
  37731.  
  37732. _M_initialize ( ) ;
  37733. }
  37734.  
  37735. template < typename _IntType >
  37736. template < typename _UniformRandomNumberGenerator >
  37737. typename discrete_distribution < _IntType > :: result_type
  37738. discrete_distribution < _IntType > ::
  37739. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  37740. const param_type & __param )
  37741. {
  37742. if ( __param . _M_cp . empty ( ) )
  37743. return result_type ( 0 ) ;
  37744.  
  37745. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  37746. __aurng ( __urng ) ;
  37747.  
  37748. const double __p = __aurng ( ) ;
  37749. auto __pos = std :: lower_bound ( __param . _M_cp . begin ( ) ,
  37750. __param . _M_cp . end ( ) , __p ) ;
  37751.  
  37752. return __pos - __param . _M_cp . begin ( ) ;
  37753. }
  37754.  
  37755. template < typename _IntType >
  37756. template < typename _ForwardIterator ,
  37757. typename _UniformRandomNumberGenerator >
  37758. void
  37759. discrete_distribution < _IntType > ::
  37760. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37761. _UniformRandomNumberGenerator & __urng ,
  37762. const param_type & __param )
  37763. {
  37764.  
  37765.  
  37766. if ( __param . _M_cp . empty ( ) )
  37767. {
  37768. while ( __f != __t )
  37769. * __f ++ = result_type ( 0 ) ;
  37770. return ;
  37771. }
  37772.  
  37773. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  37774. __aurng ( __urng ) ;
  37775.  
  37776. while ( __f != __t )
  37777. {
  37778. const double __p = __aurng ( ) ;
  37779. auto __pos = std :: lower_bound ( __param . _M_cp . begin ( ) ,
  37780. __param . _M_cp . end ( ) , __p ) ;
  37781.  
  37782. * __f ++ = __pos - __param . _M_cp . begin ( ) ;
  37783. }
  37784. }
  37785.  
  37786. template < typename _IntType , typename _CharT , typename _Traits >
  37787. std :: basic_ostream < _CharT , _Traits > &
  37788. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37789. const discrete_distribution < _IntType > & __x )
  37790. {
  37791. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  37792. typedef typename __ostream_type :: ios_base __ios_base ;
  37793.  
  37794. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  37795. const _CharT __fill = __os . fill ( ) ;
  37796. const std :: streamsize __precision = __os . precision ( ) ;
  37797. const _CharT __space = __os . widen ( ' ' ) ;
  37798. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  37799. __os . fill ( __space ) ;
  37800. __os . precision ( std :: numeric_limits < double > :: max_digits10 ) ;
  37801.  
  37802. std :: vector < double > __prob = __x . probabilities ( ) ;
  37803. __os << __prob . size ( ) ;
  37804. for ( auto __dit = __prob . begin ( ) ; __dit != __prob . end ( ) ; ++ __dit )
  37805. __os << __space << * __dit ;
  37806.  
  37807. __os . flags ( __flags ) ;
  37808. __os . fill ( __fill ) ;
  37809. __os . precision ( __precision ) ;
  37810. return __os ;
  37811. }
  37812.  
  37813. template < typename _IntType , typename _CharT , typename _Traits >
  37814. std :: basic_istream < _CharT , _Traits > &
  37815. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  37816. discrete_distribution < _IntType > & __x )
  37817. {
  37818. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  37819. typedef typename __istream_type :: ios_base __ios_base ;
  37820.  
  37821. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  37822. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  37823.  
  37824. size_t __n ;
  37825. __is >> __n ;
  37826.  
  37827. std :: vector < double > __prob_vec ;
  37828. __prob_vec . reserve ( __n ) ;
  37829. for ( ; __n != 0 ; -- __n )
  37830. {
  37831. double __prob ;
  37832. __is >> __prob ;
  37833. __prob_vec . push_back ( __prob ) ;
  37834. }
  37835.  
  37836. __x . param ( typename discrete_distribution < _IntType > ::
  37837. param_type ( __prob_vec . begin ( ) , __prob_vec . end ( ) ) ) ;
  37838.  
  37839. __is . flags ( __flags ) ;
  37840. return __is ;
  37841. }
  37842.  
  37843.  
  37844. template < typename _RealType >
  37845. void
  37846. piecewise_constant_distribution < _RealType > :: param_type ::
  37847. _M_initialize ( )
  37848. {
  37849. if ( _M_int . size ( ) < 2
  37850. || ( _M_int . size ( ) == 2
  37851. && _M_int [ 0 ] == _RealType ( 0 )
  37852. && _M_int [ 1 ] == _RealType ( 1 ) ) )
  37853. {
  37854. _M_int . clear ( ) ;
  37855. _M_den . clear ( ) ;
  37856. return ;
  37857. }
  37858.  
  37859. const double __sum = std :: accumulate ( _M_den . begin ( ) ,
  37860. _M_den . end ( ) , 0.0 ) ;
  37861.  
  37862. __detail :: __normalize ( _M_den . begin ( ) , _M_den . end ( ) , _M_den . begin ( ) ,
  37863. __sum ) ;
  37864.  
  37865. _M_cp . reserve ( _M_den . size ( ) ) ;
  37866. std :: partial_sum ( _M_den . begin ( ) , _M_den . end ( ) ,
  37867. std :: back_inserter ( _M_cp ) ) ;
  37868.  
  37869.  
  37870. _M_cp [ _M_cp . size ( ) - 1 ] = 1.0 ;
  37871.  
  37872. for ( size_t __k = 0 ; __k < _M_den . size ( ) ; ++ __k )
  37873. _M_den [ __k ] /= _M_int [ __k + 1 ] - _M_int [ __k ] ;
  37874. }
  37875.  
  37876. template < typename _RealType >
  37877. template < typename _InputIteratorB , typename _InputIteratorW >
  37878. piecewise_constant_distribution < _RealType > :: param_type ::
  37879. param_type ( _InputIteratorB __bbegin ,
  37880. _InputIteratorB __bend ,
  37881. _InputIteratorW __wbegin )
  37882. : _M_int ( ) , _M_den ( ) , _M_cp ( )
  37883. {
  37884. if ( __bbegin != __bend )
  37885. {
  37886. for ( ; ; )
  37887. {
  37888. _M_int . push_back ( * __bbegin ) ;
  37889. ++ __bbegin ;
  37890. if ( __bbegin == __bend )
  37891. break ;
  37892.  
  37893. _M_den . push_back ( * __wbegin ) ;
  37894. ++ __wbegin ;
  37895. }
  37896. }
  37897.  
  37898. _M_initialize ( ) ;
  37899. }
  37900.  
  37901. template < typename _RealType >
  37902. template < typename _Func >
  37903. piecewise_constant_distribution < _RealType > :: param_type ::
  37904. param_type ( initializer_list < _RealType > __bl , _Func __fw )
  37905. : _M_int ( ) , _M_den ( ) , _M_cp ( )
  37906. {
  37907. _M_int . reserve ( __bl . size ( ) ) ;
  37908. for ( auto __biter = __bl . begin ( ) ; __biter != __bl . end ( ) ; ++ __biter )
  37909. _M_int . push_back ( * __biter ) ;
  37910.  
  37911. _M_den . reserve ( _M_int . size ( ) - 1 ) ;
  37912. for ( size_t __k = 0 ; __k < _M_int . size ( ) - 1 ; ++ __k )
  37913. _M_den . push_back ( __fw ( 0.5 * ( _M_int [ __k + 1 ] + _M_int [ __k ] ) ) ) ;
  37914.  
  37915. _M_initialize ( ) ;
  37916. }
  37917.  
  37918. template < typename _RealType >
  37919. template < typename _Func >
  37920. piecewise_constant_distribution < _RealType > :: param_type ::
  37921. param_type ( size_t __nw , _RealType __xmin , _RealType __xmax , _Func __fw )
  37922. : _M_int ( ) , _M_den ( ) , _M_cp ( )
  37923. {
  37924. const size_t __n = __nw == 0 ? 1 : __nw ;
  37925. const _RealType __delta = ( __xmax - __xmin ) / __n ;
  37926.  
  37927. _M_int . reserve ( __n + 1 ) ;
  37928. for ( size_t __k = 0 ; __k <= __nw ; ++ __k )
  37929. _M_int . push_back ( __xmin + __k * __delta ) ;
  37930.  
  37931. _M_den . reserve ( __n ) ;
  37932. for ( size_t __k = 0 ; __k < __nw ; ++ __k )
  37933. _M_den . push_back ( __fw ( _M_int [ __k ] + 0.5 * __delta ) ) ;
  37934.  
  37935. _M_initialize ( ) ;
  37936. }
  37937.  
  37938. template < typename _RealType >
  37939. template < typename _UniformRandomNumberGenerator >
  37940. typename piecewise_constant_distribution < _RealType > :: result_type
  37941. piecewise_constant_distribution < _RealType > ::
  37942. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  37943. const param_type & __param )
  37944. {
  37945. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  37946. __aurng ( __urng ) ;
  37947.  
  37948. const double __p = __aurng ( ) ;
  37949. if ( __param . _M_cp . empty ( ) )
  37950. return __p ;
  37951.  
  37952. auto __pos = std :: lower_bound ( __param . _M_cp . begin ( ) ,
  37953. __param . _M_cp . end ( ) , __p ) ;
  37954. const size_t __i = __pos - __param . _M_cp . begin ( ) ;
  37955.  
  37956. const double __pref = __i > 0 ? __param . _M_cp [ __i - 1 ] : 0.0 ;
  37957.  
  37958. return __param . _M_int [ __i ] + ( __p - __pref ) / __param . _M_den [ __i ] ;
  37959. }
  37960.  
  37961. template < typename _RealType >
  37962. template < typename _ForwardIterator ,
  37963. typename _UniformRandomNumberGenerator >
  37964. void
  37965. piecewise_constant_distribution < _RealType > ::
  37966. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  37967. _UniformRandomNumberGenerator & __urng ,
  37968. const param_type & __param )
  37969. {
  37970.  
  37971. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  37972. __aurng ( __urng ) ;
  37973.  
  37974. if ( __param . _M_cp . empty ( ) )
  37975. {
  37976. while ( __f != __t )
  37977. * __f ++ = __aurng ( ) ;
  37978. return ;
  37979. }
  37980.  
  37981. while ( __f != __t )
  37982. {
  37983. const double __p = __aurng ( ) ;
  37984.  
  37985. auto __pos = std :: lower_bound ( __param . _M_cp . begin ( ) ,
  37986. __param . _M_cp . end ( ) , __p ) ;
  37987. const size_t __i = __pos - __param . _M_cp . begin ( ) ;
  37988.  
  37989. const double __pref = __i > 0 ? __param . _M_cp [ __i - 1 ] : 0.0 ;
  37990.  
  37991. * __f ++ = ( __param . _M_int [ __i ]
  37992. + ( __p - __pref ) / __param . _M_den [ __i ] ) ;
  37993. }
  37994. }
  37995.  
  37996. template < typename _RealType , typename _CharT , typename _Traits >
  37997. std :: basic_ostream < _CharT , _Traits > &
  37998. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  37999. const piecewise_constant_distribution < _RealType > & __x )
  38000. {
  38001. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  38002. typedef typename __ostream_type :: ios_base __ios_base ;
  38003.  
  38004. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  38005. const _CharT __fill = __os . fill ( ) ;
  38006. const std :: streamsize __precision = __os . precision ( ) ;
  38007. const _CharT __space = __os . widen ( ' ' ) ;
  38008. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  38009. __os . fill ( __space ) ;
  38010. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  38011.  
  38012. std :: vector < _RealType > __int = __x . intervals ( ) ;
  38013. __os << __int . size ( ) - 1 ;
  38014.  
  38015. for ( auto __xit = __int . begin ( ) ; __xit != __int . end ( ) ; ++ __xit )
  38016. __os << __space << * __xit ;
  38017.  
  38018. std :: vector < double > __den = __x . densities ( ) ;
  38019. for ( auto __dit = __den . begin ( ) ; __dit != __den . end ( ) ; ++ __dit )
  38020. __os << __space << * __dit ;
  38021.  
  38022. __os . flags ( __flags ) ;
  38023. __os . fill ( __fill ) ;
  38024. __os . precision ( __precision ) ;
  38025. return __os ;
  38026. }
  38027.  
  38028. template < typename _RealType , typename _CharT , typename _Traits >
  38029. std :: basic_istream < _CharT , _Traits > &
  38030. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  38031. piecewise_constant_distribution < _RealType > & __x )
  38032. {
  38033. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  38034. typedef typename __istream_type :: ios_base __ios_base ;
  38035.  
  38036. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  38037. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  38038.  
  38039. size_t __n ;
  38040. __is >> __n ;
  38041.  
  38042. std :: vector < _RealType > __int_vec ;
  38043. __int_vec . reserve ( __n + 1 ) ;
  38044. for ( size_t __i = 0 ; __i <= __n ; ++ __i )
  38045. {
  38046. _RealType __int ;
  38047. __is >> __int ;
  38048. __int_vec . push_back ( __int ) ;
  38049. }
  38050.  
  38051. std :: vector < double > __den_vec ;
  38052. __den_vec . reserve ( __n ) ;
  38053. for ( size_t __i = 0 ; __i < __n ; ++ __i )
  38054. {
  38055. double __den ;
  38056. __is >> __den ;
  38057. __den_vec . push_back ( __den ) ;
  38058. }
  38059.  
  38060. __x . param ( typename piecewise_constant_distribution < _RealType > ::
  38061. param_type ( __int_vec . begin ( ) , __int_vec . end ( ) , __den_vec . begin ( ) ) ) ;
  38062.  
  38063. __is . flags ( __flags ) ;
  38064. return __is ;
  38065. }
  38066.  
  38067.  
  38068. template < typename _RealType >
  38069. void
  38070. piecewise_linear_distribution < _RealType > :: param_type ::
  38071. _M_initialize ( )
  38072. {
  38073. if ( _M_int . size ( ) < 2
  38074. || ( _M_int . size ( ) == 2
  38075. && _M_int [ 0 ] == _RealType ( 0 )
  38076. && _M_int [ 1 ] == _RealType ( 1 )
  38077. && _M_den [ 0 ] == _M_den [ 1 ] ) )
  38078. {
  38079. _M_int . clear ( ) ;
  38080. _M_den . clear ( ) ;
  38081. return ;
  38082. }
  38083.  
  38084. double __sum = 0.0 ;
  38085. _M_cp . reserve ( _M_int . size ( ) - 1 ) ;
  38086. _M_m . reserve ( _M_int . size ( ) - 1 ) ;
  38087. for ( size_t __k = 0 ; __k < _M_int . size ( ) - 1 ; ++ __k )
  38088. {
  38089. const _RealType __delta = _M_int [ __k + 1 ] - _M_int [ __k ] ;
  38090. __sum += 0.5 * ( _M_den [ __k + 1 ] + _M_den [ __k ] ) * __delta ;
  38091. _M_cp . push_back ( __sum ) ;
  38092. _M_m . push_back ( ( _M_den [ __k + 1 ] - _M_den [ __k ] ) / __delta ) ;
  38093. }
  38094.  
  38095.  
  38096. __detail :: __normalize ( _M_den . begin ( ) , _M_den . end ( ) , _M_den . begin ( ) ,
  38097. __sum ) ;
  38098.  
  38099. __detail :: __normalize ( _M_cp . begin ( ) , _M_cp . end ( ) , _M_cp . begin ( ) , __sum ) ;
  38100.  
  38101. __detail :: __normalize ( _M_m . begin ( ) , _M_m . end ( ) , _M_m . begin ( ) , __sum ) ;
  38102.  
  38103.  
  38104. _M_cp [ _M_cp . size ( ) - 1 ] = 1.0 ;
  38105. }
  38106.  
  38107. template < typename _RealType >
  38108. template < typename _InputIteratorB , typename _InputIteratorW >
  38109. piecewise_linear_distribution < _RealType > :: param_type ::
  38110. param_type ( _InputIteratorB __bbegin ,
  38111. _InputIteratorB __bend ,
  38112. _InputIteratorW __wbegin )
  38113. : _M_int ( ) , _M_den ( ) , _M_cp ( ) , _M_m ( )
  38114. {
  38115. for ( ; __bbegin != __bend ; ++ __bbegin , ++ __wbegin )
  38116. {
  38117. _M_int . push_back ( * __bbegin ) ;
  38118. _M_den . push_back ( * __wbegin ) ;
  38119. }
  38120.  
  38121. _M_initialize ( ) ;
  38122. }
  38123.  
  38124. template < typename _RealType >
  38125. template < typename _Func >
  38126. piecewise_linear_distribution < _RealType > :: param_type ::
  38127. param_type ( initializer_list < _RealType > __bl , _Func __fw )
  38128. : _M_int ( ) , _M_den ( ) , _M_cp ( ) , _M_m ( )
  38129. {
  38130. _M_int . reserve ( __bl . size ( ) ) ;
  38131. _M_den . reserve ( __bl . size ( ) ) ;
  38132. for ( auto __biter = __bl . begin ( ) ; __biter != __bl . end ( ) ; ++ __biter )
  38133. {
  38134. _M_int . push_back ( * __biter ) ;
  38135. _M_den . push_back ( __fw ( * __biter ) ) ;
  38136. }
  38137.  
  38138. _M_initialize ( ) ;
  38139. }
  38140.  
  38141. template < typename _RealType >
  38142. template < typename _Func >
  38143. piecewise_linear_distribution < _RealType > :: param_type ::
  38144. param_type ( size_t __nw , _RealType __xmin , _RealType __xmax , _Func __fw )
  38145. : _M_int ( ) , _M_den ( ) , _M_cp ( ) , _M_m ( )
  38146. {
  38147. const size_t __n = __nw == 0 ? 1 : __nw ;
  38148. const _RealType __delta = ( __xmax - __xmin ) / __n ;
  38149.  
  38150. _M_int . reserve ( __n + 1 ) ;
  38151. _M_den . reserve ( __n + 1 ) ;
  38152. for ( size_t __k = 0 ; __k <= __nw ; ++ __k )
  38153. {
  38154. _M_int . push_back ( __xmin + __k * __delta ) ;
  38155. _M_den . push_back ( __fw ( _M_int [ __k ] + __delta ) ) ;
  38156. }
  38157.  
  38158. _M_initialize ( ) ;
  38159. }
  38160.  
  38161. template < typename _RealType >
  38162. template < typename _UniformRandomNumberGenerator >
  38163. typename piecewise_linear_distribution < _RealType > :: result_type
  38164. piecewise_linear_distribution < _RealType > ::
  38165. operator ( ) ( _UniformRandomNumberGenerator & __urng ,
  38166. const param_type & __param )
  38167. {
  38168. __detail :: _Adaptor < _UniformRandomNumberGenerator , double >
  38169. __aurng ( __urng ) ;
  38170.  
  38171. const double __p = __aurng ( ) ;
  38172. if ( __param . _M_cp . empty ( ) )
  38173. return __p ;
  38174.  
  38175. auto __pos = std :: lower_bound ( __param . _M_cp . begin ( ) ,
  38176. __param . _M_cp . end ( ) , __p ) ;
  38177. const size_t __i = __pos - __param . _M_cp . begin ( ) ;
  38178.  
  38179. const double __pref = __i > 0 ? __param . _M_cp [ __i - 1 ] : 0.0 ;
  38180.  
  38181. const double __a = 0.5 * __param . _M_m [ __i ] ;
  38182. const double __b = __param . _M_den [ __i ] ;
  38183. const double __cm = __p - __pref ;
  38184.  
  38185. _RealType __x = __param . _M_int [ __i ] ;
  38186. if ( __a == 0 )
  38187. __x += __cm / __b ;
  38188. else
  38189. {
  38190. const double __d = __b * __b + 4.0 * __a * __cm ;
  38191. __x += 0.5 * ( std :: sqrt ( __d ) - __b ) / __a ;
  38192. }
  38193.  
  38194. return __x ;
  38195. }
  38196.  
  38197. template < typename _RealType >
  38198. template < typename _ForwardIterator ,
  38199. typename _UniformRandomNumberGenerator >
  38200. void
  38201. piecewise_linear_distribution < _RealType > ::
  38202. __generate_impl ( _ForwardIterator __f , _ForwardIterator __t ,
  38203. _UniformRandomNumberGenerator & __urng ,
  38204. const param_type & __param )
  38205. {
  38206.  
  38207.  
  38208. while ( __f != __t )
  38209. * __f ++ = this -> operator ( ) ( __urng , __param ) ;
  38210. }
  38211.  
  38212. template < typename _RealType , typename _CharT , typename _Traits >
  38213. std :: basic_ostream < _CharT , _Traits > &
  38214. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  38215. const piecewise_linear_distribution < _RealType > & __x )
  38216. {
  38217. typedef std :: basic_ostream < _CharT , _Traits > __ostream_type ;
  38218. typedef typename __ostream_type :: ios_base __ios_base ;
  38219.  
  38220. const typename __ios_base :: fmtflags __flags = __os . flags ( ) ;
  38221. const _CharT __fill = __os . fill ( ) ;
  38222. const std :: streamsize __precision = __os . precision ( ) ;
  38223. const _CharT __space = __os . widen ( ' ' ) ;
  38224. __os . flags ( __ios_base :: scientific | __ios_base :: left ) ;
  38225. __os . fill ( __space ) ;
  38226. __os . precision ( std :: numeric_limits < _RealType > :: max_digits10 ) ;
  38227.  
  38228. std :: vector < _RealType > __int = __x . intervals ( ) ;
  38229. __os << __int . size ( ) - 1 ;
  38230.  
  38231. for ( auto __xit = __int . begin ( ) ; __xit != __int . end ( ) ; ++ __xit )
  38232. __os << __space << * __xit ;
  38233.  
  38234. std :: vector < double > __den = __x . densities ( ) ;
  38235. for ( auto __dit = __den . begin ( ) ; __dit != __den . end ( ) ; ++ __dit )
  38236. __os << __space << * __dit ;
  38237.  
  38238. __os . flags ( __flags ) ;
  38239. __os . fill ( __fill ) ;
  38240. __os . precision ( __precision ) ;
  38241. return __os ;
  38242. }
  38243.  
  38244. template < typename _RealType , typename _CharT , typename _Traits >
  38245. std :: basic_istream < _CharT , _Traits > &
  38246. operator >> ( std :: basic_istream < _CharT , _Traits > & __is ,
  38247. piecewise_linear_distribution < _RealType > & __x )
  38248. {
  38249. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  38250. typedef typename __istream_type :: ios_base __ios_base ;
  38251.  
  38252. const typename __ios_base :: fmtflags __flags = __is . flags ( ) ;
  38253. __is . flags ( __ios_base :: dec | __ios_base :: skipws ) ;
  38254.  
  38255. size_t __n ;
  38256. __is >> __n ;
  38257.  
  38258. std :: vector < _RealType > __int_vec ;
  38259. __int_vec . reserve ( __n + 1 ) ;
  38260. for ( size_t __i = 0 ; __i <= __n ; ++ __i )
  38261. {
  38262. _RealType __int ;
  38263. __is >> __int ;
  38264. __int_vec . push_back ( __int ) ;
  38265. }
  38266.  
  38267. std :: vector < double > __den_vec ;
  38268. __den_vec . reserve ( __n + 1 ) ;
  38269. for ( size_t __i = 0 ; __i <= __n ; ++ __i )
  38270. {
  38271. double __den ;
  38272. __is >> __den ;
  38273. __den_vec . push_back ( __den ) ;
  38274. }
  38275.  
  38276. __x . param ( typename piecewise_linear_distribution < _RealType > ::
  38277. param_type ( __int_vec . begin ( ) , __int_vec . end ( ) , __den_vec . begin ( ) ) ) ;
  38278.  
  38279. __is . flags ( __flags ) ;
  38280. return __is ;
  38281. }
  38282.  
  38283.  
  38284. template < typename _IntType >
  38285. seed_seq :: seed_seq ( std :: initializer_list < _IntType > __il )
  38286. {
  38287. for ( auto __iter = __il . begin ( ) ; __iter != __il . end ( ) ; ++ __iter )
  38288. _M_v . push_back ( __detail :: __mod < result_type ,
  38289. __detail :: _Shift < result_type , 32 > :: __value > ( * __iter ) ) ;
  38290. }
  38291.  
  38292. template < typename _InputIterator >
  38293. seed_seq :: seed_seq ( _InputIterator __begin , _InputIterator __end )
  38294. {
  38295. for ( _InputIterator __iter = __begin ; __iter != __end ; ++ __iter )
  38296. _M_v . push_back ( __detail :: __mod < result_type ,
  38297. __detail :: _Shift < result_type , 32 > :: __value > ( * __iter ) ) ;
  38298. }
  38299.  
  38300. template < typename _RandomAccessIterator >
  38301. void
  38302. seed_seq :: generate ( _RandomAccessIterator __begin ,
  38303. _RandomAccessIterator __end )
  38304. {
  38305. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  38306. _Type ;
  38307.  
  38308. if ( __begin == __end )
  38309. return ;
  38310.  
  38311. std :: fill ( __begin , __end , _Type ( 0x8b8b8b8bu ) ) ;
  38312.  
  38313. const size_t __n = __end - __begin ;
  38314. const size_t __s = _M_v . size ( ) ;
  38315. const size_t __t = ( __n >= 623 ) ? 11
  38316. : ( __n >= 68 ) ? 7
  38317. : ( __n >= 39 ) ? 5
  38318. : ( __n >= 7 ) ? 3
  38319. : ( __n - 1 ) / 2 ;
  38320. const size_t __p = ( __n - __t ) / 2 ;
  38321. const size_t __q = __p + __t ;
  38322. const size_t __m = std :: max ( size_t ( __s + 1 ) , __n ) ;
  38323.  
  38324. for ( size_t __k = 0 ; __k < __m ; ++ __k )
  38325. {
  38326. _Type __arg = ( __begin [ __k % __n ]
  38327. ^ __begin [ ( __k + __p ) % __n ]
  38328. ^ __begin [ ( __k - 1 ) % __n ] ) ;
  38329. _Type __r1 = __arg ^ ( __arg >> 27 ) ;
  38330. __r1 = __detail :: __mod < _Type ,
  38331. __detail :: _Shift < _Type , 32 > :: __value > ( 1664525u * __r1 ) ;
  38332. _Type __r2 = __r1 ;
  38333. if ( __k == 0 )
  38334. __r2 += __s ;
  38335. else if ( __k <= __s )
  38336. __r2 += __k % __n + _M_v [ __k - 1 ] ;
  38337. else
  38338. __r2 += __k % __n ;
  38339. __r2 = __detail :: __mod < _Type ,
  38340. __detail :: _Shift < _Type , 32 > :: __value > ( __r2 ) ;
  38341. __begin [ ( __k + __p ) % __n ] += __r1 ;
  38342. __begin [ ( __k + __q ) % __n ] += __r2 ;
  38343. __begin [ __k % __n ] = __r2 ;
  38344. }
  38345.  
  38346. for ( size_t __k = __m ; __k < __m + __n ; ++ __k )
  38347. {
  38348. _Type __arg = ( __begin [ __k % __n ]
  38349. + __begin [ ( __k + __p ) % __n ]
  38350. + __begin [ ( __k - 1 ) % __n ] ) ;
  38351. _Type __r3 = __arg ^ ( __arg >> 27 ) ;
  38352. __r3 = __detail :: __mod < _Type ,
  38353. __detail :: _Shift < _Type , 32 > :: __value > ( 1566083941u * __r3 ) ;
  38354. _Type __r4 = __r3 - __k % __n ;
  38355. __r4 = __detail :: __mod < _Type ,
  38356. __detail :: _Shift < _Type , 32 > :: __value > ( __r4 ) ;
  38357. __begin [ ( __k + __p ) % __n ] ^= __r3 ;
  38358. __begin [ ( __k + __q ) % __n ] ^= __r4 ;
  38359. __begin [ __k % __n ] = __r4 ;
  38360. }
  38361. }
  38362.  
  38363. template < typename _RealType , size_t __bits ,
  38364. typename _UniformRandomNumberGenerator >
  38365. _RealType
  38366. generate_canonical ( _UniformRandomNumberGenerator & __urng )
  38367. {
  38368. const size_t __b
  38369. = std :: min ( static_cast < size_t > ( std :: numeric_limits < _RealType > :: digits ) ,
  38370. __bits ) ;
  38371. const long double __r = static_cast < long double > ( __urng . max ( ) )
  38372. - static_cast < long double > ( __urng . min ( ) ) + 1.0L ;
  38373. const size_t __log2r = std :: log ( __r ) / std :: log ( 2.0L ) ;
  38374. size_t __k = std :: max < size_t > ( 1UL , ( __b + __log2r - 1UL ) / __log2r ) ;
  38375. _RealType __sum = _RealType ( 0 ) ;
  38376. _RealType __tmp = _RealType ( 1 ) ;
  38377. for ( ; __k != 0 ; -- __k )
  38378. {
  38379. __sum += _RealType ( __urng ( ) - __urng . min ( ) ) * __tmp ;
  38380. __tmp *= __r ;
  38381. }
  38382. return __sum / __tmp ;
  38383. }
  38384.  
  38385.  
  38386. }
  38387. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/functional"
  38388. #46
  38389. #pragma GCC system_header
  38390. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/typeinfo"
  38391. #32
  38392. #pragma GCC system_header
  38393. #39
  38394. #pragma GCC visibility push ( default )
  38395.  
  38396. extern "C++" {
  38397.  
  38398. namespace __cxxabiv1
  38399. {
  38400. class __class_type_info ;
  38401. }
  38402. #80
  38403. namespace std
  38404. {
  38405. #88
  38406. class type_info
  38407. {
  38408. public :
  38409.  
  38410.  
  38411.  
  38412.  
  38413. virtual ~ type_info ( ) ;
  38414.  
  38415.  
  38416.  
  38417. const char * name ( ) const noexcept
  38418. { return __name [ 0 ] == '*' ? __name + 1 : __name ; }
  38419. #115
  38420. bool before ( const type_info & __arg ) const noexcept
  38421. { return ( __name [ 0 ] == '*' && __arg . __name [ 0 ] == '*' )
  38422. ? __name < __arg . __name
  38423. : __builtin_strcmp ( __name , __arg . __name ) < 0 ; }
  38424.  
  38425. bool operator == ( const type_info & __arg ) const noexcept
  38426. {
  38427. return ( ( __name == __arg . __name )
  38428. || ( __name [ 0 ] != '*' &&
  38429. __builtin_strcmp ( __name , __arg . __name ) == 0 ) ) ;
  38430. }
  38431. #136
  38432. bool operator != ( const type_info & __arg ) const noexcept
  38433. { return ! operator == ( __arg ) ; }
  38434.  
  38435.  
  38436. size_t hash_code ( ) const noexcept
  38437. {
  38438.  
  38439. return _Hash_bytes ( name ( ) , __builtin_strlen ( name ( ) ) ,
  38440. static_cast < size_t > ( 0xc70f6907UL ) ) ;
  38441.  
  38442.  
  38443.  
  38444. }
  38445.  
  38446.  
  38447.  
  38448. virtual bool __is_pointer_p ( ) const ;
  38449.  
  38450.  
  38451. virtual bool __is_function_p ( ) const ;
  38452. #163
  38453. virtual bool __do_catch ( const type_info * __thr_type , void * * __thr_obj ,
  38454. unsigned __outer ) const ;
  38455.  
  38456.  
  38457. virtual bool __do_upcast ( const __cxxabiv1 :: __class_type_info * __target ,
  38458. void * * __obj_ptr ) const ;
  38459.  
  38460. protected :
  38461. const char * __name ;
  38462.  
  38463. explicit type_info ( const char * __n ) : __name ( __n ) { }
  38464.  
  38465. private :
  38466.  
  38467. type_info & operator = ( const type_info & ) ;
  38468. type_info ( const type_info & ) ;
  38469. } ;
  38470. #187
  38471. class bad_cast : public exception
  38472. {
  38473. public :
  38474. bad_cast ( ) noexcept { }
  38475.  
  38476.  
  38477.  
  38478. virtual ~ bad_cast ( ) noexcept ;
  38479.  
  38480.  
  38481. virtual const char * what ( ) const noexcept ;
  38482. } ;
  38483.  
  38484.  
  38485.  
  38486.  
  38487.  
  38488. class bad_typeid : public exception
  38489. {
  38490. public :
  38491. bad_typeid ( ) noexcept { }
  38492.  
  38493.  
  38494.  
  38495. virtual ~ bad_typeid ( ) noexcept ;
  38496.  
  38497.  
  38498. virtual const char * what ( ) const noexcept ;
  38499. } ;
  38500. }
  38501.  
  38502. }
  38503.  
  38504. #pragma GCC visibility pop
  38505. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/tuple"
  38506. #32
  38507. #pragma GCC system_header
  38508. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/include/CC/gnu/array"
  38509. #38
  38510. #pragma GCC system_header
  38511. #48
  38512. namespace std
  38513. {
  38514.  
  38515.  
  38516. template < typename _Tp , std :: size_t _Nm >
  38517. struct __array_traits
  38518. {
  38519. typedef _Tp _Type [ _Nm ] ;
  38520.  
  38521. static constexpr _Tp &
  38522. _S_ref ( const _Type & __t , std :: size_t __n ) noexcept
  38523. { return const_cast < _Tp & > ( __t [ __n ] ) ; }
  38524. } ;
  38525.  
  38526. template < typename _Tp >
  38527. struct __array_traits < _Tp , 0 >
  38528. {
  38529. struct _Type { } ;
  38530.  
  38531. static constexpr _Tp &
  38532. _S_ref ( const _Type & , std :: size_t ) noexcept
  38533. { return * static_cast < _Tp * > ( nullptr ) ; }
  38534. } ;
  38535. #86
  38536. template < typename _Tp , std :: size_t _Nm >
  38537. struct array
  38538. {
  38539. typedef _Tp value_type ;
  38540. typedef value_type * pointer ;
  38541. typedef const value_type * const_pointer ;
  38542. typedef value_type & reference ;
  38543. typedef const value_type & const_reference ;
  38544. typedef value_type * iterator ;
  38545. typedef const value_type * const_iterator ;
  38546. typedef std :: size_t size_type ;
  38547. typedef std :: ptrdiff_t difference_type ;
  38548. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  38549. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  38550.  
  38551.  
  38552. typedef std :: __array_traits < _Tp , _Nm > _AT_Type ;
  38553. typename _AT_Type :: _Type _M_elems ;
  38554.  
  38555.  
  38556.  
  38557.  
  38558. void
  38559. fill ( const value_type & __u )
  38560. { std :: fill_n ( begin ( ) , size ( ) , __u ) ; }
  38561.  
  38562. void
  38563. swap ( array & __other )
  38564. noexcept ( noexcept ( std :: swap ( std :: declval < _Tp & > ( ) , std :: declval < _Tp & > ( ) ) ) )
  38565. { std :: swap_ranges ( begin ( ) , end ( ) , __other . begin ( ) ) ; }
  38566.  
  38567.  
  38568. iterator
  38569. begin ( ) noexcept
  38570. { return iterator ( data ( ) ) ; }
  38571.  
  38572. const_iterator
  38573. begin ( ) const noexcept
  38574. { return const_iterator ( data ( ) ) ; }
  38575.  
  38576. iterator
  38577. end ( ) noexcept
  38578. { return iterator ( data ( ) + _Nm ) ; }
  38579.  
  38580. const_iterator
  38581. end ( ) const noexcept
  38582. { return const_iterator ( data ( ) + _Nm ) ; }
  38583.  
  38584. reverse_iterator
  38585. rbegin ( ) noexcept
  38586. { return reverse_iterator ( end ( ) ) ; }
  38587.  
  38588. const_reverse_iterator
  38589. rbegin ( ) const noexcept
  38590. { return const_reverse_iterator ( end ( ) ) ; }
  38591.  
  38592. reverse_iterator
  38593. rend ( ) noexcept
  38594. { return reverse_iterator ( begin ( ) ) ; }
  38595.  
  38596. const_reverse_iterator
  38597. rend ( ) const noexcept
  38598. { return const_reverse_iterator ( begin ( ) ) ; }
  38599.  
  38600. const_iterator
  38601. cbegin ( ) const noexcept
  38602. { return const_iterator ( data ( ) ) ; }
  38603.  
  38604. const_iterator
  38605. cend ( ) const noexcept
  38606. { return const_iterator ( data ( ) + _Nm ) ; }
  38607.  
  38608. const_reverse_iterator
  38609. crbegin ( ) const noexcept
  38610. { return const_reverse_iterator ( end ( ) ) ; }
  38611.  
  38612. const_reverse_iterator
  38613. crend ( ) const noexcept
  38614. { return const_reverse_iterator ( begin ( ) ) ; }
  38615.  
  38616.  
  38617. constexpr size_type
  38618. size ( ) const noexcept { return _Nm ; }
  38619.  
  38620. constexpr size_type
  38621. max_size ( ) const noexcept { return _Nm ; }
  38622.  
  38623. constexpr bool
  38624. empty ( ) const noexcept { return size ( ) == 0 ; }
  38625.  
  38626.  
  38627. reference
  38628. operator [ ] ( size_type __n )
  38629. { return _AT_Type :: _S_ref ( _M_elems , __n ) ; }
  38630.  
  38631. constexpr const_reference
  38632. operator [ ] ( size_type __n ) const noexcept
  38633. { return _AT_Type :: _S_ref ( _M_elems , __n ) ; }
  38634.  
  38635. reference
  38636. at ( size_type __n )
  38637. {
  38638. if ( __n >= _Nm )
  38639. std :: __throw_out_of_range ( ( "array::at" ) ) ;
  38640. return _AT_Type :: _S_ref ( _M_elems , __n ) ;
  38641. }
  38642.  
  38643. constexpr const_reference
  38644. at ( size_type __n ) const
  38645. {
  38646.  
  38647.  
  38648. return __n < _Nm ? _AT_Type :: _S_ref ( _M_elems , __n )
  38649. : ( std :: __throw_out_of_range ( ( "array::at" ) ) ,
  38650. _AT_Type :: _S_ref ( _M_elems , 0 ) ) ;
  38651. }
  38652.  
  38653. reference
  38654. front ( )
  38655. { return * begin ( ) ; }
  38656.  
  38657. constexpr const_reference
  38658. front ( ) const
  38659. { return _AT_Type :: _S_ref ( _M_elems , 0 ) ; }
  38660.  
  38661. reference
  38662. back ( )
  38663. { return _Nm ? * ( end ( ) - 1 ) : * end ( ) ; }
  38664.  
  38665. constexpr const_reference
  38666. back ( ) const
  38667. {
  38668. return _Nm ? _AT_Type :: _S_ref ( _M_elems , _Nm - 1 )
  38669. : _AT_Type :: _S_ref ( _M_elems , 0 ) ;
  38670. }
  38671.  
  38672. pointer
  38673. data ( ) noexcept
  38674. { return std :: __addressof ( _AT_Type :: _S_ref ( _M_elems , 0 ) ) ; }
  38675.  
  38676. const_pointer
  38677. data ( ) const noexcept
  38678. { return std :: __addressof ( _AT_Type :: _S_ref ( _M_elems , 0 ) ) ; }
  38679. } ;
  38680.  
  38681.  
  38682. template < typename _Tp , std :: size_t _Nm >
  38683. inline bool
  38684. operator == ( const array < _Tp , _Nm > & __one , const array < _Tp , _Nm > & __two )
  38685. { return std :: equal ( __one . begin ( ) , __one . end ( ) , __two . begin ( ) ) ; }
  38686.  
  38687. template < typename _Tp , std :: size_t _Nm >
  38688. inline bool
  38689. operator != ( const array < _Tp , _Nm > & __one , const array < _Tp , _Nm > & __two )
  38690. { return ! ( __one == __two ) ; }
  38691.  
  38692. template < typename _Tp , std :: size_t _Nm >
  38693. inline bool
  38694. operator < ( const array < _Tp , _Nm > & __a , const array < _Tp , _Nm > & __b )
  38695. {
  38696. return std :: lexicographical_compare ( __a . begin ( ) , __a . end ( ) ,
  38697. __b . begin ( ) , __b . end ( ) ) ;
  38698. }
  38699.  
  38700. template < typename _Tp , std :: size_t _Nm >
  38701. inline bool
  38702. operator > ( const array < _Tp , _Nm > & __one , const array < _Tp , _Nm > & __two )
  38703. { return __two < __one ; }
  38704.  
  38705. template < typename _Tp , std :: size_t _Nm >
  38706. inline bool
  38707. operator <= ( const array < _Tp , _Nm > & __one , const array < _Tp , _Nm > & __two )
  38708. { return ! ( __one > __two ) ; }
  38709.  
  38710. template < typename _Tp , std :: size_t _Nm >
  38711. inline bool
  38712. operator >= ( const array < _Tp , _Nm > & __one , const array < _Tp , _Nm > & __two )
  38713. { return ! ( __one < __two ) ; }
  38714.  
  38715.  
  38716. template < typename _Tp , std :: size_t _Nm >
  38717. inline void
  38718. swap ( array < _Tp , _Nm > & __one , array < _Tp , _Nm > & __two )
  38719. noexcept ( noexcept ( __one . swap ( __two ) ) )
  38720. { __one . swap ( __two ) ; }
  38721.  
  38722. template < std :: size_t _Int , typename _Tp , std :: size_t _Nm >
  38723. constexpr _Tp &
  38724. get ( array < _Tp , _Nm > & __arr ) noexcept
  38725. {
  38726. static_assert ( _Int < _Nm , "index is out of bounds" ) ;
  38727. return std :: __array_traits < _Tp , _Nm > ::
  38728. _S_ref ( __arr . _M_elems , _Int ) ;
  38729. }
  38730.  
  38731. template < std :: size_t _Int , typename _Tp , std :: size_t _Nm >
  38732. constexpr _Tp &&
  38733. get ( array < _Tp , _Nm > && __arr ) noexcept
  38734. {
  38735. static_assert ( _Int < _Nm , "index is out of bounds" ) ;
  38736. return std :: move ( get < _Int > ( __arr ) ) ;
  38737. }
  38738.  
  38739. template < std :: size_t _Int , typename _Tp , std :: size_t _Nm >
  38740. constexpr const _Tp &
  38741. get ( const array < _Tp , _Nm > & __arr ) noexcept
  38742. {
  38743. static_assert ( _Int < _Nm , "index is out of bounds" ) ;
  38744. return std :: __array_traits < _Tp , _Nm > ::
  38745. _S_ref ( __arr . _M_elems , _Int ) ;
  38746. }
  38747.  
  38748.  
  38749. }
  38750.  
  38751. namespace std
  38752. {
  38753.  
  38754.  
  38755.  
  38756.  
  38757.  
  38758. template < typename _Tp >
  38759. class tuple_size ;
  38760.  
  38761. template < typename _Tp , std :: size_t _Nm >
  38762. struct tuple_size < std :: array < _Tp , _Nm >>
  38763. : public integral_constant < std :: size_t , _Nm > { } ;
  38764.  
  38765.  
  38766. template < std :: size_t _Int , typename _Tp >
  38767. class tuple_element ;
  38768.  
  38769. template < std :: size_t _Int , typename _Tp , std :: size_t _Nm >
  38770. struct tuple_element < _Int , std :: array < _Tp , _Nm >>
  38771. {
  38772. static_assert ( _Int < _Nm , "index is out of bounds" ) ;
  38773. typedef _Tp type ;
  38774. } ;
  38775.  
  38776.  
  38777. }
  38778. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/uses_allocator.h"
  38779. #34
  38780. namespace std
  38781. {
  38782.  
  38783.  
  38784.  
  38785. struct allocator_arg_t { } ;
  38786.  
  38787. constexpr allocator_arg_t allocator_arg = allocator_arg_t ( ) ;
  38788.  
  38789. template < typename _Tp > class __has_allocator_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  38790. #43
  38791. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: allocator_type > * ) ; template < typename
  38792. #43
  38793. _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1 ; } ; template
  38794. #43
  38795. < typename _Tp > struct __has_allocator_type : integral_constant < bool , __has_allocator_type_helper < typename remove_cv
  38796. #43
  38797. < _Tp > :: type > :: value > { } ;
  38798.  
  38799. template < typename _Tp , typename _Alloc ,
  38800. bool = __has_allocator_type < _Tp > :: value >
  38801. struct __uses_allocator_helper
  38802. : public false_type { } ;
  38803.  
  38804. template < typename _Tp , typename _Alloc >
  38805. struct __uses_allocator_helper < _Tp , _Alloc , true >
  38806. : public integral_constant < bool , is_convertible < _Alloc ,
  38807. typename _Tp :: allocator_type > :: value >
  38808. { } ;
  38809.  
  38810.  
  38811. template < typename _Tp , typename _Alloc >
  38812. struct uses_allocator
  38813. : public integral_constant < bool ,
  38814. __uses_allocator_helper < _Tp , _Alloc > :: value >
  38815. { } ;
  38816.  
  38817. template < typename _Tp , typename _Alloc , typename ... _Args >
  38818. struct __uses_allocator_arg
  38819. : is_constructible < _Tp , _Alloc , _Args ... >
  38820. { static_assert ( uses_allocator < _Tp , _Alloc > :: value , "uses allocator" ) ; } ;
  38821.  
  38822. struct __uses_alloc_base { } ;
  38823. struct __uses_alloc0 : __uses_alloc_base
  38824. { struct _Anything { _Anything ( ... ) { } } _M_a ; } ;
  38825. template < typename _Alloc >
  38826. struct __uses_alloc1 : __uses_alloc_base { const _Alloc * _M_a ; } ;
  38827. template < typename _Alloc >
  38828. struct __uses_alloc2 : __uses_alloc_base { const _Alloc * _M_a ; } ;
  38829.  
  38830. template < bool , typename _Alloc , typename ... _Args >
  38831. struct __uses_alloc ;
  38832.  
  38833. template < typename _Tp , typename _Alloc , typename ... _Args >
  38834. struct __uses_alloc < true , _Tp , _Alloc , _Args ... >
  38835. : conditional <
  38836. is_constructible < _Tp , allocator_arg_t , _Alloc , _Args ... > :: value ,
  38837. __uses_alloc1 < _Alloc > ,
  38838. __uses_alloc2 < _Alloc >> :: type
  38839. { } ;
  38840.  
  38841. template < typename _Tp , typename _Alloc , typename ... _Args >
  38842. struct __uses_alloc < false , _Tp , _Alloc , _Args ... >
  38843. : __uses_alloc0 { } ;
  38844.  
  38845. template < typename _Tp , typename _Alloc , typename ... _Args >
  38846. struct __uses_alloc_impl
  38847. : __uses_alloc < uses_allocator < _Tp , _Alloc > :: value , _Tp , _Alloc , _Args ... >
  38848. { } ;
  38849.  
  38850. template < typename _Tp , typename _Alloc , typename ... _Args >
  38851. __uses_alloc_impl < _Tp , _Alloc , _Args ... >
  38852. __use_alloc ( const _Alloc & __a )
  38853. {
  38854. __uses_alloc_impl < _Tp , _Alloc , _Args ... > __ret ;
  38855. __ret . _M_a = & __a ;
  38856. return __ret ;
  38857. }
  38858.  
  38859.  
  38860. }
  38861. #42 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/tuple"
  38862. namespace std
  38863. {
  38864. #52
  38865. template < typename _Tp >
  38866. struct __add_c_ref
  38867. { typedef const _Tp & type ; } ;
  38868.  
  38869. template < typename _Tp >
  38870. struct __add_c_ref < _Tp & >
  38871. { typedef _Tp & type ; } ;
  38872.  
  38873.  
  38874. template < typename _Tp >
  38875. struct __add_ref
  38876. { typedef _Tp & type ; } ;
  38877.  
  38878. template < typename _Tp >
  38879. struct __add_ref < _Tp & >
  38880. { typedef _Tp & type ; } ;
  38881.  
  38882.  
  38883. template < typename _Tp >
  38884. struct __add_r_ref
  38885. { typedef _Tp && type ; } ;
  38886.  
  38887. template < typename _Tp >
  38888. struct __add_r_ref < _Tp & >
  38889. { typedef _Tp & type ; } ;
  38890.  
  38891. template < std :: size_t _Idx , typename _Head , bool _IsEmptyNotFinal >
  38892. struct _Head_base ;
  38893.  
  38894. template < std :: size_t _Idx , typename _Head >
  38895. struct _Head_base < _Idx , _Head , true >
  38896. : public _Head
  38897. {
  38898. constexpr _Head_base ( )
  38899. : _Head ( ) { }
  38900.  
  38901. constexpr _Head_base ( const _Head & __h )
  38902. : _Head ( __h ) { }
  38903.  
  38904. template < typename _UHead , typename = typename
  38905. enable_if < ! is_convertible < _UHead ,
  38906. __uses_alloc_base > :: value > :: type >
  38907. constexpr _Head_base ( _UHead && __h )
  38908. : _Head ( std :: forward < _UHead > ( __h ) ) { }
  38909.  
  38910. _Head_base ( __uses_alloc0 )
  38911. : _Head ( ) { }
  38912.  
  38913. template < typename _Alloc >
  38914. _Head_base ( __uses_alloc1 < _Alloc > __a )
  38915. : _Head ( allocator_arg , * __a . _M_a ) { }
  38916.  
  38917. template < typename _Alloc >
  38918. _Head_base ( __uses_alloc2 < _Alloc > __a )
  38919. : _Head ( * __a . _M_a ) { }
  38920.  
  38921. template < typename _UHead >
  38922. _Head_base ( __uses_alloc0 , _UHead && __uhead )
  38923. : _Head ( std :: forward < _UHead > ( __uhead ) ) { }
  38924.  
  38925. template < typename _Alloc , typename _UHead >
  38926. _Head_base ( __uses_alloc1 < _Alloc > __a , _UHead && __uhead )
  38927. : _Head ( allocator_arg , * __a . _M_a , std :: forward < _UHead > ( __uhead ) ) { }
  38928.  
  38929. template < typename _Alloc , typename _UHead >
  38930. _Head_base ( __uses_alloc2 < _Alloc > __a , _UHead && __uhead )
  38931. : _Head ( std :: forward < _UHead > ( __uhead ) , * __a . _M_a ) { }
  38932.  
  38933. static constexpr _Head &
  38934. _M_head ( _Head_base & __b ) noexcept { return __b ; }
  38935.  
  38936. static constexpr const _Head &
  38937. _M_head ( const _Head_base & __b ) noexcept { return __b ; }
  38938. } ;
  38939.  
  38940. template < std :: size_t _Idx , typename _Head >
  38941. struct _Head_base < _Idx , _Head , false >
  38942. {
  38943. constexpr _Head_base ( )
  38944. : _M_head_impl ( ) { }
  38945.  
  38946. constexpr _Head_base ( const _Head & __h )
  38947. : _M_head_impl ( __h ) { }
  38948.  
  38949. template < typename _UHead , typename = typename
  38950. enable_if < ! is_convertible < _UHead ,
  38951. __uses_alloc_base > :: value > :: type >
  38952. constexpr _Head_base ( _UHead && __h )
  38953. : _M_head_impl ( std :: forward < _UHead > ( __h ) ) { }
  38954.  
  38955. _Head_base ( __uses_alloc0 )
  38956. : _M_head_impl ( ) { }
  38957.  
  38958. template < typename _Alloc >
  38959. _Head_base ( __uses_alloc1 < _Alloc > __a )
  38960. : _M_head_impl ( allocator_arg , * __a . _M_a ) { }
  38961.  
  38962. template < typename _Alloc >
  38963. _Head_base ( __uses_alloc2 < _Alloc > __a )
  38964. : _M_head_impl ( * __a . _M_a ) { }
  38965.  
  38966. template < typename _UHead >
  38967. _Head_base ( __uses_alloc0 , _UHead && __uhead )
  38968. : _M_head_impl ( std :: forward < _UHead > ( __uhead ) ) { }
  38969.  
  38970. template < typename _Alloc , typename _UHead >
  38971. _Head_base ( __uses_alloc1 < _Alloc > __a , _UHead && __uhead )
  38972. : _M_head_impl ( allocator_arg , * __a . _M_a , std :: forward < _UHead > ( __uhead ) )
  38973. { }
  38974.  
  38975. template < typename _Alloc , typename _UHead >
  38976. _Head_base ( __uses_alloc2 < _Alloc > __a , _UHead && __uhead )
  38977. : _M_head_impl ( std :: forward < _UHead > ( __uhead ) , * __a . _M_a ) { }
  38978.  
  38979. static constexpr _Head &
  38980. _M_head ( _Head_base & __b ) noexcept { return __b . _M_head_impl ; }
  38981.  
  38982. static constexpr const _Head &
  38983. _M_head ( const _Head_base & __b ) noexcept { return __b . _M_head_impl ; }
  38984.  
  38985. _Head _M_head_impl ;
  38986. } ;
  38987. #183
  38988. template < std :: size_t _Idx , typename ... _Elements >
  38989. struct _Tuple_impl ;
  38990.  
  38991.  
  38992.  
  38993.  
  38994.  
  38995. template < std :: size_t _Idx >
  38996. struct _Tuple_impl < _Idx >
  38997. {
  38998. template < std :: size_t , typename ... > friend class _Tuple_impl ;
  38999.  
  39000. _Tuple_impl ( ) = default ;
  39001.  
  39002. template < typename _Alloc >
  39003. _Tuple_impl ( allocator_arg_t , const _Alloc & ) { }
  39004.  
  39005. template < typename _Alloc >
  39006. _Tuple_impl ( allocator_arg_t , const _Alloc & , const _Tuple_impl & ) { }
  39007.  
  39008. template < typename _Alloc >
  39009. _Tuple_impl ( allocator_arg_t , const _Alloc & , _Tuple_impl && ) { }
  39010.  
  39011. protected :
  39012. void _M_swap ( _Tuple_impl & ) noexcept { }
  39013. } ;
  39014.  
  39015. template < typename _Tp >
  39016. struct __is_empty_non_tuple : is_empty < _Tp > { } ;
  39017.  
  39018.  
  39019. template < typename _El0 , typename ... _El >
  39020. struct __is_empty_non_tuple < tuple < _El0 , _El ... >> : false_type { } ;
  39021.  
  39022.  
  39023. template < typename _Tp >
  39024. using __empty_not_final
  39025. = typename conditional < __oracle_is_final ( _Tp ) , false_type ,
  39026. __is_empty_non_tuple < _Tp >> :: type ;
  39027. #228
  39028. template < std :: size_t _Idx , typename _Head , typename ... _Tail >
  39029. struct _Tuple_impl < _Idx , _Head , _Tail ... >
  39030. : public _Tuple_impl < _Idx + 1 , _Tail ... > ,
  39031. private _Head_base < _Idx , _Head , __empty_not_final < _Head > :: value >
  39032. {
  39033. template < std :: size_t , typename ... > friend class _Tuple_impl ;
  39034.  
  39035. typedef _Tuple_impl < _Idx + 1 , _Tail ... > _Inherited ;
  39036. typedef _Head_base < _Idx , _Head , __empty_not_final < _Head > :: value > _Base ;
  39037.  
  39038. static constexpr _Head &
  39039. _M_head ( _Tuple_impl & __t ) noexcept { return _Base :: _M_head ( __t ) ; }
  39040.  
  39041. static constexpr const _Head &
  39042. _M_head ( const _Tuple_impl & __t ) noexcept { return _Base :: _M_head ( __t ) ; }
  39043.  
  39044. static constexpr _Inherited &
  39045. _M_tail ( _Tuple_impl & __t ) noexcept { return __t ; }
  39046.  
  39047. static constexpr const _Inherited &
  39048. _M_tail ( const _Tuple_impl & __t ) noexcept { return __t ; }
  39049.  
  39050. constexpr _Tuple_impl ( )
  39051. : _Inherited ( ) , _Base ( ) { }
  39052.  
  39053. explicit
  39054. constexpr _Tuple_impl ( const _Head & __head , const _Tail & ... __tail )
  39055. : _Inherited ( __tail ... ) , _Base ( __head ) { }
  39056.  
  39057. template < typename _UHead , typename ... _UTail , typename = typename
  39058. enable_if < sizeof ... ( _Tail ) == sizeof ... ( _UTail ) > :: type >
  39059. explicit
  39060. constexpr _Tuple_impl ( _UHead && __head , _UTail && ... __tail )
  39061. : _Inherited ( std :: forward < _UTail > ( __tail ) ... ) ,
  39062. _Base ( std :: forward < _UHead > ( __head ) ) { }
  39063.  
  39064. constexpr _Tuple_impl ( const _Tuple_impl & ) = default ;
  39065.  
  39066. constexpr
  39067. _Tuple_impl ( _Tuple_impl && __in )
  39068. noexcept ( __and_ < is_nothrow_move_constructible < _Head > ,
  39069. is_nothrow_move_constructible < _Inherited >> :: value )
  39070. : _Inherited ( std :: move ( _M_tail ( __in ) ) ) ,
  39071. _Base ( std :: forward < _Head > ( _M_head ( __in ) ) ) { }
  39072.  
  39073. template < typename ... _UElements >
  39074. constexpr _Tuple_impl ( const _Tuple_impl < _Idx , _UElements ... > & __in )
  39075. : _Inherited ( _Tuple_impl < _Idx , _UElements ... > :: _M_tail ( __in ) ) ,
  39076. _Base ( _Tuple_impl < _Idx , _UElements ... > :: _M_head ( __in ) ) { }
  39077.  
  39078. template < typename _UHead , typename ... _UTails >
  39079. constexpr _Tuple_impl ( _Tuple_impl < _Idx , _UHead , _UTails ... > && __in )
  39080. : _Inherited ( std :: move
  39081. ( _Tuple_impl < _Idx , _UHead , _UTails ... > :: _M_tail ( __in ) ) ) ,
  39082. _Base ( std :: forward < _UHead >
  39083. ( _Tuple_impl < _Idx , _UHead , _UTails ... > :: _M_head ( __in ) ) ) { }
  39084.  
  39085. template < typename _Alloc >
  39086. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a )
  39087. : _Inherited ( __tag , __a ) ,
  39088. _Base ( __use_alloc < _Head > ( __a ) ) { }
  39089.  
  39090. template < typename _Alloc >
  39091. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a ,
  39092. const _Head & __head , const _Tail & ... __tail )
  39093. : _Inherited ( __tag , __a , __tail ... ) ,
  39094. _Base ( __use_alloc < _Head , _Alloc , _Head > ( __a ) , __head ) { }
  39095.  
  39096. template < typename _Alloc , typename _UHead , typename ... _UTail ,
  39097. typename = typename enable_if < sizeof ... ( _Tail )
  39098. == sizeof ... ( _UTail ) > :: type >
  39099. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a ,
  39100. _UHead && __head , _UTail && ... __tail )
  39101. : _Inherited ( __tag , __a , std :: forward < _UTail > ( __tail ) ... ) ,
  39102. _Base ( __use_alloc < _Head , _Alloc , _UHead > ( __a ) ,
  39103. std :: forward < _UHead > ( __head ) ) { }
  39104.  
  39105. template < typename _Alloc >
  39106. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a ,
  39107. const _Tuple_impl & __in )
  39108. : _Inherited ( __tag , __a , _M_tail ( __in ) ) ,
  39109. _Base ( __use_alloc < _Head , _Alloc , _Head > ( __a ) , _M_head ( __in ) ) { }
  39110.  
  39111. template < typename _Alloc >
  39112. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a ,
  39113. _Tuple_impl && __in )
  39114. : _Inherited ( __tag , __a , std :: move ( _M_tail ( __in ) ) ) ,
  39115. _Base ( __use_alloc < _Head , _Alloc , _Head > ( __a ) ,
  39116. std :: forward < _Head > ( _M_head ( __in ) ) ) { }
  39117.  
  39118. template < typename _Alloc , typename ... _UElements >
  39119. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a ,
  39120. const _Tuple_impl < _Idx , _UElements ... > & __in )
  39121. : _Inherited ( __tag , __a ,
  39122. _Tuple_impl < _Idx , _UElements ... > :: _M_tail ( __in ) ) ,
  39123. _Base ( __use_alloc < _Head , _Alloc , _Head > ( __a ) ,
  39124. _Tuple_impl < _Idx , _UElements ... > :: _M_head ( __in ) ) { }
  39125.  
  39126. template < typename _Alloc , typename _UHead , typename ... _UTails >
  39127. _Tuple_impl ( allocator_arg_t __tag , const _Alloc & __a ,
  39128. _Tuple_impl < _Idx , _UHead , _UTails ... > && __in )
  39129. : _Inherited ( __tag , __a , std :: move
  39130. ( _Tuple_impl < _Idx , _UHead , _UTails ... > :: _M_tail ( __in ) ) ) ,
  39131. _Base ( __use_alloc < _Head , _Alloc , _UHead > ( __a ) ,
  39132. std :: forward < _UHead >
  39133. ( _Tuple_impl < _Idx , _UHead , _UTails ... > :: _M_head ( __in ) ) ) { }
  39134.  
  39135. _Tuple_impl &
  39136. operator = ( const _Tuple_impl & __in )
  39137. {
  39138. _M_head ( * this ) = _M_head ( __in ) ;
  39139. _M_tail ( * this ) = _M_tail ( __in ) ;
  39140. return * this ;
  39141. }
  39142.  
  39143. _Tuple_impl &
  39144. operator = ( _Tuple_impl && __in )
  39145. noexcept ( __and_ < is_nothrow_move_assignable < _Head > ,
  39146. is_nothrow_move_assignable < _Inherited >> :: value )
  39147. {
  39148. _M_head ( * this ) = std :: forward < _Head > ( _M_head ( __in ) ) ;
  39149. _M_tail ( * this ) = std :: move ( _M_tail ( __in ) ) ;
  39150. return * this ;
  39151. }
  39152.  
  39153. template < typename ... _UElements >
  39154. _Tuple_impl &
  39155. operator = ( const _Tuple_impl < _Idx , _UElements ... > & __in )
  39156. {
  39157. _M_head ( * this ) = _Tuple_impl < _Idx , _UElements ... > :: _M_head ( __in ) ;
  39158. _M_tail ( * this ) = _Tuple_impl < _Idx , _UElements ... > :: _M_tail ( __in ) ;
  39159. return * this ;
  39160. }
  39161.  
  39162. template < typename _UHead , typename ... _UTails >
  39163. _Tuple_impl &
  39164. operator = ( _Tuple_impl < _Idx , _UHead , _UTails ... > && __in )
  39165. {
  39166. _M_head ( * this ) = std :: forward < _UHead >
  39167. ( _Tuple_impl < _Idx , _UHead , _UTails ... > :: _M_head ( __in ) ) ;
  39168. _M_tail ( * this ) = std :: move
  39169. ( _Tuple_impl < _Idx , _UHead , _UTails ... > :: _M_tail ( __in ) ) ;
  39170. return * this ;
  39171. }
  39172.  
  39173. protected :
  39174. void
  39175. _M_swap ( _Tuple_impl & __in )
  39176. noexcept ( noexcept ( swap ( std :: declval < _Head & > ( ) ,
  39177. std :: declval < _Head & > ( ) ) )
  39178. && noexcept ( _M_tail ( __in ) . _M_swap ( _M_tail ( __in ) ) ) )
  39179. {
  39180. using std :: swap ;
  39181. swap ( _M_head ( * this ) , _M_head ( __in ) ) ;
  39182. _Inherited :: _M_swap ( _M_tail ( __in ) ) ;
  39183. }
  39184. } ;
  39185.  
  39186.  
  39187. template < typename ... _Elements >
  39188. class tuple : public _Tuple_impl < 0 , _Elements ... >
  39189. {
  39190. typedef _Tuple_impl < 0 , _Elements ... > _Inherited ;
  39191.  
  39192. public :
  39193. constexpr tuple ( )
  39194. : _Inherited ( ) { }
  39195.  
  39196. explicit
  39197. constexpr tuple ( const _Elements & ... __elements )
  39198. : _Inherited ( __elements ... ) { }
  39199.  
  39200. template < typename ... _UElements , typename = typename
  39201. enable_if < __and_ < is_convertible < _UElements ,
  39202. _Elements > ... > :: value > :: type >
  39203. explicit
  39204. constexpr tuple ( _UElements && ... __elements )
  39205. : _Inherited ( std :: forward < _UElements > ( __elements ) ... ) { }
  39206.  
  39207. constexpr tuple ( const tuple & ) = default ;
  39208.  
  39209. constexpr tuple ( tuple && ) = default ;
  39210.  
  39211. template < typename ... _UElements , typename = typename
  39212. enable_if < __and_ < is_convertible < const _UElements & ,
  39213. _Elements > ... > :: value > :: type >
  39214. constexpr tuple ( const tuple < _UElements ... > & __in )
  39215. : _Inherited ( static_cast < const _Tuple_impl < 0 , _UElements ... > & > ( __in ) )
  39216. { }
  39217.  
  39218. template < typename ... _UElements , typename = typename
  39219. enable_if < __and_ < is_convertible < _UElements ,
  39220. _Elements > ... > :: value > :: type >
  39221. constexpr tuple ( tuple < _UElements ... > && __in )
  39222. : _Inherited ( static_cast < _Tuple_impl < 0 , _UElements ... > && > ( __in ) ) { }
  39223.  
  39224.  
  39225.  
  39226. template < typename _Alloc >
  39227. tuple ( allocator_arg_t __tag , const _Alloc & __a )
  39228. : _Inherited ( __tag , __a ) { }
  39229.  
  39230. template < typename _Alloc >
  39231. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39232. const _Elements & ... __elements )
  39233. : _Inherited ( __tag , __a , __elements ... ) { }
  39234.  
  39235. template < typename _Alloc , typename ... _UElements , typename = typename
  39236. enable_if < sizeof ... ( _UElements )
  39237. == sizeof ... ( _Elements ) > :: type >
  39238. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39239. _UElements && ... __elements )
  39240. : _Inherited ( __tag , __a , std :: forward < _UElements > ( __elements ) ... )
  39241. { }
  39242.  
  39243. template < typename _Alloc >
  39244. tuple ( allocator_arg_t __tag , const _Alloc & __a , const tuple & __in )
  39245. : _Inherited ( __tag , __a , static_cast < const _Inherited & > ( __in ) ) { }
  39246.  
  39247. template < typename _Alloc >
  39248. tuple ( allocator_arg_t __tag , const _Alloc & __a , tuple && __in )
  39249. : _Inherited ( __tag , __a , static_cast < _Inherited && > ( __in ) ) { }
  39250.  
  39251. template < typename _Alloc , typename ... _UElements , typename = typename
  39252. enable_if < sizeof ... ( _UElements )
  39253. == sizeof ... ( _Elements ) > :: type >
  39254. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39255. const tuple < _UElements ... > & __in )
  39256. : _Inherited ( __tag , __a ,
  39257. static_cast < const _Tuple_impl < 0 , _UElements ... > & > ( __in ) )
  39258. { }
  39259.  
  39260. template < typename _Alloc , typename ... _UElements , typename = typename
  39261. enable_if < sizeof ... ( _UElements )
  39262. == sizeof ... ( _Elements ) > :: type >
  39263. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39264. tuple < _UElements ... > && __in )
  39265. : _Inherited ( __tag , __a ,
  39266. static_cast < _Tuple_impl < 0 , _UElements ... > && > ( __in ) )
  39267. { }
  39268.  
  39269. tuple &
  39270. operator = ( const tuple & __in )
  39271. {
  39272. static_cast < _Inherited & > ( * this ) = __in ;
  39273. return * this ;
  39274. }
  39275.  
  39276. tuple &
  39277. operator = ( tuple && __in )
  39278. noexcept ( is_nothrow_move_assignable < _Inherited > :: value )
  39279. {
  39280. static_cast < _Inherited & > ( * this ) = std :: move ( __in ) ;
  39281. return * this ;
  39282. }
  39283.  
  39284. template < typename ... _UElements , typename = typename
  39285. enable_if < sizeof ... ( _UElements )
  39286. == sizeof ... ( _Elements ) > :: type >
  39287. tuple &
  39288. operator = ( const tuple < _UElements ... > & __in )
  39289. {
  39290. static_cast < _Inherited & > ( * this ) = __in ;
  39291. return * this ;
  39292. }
  39293.  
  39294. template < typename ... _UElements , typename = typename
  39295. enable_if < sizeof ... ( _UElements )
  39296. == sizeof ... ( _Elements ) > :: type >
  39297. tuple &
  39298. operator = ( tuple < _UElements ... > && __in )
  39299. {
  39300. static_cast < _Inherited & > ( * this ) = std :: move ( __in ) ;
  39301. return * this ;
  39302. }
  39303.  
  39304. void
  39305. swap ( tuple & __in )
  39306. noexcept ( noexcept ( __in . _M_swap ( __in ) ) )
  39307. { _Inherited :: _M_swap ( __in ) ; }
  39308. } ;
  39309.  
  39310.  
  39311. template < >
  39312. class tuple < >
  39313. {
  39314. public :
  39315. void swap ( tuple & ) noexcept { }
  39316. } ;
  39317.  
  39318.  
  39319.  
  39320. template < typename _T1 , typename _T2 >
  39321. class tuple < _T1 , _T2 > : public _Tuple_impl < 0 , _T1 , _T2 >
  39322. {
  39323. typedef _Tuple_impl < 0 , _T1 , _T2 > _Inherited ;
  39324.  
  39325. public :
  39326. constexpr tuple ( )
  39327. : _Inherited ( ) { }
  39328.  
  39329. explicit
  39330. constexpr tuple ( const _T1 & __a1 , const _T2 & __a2 )
  39331. : _Inherited ( __a1 , __a2 ) { }
  39332.  
  39333. template < typename _U1 , typename _U2 , typename = typename
  39334. enable_if < __and_ < is_convertible < _U1 , _T1 > ,
  39335. is_convertible < _U2 , _T2 >> :: value > :: type >
  39336. explicit
  39337. constexpr tuple ( _U1 && __a1 , _U2 && __a2 )
  39338. : _Inherited ( std :: forward < _U1 > ( __a1 ) , std :: forward < _U2 > ( __a2 ) ) { }
  39339.  
  39340. constexpr tuple ( const tuple & ) = default ;
  39341.  
  39342. constexpr tuple ( tuple && ) = default ;
  39343.  
  39344. template < typename _U1 , typename _U2 , typename = typename
  39345. enable_if < __and_ < is_convertible < const _U1 & , _T1 > ,
  39346. is_convertible < const _U2 & , _T2 >> :: value > :: type >
  39347. constexpr tuple ( const tuple < _U1 , _U2 > & __in )
  39348. : _Inherited ( static_cast < const _Tuple_impl < 0 , _U1 , _U2 > & > ( __in ) ) { }
  39349.  
  39350. template < typename _U1 , typename _U2 , typename = typename
  39351. enable_if < __and_ < is_convertible < _U1 , _T1 > ,
  39352. is_convertible < _U2 , _T2 >> :: value > :: type >
  39353. constexpr tuple ( tuple < _U1 , _U2 > && __in )
  39354. : _Inherited ( static_cast < _Tuple_impl < 0 , _U1 , _U2 > && > ( __in ) ) { }
  39355.  
  39356. template < typename _U1 , typename _U2 , typename = typename
  39357. enable_if < __and_ < is_convertible < const _U1 & , _T1 > ,
  39358. is_convertible < const _U2 & , _T2 >> :: value > :: type >
  39359. constexpr tuple ( const pair < _U1 , _U2 > & __in )
  39360. : _Inherited ( __in . first , __in . second ) { }
  39361.  
  39362. template < typename _U1 , typename _U2 , typename = typename
  39363. enable_if < __and_ < is_convertible < _U1 , _T1 > ,
  39364. is_convertible < _U2 , _T2 >> :: value > :: type >
  39365. constexpr tuple ( pair < _U1 , _U2 > && __in )
  39366. : _Inherited ( std :: forward < _U1 > ( __in . first ) ,
  39367. std :: forward < _U2 > ( __in . second ) ) { }
  39368.  
  39369.  
  39370.  
  39371. template < typename _Alloc >
  39372. tuple ( allocator_arg_t __tag , const _Alloc & __a )
  39373. : _Inherited ( __tag , __a ) { }
  39374.  
  39375. template < typename _Alloc >
  39376. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39377. const _T1 & __a1 , const _T2 & __a2 )
  39378. : _Inherited ( __tag , __a , __a1 , __a2 ) { }
  39379.  
  39380. template < typename _Alloc , typename _U1 , typename _U2 >
  39381. tuple ( allocator_arg_t __tag , const _Alloc & __a , _U1 && __a1 , _U2 && __a2 )
  39382. : _Inherited ( __tag , __a , std :: forward < _U1 > ( __a1 ) ,
  39383. std :: forward < _U2 > ( __a2 ) ) { }
  39384.  
  39385. template < typename _Alloc >
  39386. tuple ( allocator_arg_t __tag , const _Alloc & __a , const tuple & __in )
  39387. : _Inherited ( __tag , __a , static_cast < const _Inherited & > ( __in ) ) { }
  39388.  
  39389. template < typename _Alloc >
  39390. tuple ( allocator_arg_t __tag , const _Alloc & __a , tuple && __in )
  39391. : _Inherited ( __tag , __a , static_cast < _Inherited && > ( __in ) ) { }
  39392.  
  39393. template < typename _Alloc , typename _U1 , typename _U2 >
  39394. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39395. const tuple < _U1 , _U2 > & __in )
  39396. : _Inherited ( __tag , __a ,
  39397. static_cast < const _Tuple_impl < 0 , _U1 , _U2 > & > ( __in ) )
  39398. { }
  39399.  
  39400. template < typename _Alloc , typename _U1 , typename _U2 >
  39401. tuple ( allocator_arg_t __tag , const _Alloc & __a , tuple < _U1 , _U2 > && __in )
  39402. : _Inherited ( __tag , __a , static_cast < _Tuple_impl < 0 , _U1 , _U2 > && > ( __in ) )
  39403. { }
  39404.  
  39405. template < typename _Alloc , typename _U1 , typename _U2 >
  39406. tuple ( allocator_arg_t __tag , const _Alloc & __a ,
  39407. const pair < _U1 , _U2 > & __in )
  39408. : _Inherited ( __tag , __a , __in . first , __in . second ) { }
  39409.  
  39410. template < typename _Alloc , typename _U1 , typename _U2 >
  39411. tuple ( allocator_arg_t __tag , const _Alloc & __a , pair < _U1 , _U2 > && __in )
  39412. : _Inherited ( __tag , __a , std :: forward < _U1 > ( __in . first ) ,
  39413. std :: forward < _U2 > ( __in . second ) ) { }
  39414.  
  39415. tuple &
  39416. operator = ( const tuple & __in )
  39417. {
  39418. static_cast < _Inherited & > ( * this ) = __in ;
  39419. return * this ;
  39420. }
  39421.  
  39422. tuple &
  39423. operator = ( tuple && __in )
  39424. noexcept ( is_nothrow_move_assignable < _Inherited > :: value )
  39425. {
  39426. static_cast < _Inherited & > ( * this ) = std :: move ( __in ) ;
  39427. return * this ;
  39428. }
  39429.  
  39430. template < typename _U1 , typename _U2 >
  39431. tuple &
  39432. operator = ( const tuple < _U1 , _U2 > & __in )
  39433. {
  39434. static_cast < _Inherited & > ( * this ) = __in ;
  39435. return * this ;
  39436. }
  39437.  
  39438. template < typename _U1 , typename _U2 >
  39439. tuple &
  39440. operator = ( tuple < _U1 , _U2 > && __in )
  39441. {
  39442. static_cast < _Inherited & > ( * this ) = std :: move ( __in ) ;
  39443. return * this ;
  39444. }
  39445.  
  39446. template < typename _U1 , typename _U2 >
  39447. tuple &
  39448. operator = ( const pair < _U1 , _U2 > & __in )
  39449. {
  39450. this -> _M_head ( * this ) = __in . first ;
  39451. this -> _M_tail ( * this ) . _M_head ( * this ) = __in . second ;
  39452. return * this ;
  39453. }
  39454.  
  39455. template < typename _U1 , typename _U2 >
  39456. tuple &
  39457. operator = ( pair < _U1 , _U2 > && __in )
  39458. {
  39459. this -> _M_head ( * this ) = std :: forward < _U1 > ( __in . first ) ;
  39460. this -> _M_tail ( * this ) . _M_head ( * this ) = std :: forward < _U2 > ( __in . second ) ;
  39461. return * this ;
  39462. }
  39463.  
  39464. void
  39465. swap ( tuple & __in )
  39466. noexcept ( noexcept ( __in . _M_swap ( __in ) ) )
  39467. { _Inherited :: _M_swap ( __in ) ; }
  39468. } ;
  39469.  
  39470.  
  39471.  
  39472. template < std :: size_t __i , typename _Tp >
  39473. struct tuple_element ;
  39474.  
  39475.  
  39476.  
  39477.  
  39478.  
  39479. template < std :: size_t __i , typename _Head , typename ... _Tail >
  39480. struct tuple_element < __i , tuple < _Head , _Tail ... > >
  39481. : tuple_element < __i - 1 , tuple < _Tail ... > > { } ;
  39482.  
  39483.  
  39484.  
  39485.  
  39486. template < typename _Head , typename ... _Tail >
  39487. struct tuple_element < 0 , tuple < _Head , _Tail ... > >
  39488. {
  39489. typedef _Head type ;
  39490. } ;
  39491.  
  39492. template < std :: size_t __i , typename _Tp >
  39493. struct tuple_element < __i , const _Tp >
  39494. {
  39495. typedef typename
  39496. add_const < typename tuple_element < __i , _Tp > :: type > :: type type ;
  39497. } ;
  39498.  
  39499. template < std :: size_t __i , typename _Tp >
  39500. struct tuple_element < __i , volatile _Tp >
  39501. {
  39502. typedef typename
  39503. add_volatile < typename tuple_element < __i , _Tp > :: type > :: type type ;
  39504. } ;
  39505.  
  39506. template < std :: size_t __i , typename _Tp >
  39507. struct tuple_element < __i , const volatile _Tp >
  39508. {
  39509. typedef typename
  39510. add_cv < typename tuple_element < __i , _Tp > :: type > :: type type ;
  39511. } ;
  39512.  
  39513.  
  39514. template < typename _Tp >
  39515. struct tuple_size ;
  39516.  
  39517. template < typename _Tp >
  39518. struct tuple_size < const _Tp >
  39519. : public integral_constant <
  39520. typename remove_cv < decltype ( tuple_size < _Tp > :: value ) > :: type ,
  39521. tuple_size < _Tp > :: value > { } ;
  39522.  
  39523. template < typename _Tp >
  39524. struct tuple_size < volatile _Tp >
  39525. : public integral_constant <
  39526. typename remove_cv < decltype ( tuple_size < _Tp > :: value ) > :: type ,
  39527. tuple_size < _Tp > :: value > { } ;
  39528.  
  39529. template < typename _Tp >
  39530. struct tuple_size < const volatile _Tp >
  39531. : public integral_constant <
  39532. typename remove_cv < decltype ( tuple_size < _Tp > :: value ) > :: type ,
  39533. tuple_size < _Tp > :: value > { } ;
  39534.  
  39535.  
  39536. template < typename ... _Elements >
  39537. struct tuple_size < tuple < _Elements ... >>
  39538. : public integral_constant < std :: size_t , sizeof ... ( _Elements ) > { } ;
  39539.  
  39540. template < std :: size_t __i , typename _Head , typename ... _Tail >
  39541. constexpr typename __add_ref < _Head > :: type
  39542. __get_helper ( _Tuple_impl < __i , _Head , _Tail ... > & __t ) noexcept
  39543. { return _Tuple_impl < __i , _Head , _Tail ... > :: _M_head ( __t ) ; }
  39544.  
  39545. template < std :: size_t __i , typename _Head , typename ... _Tail >
  39546. constexpr typename __add_c_ref < _Head > :: type
  39547. __get_helper ( const _Tuple_impl < __i , _Head , _Tail ... > & __t ) noexcept
  39548. { return _Tuple_impl < __i , _Head , _Tail ... > :: _M_head ( __t ) ; }
  39549.  
  39550.  
  39551.  
  39552.  
  39553. template < std :: size_t __i , typename ... _Elements >
  39554. constexpr typename __add_ref <
  39555. typename tuple_element < __i , tuple < _Elements ... >> :: type
  39556. > :: type
  39557. get ( tuple < _Elements ... > & __t ) noexcept
  39558. { return __get_helper < __i > ( __t ) ; }
  39559.  
  39560. template < std :: size_t __i , typename ... _Elements >
  39561. constexpr typename __add_c_ref <
  39562. typename tuple_element < __i , tuple < _Elements ... >> :: type
  39563. > :: type
  39564. get ( const tuple < _Elements ... > & __t ) noexcept
  39565. { return __get_helper < __i > ( __t ) ; }
  39566.  
  39567. template < std :: size_t __i , typename ... _Elements >
  39568. constexpr typename __add_r_ref <
  39569. typename tuple_element < __i , tuple < _Elements ... >> :: type
  39570. > :: type
  39571. get ( tuple < _Elements ... > && __t ) noexcept
  39572. { return std :: forward < typename tuple_element < __i ,
  39573. tuple < _Elements ... >> :: type && > ( get < __i > ( __t ) ) ; }
  39574.  
  39575.  
  39576. template < std :: size_t __check_equal_size , std :: size_t __i , std :: size_t __j ,
  39577. typename _Tp , typename _Up >
  39578. struct __tuple_compare ;
  39579.  
  39580. template < std :: size_t __i , std :: size_t __j , typename _Tp , typename _Up >
  39581. struct __tuple_compare < 0 , __i , __j , _Tp , _Up >
  39582. {
  39583. static constexpr bool
  39584. __eq ( const _Tp & __t , const _Up & __u )
  39585. {
  39586. return ( get < __i > ( __t ) == get < __i > ( __u ) &&
  39587. __tuple_compare < 0 , __i + 1 , __j , _Tp , _Up > :: __eq ( __t , __u ) ) ;
  39588. }
  39589.  
  39590. static constexpr bool
  39591. __less ( const _Tp & __t , const _Up & __u )
  39592. {
  39593. return ( ( get < __i > ( __t ) < get < __i > ( __u ) )
  39594. || ! ( get < __i > ( __u ) < get < __i > ( __t ) ) &&
  39595. __tuple_compare < 0 , __i + 1 , __j , _Tp , _Up > :: __less ( __t , __u ) ) ;
  39596. }
  39597. } ;
  39598.  
  39599. template < std :: size_t __i , typename _Tp , typename _Up >
  39600. struct __tuple_compare < 0 , __i , __i , _Tp , _Up >
  39601. {
  39602. static constexpr bool
  39603. __eq ( const _Tp & , const _Up & ) { return true ; }
  39604.  
  39605. static constexpr bool
  39606. __less ( const _Tp & , const _Up & ) { return false ; }
  39607. } ;
  39608.  
  39609. template < typename ... _TElements , typename ... _UElements >
  39610. constexpr bool
  39611. operator == ( const tuple < _TElements ... > & __t ,
  39612. const tuple < _UElements ... > & __u )
  39613. {
  39614. typedef tuple < _TElements ... > _Tp ;
  39615. typedef tuple < _UElements ... > _Up ;
  39616. return bool ( __tuple_compare < tuple_size < _Tp > :: value - tuple_size < _Up > :: value ,
  39617. 0 , tuple_size < _Tp > :: value , _Tp , _Up > :: __eq ( __t , __u ) ) ;
  39618. }
  39619.  
  39620. template < typename ... _TElements , typename ... _UElements >
  39621. constexpr bool
  39622. operator < ( const tuple < _TElements ... > & __t ,
  39623. const tuple < _UElements ... > & __u )
  39624. {
  39625. typedef tuple < _TElements ... > _Tp ;
  39626. typedef tuple < _UElements ... > _Up ;
  39627. return bool ( __tuple_compare < tuple_size < _Tp > :: value - tuple_size < _Up > :: value ,
  39628. 0 , tuple_size < _Tp > :: value , _Tp , _Up > :: __less ( __t , __u ) ) ;
  39629. }
  39630.  
  39631. template < typename ... _TElements , typename ... _UElements >
  39632. inline constexpr bool
  39633. operator != ( const tuple < _TElements ... > & __t ,
  39634. const tuple < _UElements ... > & __u )
  39635. { return ! ( __t == __u ) ; }
  39636.  
  39637. template < typename ... _TElements , typename ... _UElements >
  39638. inline constexpr bool
  39639. operator > ( const tuple < _TElements ... > & __t ,
  39640. const tuple < _UElements ... > & __u )
  39641. { return __u < __t ; }
  39642.  
  39643. template < typename ... _TElements , typename ... _UElements >
  39644. inline constexpr bool
  39645. operator <= ( const tuple < _TElements ... > & __t ,
  39646. const tuple < _UElements ... > & __u )
  39647. { return ! ( __u < __t ) ; }
  39648.  
  39649. template < typename ... _TElements , typename ... _UElements >
  39650. inline constexpr bool
  39651. operator >= ( const tuple < _TElements ... > & __t ,
  39652. const tuple < _UElements ... > & __u )
  39653. { return ! ( __t < __u ) ; }
  39654.  
  39655.  
  39656. template < typename ... _Elements >
  39657. constexpr tuple < typename __decay_and_strip < _Elements > :: __type ... >
  39658. make_tuple ( _Elements && ... __args )
  39659. {
  39660. typedef tuple < typename __decay_and_strip < _Elements > :: __type ... >
  39661. __result_type ;
  39662. return __result_type ( std :: forward < _Elements > ( __args ) ... ) ;
  39663. }
  39664.  
  39665. template < typename ... _Elements >
  39666. tuple < _Elements && ... >
  39667. forward_as_tuple ( _Elements && ... __args ) noexcept
  39668. { return tuple < _Elements && ... > ( std :: forward < _Elements > ( __args ) ... ) ; }
  39669.  
  39670. template < typename >
  39671. struct __is_tuple_like_impl : false_type
  39672. { } ;
  39673.  
  39674. template < typename ... _Tps >
  39675. struct __is_tuple_like_impl < tuple < _Tps ... >> : true_type
  39676. { } ;
  39677.  
  39678. template < typename _T1 , typename _T2 >
  39679. struct __is_tuple_like_impl < pair < _T1 , _T2 >> : true_type
  39680. { } ;
  39681.  
  39682. template < typename _Tp , std :: size_t _Nm >
  39683. struct __is_tuple_like_impl < array < _Tp , _Nm >> : true_type
  39684. { } ;
  39685.  
  39686.  
  39687. template < typename _Tp >
  39688. struct __is_tuple_like
  39689. : public __is_tuple_like_impl < typename std :: remove_cv
  39690. < typename std :: remove_reference < _Tp > :: type > :: type > :: type
  39691. { } ;
  39692.  
  39693.  
  39694.  
  39695. template < std :: size_t ... _Indexes >
  39696. struct _Index_tuple
  39697. {
  39698. typedef _Index_tuple < _Indexes ... , sizeof ... ( _Indexes ) > __next ;
  39699. } ;
  39700.  
  39701.  
  39702. template < std :: size_t _Num >
  39703. struct _Build_index_tuple
  39704. {
  39705. typedef typename _Build_index_tuple < _Num - 1 > :: __type :: __next __type ;
  39706. } ;
  39707.  
  39708. template < >
  39709. struct _Build_index_tuple < 0 >
  39710. {
  39711. typedef _Index_tuple < > __type ;
  39712. } ;
  39713.  
  39714. template < std :: size_t , typename , typename , std :: size_t >
  39715. struct __make_tuple_impl ;
  39716.  
  39717. template < std :: size_t _Idx , typename _Tuple , typename ... _Tp ,
  39718. std :: size_t _Nm >
  39719. struct __make_tuple_impl < _Idx , tuple < _Tp ... > , _Tuple , _Nm >
  39720. {
  39721. typedef typename __make_tuple_impl < _Idx + 1 , tuple < _Tp ... ,
  39722. typename std :: tuple_element < _Idx , _Tuple > :: type > , _Tuple , _Nm > :: __type
  39723. __type ;
  39724. } ;
  39725.  
  39726. template < std :: size_t _Nm , typename _Tuple , typename ... _Tp >
  39727. struct __make_tuple_impl < _Nm , tuple < _Tp ... > , _Tuple , _Nm >
  39728. {
  39729. typedef tuple < _Tp ... > __type ;
  39730. } ;
  39731.  
  39732. template < typename _Tuple >
  39733. struct __do_make_tuple
  39734. : public __make_tuple_impl < 0 , tuple < > , _Tuple ,
  39735. std :: tuple_size < _Tuple > :: value >
  39736. { } ;
  39737.  
  39738.  
  39739. template < typename _Tuple >
  39740. struct __make_tuple
  39741. : public __do_make_tuple < typename std :: remove_cv
  39742. < typename std :: remove_reference < _Tuple > :: type > :: type >
  39743. { } ;
  39744.  
  39745.  
  39746. template < typename ... >
  39747. struct __combine_tuples ;
  39748.  
  39749. template < >
  39750. struct __combine_tuples < >
  39751. {
  39752. typedef tuple < > __type ;
  39753. } ;
  39754.  
  39755. template < typename ... _Ts >
  39756. struct __combine_tuples < tuple < _Ts ... >>
  39757. {
  39758. typedef tuple < _Ts ... > __type ;
  39759. } ;
  39760.  
  39761. template < typename ... _T1s , typename ... _T2s , typename ... _Rem >
  39762. struct __combine_tuples < tuple < _T1s ... > , tuple < _T2s ... > , _Rem ... >
  39763. {
  39764. typedef typename __combine_tuples < tuple < _T1s ... , _T2s ... > ,
  39765. _Rem ... > :: __type __type ;
  39766. } ;
  39767.  
  39768.  
  39769. template < typename ... _Tpls >
  39770. struct __tuple_cat_result
  39771. {
  39772. typedef typename __combine_tuples
  39773. < typename __make_tuple < _Tpls > :: __type ... > :: __type __type ;
  39774. } ;
  39775.  
  39776.  
  39777.  
  39778. template < typename ... >
  39779. struct __make_1st_indices ;
  39780.  
  39781. template < >
  39782. struct __make_1st_indices < >
  39783. {
  39784. typedef std :: _Index_tuple < > __type ;
  39785. } ;
  39786.  
  39787. template < typename _Tp , typename ... _Tpls >
  39788. struct __make_1st_indices < _Tp , _Tpls ... >
  39789. {
  39790. typedef typename std :: _Build_index_tuple < std :: tuple_size <
  39791. typename std :: remove_reference < _Tp > :: type > :: value > :: __type __type ;
  39792. } ;
  39793.  
  39794.  
  39795.  
  39796.  
  39797. template < typename _Ret , typename _Indices , typename ... _Tpls >
  39798. struct __tuple_concater ;
  39799.  
  39800. template < typename _Ret , std :: size_t ... _Is , typename _Tp , typename ... _Tpls >
  39801. struct __tuple_concater < _Ret , std :: _Index_tuple < _Is ... > , _Tp , _Tpls ... >
  39802. {
  39803. template < typename ... _Us >
  39804. static constexpr _Ret
  39805. _S_do ( _Tp && __tp , _Tpls && ... __tps , _Us && ... __us )
  39806. {
  39807. typedef typename __make_1st_indices < _Tpls ... > :: __type __idx ;
  39808. typedef __tuple_concater < _Ret , __idx , _Tpls ... > __next ;
  39809. return __next :: _S_do ( std :: forward < _Tpls > ( __tps ) ... ,
  39810. std :: forward < _Us > ( __us ) ... ,
  39811. std :: get < _Is > ( std :: forward < _Tp > ( __tp ) ) ... ) ;
  39812. }
  39813. } ;
  39814.  
  39815. template < typename _Ret >
  39816. struct __tuple_concater < _Ret , std :: _Index_tuple < >>
  39817. {
  39818. template < typename ... _Us >
  39819. static constexpr _Ret
  39820. _S_do ( _Us && ... __us )
  39821. {
  39822. return _Ret ( std :: forward < _Us > ( __us ) ... ) ;
  39823. }
  39824. } ;
  39825.  
  39826.  
  39827. template < typename ... _Tpls , typename = typename
  39828. enable_if < __and_ < __is_tuple_like < _Tpls > ... > :: value > :: type >
  39829. constexpr auto
  39830. tuple_cat ( _Tpls && ... __tpls )
  39831. -> typename __tuple_cat_result < _Tpls ... > :: __type
  39832. {
  39833. typedef typename __tuple_cat_result < _Tpls ... > :: __type __ret ;
  39834. typedef typename __make_1st_indices < _Tpls ... > :: __type __idx ;
  39835. typedef __tuple_concater < __ret , __idx , _Tpls ... > __concater ;
  39836. return __concater :: _S_do ( std :: forward < _Tpls > ( __tpls ) ... ) ;
  39837. }
  39838.  
  39839.  
  39840. template < typename ... _Elements >
  39841. inline tuple < _Elements & ... >
  39842. tie ( _Elements & ... __args ) noexcept
  39843. { return tuple < _Elements & ... > ( __args ... ) ; }
  39844.  
  39845.  
  39846. template < typename ... _Elements >
  39847. inline void
  39848. swap ( tuple < _Elements ... > & __x , tuple < _Elements ... > & __y )
  39849. noexcept ( noexcept ( __x . swap ( __y ) ) )
  39850. { __x . swap ( __y ) ; }
  39851.  
  39852.  
  39853.  
  39854. struct _Swallow_assign
  39855. {
  39856. template < class _Tp >
  39857. const _Swallow_assign &
  39858. operator = ( const _Tp & ) const
  39859. { return * this ; }
  39860. } ;
  39861.  
  39862. const _Swallow_assign ignore { } ;
  39863.  
  39864.  
  39865. template < typename ... _Types , typename _Alloc >
  39866. struct uses_allocator < tuple < _Types ... > , _Alloc > : true_type { } ;
  39867.  
  39868.  
  39869. template < class _T1 , class _T2 >
  39870. template < typename ... _Args1 , typename ... _Args2 >
  39871. inline
  39872. pair < _T1 , _T2 > ::
  39873. pair ( piecewise_construct_t ,
  39874. tuple < _Args1 ... > __first , tuple < _Args2 ... > __second )
  39875. : pair ( __first , __second ,
  39876. typename _Build_index_tuple < sizeof ... ( _Args1 ) > :: __type ( ) ,
  39877. typename _Build_index_tuple < sizeof ... ( _Args2 ) > :: __type ( ) )
  39878. { }
  39879.  
  39880. template < class _T1 , class _T2 >
  39881. template < typename ... _Args1 , std :: size_t ... _Indexes1 ,
  39882. typename ... _Args2 , std :: size_t ... _Indexes2 >
  39883. inline
  39884. pair < _T1 , _T2 > ::
  39885. pair ( tuple < _Args1 ... > & __tuple1 , tuple < _Args2 ... > & __tuple2 ,
  39886. _Index_tuple < _Indexes1 ... > , _Index_tuple < _Indexes2 ... > )
  39887. : first ( std :: forward < _Args1 > ( std :: get < _Indexes1 > ( __tuple1 ) ) ... ) ,
  39888. second ( std :: forward < _Args2 > ( std :: get < _Indexes2 > ( __tuple2 ) ) ... )
  39889. { }
  39890.  
  39891.  
  39892.  
  39893.  
  39894. }
  39895. #60 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/functional"
  39896. namespace std
  39897. {
  39898.  
  39899.  
  39900. template < typename _MemberPointer >
  39901. class _Mem_fn ;
  39902. template < typename _Tp , typename _Class >
  39903. _Mem_fn < _Tp _Class :: * >
  39904. mem_fn ( _Tp _Class :: * ) noexcept ;
  39905.  
  39906. template < typename _Tp > class __has_result_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type {
  39907. #70
  39908. } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: result_type > * ) ; template < typename
  39909. #70
  39910. _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1 ; } ; template
  39911. #70
  39912. < typename _Tp > struct __has_result_type : integral_constant < bool , __has_result_type_helper < typename remove_cv < _Tp
  39913. #70
  39914. > :: type > :: value > { } ;
  39915.  
  39916.  
  39917. template < bool _Has_result_type , typename _Functor >
  39918. struct _Maybe_get_result_type
  39919. { } ;
  39920.  
  39921. template < typename _Functor >
  39922. struct _Maybe_get_result_type < true , _Functor >
  39923. { typedef typename _Functor :: result_type result_type ; } ;
  39924.  
  39925.  
  39926.  
  39927.  
  39928.  
  39929. template < typename _Functor >
  39930. struct _Weak_result_type_impl
  39931. : _Maybe_get_result_type < __has_result_type < _Functor > :: value , _Functor >
  39932. { } ;
  39933.  
  39934.  
  39935. template < typename _Res , typename ... _ArgTypes >
  39936. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ) >
  39937. { typedef _Res result_type ; } ;
  39938.  
  39939. template < typename _Res , typename ... _ArgTypes >
  39940. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ... ) >
  39941. { typedef _Res result_type ; } ;
  39942.  
  39943. template < typename _Res , typename ... _ArgTypes >
  39944. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ) const >
  39945. { typedef _Res result_type ; } ;
  39946.  
  39947. template < typename _Res , typename ... _ArgTypes >
  39948. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ... ) const >
  39949. { typedef _Res result_type ; } ;
  39950.  
  39951. template < typename _Res , typename ... _ArgTypes >
  39952. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ) volatile >
  39953. { typedef _Res result_type ; } ;
  39954.  
  39955. template < typename _Res , typename ... _ArgTypes >
  39956. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ... ) volatile >
  39957. { typedef _Res result_type ; } ;
  39958.  
  39959. template < typename _Res , typename ... _ArgTypes >
  39960. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ) const volatile >
  39961. { typedef _Res result_type ; } ;
  39962.  
  39963. template < typename _Res , typename ... _ArgTypes >
  39964. struct _Weak_result_type_impl < _Res ( _ArgTypes ... ... ) const volatile >
  39965. { typedef _Res result_type ; } ;
  39966.  
  39967.  
  39968. template < typename _Res , typename ... _ArgTypes >
  39969. struct _Weak_result_type_impl < _Res ( & ) ( _ArgTypes ... ) >
  39970. { typedef _Res result_type ; } ;
  39971.  
  39972. template < typename _Res , typename ... _ArgTypes >
  39973. struct _Weak_result_type_impl < _Res ( & ) ( _ArgTypes ... ... ) >
  39974. { typedef _Res result_type ; } ;
  39975.  
  39976.  
  39977. template < typename _Res , typename ... _ArgTypes >
  39978. struct _Weak_result_type_impl < _Res ( * ) ( _ArgTypes ... ) >
  39979. { typedef _Res result_type ; } ;
  39980.  
  39981. template < typename _Res , typename ... _ArgTypes >
  39982. struct _Weak_result_type_impl < _Res ( * ) ( _ArgTypes ... ... ) >
  39983. { typedef _Res result_type ; } ;
  39984.  
  39985.  
  39986. template < typename _Res , typename _Class , typename ... _ArgTypes >
  39987. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ) >
  39988. { typedef _Res result_type ; } ;
  39989.  
  39990. template < typename _Res , typename _Class , typename ... _ArgTypes >
  39991. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ... ) >
  39992. { typedef _Res result_type ; } ;
  39993.  
  39994.  
  39995. template < typename _Res , typename _Class , typename ... _ArgTypes >
  39996. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ) const >
  39997. { typedef _Res result_type ; } ;
  39998.  
  39999. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40000. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ... ) const >
  40001. { typedef _Res result_type ; } ;
  40002.  
  40003.  
  40004. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40005. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ) volatile >
  40006. { typedef _Res result_type ; } ;
  40007.  
  40008. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40009. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ... ) volatile >
  40010. { typedef _Res result_type ; } ;
  40011.  
  40012.  
  40013. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40014. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... )
  40015. const volatile >
  40016. { typedef _Res result_type ; } ;
  40017.  
  40018. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40019. struct _Weak_result_type_impl < _Res ( _Class :: * ) ( _ArgTypes ... ... )
  40020. const volatile >
  40021. { typedef _Res result_type ; } ;
  40022.  
  40023.  
  40024.  
  40025.  
  40026.  
  40027. template < typename _Functor >
  40028. struct _Weak_result_type
  40029. : _Weak_result_type_impl < typename remove_cv < _Functor > :: type >
  40030. { } ;
  40031.  
  40032.  
  40033. template < typename _Tp >
  40034. struct _Derives_from_unary_function : __sfinae_types
  40035. {
  40036. private :
  40037. template < typename _T1 , typename _Res >
  40038. static __one __test ( const volatile unary_function < _T1 , _Res > * ) ;
  40039.  
  40040.  
  40041.  
  40042. static __two __test ( ... ) ;
  40043.  
  40044. public :
  40045. static const bool value = sizeof ( __test ( ( _Tp * ) 0 ) ) == 1 ;
  40046. } ;
  40047.  
  40048.  
  40049. template < typename _Tp >
  40050. struct _Derives_from_binary_function : __sfinae_types
  40051. {
  40052. private :
  40053. template < typename _T1 , typename _T2 , typename _Res >
  40054. static __one __test ( const volatile binary_function < _T1 , _T2 , _Res > * ) ;
  40055.  
  40056.  
  40057.  
  40058. static __two __test ( ... ) ;
  40059.  
  40060. public :
  40061. static const bool value = sizeof ( __test ( ( _Tp * ) 0 ) ) == 1 ;
  40062. } ;
  40063.  
  40064.  
  40065.  
  40066.  
  40067.  
  40068. template < typename _Functor , typename ... _Args >
  40069. inline
  40070. typename enable_if <
  40071. ( ! is_member_pointer < _Functor > :: value
  40072. && ! is_function < _Functor > :: value
  40073. && ! is_function < typename remove_pointer < _Functor > :: type > :: value ) ,
  40074. typename result_of < _Functor & ( _Args && ... ) > :: type
  40075. > :: type
  40076. __invoke ( _Functor & __f , _Args && ... __args )
  40077. {
  40078. return __f ( std :: forward < _Args > ( __args ) ... ) ;
  40079. }
  40080.  
  40081. template < typename _Functor , typename ... _Args >
  40082. inline
  40083. typename enable_if <
  40084. ( is_member_pointer < _Functor > :: value
  40085. && ! is_function < _Functor > :: value
  40086. && ! is_function < typename remove_pointer < _Functor > :: type > :: value ) ,
  40087. typename result_of < _Functor ( _Args && ... ) > :: type
  40088. > :: type
  40089. __invoke ( _Functor & __f , _Args && ... __args )
  40090. {
  40091. return std :: mem_fn ( __f ) ( std :: forward < _Args > ( __args ) ... ) ;
  40092. }
  40093.  
  40094.  
  40095. template < typename _Functor , typename ... _Args >
  40096. inline
  40097. typename enable_if <
  40098. ( is_pointer < _Functor > :: value
  40099. && is_function < typename remove_pointer < _Functor > :: type > :: value ) ,
  40100. typename result_of < _Functor ( _Args && ... ) > :: type
  40101. > :: type
  40102. __invoke ( _Functor __f , _Args && ... __args )
  40103. {
  40104. return __f ( std :: forward < _Args > ( __args ) ... ) ;
  40105. }
  40106. #268
  40107. template < bool _Unary , bool _Binary , typename _Tp >
  40108. struct _Reference_wrapper_base_impl ;
  40109.  
  40110.  
  40111. template < typename _Tp >
  40112. struct _Reference_wrapper_base_impl < false , false , _Tp >
  40113. : _Weak_result_type < _Tp >
  40114. { } ;
  40115.  
  40116.  
  40117. template < typename _Tp >
  40118. struct _Reference_wrapper_base_impl < true , false , _Tp >
  40119. : _Weak_result_type < _Tp >
  40120. {
  40121. typedef typename _Tp :: argument_type argument_type ;
  40122. } ;
  40123.  
  40124.  
  40125. template < typename _Tp >
  40126. struct _Reference_wrapper_base_impl < false , true , _Tp >
  40127. : _Weak_result_type < _Tp >
  40128. {
  40129. typedef typename _Tp :: first_argument_type first_argument_type ;
  40130. typedef typename _Tp :: second_argument_type second_argument_type ;
  40131. } ;
  40132.  
  40133.  
  40134. template < typename _Tp >
  40135. struct _Reference_wrapper_base_impl < true , true , _Tp >
  40136. : _Weak_result_type < _Tp >
  40137. {
  40138. typedef typename _Tp :: argument_type argument_type ;
  40139. typedef typename _Tp :: first_argument_type first_argument_type ;
  40140. typedef typename _Tp :: second_argument_type second_argument_type ;
  40141. } ;
  40142.  
  40143. template < typename _Tp > class __has_argument_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  40144. #304
  40145. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: argument_type > * ) ; template < typename
  40146. #304
  40147. _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1 ; } ; template
  40148. #304
  40149. < typename _Tp > struct __has_argument_type : integral_constant < bool , __has_argument_type_helper < typename remove_cv
  40150. #304
  40151. < _Tp > :: type > :: value > { } ;
  40152. template < typename _Tp > class __has_first_argument_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  40153. #305
  40154. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: first_argument_type > * ) ; template <
  40155. #305
  40156. typename _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) == 1
  40157. #305
  40158. ; } ; template < typename _Tp > struct __has_first_argument_type : integral_constant < bool , __has_first_argument_type_helper
  40159. #305
  40160. < typename remove_cv < _Tp > :: type > :: value > { } ;
  40161. template < typename _Tp > class __has_second_argument_type_helper : __sfinae_types { template < typename _Up > struct _Wrap_type
  40162. #306
  40163. { } ; template < typename _Up > static __one __test ( _Wrap_type < typename _Up :: second_argument_type > * ) ; template
  40164. #306
  40165. < typename _Up > static __two __test ( ... ) ; public : static constexpr bool value = sizeof ( __test < _Tp > ( 0 ) ) ==
  40166. #306
  40167. 1 ; } ; template < typename _Tp > struct __has_second_argument_type : integral_constant < bool , __has_second_argument_type_helper
  40168. #306
  40169. < typename remove_cv < _Tp > :: type > :: value > { } ;
  40170. #314
  40171. template < typename _Tp >
  40172. struct _Reference_wrapper_base
  40173. : _Reference_wrapper_base_impl <
  40174. __has_argument_type < _Tp > :: value ,
  40175. __has_first_argument_type < _Tp > :: value
  40176. && __has_second_argument_type < _Tp > :: value ,
  40177. _Tp >
  40178. { } ;
  40179.  
  40180.  
  40181. template < typename _Res , typename _T1 >
  40182. struct _Reference_wrapper_base < _Res ( _T1 ) >
  40183. : unary_function < _T1 , _Res >
  40184. { } ;
  40185.  
  40186. template < typename _Res , typename _T1 >
  40187. struct _Reference_wrapper_base < _Res ( _T1 ) const >
  40188. : unary_function < _T1 , _Res >
  40189. { } ;
  40190.  
  40191. template < typename _Res , typename _T1 >
  40192. struct _Reference_wrapper_base < _Res ( _T1 ) volatile >
  40193. : unary_function < _T1 , _Res >
  40194. { } ;
  40195.  
  40196. template < typename _Res , typename _T1 >
  40197. struct _Reference_wrapper_base < _Res ( _T1 ) const volatile >
  40198. : unary_function < _T1 , _Res >
  40199. { } ;
  40200.  
  40201.  
  40202. template < typename _Res , typename _T1 , typename _T2 >
  40203. struct _Reference_wrapper_base < _Res ( _T1 , _T2 ) >
  40204. : binary_function < _T1 , _T2 , _Res >
  40205. { } ;
  40206.  
  40207. template < typename _Res , typename _T1 , typename _T2 >
  40208. struct _Reference_wrapper_base < _Res ( _T1 , _T2 ) const >
  40209. : binary_function < _T1 , _T2 , _Res >
  40210. { } ;
  40211.  
  40212. template < typename _Res , typename _T1 , typename _T2 >
  40213. struct _Reference_wrapper_base < _Res ( _T1 , _T2 ) volatile >
  40214. : binary_function < _T1 , _T2 , _Res >
  40215. { } ;
  40216.  
  40217. template < typename _Res , typename _T1 , typename _T2 >
  40218. struct _Reference_wrapper_base < _Res ( _T1 , _T2 ) const volatile >
  40219. : binary_function < _T1 , _T2 , _Res >
  40220. { } ;
  40221.  
  40222.  
  40223. template < typename _Res , typename _T1 >
  40224. struct _Reference_wrapper_base < _Res ( * ) ( _T1 ) >
  40225. : unary_function < _T1 , _Res >
  40226. { } ;
  40227.  
  40228.  
  40229. template < typename _Res , typename _T1 , typename _T2 >
  40230. struct _Reference_wrapper_base < _Res ( * ) ( _T1 , _T2 ) >
  40231. : binary_function < _T1 , _T2 , _Res >
  40232. { } ;
  40233.  
  40234.  
  40235. template < typename _Res , typename _T1 >
  40236. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( ) >
  40237. : unary_function < _T1 * , _Res >
  40238. { } ;
  40239.  
  40240.  
  40241. template < typename _Res , typename _T1 , typename _T2 >
  40242. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( _T2 ) >
  40243. : binary_function < _T1 * , _T2 , _Res >
  40244. { } ;
  40245.  
  40246.  
  40247. template < typename _Res , typename _T1 >
  40248. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( ) const >
  40249. : unary_function < const _T1 * , _Res >
  40250. { } ;
  40251.  
  40252.  
  40253. template < typename _Res , typename _T1 , typename _T2 >
  40254. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( _T2 ) const >
  40255. : binary_function < const _T1 * , _T2 , _Res >
  40256. { } ;
  40257.  
  40258.  
  40259. template < typename _Res , typename _T1 >
  40260. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( ) volatile >
  40261. : unary_function < volatile _T1 * , _Res >
  40262. { } ;
  40263.  
  40264.  
  40265. template < typename _Res , typename _T1 , typename _T2 >
  40266. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( _T2 ) volatile >
  40267. : binary_function < volatile _T1 * , _T2 , _Res >
  40268. { } ;
  40269.  
  40270.  
  40271. template < typename _Res , typename _T1 >
  40272. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( ) const volatile >
  40273. : unary_function < const volatile _T1 * , _Res >
  40274. { } ;
  40275.  
  40276.  
  40277. template < typename _Res , typename _T1 , typename _T2 >
  40278. struct _Reference_wrapper_base < _Res ( _T1 :: * ) ( _T2 ) const volatile >
  40279. : binary_function < const volatile _T1 * , _T2 , _Res >
  40280. { } ;
  40281. #430
  40282. template < typename _Tp >
  40283. class reference_wrapper
  40284. : public _Reference_wrapper_base < typename remove_cv < _Tp > :: type >
  40285. {
  40286. _Tp * _M_data ;
  40287.  
  40288. public :
  40289. typedef _Tp type ;
  40290.  
  40291. reference_wrapper ( _Tp & __indata ) noexcept
  40292. : _M_data ( std :: __addressof ( __indata ) )
  40293. { }
  40294.  
  40295. reference_wrapper ( _Tp && ) = delete ;
  40296.  
  40297. reference_wrapper ( const reference_wrapper < _Tp > & __inref ) noexcept
  40298. : _M_data ( __inref . _M_data )
  40299. { }
  40300.  
  40301. reference_wrapper &
  40302. operator = ( const reference_wrapper < _Tp > & __inref ) noexcept
  40303. {
  40304. _M_data = __inref . _M_data ;
  40305. return * this ;
  40306. }
  40307.  
  40308. operator _Tp & ( ) const noexcept
  40309. { return this -> get ( ) ; }
  40310.  
  40311. _Tp &
  40312. get ( ) const noexcept
  40313. { return * _M_data ; }
  40314.  
  40315. template < typename ... _Args >
  40316. typename result_of < _Tp & ( _Args && ... ) > :: type
  40317. operator ( ) ( _Args && ... __args ) const
  40318. {
  40319. return __invoke ( get ( ) , std :: forward < _Args > ( __args ) ... ) ;
  40320. }
  40321. } ;
  40322.  
  40323.  
  40324.  
  40325. template < typename _Tp >
  40326. inline reference_wrapper < _Tp >
  40327. ref ( _Tp & __t ) noexcept
  40328. { return reference_wrapper < _Tp > ( __t ) ; }
  40329.  
  40330.  
  40331. template < typename _Tp >
  40332. inline reference_wrapper < const _Tp >
  40333. cref ( const _Tp & __t ) noexcept
  40334. { return reference_wrapper < const _Tp > ( __t ) ; }
  40335.  
  40336. template < typename _Tp >
  40337. void ref ( const _Tp && ) = delete ;
  40338.  
  40339. template < typename _Tp >
  40340. void cref ( const _Tp && ) = delete ;
  40341.  
  40342.  
  40343. template < typename _Tp >
  40344. inline reference_wrapper < _Tp >
  40345. ref ( reference_wrapper < _Tp > __t ) noexcept
  40346. { return ref ( __t . get ( ) ) ; }
  40347.  
  40348.  
  40349. template < typename _Tp >
  40350. inline reference_wrapper < const _Tp >
  40351. cref ( reference_wrapper < _Tp > __t ) noexcept
  40352. { return cref ( __t . get ( ) ) ; }
  40353.  
  40354.  
  40355.  
  40356. template < typename ... _Types >
  40357. struct _Pack : integral_constant < size_t , sizeof ... ( _Types ) >
  40358. { } ;
  40359.  
  40360. template < typename _From , typename _To , bool = _From :: value == _To :: value >
  40361. struct _AllConvertible : false_type
  40362. { } ;
  40363.  
  40364. template < typename ... _From , typename ... _To >
  40365. struct _AllConvertible < _Pack < _From ... > , _Pack < _To ... > , true >
  40366. : __and_ < is_convertible < _From , _To > ... >
  40367. { } ;
  40368.  
  40369. template < typename _Tp1 , typename _Tp2 >
  40370. using _NotSame = __not_ < is_same < typename std :: decay < _Tp1 > :: type ,
  40371. typename std :: decay < _Tp2 > :: type >> ;
  40372. #526
  40373. template < typename _Res , typename ... _ArgTypes >
  40374. struct _Maybe_unary_or_binary_function { } ;
  40375.  
  40376.  
  40377. template < typename _Res , typename _T1 >
  40378. struct _Maybe_unary_or_binary_function < _Res , _T1 >
  40379. : std :: unary_function < _T1 , _Res > { } ;
  40380.  
  40381.  
  40382. template < typename _Res , typename _T1 , typename _T2 >
  40383. struct _Maybe_unary_or_binary_function < _Res , _T1 , _T2 >
  40384. : std :: binary_function < _T1 , _T2 , _Res > { } ;
  40385.  
  40386.  
  40387. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40388. class _Mem_fn < _Res ( _Class :: * ) ( _ArgTypes ... ) >
  40389. : public _Maybe_unary_or_binary_function < _Res , _Class * , _ArgTypes ... >
  40390. {
  40391. typedef _Res ( _Class :: * _Functor ) ( _ArgTypes ... ) ;
  40392.  
  40393. template < typename _Tp , typename ... _Args >
  40394. _Res
  40395. _M_call ( _Tp && __object , const volatile _Class * ,
  40396. _Args && ... __args ) const
  40397. {
  40398. return ( std :: forward < _Tp > ( __object ) .* __pmf )
  40399. ( std :: forward < _Args > ( __args ) ... ) ;
  40400. }
  40401.  
  40402. template < typename _Tp , typename ... _Args >
  40403. _Res
  40404. _M_call ( _Tp && __ptr , const volatile void * , _Args && ... __args ) const
  40405. { return ( ( * __ptr ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40406.  
  40407.  
  40408. template < typename ... _Args >
  40409. using _RequireValidArgs
  40410. = _Require < _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40411.  
  40412.  
  40413.  
  40414. template < typename _Tp , typename ... _Args >
  40415. using _RequireValidArgs2
  40416. = _Require < _NotSame < _Class , _Tp > , _NotSame < _Class * , _Tp > ,
  40417. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40418.  
  40419.  
  40420.  
  40421. template < typename _Tp , typename ... _Args >
  40422. using _RequireValidArgs3
  40423. = _Require < is_base_of < _Class , _Tp > ,
  40424. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40425.  
  40426. public :
  40427. typedef _Res result_type ;
  40428.  
  40429. explicit _Mem_fn ( _Functor __pmf ) : __pmf ( __pmf ) { }
  40430.  
  40431.  
  40432. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40433. _Res
  40434. operator ( ) ( _Class & __object , _Args && ... __args ) const
  40435. { return ( __object .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40436.  
  40437. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40438. _Res
  40439. operator ( ) ( _Class && __object , _Args && ... __args ) const
  40440. {
  40441. return ( std :: move ( __object ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ;
  40442. }
  40443.  
  40444.  
  40445. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40446. _Res
  40447. operator ( ) ( _Class * __object , _Args && ... __args ) const
  40448. { return ( __object ->* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40449.  
  40450.  
  40451. template < typename _Tp , typename ... _Args ,
  40452. typename _Req = _RequireValidArgs2 < _Tp , _Args ... >>
  40453. _Res
  40454. operator ( ) ( _Tp && __object , _Args && ... __args ) const
  40455. {
  40456. return _M_call ( std :: forward < _Tp > ( __object ) , & __object ,
  40457. std :: forward < _Args > ( __args ) ... ) ;
  40458. }
  40459.  
  40460. template < typename _Tp , typename ... _Args ,
  40461. typename _Req = _RequireValidArgs3 < _Tp , _Args ... >>
  40462. _Res
  40463. operator ( ) ( reference_wrapper < _Tp > __ref , _Args && ... __args ) const
  40464. { return operator ( ) ( __ref . get ( ) , std :: forward < _Args > ( __args ) ... ) ; }
  40465.  
  40466. private :
  40467. _Functor __pmf ;
  40468. } ;
  40469.  
  40470.  
  40471. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40472. class _Mem_fn < _Res ( _Class :: * ) ( _ArgTypes ... ) const >
  40473. : public _Maybe_unary_or_binary_function < _Res , const _Class * ,
  40474. _ArgTypes ... >
  40475. {
  40476. typedef _Res ( _Class :: * _Functor ) ( _ArgTypes ... ) const ;
  40477.  
  40478. template < typename _Tp , typename ... _Args >
  40479. _Res
  40480. _M_call ( _Tp && __object , const volatile _Class * ,
  40481. _Args && ... __args ) const
  40482. {
  40483. return ( std :: forward < _Tp > ( __object ) .* __pmf )
  40484. ( std :: forward < _Args > ( __args ) ... ) ;
  40485. }
  40486.  
  40487. template < typename _Tp , typename ... _Args >
  40488. _Res
  40489. _M_call ( _Tp && __ptr , const volatile void * , _Args && ... __args ) const
  40490. { return ( ( * __ptr ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40491.  
  40492. template < typename ... _Args >
  40493. using _RequireValidArgs
  40494. = _Require < _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40495.  
  40496. template < typename _Tp , typename ... _Args >
  40497. using _RequireValidArgs2
  40498. = _Require < _NotSame < _Class , _Tp > , _NotSame < const _Class * , _Tp > ,
  40499. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40500.  
  40501. template < typename _Tp , typename ... _Args >
  40502. using _RequireValidArgs3
  40503. = _Require < is_base_of < _Class , _Tp > ,
  40504. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40505.  
  40506. public :
  40507. typedef _Res result_type ;
  40508.  
  40509. explicit _Mem_fn ( _Functor __pmf ) : __pmf ( __pmf ) { }
  40510.  
  40511.  
  40512. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40513. _Res
  40514. operator ( ) ( const _Class & __object , _Args && ... __args ) const
  40515. { return ( __object .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40516.  
  40517. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40518. _Res
  40519. operator ( ) ( const _Class && __object , _Args && ... __args ) const
  40520. {
  40521. return ( std :: move ( __object ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ;
  40522. }
  40523.  
  40524.  
  40525. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40526. _Res
  40527. operator ( ) ( const _Class * __object , _Args && ... __args ) const
  40528. { return ( __object ->* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40529.  
  40530.  
  40531. template < typename _Tp , typename ... _Args ,
  40532. typename _Req = _RequireValidArgs2 < _Tp , _Args ... >>
  40533. _Res operator ( ) ( _Tp && __object , _Args && ... __args ) const
  40534. {
  40535. return _M_call ( std :: forward < _Tp > ( __object ) , & __object ,
  40536. std :: forward < _Args > ( __args ) ... ) ;
  40537. }
  40538.  
  40539. template < typename _Tp , typename ... _Args ,
  40540. typename _Req = _RequireValidArgs3 < _Tp , _Args ... >>
  40541. _Res
  40542. operator ( ) ( reference_wrapper < _Tp > __ref , _Args && ... __args ) const
  40543. { return operator ( ) ( __ref . get ( ) , std :: forward < _Args > ( __args ) ... ) ; }
  40544.  
  40545. private :
  40546. _Functor __pmf ;
  40547. } ;
  40548.  
  40549.  
  40550. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40551. class _Mem_fn < _Res ( _Class :: * ) ( _ArgTypes ... ) volatile >
  40552. : public _Maybe_unary_or_binary_function < _Res , volatile _Class * ,
  40553. _ArgTypes ... >
  40554. {
  40555. typedef _Res ( _Class :: * _Functor ) ( _ArgTypes ... ) volatile ;
  40556.  
  40557. template < typename _Tp , typename ... _Args >
  40558. _Res
  40559. _M_call ( _Tp && __object , const volatile _Class * ,
  40560. _Args && ... __args ) const
  40561. {
  40562. return ( std :: forward < _Tp > ( __object ) .* __pmf )
  40563. ( std :: forward < _Args > ( __args ) ... ) ;
  40564. }
  40565.  
  40566. template < typename _Tp , typename ... _Args >
  40567. _Res
  40568. _M_call ( _Tp && __ptr , const volatile void * , _Args && ... __args ) const
  40569. { return ( ( * __ptr ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40570.  
  40571. template < typename ... _Args >
  40572. using _RequireValidArgs
  40573. = _Require < _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40574.  
  40575. template < typename _Tp , typename ... _Args >
  40576. using _RequireValidArgs2
  40577. = _Require < _NotSame < _Class , _Tp > , _NotSame < volatile _Class * , _Tp > ,
  40578. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40579.  
  40580. template < typename _Tp , typename ... _Args >
  40581. using _RequireValidArgs3
  40582. = _Require < is_base_of < _Class , _Tp > ,
  40583. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40584.  
  40585. public :
  40586. typedef _Res result_type ;
  40587.  
  40588. explicit _Mem_fn ( _Functor __pmf ) : __pmf ( __pmf ) { }
  40589.  
  40590.  
  40591. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40592. _Res
  40593. operator ( ) ( volatile _Class & __object , _Args && ... __args ) const
  40594. { return ( __object .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40595.  
  40596. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40597. _Res
  40598. operator ( ) ( volatile _Class && __object , _Args && ... __args ) const
  40599. {
  40600. return ( std :: move ( __object ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ;
  40601. }
  40602.  
  40603.  
  40604. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40605. _Res
  40606. operator ( ) ( volatile _Class * __object , _Args && ... __args ) const
  40607. { return ( __object ->* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40608.  
  40609.  
  40610. template < typename _Tp , typename ... _Args ,
  40611. typename _Req = _RequireValidArgs2 < _Tp , _Args ... >>
  40612. _Res
  40613. operator ( ) ( _Tp && __object , _Args && ... __args ) const
  40614. {
  40615. return _M_call ( std :: forward < _Tp > ( __object ) , & __object ,
  40616. std :: forward < _Args > ( __args ) ... ) ;
  40617. }
  40618.  
  40619. template < typename _Tp , typename ... _Args ,
  40620. typename _Req = _RequireValidArgs3 < _Tp , _Args ... >>
  40621. _Res
  40622. operator ( ) ( reference_wrapper < _Tp > __ref , _Args && ... __args ) const
  40623. { return operator ( ) ( __ref . get ( ) , std :: forward < _Args > ( __args ) ... ) ; }
  40624.  
  40625. private :
  40626. _Functor __pmf ;
  40627. } ;
  40628.  
  40629.  
  40630. template < typename _Res , typename _Class , typename ... _ArgTypes >
  40631. class _Mem_fn < _Res ( _Class :: * ) ( _ArgTypes ... ) const volatile >
  40632. : public _Maybe_unary_or_binary_function < _Res , const volatile _Class * ,
  40633. _ArgTypes ... >
  40634. {
  40635. typedef _Res ( _Class :: * _Functor ) ( _ArgTypes ... ) const volatile ;
  40636.  
  40637. template < typename _Tp , typename ... _Args >
  40638. _Res
  40639. _M_call ( _Tp && __object , const volatile _Class * ,
  40640. _Args && ... __args ) const
  40641. {
  40642. return ( std :: forward < _Tp > ( __object ) .* __pmf )
  40643. ( std :: forward < _Args > ( __args ) ... ) ;
  40644. }
  40645.  
  40646. template < typename _Tp , typename ... _Args >
  40647. _Res
  40648. _M_call ( _Tp && __ptr , const volatile void * , _Args && ... __args ) const
  40649. { return ( ( * __ptr ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40650.  
  40651. template < typename ... _Args >
  40652. using _RequireValidArgs
  40653. = _Require < _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40654.  
  40655. template < typename _Tp , typename ... _Args >
  40656. using _RequireValidArgs2
  40657. = _Require < _NotSame < _Class , _Tp > ,
  40658. _NotSame < const volatile _Class * , _Tp > ,
  40659. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40660.  
  40661. template < typename _Tp , typename ... _Args >
  40662. using _RequireValidArgs3
  40663. = _Require < is_base_of < _Class , _Tp > ,
  40664. _AllConvertible < _Pack < _Args ... > , _Pack < _ArgTypes ... >> > ;
  40665.  
  40666. public :
  40667. typedef _Res result_type ;
  40668.  
  40669. explicit _Mem_fn ( _Functor __pmf ) : __pmf ( __pmf ) { }
  40670.  
  40671.  
  40672. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40673. _Res
  40674. operator ( ) ( const volatile _Class & __object , _Args && ... __args ) const
  40675. { return ( __object .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40676.  
  40677. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40678. _Res
  40679. operator ( ) ( const volatile _Class && __object , _Args && ... __args ) const
  40680. {
  40681. return ( std :: move ( __object ) .* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ;
  40682. }
  40683.  
  40684.  
  40685. template < typename ... _Args , typename _Req = _RequireValidArgs < _Args ... >>
  40686. _Res
  40687. operator ( ) ( const volatile _Class * __object , _Args && ... __args ) const
  40688. { return ( __object ->* __pmf ) ( std :: forward < _Args > ( __args ) ... ) ; }
  40689.  
  40690.  
  40691. template < typename _Tp , typename ... _Args ,
  40692. typename _Req = _RequireValidArgs2 < _Tp , _Args ... >>
  40693. _Res operator ( ) ( _Tp && __object , _Args && ... __args ) const
  40694. {
  40695. return _M_call ( std :: forward < _Tp > ( __object ) , & __object ,
  40696. std :: forward < _Args > ( __args ) ... ) ;
  40697. }
  40698.  
  40699. template < typename _Tp , typename ... _Args ,
  40700. typename _Req = _RequireValidArgs3 < _Tp , _Args ... >>
  40701. _Res
  40702. operator ( ) ( reference_wrapper < _Tp > __ref , _Args && ... __args ) const
  40703. { return operator ( ) ( __ref . get ( ) , std :: forward < _Args > ( __args ) ... ) ; }
  40704.  
  40705. private :
  40706. _Functor __pmf ;
  40707. } ;
  40708.  
  40709.  
  40710. template < typename _Tp , bool >
  40711. struct _Mem_fn_const_or_non
  40712. {
  40713. typedef const _Tp & type ;
  40714. } ;
  40715.  
  40716. template < typename _Tp >
  40717. struct _Mem_fn_const_or_non < _Tp , false >
  40718. {
  40719. typedef _Tp & type ;
  40720. } ;
  40721.  
  40722. template < typename _Res , typename _Class >
  40723. class _Mem_fn < _Res _Class :: * >
  40724. {
  40725. using __pm_type = _Res _Class :: * ;
  40726.  
  40727.  
  40728.  
  40729.  
  40730. template < typename _Tp >
  40731. auto
  40732. _M_call ( _Tp && __object , const _Class * ) const noexcept
  40733. -> decltype ( std :: forward < _Tp > ( __object ) .* std :: declval < __pm_type & > ( ) )
  40734. { return std :: forward < _Tp > ( __object ) .* __pm ; }
  40735.  
  40736. template < typename _Tp , typename _Up >
  40737. auto
  40738. _M_call ( _Tp && __object , _Up * const * ) const noexcept
  40739. -> decltype ( ( * std :: forward < _Tp > ( __object ) ) .* std :: declval < __pm_type & > ( ) )
  40740. { return ( * std :: forward < _Tp > ( __object ) ) .* __pm ; }
  40741.  
  40742. template < typename _Tp >
  40743. auto
  40744. _M_call ( _Tp && __ptr , const volatile void * ) const
  40745. noexcept ( noexcept ( ( * __ptr ) .* std :: declval < __pm_type & > ( ) ) )
  40746. -> decltype ( ( * __ptr ) .* std :: declval < __pm_type & > ( ) )
  40747. { return ( * __ptr ) .* __pm ; }
  40748.  
  40749. public :
  40750. explicit
  40751. _Mem_fn ( _Res _Class :: * __pm ) noexcept : __pm ( __pm ) { }
  40752.  
  40753.  
  40754. _Res &
  40755. operator ( ) ( _Class & __object ) const noexcept
  40756. { return __object .* __pm ; }
  40757.  
  40758. const _Res &
  40759. operator ( ) ( const _Class & __object ) const noexcept
  40760. { return __object .* __pm ; }
  40761.  
  40762. _Res &&
  40763. operator ( ) ( _Class && __object ) const noexcept
  40764. { return std :: forward < _Class > ( __object ) .* __pm ; }
  40765.  
  40766. const _Res &&
  40767. operator ( ) ( const _Class && __object ) const noexcept
  40768. { return std :: forward < const _Class > ( __object ) .* __pm ; }
  40769.  
  40770.  
  40771. _Res &
  40772. operator ( ) ( _Class * __object ) const noexcept
  40773. { return __object ->* __pm ; }
  40774.  
  40775. const _Res &
  40776. operator ( ) ( const _Class * __object ) const noexcept
  40777. { return __object ->* __pm ; }
  40778.  
  40779.  
  40780. template < typename _Tp , typename _Req = _Require < _NotSame < _Class * , _Tp >> >
  40781. auto
  40782. operator ( ) ( _Tp && __unknown ) const
  40783. noexcept ( noexcept ( std :: declval < _Mem_fn * > ( ) -> _M_call
  40784. ( std :: forward < _Tp > ( __unknown ) , & __unknown ) ) )
  40785. -> decltype ( this -> _M_call ( std :: forward < _Tp > ( __unknown ) , & __unknown ) )
  40786. { return _M_call ( std :: forward < _Tp > ( __unknown ) , & __unknown ) ; }
  40787.  
  40788. template < typename _Tp , typename _Req = _Require < is_base_of < _Class , _Tp >> >
  40789. auto
  40790. operator ( ) ( reference_wrapper < _Tp > __ref ) const
  40791. noexcept ( noexcept ( std :: declval < _Mem_fn & > ( ) ( __ref . get ( ) ) ) )
  40792. -> decltype ( ( * this ) ( __ref . get ( ) ) )
  40793. { return ( * this ) ( __ref . get ( ) ) ; }
  40794.  
  40795. private :
  40796. _Res _Class :: * __pm ;
  40797. } ;
  40798. #959
  40799. template < typename _Tp , typename _Class >
  40800. inline _Mem_fn < _Tp _Class :: * >
  40801. mem_fn ( _Tp _Class :: * __pm ) noexcept
  40802. {
  40803. return _Mem_fn < _Tp _Class :: * > ( __pm ) ;
  40804. }
  40805. #972
  40806. template < typename _Tp >
  40807. struct is_bind_expression
  40808. : public false_type { } ;
  40809. #981
  40810. template < typename _Tp >
  40811. struct is_placeholder
  40812. : public integral_constant < int , 0 >
  40813. { } ;
  40814.  
  40815.  
  40816.  
  40817.  
  40818. template < int _Num > struct _Placeholder { } ;
  40819. #997
  40820. namespace placeholders
  40821. {
  40822.  
  40823.  
  40824.  
  40825.  
  40826.  
  40827. extern const _Placeholder < 1 > _1 ;
  40828. extern const _Placeholder < 2 > _2 ;
  40829. extern const _Placeholder < 3 > _3 ;
  40830. extern const _Placeholder < 4 > _4 ;
  40831. extern const _Placeholder < 5 > _5 ;
  40832. extern const _Placeholder < 6 > _6 ;
  40833. extern const _Placeholder < 7 > _7 ;
  40834. extern const _Placeholder < 8 > _8 ;
  40835. extern const _Placeholder < 9 > _9 ;
  40836. extern const _Placeholder < 10 > _10 ;
  40837. extern const _Placeholder < 11 > _11 ;
  40838. extern const _Placeholder < 12 > _12 ;
  40839. extern const _Placeholder < 13 > _13 ;
  40840. extern const _Placeholder < 14 > _14 ;
  40841. extern const _Placeholder < 15 > _15 ;
  40842. extern const _Placeholder < 16 > _16 ;
  40843. extern const _Placeholder < 17 > _17 ;
  40844. extern const _Placeholder < 18 > _18 ;
  40845. extern const _Placeholder < 19 > _19 ;
  40846. extern const _Placeholder < 20 > _20 ;
  40847. extern const _Placeholder < 21 > _21 ;
  40848. extern const _Placeholder < 22 > _22 ;
  40849. extern const _Placeholder < 23 > _23 ;
  40850. extern const _Placeholder < 24 > _24 ;
  40851. extern const _Placeholder < 25 > _25 ;
  40852. extern const _Placeholder < 26 > _26 ;
  40853. extern const _Placeholder < 27 > _27 ;
  40854. extern const _Placeholder < 28 > _28 ;
  40855. extern const _Placeholder < 29 > _29 ;
  40856.  
  40857. }
  40858. #1043
  40859. template < int _Num >
  40860. struct is_placeholder < _Placeholder < _Num > >
  40861. : public integral_constant < int , _Num >
  40862. { } ;
  40863.  
  40864. template < int _Num >
  40865. struct is_placeholder < const _Placeholder < _Num > >
  40866. : public integral_constant < int , _Num >
  40867. { } ;
  40868.  
  40869.  
  40870.  
  40871.  
  40872.  
  40873. struct _No_tuple_element ;
  40874. #1064
  40875. template < std :: size_t __i , typename _Tuple , bool _IsSafe >
  40876. struct _Safe_tuple_element_impl
  40877. : tuple_element < __i , _Tuple > { } ;
  40878. #1073
  40879. template < std :: size_t __i , typename _Tuple >
  40880. struct _Safe_tuple_element_impl < __i , _Tuple , false >
  40881. {
  40882. typedef _No_tuple_element type ;
  40883. } ;
  40884.  
  40885.  
  40886.  
  40887.  
  40888.  
  40889. template < std :: size_t __i , typename _Tuple >
  40890. struct _Safe_tuple_element
  40891. : _Safe_tuple_element_impl < __i , _Tuple ,
  40892. ( __i < tuple_size < _Tuple > :: value ) >
  40893. { } ;
  40894. #1100
  40895. template < typename _Arg ,
  40896. bool _IsBindExp = is_bind_expression < _Arg > :: value ,
  40897. bool _IsPlaceholder = ( is_placeholder < _Arg > :: value > 0 ) >
  40898. class _Mu ;
  40899.  
  40900.  
  40901.  
  40902.  
  40903.  
  40904. template < typename _Tp >
  40905. class _Mu < reference_wrapper < _Tp > , false , false >
  40906. {
  40907. public :
  40908. typedef _Tp & result_type ;
  40909.  
  40910.  
  40911.  
  40912.  
  40913.  
  40914. template < typename _CVRef , typename _Tuple >
  40915. result_type
  40916. operator ( ) ( _CVRef & __arg , _Tuple & ) const volatile
  40917. { return __arg . get ( ) ; }
  40918. } ;
  40919. #1130
  40920. template < typename _Arg >
  40921. class _Mu < _Arg , true , false >
  40922. {
  40923. public :
  40924. template < typename _CVArg , typename ... _Args >
  40925. auto
  40926. operator ( ) ( _CVArg & __arg ,
  40927. tuple < _Args ... > & __tuple ) const volatile
  40928. -> decltype ( __arg ( declval < _Args > ( ) ... ) )
  40929. {
  40930.  
  40931. typedef typename _Build_index_tuple < sizeof ... ( _Args ) > :: __type
  40932. _Indexes ;
  40933. return this -> __call ( __arg , __tuple , _Indexes ( ) ) ;
  40934. }
  40935.  
  40936. private :
  40937.  
  40938.  
  40939. template < typename _CVArg , typename ... _Args , std :: size_t ... _Indexes >
  40940. auto
  40941. __call ( _CVArg & __arg , tuple < _Args ... > & __tuple ,
  40942. const _Index_tuple < _Indexes ... > & ) const volatile
  40943. -> decltype ( __arg ( declval < _Args > ( ) ... ) )
  40944. {
  40945. return __arg ( std :: forward < _Args > ( get < _Indexes > ( __tuple ) ) ... ) ;
  40946. }
  40947. } ;
  40948. #1164
  40949. template < typename _Arg >
  40950. class _Mu < _Arg , false , true >
  40951. {
  40952. public :
  40953. template < typename _Signature > class result ;
  40954.  
  40955. template < typename _CVMu , typename _CVArg , typename _Tuple >
  40956. class result < _CVMu ( _CVArg , _Tuple ) >
  40957. {
  40958.  
  40959.  
  40960.  
  40961. typedef typename _Safe_tuple_element < ( is_placeholder < _Arg > :: value
  40962. - 1 ) , _Tuple > :: type
  40963. __base_type ;
  40964.  
  40965. public :
  40966. typedef typename add_rvalue_reference < __base_type > :: type type ;
  40967. } ;
  40968.  
  40969. template < typename _Tuple >
  40970. typename result < _Mu ( _Arg , _Tuple ) > :: type
  40971. operator ( ) ( const volatile _Arg & , _Tuple & __tuple ) const volatile
  40972. {
  40973. return std :: forward < typename result < _Mu ( _Arg , _Tuple ) > :: type > (
  40974. :: std :: get < ( is_placeholder < _Arg > :: value - 1 ) > ( __tuple ) ) ;
  40975. }
  40976. } ;
  40977. #1198
  40978. template < typename _Arg >
  40979. class _Mu < _Arg , false , false >
  40980. {
  40981. public :
  40982. template < typename _Signature > struct result ;
  40983.  
  40984. template < typename _CVMu , typename _CVArg , typename _Tuple >
  40985. struct result < _CVMu ( _CVArg , _Tuple ) >
  40986. {
  40987. typedef typename add_lvalue_reference < _CVArg > :: type type ;
  40988. } ;
  40989.  
  40990.  
  40991. template < typename _CVArg , typename _Tuple >
  40992. _CVArg &&
  40993. operator ( ) ( _CVArg && __arg , _Tuple & ) const volatile
  40994. { return std :: forward < _CVArg > ( __arg ) ; }
  40995. } ;
  40996. #1222
  40997. template < typename _Tp >
  40998. struct _Maybe_wrap_member_pointer
  40999. {
  41000. typedef _Tp type ;
  41001.  
  41002. static const _Tp &
  41003. __do_wrap ( const _Tp & __x )
  41004. { return __x ; }
  41005.  
  41006. static _Tp &&
  41007. __do_wrap ( _Tp && __x )
  41008. { return static_cast < _Tp && > ( __x ) ; }
  41009. } ;
  41010. #1241
  41011. template < typename _Tp , typename _Class >
  41012. struct _Maybe_wrap_member_pointer < _Tp _Class :: * >
  41013. {
  41014. typedef _Mem_fn < _Tp _Class :: * > type ;
  41015.  
  41016. static type
  41017. __do_wrap ( _Tp _Class :: * __pm )
  41018. { return type ( __pm ) ; }
  41019. } ;
  41020.  
  41021.  
  41022.  
  41023.  
  41024.  
  41025. template < >
  41026. struct _Maybe_wrap_member_pointer < void >
  41027. {
  41028. typedef void type ;
  41029. } ;
  41030.  
  41031.  
  41032. template < std :: size_t _Ind , typename ... _Tp >
  41033. inline auto
  41034. __volget ( volatile tuple < _Tp ... > & __tuple )
  41035. -> typename tuple_element < _Ind , tuple < _Tp ... >> :: type volatile &
  41036. { return std :: get < _Ind > ( const_cast < tuple < _Tp ... > & > ( __tuple ) ) ; }
  41037.  
  41038.  
  41039. template < std :: size_t _Ind , typename ... _Tp >
  41040. inline auto
  41041. __volget ( const volatile tuple < _Tp ... > & __tuple )
  41042. -> typename tuple_element < _Ind , tuple < _Tp ... >> :: type const volatile &
  41043. { return std :: get < _Ind > ( const_cast < const tuple < _Tp ... > & > ( __tuple ) ) ; }
  41044.  
  41045.  
  41046. template < typename _Signature >
  41047. struct _Bind ;
  41048.  
  41049. template < typename _Functor , typename ... _Bound_args >
  41050. class _Bind < _Functor ( _Bound_args ... ) >
  41051. : public _Weak_result_type < _Functor >
  41052. {
  41053. typedef _Bind __self_type ;
  41054. typedef typename _Build_index_tuple < sizeof ... ( _Bound_args ) > :: __type
  41055. _Bound_indexes ;
  41056.  
  41057. _Functor _M_f ;
  41058. tuple < _Bound_args ... > _M_bound_args ;
  41059.  
  41060.  
  41061. template < typename _Result , typename ... _Args , std :: size_t ... _Indexes >
  41062. _Result
  41063. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > )
  41064. {
  41065. return _M_f ( _Mu < _Bound_args > ( )
  41066. ( get < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41067. }
  41068.  
  41069.  
  41070. template < typename _Result , typename ... _Args , std :: size_t ... _Indexes >
  41071. _Result
  41072. __call_c ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ) const
  41073. {
  41074. return _M_f ( _Mu < _Bound_args > ( )
  41075. ( get < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41076. }
  41077.  
  41078.  
  41079. template < typename _Result , typename ... _Args , std :: size_t ... _Indexes >
  41080. _Result
  41081. __call_v ( tuple < _Args ... > && __args ,
  41082. _Index_tuple < _Indexes ... > ) volatile
  41083. {
  41084. return _M_f ( _Mu < _Bound_args > ( )
  41085. ( __volget < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41086. }
  41087.  
  41088.  
  41089. template < typename _Result , typename ... _Args , std :: size_t ... _Indexes >
  41090. _Result
  41091. __call_c_v ( tuple < _Args ... > && __args ,
  41092. _Index_tuple < _Indexes ... > ) const volatile
  41093. {
  41094. return _M_f ( _Mu < _Bound_args > ( )
  41095. ( __volget < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41096. }
  41097.  
  41098. public :
  41099. template < typename ... _Args >
  41100. explicit _Bind ( const _Functor & __f , _Args && ... __args )
  41101. : _M_f ( __f ) , _M_bound_args ( std :: forward < _Args > ( __args ) ... )
  41102. { }
  41103.  
  41104. template < typename ... _Args >
  41105. explicit _Bind ( _Functor && __f , _Args && ... __args )
  41106. : _M_f ( std :: move ( __f ) ) , _M_bound_args ( std :: forward < _Args > ( __args ) ... )
  41107. { }
  41108.  
  41109. _Bind ( const _Bind & ) = default ;
  41110.  
  41111. _Bind ( _Bind && __b )
  41112. : _M_f ( std :: move ( __b . _M_f ) ) , _M_bound_args ( std :: move ( __b . _M_bound_args ) )
  41113. { }
  41114.  
  41115.  
  41116. template < typename ... _Args , typename _Result
  41117. = decltype ( std :: declval < _Functor > ( ) (
  41118. _Mu < _Bound_args > ( ) ( std :: declval < _Bound_args & > ( ) ,
  41119. std :: declval < tuple < _Args ... > & > ( ) ) ... ) ) >
  41120. _Result
  41121. operator ( ) ( _Args && ... __args )
  41122. {
  41123. return this -> __call < _Result > (
  41124. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41125. _Bound_indexes ( ) ) ;
  41126. }
  41127.  
  41128.  
  41129. template < typename ... _Args , typename _Result
  41130. = decltype ( std :: declval < typename enable_if < ( sizeof ... ( _Args ) >= 0 ) ,
  41131. typename add_const < _Functor > :: type > :: type > ( ) (
  41132. _Mu < _Bound_args > ( ) ( std :: declval < const _Bound_args & > ( ) ,
  41133. std :: declval < tuple < _Args ... > & > ( ) ) ... ) ) >
  41134. _Result
  41135. operator ( ) ( _Args && ... __args ) const
  41136. {
  41137. return this -> __call_c < _Result > (
  41138. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41139. _Bound_indexes ( ) ) ;
  41140. }
  41141.  
  41142.  
  41143. template < typename ... _Args , typename _Result
  41144. = decltype ( std :: declval < typename enable_if < ( sizeof ... ( _Args ) >= 0 ) ,
  41145. typename add_volatile < _Functor > :: type > :: type > ( ) (
  41146. _Mu < _Bound_args > ( ) ( std :: declval < volatile _Bound_args & > ( ) ,
  41147. std :: declval < tuple < _Args ... > & > ( ) ) ... ) ) >
  41148. _Result
  41149. operator ( ) ( _Args && ... __args ) volatile
  41150. {
  41151. return this -> __call_v < _Result > (
  41152. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41153. _Bound_indexes ( ) ) ;
  41154. }
  41155.  
  41156.  
  41157. template < typename ... _Args , typename _Result
  41158. = decltype ( std :: declval < typename enable_if < ( sizeof ... ( _Args ) >= 0 ) ,
  41159. typename add_cv < _Functor > :: type > :: type > ( ) (
  41160. _Mu < _Bound_args > ( ) ( std :: declval < const volatile _Bound_args & > ( ) ,
  41161. std :: declval < tuple < _Args ... > & > ( ) ) ... ) ) >
  41162. _Result
  41163. operator ( ) ( _Args && ... __args ) const volatile
  41164. {
  41165. return this -> __call_c_v < _Result > (
  41166. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41167. _Bound_indexes ( ) ) ;
  41168. }
  41169. } ;
  41170.  
  41171.  
  41172. template < typename _Result , typename _Signature >
  41173. struct _Bind_result ;
  41174.  
  41175. template < typename _Result , typename _Functor , typename ... _Bound_args >
  41176. class _Bind_result < _Result , _Functor ( _Bound_args ... ) >
  41177. {
  41178. typedef _Bind_result __self_type ;
  41179. typedef typename _Build_index_tuple < sizeof ... ( _Bound_args ) > :: __type
  41180. _Bound_indexes ;
  41181.  
  41182. _Functor _M_f ;
  41183. tuple < _Bound_args ... > _M_bound_args ;
  41184.  
  41185.  
  41186. template < typename _Res >
  41187. struct __enable_if_void : enable_if < is_void < _Res > :: value , int > { } ;
  41188. template < typename _Res >
  41189. struct __disable_if_void : enable_if < ! is_void < _Res > :: value , int > { } ;
  41190.  
  41191.  
  41192. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41193. _Result
  41194. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41195. typename __disable_if_void < _Res > :: type = 0 )
  41196. {
  41197. return _M_f ( _Mu < _Bound_args > ( )
  41198. ( get < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41199. }
  41200.  
  41201.  
  41202. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41203. void
  41204. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41205. typename __enable_if_void < _Res > :: type = 0 )
  41206. {
  41207. _M_f ( _Mu < _Bound_args > ( )
  41208. ( get < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41209. }
  41210.  
  41211.  
  41212. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41213. _Result
  41214. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41215. typename __disable_if_void < _Res > :: type = 0 ) const
  41216. {
  41217. return _M_f ( _Mu < _Bound_args > ( )
  41218. ( get < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41219. }
  41220.  
  41221.  
  41222. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41223. void
  41224. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41225. typename __enable_if_void < _Res > :: type = 0 ) const
  41226. {
  41227. _M_f ( _Mu < _Bound_args > ( )
  41228. ( get < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41229. }
  41230.  
  41231.  
  41232. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41233. _Result
  41234. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41235. typename __disable_if_void < _Res > :: type = 0 ) volatile
  41236. {
  41237. return _M_f ( _Mu < _Bound_args > ( )
  41238. ( __volget < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41239. }
  41240.  
  41241.  
  41242. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41243. void
  41244. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41245. typename __enable_if_void < _Res > :: type = 0 ) volatile
  41246. {
  41247. _M_f ( _Mu < _Bound_args > ( )
  41248. ( __volget < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41249. }
  41250.  
  41251.  
  41252. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41253. _Result
  41254. __call ( tuple < _Args ... > && __args , _Index_tuple < _Indexes ... > ,
  41255. typename __disable_if_void < _Res > :: type = 0 ) const volatile
  41256. {
  41257. return _M_f ( _Mu < _Bound_args > ( )
  41258. ( __volget < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41259. }
  41260.  
  41261.  
  41262. template < typename _Res , typename ... _Args , std :: size_t ... _Indexes >
  41263. void
  41264. __call ( tuple < _Args ... > && __args ,
  41265. _Index_tuple < _Indexes ... > ,
  41266. typename __enable_if_void < _Res > :: type = 0 ) const volatile
  41267. {
  41268. _M_f ( _Mu < _Bound_args > ( )
  41269. ( __volget < _Indexes > ( _M_bound_args ) , __args ) ... ) ;
  41270. }
  41271.  
  41272. public :
  41273. typedef _Result result_type ;
  41274.  
  41275. template < typename ... _Args >
  41276. explicit _Bind_result ( const _Functor & __f , _Args && ... __args )
  41277. : _M_f ( __f ) , _M_bound_args ( std :: forward < _Args > ( __args ) ... )
  41278. { }
  41279.  
  41280. template < typename ... _Args >
  41281. explicit _Bind_result ( _Functor && __f , _Args && ... __args )
  41282. : _M_f ( std :: move ( __f ) ) , _M_bound_args ( std :: forward < _Args > ( __args ) ... )
  41283. { }
  41284.  
  41285. _Bind_result ( const _Bind_result & ) = default ;
  41286.  
  41287. _Bind_result ( _Bind_result && __b )
  41288. : _M_f ( std :: move ( __b . _M_f ) ) , _M_bound_args ( std :: move ( __b . _M_bound_args ) )
  41289. { }
  41290.  
  41291.  
  41292. template < typename ... _Args >
  41293. result_type
  41294. operator ( ) ( _Args && ... __args )
  41295. {
  41296. return this -> __call < _Result > (
  41297. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41298. _Bound_indexes ( ) ) ;
  41299. }
  41300.  
  41301.  
  41302. template < typename ... _Args >
  41303. result_type
  41304. operator ( ) ( _Args && ... __args ) const
  41305. {
  41306. return this -> __call < _Result > (
  41307. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41308. _Bound_indexes ( ) ) ;
  41309. }
  41310.  
  41311.  
  41312. template < typename ... _Args >
  41313. result_type
  41314. operator ( ) ( _Args && ... __args ) volatile
  41315. {
  41316. return this -> __call < _Result > (
  41317. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41318. _Bound_indexes ( ) ) ;
  41319. }
  41320.  
  41321.  
  41322. template < typename ... _Args >
  41323. result_type
  41324. operator ( ) ( _Args && ... __args ) const volatile
  41325. {
  41326. return this -> __call < _Result > (
  41327. std :: forward_as_tuple ( std :: forward < _Args > ( __args ) ... ) ,
  41328. _Bound_indexes ( ) ) ;
  41329. }
  41330. } ;
  41331.  
  41332.  
  41333.  
  41334.  
  41335.  
  41336. template < typename _Signature >
  41337. struct is_bind_expression < _Bind < _Signature > >
  41338. : public true_type { } ;
  41339.  
  41340.  
  41341.  
  41342.  
  41343.  
  41344. template < typename _Signature >
  41345. struct is_bind_expression < const _Bind < _Signature > >
  41346. : public true_type { } ;
  41347.  
  41348.  
  41349.  
  41350.  
  41351.  
  41352. template < typename _Signature >
  41353. struct is_bind_expression < volatile _Bind < _Signature > >
  41354. : public true_type { } ;
  41355.  
  41356.  
  41357.  
  41358.  
  41359.  
  41360. template < typename _Signature >
  41361. struct is_bind_expression < const volatile _Bind < _Signature >>
  41362. : public true_type { } ;
  41363.  
  41364.  
  41365.  
  41366.  
  41367.  
  41368. template < typename _Result , typename _Signature >
  41369. struct is_bind_expression < _Bind_result < _Result , _Signature >>
  41370. : public true_type { } ;
  41371.  
  41372.  
  41373.  
  41374.  
  41375.  
  41376. template < typename _Result , typename _Signature >
  41377. struct is_bind_expression < const _Bind_result < _Result , _Signature >>
  41378. : public true_type { } ;
  41379.  
  41380.  
  41381.  
  41382.  
  41383.  
  41384. template < typename _Result , typename _Signature >
  41385. struct is_bind_expression < volatile _Bind_result < _Result , _Signature >>
  41386. : public true_type { } ;
  41387.  
  41388.  
  41389.  
  41390.  
  41391.  
  41392. template < typename _Result , typename _Signature >
  41393. struct is_bind_expression < const volatile _Bind_result < _Result , _Signature >>
  41394. : public true_type { } ;
  41395.  
  41396.  
  41397.  
  41398.  
  41399. template < typename _Tp , typename _Tp2 = typename decay < _Tp > :: type >
  41400. using __is_socketlike = __or_ < is_integral < _Tp2 > , is_enum < _Tp2 >> ;
  41401.  
  41402. template < bool _SocketLike , typename _Func , typename ... _BoundArgs >
  41403. struct _Bind_helper
  41404. {
  41405. typedef _Maybe_wrap_member_pointer < typename decay < _Func > :: type >
  41406. __maybe_type ;
  41407. typedef typename __maybe_type :: type __func_type ;
  41408. typedef _Bind < __func_type ( typename decay < _BoundArgs > :: type ... ) > type ;
  41409. } ;
  41410.  
  41411.  
  41412.  
  41413.  
  41414. template < typename _Func , typename ... _BoundArgs >
  41415. struct _Bind_helper < true , _Func , _BoundArgs ... >
  41416. { } ;
  41417.  
  41418.  
  41419.  
  41420.  
  41421.  
  41422. template < typename _Func , typename ... _BoundArgs >
  41423. inline typename
  41424. _Bind_helper < __is_socketlike < _Func > :: value , _Func , _BoundArgs ... > :: type
  41425. bind ( _Func && __f , _BoundArgs && ... __args )
  41426. {
  41427. typedef _Bind_helper < false , _Func , _BoundArgs ... > __helper_type ;
  41428. typedef typename __helper_type :: __maybe_type __maybe_type ;
  41429. typedef typename __helper_type :: type __result_type ;
  41430. return __result_type ( __maybe_type :: __do_wrap ( std :: forward < _Func > ( __f ) ) ,
  41431. std :: forward < _BoundArgs > ( __args ) ... ) ;
  41432. }
  41433.  
  41434. template < typename _Result , typename _Func , typename ... _BoundArgs >
  41435. struct _Bindres_helper
  41436. {
  41437. typedef _Maybe_wrap_member_pointer < typename decay < _Func > :: type >
  41438. __maybe_type ;
  41439. typedef typename __maybe_type :: type __functor_type ;
  41440. typedef _Bind_result < _Result ,
  41441. __functor_type ( typename decay < _BoundArgs > :: type ... ) >
  41442. type ;
  41443. } ;
  41444.  
  41445.  
  41446.  
  41447.  
  41448.  
  41449. template < typename _Result , typename _Func , typename ... _BoundArgs >
  41450. inline
  41451. typename _Bindres_helper < _Result , _Func , _BoundArgs ... > :: type
  41452. bind ( _Func && __f , _BoundArgs && ... __args )
  41453. {
  41454. typedef _Bindres_helper < _Result , _Func , _BoundArgs ... > __helper_type ;
  41455. typedef typename __helper_type :: __maybe_type __maybe_type ;
  41456. typedef typename __helper_type :: type __result_type ;
  41457. return __result_type ( __maybe_type :: __do_wrap ( std :: forward < _Func > ( __f ) ) ,
  41458. std :: forward < _BoundArgs > ( __args ) ... ) ;
  41459. }
  41460.  
  41461. template < typename _Signature >
  41462. struct _Bind_simple ;
  41463.  
  41464. template < typename _Callable , typename ... _Args >
  41465. struct _Bind_simple < _Callable ( _Args ... ) >
  41466. {
  41467. typedef typename result_of < _Callable ( _Args ... ) > :: type result_type ;
  41468.  
  41469. template < typename ... _Args2 , typename = typename
  41470. enable_if < sizeof ... ( _Args ) == sizeof ... ( _Args2 ) > :: type >
  41471. explicit
  41472. _Bind_simple ( const _Callable & __callable , _Args2 && ... __args )
  41473. : _M_bound ( __callable , std :: forward < _Args2 > ( __args ) ... )
  41474. { }
  41475.  
  41476. template < typename ... _Args2 , typename = typename
  41477. enable_if < sizeof ... ( _Args ) == sizeof ... ( _Args2 ) > :: type >
  41478. explicit
  41479. _Bind_simple ( _Callable && __callable , _Args2 && ... __args )
  41480. : _M_bound ( std :: move ( __callable ) , std :: forward < _Args2 > ( __args ) ... )
  41481. { }
  41482.  
  41483. _Bind_simple ( const _Bind_simple & ) = default ;
  41484. _Bind_simple ( _Bind_simple && ) = default ;
  41485.  
  41486. result_type
  41487. operator ( ) ( )
  41488. {
  41489. typedef typename _Build_index_tuple < sizeof ... ( _Args ) > :: __type _Indices ;
  41490. return _M_invoke ( _Indices ( ) ) ;
  41491. }
  41492.  
  41493. private :
  41494.  
  41495. template < std :: size_t ... _Indices >
  41496. typename result_of < _Callable ( _Args ... ) > :: type
  41497. _M_invoke ( _Index_tuple < _Indices ... > )
  41498. {
  41499.  
  41500.  
  41501. return std :: forward < _Callable > ( std :: get < 0 > ( _M_bound ) ) (
  41502. std :: forward < _Args > ( std :: get < _Indices + 1 > ( _M_bound ) ) ... ) ;
  41503. }
  41504.  
  41505. std :: tuple < _Callable , _Args ... > _M_bound ;
  41506. } ;
  41507.  
  41508. template < typename _Func , typename ... _BoundArgs >
  41509. struct _Bind_simple_helper
  41510. {
  41511. typedef _Maybe_wrap_member_pointer < typename decay < _Func > :: type >
  41512. __maybe_type ;
  41513. typedef typename __maybe_type :: type __func_type ;
  41514. typedef _Bind_simple < __func_type ( typename decay < _BoundArgs > :: type ... ) >
  41515. __type ;
  41516. } ;
  41517.  
  41518.  
  41519.  
  41520. template < typename _Callable , typename ... _Args >
  41521. typename _Bind_simple_helper < _Callable , _Args ... > :: __type
  41522. __bind_simple ( _Callable && __callable , _Args && ... __args )
  41523. {
  41524. typedef _Bind_simple_helper < _Callable , _Args ... > __helper_type ;
  41525. typedef typename __helper_type :: __maybe_type __maybe_type ;
  41526. typedef typename __helper_type :: __type __result_type ;
  41527. return __result_type (
  41528. __maybe_type :: __do_wrap ( std :: forward < _Callable > ( __callable ) ) ,
  41529. std :: forward < _Args > ( __args ) ... ) ;
  41530. }
  41531. #1767
  41532. class bad_function_call : public std :: exception
  41533. {
  41534. public :
  41535. virtual ~ bad_function_call ( ) noexcept ;
  41536.  
  41537. const char * what ( ) const noexcept ;
  41538. } ;
  41539. #1780
  41540. template < typename _Tp >
  41541. struct __is_location_invariant
  41542. : integral_constant < bool , ( is_pointer < _Tp > :: value
  41543. || is_member_pointer < _Tp > :: value ) >
  41544. { } ;
  41545.  
  41546. class _Undefined_class ;
  41547.  
  41548. union _Nocopy_types
  41549. {
  41550. void * _M_object ;
  41551. const void * _M_const_object ;
  41552. void ( * _M_function_pointer ) ( ) ;
  41553. void ( _Undefined_class :: * _M_member_pointer ) ( ) ;
  41554. } ;
  41555.  
  41556. union _Any_data
  41557. {
  41558. void * _M_access ( ) { return & _M_pod_data [ 0 ] ; }
  41559. const void * _M_access ( ) const { return & _M_pod_data [ 0 ] ; }
  41560.  
  41561. template < typename _Tp >
  41562. _Tp &
  41563. _M_access ( )
  41564. { return * static_cast < _Tp * > ( _M_access ( ) ) ; }
  41565.  
  41566. template < typename _Tp >
  41567. const _Tp &
  41568. _M_access ( ) const
  41569. { return * static_cast < const _Tp * > ( _M_access ( ) ) ; }
  41570.  
  41571. _Nocopy_types _M_unused ;
  41572. char _M_pod_data [ sizeof ( _Nocopy_types ) ] ;
  41573. } ;
  41574.  
  41575. enum _Manager_operation
  41576. {
  41577. __get_type_info ,
  41578. __get_functor_ptr ,
  41579. __clone_functor ,
  41580. __destroy_functor
  41581. } ;
  41582.  
  41583.  
  41584.  
  41585. template < typename _Tp >
  41586. struct _Simple_type_wrapper
  41587. {
  41588. _Simple_type_wrapper ( _Tp __value ) : __value ( __value ) { }
  41589.  
  41590. _Tp __value ;
  41591. } ;
  41592.  
  41593. template < typename _Tp >
  41594. struct __is_location_invariant < _Simple_type_wrapper < _Tp > >
  41595. : __is_location_invariant < _Tp >
  41596. { } ;
  41597.  
  41598.  
  41599.  
  41600. template < typename _Functor >
  41601. inline _Functor &
  41602. __callable_functor ( _Functor & __f )
  41603. { return __f ; }
  41604.  
  41605. template < typename _Member , typename _Class >
  41606. inline _Mem_fn < _Member _Class :: * >
  41607. __callable_functor ( _Member _Class :: * & __p )
  41608. { return std :: mem_fn ( __p ) ; }
  41609.  
  41610. template < typename _Member , typename _Class >
  41611. inline _Mem_fn < _Member _Class :: * >
  41612. __callable_functor ( _Member _Class :: * const & __p )
  41613. { return std :: mem_fn ( __p ) ; }
  41614.  
  41615. template < typename _Member , typename _Class >
  41616. inline _Mem_fn < _Member _Class :: * >
  41617. __callable_functor ( _Member _Class :: * volatile & __p )
  41618. { return std :: mem_fn ( __p ) ; }
  41619.  
  41620. template < typename _Member , typename _Class >
  41621. inline _Mem_fn < _Member _Class :: * >
  41622. __callable_functor ( _Member _Class :: * const volatile & __p )
  41623. { return std :: mem_fn ( __p ) ; }
  41624.  
  41625. template < typename _Signature >
  41626. class function ;
  41627.  
  41628.  
  41629. class _Function_base
  41630. {
  41631. public :
  41632. static const std :: size_t _M_max_size = sizeof ( _Nocopy_types ) ;
  41633. static const std :: size_t _M_max_align = __alignof ( _Nocopy_types ) ;
  41634.  
  41635. template < typename _Functor >
  41636. class _Base_manager
  41637. {
  41638. protected :
  41639. static const bool __stored_locally =
  41640. ( __is_location_invariant < _Functor > :: value
  41641. && sizeof ( _Functor ) <= _M_max_size
  41642. && __alignof ( _Functor ) <= _M_max_align
  41643. && ( _M_max_align % __alignof ( _Functor ) == 0 ) ) ;
  41644.  
  41645. typedef integral_constant < bool , __stored_locally > _Local_storage ;
  41646.  
  41647.  
  41648. static _Functor *
  41649. _M_get_pointer ( const _Any_data & __source )
  41650. {
  41651. const _Functor * __ptr =
  41652. __stored_locally ? std :: __addressof ( __source . _M_access < _Functor > ( ) )
  41653. : __source . _M_access < _Functor * > ( ) ;
  41654. return const_cast < _Functor * > ( __ptr ) ;
  41655. }
  41656.  
  41657.  
  41658.  
  41659. static void
  41660. _M_clone ( _Any_data & __dest , const _Any_data & __source , true_type )
  41661. {
  41662. new ( __dest . _M_access ( ) ) _Functor ( __source . _M_access < _Functor > ( ) ) ;
  41663. }
  41664.  
  41665.  
  41666.  
  41667. static void
  41668. _M_clone ( _Any_data & __dest , const _Any_data & __source , false_type )
  41669. {
  41670. __dest . _M_access < _Functor * > ( ) =
  41671. new _Functor ( * __source . _M_access < _Functor * > ( ) ) ;
  41672. }
  41673.  
  41674.  
  41675.  
  41676. static void
  41677. _M_destroy ( _Any_data & __victim , true_type )
  41678. {
  41679. __victim . _M_access < _Functor > ( ) . ~ _Functor ( ) ;
  41680. }
  41681.  
  41682.  
  41683. static void
  41684. _M_destroy ( _Any_data & __victim , false_type )
  41685. {
  41686. delete __victim . _M_access < _Functor * > ( ) ;
  41687. }
  41688.  
  41689. public :
  41690. static bool
  41691. _M_manager ( _Any_data & __dest , const _Any_data & __source ,
  41692. _Manager_operation __op )
  41693. {
  41694. switch ( __op )
  41695. {
  41696.  
  41697.  
  41698.  
  41699.  
  41700.  
  41701. case __get_functor_ptr :
  41702. __dest . _M_access < _Functor * > ( ) = _M_get_pointer ( __source ) ;
  41703. break ;
  41704.  
  41705. case __clone_functor :
  41706. _M_clone ( __dest , __source , _Local_storage ( ) ) ;
  41707. break ;
  41708.  
  41709. case __destroy_functor :
  41710. _M_destroy ( __dest , _Local_storage ( ) ) ;
  41711. break ;
  41712. }
  41713. return false ;
  41714. }
  41715.  
  41716. static void
  41717. _M_init_functor ( _Any_data & __functor , _Functor && __f )
  41718. { _M_init_functor ( __functor , std :: move ( __f ) , _Local_storage ( ) ) ; }
  41719.  
  41720. template < typename _Signature >
  41721. static bool
  41722. _M_not_empty_function ( const function < _Signature > & __f )
  41723. { return static_cast < bool > ( __f ) ; }
  41724.  
  41725. template < typename _Tp >
  41726. static bool
  41727. _M_not_empty_function ( _Tp * const & __fp )
  41728. { return __fp ; }
  41729.  
  41730. template < typename _Class , typename _Tp >
  41731. static bool
  41732. _M_not_empty_function ( _Tp _Class :: * const & __mp )
  41733. { return __mp ; }
  41734.  
  41735. template < typename _Tp >
  41736. static bool
  41737. _M_not_empty_function ( const _Tp & )
  41738. { return true ; }
  41739.  
  41740. private :
  41741. static void
  41742. _M_init_functor ( _Any_data & __functor , _Functor && __f , true_type )
  41743. { new ( __functor . _M_access ( ) ) _Functor ( std :: move ( __f ) ) ; }
  41744.  
  41745. static void
  41746. _M_init_functor ( _Any_data & __functor , _Functor && __f , false_type )
  41747. { __functor . _M_access < _Functor * > ( ) = new _Functor ( std :: move ( __f ) ) ; }
  41748. } ;
  41749.  
  41750. template < typename _Functor >
  41751. class _Ref_manager : public _Base_manager < _Functor * >
  41752. {
  41753. typedef _Function_base :: _Base_manager < _Functor * > _Base ;
  41754.  
  41755. public :
  41756. static bool
  41757. _M_manager ( _Any_data & __dest , const _Any_data & __source ,
  41758. _Manager_operation __op )
  41759. {
  41760. switch ( __op )
  41761. {
  41762.  
  41763.  
  41764.  
  41765.  
  41766.  
  41767. case __get_functor_ptr :
  41768. __dest . _M_access < _Functor * > ( ) = * _Base :: _M_get_pointer ( __source ) ;
  41769. return is_const < _Functor > :: value ;
  41770. break ;
  41771.  
  41772. default :
  41773. _Base :: _M_manager ( __dest , __source , __op ) ;
  41774. }
  41775. return false ;
  41776. }
  41777.  
  41778. static void
  41779. _M_init_functor ( _Any_data & __functor , reference_wrapper < _Functor > __f )
  41780. {
  41781. _Base :: _M_init_functor ( __functor , std :: __addressof ( __f . get ( ) ) ) ;
  41782. }
  41783. } ;
  41784.  
  41785. _Function_base ( ) : _M_manager ( 0 ) { }
  41786.  
  41787. ~ _Function_base ( )
  41788. {
  41789. if ( _M_manager )
  41790. _M_manager ( _M_functor , _M_functor , __destroy_functor ) ;
  41791. }
  41792.  
  41793.  
  41794. bool _M_empty ( ) const { return ! _M_manager ; }
  41795.  
  41796. typedef bool ( * _Manager_type ) ( _Any_data & , const _Any_data & ,
  41797. _Manager_operation ) ;
  41798.  
  41799. _Any_data _M_functor ;
  41800. _Manager_type _M_manager ;
  41801. } ;
  41802.  
  41803. template < typename _Signature , typename _Functor >
  41804. class _Function_handler ;
  41805.  
  41806. template < typename _Res , typename _Functor , typename ... _ArgTypes >
  41807. class _Function_handler < _Res ( _ArgTypes ... ) , _Functor >
  41808. : public _Function_base :: _Base_manager < _Functor >
  41809. {
  41810. typedef _Function_base :: _Base_manager < _Functor > _Base ;
  41811.  
  41812. public :
  41813. static _Res
  41814. _M_invoke ( const _Any_data & __functor , _ArgTypes ... __args )
  41815. {
  41816. return ( * _Base :: _M_get_pointer ( __functor ) ) (
  41817. std :: forward < _ArgTypes > ( __args ) ... ) ;
  41818. }
  41819. } ;
  41820.  
  41821. template < typename _Functor , typename ... _ArgTypes >
  41822. class _Function_handler < void ( _ArgTypes ... ) , _Functor >
  41823. : public _Function_base :: _Base_manager < _Functor >
  41824. {
  41825. typedef _Function_base :: _Base_manager < _Functor > _Base ;
  41826.  
  41827. public :
  41828. static void
  41829. _M_invoke ( const _Any_data & __functor , _ArgTypes ... __args )
  41830. {
  41831. ( * _Base :: _M_get_pointer ( __functor ) ) (
  41832. std :: forward < _ArgTypes > ( __args ) ... ) ;
  41833. }
  41834. } ;
  41835.  
  41836. template < typename _Res , typename _Functor , typename ... _ArgTypes >
  41837. class _Function_handler < _Res ( _ArgTypes ... ) , reference_wrapper < _Functor > >
  41838. : public _Function_base :: _Ref_manager < _Functor >
  41839. {
  41840. typedef _Function_base :: _Ref_manager < _Functor > _Base ;
  41841.  
  41842. public :
  41843. static _Res
  41844. _M_invoke ( const _Any_data & __functor , _ArgTypes ... __args )
  41845. {
  41846. return __callable_functor ( * * _Base :: _M_get_pointer ( __functor ) ) (
  41847. std :: forward < _ArgTypes > ( __args ) ... ) ;
  41848. }
  41849. } ;
  41850.  
  41851. template < typename _Functor , typename ... _ArgTypes >
  41852. class _Function_handler < void ( _ArgTypes ... ) , reference_wrapper < _Functor > >
  41853. : public _Function_base :: _Ref_manager < _Functor >
  41854. {
  41855. typedef _Function_base :: _Ref_manager < _Functor > _Base ;
  41856.  
  41857. public :
  41858. static void
  41859. _M_invoke ( const _Any_data & __functor , _ArgTypes ... __args )
  41860. {
  41861. __callable_functor ( * * _Base :: _M_get_pointer ( __functor ) ) (
  41862. std :: forward < _ArgTypes > ( __args ) ... ) ;
  41863. }
  41864. } ;
  41865.  
  41866. template < typename _Class , typename _Member , typename _Res ,
  41867. typename ... _ArgTypes >
  41868. class _Function_handler < _Res ( _ArgTypes ... ) , _Member _Class :: * >
  41869. : public _Function_handler < void ( _ArgTypes ... ) , _Member _Class :: * >
  41870. {
  41871. typedef _Function_handler < void ( _ArgTypes ... ) , _Member _Class :: * >
  41872. _Base ;
  41873.  
  41874. public :
  41875. static _Res
  41876. _M_invoke ( const _Any_data & __functor , _ArgTypes ... __args )
  41877. {
  41878. return std :: mem_fn ( _Base :: _M_get_pointer ( __functor ) -> __value ) (
  41879. std :: forward < _ArgTypes > ( __args ) ... ) ;
  41880. }
  41881. } ;
  41882.  
  41883. template < typename _Class , typename _Member , typename ... _ArgTypes >
  41884. class _Function_handler < void ( _ArgTypes ... ) , _Member _Class :: * >
  41885. : public _Function_base :: _Base_manager <
  41886. _Simple_type_wrapper < _Member _Class :: * > >
  41887. {
  41888. typedef _Member _Class :: * _Functor ;
  41889. typedef _Simple_type_wrapper < _Functor > _Wrapper ;
  41890. typedef _Function_base :: _Base_manager < _Wrapper > _Base ;
  41891.  
  41892. public :
  41893. static bool
  41894. _M_manager ( _Any_data & __dest , const _Any_data & __source ,
  41895. _Manager_operation __op )
  41896. {
  41897. switch ( __op )
  41898. {
  41899.  
  41900.  
  41901.  
  41902.  
  41903.  
  41904. case __get_functor_ptr :
  41905. __dest . _M_access < _Functor * > ( ) =
  41906. & _Base :: _M_get_pointer ( __source ) -> __value ;
  41907. break ;
  41908.  
  41909. default :
  41910. _Base :: _M_manager ( __dest , __source , __op ) ;
  41911. }
  41912. return false ;
  41913. }
  41914.  
  41915. static void
  41916. _M_invoke ( const _Any_data & __functor , _ArgTypes ... __args )
  41917. {
  41918. std :: mem_fn ( _Base :: _M_get_pointer ( __functor ) -> __value ) (
  41919. std :: forward < _ArgTypes > ( __args ) ... ) ;
  41920. }
  41921. } ;
  41922.  
  41923. template < typename _From , typename _To >
  41924. using __check_func_return_type
  41925. = __or_ < is_void < _To > , is_convertible < _From , _To >> ;
  41926. #2173
  41927. template < typename _Res , typename ... _ArgTypes >
  41928. class function < _Res ( _ArgTypes ... ) >
  41929. : public _Maybe_unary_or_binary_function < _Res , _ArgTypes ... > ,
  41930. private _Function_base
  41931. {
  41932. typedef _Res _Signature_type ( _ArgTypes ... ) ;
  41933.  
  41934. template < typename _Functor >
  41935. using _Invoke = decltype ( __callable_functor ( std :: declval < _Functor & > ( ) )
  41936. ( std :: declval < _ArgTypes > ( ) ... ) ) ;
  41937.  
  41938. template < typename _Functor >
  41939. using _Callable = __check_func_return_type < _Invoke < _Functor > , _Res > ;
  41940.  
  41941. template < typename _Cond , typename _Tp >
  41942. using _Requires = typename enable_if < _Cond :: value , _Tp > :: type ;
  41943.  
  41944. public :
  41945. typedef _Res result_type ;
  41946. #2199
  41947. function ( ) noexcept
  41948. : _Function_base ( ) { }
  41949.  
  41950.  
  41951.  
  41952.  
  41953.  
  41954. function ( nullptr_t ) noexcept
  41955. : _Function_base ( ) { }
  41956. #2217
  41957. function ( const function & __x ) ;
  41958. #2226
  41959. function ( function && __x ) : _Function_base ( )
  41960. {
  41961. __x . swap ( * this ) ;
  41962. }
  41963. #2249
  41964. template < typename _Functor ,
  41965. typename = _Requires < _Callable < _Functor > , void >>
  41966. function ( _Functor ) ;
  41967. #2265
  41968. function &
  41969. operator = ( const function & __x )
  41970. {
  41971. function ( __x ) . swap ( * this ) ;
  41972. return * this ;
  41973. }
  41974. #2283
  41975. function &
  41976. operator = ( function && __x )
  41977. {
  41978. function ( std :: move ( __x ) ) . swap ( * this ) ;
  41979. return * this ;
  41980. }
  41981. #2297
  41982. function &
  41983. operator = ( nullptr_t )
  41984. {
  41985. if ( _M_manager )
  41986. {
  41987. _M_manager ( _M_functor , _M_functor , __destroy_functor ) ;
  41988. _M_manager = 0 ;
  41989. _M_invoker = 0 ;
  41990. }
  41991. return * this ;
  41992. }
  41993. #2325
  41994. template < typename _Functor >
  41995. _Requires < _Callable < _Functor > , function & >
  41996. operator = ( _Functor && __f )
  41997. {
  41998. function ( std :: forward < _Functor > ( __f ) ) . swap ( * this ) ;
  41999. return * this ;
  42000. }
  42001.  
  42002.  
  42003. template < typename _Functor >
  42004. function &
  42005. operator = ( reference_wrapper < _Functor > __f ) noexcept
  42006. {
  42007. function ( __f ) . swap ( * this ) ;
  42008. return * this ;
  42009. }
  42010. #2351
  42011. void swap ( function & __x )
  42012. {
  42013. std :: swap ( _M_functor , __x . _M_functor ) ;
  42014. std :: swap ( _M_manager , __x . _M_manager ) ;
  42015. std :: swap ( _M_invoker , __x . _M_invoker ) ;
  42016. }
  42017. #2379
  42018. explicit operator bool ( ) const noexcept
  42019. { return ! _M_empty ( ) ; }
  42020. #2392
  42021. _Res operator ( ) ( _ArgTypes ... __args ) const ;
  42022. #2422
  42023. private :
  42024. typedef _Res ( * _Invoker_type ) ( const _Any_data & , _ArgTypes ... ) ;
  42025. _Invoker_type _M_invoker ;
  42026. } ;
  42027.  
  42028.  
  42029. template < typename _Res , typename ... _ArgTypes >
  42030. function < _Res ( _ArgTypes ... ) > ::
  42031. function ( const function & __x )
  42032. : _Function_base ( )
  42033. {
  42034. if ( static_cast < bool > ( __x ) )
  42035. {
  42036. _M_invoker = __x . _M_invoker ;
  42037. _M_manager = __x . _M_manager ;
  42038. __x . _M_manager ( _M_functor , __x . _M_functor , __clone_functor ) ;
  42039. }
  42040. }
  42041.  
  42042. template < typename _Res , typename ... _ArgTypes >
  42043. template < typename _Functor , typename >
  42044. function < _Res ( _ArgTypes ... ) > ::
  42045. function ( _Functor __f )
  42046. : _Function_base ( )
  42047. {
  42048. typedef _Function_handler < _Signature_type , _Functor > _My_handler ;
  42049.  
  42050. if ( _My_handler :: _M_not_empty_function ( __f ) )
  42051. {
  42052. _My_handler :: _M_init_functor ( _M_functor , std :: move ( __f ) ) ;
  42053. _M_invoker = & _My_handler :: _M_invoke ;
  42054. _M_manager = & _My_handler :: _M_manager ;
  42055. }
  42056. }
  42057.  
  42058. template < typename _Res , typename ... _ArgTypes >
  42059. _Res
  42060. function < _Res ( _ArgTypes ... ) > ::
  42061. operator ( ) ( _ArgTypes ... __args ) const
  42062. {
  42063. if ( _M_empty ( ) )
  42064. __throw_bad_function_call ( ) ;
  42065. return _M_invoker ( _M_functor , std :: forward < _ArgTypes > ( __args ) ... ) ;
  42066. }
  42067. #2528
  42068. template < typename _Res , typename ... _Args >
  42069. inline bool
  42070. operator == ( const function < _Res ( _Args ... ) > & __f , nullptr_t ) noexcept
  42071. { return ! static_cast < bool > ( __f ) ; }
  42072.  
  42073.  
  42074. template < typename _Res , typename ... _Args >
  42075. inline bool
  42076. operator == ( nullptr_t , const function < _Res ( _Args ... ) > & __f ) noexcept
  42077. { return ! static_cast < bool > ( __f ) ; }
  42078. #2546
  42079. template < typename _Res , typename ... _Args >
  42080. inline bool
  42081. operator != ( const function < _Res ( _Args ... ) > & __f , nullptr_t ) noexcept
  42082. { return static_cast < bool > ( __f ) ; }
  42083.  
  42084.  
  42085. template < typename _Res , typename ... _Args >
  42086. inline bool
  42087. operator != ( nullptr_t , const function < _Res ( _Args ... ) > & __f ) noexcept
  42088. { return static_cast < bool > ( __f ) ; }
  42089. #2564
  42090. template < typename _Res , typename ... _Args >
  42091. inline void
  42092. swap ( function < _Res ( _Args ... ) > & __x , function < _Res ( _Args ... ) > & __y )
  42093. { __x . swap ( __y ) ; }
  42094.  
  42095.  
  42096. }
  42097. #71 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_algo.h"
  42098. namespace std
  42099. {
  42100.  
  42101.  
  42102.  
  42103. template < typename _Iterator >
  42104. void
  42105. __move_median_to_first ( _Iterator __result , _Iterator __a ,
  42106. _Iterator __b , _Iterator __c )
  42107. {
  42108.  
  42109.  
  42110.  
  42111.  
  42112. if ( * __a < * __b )
  42113. {
  42114. if ( * __b < * __c )
  42115. std :: iter_swap ( __result , __b ) ;
  42116. else if ( * __a < * __c )
  42117. std :: iter_swap ( __result , __c ) ;
  42118. else
  42119. std :: iter_swap ( __result , __a ) ;
  42120. }
  42121. else if ( * __a < * __c )
  42122. std :: iter_swap ( __result , __a ) ;
  42123. else if ( * __b < * __c )
  42124. std :: iter_swap ( __result , __c ) ;
  42125. else
  42126. std :: iter_swap ( __result , __b ) ;
  42127. }
  42128.  
  42129.  
  42130. template < typename _Iterator , typename _Compare >
  42131. void
  42132. __move_median_to_first ( _Iterator __result , _Iterator __a ,
  42133. _Iterator __b , _Iterator __c ,
  42134. _Compare __comp )
  42135. {
  42136.  
  42137.  
  42138.  
  42139.  
  42140.  
  42141. if ( __comp ( * __a , * __b ) )
  42142. {
  42143. if ( __comp ( * __b , * __c ) )
  42144. std :: iter_swap ( __result , __b ) ;
  42145. else if ( __comp ( * __a , * __c ) )
  42146. std :: iter_swap ( __result , __c ) ;
  42147. else
  42148. std :: iter_swap ( __result , __a ) ;
  42149. }
  42150. else if ( __comp ( * __a , * __c ) )
  42151. std :: iter_swap ( __result , __a ) ;
  42152. else if ( __comp ( * __b , * __c ) )
  42153. std :: iter_swap ( __result , __c ) ;
  42154. else
  42155. std :: iter_swap ( __result , __b ) ;
  42156. }
  42157.  
  42158.  
  42159.  
  42160.  
  42161. template < typename _InputIterator , typename _Tp >
  42162. inline _InputIterator
  42163. __find ( _InputIterator __first , _InputIterator __last ,
  42164. const _Tp & __val , input_iterator_tag )
  42165. {
  42166. while ( __first != __last && ! ( * __first == __val ) )
  42167. ++ __first ;
  42168. return __first ;
  42169. }
  42170.  
  42171.  
  42172. template < typename _InputIterator , typename _Predicate >
  42173. inline _InputIterator
  42174. __find_if ( _InputIterator __first , _InputIterator __last ,
  42175. _Predicate __pred , input_iterator_tag )
  42176. {
  42177. while ( __first != __last && ! bool ( __pred ( * __first ) ) )
  42178. ++ __first ;
  42179. return __first ;
  42180. }
  42181.  
  42182.  
  42183. template < typename _RandomAccessIterator , typename _Tp >
  42184. _RandomAccessIterator
  42185. __find ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  42186. const _Tp & __val , random_access_iterator_tag )
  42187. {
  42188. typename iterator_traits < _RandomAccessIterator > :: difference_type
  42189. __trip_count = ( __last - __first ) >> 2 ;
  42190.  
  42191. for ( ; __trip_count > 0 ; -- __trip_count )
  42192. {
  42193. if ( * __first == __val )
  42194. return __first ;
  42195. ++ __first ;
  42196.  
  42197. if ( * __first == __val )
  42198. return __first ;
  42199. ++ __first ;
  42200.  
  42201. if ( * __first == __val )
  42202. return __first ;
  42203. ++ __first ;
  42204.  
  42205. if ( * __first == __val )
  42206. return __first ;
  42207. ++ __first ;
  42208. }
  42209.  
  42210. switch ( __last - __first )
  42211. {
  42212. case 3 :
  42213. if ( * __first == __val )
  42214. return __first ;
  42215. ++ __first ;
  42216. case 2 :
  42217. if ( * __first == __val )
  42218. return __first ;
  42219. ++ __first ;
  42220. case 1 :
  42221. if ( * __first == __val )
  42222. return __first ;
  42223. ++ __first ;
  42224. case 0 :
  42225. default :
  42226. return __last ;
  42227. }
  42228. }
  42229.  
  42230.  
  42231. template < typename _RandomAccessIterator , typename _Predicate >
  42232. _RandomAccessIterator
  42233. __find_if ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  42234. _Predicate __pred , random_access_iterator_tag )
  42235. {
  42236. typename iterator_traits < _RandomAccessIterator > :: difference_type
  42237. __trip_count = ( __last - __first ) >> 2 ;
  42238.  
  42239. for ( ; __trip_count > 0 ; -- __trip_count )
  42240. {
  42241. if ( __pred ( * __first ) )
  42242. return __first ;
  42243. ++ __first ;
  42244.  
  42245. if ( __pred ( * __first ) )
  42246. return __first ;
  42247. ++ __first ;
  42248.  
  42249. if ( __pred ( * __first ) )
  42250. return __first ;
  42251. ++ __first ;
  42252.  
  42253. if ( __pred ( * __first ) )
  42254. return __first ;
  42255. ++ __first ;
  42256. }
  42257.  
  42258. switch ( __last - __first )
  42259. {
  42260. case 3 :
  42261. if ( __pred ( * __first ) )
  42262. return __first ;
  42263. ++ __first ;
  42264. case 2 :
  42265. if ( __pred ( * __first ) )
  42266. return __first ;
  42267. ++ __first ;
  42268. case 1 :
  42269. if ( __pred ( * __first ) )
  42270. return __first ;
  42271. ++ __first ;
  42272. case 0 :
  42273. default :
  42274. return __last ;
  42275. }
  42276. }
  42277.  
  42278.  
  42279. template < typename _InputIterator , typename _Predicate >
  42280. inline _InputIterator
  42281. __find_if_not ( _InputIterator __first , _InputIterator __last ,
  42282. _Predicate __pred , input_iterator_tag )
  42283. {
  42284. while ( __first != __last && bool ( __pred ( * __first ) ) )
  42285. ++ __first ;
  42286. return __first ;
  42287. }
  42288.  
  42289.  
  42290. template < typename _RandomAccessIterator , typename _Predicate >
  42291. _RandomAccessIterator
  42292. __find_if_not ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  42293. _Predicate __pred , random_access_iterator_tag )
  42294. {
  42295. typename iterator_traits < _RandomAccessIterator > :: difference_type
  42296. __trip_count = ( __last - __first ) >> 2 ;
  42297.  
  42298. for ( ; __trip_count > 0 ; -- __trip_count )
  42299. {
  42300. if ( ! bool ( __pred ( * __first ) ) )
  42301. return __first ;
  42302. ++ __first ;
  42303.  
  42304. if ( ! bool ( __pred ( * __first ) ) )
  42305. return __first ;
  42306. ++ __first ;
  42307.  
  42308. if ( ! bool ( __pred ( * __first ) ) )
  42309. return __first ;
  42310. ++ __first ;
  42311.  
  42312. if ( ! bool ( __pred ( * __first ) ) )
  42313. return __first ;
  42314. ++ __first ;
  42315. }
  42316.  
  42317. switch ( __last - __first )
  42318. {
  42319. case 3 :
  42320. if ( ! bool ( __pred ( * __first ) ) )
  42321. return __first ;
  42322. ++ __first ;
  42323. case 2 :
  42324. if ( ! bool ( __pred ( * __first ) ) )
  42325. return __first ;
  42326. ++ __first ;
  42327. case 1 :
  42328. if ( ! bool ( __pred ( * __first ) ) )
  42329. return __first ;
  42330. ++ __first ;
  42331. case 0 :
  42332. default :
  42333. return __last ;
  42334. }
  42335. }
  42336.  
  42337.  
  42338. template < typename _InputIterator , typename _Predicate >
  42339. inline _InputIterator
  42340. __find_if_not ( _InputIterator __first , _InputIterator __last ,
  42341. _Predicate __pred )
  42342. {
  42343. return std :: __find_if_not ( __first , __last , __pred ,
  42344. std :: __iterator_category ( __first ) ) ;
  42345. }
  42346.  
  42347.  
  42348.  
  42349.  
  42350. template < typename _InputIterator , typename _Predicate , typename _Distance >
  42351. _InputIterator
  42352. __find_if_not_n ( _InputIterator __first , _Distance & __len , _Predicate __pred )
  42353. {
  42354. for ( ; __len ; -- __len , ++ __first )
  42355. if ( ! bool ( __pred ( * __first ) ) )
  42356. break ;
  42357. return __first ;
  42358. }
  42359. #351
  42360. template < typename _ForwardIterator , typename _Integer , typename _Tp >
  42361. _ForwardIterator
  42362. __search_n ( _ForwardIterator __first , _ForwardIterator __last ,
  42363. _Integer __count , const _Tp & __val ,
  42364. std :: forward_iterator_tag )
  42365. {
  42366. __first = std :: find ( __first , __last , __val ) ;
  42367. while ( __first != __last )
  42368. {
  42369. typename iterator_traits < _ForwardIterator > :: difference_type
  42370. __n = __count ;
  42371. _ForwardIterator __i = __first ;
  42372. ++ __i ;
  42373. while ( __i != __last && __n != 1 && * __i == __val )
  42374. {
  42375. ++ __i ;
  42376. -- __n ;
  42377. }
  42378. if ( __n == 1 )
  42379. return __first ;
  42380. if ( __i == __last )
  42381. return __last ;
  42382. __first = std :: find ( ++ __i , __last , __val ) ;
  42383. }
  42384. return __last ;
  42385. }
  42386. #383
  42387. template < typename _RandomAccessIter , typename _Integer , typename _Tp >
  42388. _RandomAccessIter
  42389. __search_n ( _RandomAccessIter __first , _RandomAccessIter __last ,
  42390. _Integer __count , const _Tp & __val ,
  42391. std :: random_access_iterator_tag )
  42392. {
  42393.  
  42394. typedef typename std :: iterator_traits < _RandomAccessIter > :: difference_type
  42395. _DistanceType ;
  42396.  
  42397. _DistanceType __tailSize = __last - __first ;
  42398. _DistanceType __remainder = __count ;
  42399.  
  42400. while ( __remainder <= __tailSize )
  42401. {
  42402. __first += __remainder ;
  42403. __tailSize -= __remainder ;
  42404.  
  42405.  
  42406. _RandomAccessIter __backTrack = __first ;
  42407. while ( * -- __backTrack == __val )
  42408. {
  42409. if ( -- __remainder == 0 )
  42410. return ( __first - __count ) ;
  42411. }
  42412. __remainder = __count + 1 - ( __first - __backTrack ) ;
  42413. }
  42414. return __last ;
  42415. }
  42416. #421
  42417. template < typename _ForwardIterator , typename _Integer , typename _Tp ,
  42418. typename _BinaryPredicate >
  42419. _ForwardIterator
  42420. __search_n ( _ForwardIterator __first , _ForwardIterator __last ,
  42421. _Integer __count , const _Tp & __val ,
  42422. _BinaryPredicate __binary_pred , std :: forward_iterator_tag )
  42423. {
  42424. while ( __first != __last && ! bool ( __binary_pred ( * __first , __val ) ) )
  42425. ++ __first ;
  42426.  
  42427. while ( __first != __last )
  42428. {
  42429. typename iterator_traits < _ForwardIterator > :: difference_type
  42430. __n = __count ;
  42431. _ForwardIterator __i = __first ;
  42432. ++ __i ;
  42433. while ( __i != __last && __n != 1 && bool ( __binary_pred ( * __i , __val ) ) )
  42434. {
  42435. ++ __i ;
  42436. -- __n ;
  42437. }
  42438. if ( __n == 1 )
  42439. return __first ;
  42440. if ( __i == __last )
  42441. return __last ;
  42442. __first = ++ __i ;
  42443. while ( __first != __last
  42444. && ! bool ( __binary_pred ( * __first , __val ) ) )
  42445. ++ __first ;
  42446. }
  42447. return __last ;
  42448. }
  42449. #460
  42450. template < typename _RandomAccessIter , typename _Integer , typename _Tp ,
  42451. typename _BinaryPredicate >
  42452. _RandomAccessIter
  42453. __search_n ( _RandomAccessIter __first , _RandomAccessIter __last ,
  42454. _Integer __count , const _Tp & __val ,
  42455. _BinaryPredicate __binary_pred , std :: random_access_iterator_tag )
  42456. {
  42457.  
  42458. typedef typename std :: iterator_traits < _RandomAccessIter > :: difference_type
  42459. _DistanceType ;
  42460.  
  42461. _DistanceType __tailSize = __last - __first ;
  42462. _DistanceType __remainder = __count ;
  42463.  
  42464. while ( __remainder <= __tailSize )
  42465. {
  42466. __first += __remainder ;
  42467. __tailSize -= __remainder ;
  42468.  
  42469.  
  42470. _RandomAccessIter __backTrack = __first ;
  42471. while ( __binary_pred ( * -- __backTrack , __val ) )
  42472. {
  42473. if ( -- __remainder == 0 )
  42474. return ( __first - __count ) ;
  42475. }
  42476. __remainder = __count + 1 - ( __first - __backTrack ) ;
  42477. }
  42478. return __last ;
  42479. }
  42480.  
  42481.  
  42482. template < typename _ForwardIterator1 , typename _ForwardIterator2 >
  42483. _ForwardIterator1
  42484. __find_end ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  42485. _ForwardIterator2 __first2 , _ForwardIterator2 __last2 ,
  42486. forward_iterator_tag , forward_iterator_tag )
  42487. {
  42488. if ( __first2 == __last2 )
  42489. return __last1 ;
  42490. else
  42491. {
  42492. _ForwardIterator1 __result = __last1 ;
  42493. while ( 1 )
  42494. {
  42495. _ForwardIterator1 __new_result
  42496. = std :: search ( __first1 , __last1 , __first2 , __last2 ) ;
  42497. if ( __new_result == __last1 )
  42498. return __result ;
  42499. else
  42500. {
  42501. __result = __new_result ;
  42502. __first1 = __new_result ;
  42503. ++ __first1 ;
  42504. }
  42505. }
  42506. }
  42507. }
  42508.  
  42509. template < typename _ForwardIterator1 , typename _ForwardIterator2 ,
  42510. typename _BinaryPredicate >
  42511. _ForwardIterator1
  42512. __find_end ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  42513. _ForwardIterator2 __first2 , _ForwardIterator2 __last2 ,
  42514. forward_iterator_tag , forward_iterator_tag ,
  42515. _BinaryPredicate __comp )
  42516. {
  42517. if ( __first2 == __last2 )
  42518. return __last1 ;
  42519. else
  42520. {
  42521. _ForwardIterator1 __result = __last1 ;
  42522. while ( 1 )
  42523. {
  42524. _ForwardIterator1 __new_result
  42525. = std :: search ( __first1 , __last1 , __first2 ,
  42526. __last2 , __comp ) ;
  42527. if ( __new_result == __last1 )
  42528. return __result ;
  42529. else
  42530. {
  42531. __result = __new_result ;
  42532. __first1 = __new_result ;
  42533. ++ __first1 ;
  42534. }
  42535. }
  42536. }
  42537. }
  42538.  
  42539.  
  42540. template < typename _BidirectionalIterator1 , typename _BidirectionalIterator2 >
  42541. _BidirectionalIterator1
  42542. __find_end ( _BidirectionalIterator1 __first1 ,
  42543. _BidirectionalIterator1 __last1 ,
  42544. _BidirectionalIterator2 __first2 ,
  42545. _BidirectionalIterator2 __last2 ,
  42546. bidirectional_iterator_tag , bidirectional_iterator_tag )
  42547. {
  42548. #564
  42549. typedef reverse_iterator < _BidirectionalIterator1 > _RevIterator1 ;
  42550. typedef reverse_iterator < _BidirectionalIterator2 > _RevIterator2 ;
  42551.  
  42552. _RevIterator1 __rlast1 ( __first1 ) ;
  42553. _RevIterator2 __rlast2 ( __first2 ) ;
  42554. _RevIterator1 __rresult = std :: search ( _RevIterator1 ( __last1 ) ,
  42555. __rlast1 ,
  42556. _RevIterator2 ( __last2 ) ,
  42557. __rlast2 ) ;
  42558.  
  42559. if ( __rresult == __rlast1 )
  42560. return __last1 ;
  42561. else
  42562. {
  42563. _BidirectionalIterator1 __result = __rresult . base ( ) ;
  42564. std :: advance ( __result , - std :: distance ( __first2 , __last2 ) ) ;
  42565. return __result ;
  42566. }
  42567. }
  42568.  
  42569. template < typename _BidirectionalIterator1 , typename _BidirectionalIterator2 ,
  42570. typename _BinaryPredicate >
  42571. _BidirectionalIterator1
  42572. __find_end ( _BidirectionalIterator1 __first1 ,
  42573. _BidirectionalIterator1 __last1 ,
  42574. _BidirectionalIterator2 __first2 ,
  42575. _BidirectionalIterator2 __last2 ,
  42576. bidirectional_iterator_tag , bidirectional_iterator_tag ,
  42577. _BinaryPredicate __comp )
  42578. {
  42579. #600
  42580. typedef reverse_iterator < _BidirectionalIterator1 > _RevIterator1 ;
  42581. typedef reverse_iterator < _BidirectionalIterator2 > _RevIterator2 ;
  42582.  
  42583. _RevIterator1 __rlast1 ( __first1 ) ;
  42584. _RevIterator2 __rlast2 ( __first2 ) ;
  42585. _RevIterator1 __rresult = std :: search ( _RevIterator1 ( __last1 ) , __rlast1 ,
  42586. _RevIterator2 ( __last2 ) , __rlast2 ,
  42587. __comp ) ;
  42588.  
  42589. if ( __rresult == __rlast1 )
  42590. return __last1 ;
  42591. else
  42592. {
  42593. _BidirectionalIterator1 __result = __rresult . base ( ) ;
  42594. std :: advance ( __result , - std :: distance ( __first2 , __last2 ) ) ;
  42595. return __result ;
  42596. }
  42597. }
  42598. #645
  42599. template < typename _ForwardIterator1 , typename _ForwardIterator2 >
  42600. inline _ForwardIterator1
  42601. find_end ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  42602. _ForwardIterator2 __first2 , _ForwardIterator2 __last2 )
  42603. {
  42604. #656
  42605. ;
  42606. ;
  42607.  
  42608. return std :: __find_end ( __first1 , __last1 , __first2 , __last2 ,
  42609. std :: __iterator_category ( __first1 ) ,
  42610. std :: __iterator_category ( __first2 ) ) ;
  42611. }
  42612. #692
  42613. template < typename _ForwardIterator1 , typename _ForwardIterator2 ,
  42614. typename _BinaryPredicate >
  42615. inline _ForwardIterator1
  42616. find_end ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  42617. _ForwardIterator2 __first2 , _ForwardIterator2 __last2 ,
  42618. _BinaryPredicate __comp )
  42619. {
  42620. #705
  42621. ;
  42622. ;
  42623.  
  42624. return std :: __find_end ( __first1 , __last1 , __first2 , __last2 ,
  42625. std :: __iterator_category ( __first1 ) ,
  42626. std :: __iterator_category ( __first2 ) ,
  42627. __comp ) ;
  42628. }
  42629. #727
  42630. template < typename _InputIterator , typename _Predicate >
  42631. inline bool
  42632. all_of ( _InputIterator __first , _InputIterator __last , _Predicate __pred )
  42633. { return __last == std :: find_if_not ( __first , __last , __pred ) ; }
  42634. #744
  42635. template < typename _InputIterator , typename _Predicate >
  42636. inline bool
  42637. none_of ( _InputIterator __first , _InputIterator __last , _Predicate __pred )
  42638. { return __last == std :: find_if ( __first , __last , __pred ) ; }
  42639. #762
  42640. template < typename _InputIterator , typename _Predicate >
  42641. inline bool
  42642. any_of ( _InputIterator __first , _InputIterator __last , _Predicate __pred )
  42643. { return ! std :: none_of ( __first , __last , __pred ) ; }
  42644. #777
  42645. template < typename _InputIterator , typename _Predicate >
  42646. inline _InputIterator
  42647. find_if_not ( _InputIterator __first , _InputIterator __last ,
  42648. _Predicate __pred )
  42649. {
  42650.  
  42651.  
  42652.  
  42653.  
  42654. ;
  42655. return std :: __find_if_not ( __first , __last , __pred ) ;
  42656. }
  42657. #800
  42658. template < typename _InputIterator , typename _Predicate >
  42659. inline bool
  42660. is_partitioned ( _InputIterator __first , _InputIterator __last ,
  42661. _Predicate __pred )
  42662. {
  42663. __first = std :: find_if_not ( __first , __last , __pred ) ;
  42664. return std :: none_of ( __first , __last , __pred ) ;
  42665. }
  42666. #818
  42667. template < typename _ForwardIterator , typename _Predicate >
  42668. _ForwardIterator
  42669. partition_point ( _ForwardIterator __first , _ForwardIterator __last ,
  42670. _Predicate __pred )
  42671. {
  42672. #829
  42673. ;
  42674.  
  42675. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  42676. _DistanceType ;
  42677.  
  42678. _DistanceType __len = std :: distance ( __first , __last ) ;
  42679. _DistanceType __half ;
  42680. _ForwardIterator __middle ;
  42681.  
  42682. while ( __len > 0 )
  42683. {
  42684. __half = __len >> 1 ;
  42685. __middle = __first ;
  42686. std :: advance ( __middle , __half ) ;
  42687. if ( __pred ( * __middle ) )
  42688. {
  42689. __first = __middle ;
  42690. ++ __first ;
  42691. __len = __len - __half - 1 ;
  42692. }
  42693. else
  42694. __len = __half ;
  42695. }
  42696. return __first ;
  42697. }
  42698. #871
  42699. template < typename _InputIterator , typename _OutputIterator , typename _Tp >
  42700. _OutputIterator
  42701. remove_copy ( _InputIterator __first , _InputIterator __last ,
  42702. _OutputIterator __result , const _Tp & __value )
  42703. {
  42704. #882
  42705. ;
  42706.  
  42707. for ( ; __first != __last ; ++ __first )
  42708. if ( ! ( * __first == __value ) )
  42709. {
  42710. * __result = * __first ;
  42711. ++ __result ;
  42712. }
  42713. return __result ;
  42714. }
  42715. #908
  42716. template < typename _InputIterator , typename _OutputIterator ,
  42717. typename _Predicate >
  42718. _OutputIterator
  42719. remove_copy_if ( _InputIterator __first , _InputIterator __last ,
  42720. _OutputIterator __result , _Predicate __pred )
  42721. {
  42722. #920
  42723. ;
  42724.  
  42725. for ( ; __first != __last ; ++ __first )
  42726. if ( ! bool ( __pred ( * __first ) ) )
  42727. {
  42728. * __result = * __first ;
  42729. ++ __result ;
  42730. }
  42731. return __result ;
  42732. }
  42733. #947
  42734. template < typename _InputIterator , typename _OutputIterator ,
  42735. typename _Predicate >
  42736. _OutputIterator
  42737. copy_if ( _InputIterator __first , _InputIterator __last ,
  42738. _OutputIterator __result , _Predicate __pred )
  42739. {
  42740. #959
  42741. ;
  42742.  
  42743. for ( ; __first != __last ; ++ __first )
  42744. if ( __pred ( * __first ) )
  42745. {
  42746. * __result = * __first ;
  42747. ++ __result ;
  42748. }
  42749. return __result ;
  42750. }
  42751.  
  42752.  
  42753. template < typename _InputIterator , typename _Size , typename _OutputIterator >
  42754. _OutputIterator
  42755. __copy_n ( _InputIterator __first , _Size __n ,
  42756. _OutputIterator __result , input_iterator_tag )
  42757. {
  42758. if ( __n > 0 )
  42759. {
  42760. while ( true )
  42761. {
  42762. * __result = * __first ;
  42763. ++ __result ;
  42764. if ( -- __n > 0 )
  42765. ++ __first ;
  42766. else
  42767. break ;
  42768. }
  42769. }
  42770. return __result ;
  42771. }
  42772.  
  42773. template < typename _RandomAccessIterator , typename _Size ,
  42774. typename _OutputIterator >
  42775. inline _OutputIterator
  42776. __copy_n ( _RandomAccessIterator __first , _Size __n ,
  42777. _OutputIterator __result , random_access_iterator_tag )
  42778. { return std :: copy ( __first , __first + __n , __result ) ; }
  42779. #1011
  42780. template < typename _InputIterator , typename _Size , typename _OutputIterator >
  42781. inline _OutputIterator
  42782. copy_n ( _InputIterator __first , _Size __n , _OutputIterator __result )
  42783. {
  42784.  
  42785.  
  42786.  
  42787.  
  42788.  
  42789. return std :: __copy_n ( __first , __n , __result ,
  42790. std :: __iterator_category ( __first ) ) ;
  42791. }
  42792. #1039
  42793. template < typename _InputIterator , typename _OutputIterator1 ,
  42794. typename _OutputIterator2 , typename _Predicate >
  42795. pair < _OutputIterator1 , _OutputIterator2 >
  42796. partition_copy ( _InputIterator __first , _InputIterator __last ,
  42797. _OutputIterator1 __out_true , _OutputIterator2 __out_false ,
  42798. _Predicate __pred )
  42799. {
  42800. #1054
  42801. ;
  42802.  
  42803. for ( ; __first != __last ; ++ __first )
  42804. if ( __pred ( * __first ) )
  42805. {
  42806. * __out_true = * __first ;
  42807. ++ __out_true ;
  42808. }
  42809. else
  42810. {
  42811. * __out_false = * __first ;
  42812. ++ __out_false ;
  42813. }
  42814.  
  42815. return pair < _OutputIterator1 , _OutputIterator2 > ( __out_true , __out_false ) ;
  42816. }
  42817. #1089
  42818. template < typename _ForwardIterator , typename _Tp >
  42819. _ForwardIterator
  42820. remove ( _ForwardIterator __first , _ForwardIterator __last ,
  42821. const _Tp & __value )
  42822. {
  42823.  
  42824.  
  42825.  
  42826.  
  42827.  
  42828. ;
  42829.  
  42830. __first = std :: find ( __first , __last , __value ) ;
  42831. if ( __first == __last )
  42832. return __first ;
  42833. _ForwardIterator __result = __first ;
  42834. ++ __first ;
  42835. for ( ; __first != __last ; ++ __first )
  42836. if ( ! ( * __first == __value ) )
  42837. {
  42838. * __result = std :: move ( * __first ) ;
  42839. ++ __result ;
  42840. }
  42841. return __result ;
  42842. }
  42843. #1132
  42844. template < typename _ForwardIterator , typename _Predicate >
  42845. _ForwardIterator
  42846. remove_if ( _ForwardIterator __first , _ForwardIterator __last ,
  42847. _Predicate __pred )
  42848. {
  42849.  
  42850.  
  42851.  
  42852.  
  42853.  
  42854. ;
  42855.  
  42856. __first = std :: find_if ( __first , __last , __pred ) ;
  42857. if ( __first == __last )
  42858. return __first ;
  42859. _ForwardIterator __result = __first ;
  42860. ++ __first ;
  42861. for ( ; __first != __last ; ++ __first )
  42862. if ( ! bool ( __pred ( * __first ) ) )
  42863. {
  42864. * __result = std :: move ( * __first ) ;
  42865. ++ __result ;
  42866. }
  42867. return __result ;
  42868. }
  42869. #1172
  42870. template < typename _ForwardIterator >
  42871. _ForwardIterator
  42872. unique ( _ForwardIterator __first , _ForwardIterator __last )
  42873. {
  42874.  
  42875.  
  42876.  
  42877.  
  42878.  
  42879. ;
  42880.  
  42881.  
  42882. __first = std :: adjacent_find ( __first , __last ) ;
  42883. if ( __first == __last )
  42884. return __last ;
  42885.  
  42886.  
  42887. _ForwardIterator __dest = __first ;
  42888. ++ __first ;
  42889. while ( ++ __first != __last )
  42890. if ( ! ( * __dest == * __first ) )
  42891. * ++ __dest = std :: move ( * __first ) ;
  42892. return ++ __dest ;
  42893. }
  42894. #1212
  42895. template < typename _ForwardIterator , typename _BinaryPredicate >
  42896. _ForwardIterator
  42897. unique ( _ForwardIterator __first , _ForwardIterator __last ,
  42898. _BinaryPredicate __binary_pred )
  42899. {
  42900. #1223
  42901. ;
  42902.  
  42903.  
  42904. __first = std :: adjacent_find ( __first , __last , __binary_pred ) ;
  42905. if ( __first == __last )
  42906. return __last ;
  42907.  
  42908.  
  42909. _ForwardIterator __dest = __first ;
  42910. ++ __first ;
  42911. while ( ++ __first != __last )
  42912. if ( ! bool ( __binary_pred ( * __dest , * __first ) ) )
  42913. * ++ __dest = std :: move ( * __first ) ;
  42914. return ++ __dest ;
  42915. }
  42916. #1244
  42917. template < typename _ForwardIterator , typename _OutputIterator >
  42918. _OutputIterator
  42919. __unique_copy ( _ForwardIterator __first , _ForwardIterator __last ,
  42920. _OutputIterator __result ,
  42921. forward_iterator_tag , output_iterator_tag )
  42922. {
  42923.  
  42924. _ForwardIterator __next = __first ;
  42925. * __result = * __first ;
  42926. while ( ++ __next != __last )
  42927. if ( ! ( * __first == * __next ) )
  42928. {
  42929. __first = __next ;
  42930. * ++ __result = * __first ;
  42931. }
  42932. return ++ __result ;
  42933. }
  42934. #1267
  42935. template < typename _InputIterator , typename _OutputIterator >
  42936. _OutputIterator
  42937. __unique_copy ( _InputIterator __first , _InputIterator __last ,
  42938. _OutputIterator __result ,
  42939. input_iterator_tag , output_iterator_tag )
  42940. {
  42941.  
  42942. typename iterator_traits < _InputIterator > :: value_type __value = * __first ;
  42943. * __result = __value ;
  42944. while ( ++ __first != __last )
  42945. if ( ! ( __value == * __first ) )
  42946. {
  42947. __value = * __first ;
  42948. * ++ __result = __value ;
  42949. }
  42950. return ++ __result ;
  42951. }
  42952. #1290
  42953. template < typename _InputIterator , typename _ForwardIterator >
  42954. _ForwardIterator
  42955. __unique_copy ( _InputIterator __first , _InputIterator __last ,
  42956. _ForwardIterator __result ,
  42957. input_iterator_tag , forward_iterator_tag )
  42958. {
  42959.  
  42960. * __result = * __first ;
  42961. while ( ++ __first != __last )
  42962. if ( ! ( * __result == * __first ) )
  42963. * ++ __result = * __first ;
  42964. return ++ __result ;
  42965. }
  42966. #1310
  42967. template < typename _ForwardIterator , typename _OutputIterator ,
  42968. typename _BinaryPredicate >
  42969. _OutputIterator
  42970. __unique_copy ( _ForwardIterator __first , _ForwardIterator __last ,
  42971. _OutputIterator __result , _BinaryPredicate __binary_pred ,
  42972. forward_iterator_tag , output_iterator_tag )
  42973. {
  42974.  
  42975.  
  42976.  
  42977.  
  42978.  
  42979. _ForwardIterator __next = __first ;
  42980. * __result = * __first ;
  42981. while ( ++ __next != __last )
  42982. if ( ! bool ( __binary_pred ( * __first , * __next ) ) )
  42983. {
  42984. __first = __next ;
  42985. * ++ __result = * __first ;
  42986. }
  42987. return ++ __result ;
  42988. }
  42989. #1339
  42990. template < typename _InputIterator , typename _OutputIterator ,
  42991. typename _BinaryPredicate >
  42992. _OutputIterator
  42993. __unique_copy ( _InputIterator __first , _InputIterator __last ,
  42994. _OutputIterator __result , _BinaryPredicate __binary_pred ,
  42995. input_iterator_tag , output_iterator_tag )
  42996. {
  42997.  
  42998.  
  42999.  
  43000.  
  43001.  
  43002. typename iterator_traits < _InputIterator > :: value_type __value = * __first ;
  43003. * __result = __value ;
  43004. while ( ++ __first != __last )
  43005. if ( ! bool ( __binary_pred ( __value , * __first ) ) )
  43006. {
  43007. __value = * __first ;
  43008. * ++ __result = __value ;
  43009. }
  43010. return ++ __result ;
  43011. }
  43012. #1368
  43013. template < typename _InputIterator , typename _ForwardIterator ,
  43014. typename _BinaryPredicate >
  43015. _ForwardIterator
  43016. __unique_copy ( _InputIterator __first , _InputIterator __last ,
  43017. _ForwardIterator __result , _BinaryPredicate __binary_pred ,
  43018. input_iterator_tag , forward_iterator_tag )
  43019. {
  43020.  
  43021.  
  43022.  
  43023.  
  43024.  
  43025. * __result = * __first ;
  43026. while ( ++ __first != __last )
  43027. if ( ! bool ( __binary_pred ( * __result , * __first ) ) )
  43028. * ++ __result = * __first ;
  43029. return ++ __result ;
  43030. }
  43031. #1392
  43032. template < typename _BidirectionalIterator >
  43033. void
  43034. __reverse ( _BidirectionalIterator __first , _BidirectionalIterator __last ,
  43035. bidirectional_iterator_tag )
  43036. {
  43037. while ( true )
  43038. if ( __first == __last || __first == -- __last )
  43039. return ;
  43040. else
  43041. {
  43042. std :: iter_swap ( __first , __last ) ;
  43043. ++ __first ;
  43044. }
  43045. }
  43046. #1412
  43047. template < typename _RandomAccessIterator >
  43048. void
  43049. __reverse ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  43050. random_access_iterator_tag )
  43051. {
  43052. if ( __first == __last )
  43053. return ;
  43054. -- __last ;
  43055. while ( __first < __last )
  43056. {
  43057. std :: iter_swap ( __first , __last ) ;
  43058. ++ __first ;
  43059. -- __last ;
  43060. }
  43061. }
  43062. #1440
  43063. template < typename _BidirectionalIterator >
  43064. inline void
  43065. reverse ( _BidirectionalIterator __first , _BidirectionalIterator __last )
  43066. {
  43067.  
  43068.  
  43069.  
  43070. ;
  43071. std :: __reverse ( __first , __last , std :: __iterator_category ( __first ) ) ;
  43072. }
  43073. #1467
  43074. template < typename _BidirectionalIterator , typename _OutputIterator >
  43075. _OutputIterator
  43076. reverse_copy ( _BidirectionalIterator __first , _BidirectionalIterator __last ,
  43077. _OutputIterator __result )
  43078. {
  43079.  
  43080.  
  43081.  
  43082.  
  43083.  
  43084. ;
  43085.  
  43086. while ( __first != __last )
  43087. {
  43088. -- __last ;
  43089. * __result = * __last ;
  43090. ++ __result ;
  43091. }
  43092. return __result ;
  43093. }
  43094.  
  43095.  
  43096.  
  43097.  
  43098.  
  43099. template < typename _EuclideanRingElement >
  43100. _EuclideanRingElement
  43101. __gcd ( _EuclideanRingElement __m , _EuclideanRingElement __n )
  43102. {
  43103. while ( __n != 0 )
  43104. {
  43105. _EuclideanRingElement __t = __m % __n ;
  43106. __m = __n ;
  43107. __n = __t ;
  43108. }
  43109. return __m ;
  43110. }
  43111.  
  43112.  
  43113. template < typename _ForwardIterator >
  43114. void
  43115. __rotate ( _ForwardIterator __first ,
  43116. _ForwardIterator __middle ,
  43117. _ForwardIterator __last ,
  43118. forward_iterator_tag )
  43119. {
  43120. if ( __first == __middle || __last == __middle )
  43121. return ;
  43122.  
  43123. _ForwardIterator __first2 = __middle ;
  43124. do
  43125. {
  43126. std :: iter_swap ( __first , __first2 ) ;
  43127. ++ __first ;
  43128. ++ __first2 ;
  43129. if ( __first == __middle )
  43130. __middle = __first2 ;
  43131. }
  43132. while ( __first2 != __last ) ;
  43133.  
  43134. __first2 = __middle ;
  43135.  
  43136. while ( __first2 != __last )
  43137. {
  43138. std :: iter_swap ( __first , __first2 ) ;
  43139. ++ __first ;
  43140. ++ __first2 ;
  43141. if ( __first == __middle )
  43142. __middle = __first2 ;
  43143. else if ( __first2 == __last )
  43144. __first2 = __middle ;
  43145. }
  43146. }
  43147.  
  43148.  
  43149. template < typename _BidirectionalIterator >
  43150. void
  43151. __rotate ( _BidirectionalIterator __first ,
  43152. _BidirectionalIterator __middle ,
  43153. _BidirectionalIterator __last ,
  43154. bidirectional_iterator_tag )
  43155. {
  43156.  
  43157.  
  43158.  
  43159.  
  43160. if ( __first == __middle || __last == __middle )
  43161. return ;
  43162.  
  43163. std :: __reverse ( __first , __middle , bidirectional_iterator_tag ( ) ) ;
  43164. std :: __reverse ( __middle , __last , bidirectional_iterator_tag ( ) ) ;
  43165.  
  43166. while ( __first != __middle && __middle != __last )
  43167. {
  43168. std :: iter_swap ( __first , -- __last ) ;
  43169. ++ __first ;
  43170. }
  43171.  
  43172. if ( __first == __middle )
  43173. std :: __reverse ( __middle , __last , bidirectional_iterator_tag ( ) ) ;
  43174. else
  43175. std :: __reverse ( __first , __middle , bidirectional_iterator_tag ( ) ) ;
  43176. }
  43177.  
  43178.  
  43179. template < typename _RandomAccessIterator >
  43180. void
  43181. __rotate ( _RandomAccessIterator __first ,
  43182. _RandomAccessIterator __middle ,
  43183. _RandomAccessIterator __last ,
  43184. random_access_iterator_tag )
  43185. {
  43186.  
  43187.  
  43188.  
  43189.  
  43190. if ( __first == __middle || __last == __middle )
  43191. return ;
  43192.  
  43193. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  43194. _Distance ;
  43195. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43196. _ValueType ;
  43197.  
  43198. _Distance __n = __last - __first ;
  43199. _Distance __k = __middle - __first ;
  43200.  
  43201. if ( __k == __n - __k )
  43202. {
  43203. std :: swap_ranges ( __first , __middle , __middle ) ;
  43204. return ;
  43205. }
  43206.  
  43207. _RandomAccessIterator __p = __first ;
  43208.  
  43209. for ( ; ; )
  43210. {
  43211. if ( __k < __n - __k )
  43212. {
  43213. if ( __oracle_is_pod ( _ValueType ) && __k == 1 )
  43214. {
  43215. _ValueType __t = std :: move ( * __p ) ;
  43216. std :: move ( __p + 1 , __p + __n , __p ) ;
  43217. * ( __p + __n - 1 ) = std :: move ( __t ) ;
  43218. return ;
  43219. }
  43220. _RandomAccessIterator __q = __p + __k ;
  43221. for ( _Distance __i = 0 ; __i < __n - __k ; ++ __i )
  43222. {
  43223. std :: iter_swap ( __p , __q ) ;
  43224. ++ __p ;
  43225. ++ __q ;
  43226. }
  43227. __n %= __k ;
  43228. if ( __n == 0 )
  43229. return ;
  43230. std :: swap ( __n , __k ) ;
  43231. __k = __n - __k ;
  43232. }
  43233. else
  43234. {
  43235. __k = __n - __k ;
  43236. if ( __oracle_is_pod ( _ValueType ) && __k == 1 )
  43237. {
  43238. _ValueType __t = std :: move ( * ( __p + __n - 1 ) ) ;
  43239. std :: move_backward ( __p , __p + __n - 1 , __p + __n ) ;
  43240. * __p = std :: move ( __t ) ;
  43241. return ;
  43242. }
  43243. _RandomAccessIterator __q = __p + __n ;
  43244. __p = __q - __k ;
  43245. for ( _Distance __i = 0 ; __i < __n - __k ; ++ __i )
  43246. {
  43247. -- __p ;
  43248. -- __q ;
  43249. std :: iter_swap ( __p , __q ) ;
  43250. }
  43251. __n %= __k ;
  43252. if ( __n == 0 )
  43253. return ;
  43254. std :: swap ( __n , __k ) ;
  43255. }
  43256. }
  43257. }
  43258. #1673
  43259. template < typename _ForwardIterator >
  43260. inline void
  43261. rotate ( _ForwardIterator __first , _ForwardIterator __middle ,
  43262. _ForwardIterator __last )
  43263. {
  43264.  
  43265.  
  43266.  
  43267. ;
  43268. ;
  43269.  
  43270. typedef typename iterator_traits < _ForwardIterator > :: iterator_category
  43271. _IterType ;
  43272. std :: __rotate ( __first , __middle , __last , _IterType ( ) ) ;
  43273. }
  43274. #1709
  43275. template < typename _ForwardIterator , typename _OutputIterator >
  43276. _OutputIterator
  43277. rotate_copy ( _ForwardIterator __first , _ForwardIterator __middle ,
  43278. _ForwardIterator __last , _OutputIterator __result )
  43279. {
  43280.  
  43281.  
  43282.  
  43283.  
  43284. ;
  43285. ;
  43286.  
  43287. return std :: copy ( __first , __middle ,
  43288. std :: copy ( __middle , __last , __result ) ) ;
  43289. }
  43290.  
  43291.  
  43292. template < typename _ForwardIterator , typename _Predicate >
  43293. _ForwardIterator
  43294. __partition ( _ForwardIterator __first , _ForwardIterator __last ,
  43295. _Predicate __pred , forward_iterator_tag )
  43296. {
  43297. if ( __first == __last )
  43298. return __first ;
  43299.  
  43300. while ( __pred ( * __first ) )
  43301. if ( ++ __first == __last )
  43302. return __first ;
  43303.  
  43304. _ForwardIterator __next = __first ;
  43305.  
  43306. while ( ++ __next != __last )
  43307. if ( __pred ( * __next ) )
  43308. {
  43309. std :: iter_swap ( __first , __next ) ;
  43310. ++ __first ;
  43311. }
  43312.  
  43313. return __first ;
  43314. }
  43315.  
  43316.  
  43317. template < typename _BidirectionalIterator , typename _Predicate >
  43318. _BidirectionalIterator
  43319. __partition ( _BidirectionalIterator __first , _BidirectionalIterator __last ,
  43320. _Predicate __pred , bidirectional_iterator_tag )
  43321. {
  43322. while ( true )
  43323. {
  43324. while ( true )
  43325. if ( __first == __last )
  43326. return __first ;
  43327. else if ( __pred ( * __first ) )
  43328. ++ __first ;
  43329. else
  43330. break ;
  43331. -- __last ;
  43332. while ( true )
  43333. if ( __first == __last )
  43334. return __first ;
  43335. else if ( ! bool ( __pred ( * __last ) ) )
  43336. -- __last ;
  43337. else
  43338. break ;
  43339. std :: iter_swap ( __first , __last ) ;
  43340. ++ __first ;
  43341. }
  43342. }
  43343. #1783
  43344. template < typename _ForwardIterator , typename _Predicate , typename _Distance >
  43345. _ForwardIterator
  43346. __inplace_stable_partition ( _ForwardIterator __first ,
  43347. _Predicate __pred , _Distance __len )
  43348. {
  43349. if ( __len == 1 )
  43350. return __first ;
  43351. _ForwardIterator __middle = __first ;
  43352. std :: advance ( __middle , __len / 2 ) ;
  43353. _ForwardIterator __left_split =
  43354. std :: __inplace_stable_partition ( __first , __pred , __len / 2 ) ;
  43355.  
  43356.  
  43357. _Distance __right_len = __len - __len / 2 ;
  43358. _ForwardIterator __right_split =
  43359. std :: __find_if_not_n ( __middle , __right_len , __pred ) ;
  43360. if ( __right_len )
  43361. __right_split = std :: __inplace_stable_partition ( __middle ,
  43362. __pred ,
  43363. __right_len ) ;
  43364. std :: rotate ( __left_split , __middle , __right_split ) ;
  43365. std :: advance ( __left_split , std :: distance ( __middle , __right_split ) ) ;
  43366. return __left_split ;
  43367. }
  43368. #1814
  43369. template < typename _ForwardIterator , typename _Pointer , typename _Predicate ,
  43370. typename _Distance >
  43371. _ForwardIterator
  43372. __stable_partition_adaptive ( _ForwardIterator __first ,
  43373. _ForwardIterator __last ,
  43374. _Predicate __pred , _Distance __len ,
  43375. _Pointer __buffer ,
  43376. _Distance __buffer_size )
  43377. {
  43378. if ( __len <= __buffer_size )
  43379. {
  43380. _ForwardIterator __result1 = __first ;
  43381. _Pointer __result2 = __buffer ;
  43382.  
  43383.  
  43384.  
  43385. * __result2 = std :: move ( * __first ) ;
  43386. ++ __result2 ;
  43387. ++ __first ;
  43388. for ( ; __first != __last ; ++ __first )
  43389. if ( __pred ( * __first ) )
  43390. {
  43391. * __result1 = std :: move ( * __first ) ;
  43392. ++ __result1 ;
  43393. }
  43394. else
  43395. {
  43396. * __result2 = std :: move ( * __first ) ;
  43397. ++ __result2 ;
  43398. }
  43399. std :: move ( __buffer , __result2 , __result1 ) ;
  43400. return __result1 ;
  43401. }
  43402. else
  43403. {
  43404. _ForwardIterator __middle = __first ;
  43405. std :: advance ( __middle , __len / 2 ) ;
  43406. _ForwardIterator __left_split =
  43407. std :: __stable_partition_adaptive ( __first , __middle , __pred ,
  43408. __len / 2 , __buffer ,
  43409. __buffer_size ) ;
  43410.  
  43411.  
  43412. _Distance __right_len = __len - __len / 2 ;
  43413. _ForwardIterator __right_split =
  43414. std :: __find_if_not_n ( __middle , __right_len , __pred ) ;
  43415. if ( __right_len )
  43416. __right_split =
  43417. std :: __stable_partition_adaptive ( __right_split , __last , __pred ,
  43418. __right_len ,
  43419. __buffer , __buffer_size ) ;
  43420. std :: rotate ( __left_split , __middle , __right_split ) ;
  43421. std :: advance ( __left_split , std :: distance ( __middle , __right_split ) ) ;
  43422. return __left_split ;
  43423. }
  43424. }
  43425. #1888
  43426. template < typename _ForwardIterator , typename _Predicate >
  43427. _ForwardIterator
  43428. stable_partition ( _ForwardIterator __first , _ForwardIterator __last ,
  43429. _Predicate __pred )
  43430. {
  43431.  
  43432.  
  43433.  
  43434.  
  43435.  
  43436. ;
  43437.  
  43438. __first = std :: __find_if_not ( __first , __last , __pred ) ;
  43439.  
  43440. if ( __first == __last )
  43441. return __first ;
  43442. else
  43443. {
  43444. typedef typename iterator_traits < _ForwardIterator > :: value_type
  43445. _ValueType ;
  43446. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  43447. _DistanceType ;
  43448.  
  43449. _Temporary_buffer < _ForwardIterator , _ValueType > __buf ( __first ,
  43450. __last ) ;
  43451. if ( __buf . size ( ) > 0 )
  43452. return
  43453. std :: __stable_partition_adaptive ( __first , __last , __pred ,
  43454. _DistanceType ( __buf . requested_size ( ) ) ,
  43455. __buf . begin ( ) ,
  43456. _DistanceType ( __buf . size ( ) ) ) ;
  43457. else
  43458. return
  43459. std :: __inplace_stable_partition ( __first , __pred ,
  43460. _DistanceType ( __buf . requested_size ( ) ) ) ;
  43461. }
  43462. }
  43463.  
  43464.  
  43465. template < typename _RandomAccessIterator >
  43466. void
  43467. __heap_select ( _RandomAccessIterator __first ,
  43468. _RandomAccessIterator __middle ,
  43469. _RandomAccessIterator __last )
  43470. {
  43471. std :: make_heap ( __first , __middle ) ;
  43472. for ( _RandomAccessIterator __i = __middle ; __i < __last ; ++ __i )
  43473. if ( * __i < * __first )
  43474. std :: __pop_heap ( __first , __middle , __i ) ;
  43475. }
  43476.  
  43477.  
  43478. template < typename _RandomAccessIterator , typename _Compare >
  43479. void
  43480. __heap_select ( _RandomAccessIterator __first ,
  43481. _RandomAccessIterator __middle ,
  43482. _RandomAccessIterator __last , _Compare __comp )
  43483. {
  43484. std :: make_heap ( __first , __middle , __comp ) ;
  43485. for ( _RandomAccessIterator __i = __middle ; __i < __last ; ++ __i )
  43486. if ( __comp ( * __i , * __first ) )
  43487. std :: __pop_heap ( __first , __middle , __i , __comp ) ;
  43488. }
  43489. #1972
  43490. template < typename _InputIterator , typename _RandomAccessIterator >
  43491. _RandomAccessIterator
  43492. partial_sort_copy ( _InputIterator __first , _InputIterator __last ,
  43493. _RandomAccessIterator __result_first ,
  43494. _RandomAccessIterator __result_last )
  43495. {
  43496. typedef typename iterator_traits < _InputIterator > :: value_type
  43497. _InputValueType ;
  43498. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43499. _OutputValueType ;
  43500. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  43501. _DistanceType ;
  43502. #1992
  43503. ;
  43504. ;
  43505.  
  43506. if ( __result_first == __result_last )
  43507. return __result_last ;
  43508. _RandomAccessIterator __result_real_last = __result_first ;
  43509. while ( __first != __last && __result_real_last != __result_last )
  43510. {
  43511. * __result_real_last = * __first ;
  43512. ++ __result_real_last ;
  43513. ++ __first ;
  43514. }
  43515. std :: make_heap ( __result_first , __result_real_last ) ;
  43516. while ( __first != __last )
  43517. {
  43518. if ( * __first < * __result_first )
  43519. std :: __adjust_heap ( __result_first , _DistanceType ( 0 ) ,
  43520. _DistanceType ( __result_real_last
  43521. - __result_first ) ,
  43522. _InputValueType ( * __first ) ) ;
  43523. ++ __first ;
  43524. }
  43525. std :: sort_heap ( __result_first , __result_real_last ) ;
  43526. return __result_real_last ;
  43527. }
  43528. #2038
  43529. template < typename _InputIterator , typename _RandomAccessIterator , typename _Compare >
  43530. _RandomAccessIterator
  43531. partial_sort_copy ( _InputIterator __first , _InputIterator __last ,
  43532. _RandomAccessIterator __result_first ,
  43533. _RandomAccessIterator __result_last ,
  43534. _Compare __comp )
  43535. {
  43536. typedef typename iterator_traits < _InputIterator > :: value_type
  43537. _InputValueType ;
  43538. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43539. _OutputValueType ;
  43540. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  43541. _DistanceType ;
  43542. #2062
  43543. ;
  43544. ;
  43545.  
  43546. if ( __result_first == __result_last )
  43547. return __result_last ;
  43548. _RandomAccessIterator __result_real_last = __result_first ;
  43549. while ( __first != __last && __result_real_last != __result_last )
  43550. {
  43551. * __result_real_last = * __first ;
  43552. ++ __result_real_last ;
  43553. ++ __first ;
  43554. }
  43555. std :: make_heap ( __result_first , __result_real_last , __comp ) ;
  43556. while ( __first != __last )
  43557. {
  43558. if ( __comp ( * __first , * __result_first ) )
  43559. std :: __adjust_heap ( __result_first , _DistanceType ( 0 ) ,
  43560. _DistanceType ( __result_real_last
  43561. - __result_first ) ,
  43562. _InputValueType ( * __first ) ,
  43563. __comp ) ;
  43564. ++ __first ;
  43565. }
  43566. std :: sort_heap ( __result_first , __result_real_last , __comp ) ;
  43567. return __result_real_last ;
  43568. }
  43569.  
  43570.  
  43571. template < typename _RandomAccessIterator >
  43572. void
  43573. __unguarded_linear_insert ( _RandomAccessIterator __last )
  43574. {
  43575. typename iterator_traits < _RandomAccessIterator > :: value_type
  43576. __val = std :: move ( * __last ) ;
  43577. _RandomAccessIterator __next = __last ;
  43578. -- __next ;
  43579. while ( __val < * __next )
  43580. {
  43581. * __last = std :: move ( * __next ) ;
  43582. __last = __next ;
  43583. -- __next ;
  43584. }
  43585. * __last = std :: move ( __val ) ;
  43586. }
  43587.  
  43588.  
  43589. template < typename _RandomAccessIterator , typename _Compare >
  43590. void
  43591. __unguarded_linear_insert ( _RandomAccessIterator __last ,
  43592. _Compare __comp )
  43593. {
  43594. typename iterator_traits < _RandomAccessIterator > :: value_type
  43595. __val = std :: move ( * __last ) ;
  43596. _RandomAccessIterator __next = __last ;
  43597. -- __next ;
  43598. while ( __comp ( __val , * __next ) )
  43599. {
  43600. * __last = std :: move ( * __next ) ;
  43601. __last = __next ;
  43602. -- __next ;
  43603. }
  43604. * __last = std :: move ( __val ) ;
  43605. }
  43606.  
  43607.  
  43608. template < typename _RandomAccessIterator >
  43609. void
  43610. __insertion_sort ( _RandomAccessIterator __first ,
  43611. _RandomAccessIterator __last )
  43612. {
  43613. if ( __first == __last )
  43614. return ;
  43615.  
  43616. for ( _RandomAccessIterator __i = __first + 1 ; __i != __last ; ++ __i )
  43617. {
  43618. if ( * __i < * __first )
  43619. {
  43620. typename iterator_traits < _RandomAccessIterator > :: value_type
  43621. __val = std :: move ( * __i ) ;
  43622. std :: move_backward ( __first , __i , __i + 1 ) ;
  43623. * __first = std :: move ( __val ) ;
  43624. }
  43625. else
  43626. std :: __unguarded_linear_insert ( __i ) ;
  43627. }
  43628. }
  43629.  
  43630.  
  43631. template < typename _RandomAccessIterator , typename _Compare >
  43632. void
  43633. __insertion_sort ( _RandomAccessIterator __first ,
  43634. _RandomAccessIterator __last , _Compare __comp )
  43635. {
  43636. if ( __first == __last ) return ;
  43637.  
  43638. for ( _RandomAccessIterator __i = __first + 1 ; __i != __last ; ++ __i )
  43639. {
  43640. if ( __comp ( * __i , * __first ) )
  43641. {
  43642. typename iterator_traits < _RandomAccessIterator > :: value_type
  43643. __val = std :: move ( * __i ) ;
  43644. std :: move_backward ( __first , __i , __i + 1 ) ;
  43645. * __first = std :: move ( __val ) ;
  43646. }
  43647. else
  43648. std :: __unguarded_linear_insert ( __i , __comp ) ;
  43649. }
  43650. }
  43651.  
  43652.  
  43653. template < typename _RandomAccessIterator >
  43654. inline void
  43655. __unguarded_insertion_sort ( _RandomAccessIterator __first ,
  43656. _RandomAccessIterator __last )
  43657. {
  43658. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43659. _ValueType ;
  43660.  
  43661. for ( _RandomAccessIterator __i = __first ; __i != __last ; ++ __i )
  43662. std :: __unguarded_linear_insert ( __i ) ;
  43663. }
  43664.  
  43665.  
  43666. template < typename _RandomAccessIterator , typename _Compare >
  43667. inline void
  43668. __unguarded_insertion_sort ( _RandomAccessIterator __first ,
  43669. _RandomAccessIterator __last , _Compare __comp )
  43670. {
  43671. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43672. _ValueType ;
  43673.  
  43674. for ( _RandomAccessIterator __i = __first ; __i != __last ; ++ __i )
  43675. std :: __unguarded_linear_insert ( __i , __comp ) ;
  43676. }
  43677.  
  43678.  
  43679.  
  43680.  
  43681.  
  43682. enum { _S_threshold = 16 } ;
  43683.  
  43684.  
  43685. template < typename _RandomAccessIterator >
  43686. void
  43687. __final_insertion_sort ( _RandomAccessIterator __first ,
  43688. _RandomAccessIterator __last )
  43689. {
  43690. if ( __last - __first > int ( _S_threshold ) )
  43691. {
  43692. std :: __insertion_sort ( __first , __first + int ( _S_threshold ) ) ;
  43693. std :: __unguarded_insertion_sort ( __first + int ( _S_threshold ) , __last ) ;
  43694. }
  43695. else
  43696. std :: __insertion_sort ( __first , __last ) ;
  43697. }
  43698.  
  43699.  
  43700. template < typename _RandomAccessIterator , typename _Compare >
  43701. void
  43702. __final_insertion_sort ( _RandomAccessIterator __first ,
  43703. _RandomAccessIterator __last , _Compare __comp )
  43704. {
  43705. if ( __last - __first > int ( _S_threshold ) )
  43706. {
  43707. std :: __insertion_sort ( __first , __first + int ( _S_threshold ) , __comp ) ;
  43708. std :: __unguarded_insertion_sort ( __first + int ( _S_threshold ) , __last ,
  43709. __comp ) ;
  43710. }
  43711. else
  43712. std :: __insertion_sort ( __first , __last , __comp ) ;
  43713. }
  43714.  
  43715.  
  43716. template < typename _RandomAccessIterator , typename _Tp >
  43717. _RandomAccessIterator
  43718. __unguarded_partition ( _RandomAccessIterator __first ,
  43719. _RandomAccessIterator __last , const _Tp & __pivot )
  43720. {
  43721. while ( true )
  43722. {
  43723. while ( * __first < __pivot )
  43724. ++ __first ;
  43725. -- __last ;
  43726. while ( __pivot < * __last )
  43727. -- __last ;
  43728. if ( ! ( __first < __last ) )
  43729. return __first ;
  43730. std :: iter_swap ( __first , __last ) ;
  43731. ++ __first ;
  43732. }
  43733. }
  43734.  
  43735.  
  43736. template < typename _RandomAccessIterator , typename _Tp , typename _Compare >
  43737. _RandomAccessIterator
  43738. __unguarded_partition ( _RandomAccessIterator __first ,
  43739. _RandomAccessIterator __last ,
  43740. const _Tp & __pivot , _Compare __comp )
  43741. {
  43742. while ( true )
  43743. {
  43744. while ( __comp ( * __first , __pivot ) )
  43745. ++ __first ;
  43746. -- __last ;
  43747. while ( __comp ( __pivot , * __last ) )
  43748. -- __last ;
  43749. if ( ! ( __first < __last ) )
  43750. return __first ;
  43751. std :: iter_swap ( __first , __last ) ;
  43752. ++ __first ;
  43753. }
  43754. }
  43755.  
  43756.  
  43757. template < typename _RandomAccessIterator >
  43758. inline _RandomAccessIterator
  43759. __unguarded_partition_pivot ( _RandomAccessIterator __first ,
  43760. _RandomAccessIterator __last )
  43761. {
  43762. _RandomAccessIterator __mid = __first + ( __last - __first ) / 2 ;
  43763. std :: __move_median_to_first ( __first , __first + 1 , __mid , ( __last - 2 ) ) ;
  43764. return std :: __unguarded_partition ( __first + 1 , __last , * __first ) ;
  43765. }
  43766.  
  43767.  
  43768.  
  43769. template < typename _RandomAccessIterator , typename _Compare >
  43770. inline _RandomAccessIterator
  43771. __unguarded_partition_pivot ( _RandomAccessIterator __first ,
  43772. _RandomAccessIterator __last , _Compare __comp )
  43773. {
  43774. _RandomAccessIterator __mid = __first + ( __last - __first ) / 2 ;
  43775. std :: __move_median_to_first ( __first , __first + 1 , __mid , ( __last - 2 ) ,
  43776. __comp ) ;
  43777. return std :: __unguarded_partition ( __first + 1 , __last , * __first , __comp ) ;
  43778. }
  43779.  
  43780.  
  43781. template < typename _RandomAccessIterator , typename _Size >
  43782. void
  43783. __introsort_loop ( _RandomAccessIterator __first ,
  43784. _RandomAccessIterator __last ,
  43785. _Size __depth_limit )
  43786. {
  43787. while ( __last - __first > int ( _S_threshold ) )
  43788. {
  43789. if ( __depth_limit == 0 )
  43790. {
  43791. std :: partial_sort ( __first , __last , __last ) ;
  43792. return ;
  43793. }
  43794. -- __depth_limit ;
  43795. _RandomAccessIterator __cut =
  43796. std :: __unguarded_partition_pivot ( __first , __last ) ;
  43797. std :: __introsort_loop ( __cut , __last , __depth_limit ) ;
  43798. __last = __cut ;
  43799. }
  43800. }
  43801.  
  43802.  
  43803. template < typename _RandomAccessIterator , typename _Size , typename _Compare >
  43804. void
  43805. __introsort_loop ( _RandomAccessIterator __first ,
  43806. _RandomAccessIterator __last ,
  43807. _Size __depth_limit , _Compare __comp )
  43808. {
  43809. while ( __last - __first > int ( _S_threshold ) )
  43810. {
  43811. if ( __depth_limit == 0 )
  43812. {
  43813. std :: partial_sort ( __first , __last , __last , __comp ) ;
  43814. return ;
  43815. }
  43816. -- __depth_limit ;
  43817. _RandomAccessIterator __cut =
  43818. std :: __unguarded_partition_pivot ( __first , __last , __comp ) ;
  43819. std :: __introsort_loop ( __cut , __last , __depth_limit , __comp ) ;
  43820. __last = __cut ;
  43821. }
  43822. }
  43823.  
  43824.  
  43825.  
  43826. template < typename _RandomAccessIterator , typename _Size >
  43827. void
  43828. __introselect ( _RandomAccessIterator __first , _RandomAccessIterator __nth ,
  43829. _RandomAccessIterator __last , _Size __depth_limit )
  43830. {
  43831. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43832. _ValueType ;
  43833.  
  43834. while ( __last - __first > 3 )
  43835. {
  43836. if ( __depth_limit == 0 )
  43837. {
  43838. std :: __heap_select ( __first , __nth + 1 , __last ) ;
  43839.  
  43840.  
  43841. std :: iter_swap ( __first , __nth ) ;
  43842. return ;
  43843. }
  43844. -- __depth_limit ;
  43845. _RandomAccessIterator __cut =
  43846. std :: __unguarded_partition_pivot ( __first , __last ) ;
  43847. if ( __cut <= __nth )
  43848. __first = __cut ;
  43849. else
  43850. __last = __cut ;
  43851. }
  43852. std :: __insertion_sort ( __first , __last ) ;
  43853. }
  43854.  
  43855. template < typename _RandomAccessIterator , typename _Size , typename _Compare >
  43856. void
  43857. __introselect ( _RandomAccessIterator __first , _RandomAccessIterator __nth ,
  43858. _RandomAccessIterator __last , _Size __depth_limit ,
  43859. _Compare __comp )
  43860. {
  43861. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  43862. _ValueType ;
  43863.  
  43864. while ( __last - __first > 3 )
  43865. {
  43866. if ( __depth_limit == 0 )
  43867. {
  43868. std :: __heap_select ( __first , __nth + 1 , __last , __comp ) ;
  43869.  
  43870. std :: iter_swap ( __first , __nth ) ;
  43871. return ;
  43872. }
  43873. -- __depth_limit ;
  43874. _RandomAccessIterator __cut =
  43875. std :: __unguarded_partition_pivot ( __first , __last , __comp ) ;
  43876. if ( __cut <= __nth )
  43877. __first = __cut ;
  43878. else
  43879. __last = __cut ;
  43880. }
  43881. std :: __insertion_sort ( __first , __last , __comp ) ;
  43882. }
  43883. #2423
  43884. template < typename _ForwardIterator , typename _Tp , typename _Compare >
  43885. _ForwardIterator
  43886. lower_bound ( _ForwardIterator __first , _ForwardIterator __last ,
  43887. const _Tp & __val , _Compare __comp )
  43888. {
  43889. typedef typename iterator_traits < _ForwardIterator > :: value_type
  43890. _ValueType ;
  43891. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  43892. _DistanceType ;
  43893. #2438
  43894. ;
  43895.  
  43896. _DistanceType __len = std :: distance ( __first , __last ) ;
  43897.  
  43898. while ( __len > 0 )
  43899. {
  43900. _DistanceType __half = __len >> 1 ;
  43901. _ForwardIterator __middle = __first ;
  43902. std :: advance ( __middle , __half ) ;
  43903. if ( __comp ( * __middle , __val ) )
  43904. {
  43905. __first = __middle ;
  43906. ++ __first ;
  43907. __len = __len - __half - 1 ;
  43908. }
  43909. else
  43910. __len = __half ;
  43911. }
  43912. return __first ;
  43913. }
  43914. #2470
  43915. template < typename _ForwardIterator , typename _Tp >
  43916. _ForwardIterator
  43917. upper_bound ( _ForwardIterator __first , _ForwardIterator __last ,
  43918. const _Tp & __val )
  43919. {
  43920. typedef typename iterator_traits < _ForwardIterator > :: value_type
  43921. _ValueType ;
  43922. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  43923. _DistanceType ;
  43924.  
  43925.  
  43926.  
  43927.  
  43928. ;
  43929.  
  43930. _DistanceType __len = std :: distance ( __first , __last ) ;
  43931.  
  43932. while ( __len > 0 )
  43933. {
  43934. _DistanceType __half = __len >> 1 ;
  43935. _ForwardIterator __middle = __first ;
  43936. std :: advance ( __middle , __half ) ;
  43937. if ( __val < * __middle )
  43938. __len = __half ;
  43939. else
  43940. {
  43941. __first = __middle ;
  43942. ++ __first ;
  43943. __len = __len - __half - 1 ;
  43944. }
  43945. }
  43946. return __first ;
  43947. }
  43948. #2519
  43949. template < typename _ForwardIterator , typename _Tp , typename _Compare >
  43950. _ForwardIterator
  43951. upper_bound ( _ForwardIterator __first , _ForwardIterator __last ,
  43952. const _Tp & __val , _Compare __comp )
  43953. {
  43954. typedef typename iterator_traits < _ForwardIterator > :: value_type
  43955. _ValueType ;
  43956. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  43957. _DistanceType ;
  43958. #2534
  43959. ;
  43960.  
  43961. _DistanceType __len = std :: distance ( __first , __last ) ;
  43962.  
  43963. while ( __len > 0 )
  43964. {
  43965. _DistanceType __half = __len >> 1 ;
  43966. _ForwardIterator __middle = __first ;
  43967. std :: advance ( __middle , __half ) ;
  43968. if ( __comp ( __val , * __middle ) )
  43969. __len = __half ;
  43970. else
  43971. {
  43972. __first = __middle ;
  43973. ++ __first ;
  43974. __len = __len - __half - 1 ;
  43975. }
  43976. }
  43977. return __first ;
  43978. }
  43979. #2572
  43980. template < typename _ForwardIterator , typename _Tp >
  43981. pair < _ForwardIterator , _ForwardIterator >
  43982. equal_range ( _ForwardIterator __first , _ForwardIterator __last ,
  43983. const _Tp & __val )
  43984. {
  43985. typedef typename iterator_traits < _ForwardIterator > :: value_type
  43986. _ValueType ;
  43987. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  43988. _DistanceType ;
  43989.  
  43990.  
  43991.  
  43992.  
  43993.  
  43994. ;
  43995. ;
  43996.  
  43997. _DistanceType __len = std :: distance ( __first , __last ) ;
  43998.  
  43999. while ( __len > 0 )
  44000. {
  44001. _DistanceType __half = __len >> 1 ;
  44002. _ForwardIterator __middle = __first ;
  44003. std :: advance ( __middle , __half ) ;
  44004. if ( * __middle < __val )
  44005. {
  44006. __first = __middle ;
  44007. ++ __first ;
  44008. __len = __len - __half - 1 ;
  44009. }
  44010. else if ( __val < * __middle )
  44011. __len = __half ;
  44012. else
  44013. {
  44014. _ForwardIterator __left = std :: lower_bound ( __first , __middle ,
  44015. __val ) ;
  44016. std :: advance ( __first , __len ) ;
  44017. _ForwardIterator __right = std :: upper_bound ( ++ __middle , __first ,
  44018. __val ) ;
  44019. return pair < _ForwardIterator , _ForwardIterator > ( __left , __right ) ;
  44020. }
  44021. }
  44022. return pair < _ForwardIterator , _ForwardIterator > ( __first , __first ) ;
  44023. }
  44024. #2634
  44025. template < typename _ForwardIterator , typename _Tp , typename _Compare >
  44026. pair < _ForwardIterator , _ForwardIterator >
  44027. equal_range ( _ForwardIterator __first , _ForwardIterator __last ,
  44028. const _Tp & __val , _Compare __comp )
  44029. {
  44030. typedef typename iterator_traits < _ForwardIterator > :: value_type
  44031. _ValueType ;
  44032. typedef typename iterator_traits < _ForwardIterator > :: difference_type
  44033. _DistanceType ;
  44034. #2651
  44035. ;
  44036.  
  44037. ;
  44038.  
  44039. _DistanceType __len = std :: distance ( __first , __last ) ;
  44040.  
  44041. while ( __len > 0 )
  44042. {
  44043. _DistanceType __half = __len >> 1 ;
  44044. _ForwardIterator __middle = __first ;
  44045. std :: advance ( __middle , __half ) ;
  44046. if ( __comp ( * __middle , __val ) )
  44047. {
  44048. __first = __middle ;
  44049. ++ __first ;
  44050. __len = __len - __half - 1 ;
  44051. }
  44052. else if ( __comp ( __val , * __middle ) )
  44053. __len = __half ;
  44054. else
  44055. {
  44056. _ForwardIterator __left = std :: lower_bound ( __first , __middle ,
  44057. __val , __comp ) ;
  44058. std :: advance ( __first , __len ) ;
  44059. _ForwardIterator __right = std :: upper_bound ( ++ __middle , __first ,
  44060. __val , __comp ) ;
  44061. return pair < _ForwardIterator , _ForwardIterator > ( __left , __right ) ;
  44062. }
  44063. }
  44064. return pair < _ForwardIterator , _ForwardIterator > ( __first , __first ) ;
  44065. }
  44066. #2695
  44067. template < typename _ForwardIterator , typename _Tp >
  44068. bool
  44069. binary_search ( _ForwardIterator __first , _ForwardIterator __last ,
  44070. const _Tp & __val )
  44071. {
  44072. typedef typename iterator_traits < _ForwardIterator > :: value_type
  44073. _ValueType ;
  44074.  
  44075.  
  44076.  
  44077.  
  44078. ;
  44079. ;
  44080.  
  44081. _ForwardIterator __i = std :: lower_bound ( __first , __last , __val ) ;
  44082. return __i != __last && ! ( __val < * __i ) ;
  44083. }
  44084. #2728
  44085. template < typename _ForwardIterator , typename _Tp , typename _Compare >
  44086. bool
  44087. binary_search ( _ForwardIterator __first , _ForwardIterator __last ,
  44088. const _Tp & __val , _Compare __comp )
  44089. {
  44090. typedef typename iterator_traits < _ForwardIterator > :: value_type
  44091. _ValueType ;
  44092. #2741
  44093. ;
  44094.  
  44095. ;
  44096.  
  44097. _ForwardIterator __i = std :: lower_bound ( __first , __last , __val , __comp ) ;
  44098. return __i != __last && ! bool ( __comp ( __val , * __i ) ) ;
  44099. }
  44100.  
  44101.  
  44102.  
  44103.  
  44104. template < typename _InputIterator1 , typename _InputIterator2 ,
  44105. typename _OutputIterator >
  44106. void
  44107. __move_merge_adaptive ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  44108. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  44109. _OutputIterator __result )
  44110. {
  44111. while ( __first1 != __last1 && __first2 != __last2 )
  44112. {
  44113. if ( * __first2 < * __first1 )
  44114. {
  44115. * __result = std :: move ( * __first2 ) ;
  44116. ++ __first2 ;
  44117. }
  44118. else
  44119. {
  44120. * __result = std :: move ( * __first1 ) ;
  44121. ++ __first1 ;
  44122. }
  44123. ++ __result ;
  44124. }
  44125. if ( __first1 != __last1 )
  44126. std :: move ( __first1 , __last1 , __result ) ;
  44127. }
  44128.  
  44129.  
  44130. template < typename _InputIterator1 , typename _InputIterator2 ,
  44131. typename _OutputIterator , typename _Compare >
  44132. void
  44133. __move_merge_adaptive ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  44134. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  44135. _OutputIterator __result , _Compare __comp )
  44136. {
  44137. while ( __first1 != __last1 && __first2 != __last2 )
  44138. {
  44139. if ( __comp ( * __first2 , * __first1 ) )
  44140. {
  44141. * __result = std :: move ( * __first2 ) ;
  44142. ++ __first2 ;
  44143. }
  44144. else
  44145. {
  44146. * __result = std :: move ( * __first1 ) ;
  44147. ++ __first1 ;
  44148. }
  44149. ++ __result ;
  44150. }
  44151. if ( __first1 != __last1 )
  44152. std :: move ( __first1 , __last1 , __result ) ;
  44153. }
  44154.  
  44155.  
  44156. template < typename _BidirectionalIterator1 , typename _BidirectionalIterator2 ,
  44157. typename _BidirectionalIterator3 >
  44158. void
  44159. __move_merge_adaptive_backward ( _BidirectionalIterator1 __first1 ,
  44160. _BidirectionalIterator1 __last1 ,
  44161. _BidirectionalIterator2 __first2 ,
  44162. _BidirectionalIterator2 __last2 ,
  44163. _BidirectionalIterator3 __result )
  44164. {
  44165. if ( __first1 == __last1 )
  44166. {
  44167. std :: move_backward ( __first2 , __last2 , __result ) ;
  44168. return ;
  44169. }
  44170. else if ( __first2 == __last2 )
  44171. return ;
  44172.  
  44173. -- __last1 ;
  44174. -- __last2 ;
  44175. while ( true )
  44176. {
  44177. if ( * __last2 < * __last1 )
  44178. {
  44179. * -- __result = std :: move ( * __last1 ) ;
  44180. if ( __first1 == __last1 )
  44181. {
  44182. std :: move_backward ( __first2 , ++ __last2 , __result ) ;
  44183. return ;
  44184. }
  44185. -- __last1 ;
  44186. }
  44187. else
  44188. {
  44189. * -- __result = std :: move ( * __last2 ) ;
  44190. if ( __first2 == __last2 )
  44191. return ;
  44192. -- __last2 ;
  44193. }
  44194. }
  44195. }
  44196.  
  44197.  
  44198. template < typename _BidirectionalIterator1 , typename _BidirectionalIterator2 ,
  44199. typename _BidirectionalIterator3 , typename _Compare >
  44200. void
  44201. __move_merge_adaptive_backward ( _BidirectionalIterator1 __first1 ,
  44202. _BidirectionalIterator1 __last1 ,
  44203. _BidirectionalIterator2 __first2 ,
  44204. _BidirectionalIterator2 __last2 ,
  44205. _BidirectionalIterator3 __result ,
  44206. _Compare __comp )
  44207. {
  44208. if ( __first1 == __last1 )
  44209. {
  44210. std :: move_backward ( __first2 , __last2 , __result ) ;
  44211. return ;
  44212. }
  44213. else if ( __first2 == __last2 )
  44214. return ;
  44215.  
  44216. -- __last1 ;
  44217. -- __last2 ;
  44218. while ( true )
  44219. {
  44220. if ( __comp ( * __last2 , * __last1 ) )
  44221. {
  44222. * -- __result = std :: move ( * __last1 ) ;
  44223. if ( __first1 == __last1 )
  44224. {
  44225. std :: move_backward ( __first2 , ++ __last2 , __result ) ;
  44226. return ;
  44227. }
  44228. -- __last1 ;
  44229. }
  44230. else
  44231. {
  44232. * -- __result = std :: move ( * __last2 ) ;
  44233. if ( __first2 == __last2 )
  44234. return ;
  44235. -- __last2 ;
  44236. }
  44237. }
  44238. }
  44239.  
  44240.  
  44241. template < typename _BidirectionalIterator1 , typename _BidirectionalIterator2 ,
  44242. typename _Distance >
  44243. _BidirectionalIterator1
  44244. __rotate_adaptive ( _BidirectionalIterator1 __first ,
  44245. _BidirectionalIterator1 __middle ,
  44246. _BidirectionalIterator1 __last ,
  44247. _Distance __len1 , _Distance __len2 ,
  44248. _BidirectionalIterator2 __buffer ,
  44249. _Distance __buffer_size )
  44250. {
  44251. _BidirectionalIterator2 __buffer_end ;
  44252. if ( __len1 > __len2 && __len2 <= __buffer_size )
  44253. {
  44254. if ( __len2 )
  44255. {
  44256. __buffer_end = std :: move ( __middle , __last , __buffer ) ;
  44257. std :: move_backward ( __first , __middle , __last ) ;
  44258. return std :: move ( __buffer , __buffer_end , __first ) ;
  44259. }
  44260. else
  44261. return __first ;
  44262. }
  44263. else if ( __len1 <= __buffer_size )
  44264. {
  44265. if ( __len1 )
  44266. {
  44267. __buffer_end = std :: move ( __first , __middle , __buffer ) ;
  44268. std :: move ( __middle , __last , __first ) ;
  44269. return std :: move_backward ( __buffer , __buffer_end , __last ) ;
  44270. }
  44271. else
  44272. return __last ;
  44273. }
  44274. else
  44275. {
  44276. std :: rotate ( __first , __middle , __last ) ;
  44277. std :: advance ( __first , std :: distance ( __middle , __last ) ) ;
  44278. return __first ;
  44279. }
  44280. }
  44281.  
  44282.  
  44283. template < typename _BidirectionalIterator , typename _Distance ,
  44284. typename _Pointer >
  44285. void
  44286. __merge_adaptive ( _BidirectionalIterator __first ,
  44287. _BidirectionalIterator __middle ,
  44288. _BidirectionalIterator __last ,
  44289. _Distance __len1 , _Distance __len2 ,
  44290. _Pointer __buffer , _Distance __buffer_size )
  44291. {
  44292. if ( __len1 <= __len2 && __len1 <= __buffer_size )
  44293. {
  44294. _Pointer __buffer_end = std :: move ( __first , __middle , __buffer ) ;
  44295. std :: __move_merge_adaptive ( __buffer , __buffer_end , __middle , __last ,
  44296. __first ) ;
  44297. }
  44298. else if ( __len2 <= __buffer_size )
  44299. {
  44300. _Pointer __buffer_end = std :: move ( __middle , __last , __buffer ) ;
  44301. std :: __move_merge_adaptive_backward ( __first , __middle , __buffer ,
  44302. __buffer_end , __last ) ;
  44303. }
  44304. else
  44305. {
  44306. _BidirectionalIterator __first_cut = __first ;
  44307. _BidirectionalIterator __second_cut = __middle ;
  44308. _Distance __len11 = 0 ;
  44309. _Distance __len22 = 0 ;
  44310. if ( __len1 > __len2 )
  44311. {
  44312. __len11 = __len1 / 2 ;
  44313. std :: advance ( __first_cut , __len11 ) ;
  44314. __second_cut = std :: lower_bound ( __middle , __last ,
  44315. * __first_cut ) ;
  44316. __len22 = std :: distance ( __middle , __second_cut ) ;
  44317. }
  44318. else
  44319. {
  44320. __len22 = __len2 / 2 ;
  44321. std :: advance ( __second_cut , __len22 ) ;
  44322. __first_cut = std :: upper_bound ( __first , __middle ,
  44323. * __second_cut ) ;
  44324. __len11 = std :: distance ( __first , __first_cut ) ;
  44325. }
  44326. _BidirectionalIterator __new_middle =
  44327. std :: __rotate_adaptive ( __first_cut , __middle , __second_cut ,
  44328. __len1 - __len11 , __len22 , __buffer ,
  44329. __buffer_size ) ;
  44330. std :: __merge_adaptive ( __first , __first_cut , __new_middle , __len11 ,
  44331. __len22 , __buffer , __buffer_size ) ;
  44332. std :: __merge_adaptive ( __new_middle , __second_cut , __last ,
  44333. __len1 - __len11 ,
  44334. __len2 - __len22 , __buffer , __buffer_size ) ;
  44335. }
  44336. }
  44337.  
  44338.  
  44339. template < typename _BidirectionalIterator , typename _Distance ,
  44340. typename _Pointer , typename _Compare >
  44341. void
  44342. __merge_adaptive ( _BidirectionalIterator __first ,
  44343. _BidirectionalIterator __middle ,
  44344. _BidirectionalIterator __last ,
  44345. _Distance __len1 , _Distance __len2 ,
  44346. _Pointer __buffer , _Distance __buffer_size ,
  44347. _Compare __comp )
  44348. {
  44349. if ( __len1 <= __len2 && __len1 <= __buffer_size )
  44350. {
  44351. _Pointer __buffer_end = std :: move ( __first , __middle , __buffer ) ;
  44352. std :: __move_merge_adaptive ( __buffer , __buffer_end , __middle , __last ,
  44353. __first , __comp ) ;
  44354. }
  44355. else if ( __len2 <= __buffer_size )
  44356. {
  44357. _Pointer __buffer_end = std :: move ( __middle , __last , __buffer ) ;
  44358. std :: __move_merge_adaptive_backward ( __first , __middle , __buffer ,
  44359. __buffer_end , __last , __comp ) ;
  44360. }
  44361. else
  44362. {
  44363. _BidirectionalIterator __first_cut = __first ;
  44364. _BidirectionalIterator __second_cut = __middle ;
  44365. _Distance __len11 = 0 ;
  44366. _Distance __len22 = 0 ;
  44367. if ( __len1 > __len2 )
  44368. {
  44369. __len11 = __len1 / 2 ;
  44370. std :: advance ( __first_cut , __len11 ) ;
  44371. __second_cut = std :: lower_bound ( __middle , __last , * __first_cut ,
  44372. __comp ) ;
  44373. __len22 = std :: distance ( __middle , __second_cut ) ;
  44374. }
  44375. else
  44376. {
  44377. __len22 = __len2 / 2 ;
  44378. std :: advance ( __second_cut , __len22 ) ;
  44379. __first_cut = std :: upper_bound ( __first , __middle , * __second_cut ,
  44380. __comp ) ;
  44381. __len11 = std :: distance ( __first , __first_cut ) ;
  44382. }
  44383. _BidirectionalIterator __new_middle =
  44384. std :: __rotate_adaptive ( __first_cut , __middle , __second_cut ,
  44385. __len1 - __len11 , __len22 , __buffer ,
  44386. __buffer_size ) ;
  44387. std :: __merge_adaptive ( __first , __first_cut , __new_middle , __len11 ,
  44388. __len22 , __buffer , __buffer_size , __comp ) ;
  44389. std :: __merge_adaptive ( __new_middle , __second_cut , __last ,
  44390. __len1 - __len11 ,
  44391. __len2 - __len22 , __buffer ,
  44392. __buffer_size , __comp ) ;
  44393. }
  44394. }
  44395.  
  44396.  
  44397. template < typename _BidirectionalIterator , typename _Distance >
  44398. void
  44399. __merge_without_buffer ( _BidirectionalIterator __first ,
  44400. _BidirectionalIterator __middle ,
  44401. _BidirectionalIterator __last ,
  44402. _Distance __len1 , _Distance __len2 )
  44403. {
  44404. if ( __len1 == 0 || __len2 == 0 )
  44405. return ;
  44406. if ( __len1 + __len2 == 2 )
  44407. {
  44408. if ( * __middle < * __first )
  44409. std :: iter_swap ( __first , __middle ) ;
  44410. return ;
  44411. }
  44412. _BidirectionalIterator __first_cut = __first ;
  44413. _BidirectionalIterator __second_cut = __middle ;
  44414. _Distance __len11 = 0 ;
  44415. _Distance __len22 = 0 ;
  44416. if ( __len1 > __len2 )
  44417. {
  44418. __len11 = __len1 / 2 ;
  44419. std :: advance ( __first_cut , __len11 ) ;
  44420. __second_cut = std :: lower_bound ( __middle , __last , * __first_cut ) ;
  44421. __len22 = std :: distance ( __middle , __second_cut ) ;
  44422. }
  44423. else
  44424. {
  44425. __len22 = __len2 / 2 ;
  44426. std :: advance ( __second_cut , __len22 ) ;
  44427. __first_cut = std :: upper_bound ( __first , __middle , * __second_cut ) ;
  44428. __len11 = std :: distance ( __first , __first_cut ) ;
  44429. }
  44430. std :: rotate ( __first_cut , __middle , __second_cut ) ;
  44431. _BidirectionalIterator __new_middle = __first_cut ;
  44432. std :: advance ( __new_middle , std :: distance ( __middle , __second_cut ) ) ;
  44433. std :: __merge_without_buffer ( __first , __first_cut , __new_middle ,
  44434. __len11 , __len22 ) ;
  44435. std :: __merge_without_buffer ( __new_middle , __second_cut , __last ,
  44436. __len1 - __len11 , __len2 - __len22 ) ;
  44437. }
  44438.  
  44439.  
  44440. template < typename _BidirectionalIterator , typename _Distance ,
  44441. typename _Compare >
  44442. void
  44443. __merge_without_buffer ( _BidirectionalIterator __first ,
  44444. _BidirectionalIterator __middle ,
  44445. _BidirectionalIterator __last ,
  44446. _Distance __len1 , _Distance __len2 ,
  44447. _Compare __comp )
  44448. {
  44449. if ( __len1 == 0 || __len2 == 0 )
  44450. return ;
  44451. if ( __len1 + __len2 == 2 )
  44452. {
  44453. if ( __comp ( * __middle , * __first ) )
  44454. std :: iter_swap ( __first , __middle ) ;
  44455. return ;
  44456. }
  44457. _BidirectionalIterator __first_cut = __first ;
  44458. _BidirectionalIterator __second_cut = __middle ;
  44459. _Distance __len11 = 0 ;
  44460. _Distance __len22 = 0 ;
  44461. if ( __len1 > __len2 )
  44462. {
  44463. __len11 = __len1 / 2 ;
  44464. std :: advance ( __first_cut , __len11 ) ;
  44465. __second_cut = std :: lower_bound ( __middle , __last , * __first_cut ,
  44466. __comp ) ;
  44467. __len22 = std :: distance ( __middle , __second_cut ) ;
  44468. }
  44469. else
  44470. {
  44471. __len22 = __len2 / 2 ;
  44472. std :: advance ( __second_cut , __len22 ) ;
  44473. __first_cut = std :: upper_bound ( __first , __middle , * __second_cut ,
  44474. __comp ) ;
  44475. __len11 = std :: distance ( __first , __first_cut ) ;
  44476. }
  44477. std :: rotate ( __first_cut , __middle , __second_cut ) ;
  44478. _BidirectionalIterator __new_middle = __first_cut ;
  44479. std :: advance ( __new_middle , std :: distance ( __middle , __second_cut ) ) ;
  44480. std :: __merge_without_buffer ( __first , __first_cut , __new_middle ,
  44481. __len11 , __len22 , __comp ) ;
  44482. std :: __merge_without_buffer ( __new_middle , __second_cut , __last ,
  44483. __len1 - __len11 , __len2 - __len22 , __comp ) ;
  44484. }
  44485. #3152
  44486. template < typename _BidirectionalIterator >
  44487. void
  44488. inplace_merge ( _BidirectionalIterator __first ,
  44489. _BidirectionalIterator __middle ,
  44490. _BidirectionalIterator __last )
  44491. {
  44492. typedef typename iterator_traits < _BidirectionalIterator > :: value_type
  44493. _ValueType ;
  44494. typedef typename iterator_traits < _BidirectionalIterator > :: difference_type
  44495. _DistanceType ;
  44496.  
  44497.  
  44498.  
  44499.  
  44500.  
  44501. ;
  44502. ;
  44503.  
  44504. if ( __first == __middle || __middle == __last )
  44505. return ;
  44506.  
  44507. _DistanceType __len1 = std :: distance ( __first , __middle ) ;
  44508. _DistanceType __len2 = std :: distance ( __middle , __last ) ;
  44509.  
  44510. _Temporary_buffer < _BidirectionalIterator , _ValueType > __buf ( __first ,
  44511. __last ) ;
  44512. if ( __buf . begin ( ) == 0 )
  44513. std :: __merge_without_buffer ( __first , __middle , __last , __len1 , __len2 ) ;
  44514. else
  44515. std :: __merge_adaptive ( __first , __middle , __last , __len1 , __len2 ,
  44516. __buf . begin ( ) , _DistanceType ( __buf . size ( ) ) ) ;
  44517. }
  44518. #3207
  44519. template < typename _BidirectionalIterator , typename _Compare >
  44520. void
  44521. inplace_merge ( _BidirectionalIterator __first ,
  44522. _BidirectionalIterator __middle ,
  44523. _BidirectionalIterator __last ,
  44524. _Compare __comp )
  44525. {
  44526. typedef typename iterator_traits < _BidirectionalIterator > :: value_type
  44527. _ValueType ;
  44528. typedef typename iterator_traits < _BidirectionalIterator > :: difference_type
  44529. _DistanceType ;
  44530. #3224
  44531. ;
  44532. ;
  44533.  
  44534. if ( __first == __middle || __middle == __last )
  44535. return ;
  44536.  
  44537. const _DistanceType __len1 = std :: distance ( __first , __middle ) ;
  44538. const _DistanceType __len2 = std :: distance ( __middle , __last ) ;
  44539.  
  44540. _Temporary_buffer < _BidirectionalIterator , _ValueType > __buf ( __first ,
  44541. __last ) ;
  44542. if ( __buf . begin ( ) == 0 )
  44543. std :: __merge_without_buffer ( __first , __middle , __last , __len1 ,
  44544. __len2 , __comp ) ;
  44545. else
  44546. std :: __merge_adaptive ( __first , __middle , __last , __len1 , __len2 ,
  44547. __buf . begin ( ) , _DistanceType ( __buf . size ( ) ) ,
  44548. __comp ) ;
  44549. }
  44550.  
  44551.  
  44552.  
  44553. template < typename _InputIterator1 , typename _InputIterator2 ,
  44554. typename _OutputIterator >
  44555. _OutputIterator
  44556. __move_merge ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  44557. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  44558. _OutputIterator __result )
  44559. {
  44560. while ( __first1 != __last1 && __first2 != __last2 )
  44561. {
  44562. if ( * __first2 < * __first1 )
  44563. {
  44564. * __result = std :: move ( * __first2 ) ;
  44565. ++ __first2 ;
  44566. }
  44567. else
  44568. {
  44569. * __result = std :: move ( * __first1 ) ;
  44570. ++ __first1 ;
  44571. }
  44572. ++ __result ;
  44573. }
  44574. return
  44575.  
  44576. std :: move ( __first2 , __last2 , std :: move ( __first1 , __last1 , __result ) ) ;
  44577. }
  44578.  
  44579.  
  44580. template < typename _InputIterator1 , typename _InputIterator2 ,
  44581. typename _OutputIterator , typename _Compare >
  44582. _OutputIterator
  44583. __move_merge ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  44584. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  44585. _OutputIterator __result , _Compare __comp )
  44586. {
  44587. while ( __first1 != __last1 && __first2 != __last2 )
  44588. {
  44589. if ( __comp ( * __first2 , * __first1 ) )
  44590. {
  44591. * __result = std :: move ( * __first2 ) ;
  44592. ++ __first2 ;
  44593. }
  44594. else
  44595. {
  44596. * __result = std :: move ( * __first1 ) ;
  44597. ++ __first1 ;
  44598. }
  44599. ++ __result ;
  44600. }
  44601. return
  44602.  
  44603. std :: move ( __first2 , __last2 , std :: move ( __first1 , __last1 , __result ) ) ;
  44604. }
  44605.  
  44606. template < typename _RandomAccessIterator1 , typename _RandomAccessIterator2 ,
  44607. typename _Distance >
  44608. void
  44609. __merge_sort_loop ( _RandomAccessIterator1 __first ,
  44610. _RandomAccessIterator1 __last ,
  44611. _RandomAccessIterator2 __result ,
  44612. _Distance __step_size )
  44613. {
  44614. const _Distance __two_step = 2 * __step_size ;
  44615.  
  44616. while ( __last - __first >= __two_step )
  44617. {
  44618. __result = std :: __move_merge ( __first , __first + __step_size ,
  44619. __first + __step_size ,
  44620. __first + __two_step , __result ) ;
  44621. __first += __two_step ;
  44622. }
  44623.  
  44624. __step_size = std :: min ( _Distance ( __last - __first ) , __step_size ) ;
  44625. std :: __move_merge ( __first , __first + __step_size ,
  44626. __first + __step_size , __last , __result ) ;
  44627. }
  44628.  
  44629. template < typename _RandomAccessIterator1 , typename _RandomAccessIterator2 ,
  44630. typename _Distance , typename _Compare >
  44631. void
  44632. __merge_sort_loop ( _RandomAccessIterator1 __first ,
  44633. _RandomAccessIterator1 __last ,
  44634. _RandomAccessIterator2 __result , _Distance __step_size ,
  44635. _Compare __comp )
  44636. {
  44637. const _Distance __two_step = 2 * __step_size ;
  44638.  
  44639. while ( __last - __first >= __two_step )
  44640. {
  44641. __result = std :: __move_merge ( __first , __first + __step_size ,
  44642. __first + __step_size ,
  44643. __first + __two_step ,
  44644. __result , __comp ) ;
  44645. __first += __two_step ;
  44646. }
  44647. __step_size = std :: min ( _Distance ( __last - __first ) , __step_size ) ;
  44648.  
  44649. std :: __move_merge ( __first , __first + __step_size ,
  44650. __first + __step_size , __last , __result , __comp ) ;
  44651. }
  44652.  
  44653. template < typename _RandomAccessIterator , typename _Distance >
  44654. void
  44655. __chunk_insertion_sort ( _RandomAccessIterator __first ,
  44656. _RandomAccessIterator __last ,
  44657. _Distance __chunk_size )
  44658. {
  44659. while ( __last - __first >= __chunk_size )
  44660. {
  44661. std :: __insertion_sort ( __first , __first + __chunk_size ) ;
  44662. __first += __chunk_size ;
  44663. }
  44664. std :: __insertion_sort ( __first , __last ) ;
  44665. }
  44666.  
  44667. template < typename _RandomAccessIterator , typename _Distance ,
  44668. typename _Compare >
  44669. void
  44670. __chunk_insertion_sort ( _RandomAccessIterator __first ,
  44671. _RandomAccessIterator __last ,
  44672. _Distance __chunk_size , _Compare __comp )
  44673. {
  44674. while ( __last - __first >= __chunk_size )
  44675. {
  44676. std :: __insertion_sort ( __first , __first + __chunk_size , __comp ) ;
  44677. __first += __chunk_size ;
  44678. }
  44679. std :: __insertion_sort ( __first , __last , __comp ) ;
  44680. }
  44681.  
  44682. enum { _S_chunk_size = 7 } ;
  44683.  
  44684. template < typename _RandomAccessIterator , typename _Pointer >
  44685. void
  44686. __merge_sort_with_buffer ( _RandomAccessIterator __first ,
  44687. _RandomAccessIterator __last ,
  44688. _Pointer __buffer )
  44689. {
  44690. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  44691. _Distance ;
  44692.  
  44693. const _Distance __len = __last - __first ;
  44694. const _Pointer __buffer_last = __buffer + __len ;
  44695.  
  44696. _Distance __step_size = _S_chunk_size ;
  44697. std :: __chunk_insertion_sort ( __first , __last , __step_size ) ;
  44698.  
  44699. while ( __step_size < __len )
  44700. {
  44701. std :: __merge_sort_loop ( __first , __last , __buffer , __step_size ) ;
  44702. __step_size *= 2 ;
  44703. std :: __merge_sort_loop ( __buffer , __buffer_last , __first , __step_size ) ;
  44704. __step_size *= 2 ;
  44705. }
  44706. }
  44707.  
  44708. template < typename _RandomAccessIterator , typename _Pointer , typename _Compare >
  44709. void
  44710. __merge_sort_with_buffer ( _RandomAccessIterator __first ,
  44711. _RandomAccessIterator __last ,
  44712. _Pointer __buffer , _Compare __comp )
  44713. {
  44714. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  44715. _Distance ;
  44716.  
  44717. const _Distance __len = __last - __first ;
  44718. const _Pointer __buffer_last = __buffer + __len ;
  44719.  
  44720. _Distance __step_size = _S_chunk_size ;
  44721. std :: __chunk_insertion_sort ( __first , __last , __step_size , __comp ) ;
  44722.  
  44723. while ( __step_size < __len )
  44724. {
  44725. std :: __merge_sort_loop ( __first , __last , __buffer ,
  44726. __step_size , __comp ) ;
  44727. __step_size *= 2 ;
  44728. std :: __merge_sort_loop ( __buffer , __buffer_last , __first ,
  44729. __step_size , __comp ) ;
  44730. __step_size *= 2 ;
  44731. }
  44732. }
  44733.  
  44734. template < typename _RandomAccessIterator , typename _Pointer ,
  44735. typename _Distance >
  44736. void
  44737. __stable_sort_adaptive ( _RandomAccessIterator __first ,
  44738. _RandomAccessIterator __last ,
  44739. _Pointer __buffer , _Distance __buffer_size )
  44740. {
  44741. const _Distance __len = ( __last - __first + 1 ) / 2 ;
  44742. const _RandomAccessIterator __middle = __first + __len ;
  44743. if ( __len > __buffer_size )
  44744. {
  44745. std :: __stable_sort_adaptive ( __first , __middle ,
  44746. __buffer , __buffer_size ) ;
  44747. std :: __stable_sort_adaptive ( __middle , __last ,
  44748. __buffer , __buffer_size ) ;
  44749. }
  44750. else
  44751. {
  44752. std :: __merge_sort_with_buffer ( __first , __middle , __buffer ) ;
  44753. std :: __merge_sort_with_buffer ( __middle , __last , __buffer ) ;
  44754. }
  44755. std :: __merge_adaptive ( __first , __middle , __last ,
  44756. _Distance ( __middle - __first ) ,
  44757. _Distance ( __last - __middle ) ,
  44758. __buffer , __buffer_size ) ;
  44759. }
  44760.  
  44761. template < typename _RandomAccessIterator , typename _Pointer ,
  44762. typename _Distance , typename _Compare >
  44763. void
  44764. __stable_sort_adaptive ( _RandomAccessIterator __first ,
  44765. _RandomAccessIterator __last ,
  44766. _Pointer __buffer , _Distance __buffer_size ,
  44767. _Compare __comp )
  44768. {
  44769. const _Distance __len = ( __last - __first + 1 ) / 2 ;
  44770. const _RandomAccessIterator __middle = __first + __len ;
  44771. if ( __len > __buffer_size )
  44772. {
  44773. std :: __stable_sort_adaptive ( __first , __middle , __buffer ,
  44774. __buffer_size , __comp ) ;
  44775. std :: __stable_sort_adaptive ( __middle , __last , __buffer ,
  44776. __buffer_size , __comp ) ;
  44777. }
  44778. else
  44779. {
  44780. std :: __merge_sort_with_buffer ( __first , __middle , __buffer , __comp ) ;
  44781. std :: __merge_sort_with_buffer ( __middle , __last , __buffer , __comp ) ;
  44782. }
  44783. std :: __merge_adaptive ( __first , __middle , __last ,
  44784. _Distance ( __middle - __first ) ,
  44785. _Distance ( __last - __middle ) ,
  44786. __buffer , __buffer_size ,
  44787. __comp ) ;
  44788. }
  44789.  
  44790.  
  44791. template < typename _RandomAccessIterator >
  44792. void
  44793. __inplace_stable_sort ( _RandomAccessIterator __first ,
  44794. _RandomAccessIterator __last )
  44795. {
  44796. if ( __last - __first < 15 )
  44797. {
  44798. std :: __insertion_sort ( __first , __last ) ;
  44799. return ;
  44800. }
  44801. _RandomAccessIterator __middle = __first + ( __last - __first ) / 2 ;
  44802. std :: __inplace_stable_sort ( __first , __middle ) ;
  44803. std :: __inplace_stable_sort ( __middle , __last ) ;
  44804. std :: __merge_without_buffer ( __first , __middle , __last ,
  44805. __middle - __first ,
  44806. __last - __middle ) ;
  44807. }
  44808.  
  44809.  
  44810. template < typename _RandomAccessIterator , typename _Compare >
  44811. void
  44812. __inplace_stable_sort ( _RandomAccessIterator __first ,
  44813. _RandomAccessIterator __last , _Compare __comp )
  44814. {
  44815. if ( __last - __first < 15 )
  44816. {
  44817. std :: __insertion_sort ( __first , __last , __comp ) ;
  44818. return ;
  44819. }
  44820. _RandomAccessIterator __middle = __first + ( __last - __first ) / 2 ;
  44821. std :: __inplace_stable_sort ( __first , __middle , __comp ) ;
  44822. std :: __inplace_stable_sort ( __middle , __last , __comp ) ;
  44823. std :: __merge_without_buffer ( __first , __middle , __last ,
  44824. __middle - __first ,
  44825. __last - __middle ,
  44826. __comp ) ;
  44827. }
  44828. #3547
  44829. template < typename _InputIterator1 , typename _InputIterator2 >
  44830. bool
  44831. includes ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  44832. _InputIterator2 __first2 , _InputIterator2 __last2 )
  44833. {
  44834. typedef typename iterator_traits < _InputIterator1 > :: value_type
  44835. _ValueType1 ;
  44836. typedef typename iterator_traits < _InputIterator2 > :: value_type
  44837. _ValueType2 ;
  44838. #3562
  44839. ;
  44840. ;
  44841.  
  44842. while ( __first1 != __last1 && __first2 != __last2 )
  44843. if ( * __first2 < * __first1 )
  44844. return false ;
  44845. else if ( * __first1 < * __first2 )
  44846. ++ __first1 ;
  44847. else
  44848. ++ __first1 , ++ __first2 ;
  44849.  
  44850. return __first2 == __last2 ;
  44851. }
  44852. #3597
  44853. template < typename _InputIterator1 , typename _InputIterator2 ,
  44854. typename _Compare >
  44855. bool
  44856. includes ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  44857. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  44858. _Compare __comp )
  44859. {
  44860. typedef typename iterator_traits < _InputIterator1 > :: value_type
  44861. _ValueType1 ;
  44862. typedef typename iterator_traits < _InputIterator2 > :: value_type
  44863. _ValueType2 ;
  44864. #3616
  44865. ;
  44866. ;
  44867.  
  44868. while ( __first1 != __last1 && __first2 != __last2 )
  44869. if ( __comp ( * __first2 , * __first1 ) )
  44870. return false ;
  44871. else if ( __comp ( * __first1 , * __first2 ) )
  44872. ++ __first1 ;
  44873. else
  44874. ++ __first1 , ++ __first2 ;
  44875.  
  44876. return __first2 == __last2 ;
  44877. }
  44878. #3652
  44879. template < typename _BidirectionalIterator >
  44880. bool
  44881. next_permutation ( _BidirectionalIterator __first ,
  44882. _BidirectionalIterator __last )
  44883. {
  44884.  
  44885.  
  44886.  
  44887.  
  44888.  
  44889. ;
  44890.  
  44891. if ( __first == __last )
  44892. return false ;
  44893. _BidirectionalIterator __i = __first ;
  44894. ++ __i ;
  44895. if ( __i == __last )
  44896. return false ;
  44897. __i = __last ;
  44898. -- __i ;
  44899.  
  44900. for ( ; ; )
  44901. {
  44902. _BidirectionalIterator __ii = __i ;
  44903. -- __i ;
  44904. if ( * __i < * __ii )
  44905. {
  44906. _BidirectionalIterator __j = __last ;
  44907. while ( ! ( * __i < * -- __j ) )
  44908. { }
  44909. std :: iter_swap ( __i , __j ) ;
  44910. std :: reverse ( __ii , __last ) ;
  44911. return true ;
  44912. }
  44913. if ( __i == __first )
  44914. {
  44915. std :: reverse ( __first , __last ) ;
  44916. return false ;
  44917. }
  44918. }
  44919. }
  44920. #3709
  44921. template < typename _BidirectionalIterator , typename _Compare >
  44922. bool
  44923. next_permutation ( _BidirectionalIterator __first ,
  44924. _BidirectionalIterator __last , _Compare __comp )
  44925. {
  44926. #3720
  44927. ;
  44928.  
  44929. if ( __first == __last )
  44930. return false ;
  44931. _BidirectionalIterator __i = __first ;
  44932. ++ __i ;
  44933. if ( __i == __last )
  44934. return false ;
  44935. __i = __last ;
  44936. -- __i ;
  44937.  
  44938. for ( ; ; )
  44939. {
  44940. _BidirectionalIterator __ii = __i ;
  44941. -- __i ;
  44942. if ( __comp ( * __i , * __ii ) )
  44943. {
  44944. _BidirectionalIterator __j = __last ;
  44945. while ( ! bool ( __comp ( * __i , * -- __j ) ) )
  44946. { }
  44947. std :: iter_swap ( __i , __j ) ;
  44948. std :: reverse ( __ii , __last ) ;
  44949. return true ;
  44950. }
  44951. if ( __i == __first )
  44952. {
  44953. std :: reverse ( __first , __last ) ;
  44954. return false ;
  44955. }
  44956. }
  44957. }
  44958. #3765
  44959. template < typename _BidirectionalIterator >
  44960. bool
  44961. prev_permutation ( _BidirectionalIterator __first ,
  44962. _BidirectionalIterator __last )
  44963. {
  44964.  
  44965.  
  44966.  
  44967.  
  44968.  
  44969. ;
  44970.  
  44971. if ( __first == __last )
  44972. return false ;
  44973. _BidirectionalIterator __i = __first ;
  44974. ++ __i ;
  44975. if ( __i == __last )
  44976. return false ;
  44977. __i = __last ;
  44978. -- __i ;
  44979.  
  44980. for ( ; ; )
  44981. {
  44982. _BidirectionalIterator __ii = __i ;
  44983. -- __i ;
  44984. if ( * __ii < * __i )
  44985. {
  44986. _BidirectionalIterator __j = __last ;
  44987. while ( ! ( * -- __j < * __i ) )
  44988. { }
  44989. std :: iter_swap ( __i , __j ) ;
  44990. std :: reverse ( __ii , __last ) ;
  44991. return true ;
  44992. }
  44993. if ( __i == __first )
  44994. {
  44995. std :: reverse ( __first , __last ) ;
  44996. return false ;
  44997. }
  44998. }
  44999. }
  45000. #3822
  45001. template < typename _BidirectionalIterator , typename _Compare >
  45002. bool
  45003. prev_permutation ( _BidirectionalIterator __first ,
  45004. _BidirectionalIterator __last , _Compare __comp )
  45005. {
  45006. #3833
  45007. ;
  45008.  
  45009. if ( __first == __last )
  45010. return false ;
  45011. _BidirectionalIterator __i = __first ;
  45012. ++ __i ;
  45013. if ( __i == __last )
  45014. return false ;
  45015. __i = __last ;
  45016. -- __i ;
  45017.  
  45018. for ( ; ; )
  45019. {
  45020. _BidirectionalIterator __ii = __i ;
  45021. -- __i ;
  45022. if ( __comp ( * __ii , * __i ) )
  45023. {
  45024. _BidirectionalIterator __j = __last ;
  45025. while ( ! bool ( __comp ( * -- __j , * __i ) ) )
  45026. { }
  45027. std :: iter_swap ( __i , __j ) ;
  45028. std :: reverse ( __ii , __last ) ;
  45029. return true ;
  45030. }
  45031. if ( __i == __first )
  45032. {
  45033. std :: reverse ( __first , __last ) ;
  45034. return false ;
  45035. }
  45036. }
  45037. }
  45038. #3882
  45039. template < typename _InputIterator , typename _OutputIterator , typename _Tp >
  45040. _OutputIterator
  45041. replace_copy ( _InputIterator __first , _InputIterator __last ,
  45042. _OutputIterator __result ,
  45043. const _Tp & __old_value , const _Tp & __new_value )
  45044. {
  45045. #3894
  45046. ;
  45047.  
  45048. for ( ; __first != __last ; ++ __first , ++ __result )
  45049. if ( * __first == __old_value )
  45050. * __result = __new_value ;
  45051. else
  45052. * __result = * __first ;
  45053. return __result ;
  45054. }
  45055. #3919
  45056. template < typename _InputIterator , typename _OutputIterator ,
  45057. typename _Predicate , typename _Tp >
  45058. _OutputIterator
  45059. replace_copy_if ( _InputIterator __first , _InputIterator __last ,
  45060. _OutputIterator __result ,
  45061. _Predicate __pred , const _Tp & __new_value )
  45062. {
  45063. #3932
  45064. ;
  45065.  
  45066. for ( ; __first != __last ; ++ __first , ++ __result )
  45067. if ( __pred ( * __first ) )
  45068. * __result = __new_value ;
  45069. else
  45070. * __result = * __first ;
  45071. return __result ;
  45072. }
  45073. #3950
  45074. template < typename _ForwardIterator >
  45075. inline bool
  45076. is_sorted ( _ForwardIterator __first , _ForwardIterator __last )
  45077. { return std :: is_sorted_until ( __first , __last ) == __last ; }
  45078. #3964
  45079. template < typename _ForwardIterator , typename _Compare >
  45080. inline bool
  45081. is_sorted ( _ForwardIterator __first , _ForwardIterator __last ,
  45082. _Compare __comp )
  45083. { return std :: is_sorted_until ( __first , __last , __comp ) == __last ; }
  45084. #3978
  45085. template < typename _ForwardIterator >
  45086. _ForwardIterator
  45087. is_sorted_until ( _ForwardIterator __first , _ForwardIterator __last )
  45088. {
  45089.  
  45090.  
  45091.  
  45092.  
  45093. ;
  45094.  
  45095. if ( __first == __last )
  45096. return __last ;
  45097.  
  45098. _ForwardIterator __next = __first ;
  45099. for ( ++ __next ; __next != __last ; __first = __next , ++ __next )
  45100. if ( * __next < * __first )
  45101. return __next ;
  45102. return __next ;
  45103. }
  45104. #4007
  45105. template < typename _ForwardIterator , typename _Compare >
  45106. _ForwardIterator
  45107. is_sorted_until ( _ForwardIterator __first , _ForwardIterator __last ,
  45108. _Compare __comp )
  45109. {
  45110.  
  45111.  
  45112.  
  45113.  
  45114.  
  45115. ;
  45116.  
  45117. if ( __first == __last )
  45118. return __last ;
  45119.  
  45120. _ForwardIterator __next = __first ;
  45121. for ( ++ __next ; __next != __last ; __first = __next , ++ __next )
  45122. if ( __comp ( * __next , * __first ) )
  45123. return __next ;
  45124. return __next ;
  45125. }
  45126. #4037
  45127. template < typename _Tp >
  45128. inline pair < const _Tp & , const _Tp & >
  45129. minmax ( const _Tp & __a , const _Tp & __b )
  45130. {
  45131.  
  45132.  
  45133.  
  45134. return __b < __a ? pair < const _Tp & , const _Tp & > ( __b , __a )
  45135. : pair < const _Tp & , const _Tp & > ( __a , __b ) ;
  45136. }
  45137. #4057
  45138. template < typename _Tp , typename _Compare >
  45139. inline pair < const _Tp & , const _Tp & >
  45140. minmax ( const _Tp & __a , const _Tp & __b , _Compare __comp )
  45141. {
  45142. return __comp ( __b , __a ) ? pair < const _Tp & , const _Tp & > ( __b , __a )
  45143. : pair < const _Tp & , const _Tp & > ( __a , __b ) ;
  45144. }
  45145. #4076
  45146. template < typename _ForwardIterator >
  45147. pair < _ForwardIterator , _ForwardIterator >
  45148. minmax_element ( _ForwardIterator __first , _ForwardIterator __last )
  45149. {
  45150.  
  45151.  
  45152.  
  45153.  
  45154. ;
  45155.  
  45156. _ForwardIterator __next = __first ;
  45157. if ( __first == __last
  45158. || ++ __next == __last )
  45159. return std :: make_pair ( __first , __first ) ;
  45160.  
  45161. _ForwardIterator __min , __max ;
  45162. if ( * __next < * __first )
  45163. {
  45164. __min = __next ;
  45165. __max = __first ;
  45166. }
  45167. else
  45168. {
  45169. __min = __first ;
  45170. __max = __next ;
  45171. }
  45172.  
  45173. __first = __next ;
  45174. ++ __first ;
  45175.  
  45176. while ( __first != __last )
  45177. {
  45178. __next = __first ;
  45179. if ( ++ __next == __last )
  45180. {
  45181. if ( * __first < * __min )
  45182. __min = __first ;
  45183. else if ( ! ( * __first < * __max ) )
  45184. __max = __first ;
  45185. break ;
  45186. }
  45187.  
  45188. if ( * __next < * __first )
  45189. {
  45190. if ( * __next < * __min )
  45191. __min = __next ;
  45192. if ( ! ( * __first < * __max ) )
  45193. __max = __first ;
  45194. }
  45195. else
  45196. {
  45197. if ( * __first < * __min )
  45198. __min = __first ;
  45199. if ( ! ( * __next < * __max ) )
  45200. __max = __next ;
  45201. }
  45202.  
  45203. __first = __next ;
  45204. ++ __first ;
  45205. }
  45206.  
  45207. return std :: make_pair ( __min , __max ) ;
  45208. }
  45209. #4152
  45210. template < typename _ForwardIterator , typename _Compare >
  45211. pair < _ForwardIterator , _ForwardIterator >
  45212. minmax_element ( _ForwardIterator __first , _ForwardIterator __last ,
  45213. _Compare __comp )
  45214. {
  45215.  
  45216.  
  45217.  
  45218.  
  45219.  
  45220. ;
  45221.  
  45222. _ForwardIterator __next = __first ;
  45223. if ( __first == __last
  45224. || ++ __next == __last )
  45225. return std :: make_pair ( __first , __first ) ;
  45226.  
  45227. _ForwardIterator __min , __max ;
  45228. if ( __comp ( * __next , * __first ) )
  45229. {
  45230. __min = __next ;
  45231. __max = __first ;
  45232. }
  45233. else
  45234. {
  45235. __min = __first ;
  45236. __max = __next ;
  45237. }
  45238.  
  45239. __first = __next ;
  45240. ++ __first ;
  45241.  
  45242. while ( __first != __last )
  45243. {
  45244. __next = __first ;
  45245. if ( ++ __next == __last )
  45246. {
  45247. if ( __comp ( * __first , * __min ) )
  45248. __min = __first ;
  45249. else if ( ! __comp ( * __first , * __max ) )
  45250. __max = __first ;
  45251. break ;
  45252. }
  45253.  
  45254. if ( __comp ( * __next , * __first ) )
  45255. {
  45256. if ( __comp ( * __next , * __min ) )
  45257. __min = __next ;
  45258. if ( ! __comp ( * __first , * __max ) )
  45259. __max = __first ;
  45260. }
  45261. else
  45262. {
  45263. if ( __comp ( * __first , * __min ) )
  45264. __min = __first ;
  45265. if ( ! __comp ( * __next , * __max ) )
  45266. __max = __next ;
  45267. }
  45268.  
  45269. __first = __next ;
  45270. ++ __first ;
  45271. }
  45272.  
  45273. return std :: make_pair ( __min , __max ) ;
  45274. }
  45275.  
  45276.  
  45277. template < typename _Tp >
  45278. inline _Tp
  45279. min ( initializer_list < _Tp > __l )
  45280. { return * std :: min_element ( __l . begin ( ) , __l . end ( ) ) ; }
  45281.  
  45282. template < typename _Tp , typename _Compare >
  45283. inline _Tp
  45284. min ( initializer_list < _Tp > __l , _Compare __comp )
  45285. { return * std :: min_element ( __l . begin ( ) , __l . end ( ) , __comp ) ; }
  45286.  
  45287. template < typename _Tp >
  45288. inline _Tp
  45289. max ( initializer_list < _Tp > __l )
  45290. { return * std :: max_element ( __l . begin ( ) , __l . end ( ) ) ; }
  45291.  
  45292. template < typename _Tp , typename _Compare >
  45293. inline _Tp
  45294. max ( initializer_list < _Tp > __l , _Compare __comp )
  45295. { return * std :: max_element ( __l . begin ( ) , __l . end ( ) , __comp ) ; }
  45296.  
  45297. template < typename _Tp >
  45298. inline pair < _Tp , _Tp >
  45299. minmax ( initializer_list < _Tp > __l )
  45300. {
  45301. pair < const _Tp * , const _Tp * > __p =
  45302. std :: minmax_element ( __l . begin ( ) , __l . end ( ) ) ;
  45303. return std :: make_pair ( * __p . first , * __p . second ) ;
  45304. }
  45305.  
  45306. template < typename _Tp , typename _Compare >
  45307. inline pair < _Tp , _Tp >
  45308. minmax ( initializer_list < _Tp > __l , _Compare __comp )
  45309. {
  45310. pair < const _Tp * , const _Tp * > __p =
  45311. std :: minmax_element ( __l . begin ( ) , __l . end ( ) , __comp ) ;
  45312. return std :: make_pair ( * __p . first , * __p . second ) ;
  45313. }
  45314. #4269
  45315. template < typename _ForwardIterator1 , typename _ForwardIterator2 >
  45316. bool
  45317. is_permutation ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  45318. _ForwardIterator2 __first2 )
  45319. {
  45320.  
  45321.  
  45322. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  45323. if ( ! ( * __first1 == * __first2 ) )
  45324. break ;
  45325.  
  45326. if ( __first1 == __last1 )
  45327. return true ;
  45328.  
  45329.  
  45330.  
  45331. _ForwardIterator2 __last2 = __first2 ;
  45332. std :: advance ( __last2 , std :: distance ( __first1 , __last1 ) ) ;
  45333. for ( _ForwardIterator1 __scan = __first1 ; __scan != __last1 ; ++ __scan )
  45334. {
  45335. if ( __scan != std :: find ( __first1 , __scan , * __scan ) )
  45336. continue ;
  45337.  
  45338. auto __matches = std :: count ( __first2 , __last2 , * __scan ) ;
  45339. if ( 0 == __matches
  45340. || std :: count ( __scan , __last1 , * __scan ) != __matches )
  45341. return false ;
  45342. }
  45343. return true ;
  45344. }
  45345. #4314
  45346. template < typename _ForwardIterator1 , typename _ForwardIterator2 ,
  45347. typename _BinaryPredicate >
  45348. bool
  45349. is_permutation ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  45350. _ForwardIterator2 __first2 , _BinaryPredicate __pred )
  45351. {
  45352.  
  45353.  
  45354. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 )
  45355. if ( ! bool ( __pred ( * __first1 , * __first2 ) ) )
  45356. break ;
  45357.  
  45358. if ( __first1 == __last1 )
  45359. return true ;
  45360.  
  45361.  
  45362.  
  45363. _ForwardIterator2 __last2 = __first2 ;
  45364. std :: advance ( __last2 , std :: distance ( __first1 , __last1 ) ) ;
  45365. for ( _ForwardIterator1 __scan = __first1 ; __scan != __last1 ; ++ __scan )
  45366. {
  45367. using std :: placeholders :: _1 ;
  45368.  
  45369. if ( __scan != std :: find_if ( __first1 , __scan ,
  45370. std :: bind ( __pred , _1 , * __scan ) ) )
  45371. continue ;
  45372.  
  45373. auto __matches = std :: count_if ( __first2 , __last2 ,
  45374. std :: bind ( __pred , _1 , * __scan ) ) ;
  45375. if ( 0 == __matches
  45376. || std :: count_if ( __scan , __last1 ,
  45377. std :: bind ( __pred , _1 , * __scan ) ) != __matches )
  45378. return false ;
  45379. }
  45380. return true ;
  45381. }
  45382. #4364
  45383. template < typename _RandomAccessIterator ,
  45384. typename _UniformRandomNumberGenerator >
  45385. void
  45386. shuffle ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  45387. _UniformRandomNumberGenerator && __g )
  45388. {
  45389.  
  45390.  
  45391.  
  45392. ;
  45393.  
  45394. if ( __first == __last )
  45395. return ;
  45396.  
  45397. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  45398. _DistanceType ;
  45399.  
  45400. typedef typename std :: make_unsigned < _DistanceType > :: type __ud_type ;
  45401. typedef typename std :: uniform_int_distribution < __ud_type > __distr_type ;
  45402. typedef typename __distr_type :: param_type __p_type ;
  45403. __distr_type __d ;
  45404.  
  45405. for ( _RandomAccessIterator __i = __first + 1 ; __i != __last ; ++ __i )
  45406. std :: iter_swap ( __i , __first + __d ( __g , __p_type ( 0 , __i - __first ) ) ) ;
  45407. }
  45408. #4409
  45409. template < typename _InputIterator , typename _Function >
  45410. _Function
  45411. for_each ( _InputIterator __first , _InputIterator __last , _Function __f )
  45412. {
  45413.  
  45414.  
  45415. ;
  45416. for ( ; __first != __last ; ++ __first )
  45417. __f ( * __first ) ;
  45418. return std :: move ( __f ) ;
  45419. }
  45420. #4430
  45421. template < typename _InputIterator , typename _Tp >
  45422. inline _InputIterator
  45423. find ( _InputIterator __first , _InputIterator __last ,
  45424. const _Tp & __val )
  45425. {
  45426.  
  45427.  
  45428.  
  45429.  
  45430. ;
  45431. return std :: __find ( __first , __last , __val ,
  45432. std :: __iterator_category ( __first ) ) ;
  45433. }
  45434. #4454
  45435. template < typename _InputIterator , typename _Predicate >
  45436. inline _InputIterator
  45437. find_if ( _InputIterator __first , _InputIterator __last ,
  45438. _Predicate __pred )
  45439. {
  45440.  
  45441.  
  45442.  
  45443.  
  45444. ;
  45445. return std :: __find_if ( __first , __last , __pred ,
  45446. std :: __iterator_category ( __first ) ) ;
  45447. }
  45448. #4484
  45449. template < typename _InputIterator , typename _ForwardIterator >
  45450. _InputIterator
  45451. find_first_of ( _InputIterator __first1 , _InputIterator __last1 ,
  45452. _ForwardIterator __first2 , _ForwardIterator __last2 )
  45453. {
  45454. #4495
  45455. ;
  45456. ;
  45457.  
  45458. for ( ; __first1 != __last1 ; ++ __first1 )
  45459. for ( _ForwardIterator __iter = __first2 ; __iter != __last2 ; ++ __iter )
  45460. if ( * __first1 == * __iter )
  45461. return __first1 ;
  45462. return __last1 ;
  45463. }
  45464. #4524
  45465. template < typename _InputIterator , typename _ForwardIterator ,
  45466. typename _BinaryPredicate >
  45467. _InputIterator
  45468. find_first_of ( _InputIterator __first1 , _InputIterator __last1 ,
  45469. _ForwardIterator __first2 , _ForwardIterator __last2 ,
  45470. _BinaryPredicate __comp )
  45471. {
  45472. #4537
  45473. ;
  45474. ;
  45475.  
  45476. for ( ; __first1 != __last1 ; ++ __first1 )
  45477. for ( _ForwardIterator __iter = __first2 ; __iter != __last2 ; ++ __iter )
  45478. if ( __comp ( * __first1 , * __iter ) )
  45479. return __first1 ;
  45480. return __last1 ;
  45481. }
  45482. #4556
  45483. template < typename _ForwardIterator >
  45484. _ForwardIterator
  45485. adjacent_find ( _ForwardIterator __first , _ForwardIterator __last )
  45486. {
  45487.  
  45488.  
  45489.  
  45490.  
  45491. ;
  45492. if ( __first == __last )
  45493. return __last ;
  45494. _ForwardIterator __next = __first ;
  45495. while ( ++ __next != __last )
  45496. {
  45497. if ( * __first == * __next )
  45498. return __first ;
  45499. __first = __next ;
  45500. }
  45501. return __last ;
  45502. }
  45503. #4588
  45504. template < typename _ForwardIterator , typename _BinaryPredicate >
  45505. _ForwardIterator
  45506. adjacent_find ( _ForwardIterator __first , _ForwardIterator __last ,
  45507. _BinaryPredicate __binary_pred )
  45508. {
  45509.  
  45510.  
  45511.  
  45512.  
  45513.  
  45514. ;
  45515. if ( __first == __last )
  45516. return __last ;
  45517. _ForwardIterator __next = __first ;
  45518. while ( ++ __next != __last )
  45519. {
  45520. if ( __binary_pred ( * __first , * __next ) )
  45521. return __first ;
  45522. __first = __next ;
  45523. }
  45524. return __last ;
  45525. }
  45526. #4620
  45527. template < typename _InputIterator , typename _Tp >
  45528. typename iterator_traits < _InputIterator > :: difference_type
  45529. count ( _InputIterator __first , _InputIterator __last , const _Tp & __value )
  45530. {
  45531.  
  45532.  
  45533.  
  45534.  
  45535. ;
  45536. typename iterator_traits < _InputIterator > :: difference_type __n = 0 ;
  45537. for ( ; __first != __last ; ++ __first )
  45538. if ( * __first == __value )
  45539. ++ __n ;
  45540. return __n ;
  45541. }
  45542. #4645
  45543. template < typename _InputIterator , typename _Predicate >
  45544. typename iterator_traits < _InputIterator > :: difference_type
  45545. count_if ( _InputIterator __first , _InputIterator __last , _Predicate __pred )
  45546. {
  45547.  
  45548.  
  45549.  
  45550.  
  45551. ;
  45552. typename iterator_traits < _InputIterator > :: difference_type __n = 0 ;
  45553. for ( ; __first != __last ; ++ __first )
  45554. if ( __pred ( * __first ) )
  45555. ++ __n ;
  45556. return __n ;
  45557. }
  45558. #4687
  45559. template < typename _ForwardIterator1 , typename _ForwardIterator2 >
  45560. _ForwardIterator1
  45561. search ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  45562. _ForwardIterator2 __first2 , _ForwardIterator2 __last2 )
  45563. {
  45564. #4698
  45565. ;
  45566. ;
  45567.  
  45568.  
  45569. if ( __first1 == __last1 || __first2 == __last2 )
  45570. return __first1 ;
  45571.  
  45572.  
  45573. _ForwardIterator2 __p1 ( __first2 ) ;
  45574. if ( ++ __p1 == __last2 )
  45575. return std :: find ( __first1 , __last1 , * __first2 ) ;
  45576.  
  45577.  
  45578. _ForwardIterator2 __p ;
  45579. _ForwardIterator1 __current = __first1 ;
  45580.  
  45581. for ( ; ; )
  45582. {
  45583. __first1 = std :: find ( __first1 , __last1 , * __first2 ) ;
  45584. if ( __first1 == __last1 )
  45585. return __last1 ;
  45586.  
  45587. __p = __p1 ;
  45588. __current = __first1 ;
  45589. if ( ++ __current == __last1 )
  45590. return __last1 ;
  45591.  
  45592. while ( * __current == * __p )
  45593. {
  45594. if ( ++ __p == __last2 )
  45595. return __first1 ;
  45596. if ( ++ __current == __last1 )
  45597. return __last1 ;
  45598. }
  45599. ++ __first1 ;
  45600. }
  45601. return __first1 ;
  45602. }
  45603. #4758
  45604. template < typename _ForwardIterator1 , typename _ForwardIterator2 ,
  45605. typename _BinaryPredicate >
  45606. _ForwardIterator1
  45607. search ( _ForwardIterator1 __first1 , _ForwardIterator1 __last1 ,
  45608. _ForwardIterator2 __first2 , _ForwardIterator2 __last2 ,
  45609. _BinaryPredicate __predicate )
  45610. {
  45611. #4771
  45612. ;
  45613. ;
  45614.  
  45615.  
  45616. if ( __first1 == __last1 || __first2 == __last2 )
  45617. return __first1 ;
  45618.  
  45619.  
  45620. _ForwardIterator2 __p1 ( __first2 ) ;
  45621. if ( ++ __p1 == __last2 )
  45622. {
  45623. while ( __first1 != __last1
  45624. && ! bool ( __predicate ( * __first1 , * __first2 ) ) )
  45625. ++ __first1 ;
  45626. return __first1 ;
  45627. }
  45628.  
  45629.  
  45630. _ForwardIterator2 __p ;
  45631. _ForwardIterator1 __current = __first1 ;
  45632.  
  45633. for ( ; ; )
  45634. {
  45635. while ( __first1 != __last1
  45636. && ! bool ( __predicate ( * __first1 , * __first2 ) ) )
  45637. ++ __first1 ;
  45638. if ( __first1 == __last1 )
  45639. return __last1 ;
  45640.  
  45641. __p = __p1 ;
  45642. __current = __first1 ;
  45643. if ( ++ __current == __last1 )
  45644. return __last1 ;
  45645.  
  45646. while ( __predicate ( * __current , * __p ) )
  45647. {
  45648. if ( ++ __p == __last2 )
  45649. return __first1 ;
  45650. if ( ++ __current == __last1 )
  45651. return __last1 ;
  45652. }
  45653. ++ __first1 ;
  45654. }
  45655. return __first1 ;
  45656. }
  45657. #4833
  45658. template < typename _ForwardIterator , typename _Integer , typename _Tp >
  45659. _ForwardIterator
  45660. search_n ( _ForwardIterator __first , _ForwardIterator __last ,
  45661. _Integer __count , const _Tp & __val )
  45662. {
  45663.  
  45664.  
  45665.  
  45666.  
  45667. ;
  45668.  
  45669. if ( __count <= 0 )
  45670. return __first ;
  45671. if ( __count == 1 )
  45672. return std :: find ( __first , __last , __val ) ;
  45673. return std :: __search_n ( __first , __last , __count , __val ,
  45674. std :: __iterator_category ( __first ) ) ;
  45675. }
  45676. #4870
  45677. template < typename _ForwardIterator , typename _Integer , typename _Tp ,
  45678. typename _BinaryPredicate >
  45679. _ForwardIterator
  45680. search_n ( _ForwardIterator __first , _ForwardIterator __last ,
  45681. _Integer __count , const _Tp & __val ,
  45682. _BinaryPredicate __binary_pred )
  45683. {
  45684.  
  45685.  
  45686.  
  45687.  
  45688. ;
  45689.  
  45690. if ( __count <= 0 )
  45691. return __first ;
  45692. if ( __count == 1 )
  45693. {
  45694. while ( __first != __last && ! bool ( __binary_pred ( * __first , __val ) ) )
  45695. ++ __first ;
  45696. return __first ;
  45697. }
  45698. return std :: __search_n ( __first , __last , __count , __val , __binary_pred ,
  45699. std :: __iterator_category ( __first ) ) ;
  45700. }
  45701. #4912
  45702. template < typename _InputIterator , typename _OutputIterator ,
  45703. typename _UnaryOperation >
  45704. _OutputIterator
  45705. transform ( _InputIterator __first , _InputIterator __last ,
  45706. _OutputIterator __result , _UnaryOperation __unary_op )
  45707. {
  45708.  
  45709.  
  45710.  
  45711.  
  45712.  
  45713. ;
  45714.  
  45715. for ( ; __first != __last ; ++ __first , ++ __result )
  45716. * __result = __unary_op ( * __first ) ;
  45717. return __result ;
  45718. }
  45719. #4949
  45720. template < typename _InputIterator1 , typename _InputIterator2 ,
  45721. typename _OutputIterator , typename _BinaryOperation >
  45722. _OutputIterator
  45723. transform ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  45724. _InputIterator2 __first2 , _OutputIterator __result ,
  45725. _BinaryOperation __binary_op )
  45726. {
  45727. #4962
  45728. ;
  45729.  
  45730. for ( ; __first1 != __last1 ; ++ __first1 , ++ __first2 , ++ __result )
  45731. * __result = __binary_op ( * __first1 , * __first2 ) ;
  45732. return __result ;
  45733. }
  45734. #4982
  45735. template < typename _ForwardIterator , typename _Tp >
  45736. void
  45737. replace ( _ForwardIterator __first , _ForwardIterator __last ,
  45738. const _Tp & __old_value , const _Tp & __new_value )
  45739. {
  45740. #4994
  45741. ;
  45742.  
  45743. for ( ; __first != __last ; ++ __first )
  45744. if ( * __first == __old_value )
  45745. * __first = __new_value ;
  45746. }
  45747. #5014
  45748. template < typename _ForwardIterator , typename _Predicate , typename _Tp >
  45749. void
  45750. replace_if ( _ForwardIterator __first , _ForwardIterator __last ,
  45751. _Predicate __pred , const _Tp & __new_value )
  45752. {
  45753. #5026
  45754. ;
  45755.  
  45756. for ( ; __first != __last ; ++ __first )
  45757. if ( __pred ( * __first ) )
  45758. * __first = __new_value ;
  45759. }
  45760. #5046
  45761. template < typename _ForwardIterator , typename _Generator >
  45762. void
  45763. generate ( _ForwardIterator __first , _ForwardIterator __last ,
  45764. _Generator __gen )
  45765. {
  45766.  
  45767.  
  45768.  
  45769.  
  45770. ;
  45771.  
  45772. for ( ; __first != __last ; ++ __first )
  45773. * __first = __gen ( ) ;
  45774. }
  45775. #5077
  45776. template < typename _OutputIterator , typename _Size , typename _Generator >
  45777. _OutputIterator
  45778. generate_n ( _OutputIterator __first , _Size __n , _Generator __gen )
  45779. {
  45780.  
  45781.  
  45782.  
  45783.  
  45784.  
  45785. for ( __decltype ( __n + 0 ) __niter = __n ;
  45786. __niter > 0 ; -- __niter , ++ __first )
  45787. * __first = __gen ( ) ;
  45788. return __first ;
  45789. }
  45790. #5114
  45791. template < typename _InputIterator , typename _OutputIterator >
  45792. inline _OutputIterator
  45793. unique_copy ( _InputIterator __first , _InputIterator __last ,
  45794. _OutputIterator __result )
  45795. {
  45796. #5125
  45797. ;
  45798.  
  45799. if ( __first == __last )
  45800. return __result ;
  45801. return std :: __unique_copy ( __first , __last , __result ,
  45802. std :: __iterator_category ( __first ) ,
  45803. std :: __iterator_category ( __result ) ) ;
  45804. }
  45805. #5153
  45806. template < typename _InputIterator , typename _OutputIterator ,
  45807. typename _BinaryPredicate >
  45808. inline _OutputIterator
  45809. unique_copy ( _InputIterator __first , _InputIterator __last ,
  45810. _OutputIterator __result ,
  45811. _BinaryPredicate __binary_pred )
  45812. {
  45813.  
  45814.  
  45815.  
  45816.  
  45817. ;
  45818.  
  45819. if ( __first == __last )
  45820. return __result ;
  45821. return std :: __unique_copy ( __first , __last , __result , __binary_pred ,
  45822. std :: __iterator_category ( __first ) ,
  45823. std :: __iterator_category ( __result ) ) ;
  45824. }
  45825. #5185
  45826. template < typename _RandomAccessIterator >
  45827. inline void
  45828. random_shuffle ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  45829. {
  45830.  
  45831.  
  45832.  
  45833. ;
  45834.  
  45835. if ( __first != __last )
  45836. for ( _RandomAccessIterator __i = __first + 1 ; __i != __last ; ++ __i )
  45837. std :: iter_swap ( __i , __first + ( std :: rand ( ) % ( ( __i - __first ) + 1 ) ) ) ;
  45838. }
  45839. #5213
  45840. template < typename _RandomAccessIterator , typename _RandomNumberGenerator >
  45841. void
  45842. random_shuffle ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  45843.  
  45844. _RandomNumberGenerator && __rand )
  45845.  
  45846.  
  45847.  
  45848. {
  45849.  
  45850.  
  45851.  
  45852. ;
  45853.  
  45854. if ( __first == __last )
  45855. return ;
  45856. for ( _RandomAccessIterator __i = __first + 1 ; __i != __last ; ++ __i )
  45857. std :: iter_swap ( __i , __first + __rand ( ( __i - __first ) + 1 ) ) ;
  45858. }
  45859. #5249
  45860. template < typename _ForwardIterator , typename _Predicate >
  45861. inline _ForwardIterator
  45862. partition ( _ForwardIterator __first , _ForwardIterator __last ,
  45863. _Predicate __pred )
  45864. {
  45865.  
  45866.  
  45867.  
  45868.  
  45869.  
  45870. ;
  45871.  
  45872. return std :: __partition ( __first , __last , __pred ,
  45873. std :: __iterator_category ( __first ) ) ;
  45874. }
  45875. #5283
  45876. template < typename _RandomAccessIterator >
  45877. inline void
  45878. partial_sort ( _RandomAccessIterator __first ,
  45879. _RandomAccessIterator __middle ,
  45880. _RandomAccessIterator __last )
  45881. {
  45882. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  45883. _ValueType ;
  45884.  
  45885.  
  45886.  
  45887.  
  45888.  
  45889. ;
  45890. ;
  45891.  
  45892. std :: __heap_select ( __first , __middle , __last ) ;
  45893. std :: sort_heap ( __first , __middle ) ;
  45894. }
  45895. #5322
  45896. template < typename _RandomAccessIterator , typename _Compare >
  45897. inline void
  45898. partial_sort ( _RandomAccessIterator __first ,
  45899. _RandomAccessIterator __middle ,
  45900. _RandomAccessIterator __last ,
  45901. _Compare __comp )
  45902. {
  45903. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  45904. _ValueType ;
  45905. #5337
  45906. ;
  45907. ;
  45908.  
  45909. std :: __heap_select ( __first , __middle , __last , __comp ) ;
  45910. std :: sort_heap ( __first , __middle , __comp ) ;
  45911. }
  45912. #5359
  45913. template < typename _RandomAccessIterator >
  45914. inline void
  45915. nth_element ( _RandomAccessIterator __first , _RandomAccessIterator __nth ,
  45916. _RandomAccessIterator __last )
  45917. {
  45918. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  45919. _ValueType ;
  45920.  
  45921.  
  45922.  
  45923.  
  45924.  
  45925. ;
  45926. ;
  45927.  
  45928. if ( __first == __last || __nth == __last )
  45929. return ;
  45930.  
  45931. std :: __introselect ( __first , __nth , __last ,
  45932. std :: __lg ( __last - __first ) * 2 ) ;
  45933. }
  45934. #5398
  45935. template < typename _RandomAccessIterator , typename _Compare >
  45936. inline void
  45937. nth_element ( _RandomAccessIterator __first , _RandomAccessIterator __nth ,
  45938. _RandomAccessIterator __last , _Compare __comp )
  45939. {
  45940. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  45941. _ValueType ;
  45942. #5411
  45943. ;
  45944. ;
  45945.  
  45946. if ( __first == __last || __nth == __last )
  45947. return ;
  45948.  
  45949. std :: __introselect ( __first , __nth , __last ,
  45950. std :: __lg ( __last - __first ) * 2 , __comp ) ;
  45951. }
  45952. #5436
  45953. template < typename _RandomAccessIterator >
  45954. inline void
  45955. sort ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  45956. {
  45957. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  45958. _ValueType ;
  45959.  
  45960.  
  45961.  
  45962.  
  45963.  
  45964. ;
  45965.  
  45966. if ( __first != __last )
  45967. {
  45968. std :: __introsort_loop ( __first , __last ,
  45969. std :: __lg ( __last - __first ) * 2 ) ;
  45970. std :: __final_insertion_sort ( __first , __last ) ;
  45971. }
  45972. }
  45973. #5472
  45974. template < typename _RandomAccessIterator , typename _Compare >
  45975. inline void
  45976. sort ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  45977. _Compare __comp )
  45978. {
  45979. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  45980. _ValueType ;
  45981. #5485
  45982. ;
  45983.  
  45984. if ( __first != __last )
  45985. {
  45986. std :: __introsort_loop ( __first , __last ,
  45987. std :: __lg ( __last - __first ) * 2 , __comp ) ;
  45988. std :: __final_insertion_sort ( __first , __last , __comp ) ;
  45989. }
  45990. }
  45991. #5514
  45992. template < typename _InputIterator1 , typename _InputIterator2 ,
  45993. typename _OutputIterator >
  45994. _OutputIterator
  45995. merge ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  45996. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  45997. _OutputIterator __result )
  45998. {
  45999. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46000. _ValueType1 ;
  46001. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46002. _ValueType2 ;
  46003. #5534
  46004. ;
  46005. ;
  46006.  
  46007. while ( __first1 != __last1 && __first2 != __last2 )
  46008. {
  46009. if ( * __first2 < * __first1 )
  46010. {
  46011. * __result = * __first2 ;
  46012. ++ __first2 ;
  46013. }
  46014. else
  46015. {
  46016. * __result = * __first1 ;
  46017. ++ __first1 ;
  46018. }
  46019. ++ __result ;
  46020. }
  46021. return std :: copy ( __first2 , __last2 , std :: copy ( __first1 , __last1 ,
  46022. __result ) ) ;
  46023. }
  46024. #5578
  46025. template < typename _InputIterator1 , typename _InputIterator2 ,
  46026. typename _OutputIterator , typename _Compare >
  46027. _OutputIterator
  46028. merge ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46029. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46030. _OutputIterator __result , _Compare __comp )
  46031. {
  46032. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46033. _ValueType1 ;
  46034. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46035. _ValueType2 ;
  46036. #5599
  46037. ;
  46038. ;
  46039.  
  46040. while ( __first1 != __last1 && __first2 != __last2 )
  46041. {
  46042. if ( __comp ( * __first2 , * __first1 ) )
  46043. {
  46044. * __result = * __first2 ;
  46045. ++ __first2 ;
  46046. }
  46047. else
  46048. {
  46049. * __result = * __first1 ;
  46050. ++ __first1 ;
  46051. }
  46052. ++ __result ;
  46053. }
  46054. return std :: copy ( __first2 , __last2 , std :: copy ( __first1 , __last1 ,
  46055. __result ) ) ;
  46056. }
  46057. #5638
  46058. template < typename _RandomAccessIterator >
  46059. inline void
  46060. stable_sort ( _RandomAccessIterator __first , _RandomAccessIterator __last )
  46061. {
  46062. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  46063. _ValueType ;
  46064. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  46065. _DistanceType ;
  46066.  
  46067.  
  46068.  
  46069.  
  46070.  
  46071. ;
  46072.  
  46073. _Temporary_buffer < _RandomAccessIterator , _ValueType > __buf ( __first ,
  46074. __last ) ;
  46075. if ( __buf . begin ( ) == 0 )
  46076. std :: __inplace_stable_sort ( __first , __last ) ;
  46077. else
  46078. std :: __stable_sort_adaptive ( __first , __last , __buf . begin ( ) ,
  46079. _DistanceType ( __buf . size ( ) ) ) ;
  46080. }
  46081. #5680
  46082. template < typename _RandomAccessIterator , typename _Compare >
  46083. inline void
  46084. stable_sort ( _RandomAccessIterator __first , _RandomAccessIterator __last ,
  46085. _Compare __comp )
  46086. {
  46087. typedef typename iterator_traits < _RandomAccessIterator > :: value_type
  46088. _ValueType ;
  46089. typedef typename iterator_traits < _RandomAccessIterator > :: difference_type
  46090. _DistanceType ;
  46091. #5696
  46092. ;
  46093.  
  46094. _Temporary_buffer < _RandomAccessIterator , _ValueType > __buf ( __first ,
  46095. __last ) ;
  46096. if ( __buf . begin ( ) == 0 )
  46097. std :: __inplace_stable_sort ( __first , __last , __comp ) ;
  46098. else
  46099. std :: __stable_sort_adaptive ( __first , __last , __buf . begin ( ) ,
  46100. _DistanceType ( __buf . size ( ) ) , __comp ) ;
  46101. }
  46102. #5726
  46103. template < typename _InputIterator1 , typename _InputIterator2 ,
  46104. typename _OutputIterator >
  46105. _OutputIterator
  46106. set_union ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46107. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46108. _OutputIterator __result )
  46109. {
  46110. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46111. _ValueType1 ;
  46112. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46113. _ValueType2 ;
  46114. #5747
  46115. ;
  46116. ;
  46117.  
  46118. while ( __first1 != __last1 && __first2 != __last2 )
  46119. {
  46120. if ( * __first1 < * __first2 )
  46121. {
  46122. * __result = * __first1 ;
  46123. ++ __first1 ;
  46124. }
  46125. else if ( * __first2 < * __first1 )
  46126. {
  46127. * __result = * __first2 ;
  46128. ++ __first2 ;
  46129. }
  46130. else
  46131. {
  46132. * __result = * __first1 ;
  46133. ++ __first1 ;
  46134. ++ __first2 ;
  46135. }
  46136. ++ __result ;
  46137. }
  46138. return std :: copy ( __first2 , __last2 , std :: copy ( __first1 , __last1 ,
  46139. __result ) ) ;
  46140. }
  46141. #5793
  46142. template < typename _InputIterator1 , typename _InputIterator2 ,
  46143. typename _OutputIterator , typename _Compare >
  46144. _OutputIterator
  46145. set_union ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46146. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46147. _OutputIterator __result , _Compare __comp )
  46148. {
  46149. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46150. _ValueType1 ;
  46151. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46152. _ValueType2 ;
  46153. #5816
  46154. ;
  46155. ;
  46156.  
  46157. while ( __first1 != __last1 && __first2 != __last2 )
  46158. {
  46159. if ( __comp ( * __first1 , * __first2 ) )
  46160. {
  46161. * __result = * __first1 ;
  46162. ++ __first1 ;
  46163. }
  46164. else if ( __comp ( * __first2 , * __first1 ) )
  46165. {
  46166. * __result = * __first2 ;
  46167. ++ __first2 ;
  46168. }
  46169. else
  46170. {
  46171. * __result = * __first1 ;
  46172. ++ __first1 ;
  46173. ++ __first2 ;
  46174. }
  46175. ++ __result ;
  46176. }
  46177. return std :: copy ( __first2 , __last2 , std :: copy ( __first1 , __last1 ,
  46178. __result ) ) ;
  46179. }
  46180. #5860
  46181. template < typename _InputIterator1 , typename _InputIterator2 ,
  46182. typename _OutputIterator >
  46183. _OutputIterator
  46184. set_intersection ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46185. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46186. _OutputIterator __result )
  46187. {
  46188. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46189. _ValueType1 ;
  46190. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46191. _ValueType2 ;
  46192. #5879
  46193. ;
  46194. ;
  46195.  
  46196. while ( __first1 != __last1 && __first2 != __last2 )
  46197. if ( * __first1 < * __first2 )
  46198. ++ __first1 ;
  46199. else if ( * __first2 < * __first1 )
  46200. ++ __first2 ;
  46201. else
  46202. {
  46203. * __result = * __first1 ;
  46204. ++ __first1 ;
  46205. ++ __first2 ;
  46206. ++ __result ;
  46207. }
  46208. return __result ;
  46209. }
  46210. #5917
  46211. template < typename _InputIterator1 , typename _InputIterator2 ,
  46212. typename _OutputIterator , typename _Compare >
  46213. _OutputIterator
  46214. set_intersection ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46215. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46216. _OutputIterator __result , _Compare __comp )
  46217. {
  46218. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46219. _ValueType1 ;
  46220. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46221. _ValueType2 ;
  46222. #5938
  46223. ;
  46224. ;
  46225.  
  46226. while ( __first1 != __last1 && __first2 != __last2 )
  46227. if ( __comp ( * __first1 , * __first2 ) )
  46228. ++ __first1 ;
  46229. else if ( __comp ( * __first2 , * __first1 ) )
  46230. ++ __first2 ;
  46231. else
  46232. {
  46233. * __result = * __first1 ;
  46234. ++ __first1 ;
  46235. ++ __first2 ;
  46236. ++ __result ;
  46237. }
  46238. return __result ;
  46239. }
  46240. #5975
  46241. template < typename _InputIterator1 , typename _InputIterator2 ,
  46242. typename _OutputIterator >
  46243. _OutputIterator
  46244. set_difference ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46245. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46246. _OutputIterator __result )
  46247. {
  46248. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46249. _ValueType1 ;
  46250. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46251. _ValueType2 ;
  46252. #5994
  46253. ;
  46254. ;
  46255.  
  46256. while ( __first1 != __last1 && __first2 != __last2 )
  46257. if ( * __first1 < * __first2 )
  46258. {
  46259. * __result = * __first1 ;
  46260. ++ __first1 ;
  46261. ++ __result ;
  46262. }
  46263. else if ( * __first2 < * __first1 )
  46264. ++ __first2 ;
  46265. else
  46266. {
  46267. ++ __first1 ;
  46268. ++ __first2 ;
  46269. }
  46270. return std :: copy ( __first1 , __last1 , __result ) ;
  46271. }
  46272. #6036
  46273. template < typename _InputIterator1 , typename _InputIterator2 ,
  46274. typename _OutputIterator , typename _Compare >
  46275. _OutputIterator
  46276. set_difference ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46277. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46278. _OutputIterator __result , _Compare __comp )
  46279. {
  46280. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46281. _ValueType1 ;
  46282. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46283. _ValueType2 ;
  46284. #6057
  46285. ;
  46286. ;
  46287.  
  46288. while ( __first1 != __last1 && __first2 != __last2 )
  46289. if ( __comp ( * __first1 , * __first2 ) )
  46290. {
  46291. * __result = * __first1 ;
  46292. ++ __first1 ;
  46293. ++ __result ;
  46294. }
  46295. else if ( __comp ( * __first2 , * __first1 ) )
  46296. ++ __first2 ;
  46297. else
  46298. {
  46299. ++ __first1 ;
  46300. ++ __first2 ;
  46301. }
  46302. return std :: copy ( __first1 , __last1 , __result ) ;
  46303. }
  46304. #6094
  46305. template < typename _InputIterator1 , typename _InputIterator2 ,
  46306. typename _OutputIterator >
  46307. _OutputIterator
  46308. set_symmetric_difference ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46309. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46310. _OutputIterator __result )
  46311. {
  46312. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46313. _ValueType1 ;
  46314. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46315. _ValueType2 ;
  46316. #6115
  46317. ;
  46318. ;
  46319.  
  46320. while ( __first1 != __last1 && __first2 != __last2 )
  46321. if ( * __first1 < * __first2 )
  46322. {
  46323. * __result = * __first1 ;
  46324. ++ __first1 ;
  46325. ++ __result ;
  46326. }
  46327. else if ( * __first2 < * __first1 )
  46328. {
  46329. * __result = * __first2 ;
  46330. ++ __first2 ;
  46331. ++ __result ;
  46332. }
  46333. else
  46334. {
  46335. ++ __first1 ;
  46336. ++ __first2 ;
  46337. }
  46338. return std :: copy ( __first2 , __last2 , std :: copy ( __first1 ,
  46339. __last1 , __result ) ) ;
  46340. }
  46341. #6160
  46342. template < typename _InputIterator1 , typename _InputIterator2 ,
  46343. typename _OutputIterator , typename _Compare >
  46344. _OutputIterator
  46345. set_symmetric_difference ( _InputIterator1 __first1 , _InputIterator1 __last1 ,
  46346. _InputIterator2 __first2 , _InputIterator2 __last2 ,
  46347. _OutputIterator __result ,
  46348. _Compare __comp )
  46349. {
  46350. typedef typename iterator_traits < _InputIterator1 > :: value_type
  46351. _ValueType1 ;
  46352. typedef typename iterator_traits < _InputIterator2 > :: value_type
  46353. _ValueType2 ;
  46354. #6184
  46355. ;
  46356. ;
  46357.  
  46358. while ( __first1 != __last1 && __first2 != __last2 )
  46359. if ( __comp ( * __first1 , * __first2 ) )
  46360. {
  46361. * __result = * __first1 ;
  46362. ++ __first1 ;
  46363. ++ __result ;
  46364. }
  46365. else if ( __comp ( * __first2 , * __first1 ) )
  46366. {
  46367. * __result = * __first2 ;
  46368. ++ __first2 ;
  46369. ++ __result ;
  46370. }
  46371. else
  46372. {
  46373. ++ __first1 ;
  46374. ++ __first2 ;
  46375. }
  46376. return std :: copy ( __first2 , __last2 ,
  46377. std :: copy ( __first1 , __last1 , __result ) ) ;
  46378. }
  46379. #6217
  46380. template < typename _ForwardIterator >
  46381. _ForwardIterator
  46382. min_element ( _ForwardIterator __first , _ForwardIterator __last )
  46383. {
  46384.  
  46385.  
  46386.  
  46387.  
  46388. ;
  46389.  
  46390. if ( __first == __last )
  46391. return __first ;
  46392. _ForwardIterator __result = __first ;
  46393. while ( ++ __first != __last )
  46394. if ( * __first < * __result )
  46395. __result = __first ;
  46396. return __result ;
  46397. }
  46398. #6245
  46399. template < typename _ForwardIterator , typename _Compare >
  46400. _ForwardIterator
  46401. min_element ( _ForwardIterator __first , _ForwardIterator __last ,
  46402. _Compare __comp )
  46403. {
  46404.  
  46405.  
  46406.  
  46407.  
  46408.  
  46409. ;
  46410.  
  46411. if ( __first == __last )
  46412. return __first ;
  46413. _ForwardIterator __result = __first ;
  46414. while ( ++ __first != __last )
  46415. if ( __comp ( * __first , * __result ) )
  46416. __result = __first ;
  46417. return __result ;
  46418. }
  46419. #6273
  46420. template < typename _ForwardIterator >
  46421. _ForwardIterator
  46422. max_element ( _ForwardIterator __first , _ForwardIterator __last )
  46423. {
  46424.  
  46425.  
  46426.  
  46427.  
  46428. ;
  46429.  
  46430. if ( __first == __last )
  46431. return __first ;
  46432. _ForwardIterator __result = __first ;
  46433. while ( ++ __first != __last )
  46434. if ( * __result < * __first )
  46435. __result = __first ;
  46436. return __result ;
  46437. }
  46438. #6301
  46439. template < typename _ForwardIterator , typename _Compare >
  46440. _ForwardIterator
  46441. max_element ( _ForwardIterator __first , _ForwardIterator __last ,
  46442. _Compare __comp )
  46443. {
  46444.  
  46445.  
  46446.  
  46447.  
  46448.  
  46449. ;
  46450.  
  46451. if ( __first == __last ) return __first ;
  46452. _ForwardIterator __result = __first ;
  46453. while ( ++ __first != __last )
  46454. if ( __comp ( * __result , * __first ) )
  46455. __result = __first ;
  46456. return __result ;
  46457. }
  46458.  
  46459.  
  46460. }
  46461. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/map"
  46462. #58
  46463. #pragma GCC system_header
  46464. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_tree.h"
  46465. #69
  46466. namespace std
  46467. {
  46468. #89
  46469. enum _Rb_tree_color { _S_red = false , _S_black = true } ;
  46470.  
  46471. struct _Rb_tree_node_base
  46472. {
  46473. typedef _Rb_tree_node_base * _Base_ptr ;
  46474. typedef const _Rb_tree_node_base * _Const_Base_ptr ;
  46475.  
  46476. _Rb_tree_color _M_color ;
  46477. _Base_ptr _M_parent ;
  46478. _Base_ptr _M_left ;
  46479. _Base_ptr _M_right ;
  46480.  
  46481. static _Base_ptr
  46482. _S_minimum ( _Base_ptr __x )
  46483. {
  46484. while ( __x -> _M_left != 0 ) __x = __x -> _M_left ;
  46485. return __x ;
  46486. }
  46487.  
  46488. static _Const_Base_ptr
  46489. _S_minimum ( _Const_Base_ptr __x )
  46490. {
  46491. while ( __x -> _M_left != 0 ) __x = __x -> _M_left ;
  46492. return __x ;
  46493. }
  46494.  
  46495. static _Base_ptr
  46496. _S_maximum ( _Base_ptr __x )
  46497. {
  46498. while ( __x -> _M_right != 0 ) __x = __x -> _M_right ;
  46499. return __x ;
  46500. }
  46501.  
  46502. static _Const_Base_ptr
  46503. _S_maximum ( _Const_Base_ptr __x )
  46504. {
  46505. while ( __x -> _M_right != 0 ) __x = __x -> _M_right ;
  46506. return __x ;
  46507. }
  46508. } ;
  46509.  
  46510. template < typename _Val >
  46511. struct _Rb_tree_node : public _Rb_tree_node_base
  46512. {
  46513. typedef _Rb_tree_node < _Val > * _Link_type ;
  46514. _Val _M_value_field ;
  46515.  
  46516.  
  46517. template < typename ... _Args >
  46518. _Rb_tree_node ( _Args && ... __args )
  46519. : _Rb_tree_node_base ( ) ,
  46520. _M_value_field ( std :: forward < _Args > ( __args ) ... ) { }
  46521.  
  46522. } ;
  46523.  
  46524. __attribute__ ( ( __pure__ ) ) _Rb_tree_node_base *
  46525. _Rb_tree_increment ( _Rb_tree_node_base * __x ) throw ( ) ;
  46526.  
  46527. __attribute__ ( ( __pure__ ) ) const _Rb_tree_node_base *
  46528. _Rb_tree_increment ( const _Rb_tree_node_base * __x ) throw ( ) ;
  46529.  
  46530. __attribute__ ( ( __pure__ ) ) _Rb_tree_node_base *
  46531. _Rb_tree_decrement ( _Rb_tree_node_base * __x ) throw ( ) ;
  46532.  
  46533. __attribute__ ( ( __pure__ ) ) const _Rb_tree_node_base *
  46534. _Rb_tree_decrement ( const _Rb_tree_node_base * __x ) throw ( ) ;
  46535.  
  46536. template < typename _Tp >
  46537. struct _Rb_tree_iterator
  46538. {
  46539. typedef _Tp value_type ;
  46540. typedef _Tp & reference ;
  46541. typedef _Tp * pointer ;
  46542.  
  46543. typedef bidirectional_iterator_tag iterator_category ;
  46544. typedef ptrdiff_t difference_type ;
  46545.  
  46546. typedef _Rb_tree_iterator < _Tp > _Self ;
  46547. typedef _Rb_tree_node_base :: _Base_ptr _Base_ptr ;
  46548. typedef _Rb_tree_node < _Tp > * _Link_type ;
  46549.  
  46550. _Rb_tree_iterator ( )
  46551. : _M_node ( ) { }
  46552.  
  46553. explicit
  46554. _Rb_tree_iterator ( _Link_type __x )
  46555. : _M_node ( __x ) { }
  46556.  
  46557. reference
  46558. operator * ( ) const
  46559. { return static_cast < _Link_type > ( _M_node ) -> _M_value_field ; }
  46560.  
  46561. pointer
  46562. operator -> ( ) const
  46563. { return std :: __addressof ( static_cast < _Link_type >
  46564. ( _M_node ) -> _M_value_field ) ; }
  46565.  
  46566. _Self &
  46567. operator ++ ( )
  46568. {
  46569. _M_node = _Rb_tree_increment ( _M_node ) ;
  46570. return * this ;
  46571. }
  46572.  
  46573. _Self
  46574. operator ++ ( int )
  46575. {
  46576. _Self __tmp = * this ;
  46577. _M_node = _Rb_tree_increment ( _M_node ) ;
  46578. return __tmp ;
  46579. }
  46580.  
  46581. _Self &
  46582. operator -- ( )
  46583. {
  46584. _M_node = _Rb_tree_decrement ( _M_node ) ;
  46585. return * this ;
  46586. }
  46587.  
  46588. _Self
  46589. operator -- ( int )
  46590. {
  46591. _Self __tmp = * this ;
  46592. _M_node = _Rb_tree_decrement ( _M_node ) ;
  46593. return __tmp ;
  46594. }
  46595.  
  46596. bool
  46597. operator == ( const _Self & __x ) const
  46598. { return _M_node == __x . _M_node ; }
  46599.  
  46600. bool
  46601. operator != ( const _Self & __x ) const
  46602. { return _M_node != __x . _M_node ; }
  46603.  
  46604. _Base_ptr _M_node ;
  46605. } ;
  46606.  
  46607. template < typename _Tp >
  46608. struct _Rb_tree_const_iterator
  46609. {
  46610. typedef _Tp value_type ;
  46611. typedef const _Tp & reference ;
  46612. typedef const _Tp * pointer ;
  46613.  
  46614. typedef _Rb_tree_iterator < _Tp > iterator ;
  46615.  
  46616. typedef bidirectional_iterator_tag iterator_category ;
  46617. typedef ptrdiff_t difference_type ;
  46618.  
  46619. typedef _Rb_tree_const_iterator < _Tp > _Self ;
  46620. typedef _Rb_tree_node_base :: _Const_Base_ptr _Base_ptr ;
  46621. typedef const _Rb_tree_node < _Tp > * _Link_type ;
  46622.  
  46623. _Rb_tree_const_iterator ( )
  46624. : _M_node ( ) { }
  46625.  
  46626. explicit
  46627. _Rb_tree_const_iterator ( _Link_type __x )
  46628. : _M_node ( __x ) { }
  46629.  
  46630. _Rb_tree_const_iterator ( const iterator & __it )
  46631. : _M_node ( __it . _M_node ) { }
  46632.  
  46633. iterator
  46634. _M_const_cast ( ) const
  46635. { return iterator ( static_cast < typename iterator :: _Link_type >
  46636. ( const_cast < typename iterator :: _Base_ptr > ( _M_node ) ) ) ; }
  46637.  
  46638. reference
  46639. operator * ( ) const
  46640. { return static_cast < _Link_type > ( _M_node ) -> _M_value_field ; }
  46641.  
  46642. pointer
  46643. operator -> ( ) const
  46644. { return std :: __addressof ( static_cast < _Link_type >
  46645. ( _M_node ) -> _M_value_field ) ; }
  46646.  
  46647. _Self &
  46648. operator ++ ( )
  46649. {
  46650. _M_node = _Rb_tree_increment ( _M_node ) ;
  46651. return * this ;
  46652. }
  46653.  
  46654. _Self
  46655. operator ++ ( int )
  46656. {
  46657. _Self __tmp = * this ;
  46658. _M_node = _Rb_tree_increment ( _M_node ) ;
  46659. return __tmp ;
  46660. }
  46661.  
  46662. _Self &
  46663. operator -- ( )
  46664. {
  46665. _M_node = _Rb_tree_decrement ( _M_node ) ;
  46666. return * this ;
  46667. }
  46668.  
  46669. _Self
  46670. operator -- ( int )
  46671. {
  46672. _Self __tmp = * this ;
  46673. _M_node = _Rb_tree_decrement ( _M_node ) ;
  46674. return __tmp ;
  46675. }
  46676.  
  46677. bool
  46678. operator == ( const _Self & __x ) const
  46679. { return _M_node == __x . _M_node ; }
  46680.  
  46681. bool
  46682. operator != ( const _Self & __x ) const
  46683. { return _M_node != __x . _M_node ; }
  46684.  
  46685. _Base_ptr _M_node ;
  46686. } ;
  46687.  
  46688. template < typename _Val >
  46689. inline bool
  46690. operator == ( const _Rb_tree_iterator < _Val > & __x ,
  46691. const _Rb_tree_const_iterator < _Val > & __y )
  46692. { return __x . _M_node == __y . _M_node ; }
  46693.  
  46694. template < typename _Val >
  46695. inline bool
  46696. operator != ( const _Rb_tree_iterator < _Val > & __x ,
  46697. const _Rb_tree_const_iterator < _Val > & __y )
  46698. { return __x . _M_node != __y . _M_node ; }
  46699.  
  46700. void
  46701. _Rb_tree_insert_and_rebalance ( const bool __insert_left ,
  46702. _Rb_tree_node_base * __x ,
  46703. _Rb_tree_node_base * __p ,
  46704. _Rb_tree_node_base & __header ) throw ( ) ;
  46705.  
  46706. _Rb_tree_node_base *
  46707. _Rb_tree_rebalance_for_erase ( _Rb_tree_node_base * const __z ,
  46708. _Rb_tree_node_base & __header ) throw ( ) ;
  46709.  
  46710.  
  46711. template < typename _Key , typename _Val , typename _KeyOfValue ,
  46712. typename _Compare , typename _Alloc = allocator < _Val > >
  46713. class _Rb_tree
  46714. {
  46715. typedef typename _Alloc :: template rebind < _Rb_tree_node < _Val > > :: other
  46716. _Node_allocator ;
  46717.  
  46718. protected :
  46719. typedef _Rb_tree_node_base * _Base_ptr ;
  46720. typedef const _Rb_tree_node_base * _Const_Base_ptr ;
  46721.  
  46722. public :
  46723. typedef _Key key_type ;
  46724. typedef _Val value_type ;
  46725. typedef value_type * pointer ;
  46726. typedef const value_type * const_pointer ;
  46727. typedef value_type & reference ;
  46728. typedef const value_type & const_reference ;
  46729. typedef _Rb_tree_node < _Val > * _Link_type ;
  46730. typedef const _Rb_tree_node < _Val > * _Const_Link_type ;
  46731. typedef size_t size_type ;
  46732. typedef ptrdiff_t difference_type ;
  46733. typedef _Alloc allocator_type ;
  46734.  
  46735. _Node_allocator &
  46736. _M_get_Node_allocator ( ) noexcept
  46737. { return * static_cast < _Node_allocator * > ( & this -> _M_impl ) ; }
  46738.  
  46739. const _Node_allocator &
  46740. _M_get_Node_allocator ( ) const noexcept
  46741. { return * static_cast < const _Node_allocator * > ( & this -> _M_impl ) ; }
  46742.  
  46743. allocator_type
  46744. get_allocator ( ) const noexcept
  46745. { return allocator_type ( _M_get_Node_allocator ( ) ) ; }
  46746.  
  46747. protected :
  46748. _Link_type
  46749. _M_get_node ( )
  46750. { return _M_impl . _Node_allocator :: allocate ( 1 ) ; }
  46751.  
  46752. void
  46753. _M_put_node ( _Link_type __p )
  46754. { _M_impl . _Node_allocator :: deallocate ( __p , 1 ) ; }
  46755. #399
  46756. template < typename ... _Args >
  46757. _Link_type
  46758. _M_create_node ( _Args && ... __args )
  46759. {
  46760. _Link_type __tmp = _M_get_node ( ) ;
  46761. try
  46762. {
  46763. allocator_traits < _Node_allocator > ::
  46764. construct ( _M_get_Node_allocator ( ) , __tmp ,
  46765. std :: forward < _Args > ( __args ) ... ) ;
  46766. }
  46767. catch ( ... )
  46768. {
  46769. _M_put_node ( __tmp ) ;
  46770. throw ;
  46771. }
  46772. return __tmp ;
  46773. }
  46774.  
  46775. void
  46776. _M_destroy_node ( _Link_type __p )
  46777. {
  46778. _M_get_Node_allocator ( ) . destroy ( __p ) ;
  46779. _M_put_node ( __p ) ;
  46780. }
  46781.  
  46782.  
  46783. _Link_type
  46784. _M_clone_node ( _Const_Link_type __x )
  46785. {
  46786. _Link_type __tmp = _M_create_node ( __x -> _M_value_field ) ;
  46787. __tmp -> _M_color = __x -> _M_color ;
  46788. __tmp -> _M_left = 0 ;
  46789. __tmp -> _M_right = 0 ;
  46790. return __tmp ;
  46791. }
  46792.  
  46793. protected :
  46794. template < typename _Key_compare ,
  46795. bool _Is_pod_comparator = __oracle_is_pod ( _Key_compare ) >
  46796. struct _Rb_tree_impl : public _Node_allocator
  46797. {
  46798. _Key_compare _M_key_compare ;
  46799. _Rb_tree_node_base _M_header ;
  46800. size_type _M_node_count ;
  46801.  
  46802. _Rb_tree_impl ( )
  46803. : _Node_allocator ( ) , _M_key_compare ( ) , _M_header ( ) ,
  46804. _M_node_count ( 0 )
  46805. { _M_initialize ( ) ; }
  46806.  
  46807. _Rb_tree_impl ( const _Key_compare & __comp , const _Node_allocator & __a )
  46808. : _Node_allocator ( __a ) , _M_key_compare ( __comp ) , _M_header ( ) ,
  46809. _M_node_count ( 0 )
  46810. { _M_initialize ( ) ; }
  46811.  
  46812.  
  46813. _Rb_tree_impl ( const _Key_compare & __comp , _Node_allocator && __a )
  46814. : _Node_allocator ( std :: move ( __a ) ) , _M_key_compare ( __comp ) ,
  46815. _M_header ( ) , _M_node_count ( 0 )
  46816. { _M_initialize ( ) ; }
  46817.  
  46818.  
  46819. private :
  46820. void
  46821. _M_initialize ( )
  46822. {
  46823. this -> _M_header . _M_color = _S_red ;
  46824. this -> _M_header . _M_parent = 0 ;
  46825. this -> _M_header . _M_left = & this -> _M_header ;
  46826. this -> _M_header . _M_right = & this -> _M_header ;
  46827. }
  46828. } ;
  46829.  
  46830. _Rb_tree_impl < _Compare > _M_impl ;
  46831.  
  46832. protected :
  46833. _Base_ptr &
  46834. _M_root ( )
  46835. { return this -> _M_impl . _M_header . _M_parent ; }
  46836.  
  46837. _Const_Base_ptr
  46838. _M_root ( ) const
  46839. { return this -> _M_impl . _M_header . _M_parent ; }
  46840.  
  46841. _Base_ptr &
  46842. _M_leftmost ( )
  46843. { return this -> _M_impl . _M_header . _M_left ; }
  46844.  
  46845. _Const_Base_ptr
  46846. _M_leftmost ( ) const
  46847. { return this -> _M_impl . _M_header . _M_left ; }
  46848.  
  46849. _Base_ptr &
  46850. _M_rightmost ( )
  46851. { return this -> _M_impl . _M_header . _M_right ; }
  46852.  
  46853. _Const_Base_ptr
  46854. _M_rightmost ( ) const
  46855. { return this -> _M_impl . _M_header . _M_right ; }
  46856.  
  46857. _Link_type
  46858. _M_begin ( )
  46859. { return static_cast < _Link_type > ( this -> _M_impl . _M_header . _M_parent ) ; }
  46860.  
  46861. _Const_Link_type
  46862. _M_begin ( ) const
  46863. {
  46864. return static_cast < _Const_Link_type >
  46865. ( this -> _M_impl . _M_header . _M_parent ) ;
  46866. }
  46867.  
  46868. _Link_type
  46869. _M_end ( )
  46870. { return static_cast < _Link_type > ( & this -> _M_impl . _M_header ) ; }
  46871.  
  46872. _Const_Link_type
  46873. _M_end ( ) const
  46874. { return static_cast < _Const_Link_type > ( & this -> _M_impl . _M_header ) ; }
  46875.  
  46876. static const_reference
  46877. _S_value ( _Const_Link_type __x )
  46878. { return __x -> _M_value_field ; }
  46879.  
  46880. static const _Key &
  46881. _S_key ( _Const_Link_type __x )
  46882. { return _KeyOfValue ( ) ( _S_value ( __x ) ) ; }
  46883.  
  46884. static _Link_type
  46885. _S_left ( _Base_ptr __x )
  46886. { return static_cast < _Link_type > ( __x -> _M_left ) ; }
  46887.  
  46888. static _Const_Link_type
  46889. _S_left ( _Const_Base_ptr __x )
  46890. { return static_cast < _Const_Link_type > ( __x -> _M_left ) ; }
  46891.  
  46892. static _Link_type
  46893. _S_right ( _Base_ptr __x )
  46894. { return static_cast < _Link_type > ( __x -> _M_right ) ; }
  46895.  
  46896. static _Const_Link_type
  46897. _S_right ( _Const_Base_ptr __x )
  46898. { return static_cast < _Const_Link_type > ( __x -> _M_right ) ; }
  46899.  
  46900. static const_reference
  46901. _S_value ( _Const_Base_ptr __x )
  46902. { return static_cast < _Const_Link_type > ( __x ) -> _M_value_field ; }
  46903.  
  46904. static const _Key &
  46905. _S_key ( _Const_Base_ptr __x )
  46906. { return _KeyOfValue ( ) ( _S_value ( __x ) ) ; }
  46907.  
  46908. static _Base_ptr
  46909. _S_minimum ( _Base_ptr __x )
  46910. { return _Rb_tree_node_base :: _S_minimum ( __x ) ; }
  46911.  
  46912. static _Const_Base_ptr
  46913. _S_minimum ( _Const_Base_ptr __x )
  46914. { return _Rb_tree_node_base :: _S_minimum ( __x ) ; }
  46915.  
  46916. static _Base_ptr
  46917. _S_maximum ( _Base_ptr __x )
  46918. { return _Rb_tree_node_base :: _S_maximum ( __x ) ; }
  46919.  
  46920. static _Const_Base_ptr
  46921. _S_maximum ( _Const_Base_ptr __x )
  46922. { return _Rb_tree_node_base :: _S_maximum ( __x ) ; }
  46923.  
  46924. public :
  46925. typedef _Rb_tree_iterator < value_type > iterator ;
  46926. typedef _Rb_tree_const_iterator < value_type > const_iterator ;
  46927.  
  46928. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  46929. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  46930.  
  46931. private :
  46932. pair < _Base_ptr , _Base_ptr >
  46933. _M_get_insert_unique_pos ( const key_type & __k ) ;
  46934.  
  46935. pair < _Base_ptr , _Base_ptr >
  46936. _M_get_insert_equal_pos ( const key_type & __k ) ;
  46937.  
  46938. pair < _Base_ptr , _Base_ptr >
  46939. _M_get_insert_hint_unique_pos ( const_iterator __pos ,
  46940. const key_type & __k ) ;
  46941.  
  46942. pair < _Base_ptr , _Base_ptr >
  46943. _M_get_insert_hint_equal_pos ( const_iterator __pos ,
  46944. const key_type & __k ) ;
  46945.  
  46946.  
  46947. template < typename _Arg >
  46948. iterator
  46949. _M_insert_ ( _Base_ptr __x , _Base_ptr __y , _Arg && __v ) ;
  46950.  
  46951. iterator
  46952. _M_insert_node ( _Base_ptr __x , _Base_ptr __y , _Link_type __z ) ;
  46953.  
  46954. template < typename _Arg >
  46955. iterator
  46956. _M_insert_lower ( _Base_ptr __y , _Arg && __v ) ;
  46957.  
  46958. template < typename _Arg >
  46959. iterator
  46960. _M_insert_equal_lower ( _Arg && __x ) ;
  46961.  
  46962. iterator
  46963. _M_insert_lower_node ( _Base_ptr __p , _Link_type __z ) ;
  46964.  
  46965. iterator
  46966. _M_insert_equal_lower_node ( _Link_type __z ) ;
  46967. #624
  46968. _Link_type
  46969. _M_copy ( _Const_Link_type __x , _Link_type __p ) ;
  46970.  
  46971. void
  46972. _M_erase ( _Link_type __x ) ;
  46973.  
  46974. iterator
  46975. _M_lower_bound ( _Link_type __x , _Link_type __y ,
  46976. const _Key & __k ) ;
  46977.  
  46978. const_iterator
  46979. _M_lower_bound ( _Const_Link_type __x , _Const_Link_type __y ,
  46980. const _Key & __k ) const ;
  46981.  
  46982. iterator
  46983. _M_upper_bound ( _Link_type __x , _Link_type __y ,
  46984. const _Key & __k ) ;
  46985.  
  46986. const_iterator
  46987. _M_upper_bound ( _Const_Link_type __x , _Const_Link_type __y ,
  46988. const _Key & __k ) const ;
  46989.  
  46990. public :
  46991.  
  46992. _Rb_tree ( ) { }
  46993.  
  46994. _Rb_tree ( const _Compare & __comp ,
  46995. const allocator_type & __a = allocator_type ( ) )
  46996. : _M_impl ( __comp , _Node_allocator ( __a ) ) { }
  46997.  
  46998. _Rb_tree ( const _Rb_tree & __x )
  46999. : _M_impl ( __x . _M_impl . _M_key_compare , __x . _M_get_Node_allocator ( ) )
  47000. {
  47001. if ( __x . _M_root ( ) != 0 )
  47002. {
  47003. _M_root ( ) = _M_copy ( __x . _M_begin ( ) , _M_end ( ) ) ;
  47004. _M_leftmost ( ) = _S_minimum ( _M_root ( ) ) ;
  47005. _M_rightmost ( ) = _S_maximum ( _M_root ( ) ) ;
  47006. _M_impl . _M_node_count = __x . _M_impl . _M_node_count ;
  47007. }
  47008. }
  47009.  
  47010.  
  47011. _Rb_tree ( _Rb_tree && __x ) ;
  47012.  
  47013.  
  47014. ~ _Rb_tree ( ) noexcept
  47015. { _M_erase ( _M_begin ( ) ) ; }
  47016.  
  47017. _Rb_tree &
  47018. operator = ( const _Rb_tree & __x ) ;
  47019.  
  47020.  
  47021. _Compare
  47022. key_comp ( ) const
  47023. { return _M_impl . _M_key_compare ; }
  47024.  
  47025. iterator
  47026. begin ( ) noexcept
  47027. {
  47028. return iterator ( static_cast < _Link_type >
  47029. ( this -> _M_impl . _M_header . _M_left ) ) ;
  47030. }
  47031.  
  47032. const_iterator
  47033. begin ( ) const noexcept
  47034. {
  47035. return const_iterator ( static_cast < _Const_Link_type >
  47036. ( this -> _M_impl . _M_header . _M_left ) ) ;
  47037. }
  47038.  
  47039. iterator
  47040. end ( ) noexcept
  47041. { return iterator ( static_cast < _Link_type > ( & this -> _M_impl . _M_header ) ) ; }
  47042.  
  47043. const_iterator
  47044. end ( ) const noexcept
  47045. {
  47046. return const_iterator ( static_cast < _Const_Link_type >
  47047. ( & this -> _M_impl . _M_header ) ) ;
  47048. }
  47049.  
  47050. reverse_iterator
  47051. rbegin ( ) noexcept
  47052. { return reverse_iterator ( end ( ) ) ; }
  47053.  
  47054. const_reverse_iterator
  47055. rbegin ( ) const noexcept
  47056. { return const_reverse_iterator ( end ( ) ) ; }
  47057.  
  47058. reverse_iterator
  47059. rend ( ) noexcept
  47060. { return reverse_iterator ( begin ( ) ) ; }
  47061.  
  47062. const_reverse_iterator
  47063. rend ( ) const noexcept
  47064. { return const_reverse_iterator ( begin ( ) ) ; }
  47065.  
  47066. bool
  47067. empty ( ) const noexcept
  47068. { return _M_impl . _M_node_count == 0 ; }
  47069.  
  47070. size_type
  47071. size ( ) const noexcept
  47072. { return _M_impl . _M_node_count ; }
  47073.  
  47074. size_type
  47075. max_size ( ) const noexcept
  47076. { return _M_get_Node_allocator ( ) . max_size ( ) ; }
  47077.  
  47078. void
  47079. swap ( _Rb_tree & __t ) ;
  47080.  
  47081.  
  47082.  
  47083. template < typename _Arg >
  47084. pair < iterator , bool >
  47085. _M_insert_unique ( _Arg && __x ) ;
  47086.  
  47087. template < typename _Arg >
  47088. iterator
  47089. _M_insert_equal ( _Arg && __x ) ;
  47090.  
  47091. template < typename _Arg >
  47092. iterator
  47093. _M_insert_unique_ ( const_iterator __position , _Arg && __x ) ;
  47094.  
  47095. template < typename _Arg >
  47096. iterator
  47097. _M_insert_equal_ ( const_iterator __position , _Arg && __x ) ;
  47098.  
  47099. template < typename ... _Args >
  47100. pair < iterator , bool >
  47101. _M_emplace_unique ( _Args && ... __args ) ;
  47102.  
  47103. template < typename ... _Args >
  47104. iterator
  47105. _M_emplace_equal ( _Args && ... __args ) ;
  47106.  
  47107. template < typename ... _Args >
  47108. iterator
  47109. _M_emplace_hint_unique ( const_iterator __pos , _Args && ... __args ) ;
  47110.  
  47111. template < typename ... _Args >
  47112. iterator
  47113. _M_emplace_hint_equal ( const_iterator __pos , _Args && ... __args ) ;
  47114. #784
  47115. template < typename _InputIterator >
  47116. void
  47117. _M_insert_unique ( _InputIterator __first , _InputIterator __last ) ;
  47118.  
  47119. template < typename _InputIterator >
  47120. void
  47121. _M_insert_equal ( _InputIterator __first , _InputIterator __last ) ;
  47122.  
  47123. private :
  47124. void
  47125. _M_erase_aux ( const_iterator __position ) ;
  47126.  
  47127. void
  47128. _M_erase_aux ( const_iterator __first , const_iterator __last ) ;
  47129.  
  47130. public :
  47131.  
  47132.  
  47133.  
  47134. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  47135. iterator
  47136. erase ( const_iterator __position )
  47137. {
  47138. const_iterator __result = __position ;
  47139. ++ __result ;
  47140. _M_erase_aux ( __position ) ;
  47141. return __result . _M_const_cast ( ) ;
  47142. }
  47143.  
  47144.  
  47145. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  47146. iterator
  47147. erase ( iterator __position )
  47148. {
  47149. iterator __result = __position ;
  47150. ++ __result ;
  47151. _M_erase_aux ( __position ) ;
  47152. return __result ;
  47153. }
  47154. #832
  47155. size_type
  47156. erase ( const key_type & __x ) ;
  47157.  
  47158.  
  47159.  
  47160.  
  47161. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  47162. iterator
  47163. erase ( const_iterator __first , const_iterator __last )
  47164. {
  47165. _M_erase_aux ( __first , __last ) ;
  47166. return __last . _M_const_cast ( ) ;
  47167. }
  47168. #854
  47169. void
  47170. erase ( const key_type * __first , const key_type * __last ) ;
  47171.  
  47172. void
  47173. clear ( ) noexcept
  47174. {
  47175. _M_erase ( _M_begin ( ) ) ;
  47176. _M_leftmost ( ) = _M_end ( ) ;
  47177. _M_root ( ) = 0 ;
  47178. _M_rightmost ( ) = _M_end ( ) ;
  47179. _M_impl . _M_node_count = 0 ;
  47180. }
  47181.  
  47182.  
  47183. iterator
  47184. find ( const key_type & __k ) ;
  47185.  
  47186. const_iterator
  47187. find ( const key_type & __k ) const ;
  47188.  
  47189. size_type
  47190. count ( const key_type & __k ) const ;
  47191.  
  47192. iterator
  47193. lower_bound ( const key_type & __k )
  47194. { return _M_lower_bound ( _M_begin ( ) , _M_end ( ) , __k ) ; }
  47195.  
  47196. const_iterator
  47197. lower_bound ( const key_type & __k ) const
  47198. { return _M_lower_bound ( _M_begin ( ) , _M_end ( ) , __k ) ; }
  47199.  
  47200. iterator
  47201. upper_bound ( const key_type & __k )
  47202. { return _M_upper_bound ( _M_begin ( ) , _M_end ( ) , __k ) ; }
  47203.  
  47204. const_iterator
  47205. upper_bound ( const key_type & __k ) const
  47206. { return _M_upper_bound ( _M_begin ( ) , _M_end ( ) , __k ) ; }
  47207.  
  47208. pair < iterator , iterator >
  47209. equal_range ( const key_type & __k ) ;
  47210.  
  47211. pair < const_iterator , const_iterator >
  47212. equal_range ( const key_type & __k ) const ;
  47213.  
  47214.  
  47215. bool
  47216. __rb_verify ( ) const ;
  47217. } ;
  47218.  
  47219. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47220. typename _Compare , typename _Alloc >
  47221. inline bool
  47222. operator == ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47223. const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47224. {
  47225. return __x . size ( ) == __y . size ( )
  47226. && std :: equal ( __x . begin ( ) , __x . end ( ) , __y . begin ( ) ) ;
  47227. }
  47228.  
  47229. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47230. typename _Compare , typename _Alloc >
  47231. inline bool
  47232. operator < ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47233. const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47234. {
  47235. return std :: lexicographical_compare ( __x . begin ( ) , __x . end ( ) ,
  47236. __y . begin ( ) , __y . end ( ) ) ;
  47237. }
  47238.  
  47239. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47240. typename _Compare , typename _Alloc >
  47241. inline bool
  47242. operator != ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47243. const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47244. { return ! ( __x == __y ) ; }
  47245.  
  47246. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47247. typename _Compare , typename _Alloc >
  47248. inline bool
  47249. operator > ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47250. const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47251. { return __y < __x ; }
  47252.  
  47253. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47254. typename _Compare , typename _Alloc >
  47255. inline bool
  47256. operator <= ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47257. const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47258. { return ! ( __y < __x ) ; }
  47259.  
  47260. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47261. typename _Compare , typename _Alloc >
  47262. inline bool
  47263. operator >= ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47264. const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47265. { return ! ( __x < __y ) ; }
  47266.  
  47267. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47268. typename _Compare , typename _Alloc >
  47269. inline void
  47270. swap ( _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x ,
  47271. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __y )
  47272. { __x . swap ( __y ) ; }
  47273.  
  47274.  
  47275. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47276. typename _Compare , typename _Alloc >
  47277. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47278. _Rb_tree ( _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > && __x )
  47279. : _M_impl ( __x . _M_impl . _M_key_compare ,
  47280. std :: move ( __x . _M_get_Node_allocator ( ) ) )
  47281. {
  47282. if ( __x . _M_root ( ) != 0 )
  47283. {
  47284. _M_root ( ) = __x . _M_root ( ) ;
  47285. _M_leftmost ( ) = __x . _M_leftmost ( ) ;
  47286. _M_rightmost ( ) = __x . _M_rightmost ( ) ;
  47287. _M_root ( ) -> _M_parent = _M_end ( ) ;
  47288.  
  47289. __x . _M_root ( ) = 0 ;
  47290. __x . _M_leftmost ( ) = __x . _M_end ( ) ;
  47291. __x . _M_rightmost ( ) = __x . _M_end ( ) ;
  47292.  
  47293. this -> _M_impl . _M_node_count = __x . _M_impl . _M_node_count ;
  47294. __x . _M_impl . _M_node_count = 0 ;
  47295. }
  47296. }
  47297.  
  47298.  
  47299. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47300. typename _Compare , typename _Alloc >
  47301. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > &
  47302. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47303. operator = ( const _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __x )
  47304. {
  47305. if ( this != & __x )
  47306. {
  47307.  
  47308. clear ( ) ;
  47309. _M_impl . _M_key_compare = __x . _M_impl . _M_key_compare ;
  47310. if ( __x . _M_root ( ) != 0 )
  47311. {
  47312. _M_root ( ) = _M_copy ( __x . _M_begin ( ) , _M_end ( ) ) ;
  47313. _M_leftmost ( ) = _S_minimum ( _M_root ( ) ) ;
  47314. _M_rightmost ( ) = _S_maximum ( _M_root ( ) ) ;
  47315. _M_impl . _M_node_count = __x . _M_impl . _M_node_count ;
  47316. }
  47317. }
  47318. return * this ;
  47319. }
  47320.  
  47321. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47322. typename _Compare , typename _Alloc >
  47323.  
  47324. template < typename _Arg >
  47325.  
  47326. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47327. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47328.  
  47329. _M_insert_ ( _Base_ptr __x , _Base_ptr __p , _Arg && __v )
  47330.  
  47331.  
  47332.  
  47333. {
  47334. bool __insert_left = ( __x != 0 || __p == _M_end ( )
  47335. || _M_impl . _M_key_compare ( _KeyOfValue ( ) ( __v ) ,
  47336. _S_key ( __p ) ) ) ;
  47337.  
  47338. _Link_type __z = _M_create_node ( std :: forward < _Arg > ( __v ) ) ;
  47339.  
  47340. _Rb_tree_insert_and_rebalance ( __insert_left , __z , __p ,
  47341. this -> _M_impl . _M_header ) ;
  47342. ++ _M_impl . _M_node_count ;
  47343. return iterator ( __z ) ;
  47344. }
  47345.  
  47346. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47347. typename _Compare , typename _Alloc >
  47348.  
  47349. template < typename _Arg >
  47350.  
  47351. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47352. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47353.  
  47354. _M_insert_lower ( _Base_ptr __p , _Arg && __v )
  47355.  
  47356.  
  47357.  
  47358. {
  47359. bool __insert_left = ( __p == _M_end ( )
  47360. || ! _M_impl . _M_key_compare ( _S_key ( __p ) ,
  47361. _KeyOfValue ( ) ( __v ) ) ) ;
  47362.  
  47363. _Link_type __z = _M_create_node ( std :: forward < _Arg > ( __v ) ) ;
  47364.  
  47365. _Rb_tree_insert_and_rebalance ( __insert_left , __z , __p ,
  47366. this -> _M_impl . _M_header ) ;
  47367. ++ _M_impl . _M_node_count ;
  47368. return iterator ( __z ) ;
  47369. }
  47370.  
  47371. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47372. typename _Compare , typename _Alloc >
  47373.  
  47374. template < typename _Arg >
  47375.  
  47376. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47377. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47378.  
  47379. _M_insert_equal_lower ( _Arg && __v )
  47380.  
  47381.  
  47382.  
  47383. {
  47384. _Link_type __x = _M_begin ( ) ;
  47385. _Link_type __y = _M_end ( ) ;
  47386. while ( __x != 0 )
  47387. {
  47388. __y = __x ;
  47389. __x = ! _M_impl . _M_key_compare ( _S_key ( __x ) , _KeyOfValue ( ) ( __v ) ) ?
  47390. _S_left ( __x ) : _S_right ( __x ) ;
  47391. }
  47392. return _M_insert_lower ( __y , std :: forward < _Arg > ( __v ) ) ;
  47393. }
  47394.  
  47395. template < typename _Key , typename _Val , typename _KoV ,
  47396. typename _Compare , typename _Alloc >
  47397. typename _Rb_tree < _Key , _Val , _KoV , _Compare , _Alloc > :: _Link_type
  47398. _Rb_tree < _Key , _Val , _KoV , _Compare , _Alloc > ::
  47399. _M_copy ( _Const_Link_type __x , _Link_type __p )
  47400. {
  47401.  
  47402. _Link_type __top = _M_clone_node ( __x ) ;
  47403. __top -> _M_parent = __p ;
  47404.  
  47405. try
  47406. {
  47407. if ( __x -> _M_right )
  47408. __top -> _M_right = _M_copy ( _S_right ( __x ) , __top ) ;
  47409. __p = __top ;
  47410. __x = _S_left ( __x ) ;
  47411.  
  47412. while ( __x != 0 )
  47413. {
  47414. _Link_type __y = _M_clone_node ( __x ) ;
  47415. __p -> _M_left = __y ;
  47416. __y -> _M_parent = __p ;
  47417. if ( __x -> _M_right )
  47418. __y -> _M_right = _M_copy ( _S_right ( __x ) , __y ) ;
  47419. __p = __y ;
  47420. __x = _S_left ( __x ) ;
  47421. }
  47422. }
  47423. catch ( ... )
  47424. {
  47425. _M_erase ( __top ) ;
  47426. throw ;
  47427. }
  47428. return __top ;
  47429. }
  47430.  
  47431. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47432. typename _Compare , typename _Alloc >
  47433. void
  47434. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47435. _M_erase ( _Link_type __x )
  47436. {
  47437.  
  47438. while ( __x != 0 )
  47439. {
  47440. _M_erase ( _S_right ( __x ) ) ;
  47441. _Link_type __y = _S_left ( __x ) ;
  47442. _M_destroy_node ( __x ) ;
  47443. __x = __y ;
  47444. }
  47445. }
  47446.  
  47447. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47448. typename _Compare , typename _Alloc >
  47449. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47450. _Compare , _Alloc > :: iterator
  47451. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47452. _M_lower_bound ( _Link_type __x , _Link_type __y ,
  47453. const _Key & __k )
  47454. {
  47455. while ( __x != 0 )
  47456. if ( ! _M_impl . _M_key_compare ( _S_key ( __x ) , __k ) )
  47457. __y = __x , __x = _S_left ( __x ) ;
  47458. else
  47459. __x = _S_right ( __x ) ;
  47460. return iterator ( __y ) ;
  47461. }
  47462.  
  47463. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47464. typename _Compare , typename _Alloc >
  47465. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47466. _Compare , _Alloc > :: const_iterator
  47467. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47468. _M_lower_bound ( _Const_Link_type __x , _Const_Link_type __y ,
  47469. const _Key & __k ) const
  47470. {
  47471. while ( __x != 0 )
  47472. if ( ! _M_impl . _M_key_compare ( _S_key ( __x ) , __k ) )
  47473. __y = __x , __x = _S_left ( __x ) ;
  47474. else
  47475. __x = _S_right ( __x ) ;
  47476. return const_iterator ( __y ) ;
  47477. }
  47478.  
  47479. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47480. typename _Compare , typename _Alloc >
  47481. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47482. _Compare , _Alloc > :: iterator
  47483. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47484. _M_upper_bound ( _Link_type __x , _Link_type __y ,
  47485. const _Key & __k )
  47486. {
  47487. while ( __x != 0 )
  47488. if ( _M_impl . _M_key_compare ( __k , _S_key ( __x ) ) )
  47489. __y = __x , __x = _S_left ( __x ) ;
  47490. else
  47491. __x = _S_right ( __x ) ;
  47492. return iterator ( __y ) ;
  47493. }
  47494.  
  47495. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47496. typename _Compare , typename _Alloc >
  47497. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47498. _Compare , _Alloc > :: const_iterator
  47499. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47500. _M_upper_bound ( _Const_Link_type __x , _Const_Link_type __y ,
  47501. const _Key & __k ) const
  47502. {
  47503. while ( __x != 0 )
  47504. if ( _M_impl . _M_key_compare ( __k , _S_key ( __x ) ) )
  47505. __y = __x , __x = _S_left ( __x ) ;
  47506. else
  47507. __x = _S_right ( __x ) ;
  47508. return const_iterator ( __y ) ;
  47509. }
  47510.  
  47511. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47512. typename _Compare , typename _Alloc >
  47513. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47514. _Compare , _Alloc > :: iterator ,
  47515. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47516. _Compare , _Alloc > :: iterator >
  47517. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47518. equal_range ( const _Key & __k )
  47519. {
  47520. _Link_type __x = _M_begin ( ) ;
  47521. _Link_type __y = _M_end ( ) ;
  47522. while ( __x != 0 )
  47523. {
  47524. if ( _M_impl . _M_key_compare ( _S_key ( __x ) , __k ) )
  47525. __x = _S_right ( __x ) ;
  47526. else if ( _M_impl . _M_key_compare ( __k , _S_key ( __x ) ) )
  47527. __y = __x , __x = _S_left ( __x ) ;
  47528. else
  47529. {
  47530. _Link_type __xu ( __x ) , __yu ( __y ) ;
  47531. __y = __x , __x = _S_left ( __x ) ;
  47532. __xu = _S_right ( __xu ) ;
  47533. return pair < iterator ,
  47534. iterator > ( _M_lower_bound ( __x , __y , __k ) ,
  47535. _M_upper_bound ( __xu , __yu , __k ) ) ;
  47536. }
  47537. }
  47538. return pair < iterator , iterator > ( iterator ( __y ) ,
  47539. iterator ( __y ) ) ;
  47540. }
  47541.  
  47542. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47543. typename _Compare , typename _Alloc >
  47544. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47545. _Compare , _Alloc > :: const_iterator ,
  47546. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47547. _Compare , _Alloc > :: const_iterator >
  47548. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47549. equal_range ( const _Key & __k ) const
  47550. {
  47551. _Const_Link_type __x = _M_begin ( ) ;
  47552. _Const_Link_type __y = _M_end ( ) ;
  47553. while ( __x != 0 )
  47554. {
  47555. if ( _M_impl . _M_key_compare ( _S_key ( __x ) , __k ) )
  47556. __x = _S_right ( __x ) ;
  47557. else if ( _M_impl . _M_key_compare ( __k , _S_key ( __x ) ) )
  47558. __y = __x , __x = _S_left ( __x ) ;
  47559. else
  47560. {
  47561. _Const_Link_type __xu ( __x ) , __yu ( __y ) ;
  47562. __y = __x , __x = _S_left ( __x ) ;
  47563. __xu = _S_right ( __xu ) ;
  47564. return pair < const_iterator ,
  47565. const_iterator > ( _M_lower_bound ( __x , __y , __k ) ,
  47566. _M_upper_bound ( __xu , __yu , __k ) ) ;
  47567. }
  47568. }
  47569. return pair < const_iterator , const_iterator > ( const_iterator ( __y ) ,
  47570. const_iterator ( __y ) ) ;
  47571. }
  47572.  
  47573. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47574. typename _Compare , typename _Alloc >
  47575. void
  47576. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47577. swap ( _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > & __t )
  47578. {
  47579. if ( _M_root ( ) == 0 )
  47580. {
  47581. if ( __t . _M_root ( ) != 0 )
  47582. {
  47583. _M_root ( ) = __t . _M_root ( ) ;
  47584. _M_leftmost ( ) = __t . _M_leftmost ( ) ;
  47585. _M_rightmost ( ) = __t . _M_rightmost ( ) ;
  47586. _M_root ( ) -> _M_parent = _M_end ( ) ;
  47587.  
  47588. __t . _M_root ( ) = 0 ;
  47589. __t . _M_leftmost ( ) = __t . _M_end ( ) ;
  47590. __t . _M_rightmost ( ) = __t . _M_end ( ) ;
  47591. }
  47592. }
  47593. else if ( __t . _M_root ( ) == 0 )
  47594. {
  47595. __t . _M_root ( ) = _M_root ( ) ;
  47596. __t . _M_leftmost ( ) = _M_leftmost ( ) ;
  47597. __t . _M_rightmost ( ) = _M_rightmost ( ) ;
  47598. __t . _M_root ( ) -> _M_parent = __t . _M_end ( ) ;
  47599.  
  47600. _M_root ( ) = 0 ;
  47601. _M_leftmost ( ) = _M_end ( ) ;
  47602. _M_rightmost ( ) = _M_end ( ) ;
  47603. }
  47604. else
  47605. {
  47606. std :: swap ( _M_root ( ) , __t . _M_root ( ) ) ;
  47607. std :: swap ( _M_leftmost ( ) , __t . _M_leftmost ( ) ) ;
  47608. std :: swap ( _M_rightmost ( ) , __t . _M_rightmost ( ) ) ;
  47609.  
  47610. _M_root ( ) -> _M_parent = _M_end ( ) ;
  47611. __t . _M_root ( ) -> _M_parent = __t . _M_end ( ) ;
  47612. }
  47613.  
  47614. std :: swap ( this -> _M_impl . _M_node_count , __t . _M_impl . _M_node_count ) ;
  47615. std :: swap ( this -> _M_impl . _M_key_compare , __t . _M_impl . _M_key_compare ) ;
  47616.  
  47617.  
  47618.  
  47619. std :: __alloc_swap < _Node_allocator > ::
  47620. _S_do_it ( _M_get_Node_allocator ( ) , __t . _M_get_Node_allocator ( ) ) ;
  47621. }
  47622.  
  47623. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47624. typename _Compare , typename _Alloc >
  47625. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47626. _Compare , _Alloc > :: _Base_ptr ,
  47627. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47628. _Compare , _Alloc > :: _Base_ptr >
  47629. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47630. _M_get_insert_unique_pos ( const key_type & __k )
  47631. {
  47632. typedef pair < _Base_ptr , _Base_ptr > _Res ;
  47633. _Link_type __x = _M_begin ( ) ;
  47634. _Link_type __y = _M_end ( ) ;
  47635. bool __comp = true ;
  47636. while ( __x != 0 )
  47637. {
  47638. __y = __x ;
  47639. __comp = _M_impl . _M_key_compare ( __k , _S_key ( __x ) ) ;
  47640. __x = __comp ? _S_left ( __x ) : _S_right ( __x ) ;
  47641. }
  47642. iterator __j = iterator ( __y ) ;
  47643. if ( __comp )
  47644. {
  47645. if ( __j == begin ( ) )
  47646. return _Res ( __x , __y ) ;
  47647. else
  47648. -- __j ;
  47649. }
  47650. if ( _M_impl . _M_key_compare ( _S_key ( __j . _M_node ) , __k ) )
  47651. return _Res ( __x , __y ) ;
  47652. return _Res ( __j . _M_node , 0 ) ;
  47653. }
  47654.  
  47655. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47656. typename _Compare , typename _Alloc >
  47657. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47658. _Compare , _Alloc > :: _Base_ptr ,
  47659. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47660. _Compare , _Alloc > :: _Base_ptr >
  47661. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47662. _M_get_insert_equal_pos ( const key_type & __k )
  47663. {
  47664. typedef pair < _Base_ptr , _Base_ptr > _Res ;
  47665. _Link_type __x = _M_begin ( ) ;
  47666. _Link_type __y = _M_end ( ) ;
  47667. while ( __x != 0 )
  47668. {
  47669. __y = __x ;
  47670. __x = _M_impl . _M_key_compare ( __k , _S_key ( __x ) ) ?
  47671. _S_left ( __x ) : _S_right ( __x ) ;
  47672. }
  47673. return _Res ( __x , __y ) ;
  47674. }
  47675.  
  47676. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47677. typename _Compare , typename _Alloc >
  47678.  
  47679. template < typename _Arg >
  47680.  
  47681. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47682. _Compare , _Alloc > :: iterator , bool >
  47683. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47684.  
  47685. _M_insert_unique ( _Arg && __v )
  47686.  
  47687.  
  47688.  
  47689. {
  47690. typedef pair < iterator , bool > _Res ;
  47691. pair < _Base_ptr , _Base_ptr > __res
  47692. = _M_get_insert_unique_pos ( _KeyOfValue ( ) ( __v ) ) ;
  47693.  
  47694. if ( __res . second )
  47695. return _Res ( _M_insert_ ( __res . first , __res . second ,
  47696. std :: forward < _Arg > ( __v ) ) ,
  47697. true ) ;
  47698.  
  47699. return _Res ( iterator ( static_cast < _Link_type > ( __res . first ) ) , false ) ;
  47700. }
  47701.  
  47702. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47703. typename _Compare , typename _Alloc >
  47704.  
  47705. template < typename _Arg >
  47706.  
  47707. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47708. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47709.  
  47710. _M_insert_equal ( _Arg && __v )
  47711.  
  47712.  
  47713.  
  47714. {
  47715. pair < _Base_ptr , _Base_ptr > __res
  47716. = _M_get_insert_equal_pos ( _KeyOfValue ( ) ( __v ) ) ;
  47717. return _M_insert_ ( __res . first , __res . second , std :: forward < _Arg > ( __v ) ) ;
  47718. }
  47719.  
  47720. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47721. typename _Compare , typename _Alloc >
  47722. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47723. _Compare , _Alloc > :: _Base_ptr ,
  47724. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47725. _Compare , _Alloc > :: _Base_ptr >
  47726. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47727. _M_get_insert_hint_unique_pos ( const_iterator __position ,
  47728. const key_type & __k )
  47729. {
  47730. iterator __pos = __position . _M_const_cast ( ) ;
  47731. typedef pair < _Base_ptr , _Base_ptr > _Res ;
  47732.  
  47733.  
  47734. if ( __pos . _M_node == _M_end ( ) )
  47735. {
  47736. if ( size ( ) > 0
  47737. && _M_impl . _M_key_compare ( _S_key ( _M_rightmost ( ) ) , __k ) )
  47738. return _Res ( 0 , _M_rightmost ( ) ) ;
  47739. else
  47740. return _M_get_insert_unique_pos ( __k ) ;
  47741. }
  47742. else if ( _M_impl . _M_key_compare ( __k , _S_key ( __pos . _M_node ) ) )
  47743. {
  47744.  
  47745. iterator __before = __pos ;
  47746. if ( __pos . _M_node == _M_leftmost ( ) )
  47747. return _Res ( _M_leftmost ( ) , _M_leftmost ( ) ) ;
  47748. else if ( _M_impl . _M_key_compare ( _S_key ( ( -- __before ) . _M_node ) , __k ) )
  47749. {
  47750. if ( _S_right ( __before . _M_node ) == 0 )
  47751. return _Res ( 0 , __before . _M_node ) ;
  47752. else
  47753. return _Res ( __pos . _M_node , __pos . _M_node ) ;
  47754. }
  47755. else
  47756. return _M_get_insert_unique_pos ( __k ) ;
  47757. }
  47758. else if ( _M_impl . _M_key_compare ( _S_key ( __pos . _M_node ) , __k ) )
  47759. {
  47760.  
  47761. iterator __after = __pos ;
  47762. if ( __pos . _M_node == _M_rightmost ( ) )
  47763. return _Res ( 0 , _M_rightmost ( ) ) ;
  47764. else if ( _M_impl . _M_key_compare ( __k , _S_key ( ( ++ __after ) . _M_node ) ) )
  47765. {
  47766. if ( _S_right ( __pos . _M_node ) == 0 )
  47767. return _Res ( 0 , __pos . _M_node ) ;
  47768. else
  47769. return _Res ( __after . _M_node , __after . _M_node ) ;
  47770. }
  47771. else
  47772. return _M_get_insert_unique_pos ( __k ) ;
  47773. }
  47774. else
  47775.  
  47776. return _Res ( __pos . _M_node , 0 ) ;
  47777. }
  47778.  
  47779. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47780. typename _Compare , typename _Alloc >
  47781.  
  47782. template < typename _Arg >
  47783.  
  47784. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47785. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47786.  
  47787. _M_insert_unique_ ( const_iterator __position , _Arg && __v )
  47788.  
  47789.  
  47790.  
  47791. {
  47792. pair < _Base_ptr , _Base_ptr > __res
  47793. = _M_get_insert_hint_unique_pos ( __position , _KeyOfValue ( ) ( __v ) ) ;
  47794.  
  47795. if ( __res . second )
  47796. return _M_insert_ ( __res . first , __res . second ,
  47797. std :: forward < _Arg > ( __v ) ) ;
  47798. return iterator ( static_cast < _Link_type > ( __res . first ) ) ;
  47799. }
  47800.  
  47801. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47802. typename _Compare , typename _Alloc >
  47803. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47804. _Compare , _Alloc > :: _Base_ptr ,
  47805. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47806. _Compare , _Alloc > :: _Base_ptr >
  47807. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47808. _M_get_insert_hint_equal_pos ( const_iterator __position , const key_type & __k )
  47809. {
  47810. iterator __pos = __position . _M_const_cast ( ) ;
  47811. typedef pair < _Base_ptr , _Base_ptr > _Res ;
  47812.  
  47813.  
  47814. if ( __pos . _M_node == _M_end ( ) )
  47815. {
  47816. if ( size ( ) > 0
  47817. && ! _M_impl . _M_key_compare ( __k , _S_key ( _M_rightmost ( ) ) ) )
  47818. return _Res ( 0 , _M_rightmost ( ) ) ;
  47819. else
  47820. return _M_get_insert_equal_pos ( __k ) ;
  47821. }
  47822. else if ( ! _M_impl . _M_key_compare ( _S_key ( __pos . _M_node ) , __k ) )
  47823. {
  47824.  
  47825. iterator __before = __pos ;
  47826. if ( __pos . _M_node == _M_leftmost ( ) )
  47827. return _Res ( _M_leftmost ( ) , _M_leftmost ( ) ) ;
  47828. else if ( ! _M_impl . _M_key_compare ( __k , _S_key ( ( -- __before ) . _M_node ) ) )
  47829. {
  47830. if ( _S_right ( __before . _M_node ) == 0 )
  47831. return _Res ( 0 , __before . _M_node ) ;
  47832. else
  47833. return _Res ( __pos . _M_node , __pos . _M_node ) ;
  47834. }
  47835. else
  47836. return _M_get_insert_equal_pos ( __k ) ;
  47837. }
  47838. else
  47839. {
  47840.  
  47841. iterator __after = __pos ;
  47842. if ( __pos . _M_node == _M_rightmost ( ) )
  47843. return _Res ( 0 , _M_rightmost ( ) ) ;
  47844. else if ( ! _M_impl . _M_key_compare ( _S_key ( ( ++ __after ) . _M_node ) , __k ) )
  47845. {
  47846. if ( _S_right ( __pos . _M_node ) == 0 )
  47847. return _Res ( 0 , __pos . _M_node ) ;
  47848. else
  47849. return _Res ( __after . _M_node , __after . _M_node ) ;
  47850. }
  47851. else
  47852. return _Res ( 0 , 0 ) ;
  47853. }
  47854. }
  47855.  
  47856. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47857. typename _Compare , typename _Alloc >
  47858.  
  47859. template < typename _Arg >
  47860.  
  47861. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47862. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47863.  
  47864. _M_insert_equal_ ( const_iterator __position , _Arg && __v )
  47865.  
  47866.  
  47867.  
  47868. {
  47869. pair < _Base_ptr , _Base_ptr > __res
  47870. = _M_get_insert_hint_equal_pos ( __position , _KeyOfValue ( ) ( __v ) ) ;
  47871.  
  47872. if ( __res . second )
  47873. return _M_insert_ ( __res . first , __res . second ,
  47874. std :: forward < _Arg > ( __v ) ) ;
  47875.  
  47876. return _M_insert_equal_lower ( std :: forward < _Arg > ( __v ) ) ;
  47877. }
  47878.  
  47879.  
  47880. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47881. typename _Compare , typename _Alloc >
  47882. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47883. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47884. _M_insert_node ( _Base_ptr __x , _Base_ptr __p , _Link_type __z )
  47885. {
  47886. bool __insert_left = ( __x != 0 || __p == _M_end ( )
  47887. || _M_impl . _M_key_compare ( _S_key ( __z ) ,
  47888. _S_key ( __p ) ) ) ;
  47889.  
  47890. _Rb_tree_insert_and_rebalance ( __insert_left , __z , __p ,
  47891. this -> _M_impl . _M_header ) ;
  47892. ++ _M_impl . _M_node_count ;
  47893. return iterator ( __z ) ;
  47894. }
  47895.  
  47896. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47897. typename _Compare , typename _Alloc >
  47898. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47899. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47900. _M_insert_lower_node ( _Base_ptr __p , _Link_type __z )
  47901. {
  47902. bool __insert_left = ( __p == _M_end ( )
  47903. || ! _M_impl . _M_key_compare ( _S_key ( __p ) ,
  47904. _S_key ( __z ) ) ) ;
  47905.  
  47906. _Rb_tree_insert_and_rebalance ( __insert_left , __z , __p ,
  47907. this -> _M_impl . _M_header ) ;
  47908. ++ _M_impl . _M_node_count ;
  47909. return iterator ( __z ) ;
  47910. }
  47911.  
  47912. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47913. typename _Compare , typename _Alloc >
  47914. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47915. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47916. _M_insert_equal_lower_node ( _Link_type __z )
  47917. {
  47918. _Link_type __x = _M_begin ( ) ;
  47919. _Link_type __y = _M_end ( ) ;
  47920. while ( __x != 0 )
  47921. {
  47922. __y = __x ;
  47923. __x = ! _M_impl . _M_key_compare ( _S_key ( __x ) , _S_key ( __z ) ) ?
  47924. _S_left ( __x ) : _S_right ( __x ) ;
  47925. }
  47926. return _M_insert_lower_node ( __y , __z ) ;
  47927. }
  47928.  
  47929. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47930. typename _Compare , typename _Alloc >
  47931. template < typename ... _Args >
  47932. pair < typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  47933. _Compare , _Alloc > :: iterator , bool >
  47934. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47935. _M_emplace_unique ( _Args && ... __args )
  47936. {
  47937. _Link_type __z = _M_create_node ( std :: forward < _Args > ( __args ) ... ) ;
  47938.  
  47939. try
  47940. {
  47941. typedef pair < iterator , bool > _Res ;
  47942. auto __res = _M_get_insert_unique_pos ( _S_key ( __z ) ) ;
  47943. if ( __res . second )
  47944. return _Res ( _M_insert_node ( __res . first , __res . second , __z ) , true ) ;
  47945.  
  47946. _M_destroy_node ( __z ) ;
  47947. return _Res ( iterator ( static_cast < _Link_type > ( __res . first ) ) , false ) ;
  47948. }
  47949. catch ( ... )
  47950. {
  47951. _M_destroy_node ( __z ) ;
  47952. throw ;
  47953. }
  47954. }
  47955.  
  47956. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47957. typename _Compare , typename _Alloc >
  47958. template < typename ... _Args >
  47959. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47960. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47961. _M_emplace_equal ( _Args && ... __args )
  47962. {
  47963. _Link_type __z = _M_create_node ( std :: forward < _Args > ( __args ) ... ) ;
  47964.  
  47965. try
  47966. {
  47967. auto __res = _M_get_insert_equal_pos ( _S_key ( __z ) ) ;
  47968. return _M_insert_node ( __res . first , __res . second , __z ) ;
  47969. }
  47970. catch ( ... )
  47971. {
  47972. _M_destroy_node ( __z ) ;
  47973. throw ;
  47974. }
  47975. }
  47976.  
  47977. template < typename _Key , typename _Val , typename _KeyOfValue ,
  47978. typename _Compare , typename _Alloc >
  47979. template < typename ... _Args >
  47980. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  47981. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  47982. _M_emplace_hint_unique ( const_iterator __pos , _Args && ... __args )
  47983. {
  47984. _Link_type __z = _M_create_node ( std :: forward < _Args > ( __args ) ... ) ;
  47985.  
  47986. try
  47987. {
  47988. auto __res = _M_get_insert_hint_unique_pos ( __pos , _S_key ( __z ) ) ;
  47989.  
  47990. if ( __res . second )
  47991. return _M_insert_node ( __res . first , __res . second , __z ) ;
  47992.  
  47993. _M_destroy_node ( __z ) ;
  47994. return iterator ( static_cast < _Link_type > ( __res . first ) ) ;
  47995. }
  47996. catch ( ... )
  47997. {
  47998. _M_destroy_node ( __z ) ;
  47999. throw ;
  48000. }
  48001. }
  48002.  
  48003. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48004. typename _Compare , typename _Alloc >
  48005. template < typename ... _Args >
  48006. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: iterator
  48007. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48008. _M_emplace_hint_equal ( const_iterator __pos , _Args && ... __args )
  48009. {
  48010. _Link_type __z = _M_create_node ( std :: forward < _Args > ( __args ) ... ) ;
  48011.  
  48012. try
  48013. {
  48014. auto __res = _M_get_insert_hint_equal_pos ( __pos , _S_key ( __z ) ) ;
  48015.  
  48016. if ( __res . second )
  48017. return _M_insert_node ( __res . first , __res . second , __z ) ;
  48018.  
  48019. return _M_insert_equal_lower_node ( __z ) ;
  48020. }
  48021. catch ( ... )
  48022. {
  48023. _M_destroy_node ( __z ) ;
  48024. throw ;
  48025. }
  48026. }
  48027.  
  48028.  
  48029. template < typename _Key , typename _Val , typename _KoV ,
  48030. typename _Cmp , typename _Alloc >
  48031. template < class _II >
  48032. void
  48033. _Rb_tree < _Key , _Val , _KoV , _Cmp , _Alloc > ::
  48034. _M_insert_unique ( _II __first , _II __last )
  48035. {
  48036. for ( ; __first != __last ; ++ __first )
  48037. _M_insert_unique_ ( end ( ) , * __first ) ;
  48038. }
  48039.  
  48040. template < typename _Key , typename _Val , typename _KoV ,
  48041. typename _Cmp , typename _Alloc >
  48042. template < class _II >
  48043. void
  48044. _Rb_tree < _Key , _Val , _KoV , _Cmp , _Alloc > ::
  48045. _M_insert_equal ( _II __first , _II __last )
  48046. {
  48047. for ( ; __first != __last ; ++ __first )
  48048. _M_insert_equal_ ( end ( ) , * __first ) ;
  48049. }
  48050.  
  48051. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48052. typename _Compare , typename _Alloc >
  48053. void
  48054. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48055. _M_erase_aux ( const_iterator __position )
  48056. {
  48057. _Link_type __y =
  48058. static_cast < _Link_type > ( _Rb_tree_rebalance_for_erase
  48059. ( const_cast < _Base_ptr > ( __position . _M_node ) ,
  48060. this -> _M_impl . _M_header ) ) ;
  48061. _M_destroy_node ( __y ) ;
  48062. -- _M_impl . _M_node_count ;
  48063. }
  48064.  
  48065. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48066. typename _Compare , typename _Alloc >
  48067. void
  48068. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48069. _M_erase_aux ( const_iterator __first , const_iterator __last )
  48070. {
  48071. if ( __first == begin ( ) && __last == end ( ) )
  48072. clear ( ) ;
  48073. else
  48074. while ( __first != __last )
  48075. erase ( __first ++ ) ;
  48076. }
  48077.  
  48078. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48079. typename _Compare , typename _Alloc >
  48080. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: size_type
  48081. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48082. erase ( const _Key & __x )
  48083. {
  48084. pair < iterator , iterator > __p = equal_range ( __x ) ;
  48085. const size_type __old_size = size ( ) ;
  48086. erase ( __p . first , __p . second ) ;
  48087. return __old_size - size ( ) ;
  48088. }
  48089.  
  48090. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48091. typename _Compare , typename _Alloc >
  48092. void
  48093. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48094. erase ( const _Key * __first , const _Key * __last )
  48095. {
  48096. while ( __first != __last )
  48097. erase ( * __first ++ ) ;
  48098. }
  48099.  
  48100. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48101. typename _Compare , typename _Alloc >
  48102. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  48103. _Compare , _Alloc > :: iterator
  48104. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48105. find ( const _Key & __k )
  48106. {
  48107. iterator __j = _M_lower_bound ( _M_begin ( ) , _M_end ( ) , __k ) ;
  48108. return ( __j == end ( )
  48109. || _M_impl . _M_key_compare ( __k ,
  48110. _S_key ( __j . _M_node ) ) ) ? end ( ) : __j ;
  48111. }
  48112.  
  48113. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48114. typename _Compare , typename _Alloc >
  48115. typename _Rb_tree < _Key , _Val , _KeyOfValue ,
  48116. _Compare , _Alloc > :: const_iterator
  48117. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48118. find ( const _Key & __k ) const
  48119. {
  48120. const_iterator __j = _M_lower_bound ( _M_begin ( ) , _M_end ( ) , __k ) ;
  48121. return ( __j == end ( )
  48122. || _M_impl . _M_key_compare ( __k ,
  48123. _S_key ( __j . _M_node ) ) ) ? end ( ) : __j ;
  48124. }
  48125.  
  48126. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48127. typename _Compare , typename _Alloc >
  48128. typename _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: size_type
  48129. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > ::
  48130. count ( const _Key & __k ) const
  48131. {
  48132. pair < const_iterator , const_iterator > __p = equal_range ( __k ) ;
  48133. const size_type __n = std :: distance ( __p . first , __p . second ) ;
  48134. return __n ;
  48135. }
  48136.  
  48137. __attribute__ ( ( __pure__ ) ) unsigned int
  48138. _Rb_tree_black_count ( const _Rb_tree_node_base * __node ,
  48139. const _Rb_tree_node_base * __root ) throw ( ) ;
  48140.  
  48141. template < typename _Key , typename _Val , typename _KeyOfValue ,
  48142. typename _Compare , typename _Alloc >
  48143. bool
  48144. _Rb_tree < _Key , _Val , _KeyOfValue , _Compare , _Alloc > :: __rb_verify ( ) const
  48145. {
  48146. if ( _M_impl . _M_node_count == 0 || begin ( ) == end ( ) )
  48147. return _M_impl . _M_node_count == 0 && begin ( ) == end ( )
  48148. && this -> _M_impl . _M_header . _M_left == _M_end ( )
  48149. && this -> _M_impl . _M_header . _M_right == _M_end ( ) ;
  48150.  
  48151. unsigned int __len = _Rb_tree_black_count ( _M_leftmost ( ) , _M_root ( ) ) ;
  48152. for ( const_iterator __it = begin ( ) ; __it != end ( ) ; ++ __it )
  48153. {
  48154. _Const_Link_type __x = static_cast < _Const_Link_type > ( __it . _M_node ) ;
  48155. _Const_Link_type __L = _S_left ( __x ) ;
  48156. _Const_Link_type __R = _S_right ( __x ) ;
  48157.  
  48158. if ( __x -> _M_color == _S_red )
  48159. if ( ( __L && __L -> _M_color == _S_red )
  48160. || ( __R && __R -> _M_color == _S_red ) )
  48161. return false ;
  48162.  
  48163. if ( __L && _M_impl . _M_key_compare ( _S_key ( __x ) , _S_key ( __L ) ) )
  48164. return false ;
  48165. if ( __R && _M_impl . _M_key_compare ( _S_key ( __R ) , _S_key ( __x ) ) )
  48166. return false ;
  48167.  
  48168. if ( ! __L && ! __R && _Rb_tree_black_count ( __x , _M_root ( ) ) != __len )
  48169. return false ;
  48170. }
  48171.  
  48172. if ( _M_leftmost ( ) != _Rb_tree_node_base :: _S_minimum ( _M_root ( ) ) )
  48173. return false ;
  48174. if ( _M_rightmost ( ) != _Rb_tree_node_base :: _S_maximum ( _M_root ( ) ) )
  48175. return false ;
  48176. return true ;
  48177. }
  48178.  
  48179.  
  48180. }
  48181. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_map.h"
  48182. #66
  48183. namespace std
  48184. {
  48185. #94
  48186. template < typename _Key , typename _Tp , typename _Compare = std :: less < _Key > ,
  48187. typename _Alloc = std :: allocator < std :: pair < const _Key , _Tp > > >
  48188. class map
  48189. {
  48190. public :
  48191. typedef _Key key_type ;
  48192. typedef _Tp mapped_type ;
  48193. typedef std :: pair < const _Key , _Tp > value_type ;
  48194. typedef _Compare key_compare ;
  48195. typedef _Alloc allocator_type ;
  48196.  
  48197. private :
  48198.  
  48199. typedef typename _Alloc :: value_type _Alloc_value_type ;
  48200.  
  48201.  
  48202.  
  48203.  
  48204.  
  48205. public :
  48206. class value_compare
  48207. : public std :: binary_function < value_type , value_type , bool >
  48208. {
  48209. friend class map < _Key , _Tp , _Compare , _Alloc > ;
  48210. protected :
  48211. _Compare comp ;
  48212.  
  48213. value_compare ( _Compare __c )
  48214. : comp ( __c ) { }
  48215.  
  48216. public :
  48217. bool operator ( ) ( const value_type & __x , const value_type & __y ) const
  48218. { return comp ( __x . first , __y . first ) ; }
  48219. } ;
  48220.  
  48221. private :
  48222.  
  48223. typedef typename _Alloc :: template rebind < value_type > :: other
  48224. _Pair_alloc_type ;
  48225.  
  48226. typedef _Rb_tree < key_type , value_type , _Select1st < value_type > ,
  48227. key_compare , _Pair_alloc_type > _Rep_type ;
  48228.  
  48229.  
  48230. _Rep_type _M_t ;
  48231.  
  48232. public :
  48233.  
  48234.  
  48235. typedef typename _Pair_alloc_type :: pointer pointer ;
  48236. typedef typename _Pair_alloc_type :: const_pointer const_pointer ;
  48237. typedef typename _Pair_alloc_type :: reference reference ;
  48238. typedef typename _Pair_alloc_type :: const_reference const_reference ;
  48239. typedef typename _Rep_type :: iterator iterator ;
  48240. typedef typename _Rep_type :: const_iterator const_iterator ;
  48241. typedef typename _Rep_type :: size_type size_type ;
  48242. typedef typename _Rep_type :: difference_type difference_type ;
  48243. typedef typename _Rep_type :: reverse_iterator reverse_iterator ;
  48244. typedef typename _Rep_type :: const_reverse_iterator const_reverse_iterator ;
  48245. #160
  48246. map ( )
  48247. : _M_t ( ) { }
  48248. #168
  48249. explicit
  48250. map ( const _Compare & __comp ,
  48251. const allocator_type & __a = allocator_type ( ) )
  48252. : _M_t ( __comp , _Pair_alloc_type ( __a ) ) { }
  48253. #180
  48254. map ( const map & __x )
  48255. : _M_t ( __x . _M_t ) { }
  48256. #191
  48257. map ( map && __x )
  48258. noexcept ( is_nothrow_copy_constructible < _Compare > :: value )
  48259. : _M_t ( std :: move ( __x . _M_t ) ) { }
  48260. #206
  48261. map ( initializer_list < value_type > __l ,
  48262. const _Compare & __comp = _Compare ( ) ,
  48263. const allocator_type & __a = allocator_type ( ) )
  48264. : _M_t ( __comp , _Pair_alloc_type ( __a ) )
  48265. { _M_t . _M_insert_unique ( __l . begin ( ) , __l . end ( ) ) ; }
  48266. #223
  48267. template < typename _InputIterator >
  48268. map ( _InputIterator __first , _InputIterator __last )
  48269. : _M_t ( )
  48270. { _M_t . _M_insert_unique ( __first , __last ) ; }
  48271. #240
  48272. template < typename _InputIterator >
  48273. map ( _InputIterator __first , _InputIterator __last ,
  48274. const _Compare & __comp ,
  48275. const allocator_type & __a = allocator_type ( ) )
  48276. : _M_t ( __comp , _Pair_alloc_type ( __a ) )
  48277. { _M_t . _M_insert_unique ( __first , __last ) ; }
  48278. #263
  48279. map &
  48280. operator = ( const map & __x )
  48281. {
  48282. _M_t = __x . _M_t ;
  48283. return * this ;
  48284. }
  48285. #278
  48286. map &
  48287. operator = ( map && __x )
  48288. {
  48289.  
  48290.  
  48291. this -> clear ( ) ;
  48292. this -> swap ( __x ) ;
  48293. return * this ;
  48294. }
  48295. #299
  48296. map &
  48297. operator = ( initializer_list < value_type > __l )
  48298. {
  48299. this -> clear ( ) ;
  48300. this -> insert ( __l . begin ( ) , __l . end ( ) ) ;
  48301. return * this ;
  48302. }
  48303.  
  48304.  
  48305.  
  48306. allocator_type
  48307. get_allocator ( ) const noexcept
  48308. { return allocator_type ( _M_t . get_allocator ( ) ) ; }
  48309. #319
  48310. iterator
  48311. begin ( ) noexcept
  48312. { return _M_t . begin ( ) ; }
  48313. #328
  48314. const_iterator
  48315. begin ( ) const noexcept
  48316. { return _M_t . begin ( ) ; }
  48317. #337
  48318. iterator
  48319. end ( ) noexcept
  48320. { return _M_t . end ( ) ; }
  48321. #346
  48322. const_iterator
  48323. end ( ) const noexcept
  48324. { return _M_t . end ( ) ; }
  48325. #355
  48326. reverse_iterator
  48327. rbegin ( ) noexcept
  48328. { return _M_t . rbegin ( ) ; }
  48329. #364
  48330. const_reverse_iterator
  48331. rbegin ( ) const noexcept
  48332. { return _M_t . rbegin ( ) ; }
  48333. #373
  48334. reverse_iterator
  48335. rend ( ) noexcept
  48336. { return _M_t . rend ( ) ; }
  48337. #382
  48338. const_reverse_iterator
  48339. rend ( ) const noexcept
  48340. { return _M_t . rend ( ) ; }
  48341. #392
  48342. const_iterator
  48343. cbegin ( ) const noexcept
  48344. { return _M_t . begin ( ) ; }
  48345. #401
  48346. const_iterator
  48347. cend ( ) const noexcept
  48348. { return _M_t . end ( ) ; }
  48349. #410
  48350. const_reverse_iterator
  48351. crbegin ( ) const noexcept
  48352. { return _M_t . rbegin ( ) ; }
  48353. #419
  48354. const_reverse_iterator
  48355. crend ( ) const noexcept
  48356. { return _M_t . rend ( ) ; }
  48357. #428
  48358. bool
  48359. empty ( ) const noexcept
  48360. { return _M_t . empty ( ) ; }
  48361.  
  48362.  
  48363. size_type
  48364. size ( ) const noexcept
  48365. { return _M_t . size ( ) ; }
  48366.  
  48367.  
  48368. size_type
  48369. max_size ( ) const noexcept
  48370. { return _M_t . max_size ( ) ; }
  48371. #455
  48372. mapped_type &
  48373. operator [ ] ( const key_type & __k )
  48374. {
  48375.  
  48376.  
  48377.  
  48378. iterator __i = lower_bound ( __k ) ;
  48379.  
  48380. if ( __i == end ( ) || key_comp ( ) ( __k , ( * __i ) . first ) )
  48381.  
  48382. __i = _M_t . _M_emplace_hint_unique ( __i , std :: piecewise_construct ,
  48383. std :: tuple < const key_type & > ( __k ) ,
  48384. std :: tuple < > ( ) ) ;
  48385.  
  48386.  
  48387.  
  48388. return ( * __i ) . second ;
  48389. }
  48390.  
  48391.  
  48392. mapped_type &
  48393. operator [ ] ( key_type && __k )
  48394. {
  48395.  
  48396.  
  48397.  
  48398. iterator __i = lower_bound ( __k ) ;
  48399.  
  48400. if ( __i == end ( ) || key_comp ( ) ( __k , ( * __i ) . first ) )
  48401. __i = _M_t . _M_emplace_hint_unique ( __i , std :: piecewise_construct ,
  48402. std :: forward_as_tuple ( std :: move ( __k ) ) ,
  48403. std :: tuple < > ( ) ) ;
  48404. return ( * __i ) . second ;
  48405. }
  48406. #500
  48407. mapped_type &
  48408. at ( const key_type & __k )
  48409. {
  48410. iterator __i = lower_bound ( __k ) ;
  48411. if ( __i == end ( ) || key_comp ( ) ( __k , ( * __i ) . first ) )
  48412. __throw_out_of_range ( ( "map::at" ) ) ;
  48413. return ( * __i ) . second ;
  48414. }
  48415.  
  48416. const mapped_type &
  48417. at ( const key_type & __k ) const
  48418. {
  48419. const_iterator __i = lower_bound ( __k ) ;
  48420. if ( __i == end ( ) || key_comp ( ) ( __k , ( * __i ) . first ) )
  48421. __throw_out_of_range ( ( "map::at" ) ) ;
  48422. return ( * __i ) . second ;
  48423. }
  48424. #538
  48425. template < typename ... _Args >
  48426. std :: pair < iterator , bool >
  48427. emplace ( _Args && ... __args )
  48428. { return _M_t . _M_emplace_unique ( std :: forward < _Args > ( __args ) ... ) ; }
  48429. #568
  48430. template < typename ... _Args >
  48431. iterator
  48432. emplace_hint ( const_iterator __pos , _Args && ... __args )
  48433. {
  48434. return _M_t . _M_emplace_hint_unique ( __pos ,
  48435. std :: forward < _Args > ( __args ) ... ) ;
  48436. }
  48437. #593
  48438. std :: pair < iterator , bool >
  48439. insert ( const value_type & __x )
  48440. { return _M_t . _M_insert_unique ( __x ) ; }
  48441.  
  48442.  
  48443. template < typename _Pair , typename = typename
  48444. std :: enable_if < std :: is_constructible < value_type ,
  48445. _Pair && > :: value > :: type >
  48446. std :: pair < iterator , bool >
  48447. insert ( _Pair && __x )
  48448. { return _M_t . _M_insert_unique ( std :: forward < _Pair > ( __x ) ) ; }
  48449. #614
  48450. void
  48451. insert ( std :: initializer_list < value_type > __list )
  48452. { insert ( __list . begin ( ) , __list . end ( ) ) ; }
  48453. #642
  48454. iterator
  48455.  
  48456. insert ( const_iterator __position , const value_type & __x )
  48457.  
  48458.  
  48459.  
  48460. { return _M_t . _M_insert_unique_ ( __position , __x ) ; }
  48461.  
  48462.  
  48463. template < typename _Pair , typename = typename
  48464. std :: enable_if < std :: is_constructible < value_type ,
  48465. _Pair && > :: value > :: type >
  48466. iterator
  48467. insert ( const_iterator __position , _Pair && __x )
  48468. { return _M_t . _M_insert_unique_ ( __position ,
  48469. std :: forward < _Pair > ( __x ) ) ; }
  48470. #668
  48471. template < typename _InputIterator >
  48472. void
  48473. insert ( _InputIterator __first , _InputIterator __last )
  48474. { _M_t . _M_insert_unique ( __first , __last ) ; }
  48475. #689
  48476. iterator
  48477. erase ( const_iterator __position )
  48478. { return _M_t . erase ( __position ) ; }
  48479.  
  48480.  
  48481. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  48482. iterator
  48483. erase ( iterator __position )
  48484. { return _M_t . erase ( __position ) ; }
  48485. #725
  48486. size_type
  48487. erase ( const key_type & __x )
  48488. { return _M_t . erase ( __x ) ; }
  48489. #745
  48490. iterator
  48491. erase ( const_iterator __first , const_iterator __last )
  48492. { return _M_t . erase ( __first , __last ) ; }
  48493. #777
  48494. void
  48495. swap ( map & __x )
  48496. { _M_t . swap ( __x . _M_t ) ; }
  48497. #787
  48498. void
  48499. clear ( ) noexcept
  48500. { _M_t . clear ( ) ; }
  48501. #796
  48502. key_compare
  48503. key_comp ( ) const
  48504. { return _M_t . key_comp ( ) ; }
  48505.  
  48506.  
  48507.  
  48508.  
  48509.  
  48510. value_compare
  48511. value_comp ( ) const
  48512. { return value_compare ( _M_t . key_comp ( ) ) ; }
  48513. #820
  48514. iterator
  48515. find ( const key_type & __x )
  48516. { return _M_t . find ( __x ) ; }
  48517. #835
  48518. const_iterator
  48519. find ( const key_type & __x ) const
  48520. { return _M_t . find ( __x ) ; }
  48521. #847
  48522. size_type
  48523. count ( const key_type & __x ) const
  48524. { return _M_t . find ( __x ) == _M_t . end ( ) ? 0 : 1 ; }
  48525. #862
  48526. iterator
  48527. lower_bound ( const key_type & __x )
  48528. { return _M_t . lower_bound ( __x ) ; }
  48529. #877
  48530. const_iterator
  48531. lower_bound ( const key_type & __x ) const
  48532. { return _M_t . lower_bound ( __x ) ; }
  48533. #887
  48534. iterator
  48535. upper_bound ( const key_type & __x )
  48536. { return _M_t . upper_bound ( __x ) ; }
  48537. #897
  48538. const_iterator
  48539. upper_bound ( const key_type & __x ) const
  48540. { return _M_t . upper_bound ( __x ) ; }
  48541. #916
  48542. std :: pair < iterator , iterator >
  48543. equal_range ( const key_type & __x )
  48544. { return _M_t . equal_range ( __x ) ; }
  48545. #935
  48546. std :: pair < const_iterator , const_iterator >
  48547. equal_range ( const key_type & __x ) const
  48548. { return _M_t . equal_range ( __x ) ; }
  48549.  
  48550. template < typename _K1 , typename _T1 , typename _C1 , typename _A1 >
  48551. friend bool
  48552. operator == ( const map < _K1 , _T1 , _C1 , _A1 > & ,
  48553. const map < _K1 , _T1 , _C1 , _A1 > & ) ;
  48554.  
  48555. template < typename _K1 , typename _T1 , typename _C1 , typename _A1 >
  48556. friend bool
  48557. operator < ( const map < _K1 , _T1 , _C1 , _A1 > & ,
  48558. const map < _K1 , _T1 , _C1 , _A1 > & ) ;
  48559. } ;
  48560. #960
  48561. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48562. inline bool
  48563. operator == ( const map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48564. const map < _Key , _Tp , _Compare , _Alloc > & __y )
  48565. { return __x . _M_t == __y . _M_t ; }
  48566. #977
  48567. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48568. inline bool
  48569. operator < ( const map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48570. const map < _Key , _Tp , _Compare , _Alloc > & __y )
  48571. { return __x . _M_t < __y . _M_t ; }
  48572.  
  48573.  
  48574. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48575. inline bool
  48576. operator != ( const map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48577. const map < _Key , _Tp , _Compare , _Alloc > & __y )
  48578. { return ! ( __x == __y ) ; }
  48579.  
  48580.  
  48581. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48582. inline bool
  48583. operator > ( const map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48584. const map < _Key , _Tp , _Compare , _Alloc > & __y )
  48585. { return __y < __x ; }
  48586.  
  48587.  
  48588. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48589. inline bool
  48590. operator <= ( const map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48591. const map < _Key , _Tp , _Compare , _Alloc > & __y )
  48592. { return ! ( __y < __x ) ; }
  48593.  
  48594.  
  48595. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48596. inline bool
  48597. operator >= ( const map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48598. const map < _Key , _Tp , _Compare , _Alloc > & __y )
  48599. { return ! ( __x < __y ) ; }
  48600.  
  48601.  
  48602. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48603. inline void
  48604. swap ( map < _Key , _Tp , _Compare , _Alloc > & __x ,
  48605. map < _Key , _Tp , _Compare , _Alloc > & __y )
  48606. { __x . swap ( __y ) ; }
  48607.  
  48608.  
  48609. }
  48610. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_multimap.h"
  48611. #64
  48612. namespace std
  48613. {
  48614. #92
  48615. template < typename _Key , typename _Tp ,
  48616. typename _Compare = std :: less < _Key > ,
  48617. typename _Alloc = std :: allocator < std :: pair < const _Key , _Tp > > >
  48618. class multimap
  48619. {
  48620. public :
  48621. typedef _Key key_type ;
  48622. typedef _Tp mapped_type ;
  48623. typedef std :: pair < const _Key , _Tp > value_type ;
  48624. typedef _Compare key_compare ;
  48625. typedef _Alloc allocator_type ;
  48626.  
  48627. private :
  48628.  
  48629. typedef typename _Alloc :: value_type _Alloc_value_type ;
  48630.  
  48631.  
  48632.  
  48633.  
  48634.  
  48635. public :
  48636. class value_compare
  48637. : public std :: binary_function < value_type , value_type , bool >
  48638. {
  48639. friend class multimap < _Key , _Tp , _Compare , _Alloc > ;
  48640. protected :
  48641. _Compare comp ;
  48642.  
  48643. value_compare ( _Compare __c )
  48644. : comp ( __c ) { }
  48645.  
  48646. public :
  48647. bool operator ( ) ( const value_type & __x , const value_type & __y ) const
  48648. { return comp ( __x . first , __y . first ) ; }
  48649. } ;
  48650.  
  48651. private :
  48652.  
  48653. typedef typename _Alloc :: template rebind < value_type > :: other
  48654. _Pair_alloc_type ;
  48655.  
  48656. typedef _Rb_tree < key_type , value_type , _Select1st < value_type > ,
  48657. key_compare , _Pair_alloc_type > _Rep_type ;
  48658.  
  48659. _Rep_type _M_t ;
  48660.  
  48661. public :
  48662.  
  48663.  
  48664. typedef typename _Pair_alloc_type :: pointer pointer ;
  48665. typedef typename _Pair_alloc_type :: const_pointer const_pointer ;
  48666. typedef typename _Pair_alloc_type :: reference reference ;
  48667. typedef typename _Pair_alloc_type :: const_reference const_reference ;
  48668. typedef typename _Rep_type :: iterator iterator ;
  48669. typedef typename _Rep_type :: const_iterator const_iterator ;
  48670. typedef typename _Rep_type :: size_type size_type ;
  48671. typedef typename _Rep_type :: difference_type difference_type ;
  48672. typedef typename _Rep_type :: reverse_iterator reverse_iterator ;
  48673. typedef typename _Rep_type :: const_reverse_iterator const_reverse_iterator ;
  48674. #157
  48675. multimap ( )
  48676. : _M_t ( ) { }
  48677. #165
  48678. explicit
  48679. multimap ( const _Compare & __comp ,
  48680. const allocator_type & __a = allocator_type ( ) )
  48681. : _M_t ( __comp , _Pair_alloc_type ( __a ) ) { }
  48682. #177
  48683. multimap ( const multimap & __x )
  48684. : _M_t ( __x . _M_t ) { }
  48685. #188
  48686. multimap ( multimap && __x )
  48687. noexcept ( is_nothrow_copy_constructible < _Compare > :: value )
  48688. : _M_t ( std :: move ( __x . _M_t ) ) { }
  48689. #202
  48690. multimap ( initializer_list < value_type > __l ,
  48691. const _Compare & __comp = _Compare ( ) ,
  48692. const allocator_type & __a = allocator_type ( ) )
  48693. : _M_t ( __comp , _Pair_alloc_type ( __a ) )
  48694. { _M_t . _M_insert_equal ( __l . begin ( ) , __l . end ( ) ) ; }
  48695. #218
  48696. template < typename _InputIterator >
  48697. multimap ( _InputIterator __first , _InputIterator __last )
  48698. : _M_t ( )
  48699. { _M_t . _M_insert_equal ( __first , __last ) ; }
  48700. #234
  48701. template < typename _InputIterator >
  48702. multimap ( _InputIterator __first , _InputIterator __last ,
  48703. const _Compare & __comp ,
  48704. const allocator_type & __a = allocator_type ( ) )
  48705. : _M_t ( __comp , _Pair_alloc_type ( __a ) )
  48706. { _M_t . _M_insert_equal ( __first , __last ) ; }
  48707. #257
  48708. multimap &
  48709. operator = ( const multimap & __x )
  48710. {
  48711. _M_t = __x . _M_t ;
  48712. return * this ;
  48713. }
  48714. #272
  48715. multimap &
  48716. operator = ( multimap && __x )
  48717. {
  48718.  
  48719.  
  48720. this -> clear ( ) ;
  48721. this -> swap ( __x ) ;
  48722. return * this ;
  48723. }
  48724. #293
  48725. multimap &
  48726. operator = ( initializer_list < value_type > __l )
  48727. {
  48728. this -> clear ( ) ;
  48729. this -> insert ( __l . begin ( ) , __l . end ( ) ) ;
  48730. return * this ;
  48731. }
  48732.  
  48733.  
  48734.  
  48735. allocator_type
  48736. get_allocator ( ) const noexcept
  48737. { return allocator_type ( _M_t . get_allocator ( ) ) ; }
  48738. #313
  48739. iterator
  48740. begin ( ) noexcept
  48741. { return _M_t . begin ( ) ; }
  48742. #322
  48743. const_iterator
  48744. begin ( ) const noexcept
  48745. { return _M_t . begin ( ) ; }
  48746. #331
  48747. iterator
  48748. end ( ) noexcept
  48749. { return _M_t . end ( ) ; }
  48750. #340
  48751. const_iterator
  48752. end ( ) const noexcept
  48753. { return _M_t . end ( ) ; }
  48754. #349
  48755. reverse_iterator
  48756. rbegin ( ) noexcept
  48757. { return _M_t . rbegin ( ) ; }
  48758. #358
  48759. const_reverse_iterator
  48760. rbegin ( ) const noexcept
  48761. { return _M_t . rbegin ( ) ; }
  48762. #367
  48763. reverse_iterator
  48764. rend ( ) noexcept
  48765. { return _M_t . rend ( ) ; }
  48766. #376
  48767. const_reverse_iterator
  48768. rend ( ) const noexcept
  48769. { return _M_t . rend ( ) ; }
  48770. #386
  48771. const_iterator
  48772. cbegin ( ) const noexcept
  48773. { return _M_t . begin ( ) ; }
  48774. #395
  48775. const_iterator
  48776. cend ( ) const noexcept
  48777. { return _M_t . end ( ) ; }
  48778. #404
  48779. const_reverse_iterator
  48780. crbegin ( ) const noexcept
  48781. { return _M_t . rbegin ( ) ; }
  48782. #413
  48783. const_reverse_iterator
  48784. crend ( ) const noexcept
  48785. { return _M_t . rend ( ) ; }
  48786.  
  48787.  
  48788.  
  48789.  
  48790. bool
  48791. empty ( ) const noexcept
  48792. { return _M_t . empty ( ) ; }
  48793.  
  48794.  
  48795. size_type
  48796. size ( ) const noexcept
  48797. { return _M_t . size ( ) ; }
  48798.  
  48799.  
  48800. size_type
  48801. max_size ( ) const noexcept
  48802. { return _M_t . max_size ( ) ; }
  48803. #452
  48804. template < typename ... _Args >
  48805. iterator
  48806. emplace ( _Args && ... __args )
  48807. { return _M_t . _M_emplace_equal ( std :: forward < _Args > ( __args ) ... ) ; }
  48808. #479
  48809. template < typename ... _Args >
  48810. iterator
  48811. emplace_hint ( const_iterator __pos , _Args && ... __args )
  48812. {
  48813. return _M_t . _M_emplace_hint_equal ( __pos ,
  48814. std :: forward < _Args > ( __args ) ... ) ;
  48815. }
  48816. #500
  48817. iterator
  48818. insert ( const value_type & __x )
  48819. { return _M_t . _M_insert_equal ( __x ) ; }
  48820.  
  48821.  
  48822. template < typename _Pair , typename = typename
  48823. std :: enable_if < std :: is_constructible < value_type ,
  48824. _Pair && > :: value > :: type >
  48825. iterator
  48826. insert ( _Pair && __x )
  48827. { return _M_t . _M_insert_equal ( std :: forward < _Pair > ( __x ) ) ; }
  48828. #533
  48829. iterator
  48830.  
  48831. insert ( const_iterator __position , const value_type & __x )
  48832.  
  48833.  
  48834.  
  48835. { return _M_t . _M_insert_equal_ ( __position , __x ) ; }
  48836.  
  48837.  
  48838. template < typename _Pair , typename = typename
  48839. std :: enable_if < std :: is_constructible < value_type ,
  48840. _Pair && > :: value > :: type >
  48841. iterator
  48842. insert ( const_iterator __position , _Pair && __x )
  48843. { return _M_t . _M_insert_equal_ ( __position ,
  48844. std :: forward < _Pair > ( __x ) ) ; }
  48845. #560
  48846. template < typename _InputIterator >
  48847. void
  48848. insert ( _InputIterator __first , _InputIterator __last )
  48849. { _M_t . _M_insert_equal ( __first , __last ) ; }
  48850. #573
  48851. void
  48852. insert ( initializer_list < value_type > __l )
  48853. { this -> insert ( __l . begin ( ) , __l . end ( ) ) ; }
  48854. #594
  48855. iterator
  48856. erase ( const_iterator __position )
  48857. { return _M_t . erase ( __position ) ; }
  48858.  
  48859.  
  48860. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  48861. iterator
  48862. erase ( iterator __position )
  48863. { return _M_t . erase ( __position ) ; }
  48864. #630
  48865. size_type
  48866. erase ( const key_type & __x )
  48867. { return _M_t . erase ( __x ) ; }
  48868. #651
  48869. iterator
  48870. erase ( const_iterator __first , const_iterator __last )
  48871. { return _M_t . erase ( __first , __last ) ; }
  48872. #686
  48873. void
  48874. swap ( multimap & __x )
  48875. { _M_t . swap ( __x . _M_t ) ; }
  48876. #696
  48877. void
  48878. clear ( ) noexcept
  48879. { _M_t . clear ( ) ; }
  48880. #705
  48881. key_compare
  48882. key_comp ( ) const
  48883. { return _M_t . key_comp ( ) ; }
  48884.  
  48885.  
  48886.  
  48887.  
  48888.  
  48889. value_compare
  48890. value_comp ( ) const
  48891. { return value_compare ( _M_t . key_comp ( ) ) ; }
  48892. #729
  48893. iterator
  48894. find ( const key_type & __x )
  48895. { return _M_t . find ( __x ) ; }
  48896. #744
  48897. const_iterator
  48898. find ( const key_type & __x ) const
  48899. { return _M_t . find ( __x ) ; }
  48900. #753
  48901. size_type
  48902. count ( const key_type & __x ) const
  48903. { return _M_t . count ( __x ) ; }
  48904. #768
  48905. iterator
  48906. lower_bound ( const key_type & __x )
  48907. { return _M_t . lower_bound ( __x ) ; }
  48908. #783
  48909. const_iterator
  48910. lower_bound ( const key_type & __x ) const
  48911. { return _M_t . lower_bound ( __x ) ; }
  48912. #793
  48913. iterator
  48914. upper_bound ( const key_type & __x )
  48915. { return _M_t . upper_bound ( __x ) ; }
  48916. #803
  48917. const_iterator
  48918. upper_bound ( const key_type & __x ) const
  48919. { return _M_t . upper_bound ( __x ) ; }
  48920. #820
  48921. std :: pair < iterator , iterator >
  48922. equal_range ( const key_type & __x )
  48923. { return _M_t . equal_range ( __x ) ; }
  48924. #837
  48925. std :: pair < const_iterator , const_iterator >
  48926. equal_range ( const key_type & __x ) const
  48927. { return _M_t . equal_range ( __x ) ; }
  48928.  
  48929. template < typename _K1 , typename _T1 , typename _C1 , typename _A1 >
  48930. friend bool
  48931. operator == ( const multimap < _K1 , _T1 , _C1 , _A1 > & ,
  48932. const multimap < _K1 , _T1 , _C1 , _A1 > & ) ;
  48933.  
  48934. template < typename _K1 , typename _T1 , typename _C1 , typename _A1 >
  48935. friend bool
  48936. operator < ( const multimap < _K1 , _T1 , _C1 , _A1 > & ,
  48937. const multimap < _K1 , _T1 , _C1 , _A1 > & ) ;
  48938. } ;
  48939. #862
  48940. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48941. inline bool
  48942. operator == ( const multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48943. const multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48944. { return __x . _M_t == __y . _M_t ; }
  48945. #879
  48946. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48947. inline bool
  48948. operator < ( const multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48949. const multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48950. { return __x . _M_t < __y . _M_t ; }
  48951.  
  48952.  
  48953. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48954. inline bool
  48955. operator != ( const multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48956. const multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48957. { return ! ( __x == __y ) ; }
  48958.  
  48959.  
  48960. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48961. inline bool
  48962. operator > ( const multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48963. const multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48964. { return __y < __x ; }
  48965.  
  48966.  
  48967. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48968. inline bool
  48969. operator <= ( const multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48970. const multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48971. { return ! ( __y < __x ) ; }
  48972.  
  48973.  
  48974. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48975. inline bool
  48976. operator >= ( const multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48977. const multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48978. { return ! ( __x < __y ) ; }
  48979.  
  48980.  
  48981. template < typename _Key , typename _Tp , typename _Compare , typename _Alloc >
  48982. inline void
  48983. swap ( multimap < _Key , _Tp , _Compare , _Alloc > & __x ,
  48984. multimap < _Key , _Tp , _Compare , _Alloc > & __y )
  48985. { __x . swap ( __y ) ; }
  48986.  
  48987.  
  48988. }
  48989. #1 "./boost/limits.hpp"
  48990. #1 "./boost/assert.hpp"
  48991. #1 "/usr/include/assert.h"
  48992. #1 "./boost/cstdint.hpp"
  48993. #194
  48994. namespace boost
  48995. {
  48996. #208
  48997. typedef signed char int8_t ;
  48998. typedef signed char int_least8_t ;
  48999. typedef signed char int_fast8_t ;
  49000. typedef unsigned char uint8_t ;
  49001. typedef unsigned char uint_least8_t ;
  49002. typedef unsigned char uint_fast8_t ;
  49003. #231
  49004. typedef short int16_t ;
  49005. typedef short int_least16_t ;
  49006. typedef short int_fast16_t ;
  49007. typedef unsigned short uint16_t ;
  49008. typedef unsigned short uint_least16_t ;
  49009. typedef unsigned short uint_fast16_t ;
  49010. #260
  49011. typedef int int32_t ;
  49012. typedef int int_least32_t ;
  49013. typedef int int_fast32_t ;
  49014. typedef unsigned int uint32_t ;
  49015. typedef unsigned int uint_least32_t ;
  49016. typedef unsigned int uint_fast32_t ;
  49017. #306
  49018. typedef :: boost :: long_long_type intmax_t ;
  49019. typedef :: boost :: ulong_long_type uintmax_t ;
  49020. typedef :: boost :: long_long_type int64_t ;
  49021. typedef :: boost :: long_long_type int_least64_t ;
  49022. typedef :: boost :: long_long_type int_fast64_t ;
  49023. typedef :: boost :: ulong_long_type uint64_t ;
  49024. typedef :: boost :: ulong_long_type uint_least64_t ;
  49025. typedef :: boost :: ulong_long_type uint_fast64_t ;
  49026. #356
  49027. }
  49028. #1 "./boost/throw_exception.hpp"
  49029. #1 "./boost/exception/detail/attribute_noreturn.hpp"
  49030. #1 "./boost/detail/workaround.hpp"
  49031. #1 "./boost/exception/exception.hpp"
  49032. #15
  49033. namespace
  49034. boost
  49035. {
  49036. namespace
  49037. exception_detail
  49038. {
  49039. template < class T >
  49040. class
  49041. refcount_ptr
  49042. {
  49043. public :
  49044.  
  49045. refcount_ptr ( ) :
  49046. px_ ( 0 )
  49047. {
  49048. }
  49049.  
  49050. ~ refcount_ptr ( )
  49051. {
  49052. release ( ) ;
  49053. }
  49054.  
  49055. refcount_ptr ( refcount_ptr const & x ) :
  49056. px_ ( x . px_ )
  49057. {
  49058. add_ref ( ) ;
  49059. }
  49060.  
  49061. refcount_ptr &
  49062. operator = ( refcount_ptr const & x )
  49063. {
  49064. adopt ( x . px_ ) ;
  49065. return * this ;
  49066. }
  49067.  
  49068. void
  49069. adopt ( T * px )
  49070. {
  49071. release ( ) ;
  49072. px_ = px ;
  49073. add_ref ( ) ;
  49074. }
  49075.  
  49076. T *
  49077. get ( ) const
  49078. {
  49079. return px_ ;
  49080. }
  49081.  
  49082. private :
  49083.  
  49084. T * px_ ;
  49085.  
  49086. void
  49087. add_ref ( )
  49088. {
  49089. if ( px_ )
  49090. px_ -> add_ref ( ) ;
  49091. }
  49092.  
  49093. void
  49094. release ( )
  49095. {
  49096. if ( px_ && px_ -> release ( ) )
  49097. px_ = 0 ;
  49098. }
  49099. } ;
  49100. }
  49101.  
  49102.  
  49103.  
  49104. template < class Tag , class T >
  49105. class error_info ;
  49106.  
  49107. typedef error_info < struct throw_function_ , char const * > throw_function ;
  49108. typedef error_info < struct throw_file_ , char const * > throw_file ;
  49109. typedef error_info < struct throw_line_ , int > throw_line ;
  49110.  
  49111. template < >
  49112. class
  49113. error_info < throw_function_ , char const * >
  49114. {
  49115. public :
  49116. typedef char const * value_type ;
  49117. value_type v_ ;
  49118. explicit
  49119. error_info ( value_type v ) :
  49120. v_ ( v )
  49121. {
  49122. }
  49123. } ;
  49124.  
  49125. template < >
  49126. class
  49127. error_info < throw_file_ , char const * >
  49128. {
  49129. public :
  49130. typedef char const * value_type ;
  49131. value_type v_ ;
  49132. explicit
  49133. error_info ( value_type v ) :
  49134. v_ ( v )
  49135. {
  49136. }
  49137. } ;
  49138.  
  49139. template < >
  49140. class
  49141. error_info < throw_line_ , int >
  49142. {
  49143. public :
  49144. typedef int value_type ;
  49145. value_type v_ ;
  49146. explicit
  49147. error_info ( value_type v ) :
  49148. v_ ( v )
  49149. {
  49150. }
  49151. } ;
  49152. #140
  49153. class exception ;
  49154. #147
  49155. template < class T >
  49156. class shared_ptr ;
  49157.  
  49158. namespace
  49159. exception_detail
  49160. {
  49161. class error_info_base ;
  49162. struct type_info_ ;
  49163.  
  49164. struct
  49165. error_info_container
  49166. {
  49167. virtual char const * diagnostic_information ( char const * ) const = 0 ;
  49168. virtual shared_ptr < error_info_base > get ( type_info_ const & ) const = 0 ;
  49169. virtual void set ( shared_ptr < error_info_base > const & , type_info_ const & ) = 0 ;
  49170. virtual void add_ref ( ) const = 0 ;
  49171. virtual bool release ( ) const = 0 ;
  49172. virtual refcount_ptr < exception_detail :: error_info_container > clone ( ) const = 0 ;
  49173.  
  49174. protected :
  49175.  
  49176. ~ error_info_container ( ) throw ( )
  49177. {
  49178. }
  49179. } ;
  49180.  
  49181. template < class >
  49182. struct get_info ;
  49183.  
  49184. template < >
  49185. struct get_info < throw_function > ;
  49186.  
  49187. template < >
  49188. struct get_info < throw_file > ;
  49189.  
  49190. template < >
  49191. struct get_info < throw_line > ;
  49192.  
  49193. char const * get_diagnostic_information ( exception const & , char const * ) ;
  49194.  
  49195. void copy_boost_exception ( exception * , exception const * ) ;
  49196.  
  49197. template < class E , class Tag , class T >
  49198. E const & set_info ( E const & , error_info < Tag , T > const & ) ;
  49199.  
  49200. template < class E >
  49201. E const & set_info ( E const & , throw_function const & ) ;
  49202.  
  49203. template < class E >
  49204. E const & set_info ( E const & , throw_file const & ) ;
  49205.  
  49206. template < class E >
  49207. E const & set_info ( E const & , throw_line const & ) ;
  49208. }
  49209. #207
  49210. class
  49211. exception
  49212. {
  49213. protected :
  49214.  
  49215. exception ( ) :
  49216. throw_function_ ( 0 ) ,
  49217. throw_file_ ( 0 ) ,
  49218. throw_line_ ( - 1 )
  49219. {
  49220. }
  49221. #231
  49222. virtual ~ exception ( ) throw ( )
  49223.  
  49224. = 0
  49225.  
  49226. ;
  49227.  
  49228.  
  49229.  
  49230.  
  49231. private :
  49232.  
  49233. template < class E >
  49234. friend E const & exception_detail :: set_info ( E const & , throw_function const & ) ;
  49235.  
  49236. template < class E >
  49237. friend E const & exception_detail :: set_info ( E const & , throw_file const & ) ;
  49238.  
  49239. template < class E >
  49240. friend E const & exception_detail :: set_info ( E const & , throw_line const & ) ;
  49241.  
  49242. template < class E , class Tag , class T >
  49243. friend E const & exception_detail :: set_info ( E const & , error_info < Tag , T > const & ) ;
  49244.  
  49245. friend char const * exception_detail :: get_diagnostic_information ( exception const & , char const * ) ;
  49246.  
  49247. template < class >
  49248. friend struct exception_detail :: get_info ;
  49249. friend struct exception_detail :: get_info < throw_function > ;
  49250. friend struct exception_detail :: get_info < throw_file > ;
  49251. friend struct exception_detail :: get_info < throw_line > ;
  49252. friend void exception_detail :: copy_boost_exception ( exception * , exception const * ) ;
  49253.  
  49254. mutable exception_detail :: refcount_ptr < exception_detail :: error_info_container > data_ ;
  49255. mutable char const * throw_function_ ;
  49256. mutable char const * throw_file_ ;
  49257. mutable int throw_line_ ;
  49258. } ;
  49259. #274
  49260. inline
  49261. exception ::
  49262. ~ exception ( ) throw ( )
  49263. {
  49264. }
  49265.  
  49266. namespace
  49267. exception_detail
  49268. {
  49269. template < class E >
  49270. E const &
  49271. set_info ( E const & x , throw_function const & y )
  49272. {
  49273. x . throw_function_ = y . v_ ;
  49274. return x ;
  49275. }
  49276.  
  49277. template < class E >
  49278. E const &
  49279. set_info ( E const & x , throw_file const & y )
  49280. {
  49281. x . throw_file_ = y . v_ ;
  49282. return x ;
  49283. }
  49284.  
  49285. template < class E >
  49286. E const &
  49287. set_info ( E const & x , throw_line const & y )
  49288. {
  49289. x . throw_line_ = y . v_ ;
  49290. return x ;
  49291. }
  49292. }
  49293.  
  49294.  
  49295.  
  49296. namespace
  49297. exception_detail
  49298. {
  49299.  
  49300.  
  49301.  
  49302.  
  49303.  
  49304. template < class T >
  49305. struct
  49306. error_info_injector :
  49307. public T ,
  49308. public exception
  49309. {
  49310. explicit
  49311. error_info_injector ( T const & x ) :
  49312. T ( x )
  49313. {
  49314. }
  49315.  
  49316. ~ error_info_injector ( ) throw ( )
  49317. {
  49318. }
  49319. } ;
  49320. #340
  49321. struct large_size { char c [ 256 ] ; } ;
  49322. large_size dispatch_boost_exception ( exception const * ) ;
  49323.  
  49324. struct small_size { } ;
  49325. small_size dispatch_boost_exception ( void const * ) ;
  49326.  
  49327. template < class , int >
  49328. struct enable_error_info_helper ;
  49329.  
  49330. template < class T >
  49331. struct
  49332. enable_error_info_helper < T , sizeof ( large_size ) >
  49333. {
  49334. typedef T type ;
  49335. } ;
  49336.  
  49337. template < class T >
  49338. struct
  49339. enable_error_info_helper < T , sizeof ( small_size ) >
  49340. {
  49341. typedef error_info_injector < T > type ;
  49342. } ;
  49343.  
  49344. template < class T >
  49345. struct
  49346. enable_error_info_return_type
  49347. {
  49348. typedef typename enable_error_info_helper < T , sizeof ( exception_detail :: dispatch_boost_exception ( static_cast < T *
  49349. #367
  49350. > ( 0 ) ) ) > :: type type ;
  49351. } ;
  49352. }
  49353.  
  49354. template < class T >
  49355. inline
  49356. typename
  49357. exception_detail :: enable_error_info_return_type < T > :: type
  49358. enable_error_info ( T const & x )
  49359. {
  49360. typedef typename exception_detail :: enable_error_info_return_type < T > :: type rt ;
  49361. return rt ( x ) ;
  49362. }
  49363.  
  49364.  
  49365.  
  49366. namespace
  49367. exception_detail
  49368. {
  49369.  
  49370.  
  49371.  
  49372.  
  49373.  
  49374. class
  49375. clone_base
  49376. {
  49377. public :
  49378.  
  49379. virtual clone_base const * clone ( ) const = 0 ;
  49380. virtual void rethrow ( ) const = 0 ;
  49381.  
  49382. virtual
  49383. ~ clone_base ( ) throw ( )
  49384. {
  49385. }
  49386. } ;
  49387. #410
  49388. inline
  49389. void
  49390. copy_boost_exception ( exception * a , exception const * b )
  49391. {
  49392. refcount_ptr < error_info_container > data ;
  49393. if ( error_info_container * d = b -> data_ . get ( ) )
  49394. data = d -> clone ( ) ;
  49395. a -> throw_file_ = b -> throw_file_ ;
  49396. a -> throw_line_ = b -> throw_line_ ;
  49397. a -> throw_function_ = b -> throw_function_ ;
  49398. a -> data_ = data ;
  49399. }
  49400.  
  49401. inline
  49402. void
  49403. copy_boost_exception ( void * , void const * )
  49404. {
  49405. }
  49406.  
  49407. template < class T >
  49408. class
  49409. clone_impl :
  49410. public T ,
  49411. public virtual clone_base
  49412. {
  49413. struct clone_tag { } ;
  49414. clone_impl ( clone_impl const & x , clone_tag ) :
  49415. T ( x )
  49416. {
  49417. copy_boost_exception ( this , & x ) ;
  49418. }
  49419.  
  49420. public :
  49421.  
  49422. explicit
  49423. clone_impl ( T const & x ) :
  49424. T ( x )
  49425. {
  49426. copy_boost_exception ( this , & x ) ;
  49427. }
  49428.  
  49429. ~ clone_impl ( ) throw ( )
  49430. {
  49431. }
  49432.  
  49433. private :
  49434.  
  49435. clone_base const *
  49436. clone ( ) const
  49437. {
  49438. return new clone_impl ( * this , clone_tag ( ) ) ;
  49439. }
  49440.  
  49441. void
  49442. rethrow ( ) const
  49443. {
  49444. throw * this ;
  49445. }
  49446. } ;
  49447. }
  49448.  
  49449. template < class T >
  49450. inline
  49451. exception_detail :: clone_impl < T >
  49452. enable_current_exception ( T const & x )
  49453. {
  49454. return exception_detail :: clone_impl < T > ( x ) ;
  49455. }
  49456. }
  49457. #1 "./boost/current_function.hpp"
  49458. #22
  49459. namespace boost
  49460. {
  49461.  
  49462. namespace detail
  49463. {
  49464.  
  49465. inline void current_function_helper ( )
  49466. {
  49467. #61
  49468. }
  49469.  
  49470. }
  49471.  
  49472. }
  49473. #50 "./boost/throw_exception.hpp"
  49474. namespace boost
  49475. {
  49476. #58
  49477. inline void throw_exception_assert_compatibility ( std :: exception const & ) { }
  49478.  
  49479. template < class E > inline void throw_exception ( E const & e )
  49480. {
  49481.  
  49482.  
  49483. throw_exception_assert_compatibility ( e ) ;
  49484.  
  49485.  
  49486. throw enable_current_exception ( enable_error_info ( e ) ) ;
  49487.  
  49488.  
  49489.  
  49490. }
  49491.  
  49492.  
  49493.  
  49494.  
  49495. namespace
  49496. exception_detail
  49497. {
  49498. template < class E >
  49499.  
  49500. void
  49501. throw_exception_ ( E const & x , char const * current_function , char const * file , int line )
  49502. {
  49503. boost :: throw_exception (
  49504. set_info (
  49505. set_info (
  49506. set_info (
  49507. enable_error_info ( x ) ,
  49508. throw_function ( current_function ) ) ,
  49509. throw_file ( file ) ) ,
  49510. throw_line ( line ) ) ) ;
  49511. }
  49512. }
  49513.  
  49514. }
  49515. #1 "./boost/scoped_ptr.hpp"
  49516. #1 "./boost/smart_ptr/scoped_ptr.hpp"
  49517. #1 "./boost/assert.hpp"
  49518. #1 "/usr/include/assert.h"
  49519. #1 "./boost/checked_delete.hpp"
  49520. #24
  49521. namespace boost
  49522. {
  49523.  
  49524.  
  49525.  
  49526. template < class T > inline void checked_delete ( T * x )
  49527. {
  49528.  
  49529. typedef char type_must_be_complete [ sizeof ( T ) ? 1 : - 1 ] ;
  49530. ( void ) sizeof ( type_must_be_complete ) ;
  49531. delete x ;
  49532. }
  49533.  
  49534. template < class T > inline void checked_array_delete ( T * x )
  49535. {
  49536. typedef char type_must_be_complete [ sizeof ( T ) ? 1 : - 1 ] ;
  49537. ( void ) sizeof ( type_must_be_complete ) ;
  49538. delete [ ] x ;
  49539. }
  49540.  
  49541. template < class T > struct checked_deleter
  49542. {
  49543. typedef void result_type ;
  49544. typedef T * argument_type ;
  49545.  
  49546. void operator ( ) ( T * x ) const
  49547. {
  49548.  
  49549. boost :: checked_delete ( x ) ;
  49550. }
  49551. } ;
  49552.  
  49553. template < class T > struct checked_array_deleter
  49554. {
  49555. typedef void result_type ;
  49556. typedef T * argument_type ;
  49557.  
  49558. void operator ( ) ( T * x ) const
  49559. {
  49560. boost :: checked_array_delete ( x ) ;
  49561. }
  49562. } ;
  49563.  
  49564. }
  49565. #1 "./boost/smart_ptr/detail/sp_nullptr_t.hpp"
  49566. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/memory"
  49567. #46
  49568. #pragma GCC system_header
  49569. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_raw_storage_iter.h"
  49570. #59
  49571. namespace std
  49572. {
  49573. #67
  49574. template < class _OutputIterator , class _Tp >
  49575. class raw_storage_iterator
  49576. : public iterator < output_iterator_tag , void , void , void , void >
  49577. {
  49578. protected :
  49579. _OutputIterator _M_iter ;
  49580.  
  49581. public :
  49582. explicit
  49583. raw_storage_iterator ( _OutputIterator __x )
  49584. : _M_iter ( __x ) { }
  49585.  
  49586. raw_storage_iterator &
  49587. operator * ( ) { return * this ; }
  49588.  
  49589. raw_storage_iterator &
  49590. operator = ( const _Tp & __element )
  49591. {
  49592. std :: _Construct ( std :: __addressof ( * _M_iter ) , __element ) ;
  49593. return * this ;
  49594. }
  49595.  
  49596. raw_storage_iterator < _OutputIterator , _Tp > &
  49597. operator ++ ( )
  49598. {
  49599. ++ _M_iter ;
  49600. return * this ;
  49601. }
  49602.  
  49603. raw_storage_iterator < _OutputIterator , _Tp >
  49604. operator ++ ( int )
  49605. {
  49606. raw_storage_iterator < _OutputIterator , _Tp > __tmp = * this ;
  49607. ++ _M_iter ;
  49608. return __tmp ;
  49609. }
  49610. } ;
  49611.  
  49612.  
  49613. }
  49614. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ext/concurrence.h"
  49615. #32
  49616. #pragma GCC system_header
  49617. #40
  49618. namespace __gnu_cxx
  49619. {
  49620. #49
  49621. enum _Lock_policy { _S_single , _S_mutex , _S_atomic } ;
  49622.  
  49623.  
  49624.  
  49625. static const _Lock_policy __default_lock_policy =
  49626.  
  49627.  
  49628.  
  49629.  
  49630.  
  49631. _S_mutex ;
  49632. #67
  49633. class __concurrence_lock_error : public std :: exception
  49634. {
  49635. public :
  49636. virtual char const *
  49637. what ( ) const throw ( )
  49638. { return "__gnu_cxx::__concurrence_lock_error" ; }
  49639. } ;
  49640.  
  49641. class __concurrence_unlock_error : public std :: exception
  49642. {
  49643. public :
  49644. virtual char const *
  49645. what ( ) const throw ( )
  49646. { return "__gnu_cxx::__concurrence_unlock_error" ; }
  49647. } ;
  49648.  
  49649. class __concurrence_broadcast_error : public std :: exception
  49650. {
  49651. public :
  49652. virtual char const *
  49653. what ( ) const throw ( )
  49654. { return "__gnu_cxx::__concurrence_broadcast_error" ; }
  49655. } ;
  49656.  
  49657. class __concurrence_wait_error : public std :: exception
  49658. {
  49659. public :
  49660. virtual char const *
  49661. what ( ) const throw ( )
  49662. { return "__gnu_cxx::__concurrence_wait_error" ; }
  49663. } ;
  49664.  
  49665.  
  49666. inline void
  49667. __throw_concurrence_lock_error ( )
  49668. { ( throw ( __concurrence_lock_error ( ) ) ) ; }
  49669.  
  49670. inline void
  49671. __throw_concurrence_unlock_error ( )
  49672. { ( throw ( __concurrence_unlock_error ( ) ) ) ; }
  49673.  
  49674.  
  49675. inline void
  49676. __throw_concurrence_broadcast_error ( )
  49677. { ( throw ( __concurrence_broadcast_error ( ) ) ) ; }
  49678.  
  49679. inline void
  49680. __throw_concurrence_wait_error ( )
  49681. { ( throw ( __concurrence_wait_error ( ) ) ) ; }
  49682.  
  49683.  
  49684. class __mutex
  49685. {
  49686. private :
  49687.  
  49688.  
  49689.  
  49690. __gthread_mutex_t _M_mutex ;
  49691.  
  49692.  
  49693. __mutex ( const __mutex & ) ;
  49694. __mutex & operator = ( const __mutex & ) ;
  49695.  
  49696. public :
  49697. __mutex ( )
  49698. {
  49699.  
  49700. if ( __gthread_active_p ( ) )
  49701. __gthread_mutex_init_function ( & _M_mutex ) ;
  49702.  
  49703. }
  49704.  
  49705.  
  49706. ~ __mutex ( )
  49707. {
  49708. if ( __gthread_active_p ( ) )
  49709. __gthread_mutex_destroy ( & _M_mutex ) ;
  49710. }
  49711.  
  49712.  
  49713. void lock ( )
  49714. {
  49715.  
  49716. if ( __gthread_active_p ( ) )
  49717. {
  49718. if ( __gthread_mutex_lock ( & _M_mutex ) != 0 )
  49719. __throw_concurrence_lock_error ( ) ;
  49720. }
  49721.  
  49722. }
  49723.  
  49724. void unlock ( )
  49725. {
  49726.  
  49727. if ( __gthread_active_p ( ) )
  49728. {
  49729. if ( __gthread_mutex_unlock ( & _M_mutex ) != 0 )
  49730. __throw_concurrence_unlock_error ( ) ;
  49731. }
  49732.  
  49733. }
  49734.  
  49735. __gthread_mutex_t * gthread_mutex ( void )
  49736. { return & _M_mutex ; }
  49737. } ;
  49738.  
  49739. class __recursive_mutex
  49740. {
  49741. private :
  49742.  
  49743.  
  49744.  
  49745. __gthread_recursive_mutex_t _M_mutex ;
  49746.  
  49747.  
  49748. __recursive_mutex ( const __recursive_mutex & ) ;
  49749. __recursive_mutex & operator = ( const __recursive_mutex & ) ;
  49750.  
  49751. public :
  49752. __recursive_mutex ( )
  49753. {
  49754.  
  49755. if ( __gthread_active_p ( ) )
  49756. __gthread_recursive_mutex_init_function ( & _M_mutex ) ;
  49757.  
  49758. }
  49759.  
  49760.  
  49761. ~ __recursive_mutex ( )
  49762. {
  49763. if ( __gthread_active_p ( ) )
  49764. __gthread_recursive_mutex_destroy ( & _M_mutex ) ;
  49765. }
  49766.  
  49767.  
  49768. void lock ( )
  49769. {
  49770.  
  49771. if ( __gthread_active_p ( ) )
  49772. {
  49773. if ( __gthread_recursive_mutex_lock ( & _M_mutex ) != 0 )
  49774. __throw_concurrence_lock_error ( ) ;
  49775. }
  49776.  
  49777. }
  49778.  
  49779. void unlock ( )
  49780. {
  49781.  
  49782. if ( __gthread_active_p ( ) )
  49783. {
  49784. if ( __gthread_recursive_mutex_unlock ( & _M_mutex ) != 0 )
  49785. __throw_concurrence_unlock_error ( ) ;
  49786. }
  49787.  
  49788. }
  49789.  
  49790. __gthread_recursive_mutex_t * gthread_recursive_mutex ( void )
  49791. { return & _M_mutex ; }
  49792. } ;
  49793.  
  49794.  
  49795.  
  49796.  
  49797. class __scoped_lock
  49798. {
  49799. public :
  49800. typedef __mutex __mutex_type ;
  49801.  
  49802. private :
  49803. __mutex_type & _M_device ;
  49804.  
  49805. __scoped_lock ( const __scoped_lock & ) ;
  49806. __scoped_lock & operator = ( const __scoped_lock & ) ;
  49807.  
  49808. public :
  49809. explicit __scoped_lock ( __mutex_type & __name ) : _M_device ( __name )
  49810. { _M_device . lock ( ) ; }
  49811.  
  49812. ~ __scoped_lock ( ) throw ( )
  49813. { _M_device . unlock ( ) ; }
  49814. } ;
  49815.  
  49816.  
  49817. class __cond
  49818. {
  49819. private :
  49820.  
  49821.  
  49822.  
  49823. __gthread_cond_t _M_cond ;
  49824.  
  49825.  
  49826. __cond ( const __cond & ) ;
  49827. __cond & operator = ( const __cond & ) ;
  49828.  
  49829. public :
  49830. __cond ( )
  49831. {
  49832.  
  49833. if ( __gthread_active_p ( ) )
  49834. __gthread_cond_init_function ( & _M_cond ) ;
  49835.  
  49836. }
  49837.  
  49838.  
  49839. ~ __cond ( )
  49840. {
  49841. if ( __gthread_active_p ( ) )
  49842. __gthread_cond_destroy ( & _M_cond ) ;
  49843. }
  49844.  
  49845.  
  49846. void broadcast ( )
  49847. {
  49848.  
  49849. if ( __gthread_active_p ( ) )
  49850. {
  49851. if ( __gthread_cond_broadcast ( & _M_cond ) != 0 )
  49852. __throw_concurrence_broadcast_error ( ) ;
  49853. }
  49854.  
  49855. }
  49856.  
  49857. void wait ( __mutex * mutex )
  49858. {
  49859.  
  49860. {
  49861. if ( __gthread_cond_wait ( & _M_cond , mutex -> gthread_mutex ( ) ) != 0 )
  49862. __throw_concurrence_wait_error ( ) ;
  49863. }
  49864.  
  49865. }
  49866.  
  49867. void wait_recursive ( __recursive_mutex * mutex )
  49868. {
  49869.  
  49870. {
  49871. if ( __gthread_cond_wait_recursive ( & _M_cond ,
  49872. mutex -> gthread_recursive_mutex ( ) )
  49873. != 0 )
  49874. __throw_concurrence_wait_error ( ) ;
  49875. }
  49876.  
  49877. }
  49878. } ;
  49879.  
  49880.  
  49881.  
  49882. }
  49883. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/unique_ptr.h"
  49884. #39
  49885. namespace std
  49886. {
  49887. #49
  49888. template < typename > class auto_ptr ;
  49889.  
  49890.  
  49891.  
  49892. template < typename _Tp >
  49893. struct default_delete
  49894. {
  49895. constexpr default_delete ( ) noexcept = default ;
  49896.  
  49897. template < typename _Up , typename = typename
  49898. enable_if < is_convertible < _Up * , _Tp * > :: value > :: type >
  49899. default_delete ( const default_delete < _Up > & ) noexcept { }
  49900.  
  49901. void
  49902. operator ( ) ( _Tp * __ptr ) const
  49903. {
  49904. static_assert ( sizeof ( _Tp ) > 0 ,
  49905. "can't delete pointer to incomplete type" ) ;
  49906. delete __ptr ;
  49907. }
  49908. } ;
  49909.  
  49910.  
  49911.  
  49912.  
  49913. template < typename _Tp >
  49914. struct default_delete < _Tp [ ] >
  49915. {
  49916. private :
  49917. template < typename _Up >
  49918. using __remove_cv = typename remove_cv < _Up > :: type ;
  49919.  
  49920.  
  49921. template < typename _Up >
  49922. using __is_derived_Tp
  49923. = __and_ < is_base_of < _Tp , _Up > ,
  49924. __not_ < is_same < __remove_cv < _Tp > , __remove_cv < _Up >> > > ;
  49925.  
  49926. public :
  49927. constexpr default_delete ( ) noexcept = default ;
  49928.  
  49929. template < typename _Up , typename = typename
  49930. enable_if < ! __is_derived_Tp < _Up > :: value > :: type >
  49931. default_delete ( const default_delete < _Up [ ] > & ) noexcept { }
  49932.  
  49933. void
  49934. operator ( ) ( _Tp * __ptr ) const
  49935. {
  49936. static_assert ( sizeof ( _Tp ) > 0 ,
  49937. "can't delete pointer to incomplete type" ) ;
  49938. delete [ ] __ptr ;
  49939. }
  49940.  
  49941. template < typename _Up >
  49942. typename enable_if < __is_derived_Tp < _Up > :: value > :: type
  49943. operator ( ) ( _Up * ) const = delete ;
  49944. } ;
  49945.  
  49946.  
  49947. template < typename _Tp , typename _Dp = default_delete < _Tp > >
  49948. class unique_ptr
  49949. {
  49950.  
  49951. class _Pointer
  49952. {
  49953. template < typename _Up >
  49954. static typename _Up :: pointer __test ( typename _Up :: pointer * ) ;
  49955.  
  49956. template < typename _Up >
  49957. static _Tp * __test ( ... ) ;
  49958.  
  49959. typedef typename remove_reference < _Dp > :: type _Del ;
  49960.  
  49961. public :
  49962. typedef decltype ( __test < _Del > ( 0 ) ) type ;
  49963. } ;
  49964.  
  49965. typedef std :: tuple < typename _Pointer :: type , _Dp > __tuple_type ;
  49966. __tuple_type _M_t ;
  49967.  
  49968. public :
  49969. typedef typename _Pointer :: type pointer ;
  49970. typedef _Tp element_type ;
  49971. typedef _Dp deleter_type ;
  49972.  
  49973.  
  49974. constexpr unique_ptr ( ) noexcept
  49975. : _M_t ( )
  49976. { static_assert ( ! is_pointer < deleter_type > :: value ,
  49977. "constructed with null function pointer deleter" ) ; }
  49978.  
  49979. explicit
  49980. unique_ptr ( pointer __p ) noexcept
  49981. : _M_t ( __p , deleter_type ( ) )
  49982. { static_assert ( ! is_pointer < deleter_type > :: value ,
  49983. "constructed with null function pointer deleter" ) ; }
  49984.  
  49985. unique_ptr ( pointer __p ,
  49986. typename conditional < is_reference < deleter_type > :: value ,
  49987. deleter_type , const deleter_type & > :: type __d ) noexcept
  49988. : _M_t ( __p , __d ) { }
  49989.  
  49990. unique_ptr ( pointer __p ,
  49991. typename remove_reference < deleter_type > :: type && __d ) noexcept
  49992. : _M_t ( std :: move ( __p ) , std :: move ( __d ) )
  49993. { static_assert ( ! std :: is_reference < deleter_type > :: value ,
  49994. "rvalue deleter bound to reference" ) ; }
  49995.  
  49996. constexpr unique_ptr ( nullptr_t ) noexcept : unique_ptr ( ) { }
  49997.  
  49998.  
  49999. unique_ptr ( unique_ptr && __u ) noexcept
  50000. : _M_t ( __u . release ( ) , std :: forward < deleter_type > ( __u . get_deleter ( ) ) ) { }
  50001.  
  50002. template < typename _Up , typename _Ep , typename = _Require <
  50003. is_convertible < typename unique_ptr < _Up , _Ep > :: pointer , pointer > ,
  50004. __not_ < is_array < _Up >> ,
  50005. typename conditional < is_reference < _Dp > :: value ,
  50006. is_same < _Ep , _Dp > ,
  50007. is_convertible < _Ep , _Dp >> :: type >>
  50008. unique_ptr ( unique_ptr < _Up , _Ep > && __u ) noexcept
  50009. : _M_t ( __u . release ( ) , std :: forward < _Ep > ( __u . get_deleter ( ) ) )
  50010. { }
  50011.  
  50012.  
  50013. template < typename _Up , typename = _Require <
  50014. is_convertible < _Up * , _Tp * > , is_same < _Dp , default_delete < _Tp >> >>
  50015. unique_ptr ( auto_ptr < _Up > && __u ) noexcept ;
  50016.  
  50017.  
  50018.  
  50019. ~ unique_ptr ( ) noexcept
  50020. {
  50021. auto & __ptr = std :: get < 0 > ( _M_t ) ;
  50022. if ( __ptr != nullptr )
  50023. get_deleter ( ) ( __ptr ) ;
  50024. __ptr = pointer ( ) ;
  50025. }
  50026.  
  50027.  
  50028. unique_ptr &
  50029. operator = ( unique_ptr && __u ) noexcept
  50030. {
  50031. reset ( __u . release ( ) ) ;
  50032. get_deleter ( ) = std :: forward < deleter_type > ( __u . get_deleter ( ) ) ;
  50033. return * this ;
  50034. }
  50035.  
  50036. template < typename _Up , typename _Ep >
  50037. typename enable_if < __and_ <
  50038. is_convertible < typename unique_ptr < _Up , _Ep > :: pointer , pointer > ,
  50039. __not_ < is_array < _Up >>
  50040. > :: value ,
  50041. unique_ptr & > :: type
  50042. operator = ( unique_ptr < _Up , _Ep > && __u ) noexcept
  50043. {
  50044. reset ( __u . release ( ) ) ;
  50045. get_deleter ( ) = std :: forward < _Ep > ( __u . get_deleter ( ) ) ;
  50046. return * this ;
  50047. }
  50048.  
  50049. unique_ptr &
  50050. operator = ( nullptr_t ) noexcept
  50051. {
  50052. reset ( ) ;
  50053. return * this ;
  50054. }
  50055.  
  50056.  
  50057. typename add_lvalue_reference < element_type > :: type
  50058. operator * ( ) const
  50059. {
  50060. ;
  50061. return * get ( ) ;
  50062. }
  50063.  
  50064. pointer
  50065. operator -> ( ) const noexcept
  50066. {
  50067. ;
  50068. return get ( ) ;
  50069. }
  50070.  
  50071. pointer
  50072. get ( ) const noexcept
  50073. { return std :: get < 0 > ( _M_t ) ; }
  50074.  
  50075. deleter_type &
  50076. get_deleter ( ) noexcept
  50077. { return std :: get < 1 > ( _M_t ) ; }
  50078.  
  50079. const deleter_type &
  50080. get_deleter ( ) const noexcept
  50081. { return std :: get < 1 > ( _M_t ) ; }
  50082.  
  50083. explicit operator bool ( ) const noexcept
  50084. { return get ( ) == pointer ( ) ? false : true ; }
  50085.  
  50086.  
  50087. pointer
  50088. release ( ) noexcept
  50089. {
  50090. pointer __p = get ( ) ;
  50091. std :: get < 0 > ( _M_t ) = pointer ( ) ;
  50092. return __p ;
  50093. }
  50094.  
  50095. void
  50096. reset ( pointer __p = pointer ( ) ) noexcept
  50097. {
  50098. using std :: swap ;
  50099. swap ( std :: get < 0 > ( _M_t ) , __p ) ;
  50100. if ( __p != pointer ( ) )
  50101. get_deleter ( ) ( __p ) ;
  50102. }
  50103.  
  50104. void
  50105. swap ( unique_ptr & __u ) noexcept
  50106. {
  50107. using std :: swap ;
  50108. swap ( _M_t , __u . _M_t ) ;
  50109. }
  50110.  
  50111.  
  50112. unique_ptr ( const unique_ptr & ) = delete ;
  50113. unique_ptr & operator = ( const unique_ptr & ) = delete ;
  50114. } ;
  50115.  
  50116.  
  50117.  
  50118.  
  50119.  
  50120. template < typename _Tp , typename _Dp >
  50121. class unique_ptr < _Tp [ ] , _Dp >
  50122. {
  50123.  
  50124. class _Pointer
  50125. {
  50126. template < typename _Up >
  50127. static typename _Up :: pointer __test ( typename _Up :: pointer * ) ;
  50128.  
  50129. template < typename _Up >
  50130. static _Tp * __test ( ... ) ;
  50131.  
  50132. typedef typename remove_reference < _Dp > :: type _Del ;
  50133.  
  50134. public :
  50135. typedef decltype ( __test < _Del > ( 0 ) ) type ;
  50136. } ;
  50137.  
  50138. typedef std :: tuple < typename _Pointer :: type , _Dp > __tuple_type ;
  50139. __tuple_type _M_t ;
  50140.  
  50141. template < typename _Up >
  50142. using __remove_cv = typename remove_cv < _Up > :: type ;
  50143.  
  50144.  
  50145. template < typename _Up >
  50146. using __is_derived_Tp
  50147. = __and_ < is_base_of < _Tp , _Up > ,
  50148. __not_ < is_same < __remove_cv < _Tp > , __remove_cv < _Up >> > > ;
  50149.  
  50150. template < typename _Up , typename _Ep ,
  50151. typename _Tp_pointer = typename _Pointer :: type ,
  50152. typename _Up_pointer = typename unique_ptr < _Up , _Ep > :: pointer >
  50153. using __safe_conversion = __and_ <
  50154. is_convertible < _Up_pointer , _Tp_pointer > ,
  50155. is_array < _Up > ,
  50156. __or_ < __not_ < is_pointer < _Up_pointer >> ,
  50157. __not_ < is_pointer < _Tp_pointer >> ,
  50158. __not_ < __is_derived_Tp < typename remove_extent < _Up > :: type >>
  50159. >
  50160. > ;
  50161.  
  50162. public :
  50163. typedef typename _Pointer :: type pointer ;
  50164. typedef _Tp element_type ;
  50165. typedef _Dp deleter_type ;
  50166.  
  50167.  
  50168. constexpr unique_ptr ( ) noexcept
  50169. : _M_t ( )
  50170. { static_assert ( ! std :: is_pointer < deleter_type > :: value ,
  50171. "constructed with null function pointer deleter" ) ; }
  50172.  
  50173. explicit
  50174. unique_ptr ( pointer __p ) noexcept
  50175. : _M_t ( __p , deleter_type ( ) )
  50176. { static_assert ( ! is_pointer < deleter_type > :: value ,
  50177. "constructed with null function pointer deleter" ) ; }
  50178.  
  50179. template < typename _Up , typename = _Require < is_pointer < pointer > ,
  50180. is_convertible < _Up * , pointer > , __is_derived_Tp < _Up >> >
  50181. explicit
  50182. unique_ptr ( _Up * __p ) = delete ;
  50183.  
  50184. unique_ptr ( pointer __p ,
  50185. typename conditional < is_reference < deleter_type > :: value ,
  50186. deleter_type , const deleter_type & > :: type __d ) noexcept
  50187. : _M_t ( __p , __d ) { }
  50188.  
  50189. unique_ptr ( pointer __p , typename
  50190. remove_reference < deleter_type > :: type && __d ) noexcept
  50191. : _M_t ( std :: move ( __p ) , std :: move ( __d ) )
  50192. { static_assert ( ! is_reference < deleter_type > :: value ,
  50193. "rvalue deleter bound to reference" ) ; }
  50194.  
  50195.  
  50196. unique_ptr ( unique_ptr && __u ) noexcept
  50197. : _M_t ( __u . release ( ) , std :: forward < deleter_type > ( __u . get_deleter ( ) ) ) { }
  50198.  
  50199. constexpr unique_ptr ( nullptr_t ) noexcept : unique_ptr ( ) { }
  50200.  
  50201. template < typename _Up , typename _Ep ,
  50202. typename = _Require < __safe_conversion < _Up , _Ep > ,
  50203. typename conditional < is_reference < _Dp > :: value ,
  50204. is_same < _Ep , _Dp > ,
  50205. is_convertible < _Ep , _Dp >> :: type
  50206. >>
  50207. unique_ptr ( unique_ptr < _Up , _Ep > && __u ) noexcept
  50208. : _M_t ( __u . release ( ) , std :: forward < _Ep > ( __u . get_deleter ( ) ) )
  50209. { }
  50210.  
  50211.  
  50212. ~ unique_ptr ( )
  50213. {
  50214. auto & __ptr = std :: get < 0 > ( _M_t ) ;
  50215. if ( __ptr != nullptr )
  50216. get_deleter ( ) ( __ptr ) ;
  50217. __ptr = pointer ( ) ;
  50218. }
  50219.  
  50220.  
  50221. unique_ptr &
  50222. operator = ( unique_ptr && __u ) noexcept
  50223. {
  50224. reset ( __u . release ( ) ) ;
  50225. get_deleter ( ) = std :: forward < deleter_type > ( __u . get_deleter ( ) ) ;
  50226. return * this ;
  50227. }
  50228.  
  50229. template < typename _Up , typename _Ep >
  50230. typename
  50231. enable_if < __safe_conversion < _Up , _Ep > :: value , unique_ptr & > :: type
  50232. operator = ( unique_ptr < _Up , _Ep > && __u ) noexcept
  50233. {
  50234. reset ( __u . release ( ) ) ;
  50235. get_deleter ( ) = std :: forward < _Ep > ( __u . get_deleter ( ) ) ;
  50236. return * this ;
  50237. }
  50238.  
  50239. unique_ptr &
  50240. operator = ( nullptr_t ) noexcept
  50241. {
  50242. reset ( ) ;
  50243. return * this ;
  50244. }
  50245.  
  50246.  
  50247. typename std :: add_lvalue_reference < element_type > :: type
  50248. operator [ ] ( size_t __i ) const
  50249. {
  50250. ;
  50251. return get ( ) [ __i ] ;
  50252. }
  50253.  
  50254. pointer
  50255. get ( ) const noexcept
  50256. { return std :: get < 0 > ( _M_t ) ; }
  50257.  
  50258. deleter_type &
  50259. get_deleter ( ) noexcept
  50260. { return std :: get < 1 > ( _M_t ) ; }
  50261.  
  50262. const deleter_type &
  50263. get_deleter ( ) const noexcept
  50264. { return std :: get < 1 > ( _M_t ) ; }
  50265.  
  50266. explicit operator bool ( ) const noexcept
  50267. { return get ( ) == pointer ( ) ? false : true ; }
  50268.  
  50269.  
  50270. pointer
  50271. release ( ) noexcept
  50272. {
  50273. pointer __p = get ( ) ;
  50274. std :: get < 0 > ( _M_t ) = pointer ( ) ;
  50275. return __p ;
  50276. }
  50277.  
  50278. void
  50279. reset ( ) noexcept
  50280. { reset ( pointer ( ) ) ; }
  50281.  
  50282. void
  50283. reset ( pointer __p ) noexcept
  50284. {
  50285. using std :: swap ;
  50286. swap ( std :: get < 0 > ( _M_t ) , __p ) ;
  50287. if ( __p != nullptr )
  50288. get_deleter ( ) ( __p ) ;
  50289. }
  50290.  
  50291. template < typename _Up , typename = _Require < is_pointer < pointer > ,
  50292. is_convertible < _Up * , pointer > , __is_derived_Tp < _Up >> >
  50293. void reset ( _Up * ) = delete ;
  50294.  
  50295. void
  50296. swap ( unique_ptr & __u ) noexcept
  50297. {
  50298. using std :: swap ;
  50299. swap ( _M_t , __u . _M_t ) ;
  50300. }
  50301.  
  50302.  
  50303. unique_ptr ( const unique_ptr & ) = delete ;
  50304. unique_ptr & operator = ( const unique_ptr & ) = delete ;
  50305.  
  50306.  
  50307. template < typename _Up , typename = _Require < is_pointer < pointer > ,
  50308. is_convertible < _Up * , pointer > , __is_derived_Tp < _Up >> >
  50309. unique_ptr ( _Up * , typename
  50310. conditional < is_reference < deleter_type > :: value ,
  50311. deleter_type , const deleter_type & > :: type ) = delete ;
  50312.  
  50313. template < typename _Up , typename = _Require < is_pointer < pointer > ,
  50314. is_convertible < _Up * , pointer > , __is_derived_Tp < _Up >> >
  50315. unique_ptr ( _Up * , typename
  50316. remove_reference < deleter_type > :: type && ) = delete ;
  50317. } ;
  50318.  
  50319. template < typename _Tp , typename _Dp >
  50320. inline void
  50321. swap ( unique_ptr < _Tp , _Dp > & __x ,
  50322. unique_ptr < _Tp , _Dp > & __y ) noexcept
  50323. { __x . swap ( __y ) ; }
  50324.  
  50325. template < typename _Tp , typename _Dp ,
  50326. typename _Up , typename _Ep >
  50327. inline bool
  50328. operator == ( const unique_ptr < _Tp , _Dp > & __x ,
  50329. const unique_ptr < _Up , _Ep > & __y )
  50330. { return __x . get ( ) == __y . get ( ) ; }
  50331.  
  50332. template < typename _Tp , typename _Dp >
  50333. inline bool
  50334. operator == ( const unique_ptr < _Tp , _Dp > & __x , nullptr_t ) noexcept
  50335. { return ! __x ; }
  50336.  
  50337. template < typename _Tp , typename _Dp >
  50338. inline bool
  50339. operator == ( nullptr_t , const unique_ptr < _Tp , _Dp > & __x ) noexcept
  50340. { return ! __x ; }
  50341.  
  50342. template < typename _Tp , typename _Dp ,
  50343. typename _Up , typename _Ep >
  50344. inline bool
  50345. operator != ( const unique_ptr < _Tp , _Dp > & __x ,
  50346. const unique_ptr < _Up , _Ep > & __y )
  50347. { return __x . get ( ) != __y . get ( ) ; }
  50348.  
  50349. template < typename _Tp , typename _Dp >
  50350. inline bool
  50351. operator != ( const unique_ptr < _Tp , _Dp > & __x , nullptr_t ) noexcept
  50352. { return ( bool ) __x ; }
  50353.  
  50354. template < typename _Tp , typename _Dp >
  50355. inline bool
  50356. operator != ( nullptr_t , const unique_ptr < _Tp , _Dp > & __x ) noexcept
  50357. { return ( bool ) __x ; }
  50358.  
  50359. template < typename _Tp , typename _Dp ,
  50360. typename _Up , typename _Ep >
  50361. inline bool
  50362. operator < ( const unique_ptr < _Tp , _Dp > & __x ,
  50363. const unique_ptr < _Up , _Ep > & __y )
  50364. {
  50365. typedef typename
  50366. std :: common_type < typename unique_ptr < _Tp , _Dp > :: pointer ,
  50367. typename unique_ptr < _Up , _Ep > :: pointer > :: type _CT ;
  50368. return std :: less < _CT > ( ) ( __x . get ( ) , __y . get ( ) ) ;
  50369. }
  50370.  
  50371. template < typename _Tp , typename _Dp >
  50372. inline bool
  50373. operator < ( const unique_ptr < _Tp , _Dp > & __x , nullptr_t )
  50374. { return std :: less < typename unique_ptr < _Tp , _Dp > :: pointer > ( ) ( __x . get ( ) ,
  50375. nullptr ) ; }
  50376.  
  50377. template < typename _Tp , typename _Dp >
  50378. inline bool
  50379. operator < ( nullptr_t , const unique_ptr < _Tp , _Dp > & __x )
  50380. { return std :: less < typename unique_ptr < _Tp , _Dp > :: pointer > ( ) ( nullptr ,
  50381. __x . get ( ) ) ; }
  50382.  
  50383. template < typename _Tp , typename _Dp ,
  50384. typename _Up , typename _Ep >
  50385. inline bool
  50386. operator <= ( const unique_ptr < _Tp , _Dp > & __x ,
  50387. const unique_ptr < _Up , _Ep > & __y )
  50388. { return ! ( __y < __x ) ; }
  50389.  
  50390. template < typename _Tp , typename _Dp >
  50391. inline bool
  50392. operator <= ( const unique_ptr < _Tp , _Dp > & __x , nullptr_t )
  50393. { return ! ( nullptr < __x ) ; }
  50394.  
  50395. template < typename _Tp , typename _Dp >
  50396. inline bool
  50397. operator <= ( nullptr_t , const unique_ptr < _Tp , _Dp > & __x )
  50398. { return ! ( __x < nullptr ) ; }
  50399.  
  50400. template < typename _Tp , typename _Dp ,
  50401. typename _Up , typename _Ep >
  50402. inline bool
  50403. operator > ( const unique_ptr < _Tp , _Dp > & __x ,
  50404. const unique_ptr < _Up , _Ep > & __y )
  50405. { return ( __y < __x ) ; }
  50406.  
  50407. template < typename _Tp , typename _Dp >
  50408. inline bool
  50409. operator > ( const unique_ptr < _Tp , _Dp > & __x , nullptr_t )
  50410. { return std :: less < typename unique_ptr < _Tp , _Dp > :: pointer > ( ) ( nullptr ,
  50411. __x . get ( ) ) ; }
  50412.  
  50413. template < typename _Tp , typename _Dp >
  50414. inline bool
  50415. operator > ( nullptr_t , const unique_ptr < _Tp , _Dp > & __x )
  50416. { return std :: less < typename unique_ptr < _Tp , _Dp > :: pointer > ( ) ( __x . get ( ) ,
  50417. nullptr ) ; }
  50418.  
  50419. template < typename _Tp , typename _Dp ,
  50420. typename _Up , typename _Ep >
  50421. inline bool
  50422. operator >= ( const unique_ptr < _Tp , _Dp > & __x ,
  50423. const unique_ptr < _Up , _Ep > & __y )
  50424. { return ! ( __x < __y ) ; }
  50425.  
  50426. template < typename _Tp , typename _Dp >
  50427. inline bool
  50428. operator >= ( const unique_ptr < _Tp , _Dp > & __x , nullptr_t )
  50429. { return ! ( __x < nullptr ) ; }
  50430.  
  50431. template < typename _Tp , typename _Dp >
  50432. inline bool
  50433. operator >= ( nullptr_t , const unique_ptr < _Tp , _Dp > & __x )
  50434. { return ! ( nullptr < __x ) ; }
  50435.  
  50436.  
  50437. template < typename _Tp , typename _Dp >
  50438. struct hash < unique_ptr < _Tp , _Dp >>
  50439. : public __hash_base < size_t , unique_ptr < _Tp , _Dp >>
  50440. {
  50441. size_t
  50442. operator ( ) ( const unique_ptr < _Tp , _Dp > & __u ) const noexcept
  50443. {
  50444. typedef unique_ptr < _Tp , _Dp > _UP ;
  50445. return std :: hash < typename _UP :: pointer > ( ) ( __u . get ( ) ) ;
  50446. }
  50447. } ;
  50448.  
  50449.  
  50450.  
  50451.  
  50452. }
  50453. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/shared_ptr.h"
  50454. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/shared_ptr_base.h"
  50455. #52
  50456. namespace std
  50457. {
  50458.  
  50459.  
  50460.  
  50461. template < typename > class auto_ptr ;
  50462. #64
  50463. class bad_weak_ptr : public std :: exception
  50464. {
  50465. public :
  50466. virtual char const *
  50467. what ( ) const noexcept ;
  50468.  
  50469. virtual ~ bad_weak_ptr ( ) noexcept ;
  50470. } ;
  50471.  
  50472.  
  50473. inline void
  50474. __throw_bad_weak_ptr ( )
  50475. { ( throw ( bad_weak_ptr ( ) ) ) ; }
  50476.  
  50477. using __gnu_cxx :: _Lock_policy ;
  50478. using __gnu_cxx :: __default_lock_policy ;
  50479. using __gnu_cxx :: _S_single ;
  50480. using __gnu_cxx :: _S_mutex ;
  50481. using __gnu_cxx :: _S_atomic ;
  50482.  
  50483.  
  50484. template < _Lock_policy _Lp >
  50485. class _Mutex_base
  50486. {
  50487. protected :
  50488.  
  50489. enum { _S_need_barriers = 0 } ;
  50490. } ;
  50491.  
  50492. template < >
  50493. class _Mutex_base < _S_mutex >
  50494. : public __gnu_cxx :: __mutex
  50495. {
  50496. protected :
  50497.  
  50498.  
  50499.  
  50500. enum { _S_need_barriers = 1 } ;
  50501. } ;
  50502.  
  50503. template < _Lock_policy _Lp = __default_lock_policy >
  50504. class _Sp_counted_base
  50505. : public _Mutex_base < _Lp >
  50506. {
  50507. public :
  50508. _Sp_counted_base ( ) noexcept
  50509. : _M_use_count ( 1 ) , _M_weak_count ( 1 ) { }
  50510.  
  50511. virtual
  50512. ~ _Sp_counted_base ( ) noexcept
  50513. { }
  50514.  
  50515.  
  50516.  
  50517. virtual void
  50518. _M_dispose ( ) noexcept = 0 ;
  50519.  
  50520.  
  50521. virtual void
  50522. _M_destroy ( ) noexcept
  50523. { delete this ; }
  50524.  
  50525. virtual void *
  50526. _M_get_deleter ( const std :: type_info & ) = 0 ;
  50527.  
  50528. void
  50529. _M_add_ref_copy ( )
  50530. { __gnu_cxx :: __atomic_add_dispatch ( & _M_use_count , 1 ) ; }
  50531.  
  50532. void
  50533. _M_add_ref_lock ( ) ;
  50534.  
  50535. void
  50536. _M_release ( ) noexcept
  50537. {
  50538.  
  50539. ;
  50540. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_use_count , - 1 ) == 1 )
  50541. {
  50542. ;
  50543. _M_dispose ( ) ;
  50544.  
  50545.  
  50546.  
  50547.  
  50548. if ( _Mutex_base < _Lp > :: _S_need_barriers )
  50549. {
  50550. asm volatile ( "" :: : "memory" ) ;
  50551. asm volatile ( "" :: : "memory" ) ;
  50552. }
  50553.  
  50554.  
  50555. ;
  50556. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_weak_count ,
  50557. - 1 ) == 1 )
  50558. {
  50559. ;
  50560. _M_destroy ( ) ;
  50561. }
  50562. }
  50563. }
  50564.  
  50565. void
  50566. _M_weak_add_ref ( ) noexcept
  50567. { __gnu_cxx :: __atomic_add_dispatch ( & _M_weak_count , 1 ) ; }
  50568.  
  50569. void
  50570. _M_weak_release ( ) noexcept
  50571. {
  50572.  
  50573. ;
  50574. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_weak_count , - 1 ) == 1 )
  50575. {
  50576. ;
  50577. if ( _Mutex_base < _Lp > :: _S_need_barriers )
  50578. {
  50579.  
  50580.  
  50581. asm volatile ( "" :: : "memory" ) ;
  50582. asm volatile ( "" :: : "memory" ) ;
  50583. }
  50584. _M_destroy ( ) ;
  50585. }
  50586. }
  50587.  
  50588. long
  50589. _M_get_use_count ( ) const noexcept
  50590. {
  50591.  
  50592.  
  50593. return __atomic_load_n ( & _M_use_count , 0 ) ;
  50594. }
  50595.  
  50596. private :
  50597. _Sp_counted_base ( _Sp_counted_base const & ) = delete ;
  50598. _Sp_counted_base & operator = ( _Sp_counted_base const & ) = delete ;
  50599.  
  50600. _Atomic_word _M_use_count ;
  50601. _Atomic_word _M_weak_count ;
  50602. } ;
  50603.  
  50604. template < >
  50605. inline void
  50606. _Sp_counted_base < _S_single > ::
  50607. _M_add_ref_lock ( )
  50608. {
  50609. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_use_count , 1 ) == 0 )
  50610. {
  50611. _M_use_count = 0 ;
  50612. __throw_bad_weak_ptr ( ) ;
  50613. }
  50614. }
  50615.  
  50616. template < >
  50617. inline void
  50618. _Sp_counted_base < _S_mutex > ::
  50619. _M_add_ref_lock ( )
  50620. {
  50621. __gnu_cxx :: __scoped_lock sentry ( * this ) ;
  50622. if ( __gnu_cxx :: __exchange_and_add_dispatch ( & _M_use_count , 1 ) == 0 )
  50623. {
  50624. _M_use_count = 0 ;
  50625. __throw_bad_weak_ptr ( ) ;
  50626. }
  50627. }
  50628.  
  50629. template < >
  50630. inline void
  50631. _Sp_counted_base < _S_atomic > ::
  50632. _M_add_ref_lock ( )
  50633. {
  50634.  
  50635. _Atomic_word __count = _M_use_count ;
  50636. do
  50637. {
  50638. if ( __count == 0 )
  50639. __throw_bad_weak_ptr ( ) ;
  50640.  
  50641.  
  50642. }
  50643. while ( !
  50644.  
  50645. __builtin_atomic_compare_exchange_n ( ( void * ) ( & _M_use_count ) , ( void * ) ( & __count ) , ( __count + 1 ) , ( true
  50646. #246
  50647. ) , ( 4 ) , ( 0 ) ) ) ;
  50648. }
  50649.  
  50650.  
  50651.  
  50652. template < typename _Tp , _Lock_policy _Lp = __default_lock_policy >
  50653. class __shared_ptr ;
  50654.  
  50655. template < typename _Tp , _Lock_policy _Lp = __default_lock_policy >
  50656. class __weak_ptr ;
  50657.  
  50658. template < typename _Tp , _Lock_policy _Lp = __default_lock_policy >
  50659. class __enable_shared_from_this ;
  50660.  
  50661. template < typename _Tp >
  50662. class shared_ptr ;
  50663.  
  50664. template < typename _Tp >
  50665. class weak_ptr ;
  50666.  
  50667. template < typename _Tp >
  50668. struct owner_less ;
  50669.  
  50670. template < typename _Tp >
  50671. class enable_shared_from_this ;
  50672.  
  50673. template < _Lock_policy _Lp = __default_lock_policy >
  50674. class __weak_count ;
  50675.  
  50676. template < _Lock_policy _Lp = __default_lock_policy >
  50677. class __shared_count ;
  50678.  
  50679.  
  50680.  
  50681. template < typename _Ptr , _Lock_policy _Lp >
  50682. class _Sp_counted_ptr final : public _Sp_counted_base < _Lp >
  50683. {
  50684. public :
  50685. explicit
  50686. _Sp_counted_ptr ( _Ptr __p )
  50687. : _M_ptr ( __p ) { }
  50688.  
  50689. virtual void
  50690. _M_dispose ( ) noexcept
  50691. { delete _M_ptr ; }
  50692.  
  50693. virtual void
  50694. _M_destroy ( ) noexcept
  50695. { delete this ; }
  50696.  
  50697. virtual void *
  50698. _M_get_deleter ( const std :: type_info & )
  50699. { return 0 ; }
  50700.  
  50701. _Sp_counted_ptr ( const _Sp_counted_ptr & ) = delete ;
  50702. _Sp_counted_ptr & operator = ( const _Sp_counted_ptr & ) = delete ;
  50703.  
  50704. protected :
  50705. _Ptr _M_ptr ;
  50706. } ;
  50707.  
  50708. template < >
  50709. inline void
  50710. _Sp_counted_ptr < nullptr_t , _S_single > :: _M_dispose ( ) noexcept { }
  50711.  
  50712. template < >
  50713. inline void
  50714. _Sp_counted_ptr < nullptr_t , _S_mutex > :: _M_dispose ( ) noexcept { }
  50715.  
  50716. template < >
  50717. inline void
  50718. _Sp_counted_ptr < nullptr_t , _S_atomic > :: _M_dispose ( ) noexcept { }
  50719.  
  50720.  
  50721. template < typename _Ptr , typename _Deleter , typename _Alloc , _Lock_policy _Lp >
  50722. class _Sp_counted_deleter final : public _Sp_counted_base < _Lp >
  50723. {
  50724.  
  50725.  
  50726.  
  50727. struct _My_Deleter
  50728. : public _Alloc
  50729. {
  50730. _Deleter _M_del ;
  50731. _My_Deleter ( _Deleter __d , const _Alloc & __a )
  50732. : _Alloc ( __a ) , _M_del ( __d ) { }
  50733. } ;
  50734.  
  50735. public :
  50736.  
  50737. _Sp_counted_deleter ( _Ptr __p , _Deleter __d )
  50738. : _M_ptr ( __p ) , _M_del ( __d , _Alloc ( ) ) { }
  50739.  
  50740.  
  50741. _Sp_counted_deleter ( _Ptr __p , _Deleter __d , const _Alloc & __a )
  50742. : _M_ptr ( __p ) , _M_del ( __d , __a ) { }
  50743.  
  50744. ~ _Sp_counted_deleter ( ) noexcept { }
  50745.  
  50746. virtual void
  50747. _M_dispose ( ) noexcept
  50748. { _M_del . _M_del ( _M_ptr ) ; }
  50749.  
  50750. virtual void
  50751. _M_destroy ( ) noexcept
  50752. {
  50753. typedef typename allocator_traits < _Alloc > :: template
  50754. rebind_traits < _Sp_counted_deleter > _Alloc_traits ;
  50755. typename _Alloc_traits :: allocator_type __a ( _M_del ) ;
  50756. _Alloc_traits :: destroy ( __a , this ) ;
  50757. _Alloc_traits :: deallocate ( __a , this , 1 ) ;
  50758. }
  50759.  
  50760. virtual void *
  50761. _M_get_deleter ( const std :: type_info & __ti )
  50762. {
  50763.  
  50764.  
  50765.  
  50766. return 0 ;
  50767.  
  50768. }
  50769.  
  50770. protected :
  50771. _Ptr _M_ptr ;
  50772. _My_Deleter _M_del ;
  50773. } ;
  50774.  
  50775.  
  50776.  
  50777. struct _Sp_make_shared_tag { } ;
  50778.  
  50779. template < typename _Tp , typename _Alloc , _Lock_policy _Lp >
  50780. class _Sp_counted_ptr_inplace final : public _Sp_counted_base < _Lp >
  50781. {
  50782.  
  50783.  
  50784.  
  50785. struct _Impl
  50786. : public _Alloc
  50787. {
  50788. _Impl ( _Alloc __a ) : _Alloc ( __a ) , _M_ptr ( ) { }
  50789. _Tp * _M_ptr ;
  50790. } ;
  50791.  
  50792. public :
  50793. template < typename ... _Args >
  50794. _Sp_counted_ptr_inplace ( _Alloc __a , _Args && ... __args )
  50795. : _M_impl ( __a ) , _M_storage ( )
  50796. {
  50797. _M_impl . _M_ptr = static_cast < _Tp * > ( static_cast < void * > ( & _M_storage ) ) ;
  50798.  
  50799.  
  50800. allocator_traits < _Alloc > :: construct ( __a , _M_impl . _M_ptr ,
  50801. std :: forward < _Args > ( __args ) ... ) ;
  50802. }
  50803.  
  50804. ~ _Sp_counted_ptr_inplace ( ) noexcept { }
  50805.  
  50806. virtual void
  50807. _M_dispose ( ) noexcept
  50808. { allocator_traits < _Alloc > :: destroy ( _M_impl , _M_impl . _M_ptr ) ; }
  50809.  
  50810.  
  50811. virtual void
  50812. _M_destroy ( ) noexcept
  50813. {
  50814. typedef typename allocator_traits < _Alloc > :: template
  50815. rebind_traits < _Sp_counted_ptr_inplace > _Alloc_traits ;
  50816. typename _Alloc_traits :: allocator_type __a ( _M_impl ) ;
  50817. _Alloc_traits :: destroy ( __a , this ) ;
  50818. _Alloc_traits :: deallocate ( __a , this , 1 ) ;
  50819. }
  50820.  
  50821.  
  50822. virtual void *
  50823. _M_get_deleter ( const std :: type_info & __ti ) noexcept
  50824. {
  50825.  
  50826.  
  50827.  
  50828.  
  50829.  
  50830. return 0 ;
  50831.  
  50832. }
  50833.  
  50834. private :
  50835. _Impl _M_impl ;
  50836. typename aligned_storage < sizeof ( _Tp ) , alignment_of < _Tp > :: value > :: type
  50837. _M_storage ;
  50838. } ;
  50839.  
  50840. template < _Lock_policy _Lp >
  50841. class __shared_count
  50842. {
  50843. public :
  50844. constexpr __shared_count ( ) noexcept : _M_pi ( 0 )
  50845. { }
  50846.  
  50847. template < typename _Ptr >
  50848. explicit
  50849. __shared_count ( _Ptr __p ) : _M_pi ( 0 )
  50850. {
  50851. try
  50852. {
  50853. _M_pi = new _Sp_counted_ptr < _Ptr , _Lp > ( __p ) ;
  50854. }
  50855. catch ( ... )
  50856. {
  50857. delete __p ;
  50858. throw ;
  50859. }
  50860. }
  50861.  
  50862. template < typename _Ptr , typename _Deleter >
  50863. __shared_count ( _Ptr __p , _Deleter __d )
  50864. : __shared_count ( __p , std :: move ( __d ) , allocator < int > ( ) )
  50865. { }
  50866.  
  50867. template < typename _Ptr , typename _Deleter , typename _Alloc >
  50868. __shared_count ( _Ptr __p , _Deleter __d , _Alloc __a ) : _M_pi ( 0 )
  50869. {
  50870. typedef _Sp_counted_deleter < _Ptr , _Deleter , _Alloc , _Lp > _Sp_cd_type ;
  50871. typedef typename allocator_traits < _Alloc > :: template
  50872. rebind_traits < _Sp_cd_type > _Alloc_traits ;
  50873. typename _Alloc_traits :: allocator_type __a2 ( __a ) ;
  50874. _Sp_cd_type * __mem = 0 ;
  50875. try
  50876. {
  50877. __mem = _Alloc_traits :: allocate ( __a2 , 1 ) ;
  50878. _Alloc_traits :: construct ( __a2 , __mem ,
  50879. __p , std :: move ( __d ) , std :: move ( __a ) ) ;
  50880. _M_pi = __mem ;
  50881. }
  50882. catch ( ... )
  50883. {
  50884. __d ( __p ) ;
  50885. if ( __mem )
  50886. _Alloc_traits :: deallocate ( __a2 , __mem , 1 ) ;
  50887. throw ;
  50888. }
  50889. }
  50890.  
  50891. template < typename _Tp , typename _Alloc , typename ... _Args >
  50892. __shared_count ( _Sp_make_shared_tag , _Tp * , const _Alloc & __a ,
  50893. _Args && ... __args )
  50894. : _M_pi ( 0 )
  50895. {
  50896. typedef _Sp_counted_ptr_inplace < _Tp , _Alloc , _Lp > _Sp_cp_type ;
  50897. typedef typename allocator_traits < _Alloc > :: template
  50898. rebind_traits < _Sp_cp_type > _Alloc_traits ;
  50899. typename _Alloc_traits :: allocator_type __a2 ( __a ) ;
  50900. _Sp_cp_type * __mem = _Alloc_traits :: allocate ( __a2 , 1 ) ;
  50901. try
  50902. {
  50903. _Alloc_traits :: construct ( __a2 , __mem , std :: move ( __a ) ,
  50904. std :: forward < _Args > ( __args ) ... ) ;
  50905. _M_pi = __mem ;
  50906. }
  50907. catch ( ... )
  50908. {
  50909. _Alloc_traits :: deallocate ( __a2 , __mem , 1 ) ;
  50910. throw ;
  50911. }
  50912. }
  50913.  
  50914.  
  50915.  
  50916. template < typename _Tp >
  50917. explicit
  50918. __shared_count ( std :: auto_ptr < _Tp > && __r ) ;
  50919.  
  50920.  
  50921.  
  50922. template < typename _Tp , typename _Del >
  50923. explicit
  50924. __shared_count ( std :: unique_ptr < _Tp , _Del > && __r ) : _M_pi ( 0 )
  50925. {
  50926. using _Ptr = typename unique_ptr < _Tp , _Del > :: pointer ;
  50927. using _Del2 = typename conditional < is_reference < _Del > :: value ,
  50928. reference_wrapper < typename remove_reference < _Del > :: type > ,
  50929. _Del > :: type ;
  50930. using _Sp_cd_type
  50931. = _Sp_counted_deleter < _Ptr , _Del2 , allocator < void > , _Lp > ;
  50932. using _Alloc = allocator < _Sp_cd_type > ;
  50933. using _Alloc_traits = allocator_traits < _Alloc > ;
  50934. _Alloc __a ;
  50935. _Sp_cd_type * __mem = _Alloc_traits :: allocate ( __a , 1 ) ;
  50936. _Alloc_traits :: construct ( __a , __mem , __r . release ( ) ,
  50937. __r . get_deleter ( ) ) ;
  50938. _M_pi = __mem ;
  50939. }
  50940.  
  50941.  
  50942. explicit __shared_count ( const __weak_count < _Lp > & __r ) ;
  50943.  
  50944. ~ __shared_count ( ) noexcept
  50945. {
  50946. if ( _M_pi != nullptr )
  50947. _M_pi -> _M_release ( ) ;
  50948. }
  50949.  
  50950. __shared_count ( const __shared_count & __r ) noexcept
  50951. : _M_pi ( __r . _M_pi )
  50952. {
  50953. if ( _M_pi != 0 )
  50954. _M_pi -> _M_add_ref_copy ( ) ;
  50955. }
  50956.  
  50957. __shared_count &
  50958. operator = ( const __shared_count & __r ) noexcept
  50959. {
  50960. _Sp_counted_base < _Lp > * __tmp = __r . _M_pi ;
  50961. if ( __tmp != _M_pi )
  50962. {
  50963. if ( __tmp != 0 )
  50964. __tmp -> _M_add_ref_copy ( ) ;
  50965. if ( _M_pi != 0 )
  50966. _M_pi -> _M_release ( ) ;
  50967. _M_pi = __tmp ;
  50968. }
  50969. return * this ;
  50970. }
  50971.  
  50972. void
  50973. _M_swap ( __shared_count & __r ) noexcept
  50974. {
  50975. _Sp_counted_base < _Lp > * __tmp = __r . _M_pi ;
  50976. __r . _M_pi = _M_pi ;
  50977. _M_pi = __tmp ;
  50978. }
  50979.  
  50980. long
  50981. _M_get_use_count ( ) const noexcept
  50982. { return _M_pi != 0 ? _M_pi -> _M_get_use_count ( ) : 0 ; }
  50983.  
  50984. bool
  50985. _M_unique ( ) const noexcept
  50986. { return this -> _M_get_use_count ( ) == 1 ; }
  50987.  
  50988. void *
  50989. _M_get_deleter ( const std :: type_info & __ti ) const noexcept
  50990. { return _M_pi ? _M_pi -> _M_get_deleter ( __ti ) : 0 ; }
  50991.  
  50992. bool
  50993. _M_less ( const __shared_count & __rhs ) const noexcept
  50994. { return std :: less < _Sp_counted_base < _Lp > * > ( ) ( this -> _M_pi , __rhs . _M_pi ) ; }
  50995.  
  50996. bool
  50997. _M_less ( const __weak_count < _Lp > & __rhs ) const noexcept
  50998. { return std :: less < _Sp_counted_base < _Lp > * > ( ) ( this -> _M_pi , __rhs . _M_pi ) ; }
  50999.  
  51000.  
  51001. friend inline bool
  51002. operator == ( const __shared_count & __a , const __shared_count & __b ) noexcept
  51003. { return __a . _M_pi == __b . _M_pi ; }
  51004.  
  51005. private :
  51006. friend class __weak_count < _Lp > ;
  51007.  
  51008. _Sp_counted_base < _Lp > * _M_pi ;
  51009. } ;
  51010.  
  51011.  
  51012. template < _Lock_policy _Lp >
  51013. class __weak_count
  51014. {
  51015. public :
  51016. constexpr __weak_count ( ) noexcept : _M_pi ( 0 )
  51017. { }
  51018.  
  51019. __weak_count ( const __shared_count < _Lp > & __r ) noexcept
  51020. : _M_pi ( __r . _M_pi )
  51021. {
  51022. if ( _M_pi != 0 )
  51023. _M_pi -> _M_weak_add_ref ( ) ;
  51024. }
  51025.  
  51026. __weak_count ( const __weak_count < _Lp > & __r ) noexcept
  51027. : _M_pi ( __r . _M_pi )
  51028. {
  51029. if ( _M_pi != 0 )
  51030. _M_pi -> _M_weak_add_ref ( ) ;
  51031. }
  51032.  
  51033. ~ __weak_count ( ) noexcept
  51034. {
  51035. if ( _M_pi != 0 )
  51036. _M_pi -> _M_weak_release ( ) ;
  51037. }
  51038.  
  51039. __weak_count < _Lp > &
  51040. operator = ( const __shared_count < _Lp > & __r ) noexcept
  51041. {
  51042. _Sp_counted_base < _Lp > * __tmp = __r . _M_pi ;
  51043. if ( __tmp != 0 )
  51044. __tmp -> _M_weak_add_ref ( ) ;
  51045. if ( _M_pi != 0 )
  51046. _M_pi -> _M_weak_release ( ) ;
  51047. _M_pi = __tmp ;
  51048. return * this ;
  51049. }
  51050.  
  51051. __weak_count < _Lp > &
  51052. operator = ( const __weak_count < _Lp > & __r ) noexcept
  51053. {
  51054. _Sp_counted_base < _Lp > * __tmp = __r . _M_pi ;
  51055. if ( __tmp != 0 )
  51056. __tmp -> _M_weak_add_ref ( ) ;
  51057. if ( _M_pi != 0 )
  51058. _M_pi -> _M_weak_release ( ) ;
  51059. _M_pi = __tmp ;
  51060. return * this ;
  51061. }
  51062.  
  51063. void
  51064. _M_swap ( __weak_count < _Lp > & __r ) noexcept
  51065. {
  51066. _Sp_counted_base < _Lp > * __tmp = __r . _M_pi ;
  51067. __r . _M_pi = _M_pi ;
  51068. _M_pi = __tmp ;
  51069. }
  51070.  
  51071. long
  51072. _M_get_use_count ( ) const noexcept
  51073. { return _M_pi != 0 ? _M_pi -> _M_get_use_count ( ) : 0 ; }
  51074.  
  51075. bool
  51076. _M_less ( const __weak_count & __rhs ) const noexcept
  51077. { return std :: less < _Sp_counted_base < _Lp > * > ( ) ( this -> _M_pi , __rhs . _M_pi ) ; }
  51078.  
  51079. bool
  51080. _M_less ( const __shared_count < _Lp > & __rhs ) const noexcept
  51081. { return std :: less < _Sp_counted_base < _Lp > * > ( ) ( this -> _M_pi , __rhs . _M_pi ) ; }
  51082.  
  51083.  
  51084. friend inline bool
  51085. operator == ( const __weak_count & __a , const __weak_count & __b ) noexcept
  51086. { return __a . _M_pi == __b . _M_pi ; }
  51087.  
  51088. private :
  51089. friend class __shared_count < _Lp > ;
  51090.  
  51091. _Sp_counted_base < _Lp > * _M_pi ;
  51092. } ;
  51093.  
  51094.  
  51095. template < _Lock_policy _Lp >
  51096. inline __shared_count < _Lp > :: __shared_count ( const __weak_count < _Lp > & __r )
  51097. : _M_pi ( __r . _M_pi )
  51098. {
  51099. if ( _M_pi != 0 )
  51100. _M_pi -> _M_add_ref_lock ( ) ;
  51101. else
  51102. __throw_bad_weak_ptr ( ) ;
  51103. }
  51104.  
  51105.  
  51106.  
  51107.  
  51108.  
  51109. template < _Lock_policy _Lp , typename _Tp1 , typename _Tp2 >
  51110. void
  51111. __enable_shared_from_this_helper ( const __shared_count < _Lp > & ,
  51112. const __enable_shared_from_this < _Tp1 ,
  51113. _Lp > * , const _Tp2 * ) noexcept ;
  51114.  
  51115.  
  51116. template < typename _Tp1 , typename _Tp2 >
  51117. void
  51118. __enable_shared_from_this_helper ( const __shared_count < > & ,
  51119. const enable_shared_from_this < _Tp1 > * ,
  51120. const _Tp2 * ) noexcept ;
  51121.  
  51122. template < _Lock_policy _Lp >
  51123. inline void
  51124. __enable_shared_from_this_helper ( const __shared_count < _Lp > & , ... ) noexcept
  51125. { }
  51126.  
  51127.  
  51128. template < typename _Tp , _Lock_policy _Lp >
  51129. class __shared_ptr
  51130. {
  51131. public :
  51132. typedef _Tp element_type ;
  51133.  
  51134. constexpr __shared_ptr ( ) noexcept
  51135. : _M_ptr ( 0 ) , _M_refcount ( )
  51136. { }
  51137.  
  51138. template < typename _Tp1 >
  51139. explicit __shared_ptr ( _Tp1 * __p )
  51140. : _M_ptr ( __p ) , _M_refcount ( __p )
  51141. {
  51142.  
  51143. static_assert ( sizeof ( _Tp1 ) > 0 , "incomplete type" ) ;
  51144. __enable_shared_from_this_helper ( _M_refcount , __p , __p ) ;
  51145. }
  51146.  
  51147. template < typename _Tp1 , typename _Deleter >
  51148. __shared_ptr ( _Tp1 * __p , _Deleter __d )
  51149. : _M_ptr ( __p ) , _M_refcount ( __p , __d )
  51150. {
  51151.  
  51152.  
  51153. __enable_shared_from_this_helper ( _M_refcount , __p , __p ) ;
  51154. }
  51155.  
  51156. template < typename _Tp1 , typename _Deleter , typename _Alloc >
  51157. __shared_ptr ( _Tp1 * __p , _Deleter __d , _Alloc __a )
  51158. : _M_ptr ( __p ) , _M_refcount ( __p , __d , std :: move ( __a ) )
  51159. {
  51160.  
  51161.  
  51162. __enable_shared_from_this_helper ( _M_refcount , __p , __p ) ;
  51163. }
  51164.  
  51165. template < typename _Deleter >
  51166. __shared_ptr ( nullptr_t __p , _Deleter __d )
  51167. : _M_ptr ( 0 ) , _M_refcount ( __p , __d )
  51168. { }
  51169.  
  51170. template < typename _Deleter , typename _Alloc >
  51171. __shared_ptr ( nullptr_t __p , _Deleter __d , _Alloc __a )
  51172. : _M_ptr ( 0 ) , _M_refcount ( __p , __d , std :: move ( __a ) )
  51173. { }
  51174.  
  51175. template < typename _Tp1 >
  51176. __shared_ptr ( const __shared_ptr < _Tp1 , _Lp > & __r , _Tp * __p ) noexcept
  51177. : _M_ptr ( __p ) , _M_refcount ( __r . _M_refcount )
  51178. { }
  51179.  
  51180. __shared_ptr ( const __shared_ptr & ) noexcept = default ;
  51181. __shared_ptr & operator = ( const __shared_ptr & ) noexcept = default ;
  51182. ~ __shared_ptr ( ) = default ;
  51183.  
  51184. template < typename _Tp1 , typename = typename
  51185. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  51186. __shared_ptr ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51187. : _M_ptr ( __r . _M_ptr ) , _M_refcount ( __r . _M_refcount )
  51188. { }
  51189.  
  51190. __shared_ptr ( __shared_ptr && __r ) noexcept
  51191. : _M_ptr ( __r . _M_ptr ) , _M_refcount ( )
  51192. {
  51193. _M_refcount . _M_swap ( __r . _M_refcount ) ;
  51194. __r . _M_ptr = 0 ;
  51195. }
  51196.  
  51197. template < typename _Tp1 , typename = typename
  51198. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  51199. __shared_ptr ( __shared_ptr < _Tp1 , _Lp > && __r ) noexcept
  51200. : _M_ptr ( __r . _M_ptr ) , _M_refcount ( )
  51201. {
  51202. _M_refcount . _M_swap ( __r . _M_refcount ) ;
  51203. __r . _M_ptr = 0 ;
  51204. }
  51205.  
  51206. template < typename _Tp1 >
  51207. explicit __shared_ptr ( const __weak_ptr < _Tp1 , _Lp > & __r )
  51208. : _M_refcount ( __r . _M_refcount )
  51209. {
  51210.  
  51211.  
  51212.  
  51213.  
  51214. _M_ptr = __r . _M_ptr ;
  51215. }
  51216.  
  51217.  
  51218. template < typename _Tp1 , typename _Del >
  51219. __shared_ptr ( std :: unique_ptr < _Tp1 , _Del > && __r )
  51220. : _M_ptr ( __r . get ( ) ) , _M_refcount ( )
  51221. {
  51222.  
  51223. auto __tmp = std :: __addressof ( * __r . get ( ) ) ;
  51224. _M_refcount = __shared_count < _Lp > ( std :: move ( __r ) ) ;
  51225. __enable_shared_from_this_helper ( _M_refcount , __tmp , __tmp ) ;
  51226. }
  51227.  
  51228.  
  51229.  
  51230. template < typename _Tp1 >
  51231. __shared_ptr ( std :: auto_ptr < _Tp1 > && __r ) ;
  51232.  
  51233.  
  51234.  
  51235. constexpr __shared_ptr ( nullptr_t ) noexcept
  51236. : _M_ptr ( 0 ) , _M_refcount ( )
  51237. { }
  51238.  
  51239. template < typename _Tp1 >
  51240. __shared_ptr &
  51241. operator = ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51242. {
  51243. _M_ptr = __r . _M_ptr ;
  51244. _M_refcount = __r . _M_refcount ;
  51245. return * this ;
  51246. }
  51247.  
  51248.  
  51249. template < typename _Tp1 >
  51250. __shared_ptr &
  51251. operator = ( std :: auto_ptr < _Tp1 > && __r )
  51252. {
  51253. __shared_ptr ( std :: move ( __r ) ) . swap ( * this ) ;
  51254. return * this ;
  51255. }
  51256.  
  51257.  
  51258. __shared_ptr &
  51259. operator = ( __shared_ptr && __r ) noexcept
  51260. {
  51261. __shared_ptr ( std :: move ( __r ) ) . swap ( * this ) ;
  51262. return * this ;
  51263. }
  51264.  
  51265. template < class _Tp1 >
  51266. __shared_ptr &
  51267. operator = ( __shared_ptr < _Tp1 , _Lp > && __r ) noexcept
  51268. {
  51269. __shared_ptr ( std :: move ( __r ) ) . swap ( * this ) ;
  51270. return * this ;
  51271. }
  51272.  
  51273. template < typename _Tp1 , typename _Del >
  51274. __shared_ptr &
  51275. operator = ( std :: unique_ptr < _Tp1 , _Del > && __r )
  51276. {
  51277. __shared_ptr ( std :: move ( __r ) ) . swap ( * this ) ;
  51278. return * this ;
  51279. }
  51280.  
  51281. void
  51282. reset ( ) noexcept
  51283. { __shared_ptr ( ) . swap ( * this ) ; }
  51284.  
  51285. template < typename _Tp1 >
  51286. void
  51287. reset ( _Tp1 * __p )
  51288. {
  51289.  
  51290. ;
  51291. __shared_ptr ( __p ) . swap ( * this ) ;
  51292. }
  51293.  
  51294. template < typename _Tp1 , typename _Deleter >
  51295. void
  51296. reset ( _Tp1 * __p , _Deleter __d )
  51297. { __shared_ptr ( __p , __d ) . swap ( * this ) ; }
  51298.  
  51299. template < typename _Tp1 , typename _Deleter , typename _Alloc >
  51300. void
  51301. reset ( _Tp1 * __p , _Deleter __d , _Alloc __a )
  51302. { __shared_ptr ( __p , __d , std :: move ( __a ) ) . swap ( * this ) ; }
  51303.  
  51304.  
  51305. typename std :: add_lvalue_reference < _Tp > :: type
  51306. operator * ( ) const noexcept
  51307. {
  51308. ;
  51309. return * _M_ptr ;
  51310. }
  51311.  
  51312. _Tp *
  51313. operator -> ( ) const noexcept
  51314. {
  51315. ;
  51316. return _M_ptr ;
  51317. }
  51318.  
  51319. _Tp *
  51320. get ( ) const noexcept
  51321. { return _M_ptr ; }
  51322.  
  51323. explicit operator bool ( ) const
  51324. { return _M_ptr == 0 ? false : true ; }
  51325.  
  51326. bool
  51327. unique ( ) const noexcept
  51328. { return _M_refcount . _M_unique ( ) ; }
  51329.  
  51330. long
  51331. use_count ( ) const noexcept
  51332. { return _M_refcount . _M_get_use_count ( ) ; }
  51333.  
  51334. void
  51335. swap ( __shared_ptr < _Tp , _Lp > & __other ) noexcept
  51336. {
  51337. std :: swap ( _M_ptr , __other . _M_ptr ) ;
  51338. _M_refcount . _M_swap ( __other . _M_refcount ) ;
  51339. }
  51340.  
  51341. template < typename _Tp1 >
  51342. bool
  51343. owner_before ( __shared_ptr < _Tp1 , _Lp > const & __rhs ) const
  51344. { return _M_refcount . _M_less ( __rhs . _M_refcount ) ; }
  51345.  
  51346. template < typename _Tp1 >
  51347. bool
  51348. owner_before ( __weak_ptr < _Tp1 , _Lp > const & __rhs ) const
  51349. { return _M_refcount . _M_less ( __rhs . _M_refcount ) ; }
  51350. #966
  51351. template < typename _Alloc >
  51352. struct _Deleter
  51353. {
  51354. void operator ( ) ( _Tp * __ptr )
  51355. {
  51356. typedef allocator_traits < _Alloc > _Alloc_traits ;
  51357. _Alloc_traits :: destroy ( _M_alloc , __ptr ) ;
  51358. _Alloc_traits :: deallocate ( _M_alloc , __ptr , 1 ) ;
  51359. }
  51360. _Alloc _M_alloc ;
  51361. } ;
  51362.  
  51363. template < typename _Alloc , typename ... _Args >
  51364. __shared_ptr ( _Sp_make_shared_tag __tag , const _Alloc & __a ,
  51365. _Args && ... __args )
  51366. : _M_ptr ( ) , _M_refcount ( )
  51367. {
  51368. typedef typename _Alloc :: template rebind < _Tp > :: other _Alloc2 ;
  51369. _Deleter < _Alloc2 > __del = { _Alloc2 ( __a ) } ;
  51370. typedef allocator_traits < _Alloc2 > __traits ;
  51371. _M_ptr = __traits :: allocate ( __del . _M_alloc , 1 ) ;
  51372. try
  51373. {
  51374.  
  51375.  
  51376. __traits :: construct ( __del . _M_alloc , _M_ptr ,
  51377. std :: forward < _Args > ( __args ) ... ) ;
  51378. }
  51379. catch ( ... )
  51380. {
  51381. __traits :: deallocate ( __del . _M_alloc , _M_ptr , 1 ) ;
  51382. throw ;
  51383. }
  51384. __shared_count < _Lp > __count ( _M_ptr , __del , __del . _M_alloc ) ;
  51385. _M_refcount . _M_swap ( __count ) ;
  51386. __enable_shared_from_this_helper ( _M_refcount , _M_ptr , _M_ptr ) ;
  51387. }
  51388.  
  51389.  
  51390. template < typename _Tp1 , _Lock_policy _Lp1 , typename _Alloc ,
  51391. typename ... _Args >
  51392. friend __shared_ptr < _Tp1 , _Lp1 >
  51393. __allocate_shared ( const _Alloc & __a , _Args && ... __args ) ;
  51394.  
  51395. private :
  51396. void *
  51397. _M_get_deleter ( const std :: type_info & __ti ) const noexcept
  51398. { return _M_refcount . _M_get_deleter ( __ti ) ; }
  51399.  
  51400. template < typename _Tp1 , _Lock_policy _Lp1 > friend class __shared_ptr ;
  51401. template < typename _Tp1 , _Lock_policy _Lp1 > friend class __weak_ptr ;
  51402.  
  51403. template < typename _Del , typename _Tp1 , _Lock_policy _Lp1 >
  51404. friend _Del * get_deleter ( const __shared_ptr < _Tp1 , _Lp1 > & ) noexcept ;
  51405.  
  51406. _Tp * _M_ptr ;
  51407. __shared_count < _Lp > _M_refcount ;
  51408. } ;
  51409.  
  51410.  
  51411.  
  51412. template < typename _Tp1 , typename _Tp2 , _Lock_policy _Lp >
  51413. inline bool
  51414. operator == ( const __shared_ptr < _Tp1 , _Lp > & __a ,
  51415. const __shared_ptr < _Tp2 , _Lp > & __b ) noexcept
  51416. { return __a . get ( ) == __b . get ( ) ; }
  51417.  
  51418. template < typename _Tp , _Lock_policy _Lp >
  51419. inline bool
  51420. operator == ( const __shared_ptr < _Tp , _Lp > & __a , nullptr_t ) noexcept
  51421. { return ! __a ; }
  51422.  
  51423. template < typename _Tp , _Lock_policy _Lp >
  51424. inline bool
  51425. operator == ( nullptr_t , const __shared_ptr < _Tp , _Lp > & __a ) noexcept
  51426. { return ! __a ; }
  51427.  
  51428. template < typename _Tp1 , typename _Tp2 , _Lock_policy _Lp >
  51429. inline bool
  51430. operator != ( const __shared_ptr < _Tp1 , _Lp > & __a ,
  51431. const __shared_ptr < _Tp2 , _Lp > & __b ) noexcept
  51432. { return __a . get ( ) != __b . get ( ) ; }
  51433.  
  51434. template < typename _Tp , _Lock_policy _Lp >
  51435. inline bool
  51436. operator != ( const __shared_ptr < _Tp , _Lp > & __a , nullptr_t ) noexcept
  51437. { return ( bool ) __a ; }
  51438.  
  51439. template < typename _Tp , _Lock_policy _Lp >
  51440. inline bool
  51441. operator != ( nullptr_t , const __shared_ptr < _Tp , _Lp > & __a ) noexcept
  51442. { return ( bool ) __a ; }
  51443.  
  51444. template < typename _Tp1 , typename _Tp2 , _Lock_policy _Lp >
  51445. inline bool
  51446. operator < ( const __shared_ptr < _Tp1 , _Lp > & __a ,
  51447. const __shared_ptr < _Tp2 , _Lp > & __b ) noexcept
  51448. {
  51449. typedef typename std :: common_type < _Tp1 * , _Tp2 * > :: type _CT ;
  51450. return std :: less < _CT > ( ) ( __a . get ( ) , __b . get ( ) ) ;
  51451. }
  51452.  
  51453. template < typename _Tp , _Lock_policy _Lp >
  51454. inline bool
  51455. operator < ( const __shared_ptr < _Tp , _Lp > & __a , nullptr_t ) noexcept
  51456. { return std :: less < _Tp * > ( ) ( __a . get ( ) , nullptr ) ; }
  51457.  
  51458. template < typename _Tp , _Lock_policy _Lp >
  51459. inline bool
  51460. operator < ( nullptr_t , const __shared_ptr < _Tp , _Lp > & __a ) noexcept
  51461. { return std :: less < _Tp * > ( ) ( nullptr , __a . get ( ) ) ; }
  51462.  
  51463. template < typename _Tp1 , typename _Tp2 , _Lock_policy _Lp >
  51464. inline bool
  51465. operator <= ( const __shared_ptr < _Tp1 , _Lp > & __a ,
  51466. const __shared_ptr < _Tp2 , _Lp > & __b ) noexcept
  51467. { return ! ( __b < __a ) ; }
  51468.  
  51469. template < typename _Tp , _Lock_policy _Lp >
  51470. inline bool
  51471. operator <= ( const __shared_ptr < _Tp , _Lp > & __a , nullptr_t ) noexcept
  51472. { return ! ( nullptr < __a ) ; }
  51473.  
  51474. template < typename _Tp , _Lock_policy _Lp >
  51475. inline bool
  51476. operator <= ( nullptr_t , const __shared_ptr < _Tp , _Lp > & __a ) noexcept
  51477. { return ! ( __a < nullptr ) ; }
  51478.  
  51479. template < typename _Tp1 , typename _Tp2 , _Lock_policy _Lp >
  51480. inline bool
  51481. operator > ( const __shared_ptr < _Tp1 , _Lp > & __a ,
  51482. const __shared_ptr < _Tp2 , _Lp > & __b ) noexcept
  51483. { return ( __b < __a ) ; }
  51484.  
  51485. template < typename _Tp , _Lock_policy _Lp >
  51486. inline bool
  51487. operator > ( const __shared_ptr < _Tp , _Lp > & __a , nullptr_t ) noexcept
  51488. { return std :: less < _Tp * > ( ) ( nullptr , __a . get ( ) ) ; }
  51489.  
  51490. template < typename _Tp , _Lock_policy _Lp >
  51491. inline bool
  51492. operator > ( nullptr_t , const __shared_ptr < _Tp , _Lp > & __a ) noexcept
  51493. { return std :: less < _Tp * > ( ) ( __a . get ( ) , nullptr ) ; }
  51494.  
  51495. template < typename _Tp1 , typename _Tp2 , _Lock_policy _Lp >
  51496. inline bool
  51497. operator >= ( const __shared_ptr < _Tp1 , _Lp > & __a ,
  51498. const __shared_ptr < _Tp2 , _Lp > & __b ) noexcept
  51499. { return ! ( __a < __b ) ; }
  51500.  
  51501. template < typename _Tp , _Lock_policy _Lp >
  51502. inline bool
  51503. operator >= ( const __shared_ptr < _Tp , _Lp > & __a , nullptr_t ) noexcept
  51504. { return ! ( __a < nullptr ) ; }
  51505.  
  51506. template < typename _Tp , _Lock_policy _Lp >
  51507. inline bool
  51508. operator >= ( nullptr_t , const __shared_ptr < _Tp , _Lp > & __a ) noexcept
  51509. { return ! ( nullptr < __a ) ; }
  51510.  
  51511. template < typename _Sp >
  51512. struct _Sp_less : public binary_function < _Sp , _Sp , bool >
  51513. {
  51514. bool
  51515. operator ( ) ( const _Sp & __lhs , const _Sp & __rhs ) const noexcept
  51516. {
  51517. typedef typename _Sp :: element_type element_type ;
  51518. return std :: less < element_type * > ( ) ( __lhs . get ( ) , __rhs . get ( ) ) ;
  51519. }
  51520. } ;
  51521.  
  51522. template < typename _Tp , _Lock_policy _Lp >
  51523. struct less < __shared_ptr < _Tp , _Lp >>
  51524. : public _Sp_less < __shared_ptr < _Tp , _Lp >>
  51525. { } ;
  51526.  
  51527.  
  51528. template < typename _Tp , _Lock_policy _Lp >
  51529. inline void
  51530. swap ( __shared_ptr < _Tp , _Lp > & __a , __shared_ptr < _Tp , _Lp > & __b ) noexcept
  51531. { __a . swap ( __b ) ; }
  51532. #1155
  51533. template < typename _Tp , typename _Tp1 , _Lock_policy _Lp >
  51534. inline __shared_ptr < _Tp , _Lp >
  51535. static_pointer_cast ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51536. { return __shared_ptr < _Tp , _Lp > ( __r , static_cast < _Tp * > ( __r . get ( ) ) ) ; }
  51537. #1165
  51538. template < typename _Tp , typename _Tp1 , _Lock_policy _Lp >
  51539. inline __shared_ptr < _Tp , _Lp >
  51540. const_pointer_cast ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51541. { return __shared_ptr < _Tp , _Lp > ( __r , const_cast < _Tp * > ( __r . get ( ) ) ) ; }
  51542. #1175
  51543. template < typename _Tp , typename _Tp1 , _Lock_policy _Lp >
  51544. inline __shared_ptr < _Tp , _Lp >
  51545. dynamic_pointer_cast ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51546. {
  51547. if ( _Tp * __p = dynamic_cast < _Tp * > ( __r . get ( ) ) )
  51548. return __shared_ptr < _Tp , _Lp > ( __r , __p ) ;
  51549. return __shared_ptr < _Tp , _Lp > ( ) ;
  51550. }
  51551.  
  51552.  
  51553. template < typename _Tp , _Lock_policy _Lp >
  51554. class __weak_ptr
  51555. {
  51556. public :
  51557. typedef _Tp element_type ;
  51558.  
  51559. constexpr __weak_ptr ( ) noexcept
  51560. : _M_ptr ( 0 ) , _M_refcount ( )
  51561. { }
  51562.  
  51563. __weak_ptr ( const __weak_ptr & ) noexcept = default ;
  51564. __weak_ptr & operator = ( const __weak_ptr & ) noexcept = default ;
  51565. ~ __weak_ptr ( ) = default ;
  51566. #1213
  51567. template < typename _Tp1 , typename = typename
  51568. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  51569. __weak_ptr ( const __weak_ptr < _Tp1 , _Lp > & __r ) noexcept
  51570. : _M_refcount ( __r . _M_refcount )
  51571. { _M_ptr = __r . lock ( ) . get ( ) ; }
  51572.  
  51573. template < typename _Tp1 , typename = typename
  51574. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  51575. __weak_ptr ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51576. : _M_ptr ( __r . _M_ptr ) , _M_refcount ( __r . _M_refcount )
  51577. { }
  51578.  
  51579. template < typename _Tp1 >
  51580. __weak_ptr &
  51581. operator = ( const __weak_ptr < _Tp1 , _Lp > & __r ) noexcept
  51582. {
  51583. _M_ptr = __r . lock ( ) . get ( ) ;
  51584. _M_refcount = __r . _M_refcount ;
  51585. return * this ;
  51586. }
  51587.  
  51588. template < typename _Tp1 >
  51589. __weak_ptr &
  51590. operator = ( const __shared_ptr < _Tp1 , _Lp > & __r ) noexcept
  51591. {
  51592. _M_ptr = __r . _M_ptr ;
  51593. _M_refcount = __r . _M_refcount ;
  51594. return * this ;
  51595. }
  51596.  
  51597. __shared_ptr < _Tp , _Lp >
  51598. lock ( ) const noexcept
  51599. {
  51600.  
  51601.  
  51602. if ( expired ( ) )
  51603. return __shared_ptr < element_type , _Lp > ( ) ;
  51604.  
  51605. try
  51606. {
  51607. return __shared_ptr < element_type , _Lp > ( * this ) ;
  51608. }
  51609. catch ( const bad_weak_ptr & )
  51610. {
  51611.  
  51612.  
  51613.  
  51614. return __shared_ptr < element_type , _Lp > ( ) ;
  51615. }
  51616. #1269
  51617. }
  51618.  
  51619. long
  51620. use_count ( ) const noexcept
  51621. { return _M_refcount . _M_get_use_count ( ) ; }
  51622.  
  51623. bool
  51624. expired ( ) const noexcept
  51625. { return _M_refcount . _M_get_use_count ( ) == 0 ; }
  51626.  
  51627. template < typename _Tp1 >
  51628. bool
  51629. owner_before ( const __shared_ptr < _Tp1 , _Lp > & __rhs ) const
  51630. { return _M_refcount . _M_less ( __rhs . _M_refcount ) ; }
  51631.  
  51632. template < typename _Tp1 >
  51633. bool
  51634. owner_before ( const __weak_ptr < _Tp1 , _Lp > & __rhs ) const
  51635. { return _M_refcount . _M_less ( __rhs . _M_refcount ) ; }
  51636.  
  51637. void
  51638. reset ( ) noexcept
  51639. { __weak_ptr ( ) . swap ( * this ) ; }
  51640.  
  51641. void
  51642. swap ( __weak_ptr & __s ) noexcept
  51643. {
  51644. std :: swap ( _M_ptr , __s . _M_ptr ) ;
  51645. _M_refcount . _M_swap ( __s . _M_refcount ) ;
  51646. }
  51647.  
  51648. private :
  51649.  
  51650. void
  51651. _M_assign ( _Tp * __ptr , const __shared_count < _Lp > & __refcount ) noexcept
  51652. {
  51653. _M_ptr = __ptr ;
  51654. _M_refcount = __refcount ;
  51655. }
  51656.  
  51657. template < typename _Tp1 , _Lock_policy _Lp1 > friend class __shared_ptr ;
  51658. template < typename _Tp1 , _Lock_policy _Lp1 > friend class __weak_ptr ;
  51659. friend class __enable_shared_from_this < _Tp , _Lp > ;
  51660. friend class enable_shared_from_this < _Tp > ;
  51661.  
  51662. _Tp * _M_ptr ;
  51663. __weak_count < _Lp > _M_refcount ;
  51664. } ;
  51665.  
  51666.  
  51667. template < typename _Tp , _Lock_policy _Lp >
  51668. inline void
  51669. swap ( __weak_ptr < _Tp , _Lp > & __a , __weak_ptr < _Tp , _Lp > & __b ) noexcept
  51670. { __a . swap ( __b ) ; }
  51671.  
  51672. template < typename _Tp , typename _Tp1 >
  51673. struct _Sp_owner_less : public binary_function < _Tp , _Tp , bool >
  51674. {
  51675. bool
  51676. operator ( ) ( const _Tp & __lhs , const _Tp & __rhs ) const
  51677. { return __lhs . owner_before ( __rhs ) ; }
  51678.  
  51679. bool
  51680. operator ( ) ( const _Tp & __lhs , const _Tp1 & __rhs ) const
  51681. { return __lhs . owner_before ( __rhs ) ; }
  51682.  
  51683. bool
  51684. operator ( ) ( const _Tp1 & __lhs , const _Tp & __rhs ) const
  51685. { return __lhs . owner_before ( __rhs ) ; }
  51686. } ;
  51687.  
  51688. template < typename _Tp , _Lock_policy _Lp >
  51689. struct owner_less < __shared_ptr < _Tp , _Lp >>
  51690. : public _Sp_owner_less < __shared_ptr < _Tp , _Lp > , __weak_ptr < _Tp , _Lp >>
  51691. { } ;
  51692.  
  51693. template < typename _Tp , _Lock_policy _Lp >
  51694. struct owner_less < __weak_ptr < _Tp , _Lp >>
  51695. : public _Sp_owner_less < __weak_ptr < _Tp , _Lp > , __shared_ptr < _Tp , _Lp >>
  51696. { } ;
  51697.  
  51698.  
  51699. template < typename _Tp , _Lock_policy _Lp >
  51700. class __enable_shared_from_this
  51701. {
  51702. protected :
  51703. constexpr __enable_shared_from_this ( ) noexcept { }
  51704.  
  51705. __enable_shared_from_this ( const __enable_shared_from_this & ) noexcept { }
  51706.  
  51707. __enable_shared_from_this &
  51708. operator = ( const __enable_shared_from_this & ) noexcept
  51709. { return * this ; }
  51710.  
  51711. ~ __enable_shared_from_this ( ) { }
  51712.  
  51713. public :
  51714. __shared_ptr < _Tp , _Lp >
  51715. shared_from_this ( )
  51716. { return __shared_ptr < _Tp , _Lp > ( this -> _M_weak_this ) ; }
  51717.  
  51718. __shared_ptr < const _Tp , _Lp >
  51719. shared_from_this ( ) const
  51720. { return __shared_ptr < const _Tp , _Lp > ( this -> _M_weak_this ) ; }
  51721.  
  51722. private :
  51723. template < typename _Tp1 >
  51724. void
  51725. _M_weak_assign ( _Tp1 * __p , const __shared_count < _Lp > & __n ) const noexcept
  51726. { _M_weak_this . _M_assign ( __p , __n ) ; }
  51727.  
  51728. template < typename _Tp1 >
  51729. friend void
  51730. __enable_shared_from_this_helper ( const __shared_count < _Lp > & __pn ,
  51731. const __enable_shared_from_this * __pe ,
  51732. const _Tp1 * __px ) noexcept
  51733. {
  51734. if ( __pe != 0 )
  51735. __pe -> _M_weak_assign ( const_cast < _Tp1 * > ( __px ) , __pn ) ;
  51736. }
  51737.  
  51738. mutable __weak_ptr < _Tp , _Lp > _M_weak_this ;
  51739. } ;
  51740.  
  51741.  
  51742. template < typename _Tp , _Lock_policy _Lp , typename _Alloc , typename ... _Args >
  51743. inline __shared_ptr < _Tp , _Lp >
  51744. __allocate_shared ( const _Alloc & __a , _Args && ... __args )
  51745. {
  51746. return __shared_ptr < _Tp , _Lp > ( _Sp_make_shared_tag ( ) , __a ,
  51747. std :: forward < _Args > ( __args ) ... ) ;
  51748. }
  51749.  
  51750. template < typename _Tp , _Lock_policy _Lp , typename ... _Args >
  51751. inline __shared_ptr < _Tp , _Lp >
  51752. __make_shared ( _Args && ... __args )
  51753. {
  51754. typedef typename std :: remove_const < _Tp > :: type _Tp_nc ;
  51755. return std :: __allocate_shared < _Tp , _Lp > ( std :: allocator < _Tp_nc > ( ) ,
  51756. std :: forward < _Args > ( __args ) ... ) ;
  51757. }
  51758.  
  51759.  
  51760. template < typename _Tp , _Lock_policy _Lp >
  51761. struct hash < __shared_ptr < _Tp , _Lp >>
  51762. : public __hash_base < size_t , __shared_ptr < _Tp , _Lp >>
  51763. {
  51764. size_t
  51765. operator ( ) ( const __shared_ptr < _Tp , _Lp > & __s ) const noexcept
  51766. { return std :: hash < _Tp * > ( ) ( __s . get ( ) ) ; }
  51767. } ;
  51768.  
  51769.  
  51770. }
  51771. #54 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/shared_ptr.h"
  51772. namespace std
  51773. {
  51774. #64
  51775. template < typename _Ch , typename _Tr , typename _Tp , _Lock_policy _Lp >
  51776. inline std :: basic_ostream < _Ch , _Tr > &
  51777. operator << ( std :: basic_ostream < _Ch , _Tr > & __os ,
  51778. const __shared_ptr < _Tp , _Lp > & __p )
  51779. {
  51780. __os << __p . get ( ) ;
  51781. return __os ;
  51782. }
  51783.  
  51784.  
  51785. template < typename _Del , typename _Tp , _Lock_policy _Lp >
  51786. inline _Del *
  51787. get_deleter ( const __shared_ptr < _Tp , _Lp > & __p ) noexcept
  51788. {
  51789.  
  51790.  
  51791.  
  51792. return 0 ;
  51793.  
  51794. }
  51795. #92
  51796. template < typename _Tp >
  51797. class shared_ptr : public __shared_ptr < _Tp >
  51798. {
  51799. public :
  51800.  
  51801.  
  51802.  
  51803.  
  51804. constexpr shared_ptr ( ) noexcept
  51805. : __shared_ptr < _Tp > ( ) { }
  51806.  
  51807. shared_ptr ( const shared_ptr & ) noexcept = default ;
  51808. #111
  51809. template < typename _Tp1 >
  51810. explicit shared_ptr ( _Tp1 * __p )
  51811. : __shared_ptr < _Tp > ( __p ) { }
  51812. #128
  51813. template < typename _Tp1 , typename _Deleter >
  51814. shared_ptr ( _Tp1 * __p , _Deleter __d )
  51815. : __shared_ptr < _Tp > ( __p , __d ) { }
  51816. #145
  51817. template < typename _Deleter >
  51818. shared_ptr ( nullptr_t __p , _Deleter __d )
  51819. : __shared_ptr < _Tp > ( __p , __d ) { }
  51820. #164
  51821. template < typename _Tp1 , typename _Deleter , typename _Alloc >
  51822. shared_ptr ( _Tp1 * __p , _Deleter __d , _Alloc __a )
  51823. : __shared_ptr < _Tp > ( __p , __d , std :: move ( __a ) ) { }
  51824. #183
  51825. template < typename _Deleter , typename _Alloc >
  51826. shared_ptr ( nullptr_t __p , _Deleter __d , _Alloc __a )
  51827. : __shared_ptr < _Tp > ( __p , __d , std :: move ( __a ) ) { }
  51828. #205
  51829. template < typename _Tp1 >
  51830. shared_ptr ( const shared_ptr < _Tp1 > & __r , _Tp * __p ) noexcept
  51831. : __shared_ptr < _Tp > ( __r , __p ) { }
  51832. #216
  51833. template < typename _Tp1 , typename = typename
  51834. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  51835. shared_ptr ( const shared_ptr < _Tp1 > & __r ) noexcept
  51836. : __shared_ptr < _Tp > ( __r ) { }
  51837. #226
  51838. shared_ptr ( shared_ptr && __r ) noexcept
  51839. : __shared_ptr < _Tp > ( std :: move ( __r ) ) { }
  51840. #234
  51841. template < typename _Tp1 , typename = typename
  51842. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  51843. shared_ptr ( shared_ptr < _Tp1 > && __r ) noexcept
  51844. : __shared_ptr < _Tp > ( std :: move ( __r ) ) { }
  51845. #247
  51846. template < typename _Tp1 >
  51847. explicit shared_ptr ( const weak_ptr < _Tp1 > & __r )
  51848. : __shared_ptr < _Tp > ( __r ) { }
  51849.  
  51850.  
  51851. template < typename _Tp1 >
  51852. shared_ptr ( std :: auto_ptr < _Tp1 > && __r ) ;
  51853.  
  51854.  
  51855. template < typename _Tp1 , typename _Del >
  51856. shared_ptr ( std :: unique_ptr < _Tp1 , _Del > && __r )
  51857. : __shared_ptr < _Tp > ( std :: move ( __r ) ) { }
  51858. #265
  51859. constexpr shared_ptr ( nullptr_t __p ) noexcept
  51860. : __shared_ptr < _Tp > ( __p ) { }
  51861.  
  51862. shared_ptr & operator = ( const shared_ptr & ) noexcept = default ;
  51863.  
  51864. template < typename _Tp1 >
  51865. shared_ptr &
  51866. operator = ( const shared_ptr < _Tp1 > & __r ) noexcept
  51867. {
  51868. this -> __shared_ptr < _Tp > :: operator = ( __r ) ;
  51869. return * this ;
  51870. }
  51871.  
  51872.  
  51873. template < typename _Tp1 >
  51874. shared_ptr &
  51875. operator = ( std :: auto_ptr < _Tp1 > && __r )
  51876. {
  51877. this -> __shared_ptr < _Tp > :: operator = ( std :: move ( __r ) ) ;
  51878. return * this ;
  51879. }
  51880.  
  51881.  
  51882. shared_ptr &
  51883. operator = ( shared_ptr && __r ) noexcept
  51884. {
  51885. this -> __shared_ptr < _Tp > :: operator = ( std :: move ( __r ) ) ;
  51886. return * this ;
  51887. }
  51888.  
  51889. template < class _Tp1 >
  51890. shared_ptr &
  51891. operator = ( shared_ptr < _Tp1 > && __r ) noexcept
  51892. {
  51893. this -> __shared_ptr < _Tp > :: operator = ( std :: move ( __r ) ) ;
  51894. return * this ;
  51895. }
  51896.  
  51897. template < typename _Tp1 , typename _Del >
  51898. shared_ptr &
  51899. operator = ( std :: unique_ptr < _Tp1 , _Del > && __r )
  51900. {
  51901. this -> __shared_ptr < _Tp > :: operator = ( std :: move ( __r ) ) ;
  51902. return * this ;
  51903. }
  51904.  
  51905. private :
  51906.  
  51907. template < typename _Alloc , typename ... _Args >
  51908. shared_ptr ( _Sp_make_shared_tag __tag , const _Alloc & __a ,
  51909. _Args && ... __args )
  51910. : __shared_ptr < _Tp > ( __tag , __a , std :: forward < _Args > ( __args ) ... )
  51911. { }
  51912.  
  51913. template < typename _Tp1 , typename _Alloc , typename ... _Args >
  51914. friend shared_ptr < _Tp1 >
  51915. allocate_shared ( const _Alloc & __a , _Args && ... __args ) ;
  51916. } ;
  51917.  
  51918.  
  51919. template < typename _Tp1 , typename _Tp2 >
  51920. inline bool
  51921. operator == ( const shared_ptr < _Tp1 > & __a ,
  51922. const shared_ptr < _Tp2 > & __b ) noexcept
  51923. { return __a . get ( ) == __b . get ( ) ; }
  51924.  
  51925. template < typename _Tp >
  51926. inline bool
  51927. operator == ( const shared_ptr < _Tp > & __a , nullptr_t ) noexcept
  51928. { return ! __a ; }
  51929.  
  51930. template < typename _Tp >
  51931. inline bool
  51932. operator == ( nullptr_t , const shared_ptr < _Tp > & __a ) noexcept
  51933. { return ! __a ; }
  51934.  
  51935. template < typename _Tp1 , typename _Tp2 >
  51936. inline bool
  51937. operator != ( const shared_ptr < _Tp1 > & __a ,
  51938. const shared_ptr < _Tp2 > & __b ) noexcept
  51939. { return __a . get ( ) != __b . get ( ) ; }
  51940.  
  51941. template < typename _Tp >
  51942. inline bool
  51943. operator != ( const shared_ptr < _Tp > & __a , nullptr_t ) noexcept
  51944. { return ( bool ) __a ; }
  51945.  
  51946. template < typename _Tp >
  51947. inline bool
  51948. operator != ( nullptr_t , const shared_ptr < _Tp > & __a ) noexcept
  51949. { return ( bool ) __a ; }
  51950.  
  51951. template < typename _Tp1 , typename _Tp2 >
  51952. inline bool
  51953. operator < ( const shared_ptr < _Tp1 > & __a ,
  51954. const shared_ptr < _Tp2 > & __b ) noexcept
  51955. {
  51956. typedef typename std :: common_type < _Tp1 * , _Tp2 * > :: type _CT ;
  51957. return std :: less < _CT > ( ) ( __a . get ( ) , __b . get ( ) ) ;
  51958. }
  51959.  
  51960. template < typename _Tp >
  51961. inline bool
  51962. operator < ( const shared_ptr < _Tp > & __a , nullptr_t ) noexcept
  51963. { return std :: less < _Tp * > ( ) ( __a . get ( ) , nullptr ) ; }
  51964.  
  51965. template < typename _Tp >
  51966. inline bool
  51967. operator < ( nullptr_t , const shared_ptr < _Tp > & __a ) noexcept
  51968. { return std :: less < _Tp * > ( ) ( nullptr , __a . get ( ) ) ; }
  51969.  
  51970. template < typename _Tp1 , typename _Tp2 >
  51971. inline bool
  51972. operator <= ( const shared_ptr < _Tp1 > & __a ,
  51973. const shared_ptr < _Tp2 > & __b ) noexcept
  51974. { return ! ( __b < __a ) ; }
  51975.  
  51976. template < typename _Tp >
  51977. inline bool
  51978. operator <= ( const shared_ptr < _Tp > & __a , nullptr_t ) noexcept
  51979. { return ! ( nullptr < __a ) ; }
  51980.  
  51981. template < typename _Tp >
  51982. inline bool
  51983. operator <= ( nullptr_t , const shared_ptr < _Tp > & __a ) noexcept
  51984. { return ! ( __a < nullptr ) ; }
  51985.  
  51986. template < typename _Tp1 , typename _Tp2 >
  51987. inline bool
  51988. operator > ( const shared_ptr < _Tp1 > & __a ,
  51989. const shared_ptr < _Tp2 > & __b ) noexcept
  51990. { return ( __b < __a ) ; }
  51991.  
  51992. template < typename _Tp >
  51993. inline bool
  51994. operator > ( const shared_ptr < _Tp > & __a , nullptr_t ) noexcept
  51995. { return std :: less < _Tp * > ( ) ( nullptr , __a . get ( ) ) ; }
  51996.  
  51997. template < typename _Tp >
  51998. inline bool
  51999. operator > ( nullptr_t , const shared_ptr < _Tp > & __a ) noexcept
  52000. { return std :: less < _Tp * > ( ) ( __a . get ( ) , nullptr ) ; }
  52001.  
  52002. template < typename _Tp1 , typename _Tp2 >
  52003. inline bool
  52004. operator >= ( const shared_ptr < _Tp1 > & __a ,
  52005. const shared_ptr < _Tp2 > & __b ) noexcept
  52006. { return ! ( __a < __b ) ; }
  52007.  
  52008. template < typename _Tp >
  52009. inline bool
  52010. operator >= ( const shared_ptr < _Tp > & __a , nullptr_t ) noexcept
  52011. { return ! ( __a < nullptr ) ; }
  52012.  
  52013. template < typename _Tp >
  52014. inline bool
  52015. operator >= ( nullptr_t , const shared_ptr < _Tp > & __a ) noexcept
  52016. { return ! ( nullptr < __a ) ; }
  52017.  
  52018. template < typename _Tp >
  52019. struct less < shared_ptr < _Tp >> : public _Sp_less < shared_ptr < _Tp >>
  52020. { } ;
  52021.  
  52022.  
  52023. template < typename _Tp >
  52024. inline void
  52025. swap ( shared_ptr < _Tp > & __a , shared_ptr < _Tp > & __b ) noexcept
  52026. { __a . swap ( __b ) ; }
  52027.  
  52028.  
  52029. template < typename _Tp , typename _Tp1 >
  52030. inline shared_ptr < _Tp >
  52031. static_pointer_cast ( const shared_ptr < _Tp1 > & __r ) noexcept
  52032. { return shared_ptr < _Tp > ( __r , static_cast < _Tp * > ( __r . get ( ) ) ) ; }
  52033.  
  52034. template < typename _Tp , typename _Tp1 >
  52035. inline shared_ptr < _Tp >
  52036. const_pointer_cast ( const shared_ptr < _Tp1 > & __r ) noexcept
  52037. { return shared_ptr < _Tp > ( __r , const_cast < _Tp * > ( __r . get ( ) ) ) ; }
  52038.  
  52039. template < typename _Tp , typename _Tp1 >
  52040. inline shared_ptr < _Tp >
  52041. dynamic_pointer_cast ( const shared_ptr < _Tp1 > & __r ) noexcept
  52042. {
  52043. if ( _Tp * __p = dynamic_cast < _Tp * > ( __r . get ( ) ) )
  52044. return shared_ptr < _Tp > ( __r , __p ) ;
  52045. return shared_ptr < _Tp > ( ) ;
  52046. }
  52047. #460
  52048. template < typename _Tp >
  52049. class weak_ptr : public __weak_ptr < _Tp >
  52050. {
  52051. public :
  52052. constexpr weak_ptr ( ) noexcept
  52053. : __weak_ptr < _Tp > ( ) { }
  52054.  
  52055. template < typename _Tp1 , typename = typename
  52056. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  52057. weak_ptr ( const weak_ptr < _Tp1 > & __r ) noexcept
  52058. : __weak_ptr < _Tp > ( __r ) { }
  52059.  
  52060. template < typename _Tp1 , typename = typename
  52061. std :: enable_if < std :: is_convertible < _Tp1 * , _Tp * > :: value > :: type >
  52062. weak_ptr ( const shared_ptr < _Tp1 > & __r ) noexcept
  52063. : __weak_ptr < _Tp > ( __r ) { }
  52064.  
  52065. template < typename _Tp1 >
  52066. weak_ptr &
  52067. operator = ( const weak_ptr < _Tp1 > & __r ) noexcept
  52068. {
  52069. this -> __weak_ptr < _Tp > :: operator = ( __r ) ;
  52070. return * this ;
  52071. }
  52072.  
  52073. template < typename _Tp1 >
  52074. weak_ptr &
  52075. operator = ( const shared_ptr < _Tp1 > & __r ) noexcept
  52076. {
  52077. this -> __weak_ptr < _Tp > :: operator = ( __r ) ;
  52078. return * this ;
  52079. }
  52080.  
  52081. shared_ptr < _Tp >
  52082. lock ( ) const noexcept
  52083. {
  52084.  
  52085. if ( this -> expired ( ) )
  52086. return shared_ptr < _Tp > ( ) ;
  52087.  
  52088. try
  52089. {
  52090. return shared_ptr < _Tp > ( * this ) ;
  52091. }
  52092. catch ( const bad_weak_ptr & )
  52093. {
  52094. return shared_ptr < _Tp > ( ) ;
  52095. }
  52096.  
  52097.  
  52098.  
  52099. }
  52100. } ;
  52101.  
  52102.  
  52103. template < typename _Tp >
  52104. inline void
  52105. swap ( weak_ptr < _Tp > & __a , weak_ptr < _Tp > & __b ) noexcept
  52106. { __a . swap ( __b ) ; }
  52107.  
  52108.  
  52109.  
  52110. template < typename _Tp >
  52111. struct owner_less ;
  52112.  
  52113.  
  52114. template < typename _Tp >
  52115. struct owner_less < shared_ptr < _Tp >>
  52116. : public _Sp_owner_less < shared_ptr < _Tp > , weak_ptr < _Tp >>
  52117. { } ;
  52118.  
  52119.  
  52120. template < typename _Tp >
  52121. struct owner_less < weak_ptr < _Tp >>
  52122. : public _Sp_owner_less < weak_ptr < _Tp > , shared_ptr < _Tp >>
  52123. { } ;
  52124.  
  52125.  
  52126.  
  52127.  
  52128. template < typename _Tp >
  52129. class enable_shared_from_this
  52130. {
  52131. protected :
  52132. constexpr enable_shared_from_this ( ) noexcept { }
  52133.  
  52134. enable_shared_from_this ( const enable_shared_from_this & ) noexcept { }
  52135.  
  52136. enable_shared_from_this &
  52137. operator = ( const enable_shared_from_this & ) noexcept
  52138. { return * this ; }
  52139.  
  52140. ~ enable_shared_from_this ( ) { }
  52141.  
  52142. public :
  52143. shared_ptr < _Tp >
  52144. shared_from_this ( )
  52145. { return shared_ptr < _Tp > ( this -> _M_weak_this ) ; }
  52146.  
  52147. shared_ptr < const _Tp >
  52148. shared_from_this ( ) const
  52149. { return shared_ptr < const _Tp > ( this -> _M_weak_this ) ; }
  52150.  
  52151. private :
  52152. template < typename _Tp1 >
  52153. void
  52154. _M_weak_assign ( _Tp1 * __p , const __shared_count < > & __n ) const noexcept
  52155. { _M_weak_this . _M_assign ( __p , __n ) ; }
  52156.  
  52157. template < typename _Tp1 >
  52158. friend void
  52159. __enable_shared_from_this_helper ( const __shared_count < > & __pn ,
  52160. const enable_shared_from_this * __pe ,
  52161. const _Tp1 * __px ) noexcept
  52162. {
  52163. if ( __pe != 0 )
  52164. __pe -> _M_weak_assign ( const_cast < _Tp1 * > ( __px ) , __pn ) ;
  52165. }
  52166.  
  52167. mutable weak_ptr < _Tp > _M_weak_this ;
  52168. } ;
  52169. #593
  52170. template < typename _Tp , typename _Alloc , typename ... _Args >
  52171. inline shared_ptr < _Tp >
  52172. allocate_shared ( const _Alloc & __a , _Args && ... __args )
  52173. {
  52174. return shared_ptr < _Tp > ( _Sp_make_shared_tag ( ) , __a ,
  52175. std :: forward < _Args > ( __args ) ... ) ;
  52176. }
  52177. #608
  52178. template < typename _Tp , typename ... _Args >
  52179. inline shared_ptr < _Tp >
  52180. make_shared ( _Args && ... __args )
  52181. {
  52182. typedef typename std :: remove_const < _Tp > :: type _Tp_nc ;
  52183. return std :: allocate_shared < _Tp > ( std :: allocator < _Tp_nc > ( ) ,
  52184. std :: forward < _Args > ( __args ) ... ) ;
  52185. }
  52186.  
  52187.  
  52188. template < typename _Tp >
  52189. struct hash < shared_ptr < _Tp >>
  52190. : public __hash_base < size_t , shared_ptr < _Tp >>
  52191. {
  52192. size_t
  52193. operator ( ) ( const shared_ptr < _Tp > & __s ) const noexcept
  52194. { return std :: hash < _Tp * > ( ) ( __s . get ( ) ) ; }
  52195. } ;
  52196.  
  52197.  
  52198.  
  52199.  
  52200. }
  52201. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/backward/auto_ptr.h"
  52202. #36
  52203. namespace std
  52204. {
  52205. #47
  52206. template < typename _Tp1 >
  52207. struct auto_ptr_ref
  52208. {
  52209. _Tp1 * _M_ptr ;
  52210.  
  52211. explicit
  52212. auto_ptr_ref ( _Tp1 * __p ) : _M_ptr ( __p ) { }
  52213. } __attribute__ ( ( __deprecated__ ) ) ;
  52214. #86
  52215. template < typename _Tp >
  52216. class auto_ptr
  52217. {
  52218. private :
  52219. _Tp * _M_ptr ;
  52220.  
  52221. public :
  52222.  
  52223. typedef _Tp element_type ;
  52224. #102
  52225. explicit
  52226. auto_ptr ( element_type * __p = 0 ) throw ( ) : _M_ptr ( __p ) { }
  52227. #112
  52228. auto_ptr ( auto_ptr & __a ) throw ( ) : _M_ptr ( __a . release ( ) ) { }
  52229. #124
  52230. template < typename _Tp1 >
  52231. auto_ptr ( auto_ptr < _Tp1 > & __a ) throw ( ) : _M_ptr ( __a . release ( ) ) { }
  52232. #135
  52233. auto_ptr &
  52234. operator = ( auto_ptr & __a ) throw ( )
  52235. {
  52236. reset ( __a . release ( ) ) ;
  52237. return * this ;
  52238. }
  52239. #152
  52240. template < typename _Tp1 >
  52241. auto_ptr &
  52242. operator = ( auto_ptr < _Tp1 > & __a ) throw ( )
  52243. {
  52244. reset ( __a . release ( ) ) ;
  52245. return * this ;
  52246. }
  52247. #170
  52248. ~ auto_ptr ( ) { delete _M_ptr ; }
  52249. #180
  52250. element_type &
  52251. operator * ( ) const throw ( )
  52252. {
  52253. ;
  52254. return * _M_ptr ;
  52255. }
  52256. #193
  52257. element_type *
  52258. operator -> ( ) const throw ( )
  52259. {
  52260. ;
  52261. return _M_ptr ;
  52262. }
  52263. #210
  52264. element_type *
  52265. get ( ) const throw ( ) { return _M_ptr ; }
  52266. #224
  52267. element_type *
  52268. release ( ) throw ( )
  52269. {
  52270. element_type * __tmp = _M_ptr ;
  52271. _M_ptr = 0 ;
  52272. return __tmp ;
  52273. }
  52274. #239
  52275. void
  52276. reset ( element_type * __p = 0 ) throw ( )
  52277. {
  52278. if ( __p != _M_ptr )
  52279. {
  52280. delete _M_ptr ;
  52281. _M_ptr = __p ;
  52282. }
  52283. }
  52284. #260
  52285. auto_ptr ( auto_ptr_ref < element_type > __ref ) throw ( )
  52286. : _M_ptr ( __ref . _M_ptr ) { }
  52287.  
  52288. auto_ptr &
  52289. operator = ( auto_ptr_ref < element_type > __ref ) throw ( )
  52290. {
  52291. if ( __ref . _M_ptr != this -> get ( ) )
  52292. {
  52293. delete _M_ptr ;
  52294. _M_ptr = __ref . _M_ptr ;
  52295. }
  52296. return * this ;
  52297. }
  52298.  
  52299. template < typename _Tp1 >
  52300. operator auto_ptr_ref < _Tp1 > ( ) throw ( )
  52301. { return auto_ptr_ref < _Tp1 > ( this -> release ( ) ) ; }
  52302.  
  52303. template < typename _Tp1 >
  52304. operator auto_ptr < _Tp1 > ( ) throw ( )
  52305. { return auto_ptr < _Tp1 > ( this -> release ( ) ) ; }
  52306. } __attribute__ ( ( __deprecated__ ) ) ;
  52307.  
  52308.  
  52309.  
  52310. template < >
  52311. class auto_ptr < void >
  52312. {
  52313. public :
  52314. typedef void element_type ;
  52315. } __attribute__ ( ( __deprecated__ ) ) ;
  52316.  
  52317.  
  52318. template < _Lock_policy _Lp >
  52319. template < typename _Tp >
  52320. inline
  52321. __shared_count < _Lp > :: __shared_count ( std :: auto_ptr < _Tp > && __r )
  52322. : _M_pi ( new _Sp_counted_ptr < _Tp * , _Lp > ( __r . get ( ) ) )
  52323. { __r . release ( ) ; }
  52324.  
  52325. template < typename _Tp , _Lock_policy _Lp >
  52326. template < typename _Tp1 >
  52327. inline
  52328. __shared_ptr < _Tp , _Lp > :: __shared_ptr ( std :: auto_ptr < _Tp1 > && __r )
  52329. : _M_ptr ( __r . get ( ) ) , _M_refcount ( )
  52330. {
  52331.  
  52332. static_assert ( sizeof ( _Tp1 ) > 0 , "incomplete type" ) ;
  52333. _Tp1 * __tmp = __r . get ( ) ;
  52334. _M_refcount = __shared_count < _Lp > ( std :: move ( __r ) ) ;
  52335. __enable_shared_from_this_helper ( _M_refcount , __tmp , __tmp ) ;
  52336. }
  52337.  
  52338. template < typename _Tp >
  52339. template < typename _Tp1 >
  52340. inline
  52341. shared_ptr < _Tp > :: shared_ptr ( std :: auto_ptr < _Tp1 > && __r )
  52342. : __shared_ptr < _Tp > ( std :: move ( __r ) ) { }
  52343.  
  52344. template < typename _Tp , typename _Dp >
  52345. template < typename _Up , typename >
  52346. inline
  52347. unique_ptr < _Tp , _Dp > :: unique_ptr ( auto_ptr < _Up > && __u ) noexcept
  52348. : _M_t ( __u . release ( ) , deleter_type ( ) ) { }
  52349.  
  52350.  
  52351.  
  52352. }
  52353. #24 "./boost/smart_ptr/scoped_ptr.hpp"
  52354. namespace boost
  52355. {
  52356. #41
  52357. template < class T > class scoped_ptr
  52358. {
  52359. private :
  52360.  
  52361. T * px ;
  52362.  
  52363. scoped_ptr ( scoped_ptr const & ) ;
  52364. scoped_ptr & operator = ( scoped_ptr const & ) ;
  52365.  
  52366. typedef scoped_ptr < T > this_type ;
  52367.  
  52368. void operator == ( scoped_ptr const & ) const ;
  52369. void operator != ( scoped_ptr const & ) const ;
  52370.  
  52371. public :
  52372.  
  52373. typedef T element_type ;
  52374.  
  52375. explicit scoped_ptr ( T * p = 0 ) : px ( p )
  52376. {
  52377.  
  52378.  
  52379.  
  52380. }
  52381.  
  52382.  
  52383.  
  52384. explicit scoped_ptr ( std :: auto_ptr < T > p ) : px ( p . release ( ) )
  52385. {
  52386.  
  52387.  
  52388.  
  52389. }
  52390.  
  52391.  
  52392.  
  52393. ~ scoped_ptr ( )
  52394. {
  52395.  
  52396.  
  52397.  
  52398. boost :: checked_delete ( px ) ;
  52399. }
  52400.  
  52401. void reset ( T * p = 0 )
  52402. {
  52403. ( ( void ) 0 ) ;
  52404. this_type ( p ) . swap ( * this ) ;
  52405. }
  52406.  
  52407. T & operator * ( ) const
  52408. {
  52409. ( ( void ) 0 ) ;
  52410. return * px ;
  52411. }
  52412.  
  52413. T * operator -> ( ) const
  52414. {
  52415. ( ( void ) 0 ) ;
  52416. return px ;
  52417. }
  52418.  
  52419. T * get ( ) const
  52420. {
  52421. return px ;
  52422. }
  52423. #1 "./boost/smart_ptr/detail/operator_bool.hpp"
  52424. #50
  52425. typedef element_type * this_type :: * unspecified_bool_type ;
  52426.  
  52427. operator unspecified_bool_type ( ) const
  52428. {
  52429. return px == 0 ? 0 : & this_type :: px ;
  52430. }
  52431.  
  52432.  
  52433.  
  52434.  
  52435. bool operator ! ( ) const
  52436. {
  52437. return px == 0 ;
  52438. }
  52439. #111 "./boost/smart_ptr/scoped_ptr.hpp"
  52440. void swap ( scoped_ptr & b )
  52441. {
  52442. T * tmp = b . px ;
  52443. b . px = px ;
  52444. px = tmp ;
  52445. }
  52446. } ;
  52447. #143
  52448. template < class T > inline void swap ( scoped_ptr < T > & a , scoped_ptr < T > & b )
  52449. {
  52450. a . swap ( b ) ;
  52451. }
  52452.  
  52453.  
  52454.  
  52455. template < class T > inline T * get_pointer ( scoped_ptr < T > const & p )
  52456. {
  52457. return p . get ( ) ;
  52458. }
  52459.  
  52460. }
  52461. #1 "./boost/scoped_array.hpp"
  52462. #1 "./boost/smart_ptr/scoped_array.hpp"
  52463. #1 "./boost/assert.hpp"
  52464. #1 "/usr/include/assert.h"
  52465. #23 "./boost/smart_ptr/scoped_array.hpp"
  52466. namespace boost
  52467. {
  52468. #39
  52469. template < class T > class scoped_array
  52470. {
  52471. private :
  52472.  
  52473. T * px ;
  52474.  
  52475. scoped_array ( scoped_array const & ) ;
  52476. scoped_array & operator = ( scoped_array const & ) ;
  52477.  
  52478. typedef scoped_array < T > this_type ;
  52479.  
  52480. void operator == ( scoped_array const & ) const ;
  52481. void operator != ( scoped_array const & ) const ;
  52482.  
  52483. public :
  52484.  
  52485. typedef T element_type ;
  52486.  
  52487. explicit scoped_array ( T * p = 0 ) : px ( p )
  52488. {
  52489.  
  52490.  
  52491.  
  52492. }
  52493.  
  52494. ~ scoped_array ( )
  52495. {
  52496.  
  52497.  
  52498.  
  52499. boost :: checked_array_delete ( px ) ;
  52500. }
  52501.  
  52502. void reset ( T * p = 0 )
  52503. {
  52504. ( ( void ) 0 ) ;
  52505. this_type ( p ) . swap ( * this ) ;
  52506. }
  52507.  
  52508. T & operator [ ] ( std :: ptrdiff_t i ) const
  52509. {
  52510. ( ( void ) 0 ) ;
  52511. ( ( void ) 0 ) ;
  52512. return px [ i ] ;
  52513. }
  52514.  
  52515. T * get ( ) const
  52516. {
  52517. return px ;
  52518. }
  52519. #1 "./boost/smart_ptr/detail/operator_bool.hpp"
  52520. #50
  52521. typedef element_type * this_type :: * unspecified_bool_type ;
  52522.  
  52523. operator unspecified_bool_type ( ) const
  52524. {
  52525. return px == 0 ? 0 : & this_type :: px ;
  52526. }
  52527.  
  52528.  
  52529.  
  52530.  
  52531. bool operator ! ( ) const
  52532. {
  52533. return px == 0 ;
  52534. }
  52535. #93 "./boost/smart_ptr/scoped_array.hpp"
  52536. void swap ( scoped_array & b )
  52537. {
  52538. T * tmp = b . px ;
  52539. b . px = px ;
  52540. px = tmp ;
  52541. }
  52542. } ;
  52543. #125
  52544. template < class T > inline void swap ( scoped_array < T > & a , scoped_array < T > & b )
  52545. {
  52546. a . swap ( b ) ;
  52547. }
  52548.  
  52549. }
  52550. #1 "./boost/shared_ptr.hpp"
  52551. #1 "./boost/smart_ptr/shared_ptr.hpp"
  52552. #1 "./boost/config/no_tr1/memory.hpp"
  52553. #1 "./boost/assert.hpp"
  52554. #1 "/usr/include/assert.h"
  52555. #1 "./boost/smart_ptr/detail/shared_count.hpp"
  52556. #1 "./boost/smart_ptr/bad_weak_ptr.hpp"
  52557. #26
  52558. namespace boost
  52559. {
  52560. #39
  52561. class bad_weak_ptr : public std :: exception
  52562. {
  52563. public :
  52564.  
  52565. virtual char const * what ( ) const throw ( )
  52566. {
  52567. return "tr1::bad_weak_ptr" ;
  52568. }
  52569. } ;
  52570.  
  52571.  
  52572.  
  52573.  
  52574.  
  52575. }
  52576. #1 "./boost/smart_ptr/detail/sp_counted_base.hpp"
  52577. #1 "./boost/smart_ptr/detail/sp_has_sync.hpp"
  52578. #1 "./boost/smart_ptr/detail/sp_counted_base_spin.hpp"
  52579. #1 "./boost/detail/sp_typeinfo.hpp"
  52580. #111
  52581. namespace boost
  52582. {
  52583.  
  52584. namespace detail
  52585. {
  52586. #123
  52587. typedef std :: type_info sp_typeinfo ;
  52588.  
  52589.  
  52590.  
  52591. }
  52592.  
  52593. }
  52594. #1 "./boost/smart_ptr/detail/spinlock_pool.hpp"
  52595. #1 "./boost/smart_ptr/detail/spinlock.hpp"
  52596. #1 "./boost/smart_ptr/detail/spinlock_pt.hpp"
  52597. #20
  52598. namespace boost
  52599. {
  52600.  
  52601. namespace detail
  52602. {
  52603.  
  52604. class spinlock
  52605. {
  52606. public :
  52607.  
  52608. pthread_mutex_t v_ ;
  52609.  
  52610. public :
  52611.  
  52612. bool try_lock ( )
  52613. {
  52614. return pthread_mutex_trylock ( & v_ ) == 0 ;
  52615. }
  52616.  
  52617. void lock ( )
  52618. {
  52619. pthread_mutex_lock ( & v_ ) ;
  52620. }
  52621.  
  52622. void unlock ( )
  52623. {
  52624. pthread_mutex_unlock ( & v_ ) ;
  52625. }
  52626.  
  52627. public :
  52628.  
  52629. class scoped_lock
  52630. {
  52631. private :
  52632.  
  52633. spinlock & sp_ ;
  52634.  
  52635. scoped_lock ( scoped_lock const & ) ;
  52636. scoped_lock & operator = ( scoped_lock const & ) ;
  52637.  
  52638. public :
  52639.  
  52640. explicit scoped_lock ( spinlock & sp ) : sp_ ( sp )
  52641. {
  52642. sp . lock ( ) ;
  52643. }
  52644.  
  52645. ~ scoped_lock ( )
  52646. {
  52647. sp_ . unlock ( ) ;
  52648. }
  52649. } ;
  52650. } ;
  52651.  
  52652. }
  52653. }
  52654. #28 "./boost/smart_ptr/detail/spinlock_pool.hpp"
  52655. namespace boost
  52656. {
  52657.  
  52658. namespace detail
  52659. {
  52660.  
  52661. template < int I > class spinlock_pool
  52662. {
  52663. private :
  52664.  
  52665. static spinlock pool_ [ 41 ] ;
  52666.  
  52667. public :
  52668.  
  52669. static spinlock & spinlock_for ( void const * pv )
  52670. {
  52671.  
  52672.  
  52673.  
  52674. std :: size_t i = reinterpret_cast < std :: size_t > ( pv ) % 41 ;
  52675.  
  52676. return pool_ [ i ] ;
  52677. }
  52678.  
  52679. class scoped_lock
  52680. {
  52681. private :
  52682.  
  52683. spinlock & sp_ ;
  52684.  
  52685. scoped_lock ( scoped_lock const & ) ;
  52686. scoped_lock & operator = ( scoped_lock const & ) ;
  52687.  
  52688. public :
  52689.  
  52690. explicit scoped_lock ( void const * pv ) : sp_ ( spinlock_for ( pv ) )
  52691. {
  52692. sp_ . lock ( ) ;
  52693. }
  52694.  
  52695. ~ scoped_lock ( )
  52696. {
  52697. sp_ . unlock ( ) ;
  52698. }
  52699. } ;
  52700. } ;
  52701.  
  52702. template < int I > spinlock spinlock_pool < I > :: pool_ [ 41 ] =
  52703. {
  52704. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52705. #77
  52706. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52707. #77
  52708. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52709. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52710. #78
  52711. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52712. #78
  52713. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52714. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52715. #79
  52716. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52717. #79
  52718. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52719. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52720. #80
  52721. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52722. #80
  52723. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52724. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52725. #81
  52726. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52727. #81
  52728. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52729. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52730. #82
  52731. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52732. #82
  52733. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52734. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52735. #83
  52736. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52737. #83
  52738. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52739. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0
  52740. #84
  52741. , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } } , { { { 0 , 0 , 0
  52742. #84
  52743. , 0 , 0x4d58 } , { { { 0 } } } , 0 } } ,
  52744. { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } }
  52745. } ;
  52746.  
  52747. }
  52748. }
  52749. #24 "./boost/smart_ptr/detail/sp_counted_base_spin.hpp"
  52750. namespace boost
  52751. {
  52752.  
  52753. namespace detail
  52754. {
  52755.  
  52756. inline int atomic_exchange_and_add ( int * pw , int dv )
  52757. {
  52758. spinlock_pool < 1 > :: scoped_lock lock ( pw ) ;
  52759.  
  52760. int r = * pw ;
  52761. * pw += dv ;
  52762. return r ;
  52763. }
  52764.  
  52765. inline void atomic_increment ( int * pw )
  52766. {
  52767. spinlock_pool < 1 > :: scoped_lock lock ( pw ) ;
  52768. ++ * pw ;
  52769. }
  52770.  
  52771. inline int atomic_conditional_increment ( int * pw )
  52772. {
  52773. spinlock_pool < 1 > :: scoped_lock lock ( pw ) ;
  52774.  
  52775. int rv = * pw ;
  52776. if ( rv != 0 ) ++ * pw ;
  52777. return rv ;
  52778. }
  52779.  
  52780. class sp_counted_base
  52781. {
  52782. private :
  52783.  
  52784. sp_counted_base ( sp_counted_base const & ) ;
  52785. sp_counted_base & operator = ( sp_counted_base const & ) ;
  52786.  
  52787. int use_count_ ;
  52788. int weak_count_ ;
  52789.  
  52790. public :
  52791.  
  52792. sp_counted_base ( ) : use_count_ ( 1 ) , weak_count_ ( 1 )
  52793. {
  52794. }
  52795.  
  52796. virtual ~ sp_counted_base ( )
  52797. {
  52798. }
  52799.  
  52800.  
  52801.  
  52802.  
  52803. virtual void dispose ( ) = 0 ;
  52804.  
  52805.  
  52806.  
  52807. virtual void destroy ( )
  52808. {
  52809. delete this ;
  52810. }
  52811.  
  52812. virtual void * get_deleter ( sp_typeinfo const & ti ) = 0 ;
  52813. virtual void * get_untyped_deleter ( ) = 0 ;
  52814.  
  52815. void add_ref_copy ( )
  52816. {
  52817. atomic_increment ( & use_count_ ) ;
  52818. }
  52819.  
  52820. bool add_ref_lock ( )
  52821. {
  52822. return atomic_conditional_increment ( & use_count_ ) != 0 ;
  52823. }
  52824.  
  52825. void release ( )
  52826. {
  52827. if ( atomic_exchange_and_add ( & use_count_ , - 1 ) == 1 )
  52828. {
  52829. dispose ( ) ;
  52830. weak_release ( ) ;
  52831. }
  52832. }
  52833.  
  52834. void weak_add_ref ( )
  52835. {
  52836. atomic_increment ( & weak_count_ ) ;
  52837. }
  52838.  
  52839. void weak_release ( )
  52840. {
  52841. if ( atomic_exchange_and_add ( & weak_count_ , - 1 ) == 1 )
  52842. {
  52843. destroy ( ) ;
  52844. }
  52845. }
  52846.  
  52847. long use_count ( ) const
  52848. {
  52849. spinlock_pool < 1 > :: scoped_lock lock ( & use_count_ ) ;
  52850. return use_count_ ;
  52851. }
  52852. } ;
  52853.  
  52854. }
  52855.  
  52856. }
  52857. #1 "./boost/smart_ptr/detail/sp_counted_impl.hpp"
  52858. #40
  52859. namespace boost
  52860. {
  52861. #50
  52862. namespace detail
  52863. {
  52864.  
  52865. template < class X > class sp_counted_impl_p : public sp_counted_base
  52866. {
  52867. private :
  52868.  
  52869. X * px_ ;
  52870.  
  52871. sp_counted_impl_p ( sp_counted_impl_p const & ) ;
  52872. sp_counted_impl_p & operator = ( sp_counted_impl_p const & ) ;
  52873.  
  52874. typedef sp_counted_impl_p < X > this_type ;
  52875.  
  52876. public :
  52877.  
  52878. explicit sp_counted_impl_p ( X * px ) : px_ ( px )
  52879. {
  52880.  
  52881.  
  52882.  
  52883. }
  52884.  
  52885. virtual void dispose ( )
  52886. {
  52887.  
  52888.  
  52889.  
  52890. boost :: checked_delete ( px_ ) ;
  52891. }
  52892.  
  52893. virtual void * get_deleter ( detail :: sp_typeinfo const & )
  52894. {
  52895. return 0 ;
  52896. }
  52897.  
  52898. virtual void * get_untyped_deleter ( )
  52899. {
  52900. return 0 ;
  52901. }
  52902. #118
  52903. } ;
  52904. #127
  52905. template < class P , class D > class sp_counted_impl_pd : public sp_counted_base
  52906. {
  52907. private :
  52908.  
  52909. P ptr ;
  52910. D del ;
  52911.  
  52912. sp_counted_impl_pd ( sp_counted_impl_pd const & ) ;
  52913. sp_counted_impl_pd & operator = ( sp_counted_impl_pd const & ) ;
  52914.  
  52915. typedef sp_counted_impl_pd < P , D > this_type ;
  52916.  
  52917. public :
  52918.  
  52919.  
  52920.  
  52921. sp_counted_impl_pd ( P p , D & d ) : ptr ( p ) , del ( d )
  52922. {
  52923. }
  52924.  
  52925. sp_counted_impl_pd ( P p ) : ptr ( p ) , del ( )
  52926. {
  52927. }
  52928.  
  52929. virtual void dispose ( )
  52930. {
  52931. del ( ptr ) ;
  52932. }
  52933.  
  52934. virtual void * get_deleter ( detail :: sp_typeinfo const & ti )
  52935. {
  52936. return ti == typeid ( D ) ? & reinterpret_cast < char & > ( del ) : 0 ;
  52937. }
  52938.  
  52939. virtual void * get_untyped_deleter ( )
  52940. {
  52941. return & reinterpret_cast < char & > ( del ) ;
  52942. }
  52943. #193
  52944. } ;
  52945.  
  52946. template < class P , class D , class A > class sp_counted_impl_pda : public sp_counted_base
  52947. {
  52948. private :
  52949.  
  52950. P p_ ;
  52951. D d_ ;
  52952. A a_ ;
  52953.  
  52954. sp_counted_impl_pda ( sp_counted_impl_pda const & ) ;
  52955. sp_counted_impl_pda & operator = ( sp_counted_impl_pda const & ) ;
  52956.  
  52957. typedef sp_counted_impl_pda < P , D , A > this_type ;
  52958.  
  52959. public :
  52960.  
  52961.  
  52962.  
  52963. sp_counted_impl_pda ( P p , D & d , A a ) : p_ ( p ) , d_ ( d ) , a_ ( a )
  52964. {
  52965. }
  52966.  
  52967. sp_counted_impl_pda ( P p , A a ) : p_ ( p ) , d_ ( ) , a_ ( a )
  52968. {
  52969. }
  52970.  
  52971. virtual void dispose ( )
  52972. {
  52973. d_ ( p_ ) ;
  52974. }
  52975.  
  52976. virtual void destroy ( )
  52977. {
  52978. typedef typename A :: template rebind < this_type > :: other A2 ;
  52979.  
  52980. A2 a2 ( a_ ) ;
  52981.  
  52982. this -> ~ this_type ( ) ;
  52983. a2 . deallocate ( this , 1 ) ;
  52984. }
  52985.  
  52986. virtual void * get_deleter ( detail :: sp_typeinfo const & ti )
  52987. {
  52988. return ti == typeid ( D ) ? & reinterpret_cast < char & > ( d_ ) : 0 ;
  52989. }
  52990.  
  52991. virtual void * get_untyped_deleter ( )
  52992. {
  52993. return & reinterpret_cast < char & > ( d_ ) ;
  52994. }
  52995. } ;
  52996.  
  52997.  
  52998.  
  52999.  
  53000.  
  53001. }
  53002.  
  53003. }
  53004. #47 "./boost/smart_ptr/detail/shared_count.hpp"
  53005. namespace boost
  53006. {
  53007.  
  53008. namespace detail
  53009. {
  53010. #60
  53011. struct sp_nothrow_tag { } ;
  53012.  
  53013. template < class D > struct sp_inplace_tag
  53014. {
  53015. } ;
  53016. #98
  53017. class weak_count ;
  53018.  
  53019. class shared_count
  53020. {
  53021. private :
  53022.  
  53023. sp_counted_base * pi_ ;
  53024.  
  53025.  
  53026.  
  53027.  
  53028.  
  53029. friend class weak_count ;
  53030.  
  53031. public :
  53032.  
  53033. shared_count ( ) : pi_ ( 0 )
  53034.  
  53035.  
  53036.  
  53037. {
  53038. }
  53039.  
  53040. template < class Y > explicit shared_count ( Y * p ) : pi_ ( 0 )
  53041.  
  53042.  
  53043.  
  53044. {
  53045.  
  53046.  
  53047. try
  53048. {
  53049. pi_ = new sp_counted_impl_p < Y > ( p ) ;
  53050. }
  53051. catch ( ... )
  53052. {
  53053. boost :: checked_delete ( p ) ;
  53054. throw ;
  53055. }
  53056. #149
  53057. }
  53058.  
  53059.  
  53060.  
  53061.  
  53062. template < class P , class D > shared_count ( P p , D d ) : pi_ ( 0 )
  53063.  
  53064.  
  53065.  
  53066.  
  53067. {
  53068.  
  53069.  
  53070.  
  53071.  
  53072.  
  53073. try
  53074. {
  53075. pi_ = new sp_counted_impl_pd < P , D > ( p , d ) ;
  53076. }
  53077. catch ( ... )
  53078. {
  53079. d ( p ) ;
  53080. throw ;
  53081. }
  53082. #186
  53083. }
  53084.  
  53085.  
  53086.  
  53087. template < class P , class D > shared_count ( P p , sp_inplace_tag < D > ) : pi_ ( 0 )
  53088.  
  53089.  
  53090.  
  53091. {
  53092.  
  53093.  
  53094. try
  53095. {
  53096. pi_ = new sp_counted_impl_pd < P , D > ( p ) ;
  53097. }
  53098. catch ( ... )
  53099. {
  53100. D :: operator_fn ( p ) ;
  53101. throw ;
  53102. }
  53103. #218
  53104. }
  53105.  
  53106.  
  53107.  
  53108. template < class P , class D , class A > shared_count ( P p , D d , A a ) : pi_ ( 0 )
  53109.  
  53110.  
  53111.  
  53112. {
  53113. typedef sp_counted_impl_pda < P , D , A > impl_type ;
  53114. typedef typename A :: template rebind < impl_type > :: other A2 ;
  53115.  
  53116. A2 a2 ( a ) ;
  53117.  
  53118.  
  53119.  
  53120. try
  53121. {
  53122. pi_ = a2 . allocate ( 1 , static_cast < impl_type * > ( 0 ) ) ;
  53123. new ( static_cast < void * > ( pi_ ) ) impl_type ( p , d , a ) ;
  53124. }
  53125. catch ( ... )
  53126. {
  53127. d ( p ) ;
  53128.  
  53129. if ( pi_ != 0 )
  53130. {
  53131. a2 . deallocate ( static_cast < impl_type * > ( pi_ ) , 1 ) ;
  53132. }
  53133.  
  53134. throw ;
  53135. }
  53136. #266
  53137. }
  53138.  
  53139.  
  53140.  
  53141. template < class P , class D , class A > shared_count ( P p , sp_inplace_tag < D > , A a ) : pi_ ( 0 )
  53142.  
  53143.  
  53144.  
  53145. {
  53146. typedef sp_counted_impl_pda < P , D , A > impl_type ;
  53147. typedef typename A :: template rebind < impl_type > :: other A2 ;
  53148.  
  53149. A2 a2 ( a ) ;
  53150.  
  53151.  
  53152.  
  53153. try
  53154. {
  53155. pi_ = a2 . allocate ( 1 , static_cast < impl_type * > ( 0 ) ) ;
  53156. new ( static_cast < void * > ( pi_ ) ) impl_type ( p , a ) ;
  53157. }
  53158. catch ( ... )
  53159. {
  53160. D :: operator_fn ( p ) ;
  53161.  
  53162. if ( pi_ != 0 )
  53163. {
  53164. a2 . deallocate ( static_cast < impl_type * > ( pi_ ) , 1 ) ;
  53165. }
  53166.  
  53167. throw ;
  53168. }
  53169. #314
  53170. }
  53171. #322
  53172. template < class Y >
  53173. explicit shared_count ( std :: auto_ptr < Y > & r ) : pi_ ( new sp_counted_impl_p < Y > ( r . get ( ) ) )
  53174.  
  53175.  
  53176.  
  53177. {
  53178. #337
  53179. r . release ( ) ;
  53180. }
  53181. #369
  53182. ~ shared_count ( )
  53183. {
  53184. if ( pi_ != 0 ) pi_ -> release ( ) ;
  53185.  
  53186.  
  53187.  
  53188. }
  53189.  
  53190. shared_count ( shared_count const & r ) : pi_ ( r . pi_ )
  53191.  
  53192.  
  53193.  
  53194. {
  53195. if ( pi_ != 0 ) pi_ -> add_ref_copy ( ) ;
  53196. }
  53197. #397
  53198. explicit shared_count ( weak_count const & r ) ;
  53199. shared_count ( weak_count const & r , sp_nothrow_tag ) ;
  53200.  
  53201. shared_count & operator = ( shared_count const & r )
  53202. {
  53203. sp_counted_base * tmp = r . pi_ ;
  53204.  
  53205. if ( tmp != pi_ )
  53206. {
  53207. if ( tmp != 0 ) tmp -> add_ref_copy ( ) ;
  53208. if ( pi_ != 0 ) pi_ -> release ( ) ;
  53209. pi_ = tmp ;
  53210. }
  53211.  
  53212. return * this ;
  53213. }
  53214.  
  53215. void swap ( shared_count & r )
  53216. {
  53217. sp_counted_base * tmp = r . pi_ ;
  53218. r . pi_ = pi_ ;
  53219. pi_ = tmp ;
  53220. }
  53221.  
  53222. long use_count ( ) const
  53223. {
  53224. return pi_ != 0 ? pi_ -> use_count ( ) : 0 ;
  53225. }
  53226.  
  53227. bool unique ( ) const
  53228. {
  53229. return use_count ( ) == 1 ;
  53230. }
  53231.  
  53232. bool empty ( ) const
  53233. {
  53234. return pi_ == 0 ;
  53235. }
  53236.  
  53237. friend inline bool operator == ( shared_count const & a , shared_count const & b )
  53238. {
  53239. return a . pi_ == b . pi_ ;
  53240. }
  53241.  
  53242. friend inline bool operator < ( shared_count const & a , shared_count const & b )
  53243. {
  53244. return std :: less < sp_counted_base * > ( ) ( a . pi_ , b . pi_ ) ;
  53245. }
  53246.  
  53247. void * get_deleter ( sp_typeinfo const & ti ) const
  53248. {
  53249. return pi_ ? pi_ -> get_deleter ( ti ) : 0 ;
  53250. }
  53251.  
  53252. void * get_untyped_deleter ( ) const
  53253. {
  53254. return pi_ ? pi_ -> get_untyped_deleter ( ) : 0 ;
  53255. }
  53256. } ;
  53257.  
  53258.  
  53259. class weak_count
  53260. {
  53261. private :
  53262.  
  53263. sp_counted_base * pi_ ;
  53264.  
  53265.  
  53266.  
  53267.  
  53268.  
  53269. friend class shared_count ;
  53270.  
  53271. public :
  53272.  
  53273. weak_count ( ) : pi_ ( 0 )
  53274.  
  53275.  
  53276.  
  53277. {
  53278. }
  53279.  
  53280. weak_count ( shared_count const & r ) : pi_ ( r . pi_ )
  53281.  
  53282.  
  53283.  
  53284. {
  53285. if ( pi_ != 0 ) pi_ -> weak_add_ref ( ) ;
  53286. }
  53287.  
  53288. weak_count ( weak_count const & r ) : pi_ ( r . pi_ )
  53289.  
  53290.  
  53291.  
  53292. {
  53293. if ( pi_ != 0 ) pi_ -> weak_add_ref ( ) ;
  53294. }
  53295. #509
  53296. ~ weak_count ( )
  53297. {
  53298. if ( pi_ != 0 ) pi_ -> weak_release ( ) ;
  53299.  
  53300.  
  53301.  
  53302. }
  53303.  
  53304. weak_count & operator = ( shared_count const & r )
  53305. {
  53306. sp_counted_base * tmp = r . pi_ ;
  53307.  
  53308. if ( tmp != pi_ )
  53309. {
  53310. if ( tmp != 0 ) tmp -> weak_add_ref ( ) ;
  53311. if ( pi_ != 0 ) pi_ -> weak_release ( ) ;
  53312. pi_ = tmp ;
  53313. }
  53314.  
  53315. return * this ;
  53316. }
  53317.  
  53318. weak_count & operator = ( weak_count const & r )
  53319. {
  53320. sp_counted_base * tmp = r . pi_ ;
  53321.  
  53322. if ( tmp != pi_ )
  53323. {
  53324. if ( tmp != 0 ) tmp -> weak_add_ref ( ) ;
  53325. if ( pi_ != 0 ) pi_ -> weak_release ( ) ;
  53326. pi_ = tmp ;
  53327. }
  53328.  
  53329. return * this ;
  53330. }
  53331.  
  53332. void swap ( weak_count & r )
  53333. {
  53334. sp_counted_base * tmp = r . pi_ ;
  53335. r . pi_ = pi_ ;
  53336. pi_ = tmp ;
  53337. }
  53338.  
  53339. long use_count ( ) const
  53340. {
  53341. return pi_ != 0 ? pi_ -> use_count ( ) : 0 ;
  53342. }
  53343.  
  53344. bool empty ( ) const
  53345. {
  53346. return pi_ == 0 ;
  53347. }
  53348.  
  53349. friend inline bool operator == ( weak_count const & a , weak_count const & b )
  53350. {
  53351. return a . pi_ == b . pi_ ;
  53352. }
  53353.  
  53354. friend inline bool operator < ( weak_count const & a , weak_count const & b )
  53355. {
  53356. return std :: less < sp_counted_base * > ( ) ( a . pi_ , b . pi_ ) ;
  53357. }
  53358. } ;
  53359.  
  53360. inline shared_count :: shared_count ( weak_count const & r ) : pi_ ( r . pi_ )
  53361.  
  53362.  
  53363.  
  53364. {
  53365. if ( pi_ == 0 || ! pi_ -> add_ref_lock ( ) )
  53366. {
  53367. boost :: throw_exception ( boost :: bad_weak_ptr ( ) ) ;
  53368. }
  53369. }
  53370.  
  53371. inline shared_count :: shared_count ( weak_count const & r , sp_nothrow_tag ) : pi_ ( r . pi_ )
  53372.  
  53373.  
  53374.  
  53375. {
  53376. if ( pi_ != 0 && ! pi_ -> add_ref_lock ( ) )
  53377. {
  53378. pi_ = 0 ;
  53379. }
  53380. }
  53381.  
  53382. }
  53383.  
  53384. }
  53385. #1 "./boost/smart_ptr/detail/sp_convertible.hpp"
  53386. #34
  53387. namespace boost
  53388. {
  53389.  
  53390. namespace detail
  53391. {
  53392.  
  53393. template < class Y , class T > struct sp_convertible
  53394. {
  53395. typedef char ( & yes ) [ 1 ] ;
  53396. typedef char ( & no ) [ 2 ] ;
  53397.  
  53398. static yes f ( T * ) ;
  53399. static no f ( ... ) ;
  53400.  
  53401. enum _vt { value = sizeof ( ( f ) ( static_cast < Y * > ( 0 ) ) ) == sizeof ( yes ) } ;
  53402. } ;
  53403.  
  53404. template < class Y , class T > struct sp_convertible < Y , T [ ] >
  53405. {
  53406. enum _vt { value = false } ;
  53407. } ;
  53408.  
  53409. template < class Y , class T > struct sp_convertible < Y [ ] , T [ ] >
  53410. {
  53411. enum _vt { value = sp_convertible < Y [ 1 ] , T [ 1 ] > :: value } ;
  53412. } ;
  53413.  
  53414. template < class Y , std :: size_t N , class T > struct sp_convertible < Y [ N ] , T [ ] >
  53415. {
  53416. enum _vt { value = sp_convertible < Y [ 1 ] , T [ 1 ] > :: value } ;
  53417. } ;
  53418.  
  53419. struct sp_empty
  53420. {
  53421. } ;
  53422.  
  53423. template < bool > struct sp_enable_if_convertible_impl ;
  53424.  
  53425. template < > struct sp_enable_if_convertible_impl < true >
  53426. {
  53427. typedef sp_empty type ;
  53428. } ;
  53429.  
  53430. template < > struct sp_enable_if_convertible_impl < false >
  53431. {
  53432. } ;
  53433.  
  53434. template < class Y , class T > struct sp_enable_if_convertible : public sp_enable_if_convertible_impl < sp_convertible <
  53435. #81
  53436. Y , T > :: value >
  53437. {
  53438. } ;
  53439.  
  53440. }
  53441.  
  53442. }
  53443. #1 "./boost/memory_order.hpp"
  53444. #21
  53445. namespace boost
  53446. {
  53447. #41
  53448. enum memory_order
  53449. {
  53450. memory_order_relaxed = 0 ,
  53451. memory_order_acquire = 1 ,
  53452. memory_order_release = 2 ,
  53453. memory_order_acq_rel = 3 ,
  53454. memory_order_seq_cst = 7 ,
  53455. memory_order_consume = 8
  53456. } ;
  53457.  
  53458. }
  53459. #55 "./boost/smart_ptr/shared_ptr.hpp"
  53460. namespace boost
  53461. {
  53462.  
  53463. template < class T > class shared_ptr ;
  53464. template < class T > class weak_ptr ;
  53465. template < class T > class enable_shared_from_this ;
  53466. class enable_shared_from_raw ;
  53467.  
  53468. namespace detail
  53469. {
  53470.  
  53471.  
  53472.  
  53473. template < class T > struct sp_element
  53474. {
  53475. typedef T type ;
  53476. } ;
  53477.  
  53478.  
  53479.  
  53480. template < class T > struct sp_element < T [ ] >
  53481. {
  53482. typedef T type ;
  53483. } ;
  53484.  
  53485.  
  53486.  
  53487. template < class T , std :: size_t N > struct sp_element < T [ N ] >
  53488. {
  53489. typedef T type ;
  53490. } ;
  53491. #93
  53492. template < class T > struct sp_dereference
  53493. {
  53494. typedef T & type ;
  53495. } ;
  53496.  
  53497. template < > struct sp_dereference < void >
  53498. {
  53499. typedef void type ;
  53500. } ;
  53501.  
  53502.  
  53503.  
  53504. template < > struct sp_dereference < void const >
  53505. {
  53506. typedef void type ;
  53507. } ;
  53508.  
  53509. template < > struct sp_dereference < void volatile >
  53510. {
  53511. typedef void type ;
  53512. } ;
  53513.  
  53514. template < > struct sp_dereference < void const volatile >
  53515. {
  53516. typedef void type ;
  53517. } ;
  53518.  
  53519.  
  53520.  
  53521.  
  53522.  
  53523. template < class T > struct sp_dereference < T [ ] >
  53524. {
  53525. typedef void type ;
  53526. } ;
  53527.  
  53528.  
  53529.  
  53530. template < class T , std :: size_t N > struct sp_dereference < T [ N ] >
  53531. {
  53532. typedef void type ;
  53533. } ;
  53534. #142
  53535. template < class T > struct sp_member_access
  53536. {
  53537. typedef T * type ;
  53538. } ;
  53539.  
  53540.  
  53541.  
  53542. template < class T > struct sp_member_access < T [ ] >
  53543. {
  53544. typedef void type ;
  53545. } ;
  53546.  
  53547.  
  53548.  
  53549. template < class T , std :: size_t N > struct sp_member_access < T [ N ] >
  53550. {
  53551. typedef void type ;
  53552. } ;
  53553. #167
  53554. template < class T > struct sp_array_access
  53555. {
  53556. typedef void type ;
  53557. } ;
  53558.  
  53559.  
  53560.  
  53561. template < class T > struct sp_array_access < T [ ] >
  53562. {
  53563. typedef T & type ;
  53564. } ;
  53565.  
  53566.  
  53567.  
  53568. template < class T , std :: size_t N > struct sp_array_access < T [ N ] >
  53569. {
  53570. typedef T & type ;
  53571. } ;
  53572. #192
  53573. template < class T > struct sp_extent
  53574. {
  53575. enum _vt { value = 0 } ;
  53576. } ;
  53577.  
  53578.  
  53579.  
  53580. template < class T , std :: size_t N > struct sp_extent < T [ N ] >
  53581. {
  53582. enum _vt { value = N } ;
  53583. } ;
  53584.  
  53585.  
  53586.  
  53587.  
  53588.  
  53589. template < class X , class Y , class T > inline void sp_enable_shared_from_this ( boost :: shared_ptr < X > const * ppx ,
  53590. #208
  53591. Y const * py , boost :: enable_shared_from_this < T > const * pe )
  53592. {
  53593. if ( pe != 0 )
  53594. {
  53595. pe -> _internal_accept_owner ( ppx , const_cast < Y * > ( py ) ) ;
  53596. }
  53597. }
  53598.  
  53599. template < class X , class Y > inline void sp_enable_shared_from_this ( boost :: shared_ptr < X > * ppx , Y const * py ,
  53600. #216
  53601. boost :: enable_shared_from_raw const * pe ) ;
  53602. #233
  53603. inline void sp_enable_shared_from_this ( ... )
  53604. {
  53605. }
  53606. #243
  53607. template < class T , class R > struct sp_enable_if_auto_ptr
  53608. {
  53609. } ;
  53610.  
  53611. template < class T , class R > struct sp_enable_if_auto_ptr < std :: auto_ptr < T > , R >
  53612. {
  53613. typedef R type ;
  53614. } ;
  53615.  
  53616.  
  53617.  
  53618.  
  53619.  
  53620. template < class Y , class T > inline void sp_assert_convertible ( )
  53621. {
  53622.  
  53623.  
  53624.  
  53625. typedef char tmp [ sp_convertible < Y , T > :: value ? 1 : - 1 ] ;
  53626. ( void ) sizeof ( tmp ) ;
  53627. #270
  53628. }
  53629.  
  53630.  
  53631.  
  53632. template < class T , class Y > inline void sp_pointer_construct ( boost :: shared_ptr < T > * ppx , Y * p , boost :: detail
  53633. #274
  53634. :: shared_count & pn )
  53635. {
  53636. boost :: detail :: shared_count ( p ) . swap ( pn ) ;
  53637. boost :: detail :: sp_enable_shared_from_this ( ppx , p , p ) ;
  53638. }
  53639.  
  53640.  
  53641.  
  53642. template < class T , class Y > inline void sp_pointer_construct ( boost :: shared_ptr < T [ ] > * , Y * p , boost :: detail
  53643. #282
  53644. :: shared_count & pn )
  53645. {
  53646. sp_assert_convertible < Y [ ] , T [ ] > ( ) ;
  53647. boost :: detail :: shared_count ( p , boost :: checked_array_deleter < T > ( ) ) . swap ( pn ) ;
  53648. }
  53649.  
  53650. template < class T , std :: size_t N , class Y > inline void sp_pointer_construct ( boost :: shared_ptr < T [ N ] > * , Y
  53651. #288
  53652. * p , boost :: detail :: shared_count & pn )
  53653. {
  53654. sp_assert_convertible < Y [ N ] , T [ N ] > ( ) ;
  53655. boost :: detail :: shared_count ( p , boost :: checked_array_deleter < T > ( ) ) . swap ( pn ) ;
  53656. }
  53657.  
  53658.  
  53659.  
  53660.  
  53661.  
  53662. template < class T , class Y > inline void sp_deleter_construct ( boost :: shared_ptr < T > * ppx , Y * p )
  53663. {
  53664. boost :: detail :: sp_enable_shared_from_this ( ppx , p , p ) ;
  53665. }
  53666.  
  53667.  
  53668.  
  53669. template < class T , class Y > inline void sp_deleter_construct ( boost :: shared_ptr < T [ ] > * , Y * )
  53670. {
  53671. sp_assert_convertible < Y [ ] , T [ ] > ( ) ;
  53672. }
  53673.  
  53674. template < class T , std :: size_t N , class Y > inline void sp_deleter_construct ( boost :: shared_ptr < T [ N ] > * , Y
  53675. #310
  53676. * )
  53677. {
  53678. sp_assert_convertible < Y [ N ] , T [ N ] > ( ) ;
  53679. }
  53680.  
  53681.  
  53682.  
  53683. }
  53684. #328
  53685. template < class T > class shared_ptr
  53686. {
  53687. private :
  53688.  
  53689.  
  53690. typedef shared_ptr < T > this_type ;
  53691.  
  53692. public :
  53693.  
  53694. typedef typename boost :: detail :: sp_element < T > :: type element_type ;
  53695.  
  53696. shared_ptr ( ) : px ( 0 ) , pn ( )
  53697. {
  53698. }
  53699. #351
  53700. template < class Y >
  53701. explicit shared_ptr ( Y * p ) : px ( p ) , pn ( )
  53702. {
  53703. boost :: detail :: sp_pointer_construct ( this , p , pn ) ;
  53704. }
  53705. #363
  53706. template < class Y , class D > shared_ptr ( Y * p , D d ) : px ( p ) , pn ( p , d )
  53707. {
  53708. boost :: detail :: sp_deleter_construct ( this , p ) ;
  53709. }
  53710. #378
  53711. template < class Y , class D , class A > shared_ptr ( Y * p , D d , A a ) : px ( p ) , pn ( p , d , a )
  53712. {
  53713. boost :: detail :: sp_deleter_construct ( this , p ) ;
  53714. }
  53715. #403
  53716. template < class Y >
  53717. explicit shared_ptr ( weak_ptr < Y > const & r ) : pn ( r . pn )
  53718. {
  53719. boost :: detail :: sp_assert_convertible < Y , T > ( ) ;
  53720.  
  53721.  
  53722. px = r . px ;
  53723. }
  53724.  
  53725. template < class Y >
  53726. shared_ptr ( weak_ptr < Y > const & r , boost :: detail :: sp_nothrow_tag )
  53727. : px ( 0 ) , pn ( r . pn , boost :: detail :: sp_nothrow_tag ( ) )
  53728. {
  53729. if ( ! pn . empty ( ) )
  53730. {
  53731. px = r . px ;
  53732. }
  53733. }
  53734.  
  53735. template < class Y >
  53736.  
  53737.  
  53738. shared_ptr ( shared_ptr < Y > const & r , typename boost :: detail :: sp_enable_if_convertible < Y , T > :: type = boost
  53739. #425
  53740. :: detail :: sp_empty ( ) )
  53741. #432
  53742. : px ( r . px ) , pn ( r . pn )
  53743. {
  53744. boost :: detail :: sp_assert_convertible < Y , T > ( ) ;
  53745. }
  53746.  
  53747.  
  53748. template < class Y >
  53749. shared_ptr ( shared_ptr < Y > const & r , element_type * p ) : px ( p ) , pn ( r . pn )
  53750. {
  53751. }
  53752.  
  53753.  
  53754.  
  53755. template < class Y >
  53756. explicit shared_ptr ( std :: auto_ptr < Y > & r ) : px ( r . get ( ) ) , pn ( )
  53757. {
  53758. boost :: detail :: sp_assert_convertible < Y , T > ( ) ;
  53759.  
  53760. Y * tmp = r . get ( ) ;
  53761. pn = boost :: detail :: shared_count ( r ) ;
  53762.  
  53763. boost :: detail :: sp_deleter_construct ( this , tmp ) ;
  53764. }
  53765. #471
  53766. template < class Ap >
  53767. explicit shared_ptr ( Ap r , typename boost :: detail :: sp_enable_if_auto_ptr < Ap , int > :: type = 0 ) : px ( r . get
  53768. #472
  53769. ( ) ) , pn ( )
  53770. {
  53771. typedef typename Ap :: element_type Y ;
  53772.  
  53773. boost :: detail :: sp_assert_convertible < Y , T > ( ) ;
  53774.  
  53775. Y * tmp = r . get ( ) ;
  53776. pn = boost :: detail :: shared_count ( r ) ;
  53777.  
  53778. boost :: detail :: sp_deleter_construct ( this , tmp ) ;
  53779. }
  53780. #505
  53781. shared_ptr & operator = ( shared_ptr const & r )
  53782. {
  53783. this_type ( r ) . swap ( * this ) ;
  53784. return * this ;
  53785. }
  53786.  
  53787.  
  53788.  
  53789. template < class Y >
  53790. shared_ptr & operator = ( shared_ptr < Y > const & r )
  53791. {
  53792. this_type ( r ) . swap ( * this ) ;
  53793. return * this ;
  53794. }
  53795.  
  53796.  
  53797.  
  53798.  
  53799.  
  53800. template < class Y >
  53801. shared_ptr & operator = ( std :: auto_ptr < Y > & r )
  53802. {
  53803. this_type ( r ) . swap ( * this ) ;
  53804. return * this ;
  53805. }
  53806. #542
  53807. template < class Ap >
  53808. typename boost :: detail :: sp_enable_if_auto_ptr < Ap , shared_ptr & > :: type operator = ( Ap r )
  53809. {
  53810. this_type ( r ) . swap ( * this ) ;
  53811. return * this ;
  53812. }
  53813. #617
  53814. void reset ( )
  53815. {
  53816. this_type ( ) . swap ( * this ) ;
  53817. }
  53818.  
  53819. template < class Y > void reset ( Y * p )
  53820. {
  53821. ( ( void ) 0 ) ;
  53822. this_type ( p ) . swap ( * this ) ;
  53823. }
  53824.  
  53825. template < class Y , class D > void reset ( Y * p , D d )
  53826. {
  53827. this_type ( p , d ) . swap ( * this ) ;
  53828. }
  53829.  
  53830. template < class Y , class D , class A > void reset ( Y * p , D d , A a )
  53831. {
  53832. this_type ( p , d , a ) . swap ( * this ) ;
  53833. }
  53834.  
  53835. template < class Y > void reset ( shared_ptr < Y > const & r , element_type * p )
  53836. {
  53837. this_type ( r , p ) . swap ( * this ) ;
  53838. }
  53839.  
  53840.  
  53841. typename boost :: detail :: sp_dereference < T > :: type operator * ( ) const
  53842. {
  53843. ( ( void ) 0 ) ;
  53844. return * px ;
  53845. }
  53846.  
  53847.  
  53848. typename boost :: detail :: sp_member_access < T > :: type operator -> ( ) const
  53849. {
  53850. ( ( void ) 0 ) ;
  53851. return px ;
  53852. }
  53853.  
  53854.  
  53855. typename boost :: detail :: sp_array_access < T > :: type operator [ ] ( std :: ptrdiff_t i ) const
  53856. {
  53857. ( ( void ) 0 ) ;
  53858. ( ( void ) 0 ) ;
  53859.  
  53860. return px [ i ] ;
  53861. }
  53862.  
  53863. element_type * get ( ) const
  53864. {
  53865. return px ;
  53866. }
  53867. #1 "./boost/smart_ptr/detail/operator_bool.hpp"
  53868. #50
  53869. typedef element_type * this_type :: * unspecified_bool_type ;
  53870.  
  53871. operator unspecified_bool_type ( ) const
  53872. {
  53873. return px == 0 ? 0 : & this_type :: px ;
  53874. }
  53875.  
  53876.  
  53877.  
  53878.  
  53879. bool operator ! ( ) const
  53880. {
  53881. return px == 0 ;
  53882. }
  53883. #674 "./boost/smart_ptr/shared_ptr.hpp"
  53884. bool unique ( ) const
  53885. {
  53886. return pn . unique ( ) ;
  53887. }
  53888.  
  53889. long use_count ( ) const
  53890. {
  53891. return pn . use_count ( ) ;
  53892. }
  53893.  
  53894. void swap ( shared_ptr & other )
  53895. {
  53896. std :: swap ( px , other . px ) ;
  53897. pn . swap ( other . pn ) ;
  53898. }
  53899.  
  53900. template < class Y > bool owner_before ( shared_ptr < Y > const & rhs ) const
  53901. {
  53902. return pn < rhs . pn ;
  53903. }
  53904.  
  53905. template < class Y > bool owner_before ( weak_ptr < Y > const & rhs ) const
  53906. {
  53907. return pn < rhs . pn ;
  53908. }
  53909.  
  53910. void * _internal_get_deleter ( boost :: detail :: sp_typeinfo const & ti ) const
  53911. {
  53912. return pn . get_deleter ( ti ) ;
  53913. }
  53914.  
  53915. void * _internal_get_untyped_deleter ( ) const
  53916. {
  53917. return pn . get_untyped_deleter ( ) ;
  53918. }
  53919.  
  53920. bool _internal_equiv ( shared_ptr const & r ) const
  53921. {
  53922. return px == r . px && pn == r . pn ;
  53923. }
  53924. #720
  53925. private :
  53926.  
  53927. template < class Y > friend class shared_ptr ;
  53928. template < class Y > friend class weak_ptr ;
  53929.  
  53930.  
  53931.  
  53932.  
  53933. element_type * px ;
  53934. boost :: detail :: shared_count pn ;
  53935.  
  53936. } ;
  53937.  
  53938. template < class T , class U > inline bool operator == ( shared_ptr < T > const & a , shared_ptr < U > const & b )
  53939. {
  53940. return a . get ( ) == b . get ( ) ;
  53941. }
  53942.  
  53943. template < class T , class U > inline bool operator != ( shared_ptr < T > const & a , shared_ptr < U > const & b )
  53944. {
  53945. return a . get ( ) != b . get ( ) ;
  53946. }
  53947. #778
  53948. template < class T , class U > inline bool operator < ( shared_ptr < T > const & a , shared_ptr < U > const & b )
  53949. {
  53950. return a . owner_before ( b ) ;
  53951. }
  53952.  
  53953. template < class T > inline void swap ( shared_ptr < T > & a , shared_ptr < T > & b )
  53954. {
  53955. a . swap ( b ) ;
  53956. }
  53957.  
  53958. template < class T , class U > shared_ptr < T > static_pointer_cast ( shared_ptr < U > const & r )
  53959. {
  53960. ( void ) static_cast < T * > ( static_cast < U * > ( 0 ) ) ;
  53961.  
  53962. typedef typename shared_ptr < T > :: element_type E ;
  53963.  
  53964. E * p = static_cast < E * > ( r . get ( ) ) ;
  53965. return shared_ptr < T > ( r , p ) ;
  53966. }
  53967.  
  53968. template < class T , class U > shared_ptr < T > const_pointer_cast ( shared_ptr < U > const & r )
  53969. {
  53970. ( void ) const_cast < T * > ( static_cast < U * > ( 0 ) ) ;
  53971.  
  53972. typedef typename shared_ptr < T > :: element_type E ;
  53973.  
  53974. E * p = const_cast < E * > ( r . get ( ) ) ;
  53975. return shared_ptr < T > ( r , p ) ;
  53976. }
  53977.  
  53978. template < class T , class U > shared_ptr < T > dynamic_pointer_cast ( shared_ptr < U > const & r )
  53979. {
  53980. ( void ) dynamic_cast < T * > ( static_cast < U * > ( 0 ) ) ;
  53981.  
  53982. typedef typename shared_ptr < T > :: element_type E ;
  53983.  
  53984. E * p = dynamic_cast < E * > ( r . get ( ) ) ;
  53985. return p ? shared_ptr < T > ( r , p ) : shared_ptr < T > ( ) ;
  53986. }
  53987.  
  53988. template < class T , class U > shared_ptr < T > reinterpret_pointer_cast ( shared_ptr < U > const & r )
  53989. {
  53990. ( void ) reinterpret_cast < T * > ( static_cast < U * > ( 0 ) ) ;
  53991.  
  53992. typedef typename shared_ptr < T > :: element_type E ;
  53993.  
  53994. E * p = reinterpret_cast < E * > ( r . get ( ) ) ;
  53995. return shared_ptr < T > ( r , p ) ;
  53996. }
  53997.  
  53998.  
  53999.  
  54000. template < class T > inline typename shared_ptr < T > :: element_type * get_pointer ( shared_ptr < T > const & p )
  54001. {
  54002. return p . get ( ) ;
  54003. }
  54004. #857
  54005. template < class E , class T , class Y > std :: basic_ostream < E , T > & operator << ( std :: basic_ostream < E , T > &
  54006. #857
  54007. os , shared_ptr < Y > const & p )
  54008.  
  54009. {
  54010. os << p . get ( ) ;
  54011. return os ;
  54012. }
  54013. #872
  54014. namespace detail
  54015. {
  54016. #890
  54017. template < class D , class T > D * basic_get_deleter ( shared_ptr < T > const & p )
  54018. {
  54019. return static_cast < D * > ( p . _internal_get_deleter ( typeid ( D ) ) ) ;
  54020. }
  54021.  
  54022.  
  54023.  
  54024. class esft2_deleter_wrapper
  54025. {
  54026. private :
  54027.  
  54028. shared_ptr < void > deleter_ ;
  54029.  
  54030. public :
  54031.  
  54032. esft2_deleter_wrapper ( )
  54033. {
  54034. }
  54035.  
  54036. template < class T > void set_deleter ( shared_ptr < T > const & deleter )
  54037. {
  54038. deleter_ = deleter ;
  54039. }
  54040.  
  54041. template < typename D > D * get_deleter ( ) const
  54042. {
  54043. return boost :: detail :: basic_get_deleter < D > ( deleter_ ) ;
  54044. }
  54045.  
  54046. template < class T > void operator ( ) ( T * )
  54047. {
  54048. ( ( void ) 0 ) ;
  54049. deleter_ . reset ( ) ;
  54050. }
  54051. } ;
  54052.  
  54053. }
  54054.  
  54055. template < class D , class T > D * get_deleter ( shared_ptr < T > const & p )
  54056. {
  54057. D * del = boost :: detail :: basic_get_deleter < D > ( p ) ;
  54058.  
  54059. if ( del == 0 )
  54060. {
  54061. boost :: detail :: esft2_deleter_wrapper * del_wrapper = boost :: detail :: basic_get_deleter < boost :: detail :: esft2_deleter_wrapper
  54062. #934
  54063. > ( p ) ;
  54064.  
  54065.  
  54066. if ( del_wrapper ) del = del_wrapper -> :: boost :: detail :: esft2_deleter_wrapper :: get_deleter < D > ( ) ;
  54067. }
  54068.  
  54069. return del ;
  54070. }
  54071.  
  54072.  
  54073.  
  54074.  
  54075.  
  54076. template < class T > inline bool atomic_is_lock_free ( shared_ptr < T > const * )
  54077. {
  54078. return false ;
  54079. }
  54080.  
  54081. template < class T > shared_ptr < T > atomic_load ( shared_ptr < T > const * p )
  54082. {
  54083. boost :: detail :: spinlock_pool < 2 > :: scoped_lock lock ( p ) ;
  54084. return * p ;
  54085. }
  54086.  
  54087. template < class T > inline shared_ptr < T > atomic_load_explicit ( shared_ptr < T > const * p , memory_order )
  54088. {
  54089. return atomic_load ( p ) ;
  54090. }
  54091.  
  54092. template < class T > void atomic_store ( shared_ptr < T > * p , shared_ptr < T > r )
  54093. {
  54094. boost :: detail :: spinlock_pool < 2 > :: scoped_lock lock ( p ) ;
  54095. p -> swap ( r ) ;
  54096. }
  54097.  
  54098. template < class T > inline void atomic_store_explicit ( shared_ptr < T > * p , shared_ptr < T > r , memory_order )
  54099. {
  54100. atomic_store ( p , r ) ;
  54101. }
  54102.  
  54103. template < class T > shared_ptr < T > atomic_exchange ( shared_ptr < T > * p , shared_ptr < T > r )
  54104. {
  54105. boost :: detail :: spinlock & sp = boost :: detail :: spinlock_pool < 2 > :: spinlock_for ( p ) ;
  54106.  
  54107. sp . lock ( ) ;
  54108. p -> swap ( r ) ;
  54109. sp . unlock ( ) ;
  54110.  
  54111. return r ;
  54112. }
  54113.  
  54114. template < class T > shared_ptr < T > atomic_exchange_explicit ( shared_ptr < T > * p , shared_ptr < T > r , memory_order
  54115. #985
  54116. )
  54117. {
  54118. return atomic_exchange ( p , r ) ;
  54119. }
  54120.  
  54121. template < class T > bool atomic_compare_exchange ( shared_ptr < T > * p , shared_ptr < T > * v , shared_ptr < T > w )
  54122. {
  54123. boost :: detail :: spinlock & sp = boost :: detail :: spinlock_pool < 2 > :: spinlock_for ( p ) ;
  54124.  
  54125. sp . lock ( ) ;
  54126.  
  54127. if ( p -> _internal_equiv ( * v ) )
  54128. {
  54129. p -> swap ( w ) ;
  54130.  
  54131. sp . unlock ( ) ;
  54132.  
  54133. return true ;
  54134. }
  54135. else
  54136. {
  54137. shared_ptr < T > tmp ( * p ) ;
  54138.  
  54139. sp . unlock ( ) ;
  54140.  
  54141. tmp . swap ( * v ) ;
  54142. return false ;
  54143. }
  54144. }
  54145.  
  54146. template < class T > inline bool atomic_compare_exchange_explicit ( shared_ptr < T > * p , shared_ptr < T > * v , shared_ptr
  54147. #1015
  54148. < T > w , memory_order , memory_order )
  54149. {
  54150. return atomic_compare_exchange ( p , v , w ) ;
  54151. }
  54152.  
  54153.  
  54154.  
  54155.  
  54156.  
  54157. template < class T > struct hash ;
  54158.  
  54159. template < class T > std :: size_t hash_value ( boost :: shared_ptr < T > const & p )
  54160. {
  54161. return boost :: hash < T * > ( ) ( p . get ( ) ) ;
  54162. }
  54163.  
  54164. }
  54165. #1 "./boost/mpl/bool_fwd.hpp"
  54166. #1 "./boost/mpl/aux_/adl_barrier.hpp"
  54167. #1 "./boost/mpl/aux_/config/adl.hpp"
  54168. #1 "./boost/mpl/aux_/config/msvc.hpp"
  54169. #1 "./boost/mpl/aux_/config/intel.hpp"
  54170. #1 "./boost/mpl/aux_/config/gcc.hpp"
  54171. #1 "./boost/mpl/aux_/config/workaround.hpp"
  54172. #33 "./boost/mpl/aux_/adl_barrier.hpp"
  54173. namespace mpl_ { namespace aux { } }
  54174. namespace boost { namespace mpl { using namespace mpl_ ;
  54175. namespace aux { using namespace mpl_ :: aux ; }
  54176. } }
  54177. #19 "./boost/mpl/bool_fwd.hpp"
  54178. namespace mpl_ {
  54179.  
  54180. template < bool C_ > struct bool_ ;
  54181.  
  54182.  
  54183. typedef bool_ < true > true_ ;
  54184. typedef bool_ < false > false_ ;
  54185.  
  54186. }
  54187.  
  54188. namespace boost { namespace mpl { using :: mpl_ :: bool_ ; } }
  54189. namespace boost { namespace mpl { using :: mpl_ :: true_ ; } }
  54190. namespace boost { namespace mpl { using :: mpl_ :: false_ ; } }
  54191. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/locale"
  54192. #36
  54193. #pragma GCC system_header
  54194. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets_nonio.h"
  54195. #37
  54196. #pragma GCC system_header
  54197. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/ctime"
  54198. #39
  54199. #pragma GCC system_header
  54200. #58
  54201. namespace std
  54202. {
  54203. using :: clock_t ;
  54204. using :: time_t ;
  54205. using :: tm ;
  54206.  
  54207. using :: clock ;
  54208. using :: difftime ;
  54209. using :: mktime ;
  54210. using :: time ;
  54211. using :: asctime ;
  54212. using :: ctime ;
  54213. using :: gmtime ;
  54214. using :: localtime ;
  54215. using :: strftime ;
  54216. }
  54217. #41 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets_nonio.h"
  54218. namespace std
  54219. {
  54220. #52
  54221. class time_base
  54222. {
  54223. public :
  54224. enum dateorder { no_order , dmy , mdy , ymd , ydm } ;
  54225. } ;
  54226.  
  54227. template < typename _CharT >
  54228. struct __timepunct_cache : public locale :: facet
  54229. {
  54230.  
  54231. static const _CharT * _S_timezones [ 14 ] ;
  54232.  
  54233. const _CharT * _M_date_format ;
  54234. const _CharT * _M_date_era_format ;
  54235. const _CharT * _M_time_format ;
  54236. const _CharT * _M_time_era_format ;
  54237. const _CharT * _M_date_time_format ;
  54238. const _CharT * _M_date_time_era_format ;
  54239. const _CharT * _M_am ;
  54240. const _CharT * _M_pm ;
  54241. const _CharT * _M_am_pm_format ;
  54242.  
  54243.  
  54244. const _CharT * _M_day1 ;
  54245. const _CharT * _M_day2 ;
  54246. const _CharT * _M_day3 ;
  54247. const _CharT * _M_day4 ;
  54248. const _CharT * _M_day5 ;
  54249. const _CharT * _M_day6 ;
  54250. const _CharT * _M_day7 ;
  54251.  
  54252.  
  54253. const _CharT * _M_aday1 ;
  54254. const _CharT * _M_aday2 ;
  54255. const _CharT * _M_aday3 ;
  54256. const _CharT * _M_aday4 ;
  54257. const _CharT * _M_aday5 ;
  54258. const _CharT * _M_aday6 ;
  54259. const _CharT * _M_aday7 ;
  54260.  
  54261.  
  54262. const _CharT * _M_month01 ;
  54263. const _CharT * _M_month02 ;
  54264. const _CharT * _M_month03 ;
  54265. const _CharT * _M_month04 ;
  54266. const _CharT * _M_month05 ;
  54267. const _CharT * _M_month06 ;
  54268. const _CharT * _M_month07 ;
  54269. const _CharT * _M_month08 ;
  54270. const _CharT * _M_month09 ;
  54271. const _CharT * _M_month10 ;
  54272. const _CharT * _M_month11 ;
  54273. const _CharT * _M_month12 ;
  54274.  
  54275.  
  54276. const _CharT * _M_amonth01 ;
  54277. const _CharT * _M_amonth02 ;
  54278. const _CharT * _M_amonth03 ;
  54279. const _CharT * _M_amonth04 ;
  54280. const _CharT * _M_amonth05 ;
  54281. const _CharT * _M_amonth06 ;
  54282. const _CharT * _M_amonth07 ;
  54283. const _CharT * _M_amonth08 ;
  54284. const _CharT * _M_amonth09 ;
  54285. const _CharT * _M_amonth10 ;
  54286. const _CharT * _M_amonth11 ;
  54287. const _CharT * _M_amonth12 ;
  54288.  
  54289. bool _M_allocated ;
  54290.  
  54291. __timepunct_cache ( size_t __refs = 0 ) : facet ( __refs ) ,
  54292. _M_date_format ( 0 ) , _M_date_era_format ( 0 ) , _M_time_format ( 0 ) ,
  54293. _M_time_era_format ( 0 ) , _M_date_time_format ( 0 ) ,
  54294. _M_date_time_era_format ( 0 ) , _M_am ( 0 ) , _M_pm ( 0 ) ,
  54295. _M_am_pm_format ( 0 ) , _M_day1 ( 0 ) , _M_day2 ( 0 ) , _M_day3 ( 0 ) ,
  54296. _M_day4 ( 0 ) , _M_day5 ( 0 ) , _M_day6 ( 0 ) , _M_day7 ( 0 ) ,
  54297. _M_aday1 ( 0 ) , _M_aday2 ( 0 ) , _M_aday3 ( 0 ) , _M_aday4 ( 0 ) ,
  54298. _M_aday5 ( 0 ) , _M_aday6 ( 0 ) , _M_aday7 ( 0 ) , _M_month01 ( 0 ) ,
  54299. _M_month02 ( 0 ) , _M_month03 ( 0 ) , _M_month04 ( 0 ) , _M_month05 ( 0 ) ,
  54300. _M_month06 ( 0 ) , _M_month07 ( 0 ) , _M_month08 ( 0 ) , _M_month09 ( 0 ) ,
  54301. _M_month10 ( 0 ) , _M_month11 ( 0 ) , _M_month12 ( 0 ) , _M_amonth01 ( 0 ) ,
  54302. _M_amonth02 ( 0 ) , _M_amonth03 ( 0 ) , _M_amonth04 ( 0 ) ,
  54303. _M_amonth05 ( 0 ) , _M_amonth06 ( 0 ) , _M_amonth07 ( 0 ) ,
  54304. _M_amonth08 ( 0 ) , _M_amonth09 ( 0 ) , _M_amonth10 ( 0 ) ,
  54305. _M_amonth11 ( 0 ) , _M_amonth12 ( 0 ) , _M_allocated ( false )
  54306. { }
  54307.  
  54308. ~ __timepunct_cache ( ) ;
  54309.  
  54310. void
  54311. _M_cache ( const locale & __loc ) ;
  54312.  
  54313. private :
  54314. __timepunct_cache &
  54315. operator = ( const __timepunct_cache & ) ;
  54316.  
  54317. explicit
  54318. __timepunct_cache ( const __timepunct_cache & ) ;
  54319. } ;
  54320.  
  54321. template < typename _CharT >
  54322. __timepunct_cache < _CharT > :: ~ __timepunct_cache ( )
  54323. {
  54324. if ( _M_allocated )
  54325. {
  54326.  
  54327. }
  54328. }
  54329.  
  54330.  
  54331. template < >
  54332. const char *
  54333. __timepunct_cache < char > :: _S_timezones [ 14 ] ;
  54334.  
  54335.  
  54336. template < >
  54337. const wchar_t *
  54338. __timepunct_cache < wchar_t > :: _S_timezones [ 14 ] ;
  54339.  
  54340.  
  54341.  
  54342. template < typename _CharT >
  54343. const _CharT * __timepunct_cache < _CharT > :: _S_timezones [ 14 ] ;
  54344.  
  54345. template < typename _CharT >
  54346. class __timepunct : public locale :: facet
  54347. {
  54348. public :
  54349.  
  54350. typedef _CharT __char_type ;
  54351. typedef basic_string < _CharT > __string_type ;
  54352. typedef __timepunct_cache < _CharT > __cache_type ;
  54353.  
  54354. protected :
  54355. __cache_type * _M_data ;
  54356. __c_locale _M_c_locale_timepunct ;
  54357. const char * _M_name_timepunct ;
  54358.  
  54359. public :
  54360.  
  54361. static locale :: id id ;
  54362.  
  54363. explicit
  54364. __timepunct ( size_t __refs = 0 ) ;
  54365.  
  54366. explicit
  54367. __timepunct ( __cache_type * __cache , size_t __refs = 0 ) ;
  54368. #210
  54369. explicit
  54370. __timepunct ( __c_locale __cloc , const char * __s , size_t __refs = 0 ) ;
  54371.  
  54372.  
  54373.  
  54374. void
  54375. _M_put ( _CharT * __s , size_t __maxlen , const _CharT * __format ,
  54376. const tm * __tm ) const throw ( ) ;
  54377.  
  54378. void
  54379. _M_date_formats ( const _CharT * * __date ) const
  54380. {
  54381.  
  54382. __date [ 0 ] = _M_data -> _M_date_format ;
  54383. __date [ 1 ] = _M_data -> _M_date_era_format ;
  54384. }
  54385.  
  54386. void
  54387. _M_time_formats ( const _CharT * * __time ) const
  54388. {
  54389.  
  54390. __time [ 0 ] = _M_data -> _M_time_format ;
  54391. __time [ 1 ] = _M_data -> _M_time_era_format ;
  54392. }
  54393.  
  54394. void
  54395. _M_date_time_formats ( const _CharT * * __dt ) const
  54396. {
  54397.  
  54398. __dt [ 0 ] = _M_data -> _M_date_time_format ;
  54399. __dt [ 1 ] = _M_data -> _M_date_time_era_format ;
  54400. }
  54401.  
  54402. void
  54403. _M_am_pm_format ( const _CharT * __ampm ) const
  54404. { __ampm = _M_data -> _M_am_pm_format ; }
  54405.  
  54406. void
  54407. _M_am_pm ( const _CharT * * __ampm ) const
  54408. {
  54409. __ampm [ 0 ] = _M_data -> _M_am ;
  54410. __ampm [ 1 ] = _M_data -> _M_pm ;
  54411. }
  54412.  
  54413. void
  54414. _M_days ( const _CharT * * __days ) const
  54415. {
  54416. __days [ 0 ] = _M_data -> _M_day1 ;
  54417. __days [ 1 ] = _M_data -> _M_day2 ;
  54418. __days [ 2 ] = _M_data -> _M_day3 ;
  54419. __days [ 3 ] = _M_data -> _M_day4 ;
  54420. __days [ 4 ] = _M_data -> _M_day5 ;
  54421. __days [ 5 ] = _M_data -> _M_day6 ;
  54422. __days [ 6 ] = _M_data -> _M_day7 ;
  54423. }
  54424.  
  54425. void
  54426. _M_days_abbreviated ( const _CharT * * __days ) const
  54427. {
  54428. __days [ 0 ] = _M_data -> _M_aday1 ;
  54429. __days [ 1 ] = _M_data -> _M_aday2 ;
  54430. __days [ 2 ] = _M_data -> _M_aday3 ;
  54431. __days [ 3 ] = _M_data -> _M_aday4 ;
  54432. __days [ 4 ] = _M_data -> _M_aday5 ;
  54433. __days [ 5 ] = _M_data -> _M_aday6 ;
  54434. __days [ 6 ] = _M_data -> _M_aday7 ;
  54435. }
  54436.  
  54437. void
  54438. _M_months ( const _CharT * * __months ) const
  54439. {
  54440. __months [ 0 ] = _M_data -> _M_month01 ;
  54441. __months [ 1 ] = _M_data -> _M_month02 ;
  54442. __months [ 2 ] = _M_data -> _M_month03 ;
  54443. __months [ 3 ] = _M_data -> _M_month04 ;
  54444. __months [ 4 ] = _M_data -> _M_month05 ;
  54445. __months [ 5 ] = _M_data -> _M_month06 ;
  54446. __months [ 6 ] = _M_data -> _M_month07 ;
  54447. __months [ 7 ] = _M_data -> _M_month08 ;
  54448. __months [ 8 ] = _M_data -> _M_month09 ;
  54449. __months [ 9 ] = _M_data -> _M_month10 ;
  54450. __months [ 10 ] = _M_data -> _M_month11 ;
  54451. __months [ 11 ] = _M_data -> _M_month12 ;
  54452. }
  54453.  
  54454. void
  54455. _M_months_abbreviated ( const _CharT * * __months ) const
  54456. {
  54457. __months [ 0 ] = _M_data -> _M_amonth01 ;
  54458. __months [ 1 ] = _M_data -> _M_amonth02 ;
  54459. __months [ 2 ] = _M_data -> _M_amonth03 ;
  54460. __months [ 3 ] = _M_data -> _M_amonth04 ;
  54461. __months [ 4 ] = _M_data -> _M_amonth05 ;
  54462. __months [ 5 ] = _M_data -> _M_amonth06 ;
  54463. __months [ 6 ] = _M_data -> _M_amonth07 ;
  54464. __months [ 7 ] = _M_data -> _M_amonth08 ;
  54465. __months [ 8 ] = _M_data -> _M_amonth09 ;
  54466. __months [ 9 ] = _M_data -> _M_amonth10 ;
  54467. __months [ 10 ] = _M_data -> _M_amonth11 ;
  54468. __months [ 11 ] = _M_data -> _M_amonth12 ;
  54469. }
  54470.  
  54471. protected :
  54472. virtual
  54473. ~ __timepunct ( ) ;
  54474.  
  54475.  
  54476. void
  54477. _M_initialize_timepunct ( __c_locale __cloc = 0 ) ;
  54478. } ;
  54479.  
  54480. template < typename _CharT >
  54481. locale :: id __timepunct < _CharT > :: id ;
  54482.  
  54483.  
  54484. template < >
  54485. void
  54486. __timepunct < char > :: _M_initialize_timepunct ( __c_locale __cloc ) ;
  54487.  
  54488. template < >
  54489. void
  54490. __timepunct < char > :: _M_put ( char * , size_t , const char * , const tm * ) const throw ( ) ;
  54491.  
  54492.  
  54493. template < >
  54494. void
  54495. __timepunct < wchar_t > :: _M_initialize_timepunct ( __c_locale __cloc ) ;
  54496.  
  54497. template < >
  54498. void
  54499. __timepunct < wchar_t > :: _M_put ( wchar_t * , size_t , const wchar_t * ,
  54500. const tm * ) const throw ( ) ;
  54501.  
  54502.  
  54503.  
  54504. }
  54505. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/time_members.h"
  54506. #37
  54507. namespace std
  54508. {
  54509.  
  54510.  
  54511. template < typename _CharT >
  54512. __timepunct < _CharT > :: __timepunct ( size_t __refs )
  54513. : facet ( __refs ) , _M_data ( 0 )
  54514. {
  54515. _M_name_timepunct = _S_get_c_name ( ) ;
  54516. _M_initialize_timepunct ( ) ;
  54517. }
  54518.  
  54519. template < typename _CharT >
  54520. __timepunct < _CharT > :: __timepunct ( __cache_type * __cache , size_t __refs )
  54521. : facet ( __refs ) , _M_data ( __cache )
  54522. {
  54523. _M_name_timepunct = _S_get_c_name ( ) ;
  54524. _M_initialize_timepunct ( ) ;
  54525. }
  54526.  
  54527. template < typename _CharT >
  54528. __timepunct < _CharT > :: __timepunct ( __c_locale __cloc , const char * __s ,
  54529. size_t __refs )
  54530. : facet ( __refs ) , _M_data ( 0 )
  54531. {
  54532. if ( __builtin_strcmp ( __s , _S_get_c_name ( ) ) != 0 )
  54533. {
  54534. const size_t __len = __builtin_strlen ( __s ) + 1 ;
  54535. char * __tmp = new char [ __len ] ;
  54536. __builtin_memcpy ( __tmp , __s , __len ) ;
  54537. _M_name_timepunct = __tmp ;
  54538. }
  54539. else
  54540. _M_name_timepunct = _S_get_c_name ( ) ;
  54541.  
  54542. try
  54543. { _M_initialize_timepunct ( __cloc ) ; }
  54544. catch ( ... )
  54545. {
  54546. if ( _M_name_timepunct != _S_get_c_name ( ) )
  54547. delete [ ] _M_name_timepunct ;
  54548. throw ;
  54549. }
  54550. }
  54551.  
  54552. template < typename _CharT >
  54553. __timepunct < _CharT > :: ~ __timepunct ( )
  54554. {
  54555. if ( _M_name_timepunct != _S_get_c_name ( ) )
  54556. delete [ ] _M_name_timepunct ;
  54557. delete _M_data ;
  54558. _S_destroy_c_locale ( _M_c_locale_timepunct ) ;
  54559. }
  54560.  
  54561.  
  54562. }
  54563. #350 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets_nonio.h"
  54564. namespace std
  54565. {
  54566. #367
  54567. template < typename _CharT , typename _InIter >
  54568. class time_get : public locale :: facet , public time_base
  54569. {
  54570. public :
  54571.  
  54572.  
  54573.  
  54574. typedef _CharT char_type ;
  54575. typedef _InIter iter_type ;
  54576.  
  54577. typedef basic_string < _CharT > __string_type ;
  54578.  
  54579.  
  54580. static locale :: id id ;
  54581. #389
  54582. explicit
  54583. time_get ( size_t __refs = 0 )
  54584. : facet ( __refs ) { }
  54585. #406
  54586. dateorder
  54587. date_order ( ) const
  54588. { return this -> do_date_order ( ) ; }
  54589. #430
  54590. iter_type
  54591. get_time ( iter_type __beg , iter_type __end , ios_base & __io ,
  54592. ios_base :: iostate & __err , tm * __tm ) const
  54593. { return this -> do_get_time ( __beg , __end , __io , __err , __tm ) ; }
  54594. #455
  54595. iter_type
  54596. get_date ( iter_type __beg , iter_type __end , ios_base & __io ,
  54597. ios_base :: iostate & __err , tm * __tm ) const
  54598. { return this -> do_get_date ( __beg , __end , __io , __err , __tm ) ; }
  54599. #483
  54600. iter_type
  54601. get_weekday ( iter_type __beg , iter_type __end , ios_base & __io ,
  54602. ios_base :: iostate & __err , tm * __tm ) const
  54603. { return this -> do_get_weekday ( __beg , __end , __io , __err , __tm ) ; }
  54604. #512
  54605. iter_type
  54606. get_monthname ( iter_type __beg , iter_type __end , ios_base & __io ,
  54607. ios_base :: iostate & __err , tm * __tm ) const
  54608. { return this -> do_get_monthname ( __beg , __end , __io , __err , __tm ) ; }
  54609. #538
  54610. iter_type
  54611. get_year ( iter_type __beg , iter_type __end , ios_base & __io ,
  54612. ios_base :: iostate & __err , tm * __tm ) const
  54613. { return this -> do_get_year ( __beg , __end , __io , __err , __tm ) ; }
  54614.  
  54615. protected :
  54616.  
  54617. virtual
  54618. ~ time_get ( ) { }
  54619. #558
  54620. virtual dateorder
  54621. do_date_order ( ) const ;
  54622. #576
  54623. virtual iter_type
  54624. do_get_time ( iter_type __beg , iter_type __end , ios_base & __io ,
  54625. ios_base :: iostate & __err , tm * __tm ) const ;
  54626. #595
  54627. virtual iter_type
  54628. do_get_date ( iter_type __beg , iter_type __end , ios_base & __io ,
  54629. ios_base :: iostate & __err , tm * __tm ) const ;
  54630. #614
  54631. virtual iter_type
  54632. do_get_weekday ( iter_type __beg , iter_type __end , ios_base & ,
  54633. ios_base :: iostate & __err , tm * __tm ) const ;
  54634. #633
  54635. virtual iter_type
  54636. do_get_monthname ( iter_type __beg , iter_type __end , ios_base & ,
  54637. ios_base :: iostate & __err , tm * __tm ) const ;
  54638. #652
  54639. virtual iter_type
  54640. do_get_year ( iter_type __beg , iter_type __end , ios_base & __io ,
  54641. ios_base :: iostate & __err , tm * __tm ) const ;
  54642.  
  54643.  
  54644. iter_type
  54645. _M_extract_num ( iter_type __beg , iter_type __end , int & __member ,
  54646. int __min , int __max , size_t __len ,
  54647. ios_base & __io , ios_base :: iostate & __err ) const ;
  54648.  
  54649.  
  54650. iter_type
  54651. _M_extract_name ( iter_type __beg , iter_type __end , int & __member ,
  54652. const _CharT * * __names , size_t __indexlen ,
  54653. ios_base & __io , ios_base :: iostate & __err ) const ;
  54654.  
  54655.  
  54656. iter_type
  54657. _M_extract_wday_or_month ( iter_type __beg , iter_type __end , int & __member ,
  54658. const _CharT * * __names , size_t __indexlen ,
  54659. ios_base & __io , ios_base :: iostate & __err ) const ;
  54660.  
  54661.  
  54662. iter_type
  54663. _M_extract_via_format ( iter_type __beg , iter_type __end , ios_base & __io ,
  54664. ios_base :: iostate & __err , tm * __tm ,
  54665. const _CharT * __format ) const ;
  54666. } ;
  54667.  
  54668. template < typename _CharT , typename _InIter >
  54669. locale :: id time_get < _CharT , _InIter > :: id ;
  54670.  
  54671.  
  54672. template < typename _CharT , typename _InIter >
  54673. class time_get_byname : public time_get < _CharT , _InIter >
  54674. {
  54675. public :
  54676.  
  54677. typedef _CharT char_type ;
  54678. typedef _InIter iter_type ;
  54679.  
  54680. explicit
  54681. time_get_byname ( const char * , size_t __refs = 0 )
  54682. : time_get < _CharT , _InIter > ( __refs ) { }
  54683.  
  54684. protected :
  54685. virtual
  54686. ~ time_get_byname ( ) { }
  54687. } ;
  54688. #714
  54689. template < typename _CharT , typename _OutIter >
  54690. class time_put : public locale :: facet
  54691. {
  54692. public :
  54693.  
  54694.  
  54695.  
  54696. typedef _CharT char_type ;
  54697. typedef _OutIter iter_type ;
  54698.  
  54699.  
  54700.  
  54701. static locale :: id id ;
  54702. #735
  54703. explicit
  54704. time_put ( size_t __refs = 0 )
  54705. : facet ( __refs ) { }
  54706. #754
  54707. iter_type
  54708. put ( iter_type __s , ios_base & __io , char_type __fill , const tm * __tm ,
  54709. const _CharT * __beg , const _CharT * __end ) const ;
  54710. #774
  54711. iter_type
  54712. put ( iter_type __s , ios_base & __io , char_type __fill ,
  54713. const tm * __tm , char __format , char __mod = 0 ) const
  54714. { return this -> do_put ( __s , __io , __fill , __tm , __format , __mod ) ; }
  54715.  
  54716. protected :
  54717.  
  54718. virtual
  54719. ~ time_put ( )
  54720. { }
  54721. #801
  54722. virtual iter_type
  54723. do_put ( iter_type __s , ios_base & __io , char_type __fill , const tm * __tm ,
  54724. char __format , char __mod ) const ;
  54725. } ;
  54726.  
  54727. template < typename _CharT , typename _OutIter >
  54728. locale :: id time_put < _CharT , _OutIter > :: id ;
  54729.  
  54730.  
  54731. template < typename _CharT , typename _OutIter >
  54732. class time_put_byname : public time_put < _CharT , _OutIter >
  54733. {
  54734. public :
  54735.  
  54736. typedef _CharT char_type ;
  54737. typedef _OutIter iter_type ;
  54738.  
  54739. explicit
  54740. time_put_byname ( const char * , size_t __refs = 0 )
  54741. : time_put < _CharT , _OutIter > ( __refs )
  54742. { } ;
  54743.  
  54744. protected :
  54745. virtual
  54746. ~ time_put_byname ( ) { }
  54747. } ;
  54748. #840
  54749. class money_base
  54750. {
  54751. public :
  54752. enum part { none , space , symbol , sign , value } ;
  54753. struct pattern { char field [ 4 ] ; } ;
  54754.  
  54755. static const pattern _S_default_pattern ;
  54756.  
  54757. enum
  54758. {
  54759. _S_minus ,
  54760. _S_zero ,
  54761. _S_end = 11
  54762. } ;
  54763.  
  54764.  
  54765.  
  54766. static const char * _S_atoms ;
  54767.  
  54768.  
  54769.  
  54770. __attribute__ ( ( __const__ ) ) static pattern
  54771. _S_construct_pattern ( char __precedes , char __space , char __posn ) throw ( ) ;
  54772. } ;
  54773.  
  54774. template < typename _CharT , bool _Intl >
  54775. struct __moneypunct_cache : public locale :: facet
  54776. {
  54777. const char * _M_grouping ;
  54778. size_t _M_grouping_size ;
  54779. bool _M_use_grouping ;
  54780. _CharT _M_decimal_point ;
  54781. _CharT _M_thousands_sep ;
  54782. const _CharT * _M_curr_symbol ;
  54783. size_t _M_curr_symbol_size ;
  54784. const _CharT * _M_positive_sign ;
  54785. size_t _M_positive_sign_size ;
  54786. const _CharT * _M_negative_sign ;
  54787. size_t _M_negative_sign_size ;
  54788. int _M_frac_digits ;
  54789. money_base :: pattern _M_pos_format ;
  54790. money_base :: pattern _M_neg_format ;
  54791.  
  54792.  
  54793.  
  54794.  
  54795. _CharT _M_atoms [ money_base :: _S_end ] ;
  54796.  
  54797. bool _M_allocated ;
  54798.  
  54799. __moneypunct_cache ( size_t __refs = 0 ) : facet ( __refs ) ,
  54800. _M_grouping ( 0 ) , _M_grouping_size ( 0 ) , _M_use_grouping ( false ) ,
  54801. _M_decimal_point ( _CharT ( ) ) , _M_thousands_sep ( _CharT ( ) ) ,
  54802. _M_curr_symbol ( 0 ) , _M_curr_symbol_size ( 0 ) ,
  54803. _M_positive_sign ( 0 ) , _M_positive_sign_size ( 0 ) ,
  54804. _M_negative_sign ( 0 ) , _M_negative_sign_size ( 0 ) ,
  54805. _M_frac_digits ( 0 ) ,
  54806. _M_pos_format ( money_base :: pattern ( ) ) ,
  54807. _M_neg_format ( money_base :: pattern ( ) ) , _M_allocated ( false )
  54808. { }
  54809.  
  54810. ~ __moneypunct_cache ( ) ;
  54811.  
  54812. void
  54813. _M_cache ( const locale & __loc ) ;
  54814.  
  54815. private :
  54816. __moneypunct_cache &
  54817. operator = ( const __moneypunct_cache & ) ;
  54818.  
  54819. explicit
  54820. __moneypunct_cache ( const __moneypunct_cache & ) ;
  54821. } ;
  54822.  
  54823. template < typename _CharT , bool _Intl >
  54824. __moneypunct_cache < _CharT , _Intl > :: ~ __moneypunct_cache ( )
  54825. {
  54826. if ( _M_allocated )
  54827. {
  54828. delete [ ] _M_grouping ;
  54829. delete [ ] _M_curr_symbol ;
  54830. delete [ ] _M_positive_sign ;
  54831. delete [ ] _M_negative_sign ;
  54832. }
  54833. }
  54834. #933
  54835. template < typename _CharT , bool _Intl >
  54836. class moneypunct : public locale :: facet , public money_base
  54837. {
  54838. public :
  54839.  
  54840.  
  54841.  
  54842. typedef _CharT char_type ;
  54843. typedef basic_string < _CharT > string_type ;
  54844.  
  54845. typedef __moneypunct_cache < _CharT , _Intl > __cache_type ;
  54846.  
  54847. private :
  54848. __cache_type * _M_data ;
  54849.  
  54850. public :
  54851.  
  54852.  
  54853. static const bool intl = _Intl ;
  54854.  
  54855. static locale :: id id ;
  54856. #962
  54857. explicit
  54858. moneypunct ( size_t __refs = 0 )
  54859. : facet ( __refs ) , _M_data ( 0 )
  54860. { _M_initialize_moneypunct ( ) ; }
  54861. #975
  54862. explicit
  54863. moneypunct ( __cache_type * __cache , size_t __refs = 0 )
  54864. : facet ( __refs ) , _M_data ( __cache )
  54865. { _M_initialize_moneypunct ( ) ; }
  54866. #990
  54867. explicit
  54868. moneypunct ( __c_locale __cloc , const char * __s , size_t __refs = 0 )
  54869. : facet ( __refs ) , _M_data ( 0 )
  54870. { _M_initialize_moneypunct ( __cloc , __s ) ; }
  54871. #1004
  54872. char_type
  54873. decimal_point ( ) const
  54874. { return this -> do_decimal_point ( ) ; }
  54875. #1017
  54876. char_type
  54877. thousands_sep ( ) const
  54878. { return this -> do_thousands_sep ( ) ; }
  54879. #1047
  54880. string
  54881. grouping ( ) const
  54882. { return this -> do_grouping ( ) ; }
  54883. #1060
  54884. string_type
  54885. curr_symbol ( ) const
  54886. { return this -> do_curr_symbol ( ) ; }
  54887. #1077
  54888. string_type
  54889. positive_sign ( ) const
  54890. { return this -> do_positive_sign ( ) ; }
  54891. #1094
  54892. string_type
  54893. negative_sign ( ) const
  54894. { return this -> do_negative_sign ( ) ; }
  54895. #1110
  54896. int
  54897. frac_digits ( ) const
  54898. { return this -> do_frac_digits ( ) ; }
  54899. #1146
  54900. pattern
  54901. pos_format ( ) const
  54902. { return this -> do_pos_format ( ) ; }
  54903.  
  54904. pattern
  54905. neg_format ( ) const
  54906. { return this -> do_neg_format ( ) ; }
  54907.  
  54908.  
  54909. protected :
  54910.  
  54911. virtual
  54912. ~ moneypunct ( ) ;
  54913. #1168
  54914. virtual char_type
  54915. do_decimal_point ( ) const
  54916. { return _M_data -> _M_decimal_point ; }
  54917. #1180
  54918. virtual char_type
  54919. do_thousands_sep ( ) const
  54920. { return _M_data -> _M_thousands_sep ; }
  54921. #1193
  54922. virtual string
  54923. do_grouping ( ) const
  54924. { return _M_data -> _M_grouping ; }
  54925. #1206
  54926. virtual string_type
  54927. do_curr_symbol ( ) const
  54928. { return _M_data -> _M_curr_symbol ; }
  54929. #1219
  54930. virtual string_type
  54931. do_positive_sign ( ) const
  54932. { return _M_data -> _M_positive_sign ; }
  54933. #1232
  54934. virtual string_type
  54935. do_negative_sign ( ) const
  54936. { return _M_data -> _M_negative_sign ; }
  54937. #1246
  54938. virtual int
  54939. do_frac_digits ( ) const
  54940. { return _M_data -> _M_frac_digits ; }
  54941. #1260
  54942. virtual pattern
  54943. do_pos_format ( ) const
  54944. { return _M_data -> _M_pos_format ; }
  54945. #1274
  54946. virtual pattern
  54947. do_neg_format ( ) const
  54948. { return _M_data -> _M_neg_format ; }
  54949.  
  54950.  
  54951. void
  54952. _M_initialize_moneypunct ( __c_locale __cloc = 0 ,
  54953. const char * __name = 0 ) ;
  54954. } ;
  54955.  
  54956. template < typename _CharT , bool _Intl >
  54957. locale :: id moneypunct < _CharT , _Intl > :: id ;
  54958.  
  54959. template < typename _CharT , bool _Intl >
  54960. const bool moneypunct < _CharT , _Intl > :: intl ;
  54961.  
  54962. template < >
  54963. moneypunct < char , true > :: ~ moneypunct ( ) ;
  54964.  
  54965. template < >
  54966. moneypunct < char , false > :: ~ moneypunct ( ) ;
  54967.  
  54968. template < >
  54969. void
  54970. moneypunct < char , true > :: _M_initialize_moneypunct ( __c_locale , const char * ) ;
  54971.  
  54972. template < >
  54973. void
  54974. moneypunct < char , false > :: _M_initialize_moneypunct ( __c_locale , const char * ) ;
  54975.  
  54976.  
  54977. template < >
  54978. moneypunct < wchar_t , true > :: ~ moneypunct ( ) ;
  54979.  
  54980. template < >
  54981. moneypunct < wchar_t , false > :: ~ moneypunct ( ) ;
  54982.  
  54983. template < >
  54984. void
  54985. moneypunct < wchar_t , true > :: _M_initialize_moneypunct ( __c_locale ,
  54986. const char * ) ;
  54987.  
  54988. template < >
  54989. void
  54990. moneypunct < wchar_t , false > :: _M_initialize_moneypunct ( __c_locale ,
  54991. const char * ) ;
  54992.  
  54993.  
  54994.  
  54995. template < typename _CharT , bool _Intl >
  54996. class moneypunct_byname : public moneypunct < _CharT , _Intl >
  54997. {
  54998. public :
  54999. typedef _CharT char_type ;
  55000. typedef basic_string < _CharT > string_type ;
  55001.  
  55002. static const bool intl = _Intl ;
  55003.  
  55004. explicit
  55005. moneypunct_byname ( const char * __s , size_t __refs = 0 )
  55006. : moneypunct < _CharT , _Intl > ( __refs )
  55007. {
  55008. if ( __builtin_strcmp ( __s , "C" ) != 0
  55009. && __builtin_strcmp ( __s , "POSIX" ) != 0 )
  55010. {
  55011. __c_locale __tmp ;
  55012. this -> _S_create_c_locale ( __tmp , __s ) ;
  55013. this -> _M_initialize_moneypunct ( __tmp ) ;
  55014. this -> _S_destroy_c_locale ( __tmp ) ;
  55015. }
  55016. }
  55017.  
  55018. protected :
  55019. virtual
  55020. ~ moneypunct_byname ( ) { }
  55021. } ;
  55022.  
  55023. template < typename _CharT , bool _Intl >
  55024. const bool moneypunct_byname < _CharT , _Intl > :: intl ;
  55025. #1369
  55026. template < typename _CharT , typename _InIter >
  55027. class money_get : public locale :: facet
  55028. {
  55029. public :
  55030.  
  55031.  
  55032.  
  55033. typedef _CharT char_type ;
  55034. typedef _InIter iter_type ;
  55035. typedef basic_string < _CharT > string_type ;
  55036.  
  55037.  
  55038.  
  55039. static locale :: id id ;
  55040. #1391
  55041. explicit
  55042. money_get ( size_t __refs = 0 ) : facet ( __refs ) { }
  55043. #1421
  55044. iter_type
  55045. get ( iter_type __s , iter_type __end , bool __intl , ios_base & __io ,
  55046. ios_base :: iostate & __err , long double & __units ) const
  55047. { return this -> do_get ( __s , __end , __intl , __io , __err , __units ) ; }
  55048. #1452
  55049. iter_type
  55050. get ( iter_type __s , iter_type __end , bool __intl , ios_base & __io ,
  55051. ios_base :: iostate & __err , string_type & __digits ) const
  55052. { return this -> do_get ( __s , __end , __intl , __io , __err , __digits ) ; }
  55053.  
  55054. protected :
  55055.  
  55056. virtual
  55057. ~ money_get ( ) { }
  55058. #1475
  55059. virtual iter_type
  55060. do_get ( iter_type __s , iter_type __end , bool __intl , ios_base & __io ,
  55061. ios_base :: iostate & __err , long double & __units ) const ;
  55062. #1487
  55063. virtual iter_type
  55064. do_get ( iter_type __s , iter_type __end , bool __intl , ios_base & __io ,
  55065. ios_base :: iostate & __err , string_type & __digits ) const ;
  55066. #1498
  55067. template < bool _Intl >
  55068. iter_type
  55069. _M_extract ( iter_type __s , iter_type __end , ios_base & __io ,
  55070. ios_base :: iostate & __err , string & __digits ) const ;
  55071. } ;
  55072.  
  55073. template < typename _CharT , typename _InIter >
  55074. locale :: id money_get < _CharT , _InIter > :: id ;
  55075. #1520
  55076. template < typename _CharT , typename _OutIter >
  55077. class money_put : public locale :: facet
  55078. {
  55079. public :
  55080.  
  55081.  
  55082. typedef _CharT char_type ;
  55083. typedef _OutIter iter_type ;
  55084. typedef basic_string < _CharT > string_type ;
  55085.  
  55086.  
  55087.  
  55088. static locale :: id id ;
  55089. #1541
  55090. explicit
  55091. money_put ( size_t __refs = 0 ) : facet ( __refs ) { }
  55092. #1561
  55093. iter_type
  55094. put ( iter_type __s , bool __intl , ios_base & __io ,
  55095. char_type __fill , long double __units ) const
  55096. { return this -> do_put ( __s , __intl , __io , __fill , __units ) ; }
  55097. #1584
  55098. iter_type
  55099. put ( iter_type __s , bool __intl , ios_base & __io ,
  55100. char_type __fill , const string_type & __digits ) const
  55101. { return this -> do_put ( __s , __intl , __io , __fill , __digits ) ; }
  55102.  
  55103. protected :
  55104.  
  55105. virtual
  55106. ~ money_put ( ) { }
  55107. #1618
  55108. virtual iter_type
  55109. do_put ( iter_type __s , bool __intl , ios_base & __io , char_type __fill ,
  55110. long double __units ) const ;
  55111. #1642
  55112. virtual iter_type
  55113. do_put ( iter_type __s , bool __intl , ios_base & __io , char_type __fill ,
  55114. const string_type & __digits ) const ;
  55115. #1653
  55116. template < bool _Intl >
  55117. iter_type
  55118. _M_insert ( iter_type __s , ios_base & __io , char_type __fill ,
  55119. const string_type & __digits ) const ;
  55120. } ;
  55121.  
  55122. template < typename _CharT , typename _OutIter >
  55123. locale :: id money_put < _CharT , _OutIter > :: id ;
  55124. #1668
  55125. struct messages_base
  55126. {
  55127. typedef int catalog ;
  55128. } ;
  55129. #1694
  55130. template < typename _CharT >
  55131. class messages : public locale :: facet , public messages_base
  55132. {
  55133. public :
  55134.  
  55135.  
  55136.  
  55137. typedef _CharT char_type ;
  55138. typedef basic_string < _CharT > string_type ;
  55139.  
  55140.  
  55141. protected :
  55142.  
  55143.  
  55144. __c_locale _M_c_locale_messages ;
  55145. const char * _M_name_messages ;
  55146.  
  55147. public :
  55148.  
  55149. static locale :: id id ;
  55150. #1722
  55151. explicit
  55152. messages ( size_t __refs = 0 ) ;
  55153. #1736
  55154. explicit
  55155. messages ( __c_locale __cloc , const char * __s , size_t __refs = 0 ) ;
  55156. #1749
  55157. catalog
  55158. open ( const basic_string < char > & __s , const locale & __loc ) const
  55159. { return this -> do_open ( __s , __loc ) ; }
  55160. #1767
  55161. catalog
  55162. open ( const basic_string < char > & , const locale & , const char * ) const ;
  55163. #1785
  55164. string_type
  55165. get ( catalog __c , int __set , int __msgid , const string_type & __s ) const
  55166. { return this -> do_get ( __c , __set , __msgid , __s ) ; }
  55167. #1796
  55168. void
  55169. close ( catalog __c ) const
  55170. { return this -> do_close ( __c ) ; }
  55171.  
  55172. protected :
  55173.  
  55174. virtual
  55175. ~ messages ( ) ;
  55176. #1816
  55177. virtual catalog
  55178. do_open ( const basic_string < char > & , const locale & ) const ;
  55179. #1835
  55180. virtual string_type
  55181. do_get ( catalog , int , int , const string_type & __dfault ) const ;
  55182. #1843
  55183. virtual void
  55184. do_close ( catalog ) const ;
  55185.  
  55186.  
  55187. char *
  55188. _M_convert_to_char ( const string_type & __msg ) const
  55189. {
  55190.  
  55191. return reinterpret_cast < char * > ( const_cast < _CharT * > ( __msg . c_str ( ) ) ) ;
  55192. }
  55193.  
  55194.  
  55195. string_type
  55196. _M_convert_from_char ( char * ) const
  55197. {
  55198.  
  55199. return string_type ( ) ;
  55200. }
  55201. } ;
  55202.  
  55203. template < typename _CharT >
  55204. locale :: id messages < _CharT > :: id ;
  55205.  
  55206.  
  55207. template < >
  55208. string
  55209. messages < char > :: do_get ( catalog , int , int , const string & ) const ;
  55210.  
  55211.  
  55212. template < >
  55213. wstring
  55214. messages < wchar_t > :: do_get ( catalog , int , int , const wstring & ) const ;
  55215.  
  55216.  
  55217.  
  55218. template < typename _CharT >
  55219. class messages_byname : public messages < _CharT >
  55220. {
  55221. public :
  55222. typedef _CharT char_type ;
  55223. typedef basic_string < _CharT > string_type ;
  55224.  
  55225. explicit
  55226. messages_byname ( const char * __s , size_t __refs = 0 ) ;
  55227.  
  55228. protected :
  55229. virtual
  55230. ~ messages_byname ( )
  55231. { }
  55232. } ;
  55233.  
  55234.  
  55235. }
  55236. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/i386-sun-solaris2.10/amd64/bits/messages_members.h"
  55237. #36
  55238. namespace std
  55239. {
  55240.  
  55241.  
  55242.  
  55243. template < typename _CharT >
  55244. messages < _CharT > :: messages ( size_t __refs )
  55245. : facet ( __refs )
  55246. { _M_c_locale_messages = _S_get_c_locale ( ) ; }
  55247.  
  55248. template < typename _CharT >
  55249. messages < _CharT > :: messages ( __c_locale , const char * , size_t __refs )
  55250. : facet ( __refs )
  55251. { _M_c_locale_messages = _S_get_c_locale ( ) ; }
  55252.  
  55253. template < typename _CharT >
  55254. typename messages < _CharT > :: catalog
  55255. messages < _CharT > :: open ( const basic_string < char > & __s , const locale & __loc ,
  55256. const char * ) const
  55257. { return this -> do_open ( __s , __loc ) ; }
  55258.  
  55259.  
  55260. template < typename _CharT >
  55261. messages < _CharT > :: ~ messages ( )
  55262. { _S_destroy_c_locale ( _M_c_locale_messages ) ; }
  55263.  
  55264. template < typename _CharT >
  55265. typename messages < _CharT > :: catalog
  55266. messages < _CharT > :: do_open ( const basic_string < char > & , const locale & ) const
  55267. { return 0 ; }
  55268.  
  55269. template < typename _CharT >
  55270. typename messages < _CharT > :: string_type
  55271. messages < _CharT > :: do_get ( catalog , int , int ,
  55272. const string_type & __dfault ) const
  55273. { return __dfault ; }
  55274.  
  55275. template < typename _CharT >
  55276. void
  55277. messages < _CharT > :: do_close ( catalog ) const
  55278. { }
  55279.  
  55280.  
  55281. template < typename _CharT >
  55282. messages_byname < _CharT > :: messages_byname ( const char * __s , size_t __refs )
  55283. : messages < _CharT > ( __refs )
  55284. {
  55285. if ( __builtin_strcmp ( __s , "C" ) != 0
  55286. && __builtin_strcmp ( __s , "POSIX" ) != 0 )
  55287. {
  55288. this -> _S_destroy_c_locale ( this -> _M_c_locale_messages ) ;
  55289. this -> _S_create_c_locale ( this -> _M_c_locale_messages , __s ) ;
  55290. }
  55291. }
  55292.  
  55293.  
  55294. }
  55295. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/codecvt.h"
  55296. #39
  55297. #pragma GCC system_header
  55298.  
  55299. namespace std
  55300. {
  55301.  
  55302.  
  55303.  
  55304. class codecvt_base
  55305. {
  55306. public :
  55307. enum result
  55308. {
  55309. ok ,
  55310. partial ,
  55311. error ,
  55312. noconv
  55313. } ;
  55314. } ;
  55315. #67
  55316. template < typename _InternT , typename _ExternT , typename _StateT >
  55317. class __codecvt_abstract_base
  55318. : public locale :: facet , public codecvt_base
  55319. {
  55320. public :
  55321.  
  55322. typedef codecvt_base :: result result ;
  55323. typedef _InternT intern_type ;
  55324. typedef _ExternT extern_type ;
  55325. typedef _StateT state_type ;
  55326. #115
  55327. result
  55328. out ( state_type & __state , const intern_type * __from ,
  55329. const intern_type * __from_end , const intern_type * & __from_next ,
  55330. extern_type * __to , extern_type * __to_end ,
  55331. extern_type * & __to_next ) const
  55332. {
  55333. return this -> do_out ( __state , __from , __from_end , __from_next ,
  55334. __to , __to_end , __to_next ) ;
  55335. }
  55336. #154
  55337. result
  55338. unshift ( state_type & __state , extern_type * __to , extern_type * __to_end ,
  55339. extern_type * & __to_next ) const
  55340. { return this -> do_unshift ( __state , __to , __to_end , __to_next ) ; }
  55341. #195
  55342. result
  55343. in ( state_type & __state , const extern_type * __from ,
  55344. const extern_type * __from_end , const extern_type * & __from_next ,
  55345. intern_type * __to , intern_type * __to_end ,
  55346. intern_type * & __to_next ) const
  55347. {
  55348. return this -> do_in ( __state , __from , __from_end , __from_next ,
  55349. __to , __to_end , __to_next ) ;
  55350. }
  55351.  
  55352. int
  55353. encoding ( ) const throw ( )
  55354. { return this -> do_encoding ( ) ; }
  55355.  
  55356. bool
  55357. always_noconv ( ) const throw ( )
  55358. { return this -> do_always_noconv ( ) ; }
  55359.  
  55360. int
  55361. length ( state_type & __state , const extern_type * __from ,
  55362. const extern_type * __end , size_t __max ) const
  55363. { return this -> do_length ( __state , __from , __end , __max ) ; }
  55364.  
  55365. int
  55366. max_length ( ) const throw ( )
  55367. { return this -> do_max_length ( ) ; }
  55368.  
  55369. protected :
  55370. explicit
  55371. __codecvt_abstract_base ( size_t __refs = 0 ) : locale :: facet ( __refs ) { }
  55372.  
  55373. virtual
  55374. ~ __codecvt_abstract_base ( ) { }
  55375. #236
  55376. virtual result
  55377. do_out ( state_type & __state , const intern_type * __from ,
  55378. const intern_type * __from_end , const intern_type * & __from_next ,
  55379. extern_type * __to , extern_type * __to_end ,
  55380. extern_type * & __to_next ) const = 0 ;
  55381.  
  55382. virtual result
  55383. do_unshift ( state_type & __state , extern_type * __to ,
  55384. extern_type * __to_end , extern_type * & __to_next ) const = 0 ;
  55385.  
  55386. virtual result
  55387. do_in ( state_type & __state , const extern_type * __from ,
  55388. const extern_type * __from_end , const extern_type * & __from_next ,
  55389. intern_type * __to , intern_type * __to_end ,
  55390. intern_type * & __to_next ) const = 0 ;
  55391.  
  55392. virtual int
  55393. do_encoding ( ) const throw ( ) = 0 ;
  55394.  
  55395. virtual bool
  55396. do_always_noconv ( ) const throw ( ) = 0 ;
  55397.  
  55398. virtual int
  55399. do_length ( state_type & , const extern_type * __from ,
  55400. const extern_type * __end , size_t __max ) const = 0 ;
  55401.  
  55402. virtual int
  55403. do_max_length ( ) const throw ( ) = 0 ;
  55404. } ;
  55405. #275
  55406. template < typename _InternT , typename _ExternT , typename _StateT >
  55407. class codecvt
  55408. : public __codecvt_abstract_base < _InternT , _ExternT , _StateT >
  55409. {
  55410. public :
  55411.  
  55412. typedef codecvt_base :: result result ;
  55413. typedef _InternT intern_type ;
  55414. typedef _ExternT extern_type ;
  55415. typedef _StateT state_type ;
  55416.  
  55417. protected :
  55418. __c_locale _M_c_locale_codecvt ;
  55419.  
  55420. public :
  55421. static locale :: id id ;
  55422.  
  55423. explicit
  55424. codecvt ( size_t __refs = 0 )
  55425. : __codecvt_abstract_base < _InternT , _ExternT , _StateT > ( __refs ) ,
  55426. _M_c_locale_codecvt ( 0 )
  55427. { }
  55428.  
  55429. explicit
  55430. codecvt ( __c_locale __cloc , size_t __refs = 0 ) ;
  55431.  
  55432. protected :
  55433. virtual
  55434. ~ codecvt ( ) { }
  55435.  
  55436. virtual result
  55437. do_out ( state_type & __state , const intern_type * __from ,
  55438. const intern_type * __from_end , const intern_type * & __from_next ,
  55439. extern_type * __to , extern_type * __to_end ,
  55440. extern_type * & __to_next ) const ;
  55441.  
  55442. virtual result
  55443. do_unshift ( state_type & __state , extern_type * __to ,
  55444. extern_type * __to_end , extern_type * & __to_next ) const ;
  55445.  
  55446. virtual result
  55447. do_in ( state_type & __state , const extern_type * __from ,
  55448. const extern_type * __from_end , const extern_type * & __from_next ,
  55449. intern_type * __to , intern_type * __to_end ,
  55450. intern_type * & __to_next ) const ;
  55451.  
  55452. virtual int
  55453. do_encoding ( ) const throw ( ) ;
  55454.  
  55455. virtual bool
  55456. do_always_noconv ( ) const throw ( ) ;
  55457.  
  55458. virtual int
  55459. do_length ( state_type & , const extern_type * __from ,
  55460. const extern_type * __end , size_t __max ) const ;
  55461.  
  55462. virtual int
  55463. do_max_length ( ) const throw ( ) ;
  55464. } ;
  55465.  
  55466. template < typename _InternT , typename _ExternT , typename _StateT >
  55467. locale :: id codecvt < _InternT , _ExternT , _StateT > :: id ;
  55468.  
  55469.  
  55470. template < >
  55471. class codecvt < char , char , mbstate_t >
  55472. : public __codecvt_abstract_base < char , char , mbstate_t >
  55473. {
  55474. public :
  55475.  
  55476. typedef char intern_type ;
  55477. typedef char extern_type ;
  55478. typedef mbstate_t state_type ;
  55479.  
  55480. protected :
  55481. __c_locale _M_c_locale_codecvt ;
  55482.  
  55483. public :
  55484. static locale :: id id ;
  55485.  
  55486. explicit
  55487. codecvt ( size_t __refs = 0 ) ;
  55488.  
  55489. explicit
  55490. codecvt ( __c_locale __cloc , size_t __refs = 0 ) ;
  55491.  
  55492. protected :
  55493. virtual
  55494. ~ codecvt ( ) ;
  55495.  
  55496. virtual result
  55497. do_out ( state_type & __state , const intern_type * __from ,
  55498. const intern_type * __from_end , const intern_type * & __from_next ,
  55499. extern_type * __to , extern_type * __to_end ,
  55500. extern_type * & __to_next ) const ;
  55501.  
  55502. virtual result
  55503. do_unshift ( state_type & __state , extern_type * __to ,
  55504. extern_type * __to_end , extern_type * & __to_next ) const ;
  55505.  
  55506. virtual result
  55507. do_in ( state_type & __state , const extern_type * __from ,
  55508. const extern_type * __from_end , const extern_type * & __from_next ,
  55509. intern_type * __to , intern_type * __to_end ,
  55510. intern_type * & __to_next ) const ;
  55511.  
  55512. virtual int
  55513. do_encoding ( ) const throw ( ) ;
  55514.  
  55515. virtual bool
  55516. do_always_noconv ( ) const throw ( ) ;
  55517.  
  55518. virtual int
  55519. do_length ( state_type & , const extern_type * __from ,
  55520. const extern_type * __end , size_t __max ) const ;
  55521.  
  55522. virtual int
  55523. do_max_length ( ) const throw ( ) ;
  55524. } ;
  55525.  
  55526.  
  55527.  
  55528. template < >
  55529. class codecvt < wchar_t , char , mbstate_t >
  55530. : public __codecvt_abstract_base < wchar_t , char , mbstate_t >
  55531. {
  55532. public :
  55533.  
  55534. typedef wchar_t intern_type ;
  55535. typedef char extern_type ;
  55536. typedef mbstate_t state_type ;
  55537.  
  55538. protected :
  55539. __c_locale _M_c_locale_codecvt ;
  55540.  
  55541. public :
  55542. static locale :: id id ;
  55543.  
  55544. explicit
  55545. codecvt ( size_t __refs = 0 ) ;
  55546.  
  55547. explicit
  55548. codecvt ( __c_locale __cloc , size_t __refs = 0 ) ;
  55549.  
  55550. protected :
  55551. virtual
  55552. ~ codecvt ( ) ;
  55553.  
  55554. virtual result
  55555. do_out ( state_type & __state , const intern_type * __from ,
  55556. const intern_type * __from_end , const intern_type * & __from_next ,
  55557. extern_type * __to , extern_type * __to_end ,
  55558. extern_type * & __to_next ) const ;
  55559.  
  55560. virtual result
  55561. do_unshift ( state_type & __state ,
  55562. extern_type * __to , extern_type * __to_end ,
  55563. extern_type * & __to_next ) const ;
  55564.  
  55565. virtual result
  55566. do_in ( state_type & __state ,
  55567. const extern_type * __from , const extern_type * __from_end ,
  55568. const extern_type * & __from_next ,
  55569. intern_type * __to , intern_type * __to_end ,
  55570. intern_type * & __to_next ) const ;
  55571.  
  55572. virtual
  55573. int do_encoding ( ) const throw ( ) ;
  55574.  
  55575. virtual
  55576. bool do_always_noconv ( ) const throw ( ) ;
  55577.  
  55578. virtual
  55579. int do_length ( state_type & , const extern_type * __from ,
  55580. const extern_type * __end , size_t __max ) const ;
  55581.  
  55582. virtual int
  55583. do_max_length ( ) const throw ( ) ;
  55584. } ;
  55585.  
  55586.  
  55587.  
  55588. template < typename _InternT , typename _ExternT , typename _StateT >
  55589. class codecvt_byname : public codecvt < _InternT , _ExternT , _StateT >
  55590. {
  55591. public :
  55592. explicit
  55593. codecvt_byname ( const char * __s , size_t __refs = 0 )
  55594. : codecvt < _InternT , _ExternT , _StateT > ( __refs )
  55595. {
  55596. if ( __builtin_strcmp ( __s , "C" ) != 0
  55597. && __builtin_strcmp ( __s , "POSIX" ) != 0 )
  55598. {
  55599. this -> _S_destroy_c_locale ( this -> _M_c_locale_codecvt ) ;
  55600. this -> _S_create_c_locale ( this -> _M_c_locale_codecvt , __s ) ;
  55601. }
  55602. }
  55603.  
  55604. protected :
  55605. virtual
  55606. ~ codecvt_byname ( ) { }
  55607. } ;
  55608.  
  55609.  
  55610.  
  55611.  
  55612. extern template class codecvt_byname < char , char , mbstate_t > ;
  55613.  
  55614. extern template
  55615. const codecvt < char , char , mbstate_t > &
  55616. use_facet < codecvt < char , char , mbstate_t > > ( const locale & ) ;
  55617.  
  55618. extern template
  55619. bool
  55620. has_facet < codecvt < char , char , mbstate_t > > ( const locale & ) ;
  55621.  
  55622.  
  55623. extern template class codecvt_byname < wchar_t , char , mbstate_t > ;
  55624.  
  55625. extern template
  55626. const codecvt < wchar_t , char , mbstate_t > &
  55627. use_facet < codecvt < wchar_t , char , mbstate_t > > ( const locale & ) ;
  55628.  
  55629. extern template
  55630. bool
  55631. has_facet < codecvt < wchar_t , char , mbstate_t > > ( const locale & ) ;
  55632.  
  55633.  
  55634.  
  55635.  
  55636. }
  55637. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets_nonio.tcc"
  55638. #33
  55639. #pragma GCC system_header
  55640.  
  55641. namespace std
  55642. {
  55643.  
  55644.  
  55645. template < typename _CharT , bool _Intl >
  55646. struct __use_cache < __moneypunct_cache < _CharT , _Intl > >
  55647. {
  55648. const __moneypunct_cache < _CharT , _Intl > *
  55649. operator ( ) ( const locale & __loc ) const
  55650. {
  55651. const size_t __i = moneypunct < _CharT , _Intl > :: id . _M_id ( ) ;
  55652. const locale :: facet * * __caches = __loc . _M_impl -> _M_caches ;
  55653. if ( ! __caches [ __i ] )
  55654. {
  55655. __moneypunct_cache < _CharT , _Intl > * __tmp = 0 ;
  55656. try
  55657. {
  55658. __tmp = new __moneypunct_cache < _CharT , _Intl > ;
  55659. __tmp -> _M_cache ( __loc ) ;
  55660. }
  55661. catch ( ... )
  55662. {
  55663. delete __tmp ;
  55664. throw ;
  55665. }
  55666. __loc . _M_impl -> _M_install_cache ( __tmp , __i ) ;
  55667. }
  55668. return static_cast <
  55669. const __moneypunct_cache < _CharT , _Intl > * > ( __caches [ __i ] ) ;
  55670. }
  55671. } ;
  55672.  
  55673. template < typename _CharT , bool _Intl >
  55674. void
  55675. __moneypunct_cache < _CharT , _Intl > :: _M_cache ( const locale & __loc )
  55676. {
  55677. _M_allocated = true ;
  55678.  
  55679. const moneypunct < _CharT , _Intl > & __mp =
  55680. use_facet < moneypunct < _CharT , _Intl > > ( __loc ) ;
  55681.  
  55682. _M_decimal_point = __mp . decimal_point ( ) ;
  55683. _M_thousands_sep = __mp . thousands_sep ( ) ;
  55684. _M_frac_digits = __mp . frac_digits ( ) ;
  55685.  
  55686. char * __grouping = 0 ;
  55687. _CharT * __curr_symbol = 0 ;
  55688. _CharT * __positive_sign = 0 ;
  55689. _CharT * __negative_sign = 0 ;
  55690. try
  55691. {
  55692. _M_grouping_size = __mp . grouping ( ) . size ( ) ;
  55693. __grouping = new char [ _M_grouping_size ] ;
  55694. __mp . grouping ( ) . copy ( __grouping , _M_grouping_size ) ;
  55695. _M_grouping = __grouping ;
  55696. _M_use_grouping = ( _M_grouping_size
  55697. && static_cast < signed char > ( _M_grouping [ 0 ] ) > 0
  55698. && ( _M_grouping [ 0 ]
  55699. != __gnu_cxx :: __numeric_traits < char > :: __max ) ) ;
  55700.  
  55701. _M_curr_symbol_size = __mp . curr_symbol ( ) . size ( ) ;
  55702. __curr_symbol = new _CharT [ _M_curr_symbol_size ] ;
  55703. __mp . curr_symbol ( ) . copy ( __curr_symbol , _M_curr_symbol_size ) ;
  55704. _M_curr_symbol = __curr_symbol ;
  55705.  
  55706. _M_positive_sign_size = __mp . positive_sign ( ) . size ( ) ;
  55707. __positive_sign = new _CharT [ _M_positive_sign_size ] ;
  55708. __mp . positive_sign ( ) . copy ( __positive_sign , _M_positive_sign_size ) ;
  55709. _M_positive_sign = __positive_sign ;
  55710.  
  55711. _M_negative_sign_size = __mp . negative_sign ( ) . size ( ) ;
  55712. __negative_sign = new _CharT [ _M_negative_sign_size ] ;
  55713. __mp . negative_sign ( ) . copy ( __negative_sign , _M_negative_sign_size ) ;
  55714. _M_negative_sign = __negative_sign ;
  55715.  
  55716. _M_pos_format = __mp . pos_format ( ) ;
  55717. _M_neg_format = __mp . neg_format ( ) ;
  55718.  
  55719. const ctype < _CharT > & __ct = use_facet < ctype < _CharT > > ( __loc ) ;
  55720. __ct . widen ( money_base :: _S_atoms ,
  55721. money_base :: _S_atoms + money_base :: _S_end , _M_atoms ) ;
  55722. }
  55723. catch ( ... )
  55724. {
  55725. delete [ ] __grouping ;
  55726. delete [ ] __curr_symbol ;
  55727. delete [ ] __positive_sign ;
  55728. delete [ ] __negative_sign ;
  55729. throw ;
  55730. }
  55731. }
  55732.  
  55733.  
  55734.  
  55735. template < typename _CharT , typename _InIter >
  55736. template < bool _Intl >
  55737. _InIter
  55738. money_get < _CharT , _InIter > ::
  55739. _M_extract ( iter_type __beg , iter_type __end , ios_base & __io ,
  55740. ios_base :: iostate & __err , string & __units ) const
  55741. {
  55742. typedef char_traits < _CharT > __traits_type ;
  55743. typedef typename string_type :: size_type size_type ;
  55744. typedef money_base :: part part ;
  55745. typedef __moneypunct_cache < _CharT , _Intl > __cache_type ;
  55746.  
  55747. const locale & __loc = __io . _M_getloc ( ) ;
  55748. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  55749.  
  55750. __use_cache < __cache_type > __uc ;
  55751. const __cache_type * __lc = __uc ( __loc ) ;
  55752. const char_type * __lit = __lc -> _M_atoms ;
  55753.  
  55754.  
  55755. bool __negative = false ;
  55756.  
  55757. size_type __sign_size = 0 ;
  55758.  
  55759. const bool __mandatory_sign = ( __lc -> _M_positive_sign_size
  55760. && __lc -> _M_negative_sign_size ) ;
  55761.  
  55762. string __grouping_tmp ;
  55763. if ( __lc -> _M_use_grouping )
  55764. __grouping_tmp . reserve ( 32 ) ;
  55765.  
  55766. int __last_pos = 0 ;
  55767.  
  55768. int __n = 0 ;
  55769.  
  55770. bool __testvalid = true ;
  55771.  
  55772. bool __testdecfound = false ;
  55773.  
  55774.  
  55775. string __res ;
  55776. __res . reserve ( 32 ) ;
  55777.  
  55778. const char_type * __lit_zero = __lit + money_base :: _S_zero ;
  55779. const money_base :: pattern __p = __lc -> _M_neg_format ;
  55780. for ( int __i = 0 ; __i < 4 && __testvalid ; ++ __i )
  55781. {
  55782. const part __which = static_cast < part > ( __p . field [ __i ] ) ;
  55783. switch ( __which )
  55784. {
  55785. case money_base :: symbol :
  55786.  
  55787.  
  55788.  
  55789.  
  55790. if ( __io . flags ( ) & ios_base :: showbase || __sign_size > 1
  55791. || __i == 0
  55792. || ( __i == 1 && ( __mandatory_sign
  55793. || ( static_cast < part > ( __p . field [ 0 ] )
  55794. == money_base :: sign )
  55795. || ( static_cast < part > ( __p . field [ 2 ] )
  55796. == money_base :: space ) ) )
  55797. || ( __i == 2 && ( ( static_cast < part > ( __p . field [ 3 ] )
  55798. == money_base :: value )
  55799. || ( __mandatory_sign
  55800. && ( static_cast < part > ( __p . field [ 3 ] )
  55801. == money_base :: sign ) ) ) ) )
  55802. {
  55803. const size_type __len = __lc -> _M_curr_symbol_size ;
  55804. size_type __j = 0 ;
  55805. for ( ; __beg != __end && __j < __len
  55806. && * __beg == __lc -> _M_curr_symbol [ __j ] ;
  55807. ++ __beg , ++ __j ) ;
  55808. if ( __j != __len
  55809. && ( __j || __io . flags ( ) & ios_base :: showbase ) )
  55810. __testvalid = false ;
  55811. }
  55812. break ;
  55813. case money_base :: sign :
  55814.  
  55815. if ( __lc -> _M_positive_sign_size && __beg != __end
  55816. && * __beg == __lc -> _M_positive_sign [ 0 ] )
  55817. {
  55818. __sign_size = __lc -> _M_positive_sign_size ;
  55819. ++ __beg ;
  55820. }
  55821. else if ( __lc -> _M_negative_sign_size && __beg != __end
  55822. && * __beg == __lc -> _M_negative_sign [ 0 ] )
  55823. {
  55824. __negative = true ;
  55825. __sign_size = __lc -> _M_negative_sign_size ;
  55826. ++ __beg ;
  55827. }
  55828. else if ( __lc -> _M_positive_sign_size
  55829. && ! __lc -> _M_negative_sign_size )
  55830.  
  55831.  
  55832. __negative = true ;
  55833. else if ( __mandatory_sign )
  55834. __testvalid = false ;
  55835. break ;
  55836. case money_base :: value :
  55837.  
  55838.  
  55839. for ( ; __beg != __end ; ++ __beg )
  55840. {
  55841. const char_type __c = * __beg ;
  55842. const char_type * __q = __traits_type :: find ( __lit_zero ,
  55843. 10 , __c ) ;
  55844. if ( __q != 0 )
  55845. {
  55846. __res += money_base :: _S_atoms [ __q - __lit ] ;
  55847. ++ __n ;
  55848. }
  55849. else if ( __c == __lc -> _M_decimal_point
  55850. && ! __testdecfound )
  55851. {
  55852. if ( __lc -> _M_frac_digits <= 0 )
  55853. break ;
  55854.  
  55855. __last_pos = __n ;
  55856. __n = 0 ;
  55857. __testdecfound = true ;
  55858. }
  55859. else if ( __lc -> _M_use_grouping
  55860. && __c == __lc -> _M_thousands_sep
  55861. && ! __testdecfound )
  55862. {
  55863. if ( __n )
  55864. {
  55865.  
  55866. __grouping_tmp += static_cast < char > ( __n ) ;
  55867. __n = 0 ;
  55868. }
  55869. else
  55870. {
  55871. __testvalid = false ;
  55872. break ;
  55873. }
  55874. }
  55875. else
  55876. break ;
  55877. }
  55878. if ( __res . empty ( ) )
  55879. __testvalid = false ;
  55880. break ;
  55881. case money_base :: space :
  55882.  
  55883. if ( __beg != __end && __ctype . is ( ctype_base :: space , * __beg ) )
  55884. ++ __beg ;
  55885. else
  55886. __testvalid = false ;
  55887. case money_base :: none :
  55888.  
  55889. if ( __i != 3 )
  55890. for ( ; __beg != __end
  55891. && __ctype . is ( ctype_base :: space , * __beg ) ; ++ __beg ) ;
  55892. break ;
  55893. }
  55894. }
  55895.  
  55896.  
  55897. if ( __sign_size > 1 && __testvalid )
  55898. {
  55899. const char_type * __sign = __negative ? __lc -> _M_negative_sign
  55900. : __lc -> _M_positive_sign ;
  55901. size_type __i = 1 ;
  55902. for ( ; __beg != __end && __i < __sign_size
  55903. && * __beg == __sign [ __i ] ; ++ __beg , ++ __i ) ;
  55904.  
  55905. if ( __i != __sign_size )
  55906. __testvalid = false ;
  55907. }
  55908.  
  55909. if ( __testvalid )
  55910. {
  55911.  
  55912. if ( __res . size ( ) > 1 )
  55913. {
  55914. const size_type __first = __res . find_first_not_of ( '0' ) ;
  55915. const bool __only_zeros = __first == string :: npos ;
  55916. if ( __first )
  55917. __res . erase ( 0 , __only_zeros ? __res . size ( ) - 1 : __first ) ;
  55918. }
  55919.  
  55920.  
  55921. if ( __negative && __res [ 0 ] != '0' )
  55922. __res . insert ( __res . begin ( ) , '-' ) ;
  55923.  
  55924.  
  55925. if ( __grouping_tmp . size ( ) )
  55926. {
  55927.  
  55928. __grouping_tmp += static_cast < char > ( __testdecfound ? __last_pos
  55929. : __n ) ;
  55930. if ( ! std :: __verify_grouping ( __lc -> _M_grouping ,
  55931. __lc -> _M_grouping_size ,
  55932. __grouping_tmp ) )
  55933. __err |= ios_base :: failbit ;
  55934. }
  55935.  
  55936.  
  55937. if ( __testdecfound && __n != __lc -> _M_frac_digits )
  55938. __testvalid = false ;
  55939. }
  55940.  
  55941.  
  55942. if ( ! __testvalid )
  55943. __err |= ios_base :: failbit ;
  55944. else
  55945. __units . swap ( __res ) ;
  55946.  
  55947.  
  55948. if ( __beg == __end )
  55949. __err |= ios_base :: eofbit ;
  55950. return __beg ;
  55951. }
  55952. #362
  55953. template < typename _CharT , typename _InIter >
  55954. _InIter
  55955. money_get < _CharT , _InIter > ::
  55956. do_get ( iter_type __beg , iter_type __end , bool __intl , ios_base & __io ,
  55957. ios_base :: iostate & __err , long double & __units ) const
  55958. {
  55959. string __str ;
  55960. __beg = __intl ? _M_extract < true > ( __beg , __end , __io , __err , __str )
  55961. : _M_extract < false > ( __beg , __end , __io , __err , __str ) ;
  55962. std :: __convert_to_v ( __str . c_str ( ) , __units , __err , _S_get_c_locale ( ) ) ;
  55963. return __beg ;
  55964. }
  55965.  
  55966. template < typename _CharT , typename _InIter >
  55967. _InIter
  55968. money_get < _CharT , _InIter > ::
  55969. do_get ( iter_type __beg , iter_type __end , bool __intl , ios_base & __io ,
  55970. ios_base :: iostate & __err , string_type & __digits ) const
  55971. {
  55972. typedef typename string :: size_type size_type ;
  55973.  
  55974. const locale & __loc = __io . _M_getloc ( ) ;
  55975. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  55976.  
  55977. string __str ;
  55978. __beg = __intl ? _M_extract < true > ( __beg , __end , __io , __err , __str )
  55979. : _M_extract < false > ( __beg , __end , __io , __err , __str ) ;
  55980. const size_type __len = __str . size ( ) ;
  55981. if ( __len )
  55982. {
  55983. __digits . resize ( __len ) ;
  55984. __ctype . widen ( __str . data ( ) , __str . data ( ) + __len , & __digits [ 0 ] ) ;
  55985. }
  55986. return __beg ;
  55987. }
  55988.  
  55989. template < typename _CharT , typename _OutIter >
  55990. template < bool _Intl >
  55991. _OutIter
  55992. money_put < _CharT , _OutIter > ::
  55993. _M_insert ( iter_type __s , ios_base & __io , char_type __fill ,
  55994. const string_type & __digits ) const
  55995. {
  55996. typedef typename string_type :: size_type size_type ;
  55997. typedef money_base :: part part ;
  55998. typedef __moneypunct_cache < _CharT , _Intl > __cache_type ;
  55999.  
  56000. const locale & __loc = __io . _M_getloc ( ) ;
  56001. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56002.  
  56003. __use_cache < __cache_type > __uc ;
  56004. const __cache_type * __lc = __uc ( __loc ) ;
  56005. const char_type * __lit = __lc -> _M_atoms ;
  56006.  
  56007.  
  56008.  
  56009. const char_type * __beg = __digits . data ( ) ;
  56010.  
  56011. money_base :: pattern __p ;
  56012. const char_type * __sign ;
  56013. size_type __sign_size ;
  56014. if ( ! ( * __beg == __lit [ money_base :: _S_minus ] ) )
  56015. {
  56016. __p = __lc -> _M_pos_format ;
  56017. __sign = __lc -> _M_positive_sign ;
  56018. __sign_size = __lc -> _M_positive_sign_size ;
  56019. }
  56020. else
  56021. {
  56022. __p = __lc -> _M_neg_format ;
  56023. __sign = __lc -> _M_negative_sign ;
  56024. __sign_size = __lc -> _M_negative_sign_size ;
  56025. if ( __digits . size ( ) )
  56026. ++ __beg ;
  56027. }
  56028.  
  56029.  
  56030. size_type __len = __ctype . scan_not ( ctype_base :: digit , __beg ,
  56031. __beg + __digits . size ( ) ) - __beg ;
  56032. if ( __len )
  56033. {
  56034.  
  56035.  
  56036.  
  56037. string_type __value ;
  56038. __value . reserve ( 2 * __len ) ;
  56039.  
  56040.  
  56041.  
  56042. long __paddec = __len - __lc -> _M_frac_digits ;
  56043. if ( __paddec > 0 )
  56044. {
  56045. if ( __lc -> _M_frac_digits < 0 )
  56046. __paddec = __len ;
  56047. if ( __lc -> _M_grouping_size )
  56048. {
  56049. __value . assign ( 2 * __paddec , char_type ( ) ) ;
  56050. _CharT * __vend =
  56051. std :: __add_grouping ( & __value [ 0 ] , __lc -> _M_thousands_sep ,
  56052. __lc -> _M_grouping ,
  56053. __lc -> _M_grouping_size ,
  56054. __beg , __beg + __paddec ) ;
  56055. __value . erase ( __vend - & __value [ 0 ] ) ;
  56056. }
  56057. else
  56058. __value . assign ( __beg , __paddec ) ;
  56059. }
  56060.  
  56061.  
  56062. if ( __lc -> _M_frac_digits > 0 )
  56063. {
  56064. __value += __lc -> _M_decimal_point ;
  56065. if ( __paddec >= 0 )
  56066. __value . append ( __beg + __paddec , __lc -> _M_frac_digits ) ;
  56067. else
  56068. {
  56069.  
  56070. __value . append ( - __paddec , __lit [ money_base :: _S_zero ] ) ;
  56071. __value . append ( __beg , __len ) ;
  56072. }
  56073. }
  56074.  
  56075.  
  56076. const ios_base :: fmtflags __f = __io . flags ( )
  56077. & ios_base :: adjustfield ;
  56078. __len = __value . size ( ) + __sign_size ;
  56079. __len += ( ( __io . flags ( ) & ios_base :: showbase )
  56080. ? __lc -> _M_curr_symbol_size : 0 ) ;
  56081.  
  56082. string_type __res ;
  56083. __res . reserve ( 2 * __len ) ;
  56084.  
  56085. const size_type __width = static_cast < size_type > ( __io . width ( ) ) ;
  56086. const bool __testipad = ( __f == ios_base :: internal
  56087. && __len < __width ) ;
  56088.  
  56089. for ( int __i = 0 ; __i < 4 ; ++ __i )
  56090. {
  56091. const part __which = static_cast < part > ( __p . field [ __i ] ) ;
  56092. switch ( __which )
  56093. {
  56094. case money_base :: symbol :
  56095. if ( __io . flags ( ) & ios_base :: showbase )
  56096. __res . append ( __lc -> _M_curr_symbol ,
  56097. __lc -> _M_curr_symbol_size ) ;
  56098. break ;
  56099. case money_base :: sign :
  56100.  
  56101.  
  56102.  
  56103. if ( __sign_size )
  56104. __res += __sign [ 0 ] ;
  56105. break ;
  56106. case money_base :: value :
  56107. __res += __value ;
  56108. break ;
  56109. case money_base :: space :
  56110.  
  56111.  
  56112.  
  56113. if ( __testipad )
  56114. __res . append ( __width - __len , __fill ) ;
  56115. else
  56116. __res += __fill ;
  56117. break ;
  56118. case money_base :: none :
  56119. if ( __testipad )
  56120. __res . append ( __width - __len , __fill ) ;
  56121. break ;
  56122. }
  56123. }
  56124.  
  56125.  
  56126. if ( __sign_size > 1 )
  56127. __res . append ( __sign + 1 , __sign_size - 1 ) ;
  56128.  
  56129.  
  56130. __len = __res . size ( ) ;
  56131. if ( __width > __len )
  56132. {
  56133. if ( __f == ios_base :: left )
  56134.  
  56135. __res . append ( __width - __len , __fill ) ;
  56136. else
  56137.  
  56138. __res . insert ( 0 , __width - __len , __fill ) ;
  56139. __len = __width ;
  56140. }
  56141.  
  56142.  
  56143. __s = std :: __write ( __s , __res . data ( ) , __len ) ;
  56144. }
  56145. __io . width ( 0 ) ;
  56146. return __s ;
  56147. }
  56148. #567
  56149. template < typename _CharT , typename _OutIter >
  56150. _OutIter
  56151. money_put < _CharT , _OutIter > ::
  56152. do_put ( iter_type __s , bool __intl , ios_base & __io , char_type __fill ,
  56153. long double __units ) const
  56154. {
  56155. const locale __loc = __io . getloc ( ) ;
  56156. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56157.  
  56158.  
  56159. int __cs_size = 64 ;
  56160. char * __cs = static_cast < char * > ( __builtin_alloca ( __cs_size ) ) ;
  56161.  
  56162.  
  56163. int __len = std :: __convert_from_v ( _S_get_c_locale ( ) , __cs , __cs_size ,
  56164. "%.*Lf" , 0 , __units ) ;
  56165.  
  56166. if ( __len >= __cs_size )
  56167. {
  56168. __cs_size = __len + 1 ;
  56169. __cs = static_cast < char * > ( __builtin_alloca ( __cs_size ) ) ;
  56170. __len = std :: __convert_from_v ( _S_get_c_locale ( ) , __cs , __cs_size ,
  56171. "%.*Lf" , 0 , __units ) ;
  56172. }
  56173. #599
  56174. string_type __digits ( __len , char_type ( ) ) ;
  56175. __ctype . widen ( __cs , __cs + __len , & __digits [ 0 ] ) ;
  56176. return __intl ? _M_insert < true > ( __s , __io , __fill , __digits )
  56177. : _M_insert < false > ( __s , __io , __fill , __digits ) ;
  56178. }
  56179.  
  56180. template < typename _CharT , typename _OutIter >
  56181. _OutIter
  56182. money_put < _CharT , _OutIter > ::
  56183. do_put ( iter_type __s , bool __intl , ios_base & __io , char_type __fill ,
  56184. const string_type & __digits ) const
  56185. { return __intl ? _M_insert < true > ( __s , __io , __fill , __digits )
  56186. : _M_insert < false > ( __s , __io , __fill , __digits ) ; }
  56187. #618
  56188. template < typename _CharT , typename _InIter >
  56189. time_base :: dateorder
  56190. time_get < _CharT , _InIter > :: do_date_order ( ) const
  56191. { return time_base :: no_order ; }
  56192.  
  56193.  
  56194.  
  56195. template < typename _CharT , typename _InIter >
  56196. _InIter
  56197. time_get < _CharT , _InIter > ::
  56198. _M_extract_via_format ( iter_type __beg , iter_type __end , ios_base & __io ,
  56199. ios_base :: iostate & __err , tm * __tm ,
  56200. const _CharT * __format ) const
  56201. {
  56202. const locale & __loc = __io . _M_getloc ( ) ;
  56203. const __timepunct < _CharT > & __tp = use_facet < __timepunct < _CharT > > ( __loc ) ;
  56204. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56205. const size_t __len = char_traits < _CharT > :: length ( __format ) ;
  56206.  
  56207. ios_base :: iostate __tmperr = ios_base :: goodbit ;
  56208. size_t __i = 0 ;
  56209. for ( ; __beg != __end && __i < __len && ! __tmperr ; ++ __i )
  56210. {
  56211. if ( __ctype . narrow ( __format [ __i ] , 0 ) == '%' )
  56212. {
  56213.  
  56214. char __c = __ctype . narrow ( __format [ ++ __i ] , 0 ) ;
  56215. int __mem = 0 ;
  56216. if ( __c == 'E' || __c == 'O' )
  56217. __c = __ctype . narrow ( __format [ ++ __i ] , 0 ) ;
  56218. switch ( __c )
  56219. {
  56220. const char * __cs ;
  56221. _CharT __wcs [ 10 ] ;
  56222. case 'a' :
  56223.  
  56224. const char_type * __days1 [ 7 ] ;
  56225. __tp . _M_days_abbreviated ( __days1 ) ;
  56226. __beg = _M_extract_name ( __beg , __end , __tm -> tm_wday , __days1 ,
  56227. 7 , __io , __tmperr ) ;
  56228. break ;
  56229. case 'A' :
  56230.  
  56231. const char_type * __days2 [ 7 ] ;
  56232. __tp . _M_days ( __days2 ) ;
  56233. __beg = _M_extract_name ( __beg , __end , __tm -> tm_wday , __days2 ,
  56234. 7 , __io , __tmperr ) ;
  56235. break ;
  56236. case 'h' :
  56237. case 'b' :
  56238.  
  56239. const char_type * __months1 [ 12 ] ;
  56240. __tp . _M_months_abbreviated ( __months1 ) ;
  56241. __beg = _M_extract_name ( __beg , __end , __tm -> tm_mon ,
  56242. __months1 , 12 , __io , __tmperr ) ;
  56243. break ;
  56244. case 'B' :
  56245.  
  56246. const char_type * __months2 [ 12 ] ;
  56247. __tp . _M_months ( __months2 ) ;
  56248. __beg = _M_extract_name ( __beg , __end , __tm -> tm_mon ,
  56249. __months2 , 12 , __io , __tmperr ) ;
  56250. break ;
  56251. case 'c' :
  56252.  
  56253. const char_type * __dt [ 2 ] ;
  56254. __tp . _M_date_time_formats ( __dt ) ;
  56255. __beg = _M_extract_via_format ( __beg , __end , __io , __tmperr ,
  56256. __tm , __dt [ 0 ] ) ;
  56257. break ;
  56258. case 'd' :
  56259.  
  56260. __beg = _M_extract_num ( __beg , __end , __tm -> tm_mday , 1 , 31 , 2 ,
  56261. __io , __tmperr ) ;
  56262. break ;
  56263. case 'e' :
  56264.  
  56265.  
  56266. if ( __ctype . is ( ctype_base :: space , * __beg ) )
  56267. __beg = _M_extract_num ( ++ __beg , __end , __tm -> tm_mday , 1 , 9 ,
  56268. 1 , __io , __tmperr ) ;
  56269. else
  56270. __beg = _M_extract_num ( __beg , __end , __tm -> tm_mday , 10 , 31 ,
  56271. 2 , __io , __tmperr ) ;
  56272. break ;
  56273. case 'D' :
  56274.  
  56275. __cs = "%m/%d/%y" ;
  56276. __ctype . widen ( __cs , __cs + 9 , __wcs ) ;
  56277. __beg = _M_extract_via_format ( __beg , __end , __io , __tmperr ,
  56278. __tm , __wcs ) ;
  56279. break ;
  56280. case 'H' :
  56281.  
  56282. __beg = _M_extract_num ( __beg , __end , __tm -> tm_hour , 0 , 23 , 2 ,
  56283. __io , __tmperr ) ;
  56284. break ;
  56285. case 'I' :
  56286.  
  56287. __beg = _M_extract_num ( __beg , __end , __tm -> tm_hour , 1 , 12 , 2 ,
  56288. __io , __tmperr ) ;
  56289. break ;
  56290. case 'm' :
  56291.  
  56292. __beg = _M_extract_num ( __beg , __end , __mem , 1 , 12 , 2 ,
  56293. __io , __tmperr ) ;
  56294. if ( ! __tmperr )
  56295. __tm -> tm_mon = __mem - 1 ;
  56296. break ;
  56297. case 'M' :
  56298.  
  56299. __beg = _M_extract_num ( __beg , __end , __tm -> tm_min , 0 , 59 , 2 ,
  56300. __io , __tmperr ) ;
  56301. break ;
  56302. case 'n' :
  56303. if ( __ctype . narrow ( * __beg , 0 ) == '\n' )
  56304. ++ __beg ;
  56305. else
  56306. __tmperr |= ios_base :: failbit ;
  56307. break ;
  56308. case 'R' :
  56309.  
  56310. __cs = "%H:%M" ;
  56311. __ctype . widen ( __cs , __cs + 6 , __wcs ) ;
  56312. __beg = _M_extract_via_format ( __beg , __end , __io , __tmperr ,
  56313. __tm , __wcs ) ;
  56314. break ;
  56315. case 'S' :
  56316.  
  56317.  
  56318.  
  56319. __beg = _M_extract_num ( __beg , __end , __tm -> tm_sec , 0 , 60 , 2 ,
  56320.  
  56321.  
  56322.  
  56323. __io , __tmperr ) ;
  56324. break ;
  56325. case 't' :
  56326. if ( __ctype . narrow ( * __beg , 0 ) == '\t' )
  56327. ++ __beg ;
  56328. else
  56329. __tmperr |= ios_base :: failbit ;
  56330. break ;
  56331. case 'T' :
  56332.  
  56333. __cs = "%H:%M:%S" ;
  56334. __ctype . widen ( __cs , __cs + 9 , __wcs ) ;
  56335. __beg = _M_extract_via_format ( __beg , __end , __io , __tmperr ,
  56336. __tm , __wcs ) ;
  56337. break ;
  56338. case 'x' :
  56339.  
  56340. const char_type * __dates [ 2 ] ;
  56341. __tp . _M_date_formats ( __dates ) ;
  56342. __beg = _M_extract_via_format ( __beg , __end , __io , __tmperr ,
  56343. __tm , __dates [ 0 ] ) ;
  56344. break ;
  56345. case 'X' :
  56346.  
  56347. const char_type * __times [ 2 ] ;
  56348. __tp . _M_time_formats ( __times ) ;
  56349. __beg = _M_extract_via_format ( __beg , __end , __io , __tmperr ,
  56350. __tm , __times [ 0 ] ) ;
  56351. break ;
  56352. case 'y' :
  56353. case 'C' :
  56354.  
  56355. case 'Y' :
  56356.  
  56357.  
  56358.  
  56359.  
  56360. __beg = _M_extract_num ( __beg , __end , __mem , 0 , 9999 , 4 ,
  56361. __io , __tmperr ) ;
  56362. if ( ! __tmperr )
  56363. __tm -> tm_year = __mem < 0 ? __mem + 100 : __mem - 1900 ;
  56364. break ;
  56365. case 'Z' :
  56366.  
  56367. if ( __ctype . is ( ctype_base :: upper , * __beg ) )
  56368. {
  56369. int __tmp ;
  56370. __beg = _M_extract_name ( __beg , __end , __tmp ,
  56371. __timepunct_cache < _CharT > :: _S_timezones ,
  56372. 14 , __io , __tmperr ) ;
  56373.  
  56374.  
  56375. if ( __beg != __end && ! __tmperr && __tmp == 0
  56376. && ( * __beg == __ctype . widen ( '-' )
  56377. || * __beg == __ctype . widen ( '+' ) ) )
  56378. {
  56379. __beg = _M_extract_num ( __beg , __end , __tmp , 0 , 23 , 2 ,
  56380. __io , __tmperr ) ;
  56381. __beg = _M_extract_num ( __beg , __end , __tmp , 0 , 59 , 2 ,
  56382. __io , __tmperr ) ;
  56383. }
  56384. }
  56385. else
  56386. __tmperr |= ios_base :: failbit ;
  56387. break ;
  56388. default :
  56389.  
  56390. __tmperr |= ios_base :: failbit ;
  56391. }
  56392. }
  56393. else
  56394. {
  56395.  
  56396. if ( __format [ __i ] == * __beg )
  56397. ++ __beg ;
  56398. else
  56399. __tmperr |= ios_base :: failbit ;
  56400. }
  56401. }
  56402.  
  56403. if ( __tmperr || __i != __len )
  56404. __err |= ios_base :: failbit ;
  56405.  
  56406. return __beg ;
  56407. }
  56408.  
  56409. template < typename _CharT , typename _InIter >
  56410. _InIter
  56411. time_get < _CharT , _InIter > ::
  56412. _M_extract_num ( iter_type __beg , iter_type __end , int & __member ,
  56413. int __min , int __max , size_t __len ,
  56414. ios_base & __io , ios_base :: iostate & __err ) const
  56415. {
  56416. const locale & __loc = __io . _M_getloc ( ) ;
  56417. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56418.  
  56419.  
  56420. int __mult = __len == 2 ? 10 : ( __len == 4 ? 1000 : 1 ) ;
  56421.  
  56422. ++ __min ;
  56423. size_t __i = 0 ;
  56424. int __value = 0 ;
  56425. for ( ; __beg != __end && __i < __len ; ++ __beg , ++ __i )
  56426. {
  56427. const char __c = __ctype . narrow ( * __beg , '*' ) ;
  56428. if ( __c >= '0' && __c <= '9' )
  56429. {
  56430. __value = __value * 10 + ( __c - '0' ) ;
  56431. const int __valuec = __value * __mult ;
  56432. if ( __valuec > __max || __valuec + __mult < __min )
  56433. break ;
  56434. __mult /= 10 ;
  56435. }
  56436. else
  56437. break ;
  56438. }
  56439. if ( __i == __len )
  56440. __member = __value ;
  56441.  
  56442. else if ( __len == 4 && __i == 2 )
  56443. __member = __value - 100 ;
  56444. else
  56445. __err |= ios_base :: failbit ;
  56446.  
  56447. return __beg ;
  56448. }
  56449.  
  56450.  
  56451.  
  56452. template < typename _CharT , typename _InIter >
  56453. _InIter
  56454. time_get < _CharT , _InIter > ::
  56455. _M_extract_name ( iter_type __beg , iter_type __end , int & __member ,
  56456. const _CharT * * __names , size_t __indexlen ,
  56457. ios_base & __io , ios_base :: iostate & __err ) const
  56458. {
  56459. typedef char_traits < _CharT > __traits_type ;
  56460. const locale & __loc = __io . _M_getloc ( ) ;
  56461. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56462.  
  56463. int * __matches = static_cast < int * > ( __builtin_alloca ( sizeof ( int )
  56464. * __indexlen ) ) ;
  56465. size_t __nmatches = 0 ;
  56466. size_t __pos = 0 ;
  56467. bool __testvalid = true ;
  56468. const char_type * __name ;
  56469.  
  56470.  
  56471.  
  56472.  
  56473.  
  56474. if ( __beg != __end )
  56475. {
  56476. const char_type __c = * __beg ;
  56477. for ( size_t __i1 = 0 ; __i1 < __indexlen ; ++ __i1 )
  56478. if ( __c == __names [ __i1 ] [ 0 ]
  56479. || __c == __ctype . toupper ( __names [ __i1 ] [ 0 ] ) )
  56480. __matches [ __nmatches ++ ] = __i1 ;
  56481. }
  56482.  
  56483. while ( __nmatches > 1 )
  56484. {
  56485.  
  56486. size_t __minlen = __traits_type :: length ( __names [ __matches [ 0 ] ] ) ;
  56487. for ( size_t __i2 = 1 ; __i2 < __nmatches ; ++ __i2 )
  56488. __minlen = std :: min ( __minlen ,
  56489. __traits_type :: length ( __names [ __matches [ __i2 ] ] ) ) ;
  56490. ++ __beg , ++ __pos ;
  56491. if ( __pos < __minlen && __beg != __end )
  56492. for ( size_t __i3 = 0 ; __i3 < __nmatches ; )
  56493. {
  56494. __name = __names [ __matches [ __i3 ] ] ;
  56495. if ( ! ( __name [ __pos ] == * __beg ) )
  56496. __matches [ __i3 ] = __matches [ -- __nmatches ] ;
  56497. else
  56498. ++ __i3 ;
  56499. }
  56500. else
  56501. break ;
  56502. }
  56503.  
  56504. if ( __nmatches == 1 )
  56505. {
  56506.  
  56507. ++ __beg , ++ __pos ;
  56508. __name = __names [ __matches [ 0 ] ] ;
  56509. const size_t __len = __traits_type :: length ( __name ) ;
  56510. while ( __pos < __len && __beg != __end && __name [ __pos ] == * __beg )
  56511. ++ __beg , ++ __pos ;
  56512.  
  56513. if ( __len == __pos )
  56514. __member = __matches [ 0 ] ;
  56515. else
  56516. __testvalid = false ;
  56517. }
  56518. else
  56519. __testvalid = false ;
  56520. if ( ! __testvalid )
  56521. __err |= ios_base :: failbit ;
  56522.  
  56523. return __beg ;
  56524. }
  56525.  
  56526. template < typename _CharT , typename _InIter >
  56527. _InIter
  56528. time_get < _CharT , _InIter > ::
  56529. _M_extract_wday_or_month ( iter_type __beg , iter_type __end , int & __member ,
  56530. const _CharT * * __names , size_t __indexlen ,
  56531. ios_base & __io , ios_base :: iostate & __err ) const
  56532. {
  56533. typedef char_traits < _CharT > __traits_type ;
  56534. const locale & __loc = __io . _M_getloc ( ) ;
  56535. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56536.  
  56537. int * __matches = static_cast < int * > ( __builtin_alloca ( 2 * sizeof ( int )
  56538. * __indexlen ) ) ;
  56539. size_t __nmatches = 0 ;
  56540. size_t * __matches_lengths = 0 ;
  56541. size_t __pos = 0 ;
  56542.  
  56543. if ( __beg != __end )
  56544. {
  56545. const char_type __c = * __beg ;
  56546. for ( size_t __i = 0 ; __i < 2 * __indexlen ; ++ __i )
  56547. if ( __c == __names [ __i ] [ 0 ]
  56548. || __c == __ctype . toupper ( __names [ __i ] [ 0 ] ) )
  56549. __matches [ __nmatches ++ ] = __i ;
  56550. }
  56551.  
  56552. if ( __nmatches )
  56553. {
  56554. ++ __beg , ++ __pos ;
  56555.  
  56556. __matches_lengths
  56557. = static_cast < size_t * > ( __builtin_alloca ( sizeof ( size_t )
  56558. * __nmatches ) ) ;
  56559. for ( size_t __i = 0 ; __i < __nmatches ; ++ __i )
  56560. __matches_lengths [ __i ]
  56561. = __traits_type :: length ( __names [ __matches [ __i ] ] ) ;
  56562. }
  56563.  
  56564. for ( ; __beg != __end ; ++ __beg , ++ __pos )
  56565. {
  56566. size_t __nskipped = 0 ;
  56567. const char_type __c = * __beg ;
  56568. for ( size_t __i = 0 ; __i < __nmatches ; )
  56569. {
  56570. const char_type * __name = __names [ __matches [ __i ] ] ;
  56571. if ( __pos >= __matches_lengths [ __i ] )
  56572. ++ __nskipped , ++ __i ;
  56573. else if ( ! ( __name [ __pos ] == __c ) )
  56574. {
  56575. -- __nmatches ;
  56576. __matches [ __i ] = __matches [ __nmatches ] ;
  56577. __matches_lengths [ __i ] = __matches_lengths [ __nmatches ] ;
  56578. }
  56579. else
  56580. ++ __i ;
  56581. }
  56582. if ( __nskipped == __nmatches )
  56583. break ;
  56584. }
  56585.  
  56586. if ( ( __nmatches == 1 && __matches_lengths [ 0 ] == __pos )
  56587. || ( __nmatches == 2 && ( __matches_lengths [ 0 ] == __pos
  56588. || __matches_lengths [ 1 ] == __pos ) ) )
  56589. __member = ( __matches [ 0 ] >= __indexlen
  56590. ? __matches [ 0 ] - __indexlen : __matches [ 0 ] ) ;
  56591. else
  56592. __err |= ios_base :: failbit ;
  56593.  
  56594. return __beg ;
  56595. }
  56596.  
  56597. template < typename _CharT , typename _InIter >
  56598. _InIter
  56599. time_get < _CharT , _InIter > ::
  56600. do_get_time ( iter_type __beg , iter_type __end , ios_base & __io ,
  56601. ios_base :: iostate & __err , tm * __tm ) const
  56602. {
  56603. const locale & __loc = __io . _M_getloc ( ) ;
  56604. const __timepunct < _CharT > & __tp = use_facet < __timepunct < _CharT > > ( __loc ) ;
  56605. const char_type * __times [ 2 ] ;
  56606. __tp . _M_time_formats ( __times ) ;
  56607. __beg = _M_extract_via_format ( __beg , __end , __io , __err ,
  56608. __tm , __times [ 0 ] ) ;
  56609. if ( __beg == __end )
  56610. __err |= ios_base :: eofbit ;
  56611. return __beg ;
  56612. }
  56613.  
  56614. template < typename _CharT , typename _InIter >
  56615. _InIter
  56616. time_get < _CharT , _InIter > ::
  56617. do_get_date ( iter_type __beg , iter_type __end , ios_base & __io ,
  56618. ios_base :: iostate & __err , tm * __tm ) const
  56619. {
  56620. const locale & __loc = __io . _M_getloc ( ) ;
  56621. const __timepunct < _CharT > & __tp = use_facet < __timepunct < _CharT > > ( __loc ) ;
  56622. const char_type * __dates [ 2 ] ;
  56623. __tp . _M_date_formats ( __dates ) ;
  56624. __beg = _M_extract_via_format ( __beg , __end , __io , __err ,
  56625. __tm , __dates [ 0 ] ) ;
  56626. if ( __beg == __end )
  56627. __err |= ios_base :: eofbit ;
  56628. return __beg ;
  56629. }
  56630.  
  56631. template < typename _CharT , typename _InIter >
  56632. _InIter
  56633. time_get < _CharT , _InIter > ::
  56634. do_get_weekday ( iter_type __beg , iter_type __end , ios_base & __io ,
  56635. ios_base :: iostate & __err , tm * __tm ) const
  56636. {
  56637. typedef char_traits < _CharT > __traits_type ;
  56638. const locale & __loc = __io . _M_getloc ( ) ;
  56639. const __timepunct < _CharT > & __tp = use_facet < __timepunct < _CharT > > ( __loc ) ;
  56640. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56641. const char_type * __days [ 14 ] ;
  56642. __tp . _M_days_abbreviated ( __days ) ;
  56643. __tp . _M_days ( __days + 7 ) ;
  56644. int __tmpwday ;
  56645. ios_base :: iostate __tmperr = ios_base :: goodbit ;
  56646.  
  56647. __beg = _M_extract_wday_or_month ( __beg , __end , __tmpwday , __days , 7 ,
  56648. __io , __tmperr ) ;
  56649. if ( ! __tmperr )
  56650. __tm -> tm_wday = __tmpwday ;
  56651. else
  56652. __err |= ios_base :: failbit ;
  56653.  
  56654. if ( __beg == __end )
  56655. __err |= ios_base :: eofbit ;
  56656. return __beg ;
  56657. }
  56658.  
  56659. template < typename _CharT , typename _InIter >
  56660. _InIter
  56661. time_get < _CharT , _InIter > ::
  56662. do_get_monthname ( iter_type __beg , iter_type __end ,
  56663. ios_base & __io , ios_base :: iostate & __err , tm * __tm ) const
  56664. {
  56665. typedef char_traits < _CharT > __traits_type ;
  56666. const locale & __loc = __io . _M_getloc ( ) ;
  56667. const __timepunct < _CharT > & __tp = use_facet < __timepunct < _CharT > > ( __loc ) ;
  56668. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56669. const char_type * __months [ 24 ] ;
  56670. __tp . _M_months_abbreviated ( __months ) ;
  56671. __tp . _M_months ( __months + 12 ) ;
  56672. int __tmpmon ;
  56673. ios_base :: iostate __tmperr = ios_base :: goodbit ;
  56674.  
  56675. __beg = _M_extract_wday_or_month ( __beg , __end , __tmpmon , __months , 12 ,
  56676. __io , __tmperr ) ;
  56677. if ( ! __tmperr )
  56678. __tm -> tm_mon = __tmpmon ;
  56679. else
  56680. __err |= ios_base :: failbit ;
  56681.  
  56682. if ( __beg == __end )
  56683. __err |= ios_base :: eofbit ;
  56684. return __beg ;
  56685. }
  56686.  
  56687. template < typename _CharT , typename _InIter >
  56688. _InIter
  56689. time_get < _CharT , _InIter > ::
  56690. do_get_year ( iter_type __beg , iter_type __end , ios_base & __io ,
  56691. ios_base :: iostate & __err , tm * __tm ) const
  56692. {
  56693. const locale & __loc = __io . _M_getloc ( ) ;
  56694. const ctype < _CharT > & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56695. int __tmpyear ;
  56696. ios_base :: iostate __tmperr = ios_base :: goodbit ;
  56697.  
  56698. __beg = _M_extract_num ( __beg , __end , __tmpyear , 0 , 9999 , 4 ,
  56699. __io , __tmperr ) ;
  56700. if ( ! __tmperr )
  56701. __tm -> tm_year = __tmpyear < 0 ? __tmpyear + 100 : __tmpyear - 1900 ;
  56702. else
  56703. __err |= ios_base :: failbit ;
  56704.  
  56705. if ( __beg == __end )
  56706. __err |= ios_base :: eofbit ;
  56707. return __beg ;
  56708. }
  56709.  
  56710. template < typename _CharT , typename _OutIter >
  56711. _OutIter
  56712. time_put < _CharT , _OutIter > ::
  56713. put ( iter_type __s , ios_base & __io , char_type __fill , const tm * __tm ,
  56714. const _CharT * __beg , const _CharT * __end ) const
  56715. {
  56716. const locale & __loc = __io . _M_getloc ( ) ;
  56717. ctype < _CharT > const & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56718. for ( ; __beg != __end ; ++ __beg )
  56719. if ( __ctype . narrow ( * __beg , 0 ) != '%' )
  56720. {
  56721. * __s = * __beg ;
  56722. ++ __s ;
  56723. }
  56724. else if ( ++ __beg != __end )
  56725. {
  56726. char __format ;
  56727. char __mod = 0 ;
  56728. const char __c = __ctype . narrow ( * __beg , 0 ) ;
  56729. if ( __c != 'E' && __c != 'O' )
  56730. __format = __c ;
  56731. else if ( ++ __beg != __end )
  56732. {
  56733. __mod = __c ;
  56734. __format = __ctype . narrow ( * __beg , 0 ) ;
  56735. }
  56736. else
  56737. break ;
  56738. __s = this -> do_put ( __s , __io , __fill , __tm , __format , __mod ) ;
  56739. }
  56740. else
  56741. break ;
  56742. return __s ;
  56743. }
  56744.  
  56745. template < typename _CharT , typename _OutIter >
  56746. _OutIter
  56747. time_put < _CharT , _OutIter > ::
  56748. do_put ( iter_type __s , ios_base & __io , char_type , const tm * __tm ,
  56749. char __format , char __mod ) const
  56750. {
  56751. const locale & __loc = __io . _M_getloc ( ) ;
  56752. ctype < _CharT > const & __ctype = use_facet < ctype < _CharT > > ( __loc ) ;
  56753. __timepunct < _CharT > const & __tp = use_facet < __timepunct < _CharT > > ( __loc ) ;
  56754.  
  56755.  
  56756.  
  56757. const size_t __maxlen = 128 ;
  56758. char_type __res [ __maxlen ] ;
  56759. #1195
  56760. char_type __fmt [ 4 ] ;
  56761. __fmt [ 0 ] = __ctype . widen ( '%' ) ;
  56762. if ( ! __mod )
  56763. {
  56764. __fmt [ 1 ] = __format ;
  56765. __fmt [ 2 ] = char_type ( ) ;
  56766. }
  56767. else
  56768. {
  56769. __fmt [ 1 ] = __mod ;
  56770. __fmt [ 2 ] = __format ;
  56771. __fmt [ 3 ] = char_type ( ) ;
  56772. }
  56773.  
  56774. __tp . _M_put ( __res , __maxlen , __fmt , __tm ) ;
  56775.  
  56776.  
  56777. return std :: __write ( __s , __res , char_traits < char_type > :: length ( __res ) ) ;
  56778. }
  56779.  
  56780.  
  56781.  
  56782.  
  56783.  
  56784. extern template class moneypunct < char , false > ;
  56785. extern template class moneypunct < char , true > ;
  56786. extern template class moneypunct_byname < char , false > ;
  56787. extern template class moneypunct_byname < char , true > ;
  56788. extern template class money_get < char > ;
  56789. extern template class money_put < char > ;
  56790. extern template class __timepunct < char > ;
  56791. extern template class time_put < char > ;
  56792. extern template class time_put_byname < char > ;
  56793. extern template class time_get < char > ;
  56794. extern template class time_get_byname < char > ;
  56795. extern template class messages < char > ;
  56796. extern template class messages_byname < char > ;
  56797.  
  56798. extern template
  56799. const moneypunct < char , true > &
  56800. use_facet < moneypunct < char , true > > ( const locale & ) ;
  56801.  
  56802. extern template
  56803. const moneypunct < char , false > &
  56804. use_facet < moneypunct < char , false > > ( const locale & ) ;
  56805.  
  56806. extern template
  56807. const money_put < char > &
  56808. use_facet < money_put < char > > ( const locale & ) ;
  56809.  
  56810. extern template
  56811. const money_get < char > &
  56812. use_facet < money_get < char > > ( const locale & ) ;
  56813.  
  56814. extern template
  56815. const __timepunct < char > &
  56816. use_facet < __timepunct < char > > ( const locale & ) ;
  56817.  
  56818. extern template
  56819. const time_put < char > &
  56820. use_facet < time_put < char > > ( const locale & ) ;
  56821.  
  56822. extern template
  56823. const time_get < char > &
  56824. use_facet < time_get < char > > ( const locale & ) ;
  56825.  
  56826. extern template
  56827. const messages < char > &
  56828. use_facet < messages < char > > ( const locale & ) ;
  56829.  
  56830. extern template
  56831. bool
  56832. has_facet < moneypunct < char > > ( const locale & ) ;
  56833.  
  56834. extern template
  56835. bool
  56836. has_facet < money_put < char > > ( const locale & ) ;
  56837.  
  56838. extern template
  56839. bool
  56840. has_facet < money_get < char > > ( const locale & ) ;
  56841.  
  56842. extern template
  56843. bool
  56844. has_facet < __timepunct < char > > ( const locale & ) ;
  56845.  
  56846. extern template
  56847. bool
  56848. has_facet < time_put < char > > ( const locale & ) ;
  56849.  
  56850. extern template
  56851. bool
  56852. has_facet < time_get < char > > ( const locale & ) ;
  56853.  
  56854. extern template
  56855. bool
  56856. has_facet < messages < char > > ( const locale & ) ;
  56857.  
  56858.  
  56859. extern template class moneypunct < wchar_t , false > ;
  56860. extern template class moneypunct < wchar_t , true > ;
  56861. extern template class moneypunct_byname < wchar_t , false > ;
  56862. extern template class moneypunct_byname < wchar_t , true > ;
  56863. extern template class money_get < wchar_t > ;
  56864. extern template class money_put < wchar_t > ;
  56865. extern template class __timepunct < wchar_t > ;
  56866. extern template class time_put < wchar_t > ;
  56867. extern template class time_put_byname < wchar_t > ;
  56868. extern template class time_get < wchar_t > ;
  56869. extern template class time_get_byname < wchar_t > ;
  56870. extern template class messages < wchar_t > ;
  56871. extern template class messages_byname < wchar_t > ;
  56872.  
  56873. extern template
  56874. const moneypunct < wchar_t , true > &
  56875. use_facet < moneypunct < wchar_t , true > > ( const locale & ) ;
  56876.  
  56877. extern template
  56878. const moneypunct < wchar_t , false > &
  56879. use_facet < moneypunct < wchar_t , false > > ( const locale & ) ;
  56880.  
  56881. extern template
  56882. const money_put < wchar_t > &
  56883. use_facet < money_put < wchar_t > > ( const locale & ) ;
  56884.  
  56885. extern template
  56886. const money_get < wchar_t > &
  56887. use_facet < money_get < wchar_t > > ( const locale & ) ;
  56888.  
  56889. extern template
  56890. const __timepunct < wchar_t > &
  56891. use_facet < __timepunct < wchar_t > > ( const locale & ) ;
  56892.  
  56893. extern template
  56894. const time_put < wchar_t > &
  56895. use_facet < time_put < wchar_t > > ( const locale & ) ;
  56896.  
  56897. extern template
  56898. const time_get < wchar_t > &
  56899. use_facet < time_get < wchar_t > > ( const locale & ) ;
  56900.  
  56901. extern template
  56902. const messages < wchar_t > &
  56903. use_facet < messages < wchar_t > > ( const locale & ) ;
  56904.  
  56905. extern template
  56906. bool
  56907. has_facet < moneypunct < wchar_t > > ( const locale & ) ;
  56908.  
  56909. extern template
  56910. bool
  56911. has_facet < money_put < wchar_t > > ( const locale & ) ;
  56912.  
  56913. extern template
  56914. bool
  56915. has_facet < money_get < wchar_t > > ( const locale & ) ;
  56916.  
  56917. extern template
  56918. bool
  56919. has_facet < __timepunct < wchar_t > > ( const locale & ) ;
  56920.  
  56921. extern template
  56922. bool
  56923. has_facet < time_put < wchar_t > > ( const locale & ) ;
  56924.  
  56925. extern template
  56926. bool
  56927. has_facet < time_get < wchar_t > > ( const locale & ) ;
  56928.  
  56929. extern template
  56930. bool
  56931. has_facet < messages < wchar_t > > ( const locale & ) ;
  56932.  
  56933.  
  56934.  
  56935.  
  56936. }
  56937. #55 "./boost/regex/v4/regex_workaround.hpp"
  56938. namespace boost { namespace re_detail {
  56939.  
  56940.  
  56941.  
  56942.  
  56943.  
  56944. using std :: distance ;
  56945.  
  56946. } }
  56947. #97
  56948. namespace boost { namespace re_detail {
  56949. #104
  56950. template < class T >
  56951. inline void pointer_destroy ( T * p )
  56952. { p -> ~ T ( ) ; ( void ) p ; }
  56953.  
  56954.  
  56955.  
  56956.  
  56957.  
  56958. template < class T >
  56959. inline void pointer_construct ( T * p , const T & t )
  56960. { new ( p ) T ( t ) ; }
  56961.  
  56962. } }
  56963. #126
  56964. namespace boost { namespace re_detail {
  56965. #184
  56966. using std :: copy ;
  56967. using std :: equal ;
  56968. #193
  56969. inline std :: size_t strcpy_s (
  56970. char * strDestination ,
  56971. std :: size_t sizeInBytes ,
  56972. const char * strSource
  56973. )
  56974. {
  56975. if ( std :: strlen ( strSource ) + 1 > sizeInBytes )
  56976. return 1 ;
  56977. std :: strcpy ( strDestination , strSource ) ;
  56978. return 0 ;
  56979. }
  56980. inline std :: size_t strcat_s (
  56981. char * strDestination ,
  56982. std :: size_t sizeInBytes ,
  56983. const char * strSource
  56984. )
  56985. {
  56986. if ( std :: strlen ( strSource ) + std :: strlen ( strDestination ) + 1 > sizeInBytes )
  56987. return 1 ;
  56988. std :: strcat ( strDestination , strSource ) ;
  56989. return 0 ;
  56990. }
  56991.  
  56992.  
  56993.  
  56994. inline void overflow_error_if_not_zero ( std :: size_t i )
  56995. {
  56996. if ( i )
  56997. {
  56998. std :: overflow_error e ( "String buffer too small" ) ;
  56999. boost :: throw_exception ( e ) ;
  57000. }
  57001. }
  57002.  
  57003. } }
  57004. #1 "./boost/regex_fwd.hpp"
  57005. #1 "./boost/regex/v4/regex_fwd.hpp"
  57006. #37
  57007. namespace boost {
  57008.  
  57009. template < class charT >
  57010. class cpp_regex_traits ;
  57011. template < class charT >
  57012. struct c_regex_traits ;
  57013. template < class charT >
  57014. class w32_regex_traits ;
  57015.  
  57016.  
  57017.  
  57018.  
  57019.  
  57020. template < class charT , class implementationT = cpp_regex_traits < charT > >
  57021. struct regex_traits ;
  57022.  
  57023.  
  57024.  
  57025.  
  57026.  
  57027. template < class charT , class traits = regex_traits < charT > >
  57028. class basic_regex ;
  57029.  
  57030. typedef basic_regex < char , regex_traits < char > > regex ;
  57031.  
  57032. typedef basic_regex < wchar_t , regex_traits < wchar_t > > wregex ;
  57033.  
  57034.  
  57035. }
  57036. #1 "./boost/regex/regex_traits.hpp"
  57037. #1 "./boost/regex/v4/regex_traits.hpp"
  57038. #1 "./boost/regex/v4/syntax_type.hpp"
  57039. #22
  57040. namespace boost {
  57041. namespace regex_constants {
  57042.  
  57043. typedef unsigned char syntax_type ;
  57044.  
  57045.  
  57046.  
  57047.  
  57048. static const syntax_type syntax_char = 0 ;
  57049. static const syntax_type syntax_open_mark = 1 ;
  57050. static const syntax_type syntax_close_mark = 2 ;
  57051. static const syntax_type syntax_dollar = 3 ;
  57052. static const syntax_type syntax_caret = 4 ;
  57053. static const syntax_type syntax_dot = 5 ;
  57054. static const syntax_type syntax_star = 6 ;
  57055. static const syntax_type syntax_plus = 7 ;
  57056. static const syntax_type syntax_question = 8 ;
  57057. static const syntax_type syntax_open_set = 9 ;
  57058. static const syntax_type syntax_close_set = 10 ;
  57059. static const syntax_type syntax_or = 11 ;
  57060. static const syntax_type syntax_escape = 12 ;
  57061. static const syntax_type syntax_dash = 14 ;
  57062. static const syntax_type syntax_open_brace = 15 ;
  57063. static const syntax_type syntax_close_brace = 16 ;
  57064. static const syntax_type syntax_digit = 17 ;
  57065. static const syntax_type syntax_comma = 27 ;
  57066. static const syntax_type syntax_equal = 37 ;
  57067. static const syntax_type syntax_colon = 36 ;
  57068. static const syntax_type syntax_not = 53 ;
  57069.  
  57070.  
  57071.  
  57072. static const syntax_type syntax_hash = 13 ;
  57073. static const syntax_type syntax_newline = 26 ;
  57074.  
  57075.  
  57076.  
  57077. typedef syntax_type escape_syntax_type ;
  57078.  
  57079. static const escape_syntax_type escape_type_word_assert = 18 ;
  57080. static const escape_syntax_type escape_type_not_word_assert = 19 ;
  57081. static const escape_syntax_type escape_type_control_f = 29 ;
  57082. static const escape_syntax_type escape_type_control_n = 30 ;
  57083. static const escape_syntax_type escape_type_control_r = 31 ;
  57084. static const escape_syntax_type escape_type_control_t = 32 ;
  57085. static const escape_syntax_type escape_type_control_v = 33 ;
  57086. static const escape_syntax_type escape_type_ascii_control = 35 ;
  57087. static const escape_syntax_type escape_type_hex = 34 ;
  57088. static const escape_syntax_type escape_type_unicode = 0 ;
  57089. static const escape_syntax_type escape_type_identity = 0 ;
  57090. static const escape_syntax_type escape_type_backref = syntax_digit ;
  57091. static const escape_syntax_type escape_type_decimal = syntax_digit ;
  57092. static const escape_syntax_type escape_type_class = 22 ;
  57093. static const escape_syntax_type escape_type_not_class = 23 ;
  57094.  
  57095.  
  57096.  
  57097. static const escape_syntax_type escape_type_left_word = 20 ;
  57098. static const escape_syntax_type escape_type_right_word = 21 ;
  57099. static const escape_syntax_type escape_type_start_buffer = 24 ;
  57100. static const escape_syntax_type escape_type_end_buffer = 25 ;
  57101. static const escape_syntax_type escape_type_control_a = 28 ;
  57102. static const escape_syntax_type escape_type_e = 38 ;
  57103. static const escape_syntax_type escape_type_E = 47 ;
  57104. static const escape_syntax_type escape_type_Q = 48 ;
  57105. static const escape_syntax_type escape_type_X = 49 ;
  57106. static const escape_syntax_type escape_type_C = 50 ;
  57107. static const escape_syntax_type escape_type_Z = 51 ;
  57108. static const escape_syntax_type escape_type_G = 52 ;
  57109.  
  57110. static const escape_syntax_type escape_type_property = 54 ;
  57111. static const escape_syntax_type escape_type_not_property = 55 ;
  57112. static const escape_syntax_type escape_type_named_char = 56 ;
  57113. static const escape_syntax_type escape_type_extended_backref = 57 ;
  57114. static const escape_syntax_type escape_type_reset_start_mark = 58 ;
  57115. static const escape_syntax_type escape_type_line_ending = 59 ;
  57116.  
  57117. static const escape_syntax_type syntax_max = 60 ;
  57118.  
  57119. }
  57120. }
  57121. #1 "./boost/regex/v4/error_type.hpp"
  57122. #23
  57123. namespace boost {
  57124.  
  57125.  
  57126.  
  57127. namespace regex_constants {
  57128.  
  57129. enum error_type {
  57130.  
  57131. error_ok = 0 ,
  57132. error_no_match = 1 ,
  57133. error_bad_pattern = 2 ,
  57134. error_collate = 3 ,
  57135. error_ctype = 4 ,
  57136. error_escape = 5 ,
  57137. error_backref = 6 ,
  57138. error_brack = 7 ,
  57139. error_paren = 8 ,
  57140. error_brace = 9 ,
  57141. error_badbrace = 10 ,
  57142. error_range = 11 ,
  57143. error_space = 12 ,
  57144. error_badrepeat = 13 ,
  57145. error_end = 14 ,
  57146. error_size = 15 ,
  57147. error_right_paren = 16 ,
  57148. error_empty = 17 ,
  57149. error_complexity = 18 ,
  57150. error_stack = 19 ,
  57151. error_perl_extension = 20 ,
  57152. error_unknown = 21
  57153. } ;
  57154.  
  57155. }
  57156. }
  57157. #1 "./boost/regex/v4/regex_traits_defaults.hpp"
  57158. #46
  57159. namespace boost { namespace re_detail {
  57160.  
  57161.  
  57162.  
  57163.  
  57164.  
  57165. template < class charT >
  57166. inline bool is_extended ( charT c )
  57167. { return c > 256 ; }
  57168. inline bool is_extended ( char )
  57169. { return false ; }
  57170.  
  57171.  
  57172. const char * get_default_syntax ( regex_constants :: syntax_type n ) ;
  57173. const char * get_default_error_string ( regex_constants :: error_type n ) ;
  57174. regex_constants :: syntax_type get_default_syntax_type ( char c ) ;
  57175. regex_constants :: escape_syntax_type get_default_escape_syntax_type ( char c ) ;
  57176.  
  57177.  
  57178. bool is_combining_implementation ( uint_least16_t s ) ;
  57179.  
  57180. template < class charT >
  57181. inline bool is_combining ( charT c )
  57182. {
  57183. return ( c <= static_cast < charT > ( 0 ) ) ? false : ( ( c >= static_cast < charT > ( ( std :: numeric_limits < uint_least16_t
  57184. #70
  57185. > :: max ) ( ) ) ) ? false : is_combining_implementation ( static_cast < unsigned short > ( c ) ) ) ;
  57186. }
  57187. template < >
  57188. inline bool is_combining < char > ( char )
  57189. {
  57190. return false ;
  57191. }
  57192. template < >
  57193. inline bool is_combining < signed char > ( signed char )
  57194. {
  57195. return false ;
  57196. }
  57197. template < >
  57198. inline bool is_combining < unsigned char > ( unsigned char )
  57199. {
  57200. return false ;
  57201. }
  57202. #114
  57203. template < class charT >
  57204. inline bool is_separator ( charT c )
  57205. {
  57206. return
  57207.  
  57208.  
  57209.  
  57210.  
  57211.  
  57212. static_cast < bool > ( ( c == static_cast < charT > ( '\n' ) ) || ( c == static_cast < charT > ( '\r' ) ) || ( c == static_cast
  57213. #123
  57214. < charT > ( '\f' ) ) || ( static_cast < boost :: uint16_t > ( c ) == 0x2028u ) || ( static_cast < boost :: uint16_t > ( c
  57215. #123
  57216. ) == 0x2029u ) || ( static_cast < boost :: uint16_t > ( c ) == 0x85u ) ) ;
  57217. }
  57218. template < >
  57219. inline bool is_separator < char > ( char c )
  57220. {
  57221. return static_cast < bool > ( ( c == '\n' ) || ( c == '\r' ) || ( c == '\f' ) ) ;
  57222. }
  57223.  
  57224.  
  57225.  
  57226.  
  57227. std :: string lookup_default_collate_name ( const std :: string & name ) ;
  57228.  
  57229.  
  57230.  
  57231.  
  57232.  
  57233. template < class charT >
  57234. struct character_pointer_range
  57235. {
  57236. const charT * p1 ;
  57237. const charT * p2 ;
  57238.  
  57239. bool operator < ( const character_pointer_range & r ) const
  57240. {
  57241. return std :: lexicographical_compare ( p1 , p2 , r . p1 , r . p2 ) ;
  57242. }
  57243. bool operator == ( const character_pointer_range & r ) const
  57244. {
  57245.  
  57246.  
  57247.  
  57248.  
  57249. return ( ( p2 - p1 ) == ( r . p2 - r . p1 ) ) && re_detail :: equal ( p1 , p2 , r . p1 ) ;
  57250. }
  57251. } ;
  57252. template < class charT >
  57253. int get_default_class_id ( const charT * p1 , const charT * p2 )
  57254. {
  57255. static const charT data [ 73 ] = {
  57256. 'a' , 'l' , 'n' , 'u' , 'm' ,
  57257. 'a' , 'l' , 'p' , 'h' , 'a' ,
  57258. 'b' , 'l' , 'a' , 'n' , 'k' ,
  57259. 'c' , 'n' , 't' , 'r' , 'l' ,
  57260. 'd' , 'i' , 'g' , 'i' , 't' ,
  57261. 'g' , 'r' , 'a' , 'p' , 'h' ,
  57262. 'l' , 'o' , 'w' , 'e' , 'r' ,
  57263. 'p' , 'r' , 'i' , 'n' , 't' ,
  57264. 'p' , 'u' , 'n' , 'c' , 't' ,
  57265. 's' , 'p' , 'a' , 'c' , 'e' ,
  57266. 'u' , 'n' , 'i' , 'c' , 'o' , 'd' , 'e' ,
  57267. 'u' , 'p' , 'p' , 'e' , 'r' ,
  57268. 'v' ,
  57269. 'w' , 'o' , 'r' , 'd' ,
  57270. 'x' , 'd' , 'i' , 'g' , 'i' , 't' ,
  57271. } ;
  57272.  
  57273. static const character_pointer_range < charT > ranges [ 21 ] =
  57274. {
  57275. { data + 0 , data + 5 , } ,
  57276. { data + 5 , data + 10 , } ,
  57277. { data + 10 , data + 15 , } ,
  57278. { data + 15 , data + 20 , } ,
  57279. { data + 20 , data + 21 , } ,
  57280. { data + 20 , data + 25 , } ,
  57281. { data + 25 , data + 30 , } ,
  57282. { data + 29 , data + 30 , } ,
  57283. { data + 30 , data + 31 , } ,
  57284. { data + 30 , data + 35 , } ,
  57285. { data + 35 , data + 40 , } ,
  57286. { data + 40 , data + 45 , } ,
  57287. { data + 45 , data + 46 , } ,
  57288. { data + 45 , data + 50 , } ,
  57289. { data + 57 , data + 58 , } ,
  57290. { data + 50 , data + 57 , } ,
  57291. { data + 57 , data + 62 , } ,
  57292. { data + 62 , data + 63 , } ,
  57293. { data + 63 , data + 64 , } ,
  57294. { data + 63 , data + 67 , } ,
  57295. { data + 67 , data + 73 , } ,
  57296. } ;
  57297. static const character_pointer_range < charT > * ranges_begin = ranges ;
  57298. static const character_pointer_range < charT > * ranges_end = ranges + ( sizeof ( ranges ) / sizeof ( ranges [ 0 ] ) ) ;
  57299. #205
  57300.  
  57301.  
  57302. character_pointer_range < charT > t = { p1 , p2 , } ;
  57303. const character_pointer_range < charT > * p = std :: lower_bound ( ranges_begin , ranges_end , t ) ;
  57304. if ( ( p != ranges_end ) && ( t == * p ) )
  57305. return static_cast < int > ( p - ranges ) ;
  57306. return - 1 ;
  57307. }
  57308.  
  57309.  
  57310.  
  57311.  
  57312. template < class charT >
  57313. std :: ptrdiff_t global_length ( const charT * p )
  57314. {
  57315. std :: ptrdiff_t n = 0 ;
  57316. while ( * p )
  57317. {
  57318. ++ p ;
  57319. ++ n ;
  57320. }
  57321. return n ;
  57322. }
  57323. template < >
  57324. inline std :: ptrdiff_t global_length < char > ( const char * p )
  57325. {
  57326. return ( std :: strlen ) ( p ) ;
  57327. }
  57328.  
  57329. template < >
  57330. inline std :: ptrdiff_t global_length < wchar_t > ( const wchar_t * p )
  57331. {
  57332. return ( std :: wcslen ) ( p ) ;
  57333. }
  57334.  
  57335. template < class charT >
  57336. inline charT global_lower ( charT c )
  57337. {
  57338. return c ;
  57339. }
  57340. template < class charT >
  57341. inline charT global_upper ( charT c )
  57342. {
  57343. return c ;
  57344. }
  57345.  
  57346. char do_global_lower ( char c ) ;
  57347. char do_global_upper ( char c ) ;
  57348.  
  57349. wchar_t do_global_lower ( wchar_t c ) ;
  57350. wchar_t do_global_upper ( wchar_t c ) ;
  57351. #271
  57352. template < > inline char global_lower < char > ( char c ) { return do_global_lower ( c ) ; }
  57353. template < > inline char global_upper < char > ( char c ) { return do_global_upper ( c ) ; }
  57354.  
  57355. template < > inline wchar_t global_lower < wchar_t > ( wchar_t c ) { return do_global_lower ( c ) ; }
  57356. template < > inline wchar_t global_upper < wchar_t > ( wchar_t c ) { return do_global_upper ( c ) ; }
  57357. #282
  57358. template < class charT >
  57359. int global_value ( charT c )
  57360. {
  57361. static const charT zero = '0' ;
  57362. static const charT nine = '9' ;
  57363. static const charT a = 'a' ;
  57364. static const charT f = 'f' ;
  57365. static const charT A = 'A' ;
  57366. static const charT F = 'F' ;
  57367.  
  57368. if ( c > f ) return - 1 ;
  57369. if ( c >= a ) return 10 + ( c - a ) ;
  57370. if ( c > F ) return - 1 ;
  57371. if ( c >= A ) return 10 + ( c - A ) ;
  57372. if ( c > nine ) return - 1 ;
  57373. if ( c >= zero ) return c - zero ;
  57374. return - 1 ;
  57375. }
  57376. template < class charT , class traits >
  57377. int global_toi ( const charT * & p1 , const charT * p2 , int radix , const traits & t )
  57378. {
  57379. ( void ) t ;
  57380. int next_value = t . value ( * p1 , radix ) ;
  57381. if ( ( p1 == p2 ) || ( next_value < 0 ) || ( next_value >= radix ) )
  57382. return - 1 ;
  57383. int result = 0 ;
  57384. while ( p1 != p2 )
  57385. {
  57386. next_value = t . value ( * p1 , radix ) ;
  57387. if ( ( next_value < 0 ) || ( next_value >= radix ) )
  57388. break ;
  57389. result *= radix ;
  57390. result += next_value ;
  57391. ++ p1 ;
  57392. }
  57393. return result ;
  57394. }
  57395.  
  57396. template < class charT >
  57397. inline const charT * get_escape_R_string ( )
  57398. {
  57399.  
  57400.  
  57401.  
  57402.  
  57403. static const charT e1 [ ] = { '(' , '?' , '>' , '\x0D' , '\x0A' , '?' ,
  57404. '|' , '[' , '\x0A' , '\x0B' , '\x0C' , static_cast < unsigned char > ( '\x85' ) , '\\' , 'x' , '{' , '2' , '0' , '2' , '8'
  57405. #328
  57406. , '}' ,
  57407. '\\' , 'x' , '{' , '2' , '0' , '2' , '9' , '}' , ']' , ')' , '\0' } ;
  57408. static const charT e2 [ ] = { '(' , '?' , '>' , '\x0D' , '\x0A' , '?' ,
  57409. '|' , '[' , '\x0A' , '\x0B' , '\x0C' , static_cast < unsigned char > ( '\x85' ) , ']' , ')' , '\0' } ;
  57410.  
  57411. charT c = static_cast < charT > ( 0x2029u ) ;
  57412. bool b = ( static_cast < unsigned > ( c ) == 0x2029u ) ;
  57413.  
  57414. return ( b ? e1 : e2 ) ;
  57415.  
  57416.  
  57417.  
  57418. }
  57419.  
  57420. template < >
  57421. inline const char * get_escape_R_string < char > ( )
  57422. {
  57423.  
  57424.  
  57425.  
  57426.  
  57427. static const char e2 [ ] = { '(' , '?' , '>' , '\x0D' , '\x0A' , '?' ,
  57428. '|' , '[' , '\x0A' , '\x0B' , '\x0C' , '\x85' , ']' , ')' , '\0' } ;
  57429. return e2 ;
  57430.  
  57431.  
  57432.  
  57433. }
  57434.  
  57435. }
  57436. }
  57437. #1 "./boost/regex/v4/cpp_regex_traits.hpp"
  57438. #1 "./boost/integer.hpp"
  57439. #1 "./boost/integer_fwd.hpp"
  57440. #1 "./boost/cstdint.hpp"
  57441. #20 "./boost/integer_fwd.hpp"
  57442. namespace boost
  57443. {
  57444. #29
  57445. typedef boost :: uintmax_t static_min_max_unsigned_type ;
  57446. typedef boost :: intmax_t static_min_max_signed_type ;
  57447. typedef boost :: uintmax_t static_log2_argument_type ;
  57448. typedef int static_log2_result_type ;
  57449. #42
  57450. template < class T >
  57451. class integer_traits ;
  57452.  
  57453. template < >
  57454. class integer_traits < bool > ;
  57455.  
  57456. template < >
  57457. class integer_traits < char > ;
  57458.  
  57459. template < >
  57460. class integer_traits < signed char > ;
  57461.  
  57462. template < >
  57463. class integer_traits < unsigned char > ;
  57464.  
  57465.  
  57466. template < >
  57467. class integer_traits < wchar_t > ;
  57468.  
  57469.  
  57470. template < >
  57471. class integer_traits < short > ;
  57472.  
  57473. template < >
  57474. class integer_traits < unsigned short > ;
  57475.  
  57476. template < >
  57477. class integer_traits < int > ;
  57478.  
  57479. template < >
  57480. class integer_traits < unsigned int > ;
  57481.  
  57482. template < >
  57483. class integer_traits < long > ;
  57484.  
  57485. template < >
  57486. class integer_traits < unsigned long > ;
  57487.  
  57488.  
  57489. template < >
  57490. class integer_traits < :: boost :: long_long_type > ;
  57491.  
  57492. template < >
  57493. class integer_traits < :: boost :: ulong_long_type > ;
  57494. #97
  57495. template < typename LeastInt >
  57496. struct int_fast_t ;
  57497.  
  57498. template < int Bits >
  57499. struct int_t ;
  57500.  
  57501. template < int Bits >
  57502. struct uint_t ;
  57503.  
  57504.  
  57505. template < boost :: long_long_type MaxValue >
  57506.  
  57507.  
  57508.  
  57509. struct int_max_value_t ;
  57510.  
  57511.  
  57512. template < boost :: long_long_type MinValue >
  57513.  
  57514.  
  57515.  
  57516. struct int_min_value_t ;
  57517.  
  57518.  
  57519. template < boost :: ulong_long_type MaxValue >
  57520.  
  57521.  
  57522.  
  57523. struct uint_value_t ;
  57524.  
  57525.  
  57526.  
  57527.  
  57528. template < std :: size_t Bit >
  57529. struct high_bit_mask_t ;
  57530.  
  57531. template < std :: size_t Bits >
  57532. struct low_bits_mask_t ;
  57533.  
  57534. template < >
  57535. struct low_bits_mask_t < :: std :: numeric_limits < unsigned char > :: digits > ;
  57536.  
  57537.  
  57538.  
  57539. template < static_log2_argument_type Value >
  57540. struct static_log2 ;
  57541.  
  57542. template < > struct static_log2 < 0u > ;
  57543.  
  57544.  
  57545.  
  57546.  
  57547. template < static_min_max_signed_type Value1 , static_min_max_signed_type Value2 >
  57548. struct static_signed_min ;
  57549.  
  57550. template < static_min_max_signed_type Value1 , static_min_max_signed_type Value2 >
  57551. struct static_signed_max ;
  57552.  
  57553. template < static_min_max_unsigned_type Value1 , static_min_max_unsigned_type Value2 >
  57554. struct static_unsigned_min ;
  57555.  
  57556. template < static_min_max_unsigned_type Value1 , static_min_max_unsigned_type Value2 >
  57557. struct static_unsigned_max ;
  57558.  
  57559. }
  57560. #1 "./boost/integer_traits.hpp"
  57561. #42
  57562. namespace boost {
  57563. template < class T >
  57564. class integer_traits : public std :: numeric_limits < T >
  57565. {
  57566. public :
  57567. static const bool is_integral = false ;
  57568. } ;
  57569.  
  57570. namespace detail {
  57571. template < class T , T min_val , T max_val >
  57572. class integer_traits_base
  57573. {
  57574. public :
  57575. static const bool is_integral = true ;
  57576. static const T const_min = min_val ;
  57577. static const T const_max = max_val ;
  57578. } ;
  57579.  
  57580.  
  57581.  
  57582. template < class T , T min_val , T max_val >
  57583. const bool integer_traits_base < T , min_val , max_val > :: is_integral ;
  57584.  
  57585. template < class T , T min_val , T max_val >
  57586. const T integer_traits_base < T , min_val , max_val > :: const_min ;
  57587.  
  57588. template < class T , T min_val , T max_val >
  57589. const T integer_traits_base < T , min_val , max_val > :: const_max ;
  57590.  
  57591.  
  57592. }
  57593.  
  57594. template < >
  57595. class integer_traits < bool >
  57596. : public std :: numeric_limits < bool > ,
  57597. public detail :: integer_traits_base < bool , false , true >
  57598. { } ;
  57599.  
  57600. template < >
  57601. class integer_traits < char >
  57602. : public std :: numeric_limits < char > ,
  57603. public detail :: integer_traits_base < char , ( - 128 ) , 127 >
  57604. { } ;
  57605.  
  57606. template < >
  57607. class integer_traits < signed char >
  57608. : public std :: numeric_limits < signed char > ,
  57609. public detail :: integer_traits_base < signed char , ( - 128 ) , 127 >
  57610. { } ;
  57611.  
  57612. template < >
  57613. class integer_traits < unsigned char >
  57614. : public std :: numeric_limits < unsigned char > ,
  57615. public detail :: integer_traits_base < unsigned char , 0 , 255 >
  57616. { } ;
  57617.  
  57618.  
  57619. template < >
  57620. class integer_traits < wchar_t >
  57621. : public std :: numeric_limits < wchar_t > ,
  57622.  
  57623.  
  57624.  
  57625. public detail :: integer_traits_base < wchar_t , ( - 2147483647 - 1 ) , 2147483647 >
  57626. #130
  57627. { } ;
  57628.  
  57629.  
  57630. template < >
  57631. class integer_traits < short >
  57632. : public std :: numeric_limits < short > ,
  57633. public detail :: integer_traits_base < short , ( - 32768 ) , 32767 >
  57634. { } ;
  57635.  
  57636. template < >
  57637. class integer_traits < unsigned short >
  57638. : public std :: numeric_limits < unsigned short > ,
  57639. public detail :: integer_traits_base < unsigned short , 0 , 65535 >
  57640. { } ;
  57641.  
  57642. template < >
  57643. class integer_traits < int >
  57644. : public std :: numeric_limits < int > ,
  57645. public detail :: integer_traits_base < int , ( - 2147483647 - 1 ) , 2147483647 >
  57646. { } ;
  57647.  
  57648. template < >
  57649. class integer_traits < unsigned int >
  57650. : public std :: numeric_limits < unsigned int > ,
  57651. public detail :: integer_traits_base < unsigned int , 0 , 4294967295U >
  57652. { } ;
  57653.  
  57654. template < >
  57655. class integer_traits < long >
  57656. : public std :: numeric_limits < long > ,
  57657. public detail :: integer_traits_base < long , ( - 9223372036854775807L - 1L ) , 9223372036854775807L >
  57658. { } ;
  57659.  
  57660. template < >
  57661. class integer_traits < unsigned long >
  57662. : public std :: numeric_limits < unsigned long > ,
  57663. public detail :: integer_traits_base < unsigned long , 0 , 18446744073709551615UL >
  57664. { } ;
  57665.  
  57666.  
  57667.  
  57668.  
  57669. template < >
  57670. class integer_traits < :: boost :: long_long_type >
  57671. : public std :: numeric_limits < :: boost :: long_long_type > ,
  57672. public detail :: integer_traits_base < :: boost :: long_long_type , ( - 9223372036854775807LL - 1LL ) , 9223372036854775807LL
  57673. #175
  57674. >
  57675. { } ;
  57676.  
  57677. template < >
  57678. class integer_traits < :: boost :: ulong_long_type >
  57679. : public std :: numeric_limits < :: boost :: ulong_long_type > ,
  57680. public detail :: integer_traits_base < :: boost :: ulong_long_type , 0 , 18446744073709551615ULL >
  57681. { } ;
  57682. #256
  57683. }
  57684. #1 "./boost/cstdint.hpp"
  57685. #1 "./boost/static_assert.hpp"
  57686. #84
  57687. namespace boost {
  57688.  
  57689.  
  57690. template < bool x > struct STATIC_ASSERTION_FAILURE ;
  57691.  
  57692. template < > struct STATIC_ASSERTION_FAILURE < true > { enum { value = 1 } ; } ;
  57693.  
  57694.  
  57695. template < int x > struct static_assert_test { } ;
  57696.  
  57697. }
  57698. #37 "./boost/integer.hpp"
  57699. namespace boost
  57700. {
  57701.  
  57702.  
  57703.  
  57704.  
  57705.  
  57706. template < typename LeastInt >
  57707. struct int_fast_t
  57708. {
  57709. typedef LeastInt fast ;
  57710. typedef fast type ;
  57711. } ;
  57712.  
  57713. namespace detail {
  57714.  
  57715.  
  57716. template < int Category > struct int_least_helper { } ;
  57717. template < int Category > struct uint_least_helper { } ;
  57718.  
  57719.  
  57720.  
  57721.  
  57722.  
  57723. template < > struct int_least_helper < 1 > { typedef boost :: long_long_type least ; } ;
  57724.  
  57725.  
  57726.  
  57727. template < > struct int_least_helper < 2 > { typedef long least ; } ;
  57728. template < > struct int_least_helper < 3 > { typedef int least ; } ;
  57729. template < > struct int_least_helper < 4 > { typedef short least ; } ;
  57730. template < > struct int_least_helper < 5 > { typedef signed char least ; } ;
  57731.  
  57732. template < > struct uint_least_helper < 1 > { typedef boost :: ulong_long_type least ; } ;
  57733.  
  57734.  
  57735.  
  57736. template < > struct uint_least_helper < 2 > { typedef unsigned long least ; } ;
  57737. template < > struct uint_least_helper < 3 > { typedef unsigned int least ; } ;
  57738. template < > struct uint_least_helper < 4 > { typedef unsigned short least ; } ;
  57739. template < > struct uint_least_helper < 5 > { typedef unsigned char least ; } ;
  57740.  
  57741. template < int Bits >
  57742. struct exact_signed_base_helper { } ;
  57743. template < int Bits >
  57744. struct exact_unsigned_base_helper { } ;
  57745.  
  57746. template < > struct exact_signed_base_helper < sizeof ( signed char ) * 8 > { typedef signed char exact ; } ;
  57747. template < > struct exact_unsigned_base_helper < sizeof ( unsigned char ) * 8 > { typedef unsigned char exact ; } ;
  57748.  
  57749. template < > struct exact_signed_base_helper < sizeof ( short ) * 8 > { typedef short exact ; } ;
  57750. template < > struct exact_unsigned_base_helper < sizeof ( unsigned short ) * 8 > { typedef unsigned short exact ; } ;
  57751.  
  57752.  
  57753. template < > struct exact_signed_base_helper < sizeof ( int ) * 8 > { typedef int exact ; } ;
  57754. template < > struct exact_unsigned_base_helper < sizeof ( unsigned int ) * 8 > { typedef unsigned int exact ; } ;
  57755.  
  57756.  
  57757. template < > struct exact_signed_base_helper < sizeof ( long ) * 8 > { typedef long exact ; } ;
  57758. template < > struct exact_unsigned_base_helper < sizeof ( unsigned long ) * 8 > { typedef unsigned long exact ; } ;
  57759. #108
  57760. }
  57761.  
  57762.  
  57763.  
  57764.  
  57765. template < int Bits >
  57766. struct int_t : public detail :: exact_signed_base_helper < Bits >
  57767. {
  57768.  
  57769. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( Bits <= ( int ) ( sizeof
  57770. #117
  57771. ( boost :: intmax_t ) * 8 ) ) > ) > boost_static_assert_typedef_117 ;
  57772. typedef typename detail :: int_least_helper
  57773. <
  57774.  
  57775. ( Bits <= ( int ) ( sizeof ( boost :: long_long_type ) * 8 ) ) +
  57776.  
  57777.  
  57778.  
  57779. ( Bits - 1 <= :: std :: numeric_limits < long > :: digits ) +
  57780. ( Bits - 1 <= :: std :: numeric_limits < int > :: digits ) +
  57781. ( Bits - 1 <= :: std :: numeric_limits < short > :: digits ) +
  57782. ( Bits - 1 <= :: std :: numeric_limits < signed char > :: digits )
  57783. > :: least least ;
  57784. typedef typename int_fast_t < least > :: type fast ;
  57785. } ;
  57786.  
  57787.  
  57788. template < int Bits >
  57789. struct uint_t : public detail :: exact_unsigned_base_helper < Bits >
  57790. {
  57791.  
  57792. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( Bits <= ( int ) ( sizeof
  57793. #138
  57794. ( boost :: uintmax_t ) * 8 ) ) > ) > boost_static_assert_typedef_138 ;
  57795. #149
  57796. typedef typename detail :: uint_least_helper
  57797. <
  57798.  
  57799. ( Bits <= ( int ) ( sizeof ( boost :: long_long_type ) * 8 ) ) +
  57800.  
  57801.  
  57802.  
  57803. ( Bits <= :: std :: numeric_limits < unsigned long > :: digits ) +
  57804. ( Bits <= :: std :: numeric_limits < unsigned int > :: digits ) +
  57805. ( Bits <= :: std :: numeric_limits < unsigned short > :: digits ) +
  57806. ( Bits <= :: std :: numeric_limits < unsigned char > :: digits )
  57807. > :: least least ;
  57808.  
  57809. typedef typename int_fast_t < least > :: type fast ;
  57810.  
  57811. } ;
  57812.  
  57813.  
  57814.  
  57815.  
  57816.  
  57817. template < boost :: long_long_type MaxValue >
  57818.  
  57819.  
  57820.  
  57821. struct int_max_value_t
  57822. {
  57823. typedef typename detail :: int_least_helper
  57824. <
  57825.  
  57826. ( MaxValue <= :: boost :: integer_traits < boost :: long_long_type > :: const_max ) +
  57827.  
  57828.  
  57829.  
  57830. ( MaxValue <= :: boost :: integer_traits < long > :: const_max ) +
  57831. ( MaxValue <= :: boost :: integer_traits < int > :: const_max ) +
  57832. ( MaxValue <= :: boost :: integer_traits < short > :: const_max ) +
  57833. ( MaxValue <= :: boost :: integer_traits < signed char > :: const_max )
  57834. > :: least least ;
  57835. typedef typename int_fast_t < least > :: type fast ;
  57836. } ;
  57837.  
  57838.  
  57839. template < boost :: long_long_type MinValue >
  57840.  
  57841.  
  57842.  
  57843. struct int_min_value_t
  57844. {
  57845. typedef typename detail :: int_least_helper
  57846. <
  57847.  
  57848. ( MinValue >= :: boost :: integer_traits < boost :: long_long_type > :: const_min ) +
  57849.  
  57850.  
  57851.  
  57852. ( MinValue >= :: boost :: integer_traits < long > :: const_min ) +
  57853. ( MinValue >= :: boost :: integer_traits < int > :: const_min ) +
  57854. ( MinValue >= :: boost :: integer_traits < short > :: const_min ) +
  57855. ( MinValue >= :: boost :: integer_traits < signed char > :: const_min )
  57856. > :: least least ;
  57857. typedef typename int_fast_t < least > :: type fast ;
  57858. } ;
  57859.  
  57860.  
  57861.  
  57862. template < boost :: ulong_long_type MaxValue >
  57863.  
  57864.  
  57865.  
  57866. struct uint_value_t
  57867. {
  57868. #242
  57869. typedef typename detail :: uint_least_helper
  57870. <
  57871.  
  57872. ( MaxValue <= :: boost :: integer_traits < boost :: ulong_long_type > :: const_max ) +
  57873.  
  57874.  
  57875.  
  57876. ( MaxValue <= :: boost :: integer_traits < unsigned long > :: const_max ) +
  57877. ( MaxValue <= :: boost :: integer_traits < unsigned int > :: const_max ) +
  57878. ( MaxValue <= :: boost :: integer_traits < unsigned short > :: const_max ) +
  57879. ( MaxValue <= :: boost :: integer_traits < unsigned char > :: const_max )
  57880. > :: least least ;
  57881.  
  57882. typedef typename int_fast_t < least > :: type fast ;
  57883. } ;
  57884.  
  57885.  
  57886. }
  57887. #1 "./boost/regex/pattern_except.hpp"
  57888. #30
  57889. namespace boost {
  57890. #47
  57891. class regex_error : public std :: runtime_error
  57892. {
  57893. public :
  57894. explicit regex_error ( const std :: string & s , regex_constants :: error_type err = regex_constants :: error_unknown , std
  57895. #50
  57896. :: ptrdiff_t pos = 0 ) ;
  57897. explicit regex_error ( regex_constants :: error_type err ) ;
  57898. ~ regex_error ( ) throw ( ) ;
  57899. regex_constants :: error_type code ( ) const
  57900. { return m_error_code ; }
  57901. std :: ptrdiff_t position ( ) const
  57902. { return m_position ; }
  57903. void raise ( ) const ;
  57904. private :
  57905. regex_constants :: error_type m_error_code ;
  57906. std :: ptrdiff_t m_position ;
  57907. } ;
  57908.  
  57909. typedef regex_error bad_pattern ;
  57910. typedef regex_error bad_expression ;
  57911.  
  57912. namespace re_detail {
  57913.  
  57914. void raise_runtime_error ( const std :: runtime_error & ex ) ;
  57915.  
  57916. template < class traits >
  57917. void raise_error ( const traits & t , regex_constants :: error_type code )
  57918. {
  57919. ( void ) t ;
  57920. std :: runtime_error e ( t . error_string ( code ) ) ;
  57921. :: boost :: re_detail :: raise_runtime_error ( e ) ;
  57922. }
  57923.  
  57924. }
  57925. #95
  57926. }
  57927. #1 "./boost/regex/pending/static_mutex.hpp"
  57928. #37
  57929. namespace boost {
  57930.  
  57931. class static_mutex ;
  57932.  
  57933.  
  57934.  
  57935. class scoped_static_mutex_lock
  57936. {
  57937. public :
  57938. scoped_static_mutex_lock ( static_mutex & mut , bool lk = true ) ;
  57939. ~ scoped_static_mutex_lock ( ) ;
  57940. inline bool locked ( ) const
  57941. {
  57942. return m_have_lock ;
  57943. }
  57944. inline operator void const * ( ) const
  57945. {
  57946. return locked ( ) ? this : 0 ;
  57947. }
  57948. void lock ( ) ;
  57949. void unlock ( ) ;
  57950. private :
  57951. static_mutex & m_mutex ;
  57952. bool m_have_lock ;
  57953. } ;
  57954.  
  57955. class static_mutex
  57956. {
  57957. public :
  57958. typedef scoped_static_mutex_lock scoped_lock ;
  57959. pthread_mutex_t m_mutex ;
  57960. } ;
  57961.  
  57962. }
  57963. #1 "./boost/regex/v4/primary_transform.hpp"
  57964. #34
  57965. namespace boost {
  57966. namespace re_detail {
  57967.  
  57968.  
  57969. enum {
  57970. sort_C ,
  57971. sort_fixed ,
  57972. sort_delim ,
  57973. sort_unknown
  57974. } ;
  57975.  
  57976. template < class S , class charT >
  57977. unsigned count_chars ( const S & s , charT c )
  57978. {
  57979. #54
  57980. unsigned int count = 0 ;
  57981. for ( unsigned pos = 0 ; pos < s . size ( ) ; ++ pos )
  57982. {
  57983. if ( s [ pos ] == c ) ++ count ;
  57984. }
  57985. return count ;
  57986. }
  57987.  
  57988.  
  57989. template < class traits , class charT >
  57990. unsigned find_sort_syntax ( const traits * pt , charT * delim )
  57991. {
  57992.  
  57993.  
  57994.  
  57995.  
  57996. typedef typename traits :: string_type string_type ;
  57997. typedef typename traits :: char_type char_type ;
  57998.  
  57999.  
  58000. ( void ) pt ;
  58001.  
  58002. char_type a [ 2 ] = { 'a' , '\0' , } ;
  58003. string_type sa ( pt -> transform ( a , a + 1 ) ) ;
  58004. if ( sa == a )
  58005. {
  58006. * delim = 0 ;
  58007. return sort_C ;
  58008. }
  58009. char_type A [ 2 ] = { 'A' , '\0' , } ;
  58010. string_type sA ( pt -> transform ( A , A + 1 ) ) ;
  58011. char_type c [ 2 ] = { ';' , '\0' , } ;
  58012. string_type sc ( pt -> transform ( c , c + 1 ) ) ;
  58013.  
  58014. int pos = 0 ;
  58015. while ( ( pos <= static_cast < int > ( sa . size ( ) ) ) && ( pos <= static_cast < int > ( sA . size ( ) ) ) && ( sa [ pos
  58016. #89
  58017. ] == sA [ pos ] ) ) ++ pos ;
  58018. -- pos ;
  58019. if ( pos < 0 )
  58020. {
  58021. * delim = 0 ;
  58022. return sort_unknown ;
  58023. }
  58024.  
  58025.  
  58026.  
  58027.  
  58028. charT maybe_delim = sa [ pos ] ;
  58029. if ( ( pos != 0 ) && ( count_chars ( sa , maybe_delim ) == count_chars ( sA , maybe_delim ) ) && ( count_chars ( sa , maybe_delim
  58030. #101
  58031. ) == count_chars ( sc , maybe_delim ) ) )
  58032. {
  58033. * delim = maybe_delim ;
  58034. return sort_delim ;
  58035. }
  58036.  
  58037.  
  58038.  
  58039. if ( ( sa . size ( ) == sA . size ( ) ) && ( sa . size ( ) == sc . size ( ) ) )
  58040. {
  58041.  
  58042.  
  58043.  
  58044. * delim = static_cast < charT > ( ++ pos ) ;
  58045. return sort_fixed ;
  58046. }
  58047.  
  58048.  
  58049.  
  58050. * delim = 0 ;
  58051. return sort_unknown ;
  58052. }
  58053.  
  58054.  
  58055. }
  58056. }
  58057. #1 "./boost/regex/pending/object_cache.hpp"
  58058. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/list"
  58059. #58
  58060. #pragma GCC system_header
  58061. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_list.h"
  58062. #64
  58063. namespace std
  58064. {
  58065. namespace __detail
  58066. {
  58067. #77
  58068. struct _List_node_base
  58069. {
  58070. _List_node_base * _M_next ;
  58071. _List_node_base * _M_prev ;
  58072.  
  58073. static void
  58074. swap ( _List_node_base & __x , _List_node_base & __y ) noexcept ;
  58075.  
  58076. void
  58077. _M_transfer ( _List_node_base * const __first ,
  58078. _List_node_base * const __last ) noexcept ;
  58079.  
  58080. void
  58081. _M_reverse ( ) noexcept ;
  58082.  
  58083. void
  58084. _M_hook ( _List_node_base * const __position ) noexcept ;
  58085.  
  58086. void
  58087. _M_unhook ( ) noexcept ;
  58088. } ;
  58089.  
  58090.  
  58091. }
  58092.  
  58093.  
  58094.  
  58095.  
  58096. template < typename _Tp >
  58097. struct _List_node : public __detail :: _List_node_base
  58098. {
  58099.  
  58100. _Tp _M_data ;
  58101.  
  58102.  
  58103. template < typename ... _Args >
  58104. _List_node ( _Args && ... __args )
  58105. : __detail :: _List_node_base ( ) , _M_data ( std :: forward < _Args > ( __args ) ... )
  58106. { }
  58107.  
  58108. } ;
  58109. #124
  58110. template < typename _Tp >
  58111. struct _List_iterator
  58112. {
  58113. typedef _List_iterator < _Tp > _Self ;
  58114. typedef _List_node < _Tp > _Node ;
  58115.  
  58116. typedef ptrdiff_t difference_type ;
  58117. typedef std :: bidirectional_iterator_tag iterator_category ;
  58118. typedef _Tp value_type ;
  58119. typedef _Tp * pointer ;
  58120. typedef _Tp & reference ;
  58121.  
  58122. _List_iterator ( )
  58123. : _M_node ( ) { }
  58124.  
  58125. explicit
  58126. _List_iterator ( __detail :: _List_node_base * __x )
  58127. : _M_node ( __x ) { }
  58128.  
  58129.  
  58130. reference
  58131. operator * ( ) const
  58132. { return static_cast < _Node * > ( _M_node ) -> _M_data ; }
  58133.  
  58134. pointer
  58135. operator -> ( ) const
  58136. { return std :: __addressof ( static_cast < _Node * > ( _M_node ) -> _M_data ) ; }
  58137.  
  58138. _Self &
  58139. operator ++ ( )
  58140. {
  58141. _M_node = _M_node -> _M_next ;
  58142. return * this ;
  58143. }
  58144.  
  58145. _Self
  58146. operator ++ ( int )
  58147. {
  58148. _Self __tmp = * this ;
  58149. _M_node = _M_node -> _M_next ;
  58150. return __tmp ;
  58151. }
  58152.  
  58153. _Self &
  58154. operator -- ( )
  58155. {
  58156. _M_node = _M_node -> _M_prev ;
  58157. return * this ;
  58158. }
  58159.  
  58160. _Self
  58161. operator -- ( int )
  58162. {
  58163. _Self __tmp = * this ;
  58164. _M_node = _M_node -> _M_prev ;
  58165. return __tmp ;
  58166. }
  58167.  
  58168. bool
  58169. operator == ( const _Self & __x ) const
  58170. { return _M_node == __x . _M_node ; }
  58171.  
  58172. bool
  58173. operator != ( const _Self & __x ) const
  58174. { return _M_node != __x . _M_node ; }
  58175.  
  58176.  
  58177. __detail :: _List_node_base * _M_node ;
  58178. } ;
  58179. #199
  58180. template < typename _Tp >
  58181. struct _List_const_iterator
  58182. {
  58183. typedef _List_const_iterator < _Tp > _Self ;
  58184. typedef const _List_node < _Tp > _Node ;
  58185. typedef _List_iterator < _Tp > iterator ;
  58186.  
  58187. typedef ptrdiff_t difference_type ;
  58188. typedef std :: bidirectional_iterator_tag iterator_category ;
  58189. typedef _Tp value_type ;
  58190. typedef const _Tp * pointer ;
  58191. typedef const _Tp & reference ;
  58192.  
  58193. _List_const_iterator ( )
  58194. : _M_node ( ) { }
  58195.  
  58196. explicit
  58197. _List_const_iterator ( const __detail :: _List_node_base * __x )
  58198. : _M_node ( __x ) { }
  58199.  
  58200. _List_const_iterator ( const iterator & __x )
  58201. : _M_node ( __x . _M_node ) { }
  58202.  
  58203.  
  58204.  
  58205. reference
  58206. operator * ( ) const
  58207. { return static_cast < _Node * > ( _M_node ) -> _M_data ; }
  58208.  
  58209. pointer
  58210. operator -> ( ) const
  58211. { return std :: __addressof ( static_cast < _Node * > ( _M_node ) -> _M_data ) ; }
  58212.  
  58213. _Self &
  58214. operator ++ ( )
  58215. {
  58216. _M_node = _M_node -> _M_next ;
  58217. return * this ;
  58218. }
  58219.  
  58220. _Self
  58221. operator ++ ( int )
  58222. {
  58223. _Self __tmp = * this ;
  58224. _M_node = _M_node -> _M_next ;
  58225. return __tmp ;
  58226. }
  58227.  
  58228. _Self &
  58229. operator -- ( )
  58230. {
  58231. _M_node = _M_node -> _M_prev ;
  58232. return * this ;
  58233. }
  58234.  
  58235. _Self
  58236. operator -- ( int )
  58237. {
  58238. _Self __tmp = * this ;
  58239. _M_node = _M_node -> _M_prev ;
  58240. return __tmp ;
  58241. }
  58242.  
  58243. bool
  58244. operator == ( const _Self & __x ) const
  58245. { return _M_node == __x . _M_node ; }
  58246.  
  58247. bool
  58248. operator != ( const _Self & __x ) const
  58249. { return _M_node != __x . _M_node ; }
  58250.  
  58251.  
  58252. const __detail :: _List_node_base * _M_node ;
  58253. } ;
  58254.  
  58255. template < typename _Val >
  58256. inline bool
  58257. operator == ( const _List_iterator < _Val > & __x ,
  58258. const _List_const_iterator < _Val > & __y )
  58259. { return __x . _M_node == __y . _M_node ; }
  58260.  
  58261. template < typename _Val >
  58262. inline bool
  58263. operator != ( const _List_iterator < _Val > & __x ,
  58264. const _List_const_iterator < _Val > & __y )
  58265. { return __x . _M_node != __y . _M_node ; }
  58266.  
  58267.  
  58268.  
  58269. template < typename _Tp , typename _Alloc >
  58270. class _List_base
  58271. {
  58272. protected :
  58273. #305
  58274. typedef typename _Alloc :: template rebind < _List_node < _Tp > > :: other
  58275. _Node_alloc_type ;
  58276.  
  58277. typedef typename _Alloc :: template rebind < _Tp > :: other _Tp_alloc_type ;
  58278.  
  58279. struct _List_impl
  58280. : public _Node_alloc_type
  58281. {
  58282. __detail :: _List_node_base _M_node ;
  58283.  
  58284. _List_impl ( )
  58285. : _Node_alloc_type ( ) , _M_node ( )
  58286. { }
  58287.  
  58288. _List_impl ( const _Node_alloc_type & __a )
  58289. : _Node_alloc_type ( __a ) , _M_node ( )
  58290. { }
  58291.  
  58292.  
  58293. _List_impl ( _Node_alloc_type && __a )
  58294. : _Node_alloc_type ( std :: move ( __a ) ) , _M_node ( )
  58295. { }
  58296.  
  58297. } ;
  58298.  
  58299. _List_impl _M_impl ;
  58300.  
  58301. _List_node < _Tp > *
  58302. _M_get_node ( )
  58303. { return _M_impl . _Node_alloc_type :: allocate ( 1 ) ; }
  58304.  
  58305. void
  58306. _M_put_node ( _List_node < _Tp > * __p )
  58307. { _M_impl . _Node_alloc_type :: deallocate ( __p , 1 ) ; }
  58308.  
  58309. public :
  58310. typedef _Alloc allocator_type ;
  58311.  
  58312. _Node_alloc_type &
  58313. _M_get_Node_allocator ( ) noexcept
  58314. { return * static_cast < _Node_alloc_type * > ( & _M_impl ) ; }
  58315.  
  58316. const _Node_alloc_type &
  58317. _M_get_Node_allocator ( ) const noexcept
  58318. { return * static_cast < const _Node_alloc_type * > ( & _M_impl ) ; }
  58319.  
  58320. _Tp_alloc_type
  58321. _M_get_Tp_allocator ( ) const noexcept
  58322. { return _Tp_alloc_type ( _M_get_Node_allocator ( ) ) ; }
  58323.  
  58324. allocator_type
  58325. get_allocator ( ) const noexcept
  58326. { return allocator_type ( _M_get_Node_allocator ( ) ) ; }
  58327.  
  58328. _List_base ( )
  58329. : _M_impl ( )
  58330. { _M_init ( ) ; }
  58331.  
  58332. _List_base ( const _Node_alloc_type & __a )
  58333. : _M_impl ( __a )
  58334. { _M_init ( ) ; }
  58335.  
  58336.  
  58337. _List_base ( _List_base && __x )
  58338. : _M_impl ( std :: move ( __x . _M_get_Node_allocator ( ) ) )
  58339. {
  58340. _M_init ( ) ;
  58341. __detail :: _List_node_base :: swap ( _M_impl . _M_node , __x . _M_impl . _M_node ) ;
  58342. }
  58343.  
  58344.  
  58345.  
  58346. ~ _List_base ( ) noexcept
  58347. { _M_clear ( ) ; }
  58348.  
  58349. void
  58350. _M_clear ( ) ;
  58351.  
  58352. void
  58353. _M_init ( )
  58354. {
  58355. this -> _M_impl . _M_node . _M_next = & this -> _M_impl . _M_node ;
  58356. this -> _M_impl . _M_node . _M_prev = & this -> _M_impl . _M_node ;
  58357. }
  58358. } ;
  58359. #437
  58360. template < typename _Tp , typename _Alloc = std :: allocator < _Tp > >
  58361. class list : protected _List_base < _Tp , _Alloc >
  58362. {
  58363.  
  58364. typedef typename _Alloc :: value_type _Alloc_value_type ;
  58365.  
  58366.  
  58367.  
  58368. typedef _List_base < _Tp , _Alloc > _Base ;
  58369. typedef typename _Base :: _Tp_alloc_type _Tp_alloc_type ;
  58370. typedef typename _Base :: _Node_alloc_type _Node_alloc_type ;
  58371.  
  58372. public :
  58373. typedef _Tp value_type ;
  58374. typedef typename _Tp_alloc_type :: pointer pointer ;
  58375. typedef typename _Tp_alloc_type :: const_pointer const_pointer ;
  58376. typedef typename _Tp_alloc_type :: reference reference ;
  58377. typedef typename _Tp_alloc_type :: const_reference const_reference ;
  58378. typedef _List_iterator < _Tp > iterator ;
  58379. typedef _List_const_iterator < _Tp > const_iterator ;
  58380. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  58381. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  58382. typedef size_t size_type ;
  58383. typedef ptrdiff_t difference_type ;
  58384. typedef _Alloc allocator_type ;
  58385.  
  58386. protected :
  58387.  
  58388.  
  58389. typedef _List_node < _Tp > _Node ;
  58390.  
  58391. using _Base :: _M_impl ;
  58392. using _Base :: _M_put_node ;
  58393. using _Base :: _M_get_node ;
  58394. using _Base :: _M_get_Tp_allocator ;
  58395. using _Base :: _M_get_Node_allocator ;
  58396. #498
  58397. template < typename ... _Args >
  58398. _Node *
  58399. _M_create_node ( _Args && ... __args )
  58400. {
  58401. _Node * __p = this -> _M_get_node ( ) ;
  58402. try
  58403. {
  58404. _M_get_Node_allocator ( ) . construct ( __p ,
  58405. std :: forward < _Args > ( __args ) ... ) ;
  58406. }
  58407. catch ( ... )
  58408. {
  58409. _M_put_node ( __p ) ;
  58410. throw ;
  58411. }
  58412. return __p ;
  58413. }
  58414.  
  58415.  
  58416. public :
  58417.  
  58418.  
  58419.  
  58420.  
  58421.  
  58422. list ( )
  58423. : _Base ( ) { }
  58424.  
  58425.  
  58426.  
  58427.  
  58428.  
  58429. explicit
  58430. list ( const allocator_type & __a )
  58431. : _Base ( _Node_alloc_type ( __a ) ) { }
  58432. #542
  58433. explicit
  58434. list ( size_type __n )
  58435. : _Base ( )
  58436. { _M_default_initialize ( __n ) ; }
  58437. #555
  58438. list ( size_type __n , const value_type & __value ,
  58439. const allocator_type & __a = allocator_type ( ) )
  58440. : _Base ( _Node_alloc_type ( __a ) )
  58441. { _M_fill_initialize ( __n , __value ) ; }
  58442. #582
  58443. list ( const list & __x )
  58444. : _Base ( __x . _M_get_Node_allocator ( ) )
  58445. { _M_initialize_dispatch ( __x . begin ( ) , __x . end ( ) , __false_type ( ) ) ; }
  58446. #594
  58447. list ( list && __x ) noexcept
  58448. : _Base ( std :: move ( __x ) ) { }
  58449. #605
  58450. list ( initializer_list < value_type > __l ,
  58451. const allocator_type & __a = allocator_type ( ) )
  58452. : _Base ( _Node_alloc_type ( __a ) )
  58453. { _M_initialize_dispatch ( __l . begin ( ) , __l . end ( ) , __false_type ( ) ) ; }
  58454. #622
  58455. template < typename _InputIterator ,
  58456. typename = std :: _RequireInputIter < _InputIterator >>
  58457. list ( _InputIterator __first , _InputIterator __last ,
  58458. const allocator_type & __a = allocator_type ( ) )
  58459. : _Base ( _Node_alloc_type ( __a ) )
  58460. { _M_initialize_dispatch ( __first , __last , __false_type ( ) ) ; }
  58461. #655
  58462. list &
  58463. operator = ( const list & __x ) ;
  58464. #666
  58465. list &
  58466. operator = ( list && __x )
  58467. {
  58468.  
  58469.  
  58470. this -> clear ( ) ;
  58471. this -> swap ( __x ) ;
  58472. return * this ;
  58473. }
  58474. #683
  58475. list &
  58476. operator = ( initializer_list < value_type > __l )
  58477. {
  58478. this -> assign ( __l . begin ( ) , __l . end ( ) ) ;
  58479. return * this ;
  58480. }
  58481. #701
  58482. void
  58483. assign ( size_type __n , const value_type & __val )
  58484. { _M_fill_assign ( __n , __val ) ; }
  58485. #718
  58486. template < typename _InputIterator ,
  58487. typename = std :: _RequireInputIter < _InputIterator >>
  58488. void
  58489. assign ( _InputIterator __first , _InputIterator __last )
  58490. { _M_assign_dispatch ( __first , __last , __false_type ( ) ) ; }
  58491. #742
  58492. void
  58493. assign ( initializer_list < value_type > __l )
  58494. { this -> assign ( __l . begin ( ) , __l . end ( ) ) ; }
  58495.  
  58496.  
  58497.  
  58498. allocator_type
  58499. get_allocator ( ) const noexcept
  58500. { return _Base :: get_allocator ( ) ; }
  58501. #757
  58502. iterator
  58503. begin ( ) noexcept
  58504. { return iterator ( this -> _M_impl . _M_node . _M_next ) ; }
  58505. #766
  58506. const_iterator
  58507. begin ( ) const noexcept
  58508. { return const_iterator ( this -> _M_impl . _M_node . _M_next ) ; }
  58509. #775
  58510. iterator
  58511. end ( ) noexcept
  58512. { return iterator ( & this -> _M_impl . _M_node ) ; }
  58513. #784
  58514. const_iterator
  58515. end ( ) const noexcept
  58516. { return const_iterator ( & this -> _M_impl . _M_node ) ; }
  58517. #793
  58518. reverse_iterator
  58519. rbegin ( ) noexcept
  58520. { return reverse_iterator ( end ( ) ) ; }
  58521. #802
  58522. const_reverse_iterator
  58523. rbegin ( ) const noexcept
  58524. { return const_reverse_iterator ( end ( ) ) ; }
  58525. #811
  58526. reverse_iterator
  58527. rend ( ) noexcept
  58528. { return reverse_iterator ( begin ( ) ) ; }
  58529. #820
  58530. const_reverse_iterator
  58531. rend ( ) const noexcept
  58532. { return const_reverse_iterator ( begin ( ) ) ; }
  58533. #830
  58534. const_iterator
  58535. cbegin ( ) const noexcept
  58536. { return const_iterator ( this -> _M_impl . _M_node . _M_next ) ; }
  58537. #839
  58538. const_iterator
  58539. cend ( ) const noexcept
  58540. { return const_iterator ( & this -> _M_impl . _M_node ) ; }
  58541. #848
  58542. const_reverse_iterator
  58543. crbegin ( ) const noexcept
  58544. { return const_reverse_iterator ( end ( ) ) ; }
  58545. #857
  58546. const_reverse_iterator
  58547. crend ( ) const noexcept
  58548. { return const_reverse_iterator ( begin ( ) ) ; }
  58549. #867
  58550. bool
  58551. empty ( ) const noexcept
  58552. { return this -> _M_impl . _M_node . _M_next == & this -> _M_impl . _M_node ; }
  58553.  
  58554.  
  58555. size_type
  58556. size ( ) const noexcept
  58557. { return std :: distance ( begin ( ) , end ( ) ) ; }
  58558.  
  58559.  
  58560. size_type
  58561. max_size ( ) const noexcept
  58562. { return _M_get_Node_allocator ( ) . max_size ( ) ; }
  58563. #891
  58564. void
  58565. resize ( size_type __new_size ) ;
  58566. #904
  58567. void
  58568. resize ( size_type __new_size , const value_type & __x ) ;
  58569. #926
  58570. reference
  58571. front ( )
  58572. { return * begin ( ) ; }
  58573.  
  58574.  
  58575.  
  58576.  
  58577.  
  58578. const_reference
  58579. front ( ) const
  58580. { return * begin ( ) ; }
  58581.  
  58582.  
  58583.  
  58584.  
  58585.  
  58586. reference
  58587. back ( )
  58588. {
  58589. iterator __tmp = end ( ) ;
  58590. -- __tmp ;
  58591. return * __tmp ;
  58592. }
  58593.  
  58594.  
  58595.  
  58596.  
  58597.  
  58598. const_reference
  58599. back ( ) const
  58600. {
  58601. const_iterator __tmp = end ( ) ;
  58602. -- __tmp ;
  58603. return * __tmp ;
  58604. }
  58605. #973
  58606. void
  58607. push_front ( const value_type & __x )
  58608. { this -> _M_insert ( begin ( ) , __x ) ; }
  58609.  
  58610.  
  58611. void
  58612. push_front ( value_type && __x )
  58613. { this -> _M_insert ( begin ( ) , std :: move ( __x ) ) ; }
  58614.  
  58615. template < typename ... _Args >
  58616. void
  58617. emplace_front ( _Args && ... __args )
  58618. { this -> _M_insert ( begin ( ) , std :: forward < _Args > ( __args ) ... ) ; }
  58619. #1000
  58620. void
  58621. pop_front ( )
  58622. { this -> _M_erase ( begin ( ) ) ; }
  58623. #1014
  58624. void
  58625. push_back ( const value_type & __x )
  58626. { this -> _M_insert ( end ( ) , __x ) ; }
  58627.  
  58628.  
  58629. void
  58630. push_back ( value_type && __x )
  58631. { this -> _M_insert ( end ( ) , std :: move ( __x ) ) ; }
  58632.  
  58633. template < typename ... _Args >
  58634. void
  58635. emplace_back ( _Args && ... __args )
  58636. { this -> _M_insert ( end ( ) , std :: forward < _Args > ( __args ) ... ) ; }
  58637. #1040
  58638. void
  58639. pop_back ( )
  58640. { this -> _M_erase ( iterator ( this -> _M_impl . _M_node . _M_prev ) ) ; }
  58641. #1057
  58642. template < typename ... _Args >
  58643. iterator
  58644. emplace ( iterator __position , _Args && ... __args ) ;
  58645. #1073
  58646. iterator
  58647. insert ( iterator __position , const value_type & __x ) ;
  58648. #1088
  58649. iterator
  58650. insert ( iterator __position , value_type && __x )
  58651. { return emplace ( __position , std :: move ( __x ) ) ; }
  58652. #1105
  58653. void
  58654. insert ( iterator __p , initializer_list < value_type > __l )
  58655. { this -> insert ( __p , __l . begin ( ) , __l . end ( ) ) ; }
  58656. #1122
  58657. void
  58658. insert ( iterator __position , size_type __n , const value_type & __x )
  58659. {
  58660. list __tmp ( __n , __x , get_allocator ( ) ) ;
  58661. splice ( __position , __tmp ) ;
  58662. }
  58663. #1143
  58664. template < typename _InputIterator ,
  58665. typename = std :: _RequireInputIter < _InputIterator >>
  58666.  
  58667.  
  58668.  
  58669. void
  58670. insert ( iterator __position , _InputIterator __first ,
  58671. _InputIterator __last )
  58672. {
  58673. list __tmp ( __first , __last , get_allocator ( ) ) ;
  58674. splice ( __position , __tmp ) ;
  58675. }
  58676. #1171
  58677. iterator
  58678. erase ( iterator __position ) ;
  58679. #1192
  58680. iterator
  58681. erase ( iterator __first , iterator __last )
  58682. {
  58683. while ( __first != __last )
  58684. __first = erase ( __first ) ;
  58685. return __last ;
  58686. }
  58687. #1209
  58688. void
  58689. swap ( list & __x )
  58690. {
  58691. __detail :: _List_node_base :: swap ( this -> _M_impl . _M_node ,
  58692. __x . _M_impl . _M_node ) ;
  58693.  
  58694.  
  58695.  
  58696. std :: __alloc_swap < typename _Base :: _Node_alloc_type > ::
  58697. _S_do_it ( _M_get_Node_allocator ( ) , __x . _M_get_Node_allocator ( ) ) ;
  58698. }
  58699. #1227
  58700. void
  58701. clear ( ) noexcept
  58702. {
  58703. _Base :: _M_clear ( ) ;
  58704. _Base :: _M_init ( ) ;
  58705. }
  58706. #1246
  58707. void
  58708.  
  58709. splice ( iterator __position , list && __x )
  58710.  
  58711.  
  58712.  
  58713. {
  58714. if ( ! __x . empty ( ) )
  58715. {
  58716. _M_check_equal_allocators ( __x ) ;
  58717.  
  58718. this -> _M_transfer ( __position , __x . begin ( ) , __x . end ( ) ) ;
  58719. }
  58720. }
  58721.  
  58722.  
  58723. void
  58724. splice ( iterator __position , list & __x )
  58725. { splice ( __position , std :: move ( __x ) ) ; }
  58726. #1276
  58727. void
  58728.  
  58729. splice ( iterator __position , list && __x , iterator __i )
  58730.  
  58731.  
  58732.  
  58733. {
  58734. iterator __j = __i ;
  58735. ++ __j ;
  58736. if ( __position == __i || __position == __j )
  58737. return ;
  58738.  
  58739. if ( this != & __x )
  58740. _M_check_equal_allocators ( __x ) ;
  58741.  
  58742. this -> _M_transfer ( __position , __i , __j ) ;
  58743. }
  58744.  
  58745.  
  58746. void
  58747. splice ( iterator __position , list & __x , iterator __i )
  58748. { splice ( __position , std :: move ( __x ) , __i ) ; }
  58749. #1312
  58750. void
  58751.  
  58752. splice ( iterator __position , list && __x , iterator __first ,
  58753. iterator __last )
  58754.  
  58755.  
  58756.  
  58757.  
  58758. {
  58759. if ( __first != __last )
  58760. {
  58761. if ( this != & __x )
  58762. _M_check_equal_allocators ( __x ) ;
  58763.  
  58764. this -> _M_transfer ( __position , __first , __last ) ;
  58765. }
  58766. }
  58767.  
  58768.  
  58769. void
  58770. splice ( iterator __position , list & __x , iterator __first , iterator __last )
  58771. { splice ( __position , std :: move ( __x ) , __first , __last ) ; }
  58772. #1347
  58773. void
  58774. remove ( const _Tp & __value ) ;
  58775. #1361
  58776. template < typename _Predicate >
  58777. void
  58778. remove_if ( _Predicate ) ;
  58779. #1375
  58780. void
  58781. unique ( ) ;
  58782. #1390
  58783. template < typename _BinaryPredicate >
  58784. void
  58785. unique ( _BinaryPredicate ) ;
  58786. #1404
  58787. void
  58788. merge ( list && __x ) ;
  58789.  
  58790. void
  58791. merge ( list & __x )
  58792. { merge ( std :: move ( __x ) ) ; }
  58793. #1429
  58794. template < typename _StrictWeakOrdering >
  58795. void
  58796. merge ( list && __x , _StrictWeakOrdering __comp ) ;
  58797.  
  58798. template < typename _StrictWeakOrdering >
  58799. void
  58800. merge ( list & __x , _StrictWeakOrdering __comp )
  58801. { merge ( std :: move ( __x ) , __comp ) ; }
  58802. #1448
  58803. void
  58804. reverse ( ) noexcept
  58805. { this -> _M_impl . _M_node . _M_reverse ( ) ; }
  58806. #1458
  58807. void
  58808. sort ( ) ;
  58809. #1467
  58810. template < typename _StrictWeakOrdering >
  58811. void
  58812. sort ( _StrictWeakOrdering ) ;
  58813.  
  58814. protected :
  58815. #1478
  58816. template < typename _Integer >
  58817. void
  58818. _M_initialize_dispatch ( _Integer __n , _Integer __x , __true_type )
  58819. { _M_fill_initialize ( static_cast < size_type > ( __n ) , __x ) ; }
  58820.  
  58821.  
  58822. template < typename _InputIterator >
  58823. void
  58824. _M_initialize_dispatch ( _InputIterator __first , _InputIterator __last ,
  58825. __false_type )
  58826. {
  58827. for ( ; __first != __last ; ++ __first )
  58828.  
  58829. emplace_back ( * __first ) ;
  58830.  
  58831.  
  58832.  
  58833. }
  58834.  
  58835.  
  58836.  
  58837. void
  58838. _M_fill_initialize ( size_type __n , const value_type & __x )
  58839. {
  58840. for ( ; __n ; -- __n )
  58841. push_back ( __x ) ;
  58842. }
  58843.  
  58844.  
  58845.  
  58846. void
  58847. _M_default_initialize ( size_type __n )
  58848. {
  58849. for ( ; __n ; -- __n )
  58850. emplace_back ( ) ;
  58851. }
  58852.  
  58853.  
  58854. void
  58855. _M_default_append ( size_type __n ) ;
  58856. #1526
  58857. template < typename _Integer >
  58858. void
  58859. _M_assign_dispatch ( _Integer __n , _Integer __val , __true_type )
  58860. { _M_fill_assign ( __n , __val ) ; }
  58861.  
  58862.  
  58863. template < typename _InputIterator >
  58864. void
  58865. _M_assign_dispatch ( _InputIterator __first , _InputIterator __last ,
  58866. __false_type ) ;
  58867.  
  58868.  
  58869.  
  58870. void
  58871. _M_fill_assign ( size_type __n , const value_type & __val ) ;
  58872.  
  58873.  
  58874.  
  58875. void
  58876. _M_transfer ( iterator __position , iterator __first , iterator __last )
  58877. { __position . _M_node -> _M_transfer ( __first . _M_node , __last . _M_node ) ; }
  58878. #1557
  58879. template < typename ... _Args >
  58880. void
  58881. _M_insert ( iterator __position , _Args && ... __args )
  58882. {
  58883. _Node * __tmp = _M_create_node ( std :: forward < _Args > ( __args ) ... ) ;
  58884. __tmp -> _M_hook ( __position . _M_node ) ;
  58885. }
  58886.  
  58887.  
  58888.  
  58889. void
  58890. _M_erase ( iterator __position )
  58891. {
  58892. __position . _M_node -> _M_unhook ( ) ;
  58893. _Node * __n = static_cast < _Node * > ( __position . _M_node ) ;
  58894.  
  58895. _M_get_Node_allocator ( ) . destroy ( __n ) ;
  58896.  
  58897.  
  58898.  
  58899. _M_put_node ( __n ) ;
  58900. }
  58901.  
  58902.  
  58903. void
  58904. _M_check_equal_allocators ( list & __x )
  58905. {
  58906. if ( std :: __alloc_neq < typename _Base :: _Node_alloc_type > ::
  58907. _S_do_it ( _M_get_Node_allocator ( ) , __x . _M_get_Node_allocator ( ) ) )
  58908. __throw_runtime_error ( ( "list::_M_check_equal_allocators" ) ) ;
  58909. }
  58910. } ;
  58911. #1600
  58912. template < typename _Tp , typename _Alloc >
  58913. inline bool
  58914. operator == ( const list < _Tp , _Alloc > & __x , const list < _Tp , _Alloc > & __y )
  58915. {
  58916. typedef typename list < _Tp , _Alloc > :: const_iterator const_iterator ;
  58917. const_iterator __end1 = __x . end ( ) ;
  58918. const_iterator __end2 = __y . end ( ) ;
  58919.  
  58920. const_iterator __i1 = __x . begin ( ) ;
  58921. const_iterator __i2 = __y . begin ( ) ;
  58922. while ( __i1 != __end1 && __i2 != __end2 && * __i1 == * __i2 )
  58923. {
  58924. ++ __i1 ;
  58925. ++ __i2 ;
  58926. }
  58927. return __i1 == __end1 && __i2 == __end2 ;
  58928. }
  58929. #1629
  58930. template < typename _Tp , typename _Alloc >
  58931. inline bool
  58932. operator < ( const list < _Tp , _Alloc > & __x , const list < _Tp , _Alloc > & __y )
  58933. { return std :: lexicographical_compare ( __x . begin ( ) , __x . end ( ) ,
  58934. __y . begin ( ) , __y . end ( ) ) ; }
  58935.  
  58936.  
  58937. template < typename _Tp , typename _Alloc >
  58938. inline bool
  58939. operator != ( const list < _Tp , _Alloc > & __x , const list < _Tp , _Alloc > & __y )
  58940. { return ! ( __x == __y ) ; }
  58941.  
  58942.  
  58943. template < typename _Tp , typename _Alloc >
  58944. inline bool
  58945. operator > ( const list < _Tp , _Alloc > & __x , const list < _Tp , _Alloc > & __y )
  58946. { return __y < __x ; }
  58947.  
  58948.  
  58949. template < typename _Tp , typename _Alloc >
  58950. inline bool
  58951. operator <= ( const list < _Tp , _Alloc > & __x , const list < _Tp , _Alloc > & __y )
  58952. { return ! ( __y < __x ) ; }
  58953.  
  58954.  
  58955. template < typename _Tp , typename _Alloc >
  58956. inline bool
  58957. operator >= ( const list < _Tp , _Alloc > & __x , const list < _Tp , _Alloc > & __y )
  58958. { return ! ( __x < __y ) ; }
  58959.  
  58960.  
  58961. template < typename _Tp , typename _Alloc >
  58962. inline void
  58963. swap ( list < _Tp , _Alloc > & __x , list < _Tp , _Alloc > & __y )
  58964. { __x . swap ( __y ) ; }
  58965.  
  58966.  
  58967. }
  58968. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/list.tcc"
  58969. #59
  58970. namespace std
  58971. {
  58972.  
  58973.  
  58974. template < typename _Tp , typename _Alloc >
  58975. void
  58976. _List_base < _Tp , _Alloc > ::
  58977. _M_clear ( )
  58978. {
  58979. typedef _List_node < _Tp > _Node ;
  58980. _Node * __cur = static_cast < _Node * > ( _M_impl . _M_node . _M_next ) ;
  58981. while ( __cur != & _M_impl . _M_node )
  58982. {
  58983. _Node * __tmp = __cur ;
  58984. __cur = static_cast < _Node * > ( __cur -> _M_next ) ;
  58985.  
  58986. _M_get_Node_allocator ( ) . destroy ( __tmp ) ;
  58987.  
  58988.  
  58989.  
  58990. _M_put_node ( __tmp ) ;
  58991. }
  58992. }
  58993.  
  58994.  
  58995. template < typename _Tp , typename _Alloc >
  58996. template < typename ... _Args >
  58997. typename list < _Tp , _Alloc > :: iterator
  58998. list < _Tp , _Alloc > ::
  58999. emplace ( iterator __position , _Args && ... __args )
  59000. {
  59001. _Node * __tmp = _M_create_node ( std :: forward < _Args > ( __args ) ... ) ;
  59002. __tmp -> _M_hook ( __position . _M_node ) ;
  59003. return iterator ( __tmp ) ;
  59004. }
  59005.  
  59006.  
  59007. template < typename _Tp , typename _Alloc >
  59008. typename list < _Tp , _Alloc > :: iterator
  59009. list < _Tp , _Alloc > ::
  59010. insert ( iterator __position , const value_type & __x )
  59011. {
  59012. _Node * __tmp = _M_create_node ( __x ) ;
  59013. __tmp -> _M_hook ( __position . _M_node ) ;
  59014. return iterator ( __tmp ) ;
  59015. }
  59016.  
  59017. template < typename _Tp , typename _Alloc >
  59018. typename list < _Tp , _Alloc > :: iterator
  59019. list < _Tp , _Alloc > ::
  59020. erase ( iterator __position )
  59021. {
  59022. iterator __ret = iterator ( __position . _M_node -> _M_next ) ;
  59023. _M_erase ( __position ) ;
  59024. return __ret ;
  59025. }
  59026.  
  59027.  
  59028. template < typename _Tp , typename _Alloc >
  59029. void
  59030. list < _Tp , _Alloc > ::
  59031. _M_default_append ( size_type __n )
  59032. {
  59033. size_type __i = 0 ;
  59034. try
  59035. {
  59036. for ( ; __i < __n ; ++ __i )
  59037. emplace_back ( ) ;
  59038. }
  59039. catch ( ... )
  59040. {
  59041. for ( ; __i ; -- __i )
  59042. pop_back ( ) ;
  59043. throw ;
  59044. }
  59045. }
  59046.  
  59047. template < typename _Tp , typename _Alloc >
  59048. void
  59049. list < _Tp , _Alloc > ::
  59050. resize ( size_type __new_size )
  59051. {
  59052. iterator __i = begin ( ) ;
  59053. size_type __len = 0 ;
  59054. for ( ; __i != end ( ) && __len < __new_size ; ++ __i , ++ __len )
  59055. ;
  59056. if ( __len == __new_size )
  59057. erase ( __i , end ( ) ) ;
  59058. else
  59059. _M_default_append ( __new_size - __len ) ;
  59060. }
  59061.  
  59062. template < typename _Tp , typename _Alloc >
  59063. void
  59064. list < _Tp , _Alloc > ::
  59065. resize ( size_type __new_size , const value_type & __x )
  59066. {
  59067. iterator __i = begin ( ) ;
  59068. size_type __len = 0 ;
  59069. for ( ; __i != end ( ) && __len < __new_size ; ++ __i , ++ __len )
  59070. ;
  59071. if ( __len == __new_size )
  59072. erase ( __i , end ( ) ) ;
  59073. else
  59074. insert ( end ( ) , __new_size - __len , __x ) ;
  59075. }
  59076. #182
  59077. template < typename _Tp , typename _Alloc >
  59078. list < _Tp , _Alloc > &
  59079. list < _Tp , _Alloc > ::
  59080. operator = ( const list & __x )
  59081. {
  59082. if ( this != & __x )
  59083. {
  59084. iterator __first1 = begin ( ) ;
  59085. iterator __last1 = end ( ) ;
  59086. const_iterator __first2 = __x . begin ( ) ;
  59087. const_iterator __last2 = __x . end ( ) ;
  59088. for ( ; __first1 != __last1 && __first2 != __last2 ;
  59089. ++ __first1 , ++ __first2 )
  59090. * __first1 = * __first2 ;
  59091. if ( __first2 == __last2 )
  59092. erase ( __first1 , __last1 ) ;
  59093. else
  59094. insert ( __last1 , __first2 , __last2 ) ;
  59095. }
  59096. return * this ;
  59097. }
  59098.  
  59099. template < typename _Tp , typename _Alloc >
  59100. void
  59101. list < _Tp , _Alloc > ::
  59102. _M_fill_assign ( size_type __n , const value_type & __val )
  59103. {
  59104. iterator __i = begin ( ) ;
  59105. for ( ; __i != end ( ) && __n > 0 ; ++ __i , -- __n )
  59106. * __i = __val ;
  59107. if ( __n > 0 )
  59108. insert ( end ( ) , __n , __val ) ;
  59109. else
  59110. erase ( __i , end ( ) ) ;
  59111. }
  59112.  
  59113. template < typename _Tp , typename _Alloc >
  59114. template < typename _InputIterator >
  59115. void
  59116. list < _Tp , _Alloc > ::
  59117. _M_assign_dispatch ( _InputIterator __first2 , _InputIterator __last2 ,
  59118. __false_type )
  59119. {
  59120. iterator __first1 = begin ( ) ;
  59121. iterator __last1 = end ( ) ;
  59122. for ( ; __first1 != __last1 && __first2 != __last2 ;
  59123. ++ __first1 , ++ __first2 )
  59124. * __first1 = * __first2 ;
  59125. if ( __first2 == __last2 )
  59126. erase ( __first1 , __last1 ) ;
  59127. else
  59128. insert ( __last1 , __first2 , __last2 ) ;
  59129. }
  59130.  
  59131. template < typename _Tp , typename _Alloc >
  59132. void
  59133. list < _Tp , _Alloc > ::
  59134. remove ( const value_type & __value )
  59135. {
  59136. iterator __first = begin ( ) ;
  59137. iterator __last = end ( ) ;
  59138. iterator __extra = __last ;
  59139. while ( __first != __last )
  59140. {
  59141. iterator __next = __first ;
  59142. ++ __next ;
  59143. if ( * __first == __value )
  59144. {
  59145.  
  59146.  
  59147.  
  59148. if ( std :: __addressof ( * __first ) != std :: __addressof ( __value ) )
  59149. _M_erase ( __first ) ;
  59150. else
  59151. __extra = __first ;
  59152. }
  59153. __first = __next ;
  59154. }
  59155. if ( __extra != __last )
  59156. _M_erase ( __extra ) ;
  59157. }
  59158.  
  59159. template < typename _Tp , typename _Alloc >
  59160. void
  59161. list < _Tp , _Alloc > ::
  59162. unique ( )
  59163. {
  59164. iterator __first = begin ( ) ;
  59165. iterator __last = end ( ) ;
  59166. if ( __first == __last )
  59167. return ;
  59168. iterator __next = __first ;
  59169. while ( ++ __next != __last )
  59170. {
  59171. if ( * __first == * __next )
  59172. _M_erase ( __next ) ;
  59173. else
  59174. __first = __next ;
  59175. __next = __first ;
  59176. }
  59177. }
  59178.  
  59179. template < typename _Tp , typename _Alloc >
  59180. void
  59181. list < _Tp , _Alloc > ::
  59182.  
  59183. merge ( list && __x )
  59184.  
  59185.  
  59186.  
  59187. {
  59188.  
  59189.  
  59190. if ( this != & __x )
  59191. {
  59192. _M_check_equal_allocators ( __x ) ;
  59193.  
  59194. iterator __first1 = begin ( ) ;
  59195. iterator __last1 = end ( ) ;
  59196. iterator __first2 = __x . begin ( ) ;
  59197. iterator __last2 = __x . end ( ) ;
  59198. while ( __first1 != __last1 && __first2 != __last2 )
  59199. if ( * __first2 < * __first1 )
  59200. {
  59201. iterator __next = __first2 ;
  59202. _M_transfer ( __first1 , __first2 , ++ __next ) ;
  59203. __first2 = __next ;
  59204. }
  59205. else
  59206. ++ __first1 ;
  59207. if ( __first2 != __last2 )
  59208. _M_transfer ( __last1 , __first2 , __last2 ) ;
  59209. }
  59210. }
  59211.  
  59212. template < typename _Tp , typename _Alloc >
  59213. template < typename _StrictWeakOrdering >
  59214. void
  59215. list < _Tp , _Alloc > ::
  59216.  
  59217. merge ( list && __x , _StrictWeakOrdering __comp )
  59218.  
  59219.  
  59220.  
  59221. {
  59222.  
  59223.  
  59224. if ( this != & __x )
  59225. {
  59226. _M_check_equal_allocators ( __x ) ;
  59227.  
  59228. iterator __first1 = begin ( ) ;
  59229. iterator __last1 = end ( ) ;
  59230. iterator __first2 = __x . begin ( ) ;
  59231. iterator __last2 = __x . end ( ) ;
  59232. while ( __first1 != __last1 && __first2 != __last2 )
  59233. if ( __comp ( * __first2 , * __first1 ) )
  59234. {
  59235. iterator __next = __first2 ;
  59236. _M_transfer ( __first1 , __first2 , ++ __next ) ;
  59237. __first2 = __next ;
  59238. }
  59239. else
  59240. ++ __first1 ;
  59241. if ( __first2 != __last2 )
  59242. _M_transfer ( __last1 , __first2 , __last2 ) ;
  59243. }
  59244. }
  59245.  
  59246. template < typename _Tp , typename _Alloc >
  59247. void
  59248. list < _Tp , _Alloc > ::
  59249. sort ( )
  59250. {
  59251.  
  59252. if ( this -> _M_impl . _M_node . _M_next != & this -> _M_impl . _M_node
  59253. && this -> _M_impl . _M_node . _M_next -> _M_next != & this -> _M_impl . _M_node )
  59254. {
  59255. list __carry ;
  59256. list __tmp [ 64 ] ;
  59257. list * __fill = & __tmp [ 0 ] ;
  59258. list * __counter ;
  59259.  
  59260. do
  59261. {
  59262. __carry . splice ( __carry . begin ( ) , * this , begin ( ) ) ;
  59263.  
  59264. for ( __counter = & __tmp [ 0 ] ;
  59265. __counter != __fill && ! __counter -> empty ( ) ;
  59266. ++ __counter )
  59267. {
  59268. __counter -> merge ( __carry ) ;
  59269. __carry . swap ( * __counter ) ;
  59270. }
  59271. __carry . swap ( * __counter ) ;
  59272. if ( __counter == __fill )
  59273. ++ __fill ;
  59274. }
  59275. while ( ! empty ( ) ) ;
  59276.  
  59277. for ( __counter = & __tmp [ 1 ] ; __counter != __fill ; ++ __counter )
  59278. __counter -> merge ( * ( __counter - 1 ) ) ;
  59279. swap ( * ( __fill - 1 ) ) ;
  59280. }
  59281. }
  59282.  
  59283. template < typename _Tp , typename _Alloc >
  59284. template < typename _Predicate >
  59285. void
  59286. list < _Tp , _Alloc > ::
  59287. remove_if ( _Predicate __pred )
  59288. {
  59289. iterator __first = begin ( ) ;
  59290. iterator __last = end ( ) ;
  59291. while ( __first != __last )
  59292. {
  59293. iterator __next = __first ;
  59294. ++ __next ;
  59295. if ( __pred ( * __first ) )
  59296. _M_erase ( __first ) ;
  59297. __first = __next ;
  59298. }
  59299. }
  59300.  
  59301. template < typename _Tp , typename _Alloc >
  59302. template < typename _BinaryPredicate >
  59303. void
  59304. list < _Tp , _Alloc > ::
  59305. unique ( _BinaryPredicate __binary_pred )
  59306. {
  59307. iterator __first = begin ( ) ;
  59308. iterator __last = end ( ) ;
  59309. if ( __first == __last )
  59310. return ;
  59311. iterator __next = __first ;
  59312. while ( ++ __next != __last )
  59313. {
  59314. if ( __binary_pred ( * __first , * __next ) )
  59315. _M_erase ( __next ) ;
  59316. else
  59317. __first = __next ;
  59318. __next = __first ;
  59319. }
  59320. }
  59321.  
  59322. template < typename _Tp , typename _Alloc >
  59323. template < typename _StrictWeakOrdering >
  59324. void
  59325. list < _Tp , _Alloc > ::
  59326. sort ( _StrictWeakOrdering __comp )
  59327. {
  59328.  
  59329. if ( this -> _M_impl . _M_node . _M_next != & this -> _M_impl . _M_node
  59330. && this -> _M_impl . _M_node . _M_next -> _M_next != & this -> _M_impl . _M_node )
  59331. {
  59332. list __carry ;
  59333. list __tmp [ 64 ] ;
  59334. list * __fill = & __tmp [ 0 ] ;
  59335. list * __counter ;
  59336.  
  59337. do
  59338. {
  59339. __carry . splice ( __carry . begin ( ) , * this , begin ( ) ) ;
  59340.  
  59341. for ( __counter = & __tmp [ 0 ] ;
  59342. __counter != __fill && ! __counter -> empty ( ) ;
  59343. ++ __counter )
  59344. {
  59345. __counter -> merge ( __carry , __comp ) ;
  59346. __carry . swap ( * __counter ) ;
  59347. }
  59348. __carry . swap ( * __counter ) ;
  59349. if ( __counter == __fill )
  59350. ++ __fill ;
  59351. }
  59352. while ( ! empty ( ) ) ;
  59353.  
  59354. for ( __counter = & __tmp [ 1 ] ; __counter != __fill ; ++ __counter )
  59355. __counter -> merge ( * ( __counter - 1 ) , __comp ) ;
  59356. swap ( * ( __fill - 1 ) ) ;
  59357. }
  59358. }
  59359.  
  59360.  
  59361. }
  59362. #32 "./boost/regex/pending/object_cache.hpp"
  59363. namespace boost {
  59364.  
  59365. template < class Key , class Object >
  59366. class object_cache
  59367. {
  59368. public :
  59369. typedef std :: pair < :: boost :: shared_ptr < Object const > , Key const * > value_type ;
  59370. typedef std :: list < value_type > list_type ;
  59371. typedef typename list_type :: iterator list_iterator ;
  59372. typedef std :: map < Key , list_iterator > map_type ;
  59373. typedef typename map_type :: iterator map_iterator ;
  59374. typedef typename list_type :: size_type size_type ;
  59375. static boost :: shared_ptr < Object const > get ( const Key & k , size_type l_max_cache_size ) ;
  59376.  
  59377. private :
  59378. static boost :: shared_ptr < Object const > do_get ( const Key & k , size_type l_max_cache_size ) ;
  59379.  
  59380. struct data
  59381. {
  59382. list_type cont ;
  59383. map_type index ;
  59384. } ;
  59385.  
  59386.  
  59387.  
  59388. friend struct data ;
  59389. } ;
  59390.  
  59391. template < class Key , class Object >
  59392. boost :: shared_ptr < Object const > object_cache < Key , Object > :: get ( const Key & k , size_type l_max_cache_size )
  59393. #61
  59394.  
  59395. {
  59396.  
  59397. static boost :: static_mutex mut = { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } , } ;
  59398.  
  59399. boost :: static_mutex :: scoped_lock l ( mut ) ;
  59400. if ( l )
  59401. {
  59402. return do_get ( k , l_max_cache_size ) ;
  59403. }
  59404.  
  59405.  
  59406.  
  59407.  
  59408. :: boost :: throw_exception ( std :: runtime_error ( "Error in thread safety code: could not acquire a lock" ) ) ;
  59409. #82
  59410. }
  59411.  
  59412. template < class Key , class Object >
  59413. boost :: shared_ptr < Object const > object_cache < Key , Object > :: do_get ( const Key & k , size_type l_max_cache_size
  59414. #85
  59415. )
  59416. {
  59417. typedef typename object_cache < Key , Object > :: data object_data ;
  59418. typedef typename map_type :: size_type map_size_type ;
  59419. static object_data s_data ;
  59420.  
  59421.  
  59422.  
  59423.  
  59424. map_iterator mpos = s_data . index . find ( k ) ;
  59425. if ( mpos != s_data . index . end ( ) )
  59426. {
  59427.  
  59428.  
  59429.  
  59430.  
  59431. if ( -- ( s_data . cont . end ( ) ) != mpos -> second )
  59432. {
  59433.  
  59434. list_type temp ;
  59435. temp . splice ( temp . end ( ) , s_data . cont , mpos -> second ) ;
  59436.  
  59437. s_data . cont . splice ( s_data . cont . end ( ) , temp , temp . begin ( ) ) ;
  59438. ( ( void ) 0 ) ;
  59439.  
  59440. mpos -> second = -- ( s_data . cont . end ( ) ) ;
  59441. ( ( void ) 0 ) ;
  59442. ( ( void ) 0 ) ;
  59443. }
  59444. return s_data . cont . back ( ) . first ;
  59445. }
  59446.  
  59447.  
  59448.  
  59449.  
  59450. boost :: shared_ptr < Object const > result ( new Object ( k ) ) ;
  59451.  
  59452.  
  59453.  
  59454. s_data . cont . push_back ( value_type ( result , static_cast < Key const * > ( 0 ) ) ) ;
  59455. s_data . index . insert ( std :: make_pair ( k , -- ( s_data . cont . end ( ) ) ) ) ;
  59456. s_data . cont . back ( ) . second = & ( s_data . index . find ( k ) -> first ) ;
  59457. map_size_type s = s_data . index . size ( ) ;
  59458. ( ( void ) 0 ) ;
  59459. ( ( void ) 0 ) ;
  59460. ( ( void ) 0 ) ;
  59461. if ( s > l_max_cache_size )
  59462. {
  59463.  
  59464.  
  59465.  
  59466.  
  59467.  
  59468. list_iterator pos = s_data . cont . begin ( ) ;
  59469. list_iterator last = s_data . cont . end ( ) ;
  59470. while ( ( pos != last ) && ( s > l_max_cache_size ) )
  59471. {
  59472. if ( pos -> first . unique ( ) )
  59473. {
  59474. list_iterator condemmed ( pos ) ;
  59475. ++ pos ;
  59476.  
  59477.  
  59478. ( ( void ) 0 ) ;
  59479. s_data . index . erase ( * ( condemmed -> second ) ) ;
  59480. s_data . cont . erase ( condemmed ) ;
  59481. -- s ;
  59482. }
  59483. else
  59484. ++ pos ;
  59485. }
  59486. ( ( void ) 0 ) ;
  59487. ( ( void ) 0 ) ;
  59488. ( ( void ) 0 ) ;
  59489. }
  59490. return result ;
  59491. }
  59492.  
  59493. }
  59494. #63 "./boost/regex/v4/cpp_regex_traits.hpp"
  59495. namespace boost {
  59496.  
  59497.  
  59498.  
  59499.  
  59500. template < class charT >
  59501. class cpp_regex_traits ;
  59502.  
  59503. namespace re_detail {
  59504.  
  59505.  
  59506.  
  59507.  
  59508.  
  59509. template < class charT ,
  59510. class traits = :: std :: char_traits < charT > >
  59511. class parser_buf : public :: std :: basic_streambuf < charT , traits >
  59512. {
  59513. typedef :: std :: basic_streambuf < charT , traits > base_type ;
  59514. typedef typename base_type :: int_type int_type ;
  59515. typedef typename base_type :: char_type char_type ;
  59516. typedef typename base_type :: pos_type pos_type ;
  59517. typedef :: std :: streamsize streamsize ;
  59518. typedef typename base_type :: off_type off_type ;
  59519. public :
  59520. parser_buf ( ) : base_type ( ) { setbuf ( 0 , 0 ) ; }
  59521. const charT * getnext ( ) { return this -> gptr ( ) ; }
  59522. protected :
  59523. std :: basic_streambuf < charT , traits > * setbuf ( char_type * s , streamsize n ) ;
  59524. typename parser_buf < charT , traits > :: pos_type seekpos ( pos_type sp , :: std :: ios_base :: openmode which ) ;
  59525. typename parser_buf < charT , traits > :: pos_type seekoff ( off_type off , :: std :: ios_base :: seekdir way , :: std ::
  59526. #93
  59527. ios_base :: openmode which ) ;
  59528. private :
  59529. parser_buf & operator = ( const parser_buf & ) ;
  59530. parser_buf ( const parser_buf & ) ;
  59531. } ;
  59532.  
  59533. template < class charT , class traits >
  59534. std :: basic_streambuf < charT , traits > *
  59535. parser_buf < charT , traits > :: setbuf ( char_type * s , streamsize n )
  59536. {
  59537. this -> setg ( s , s , s + n ) ;
  59538. return this ;
  59539. }
  59540.  
  59541. template < class charT , class traits >
  59542. typename parser_buf < charT , traits > :: pos_type
  59543. parser_buf < charT , traits > :: seekoff ( off_type off , :: std :: ios_base :: seekdir way , :: std :: ios_base :: openmode
  59544. #109
  59545. which )
  59546. {
  59547. typedef typename boost :: int_t < sizeof ( way ) * 8 > :: least cast_type ;
  59548.  
  59549. if ( which & :: std :: ios_base :: out )
  59550. return pos_type ( off_type ( - 1 ) ) ;
  59551. std :: ptrdiff_t size = this -> egptr ( ) - this -> eback ( ) ;
  59552. std :: ptrdiff_t pos = this -> gptr ( ) - this -> eback ( ) ;
  59553. charT * g = this -> eback ( ) ;
  59554. switch ( static_cast < cast_type > ( way ) )
  59555. {
  59556. case :: std :: ios_base :: beg :
  59557. if ( ( off < 0 ) || ( off > size ) )
  59558. return pos_type ( off_type ( - 1 ) ) ;
  59559. else
  59560. this -> setg ( g , g + off , g + size ) ;
  59561. break ;
  59562. case :: std :: ios_base :: end :
  59563. if ( ( off < 0 ) || ( off > size ) )
  59564. return pos_type ( off_type ( - 1 ) ) ;
  59565. else
  59566. this -> setg ( g , g + size - off , g + size ) ;
  59567. break ;
  59568. case :: std :: ios_base :: cur :
  59569. {
  59570. std :: ptrdiff_t newpos = static_cast < std :: ptrdiff_t > ( pos + off ) ;
  59571. if ( ( newpos < 0 ) || ( newpos > size ) )
  59572. return pos_type ( off_type ( - 1 ) ) ;
  59573. else
  59574. this -> setg ( g , g + newpos , g + size ) ;
  59575. break ;
  59576. }
  59577. default : ;
  59578. }
  59579.  
  59580.  
  59581.  
  59582.  
  59583. return static_cast < pos_type > ( this -> gptr ( ) - this -> eback ( ) ) ;
  59584.  
  59585.  
  59586.  
  59587. }
  59588.  
  59589. template < class charT , class traits >
  59590. typename parser_buf < charT , traits > :: pos_type
  59591. parser_buf < charT , traits > :: seekpos ( pos_type sp , :: std :: ios_base :: openmode which )
  59592. {
  59593. if ( which & :: std :: ios_base :: out )
  59594. return pos_type ( off_type ( - 1 ) ) ;
  59595. off_type size = static_cast < off_type > ( this -> egptr ( ) - this -> eback ( ) ) ;
  59596. charT * g = this -> eback ( ) ;
  59597. if ( off_type ( sp ) <= size )
  59598. {
  59599. this -> setg ( g , g + off_type ( sp ) , g + size ) ;
  59600. }
  59601. return pos_type ( off_type ( - 1 ) ) ;
  59602. }
  59603.  
  59604.  
  59605.  
  59606.  
  59607.  
  59608. template < class charT >
  59609. struct cpp_regex_traits_base
  59610. {
  59611. cpp_regex_traits_base ( const std :: locale & l )
  59612. { imbue ( l ) ; }
  59613. std :: locale imbue ( const std :: locale & l ) ;
  59614.  
  59615. std :: locale m_locale ;
  59616. std :: ctype < charT > const * m_pctype ;
  59617.  
  59618. std :: messages < charT > const * m_pmessages ;
  59619.  
  59620. std :: collate < charT > const * m_pcollate ;
  59621.  
  59622. bool operator < ( const cpp_regex_traits_base & b ) const
  59623. {
  59624. if ( m_pctype == b . m_pctype )
  59625. {
  59626.  
  59627. if ( m_pmessages == b . m_pmessages )
  59628. {
  59629. return m_pcollate < b . m_pcollate ;
  59630. }
  59631. return m_pmessages < b . m_pmessages ;
  59632.  
  59633.  
  59634.  
  59635. }
  59636. return m_pctype < b . m_pctype ;
  59637. }
  59638. bool operator == ( const cpp_regex_traits_base & b ) const
  59639. {
  59640. return ( m_pctype == b . m_pctype )
  59641.  
  59642. && ( m_pmessages == b . m_pmessages )
  59643.  
  59644. && ( m_pcollate == b . m_pcollate ) ;
  59645. }
  59646. } ;
  59647.  
  59648. template < class charT >
  59649. std :: locale cpp_regex_traits_base < charT > :: imbue ( const std :: locale & l )
  59650. {
  59651. std :: locale result ( m_locale ) ;
  59652. m_locale = l ;
  59653. m_pctype = & std :: use_facet < std :: ctype < charT > > ( l ) ;
  59654.  
  59655. m_pmessages = std :: has_facet < std :: messages < charT > > ( l ) ? & std :: use_facet < std :: messages < charT > > ( l
  59656. #219
  59657. ) : 0 ;
  59658.  
  59659. m_pcollate = & std :: use_facet < std :: collate < charT > > ( l ) ;
  59660. return result ;
  59661. }
  59662.  
  59663.  
  59664.  
  59665.  
  59666.  
  59667. template < class charT >
  59668. class cpp_regex_traits_char_layer : public cpp_regex_traits_base < charT >
  59669. {
  59670. typedef std :: basic_string < charT > string_type ;
  59671. typedef std :: map < charT , regex_constants :: syntax_type > map_type ;
  59672. typedef typename map_type :: const_iterator map_iterator_type ;
  59673. public :
  59674. cpp_regex_traits_char_layer ( const std :: locale & l )
  59675. : cpp_regex_traits_base < charT > ( l )
  59676. {
  59677. init ( ) ;
  59678. }
  59679. cpp_regex_traits_char_layer ( const cpp_regex_traits_base < charT > & b )
  59680. : cpp_regex_traits_base < charT > ( b )
  59681. {
  59682. init ( ) ;
  59683. }
  59684. void init ( ) ;
  59685.  
  59686. regex_constants :: syntax_type syntax_type ( charT c ) const
  59687. {
  59688. map_iterator_type i = m_char_map . find ( c ) ;
  59689. return ( ( i == m_char_map . end ( ) ) ? 0 : i -> second ) ;
  59690. }
  59691. regex_constants :: escape_syntax_type escape_syntax_type ( charT c ) const
  59692. {
  59693. map_iterator_type i = m_char_map . find ( c ) ;
  59694. if ( i == m_char_map . end ( ) )
  59695. {
  59696. if ( this -> m_pctype -> is ( std :: ctype_base :: lower , c ) ) return regex_constants :: escape_type_class ;
  59697. if ( this -> m_pctype -> is ( std :: ctype_base :: upper , c ) ) return regex_constants :: escape_type_not_class ;
  59698. return 0 ;
  59699. }
  59700. return i -> second ;
  59701. }
  59702.  
  59703. private :
  59704. string_type get_default_message ( regex_constants :: syntax_type ) ;
  59705.  
  59706. map_type m_char_map ;
  59707. } ;
  59708.  
  59709. template < class charT >
  59710. void cpp_regex_traits_char_layer < charT > :: init ( )
  59711. {
  59712.  
  59713.  
  59714.  
  59715.  
  59716. typename std :: messages < charT > :: catalog cat = static_cast < std :: messages < char > :: catalog > ( - 1 ) ;
  59717.  
  59718.  
  59719.  
  59720. std :: string cat_name ( cpp_regex_traits < charT > :: get_catalog_name ( ) ) ;
  59721. if ( cat_name . size ( ) && ( this -> m_pmessages != 0 ) )
  59722. {
  59723. cat = this -> m_pmessages -> open (
  59724. cat_name ,
  59725. this -> m_locale ) ;
  59726. if ( ( int ) cat < 0 )
  59727. {
  59728. std :: string m ( "Unable to open message catalog: " ) ;
  59729. std :: runtime_error err ( m + cat_name ) ;
  59730. boost :: re_detail :: raise_runtime_error ( err ) ;
  59731. }
  59732. }
  59733.  
  59734.  
  59735.  
  59736. if ( ( int ) cat >= 0 )
  59737. {
  59738.  
  59739. try {
  59740.  
  59741. for ( regex_constants :: syntax_type i = 1 ; i < regex_constants :: syntax_max ; ++ i )
  59742. {
  59743. string_type mss = this -> m_pmessages -> get ( cat , 0 , i , get_default_message ( i ) ) ;
  59744. for ( typename string_type :: size_type j = 0 ; j < mss . size ( ) ; ++ j )
  59745. {
  59746. m_char_map [ mss [ j ] ] = i ;
  59747. }
  59748. }
  59749. this -> m_pmessages -> close ( cat ) ;
  59750.  
  59751. }
  59752. catch ( ... )
  59753. {
  59754. if ( this -> m_pmessages )
  59755. this -> m_pmessages -> close ( cat ) ;
  59756. throw ;
  59757. }
  59758.  
  59759. }
  59760. else
  59761. {
  59762.  
  59763. for ( regex_constants :: syntax_type i = 1 ; i < regex_constants :: syntax_max ; ++ i )
  59764. {
  59765. const char * ptr = get_default_syntax ( i ) ;
  59766. while ( ptr && * ptr )
  59767. {
  59768. m_char_map [ this -> m_pctype -> widen ( * ptr ) ] = i ;
  59769. ++ ptr ;
  59770. }
  59771. }
  59772.  
  59773. }
  59774.  
  59775. }
  59776.  
  59777. template < class charT >
  59778. typename cpp_regex_traits_char_layer < charT > :: string_type
  59779. cpp_regex_traits_char_layer < charT > :: get_default_message ( regex_constants :: syntax_type i )
  59780. {
  59781. const char * ptr = get_default_syntax ( i ) ;
  59782. string_type result ;
  59783. while ( ptr && * ptr )
  59784. {
  59785. result . append ( 1 , this -> m_pctype -> widen ( * ptr ) ) ;
  59786. ++ ptr ;
  59787. }
  59788. return result ;
  59789. }
  59790.  
  59791.  
  59792.  
  59793.  
  59794. template < >
  59795. class cpp_regex_traits_char_layer < char > : public cpp_regex_traits_base < char >
  59796. {
  59797. typedef std :: string string_type ;
  59798. public :
  59799. cpp_regex_traits_char_layer ( const std :: locale & l )
  59800. : cpp_regex_traits_base < char > ( l )
  59801. {
  59802. init ( ) ;
  59803. }
  59804. cpp_regex_traits_char_layer ( const cpp_regex_traits_base < char > & l )
  59805. : cpp_regex_traits_base < char > ( l )
  59806. {
  59807. init ( ) ;
  59808. }
  59809.  
  59810. regex_constants :: syntax_type syntax_type ( char c ) const
  59811. {
  59812. return m_char_map [ static_cast < unsigned char > ( c ) ] ;
  59813. }
  59814. regex_constants :: escape_syntax_type escape_syntax_type ( char c ) const
  59815. {
  59816. return m_char_map [ static_cast < unsigned char > ( c ) ] ;
  59817. }
  59818.  
  59819. private :
  59820. regex_constants :: syntax_type m_char_map [ 1u << 8 ] ;
  59821. void init ( ) ;
  59822. } ;
  59823. #413
  59824. template < class charT >
  59825. class cpp_regex_traits_implementation : public cpp_regex_traits_char_layer < charT >
  59826. {
  59827. public :
  59828. typedef typename cpp_regex_traits < charT > :: char_class_type char_class_type ;
  59829. typedef typename std :: ctype < charT > :: mask native_mask_type ;
  59830.  
  59831. static const char_class_type mask_blank = 1u << 24 ;
  59832. static const char_class_type mask_word = 1u << 25 ;
  59833. static const char_class_type mask_unicode = 1u << 26 ;
  59834. static const char_class_type mask_horizontal = 1u << 27 ;
  59835. static const char_class_type mask_vertical = 1u << 28 ;
  59836.  
  59837.  
  59838. typedef std :: basic_string < charT > string_type ;
  59839. typedef charT char_type ;
  59840.  
  59841. cpp_regex_traits_implementation ( const std :: locale & l )
  59842. : cpp_regex_traits_char_layer < charT > ( l )
  59843. {
  59844. init ( ) ;
  59845. }
  59846. cpp_regex_traits_implementation ( const cpp_regex_traits_base < charT > & l )
  59847. : cpp_regex_traits_char_layer < charT > ( l )
  59848. {
  59849. init ( ) ;
  59850. }
  59851. std :: string error_string ( regex_constants :: error_type n ) const
  59852. {
  59853. if ( ! m_error_strings . empty ( ) )
  59854. {
  59855. std :: map < int , std :: string > :: const_iterator p = m_error_strings . find ( n ) ;
  59856. return ( p == m_error_strings . end ( ) ) ? std :: string ( get_default_error_string ( n ) ) : p -> second ;
  59857. }
  59858. return get_default_error_string ( n ) ;
  59859. }
  59860. char_class_type lookup_classname ( const charT * p1 , const charT * p2 ) const
  59861. {
  59862. char_class_type result = lookup_classname_imp ( p1 , p2 ) ;
  59863. if ( result == 0 )
  59864. {
  59865. string_type temp ( p1 , p2 ) ;
  59866. this -> m_pctype -> tolower ( & * temp . begin ( ) , & * temp . begin ( ) + temp . size ( ) ) ;
  59867. result = lookup_classname_imp ( & * temp . begin ( ) , & * temp . begin ( ) + temp . size ( ) ) ;
  59868. }
  59869. return result ;
  59870. }
  59871. string_type lookup_collatename ( const charT * p1 , const charT * p2 ) const ;
  59872. string_type transform_primary ( const charT * p1 , const charT * p2 ) const ;
  59873. string_type transform ( const charT * p1 , const charT * p2 ) const ;
  59874. private :
  59875. std :: map < int , std :: string > m_error_strings ;
  59876. std :: map < string_type , char_class_type > m_custom_class_names ;
  59877. std :: map < string_type , string_type > m_custom_collate_names ;
  59878. unsigned m_collate_type ;
  59879. charT m_collate_delim ;
  59880.  
  59881.  
  59882.  
  59883. char_class_type lookup_classname_imp ( const charT * p1 , const charT * p2 ) const ;
  59884. void init ( ) ;
  59885.  
  59886.  
  59887.  
  59888.  
  59889. } ;
  59890.  
  59891.  
  59892.  
  59893.  
  59894. template < class charT >
  59895. typename cpp_regex_traits_implementation < charT > :: char_class_type const cpp_regex_traits_implementation < charT > ::
  59896. #484
  59897. mask_blank ;
  59898. template < class charT >
  59899. typename cpp_regex_traits_implementation < charT > :: char_class_type const cpp_regex_traits_implementation < charT > ::
  59900. #486
  59901. mask_word ;
  59902. template < class charT >
  59903. typename cpp_regex_traits_implementation < charT > :: char_class_type const cpp_regex_traits_implementation < charT > ::
  59904. #488
  59905. mask_unicode ;
  59906. template < class charT >
  59907. typename cpp_regex_traits_implementation < charT > :: char_class_type const cpp_regex_traits_implementation < charT > ::
  59908. #490
  59909. mask_vertical ;
  59910. template < class charT >
  59911. typename cpp_regex_traits_implementation < charT > :: char_class_type const cpp_regex_traits_implementation < charT > ::
  59912. #492
  59913. mask_horizontal ;
  59914.  
  59915.  
  59916.  
  59917.  
  59918. template < class charT >
  59919. typename cpp_regex_traits_implementation < charT > :: string_type
  59920. cpp_regex_traits_implementation < charT > :: transform_primary ( const charT * p1 , const charT * p2 ) const
  59921. {
  59922. #509
  59923. ( ( void ) 0 ) ;
  59924.  
  59925. string_type result ;
  59926. #518
  59927. try {
  59928.  
  59929.  
  59930.  
  59931.  
  59932.  
  59933. switch ( m_collate_type )
  59934. {
  59935. case sort_C :
  59936. case sort_unknown :
  59937.  
  59938. {
  59939. result . assign ( p1 , p2 ) ;
  59940. this -> m_pctype -> tolower ( & * result . begin ( ) , & * result . begin ( ) + result . size ( ) ) ;
  59941. result = this -> m_pcollate -> transform ( & * result . begin ( ) , & * result . begin ( ) + result . size ( ) ) ;
  59942. break ;
  59943. }
  59944. case sort_fixed :
  59945. {
  59946.  
  59947. result . assign ( this -> m_pcollate -> transform ( p1 , p2 ) ) ;
  59948. result . erase ( this -> m_collate_delim ) ;
  59949. break ;
  59950. }
  59951. case sort_delim :
  59952.  
  59953. result . assign ( this -> m_pcollate -> transform ( p1 , p2 ) ) ;
  59954. std :: size_t i ;
  59955. for ( i = 0 ; i < result . size ( ) ; ++ i )
  59956. {
  59957. if ( result [ i ] == m_collate_delim )
  59958. break ;
  59959. }
  59960. result . erase ( i ) ;
  59961. break ;
  59962. }
  59963.  
  59964. } catch ( ... ) { }
  59965.  
  59966. while ( result . size ( ) && ( charT ( 0 ) == * result . rbegin ( ) ) )
  59967. result . erase ( result . size ( ) - 1 ) ;
  59968. if ( result . empty ( ) )
  59969. {
  59970.  
  59971. result = string_type ( 1 , charT ( 0 ) ) ;
  59972. }
  59973. return result ;
  59974. }
  59975.  
  59976. template < class charT >
  59977. typename cpp_regex_traits_implementation < charT > :: string_type
  59978. cpp_regex_traits_implementation < charT > :: transform ( const charT * p1 , const charT * p2 ) const
  59979. {
  59980. #579
  59981. ( ( void ) 0 ) ;
  59982.  
  59983.  
  59984.  
  59985.  
  59986.  
  59987. string_type result ;
  59988.  
  59989. try {
  59990.  
  59991. result = this -> m_pcollate -> transform ( p1 , p2 ) ;
  59992. #601
  59993. while ( result . size ( ) && ( charT ( 0 ) == * result . rbegin ( ) ) )
  59994. result . erase ( result . size ( ) - 1 ) ;
  59995.  
  59996. ( ( void ) 0 ) ;
  59997.  
  59998. }
  59999. catch ( ... )
  60000. {
  60001. }
  60002.  
  60003. return result ;
  60004. }
  60005.  
  60006.  
  60007. template < class charT >
  60008. typename cpp_regex_traits_implementation < charT > :: string_type
  60009. cpp_regex_traits_implementation < charT > :: lookup_collatename ( const charT * p1 , const charT * p2 ) const
  60010. {
  60011. typedef typename std :: map < string_type , string_type > :: const_iterator iter_type ;
  60012. if ( m_custom_collate_names . size ( ) )
  60013. {
  60014. iter_type pos = m_custom_collate_names . find ( string_type ( p1 , p2 ) ) ;
  60015. if ( pos != m_custom_collate_names . end ( ) )
  60016. return pos -> second ;
  60017. }
  60018.  
  60019.  
  60020.  
  60021. std :: string name ( p1 , p2 ) ;
  60022. #636
  60023. name = lookup_default_collate_name ( name ) ;
  60024.  
  60025.  
  60026.  
  60027. if ( name . size ( ) )
  60028. return string_type ( name . begin ( ) , name . end ( ) ) ;
  60029. #654
  60030. if ( p2 - p1 == 1 )
  60031. return string_type ( 1 , * p1 ) ;
  60032. return string_type ( ) ;
  60033. }
  60034.  
  60035. template < class charT >
  60036. void cpp_regex_traits_implementation < charT > :: init ( )
  60037. {
  60038.  
  60039.  
  60040. typename std :: messages < charT > :: catalog cat = static_cast < std :: messages < char > :: catalog > ( - 1 ) ;
  60041.  
  60042.  
  60043.  
  60044. std :: string cat_name ( cpp_regex_traits < charT > :: get_catalog_name ( ) ) ;
  60045. if ( cat_name . size ( ) && ( this -> m_pmessages != 0 ) )
  60046. {
  60047. cat = this -> m_pmessages -> open (
  60048. cat_name ,
  60049. this -> m_locale ) ;
  60050. if ( ( int ) cat < 0 )
  60051. {
  60052. std :: string m ( "Unable to open message catalog: " ) ;
  60053. std :: runtime_error err ( m + cat_name ) ;
  60054. boost :: re_detail :: raise_runtime_error ( err ) ;
  60055. }
  60056. }
  60057.  
  60058.  
  60059.  
  60060. if ( ( int ) cat >= 0 )
  60061. {
  60062.  
  60063.  
  60064.  
  60065. for ( boost :: regex_constants :: error_type i = static_cast < boost :: regex_constants :: error_type > ( 0 ) ;
  60066. i <= boost :: regex_constants :: error_unknown ;
  60067. i = static_cast < boost :: regex_constants :: error_type > ( i + 1 ) )
  60068. {
  60069. const char * p = get_default_error_string ( i ) ;
  60070. string_type default_message ;
  60071. while ( * p )
  60072. {
  60073. default_message . append ( 1 , this -> m_pctype -> widen ( * p ) ) ;
  60074. ++ p ;
  60075. }
  60076. string_type s = this -> m_pmessages -> get ( cat , 0 , i + 200 , default_message ) ;
  60077. std :: string result ;
  60078. for ( std :: string :: size_type j = 0 ; j < s . size ( ) ; ++ j )
  60079. {
  60080. result . append ( 1 , this -> m_pctype -> narrow ( s [ j ] , 0 ) ) ;
  60081. }
  60082. m_error_strings [ i ] = result ;
  60083. }
  60084.  
  60085.  
  60086.  
  60087.  
  60088. static const char_class_type masks [ 16 ] =
  60089. {
  60090. std :: ctype < charT > :: alnum ,
  60091. std :: ctype < charT > :: alpha ,
  60092. std :: ctype < charT > :: cntrl ,
  60093. std :: ctype < charT > :: digit ,
  60094. std :: ctype < charT > :: graph ,
  60095. cpp_regex_traits_implementation < charT > :: mask_horizontal ,
  60096. std :: ctype < charT > :: lower ,
  60097. std :: ctype < charT > :: print ,
  60098. std :: ctype < charT > :: punct ,
  60099. std :: ctype < charT > :: space ,
  60100. std :: ctype < charT > :: upper ,
  60101. cpp_regex_traits_implementation < charT > :: mask_vertical ,
  60102. std :: ctype < charT > :: xdigit ,
  60103. cpp_regex_traits_implementation < charT > :: mask_blank ,
  60104. cpp_regex_traits_implementation < charT > :: mask_word ,
  60105. cpp_regex_traits_implementation < charT > :: mask_unicode ,
  60106. } ;
  60107. #752
  60108. static const string_type null_string ;
  60109. for ( unsigned int j = 0 ; j <= 13 ; ++ j )
  60110. {
  60111. string_type s ( this -> m_pmessages -> get ( cat , 0 , j + 300 , null_string ) ) ;
  60112. if ( s . size ( ) )
  60113. this -> m_custom_class_names [ s ] = masks [ j ] ;
  60114. }
  60115. }
  60116.  
  60117.  
  60118.  
  60119.  
  60120. m_collate_type = re_detail :: find_sort_syntax ( this , & m_collate_delim ) ;
  60121. }
  60122.  
  60123. template < class charT >
  60124. typename cpp_regex_traits_implementation < charT > :: char_class_type
  60125. cpp_regex_traits_implementation < charT > :: lookup_classname_imp ( const charT * p1 , const charT * p2 ) const
  60126. {
  60127.  
  60128. static const char_class_type masks [ 22 ] =
  60129. {
  60130. 0 ,
  60131. std :: ctype < char > :: alnum ,
  60132. std :: ctype < char > :: alpha ,
  60133. cpp_regex_traits_implementation < charT > :: mask_blank ,
  60134. std :: ctype < char > :: cntrl ,
  60135. std :: ctype < char > :: digit ,
  60136. std :: ctype < char > :: digit ,
  60137. std :: ctype < char > :: graph ,
  60138. cpp_regex_traits_implementation < charT > :: mask_horizontal ,
  60139. std :: ctype < char > :: lower ,
  60140. std :: ctype < char > :: lower ,
  60141. std :: ctype < char > :: print ,
  60142. std :: ctype < char > :: punct ,
  60143. std :: ctype < char > :: space ,
  60144. std :: ctype < char > :: space ,
  60145. std :: ctype < char > :: upper ,
  60146. cpp_regex_traits_implementation < charT > :: mask_unicode ,
  60147. std :: ctype < char > :: upper ,
  60148. cpp_regex_traits_implementation < charT > :: mask_vertical ,
  60149. std :: ctype < char > :: alnum | cpp_regex_traits_implementation < charT > :: mask_word ,
  60150. std :: ctype < char > :: alnum | cpp_regex_traits_implementation < charT > :: mask_word ,
  60151. std :: ctype < char > :: xdigit ,
  60152. } ;
  60153. #824
  60154. if ( m_custom_class_names . size ( ) )
  60155. {
  60156. typedef typename std :: map < std :: basic_string < charT > , char_class_type > :: const_iterator map_iter ;
  60157. map_iter pos = m_custom_class_names . find ( string_type ( p1 , p2 ) ) ;
  60158. if ( pos != m_custom_class_names . end ( ) )
  60159. return pos -> second ;
  60160. }
  60161. std :: size_t state_id = 1 + re_detail :: get_default_class_id ( p1 , p2 ) ;
  60162. ( ( void ) 0 ) ;
  60163. return masks [ state_id ] ;
  60164. }
  60165. #859
  60166. template < class charT >
  60167. inline boost :: shared_ptr < const cpp_regex_traits_implementation < charT > > create_cpp_regex_traits ( const std :: locale
  60168. #860
  60169. & l )
  60170. {
  60171. cpp_regex_traits_base < charT > key ( l ) ;
  60172. return :: boost :: object_cache < cpp_regex_traits_base < charT > , cpp_regex_traits_implementation < charT > > :: get (
  60173. #863
  60174. key , 5 ) ;
  60175. }
  60176.  
  60177. }
  60178.  
  60179. template < class charT >
  60180. class cpp_regex_traits
  60181. {
  60182. private :
  60183. typedef std :: ctype < charT > ctype_type ;
  60184. public :
  60185. typedef charT char_type ;
  60186. typedef std :: size_t size_type ;
  60187. typedef std :: basic_string < char_type > string_type ;
  60188. typedef std :: locale locale_type ;
  60189. typedef boost :: uint_least32_t char_class_type ;
  60190.  
  60191. struct boost_extensions_tag { } ;
  60192.  
  60193. cpp_regex_traits ( )
  60194. : m_pimpl ( re_detail :: create_cpp_regex_traits < charT > ( std :: locale ( ) ) )
  60195. { }
  60196. static size_type length ( const char_type * p )
  60197. {
  60198. return std :: char_traits < charT > :: length ( p ) ;
  60199. }
  60200. regex_constants :: syntax_type syntax_type ( charT c ) const
  60201. {
  60202. return m_pimpl -> syntax_type ( c ) ;
  60203. }
  60204. regex_constants :: escape_syntax_type escape_syntax_type ( charT c ) const
  60205. {
  60206. return m_pimpl -> escape_syntax_type ( c ) ;
  60207. }
  60208. charT translate ( charT c ) const
  60209. {
  60210. return c ;
  60211. }
  60212. charT translate_nocase ( charT c ) const
  60213. {
  60214. return m_pimpl -> m_pctype -> tolower ( c ) ;
  60215. }
  60216. charT translate ( charT c , bool icase ) const
  60217. {
  60218. return icase ? m_pimpl -> m_pctype -> tolower ( c ) : c ;
  60219. }
  60220. charT tolower ( charT c ) const
  60221. {
  60222. return m_pimpl -> m_pctype -> tolower ( c ) ;
  60223. }
  60224. charT toupper ( charT c ) const
  60225. {
  60226. return m_pimpl -> m_pctype -> toupper ( c ) ;
  60227. }
  60228. string_type transform ( const charT * p1 , const charT * p2 ) const
  60229. {
  60230. return m_pimpl -> transform ( p1 , p2 ) ;
  60231. }
  60232. string_type transform_primary ( const charT * p1 , const charT * p2 ) const
  60233. {
  60234. return m_pimpl -> transform_primary ( p1 , p2 ) ;
  60235. }
  60236. char_class_type lookup_classname ( const charT * p1 , const charT * p2 ) const
  60237. {
  60238. return m_pimpl -> lookup_classname ( p1 , p2 ) ;
  60239. }
  60240. string_type lookup_collatename ( const charT * p1 , const charT * p2 ) const
  60241. {
  60242. return m_pimpl -> lookup_collatename ( p1 , p2 ) ;
  60243. }
  60244. bool isctype ( charT c , char_class_type f ) const
  60245. {
  60246.  
  60247. typedef typename std :: ctype < charT > :: mask ctype_mask ;
  60248.  
  60249. static const ctype_mask mask_base =
  60250. static_cast < ctype_mask > (
  60251. std :: ctype < charT > :: alnum
  60252. | std :: ctype < charT > :: alpha
  60253. | std :: ctype < charT > :: cntrl
  60254. | std :: ctype < charT > :: digit
  60255. | std :: ctype < charT > :: graph
  60256. | std :: ctype < charT > :: lower
  60257. | std :: ctype < charT > :: print
  60258. | std :: ctype < charT > :: punct
  60259. | std :: ctype < charT > :: space
  60260. | std :: ctype < charT > :: upper
  60261. | std :: ctype < charT > :: xdigit ) ;
  60262.  
  60263. if ( ( f & mask_base )
  60264. && ( m_pimpl -> m_pctype -> is (
  60265. static_cast < ctype_mask > ( f & mask_base ) , c ) ) )
  60266. return true ;
  60267. else if ( ( f & re_detail :: cpp_regex_traits_implementation < charT > :: mask_unicode ) && re_detail :: is_extended ( c
  60268. #956
  60269. ) )
  60270. return true ;
  60271. else if ( ( f & re_detail :: cpp_regex_traits_implementation < charT > :: mask_word ) && ( c == '_' ) )
  60272. return true ;
  60273. else if ( ( f & re_detail :: cpp_regex_traits_implementation < charT > :: mask_blank )
  60274. && m_pimpl -> m_pctype -> is ( std :: ctype < charT > :: space , c )
  60275. && ! re_detail :: is_separator ( c ) )
  60276. return true ;
  60277. else if ( ( f & re_detail :: cpp_regex_traits_implementation < charT > :: mask_vertical )
  60278. && ( :: boost :: re_detail :: is_separator ( c ) || ( c == '\v' ) ) )
  60279. return true ;
  60280. else if ( ( f & re_detail :: cpp_regex_traits_implementation < charT > :: mask_horizontal )
  60281. && this -> isctype ( c , std :: ctype < charT > :: space ) && ! this -> isctype ( c , re_detail :: cpp_regex_traits_implementation
  60282. #968
  60283. < charT > :: mask_vertical ) )
  60284. return true ;
  60285. return false ;
  60286.  
  60287.  
  60288.  
  60289. }
  60290. int toi ( const charT * & p1 , const charT * p2 , int radix ) const ;
  60291. int value ( charT c , int radix ) const
  60292. {
  60293. const charT * pc = & c ;
  60294. return toi ( pc , pc + 1 , radix ) ;
  60295. }
  60296. locale_type imbue ( locale_type l )
  60297. {
  60298. std :: locale result ( getloc ( ) ) ;
  60299. m_pimpl = re_detail :: create_cpp_regex_traits < charT > ( l ) ;
  60300. return result ;
  60301. }
  60302. locale_type getloc ( ) const
  60303. {
  60304. return m_pimpl -> m_locale ;
  60305. }
  60306. std :: string error_string ( regex_constants :: error_type n ) const
  60307. {
  60308. return m_pimpl -> error_string ( n ) ;
  60309. }
  60310.  
  60311.  
  60312.  
  60313.  
  60314.  
  60315. static std :: string catalog_name ( const std :: string & name ) ;
  60316. static std :: string get_catalog_name ( ) ;
  60317.  
  60318. private :
  60319. boost :: shared_ptr < const re_detail :: cpp_regex_traits_implementation < charT > > m_pimpl ;
  60320.  
  60321.  
  60322.  
  60323. static std :: string & get_catalog_name_inst ( ) ;
  60324.  
  60325.  
  60326. static static_mutex & get_mutex_inst ( ) ;
  60327.  
  60328. } ;
  60329.  
  60330.  
  60331. template < class charT >
  60332. int cpp_regex_traits < charT > :: toi ( const charT * & first , const charT * last , int radix ) const
  60333. {
  60334. re_detail :: parser_buf < charT > sbuf ;
  60335. std :: basic_istream < charT > is ( & sbuf ) ;
  60336.  
  60337.  
  60338. last = std :: find ( first , last , std :: use_facet < std :: numpunct < charT > > ( is . getloc ( ) ) . thousands_sep (
  60339. #1023
  60340. ) ) ;
  60341.  
  60342. sbuf . pubsetbuf ( const_cast < charT * > ( static_cast < const charT * > ( first ) ) , static_cast < std :: streamsize >
  60343. #1025
  60344. ( last - first ) ) ;
  60345. is . clear ( ) ;
  60346. if ( std :: abs ( radix ) == 16 ) is >> std :: hex ;
  60347. else if ( std :: abs ( radix ) == 8 ) is >> std :: oct ;
  60348. else is >> std :: dec ;
  60349. int val ;
  60350. if ( is >> val )
  60351. {
  60352. first = first + ( ( last - first ) - sbuf . in_avail ( ) ) ;
  60353. return val ;
  60354. }
  60355. else
  60356. return - 1 ;
  60357. }
  60358.  
  60359. template < class charT >
  60360. std :: string cpp_regex_traits < charT > :: catalog_name ( const std :: string & name )
  60361. {
  60362.  
  60363. static_mutex :: scoped_lock lk ( get_mutex_inst ( ) ) ;
  60364.  
  60365. std :: string result ( get_catalog_name_inst ( ) ) ;
  60366. get_catalog_name_inst ( ) = name ;
  60367. return result ;
  60368. }
  60369.  
  60370. template < class charT >
  60371. std :: string & cpp_regex_traits < charT > :: get_catalog_name_inst ( )
  60372. {
  60373. static std :: string s_name ;
  60374. return s_name ;
  60375. }
  60376.  
  60377. template < class charT >
  60378. std :: string cpp_regex_traits < charT > :: get_catalog_name ( )
  60379. {
  60380.  
  60381. static_mutex :: scoped_lock lk ( get_mutex_inst ( ) ) ;
  60382.  
  60383. std :: string result ( get_catalog_name_inst ( ) ) ;
  60384. return result ;
  60385. }
  60386.  
  60387.  
  60388. template < class charT >
  60389. static_mutex & cpp_regex_traits < charT > :: get_mutex_inst ( )
  60390. {
  60391. static static_mutex s_mutex = { { { 0 , 0 , 0 , 0 , 0x4d58 } , { { { 0 } } } , 0 } , } ;
  60392. return s_mutex ;
  60393. }
  60394.  
  60395.  
  60396.  
  60397. }
  60398. #1 "./boost/regex/v4/c_regex_traits.hpp"
  60399. #48
  60400. namespace boost {
  60401.  
  60402. template < class charT >
  60403. struct c_regex_traits ;
  60404.  
  60405. template < >
  60406. struct c_regex_traits < char >
  60407. {
  60408. c_regex_traits ( ) { }
  60409. typedef char char_type ;
  60410. typedef std :: size_t size_type ;
  60411. typedef std :: string string_type ;
  60412. struct locale_type { } ;
  60413. typedef boost :: uint32_t char_class_type ;
  60414.  
  60415. static size_type length ( const char_type * p )
  60416. {
  60417. return ( std :: strlen ) ( p ) ;
  60418. }
  60419.  
  60420. char translate ( char c ) const
  60421. {
  60422. return c ;
  60423. }
  60424. char translate_nocase ( char c ) const
  60425. {
  60426. return static_cast < char > ( ( std :: tolower ) ( static_cast < unsigned char > ( c ) ) ) ;
  60427. }
  60428.  
  60429. static string_type transform ( const char * p1 , const char * p2 ) ;
  60430. static string_type transform_primary ( const char * p1 , const char * p2 ) ;
  60431.  
  60432. static char_class_type lookup_classname ( const char * p1 , const char * p2 ) ;
  60433. static string_type lookup_collatename ( const char * p1 , const char * p2 ) ;
  60434.  
  60435. static bool isctype ( char , char_class_type ) ;
  60436. static int value ( char , int ) ;
  60437.  
  60438. locale_type imbue ( locale_type l )
  60439. { return l ; }
  60440. locale_type getloc ( ) const
  60441. { return locale_type ( ) ; }
  60442.  
  60443. private :
  60444.  
  60445. c_regex_traits ( const c_regex_traits & ) ;
  60446. c_regex_traits & operator = ( const c_regex_traits & ) ;
  60447. } ;
  60448.  
  60449.  
  60450. template < >
  60451. struct c_regex_traits < wchar_t >
  60452. {
  60453. c_regex_traits ( ) { }
  60454. typedef wchar_t char_type ;
  60455. typedef std :: size_t size_type ;
  60456. typedef std :: wstring string_type ;
  60457. struct locale_type { } ;
  60458. typedef boost :: uint32_t char_class_type ;
  60459.  
  60460. static size_type length ( const char_type * p )
  60461. {
  60462. return ( std :: wcslen ) ( p ) ;
  60463. }
  60464.  
  60465. wchar_t translate ( wchar_t c ) const
  60466. {
  60467. return c ;
  60468. }
  60469. wchar_t translate_nocase ( wchar_t c ) const
  60470. {
  60471. return ( std :: towlower ) ( c ) ;
  60472. }
  60473.  
  60474. static string_type transform ( const wchar_t * p1 , const wchar_t * p2 ) ;
  60475. static string_type transform_primary ( const wchar_t * p1 , const wchar_t * p2 ) ;
  60476.  
  60477. static char_class_type lookup_classname ( const wchar_t * p1 , const wchar_t * p2 ) ;
  60478. static string_type lookup_collatename ( const wchar_t * p1 , const wchar_t * p2 ) ;
  60479.  
  60480. static bool isctype ( wchar_t , char_class_type ) ;
  60481. static int value ( wchar_t , int ) ;
  60482.  
  60483. locale_type imbue ( locale_type l )
  60484. { return l ; }
  60485. locale_type getloc ( ) const
  60486. { return locale_type ( ) ; }
  60487.  
  60488. private :
  60489.  
  60490. c_regex_traits ( const c_regex_traits & ) ;
  60491. c_regex_traits & operator = ( const c_regex_traits & ) ;
  60492. } ;
  60493. #195
  60494. }
  60495. #1 "./boost/mpl/has_xxx.hpp"
  60496. #1 "./boost/mpl/bool.hpp"
  60497. #1 "./boost/mpl/integral_c_tag.hpp"
  60498. #1 "./boost/mpl/aux_/config/static_constant.hpp"
  60499. #21 "./boost/mpl/integral_c_tag.hpp"
  60500. namespace mpl_ {
  60501. struct integral_c_tag { static const int value = 0 ; } ;
  60502. }
  60503. namespace boost { namespace mpl { using :: mpl_ :: integral_c_tag ; } }
  60504. #21 "./boost/mpl/bool.hpp"
  60505. namespace mpl_ {
  60506.  
  60507. template < bool C_ > struct bool_
  60508. {
  60509. static const bool value = C_ ;
  60510. typedef integral_c_tag tag ;
  60511. typedef bool_ type ;
  60512. typedef bool value_type ;
  60513. operator bool ( ) const { return this -> value ; }
  60514. } ;
  60515.  
  60516.  
  60517. template < bool C_ >
  60518. bool const bool_ < C_ > :: value ;
  60519.  
  60520.  
  60521. }
  60522. #1 "./boost/mpl/aux_/na_spec.hpp"
  60523. #1 "./boost/mpl/lambda_fwd.hpp"
  60524. #1 "./boost/mpl/void_fwd.hpp"
  60525. #19
  60526. namespace mpl_ {
  60527.  
  60528. struct void_ ;
  60529.  
  60530. }
  60531. namespace boost { namespace mpl { using :: mpl_ :: void_ ; } }
  60532. #1 "./boost/mpl/aux_/na.hpp"
  60533. #1 "./boost/mpl/aux_/na_fwd.hpp"
  60534. #19
  60535. namespace mpl_ {
  60536.  
  60537.  
  60538. struct na
  60539. {
  60540. typedef na type ;
  60541. enum { value = 0 } ;
  60542. } ;
  60543.  
  60544. }
  60545. namespace boost { namespace mpl { using :: mpl_ :: na ; } }
  60546. #1 "./boost/mpl/aux_/config/ctps.hpp"
  60547. #22 "./boost/mpl/aux_/na.hpp"
  60548. namespace boost { namespace mpl {
  60549.  
  60550. template < typename T >
  60551. struct is_na
  60552. : false_
  60553. {
  60554.  
  60555.  
  60556.  
  60557. } ;
  60558.  
  60559. template < >
  60560. struct is_na < na >
  60561. : true_
  60562. {
  60563.  
  60564.  
  60565.  
  60566. } ;
  60567.  
  60568. template < typename T >
  60569. struct is_not_na
  60570. : true_
  60571. {
  60572.  
  60573.  
  60574.  
  60575. } ;
  60576.  
  60577. template < >
  60578. struct is_not_na < na >
  60579. : false_
  60580. {
  60581.  
  60582.  
  60583.  
  60584. } ;
  60585.  
  60586.  
  60587. template < typename T , typename U > struct if_na
  60588. {
  60589. typedef T type ;
  60590. } ;
  60591.  
  60592. template < typename U > struct if_na < na , U >
  60593. {
  60594. typedef U type ;
  60595. } ;
  60596. #93
  60597. } }
  60598. #1 "./boost/mpl/aux_/config/lambda.hpp"
  60599. #1 "./boost/mpl/aux_/config/ttp.hpp"
  60600. #1 "./boost/mpl/int.hpp"
  60601. #1 "./boost/mpl/int_fwd.hpp"
  60602. #1 "./boost/mpl/aux_/nttp_decl.hpp"
  60603. #1 "./boost/mpl/aux_/config/nttp.hpp"
  60604. #20 "./boost/mpl/int_fwd.hpp"
  60605. namespace mpl_ {
  60606.  
  60607. template < int N > struct int_ ;
  60608.  
  60609. }
  60610. namespace boost { namespace mpl { using :: mpl_ :: int_ ; } }
  60611. #1 "./boost/mpl/aux_/integral_wrapper.hpp"
  60612. #1 "./boost/mpl/aux_/static_cast.hpp"
  60613. #1 "./boost/preprocessor/cat.hpp"
  60614. #1 "./boost/preprocessor/config/config.hpp"
  60615. #40 "./boost/mpl/aux_/integral_wrapper.hpp"
  60616. namespace mpl_ {
  60617.  
  60618. template < int N >
  60619. struct int_
  60620. {
  60621. static const int value = N ;
  60622.  
  60623.  
  60624.  
  60625.  
  60626.  
  60627. typedef int_ type ;
  60628.  
  60629. typedef int value_type ;
  60630. typedef integral_c_tag tag ;
  60631. #72
  60632. typedef mpl_ :: int_ < static_cast < int > ( ( value + 1 ) ) > next ;
  60633. typedef mpl_ :: int_ < static_cast < int > ( ( value - 1 ) ) > prior ;
  60634. #80
  60635. operator int ( ) const { return static_cast < int > ( this -> value ) ; }
  60636. } ;
  60637.  
  60638.  
  60639. template < int N >
  60640. int const mpl_ :: int_ < N > :: value ;
  60641.  
  60642.  
  60643. }
  60644. #1 "./boost/mpl/aux_/lambda_arity_param.hpp"
  60645. #1 "./boost/mpl/aux_/template_arity_fwd.hpp"
  60646. #17
  60647. namespace boost { namespace mpl { namespace aux {
  60648.  
  60649. template < typename F > struct template_arity ;
  60650.  
  60651. } } }
  60652. #27 "./boost/mpl/lambda_fwd.hpp"
  60653. namespace boost { namespace mpl {
  60654.  
  60655. template <
  60656. typename T = na
  60657. , typename Tag = void_
  60658.  
  60659.  
  60660.  
  60661. >
  60662. struct lambda ;
  60663.  
  60664. } }
  60665. #1 "./boost/mpl/aux_/arity.hpp"
  60666. #1 "./boost/mpl/aux_/config/dtp.hpp"
  60667. #1 "./boost/mpl/aux_/preprocessor/params.hpp"
  60668. #1 "./boost/mpl/aux_/config/preprocessor.hpp"
  60669. #1 "./boost/preprocessor/comma_if.hpp"
  60670. #1 "./boost/preprocessor/punctuation/comma_if.hpp"
  60671. #1 "./boost/preprocessor/control/if.hpp"
  60672. #1 "./boost/preprocessor/control/iif.hpp"
  60673. #1 "./boost/preprocessor/logical/bool.hpp"
  60674. #1 "./boost/preprocessor/facilities/empty.hpp"
  60675. #1 "./boost/preprocessor/punctuation/comma.hpp"
  60676. #1 "./boost/preprocessor/repeat.hpp"
  60677. #1 "./boost/preprocessor/repetition/repeat.hpp"
  60678. #1 "./boost/preprocessor/debug/error.hpp"
  60679. #1 "./boost/preprocessor/detail/auto_rec.hpp"
  60680. #1 "./boost/preprocessor/tuple/eat.hpp"
  60681. #1 "./boost/preprocessor/inc.hpp"
  60682. #1 "./boost/preprocessor/arithmetic/inc.hpp"
  60683. #1 "./boost/mpl/aux_/preprocessor/enum.hpp"
  60684. #1 "./boost/mpl/aux_/preprocessor/def_params_tail.hpp"
  60685. #1 "./boost/mpl/limits/arity.hpp"
  60686. #1 "./boost/preprocessor/logical/and.hpp"
  60687. #1 "./boost/preprocessor/logical/bitand.hpp"
  60688. #1 "./boost/preprocessor/identity.hpp"
  60689. #1 "./boost/preprocessor/facilities/identity.hpp"
  60690. #1 "./boost/preprocessor/empty.hpp"
  60691. #1 "./boost/preprocessor/arithmetic/add.hpp"
  60692. #1 "./boost/preprocessor/arithmetic/dec.hpp"
  60693. #1 "./boost/preprocessor/control/while.hpp"
  60694. #1 "./boost/preprocessor/detail/auto_rec.hpp"
  60695. #1 "./boost/preprocessor/list/fold_left.hpp"
  60696. #1 "./boost/preprocessor/control/while.hpp"
  60697. #1 "./boost/preprocessor/detail/auto_rec.hpp"
  60698. #1 "./boost/preprocessor/list/detail/fold_left.hpp"
  60699. #1 "./boost/preprocessor/control/expr_iif.hpp"
  60700. #1 "./boost/preprocessor/list/adt.hpp"
  60701. #1 "./boost/preprocessor/detail/is_binary.hpp"
  60702. #1 "./boost/preprocessor/detail/check.hpp"
  60703. #1 "./boost/preprocessor/logical/compl.hpp"
  60704. #1 "./boost/preprocessor/list/fold_right.hpp"
  60705. #1 "./boost/preprocessor/control/while.hpp"
  60706. #1 "./boost/preprocessor/detail/auto_rec.hpp"
  60707. #1 "./boost/preprocessor/list/detail/fold_right.hpp"
  60708. #1 "./boost/preprocessor/list/reverse.hpp"
  60709. #1 "./boost/preprocessor/control/detail/while.hpp"
  60710. #1 "./boost/preprocessor/tuple/elem.hpp"
  60711. #1 "./boost/preprocessor/facilities/overload.hpp"
  60712. #1 "./boost/preprocessor/variadic/size.hpp"
  60713. #1 "./boost/preprocessor/tuple/rem.hpp"
  60714. #1 "./boost/preprocessor/variadic/elem.hpp"
  60715. #1 "./boost/preprocessor/arithmetic/sub.hpp"
  60716. #1 "./boost/mpl/aux_/config/eti.hpp"
  60717. #1 "./boost/mpl/aux_/config/overload_resolution.hpp"
  60718. #1 "./boost/mpl/aux_/type_wrapper.hpp"
  60719. #20
  60720. namespace boost { namespace mpl { namespace aux {
  60721.  
  60722. template < typename T > struct type_wrapper
  60723. {
  60724. typedef T type ;
  60725. } ;
  60726. #32
  60727. template < typename T > struct wrapped_type ;
  60728.  
  60729. template < typename T > struct wrapped_type < type_wrapper < T > >
  60730. {
  60731. typedef T type ;
  60732. } ;
  60733. #45
  60734. } } }
  60735. #1 "./boost/mpl/aux_/yes_no.hpp"
  60736. #1 "./boost/mpl/aux_/config/arrays.hpp"
  60737. #23 "./boost/mpl/aux_/yes_no.hpp"
  60738. namespace boost { namespace mpl { namespace aux {
  60739.  
  60740. typedef char ( & no_tag ) [ 1 ] ;
  60741. typedef char ( & yes_tag ) [ 2 ] ;
  60742.  
  60743. template < bool C_ > struct yes_no_tag
  60744. {
  60745. typedef no_tag type ;
  60746. } ;
  60747.  
  60748. template < > struct yes_no_tag < true >
  60749. {
  60750. typedef yes_tag type ;
  60751. } ;
  60752.  
  60753.  
  60754. template < long n > struct weighted_tag
  60755. {
  60756.  
  60757. typedef char ( & type ) [ n ] ;
  60758.  
  60759.  
  60760.  
  60761.  
  60762. } ;
  60763. #56
  60764. } } }
  60765. #1 "./boost/mpl/aux_/config/has_xxx.hpp"
  60766. #1 "./boost/mpl/aux_/config/msvc_typename.hpp"
  60767. #1 "./boost/preprocessor/array/elem.hpp"
  60768. #1 "./boost/preprocessor/array/data.hpp"
  60769. #1 "./boost/preprocessor/array/size.hpp"
  60770. #1 "./boost/preprocessor/repetition/enum_params.hpp"
  60771. #1 "./boost/preprocessor/repetition/enum_trailing_params.hpp"
  60772. #70 "./boost/regex/v4/regex_traits.hpp"
  60773. namespace boost {
  60774.  
  60775. template < class charT , class implementationT >
  60776. struct regex_traits : public implementationT
  60777. {
  60778. regex_traits ( ) : implementationT ( ) { }
  60779. } ;
  60780. #85
  60781. namespace re_detail {
  60782.  
  60783. template < typename T , typename fallback_ = boost :: mpl :: bool_ < false > > struct has_boost_extensions_tag { struct gcc_3_2_wknd
  60784. #87
  60785. { template < typename U > static boost :: mpl :: aux :: yes_tag test ( boost :: mpl :: aux :: type_wrapper < U > const volatile
  60786. #87
  60787. * , boost :: mpl :: aux :: type_wrapper < typename U :: boost_extensions_tag > * = 0 ) ; static boost :: mpl :: aux :: no_tag
  60788. #87
  60789. test ( ... ) ; } ; typedef boost :: mpl :: aux :: type_wrapper < T > t_ ; static const bool value = sizeof ( gcc_3_2_wknd
  60790. #87
  60791. :: test ( static_cast < t_ * > ( 0 ) ) ) == sizeof ( boost :: mpl :: aux :: yes_tag ) ; typedef boost :: mpl :: bool_ < value
  60792. #87
  60793. > type ; } ;
  60794. #96
  60795. template < class BaseT >
  60796. struct default_wrapper : public BaseT
  60797. {
  60798. typedef typename BaseT :: char_type char_type ;
  60799. std :: string error_string ( :: boost :: regex_constants :: error_type e ) const
  60800. {
  60801. return :: boost :: re_detail :: get_default_error_string ( e ) ;
  60802. }
  60803. :: boost :: regex_constants :: syntax_type syntax_type ( char_type c ) const
  60804. {
  60805. return ( ( c & 0x7f ) == c ) ? get_default_syntax_type ( static_cast < char > ( c ) ) : :: boost :: regex_constants :: syntax_char
  60806. #106
  60807. ;
  60808. }
  60809. :: boost :: regex_constants :: escape_syntax_type escape_syntax_type ( char_type c ) const
  60810. {
  60811. return ( ( c & 0x7f ) == c ) ? get_default_escape_syntax_type ( static_cast < char > ( c ) ) : :: boost :: regex_constants
  60812. #110
  60813. :: escape_type_identity ;
  60814. }
  60815. int toi ( const char_type * & p1 , const char_type * p2 , int radix ) const
  60816. {
  60817. return :: boost :: re_detail :: global_toi ( p1 , p2 , radix , * this ) ;
  60818. }
  60819. char_type translate ( char_type c , bool icase ) const
  60820. {
  60821. return ( icase ? this -> translate_nocase ( c ) : this -> translate ( c ) ) ;
  60822. }
  60823. char_type translate ( char_type c ) const
  60824. {
  60825. return BaseT :: translate ( c ) ;
  60826. }
  60827. char_type tolower ( char_type c ) const
  60828. {
  60829. return :: boost :: re_detail :: global_lower ( c ) ;
  60830. }
  60831. char_type toupper ( char_type c ) const
  60832. {
  60833. return :: boost :: re_detail :: global_upper ( c ) ;
  60834. }
  60835. } ;
  60836.  
  60837. template < class BaseT , bool has_extensions >
  60838. struct compute_wrapper_base
  60839. {
  60840. typedef BaseT type ;
  60841. } ;
  60842.  
  60843. template < class BaseT >
  60844. struct compute_wrapper_base < BaseT , false >
  60845. {
  60846. typedef default_wrapper < BaseT > type ;
  60847. } ;
  60848. #160
  60849. }
  60850.  
  60851. template < class BaseT >
  60852. struct regex_traits_wrapper
  60853. : public :: boost :: re_detail :: compute_wrapper_base <
  60854. BaseT ,
  60855. :: boost :: re_detail :: has_boost_extensions_tag < BaseT > :: value
  60856. > :: type
  60857. {
  60858. regex_traits_wrapper ( ) { }
  60859. private :
  60860. regex_traits_wrapper ( const regex_traits_wrapper & ) ;
  60861. regex_traits_wrapper & operator = ( const regex_traits_wrapper & ) ;
  60862. } ;
  60863.  
  60864. }
  60865. #1 "./boost/regex/v4/match_flags.hpp"
  60866. #1 "./boost/cstdint.hpp"
  60867. #27 "./boost/regex/v4/match_flags.hpp"
  60868. namespace boost {
  60869. namespace regex_constants {
  60870.  
  60871.  
  60872. typedef enum _match_flags
  60873. {
  60874. match_default = 0 ,
  60875. match_not_bol = 1 ,
  60876. match_not_eol = match_not_bol << 1 ,
  60877. match_not_bob = match_not_eol << 1 ,
  60878. match_not_eob = match_not_bob << 1 ,
  60879. match_not_bow = match_not_eob << 1 ,
  60880. match_not_eow = match_not_bow << 1 ,
  60881. match_not_dot_newline = match_not_eow << 1 ,
  60882. match_not_dot_null = match_not_dot_newline << 1 ,
  60883. match_prev_avail = match_not_dot_null << 1 ,
  60884. match_init = match_prev_avail << 1 ,
  60885. match_any = match_init << 1 ,
  60886. match_not_null = match_any << 1 ,
  60887. match_continuous = match_not_null << 1 ,
  60888.  
  60889. match_partial = match_continuous << 1 ,
  60890.  
  60891. match_stop = match_partial << 1 ,
  60892. match_not_initial_null = match_stop ,
  60893. match_all = match_stop << 1 ,
  60894. match_perl = match_all << 1 ,
  60895. match_posix = match_perl << 1 ,
  60896. match_nosubs = match_posix << 1 ,
  60897. match_extra = match_nosubs << 1 ,
  60898. match_single_line = match_extra << 1 ,
  60899. match_unused1 = match_single_line << 1 ,
  60900. match_unused2 = match_unused1 << 1 ,
  60901. match_unused3 = match_unused2 << 1 ,
  60902. match_max = match_unused3 ,
  60903.  
  60904. format_perl = 0 ,
  60905. format_default = 0 ,
  60906. format_sed = match_max << 1 ,
  60907. format_all = format_sed << 1 ,
  60908. format_no_copy = format_all << 1 ,
  60909. format_first_only = format_no_copy << 1 ,
  60910. format_is_if = format_first_only << 1 ,
  60911. format_literal = format_is_if << 1
  60912.  
  60913. } match_flags ;
  60914.  
  60915.  
  60916.  
  60917.  
  60918. typedef match_flags match_flag_type ;
  60919.  
  60920.  
  60921.  
  60922. inline match_flags operator & ( match_flags m1 , match_flags m2 )
  60923. { return static_cast < match_flags > ( static_cast < boost :: int32_t > ( m1 ) & static_cast < boost :: int32_t > ( m2 )
  60924. #82
  60925. ) ; }
  60926. inline match_flags operator | ( match_flags m1 , match_flags m2 )
  60927. { return static_cast < match_flags > ( static_cast < boost :: int32_t > ( m1 ) | static_cast < boost :: int32_t > ( m2 )
  60928. #84
  60929. ) ; }
  60930. inline match_flags operator ^ ( match_flags m1 , match_flags m2 )
  60931. { return static_cast < match_flags > ( static_cast < boost :: int32_t > ( m1 ) ^ static_cast < boost :: int32_t > ( m2 )
  60932. #86
  60933. ) ; }
  60934. inline match_flags operator ~ ( match_flags m1 )
  60935. { return static_cast < match_flags > ( ~ static_cast < boost :: int32_t > ( m1 ) ) ; }
  60936. inline match_flags & operator &= ( match_flags & m1 , match_flags m2 )
  60937. { m1 = m1 & m2 ; return m1 ; }
  60938. inline match_flags & operator |= ( match_flags & m1 , match_flags m2 )
  60939. { m1 = m1 | m2 ; return m1 ; }
  60940. inline match_flags & operator ^= ( match_flags & m1 , match_flags m2 )
  60941. { m1 = m1 ^ m2 ; return m1 ; }
  60942.  
  60943.  
  60944.  
  60945.  
  60946. }
  60947.  
  60948.  
  60949.  
  60950. using regex_constants :: match_flag_type ;
  60951. using regex_constants :: match_default ;
  60952. using regex_constants :: match_not_bol ;
  60953. using regex_constants :: match_not_eol ;
  60954. using regex_constants :: match_not_bob ;
  60955. using regex_constants :: match_not_eob ;
  60956. using regex_constants :: match_not_bow ;
  60957. using regex_constants :: match_not_eow ;
  60958. using regex_constants :: match_not_dot_newline ;
  60959. using regex_constants :: match_not_dot_null ;
  60960. using regex_constants :: match_prev_avail ;
  60961.  
  60962. using regex_constants :: match_any ;
  60963. using regex_constants :: match_not_null ;
  60964. using regex_constants :: match_continuous ;
  60965. using regex_constants :: match_partial ;
  60966.  
  60967. using regex_constants :: match_all ;
  60968. using regex_constants :: match_perl ;
  60969. using regex_constants :: match_posix ;
  60970. using regex_constants :: match_nosubs ;
  60971. using regex_constants :: match_extra ;
  60972. using regex_constants :: match_single_line ;
  60973.  
  60974. using regex_constants :: format_all ;
  60975. using regex_constants :: format_sed ;
  60976. using regex_constants :: format_perl ;
  60977. using regex_constants :: format_default ;
  60978. using regex_constants :: format_no_copy ;
  60979. using regex_constants :: format_first_only ;
  60980.  
  60981.  
  60982. }
  60983. #1 "./boost/regex/v4/regex_raw_buffer.hpp"
  60984. #31
  60985. namespace boost {
  60986. namespace re_detail {
  60987. #45
  60988. struct empty_padding { } ;
  60989.  
  60990. union padding
  60991. {
  60992. void * p ;
  60993. unsigned int i ;
  60994. } ;
  60995.  
  60996. template < int N >
  60997. struct padding3
  60998. {
  60999. enum {
  61000. padding_size = 8 ,
  61001. padding_mask = 7
  61002. } ;
  61003. } ;
  61004.  
  61005. template < >
  61006. struct padding3 < 2 >
  61007. {
  61008. enum {
  61009. padding_size = 2 ,
  61010. padding_mask = 1
  61011. } ;
  61012. } ;
  61013.  
  61014. template < >
  61015. struct padding3 < 4 >
  61016. {
  61017. enum {
  61018. padding_size = 4 ,
  61019. padding_mask = 3
  61020. } ;
  61021. } ;
  61022.  
  61023. template < >
  61024. struct padding3 < 8 >
  61025. {
  61026. enum {
  61027. padding_size = 8 ,
  61028. padding_mask = 7
  61029. } ;
  61030. } ;
  61031.  
  61032. template < >
  61033. struct padding3 < 16 >
  61034. {
  61035. enum {
  61036. padding_size = 16 ,
  61037. padding_mask = 15
  61038. } ;
  61039. } ;
  61040.  
  61041. enum {
  61042. padding_size = padding3 < sizeof ( padding ) > :: padding_size ,
  61043. padding_mask = padding3 < sizeof ( padding ) > :: padding_mask
  61044. } ;
  61045. #109
  61046. class raw_storage
  61047. {
  61048. public :
  61049. typedef std :: size_t size_type ;
  61050. typedef unsigned char * pointer ;
  61051. private :
  61052. pointer last , start , end ;
  61053. public :
  61054.  
  61055. raw_storage ( ) ;
  61056. raw_storage ( size_type n ) ;
  61057.  
  61058. ~ raw_storage ( )
  61059. {
  61060. :: operator delete ( start ) ;
  61061. }
  61062.  
  61063. void resize ( size_type n ) ;
  61064.  
  61065. void * extend ( size_type n )
  61066. {
  61067. if ( size_type ( last - end ) < n )
  61068. resize ( n + ( end - start ) ) ;
  61069. register pointer result = end ;
  61070. end += n ;
  61071. return result ;
  61072. }
  61073.  
  61074. void * insert ( size_type pos , size_type n ) ;
  61075.  
  61076. size_type size ( )
  61077. {
  61078. return end - start ;
  61079. }
  61080.  
  61081. size_type capacity ( )
  61082. {
  61083. return last - start ;
  61084. }
  61085.  
  61086. void * data ( ) const
  61087. {
  61088. return start ;
  61089. }
  61090.  
  61091. size_type index ( void * ptr )
  61092. {
  61093. return static_cast < pointer > ( ptr ) - static_cast < pointer > ( data ( ) ) ;
  61094. }
  61095.  
  61096. void clear ( )
  61097. {
  61098. end = start ;
  61099. }
  61100.  
  61101. void align ( )
  61102. {
  61103.  
  61104. end = start + ( ( ( end - start ) + padding_mask ) & ~ padding_mask ) ;
  61105. }
  61106. void swap ( raw_storage & that )
  61107. {
  61108. std :: swap ( start , that . start ) ;
  61109. std :: swap ( end , that . end ) ;
  61110. std :: swap ( last , that . last ) ;
  61111. }
  61112. } ;
  61113.  
  61114. inline raw_storage :: raw_storage ( )
  61115. {
  61116. last = start = end = 0 ;
  61117. }
  61118.  
  61119. inline raw_storage :: raw_storage ( size_type n )
  61120. {
  61121. start = end = static_cast < pointer > ( :: operator new ( n ) ) ;
  61122.  
  61123. last = start + n ;
  61124. }
  61125. #201
  61126. }
  61127. }
  61128. #1 "./boost/regex/v4/char_regex_traits.hpp"
  61129. #34
  61130. namespace boost {
  61131.  
  61132. namespace deprecated {
  61133.  
  61134.  
  61135.  
  61136. template < class charT >
  61137. class char_regex_traits_i : public regex_traits < charT > { } ;
  61138.  
  61139. template < >
  61140. class char_regex_traits_i < char > : public regex_traits < char >
  61141. {
  61142. public :
  61143. typedef char char_type ;
  61144. typedef unsigned char uchar_type ;
  61145. typedef unsigned int size_type ;
  61146. typedef regex_traits < char > base_type ;
  61147.  
  61148. } ;
  61149.  
  61150.  
  61151. template < >
  61152. class char_regex_traits_i < wchar_t > : public regex_traits < wchar_t >
  61153. {
  61154. public :
  61155. typedef wchar_t char_type ;
  61156. typedef unsigned short uchar_type ;
  61157. typedef unsigned int size_type ;
  61158. typedef regex_traits < wchar_t > base_type ;
  61159.  
  61160. } ;
  61161.  
  61162. }
  61163. }
  61164. #1 "./boost/regex/v4/states.hpp"
  61165. #33
  61166. namespace boost {
  61167. namespace re_detail {
  61168. #42
  61169. enum mask_type
  61170. {
  61171. mask_take = 1 ,
  61172. mask_skip = 2 ,
  61173. mask_init = 4 ,
  61174. mask_any = mask_skip | mask_take ,
  61175. mask_all = mask_any
  61176. } ;
  61177.  
  61178.  
  61179.  
  61180.  
  61181.  
  61182. struct _narrow_type { } ;
  61183. struct _wide_type { } ;
  61184. template < class charT > struct is_byte ;
  61185. template < > struct is_byte < char > { typedef _narrow_type width_type ; } ;
  61186. template < > struct is_byte < unsigned char > { typedef _narrow_type width_type ; } ;
  61187. template < > struct is_byte < signed char > { typedef _narrow_type width_type ; } ;
  61188. template < class charT > struct is_byte { typedef _wide_type width_type ; } ;
  61189.  
  61190.  
  61191.  
  61192.  
  61193. enum syntax_element_type
  61194. {
  61195.  
  61196. syntax_element_startmark = 0 ,
  61197.  
  61198. syntax_element_endmark = syntax_element_startmark + 1 ,
  61199.  
  61200. syntax_element_literal = syntax_element_endmark + 1 ,
  61201.  
  61202. syntax_element_start_line = syntax_element_literal + 1 ,
  61203.  
  61204. syntax_element_end_line = syntax_element_start_line + 1 ,
  61205.  
  61206. syntax_element_wild = syntax_element_end_line + 1 ,
  61207.  
  61208. syntax_element_match = syntax_element_wild + 1 ,
  61209.  
  61210. syntax_element_word_boundary = syntax_element_match + 1 ,
  61211.  
  61212. syntax_element_within_word = syntax_element_word_boundary + 1 ,
  61213.  
  61214. syntax_element_word_start = syntax_element_within_word + 1 ,
  61215.  
  61216. syntax_element_word_end = syntax_element_word_start + 1 ,
  61217.  
  61218. syntax_element_buffer_start = syntax_element_word_end + 1 ,
  61219.  
  61220. syntax_element_buffer_end = syntax_element_buffer_start + 1 ,
  61221.  
  61222. syntax_element_backref = syntax_element_buffer_end + 1 ,
  61223.  
  61224. syntax_element_long_set = syntax_element_backref + 1 ,
  61225.  
  61226. syntax_element_set = syntax_element_long_set + 1 ,
  61227.  
  61228. syntax_element_jump = syntax_element_set + 1 ,
  61229.  
  61230. syntax_element_alt = syntax_element_jump + 1 ,
  61231.  
  61232. syntax_element_rep = syntax_element_alt + 1 ,
  61233.  
  61234. syntax_element_combining = syntax_element_rep + 1 ,
  61235.  
  61236. syntax_element_soft_buffer_end = syntax_element_combining + 1 ,
  61237.  
  61238. syntax_element_restart_continue = syntax_element_soft_buffer_end + 1 ,
  61239.  
  61240. syntax_element_dot_rep = syntax_element_restart_continue + 1 ,
  61241. syntax_element_char_rep = syntax_element_dot_rep + 1 ,
  61242. syntax_element_short_set_rep = syntax_element_char_rep + 1 ,
  61243. syntax_element_long_set_rep = syntax_element_short_set_rep + 1 ,
  61244.  
  61245. syntax_element_backstep = syntax_element_long_set_rep + 1 ,
  61246.  
  61247. syntax_element_assert_backref = syntax_element_backstep + 1 ,
  61248. syntax_element_toggle_case = syntax_element_assert_backref + 1 ,
  61249.  
  61250. syntax_element_recurse = syntax_element_toggle_case + 1
  61251. } ;
  61252. #131
  61253. struct re_syntax_base ;
  61254. #138
  61255. union offset_type
  61256. {
  61257. re_syntax_base * p ;
  61258. std :: ptrdiff_t i ;
  61259. } ;
  61260.  
  61261.  
  61262.  
  61263.  
  61264. struct re_syntax_base
  61265. {
  61266. syntax_element_type type ;
  61267. offset_type next ;
  61268. } ;
  61269.  
  61270.  
  61271.  
  61272.  
  61273. struct re_brace : public re_syntax_base
  61274. {
  61275.  
  61276.  
  61277. int index ;
  61278. bool icase ;
  61279. } ;
  61280.  
  61281.  
  61282.  
  61283.  
  61284. enum
  61285. {
  61286. dont_care = 1 ,
  61287. force_not_newline = 0 ,
  61288. force_newline = 2 ,
  61289.  
  61290. test_not_newline = 2 ,
  61291. test_newline = 3
  61292. } ;
  61293. struct re_dot : public re_syntax_base
  61294. {
  61295. unsigned char mask ;
  61296. } ;
  61297.  
  61298.  
  61299.  
  61300.  
  61301.  
  61302. struct re_literal : public re_syntax_base
  61303. {
  61304. unsigned int length ;
  61305. } ;
  61306.  
  61307.  
  61308.  
  61309.  
  61310. struct re_case : public re_syntax_base
  61311. {
  61312. bool icase ;
  61313. } ;
  61314. #205
  61315. template < class mask_type >
  61316. struct re_set_long : public re_syntax_base
  61317. {
  61318. unsigned int csingles , cranges , cequivalents ;
  61319. mask_type cclasses ;
  61320. mask_type cnclasses ;
  61321. bool isnot ;
  61322. bool singleton ;
  61323. } ;
  61324.  
  61325.  
  61326.  
  61327.  
  61328. struct re_set : public re_syntax_base
  61329. {
  61330. unsigned char _map [ 1 << 8 ] ;
  61331. } ;
  61332.  
  61333.  
  61334.  
  61335.  
  61336. struct re_jump : public re_syntax_base
  61337. {
  61338. offset_type alt ;
  61339. } ;
  61340.  
  61341.  
  61342.  
  61343.  
  61344. struct re_alt : public re_jump
  61345. {
  61346. unsigned char _map [ 1 << 8 ] ;
  61347. unsigned int can_be_null ;
  61348. } ;
  61349.  
  61350.  
  61351.  
  61352.  
  61353. struct re_repeat : public re_alt
  61354. {
  61355. std :: size_t min , max ;
  61356. int state_id ;
  61357. bool leading ;
  61358. bool greedy ;
  61359. } ;
  61360.  
  61361.  
  61362.  
  61363.  
  61364. struct re_recurse : public re_jump
  61365. {
  61366. int state_id ;
  61367. } ;
  61368. #264
  61369. enum re_jump_size_type
  61370. {
  61371. re_jump_size = ( sizeof ( re_jump ) + padding_mask ) & ~ ( padding_mask ) ,
  61372. re_repeater_size = ( sizeof ( re_repeat ) + padding_mask ) & ~ ( padding_mask ) ,
  61373. re_alt_size = ( sizeof ( re_alt ) + padding_mask ) & ~ ( padding_mask )
  61374. } ;
  61375.  
  61376.  
  61377.  
  61378.  
  61379.  
  61380. template < class charT , class traits >
  61381. struct regex_data ;
  61382.  
  61383. template < class iterator , class charT , class traits_type , class char_classT >
  61384. iterator re_is_set_member ( iterator next ,
  61385. iterator last ,
  61386. const re_set_long < char_classT > * set_ ,
  61387. const regex_data < charT , traits_type > & e , bool icase ) ;
  61388.  
  61389. }
  61390.  
  61391. }
  61392. #1 "./boost/regex/v4/regbase.hpp"
  61393. #33
  61394. namespace boost {
  61395.  
  61396.  
  61397.  
  61398.  
  61399. class regbase
  61400. {
  61401. public :
  61402. enum flag_type_
  61403. {
  61404. #53
  61405. perl_syntax_group = 0 ,
  61406. basic_syntax_group = 1 ,
  61407. literal = 2 ,
  61408. main_option_type = literal | basic_syntax_group | perl_syntax_group ,
  61409.  
  61410.  
  61411.  
  61412. no_bk_refs = 1 << 8 ,
  61413. no_perl_ex = 1 << 9 ,
  61414. no_mod_m = 1 << 10 ,
  61415. mod_x = 1 << 11 ,
  61416. mod_s = 1 << 12 ,
  61417. no_mod_s = 1 << 13 ,
  61418.  
  61419.  
  61420.  
  61421.  
  61422. no_char_classes = 1 << 8 ,
  61423. no_intervals = 1 << 9 ,
  61424. bk_plus_qm = 1 << 10 ,
  61425. bk_vbar = 1 << 11 ,
  61426. emacs_ex = 1 << 12 ,
  61427.  
  61428.  
  61429.  
  61430.  
  61431. no_escape_in_lists = 1 << 16 ,
  61432. newline_alt = 1 << 17 ,
  61433. no_except = 1 << 18 ,
  61434. failbit = 1 << 19 ,
  61435. icase = 1 << 20 ,
  61436. nocollate = 0 ,
  61437. collate = 1 << 21 ,
  61438. nosubs = 1 << 22 ,
  61439. save_subexpression_location = 1 << 23 ,
  61440. no_empty_expressions = 1 << 24 ,
  61441. optimize = 0 ,
  61442.  
  61443.  
  61444.  
  61445. basic = basic_syntax_group | collate | no_escape_in_lists ,
  61446. extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists ,
  61447. normal = 0 ,
  61448. emacs = basic_syntax_group | collate | emacs_ex | bk_vbar ,
  61449. awk = no_bk_refs | collate | no_perl_ex ,
  61450. grep = basic | newline_alt ,
  61451. egrep = extended | newline_alt ,
  61452. sed = basic ,
  61453. perl = normal ,
  61454. ECMAScript = normal ,
  61455. JavaScript = normal ,
  61456. JScript = normal
  61457. } ;
  61458. typedef unsigned int flag_type ;
  61459.  
  61460. enum restart_info
  61461. {
  61462. restart_any = 0 ,
  61463. restart_word = 1 ,
  61464. restart_line = 2 ,
  61465. restart_buf = 3 ,
  61466. restart_continue = 4 ,
  61467. restart_lit = 5 ,
  61468. restart_fixed_lit = 6 ,
  61469. restart_count = 7
  61470. } ;
  61471. } ;
  61472.  
  61473.  
  61474.  
  61475.  
  61476. namespace regex_constants {
  61477.  
  61478. enum flag_type_
  61479. {
  61480.  
  61481. no_except = :: boost :: regbase :: no_except ,
  61482. failbit = :: boost :: regbase :: failbit ,
  61483. literal = :: boost :: regbase :: literal ,
  61484. icase = :: boost :: regbase :: icase ,
  61485. nocollate = :: boost :: regbase :: nocollate ,
  61486. collate = :: boost :: regbase :: collate ,
  61487. nosubs = :: boost :: regbase :: nosubs ,
  61488. optimize = :: boost :: regbase :: optimize ,
  61489. bk_plus_qm = :: boost :: regbase :: bk_plus_qm ,
  61490. bk_vbar = :: boost :: regbase :: bk_vbar ,
  61491. no_intervals = :: boost :: regbase :: no_intervals ,
  61492. no_char_classes = :: boost :: regbase :: no_char_classes ,
  61493. no_escape_in_lists = :: boost :: regbase :: no_escape_in_lists ,
  61494. no_mod_m = :: boost :: regbase :: no_mod_m ,
  61495. mod_x = :: boost :: regbase :: mod_x ,
  61496. mod_s = :: boost :: regbase :: mod_s ,
  61497. no_mod_s = :: boost :: regbase :: no_mod_s ,
  61498. save_subexpression_location = :: boost :: regbase :: save_subexpression_location ,
  61499. no_empty_expressions = :: boost :: regbase :: no_empty_expressions ,
  61500.  
  61501. basic = :: boost :: regbase :: basic ,
  61502. extended = :: boost :: regbase :: extended ,
  61503. normal = :: boost :: regbase :: normal ,
  61504. emacs = :: boost :: regbase :: emacs ,
  61505. awk = :: boost :: regbase :: awk ,
  61506. grep = :: boost :: regbase :: grep ,
  61507. egrep = :: boost :: regbase :: egrep ,
  61508. sed = basic ,
  61509. perl = normal ,
  61510. ECMAScript = normal ,
  61511. JavaScript = normal ,
  61512. JScript = normal
  61513. } ;
  61514. typedef :: boost :: regbase :: flag_type syntax_option_type ;
  61515.  
  61516. }
  61517.  
  61518. }
  61519. #1 "./boost/regex/v4/iterator_traits.hpp"
  61520. #33
  61521. namespace boost {
  61522. namespace re_detail {
  61523. #115
  61524. template < class T >
  61525. struct regex_iterator_traits : public std :: iterator_traits < T > { } ;
  61526.  
  61527.  
  61528.  
  61529. }
  61530. }
  61531. #1 "./boost/regex/v4/basic_regex.hpp"
  61532. #1 "./boost/type_traits/is_same.hpp"
  61533. #1 "./boost/type_traits/config.hpp"
  61534. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  61535. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  61536. #1 "./boost/type_traits/integral_constant.hpp"
  61537. #1 "./boost/mpl/integral_c.hpp"
  61538. #1 "./boost/mpl/integral_c_fwd.hpp"
  61539. #20
  61540. namespace mpl_ {
  61541.  
  61542.  
  61543.  
  61544.  
  61545.  
  61546. template < typename T , T N > struct integral_c ;
  61547.  
  61548.  
  61549. }
  61550. namespace boost { namespace mpl { using :: mpl_ :: integral_c ; } }
  61551. #1 "./boost/mpl/aux_/integral_wrapper.hpp"
  61552. #40
  61553. namespace mpl_ {
  61554.  
  61555. template < typename T , T N >
  61556. struct integral_c
  61557. {
  61558. static const T value = N ;
  61559.  
  61560.  
  61561.  
  61562.  
  61563.  
  61564. typedef integral_c type ;
  61565.  
  61566. typedef T value_type ;
  61567. typedef integral_c_tag tag ;
  61568. #72
  61569. typedef integral_c < T , static_cast < T > ( ( value + 1 ) ) > next ;
  61570. typedef integral_c < T , static_cast < T > ( ( value - 1 ) ) > prior ;
  61571. #80
  61572. operator T ( ) const { return static_cast < T > ( this -> value ) ; }
  61573. } ;
  61574.  
  61575.  
  61576. template < typename T , T N >
  61577. T const integral_c < T , N > :: value ;
  61578.  
  61579.  
  61580. }
  61581. #37 "./boost/mpl/integral_c.hpp"
  61582. namespace mpl_ {
  61583.  
  61584. template < bool C >
  61585. struct integral_c < bool , C >
  61586. {
  61587. static const bool value = C ;
  61588. typedef integral_c_tag tag ;
  61589. typedef integral_c type ;
  61590. typedef bool value_type ;
  61591. operator bool ( ) const { return this -> value ; }
  61592. } ;
  61593. }
  61594. #13 "./boost/type_traits/integral_constant.hpp"
  61595. namespace boost {
  61596.  
  61597.  
  61598.  
  61599.  
  61600. template < class T , T val >
  61601.  
  61602. struct integral_constant : public mpl :: integral_c < T , val >
  61603. {
  61604. typedef integral_constant < T , val > type ;
  61605. } ;
  61606.  
  61607. template < > struct integral_constant < bool , true > : public mpl :: true_
  61608. {
  61609. #34
  61610. typedef integral_constant < bool , true > type ;
  61611. } ;
  61612. template < > struct integral_constant < bool , false > : public mpl :: false_
  61613. {
  61614. #45
  61615. typedef integral_constant < bool , false > type ;
  61616. } ;
  61617.  
  61618. typedef integral_constant < bool , true > true_type ;
  61619. typedef integral_constant < bool , false > false_type ;
  61620.  
  61621. }
  61622. #1 "./boost/mpl/aux_/lambda_support.hpp"
  61623. #33 "./boost/type_traits/is_same.hpp"
  61624. namespace boost {
  61625.  
  61626.  
  61627.  
  61628. template < typename T , typename U > struct is_same : public :: boost :: integral_constant < bool , false > { public : }
  61629. #37
  61630. ;
  61631. template < typename T > struct is_same < T , T > : public :: boost :: integral_constant < bool , true > { public : } ;
  61632. #98
  61633. }
  61634. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  61635. #1 "./boost/functional/hash.hpp"
  61636. #1 "./boost/functional/hash/hash.hpp"
  61637. #1 "./boost/functional/hash/hash_fwd.hpp"
  61638. #21
  61639. namespace boost
  61640. {
  61641. template < class T > struct hash ;
  61642.  
  61643.  
  61644.  
  61645.  
  61646. template < class T > void hash_combine ( std :: size_t & seed , T const & v ) ;
  61647.  
  61648.  
  61649. template < class It > std :: size_t hash_range ( It , It ) ;
  61650. template < class It > void hash_range ( std :: size_t & , It , It ) ;
  61651.  
  61652.  
  61653.  
  61654.  
  61655.  
  61656. }
  61657. #1 "./boost/functional/hash/detail/hash_float.hpp"
  61658. #1 "./boost/functional/hash/detail/float_functions.hpp"
  61659. #1 "./boost/config/no_tr1/cmath.hpp"
  61660. #111 "./boost/functional/hash/detail/float_functions.hpp"
  61661. namespace boost {
  61662. namespace hash_detail {
  61663.  
  61664.  
  61665.  
  61666. struct not_found {
  61667.  
  61668.  
  61669.  
  61670. inline operator float ( ) const { return 0 ; }
  61671. inline operator long double ( ) const { return 0 ; }
  61672. } ;
  61673.  
  61674.  
  61675.  
  61676. template < typename T > struct is ;
  61677. template < > struct is < float > { char x [ 10 ] ; } ;
  61678. template < > struct is < double > { char x [ 20 ] ; } ;
  61679. template < > struct is < long double > { char x [ 30 ] ; } ;
  61680. template < > struct is < boost :: hash_detail :: not_found > { char x [ 40 ] ; } ;
  61681.  
  61682.  
  61683.  
  61684. template < typename T > is < T > float_type ( T ) ;
  61685.  
  61686.  
  61687.  
  61688.  
  61689.  
  61690. template < typename Float > struct call_ldexp
  61691. {
  61692. typedef double float_type ;
  61693.  
  61694. inline double operator ( ) ( double a , int b ) const
  61695. {
  61696. using namespace std ;
  61697. return ldexp ( a , b ) ;
  61698. }
  61699. } ;
  61700.  
  61701.  
  61702.  
  61703.  
  61704.  
  61705. template < typename Float > struct call_frexp
  61706. {
  61707. typedef double float_type ;
  61708.  
  61709. inline double operator ( ) ( double a , int * b ) const
  61710. {
  61711. using namespace std ;
  61712. return frexp ( a , b ) ;
  61713. }
  61714. } ;
  61715. }
  61716. }
  61717. #175
  61718. namespace boost_hash_detect_float_functions {
  61719. template < class Float > boost :: hash_detail :: not_found ldexp ( Float , int ) ;
  61720. template < class Float > boost :: hash_detail :: not_found frexp ( Float , int * ) ;
  61721. }
  61722. #276
  61723. namespace boost_hash_detect_float_functions { template < class Float > boost :: hash_detail :: not_found ldexpf ( Float ,
  61724. #276
  61725. int ) ; } namespace boost { namespace hash_detail { namespace ldexpf_detect { using namespace std ; using namespace boost_hash_detect_float_functions
  61726. #276
  61727. ; struct check { static float x ; static int y ; static const bool cpp = sizeof ( float_type ( ldexp ( x , y ) ) ) == sizeof
  61728. #276
  61729. ( is < float > ) ; static const bool c99 = sizeof ( float_type ( ldexpf ( x , y ) ) ) == sizeof ( is < float > ) ; } ; }
  61730. #276
  61731. template < bool x > struct call_c99_ldexpf : boost :: hash_detail :: call_ldexp < double > { } ; template < > struct call_c99_ldexpf
  61732. #276
  61733. < true > { typedef float float_type ; template < typename T > inline float operator ( ) ( float a , T b ) const { using namespace
  61734. #276
  61735. std ; return ldexpf ( a , b ) ; } } ; template < bool x > struct call_cpp_ldexpf : call_c99_ldexpf < :: boost :: hash_detail
  61736. #276
  61737. :: ldexpf_detect :: check :: c99 > { } ; template < > struct call_cpp_ldexpf < true > { typedef float float_type ; template
  61738. #276
  61739. < typename T > inline float operator ( ) ( float a , T b ) const { using namespace std ; return ldexp ( a , b ) ; } } ; template
  61740. #276
  61741. < > struct call_ldexp < float > : call_cpp_ldexpf < :: boost :: hash_detail :: ldexpf_detect :: check :: cpp > { } ; } }
  61742. #276
  61743.  
  61744.  
  61745.  
  61746.  
  61747.  
  61748.  
  61749. namespace boost_hash_detect_float_functions { template < class Float > boost :: hash_detail :: not_found ldexpl ( Float ,
  61750. #282
  61751. int ) ; } namespace boost { namespace hash_detail { namespace ldexpl_detect { using namespace std ; using namespace boost_hash_detect_float_functions
  61752. #282
  61753. ; struct check { static long double x ; static int y ; static const bool cpp = sizeof ( float_type ( ldexp ( x , y ) ) )
  61754. #282
  61755. == sizeof ( is < long double > ) ; static const bool c99 = sizeof ( float_type ( ldexpl ( x , y ) ) ) == sizeof ( is < long
  61756. #282
  61757. double > ) ; } ; } template < bool x > struct call_c99_ldexpl : boost :: hash_detail :: call_ldexp < double > { } ; template
  61758. #282
  61759. < > struct call_c99_ldexpl < true > { typedef long double float_type ; template < typename T > inline long double operator
  61760. #282
  61761. ( ) ( long double a , T b ) const { using namespace std ; return ldexpl ( a , b ) ; } } ; template < bool x > struct call_cpp_ldexpl
  61762. #282
  61763. : call_c99_ldexpl < :: boost :: hash_detail :: ldexpl_detect :: check :: c99 > { } ; template < > struct call_cpp_ldexpl
  61764. #282
  61765. < true > { typedef long double float_type ; template < typename T > inline long double operator ( ) ( long double a , T b
  61766. #282
  61767. ) const { using namespace std ; return ldexp ( a , b ) ; } } ; template < > struct call_ldexp < long double > : call_cpp_ldexpl
  61768. #282
  61769. < :: boost :: hash_detail :: ldexpl_detect :: check :: cpp > { } ; } }
  61770.  
  61771.  
  61772.  
  61773.  
  61774.  
  61775. namespace boost_hash_detect_float_functions { template < class Float > boost :: hash_detail :: not_found frexpf ( Float ,
  61776. #288
  61777. int * ) ; } namespace boost { namespace hash_detail { namespace frexpf_detect { using namespace std ; using namespace boost_hash_detect_float_functions
  61778. #288
  61779. ; struct check { static float x ; static int * y ; static const bool cpp = sizeof ( float_type ( frexp ( x , y ) ) ) == sizeof
  61780. #288
  61781. ( is < float > ) ; static const bool c99 = sizeof ( float_type ( frexpf ( x , y ) ) ) == sizeof ( is < float > ) ; } ; }
  61782. #288
  61783. template < bool x > struct call_c99_frexpf : boost :: hash_detail :: call_frexp < double > { } ; template < > struct call_c99_frexpf
  61784. #288
  61785. < true > { typedef float float_type ; template < typename T > inline float operator ( ) ( float a , T b ) const { using namespace
  61786. #288
  61787. std ; return frexpf ( a , b ) ; } } ; template < bool x > struct call_cpp_frexpf : call_c99_frexpf < :: boost :: hash_detail
  61788. #288
  61789. :: frexpf_detect :: check :: c99 > { } ; template < > struct call_cpp_frexpf < true > { typedef float float_type ; template
  61790. #288
  61791. < typename T > inline float operator ( ) ( float a , T b ) const { using namespace std ; return frexp ( a , b ) ; } } ; template
  61792. #288
  61793. < > struct call_frexp < float > : call_cpp_frexpf < :: boost :: hash_detail :: frexpf_detect :: check :: cpp > { } ; } }
  61794. #288
  61795.  
  61796.  
  61797.  
  61798.  
  61799.  
  61800.  
  61801. namespace boost_hash_detect_float_functions { template < class Float > boost :: hash_detail :: not_found frexpl ( Float ,
  61802. #294
  61803. int * ) ; } namespace boost { namespace hash_detail { namespace frexpl_detect { using namespace std ; using namespace boost_hash_detect_float_functions
  61804. #294
  61805. ; struct check { static long double x ; static int * y ; static const bool cpp = sizeof ( float_type ( frexp ( x , y ) )
  61806. #294
  61807. ) == sizeof ( is < long double > ) ; static const bool c99 = sizeof ( float_type ( frexpl ( x , y ) ) ) == sizeof ( is <
  61808. #294
  61809. long double > ) ; } ; } template < bool x > struct call_c99_frexpl : boost :: hash_detail :: call_frexp < double > { } ;
  61810. #294
  61811. template < > struct call_c99_frexpl < true > { typedef long double float_type ; template < typename T > inline long double
  61812. #294
  61813. operator ( ) ( long double a , T b ) const { using namespace std ; return frexpl ( a , b ) ; } } ; template < bool x > struct
  61814. #294
  61815. call_cpp_frexpl : call_c99_frexpl < :: boost :: hash_detail :: frexpl_detect :: check :: c99 > { } ; template < > struct
  61816. #294
  61817. call_cpp_frexpl < true > { typedef long double float_type ; template < typename T > inline long double operator ( ) ( long
  61818. #294
  61819. double a , T b ) const { using namespace std ; return frexp ( a , b ) ; } } ; template < > struct call_frexp < long double
  61820. #294
  61821. > : call_cpp_frexpl < :: boost :: hash_detail :: frexpl_detect :: check :: cpp > { } ; } }
  61822. #301
  61823. namespace boost
  61824. {
  61825. namespace hash_detail
  61826. {
  61827. template < typename Float1 , typename Float2 >
  61828. struct select_hash_type_impl {
  61829. typedef double type ;
  61830. } ;
  61831.  
  61832. template < >
  61833. struct select_hash_type_impl < float , float > {
  61834. typedef float type ;
  61835. } ;
  61836.  
  61837. template < >
  61838. struct select_hash_type_impl < long double , long double > {
  61839. typedef long double type ;
  61840. } ;
  61841. #326
  61842. template < typename Float >
  61843. struct select_hash_type : select_hash_type_impl <
  61844. typename call_ldexp < Float > :: float_type ,
  61845. typename call_frexp < Float > :: float_type
  61846. > { } ;
  61847. }
  61848. }
  61849. #1 "./boost/functional/hash/detail/limits.hpp"
  61850. #26
  61851. namespace boost
  61852. {
  61853. namespace hash_detail
  61854. {
  61855. template < class T >
  61856. struct limits : std :: numeric_limits < T > { } ;
  61857. #58
  61858. }
  61859. }
  61860. #1 "./boost/utility/enable_if.hpp"
  61861. #24
  61862. namespace boost
  61863. {
  61864.  
  61865. template < bool B , class T = void >
  61866. struct enable_if_c {
  61867. typedef T type ;
  61868. } ;
  61869.  
  61870. template < class T >
  61871. struct enable_if_c < false , T > { } ;
  61872.  
  61873. template < class Cond , class T = void >
  61874. struct enable_if : public enable_if_c < Cond :: value , T > { } ;
  61875.  
  61876. template < bool B , class T >
  61877. struct lazy_enable_if_c {
  61878. typedef typename T :: type type ;
  61879. } ;
  61880.  
  61881. template < class T >
  61882. struct lazy_enable_if_c < false , T > { } ;
  61883.  
  61884. template < class Cond , class T >
  61885. struct lazy_enable_if : public lazy_enable_if_c < Cond :: value , T > { } ;
  61886.  
  61887.  
  61888. template < bool B , class T = void >
  61889. struct disable_if_c {
  61890. typedef T type ;
  61891. } ;
  61892.  
  61893. template < class T >
  61894. struct disable_if_c < true , T > { } ;
  61895.  
  61896. template < class Cond , class T = void >
  61897. struct disable_if : public disable_if_c < Cond :: value , T > { } ;
  61898.  
  61899. template < bool B , class T >
  61900. struct lazy_disable_if_c {
  61901. typedef typename T :: type type ;
  61902. } ;
  61903.  
  61904. template < class T >
  61905. struct lazy_disable_if_c < true , T > { } ;
  61906.  
  61907. template < class Cond , class T >
  61908. struct lazy_disable_if : public lazy_disable_if_c < Cond :: value , T > { } ;
  61909.  
  61910. }
  61911. #1 "./boost/integer/static_log2.hpp"
  61912. #21
  61913. namespace boost {
  61914.  
  61915. namespace detail {
  61916.  
  61917. namespace static_log2_impl {
  61918. #44
  61919. typedef boost :: static_log2_argument_type argument_type ;
  61920. typedef boost :: static_log2_result_type result_type ;
  61921.  
  61922. template < result_type n >
  61923. struct choose_initial_n {
  61924.  
  61925. static const bool c = ( argument_type ( 1 ) << n << n ) != 0 ;
  61926.  
  61927.  
  61928.  
  61929. static const result_type value = ! c * n + choose_initial_n < 2 * c * n > :: value ;
  61930.  
  61931. } ;
  61932.  
  61933. template < >
  61934. struct choose_initial_n < 0 > {
  61935. static const result_type value = 0 ;
  61936. } ;
  61937.  
  61938.  
  61939.  
  61940.  
  61941. const result_type n_zero = 16 ;
  61942. const result_type initial_n = choose_initial_n < n_zero > :: value ;
  61943. #84
  61944. template < argument_type x , result_type n = initial_n >
  61945. struct static_log2_impl {
  61946.  
  61947. static const bool c = ( x >> n ) > 0 ;
  61948.  
  61949.  
  61950.  
  61951. static const result_type value = c * n + ( static_log2_impl < ( x >> c * n ) , n / 2 > :: value ) ;
  61952.  
  61953. } ;
  61954.  
  61955. template < >
  61956. struct static_log2_impl < 1 , 0 > {
  61957. static const result_type value = 0 ;
  61958. } ;
  61959.  
  61960. }
  61961. }
  61962. #109
  61963. template < static_log2_argument_type x >
  61964. struct static_log2 {
  61965.  
  61966.  
  61967.  
  61968.  
  61969. static const static_log2_result_type value = detail :: static_log2_impl :: static_log2_impl < x > :: value ;
  61970.  
  61971. } ;
  61972.  
  61973.  
  61974. template < >
  61975. struct static_log2 < 0 > { } ;
  61976.  
  61977. }
  61978. #1 "./boost/cstdint.hpp"
  61979. #1 "./boost/assert.hpp"
  61980. #1 "/usr/include/assert.h"
  61981. #51 "./boost/functional/hash/detail/hash_float.hpp"
  61982. namespace boost
  61983. {
  61984. namespace hash_detail
  61985. {
  61986. inline void hash_float_combine ( std :: size_t & seed , std :: size_t value )
  61987. {
  61988. seed ^= value + ( seed << 6 ) + ( seed >> 2 ) ;
  61989. }
  61990. #66
  61991. inline std :: size_t hash_binary ( char * ptr , std :: size_t length )
  61992. {
  61993. std :: size_t seed = 0 ;
  61994.  
  61995. if ( length >= sizeof ( std :: size_t ) ) {
  61996. seed = * ( std :: size_t * ) ptr ;
  61997. length -= sizeof ( std :: size_t ) ;
  61998. ptr += sizeof ( std :: size_t ) ;
  61999.  
  62000. while ( length >= sizeof ( std :: size_t ) ) {
  62001. std :: size_t buffer = 0 ;
  62002. std :: memcpy ( & buffer , ptr , sizeof ( std :: size_t ) ) ;
  62003. hash_float_combine ( seed , buffer ) ;
  62004. length -= sizeof ( std :: size_t ) ;
  62005. ptr += sizeof ( std :: size_t ) ;
  62006. }
  62007. }
  62008.  
  62009. if ( length > 0 ) {
  62010. std :: size_t buffer = 0 ;
  62011. std :: memcpy ( & buffer , ptr , length ) ;
  62012. hash_float_combine ( seed , buffer ) ;
  62013. }
  62014.  
  62015. return seed ;
  62016. }
  62017.  
  62018. template < typename Float >
  62019. inline std :: size_t float_hash_impl ( Float v ,
  62020. typename boost :: enable_if_c <
  62021. std :: numeric_limits < Float > :: is_iec559 &&
  62022. std :: numeric_limits < Float > :: digits == 24 &&
  62023. std :: numeric_limits < Float > :: radix == 2 &&
  62024. std :: numeric_limits < Float > :: max_exponent == 128 ,
  62025. int > :: type
  62026. )
  62027. {
  62028. return hash_binary ( ( char * ) & v , 4 ) ;
  62029. }
  62030.  
  62031.  
  62032. template < typename Float >
  62033. inline std :: size_t float_hash_impl ( Float v ,
  62034. typename boost :: enable_if_c <
  62035. std :: numeric_limits < Float > :: is_iec559 &&
  62036. std :: numeric_limits < Float > :: digits == 53 &&
  62037. std :: numeric_limits < Float > :: radix == 2 &&
  62038. std :: numeric_limits < Float > :: max_exponent == 1024 ,
  62039. int > :: type
  62040. )
  62041. {
  62042. return hash_binary ( ( char * ) & v , 8 ) ;
  62043. }
  62044.  
  62045. template < typename Float >
  62046. inline std :: size_t float_hash_impl ( Float v ,
  62047. typename boost :: enable_if_c <
  62048. std :: numeric_limits < Float > :: is_iec559 &&
  62049. std :: numeric_limits < Float > :: digits == 64 &&
  62050. std :: numeric_limits < Float > :: radix == 2 &&
  62051. std :: numeric_limits < Float > :: max_exponent == 16384 ,
  62052. int > :: type
  62053. )
  62054. {
  62055. return hash_binary ( ( char * ) & v , 10 ) ;
  62056. }
  62057.  
  62058. template < typename Float >
  62059. inline std :: size_t float_hash_impl ( Float v ,
  62060. typename boost :: enable_if_c <
  62061. std :: numeric_limits < Float > :: is_iec559 &&
  62062. std :: numeric_limits < Float > :: digits == 113 &&
  62063. std :: numeric_limits < Float > :: radix == 2 &&
  62064. std :: numeric_limits < Float > :: max_exponent == 16384 ,
  62065. int > :: type
  62066. )
  62067. {
  62068. return hash_binary ( ( char * ) & v , 16 ) ;
  62069. }
  62070. #151
  62071. template < class T >
  62072. inline std :: size_t float_hash_impl2 ( T v )
  62073. {
  62074. boost :: hash_detail :: call_frexp < T > frexp ;
  62075. boost :: hash_detail :: call_ldexp < T > ldexp ;
  62076.  
  62077. int exp = 0 ;
  62078.  
  62079. v = frexp ( v , & exp ) ;
  62080.  
  62081.  
  62082.  
  62083. if ( v < 0 ) {
  62084. v = - v ;
  62085. exp += limits < T > :: max_exponent -
  62086. limits < T > :: min_exponent ;
  62087. }
  62088.  
  62089. v = ldexp ( v , limits < std :: size_t > :: digits ) ;
  62090. std :: size_t seed = static_cast < std :: size_t > ( v ) ;
  62091. v -= static_cast < T > ( seed ) ;
  62092.  
  62093.  
  62094. std :: size_t const length
  62095. = ( limits < T > :: digits *
  62096. boost :: static_log2 < limits < T > :: radix > :: value
  62097. + limits < std :: size_t > :: digits - 1 )
  62098. / limits < std :: size_t > :: digits ;
  62099.  
  62100. for ( std :: size_t i = 0 ; i != length ; ++ i )
  62101. {
  62102. v = ldexp ( v , limits < std :: size_t > :: digits ) ;
  62103. std :: size_t part = static_cast < std :: size_t > ( v ) ;
  62104. v -= static_cast < T > ( part ) ;
  62105. hash_float_combine ( seed , part ) ;
  62106. }
  62107.  
  62108. hash_float_combine ( seed , exp ) ;
  62109.  
  62110. return seed ;
  62111. }
  62112.  
  62113.  
  62114. template < class T >
  62115. inline std :: size_t float_hash_impl ( T v , ... )
  62116. {
  62117. typedef typename select_hash_type < T > :: type type ;
  62118. return float_hash_impl2 ( static_cast < type > ( v ) ) ;
  62119. }
  62120.  
  62121. }
  62122. }
  62123. #208
  62124. namespace boost
  62125. {
  62126. namespace hash_detail
  62127. {
  62128. template < class T >
  62129. inline std :: size_t float_hash_value ( T v )
  62130. {
  62131.  
  62132.  
  62133.  
  62134.  
  62135.  
  62136. using namespace std ;
  62137. switch ( fpclassify ( v ) )
  62138.  
  62139. {
  62140. case 0 :
  62141. return 0 ;
  62142. case 3 :
  62143. return ( std :: size_t ) ( v > 0 ? - 1 : - 2 ) ;
  62144. case 4 :
  62145. return ( std :: size_t ) ( - 3 ) ;
  62146. case 2 :
  62147. case 1 :
  62148. return float_hash_impl ( v , 0 ) ;
  62149. default :
  62150. ( ( void ) 0 ) ;
  62151. return 0 ;
  62152. }
  62153. }
  62154. }
  62155. }
  62156. #1 "./boost/type_traits/is_enum.hpp"
  62157. #1 "./boost/type_traits/intrinsics.hpp"
  62158. #1 "./boost/type_traits/add_reference.hpp"
  62159. #1 "./boost/type_traits/is_reference.hpp"
  62160. #1 "./boost/type_traits/is_lvalue_reference.hpp"
  62161. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62162. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62163. #34 "./boost/type_traits/is_lvalue_reference.hpp"
  62164. namespace boost {
  62165.  
  62166.  
  62167.  
  62168.  
  62169.  
  62170. template < typename T > struct is_lvalue_reference : public :: boost :: integral_constant < bool , false > { public : } ;
  62171. #40
  62172.  
  62173. template < typename T > struct is_lvalue_reference < T & > : public :: boost :: integral_constant < bool , true > { public
  62174. #41
  62175. : } ;
  62176. #113
  62177. }
  62178. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62179. #1 "./boost/type_traits/is_rvalue_reference.hpp"
  62180. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62181. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62182. #17 "./boost/type_traits/is_rvalue_reference.hpp"
  62183. namespace boost {
  62184.  
  62185. template < typename T > struct is_rvalue_reference : public :: boost :: integral_constant < bool , false > { public : } ;
  62186. #19
  62187.  
  62188.  
  62189.  
  62190.  
  62191.  
  62192. }
  62193. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62194. #1 "./boost/type_traits/ice.hpp"
  62195. #1 "./boost/type_traits/detail/yes_no_type.hpp"
  62196. #14
  62197. namespace boost {
  62198. namespace type_traits {
  62199.  
  62200. typedef char yes_type ;
  62201. struct no_type
  62202. {
  62203. char padding [ 8 ] ;
  62204. } ;
  62205.  
  62206. }
  62207. }
  62208. #1 "./boost/type_traits/detail/ice_or.hpp"
  62209. #13
  62210. namespace boost {
  62211. namespace type_traits {
  62212.  
  62213. template < bool b1 , bool b2 , bool b3 = false , bool b4 = false , bool b5 = false , bool b6 = false , bool b7 = false >
  62214. #16
  62215.  
  62216. struct ice_or ;
  62217.  
  62218. template < bool b1 , bool b2 , bool b3 , bool b4 , bool b5 , bool b6 , bool b7 >
  62219. struct ice_or
  62220. {
  62221. static const bool value = true ;
  62222. } ;
  62223.  
  62224. template < >
  62225. struct ice_or < false , false , false , false , false , false , false >
  62226. {
  62227. static const bool value = false ;
  62228. } ;
  62229.  
  62230. }
  62231. }
  62232. #1 "./boost/type_traits/detail/ice_and.hpp"
  62233. #14
  62234. namespace boost {
  62235. namespace type_traits {
  62236.  
  62237. template < bool b1 , bool b2 , bool b3 = true , bool b4 = true , bool b5 = true , bool b6 = true , bool b7 = true >
  62238. struct ice_and ;
  62239.  
  62240. template < bool b1 , bool b2 , bool b3 , bool b4 , bool b5 , bool b6 , bool b7 >
  62241. struct ice_and
  62242. {
  62243. static const bool value = false ;
  62244. } ;
  62245.  
  62246. template < >
  62247. struct ice_and < true , true , true , true , true , true , true >
  62248. {
  62249. static const bool value = true ;
  62250. } ;
  62251.  
  62252. }
  62253. }
  62254. #1 "./boost/type_traits/detail/ice_not.hpp"
  62255. #13
  62256. namespace boost {
  62257. namespace type_traits {
  62258.  
  62259. template < bool b >
  62260. struct ice_not
  62261. {
  62262. static const bool value = true ;
  62263. } ;
  62264.  
  62265. template < >
  62266. struct ice_not < true >
  62267. {
  62268. static const bool value = false ;
  62269. } ;
  62270.  
  62271. }
  62272. }
  62273. #1 "./boost/type_traits/detail/ice_eq.hpp"
  62274. #13
  62275. namespace boost {
  62276. namespace type_traits {
  62277.  
  62278. template < int b1 , int b2 >
  62279. struct ice_eq
  62280. {
  62281. static const bool value = ( b1 == b2 ) ;
  62282. } ;
  62283.  
  62284. template < int b1 , int b2 >
  62285. struct ice_ne
  62286. {
  62287. static const bool value = ( b1 != b2 ) ;
  62288. } ;
  62289.  
  62290.  
  62291. template < int b1 , int b2 > bool const ice_eq < b1 , b2 > :: value ;
  62292. template < int b1 , int b2 > bool const ice_ne < b1 , b2 > :: value ;
  62293.  
  62294.  
  62295. }
  62296. }
  62297. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62298. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62299. #23 "./boost/type_traits/is_reference.hpp"
  62300. namespace boost {
  62301.  
  62302. namespace detail {
  62303.  
  62304. template < typename T >
  62305. struct is_reference_impl
  62306. {
  62307.  
  62308.  
  62309.  
  62310. static const bool value = ( :: boost :: type_traits :: ice_or < :: boost :: is_lvalue_reference < T > :: value , :: boost
  62311. #33
  62312. :: is_rvalue_reference < T > :: value > :: value ) ;
  62313. } ;
  62314.  
  62315. }
  62316.  
  62317. template < typename T > struct is_reference : public :: boost :: integral_constant < bool , :: boost :: detail :: is_reference_impl
  62318. #38
  62319. < T > :: value > { public : } ;
  62320.  
  62321. }
  62322. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62323. #1 "./boost/type_traits/detail/type_trait_def.hpp"
  62324. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62325. #19 "./boost/type_traits/add_reference.hpp"
  62326. namespace boost {
  62327.  
  62328. namespace detail {
  62329. #59
  62330. template < typename T >
  62331. struct add_reference_rvalue_layer
  62332. {
  62333. typedef T & type ;
  62334. } ;
  62335. #73
  62336. template < typename T >
  62337. struct add_reference_impl
  62338. {
  62339. typedef typename add_reference_rvalue_layer < T > :: type type ;
  62340. } ;
  62341.  
  62342.  
  62343. template < typename T > struct add_reference_impl < T & > { public : typedef T & type ; } ;
  62344.  
  62345.  
  62346.  
  62347.  
  62348.  
  62349. template < > struct add_reference_impl < void > { public : typedef void type ; } ;
  62350.  
  62351. template < > struct add_reference_impl < void const > { public : typedef void const type ; } ;
  62352. template < > struct add_reference_impl < void volatile > { public : typedef void volatile type ; } ;
  62353. template < > struct add_reference_impl < void const volatile > { public : typedef void const volatile type ; } ;
  62354.  
  62355.  
  62356. }
  62357.  
  62358. template < typename T > struct add_reference { public : typedef typename boost :: detail :: add_reference_impl < T > :: type
  62359. #95
  62360. type ; } ;
  62361. #103
  62362. }
  62363. #1 "./boost/type_traits/detail/type_trait_undef.hpp"
  62364. #1 "./boost/type_traits/is_arithmetic.hpp"
  62365. #1 "./boost/type_traits/is_integral.hpp"
  62366. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62367. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62368. #17 "./boost/type_traits/is_integral.hpp"
  62369. namespace boost {
  62370. #25
  62371. template < typename T > struct is_integral : public :: boost :: integral_constant < bool , false > { public : } ;
  62372.  
  62373. template < > struct is_integral < unsigned char > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62374. #27
  62375. < > struct is_integral < unsigned char const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62376. #27
  62377. < > struct is_integral < unsigned char volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62378. #27
  62379. < > struct is_integral < unsigned char const volatile > : public :: boost :: integral_constant < bool , true > { public :
  62380. #27
  62381. } ;
  62382. template < > struct is_integral < unsigned short > : public :: boost :: integral_constant < bool , true > { public : } ;
  62383. #28
  62384. template < > struct is_integral < unsigned short const > : public :: boost :: integral_constant < bool , true > { public
  62385. #28
  62386. : } ; template < > struct is_integral < unsigned short volatile > : public :: boost :: integral_constant < bool , true >
  62387. #28
  62388. { public : } ; template < > struct is_integral < unsigned short const volatile > : public :: boost :: integral_constant <
  62389. #28
  62390. bool , true > { public : } ;
  62391. template < > struct is_integral < unsigned int > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62392. #29
  62393. < > struct is_integral < unsigned int const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62394. #29
  62395. < > struct is_integral < unsigned int volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62396. #29
  62397. < > struct is_integral < unsigned int const volatile > : public :: boost :: integral_constant < bool , true > { public :
  62398. #29
  62399. } ;
  62400. template < > struct is_integral < unsigned long > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62401. #30
  62402. < > struct is_integral < unsigned long const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62403. #30
  62404. < > struct is_integral < unsigned long volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62405. #30
  62406. < > struct is_integral < unsigned long const volatile > : public :: boost :: integral_constant < bool , true > { public :
  62407. #30
  62408. } ;
  62409.  
  62410. template < > struct is_integral < signed char > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62411. #32
  62412. < > struct is_integral < signed char const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62413. #32
  62414. < > struct is_integral < signed char volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62415. #32
  62416. < > struct is_integral < signed char const volatile > : public :: boost :: integral_constant < bool , true > { public : }
  62417. #32
  62418. ;
  62419. template < > struct is_integral < signed short > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62420. #33
  62421. < > struct is_integral < signed short const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62422. #33
  62423. < > struct is_integral < signed short volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62424. #33
  62425. < > struct is_integral < signed short const volatile > : public :: boost :: integral_constant < bool , true > { public :
  62426. #33
  62427. } ;
  62428. template < > struct is_integral < signed int > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62429. #34
  62430. < > struct is_integral < signed int const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62431. #34
  62432. < > struct is_integral < signed int volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62433. #34
  62434. < > struct is_integral < signed int const volatile > : public :: boost :: integral_constant < bool , true > { public : }
  62435. #34
  62436. ;
  62437. template < > struct is_integral < signed long > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62438. #35
  62439. < > struct is_integral < signed long const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62440. #35
  62441. < > struct is_integral < signed long volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62442. #35
  62443. < > struct is_integral < signed long const volatile > : public :: boost :: integral_constant < bool , true > { public : }
  62444. #35
  62445. ;
  62446.  
  62447. template < > struct is_integral < bool > : public :: boost :: integral_constant < bool , true > { public : } ; template <
  62448. #37
  62449. > struct is_integral < bool const > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct
  62450. #37
  62451. is_integral < bool volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct is_integral
  62452. #37
  62453. < bool const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62454. template < > struct is_integral < char > : public :: boost :: integral_constant < bool , true > { public : } ; template <
  62455. #38
  62456. > struct is_integral < char const > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct
  62457. #38
  62458. is_integral < char volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct is_integral
  62459. #38
  62460. < char const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62461.  
  62462.  
  62463.  
  62464.  
  62465.  
  62466. template < > struct is_integral < wchar_t > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62467. #44
  62468. < > struct is_integral < wchar_t const > : public :: boost :: integral_constant < bool , true > { public : } ; template <
  62469. #44
  62470. > struct is_integral < wchar_t volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62471. #44
  62472. < > struct is_integral < wchar_t const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62473. #65
  62474. template < > struct is_integral < :: boost :: ulong_long_type > : public :: boost :: integral_constant < bool , true > {
  62475. #65
  62476. public : } ; template < > struct is_integral < :: boost :: ulong_long_type const > : public :: boost :: integral_constant
  62477. #65
  62478. < bool , true > { public : } ; template < > struct is_integral < :: boost :: ulong_long_type volatile > : public :: boost
  62479. #65
  62480. :: integral_constant < bool , true > { public : } ; template < > struct is_integral < :: boost :: ulong_long_type const volatile
  62481. #65
  62482. > : public :: boost :: integral_constant < bool , true > { public : } ;
  62483. template < > struct is_integral < :: boost :: long_long_type > : public :: boost :: integral_constant < bool , true > { public
  62484. #66
  62485. : } ; template < > struct is_integral < :: boost :: long_long_type const > : public :: boost :: integral_constant < bool
  62486. #66
  62487. , true > { public : } ; template < > struct is_integral < :: boost :: long_long_type volatile > : public :: boost :: integral_constant
  62488. #66
  62489. < bool , true > { public : } ; template < > struct is_integral < :: boost :: long_long_type const volatile > : public ::
  62490. #66
  62491. boost :: integral_constant < bool , true > { public : } ;
  62492. #79
  62493. }
  62494. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62495. #1 "./boost/type_traits/is_float.hpp"
  62496. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62497. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62498. #15 "./boost/type_traits/is_float.hpp"
  62499. namespace boost {
  62500.  
  62501.  
  62502. template < typename T > struct is_float : public :: boost :: integral_constant < bool , false > { public : } ;
  62503. template < > struct is_float < float > : public :: boost :: integral_constant < bool , true > { public : } ; template < >
  62504. #19
  62505. struct is_float < float const > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct
  62506. #19
  62507. is_float < float volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct is_float
  62508. #19
  62509. < float const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62510. template < > struct is_float < double > : public :: boost :: integral_constant < bool , true > { public : } ; template <
  62511. #20
  62512. > struct is_float < double const > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct
  62513. #20
  62514. is_float < double volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template < > struct is_float
  62515. #20
  62516. < double const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62517. template < > struct is_float < long double > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62518. #21
  62519. < > struct is_float < long double const > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62520. #21
  62521. < > struct is_float < long double volatile > : public :: boost :: integral_constant < bool , true > { public : } ; template
  62522. #21
  62523. < > struct is_float < long double const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62524. #21
  62525.  
  62526.  
  62527. }
  62528. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62529. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62530. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62531. #22 "./boost/type_traits/is_arithmetic.hpp"
  62532. namespace boost {
  62533.  
  62534.  
  62535. namespace detail {
  62536.  
  62537. template < typename T >
  62538. struct is_arithmetic_impl
  62539. {
  62540.  
  62541.  
  62542.  
  62543.  
  62544. static const bool value = ( :: boost :: type_traits :: ice_or < :: boost :: is_integral < T > :: value , :: boost :: is_float
  62545. #34
  62546. < T > :: value > :: value ) ;
  62547. } ;
  62548.  
  62549. }
  62550. #44
  62551. template < typename T > struct is_arithmetic : public :: boost :: integral_constant < bool , :: boost :: detail :: is_arithmetic_impl
  62552. #44
  62553. < T > :: value > { public : } ;
  62554.  
  62555.  
  62556. }
  62557. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62558. #1 "./boost/type_traits/is_convertible.hpp"
  62559. #1 "./boost/type_traits/is_array.hpp"
  62560. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62561. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62562. #29 "./boost/type_traits/is_array.hpp"
  62563. namespace boost {
  62564.  
  62565.  
  62566.  
  62567.  
  62568. template < typename T > struct is_array : public :: boost :: integral_constant < bool , false > { public : } ;
  62569.  
  62570. template < typename T , std :: size_t N > struct is_array < T [ N ] > : public :: boost :: integral_constant < bool , true
  62571. #36
  62572. > { public : } ;
  62573. template < typename T , std :: size_t N > struct is_array < T const [ N ] > : public :: boost :: integral_constant < bool
  62574. #37
  62575. , true > { public : } ;
  62576. template < typename T , std :: size_t N > struct is_array < T volatile [ N ] > : public :: boost :: integral_constant < bool
  62577. #38
  62578. , true > { public : } ;
  62579. template < typename T , std :: size_t N > struct is_array < T const volatile [ N ] > : public :: boost :: integral_constant
  62580. #39
  62581. < bool , true > { public : } ;
  62582.  
  62583. template < typename T > struct is_array < T [ ] > : public :: boost :: integral_constant < bool , true > { public : } ;
  62584. template < typename T > struct is_array < T const [ ] > : public :: boost :: integral_constant < bool , true > { public :
  62585. #42
  62586. } ;
  62587. template < typename T > struct is_array < T volatile [ ] > : public :: boost :: integral_constant < bool , true > { public
  62588. #43
  62589. : } ;
  62590. template < typename T > struct is_array < T const volatile [ ] > : public :: boost :: integral_constant < bool , true > {
  62591. #44
  62592. public : } ;
  62593. #87
  62594. }
  62595. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62596. #1 "./boost/type_traits/is_void.hpp"
  62597. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62598. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62599. #17 "./boost/type_traits/is_void.hpp"
  62600. namespace boost {
  62601.  
  62602.  
  62603.  
  62604.  
  62605.  
  62606. template < typename T > struct is_void : public :: boost :: integral_constant < bool , false > { public : } ;
  62607. template < > struct is_void < void > : public :: boost :: integral_constant < bool , true > { public : } ;
  62608.  
  62609.  
  62610. template < > struct is_void < void const > : public :: boost :: integral_constant < bool , true > { public : } ;
  62611. template < > struct is_void < void volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62612. template < > struct is_void < void const volatile > : public :: boost :: integral_constant < bool , true > { public : } ;
  62613. #29
  62614.  
  62615.  
  62616.  
  62617.  
  62618.  
  62619. }
  62620. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62621. #1 "./boost/type_traits/is_abstract.hpp"
  62622. #1 "./boost/type_traits/is_class.hpp"
  62623. #1 "./boost/type_traits/is_union.hpp"
  62624. #1 "./boost/type_traits/remove_cv.hpp"
  62625. #1 "./boost/type_traits/broken_compiler_spec.hpp"
  62626. #1 "./boost/type_traits/detail/cv_traits_impl.hpp"
  62627. #23
  62628. namespace boost {
  62629. namespace detail {
  62630. #32
  62631. template < typename T > struct cv_traits_imp { } ;
  62632.  
  62633. template < typename T >
  62634. struct cv_traits_imp < T * >
  62635. {
  62636. static const bool is_const = false ;
  62637. static const bool is_volatile = false ;
  62638. typedef T unqualified_type ;
  62639. } ;
  62640.  
  62641. template < typename T >
  62642. struct cv_traits_imp < const T * >
  62643. {
  62644. static const bool is_const = true ;
  62645. static const bool is_volatile = false ;
  62646. typedef T unqualified_type ;
  62647. } ;
  62648.  
  62649. template < typename T >
  62650. struct cv_traits_imp < volatile T * >
  62651. {
  62652. static const bool is_const = false ;
  62653. static const bool is_volatile = true ;
  62654. typedef T unqualified_type ;
  62655. } ;
  62656.  
  62657. template < typename T >
  62658. struct cv_traits_imp < const volatile T * >
  62659. {
  62660. static const bool is_const = true ;
  62661. static const bool is_volatile = true ;
  62662. typedef T unqualified_type ;
  62663. } ;
  62664. #92
  62665. }
  62666. }
  62667. #1 "./boost/type_traits/detail/type_trait_def.hpp"
  62668. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62669. #28 "./boost/type_traits/remove_cv.hpp"
  62670. namespace boost {
  62671.  
  62672.  
  62673.  
  62674. namespace detail {
  62675.  
  62676. template < class T >
  62677. struct rvalue_ref_filter_rem_cv
  62678. {
  62679. typedef typename boost :: detail :: cv_traits_imp < T * > :: unqualified_type type ;
  62680. } ;
  62681. #52
  62682. }
  62683.  
  62684.  
  62685.  
  62686. template < typename T > struct remove_cv { public : typedef typename boost :: detail :: rvalue_ref_filter_rem_cv < T > ::
  62687. #56
  62688. type type ; } ;
  62689. template < typename T > struct remove_cv < T & > { public : typedef T & type ; } ;
  62690.  
  62691. template < typename T , std :: size_t N > struct remove_cv < T const [ N ] > { public : typedef T type [ N ] ; } ;
  62692. template < typename T , std :: size_t N > struct remove_cv < T volatile [ N ] > { public : typedef T type [ N ] ; } ;
  62693. template < typename T , std :: size_t N > struct remove_cv < T const volatile [ N ] > { public : typedef T type [ N ] ; }
  62694. #61
  62695. ;
  62696. #80
  62697. }
  62698. #1 "./boost/type_traits/detail/type_trait_undef.hpp"
  62699. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62700. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62701. #21 "./boost/type_traits/is_union.hpp"
  62702. namespace boost {
  62703.  
  62704. namespace detail {
  62705.  
  62706. template < typename T > struct is_union_impl
  62707. {
  62708. typedef typename remove_cv < T > :: type cvt ;
  62709.  
  62710.  
  62711.  
  62712. static const bool value = false ;
  62713.  
  62714. } ;
  62715. #49
  62716. }
  62717.  
  62718. template < typename T > struct is_union : public :: boost :: integral_constant < bool , :: boost :: detail :: is_union_impl
  62719. #51
  62720. < T > :: value > { public : } ;
  62721.  
  62722. }
  62723. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62724. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62725. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62726. #39 "./boost/type_traits/is_class.hpp"
  62727. namespace boost {
  62728.  
  62729. namespace detail {
  62730. #75
  62731. template < typename T >
  62732. struct is_class_impl
  62733. {
  62734. template < class U > static :: boost :: type_traits :: yes_type is_class_tester ( void ( U :: * ) ( void ) ) ;
  62735. template < class U > static :: boost :: type_traits :: no_type is_class_tester ( ... ) ;
  62736. #86
  62737. static const bool value = ( :: boost :: type_traits :: ice_and < sizeof ( is_class_tester < T > ( 0 ) ) == sizeof ( :: boost
  62738. #86
  62739. :: type_traits :: yes_type ) , :: boost :: type_traits :: ice_not < :: boost :: is_union < T > :: value > :: value > :: value
  62740. #86
  62741. ) ;
  62742. } ;
  62743. #127
  62744. }
  62745.  
  62746.  
  62747.  
  62748.  
  62749.  
  62750. template < typename T > struct is_class : public :: boost :: integral_constant < bool , :: boost :: detail :: is_class_impl
  62751. #133
  62752. < T > :: value > { public : } ;
  62753.  
  62754.  
  62755. }
  62756. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62757. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  62758. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62759. #65 "./boost/type_traits/is_abstract.hpp"
  62760. namespace boost {
  62761. namespace detail {
  62762. #75
  62763. template < class T >
  62764. struct is_abstract_imp2
  62765. {
  62766.  
  62767.  
  62768.  
  62769.  
  62770. template < class U >
  62771. static type_traits :: no_type check_sig ( U ( * ) [ 1 ] ) ;
  62772. template < class U >
  62773. static type_traits :: yes_type check_sig ( ... ) ;
  62774.  
  62775.  
  62776.  
  62777.  
  62778. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( sizeof ( T ) != 0 ) >
  62779. #90
  62780. ) > boost_static_assert_typedef_90 ;
  62781. #101
  62782. static const std :: size_t s1 = sizeof ( check_sig < T > ( 0 ) ) ;
  62783. #108
  62784. static const bool value = ( s1 == sizeof ( type_traits :: yes_type ) ) ;
  62785. } ;
  62786.  
  62787. template < bool v >
  62788. struct is_abstract_select
  62789. {
  62790. template < class T >
  62791. struct rebind
  62792. {
  62793. typedef is_abstract_imp2 < T > type ;
  62794. } ;
  62795. } ;
  62796. template < >
  62797. struct is_abstract_select < false >
  62798. {
  62799. template < class T >
  62800. struct rebind
  62801. {
  62802. typedef false_type type ;
  62803. } ;
  62804. } ;
  62805.  
  62806. template < class T >
  62807. struct is_abstract_imp
  62808. {
  62809. typedef is_abstract_select < :: boost :: is_class < T > :: value > selector ;
  62810. typedef typename selector :: template rebind < T > binder ;
  62811. typedef typename binder :: type type ;
  62812.  
  62813. static const bool value = type :: value ;
  62814. } ;
  62815.  
  62816.  
  62817. }
  62818.  
  62819.  
  62820. template < typename T > struct is_abstract : public :: boost :: integral_constant < bool , :: boost :: detail :: is_abstract_imp
  62821. #144
  62822. < T > :: value > { public : } ;
  62823.  
  62824.  
  62825.  
  62826.  
  62827. }
  62828. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  62829. #1 "./boost/type_traits/add_lvalue_reference.hpp"
  62830. #1 "./boost/type_traits/detail/type_trait_def.hpp"
  62831. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62832. #14 "./boost/type_traits/add_lvalue_reference.hpp"
  62833. namespace boost {
  62834.  
  62835. template < typename T > struct add_lvalue_reference { public : typedef typename boost :: add_reference < T > :: type type
  62836. #16
  62837. ; } ;
  62838.  
  62839.  
  62840.  
  62841.  
  62842.  
  62843. }
  62844. #1 "./boost/type_traits/detail/type_trait_undef.hpp"
  62845. #1 "./boost/type_traits/add_rvalue_reference.hpp"
  62846. #1 "./boost/type_traits/detail/type_trait_def.hpp"
  62847. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  62848. #34 "./boost/type_traits/add_rvalue_reference.hpp"
  62849. namespace boost {
  62850.  
  62851. namespace type_traits_detail {
  62852.  
  62853. template < typename T , bool b >
  62854. struct add_rvalue_reference_helper
  62855. { typedef T type ; } ;
  62856. #50
  62857. template < typename T >
  62858. struct add_rvalue_reference_imp
  62859. {
  62860. typedef typename boost :: type_traits_detail :: add_rvalue_reference_helper
  62861. < T , ( is_void < T > :: value == false && is_reference < T > :: value == false ) > :: type type ;
  62862. } ;
  62863.  
  62864. }
  62865.  
  62866. template < typename T > struct add_rvalue_reference { public : typedef typename boost :: type_traits_detail :: add_rvalue_reference_imp
  62867. #59
  62868. < T > :: type type ; } ;
  62869.  
  62870. }
  62871. #1 "./boost/type_traits/detail/type_trait_undef.hpp"
  62872. #1 "./boost/type_traits/is_function.hpp"
  62873. #1 "./boost/type_traits/detail/false_result.hpp"
  62874. #14
  62875. namespace boost {
  62876. namespace type_traits {
  62877.  
  62878.  
  62879. struct false_result
  62880. {
  62881. template < typename T > struct result_
  62882. {
  62883. static const bool value = false ;
  62884. } ;
  62885. } ;
  62886.  
  62887. } }
  62888. #1 "./boost/type_traits/detail/is_function_ptr_helper.hpp"
  62889. #26
  62890. namespace boost {
  62891. namespace type_traits {
  62892.  
  62893. template < class R >
  62894. struct is_function_ptr_helper
  62895. {
  62896. static const bool value = false ;
  62897. } ;
  62898.  
  62899.  
  62900.  
  62901.  
  62902. template < class R >
  62903. struct is_function_ptr_helper < R ( * ) ( ) > { static const bool value = true ; } ;
  62904.  
  62905. template < class R >
  62906. struct is_function_ptr_helper < R ( * ) ( ... ) > { static const bool value = true ; } ;
  62907.  
  62908. template < class R , class T0 >
  62909. struct is_function_ptr_helper < R ( * ) ( T0 ) > { static const bool value = true ; } ;
  62910.  
  62911. template < class R , class T0 >
  62912. struct is_function_ptr_helper < R ( * ) ( T0 ... ) > { static const bool value = true ; } ;
  62913.  
  62914. template < class R , class T0 , class T1 >
  62915. struct is_function_ptr_helper < R ( * ) ( T0 , T1 ) > { static const bool value = true ; } ;
  62916.  
  62917. template < class R , class T0 , class T1 >
  62918. struct is_function_ptr_helper < R ( * ) ( T0 , T1 ... ) > { static const bool value = true ; } ;
  62919.  
  62920. template < class R , class T0 , class T1 , class T2 >
  62921. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 ) > { static const bool value = true ; } ;
  62922.  
  62923. template < class R , class T0 , class T1 , class T2 >
  62924. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 ... ) > { static const bool value = true ; } ;
  62925.  
  62926. template < class R , class T0 , class T1 , class T2 , class T3 >
  62927. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 ) > { static const bool value = true ; } ;
  62928.  
  62929. template < class R , class T0 , class T1 , class T2 , class T3 >
  62930. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 ... ) > { static const bool value = true ; } ;
  62931.  
  62932. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 >
  62933. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 ) > { static const bool value = true ; } ;
  62934.  
  62935. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 >
  62936. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 ... ) > { static const bool value = true ; } ;
  62937.  
  62938. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  62939. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 ) > { static const bool value = true ; } ;
  62940.  
  62941. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  62942. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 ... ) > { static const bool value = true ; } ;
  62943.  
  62944. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  62945. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ) > { static const bool value = true ; } ;
  62946.  
  62947. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  62948. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ... ) > { static const bool value = true ; } ;
  62949. #84
  62950.  
  62951.  
  62952. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  62953. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ) > { static const bool value = true ; }
  62954. #87
  62955. ;
  62956.  
  62957. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  62958. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ... ) > { static const bool value = true
  62959. #90
  62960. ; } ;
  62961.  
  62962. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 >
  62963. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) > { static const bool value = true
  62964. #93
  62965. ; } ;
  62966.  
  62967. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 >
  62968. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ... ) > { static const bool value =
  62969. #96
  62970. true ; } ;
  62971.  
  62972. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  62973. #98
  62974. T9 >
  62975. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) > { static const bool value =
  62976. #99
  62977. true ; } ;
  62978.  
  62979. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  62980. #101
  62981. T9 >
  62982. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ... ) > { static const bool value
  62983. #102
  62984. = true ; } ;
  62985.  
  62986. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  62987. #104
  62988. T9 , class T10 >
  62989. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ) > { static const bool value
  62990. #105
  62991. = true ; } ;
  62992.  
  62993. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  62994. #107
  62995. T9 , class T10 >
  62996. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ... ) > { static const bool
  62997. #108
  62998. value = true ; } ;
  62999.  
  63000. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63001. #110
  63002. T9 , class T10 , class T11 >
  63003. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ) > { static const
  63004. #111
  63005. bool value = true ; } ;
  63006.  
  63007. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63008. #113
  63009. T9 , class T10 , class T11 >
  63010. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ... ) > { static const
  63011. #114
  63012. bool value = true ; } ;
  63013.  
  63014. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63015. #116
  63016. T9 , class T10 , class T11 , class T12 >
  63017. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ) > { static
  63018. #117
  63019. const bool value = true ; } ;
  63020.  
  63021. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63022. #119
  63023. T9 , class T10 , class T11 , class T12 >
  63024. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ... ) > { static
  63025. #120
  63026. const bool value = true ; } ;
  63027.  
  63028. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63029. #122
  63030. T9 , class T10 , class T11 , class T12 , class T13 >
  63031. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ) > { static
  63032. #123
  63033. const bool value = true ; } ;
  63034.  
  63035. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63036. #125
  63037. T9 , class T10 , class T11 , class T12 , class T13 >
  63038. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ... ) >
  63039. #126
  63040. { static const bool value = true ; } ;
  63041.  
  63042. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63043. #128
  63044. T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  63045. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 )
  63046. #129
  63047. > { static const bool value = true ; } ;
  63048.  
  63049. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63050. #131
  63051. T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  63052. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...
  63053. #132
  63054. ) > { static const bool value = true ; } ;
  63055.  
  63056. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63057. #134
  63058. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  63059. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63060. #135
  63061. T15 ) > { static const bool value = true ; } ;
  63062.  
  63063. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63064. #137
  63065. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  63066. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63067. #138
  63068. T15 ... ) > { static const bool value = true ; } ;
  63069.  
  63070. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63071. #140
  63072. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  63073. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63074. #141
  63075. T15 , T16 ) > { static const bool value = true ; } ;
  63076.  
  63077. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63078. #143
  63079. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  63080. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63081. #144
  63082. T15 , T16 ... ) > { static const bool value = true ; } ;
  63083.  
  63084. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63085. #146
  63086. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  63087. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63088. #147
  63089. T15 , T16 , T17 ) > { static const bool value = true ; } ;
  63090.  
  63091. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63092. #149
  63093. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  63094. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63095. #150
  63096. T15 , T16 , T17 ... ) > { static const bool value = true ; } ;
  63097.  
  63098. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63099. #152
  63100. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 >
  63101. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63102. #153
  63103. T15 , T16 , T17 , T18 ) > { static const bool value = true ; } ;
  63104.  
  63105. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63106. #155
  63107. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 >
  63108. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63109. #156
  63110. T15 , T16 , T17 , T18 ... ) > { static const bool value = true ; } ;
  63111.  
  63112. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63113. #158
  63114. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63115. #158
  63116. >
  63117. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63118. #159
  63119. T15 , T16 , T17 , T18 , T19 ) > { static const bool value = true ; } ;
  63120.  
  63121. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63122. #161
  63123. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63124. #161
  63125. >
  63126. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63127. #162
  63128. T15 , T16 , T17 , T18 , T19 ... ) > { static const bool value = true ; } ;
  63129.  
  63130. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63131. #164
  63132. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63133. #164
  63134. , class T20 >
  63135. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63136. #165
  63137. T15 , T16 , T17 , T18 , T19 , T20 ) > { static const bool value = true ; } ;
  63138.  
  63139. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63140. #167
  63141. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63142. #167
  63143. , class T20 >
  63144. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63145. #168
  63146. T15 , T16 , T17 , T18 , T19 , T20 ... ) > { static const bool value = true ; } ;
  63147.  
  63148. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63149. #170
  63150. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63151. #170
  63152. , class T20 , class T21 >
  63153. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63154. #171
  63155. T15 , T16 , T17 , T18 , T19 , T20 , T21 ) > { static const bool value = true ; } ;
  63156.  
  63157. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63158. #173
  63159. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63160. #173
  63161. , class T20 , class T21 >
  63162. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63163. #174
  63164. T15 , T16 , T17 , T18 , T19 , T20 , T21 ... ) > { static const bool value = true ; } ;
  63165.  
  63166. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63167. #176
  63168. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63169. #176
  63170. , class T20 , class T21 , class T22 >
  63171. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63172. #177
  63173. T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ) > { static const bool value = true ; } ;
  63174.  
  63175. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63176. #179
  63177. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63178. #179
  63179. , class T20 , class T21 , class T22 >
  63180. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63181. #180
  63182. T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ... ) > { static const bool value = true ; } ;
  63183.  
  63184. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63185. #182
  63186. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63187. #182
  63188. , class T20 , class T21 , class T22 , class T23 >
  63189. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63190. #183
  63191. T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ) > { static const bool value = true ; } ;
  63192.  
  63193. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63194. #185
  63195. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63196. #185
  63197. , class T20 , class T21 , class T22 , class T23 >
  63198. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63199. #186
  63200. T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ... ) > { static const bool value = true ; } ;
  63201.  
  63202. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63203. #188
  63204. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63205. #188
  63206. , class T20 , class T21 , class T22 , class T23 , class T24 >
  63207. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63208. #189
  63209. T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ) > { static const bool value = true ; } ;
  63210.  
  63211. template < class R , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class
  63212. #191
  63213. T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18 , class T19
  63214. #191
  63215. , class T20 , class T21 , class T22 , class T23 , class T24 >
  63216. struct is_function_ptr_helper < R ( * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ,
  63217. #192
  63218. T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ... ) > { static const bool value = true ; } ;
  63219. #203
  63220. }
  63221. }
  63222. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  63223. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  63224. #34 "./boost/type_traits/is_function.hpp"
  63225. namespace boost {
  63226.  
  63227.  
  63228.  
  63229. namespace detail {
  63230.  
  63231.  
  63232. template < bool is_ref = true >
  63233. struct is_function_chooser
  63234. : public :: boost :: type_traits :: false_result
  63235. {
  63236. } ;
  63237.  
  63238. template < >
  63239. struct is_function_chooser < false >
  63240. {
  63241. template < typename T > struct result_
  63242. : public :: boost :: type_traits :: is_function_ptr_helper < T * >
  63243. {
  63244. } ;
  63245. } ;
  63246.  
  63247. template < typename T >
  63248. struct is_function_impl
  63249. : public is_function_chooser < :: boost :: is_reference < T > :: value >
  63250. :: template result_ < T >
  63251. {
  63252. } ;
  63253. #95
  63254. }
  63255. #102
  63256. template < typename T > struct is_function : public :: boost :: integral_constant < bool , :: boost :: detail :: is_function_impl
  63257. #102
  63258. < T > :: value > { public : } ;
  63259.  
  63260.  
  63261.  
  63262.  
  63263. }
  63264. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  63265. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  63266. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  63267. #39 "./boost/type_traits/is_convertible.hpp"
  63268. namespace boost {
  63269. #53
  63270. namespace detail {
  63271. #300
  63272. template < typename From , typename To >
  63273. struct is_convertible_basic_impl
  63274. {
  63275. static :: boost :: type_traits :: no_type _m_check ( ... ) ;
  63276. static :: boost :: type_traits :: yes_type _m_check ( To ) ;
  63277. typedef typename add_lvalue_reference < From > :: type lvalue_type ;
  63278. typedef typename add_rvalue_reference < From > :: type rvalue_type ;
  63279. static lvalue_type _m_from ;
  63280. #322
  63281. static const bool value = sizeof ( _m_check ( _m_from ) ) == sizeof ( :: boost :: type_traits :: yes_type ) ;
  63282.  
  63283.  
  63284.  
  63285.  
  63286. } ;
  63287. #351
  63288. template < typename From , typename To >
  63289. struct is_convertible_impl
  63290. {
  63291. #367
  63292. static const bool value = ( :: boost :: type_traits :: ice_and < :: boost :: type_traits :: ice_or < :: boost :: detail ::
  63293. #367
  63294. is_convertible_basic_impl < From , To > :: value , :: boost :: is_void < To > :: value > :: value , :: boost :: type_traits
  63295. #367
  63296. :: ice_not < :: boost :: is_array < To > :: value > :: value , :: boost :: type_traits :: ice_not < :: boost :: is_function
  63297. #367
  63298. < To > :: value > :: value > :: value ) ;
  63299. } ;
  63300.  
  63301.  
  63302. template < bool trivial1 , bool trivial2 , bool abstract_target >
  63303. struct is_convertible_impl_select
  63304. {
  63305. template < class From , class To >
  63306. struct rebind
  63307. {
  63308. typedef is_convertible_impl < From , To > type ;
  63309. } ;
  63310. } ;
  63311.  
  63312. template < >
  63313. struct is_convertible_impl_select < true , true , false >
  63314. {
  63315. template < class From , class To >
  63316. struct rebind
  63317. {
  63318. typedef true_type type ;
  63319. } ;
  63320. } ;
  63321.  
  63322. template < >
  63323. struct is_convertible_impl_select < false , false , true >
  63324. {
  63325. template < class From , class To >
  63326. struct rebind
  63327. {
  63328. typedef false_type type ;
  63329. } ;
  63330. } ;
  63331.  
  63332. template < >
  63333. struct is_convertible_impl_select < true , false , true >
  63334. {
  63335. template < class From , class To >
  63336. struct rebind
  63337. {
  63338. typedef false_type type ;
  63339. } ;
  63340. } ;
  63341.  
  63342. template < typename From , typename To >
  63343. struct is_convertible_impl_dispatch_base
  63344. {
  63345.  
  63346. typedef is_convertible_impl_select <
  63347. :: boost :: is_arithmetic < From > :: value ,
  63348. :: boost :: is_arithmetic < To > :: value ,
  63349.  
  63350. :: boost :: is_abstract < To > :: value
  63351.  
  63352.  
  63353.  
  63354. > selector ;
  63355.  
  63356.  
  63357.  
  63358. typedef typename selector :: template rebind < From , To > isc_binder ;
  63359. typedef typename isc_binder :: type type ;
  63360. } ;
  63361.  
  63362. template < typename From , typename To >
  63363. struct is_convertible_impl_dispatch
  63364. : public is_convertible_impl_dispatch_base < From , To > :: type
  63365. { } ;
  63366. #456
  63367. template < > struct is_convertible_impl < void , void > { public : static const bool value = ( true ) ; } ; template < >
  63368. #456
  63369. struct is_convertible_impl < void , void const > { public : static const bool value = ( true ) ; } ; template < > struct
  63370. #456
  63371. is_convertible_impl < void , void volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl
  63372. #456
  63373. < void , void const volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl
  63374. #456
  63375. < void const , void > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void
  63376. #456
  63377. const , void const > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void const
  63378. #456
  63379. , void volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void const
  63380. #456
  63381. , void const volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void
  63382. #456
  63383. volatile , void > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void volatile
  63384. #456
  63385. , void const > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void volatile
  63386. #456
  63387. , void volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void volatile
  63388. #456
  63389. , void const volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void
  63390. #456
  63391. const volatile , void > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl < void
  63392. #456
  63393. const volatile , void const > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl
  63394. #456
  63395. < void const volatile , void volatile > { public : static const bool value = ( true ) ; } ; template < > struct is_convertible_impl
  63396. #456
  63397. < void const volatile , void const volatile > { public : static const bool value = ( true ) ; } ;
  63398. #466
  63399. template < typename To > struct is_convertible_impl < void , To > { public : static const bool value = ( false ) ; } ;
  63400. template < typename From > struct is_convertible_impl < From , void > { public : static const bool value = ( false ) ; }
  63401. #467
  63402. ;
  63403.  
  63404. template < typename To > struct is_convertible_impl < void const , To > { public : static const bool value = ( false ) ;
  63405. #469
  63406. } ;
  63407. template < typename To > struct is_convertible_impl < void volatile , To > { public : static const bool value = ( false )
  63408. #470
  63409. ; } ;
  63410. template < typename To > struct is_convertible_impl < void const volatile , To > { public : static const bool value = ( false
  63411. #471
  63412. ) ; } ;
  63413. template < typename From > struct is_convertible_impl < From , void const > { public : static const bool value = ( false
  63414. #472
  63415. ) ; } ;
  63416. template < typename From > struct is_convertible_impl < From , void volatile > { public : static const bool value = ( false
  63417. #473
  63418. ) ; } ;
  63419. template < typename From > struct is_convertible_impl < From , void const volatile > { public : static const bool value =
  63420. #474
  63421. ( false ) ; } ;
  63422.  
  63423.  
  63424.  
  63425. }
  63426.  
  63427. template < typename From , typename To > struct is_convertible : public :: boost :: integral_constant < bool , ( :: boost
  63428. #480
  63429. :: detail :: is_convertible_impl_dispatch < From , To > :: value ) > { public : } ;
  63430. #488
  63431. }
  63432. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  63433. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  63434. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  63435. #34 "./boost/type_traits/is_enum.hpp"
  63436. namespace boost {
  63437.  
  63438.  
  63439.  
  63440.  
  63441. namespace detail {
  63442.  
  63443.  
  63444.  
  63445. template < typename T >
  63446. struct is_class_or_union
  63447. {
  63448.  
  63449.  
  63450.  
  63451.  
  63452. static const bool value = ( :: boost :: type_traits :: ice_or < :: boost :: is_class < T > :: value , :: boost :: is_union
  63453. #50
  63454. < T > :: value > :: value ) ;
  63455. } ;
  63456. #78
  63457. struct int_convertible
  63458. {
  63459. int_convertible ( int ) ;
  63460. } ;
  63461.  
  63462.  
  63463.  
  63464. template < bool is_typename_arithmetic_or_reference = true >
  63465. struct is_enum_helper
  63466. {
  63467. template < typename T > struct type
  63468. {
  63469. static const bool value = false ;
  63470. } ;
  63471. } ;
  63472.  
  63473. template < >
  63474. struct is_enum_helper < false >
  63475. {
  63476. template < typename T > struct type
  63477. : public :: boost :: is_convertible < typename boost :: add_reference < T > :: type , :: boost :: detail :: int_convertible
  63478. #98
  63479. >
  63480. {
  63481. } ;
  63482. } ;
  63483.  
  63484. template < typename T > struct is_enum_impl
  63485. {
  63486. #143
  63487. static const bool selector = ( :: boost :: type_traits :: ice_or < :: boost :: is_arithmetic < T > :: value , :: boost ::
  63488. #143
  63489. is_reference < T > :: value , is_class_or_union < T > :: value , is_array < T > :: value > :: value ) ;
  63490. #152
  63491. typedef :: boost :: detail :: is_enum_helper < selector > se_t ;
  63492.  
  63493.  
  63494. typedef typename se_t :: template type < T > helper ;
  63495. static const bool value = helper :: value ;
  63496. } ;
  63497.  
  63498.  
  63499. template < > struct is_enum_impl < void > { public : static const bool value = ( false ) ; } ;
  63500.  
  63501. template < > struct is_enum_impl < void const > { public : static const bool value = ( false ) ; } ;
  63502. template < > struct is_enum_impl < void volatile > { public : static const bool value = ( false ) ; } ;
  63503. template < > struct is_enum_impl < void const volatile > { public : static const bool value = ( false ) ; } ;
  63504.  
  63505.  
  63506. }
  63507.  
  63508. template < typename T > struct is_enum : public :: boost :: integral_constant < bool , :: boost :: detail :: is_enum_impl
  63509. #169
  63510. < T > :: value > { public : } ;
  63511. #185
  63512. }
  63513. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  63514. #37 "./boost/functional/hash/hash.hpp"
  63515. namespace boost
  63516. {
  63517. namespace hash_detail
  63518. {
  63519. struct enable_hash_value { typedef std :: size_t type ; } ;
  63520.  
  63521. template < typename T > struct basic_numbers { } ;
  63522. template < typename T > struct long_numbers ;
  63523. template < typename T > struct ulong_numbers ;
  63524. template < typename T > struct float_numbers { } ;
  63525.  
  63526. template < > struct basic_numbers < bool > :
  63527. boost :: hash_detail :: enable_hash_value { } ;
  63528. template < > struct basic_numbers < char > :
  63529. boost :: hash_detail :: enable_hash_value { } ;
  63530. template < > struct basic_numbers < unsigned char > :
  63531. boost :: hash_detail :: enable_hash_value { } ;
  63532. template < > struct basic_numbers < signed char > :
  63533. boost :: hash_detail :: enable_hash_value { } ;
  63534. template < > struct basic_numbers < short > :
  63535. boost :: hash_detail :: enable_hash_value { } ;
  63536. template < > struct basic_numbers < unsigned short > :
  63537. boost :: hash_detail :: enable_hash_value { } ;
  63538. template < > struct basic_numbers < int > :
  63539. boost :: hash_detail :: enable_hash_value { } ;
  63540. template < > struct basic_numbers < unsigned int > :
  63541. boost :: hash_detail :: enable_hash_value { } ;
  63542. template < > struct basic_numbers < long > :
  63543. boost :: hash_detail :: enable_hash_value { } ;
  63544. template < > struct basic_numbers < unsigned long > :
  63545. boost :: hash_detail :: enable_hash_value { } ;
  63546.  
  63547.  
  63548. template < > struct basic_numbers < wchar_t > :
  63549. boost :: hash_detail :: enable_hash_value { } ;
  63550.  
  63551.  
  63552.  
  63553.  
  63554.  
  63555. template < typename T > struct long_numbers2 { } ;
  63556. template < typename T > struct ulong_numbers2 { } ;
  63557. template < typename T > struct long_numbers : long_numbers2 < T > { } ;
  63558. template < typename T > struct ulong_numbers : ulong_numbers2 < T > { } ;
  63559.  
  63560.  
  63561. template < > struct long_numbers < boost :: long_long_type > :
  63562. boost :: hash_detail :: enable_hash_value { } ;
  63563. template < > struct ulong_numbers < boost :: ulong_long_type > :
  63564. boost :: hash_detail :: enable_hash_value { } ;
  63565. #96
  63566. template < > struct float_numbers < float > :
  63567. boost :: hash_detail :: enable_hash_value { } ;
  63568. template < > struct float_numbers < double > :
  63569. boost :: hash_detail :: enable_hash_value { } ;
  63570. template < > struct float_numbers < long double > :
  63571. boost :: hash_detail :: enable_hash_value { } ;
  63572. }
  63573.  
  63574. template < typename T >
  63575. typename boost :: hash_detail :: basic_numbers < T > :: type hash_value ( T ) ;
  63576. template < typename T >
  63577. typename boost :: hash_detail :: long_numbers < T > :: type hash_value ( T ) ;
  63578. template < typename T >
  63579. typename boost :: hash_detail :: ulong_numbers < T > :: type hash_value ( T ) ;
  63580.  
  63581. template < typename T >
  63582. typename boost :: enable_if < boost :: is_enum < T > , std :: size_t > :: type
  63583. hash_value ( T ) ;
  63584.  
  63585.  
  63586. template < class T > std :: size_t hash_value ( T * const & ) ;
  63587.  
  63588.  
  63589.  
  63590.  
  63591.  
  63592. template < class T , unsigned N >
  63593. std :: size_t hash_value ( const T ( & x ) [ N ] ) ;
  63594.  
  63595. template < class T , unsigned N >
  63596. std :: size_t hash_value ( T ( & x ) [ N ] ) ;
  63597.  
  63598.  
  63599. template < class Ch , class A >
  63600. std :: size_t hash_value (
  63601. std :: basic_string < Ch , std :: char_traits < Ch > , A > const & ) ;
  63602.  
  63603. template < typename T >
  63604. typename boost :: hash_detail :: float_numbers < T > :: type hash_value ( T ) ;
  63605. #142
  63606. namespace hash_detail
  63607. {
  63608. template < class T >
  63609. inline std :: size_t hash_value_signed ( T val )
  63610. {
  63611. const int size_t_bits = std :: numeric_limits < std :: size_t > :: digits ;
  63612.  
  63613. const int length = ( std :: numeric_limits < T > :: digits - 1 )
  63614. / size_t_bits ;
  63615.  
  63616. std :: size_t seed = 0 ;
  63617. T positive = val < 0 ? - 1 - val : val ;
  63618.  
  63619.  
  63620. for ( unsigned int i = length * size_t_bits ; i > 0 ; i -= size_t_bits )
  63621. {
  63622. seed ^= ( std :: size_t ) ( positive >> i ) + ( seed << 6 ) + ( seed >> 2 ) ;
  63623. }
  63624. seed ^= ( std :: size_t ) val + ( seed << 6 ) + ( seed >> 2 ) ;
  63625.  
  63626. return seed ;
  63627. }
  63628.  
  63629. template < class T >
  63630. inline std :: size_t hash_value_unsigned ( T val )
  63631. {
  63632. const int size_t_bits = std :: numeric_limits < std :: size_t > :: digits ;
  63633.  
  63634. const int length = ( std :: numeric_limits < T > :: digits - 1 )
  63635. / size_t_bits ;
  63636.  
  63637. std :: size_t seed = 0 ;
  63638.  
  63639.  
  63640. for ( unsigned int i = length * size_t_bits ; i > 0 ; i -= size_t_bits )
  63641. {
  63642. seed ^= ( std :: size_t ) ( val >> i ) + ( seed << 6 ) + ( seed >> 2 ) ;
  63643. }
  63644. seed ^= ( std :: size_t ) val + ( seed << 6 ) + ( seed >> 2 ) ;
  63645.  
  63646. return seed ;
  63647. }
  63648. }
  63649.  
  63650. template < typename T >
  63651. typename boost :: hash_detail :: basic_numbers < T > :: type hash_value ( T v )
  63652. {
  63653. return static_cast < std :: size_t > ( v ) ;
  63654. }
  63655.  
  63656. template < typename T >
  63657. typename boost :: hash_detail :: long_numbers < T > :: type hash_value ( T v )
  63658. {
  63659. return hash_detail :: hash_value_signed ( v ) ;
  63660. }
  63661.  
  63662. template < typename T >
  63663. typename boost :: hash_detail :: ulong_numbers < T > :: type hash_value ( T v )
  63664. {
  63665. return hash_detail :: hash_value_unsigned ( v ) ;
  63666. }
  63667.  
  63668. template < typename T >
  63669. typename boost :: enable_if < boost :: is_enum < T > , std :: size_t > :: type
  63670. hash_value ( T v )
  63671. {
  63672. return static_cast < std :: size_t > ( v ) ;
  63673. }
  63674.  
  63675.  
  63676.  
  63677. template < class T > std :: size_t hash_value ( T * const & v )
  63678.  
  63679.  
  63680.  
  63681. {
  63682. #224
  63683. std :: size_t x = static_cast < std :: size_t > (
  63684. reinterpret_cast < std :: ptrdiff_t > ( v ) ) ;
  63685.  
  63686. return x + ( x >> 3 ) ;
  63687. }
  63688. #244
  63689. template < class T >
  63690. inline void hash_combine ( std :: size_t & seed , T const & v )
  63691.  
  63692. {
  63693. boost :: hash < T > hasher ;
  63694. seed ^= hasher ( v ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ) ;
  63695. }
  63696.  
  63697.  
  63698.  
  63699.  
  63700.  
  63701. template < class It >
  63702. inline std :: size_t hash_range ( It first , It last )
  63703. {
  63704. std :: size_t seed = 0 ;
  63705.  
  63706. for ( ; first != last ; ++ first )
  63707. {
  63708. hash_combine ( seed , * first ) ;
  63709. }
  63710.  
  63711. return seed ;
  63712. }
  63713.  
  63714. template < class It >
  63715. inline void hash_range ( std :: size_t & seed , It first , It last )
  63716. {
  63717. for ( ; first != last ; ++ first )
  63718. {
  63719. hash_combine ( seed , * first ) ;
  63720. }
  63721. }
  63722. #305
  63723. template < class T , unsigned N >
  63724. inline std :: size_t hash_value ( const T ( & x ) [ N ] )
  63725. {
  63726. return hash_range ( x , x + N ) ;
  63727. }
  63728.  
  63729. template < class T , unsigned N >
  63730. inline std :: size_t hash_value ( T ( & x ) [ N ] )
  63731. {
  63732. return hash_range ( x , x + N ) ;
  63733. }
  63734.  
  63735.  
  63736. template < class Ch , class A >
  63737. inline std :: size_t hash_value (
  63738. std :: basic_string < Ch , std :: char_traits < Ch > , A > const & v )
  63739. {
  63740. return hash_range ( v . begin ( ) , v . end ( ) ) ;
  63741. }
  63742.  
  63743. template < typename T >
  63744. typename boost :: hash_detail :: float_numbers < T > :: type hash_value ( T v )
  63745. {
  63746. return boost :: hash_detail :: float_hash_value ( v ) ;
  63747. }
  63748. #414
  63749. template < > struct hash < bool > : public std :: unary_function < bool , std :: size_t > { std :: size_t operator ( ) (
  63750. #414
  63751. bool v ) const { return boost :: hash_value ( v ) ; } } ;
  63752. template < > struct hash < char > : public std :: unary_function < char , std :: size_t > { std :: size_t operator ( ) (
  63753. #415
  63754. char v ) const { return boost :: hash_value ( v ) ; } } ;
  63755. template < > struct hash < signed char > : public std :: unary_function < signed char , std :: size_t > { std :: size_t operator
  63756. #416
  63757. ( ) ( signed char v ) const { return boost :: hash_value ( v ) ; } } ;
  63758. template < > struct hash < unsigned char > : public std :: unary_function < unsigned char , std :: size_t > { std :: size_t
  63759. #417
  63760. operator ( ) ( unsigned char v ) const { return boost :: hash_value ( v ) ; } } ;
  63761.  
  63762. template < > struct hash < wchar_t > : public std :: unary_function < wchar_t , std :: size_t > { std :: size_t operator
  63763. #419
  63764. ( ) ( wchar_t v ) const { return boost :: hash_value ( v ) ; } } ;
  63765.  
  63766. template < > struct hash < short > : public std :: unary_function < short , std :: size_t > { std :: size_t operator ( )
  63767. #421
  63768. ( short v ) const { return boost :: hash_value ( v ) ; } } ;
  63769. template < > struct hash < unsigned short > : public std :: unary_function < unsigned short , std :: size_t > { std :: size_t
  63770. #422
  63771. operator ( ) ( unsigned short v ) const { return boost :: hash_value ( v ) ; } } ;
  63772. template < > struct hash < int > : public std :: unary_function < int , std :: size_t > { std :: size_t operator ( ) ( int
  63773. #423
  63774. v ) const { return boost :: hash_value ( v ) ; } } ;
  63775. template < > struct hash < unsigned int > : public std :: unary_function < unsigned int , std :: size_t > { std :: size_t
  63776. #424
  63777. operator ( ) ( unsigned int v ) const { return boost :: hash_value ( v ) ; } } ;
  63778. template < > struct hash < long > : public std :: unary_function < long , std :: size_t > { std :: size_t operator ( ) (
  63779. #425
  63780. long v ) const { return boost :: hash_value ( v ) ; } } ;
  63781. template < > struct hash < unsigned long > : public std :: unary_function < unsigned long , std :: size_t > { std :: size_t
  63782. #426
  63783. operator ( ) ( unsigned long v ) const { return boost :: hash_value ( v ) ; } } ;
  63784.  
  63785. template < > struct hash < float > : public std :: unary_function < float , std :: size_t > { std :: size_t operator ( )
  63786. #428
  63787. ( float v ) const { return boost :: hash_value ( v ) ; } } ;
  63788. template < > struct hash < double > : public std :: unary_function < double , std :: size_t > { std :: size_t operator (
  63789. #429
  63790. ) ( double v ) const { return boost :: hash_value ( v ) ; } } ;
  63791. template < > struct hash < long double > : public std :: unary_function < long double , std :: size_t > { std :: size_t operator
  63792. #430
  63793. ( ) ( long double v ) const { return boost :: hash_value ( v ) ; } } ;
  63794.  
  63795. template < > struct hash < std :: string > : public std :: unary_function < std :: string , std :: size_t > { std :: size_t
  63796. #432
  63797. operator ( ) ( std :: string const & v ) const { return boost :: hash_value ( v ) ; } } ;
  63798.  
  63799. template < > struct hash < std :: wstring > : public std :: unary_function < std :: wstring , std :: size_t > { std :: size_t
  63800. #434
  63801. operator ( ) ( std :: wstring const & v ) const { return boost :: hash_value ( v ) ; } } ;
  63802.  
  63803.  
  63804.  
  63805. template < > struct hash < boost :: long_long_type > : public std :: unary_function < boost :: long_long_type , std :: size_t
  63806. #438
  63807. > { std :: size_t operator ( ) ( boost :: long_long_type v ) const { return boost :: hash_value ( v ) ; } } ;
  63808. template < > struct hash < boost :: ulong_long_type > : public std :: unary_function < boost :: ulong_long_type , std ::
  63809. #439
  63810. size_t > { std :: size_t operator ( ) ( boost :: ulong_long_type v ) const { return boost :: hash_value ( v ) ; } } ;
  63811. #458
  63812. template < class T >
  63813. struct hash < T * >
  63814. : public std :: unary_function < T * , std :: size_t >
  63815. {
  63816. std :: size_t operator ( ) ( T * v ) const
  63817. {
  63818.  
  63819. return boost :: hash_value ( v ) ;
  63820. #472
  63821. }
  63822. } ;
  63823. #517
  63824. }
  63825. #1 "./boost/functional/hash/extensions.hpp"
  63826. #1 "./boost/functional/hash/hash.hpp"
  63827. #1 "./boost/detail/container_fwd.hpp"
  63828. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/deque"
  63829. #58
  63830. #pragma GCC system_header
  63831. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_deque.h"
  63832. #66
  63833. namespace std
  63834. {
  63835. #88
  63836. inline size_t
  63837. __deque_buf_size ( size_t __size )
  63838. { return ( __size < 512
  63839. ? size_t ( 512 / __size ) : size_t ( 1 ) ) ; }
  63840. #105
  63841. template < typename _Tp , typename _Ref , typename _Ptr >
  63842. struct _Deque_iterator
  63843. {
  63844. typedef _Deque_iterator < _Tp , _Tp & , _Tp * > iterator ;
  63845. typedef _Deque_iterator < _Tp , const _Tp & , const _Tp * > const_iterator ;
  63846.  
  63847. static size_t _S_buffer_size ( )
  63848. { return __deque_buf_size ( sizeof ( _Tp ) ) ; }
  63849.  
  63850. typedef std :: random_access_iterator_tag iterator_category ;
  63851. typedef _Tp value_type ;
  63852. typedef _Ptr pointer ;
  63853. typedef _Ref reference ;
  63854. typedef size_t size_type ;
  63855. typedef ptrdiff_t difference_type ;
  63856. typedef _Tp * * _Map_pointer ;
  63857. typedef _Deque_iterator _Self ;
  63858.  
  63859. _Tp * _M_cur ;
  63860. _Tp * _M_first ;
  63861. _Tp * _M_last ;
  63862. _Map_pointer _M_node ;
  63863.  
  63864. _Deque_iterator ( _Tp * __x , _Map_pointer __y )
  63865. : _M_cur ( __x ) , _M_first ( * __y ) ,
  63866. _M_last ( * __y + _S_buffer_size ( ) ) , _M_node ( __y ) { }
  63867.  
  63868. _Deque_iterator ( )
  63869. : _M_cur ( 0 ) , _M_first ( 0 ) , _M_last ( 0 ) , _M_node ( 0 ) { }
  63870.  
  63871. _Deque_iterator ( const iterator & __x )
  63872. : _M_cur ( __x . _M_cur ) , _M_first ( __x . _M_first ) ,
  63873. _M_last ( __x . _M_last ) , _M_node ( __x . _M_node ) { }
  63874.  
  63875. reference
  63876. operator * ( ) const
  63877. { return * _M_cur ; }
  63878.  
  63879. pointer
  63880. operator -> ( ) const
  63881. { return _M_cur ; }
  63882.  
  63883. _Self &
  63884. operator ++ ( )
  63885. {
  63886. ++ _M_cur ;
  63887. if ( _M_cur == _M_last )
  63888. {
  63889. _M_set_node ( _M_node + 1 ) ;
  63890. _M_cur = _M_first ;
  63891. }
  63892. return * this ;
  63893. }
  63894.  
  63895. _Self
  63896. operator ++ ( int )
  63897. {
  63898. _Self __tmp = * this ;
  63899. ++ * this ;
  63900. return __tmp ;
  63901. }
  63902.  
  63903. _Self &
  63904. operator -- ( )
  63905. {
  63906. if ( _M_cur == _M_first )
  63907. {
  63908. _M_set_node ( _M_node - 1 ) ;
  63909. _M_cur = _M_last ;
  63910. }
  63911. -- _M_cur ;
  63912. return * this ;
  63913. }
  63914.  
  63915. _Self
  63916. operator -- ( int )
  63917. {
  63918. _Self __tmp = * this ;
  63919. -- * this ;
  63920. return __tmp ;
  63921. }
  63922.  
  63923. _Self &
  63924. operator += ( difference_type __n )
  63925. {
  63926. const difference_type __offset = __n + ( _M_cur - _M_first ) ;
  63927. if ( __offset >= 0 && __offset < difference_type ( _S_buffer_size ( ) ) )
  63928. _M_cur += __n ;
  63929. else
  63930. {
  63931. const difference_type __node_offset =
  63932. __offset > 0 ? __offset / difference_type ( _S_buffer_size ( ) )
  63933. : - difference_type ( ( - __offset - 1 )
  63934. / _S_buffer_size ( ) ) - 1 ;
  63935. _M_set_node ( _M_node + __node_offset ) ;
  63936. _M_cur = _M_first + ( __offset - __node_offset
  63937. * difference_type ( _S_buffer_size ( ) ) ) ;
  63938. }
  63939. return * this ;
  63940. }
  63941.  
  63942. _Self
  63943. operator + ( difference_type __n ) const
  63944. {
  63945. _Self __tmp = * this ;
  63946. return __tmp += __n ;
  63947. }
  63948.  
  63949. _Self &
  63950. operator -= ( difference_type __n )
  63951. { return * this += - __n ; }
  63952.  
  63953. _Self
  63954. operator - ( difference_type __n ) const
  63955. {
  63956. _Self __tmp = * this ;
  63957. return __tmp -= __n ;
  63958. }
  63959.  
  63960. reference
  63961. operator [ ] ( difference_type __n ) const
  63962. { return * ( * this + __n ) ; }
  63963. #233
  63964. void
  63965. _M_set_node ( _Map_pointer __new_node )
  63966. {
  63967. _M_node = __new_node ;
  63968. _M_first = * __new_node ;
  63969. _M_last = _M_first + difference_type ( _S_buffer_size ( ) ) ;
  63970. }
  63971. } ;
  63972.  
  63973.  
  63974.  
  63975.  
  63976. template < typename _Tp , typename _Ref , typename _Ptr >
  63977. inline bool
  63978. operator == ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  63979. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  63980. { return __x . _M_cur == __y . _M_cur ; }
  63981.  
  63982. template < typename _Tp , typename _RefL , typename _PtrL ,
  63983. typename _RefR , typename _PtrR >
  63984. inline bool
  63985. operator == ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  63986. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  63987. { return __x . _M_cur == __y . _M_cur ; }
  63988.  
  63989. template < typename _Tp , typename _Ref , typename _Ptr >
  63990. inline bool
  63991. operator != ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  63992. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  63993. { return ! ( __x == __y ) ; }
  63994.  
  63995. template < typename _Tp , typename _RefL , typename _PtrL ,
  63996. typename _RefR , typename _PtrR >
  63997. inline bool
  63998. operator != ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  63999. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  64000. { return ! ( __x == __y ) ; }
  64001.  
  64002. template < typename _Tp , typename _Ref , typename _Ptr >
  64003. inline bool
  64004. operator < ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  64005. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  64006. { return ( __x . _M_node == __y . _M_node ) ? ( __x . _M_cur < __y . _M_cur )
  64007. : ( __x . _M_node < __y . _M_node ) ; }
  64008.  
  64009. template < typename _Tp , typename _RefL , typename _PtrL ,
  64010. typename _RefR , typename _PtrR >
  64011. inline bool
  64012. operator < ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  64013. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  64014. { return ( __x . _M_node == __y . _M_node ) ? ( __x . _M_cur < __y . _M_cur )
  64015. : ( __x . _M_node < __y . _M_node ) ; }
  64016.  
  64017. template < typename _Tp , typename _Ref , typename _Ptr >
  64018. inline bool
  64019. operator > ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  64020. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  64021. { return __y < __x ; }
  64022.  
  64023. template < typename _Tp , typename _RefL , typename _PtrL ,
  64024. typename _RefR , typename _PtrR >
  64025. inline bool
  64026. operator > ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  64027. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  64028. { return __y < __x ; }
  64029.  
  64030. template < typename _Tp , typename _Ref , typename _Ptr >
  64031. inline bool
  64032. operator <= ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  64033. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  64034. { return ! ( __y < __x ) ; }
  64035.  
  64036. template < typename _Tp , typename _RefL , typename _PtrL ,
  64037. typename _RefR , typename _PtrR >
  64038. inline bool
  64039. operator <= ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  64040. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  64041. { return ! ( __y < __x ) ; }
  64042.  
  64043. template < typename _Tp , typename _Ref , typename _Ptr >
  64044. inline bool
  64045. operator >= ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  64046. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  64047. { return ! ( __x < __y ) ; }
  64048.  
  64049. template < typename _Tp , typename _RefL , typename _PtrL ,
  64050. typename _RefR , typename _PtrR >
  64051. inline bool
  64052. operator >= ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  64053. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  64054. { return ! ( __x < __y ) ; }
  64055.  
  64056.  
  64057.  
  64058.  
  64059.  
  64060. template < typename _Tp , typename _Ref , typename _Ptr >
  64061. inline typename _Deque_iterator < _Tp , _Ref , _Ptr > :: difference_type
  64062. operator - ( const _Deque_iterator < _Tp , _Ref , _Ptr > & __x ,
  64063. const _Deque_iterator < _Tp , _Ref , _Ptr > & __y )
  64064. {
  64065. return typename _Deque_iterator < _Tp , _Ref , _Ptr > :: difference_type
  64066. ( _Deque_iterator < _Tp , _Ref , _Ptr > :: _S_buffer_size ( ) )
  64067. * ( __x . _M_node - __y . _M_node - 1 ) + ( __x . _M_cur - __x . _M_first )
  64068. + ( __y . _M_last - __y . _M_cur ) ;
  64069. }
  64070.  
  64071. template < typename _Tp , typename _RefL , typename _PtrL ,
  64072. typename _RefR , typename _PtrR >
  64073. inline typename _Deque_iterator < _Tp , _RefL , _PtrL > :: difference_type
  64074. operator - ( const _Deque_iterator < _Tp , _RefL , _PtrL > & __x ,
  64075. const _Deque_iterator < _Tp , _RefR , _PtrR > & __y )
  64076. {
  64077. return typename _Deque_iterator < _Tp , _RefL , _PtrL > :: difference_type
  64078. ( _Deque_iterator < _Tp , _RefL , _PtrL > :: _S_buffer_size ( ) )
  64079. * ( __x . _M_node - __y . _M_node - 1 ) + ( __x . _M_cur - __x . _M_first )
  64080. + ( __y . _M_last - __y . _M_cur ) ;
  64081. }
  64082.  
  64083. template < typename _Tp , typename _Ref , typename _Ptr >
  64084. inline _Deque_iterator < _Tp , _Ref , _Ptr >
  64085. operator + ( ptrdiff_t __n , const _Deque_iterator < _Tp , _Ref , _Ptr > & __x )
  64086. { return __x + __n ; }
  64087.  
  64088. template < typename _Tp >
  64089. void
  64090. fill ( const _Deque_iterator < _Tp , _Tp & , _Tp * > & ,
  64091. const _Deque_iterator < _Tp , _Tp & , _Tp * > & , const _Tp & ) ;
  64092.  
  64093. template < typename _Tp >
  64094. _Deque_iterator < _Tp , _Tp & , _Tp * >
  64095. copy ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64096. _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64097. _Deque_iterator < _Tp , _Tp & , _Tp * > ) ;
  64098.  
  64099. template < typename _Tp >
  64100. inline _Deque_iterator < _Tp , _Tp & , _Tp * >
  64101. copy ( _Deque_iterator < _Tp , _Tp & , _Tp * > __first ,
  64102. _Deque_iterator < _Tp , _Tp & , _Tp * > __last ,
  64103. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  64104. { return std :: copy ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > ( __first ) ,
  64105. _Deque_iterator < _Tp , const _Tp & , const _Tp * > ( __last ) ,
  64106. __result ) ; }
  64107.  
  64108. template < typename _Tp >
  64109. _Deque_iterator < _Tp , _Tp & , _Tp * >
  64110. copy_backward ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64111. _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64112. _Deque_iterator < _Tp , _Tp & , _Tp * > ) ;
  64113.  
  64114. template < typename _Tp >
  64115. inline _Deque_iterator < _Tp , _Tp & , _Tp * >
  64116. copy_backward ( _Deque_iterator < _Tp , _Tp & , _Tp * > __first ,
  64117. _Deque_iterator < _Tp , _Tp & , _Tp * > __last ,
  64118. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  64119. { return std :: copy_backward ( _Deque_iterator < _Tp ,
  64120. const _Tp & , const _Tp * > ( __first ) ,
  64121. _Deque_iterator < _Tp ,
  64122. const _Tp & , const _Tp * > ( __last ) ,
  64123. __result ) ; }
  64124.  
  64125.  
  64126. template < typename _Tp >
  64127. _Deque_iterator < _Tp , _Tp & , _Tp * >
  64128. move ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64129. _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64130. _Deque_iterator < _Tp , _Tp & , _Tp * > ) ;
  64131.  
  64132. template < typename _Tp >
  64133. inline _Deque_iterator < _Tp , _Tp & , _Tp * >
  64134. move ( _Deque_iterator < _Tp , _Tp & , _Tp * > __first ,
  64135. _Deque_iterator < _Tp , _Tp & , _Tp * > __last ,
  64136. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  64137. { return std :: move ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > ( __first ) ,
  64138. _Deque_iterator < _Tp , const _Tp & , const _Tp * > ( __last ) ,
  64139. __result ) ; }
  64140.  
  64141. template < typename _Tp >
  64142. _Deque_iterator < _Tp , _Tp & , _Tp * >
  64143. move_backward ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64144. _Deque_iterator < _Tp , const _Tp & , const _Tp * > ,
  64145. _Deque_iterator < _Tp , _Tp & , _Tp * > ) ;
  64146.  
  64147. template < typename _Tp >
  64148. inline _Deque_iterator < _Tp , _Tp & , _Tp * >
  64149. move_backward ( _Deque_iterator < _Tp , _Tp & , _Tp * > __first ,
  64150. _Deque_iterator < _Tp , _Tp & , _Tp * > __last ,
  64151. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  64152. { return std :: move_backward ( _Deque_iterator < _Tp ,
  64153. const _Tp & , const _Tp * > ( __first ) ,
  64154. _Deque_iterator < _Tp ,
  64155. const _Tp & , const _Tp * > ( __last ) ,
  64156. __result ) ; }
  64157. #438
  64158. template < typename _Tp , typename _Alloc >
  64159. class _Deque_base
  64160. {
  64161. public :
  64162. typedef _Alloc allocator_type ;
  64163.  
  64164. allocator_type
  64165. get_allocator ( ) const noexcept
  64166. { return allocator_type ( _M_get_Tp_allocator ( ) ) ; }
  64167.  
  64168. typedef _Deque_iterator < _Tp , _Tp & , _Tp * > iterator ;
  64169. typedef _Deque_iterator < _Tp , const _Tp & , const _Tp * > const_iterator ;
  64170.  
  64171. _Deque_base ( )
  64172. : _M_impl ( )
  64173. { _M_initialize_map ( 0 ) ; }
  64174.  
  64175. _Deque_base ( size_t __num_elements )
  64176. : _M_impl ( )
  64177. { _M_initialize_map ( __num_elements ) ; }
  64178.  
  64179. _Deque_base ( const allocator_type & __a , size_t __num_elements )
  64180. : _M_impl ( __a )
  64181. { _M_initialize_map ( __num_elements ) ; }
  64182.  
  64183. _Deque_base ( const allocator_type & __a )
  64184. : _M_impl ( __a )
  64185. { }
  64186.  
  64187.  
  64188. _Deque_base ( _Deque_base && __x )
  64189. : _M_impl ( std :: move ( __x . _M_get_Tp_allocator ( ) ) )
  64190. {
  64191. _M_initialize_map ( 0 ) ;
  64192. if ( __x . _M_impl . _M_map )
  64193. {
  64194. std :: swap ( this -> _M_impl . _M_start , __x . _M_impl . _M_start ) ;
  64195. std :: swap ( this -> _M_impl . _M_finish , __x . _M_impl . _M_finish ) ;
  64196. std :: swap ( this -> _M_impl . _M_map , __x . _M_impl . _M_map ) ;
  64197. std :: swap ( this -> _M_impl . _M_map_size , __x . _M_impl . _M_map_size ) ;
  64198. }
  64199. }
  64200.  
  64201.  
  64202. ~ _Deque_base ( ) ;
  64203.  
  64204. protected :
  64205.  
  64206.  
  64207.  
  64208. typedef typename _Alloc :: template rebind < _Tp * > :: other _Map_alloc_type ;
  64209.  
  64210. typedef typename _Alloc :: template rebind < _Tp > :: other _Tp_alloc_type ;
  64211.  
  64212. struct _Deque_impl
  64213. : public _Tp_alloc_type
  64214. {
  64215. _Tp * * _M_map ;
  64216. size_t _M_map_size ;
  64217. iterator _M_start ;
  64218. iterator _M_finish ;
  64219.  
  64220. _Deque_impl ( )
  64221. : _Tp_alloc_type ( ) , _M_map ( 0 ) , _M_map_size ( 0 ) ,
  64222. _M_start ( ) , _M_finish ( )
  64223. { }
  64224.  
  64225. _Deque_impl ( const _Tp_alloc_type & __a )
  64226. : _Tp_alloc_type ( __a ) , _M_map ( 0 ) , _M_map_size ( 0 ) ,
  64227. _M_start ( ) , _M_finish ( )
  64228. { }
  64229.  
  64230.  
  64231. _Deque_impl ( _Tp_alloc_type && __a )
  64232. : _Tp_alloc_type ( std :: move ( __a ) ) , _M_map ( 0 ) , _M_map_size ( 0 ) ,
  64233. _M_start ( ) , _M_finish ( )
  64234. { }
  64235.  
  64236. } ;
  64237.  
  64238. _Tp_alloc_type &
  64239. _M_get_Tp_allocator ( ) noexcept
  64240. { return * static_cast < _Tp_alloc_type * > ( & this -> _M_impl ) ; }
  64241.  
  64242. const _Tp_alloc_type &
  64243. _M_get_Tp_allocator ( ) const noexcept
  64244. { return * static_cast < const _Tp_alloc_type * > ( & this -> _M_impl ) ; }
  64245.  
  64246. _Map_alloc_type
  64247. _M_get_map_allocator ( ) const noexcept
  64248. { return _Map_alloc_type ( _M_get_Tp_allocator ( ) ) ; }
  64249.  
  64250. _Tp *
  64251. _M_allocate_node ( )
  64252. {
  64253. return _M_impl . _Tp_alloc_type :: allocate ( __deque_buf_size ( sizeof ( _Tp ) ) ) ;
  64254. }
  64255.  
  64256. void
  64257. _M_deallocate_node ( _Tp * __p )
  64258. {
  64259. _M_impl . _Tp_alloc_type :: deallocate ( __p , __deque_buf_size ( sizeof ( _Tp ) ) ) ;
  64260. }
  64261.  
  64262. _Tp * *
  64263. _M_allocate_map ( size_t __n )
  64264. { return _M_get_map_allocator ( ) . allocate ( __n ) ; }
  64265.  
  64266. void
  64267. _M_deallocate_map ( _Tp * * __p , size_t __n )
  64268. { _M_get_map_allocator ( ) . deallocate ( __p , __n ) ; }
  64269.  
  64270. protected :
  64271. void _M_initialize_map ( size_t ) ;
  64272. void _M_create_nodes ( _Tp * * __nstart , _Tp * * __nfinish ) ;
  64273. void _M_destroy_nodes ( _Tp * * __nstart , _Tp * * __nfinish ) ;
  64274. enum { _S_initial_map_size = 8 } ;
  64275.  
  64276. _Deque_impl _M_impl ;
  64277. } ;
  64278.  
  64279. template < typename _Tp , typename _Alloc >
  64280. _Deque_base < _Tp , _Alloc > ::
  64281. ~ _Deque_base ( )
  64282. {
  64283. if ( this -> _M_impl . _M_map )
  64284. {
  64285. _M_destroy_nodes ( this -> _M_impl . _M_start . _M_node ,
  64286. this -> _M_impl . _M_finish . _M_node + 1 ) ;
  64287. _M_deallocate_map ( this -> _M_impl . _M_map , this -> _M_impl . _M_map_size ) ;
  64288. }
  64289. }
  64290. #579
  64291. template < typename _Tp , typename _Alloc >
  64292. void
  64293. _Deque_base < _Tp , _Alloc > ::
  64294. _M_initialize_map ( size_t __num_elements )
  64295. {
  64296. const size_t __num_nodes = ( __num_elements / __deque_buf_size ( sizeof ( _Tp ) )
  64297. + 1 ) ;
  64298.  
  64299. this -> _M_impl . _M_map_size = std :: max ( ( size_t ) _S_initial_map_size ,
  64300. size_t ( __num_nodes + 2 ) ) ;
  64301. this -> _M_impl . _M_map = _M_allocate_map ( this -> _M_impl . _M_map_size ) ;
  64302. #596
  64303. _Tp * * __nstart = ( this -> _M_impl . _M_map
  64304. + ( this -> _M_impl . _M_map_size - __num_nodes ) / 2 ) ;
  64305. _Tp * * __nfinish = __nstart + __num_nodes ;
  64306.  
  64307. try
  64308. { _M_create_nodes ( __nstart , __nfinish ) ; }
  64309. catch ( ... )
  64310. {
  64311. _M_deallocate_map ( this -> _M_impl . _M_map , this -> _M_impl . _M_map_size ) ;
  64312. this -> _M_impl . _M_map = 0 ;
  64313. this -> _M_impl . _M_map_size = 0 ;
  64314. throw ;
  64315. }
  64316.  
  64317. this -> _M_impl . _M_start . _M_set_node ( __nstart ) ;
  64318. this -> _M_impl . _M_finish . _M_set_node ( __nfinish - 1 ) ;
  64319. this -> _M_impl . _M_start . _M_cur = _M_impl . _M_start . _M_first ;
  64320. this -> _M_impl . _M_finish . _M_cur = ( this -> _M_impl . _M_finish . _M_first
  64321. + __num_elements
  64322. % __deque_buf_size ( sizeof ( _Tp ) ) ) ;
  64323. }
  64324.  
  64325. template < typename _Tp , typename _Alloc >
  64326. void
  64327. _Deque_base < _Tp , _Alloc > ::
  64328. _M_create_nodes ( _Tp * * __nstart , _Tp * * __nfinish )
  64329. {
  64330. _Tp * * __cur ;
  64331. try
  64332. {
  64333. for ( __cur = __nstart ; __cur < __nfinish ; ++ __cur )
  64334. * __cur = this -> _M_allocate_node ( ) ;
  64335. }
  64336. catch ( ... )
  64337. {
  64338. _M_destroy_nodes ( __nstart , __cur ) ;
  64339. throw ;
  64340. }
  64341. }
  64342.  
  64343. template < typename _Tp , typename _Alloc >
  64344. void
  64345. _Deque_base < _Tp , _Alloc > ::
  64346. _M_destroy_nodes ( _Tp * * __nstart , _Tp * * __nfinish )
  64347. {
  64348. for ( _Tp * * __n = __nstart ; __n < __nfinish ; ++ __n )
  64349. _M_deallocate_node ( * __n ) ;
  64350. }
  64351. #729
  64352. template < typename _Tp , typename _Alloc = std :: allocator < _Tp > >
  64353. class deque : protected _Deque_base < _Tp , _Alloc >
  64354. {
  64355.  
  64356. typedef typename _Alloc :: value_type _Alloc_value_type ;
  64357.  
  64358.  
  64359.  
  64360. typedef _Deque_base < _Tp , _Alloc > _Base ;
  64361. typedef typename _Base :: _Tp_alloc_type _Tp_alloc_type ;
  64362.  
  64363. public :
  64364. typedef _Tp value_type ;
  64365. typedef typename _Tp_alloc_type :: pointer pointer ;
  64366. typedef typename _Tp_alloc_type :: const_pointer const_pointer ;
  64367. typedef typename _Tp_alloc_type :: reference reference ;
  64368. typedef typename _Tp_alloc_type :: const_reference const_reference ;
  64369. typedef typename _Base :: iterator iterator ;
  64370. typedef typename _Base :: const_iterator const_iterator ;
  64371. typedef std :: reverse_iterator < const_iterator > const_reverse_iterator ;
  64372. typedef std :: reverse_iterator < iterator > reverse_iterator ;
  64373. typedef size_t size_type ;
  64374. typedef ptrdiff_t difference_type ;
  64375. typedef _Alloc allocator_type ;
  64376.  
  64377. protected :
  64378. typedef pointer * _Map_pointer ;
  64379.  
  64380. static size_t _S_buffer_size ( )
  64381. { return __deque_buf_size ( sizeof ( _Tp ) ) ; }
  64382.  
  64383.  
  64384. using _Base :: _M_initialize_map ;
  64385. using _Base :: _M_create_nodes ;
  64386. using _Base :: _M_destroy_nodes ;
  64387. using _Base :: _M_allocate_node ;
  64388. using _Base :: _M_deallocate_node ;
  64389. using _Base :: _M_allocate_map ;
  64390. using _Base :: _M_deallocate_map ;
  64391. using _Base :: _M_get_Tp_allocator ;
  64392.  
  64393.  
  64394.  
  64395.  
  64396.  
  64397. using _Base :: _M_impl ;
  64398.  
  64399. public :
  64400.  
  64401.  
  64402.  
  64403.  
  64404.  
  64405. deque ( )
  64406. : _Base ( ) { }
  64407.  
  64408.  
  64409.  
  64410.  
  64411.  
  64412. explicit
  64413. deque ( const allocator_type & __a )
  64414. : _Base ( __a , 0 ) { }
  64415. #801
  64416. explicit
  64417. deque ( size_type __n )
  64418. : _Base ( __n )
  64419. { _M_default_initialize ( ) ; }
  64420. #814
  64421. deque ( size_type __n , const value_type & __value ,
  64422. const allocator_type & __a = allocator_type ( ) )
  64423. : _Base ( __a , __n )
  64424. { _M_fill_initialize ( __value ) ; }
  64425. #841
  64426. deque ( const deque & __x )
  64427. : _Base ( __x . _M_get_Tp_allocator ( ) , __x . size ( ) )
  64428. { std :: __uninitialized_copy_a ( __x . begin ( ) , __x . end ( ) ,
  64429. this -> _M_impl . _M_start ,
  64430. _M_get_Tp_allocator ( ) ) ; }
  64431. #855
  64432. deque ( deque && __x )
  64433. : _Base ( std :: move ( __x ) ) { }
  64434. #869
  64435. deque ( initializer_list < value_type > __l ,
  64436. const allocator_type & __a = allocator_type ( ) )
  64437. : _Base ( __a )
  64438. {
  64439. _M_range_initialize ( __l . begin ( ) , __l . end ( ) ,
  64440. random_access_iterator_tag ( ) ) ;
  64441. }
  64442. #894
  64443. template < typename _InputIterator ,
  64444. typename = std :: _RequireInputIter < _InputIterator >>
  64445. deque ( _InputIterator __first , _InputIterator __last ,
  64446. const allocator_type & __a = allocator_type ( ) )
  64447. : _Base ( __a )
  64448. { _M_initialize_dispatch ( __first , __last , __false_type ( ) ) ; }
  64449. #917
  64450. ~ deque ( ) noexcept
  64451. { _M_destroy_data ( begin ( ) , end ( ) , _M_get_Tp_allocator ( ) ) ; }
  64452. #927
  64453. deque &
  64454. operator = ( const deque & __x ) ;
  64455. #938
  64456. deque &
  64457. operator = ( deque && __x )
  64458. {
  64459.  
  64460.  
  64461. this -> clear ( ) ;
  64462. this -> swap ( __x ) ;
  64463. return * this ;
  64464. }
  64465. #959
  64466. deque &
  64467. operator = ( initializer_list < value_type > __l )
  64468. {
  64469. this -> assign ( __l . begin ( ) , __l . end ( ) ) ;
  64470. return * this ;
  64471. }
  64472. #977
  64473. void
  64474. assign ( size_type __n , const value_type & __val )
  64475. { _M_fill_assign ( __n , __val ) ; }
  64476. #994
  64477. template < typename _InputIterator ,
  64478. typename = std :: _RequireInputIter < _InputIterator >>
  64479. void
  64480. assign ( _InputIterator __first , _InputIterator __last )
  64481. { _M_assign_dispatch ( __first , __last , __false_type ( ) ) ; }
  64482. #1021
  64483. void
  64484. assign ( initializer_list < value_type > __l )
  64485. { this -> assign ( __l . begin ( ) , __l . end ( ) ) ; }
  64486.  
  64487.  
  64488.  
  64489. allocator_type
  64490. get_allocator ( ) const noexcept
  64491. { return _Base :: get_allocator ( ) ; }
  64492. #1036
  64493. iterator
  64494. begin ( ) noexcept
  64495. { return this -> _M_impl . _M_start ; }
  64496.  
  64497.  
  64498.  
  64499.  
  64500.  
  64501. const_iterator
  64502. begin ( ) const noexcept
  64503. { return this -> _M_impl . _M_start ; }
  64504. #1053
  64505. iterator
  64506. end ( ) noexcept
  64507. { return this -> _M_impl . _M_finish ; }
  64508. #1062
  64509. const_iterator
  64510. end ( ) const noexcept
  64511. { return this -> _M_impl . _M_finish ; }
  64512. #1071
  64513. reverse_iterator
  64514. rbegin ( ) noexcept
  64515. { return reverse_iterator ( this -> _M_impl . _M_finish ) ; }
  64516. #1080
  64517. const_reverse_iterator
  64518. rbegin ( ) const noexcept
  64519. { return const_reverse_iterator ( this -> _M_impl . _M_finish ) ; }
  64520. #1089
  64521. reverse_iterator
  64522. rend ( ) noexcept
  64523. { return reverse_iterator ( this -> _M_impl . _M_start ) ; }
  64524. #1098
  64525. const_reverse_iterator
  64526. rend ( ) const noexcept
  64527. { return const_reverse_iterator ( this -> _M_impl . _M_start ) ; }
  64528. #1107
  64529. const_iterator
  64530. cbegin ( ) const noexcept
  64531. { return this -> _M_impl . _M_start ; }
  64532. #1116
  64533. const_iterator
  64534. cend ( ) const noexcept
  64535. { return this -> _M_impl . _M_finish ; }
  64536. #1125
  64537. const_reverse_iterator
  64538. crbegin ( ) const noexcept
  64539. { return const_reverse_iterator ( this -> _M_impl . _M_finish ) ; }
  64540. #1134
  64541. const_reverse_iterator
  64542. crend ( ) const noexcept
  64543. { return const_reverse_iterator ( this -> _M_impl . _M_start ) ; }
  64544.  
  64545.  
  64546.  
  64547.  
  64548. size_type
  64549. size ( ) const noexcept
  64550. { return this -> _M_impl . _M_finish - this -> _M_impl . _M_start ; }
  64551.  
  64552.  
  64553. size_type
  64554. max_size ( ) const noexcept
  64555. { return _M_get_Tp_allocator ( ) . max_size ( ) ; }
  64556. #1160
  64557. void
  64558. resize ( size_type __new_size )
  64559. {
  64560. const size_type __len = size ( ) ;
  64561. if ( __new_size > __len )
  64562. _M_default_append ( __new_size - __len ) ;
  64563. else if ( __new_size < __len )
  64564. _M_erase_at_end ( this -> _M_impl . _M_start
  64565. + difference_type ( __new_size ) ) ;
  64566. }
  64567. #1182
  64568. void
  64569. resize ( size_type __new_size , const value_type & __x )
  64570. {
  64571. const size_type __len = size ( ) ;
  64572. if ( __new_size > __len )
  64573. insert ( this -> _M_impl . _M_finish , __new_size - __len , __x ) ;
  64574. else if ( __new_size < __len )
  64575. _M_erase_at_end ( this -> _M_impl . _M_start
  64576. + difference_type ( __new_size ) ) ;
  64577. }
  64578. #1218
  64579. void
  64580. shrink_to_fit ( )
  64581. { _M_shrink_to_fit ( ) ; }
  64582. #1227
  64583. bool
  64584. empty ( ) const noexcept
  64585. { return this -> _M_impl . _M_finish == this -> _M_impl . _M_start ; }
  64586. #1243
  64587. reference
  64588. operator [ ] ( size_type __n )
  64589. { return this -> _M_impl . _M_start [ difference_type ( __n ) ] ; }
  64590. #1258
  64591. const_reference
  64592. operator [ ] ( size_type __n ) const
  64593. { return this -> _M_impl . _M_start [ difference_type ( __n ) ] ; }
  64594.  
  64595. protected :
  64596.  
  64597. void
  64598. _M_range_check ( size_type __n ) const
  64599. {
  64600. if ( __n >= this -> size ( ) )
  64601. __throw_out_of_range ( ( "deque::_M_range_check" ) ) ;
  64602. }
  64603.  
  64604. public :
  64605. #1283
  64606. reference
  64607. at ( size_type __n )
  64608. {
  64609. _M_range_check ( __n ) ;
  64610. return ( * this ) [ __n ] ;
  64611. }
  64612. #1301
  64613. const_reference
  64614. at ( size_type __n ) const
  64615. {
  64616. _M_range_check ( __n ) ;
  64617. return ( * this ) [ __n ] ;
  64618. }
  64619.  
  64620.  
  64621.  
  64622.  
  64623.  
  64624. reference
  64625. front ( )
  64626. { return * begin ( ) ; }
  64627.  
  64628.  
  64629.  
  64630.  
  64631.  
  64632. const_reference
  64633. front ( ) const
  64634. { return * begin ( ) ; }
  64635.  
  64636.  
  64637.  
  64638.  
  64639.  
  64640. reference
  64641. back ( )
  64642. {
  64643. iterator __tmp = end ( ) ;
  64644. -- __tmp ;
  64645. return * __tmp ;
  64646. }
  64647.  
  64648.  
  64649.  
  64650.  
  64651.  
  64652. const_reference
  64653. back ( ) const
  64654. {
  64655. const_iterator __tmp = end ( ) ;
  64656. -- __tmp ;
  64657. return * __tmp ;
  64658. }
  64659. #1358
  64660. void
  64661. push_front ( const value_type & __x )
  64662. {
  64663. if ( this -> _M_impl . _M_start . _M_cur != this -> _M_impl . _M_start . _M_first )
  64664. {
  64665. this -> _M_impl . construct ( this -> _M_impl . _M_start . _M_cur - 1 , __x ) ;
  64666. -- this -> _M_impl . _M_start . _M_cur ;
  64667. }
  64668. else
  64669. _M_push_front_aux ( __x ) ;
  64670. }
  64671.  
  64672.  
  64673. void
  64674. push_front ( value_type && __x )
  64675. { emplace_front ( std :: move ( __x ) ) ; }
  64676.  
  64677. template < typename ... _Args >
  64678. void
  64679. emplace_front ( _Args && ... __args ) ;
  64680. #1389
  64681. void
  64682. push_back ( const value_type & __x )
  64683. {
  64684. if ( this -> _M_impl . _M_finish . _M_cur
  64685. != this -> _M_impl . _M_finish . _M_last - 1 )
  64686. {
  64687. this -> _M_impl . construct ( this -> _M_impl . _M_finish . _M_cur , __x ) ;
  64688. ++ this -> _M_impl . _M_finish . _M_cur ;
  64689. }
  64690. else
  64691. _M_push_back_aux ( __x ) ;
  64692. }
  64693.  
  64694.  
  64695. void
  64696. push_back ( value_type && __x )
  64697. { emplace_back ( std :: move ( __x ) ) ; }
  64698.  
  64699. template < typename ... _Args >
  64700. void
  64701. emplace_back ( _Args && ... __args ) ;
  64702. #1420
  64703. void
  64704. pop_front ( )
  64705. {
  64706. if ( this -> _M_impl . _M_start . _M_cur
  64707. != this -> _M_impl . _M_start . _M_last - 1 )
  64708. {
  64709. this -> _M_impl . destroy ( this -> _M_impl . _M_start . _M_cur ) ;
  64710. ++ this -> _M_impl . _M_start . _M_cur ;
  64711. }
  64712. else
  64713. _M_pop_front_aux ( ) ;
  64714. }
  64715. #1441
  64716. void
  64717. pop_back ( )
  64718. {
  64719. if ( this -> _M_impl . _M_finish . _M_cur
  64720. != this -> _M_impl . _M_finish . _M_first )
  64721. {
  64722. -- this -> _M_impl . _M_finish . _M_cur ;
  64723. this -> _M_impl . destroy ( this -> _M_impl . _M_finish . _M_cur ) ;
  64724. }
  64725. else
  64726. _M_pop_back_aux ( ) ;
  64727. }
  64728. #1464
  64729. template < typename ... _Args >
  64730. iterator
  64731. emplace ( iterator __position , _Args && ... __args ) ;
  64732. #1478
  64733. iterator
  64734. insert ( iterator __position , const value_type & __x ) ;
  64735. #1491
  64736. iterator
  64737. insert ( iterator __position , value_type && __x )
  64738. { return emplace ( __position , std :: move ( __x ) ) ; }
  64739. #1504
  64740. void
  64741. insert ( iterator __p , initializer_list < value_type > __l )
  64742. { this -> insert ( __p , __l . begin ( ) , __l . end ( ) ) ; }
  64743. #1518
  64744. void
  64745. insert ( iterator __position , size_type __n , const value_type & __x )
  64746. { _M_fill_insert ( __position , __n , __x ) ; }
  64747. #1533
  64748. template < typename _InputIterator ,
  64749. typename = std :: _RequireInputIter < _InputIterator >>
  64750. void
  64751. insert ( iterator __position , _InputIterator __first ,
  64752. _InputIterator __last )
  64753. { _M_insert_dispatch ( __position , __first , __last , __false_type ( ) ) ; }
  64754. #1564
  64755. iterator
  64756. erase ( iterator __position ) ;
  64757. #1583
  64758. iterator
  64759. erase ( iterator __first , iterator __last ) ;
  64760. #1595
  64761. void
  64762. swap ( deque & __x )
  64763. {
  64764. std :: swap ( this -> _M_impl . _M_start , __x . _M_impl . _M_start ) ;
  64765. std :: swap ( this -> _M_impl . _M_finish , __x . _M_impl . _M_finish ) ;
  64766. std :: swap ( this -> _M_impl . _M_map , __x . _M_impl . _M_map ) ;
  64767. std :: swap ( this -> _M_impl . _M_map_size , __x . _M_impl . _M_map_size ) ;
  64768.  
  64769.  
  64770.  
  64771. std :: __alloc_swap < _Tp_alloc_type > :: _S_do_it ( _M_get_Tp_allocator ( ) ,
  64772. __x . _M_get_Tp_allocator ( ) ) ;
  64773. }
  64774. #1615
  64775. void
  64776. clear ( ) noexcept
  64777. { _M_erase_at_end ( begin ( ) ) ; }
  64778.  
  64779. protected :
  64780. #1626
  64781. template < typename _Integer >
  64782. void
  64783. _M_initialize_dispatch ( _Integer __n , _Integer __x , __true_type )
  64784. {
  64785. _M_initialize_map ( static_cast < size_type > ( __n ) ) ;
  64786. _M_fill_initialize ( __x ) ;
  64787. }
  64788.  
  64789.  
  64790. template < typename _InputIterator >
  64791. void
  64792. _M_initialize_dispatch ( _InputIterator __first , _InputIterator __last ,
  64793. __false_type )
  64794. {
  64795. typedef typename std :: iterator_traits < _InputIterator > ::
  64796. iterator_category _IterCategory ;
  64797. _M_range_initialize ( __first , __last , _IterCategory ( ) ) ;
  64798. }
  64799. #1657
  64800. template < typename _InputIterator >
  64801. void
  64802. _M_range_initialize ( _InputIterator __first , _InputIterator __last ,
  64803. std :: input_iterator_tag ) ;
  64804.  
  64805.  
  64806. template < typename _ForwardIterator >
  64807. void
  64808. _M_range_initialize ( _ForwardIterator __first , _ForwardIterator __last ,
  64809. std :: forward_iterator_tag ) ;
  64810. #1679
  64811. void
  64812. _M_fill_initialize ( const value_type & __value ) ;
  64813.  
  64814.  
  64815.  
  64816. void
  64817. _M_default_initialize ( ) ;
  64818. #1695
  64819. template < typename _Integer >
  64820. void
  64821. _M_assign_dispatch ( _Integer __n , _Integer __val , __true_type )
  64822. { _M_fill_assign ( __n , __val ) ; }
  64823.  
  64824.  
  64825. template < typename _InputIterator >
  64826. void
  64827. _M_assign_dispatch ( _InputIterator __first , _InputIterator __last ,
  64828. __false_type )
  64829. {
  64830. typedef typename std :: iterator_traits < _InputIterator > ::
  64831. iterator_category _IterCategory ;
  64832. _M_assign_aux ( __first , __last , _IterCategory ( ) ) ;
  64833. }
  64834.  
  64835.  
  64836. template < typename _InputIterator >
  64837. void
  64838. _M_assign_aux ( _InputIterator __first , _InputIterator __last ,
  64839. std :: input_iterator_tag ) ;
  64840.  
  64841.  
  64842. template < typename _ForwardIterator >
  64843. void
  64844. _M_assign_aux ( _ForwardIterator __first , _ForwardIterator __last ,
  64845. std :: forward_iterator_tag )
  64846. {
  64847. const size_type __len = std :: distance ( __first , __last ) ;
  64848. if ( __len > size ( ) )
  64849. {
  64850. _ForwardIterator __mid = __first ;
  64851. std :: advance ( __mid , size ( ) ) ;
  64852. std :: copy ( __first , __mid , begin ( ) ) ;
  64853. insert ( end ( ) , __mid , __last ) ;
  64854. }
  64855. else
  64856. _M_erase_at_end ( std :: copy ( __first , __last , begin ( ) ) ) ;
  64857. }
  64858.  
  64859.  
  64860.  
  64861. void
  64862. _M_fill_assign ( size_type __n , const value_type & __val )
  64863. {
  64864. if ( __n > size ( ) )
  64865. {
  64866. std :: fill ( begin ( ) , end ( ) , __val ) ;
  64867. insert ( end ( ) , __n - size ( ) , __val ) ;
  64868. }
  64869. else
  64870. {
  64871. _M_erase_at_end ( begin ( ) + difference_type ( __n ) ) ;
  64872. std :: fill ( begin ( ) , end ( ) , __val ) ;
  64873. }
  64874. }
  64875. #1759
  64876. template < typename ... _Args >
  64877. void _M_push_back_aux ( _Args && ... __args ) ;
  64878.  
  64879. template < typename ... _Args >
  64880. void _M_push_front_aux ( _Args && ... __args ) ;
  64881.  
  64882.  
  64883. void _M_pop_back_aux ( ) ;
  64884.  
  64885. void _M_pop_front_aux ( ) ;
  64886. #1778
  64887. template < typename _Integer >
  64888. void
  64889. _M_insert_dispatch ( iterator __pos ,
  64890. _Integer __n , _Integer __x , __true_type )
  64891. { _M_fill_insert ( __pos , __n , __x ) ; }
  64892.  
  64893.  
  64894. template < typename _InputIterator >
  64895. void
  64896. _M_insert_dispatch ( iterator __pos ,
  64897. _InputIterator __first , _InputIterator __last ,
  64898. __false_type )
  64899. {
  64900. typedef typename std :: iterator_traits < _InputIterator > ::
  64901. iterator_category _IterCategory ;
  64902. _M_range_insert_aux ( __pos , __first , __last , _IterCategory ( ) ) ;
  64903. }
  64904.  
  64905.  
  64906. template < typename _InputIterator >
  64907. void
  64908. _M_range_insert_aux ( iterator __pos , _InputIterator __first ,
  64909. _InputIterator __last , std :: input_iterator_tag ) ;
  64910.  
  64911.  
  64912. template < typename _ForwardIterator >
  64913. void
  64914. _M_range_insert_aux ( iterator __pos , _ForwardIterator __first ,
  64915. _ForwardIterator __last , std :: forward_iterator_tag ) ;
  64916.  
  64917.  
  64918.  
  64919.  
  64920. void
  64921. _M_fill_insert ( iterator __pos , size_type __n , const value_type & __x ) ;
  64922. #1819
  64923. template < typename ... _Args >
  64924. iterator
  64925. _M_insert_aux ( iterator __pos , _Args && ... __args ) ;
  64926.  
  64927.  
  64928.  
  64929. void
  64930. _M_insert_aux ( iterator __pos , size_type __n , const value_type & __x ) ;
  64931.  
  64932.  
  64933. template < typename _ForwardIterator >
  64934. void
  64935. _M_insert_aux ( iterator __pos ,
  64936. _ForwardIterator __first , _ForwardIterator __last ,
  64937. size_type __n ) ;
  64938.  
  64939.  
  64940.  
  64941.  
  64942. void
  64943. _M_destroy_data_aux ( iterator __first , iterator __last ) ;
  64944.  
  64945.  
  64946.  
  64947. template < typename _Alloc1 >
  64948. void
  64949. _M_destroy_data ( iterator __first , iterator __last , const _Alloc1 & )
  64950. { _M_destroy_data_aux ( __first , __last ) ; }
  64951.  
  64952. void
  64953. _M_destroy_data ( iterator __first , iterator __last ,
  64954. const std :: allocator < _Tp > & )
  64955. {
  64956. if ( ! __oracle_has_trivial_destructor ( value_type ) )
  64957. _M_destroy_data_aux ( __first , __last ) ;
  64958. }
  64959.  
  64960.  
  64961. void
  64962. _M_erase_at_begin ( iterator __pos )
  64963. {
  64964. _M_destroy_data ( begin ( ) , __pos , _M_get_Tp_allocator ( ) ) ;
  64965. _M_destroy_nodes ( this -> _M_impl . _M_start . _M_node , __pos . _M_node ) ;
  64966. this -> _M_impl . _M_start = __pos ;
  64967. }
  64968.  
  64969.  
  64970.  
  64971. void
  64972. _M_erase_at_end ( iterator __pos )
  64973. {
  64974. _M_destroy_data ( __pos , end ( ) , _M_get_Tp_allocator ( ) ) ;
  64975. _M_destroy_nodes ( __pos . _M_node + 1 ,
  64976. this -> _M_impl . _M_finish . _M_node + 1 ) ;
  64977. this -> _M_impl . _M_finish = __pos ;
  64978. }
  64979.  
  64980.  
  64981.  
  64982. void
  64983. _M_default_append ( size_type __n ) ;
  64984.  
  64985. bool
  64986. _M_shrink_to_fit ( ) ;
  64987.  
  64988.  
  64989.  
  64990.  
  64991. iterator
  64992. _M_reserve_elements_at_front ( size_type __n )
  64993. {
  64994. const size_type __vacancies = this -> _M_impl . _M_start . _M_cur
  64995. - this -> _M_impl . _M_start . _M_first ;
  64996. if ( __n > __vacancies )
  64997. _M_new_elements_at_front ( __n - __vacancies ) ;
  64998. return this -> _M_impl . _M_start - difference_type ( __n ) ;
  64999. }
  65000.  
  65001. iterator
  65002. _M_reserve_elements_at_back ( size_type __n )
  65003. {
  65004. const size_type __vacancies = ( this -> _M_impl . _M_finish . _M_last
  65005. - this -> _M_impl . _M_finish . _M_cur ) - 1 ;
  65006. if ( __n > __vacancies )
  65007. _M_new_elements_at_back ( __n - __vacancies ) ;
  65008. return this -> _M_impl . _M_finish + difference_type ( __n ) ;
  65009. }
  65010.  
  65011. void
  65012. _M_new_elements_at_front ( size_type __new_elements ) ;
  65013.  
  65014. void
  65015. _M_new_elements_at_back ( size_type __new_elements ) ;
  65016. #1923
  65017. void
  65018. _M_reserve_map_at_back ( size_type __nodes_to_add = 1 )
  65019. {
  65020. if ( __nodes_to_add + 1 > this -> _M_impl . _M_map_size
  65021. - ( this -> _M_impl . _M_finish . _M_node - this -> _M_impl . _M_map ) )
  65022. _M_reallocate_map ( __nodes_to_add , false ) ;
  65023. }
  65024.  
  65025. void
  65026. _M_reserve_map_at_front ( size_type __nodes_to_add = 1 )
  65027. {
  65028. if ( __nodes_to_add > size_type ( this -> _M_impl . _M_start . _M_node
  65029. - this -> _M_impl . _M_map ) )
  65030. _M_reallocate_map ( __nodes_to_add , true ) ;
  65031. }
  65032.  
  65033. void
  65034. _M_reallocate_map ( size_type __nodes_to_add , bool __add_at_front ) ;
  65035.  
  65036. } ;
  65037. #1955
  65038. template < typename _Tp , typename _Alloc >
  65039. inline bool
  65040. operator == ( const deque < _Tp , _Alloc > & __x ,
  65041. const deque < _Tp , _Alloc > & __y )
  65042. { return __x . size ( ) == __y . size ( )
  65043. && std :: equal ( __x . begin ( ) , __x . end ( ) , __y . begin ( ) ) ; }
  65044. #1973
  65045. template < typename _Tp , typename _Alloc >
  65046. inline bool
  65047. operator < ( const deque < _Tp , _Alloc > & __x ,
  65048. const deque < _Tp , _Alloc > & __y )
  65049. { return std :: lexicographical_compare ( __x . begin ( ) , __x . end ( ) ,
  65050. __y . begin ( ) , __y . end ( ) ) ; }
  65051.  
  65052.  
  65053. template < typename _Tp , typename _Alloc >
  65054. inline bool
  65055. operator != ( const deque < _Tp , _Alloc > & __x ,
  65056. const deque < _Tp , _Alloc > & __y )
  65057. { return ! ( __x == __y ) ; }
  65058.  
  65059.  
  65060. template < typename _Tp , typename _Alloc >
  65061. inline bool
  65062. operator > ( const deque < _Tp , _Alloc > & __x ,
  65063. const deque < _Tp , _Alloc > & __y )
  65064. { return __y < __x ; }
  65065.  
  65066.  
  65067. template < typename _Tp , typename _Alloc >
  65068. inline bool
  65069. operator <= ( const deque < _Tp , _Alloc > & __x ,
  65070. const deque < _Tp , _Alloc > & __y )
  65071. { return ! ( __y < __x ) ; }
  65072.  
  65073.  
  65074. template < typename _Tp , typename _Alloc >
  65075. inline bool
  65076. operator >= ( const deque < _Tp , _Alloc > & __x ,
  65077. const deque < _Tp , _Alloc > & __y )
  65078. { return ! ( __x < __y ) ; }
  65079.  
  65080.  
  65081. template < typename _Tp , typename _Alloc >
  65082. inline void
  65083. swap ( deque < _Tp , _Alloc > & __x , deque < _Tp , _Alloc > & __y )
  65084. { __x . swap ( __y ) ; }
  65085.  
  65086.  
  65087.  
  65088.  
  65089. }
  65090. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/deque.tcc"
  65091. #59
  65092. namespace std
  65093. {
  65094.  
  65095.  
  65096.  
  65097. template < typename _Tp , typename _Alloc >
  65098. void
  65099. deque < _Tp , _Alloc > ::
  65100. _M_default_initialize ( )
  65101. {
  65102. _Map_pointer __cur ;
  65103. try
  65104. {
  65105. for ( __cur = this -> _M_impl . _M_start . _M_node ;
  65106. __cur < this -> _M_impl . _M_finish . _M_node ;
  65107. ++ __cur )
  65108. std :: __uninitialized_default_a ( * __cur , * __cur + _S_buffer_size ( ) ,
  65109. _M_get_Tp_allocator ( ) ) ;
  65110. std :: __uninitialized_default_a ( this -> _M_impl . _M_finish . _M_first ,
  65111. this -> _M_impl . _M_finish . _M_cur ,
  65112. _M_get_Tp_allocator ( ) ) ;
  65113. }
  65114. catch ( ... )
  65115. {
  65116. std :: _Destroy ( this -> _M_impl . _M_start , iterator ( * __cur , __cur ) ,
  65117. _M_get_Tp_allocator ( ) ) ;
  65118. throw ;
  65119. }
  65120. }
  65121.  
  65122.  
  65123. template < typename _Tp , typename _Alloc >
  65124. deque < _Tp , _Alloc > &
  65125. deque < _Tp , _Alloc > ::
  65126. operator = ( const deque & __x )
  65127. {
  65128. const size_type __len = size ( ) ;
  65129. if ( & __x != this )
  65130. {
  65131. if ( __len >= __x . size ( ) )
  65132. _M_erase_at_end ( std :: copy ( __x . begin ( ) , __x . end ( ) ,
  65133. this -> _M_impl . _M_start ) ) ;
  65134. else
  65135. {
  65136. const_iterator __mid = __x . begin ( ) + difference_type ( __len ) ;
  65137. std :: copy ( __x . begin ( ) , __mid , this -> _M_impl . _M_start ) ;
  65138. insert ( this -> _M_impl . _M_finish , __mid , __x . end ( ) ) ;
  65139. }
  65140. }
  65141. return * this ;
  65142. }
  65143.  
  65144.  
  65145. template < typename _Tp , typename _Alloc >
  65146. template < typename ... _Args >
  65147. void
  65148. deque < _Tp , _Alloc > ::
  65149. emplace_front ( _Args && ... __args )
  65150. {
  65151. if ( this -> _M_impl . _M_start . _M_cur != this -> _M_impl . _M_start . _M_first )
  65152. {
  65153. this -> _M_impl . construct ( this -> _M_impl . _M_start . _M_cur - 1 ,
  65154. std :: forward < _Args > ( __args ) ... ) ;
  65155. -- this -> _M_impl . _M_start . _M_cur ;
  65156. }
  65157. else
  65158. _M_push_front_aux ( std :: forward < _Args > ( __args ) ... ) ;
  65159. }
  65160.  
  65161. template < typename _Tp , typename _Alloc >
  65162. template < typename ... _Args >
  65163. void
  65164. deque < _Tp , _Alloc > ::
  65165. emplace_back ( _Args && ... __args )
  65166. {
  65167. if ( this -> _M_impl . _M_finish . _M_cur
  65168. != this -> _M_impl . _M_finish . _M_last - 1 )
  65169. {
  65170. this -> _M_impl . construct ( this -> _M_impl . _M_finish . _M_cur ,
  65171. std :: forward < _Args > ( __args ) ... ) ;
  65172. ++ this -> _M_impl . _M_finish . _M_cur ;
  65173. }
  65174. else
  65175. _M_push_back_aux ( std :: forward < _Args > ( __args ) ... ) ;
  65176. }
  65177.  
  65178.  
  65179. template < typename _Tp , typename _Alloc >
  65180. typename deque < _Tp , _Alloc > :: iterator
  65181. deque < _Tp , _Alloc > ::
  65182. insert ( iterator __position , const value_type & __x )
  65183. {
  65184. if ( __position . _M_cur == this -> _M_impl . _M_start . _M_cur )
  65185. {
  65186. push_front ( __x ) ;
  65187. return this -> _M_impl . _M_start ;
  65188. }
  65189. else if ( __position . _M_cur == this -> _M_impl . _M_finish . _M_cur )
  65190. {
  65191. push_back ( __x ) ;
  65192. iterator __tmp = this -> _M_impl . _M_finish ;
  65193. -- __tmp ;
  65194. return __tmp ;
  65195. }
  65196. else
  65197. return _M_insert_aux ( __position , __x ) ;
  65198. }
  65199.  
  65200.  
  65201. template < typename _Tp , typename _Alloc >
  65202. template < typename ... _Args >
  65203. typename deque < _Tp , _Alloc > :: iterator
  65204. deque < _Tp , _Alloc > ::
  65205. emplace ( iterator __position , _Args && ... __args )
  65206. {
  65207. if ( __position . _M_cur == this -> _M_impl . _M_start . _M_cur )
  65208. {
  65209. emplace_front ( std :: forward < _Args > ( __args ) ... ) ;
  65210. return this -> _M_impl . _M_start ;
  65211. }
  65212. else if ( __position . _M_cur == this -> _M_impl . _M_finish . _M_cur )
  65213. {
  65214. emplace_back ( std :: forward < _Args > ( __args ) ... ) ;
  65215. iterator __tmp = this -> _M_impl . _M_finish ;
  65216. -- __tmp ;
  65217. return __tmp ;
  65218. }
  65219. else
  65220. return _M_insert_aux ( __position , std :: forward < _Args > ( __args ) ... ) ;
  65221. }
  65222.  
  65223.  
  65224. template < typename _Tp , typename _Alloc >
  65225. typename deque < _Tp , _Alloc > :: iterator
  65226. deque < _Tp , _Alloc > ::
  65227. erase ( iterator __position )
  65228. {
  65229. iterator __next = __position ;
  65230. ++ __next ;
  65231. const difference_type __index = __position - begin ( ) ;
  65232. if ( static_cast < size_type > ( __index ) < ( size ( ) >> 1 ) )
  65233. {
  65234. if ( __position != begin ( ) )
  65235. std :: move_backward ( begin ( ) , __position , __next ) ;
  65236. pop_front ( ) ;
  65237. }
  65238. else
  65239. {
  65240. if ( __next != end ( ) )
  65241. std :: move ( __next , end ( ) , __position ) ;
  65242. pop_back ( ) ;
  65243. }
  65244. return begin ( ) + __index ;
  65245. }
  65246.  
  65247. template < typename _Tp , typename _Alloc >
  65248. typename deque < _Tp , _Alloc > :: iterator
  65249. deque < _Tp , _Alloc > ::
  65250. erase ( iterator __first , iterator __last )
  65251. {
  65252. if ( __first == __last )
  65253. return __first ;
  65254. else if ( __first == begin ( ) && __last == end ( ) )
  65255. {
  65256. clear ( ) ;
  65257. return end ( ) ;
  65258. }
  65259. else
  65260. {
  65261. const difference_type __n = __last - __first ;
  65262. const difference_type __elems_before = __first - begin ( ) ;
  65263. if ( static_cast < size_type > ( __elems_before ) <= ( size ( ) - __n ) / 2 )
  65264. {
  65265. if ( __first != begin ( ) )
  65266. std :: move_backward ( begin ( ) , __first , __last ) ;
  65267. _M_erase_at_begin ( begin ( ) + __n ) ;
  65268. }
  65269. else
  65270. {
  65271. if ( __last != end ( ) )
  65272. std :: move ( __last , end ( ) , __first ) ;
  65273. _M_erase_at_end ( end ( ) - __n ) ;
  65274. }
  65275. return begin ( ) + __elems_before ;
  65276. }
  65277. }
  65278.  
  65279. template < typename _Tp , class _Alloc >
  65280. template < typename _InputIterator >
  65281. void
  65282. deque < _Tp , _Alloc > ::
  65283. _M_assign_aux ( _InputIterator __first , _InputIterator __last ,
  65284. std :: input_iterator_tag )
  65285. {
  65286. iterator __cur = begin ( ) ;
  65287. for ( ; __first != __last && __cur != end ( ) ; ++ __cur , ++ __first )
  65288. * __cur = * __first ;
  65289. if ( __first == __last )
  65290. _M_erase_at_end ( __cur ) ;
  65291. else
  65292. insert ( end ( ) , __first , __last ) ;
  65293. }
  65294.  
  65295. template < typename _Tp , typename _Alloc >
  65296. void
  65297. deque < _Tp , _Alloc > ::
  65298. _M_fill_insert ( iterator __pos , size_type __n , const value_type & __x )
  65299. {
  65300. if ( __pos . _M_cur == this -> _M_impl . _M_start . _M_cur )
  65301. {
  65302. iterator __new_start = _M_reserve_elements_at_front ( __n ) ;
  65303. try
  65304. {
  65305. std :: __uninitialized_fill_a ( __new_start , this -> _M_impl . _M_start ,
  65306. __x , _M_get_Tp_allocator ( ) ) ;
  65307. this -> _M_impl . _M_start = __new_start ;
  65308. }
  65309. catch ( ... )
  65310. {
  65311. _M_destroy_nodes ( __new_start . _M_node ,
  65312. this -> _M_impl . _M_start . _M_node ) ;
  65313. throw ;
  65314. }
  65315. }
  65316. else if ( __pos . _M_cur == this -> _M_impl . _M_finish . _M_cur )
  65317. {
  65318. iterator __new_finish = _M_reserve_elements_at_back ( __n ) ;
  65319. try
  65320. {
  65321. std :: __uninitialized_fill_a ( this -> _M_impl . _M_finish ,
  65322. __new_finish , __x ,
  65323. _M_get_Tp_allocator ( ) ) ;
  65324. this -> _M_impl . _M_finish = __new_finish ;
  65325. }
  65326. catch ( ... )
  65327. {
  65328. _M_destroy_nodes ( this -> _M_impl . _M_finish . _M_node + 1 ,
  65329. __new_finish . _M_node + 1 ) ;
  65330. throw ;
  65331. }
  65332. }
  65333. else
  65334. _M_insert_aux ( __pos , __n , __x ) ;
  65335. }
  65336.  
  65337.  
  65338. template < typename _Tp , typename _Alloc >
  65339. void
  65340. deque < _Tp , _Alloc > ::
  65341. _M_default_append ( size_type __n )
  65342. {
  65343. if ( __n )
  65344. {
  65345. iterator __new_finish = _M_reserve_elements_at_back ( __n ) ;
  65346. try
  65347. {
  65348. std :: __uninitialized_default_a ( this -> _M_impl . _M_finish ,
  65349. __new_finish ,
  65350. _M_get_Tp_allocator ( ) ) ;
  65351. this -> _M_impl . _M_finish = __new_finish ;
  65352. }
  65353. catch ( ... )
  65354. {
  65355. _M_destroy_nodes ( this -> _M_impl . _M_finish . _M_node + 1 ,
  65356. __new_finish . _M_node + 1 ) ;
  65357. throw ;
  65358. }
  65359. }
  65360. }
  65361.  
  65362. template < typename _Tp , typename _Alloc >
  65363. bool
  65364. deque < _Tp , _Alloc > ::
  65365. _M_shrink_to_fit ( )
  65366. {
  65367. const difference_type __front_capacity
  65368. = ( this -> _M_impl . _M_start . _M_cur - this -> _M_impl . _M_start . _M_first ) ;
  65369. if ( __front_capacity == 0 )
  65370. return false ;
  65371.  
  65372. const difference_type __back_capacity
  65373. = ( this -> _M_impl . _M_finish . _M_last - this -> _M_impl . _M_finish . _M_cur ) ;
  65374. if ( __front_capacity + __back_capacity < _S_buffer_size ( ) )
  65375. return false ;
  65376.  
  65377. return std :: __shrink_to_fit_aux < deque > :: _S_do_it ( * this ) ;
  65378. }
  65379.  
  65380.  
  65381. template < typename _Tp , typename _Alloc >
  65382. void
  65383. deque < _Tp , _Alloc > ::
  65384. _M_fill_initialize ( const value_type & __value )
  65385. {
  65386. _Map_pointer __cur ;
  65387. try
  65388. {
  65389. for ( __cur = this -> _M_impl . _M_start . _M_node ;
  65390. __cur < this -> _M_impl . _M_finish . _M_node ;
  65391. ++ __cur )
  65392. std :: __uninitialized_fill_a ( * __cur , * __cur + _S_buffer_size ( ) ,
  65393. __value , _M_get_Tp_allocator ( ) ) ;
  65394. std :: __uninitialized_fill_a ( this -> _M_impl . _M_finish . _M_first ,
  65395. this -> _M_impl . _M_finish . _M_cur ,
  65396. __value , _M_get_Tp_allocator ( ) ) ;
  65397. }
  65398. catch ( ... )
  65399. {
  65400. std :: _Destroy ( this -> _M_impl . _M_start , iterator ( * __cur , __cur ) ,
  65401. _M_get_Tp_allocator ( ) ) ;
  65402. throw ;
  65403. }
  65404. }
  65405.  
  65406. template < typename _Tp , typename _Alloc >
  65407. template < typename _InputIterator >
  65408. void
  65409. deque < _Tp , _Alloc > ::
  65410. _M_range_initialize ( _InputIterator __first , _InputIterator __last ,
  65411. std :: input_iterator_tag )
  65412. {
  65413. this -> _M_initialize_map ( 0 ) ;
  65414. try
  65415. {
  65416. for ( ; __first != __last ; ++ __first )
  65417.  
  65418. emplace_back ( * __first ) ;
  65419.  
  65420.  
  65421.  
  65422. }
  65423. catch ( ... )
  65424. {
  65425. clear ( ) ;
  65426. throw ;
  65427. }
  65428. }
  65429.  
  65430. template < typename _Tp , typename _Alloc >
  65431. template < typename _ForwardIterator >
  65432. void
  65433. deque < _Tp , _Alloc > ::
  65434. _M_range_initialize ( _ForwardIterator __first , _ForwardIterator __last ,
  65435. std :: forward_iterator_tag )
  65436. {
  65437. const size_type __n = std :: distance ( __first , __last ) ;
  65438. this -> _M_initialize_map ( __n ) ;
  65439.  
  65440. _Map_pointer __cur_node ;
  65441. try
  65442. {
  65443. for ( __cur_node = this -> _M_impl . _M_start . _M_node ;
  65444. __cur_node < this -> _M_impl . _M_finish . _M_node ;
  65445. ++ __cur_node )
  65446. {
  65447. _ForwardIterator __mid = __first ;
  65448. std :: advance ( __mid , _S_buffer_size ( ) ) ;
  65449. std :: __uninitialized_copy_a ( __first , __mid , * __cur_node ,
  65450. _M_get_Tp_allocator ( ) ) ;
  65451. __first = __mid ;
  65452. }
  65453. std :: __uninitialized_copy_a ( __first , __last ,
  65454. this -> _M_impl . _M_finish . _M_first ,
  65455. _M_get_Tp_allocator ( ) ) ;
  65456. }
  65457. catch ( ... )
  65458. {
  65459. std :: _Destroy ( this -> _M_impl . _M_start ,
  65460. iterator ( * __cur_node , __cur_node ) ,
  65461. _M_get_Tp_allocator ( ) ) ;
  65462. throw ;
  65463. }
  65464. }
  65465.  
  65466.  
  65467. template < typename _Tp , typename _Alloc >
  65468.  
  65469. template < typename ... _Args >
  65470. void
  65471. deque < _Tp , _Alloc > ::
  65472. _M_push_back_aux ( _Args && ... __args )
  65473.  
  65474.  
  65475.  
  65476.  
  65477.  
  65478. {
  65479. _M_reserve_map_at_back ( ) ;
  65480. * ( this -> _M_impl . _M_finish . _M_node + 1 ) = this -> _M_allocate_node ( ) ;
  65481. try
  65482. {
  65483.  
  65484. this -> _M_impl . construct ( this -> _M_impl . _M_finish . _M_cur ,
  65485. std :: forward < _Args > ( __args ) ... ) ;
  65486.  
  65487.  
  65488.  
  65489. this -> _M_impl . _M_finish . _M_set_node ( this -> _M_impl . _M_finish . _M_node
  65490. + 1 ) ;
  65491. this -> _M_impl . _M_finish . _M_cur = this -> _M_impl . _M_finish . _M_first ;
  65492. }
  65493. catch ( ... )
  65494. {
  65495. _M_deallocate_node ( * ( this -> _M_impl . _M_finish . _M_node + 1 ) ) ;
  65496. throw ;
  65497. }
  65498. }
  65499.  
  65500.  
  65501. template < typename _Tp , typename _Alloc >
  65502.  
  65503. template < typename ... _Args >
  65504. void
  65505. deque < _Tp , _Alloc > ::
  65506. _M_push_front_aux ( _Args && ... __args )
  65507.  
  65508.  
  65509.  
  65510.  
  65511.  
  65512. {
  65513. _M_reserve_map_at_front ( ) ;
  65514. * ( this -> _M_impl . _M_start . _M_node - 1 ) = this -> _M_allocate_node ( ) ;
  65515. try
  65516. {
  65517. this -> _M_impl . _M_start . _M_set_node ( this -> _M_impl . _M_start . _M_node
  65518. - 1 ) ;
  65519. this -> _M_impl . _M_start . _M_cur = this -> _M_impl . _M_start . _M_last - 1 ;
  65520.  
  65521. this -> _M_impl . construct ( this -> _M_impl . _M_start . _M_cur ,
  65522. std :: forward < _Args > ( __args ) ... ) ;
  65523.  
  65524.  
  65525.  
  65526. }
  65527. catch ( ... )
  65528. {
  65529. ++ this -> _M_impl . _M_start ;
  65530. _M_deallocate_node ( * ( this -> _M_impl . _M_start . _M_node - 1 ) ) ;
  65531. throw ;
  65532. }
  65533. }
  65534.  
  65535.  
  65536. template < typename _Tp , typename _Alloc >
  65537. void deque < _Tp , _Alloc > ::
  65538. _M_pop_back_aux ( )
  65539. {
  65540. _M_deallocate_node ( this -> _M_impl . _M_finish . _M_first ) ;
  65541. this -> _M_impl . _M_finish . _M_set_node ( this -> _M_impl . _M_finish . _M_node - 1 ) ;
  65542. this -> _M_impl . _M_finish . _M_cur = this -> _M_impl . _M_finish . _M_last - 1 ;
  65543. this -> _M_impl . destroy ( this -> _M_impl . _M_finish . _M_cur ) ;
  65544. }
  65545. #518
  65546. template < typename _Tp , typename _Alloc >
  65547. void deque < _Tp , _Alloc > ::
  65548. _M_pop_front_aux ( )
  65549. {
  65550. this -> _M_impl . destroy ( this -> _M_impl . _M_start . _M_cur ) ;
  65551. _M_deallocate_node ( this -> _M_impl . _M_start . _M_first ) ;
  65552. this -> _M_impl . _M_start . _M_set_node ( this -> _M_impl . _M_start . _M_node + 1 ) ;
  65553. this -> _M_impl . _M_start . _M_cur = this -> _M_impl . _M_start . _M_first ;
  65554. }
  65555.  
  65556. template < typename _Tp , typename _Alloc >
  65557. template < typename _InputIterator >
  65558. void
  65559. deque < _Tp , _Alloc > ::
  65560. _M_range_insert_aux ( iterator __pos ,
  65561. _InputIterator __first , _InputIterator __last ,
  65562. std :: input_iterator_tag )
  65563. { std :: copy ( __first , __last , std :: inserter ( * this , __pos ) ) ; }
  65564.  
  65565. template < typename _Tp , typename _Alloc >
  65566. template < typename _ForwardIterator >
  65567. void
  65568. deque < _Tp , _Alloc > ::
  65569. _M_range_insert_aux ( iterator __pos ,
  65570. _ForwardIterator __first , _ForwardIterator __last ,
  65571. std :: forward_iterator_tag )
  65572. {
  65573. const size_type __n = std :: distance ( __first , __last ) ;
  65574. if ( __pos . _M_cur == this -> _M_impl . _M_start . _M_cur )
  65575. {
  65576. iterator __new_start = _M_reserve_elements_at_front ( __n ) ;
  65577. try
  65578. {
  65579. std :: __uninitialized_copy_a ( __first , __last , __new_start ,
  65580. _M_get_Tp_allocator ( ) ) ;
  65581. this -> _M_impl . _M_start = __new_start ;
  65582. }
  65583. catch ( ... )
  65584. {
  65585. _M_destroy_nodes ( __new_start . _M_node ,
  65586. this -> _M_impl . _M_start . _M_node ) ;
  65587. throw ;
  65588. }
  65589. }
  65590. else if ( __pos . _M_cur == this -> _M_impl . _M_finish . _M_cur )
  65591. {
  65592. iterator __new_finish = _M_reserve_elements_at_back ( __n ) ;
  65593. try
  65594. {
  65595. std :: __uninitialized_copy_a ( __first , __last ,
  65596. this -> _M_impl . _M_finish ,
  65597. _M_get_Tp_allocator ( ) ) ;
  65598. this -> _M_impl . _M_finish = __new_finish ;
  65599. }
  65600. catch ( ... )
  65601. {
  65602. _M_destroy_nodes ( this -> _M_impl . _M_finish . _M_node + 1 ,
  65603. __new_finish . _M_node + 1 ) ;
  65604. throw ;
  65605. }
  65606. }
  65607. else
  65608. _M_insert_aux ( __pos , __first , __last , __n ) ;
  65609. }
  65610.  
  65611. template < typename _Tp , typename _Alloc >
  65612.  
  65613. template < typename ... _Args >
  65614. typename deque < _Tp , _Alloc > :: iterator
  65615. deque < _Tp , _Alloc > ::
  65616. _M_insert_aux ( iterator __pos , _Args && ... __args )
  65617. {
  65618. value_type __x_copy ( std :: forward < _Args > ( __args ) ... ) ;
  65619. #598
  65620. difference_type __index = __pos - this -> _M_impl . _M_start ;
  65621. if ( static_cast < size_type > ( __index ) < size ( ) / 2 )
  65622. {
  65623. push_front ( std :: move ( front ( ) ) ) ;
  65624. iterator __front1 = this -> _M_impl . _M_start ;
  65625. ++ __front1 ;
  65626. iterator __front2 = __front1 ;
  65627. ++ __front2 ;
  65628. __pos = this -> _M_impl . _M_start + __index ;
  65629. iterator __pos1 = __pos ;
  65630. ++ __pos1 ;
  65631. std :: move ( __front2 , __pos1 , __front1 ) ;
  65632. }
  65633. else
  65634. {
  65635. push_back ( std :: move ( back ( ) ) ) ;
  65636. iterator __back1 = this -> _M_impl . _M_finish ;
  65637. -- __back1 ;
  65638. iterator __back2 = __back1 ;
  65639. -- __back2 ;
  65640. __pos = this -> _M_impl . _M_start + __index ;
  65641. std :: move_backward ( __pos , __back2 , __back1 ) ;
  65642. }
  65643. * __pos = std :: move ( __x_copy ) ;
  65644. return __pos ;
  65645. }
  65646.  
  65647. template < typename _Tp , typename _Alloc >
  65648. void
  65649. deque < _Tp , _Alloc > ::
  65650. _M_insert_aux ( iterator __pos , size_type __n , const value_type & __x )
  65651. {
  65652. const difference_type __elems_before = __pos - this -> _M_impl . _M_start ;
  65653. const size_type __length = this -> size ( ) ;
  65654. value_type __x_copy = __x ;
  65655. if ( __elems_before < difference_type ( __length / 2 ) )
  65656. {
  65657. iterator __new_start = _M_reserve_elements_at_front ( __n ) ;
  65658. iterator __old_start = this -> _M_impl . _M_start ;
  65659. __pos = this -> _M_impl . _M_start + __elems_before ;
  65660. try
  65661. {
  65662. if ( __elems_before >= difference_type ( __n ) )
  65663. {
  65664. iterator __start_n = ( this -> _M_impl . _M_start
  65665. + difference_type ( __n ) ) ;
  65666. std :: __uninitialized_move_a ( this -> _M_impl . _M_start ,
  65667. __start_n , __new_start ,
  65668. _M_get_Tp_allocator ( ) ) ;
  65669. this -> _M_impl . _M_start = __new_start ;
  65670. std :: move ( __start_n , __pos , __old_start ) ;
  65671. std :: fill ( __pos - difference_type ( __n ) , __pos , __x_copy ) ;
  65672. }
  65673. else
  65674. {
  65675. std :: __uninitialized_move_fill ( this -> _M_impl . _M_start ,
  65676. __pos , __new_start ,
  65677. this -> _M_impl . _M_start ,
  65678. __x_copy ,
  65679. _M_get_Tp_allocator ( ) ) ;
  65680. this -> _M_impl . _M_start = __new_start ;
  65681. std :: fill ( __old_start , __pos , __x_copy ) ;
  65682. }
  65683. }
  65684. catch ( ... )
  65685. {
  65686. _M_destroy_nodes ( __new_start . _M_node ,
  65687. this -> _M_impl . _M_start . _M_node ) ;
  65688. throw ;
  65689. }
  65690. }
  65691. else
  65692. {
  65693. iterator __new_finish = _M_reserve_elements_at_back ( __n ) ;
  65694. iterator __old_finish = this -> _M_impl . _M_finish ;
  65695. const difference_type __elems_after =
  65696. difference_type ( __length ) - __elems_before ;
  65697. __pos = this -> _M_impl . _M_finish - __elems_after ;
  65698. try
  65699. {
  65700. if ( __elems_after > difference_type ( __n ) )
  65701. {
  65702. iterator __finish_n = ( this -> _M_impl . _M_finish
  65703. - difference_type ( __n ) ) ;
  65704. std :: __uninitialized_move_a ( __finish_n ,
  65705. this -> _M_impl . _M_finish ,
  65706. this -> _M_impl . _M_finish ,
  65707. _M_get_Tp_allocator ( ) ) ;
  65708. this -> _M_impl . _M_finish = __new_finish ;
  65709. std :: move_backward ( __pos , __finish_n , __old_finish ) ;
  65710. std :: fill ( __pos , __pos + difference_type ( __n ) , __x_copy ) ;
  65711. }
  65712. else
  65713. {
  65714. std :: __uninitialized_fill_move ( this -> _M_impl . _M_finish ,
  65715. __pos + difference_type ( __n ) ,
  65716. __x_copy , __pos ,
  65717. this -> _M_impl . _M_finish ,
  65718. _M_get_Tp_allocator ( ) ) ;
  65719. this -> _M_impl . _M_finish = __new_finish ;
  65720. std :: fill ( __pos , __old_finish , __x_copy ) ;
  65721. }
  65722. }
  65723. catch ( ... )
  65724. {
  65725. _M_destroy_nodes ( this -> _M_impl . _M_finish . _M_node + 1 ,
  65726. __new_finish . _M_node + 1 ) ;
  65727. throw ;
  65728. }
  65729. }
  65730. }
  65731.  
  65732. template < typename _Tp , typename _Alloc >
  65733. template < typename _ForwardIterator >
  65734. void
  65735. deque < _Tp , _Alloc > ::
  65736. _M_insert_aux ( iterator __pos ,
  65737. _ForwardIterator __first , _ForwardIterator __last ,
  65738. size_type __n )
  65739. {
  65740. const difference_type __elemsbefore = __pos - this -> _M_impl . _M_start ;
  65741. const size_type __length = size ( ) ;
  65742. if ( static_cast < size_type > ( __elemsbefore ) < __length / 2 )
  65743. {
  65744. iterator __new_start = _M_reserve_elements_at_front ( __n ) ;
  65745. iterator __old_start = this -> _M_impl . _M_start ;
  65746. __pos = this -> _M_impl . _M_start + __elemsbefore ;
  65747. try
  65748. {
  65749. if ( __elemsbefore >= difference_type ( __n ) )
  65750. {
  65751. iterator __start_n = ( this -> _M_impl . _M_start
  65752. + difference_type ( __n ) ) ;
  65753. std :: __uninitialized_move_a ( this -> _M_impl . _M_start ,
  65754. __start_n , __new_start ,
  65755. _M_get_Tp_allocator ( ) ) ;
  65756. this -> _M_impl . _M_start = __new_start ;
  65757. std :: move ( __start_n , __pos , __old_start ) ;
  65758. std :: copy ( __first , __last , __pos - difference_type ( __n ) ) ;
  65759. }
  65760. else
  65761. {
  65762. _ForwardIterator __mid = __first ;
  65763. std :: advance ( __mid , difference_type ( __n ) - __elemsbefore ) ;
  65764. std :: __uninitialized_move_copy ( this -> _M_impl . _M_start ,
  65765. __pos , __first , __mid ,
  65766. __new_start ,
  65767. _M_get_Tp_allocator ( ) ) ;
  65768. this -> _M_impl . _M_start = __new_start ;
  65769. std :: copy ( __mid , __last , __old_start ) ;
  65770. }
  65771. }
  65772. catch ( ... )
  65773. {
  65774. _M_destroy_nodes ( __new_start . _M_node ,
  65775. this -> _M_impl . _M_start . _M_node ) ;
  65776. throw ;
  65777. }
  65778. }
  65779. else
  65780. {
  65781. iterator __new_finish = _M_reserve_elements_at_back ( __n ) ;
  65782. iterator __old_finish = this -> _M_impl . _M_finish ;
  65783. const difference_type __elemsafter =
  65784. difference_type ( __length ) - __elemsbefore ;
  65785. __pos = this -> _M_impl . _M_finish - __elemsafter ;
  65786. try
  65787. {
  65788. if ( __elemsafter > difference_type ( __n ) )
  65789. {
  65790. iterator __finish_n = ( this -> _M_impl . _M_finish
  65791. - difference_type ( __n ) ) ;
  65792. std :: __uninitialized_move_a ( __finish_n ,
  65793. this -> _M_impl . _M_finish ,
  65794. this -> _M_impl . _M_finish ,
  65795. _M_get_Tp_allocator ( ) ) ;
  65796. this -> _M_impl . _M_finish = __new_finish ;
  65797. std :: move_backward ( __pos , __finish_n , __old_finish ) ;
  65798. std :: copy ( __first , __last , __pos ) ;
  65799. }
  65800. else
  65801. {
  65802. _ForwardIterator __mid = __first ;
  65803. std :: advance ( __mid , __elemsafter ) ;
  65804. std :: __uninitialized_copy_move ( __mid , __last , __pos ,
  65805. this -> _M_impl . _M_finish ,
  65806. this -> _M_impl . _M_finish ,
  65807. _M_get_Tp_allocator ( ) ) ;
  65808. this -> _M_impl . _M_finish = __new_finish ;
  65809. std :: copy ( __first , __mid , __pos ) ;
  65810. }
  65811. }
  65812. catch ( ... )
  65813. {
  65814. _M_destroy_nodes ( this -> _M_impl . _M_finish . _M_node + 1 ,
  65815. __new_finish . _M_node + 1 ) ;
  65816. throw ;
  65817. }
  65818. }
  65819. }
  65820.  
  65821. template < typename _Tp , typename _Alloc >
  65822. void
  65823. deque < _Tp , _Alloc > ::
  65824. _M_destroy_data_aux ( iterator __first , iterator __last )
  65825. {
  65826. for ( _Map_pointer __node = __first . _M_node + 1 ;
  65827. __node < __last . _M_node ; ++ __node )
  65828. std :: _Destroy ( * __node , * __node + _S_buffer_size ( ) ,
  65829. _M_get_Tp_allocator ( ) ) ;
  65830.  
  65831. if ( __first . _M_node != __last . _M_node )
  65832. {
  65833. std :: _Destroy ( __first . _M_cur , __first . _M_last ,
  65834. _M_get_Tp_allocator ( ) ) ;
  65835. std :: _Destroy ( __last . _M_first , __last . _M_cur ,
  65836. _M_get_Tp_allocator ( ) ) ;
  65837. }
  65838. else
  65839. std :: _Destroy ( __first . _M_cur , __last . _M_cur ,
  65840. _M_get_Tp_allocator ( ) ) ;
  65841. }
  65842.  
  65843. template < typename _Tp , typename _Alloc >
  65844. void
  65845. deque < _Tp , _Alloc > ::
  65846. _M_new_elements_at_front ( size_type __new_elems )
  65847. {
  65848. if ( this -> max_size ( ) - this -> size ( ) < __new_elems )
  65849. __throw_length_error ( ( "deque::_M_new_elements_at_front" ) ) ;
  65850.  
  65851. const size_type __new_nodes = ( ( __new_elems + _S_buffer_size ( ) - 1 )
  65852. / _S_buffer_size ( ) ) ;
  65853. _M_reserve_map_at_front ( __new_nodes ) ;
  65854. size_type __i ;
  65855. try
  65856. {
  65857. for ( __i = 1 ; __i <= __new_nodes ; ++ __i )
  65858. * ( this -> _M_impl . _M_start . _M_node - __i ) = this -> _M_allocate_node ( ) ;
  65859. }
  65860. catch ( ... )
  65861. {
  65862. for ( size_type __j = 1 ; __j < __i ; ++ __j )
  65863. _M_deallocate_node ( * ( this -> _M_impl . _M_start . _M_node - __j ) ) ;
  65864. throw ;
  65865. }
  65866. }
  65867.  
  65868. template < typename _Tp , typename _Alloc >
  65869. void
  65870. deque < _Tp , _Alloc > ::
  65871. _M_new_elements_at_back ( size_type __new_elems )
  65872. {
  65873. if ( this -> max_size ( ) - this -> size ( ) < __new_elems )
  65874. __throw_length_error ( ( "deque::_M_new_elements_at_back" ) ) ;
  65875.  
  65876. const size_type __new_nodes = ( ( __new_elems + _S_buffer_size ( ) - 1 )
  65877. / _S_buffer_size ( ) ) ;
  65878. _M_reserve_map_at_back ( __new_nodes ) ;
  65879. size_type __i ;
  65880. try
  65881. {
  65882. for ( __i = 1 ; __i <= __new_nodes ; ++ __i )
  65883. * ( this -> _M_impl . _M_finish . _M_node + __i ) = this -> _M_allocate_node ( ) ;
  65884. }
  65885. catch ( ... )
  65886. {
  65887. for ( size_type __j = 1 ; __j < __i ; ++ __j )
  65888. _M_deallocate_node ( * ( this -> _M_impl . _M_finish . _M_node + __j ) ) ;
  65889. throw ;
  65890. }
  65891. }
  65892.  
  65893. template < typename _Tp , typename _Alloc >
  65894. void
  65895. deque < _Tp , _Alloc > ::
  65896. _M_reallocate_map ( size_type __nodes_to_add , bool __add_at_front )
  65897. {
  65898. const size_type __old_num_nodes
  65899. = this -> _M_impl . _M_finish . _M_node - this -> _M_impl . _M_start . _M_node + 1 ;
  65900. const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add ;
  65901.  
  65902. _Map_pointer __new_nstart ;
  65903. if ( this -> _M_impl . _M_map_size > 2 * __new_num_nodes )
  65904. {
  65905. __new_nstart = this -> _M_impl . _M_map + ( this -> _M_impl . _M_map_size
  65906. - __new_num_nodes ) / 2
  65907. + ( __add_at_front ? __nodes_to_add : 0 ) ;
  65908. if ( __new_nstart < this -> _M_impl . _M_start . _M_node )
  65909. std :: copy ( this -> _M_impl . _M_start . _M_node ,
  65910. this -> _M_impl . _M_finish . _M_node + 1 ,
  65911. __new_nstart ) ;
  65912. else
  65913. std :: copy_backward ( this -> _M_impl . _M_start . _M_node ,
  65914. this -> _M_impl . _M_finish . _M_node + 1 ,
  65915. __new_nstart + __old_num_nodes ) ;
  65916. }
  65917. else
  65918. {
  65919. size_type __new_map_size = this -> _M_impl . _M_map_size
  65920. + std :: max ( this -> _M_impl . _M_map_size ,
  65921. __nodes_to_add ) + 2 ;
  65922.  
  65923. _Map_pointer __new_map = this -> _M_allocate_map ( __new_map_size ) ;
  65924. __new_nstart = __new_map + ( __new_map_size - __new_num_nodes ) / 2
  65925. + ( __add_at_front ? __nodes_to_add : 0 ) ;
  65926. std :: copy ( this -> _M_impl . _M_start . _M_node ,
  65927. this -> _M_impl . _M_finish . _M_node + 1 ,
  65928. __new_nstart ) ;
  65929. _M_deallocate_map ( this -> _M_impl . _M_map , this -> _M_impl . _M_map_size ) ;
  65930.  
  65931. this -> _M_impl . _M_map = __new_map ;
  65932. this -> _M_impl . _M_map_size = __new_map_size ;
  65933. }
  65934.  
  65935. this -> _M_impl . _M_start . _M_set_node ( __new_nstart ) ;
  65936. this -> _M_impl . _M_finish . _M_set_node ( __new_nstart + __old_num_nodes - 1 ) ;
  65937. }
  65938.  
  65939.  
  65940.  
  65941. template < typename _Tp >
  65942. void
  65943. fill ( const _Deque_iterator < _Tp , _Tp & , _Tp * > & __first ,
  65944. const _Deque_iterator < _Tp , _Tp & , _Tp * > & __last , const _Tp & __value )
  65945. {
  65946. typedef typename _Deque_iterator < _Tp , _Tp & , _Tp * > :: _Self _Self ;
  65947.  
  65948. for ( typename _Self :: _Map_pointer __node = __first . _M_node + 1 ;
  65949. __node < __last . _M_node ; ++ __node )
  65950. std :: fill ( * __node , * __node + _Self :: _S_buffer_size ( ) , __value ) ;
  65951.  
  65952. if ( __first . _M_node != __last . _M_node )
  65953. {
  65954. std :: fill ( __first . _M_cur , __first . _M_last , __value ) ;
  65955. std :: fill ( __last . _M_first , __last . _M_cur , __value ) ;
  65956. }
  65957. else
  65958. std :: fill ( __first . _M_cur , __last . _M_cur , __value ) ;
  65959. }
  65960.  
  65961. template < typename _Tp >
  65962. _Deque_iterator < _Tp , _Tp & , _Tp * >
  65963. copy ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > __first ,
  65964. _Deque_iterator < _Tp , const _Tp & , const _Tp * > __last ,
  65965. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  65966. {
  65967. typedef typename _Deque_iterator < _Tp , _Tp & , _Tp * > :: _Self _Self ;
  65968. typedef typename _Self :: difference_type difference_type ;
  65969.  
  65970. difference_type __len = __last - __first ;
  65971. while ( __len > 0 )
  65972. {
  65973. const difference_type __clen
  65974. = std :: min ( __len , std :: min ( __first . _M_last - __first . _M_cur ,
  65975. __result . _M_last - __result . _M_cur ) ) ;
  65976. std :: copy ( __first . _M_cur , __first . _M_cur + __clen , __result . _M_cur ) ;
  65977. __first += __clen ;
  65978. __result += __clen ;
  65979. __len -= __clen ;
  65980. }
  65981. return __result ;
  65982. }
  65983.  
  65984. template < typename _Tp >
  65985. _Deque_iterator < _Tp , _Tp & , _Tp * >
  65986. copy_backward ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > __first ,
  65987. _Deque_iterator < _Tp , const _Tp & , const _Tp * > __last ,
  65988. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  65989. {
  65990. typedef typename _Deque_iterator < _Tp , _Tp & , _Tp * > :: _Self _Self ;
  65991. typedef typename _Self :: difference_type difference_type ;
  65992.  
  65993. difference_type __len = __last - __first ;
  65994. while ( __len > 0 )
  65995. {
  65996. difference_type __llen = __last . _M_cur - __last . _M_first ;
  65997. _Tp * __lend = __last . _M_cur ;
  65998.  
  65999. difference_type __rlen = __result . _M_cur - __result . _M_first ;
  66000. _Tp * __rend = __result . _M_cur ;
  66001.  
  66002. if ( ! __llen )
  66003. {
  66004. __llen = _Self :: _S_buffer_size ( ) ;
  66005. __lend = * ( __last . _M_node - 1 ) + __llen ;
  66006. }
  66007. if ( ! __rlen )
  66008. {
  66009. __rlen = _Self :: _S_buffer_size ( ) ;
  66010. __rend = * ( __result . _M_node - 1 ) + __rlen ;
  66011. }
  66012.  
  66013. const difference_type __clen = std :: min ( __len ,
  66014. std :: min ( __llen , __rlen ) ) ;
  66015. std :: copy_backward ( __lend - __clen , __lend , __rend ) ;
  66016. __last -= __clen ;
  66017. __result -= __clen ;
  66018. __len -= __clen ;
  66019. }
  66020. return __result ;
  66021. }
  66022.  
  66023.  
  66024. template < typename _Tp >
  66025. _Deque_iterator < _Tp , _Tp & , _Tp * >
  66026. move ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > __first ,
  66027. _Deque_iterator < _Tp , const _Tp & , const _Tp * > __last ,
  66028. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  66029. {
  66030. typedef typename _Deque_iterator < _Tp , _Tp & , _Tp * > :: _Self _Self ;
  66031. typedef typename _Self :: difference_type difference_type ;
  66032.  
  66033. difference_type __len = __last - __first ;
  66034. while ( __len > 0 )
  66035. {
  66036. const difference_type __clen
  66037. = std :: min ( __len , std :: min ( __first . _M_last - __first . _M_cur ,
  66038. __result . _M_last - __result . _M_cur ) ) ;
  66039. std :: move ( __first . _M_cur , __first . _M_cur + __clen , __result . _M_cur ) ;
  66040. __first += __clen ;
  66041. __result += __clen ;
  66042. __len -= __clen ;
  66043. }
  66044. return __result ;
  66045. }
  66046.  
  66047. template < typename _Tp >
  66048. _Deque_iterator < _Tp , _Tp & , _Tp * >
  66049. move_backward ( _Deque_iterator < _Tp , const _Tp & , const _Tp * > __first ,
  66050. _Deque_iterator < _Tp , const _Tp & , const _Tp * > __last ,
  66051. _Deque_iterator < _Tp , _Tp & , _Tp * > __result )
  66052. {
  66053. typedef typename _Deque_iterator < _Tp , _Tp & , _Tp * > :: _Self _Self ;
  66054. typedef typename _Self :: difference_type difference_type ;
  66055.  
  66056. difference_type __len = __last - __first ;
  66057. while ( __len > 0 )
  66058. {
  66059. difference_type __llen = __last . _M_cur - __last . _M_first ;
  66060. _Tp * __lend = __last . _M_cur ;
  66061.  
  66062. difference_type __rlen = __result . _M_cur - __result . _M_first ;
  66063. _Tp * __rend = __result . _M_cur ;
  66064.  
  66065. if ( ! __llen )
  66066. {
  66067. __llen = _Self :: _S_buffer_size ( ) ;
  66068. __lend = * ( __last . _M_node - 1 ) + __llen ;
  66069. }
  66070. if ( ! __rlen )
  66071. {
  66072. __rlen = _Self :: _S_buffer_size ( ) ;
  66073. __rend = * ( __result . _M_node - 1 ) + __rlen ;
  66074. }
  66075.  
  66076. const difference_type __clen = std :: min ( __len ,
  66077. std :: min ( __llen , __rlen ) ) ;
  66078. std :: move_backward ( __lend - __clen , __lend , __rend ) ;
  66079. __last -= __clen ;
  66080. __result -= __clen ;
  66081. __len -= __clen ;
  66082. }
  66083. return __result ;
  66084. }
  66085.  
  66086.  
  66087.  
  66088. }
  66089. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/set"
  66090. #58
  66091. #pragma GCC system_header
  66092. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_set.h"
  66093. #64
  66094. namespace std
  66095. {
  66096. #88
  66097. template < typename _Key , typename _Compare = std :: less < _Key > ,
  66098. typename _Alloc = std :: allocator < _Key > >
  66099. class set
  66100. {
  66101.  
  66102. typedef typename _Alloc :: value_type _Alloc_value_type ;
  66103.  
  66104.  
  66105.  
  66106.  
  66107.  
  66108. public :
  66109.  
  66110.  
  66111.  
  66112. typedef _Key key_type ;
  66113. typedef _Key value_type ;
  66114. typedef _Compare key_compare ;
  66115. typedef _Compare value_compare ;
  66116. typedef _Alloc allocator_type ;
  66117.  
  66118.  
  66119. private :
  66120. typedef typename _Alloc :: template rebind < _Key > :: other _Key_alloc_type ;
  66121.  
  66122. typedef _Rb_tree < key_type , value_type , _Identity < value_type > ,
  66123. key_compare , _Key_alloc_type > _Rep_type ;
  66124. _Rep_type _M_t ;
  66125.  
  66126. public :
  66127.  
  66128.  
  66129. typedef typename _Key_alloc_type :: pointer pointer ;
  66130. typedef typename _Key_alloc_type :: const_pointer const_pointer ;
  66131. typedef typename _Key_alloc_type :: reference reference ;
  66132. typedef typename _Key_alloc_type :: const_reference const_reference ;
  66133.  
  66134.  
  66135.  
  66136. typedef typename _Rep_type :: const_iterator iterator ;
  66137. typedef typename _Rep_type :: const_iterator const_iterator ;
  66138. typedef typename _Rep_type :: const_reverse_iterator reverse_iterator ;
  66139. typedef typename _Rep_type :: const_reverse_iterator const_reverse_iterator ;
  66140. typedef typename _Rep_type :: size_type size_type ;
  66141. typedef typename _Rep_type :: difference_type difference_type ;
  66142. #139
  66143. set ( )
  66144. : _M_t ( ) { }
  66145. #147
  66146. explicit
  66147. set ( const _Compare & __comp ,
  66148. const allocator_type & __a = allocator_type ( ) )
  66149. : _M_t ( __comp , _Key_alloc_type ( __a ) ) { }
  66150. #162
  66151. template < typename _InputIterator >
  66152. set ( _InputIterator __first , _InputIterator __last )
  66153. : _M_t ( )
  66154. { _M_t . _M_insert_unique ( __first , __last ) ; }
  66155. #179
  66156. template < typename _InputIterator >
  66157. set ( _InputIterator __first , _InputIterator __last ,
  66158. const _Compare & __comp ,
  66159. const allocator_type & __a = allocator_type ( ) )
  66160. : _M_t ( __comp , _Key_alloc_type ( __a ) )
  66161. { _M_t . _M_insert_unique ( __first , __last ) ; }
  66162. #193
  66163. set ( const set & __x )
  66164. : _M_t ( __x . _M_t ) { }
  66165. #204
  66166. set ( set && __x )
  66167. noexcept ( is_nothrow_copy_constructible < _Compare > :: value )
  66168. : _M_t ( std :: move ( __x . _M_t ) ) { }
  66169. #218
  66170. set ( initializer_list < value_type > __l ,
  66171. const _Compare & __comp = _Compare ( ) ,
  66172. const allocator_type & __a = allocator_type ( ) )
  66173. : _M_t ( __comp , _Key_alloc_type ( __a ) )
  66174. { _M_t . _M_insert_unique ( __l . begin ( ) , __l . end ( ) ) ; }
  66175. #232
  66176. set &
  66177. operator = ( const set & __x )
  66178. {
  66179. _M_t = __x . _M_t ;
  66180. return * this ;
  66181. }
  66182. #247
  66183. set &
  66184. operator = ( set && __x )
  66185. {
  66186.  
  66187.  
  66188. this -> clear ( ) ;
  66189. this -> swap ( __x ) ;
  66190. return * this ;
  66191. }
  66192. #268
  66193. set &
  66194. operator = ( initializer_list < value_type > __l )
  66195. {
  66196. this -> clear ( ) ;
  66197. this -> insert ( __l . begin ( ) , __l . end ( ) ) ;
  66198. return * this ;
  66199. }
  66200.  
  66201.  
  66202.  
  66203.  
  66204.  
  66205. key_compare
  66206. key_comp ( ) const
  66207. { return _M_t . key_comp ( ) ; }
  66208.  
  66209. value_compare
  66210. value_comp ( ) const
  66211. { return _M_t . key_comp ( ) ; }
  66212.  
  66213. allocator_type
  66214. get_allocator ( ) const noexcept
  66215. { return allocator_type ( _M_t . get_allocator ( ) ) ; }
  66216. #297
  66217. iterator
  66218. begin ( ) const noexcept
  66219. { return _M_t . begin ( ) ; }
  66220. #306
  66221. iterator
  66222. end ( ) const noexcept
  66223. { return _M_t . end ( ) ; }
  66224. #315
  66225. reverse_iterator
  66226. rbegin ( ) const noexcept
  66227. { return _M_t . rbegin ( ) ; }
  66228. #324
  66229. reverse_iterator
  66230. rend ( ) const noexcept
  66231. { return _M_t . rend ( ) ; }
  66232. #334
  66233. iterator
  66234. cbegin ( ) const noexcept
  66235. { return _M_t . begin ( ) ; }
  66236. #343
  66237. iterator
  66238. cend ( ) const noexcept
  66239. { return _M_t . end ( ) ; }
  66240. #352
  66241. reverse_iterator
  66242. crbegin ( ) const noexcept
  66243. { return _M_t . rbegin ( ) ; }
  66244. #361
  66245. reverse_iterator
  66246. crend ( ) const noexcept
  66247. { return _M_t . rend ( ) ; }
  66248.  
  66249.  
  66250.  
  66251. bool
  66252. empty ( ) const noexcept
  66253. { return _M_t . empty ( ) ; }
  66254.  
  66255.  
  66256. size_type
  66257. size ( ) const noexcept
  66258. { return _M_t . size ( ) ; }
  66259.  
  66260.  
  66261. size_type
  66262. max_size ( ) const noexcept
  66263. { return _M_t . max_size ( ) ; }
  66264. #392
  66265. void
  66266. swap ( set & __x )
  66267. { _M_t . swap ( __x . _M_t ) ; }
  66268. #411
  66269. template < typename ... _Args >
  66270. std :: pair < iterator , bool >
  66271. emplace ( _Args && ... __args )
  66272. { return _M_t . _M_emplace_unique ( std :: forward < _Args > ( __args ) ... ) ; }
  66273. #437
  66274. template < typename ... _Args >
  66275. iterator
  66276. emplace_hint ( const_iterator __pos , _Args && ... __args )
  66277. {
  66278. return _M_t . _M_emplace_hint_unique ( __pos ,
  66279. std :: forward < _Args > ( __args ) ... ) ;
  66280. }
  66281. #459
  66282. std :: pair < iterator , bool >
  66283. insert ( const value_type & __x )
  66284. {
  66285. std :: pair < typename _Rep_type :: iterator , bool > __p =
  66286. _M_t . _M_insert_unique ( __x ) ;
  66287. return std :: pair < iterator , bool > ( __p . first , __p . second ) ;
  66288. }
  66289.  
  66290.  
  66291. std :: pair < iterator , bool >
  66292. insert ( value_type && __x )
  66293. {
  66294. std :: pair < typename _Rep_type :: iterator , bool > __p =
  66295. _M_t . _M_insert_unique ( std :: move ( __x ) ) ;
  66296. return std :: pair < iterator , bool > ( __p . first , __p . second ) ;
  66297. }
  66298. #496
  66299. iterator
  66300. insert ( const_iterator __position , const value_type & __x )
  66301. { return _M_t . _M_insert_unique_ ( __position , __x ) ; }
  66302.  
  66303.  
  66304. iterator
  66305. insert ( const_iterator __position , value_type && __x )
  66306. { return _M_t . _M_insert_unique_ ( __position , std :: move ( __x ) ) ; }
  66307. #515
  66308. template < typename _InputIterator >
  66309. void
  66310. insert ( _InputIterator __first , _InputIterator __last )
  66311. { _M_t . _M_insert_unique ( __first , __last ) ; }
  66312. #528
  66313. void
  66314. insert ( initializer_list < value_type > __l )
  66315. { this -> insert ( __l . begin ( ) , __l . end ( ) ) ; }
  66316. #549
  66317. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  66318. iterator
  66319. erase ( const_iterator __position )
  66320. { return _M_t . erase ( __position ) ; }
  66321. #580
  66322. size_type
  66323. erase ( const key_type & __x )
  66324. { return _M_t . erase ( __x ) ; }
  66325. #601
  66326. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  66327. iterator
  66328. erase ( const_iterator __first , const_iterator __last )
  66329. { return _M_t . erase ( __first , __last ) ; }
  66330. #629
  66331. void
  66332. clear ( ) noexcept
  66333. { _M_t . clear ( ) ; }
  66334. #643
  66335. size_type
  66336. count ( const key_type & __x ) const
  66337. { return _M_t . find ( __x ) == _M_t . end ( ) ? 0 : 1 ; }
  66338. #661
  66339. iterator
  66340. find ( const key_type & __x )
  66341. { return _M_t . find ( __x ) ; }
  66342.  
  66343. const_iterator
  66344. find ( const key_type & __x ) const
  66345. { return _M_t . find ( __x ) ; }
  66346. #682
  66347. iterator
  66348. lower_bound ( const key_type & __x )
  66349. { return _M_t . lower_bound ( __x ) ; }
  66350.  
  66351. const_iterator
  66352. lower_bound ( const key_type & __x ) const
  66353. { return _M_t . lower_bound ( __x ) ; }
  66354. #698
  66355. iterator
  66356. upper_bound ( const key_type & __x )
  66357. { return _M_t . upper_bound ( __x ) ; }
  66358.  
  66359. const_iterator
  66360. upper_bound ( const key_type & __x ) const
  66361. { return _M_t . upper_bound ( __x ) ; }
  66362. #723
  66363. std :: pair < iterator , iterator >
  66364. equal_range ( const key_type & __x )
  66365. { return _M_t . equal_range ( __x ) ; }
  66366.  
  66367. std :: pair < const_iterator , const_iterator >
  66368. equal_range ( const key_type & __x ) const
  66369. { return _M_t . equal_range ( __x ) ; }
  66370.  
  66371.  
  66372. template < typename _K1 , typename _C1 , typename _A1 >
  66373. friend bool
  66374. operator == ( const set < _K1 , _C1 , _A1 > & , const set < _K1 , _C1 , _A1 > & ) ;
  66375.  
  66376. template < typename _K1 , typename _C1 , typename _A1 >
  66377. friend bool
  66378. operator < ( const set < _K1 , _C1 , _A1 > & , const set < _K1 , _C1 , _A1 > & ) ;
  66379. } ;
  66380. #752
  66381. template < typename _Key , typename _Compare , typename _Alloc >
  66382. inline bool
  66383. operator == ( const set < _Key , _Compare , _Alloc > & __x ,
  66384. const set < _Key , _Compare , _Alloc > & __y )
  66385. { return __x . _M_t == __y . _M_t ; }
  66386. #769
  66387. template < typename _Key , typename _Compare , typename _Alloc >
  66388. inline bool
  66389. operator < ( const set < _Key , _Compare , _Alloc > & __x ,
  66390. const set < _Key , _Compare , _Alloc > & __y )
  66391. { return __x . _M_t < __y . _M_t ; }
  66392.  
  66393.  
  66394. template < typename _Key , typename _Compare , typename _Alloc >
  66395. inline bool
  66396. operator != ( const set < _Key , _Compare , _Alloc > & __x ,
  66397. const set < _Key , _Compare , _Alloc > & __y )
  66398. { return ! ( __x == __y ) ; }
  66399.  
  66400.  
  66401. template < typename _Key , typename _Compare , typename _Alloc >
  66402. inline bool
  66403. operator > ( const set < _Key , _Compare , _Alloc > & __x ,
  66404. const set < _Key , _Compare , _Alloc > & __y )
  66405. { return __y < __x ; }
  66406.  
  66407.  
  66408. template < typename _Key , typename _Compare , typename _Alloc >
  66409. inline bool
  66410. operator <= ( const set < _Key , _Compare , _Alloc > & __x ,
  66411. const set < _Key , _Compare , _Alloc > & __y )
  66412. { return ! ( __y < __x ) ; }
  66413.  
  66414.  
  66415. template < typename _Key , typename _Compare , typename _Alloc >
  66416. inline bool
  66417. operator >= ( const set < _Key , _Compare , _Alloc > & __x ,
  66418. const set < _Key , _Compare , _Alloc > & __y )
  66419. { return ! ( __x < __y ) ; }
  66420.  
  66421.  
  66422. template < typename _Key , typename _Compare , typename _Alloc >
  66423. inline void
  66424. swap ( set < _Key , _Compare , _Alloc > & __x , set < _Key , _Compare , _Alloc > & __y )
  66425. { __x . swap ( __y ) ; }
  66426.  
  66427.  
  66428. }
  66429. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_multiset.h"
  66430. #64
  66431. namespace std
  66432. {
  66433. #90
  66434. template < typename _Key , typename _Compare = std :: less < _Key > ,
  66435. typename _Alloc = std :: allocator < _Key > >
  66436. class multiset
  66437. {
  66438.  
  66439. typedef typename _Alloc :: value_type _Alloc_value_type ;
  66440.  
  66441.  
  66442.  
  66443.  
  66444.  
  66445. public :
  66446.  
  66447. typedef _Key key_type ;
  66448. typedef _Key value_type ;
  66449. typedef _Compare key_compare ;
  66450. typedef _Compare value_compare ;
  66451. typedef _Alloc allocator_type ;
  66452.  
  66453. private :
  66454.  
  66455. typedef typename _Alloc :: template rebind < _Key > :: other _Key_alloc_type ;
  66456.  
  66457. typedef _Rb_tree < key_type , value_type , _Identity < value_type > ,
  66458. key_compare , _Key_alloc_type > _Rep_type ;
  66459.  
  66460. _Rep_type _M_t ;
  66461.  
  66462. public :
  66463. typedef typename _Key_alloc_type :: pointer pointer ;
  66464. typedef typename _Key_alloc_type :: const_pointer const_pointer ;
  66465. typedef typename _Key_alloc_type :: reference reference ;
  66466. typedef typename _Key_alloc_type :: const_reference const_reference ;
  66467.  
  66468.  
  66469.  
  66470. typedef typename _Rep_type :: const_iterator iterator ;
  66471. typedef typename _Rep_type :: const_iterator const_iterator ;
  66472. typedef typename _Rep_type :: const_reverse_iterator reverse_iterator ;
  66473. typedef typename _Rep_type :: const_reverse_iterator const_reverse_iterator ;
  66474. typedef typename _Rep_type :: size_type size_type ;
  66475. typedef typename _Rep_type :: difference_type difference_type ;
  66476.  
  66477.  
  66478.  
  66479.  
  66480.  
  66481. multiset ( )
  66482. : _M_t ( ) { }
  66483. #145
  66484. explicit
  66485. multiset ( const _Compare & __comp ,
  66486. const allocator_type & __a = allocator_type ( ) )
  66487. : _M_t ( __comp , _Key_alloc_type ( __a ) ) { }
  66488. #159
  66489. template < typename _InputIterator >
  66490. multiset ( _InputIterator __first , _InputIterator __last )
  66491. : _M_t ( )
  66492. { _M_t . _M_insert_equal ( __first , __last ) ; }
  66493. #175
  66494. template < typename _InputIterator >
  66495. multiset ( _InputIterator __first , _InputIterator __last ,
  66496. const _Compare & __comp ,
  66497. const allocator_type & __a = allocator_type ( ) )
  66498. : _M_t ( __comp , _Key_alloc_type ( __a ) )
  66499. { _M_t . _M_insert_equal ( __first , __last ) ; }
  66500. #189
  66501. multiset ( const multiset & __x )
  66502. : _M_t ( __x . _M_t ) { }
  66503. #200
  66504. multiset ( multiset && __x )
  66505. noexcept ( is_nothrow_copy_constructible < _Compare > :: value )
  66506. : _M_t ( std :: move ( __x . _M_t ) ) { }
  66507. #214
  66508. multiset ( initializer_list < value_type > __l ,
  66509. const _Compare & __comp = _Compare ( ) ,
  66510. const allocator_type & __a = allocator_type ( ) )
  66511. : _M_t ( __comp , _Key_alloc_type ( __a ) )
  66512. { _M_t . _M_insert_equal ( __l . begin ( ) , __l . end ( ) ) ; }
  66513. #228
  66514. multiset &
  66515. operator = ( const multiset & __x )
  66516. {
  66517. _M_t = __x . _M_t ;
  66518. return * this ;
  66519. }
  66520. #244
  66521. multiset &
  66522. operator = ( multiset && __x )
  66523. {
  66524.  
  66525.  
  66526. this -> clear ( ) ;
  66527. this -> swap ( __x ) ;
  66528. return * this ;
  66529. }
  66530. #265
  66531. multiset &
  66532. operator = ( initializer_list < value_type > __l )
  66533. {
  66534. this -> clear ( ) ;
  66535. this -> insert ( __l . begin ( ) , __l . end ( ) ) ;
  66536. return * this ;
  66537. }
  66538.  
  66539.  
  66540.  
  66541.  
  66542.  
  66543. key_compare
  66544. key_comp ( ) const
  66545. { return _M_t . key_comp ( ) ; }
  66546.  
  66547. value_compare
  66548. value_comp ( ) const
  66549. { return _M_t . key_comp ( ) ; }
  66550.  
  66551. allocator_type
  66552. get_allocator ( ) const noexcept
  66553. { return allocator_type ( _M_t . get_allocator ( ) ) ; }
  66554. #294
  66555. iterator
  66556. begin ( ) const noexcept
  66557. { return _M_t . begin ( ) ; }
  66558. #303
  66559. iterator
  66560. end ( ) const noexcept
  66561. { return _M_t . end ( ) ; }
  66562. #312
  66563. reverse_iterator
  66564. rbegin ( ) const noexcept
  66565. { return _M_t . rbegin ( ) ; }
  66566. #321
  66567. reverse_iterator
  66568. rend ( ) const noexcept
  66569. { return _M_t . rend ( ) ; }
  66570. #331
  66571. iterator
  66572. cbegin ( ) const noexcept
  66573. { return _M_t . begin ( ) ; }
  66574. #340
  66575. iterator
  66576. cend ( ) const noexcept
  66577. { return _M_t . end ( ) ; }
  66578. #349
  66579. reverse_iterator
  66580. crbegin ( ) const noexcept
  66581. { return _M_t . rbegin ( ) ; }
  66582. #358
  66583. reverse_iterator
  66584. crend ( ) const noexcept
  66585. { return _M_t . rend ( ) ; }
  66586.  
  66587.  
  66588.  
  66589. bool
  66590. empty ( ) const noexcept
  66591. { return _M_t . empty ( ) ; }
  66592.  
  66593.  
  66594. size_type
  66595. size ( ) const noexcept
  66596. { return _M_t . size ( ) ; }
  66597.  
  66598.  
  66599. size_type
  66600. max_size ( ) const noexcept
  66601. { return _M_t . max_size ( ) ; }
  66602. #389
  66603. void
  66604. swap ( multiset & __x )
  66605. { _M_t . swap ( __x . _M_t ) ; }
  66606. #407
  66607. template < typename ... _Args >
  66608. iterator
  66609. emplace ( _Args && ... __args )
  66610. { return _M_t . _M_emplace_equal ( std :: forward < _Args > ( __args ) ... ) ; }
  66611. #433
  66612. template < typename ... _Args >
  66613. iterator
  66614. emplace_hint ( const_iterator __pos , _Args && ... __args )
  66615. {
  66616. return _M_t . _M_emplace_hint_equal ( __pos ,
  66617. std :: forward < _Args > ( __args ) ... ) ;
  66618. }
  66619. #453
  66620. iterator
  66621. insert ( const value_type & __x )
  66622. { return _M_t . _M_insert_equal ( __x ) ; }
  66623.  
  66624.  
  66625. iterator
  66626. insert ( value_type && __x )
  66627. { return _M_t . _M_insert_equal ( std :: move ( __x ) ) ; }
  66628. #483
  66629. iterator
  66630. insert ( const_iterator __position , const value_type & __x )
  66631. { return _M_t . _M_insert_equal_ ( __position , __x ) ; }
  66632.  
  66633.  
  66634. iterator
  66635. insert ( const_iterator __position , value_type && __x )
  66636. { return _M_t . _M_insert_equal_ ( __position , std :: move ( __x ) ) ; }
  66637. #501
  66638. template < typename _InputIterator >
  66639. void
  66640. insert ( _InputIterator __first , _InputIterator __last )
  66641. { _M_t . _M_insert_equal ( __first , __last ) ; }
  66642. #514
  66643. void
  66644. insert ( initializer_list < value_type > __l )
  66645. { this -> insert ( __l . begin ( ) , __l . end ( ) ) ; }
  66646. #535
  66647. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  66648. iterator
  66649. erase ( const_iterator __position )
  66650. { return _M_t . erase ( __position ) ; }
  66651. #566
  66652. size_type
  66653. erase ( const key_type & __x )
  66654. { return _M_t . erase ( __x ) ; }
  66655. #587
  66656. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  66657. iterator
  66658. erase ( const_iterator __first , const_iterator __last )
  66659. { return _M_t . erase ( __first , __last ) ; }
  66660. #615
  66661. void
  66662. clear ( ) noexcept
  66663. { _M_t . clear ( ) ; }
  66664. #626
  66665. size_type
  66666. count ( const key_type & __x ) const
  66667. { return _M_t . count ( __x ) ; }
  66668. #644
  66669. iterator
  66670. find ( const key_type & __x )
  66671. { return _M_t . find ( __x ) ; }
  66672.  
  66673. const_iterator
  66674. find ( const key_type & __x ) const
  66675. { return _M_t . find ( __x ) ; }
  66676. #665
  66677. iterator
  66678. lower_bound ( const key_type & __x )
  66679. { return _M_t . lower_bound ( __x ) ; }
  66680.  
  66681. const_iterator
  66682. lower_bound ( const key_type & __x ) const
  66683. { return _M_t . lower_bound ( __x ) ; }
  66684. #681
  66685. iterator
  66686. upper_bound ( const key_type & __x )
  66687. { return _M_t . upper_bound ( __x ) ; }
  66688.  
  66689. const_iterator
  66690. upper_bound ( const key_type & __x ) const
  66691. { return _M_t . upper_bound ( __x ) ; }
  66692. #706
  66693. std :: pair < iterator , iterator >
  66694. equal_range ( const key_type & __x )
  66695. { return _M_t . equal_range ( __x ) ; }
  66696.  
  66697. std :: pair < const_iterator , const_iterator >
  66698. equal_range ( const key_type & __x ) const
  66699. { return _M_t . equal_range ( __x ) ; }
  66700.  
  66701.  
  66702. template < typename _K1 , typename _C1 , typename _A1 >
  66703. friend bool
  66704. operator == ( const multiset < _K1 , _C1 , _A1 > & ,
  66705. const multiset < _K1 , _C1 , _A1 > & ) ;
  66706.  
  66707. template < typename _K1 , typename _C1 , typename _A1 >
  66708. friend bool
  66709. operator < ( const multiset < _K1 , _C1 , _A1 > & ,
  66710. const multiset < _K1 , _C1 , _A1 > & ) ;
  66711. } ;
  66712. #737
  66713. template < typename _Key , typename _Compare , typename _Alloc >
  66714. inline bool
  66715. operator == ( const multiset < _Key , _Compare , _Alloc > & __x ,
  66716. const multiset < _Key , _Compare , _Alloc > & __y )
  66717. { return __x . _M_t == __y . _M_t ; }
  66718. #754
  66719. template < typename _Key , typename _Compare , typename _Alloc >
  66720. inline bool
  66721. operator < ( const multiset < _Key , _Compare , _Alloc > & __x ,
  66722. const multiset < _Key , _Compare , _Alloc > & __y )
  66723. { return __x . _M_t < __y . _M_t ; }
  66724.  
  66725.  
  66726. template < typename _Key , typename _Compare , typename _Alloc >
  66727. inline bool
  66728. operator != ( const multiset < _Key , _Compare , _Alloc > & __x ,
  66729. const multiset < _Key , _Compare , _Alloc > & __y )
  66730. { return ! ( __x == __y ) ; }
  66731.  
  66732.  
  66733. template < typename _Key , typename _Compare , typename _Alloc >
  66734. inline bool
  66735. operator > ( const multiset < _Key , _Compare , _Alloc > & __x ,
  66736. const multiset < _Key , _Compare , _Alloc > & __y )
  66737. { return __y < __x ; }
  66738.  
  66739.  
  66740. template < typename _Key , typename _Compare , typename _Alloc >
  66741. inline bool
  66742. operator <= ( const multiset < _Key , _Compare , _Alloc > & __x ,
  66743. const multiset < _Key , _Compare , _Alloc > & __y )
  66744. { return ! ( __y < __x ) ; }
  66745.  
  66746.  
  66747. template < typename _Key , typename _Compare , typename _Alloc >
  66748. inline bool
  66749. operator >= ( const multiset < _Key , _Compare , _Alloc > & __x ,
  66750. const multiset < _Key , _Compare , _Alloc > & __y )
  66751. { return ! ( __x < __y ) ; }
  66752.  
  66753.  
  66754. template < typename _Key , typename _Compare , typename _Alloc >
  66755. inline void
  66756. swap ( multiset < _Key , _Compare , _Alloc > & __x ,
  66757. multiset < _Key , _Compare , _Alloc > & __y )
  66758. { __x . swap ( __y ) ; }
  66759.  
  66760.  
  66761. }
  66762. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bitset"
  66763. #45
  66764. #pragma GCC system_header
  66765. #60
  66766. namespace std
  66767. {
  66768. #70
  66769. template < size_t _Nw >
  66770. struct _Base_bitset
  66771. {
  66772. typedef unsigned long _WordT ;
  66773.  
  66774.  
  66775. _WordT _M_w [ _Nw ] ;
  66776.  
  66777. constexpr _Base_bitset ( ) noexcept
  66778. : _M_w ( ) { }
  66779.  
  66780.  
  66781. constexpr _Base_bitset ( unsigned long long __val ) noexcept
  66782. : _M_w { _WordT ( __val )
  66783.  
  66784.  
  66785.  
  66786. } { }
  66787. #94
  66788. static constexpr size_t
  66789. _S_whichword ( size_t __pos ) noexcept
  66790. { return __pos / ( 8 * 8 ) ; }
  66791.  
  66792. static constexpr size_t
  66793. _S_whichbyte ( size_t __pos ) noexcept
  66794. { return ( __pos % ( 8 * 8 ) ) / 8 ; }
  66795.  
  66796. static constexpr size_t
  66797. _S_whichbit ( size_t __pos ) noexcept
  66798. { return __pos % ( 8 * 8 ) ; }
  66799.  
  66800. static constexpr _WordT
  66801. _S_maskbit ( size_t __pos ) noexcept
  66802. { return ( static_cast < _WordT > ( 1 ) ) << _S_whichbit ( __pos ) ; }
  66803.  
  66804. _WordT &
  66805. _M_getword ( size_t __pos ) noexcept
  66806. { return _M_w [ _S_whichword ( __pos ) ] ; }
  66807.  
  66808. constexpr _WordT
  66809. _M_getword ( size_t __pos ) const noexcept
  66810. { return _M_w [ _S_whichword ( __pos ) ] ; }
  66811.  
  66812.  
  66813. const _WordT *
  66814. _M_getdata ( ) const noexcept
  66815. { return _M_w ; }
  66816.  
  66817.  
  66818. _WordT &
  66819. _M_hiword ( ) noexcept
  66820. { return _M_w [ _Nw - 1 ] ; }
  66821.  
  66822. constexpr _WordT
  66823. _M_hiword ( ) const noexcept
  66824. { return _M_w [ _Nw - 1 ] ; }
  66825.  
  66826. void
  66827. _M_do_and ( const _Base_bitset < _Nw > & __x ) noexcept
  66828. {
  66829. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66830. _M_w [ __i ] &= __x . _M_w [ __i ] ;
  66831. }
  66832.  
  66833. void
  66834. _M_do_or ( const _Base_bitset < _Nw > & __x ) noexcept
  66835. {
  66836. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66837. _M_w [ __i ] |= __x . _M_w [ __i ] ;
  66838. }
  66839.  
  66840. void
  66841. _M_do_xor ( const _Base_bitset < _Nw > & __x ) noexcept
  66842. {
  66843. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66844. _M_w [ __i ] ^= __x . _M_w [ __i ] ;
  66845. }
  66846.  
  66847. void
  66848. _M_do_left_shift ( size_t __shift ) noexcept ;
  66849.  
  66850. void
  66851. _M_do_right_shift ( size_t __shift ) noexcept ;
  66852.  
  66853. void
  66854. _M_do_flip ( ) noexcept
  66855. {
  66856. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66857. _M_w [ __i ] = ~ _M_w [ __i ] ;
  66858. }
  66859.  
  66860. void
  66861. _M_do_set ( ) noexcept
  66862. {
  66863. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66864. _M_w [ __i ] = ~ static_cast < _WordT > ( 0 ) ;
  66865. }
  66866.  
  66867. void
  66868. _M_do_reset ( ) noexcept
  66869. { __builtin_memset ( _M_w , 0 , _Nw * sizeof ( _WordT ) ) ; }
  66870.  
  66871. bool
  66872. _M_is_equal ( const _Base_bitset < _Nw > & __x ) const noexcept
  66873. {
  66874. for ( size_t __i = 0 ; __i < _Nw ; ++ __i )
  66875. if ( _M_w [ __i ] != __x . _M_w [ __i ] )
  66876. return false ;
  66877. return true ;
  66878. }
  66879.  
  66880. template < size_t _Nb >
  66881. bool
  66882. _M_are_all ( ) const noexcept
  66883. {
  66884. for ( size_t __i = 0 ; __i < _Nw - 1 ; __i ++ )
  66885. if ( _M_w [ __i ] != ~ static_cast < _WordT > ( 0 ) )
  66886. return false ;
  66887. return _M_hiword ( ) == ( ~ static_cast < _WordT > ( 0 )
  66888. >> ( _Nw * ( 8 * 8 )
  66889. - _Nb ) ) ;
  66890. }
  66891.  
  66892. bool
  66893. _M_is_any ( ) const noexcept
  66894. {
  66895. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66896. if ( _M_w [ __i ] != static_cast < _WordT > ( 0 ) )
  66897. return true ;
  66898. return false ;
  66899. }
  66900.  
  66901. size_t
  66902. _M_do_count ( ) const noexcept
  66903. {
  66904. size_t __result = 0 ;
  66905. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  66906. __result += __builtin_popcountl ( _M_w [ __i ] ) ;
  66907. return __result ;
  66908. }
  66909.  
  66910. unsigned long
  66911. _M_do_to_ulong ( ) const ;
  66912.  
  66913.  
  66914. unsigned long long
  66915. _M_do_to_ullong ( ) const ;
  66916.  
  66917.  
  66918.  
  66919. size_t
  66920. _M_do_find_first ( size_t ) const noexcept ;
  66921.  
  66922.  
  66923. size_t
  66924. _M_do_find_next ( size_t , size_t ) const noexcept ;
  66925. } ;
  66926.  
  66927.  
  66928. template < size_t _Nw >
  66929. void
  66930. _Base_bitset < _Nw > :: _M_do_left_shift ( size_t __shift ) noexcept
  66931. {
  66932. if ( __shift != 0 )
  66933. {
  66934. const size_t __wshift = __shift / ( 8 * 8 ) ;
  66935. const size_t __offset = __shift % ( 8 * 8 ) ;
  66936.  
  66937. if ( __offset == 0 )
  66938. for ( size_t __n = _Nw - 1 ; __n >= __wshift ; -- __n )
  66939. _M_w [ __n ] = _M_w [ __n - __wshift ] ;
  66940. else
  66941. {
  66942. const size_t __sub_offset = ( ( 8 * 8 )
  66943. - __offset ) ;
  66944. for ( size_t __n = _Nw - 1 ; __n > __wshift ; -- __n )
  66945. _M_w [ __n ] = ( ( _M_w [ __n - __wshift ] << __offset )
  66946. | ( _M_w [ __n - __wshift - 1 ] >> __sub_offset ) ) ;
  66947. _M_w [ __wshift ] = _M_w [ 0 ] << __offset ;
  66948. }
  66949.  
  66950. std :: fill ( _M_w + 0 , _M_w + __wshift , static_cast < _WordT > ( 0 ) ) ;
  66951. }
  66952. }
  66953.  
  66954. template < size_t _Nw >
  66955. void
  66956. _Base_bitset < _Nw > :: _M_do_right_shift ( size_t __shift ) noexcept
  66957. {
  66958. if ( __shift != 0 )
  66959. {
  66960. const size_t __wshift = __shift / ( 8 * 8 ) ;
  66961. const size_t __offset = __shift % ( 8 * 8 ) ;
  66962. const size_t __limit = _Nw - __wshift - 1 ;
  66963.  
  66964. if ( __offset == 0 )
  66965. for ( size_t __n = 0 ; __n <= __limit ; ++ __n )
  66966. _M_w [ __n ] = _M_w [ __n + __wshift ] ;
  66967. else
  66968. {
  66969. const size_t __sub_offset = ( ( 8 * 8 )
  66970. - __offset ) ;
  66971. for ( size_t __n = 0 ; __n < __limit ; ++ __n )
  66972. _M_w [ __n ] = ( ( _M_w [ __n + __wshift ] >> __offset )
  66973. | ( _M_w [ __n + __wshift + 1 ] << __sub_offset ) ) ;
  66974. _M_w [ __limit ] = _M_w [ _Nw - 1 ] >> __offset ;
  66975. }
  66976.  
  66977. std :: fill ( _M_w + __limit + 1 , _M_w + _Nw , static_cast < _WordT > ( 0 ) ) ;
  66978. }
  66979. }
  66980.  
  66981. template < size_t _Nw >
  66982. unsigned long
  66983. _Base_bitset < _Nw > :: _M_do_to_ulong ( ) const
  66984. {
  66985. for ( size_t __i = 1 ; __i < _Nw ; ++ __i )
  66986. if ( _M_w [ __i ] )
  66987. __throw_overflow_error ( ( "_Base_bitset::_M_do_to_ulong" ) ) ;
  66988. return _M_w [ 0 ] ;
  66989. }
  66990.  
  66991.  
  66992. template < size_t _Nw >
  66993. unsigned long long
  66994. _Base_bitset < _Nw > :: _M_do_to_ullong ( ) const
  66995. {
  66996. const bool __dw = sizeof ( unsigned long long ) > sizeof ( unsigned long ) ;
  66997. for ( size_t __i = 1 + __dw ; __i < _Nw ; ++ __i )
  66998. if ( _M_w [ __i ] )
  66999. __throw_overflow_error ( ( "_Base_bitset::_M_do_to_ullong" ) ) ;
  67000.  
  67001. if ( __dw )
  67002. return _M_w [ 0 ] + ( static_cast < unsigned long long > ( _M_w [ 1 ] )
  67003. << ( 8 * 8 ) ) ;
  67004. return _M_w [ 0 ] ;
  67005. }
  67006.  
  67007.  
  67008. template < size_t _Nw >
  67009. size_t
  67010. _Base_bitset < _Nw > ::
  67011. _M_do_find_first ( size_t __not_found ) const noexcept
  67012. {
  67013. for ( size_t __i = 0 ; __i < _Nw ; __i ++ )
  67014. {
  67015. _WordT __thisword = _M_w [ __i ] ;
  67016. if ( __thisword != static_cast < _WordT > ( 0 ) )
  67017. return ( __i * ( 8 * 8 )
  67018. + __builtin_ctzl ( __thisword ) ) ;
  67019. }
  67020.  
  67021. return __not_found ;
  67022. }
  67023.  
  67024. template < size_t _Nw >
  67025. size_t
  67026. _Base_bitset < _Nw > ::
  67027. _M_do_find_next ( size_t __prev , size_t __not_found ) const noexcept
  67028. {
  67029.  
  67030. ++ __prev ;
  67031.  
  67032.  
  67033. if ( __prev >= _Nw * ( 8 * 8 ) )
  67034. return __not_found ;
  67035.  
  67036.  
  67037. size_t __i = _S_whichword ( __prev ) ;
  67038. _WordT __thisword = _M_w [ __i ] ;
  67039.  
  67040.  
  67041. __thisword &= ( ~ static_cast < _WordT > ( 0 ) ) << _S_whichbit ( __prev ) ;
  67042.  
  67043. if ( __thisword != static_cast < _WordT > ( 0 ) )
  67044. return ( __i * ( 8 * 8 )
  67045. + __builtin_ctzl ( __thisword ) ) ;
  67046.  
  67047.  
  67048. __i ++ ;
  67049. for ( ; __i < _Nw ; __i ++ )
  67050. {
  67051. __thisword = _M_w [ __i ] ;
  67052. if ( __thisword != static_cast < _WordT > ( 0 ) )
  67053. return ( __i * ( 8 * 8 )
  67054. + __builtin_ctzl ( __thisword ) ) ;
  67055. }
  67056.  
  67057. return __not_found ;
  67058. }
  67059. #371
  67060. template < >
  67061. struct _Base_bitset < 1 >
  67062. {
  67063. typedef unsigned long _WordT ;
  67064. _WordT _M_w ;
  67065.  
  67066. constexpr _Base_bitset ( ) noexcept
  67067. : _M_w ( 0 )
  67068. { }
  67069.  
  67070.  
  67071. constexpr _Base_bitset ( unsigned long long __val ) noexcept
  67072.  
  67073.  
  67074.  
  67075. : _M_w ( __val )
  67076. { }
  67077.  
  67078. static constexpr size_t
  67079. _S_whichword ( size_t __pos ) noexcept
  67080. { return __pos / ( 8 * 8 ) ; }
  67081.  
  67082. static constexpr size_t
  67083. _S_whichbyte ( size_t __pos ) noexcept
  67084. { return ( __pos % ( 8 * 8 ) ) / 8 ; }
  67085.  
  67086. static constexpr size_t
  67087. _S_whichbit ( size_t __pos ) noexcept
  67088. { return __pos % ( 8 * 8 ) ; }
  67089.  
  67090. static constexpr _WordT
  67091. _S_maskbit ( size_t __pos ) noexcept
  67092. { return ( static_cast < _WordT > ( 1 ) ) << _S_whichbit ( __pos ) ; }
  67093.  
  67094. _WordT &
  67095. _M_getword ( size_t ) noexcept
  67096. { return _M_w ; }
  67097.  
  67098. constexpr _WordT
  67099. _M_getword ( size_t ) const noexcept
  67100. { return _M_w ; }
  67101.  
  67102.  
  67103. const _WordT *
  67104. _M_getdata ( ) const noexcept
  67105. { return & _M_w ; }
  67106.  
  67107.  
  67108. _WordT &
  67109. _M_hiword ( ) noexcept
  67110. { return _M_w ; }
  67111.  
  67112. constexpr _WordT
  67113. _M_hiword ( ) const noexcept
  67114. { return _M_w ; }
  67115.  
  67116. void
  67117. _M_do_and ( const _Base_bitset < 1 > & __x ) noexcept
  67118. { _M_w &= __x . _M_w ; }
  67119.  
  67120. void
  67121. _M_do_or ( const _Base_bitset < 1 > & __x ) noexcept
  67122. { _M_w |= __x . _M_w ; }
  67123.  
  67124. void
  67125. _M_do_xor ( const _Base_bitset < 1 > & __x ) noexcept
  67126. { _M_w ^= __x . _M_w ; }
  67127.  
  67128. void
  67129. _M_do_left_shift ( size_t __shift ) noexcept
  67130. { _M_w <<= __shift ; }
  67131.  
  67132. void
  67133. _M_do_right_shift ( size_t __shift ) noexcept
  67134. { _M_w >>= __shift ; }
  67135.  
  67136. void
  67137. _M_do_flip ( ) noexcept
  67138. { _M_w = ~ _M_w ; }
  67139.  
  67140. void
  67141. _M_do_set ( ) noexcept
  67142. { _M_w = ~ static_cast < _WordT > ( 0 ) ; }
  67143.  
  67144. void
  67145. _M_do_reset ( ) noexcept
  67146. { _M_w = 0 ; }
  67147.  
  67148. bool
  67149. _M_is_equal ( const _Base_bitset < 1 > & __x ) const noexcept
  67150. { return _M_w == __x . _M_w ; }
  67151.  
  67152. template < size_t _Nb >
  67153. bool
  67154. _M_are_all ( ) const noexcept
  67155. { return _M_w == ( ~ static_cast < _WordT > ( 0 )
  67156. >> ( ( 8 * 8 ) - _Nb ) ) ; }
  67157.  
  67158. bool
  67159. _M_is_any ( ) const noexcept
  67160. { return _M_w != 0 ; }
  67161.  
  67162. size_t
  67163. _M_do_count ( ) const noexcept
  67164. { return __builtin_popcountl ( _M_w ) ; }
  67165.  
  67166. unsigned long
  67167. _M_do_to_ulong ( ) const noexcept
  67168. { return _M_w ; }
  67169.  
  67170.  
  67171. unsigned long long
  67172. _M_do_to_ullong ( ) const noexcept
  67173. { return _M_w ; }
  67174.  
  67175.  
  67176. size_t
  67177. _M_do_find_first ( size_t __not_found ) const noexcept
  67178. {
  67179. if ( _M_w != 0 )
  67180. return __builtin_ctzl ( _M_w ) ;
  67181. else
  67182. return __not_found ;
  67183. }
  67184.  
  67185.  
  67186. size_t
  67187. _M_do_find_next ( size_t __prev , size_t __not_found ) const
  67188. noexcept
  67189. {
  67190. ++ __prev ;
  67191. if ( __prev >= ( ( size_t ) ( 8 * 8 ) ) )
  67192. return __not_found ;
  67193.  
  67194. _WordT __x = _M_w >> __prev ;
  67195. if ( __x != 0 )
  67196. return __builtin_ctzl ( __x ) + __prev ;
  67197. else
  67198. return __not_found ;
  67199. }
  67200. } ;
  67201. #518
  67202. template < >
  67203. struct _Base_bitset < 0 >
  67204. {
  67205. typedef unsigned long _WordT ;
  67206.  
  67207. constexpr _Base_bitset ( ) noexcept
  67208. { }
  67209.  
  67210.  
  67211. constexpr _Base_bitset ( unsigned long long ) noexcept
  67212.  
  67213.  
  67214.  
  67215. { }
  67216.  
  67217. static constexpr size_t
  67218. _S_whichword ( size_t __pos ) noexcept
  67219. { return __pos / ( 8 * 8 ) ; }
  67220.  
  67221. static constexpr size_t
  67222. _S_whichbyte ( size_t __pos ) noexcept
  67223. { return ( __pos % ( 8 * 8 ) ) / 8 ; }
  67224.  
  67225. static constexpr size_t
  67226. _S_whichbit ( size_t __pos ) noexcept
  67227. { return __pos % ( 8 * 8 ) ; }
  67228.  
  67229. static constexpr _WordT
  67230. _S_maskbit ( size_t __pos ) noexcept
  67231. { return ( static_cast < _WordT > ( 1 ) ) << _S_whichbit ( __pos ) ; }
  67232. #556
  67233. _WordT &
  67234. _M_getword ( size_t ) noexcept
  67235. {
  67236. __throw_out_of_range ( ( "_Base_bitset::_M_getword" ) ) ;
  67237. return * new _WordT ;
  67238. }
  67239.  
  67240. constexpr _WordT
  67241. _M_getword ( size_t __pos ) const noexcept
  67242. { return 0 ; }
  67243.  
  67244. constexpr _WordT
  67245. _M_hiword ( ) const noexcept
  67246. { return 0 ; }
  67247.  
  67248. void
  67249. _M_do_and ( const _Base_bitset < 0 > & ) noexcept
  67250. { }
  67251.  
  67252. void
  67253. _M_do_or ( const _Base_bitset < 0 > & ) noexcept
  67254. { }
  67255.  
  67256. void
  67257. _M_do_xor ( const _Base_bitset < 0 > & ) noexcept
  67258. { }
  67259.  
  67260. void
  67261. _M_do_left_shift ( size_t ) noexcept
  67262. { }
  67263.  
  67264. void
  67265. _M_do_right_shift ( size_t ) noexcept
  67266. { }
  67267.  
  67268. void
  67269. _M_do_flip ( ) noexcept
  67270. { }
  67271.  
  67272. void
  67273. _M_do_set ( ) noexcept
  67274. { }
  67275.  
  67276. void
  67277. _M_do_reset ( ) noexcept
  67278. { }
  67279.  
  67280.  
  67281.  
  67282.  
  67283. bool
  67284. _M_is_equal ( const _Base_bitset < 0 > & ) const noexcept
  67285. { return true ; }
  67286.  
  67287. template < size_t _Nb >
  67288. bool
  67289. _M_are_all ( ) const noexcept
  67290. { return true ; }
  67291.  
  67292. bool
  67293. _M_is_any ( ) const noexcept
  67294. { return false ; }
  67295.  
  67296. size_t
  67297. _M_do_count ( ) const noexcept
  67298. { return 0 ; }
  67299.  
  67300. unsigned long
  67301. _M_do_to_ulong ( ) const noexcept
  67302. { return 0 ; }
  67303.  
  67304.  
  67305. unsigned long long
  67306. _M_do_to_ullong ( ) const noexcept
  67307. { return 0 ; }
  67308.  
  67309.  
  67310.  
  67311.  
  67312. size_t
  67313. _M_do_find_first ( size_t ) const noexcept
  67314. { return 0 ; }
  67315.  
  67316. size_t
  67317. _M_do_find_next ( size_t , size_t ) const noexcept
  67318. { return 0 ; }
  67319. } ;
  67320.  
  67321.  
  67322.  
  67323. template < size_t _Extrabits >
  67324. struct _Sanitize
  67325. {
  67326. typedef unsigned long _WordT ;
  67327.  
  67328. static void
  67329. _S_do_sanitize ( _WordT & __val ) noexcept
  67330. { __val &= ~ ( ( ~ static_cast < _WordT > ( 0 ) ) << _Extrabits ) ; }
  67331. } ;
  67332.  
  67333. template < >
  67334. struct _Sanitize < 0 >
  67335. {
  67336. typedef unsigned long _WordT ;
  67337.  
  67338. static void
  67339. _S_do_sanitize ( _WordT ) noexcept { }
  67340. } ;
  67341.  
  67342.  
  67343. template < size_t _Nb , bool = _Nb < ( 8 * 8 ) >
  67344. struct _Sanitize_val
  67345. {
  67346. static constexpr unsigned long long
  67347. _S_do_sanitize_val ( unsigned long long __val )
  67348. { return __val ; }
  67349. } ;
  67350.  
  67351. template < size_t _Nb >
  67352. struct _Sanitize_val < _Nb , true >
  67353. {
  67354. static constexpr unsigned long long
  67355. _S_do_sanitize_val ( unsigned long long __val )
  67356. { return __val & ~ ( ( ~ static_cast < unsigned long long > ( 0 ) ) << _Nb ) ; }
  67357. } ;
  67358. #747
  67359. template < size_t _Nb >
  67360. class bitset
  67361. : private _Base_bitset < ( ( _Nb ) / ( 8 * 8 ) + ( ( _Nb ) % ( 8 * 8 ) == 0 ? 0 : 1 ) ) >
  67362. {
  67363. private :
  67364. typedef _Base_bitset < ( ( _Nb ) / ( 8 * 8 ) + ( ( _Nb ) % ( 8 * 8 ) == 0 ? 0 : 1 ) ) > _Base ;
  67365. typedef unsigned long _WordT ;
  67366.  
  67367. void
  67368. _M_do_sanitize ( ) noexcept
  67369. {
  67370. typedef _Sanitize < _Nb % ( 8 * 8 ) > __sanitize_type ;
  67371. __sanitize_type :: _S_do_sanitize ( this -> _M_hiword ( ) ) ;
  67372. }
  67373.  
  67374.  
  67375. template < typename > friend struct hash ;
  67376.  
  67377.  
  67378. public :
  67379. #779
  67380. class reference
  67381. {
  67382. friend class bitset ;
  67383.  
  67384. _WordT * _M_wp ;
  67385. size_t _M_bpos ;
  67386.  
  67387.  
  67388. reference ( ) ;
  67389.  
  67390. public :
  67391. reference ( bitset & __b , size_t __pos ) noexcept
  67392. {
  67393. _M_wp = & __b . _M_getword ( __pos ) ;
  67394. _M_bpos = _Base :: _S_whichbit ( __pos ) ;
  67395. }
  67396.  
  67397. ~ reference ( ) noexcept
  67398. { }
  67399.  
  67400.  
  67401. reference &
  67402. operator = ( bool __x ) noexcept
  67403. {
  67404. if ( __x )
  67405. * _M_wp |= _Base :: _S_maskbit ( _M_bpos ) ;
  67406. else
  67407. * _M_wp &= ~ _Base :: _S_maskbit ( _M_bpos ) ;
  67408. return * this ;
  67409. }
  67410.  
  67411.  
  67412. reference &
  67413. operator = ( const reference & __j ) noexcept
  67414. {
  67415. if ( ( * ( __j . _M_wp ) & _Base :: _S_maskbit ( __j . _M_bpos ) ) )
  67416. * _M_wp |= _Base :: _S_maskbit ( _M_bpos ) ;
  67417. else
  67418. * _M_wp &= ~ _Base :: _S_maskbit ( _M_bpos ) ;
  67419. return * this ;
  67420. }
  67421.  
  67422.  
  67423. bool
  67424. operator ~ ( ) const noexcept
  67425. { return ( * ( _M_wp ) & _Base :: _S_maskbit ( _M_bpos ) ) == 0 ; }
  67426.  
  67427.  
  67428. operator bool ( ) const noexcept
  67429. { return ( * ( _M_wp ) & _Base :: _S_maskbit ( _M_bpos ) ) != 0 ; }
  67430.  
  67431.  
  67432. reference &
  67433. flip ( ) noexcept
  67434. {
  67435. * _M_wp ^= _Base :: _S_maskbit ( _M_bpos ) ;
  67436. return * this ;
  67437. }
  67438. } ;
  67439. friend class reference ;
  67440.  
  67441.  
  67442.  
  67443. constexpr bitset ( ) noexcept
  67444. { }
  67445.  
  67446.  
  67447.  
  67448. constexpr bitset ( unsigned long long __val ) noexcept
  67449. : _Base ( _Sanitize_val < _Nb > :: _S_do_sanitize_val ( __val ) ) { }
  67450. #864
  67451. template < class _CharT , class _Traits , class _Alloc >
  67452. explicit
  67453. bitset ( const std :: basic_string < _CharT , _Traits , _Alloc > & __s ,
  67454. size_t __position = 0 )
  67455. : _Base ( )
  67456. {
  67457. if ( __position > __s . size ( ) )
  67458. __throw_out_of_range (
  67459. ( "bitset::bitset initial position " "not valid" ) ) ;
  67460. _M_copy_from_string ( __s , __position ,
  67461. std :: basic_string < _CharT , _Traits , _Alloc > :: npos ,
  67462. _CharT ( '0' ) , _CharT ( '1' ) ) ;
  67463. }
  67464. #888
  67465. template < class _CharT , class _Traits , class _Alloc >
  67466. bitset ( const std :: basic_string < _CharT , _Traits , _Alloc > & __s ,
  67467. size_t __position , size_t __n )
  67468. : _Base ( )
  67469. {
  67470. if ( __position > __s . size ( ) )
  67471. __throw_out_of_range (
  67472. ( "bitset::bitset initial position " "not valid" ) ) ;
  67473. _M_copy_from_string ( __s , __position , __n , _CharT ( '0' ) , _CharT ( '1' ) ) ;
  67474. }
  67475.  
  67476.  
  67477.  
  67478. template < class _CharT , class _Traits , class _Alloc >
  67479. bitset ( const std :: basic_string < _CharT , _Traits , _Alloc > & __s ,
  67480. size_t __position , size_t __n ,
  67481. _CharT __zero , _CharT __one = _CharT ( '1' ) )
  67482. : _Base ( )
  67483. {
  67484. if ( __position > __s . size ( ) )
  67485. __throw_out_of_range (
  67486. ( "bitset::bitset initial position " "not valid" ) ) ;
  67487. _M_copy_from_string ( __s , __position , __n , __zero , __one ) ;
  67488. }
  67489. #923
  67490. template < typename _CharT >
  67491. explicit
  67492. bitset ( const _CharT * __str ,
  67493. typename std :: basic_string < _CharT > :: size_type __n
  67494. = std :: basic_string < _CharT > :: npos ,
  67495. _CharT __zero = _CharT ( '0' ) , _CharT __one = _CharT ( '1' ) )
  67496. : _Base ( )
  67497. {
  67498. if ( ! __str )
  67499. __throw_logic_error ( ( "bitset::bitset(const _CharT*, ...)" ) ) ;
  67500.  
  67501. if ( __n == std :: basic_string < _CharT > :: npos )
  67502. __n = std :: char_traits < _CharT > :: length ( __str ) ;
  67503. _M_copy_from_ptr < _CharT , std :: char_traits < _CharT >> ( __str , __n , 0 ,
  67504. __n , __zero ,
  67505. __one ) ;
  67506. }
  67507. #950
  67508. bitset < _Nb > &
  67509. operator &= ( const bitset < _Nb > & __rhs ) noexcept
  67510. {
  67511. this -> _M_do_and ( __rhs ) ;
  67512. return * this ;
  67513. }
  67514.  
  67515. bitset < _Nb > &
  67516. operator |= ( const bitset < _Nb > & __rhs ) noexcept
  67517. {
  67518. this -> _M_do_or ( __rhs ) ;
  67519. return * this ;
  67520. }
  67521.  
  67522. bitset < _Nb > &
  67523. operator ^= ( const bitset < _Nb > & __rhs ) noexcept
  67524. {
  67525. this -> _M_do_xor ( __rhs ) ;
  67526. return * this ;
  67527. }
  67528. #979
  67529. bitset < _Nb > &
  67530. operator <<= ( size_t __position ) noexcept
  67531. {
  67532. if ( __position < _Nb )
  67533. {
  67534. this -> _M_do_left_shift ( __position ) ;
  67535. this -> _M_do_sanitize ( ) ;
  67536. }
  67537. else
  67538. this -> _M_do_reset ( ) ;
  67539. return * this ;
  67540. }
  67541.  
  67542. bitset < _Nb > &
  67543. operator >>= ( size_t __position ) noexcept
  67544. {
  67545. if ( __position < _Nb )
  67546. {
  67547. this -> _M_do_right_shift ( __position ) ;
  67548. this -> _M_do_sanitize ( ) ;
  67549. }
  67550. else
  67551. this -> _M_do_reset ( ) ;
  67552. return * this ;
  67553. }
  67554. #1012
  67555. bitset < _Nb > &
  67556. _Unchecked_set ( size_t __pos ) noexcept
  67557. {
  67558. this -> _M_getword ( __pos ) |= _Base :: _S_maskbit ( __pos ) ;
  67559. return * this ;
  67560. }
  67561.  
  67562. bitset < _Nb > &
  67563. _Unchecked_set ( size_t __pos , int __val ) noexcept
  67564. {
  67565. if ( __val )
  67566. this -> _M_getword ( __pos ) |= _Base :: _S_maskbit ( __pos ) ;
  67567. else
  67568. this -> _M_getword ( __pos ) &= ~ _Base :: _S_maskbit ( __pos ) ;
  67569. return * this ;
  67570. }
  67571.  
  67572. bitset < _Nb > &
  67573. _Unchecked_reset ( size_t __pos ) noexcept
  67574. {
  67575. this -> _M_getword ( __pos ) &= ~ _Base :: _S_maskbit ( __pos ) ;
  67576. return * this ;
  67577. }
  67578.  
  67579. bitset < _Nb > &
  67580. _Unchecked_flip ( size_t __pos ) noexcept
  67581. {
  67582. this -> _M_getword ( __pos ) ^= _Base :: _S_maskbit ( __pos ) ;
  67583. return * this ;
  67584. }
  67585.  
  67586. constexpr bool
  67587. _Unchecked_test ( size_t __pos ) const noexcept
  67588. { return ( ( this -> _M_getword ( __pos ) & _Base :: _S_maskbit ( __pos ) )
  67589. != static_cast < _WordT > ( 0 ) ) ; }
  67590. #1053
  67591. bitset < _Nb > &
  67592. set ( ) noexcept
  67593. {
  67594. this -> _M_do_set ( ) ;
  67595. this -> _M_do_sanitize ( ) ;
  67596. return * this ;
  67597. }
  67598. #1067
  67599. bitset < _Nb > &
  67600. set ( size_t __position , bool __val = true )
  67601. {
  67602. if ( __position >= _Nb )
  67603. __throw_out_of_range ( ( "bitset::set" ) ) ;
  67604. return _Unchecked_set ( __position , __val ) ;
  67605. }
  67606.  
  67607.  
  67608.  
  67609.  
  67610. bitset < _Nb > &
  67611. reset ( ) noexcept
  67612. {
  67613. this -> _M_do_reset ( ) ;
  67614. return * this ;
  67615. }
  67616. #1092
  67617. bitset < _Nb > &
  67618. reset ( size_t __position )
  67619. {
  67620. if ( __position >= _Nb )
  67621. __throw_out_of_range ( ( "bitset::reset" ) ) ;
  67622. return _Unchecked_reset ( __position ) ;
  67623. }
  67624.  
  67625.  
  67626.  
  67627.  
  67628. bitset < _Nb > &
  67629. flip ( ) noexcept
  67630. {
  67631. this -> _M_do_flip ( ) ;
  67632. this -> _M_do_sanitize ( ) ;
  67633. return * this ;
  67634. }
  67635. #1116
  67636. bitset < _Nb > &
  67637. flip ( size_t __position )
  67638. {
  67639. if ( __position >= _Nb )
  67640. __throw_out_of_range ( ( "bitset::flip" ) ) ;
  67641. return _Unchecked_flip ( __position ) ;
  67642. }
  67643.  
  67644.  
  67645. bitset < _Nb >
  67646. operator ~ ( ) const noexcept
  67647. { return bitset < _Nb > ( * this ) . flip ( ) ; }
  67648. #1144
  67649. reference
  67650. operator [ ] ( size_t __position )
  67651. { return reference ( * this , __position ) ; }
  67652.  
  67653. constexpr bool
  67654. operator [ ] ( size_t __position ) const
  67655. { return _Unchecked_test ( __position ) ; }
  67656. #1159
  67657. unsigned long
  67658. to_ulong ( ) const
  67659. { return this -> _M_do_to_ulong ( ) ; }
  67660.  
  67661.  
  67662. unsigned long long
  67663. to_ullong ( ) const
  67664. { return this -> _M_do_to_ullong ( ) ; }
  67665. #1177
  67666. template < class _CharT , class _Traits , class _Alloc >
  67667. std :: basic_string < _CharT , _Traits , _Alloc >
  67668. to_string ( ) const
  67669. {
  67670. std :: basic_string < _CharT , _Traits , _Alloc > __result ;
  67671. _M_copy_to_string ( __result , _CharT ( '0' ) , _CharT ( '1' ) ) ;
  67672. return __result ;
  67673. }
  67674.  
  67675.  
  67676.  
  67677. template < class _CharT , class _Traits , class _Alloc >
  67678. std :: basic_string < _CharT , _Traits , _Alloc >
  67679. to_string ( _CharT __zero , _CharT __one = _CharT ( '1' ) ) const
  67680. {
  67681. std :: basic_string < _CharT , _Traits , _Alloc > __result ;
  67682. _M_copy_to_string ( __result , __zero , __one ) ;
  67683. return __result ;
  67684. }
  67685.  
  67686.  
  67687.  
  67688. template < class _CharT , class _Traits >
  67689. std :: basic_string < _CharT , _Traits , std :: allocator < _CharT > >
  67690. to_string ( ) const
  67691. { return to_string < _CharT , _Traits , std :: allocator < _CharT > > ( ) ; }
  67692.  
  67693.  
  67694.  
  67695. template < class _CharT , class _Traits >
  67696. std :: basic_string < _CharT , _Traits , std :: allocator < _CharT > >
  67697. to_string ( _CharT __zero , _CharT __one = _CharT ( '1' ) ) const
  67698. { return to_string < _CharT , _Traits ,
  67699. std :: allocator < _CharT > > ( __zero , __one ) ; }
  67700.  
  67701. template < class _CharT >
  67702. std :: basic_string < _CharT , std :: char_traits < _CharT > ,
  67703. std :: allocator < _CharT > >
  67704. to_string ( ) const
  67705. {
  67706. return to_string < _CharT , std :: char_traits < _CharT > ,
  67707. std :: allocator < _CharT > > ( ) ;
  67708. }
  67709.  
  67710. template < class _CharT >
  67711. std :: basic_string < _CharT , std :: char_traits < _CharT > ,
  67712. std :: allocator < _CharT > >
  67713. to_string ( _CharT __zero , _CharT __one = _CharT ( '1' ) ) const
  67714. {
  67715. return to_string < _CharT , std :: char_traits < _CharT > ,
  67716. std :: allocator < _CharT > > ( __zero , __one ) ;
  67717. }
  67718.  
  67719. std :: basic_string < char , std :: char_traits < char > , std :: allocator < char > >
  67720. to_string ( ) const
  67721. {
  67722. return to_string < char , std :: char_traits < char > ,
  67723. std :: allocator < char > > ( ) ;
  67724. }
  67725.  
  67726. std :: basic_string < char , std :: char_traits < char > , std :: allocator < char > >
  67727. to_string ( char __zero , char __one = '1' ) const
  67728. {
  67729. return to_string < char , std :: char_traits < char > ,
  67730. std :: allocator < char > > ( __zero , __one ) ;
  67731. }
  67732.  
  67733.  
  67734. template < class _CharT , class _Traits >
  67735. void
  67736. _M_copy_from_ptr ( const _CharT * , size_t , size_t , size_t ,
  67737. _CharT , _CharT ) ;
  67738.  
  67739. template < class _CharT , class _Traits , class _Alloc >
  67740. void
  67741. _M_copy_from_string ( const std :: basic_string < _CharT ,
  67742. _Traits , _Alloc > & __s , size_t __pos , size_t __n ,
  67743. _CharT __zero , _CharT __one )
  67744. { _M_copy_from_ptr < _CharT , _Traits > ( __s . data ( ) , __s . size ( ) , __pos , __n ,
  67745. __zero , __one ) ; }
  67746.  
  67747. template < class _CharT , class _Traits , class _Alloc >
  67748. void
  67749. _M_copy_to_string ( std :: basic_string < _CharT , _Traits , _Alloc > & ,
  67750. _CharT , _CharT ) const ;
  67751.  
  67752.  
  67753. template < class _CharT , class _Traits , class _Alloc >
  67754. void
  67755. _M_copy_from_string ( const std :: basic_string < _CharT ,
  67756. _Traits , _Alloc > & __s , size_t __pos , size_t __n )
  67757. { _M_copy_from_string ( __s , __pos , __n , _CharT ( '0' ) , _CharT ( '1' ) ) ; }
  67758.  
  67759. template < class _CharT , class _Traits , class _Alloc >
  67760. void
  67761. _M_copy_to_string ( std :: basic_string < _CharT , _Traits , _Alloc > & __s ) const
  67762. { _M_copy_to_string ( __s , _CharT ( '0' ) , _CharT ( '1' ) ) ; }
  67763.  
  67764.  
  67765. size_t
  67766. count ( ) const noexcept
  67767. { return this -> _M_do_count ( ) ; }
  67768.  
  67769.  
  67770. constexpr size_t
  67771. size ( ) const noexcept
  67772. { return _Nb ; }
  67773.  
  67774.  
  67775.  
  67776. bool
  67777. operator == ( const bitset < _Nb > & __rhs ) const noexcept
  67778. { return this -> _M_is_equal ( __rhs ) ; }
  67779.  
  67780. bool
  67781. operator != ( const bitset < _Nb > & __rhs ) const noexcept
  67782. { return ! this -> _M_is_equal ( __rhs ) ; }
  67783. #1302
  67784. bool
  67785. test ( size_t __position ) const
  67786. {
  67787. if ( __position >= _Nb )
  67788. __throw_out_of_range ( ( "bitset::test" ) ) ;
  67789. return _Unchecked_test ( __position ) ;
  67790. }
  67791. #1316
  67792. bool
  67793. all ( ) const noexcept
  67794. { return this -> template _M_are_all < _Nb > ( ) ; }
  67795.  
  67796.  
  67797.  
  67798.  
  67799.  
  67800. bool
  67801. any ( ) const noexcept
  67802. { return this -> _M_is_any ( ) ; }
  67803.  
  67804.  
  67805.  
  67806.  
  67807.  
  67808. bool
  67809. none ( ) const noexcept
  67810. { return ! this -> _M_is_any ( ) ; }
  67811.  
  67812.  
  67813.  
  67814. bitset < _Nb >
  67815. operator << ( size_t __position ) const noexcept
  67816. { return bitset < _Nb > ( * this ) <<= __position ; }
  67817.  
  67818. bitset < _Nb >
  67819. operator >> ( size_t __position ) const noexcept
  67820. { return bitset < _Nb > ( * this ) >>= __position ; }
  67821. #1353
  67822. size_t
  67823. _Find_first ( ) const noexcept
  67824. { return this -> _M_do_find_first ( _Nb ) ; }
  67825. #1364
  67826. size_t
  67827. _Find_next ( size_t __prev ) const noexcept
  67828. { return this -> _M_do_find_next ( __prev , _Nb ) ; }
  67829. } ;
  67830.  
  67831.  
  67832. template < size_t _Nb >
  67833. template < class _CharT , class _Traits >
  67834. void
  67835. bitset < _Nb > ::
  67836. _M_copy_from_ptr ( const _CharT * __s , size_t __len ,
  67837. size_t __pos , size_t __n , _CharT __zero , _CharT __one )
  67838. {
  67839. reset ( ) ;
  67840. const size_t __nbits = std :: min ( _Nb , std :: min ( __n , size_t ( __len - __pos ) ) ) ;
  67841. for ( size_t __i = __nbits ; __i > 0 ; -- __i )
  67842. {
  67843. const _CharT __c = __s [ __pos + __nbits - __i ] ;
  67844. if ( _Traits :: eq ( __c , __zero ) )
  67845. ;
  67846. else if ( _Traits :: eq ( __c , __one ) )
  67847. _Unchecked_set ( __i - 1 ) ;
  67848. else
  67849. __throw_invalid_argument ( ( "bitset::_M_copy_from_ptr" ) ) ;
  67850. }
  67851. }
  67852.  
  67853. template < size_t _Nb >
  67854. template < class _CharT , class _Traits , class _Alloc >
  67855. void
  67856. bitset < _Nb > ::
  67857. _M_copy_to_string ( std :: basic_string < _CharT , _Traits , _Alloc > & __s ,
  67858. _CharT __zero , _CharT __one ) const
  67859. {
  67860. __s . assign ( _Nb , __zero ) ;
  67861. for ( size_t __i = _Nb ; __i > 0 ; -- __i )
  67862. if ( _Unchecked_test ( __i - 1 ) )
  67863. _Traits :: assign ( __s [ _Nb - __i ] , __one ) ;
  67864. }
  67865. #1414
  67866. template < size_t _Nb >
  67867. inline bitset < _Nb >
  67868. operator & ( const bitset < _Nb > & __x , const bitset < _Nb > & __y ) noexcept
  67869. {
  67870. bitset < _Nb > __result ( __x ) ;
  67871. __result &= __y ;
  67872. return __result ;
  67873. }
  67874.  
  67875. template < size_t _Nb >
  67876. inline bitset < _Nb >
  67877. operator | ( const bitset < _Nb > & __x , const bitset < _Nb > & __y ) noexcept
  67878. {
  67879. bitset < _Nb > __result ( __x ) ;
  67880. __result |= __y ;
  67881. return __result ;
  67882. }
  67883.  
  67884. template < size_t _Nb >
  67885. inline bitset < _Nb >
  67886. operator ^ ( const bitset < _Nb > & __x , const bitset < _Nb > & __y ) noexcept
  67887. {
  67888. bitset < _Nb > __result ( __x ) ;
  67889. __result ^= __y ;
  67890. return __result ;
  67891. }
  67892. #1451
  67893. template < class _CharT , class _Traits , size_t _Nb >
  67894. std :: basic_istream < _CharT , _Traits > &
  67895. operator >> ( std :: basic_istream < _CharT , _Traits > & __is , bitset < _Nb > & __x )
  67896. {
  67897. typedef typename _Traits :: char_type char_type ;
  67898. typedef std :: basic_istream < _CharT , _Traits > __istream_type ;
  67899. typedef typename __istream_type :: ios_base __ios_base ;
  67900.  
  67901. std :: basic_string < _CharT , _Traits > __tmp ;
  67902. __tmp . reserve ( _Nb ) ;
  67903.  
  67904.  
  67905.  
  67906. const char_type __zero = __is . widen ( '0' ) ;
  67907. const char_type __one = __is . widen ( '1' ) ;
  67908.  
  67909. typename __ios_base :: iostate __state = __ios_base :: goodbit ;
  67910. typename __istream_type :: sentry __sentry ( __is ) ;
  67911. if ( __sentry )
  67912. {
  67913. try
  67914. {
  67915. for ( size_t __i = _Nb ; __i > 0 ; -- __i )
  67916. {
  67917. static typename _Traits :: int_type __eof = _Traits :: eof ( ) ;
  67918.  
  67919. typename _Traits :: int_type __c1 = __is . rdbuf ( ) -> sbumpc ( ) ;
  67920. if ( _Traits :: eq_int_type ( __c1 , __eof ) )
  67921. {
  67922. __state |= __ios_base :: eofbit ;
  67923. break ;
  67924. }
  67925. else
  67926. {
  67927. const char_type __c2 = _Traits :: to_char_type ( __c1 ) ;
  67928. if ( _Traits :: eq ( __c2 , __zero ) )
  67929. __tmp . push_back ( __zero ) ;
  67930. else if ( _Traits :: eq ( __c2 , __one ) )
  67931. __tmp . push_back ( __one ) ;
  67932. else if ( _Traits ::
  67933. eq_int_type ( __is . rdbuf ( ) -> sputbackc ( __c2 ) ,
  67934. __eof ) )
  67935. {
  67936. __state |= __ios_base :: failbit ;
  67937. break ;
  67938. }
  67939. }
  67940. }
  67941. }
  67942. catch ( __cxxabiv1 :: __forced_unwind & )
  67943. {
  67944. __is . _M_setstate ( __ios_base :: badbit ) ;
  67945. throw ;
  67946. }
  67947. catch ( ... )
  67948. { __is . _M_setstate ( __ios_base :: badbit ) ; }
  67949. }
  67950.  
  67951. if ( __tmp . empty ( ) && _Nb )
  67952. __state |= __ios_base :: failbit ;
  67953. else
  67954. __x . _M_copy_from_string ( __tmp , static_cast < size_t > ( 0 ) , _Nb ,
  67955. __zero , __one ) ;
  67956. if ( __state )
  67957. __is . setstate ( __state ) ;
  67958. return __is ;
  67959. }
  67960.  
  67961. template < class _CharT , class _Traits , size_t _Nb >
  67962. std :: basic_ostream < _CharT , _Traits > &
  67963. operator << ( std :: basic_ostream < _CharT , _Traits > & __os ,
  67964. const bitset < _Nb > & __x )
  67965. {
  67966. std :: basic_string < _CharT , _Traits > __tmp ;
  67967.  
  67968.  
  67969.  
  67970. const ctype < _CharT > & __ct = use_facet < ctype < _CharT > > ( __os . getloc ( ) ) ;
  67971. __x . _M_copy_to_string ( __tmp , __ct . widen ( '0' ) , __ct . widen ( '1' ) ) ;
  67972. return __os << __tmp ;
  67973. }
  67974.  
  67975.  
  67976.  
  67977. }
  67978. #1545
  67979. namespace std
  67980. {
  67981.  
  67982.  
  67983.  
  67984.  
  67985. template < size_t _Nb >
  67986. struct hash < std :: bitset < _Nb >>
  67987. : public __hash_base < size_t , std :: bitset < _Nb >>
  67988. {
  67989. size_t
  67990. operator ( ) ( const std :: bitset < _Nb > & __b ) const noexcept
  67991. {
  67992. const size_t __clength = ( _Nb + 8 - 1 ) / 8 ;
  67993. return std :: _Hash_impl :: hash ( __b . _M_getdata ( ) , __clength ) ;
  67994. }
  67995. } ;
  67996.  
  67997. template < >
  67998. struct hash < std :: bitset < 0 >>
  67999. : public __hash_base < size_t , std :: bitset < 0 >>
  68000. {
  68001. size_t
  68002. operator ( ) ( const std :: bitset < 0 > & ) const noexcept
  68003. { return 0 ; }
  68004. } ;
  68005.  
  68006.  
  68007. }
  68008. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/complex"
  68009. #39
  68010. #pragma GCC system_header
  68011. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/sstream"
  68012. #36
  68013. #pragma GCC system_header
  68014. #41
  68015. namespace std
  68016. {
  68017. #63
  68018. template < typename _CharT , typename _Traits , typename _Alloc >
  68019. class basic_stringbuf : public basic_streambuf < _CharT , _Traits >
  68020. {
  68021. public :
  68022.  
  68023. typedef _CharT char_type ;
  68024. typedef _Traits traits_type ;
  68025.  
  68026.  
  68027. typedef _Alloc allocator_type ;
  68028. typedef typename traits_type :: int_type int_type ;
  68029. typedef typename traits_type :: pos_type pos_type ;
  68030. typedef typename traits_type :: off_type off_type ;
  68031.  
  68032. typedef basic_streambuf < char_type , traits_type > __streambuf_type ;
  68033. typedef basic_string < char_type , _Traits , _Alloc > __string_type ;
  68034. typedef typename __string_type :: size_type __size_type ;
  68035.  
  68036. protected :
  68037.  
  68038. ios_base :: openmode _M_mode ;
  68039.  
  68040.  
  68041. __string_type _M_string ;
  68042.  
  68043. public :
  68044. #97
  68045. explicit
  68046. basic_stringbuf ( ios_base :: openmode __mode = ios_base :: in | ios_base :: out )
  68047. : __streambuf_type ( ) , _M_mode ( __mode ) , _M_string ( )
  68048. { }
  68049. #110
  68050. explicit
  68051. basic_stringbuf ( const __string_type & __str ,
  68052. ios_base :: openmode __mode = ios_base :: in | ios_base :: out )
  68053. : __streambuf_type ( ) , _M_mode ( ) , _M_string ( __str . data ( ) , __str . size ( ) )
  68054. { _M_stringbuf_init ( __mode ) ; }
  68055. #125
  68056. __string_type
  68057. str ( ) const
  68058. {
  68059. __string_type __ret ;
  68060. if ( this -> pptr ( ) )
  68061. {
  68062.  
  68063. if ( this -> pptr ( ) > this -> egptr ( ) )
  68064. __ret = __string_type ( this -> pbase ( ) , this -> pptr ( ) ) ;
  68065. else
  68066. __ret = __string_type ( this -> pbase ( ) , this -> egptr ( ) ) ;
  68067. }
  68068. else
  68069. __ret = _M_string ;
  68070. return __ret ;
  68071. }
  68072. #149
  68073. void
  68074. str ( const __string_type & __s )
  68075. {
  68076.  
  68077. _M_string . assign ( __s . data ( ) , __s . size ( ) ) ;
  68078. _M_stringbuf_init ( _M_mode ) ;
  68079. }
  68080.  
  68081. protected :
  68082.  
  68083. void
  68084. _M_stringbuf_init ( ios_base :: openmode __mode )
  68085. {
  68086. _M_mode = __mode ;
  68087. __size_type __len = 0 ;
  68088. if ( _M_mode & ( ios_base :: ate | ios_base :: app ) )
  68089. __len = _M_string . size ( ) ;
  68090. _M_sync ( const_cast < char_type * > ( _M_string . data ( ) ) , 0 , __len ) ;
  68091. }
  68092.  
  68093. virtual streamsize
  68094. showmanyc ( )
  68095. {
  68096. streamsize __ret = - 1 ;
  68097. if ( _M_mode & ios_base :: in )
  68098. {
  68099. _M_update_egptr ( ) ;
  68100. __ret = this -> egptr ( ) - this -> gptr ( ) ;
  68101. }
  68102. return __ret ;
  68103. }
  68104.  
  68105. virtual int_type
  68106. underflow ( ) ;
  68107.  
  68108. virtual int_type
  68109. pbackfail ( int_type __c = traits_type :: eof ( ) ) ;
  68110.  
  68111. virtual int_type
  68112. overflow ( int_type __c = traits_type :: eof ( ) ) ;
  68113. #201
  68114. virtual __streambuf_type *
  68115. setbuf ( char_type * __s , streamsize __n )
  68116. {
  68117. if ( __s && __n >= 0 )
  68118. {
  68119. #212
  68120. _M_string . clear ( ) ;
  68121.  
  68122.  
  68123. _M_sync ( __s , __n , 0 ) ;
  68124. }
  68125. return this ;
  68126. }
  68127.  
  68128. virtual pos_type
  68129. seekoff ( off_type __off , ios_base :: seekdir __way ,
  68130. ios_base :: openmode __mode = ios_base :: in | ios_base :: out ) ;
  68131.  
  68132. virtual pos_type
  68133. seekpos ( pos_type __sp ,
  68134. ios_base :: openmode __mode = ios_base :: in | ios_base :: out ) ;
  68135.  
  68136.  
  68137.  
  68138.  
  68139. void
  68140. _M_sync ( char_type * __base , __size_type __i , __size_type __o ) ;
  68141.  
  68142.  
  68143.  
  68144. void
  68145. _M_update_egptr ( )
  68146. {
  68147. const bool __testin = _M_mode & ios_base :: in ;
  68148. if ( this -> pptr ( ) && this -> pptr ( ) > this -> egptr ( ) )
  68149. {
  68150. if ( __testin )
  68151. this -> setg ( this -> eback ( ) , this -> gptr ( ) , this -> pptr ( ) ) ;
  68152. else
  68153. this -> setg ( this -> pptr ( ) , this -> pptr ( ) , this -> pptr ( ) ) ;
  68154. }
  68155. }
  68156.  
  68157.  
  68158.  
  68159. void
  68160. _M_pbump ( char_type * __pbeg , char_type * __pend , off_type __off ) ;
  68161. } ;
  68162. #271
  68163. template < typename _CharT , typename _Traits , typename _Alloc >
  68164. class basic_istringstream : public basic_istream < _CharT , _Traits >
  68165. {
  68166. public :
  68167.  
  68168. typedef _CharT char_type ;
  68169. typedef _Traits traits_type ;
  68170.  
  68171.  
  68172. typedef _Alloc allocator_type ;
  68173. typedef typename traits_type :: int_type int_type ;
  68174. typedef typename traits_type :: pos_type pos_type ;
  68175. typedef typename traits_type :: off_type off_type ;
  68176.  
  68177.  
  68178. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  68179. typedef basic_stringbuf < _CharT , _Traits , _Alloc > __stringbuf_type ;
  68180. typedef basic_istream < char_type , traits_type > __istream_type ;
  68181.  
  68182. private :
  68183. __stringbuf_type _M_stringbuf ;
  68184.  
  68185. public :
  68186. #307
  68187. explicit
  68188. basic_istringstream ( ios_base :: openmode __mode = ios_base :: in )
  68189. : __istream_type ( ) , _M_stringbuf ( __mode | ios_base :: in )
  68190. { this -> init ( & _M_stringbuf ) ; }
  68191. #325
  68192. explicit
  68193. basic_istringstream ( const __string_type & __str ,
  68194. ios_base :: openmode __mode = ios_base :: in )
  68195. : __istream_type ( ) , _M_stringbuf ( __str , __mode | ios_base :: in )
  68196. { this -> init ( & _M_stringbuf ) ; }
  68197. #337
  68198. ~ basic_istringstream ( )
  68199. { }
  68200. #347
  68201. __stringbuf_type *
  68202. rdbuf ( ) const
  68203. { return const_cast < __stringbuf_type * > ( & _M_stringbuf ) ; }
  68204.  
  68205.  
  68206.  
  68207.  
  68208.  
  68209. __string_type
  68210. str ( ) const
  68211. { return _M_stringbuf . str ( ) ; }
  68212. #365
  68213. void
  68214. str ( const __string_type & __s )
  68215. { _M_stringbuf . str ( __s ) ; }
  68216. } ;
  68217. #386
  68218. template < typename _CharT , typename _Traits , typename _Alloc >
  68219. class basic_ostringstream : public basic_ostream < _CharT , _Traits >
  68220. {
  68221. public :
  68222.  
  68223. typedef _CharT char_type ;
  68224. typedef _Traits traits_type ;
  68225.  
  68226.  
  68227. typedef _Alloc allocator_type ;
  68228. typedef typename traits_type :: int_type int_type ;
  68229. typedef typename traits_type :: pos_type pos_type ;
  68230. typedef typename traits_type :: off_type off_type ;
  68231.  
  68232.  
  68233. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  68234. typedef basic_stringbuf < _CharT , _Traits , _Alloc > __stringbuf_type ;
  68235. typedef basic_ostream < char_type , traits_type > __ostream_type ;
  68236.  
  68237. private :
  68238. __stringbuf_type _M_stringbuf ;
  68239.  
  68240. public :
  68241. #422
  68242. explicit
  68243. basic_ostringstream ( ios_base :: openmode __mode = ios_base :: out )
  68244. : __ostream_type ( ) , _M_stringbuf ( __mode | ios_base :: out )
  68245. { this -> init ( & _M_stringbuf ) ; }
  68246. #440
  68247. explicit
  68248. basic_ostringstream ( const __string_type & __str ,
  68249. ios_base :: openmode __mode = ios_base :: out )
  68250. : __ostream_type ( ) , _M_stringbuf ( __str , __mode | ios_base :: out )
  68251. { this -> init ( & _M_stringbuf ) ; }
  68252. #452
  68253. ~ basic_ostringstream ( )
  68254. { }
  68255. #462
  68256. __stringbuf_type *
  68257. rdbuf ( ) const
  68258. { return const_cast < __stringbuf_type * > ( & _M_stringbuf ) ; }
  68259.  
  68260.  
  68261.  
  68262.  
  68263.  
  68264. __string_type
  68265. str ( ) const
  68266. { return _M_stringbuf . str ( ) ; }
  68267. #480
  68268. void
  68269. str ( const __string_type & __s )
  68270. { _M_stringbuf . str ( __s ) ; }
  68271. } ;
  68272. #501
  68273. template < typename _CharT , typename _Traits , typename _Alloc >
  68274. class basic_stringstream : public basic_iostream < _CharT , _Traits >
  68275. {
  68276. public :
  68277.  
  68278. typedef _CharT char_type ;
  68279. typedef _Traits traits_type ;
  68280.  
  68281.  
  68282. typedef _Alloc allocator_type ;
  68283. typedef typename traits_type :: int_type int_type ;
  68284. typedef typename traits_type :: pos_type pos_type ;
  68285. typedef typename traits_type :: off_type off_type ;
  68286.  
  68287.  
  68288. typedef basic_string < _CharT , _Traits , _Alloc > __string_type ;
  68289. typedef basic_stringbuf < _CharT , _Traits , _Alloc > __stringbuf_type ;
  68290. typedef basic_iostream < char_type , traits_type > __iostream_type ;
  68291.  
  68292. private :
  68293. __stringbuf_type _M_stringbuf ;
  68294.  
  68295. public :
  68296. #536
  68297. explicit
  68298. basic_stringstream ( ios_base :: openmode __m = ios_base :: out | ios_base :: in )
  68299. : __iostream_type ( ) , _M_stringbuf ( __m )
  68300. { this -> init ( & _M_stringbuf ) ; }
  68301. #552
  68302. explicit
  68303. basic_stringstream ( const __string_type & __str ,
  68304. ios_base :: openmode __m = ios_base :: out | ios_base :: in )
  68305. : __iostream_type ( ) , _M_stringbuf ( __str , __m )
  68306. { this -> init ( & _M_stringbuf ) ; }
  68307. #564
  68308. ~ basic_stringstream ( )
  68309. { }
  68310. #574
  68311. __stringbuf_type *
  68312. rdbuf ( ) const
  68313. { return const_cast < __stringbuf_type * > ( & _M_stringbuf ) ; }
  68314.  
  68315.  
  68316.  
  68317.  
  68318.  
  68319. __string_type
  68320. str ( ) const
  68321. { return _M_stringbuf . str ( ) ; }
  68322. #592
  68323. void
  68324. str ( const __string_type & __s )
  68325. { _M_stringbuf . str ( __s ) ; }
  68326. } ;
  68327.  
  68328.  
  68329. }
  68330. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/bits/sstream.tcc"
  68331. #37
  68332. #pragma GCC system_header
  68333.  
  68334. namespace std
  68335. {
  68336.  
  68337.  
  68338. template < class _CharT , class _Traits , class _Alloc >
  68339. typename basic_stringbuf < _CharT , _Traits , _Alloc > :: int_type
  68340. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68341. pbackfail ( int_type __c )
  68342. {
  68343. int_type __ret = traits_type :: eof ( ) ;
  68344. if ( this -> eback ( ) < this -> gptr ( ) )
  68345. {
  68346.  
  68347.  
  68348. const bool __testeof = traits_type :: eq_int_type ( __c , __ret ) ;
  68349. if ( ! __testeof )
  68350. {
  68351. const bool __testeq = traits_type :: eq ( traits_type ::
  68352. to_char_type ( __c ) ,
  68353. this -> gptr ( ) [ - 1 ] ) ;
  68354. const bool __testout = this -> _M_mode & ios_base :: out ;
  68355. if ( __testeq || __testout )
  68356. {
  68357. this -> gbump ( - 1 ) ;
  68358. if ( ! __testeq )
  68359. * this -> gptr ( ) = traits_type :: to_char_type ( __c ) ;
  68360. __ret = __c ;
  68361. }
  68362. }
  68363. else
  68364. {
  68365. this -> gbump ( - 1 ) ;
  68366. __ret = traits_type :: not_eof ( __c ) ;
  68367. }
  68368. }
  68369. return __ret ;
  68370. }
  68371.  
  68372. template < class _CharT , class _Traits , class _Alloc >
  68373. typename basic_stringbuf < _CharT , _Traits , _Alloc > :: int_type
  68374. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68375. overflow ( int_type __c )
  68376. {
  68377. const bool __testout = this -> _M_mode & ios_base :: out ;
  68378. if ( ! __testout )
  68379. return traits_type :: eof ( ) ;
  68380.  
  68381. const bool __testeof = traits_type :: eq_int_type ( __c , traits_type :: eof ( ) ) ;
  68382. if ( __testeof )
  68383. return traits_type :: not_eof ( __c ) ;
  68384.  
  68385. const __size_type __capacity = _M_string . capacity ( ) ;
  68386. const __size_type __max_size = _M_string . max_size ( ) ;
  68387. const bool __testput = this -> pptr ( ) < this -> epptr ( ) ;
  68388. if ( ! __testput && __capacity == __max_size )
  68389. return traits_type :: eof ( ) ;
  68390.  
  68391.  
  68392.  
  68393. const char_type __conv = traits_type :: to_char_type ( __c ) ;
  68394. if ( ! __testput )
  68395. {
  68396. #110
  68397. const __size_type __opt_len = std :: max ( __size_type ( 2 * __capacity ) ,
  68398. __size_type ( 512 ) ) ;
  68399. const __size_type __len = std :: min ( __opt_len , __max_size ) ;
  68400. __string_type __tmp ;
  68401. __tmp . reserve ( __len ) ;
  68402. if ( this -> pbase ( ) )
  68403. __tmp . assign ( this -> pbase ( ) , this -> epptr ( ) - this -> pbase ( ) ) ;
  68404. __tmp . push_back ( __conv ) ;
  68405. _M_string . swap ( __tmp ) ;
  68406. _M_sync ( const_cast < char_type * > ( _M_string . data ( ) ) ,
  68407. this -> gptr ( ) - this -> eback ( ) , this -> pptr ( ) - this -> pbase ( ) ) ;
  68408. }
  68409. else
  68410. * this -> pptr ( ) = __conv ;
  68411. this -> pbump ( 1 ) ;
  68412. return __c ;
  68413. }
  68414.  
  68415. template < class _CharT , class _Traits , class _Alloc >
  68416. typename basic_stringbuf < _CharT , _Traits , _Alloc > :: int_type
  68417. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68418. underflow ( )
  68419. {
  68420. int_type __ret = traits_type :: eof ( ) ;
  68421. const bool __testin = this -> _M_mode & ios_base :: in ;
  68422. if ( __testin )
  68423. {
  68424.  
  68425. _M_update_egptr ( ) ;
  68426.  
  68427. if ( this -> gptr ( ) < this -> egptr ( ) )
  68428. __ret = traits_type :: to_int_type ( * this -> gptr ( ) ) ;
  68429. }
  68430. return __ret ;
  68431. }
  68432.  
  68433. template < class _CharT , class _Traits , class _Alloc >
  68434. typename basic_stringbuf < _CharT , _Traits , _Alloc > :: pos_type
  68435. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68436. seekoff ( off_type __off , ios_base :: seekdir __way , ios_base :: openmode __mode )
  68437. {
  68438. pos_type __ret = pos_type ( off_type ( - 1 ) ) ;
  68439. bool __testin = ( ios_base :: in & this -> _M_mode & __mode ) != 0 ;
  68440. bool __testout = ( ios_base :: out & this -> _M_mode & __mode ) != 0 ;
  68441. const bool __testboth = __testin && __testout && __way != ios_base :: cur ;
  68442. __testin &= ! ( __mode & ios_base :: out ) ;
  68443. __testout &= ! ( __mode & ios_base :: in ) ;
  68444.  
  68445.  
  68446.  
  68447. const char_type * __beg = __testin ? this -> eback ( ) : this -> pbase ( ) ;
  68448. if ( ( __beg || ! __off ) && ( __testin || __testout || __testboth ) )
  68449. {
  68450. _M_update_egptr ( ) ;
  68451.  
  68452. off_type __newoffi = __off ;
  68453. off_type __newoffo = __newoffi ;
  68454. if ( __way == ios_base :: cur )
  68455. {
  68456. __newoffi += this -> gptr ( ) - __beg ;
  68457. __newoffo += this -> pptr ( ) - __beg ;
  68458. }
  68459. else if ( __way == ios_base :: end )
  68460. __newoffo = __newoffi += this -> egptr ( ) - __beg ;
  68461.  
  68462. if ( ( __testin || __testboth )
  68463. && __newoffi >= 0
  68464. && this -> egptr ( ) - __beg >= __newoffi )
  68465. {
  68466. this -> setg ( this -> eback ( ) , this -> eback ( ) + __newoffi ,
  68467. this -> egptr ( ) ) ;
  68468. __ret = pos_type ( __newoffi ) ;
  68469. }
  68470. if ( ( __testout || __testboth )
  68471. && __newoffo >= 0
  68472. && this -> egptr ( ) - __beg >= __newoffo )
  68473. {
  68474. _M_pbump ( this -> pbase ( ) , this -> epptr ( ) , __newoffo ) ;
  68475. __ret = pos_type ( __newoffo ) ;
  68476. }
  68477. }
  68478. return __ret ;
  68479. }
  68480.  
  68481. template < class _CharT , class _Traits , class _Alloc >
  68482. typename basic_stringbuf < _CharT , _Traits , _Alloc > :: pos_type
  68483. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68484. seekpos ( pos_type __sp , ios_base :: openmode __mode )
  68485. {
  68486. pos_type __ret = pos_type ( off_type ( - 1 ) ) ;
  68487. const bool __testin = ( ios_base :: in & this -> _M_mode & __mode ) != 0 ;
  68488. const bool __testout = ( ios_base :: out & this -> _M_mode & __mode ) != 0 ;
  68489.  
  68490. const char_type * __beg = __testin ? this -> eback ( ) : this -> pbase ( ) ;
  68491. if ( ( __beg || ! off_type ( __sp ) ) && ( __testin || __testout ) )
  68492. {
  68493. _M_update_egptr ( ) ;
  68494.  
  68495. const off_type __pos ( __sp ) ;
  68496. const bool __testpos = ( 0 <= __pos
  68497. && __pos <= this -> egptr ( ) - __beg ) ;
  68498. if ( __testpos )
  68499. {
  68500. if ( __testin )
  68501. this -> setg ( this -> eback ( ) , this -> eback ( ) + __pos ,
  68502. this -> egptr ( ) ) ;
  68503. if ( __testout )
  68504. _M_pbump ( this -> pbase ( ) , this -> epptr ( ) , __pos ) ;
  68505. __ret = __sp ;
  68506. }
  68507. }
  68508. return __ret ;
  68509. }
  68510.  
  68511. template < class _CharT , class _Traits , class _Alloc >
  68512. void
  68513. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68514. _M_sync ( char_type * __base , __size_type __i , __size_type __o )
  68515. {
  68516. const bool __testin = _M_mode & ios_base :: in ;
  68517. const bool __testout = _M_mode & ios_base :: out ;
  68518. char_type * __endg = __base + _M_string . size ( ) ;
  68519. char_type * __endp = __base + _M_string . capacity ( ) ;
  68520.  
  68521. if ( __base != _M_string . data ( ) )
  68522. {
  68523.  
  68524. __endg += __i ;
  68525. __i = 0 ;
  68526. __endp = __endg ;
  68527. }
  68528.  
  68529. if ( __testin )
  68530. this -> setg ( __base , __base + __i , __endg ) ;
  68531. if ( __testout )
  68532. {
  68533. _M_pbump ( __base , __endp , __o ) ;
  68534.  
  68535.  
  68536.  
  68537. if ( ! __testin )
  68538. this -> setg ( __endg , __endg , __endg ) ;
  68539. }
  68540. }
  68541.  
  68542. template < class _CharT , class _Traits , class _Alloc >
  68543. void
  68544. basic_stringbuf < _CharT , _Traits , _Alloc > ::
  68545. _M_pbump ( char_type * __pbeg , char_type * __pend , off_type __off )
  68546. {
  68547. this -> setp ( __pbeg , __pend ) ;
  68548. while ( __off > __gnu_cxx :: __numeric_traits < int > :: __max )
  68549. {
  68550. this -> pbump ( __gnu_cxx :: __numeric_traits < int > :: __max ) ;
  68551. __off -= __gnu_cxx :: __numeric_traits < int > :: __max ;
  68552. }
  68553. this -> pbump ( __off ) ;
  68554. }
  68555.  
  68556.  
  68557.  
  68558.  
  68559. extern template class basic_stringbuf < char > ;
  68560. extern template class basic_istringstream < char > ;
  68561. extern template class basic_ostringstream < char > ;
  68562. extern template class basic_stringstream < char > ;
  68563.  
  68564.  
  68565. extern template class basic_stringbuf < wchar_t > ;
  68566. extern template class basic_istringstream < wchar_t > ;
  68567. extern template class basic_ostringstream < wchar_t > ;
  68568. extern template class basic_stringstream < wchar_t > ;
  68569.  
  68570.  
  68571.  
  68572.  
  68573. }
  68574. #50 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/complex"
  68575. namespace std
  68576. {
  68577. #63
  68578. template < typename _Tp > class complex ;
  68579. template < > class complex < float > ;
  68580. template < > class complex < double > ;
  68581. template < > class complex < long double > ;
  68582.  
  68583.  
  68584. template < typename _Tp > _Tp abs ( const complex < _Tp > & ) ;
  68585.  
  68586. template < typename _Tp > _Tp arg ( const complex < _Tp > & ) ;
  68587.  
  68588. template < typename _Tp > _Tp norm ( const complex < _Tp > & ) ;
  68589.  
  68590.  
  68591. template < typename _Tp > complex < _Tp > conj ( const complex < _Tp > & ) ;
  68592.  
  68593. template < typename _Tp > complex < _Tp > polar ( const _Tp & , const _Tp & = 0 ) ;
  68594.  
  68595.  
  68596.  
  68597. template < typename _Tp > complex < _Tp > cos ( const complex < _Tp > & ) ;
  68598.  
  68599. template < typename _Tp > complex < _Tp > cosh ( const complex < _Tp > & ) ;
  68600.  
  68601. template < typename _Tp > complex < _Tp > exp ( const complex < _Tp > & ) ;
  68602.  
  68603. template < typename _Tp > complex < _Tp > log ( const complex < _Tp > & ) ;
  68604.  
  68605. template < typename _Tp > complex < _Tp > log10 ( const complex < _Tp > & ) ;
  68606. #97
  68607. template < typename _Tp > complex < _Tp > pow ( const complex < _Tp > & , const _Tp & ) ;
  68608.  
  68609. template < typename _Tp > complex < _Tp > pow ( const complex < _Tp > & ,
  68610. const complex < _Tp > & ) ;
  68611.  
  68612. template < typename _Tp > complex < _Tp > pow ( const _Tp & , const complex < _Tp > & ) ;
  68613.  
  68614. template < typename _Tp > complex < _Tp > sin ( const complex < _Tp > & ) ;
  68615.  
  68616. template < typename _Tp > complex < _Tp > sinh ( const complex < _Tp > & ) ;
  68617.  
  68618. template < typename _Tp > complex < _Tp > sqrt ( const complex < _Tp > & ) ;
  68619.  
  68620. template < typename _Tp > complex < _Tp > tan ( const complex < _Tp > & ) ;
  68621.  
  68622. template < typename _Tp > complex < _Tp > tanh ( const complex < _Tp > & ) ;
  68623. #124
  68624. template < typename _Tp >
  68625. struct complex
  68626. {
  68627.  
  68628. typedef _Tp value_type ;
  68629.  
  68630.  
  68631.  
  68632. constexpr complex ( const _Tp & __r = _Tp ( ) , const _Tp & __i = _Tp ( ) )
  68633. : _M_real ( __r ) , _M_imag ( __i ) { }
  68634.  
  68635.  
  68636.  
  68637.  
  68638. template < typename _Up >
  68639. constexpr complex ( const complex < _Up > & __z )
  68640. : _M_real ( __z . real ( ) ) , _M_imag ( __z . imag ( ) ) { }
  68641.  
  68642.  
  68643.  
  68644.  
  68645. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  68646. constexpr _Tp
  68647. real ( ) { return _M_real ; }
  68648.  
  68649. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  68650. constexpr _Tp
  68651. imag ( ) { return _M_imag ; }
  68652. #172
  68653. void
  68654. real ( _Tp __val ) { _M_real = __val ; }
  68655.  
  68656. void
  68657. imag ( _Tp __val ) { _M_imag = __val ; }
  68658.  
  68659.  
  68660. complex < _Tp > & operator = ( const _Tp & ) ;
  68661.  
  68662.  
  68663.  
  68664. complex < _Tp > &
  68665. operator += ( const _Tp & __t )
  68666. {
  68667. _M_real += __t ;
  68668. return * this ;
  68669. }
  68670.  
  68671.  
  68672.  
  68673. complex < _Tp > &
  68674. operator -= ( const _Tp & __t )
  68675. {
  68676. _M_real -= __t ;
  68677. return * this ;
  68678. }
  68679.  
  68680.  
  68681. complex < _Tp > & operator *= ( const _Tp & ) ;
  68682.  
  68683. complex < _Tp > & operator /= ( const _Tp & ) ;
  68684.  
  68685.  
  68686.  
  68687.  
  68688.  
  68689. template < typename _Up >
  68690. complex < _Tp > & operator = ( const complex < _Up > & ) ;
  68691.  
  68692. template < typename _Up >
  68693. complex < _Tp > & operator += ( const complex < _Up > & ) ;
  68694.  
  68695. template < typename _Up >
  68696. complex < _Tp > & operator -= ( const complex < _Up > & ) ;
  68697.  
  68698. template < typename _Up >
  68699. complex < _Tp > & operator *= ( const complex < _Up > & ) ;
  68700.  
  68701. template < typename _Up >
  68702. complex < _Tp > & operator /= ( const complex < _Up > & ) ;
  68703.  
  68704. constexpr complex __rep ( ) const
  68705. { return * this ; }
  68706.  
  68707. private :
  68708. _Tp _M_real ;
  68709. _Tp _M_imag ;
  68710. } ;
  68711.  
  68712. template < typename _Tp >
  68713. complex < _Tp > &
  68714. complex < _Tp > :: operator = ( const _Tp & __t )
  68715. {
  68716. _M_real = __t ;
  68717. _M_imag = _Tp ( ) ;
  68718. return * this ;
  68719. }
  68720.  
  68721.  
  68722. template < typename _Tp >
  68723. complex < _Tp > &
  68724. complex < _Tp > :: operator *= ( const _Tp & __t )
  68725. {
  68726. _M_real *= __t ;
  68727. _M_imag *= __t ;
  68728. return * this ;
  68729. }
  68730.  
  68731.  
  68732. template < typename _Tp >
  68733. complex < _Tp > &
  68734. complex < _Tp > :: operator /= ( const _Tp & __t )
  68735. {
  68736. _M_real /= __t ;
  68737. _M_imag /= __t ;
  68738. return * this ;
  68739. }
  68740.  
  68741. template < typename _Tp >
  68742. template < typename _Up >
  68743. complex < _Tp > &
  68744. complex < _Tp > :: operator = ( const complex < _Up > & __z )
  68745. {
  68746. _M_real = __z . real ( ) ;
  68747. _M_imag = __z . imag ( ) ;
  68748. return * this ;
  68749. }
  68750.  
  68751.  
  68752. template < typename _Tp >
  68753. template < typename _Up >
  68754. complex < _Tp > &
  68755. complex < _Tp > :: operator += ( const complex < _Up > & __z )
  68756. {
  68757. _M_real += __z . real ( ) ;
  68758. _M_imag += __z . imag ( ) ;
  68759. return * this ;
  68760. }
  68761.  
  68762.  
  68763. template < typename _Tp >
  68764. template < typename _Up >
  68765. complex < _Tp > &
  68766. complex < _Tp > :: operator -= ( const complex < _Up > & __z )
  68767. {
  68768. _M_real -= __z . real ( ) ;
  68769. _M_imag -= __z . imag ( ) ;
  68770. return * this ;
  68771. }
  68772.  
  68773.  
  68774.  
  68775. template < typename _Tp >
  68776. template < typename _Up >
  68777. complex < _Tp > &
  68778. complex < _Tp > :: operator *= ( const complex < _Up > & __z )
  68779. {
  68780. const _Tp __r = _M_real * __z . real ( ) - _M_imag * __z . imag ( ) ;
  68781. _M_imag = _M_real * __z . imag ( ) + _M_imag * __z . real ( ) ;
  68782. _M_real = __r ;
  68783. return * this ;
  68784. }
  68785.  
  68786.  
  68787.  
  68788. template < typename _Tp >
  68789. template < typename _Up >
  68790. complex < _Tp > &
  68791. complex < _Tp > :: operator /= ( const complex < _Up > & __z )
  68792. {
  68793. const _Tp __r = _M_real * __z . real ( ) + _M_imag * __z . imag ( ) ;
  68794. const _Tp __n = std :: norm ( __z ) ;
  68795. _M_imag = ( _M_imag * __z . real ( ) - _M_real * __z . imag ( ) ) / __n ;
  68796. _M_real = __r / __n ;
  68797. return * this ;
  68798. }
  68799.  
  68800.  
  68801.  
  68802.  
  68803. template < typename _Tp >
  68804. inline complex < _Tp >
  68805. operator + ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  68806. {
  68807. complex < _Tp > __r = __x ;
  68808. __r += __y ;
  68809. return __r ;
  68810. }
  68811.  
  68812. template < typename _Tp >
  68813. inline complex < _Tp >
  68814. operator + ( const complex < _Tp > & __x , const _Tp & __y )
  68815. {
  68816. complex < _Tp > __r = __x ;
  68817. __r += __y ;
  68818. return __r ;
  68819. }
  68820.  
  68821. template < typename _Tp >
  68822. inline complex < _Tp >
  68823. operator + ( const _Tp & __x , const complex < _Tp > & __y )
  68824. {
  68825. complex < _Tp > __r = __y ;
  68826. __r += __x ;
  68827. return __r ;
  68828. }
  68829.  
  68830.  
  68831.  
  68832.  
  68833. template < typename _Tp >
  68834. inline complex < _Tp >
  68835. operator - ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  68836. {
  68837. complex < _Tp > __r = __x ;
  68838. __r -= __y ;
  68839. return __r ;
  68840. }
  68841.  
  68842. template < typename _Tp >
  68843. inline complex < _Tp >
  68844. operator - ( const complex < _Tp > & __x , const _Tp & __y )
  68845. {
  68846. complex < _Tp > __r = __x ;
  68847. __r -= __y ;
  68848. return __r ;
  68849. }
  68850.  
  68851. template < typename _Tp >
  68852. inline complex < _Tp >
  68853. operator - ( const _Tp & __x , const complex < _Tp > & __y )
  68854. {
  68855. complex < _Tp > __r ( __x , - __y . imag ( ) ) ;
  68856. __r -= __y . real ( ) ;
  68857. return __r ;
  68858. }
  68859.  
  68860.  
  68861.  
  68862.  
  68863. template < typename _Tp >
  68864. inline complex < _Tp >
  68865. operator * ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  68866. {
  68867. complex < _Tp > __r = __x ;
  68868. __r *= __y ;
  68869. return __r ;
  68870. }
  68871.  
  68872. template < typename _Tp >
  68873. inline complex < _Tp >
  68874. operator * ( const complex < _Tp > & __x , const _Tp & __y )
  68875. {
  68876. complex < _Tp > __r = __x ;
  68877. __r *= __y ;
  68878. return __r ;
  68879. }
  68880.  
  68881. template < typename _Tp >
  68882. inline complex < _Tp >
  68883. operator * ( const _Tp & __x , const complex < _Tp > & __y )
  68884. {
  68885. complex < _Tp > __r = __y ;
  68886. __r *= __x ;
  68887. return __r ;
  68888. }
  68889.  
  68890.  
  68891.  
  68892.  
  68893. template < typename _Tp >
  68894. inline complex < _Tp >
  68895. operator / ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  68896. {
  68897. complex < _Tp > __r = __x ;
  68898. __r /= __y ;
  68899. return __r ;
  68900. }
  68901.  
  68902. template < typename _Tp >
  68903. inline complex < _Tp >
  68904. operator / ( const complex < _Tp > & __x , const _Tp & __y )
  68905. {
  68906. complex < _Tp > __r = __x ;
  68907. __r /= __y ;
  68908. return __r ;
  68909. }
  68910.  
  68911. template < typename _Tp >
  68912. inline complex < _Tp >
  68913. operator / ( const _Tp & __x , const complex < _Tp > & __y )
  68914. {
  68915. complex < _Tp > __r = __x ;
  68916. __r /= __y ;
  68917. return __r ;
  68918. }
  68919.  
  68920.  
  68921.  
  68922. template < typename _Tp >
  68923. inline complex < _Tp >
  68924. operator + ( const complex < _Tp > & __x )
  68925. { return __x ; }
  68926.  
  68927.  
  68928. template < typename _Tp >
  68929. inline complex < _Tp >
  68930. operator - ( const complex < _Tp > & __x )
  68931. { return complex < _Tp > ( - __x . real ( ) , - __x . imag ( ) ) ; }
  68932.  
  68933.  
  68934.  
  68935. template < typename _Tp >
  68936. inline constexpr bool
  68937. operator == ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  68938. { return __x . real ( ) == __y . real ( ) && __x . imag ( ) == __y . imag ( ) ; }
  68939.  
  68940. template < typename _Tp >
  68941. inline constexpr bool
  68942. operator == ( const complex < _Tp > & __x , const _Tp & __y )
  68943. { return __x . real ( ) == __y && __x . imag ( ) == _Tp ( ) ; }
  68944.  
  68945. template < typename _Tp >
  68946. inline constexpr bool
  68947. operator == ( const _Tp & __x , const complex < _Tp > & __y )
  68948. { return __x == __y . real ( ) && _Tp ( ) == __y . imag ( ) ; }
  68949.  
  68950.  
  68951.  
  68952.  
  68953. template < typename _Tp >
  68954. inline constexpr bool
  68955. operator != ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  68956. { return __x . real ( ) != __y . real ( ) || __x . imag ( ) != __y . imag ( ) ; }
  68957.  
  68958. template < typename _Tp >
  68959. inline constexpr bool
  68960. operator != ( const complex < _Tp > & __x , const _Tp & __y )
  68961. { return __x . real ( ) != __y || __x . imag ( ) != _Tp ( ) ; }
  68962.  
  68963. template < typename _Tp >
  68964. inline constexpr bool
  68965. operator != ( const _Tp & __x , const complex < _Tp > & __y )
  68966. { return __x != __y . real ( ) || _Tp ( ) != __y . imag ( ) ; }
  68967.  
  68968.  
  68969.  
  68970. template < typename _Tp , typename _CharT , class _Traits >
  68971. basic_istream < _CharT , _Traits > &
  68972. operator >> ( basic_istream < _CharT , _Traits > & __is , complex < _Tp > & __x )
  68973. {
  68974. _Tp __re_x , __im_x ;
  68975. _CharT __ch ;
  68976. __is >> __ch ;
  68977. if ( __ch == '(' )
  68978. {
  68979. __is >> __re_x >> __ch ;
  68980. if ( __ch == ',' )
  68981. {
  68982. __is >> __im_x >> __ch ;
  68983. if ( __ch == ')' )
  68984. __x = complex < _Tp > ( __re_x , __im_x ) ;
  68985. else
  68986. __is . setstate ( ios_base :: failbit ) ;
  68987. }
  68988. else if ( __ch == ')' )
  68989. __x = __re_x ;
  68990. else
  68991. __is . setstate ( ios_base :: failbit ) ;
  68992. }
  68993. else
  68994. {
  68995. __is . putback ( __ch ) ;
  68996. __is >> __re_x ;
  68997. __x = __re_x ;
  68998. }
  68999. return __is ;
  69000. }
  69001.  
  69002.  
  69003. template < typename _Tp , typename _CharT , class _Traits >
  69004. basic_ostream < _CharT , _Traits > &
  69005. operator << ( basic_ostream < _CharT , _Traits > & __os , const complex < _Tp > & __x )
  69006. {
  69007. basic_ostringstream < _CharT , _Traits > __s ;
  69008. __s . flags ( __os . flags ( ) ) ;
  69009. __s . imbue ( __os . getloc ( ) ) ;
  69010. __s . precision ( __os . precision ( ) ) ;
  69011. __s << '(' << __x . real ( ) << ',' << __x . imag ( ) << ')' ;
  69012. return __os << __s . str ( ) ;
  69013. }
  69014.  
  69015.  
  69016.  
  69017. template < typename _Tp >
  69018. constexpr _Tp
  69019. real ( const complex < _Tp > & __z )
  69020. { return __z . real ( ) ; }
  69021.  
  69022. template < typename _Tp >
  69023. constexpr _Tp
  69024. imag ( const complex < _Tp > & __z )
  69025. { return __z . imag ( ) ; }
  69026. #568
  69027. template < typename _Tp >
  69028. inline _Tp
  69029. __complex_abs ( const complex < _Tp > & __z )
  69030. {
  69031. _Tp __x = __z . real ( ) ;
  69032. _Tp __y = __z . imag ( ) ;
  69033. const _Tp __s = std :: max ( abs ( __x ) , abs ( __y ) ) ;
  69034. if ( __s == _Tp ( ) )
  69035. return __s ;
  69036. __x /= __s ;
  69037. __y /= __s ;
  69038. return __s * sqrt ( __x * __x + __y * __y ) ;
  69039. }
  69040. #597
  69041. template < typename _Tp >
  69042. inline _Tp
  69043. abs ( const complex < _Tp > & __z ) { return __complex_abs ( __z ) ; }
  69044.  
  69045.  
  69046.  
  69047.  
  69048. template < typename _Tp >
  69049. inline _Tp
  69050. __complex_arg ( const complex < _Tp > & __z )
  69051. { return atan2 ( __z . imag ( ) , __z . real ( ) ) ; }
  69052. #624
  69053. template < typename _Tp >
  69054. inline _Tp
  69055. arg ( const complex < _Tp > & __z ) { return __complex_arg ( __z ) ; }
  69056. #634
  69057. template < bool >
  69058. struct _Norm_helper
  69059. {
  69060. template < typename _Tp >
  69061. static inline _Tp _S_do_it ( const complex < _Tp > & __z )
  69062. {
  69063. const _Tp __x = __z . real ( ) ;
  69064. const _Tp __y = __z . imag ( ) ;
  69065. return __x * __x + __y * __y ;
  69066. }
  69067. } ;
  69068.  
  69069. template < >
  69070. struct _Norm_helper < true >
  69071. {
  69072. template < typename _Tp >
  69073. static inline _Tp _S_do_it ( const complex < _Tp > & __z )
  69074. {
  69075. _Tp __res = std :: abs ( __z ) ;
  69076. return __res * __res ;
  69077. }
  69078. } ;
  69079.  
  69080. template < typename _Tp >
  69081. inline _Tp
  69082. norm ( const complex < _Tp > & __z )
  69083. {
  69084. return _Norm_helper < __is_floating < _Tp > :: __value
  69085. && ! 0 > :: _S_do_it ( __z ) ;
  69086. }
  69087.  
  69088. template < typename _Tp >
  69089. inline complex < _Tp >
  69090. polar ( const _Tp & __rho , const _Tp & __theta )
  69091. { return complex < _Tp > ( __rho * cos ( __theta ) , __rho * sin ( __theta ) ) ; }
  69092.  
  69093. template < typename _Tp >
  69094. inline complex < _Tp >
  69095. conj ( const complex < _Tp > & __z )
  69096. { return complex < _Tp > ( __z . real ( ) , - __z . imag ( ) ) ; }
  69097.  
  69098.  
  69099.  
  69100.  
  69101. template < typename _Tp >
  69102. inline complex < _Tp >
  69103. __complex_cos ( const complex < _Tp > & __z )
  69104. {
  69105. const _Tp __x = __z . real ( ) ;
  69106. const _Tp __y = __z . imag ( ) ;
  69107. return complex < _Tp > ( cos ( __x ) * cosh ( __y ) , - sin ( __x ) * sinh ( __y ) ) ;
  69108. }
  69109. #702
  69110. template < typename _Tp >
  69111. inline complex < _Tp >
  69112. cos ( const complex < _Tp > & __z ) { return __complex_cos ( __z ) ; }
  69113.  
  69114.  
  69115.  
  69116. template < typename _Tp >
  69117. inline complex < _Tp >
  69118. __complex_cosh ( const complex < _Tp > & __z )
  69119. {
  69120. const _Tp __x = __z . real ( ) ;
  69121. const _Tp __y = __z . imag ( ) ;
  69122. return complex < _Tp > ( cosh ( __x ) * cos ( __y ) , sinh ( __x ) * sin ( __y ) ) ;
  69123. }
  69124. #732
  69125. template < typename _Tp >
  69126. inline complex < _Tp >
  69127. cosh ( const complex < _Tp > & __z ) { return __complex_cosh ( __z ) ; }
  69128.  
  69129.  
  69130.  
  69131. template < typename _Tp >
  69132. inline complex < _Tp >
  69133. __complex_exp ( const complex < _Tp > & __z )
  69134. { return std :: polar ( exp ( __z . real ( ) ) , __z . imag ( ) ) ; }
  69135. #758
  69136. template < typename _Tp >
  69137. inline complex < _Tp >
  69138. exp ( const complex < _Tp > & __z ) { return __complex_exp ( __z ) ; }
  69139.  
  69140.  
  69141.  
  69142.  
  69143. template < typename _Tp >
  69144. inline complex < _Tp >
  69145. __complex_log ( const complex < _Tp > & __z )
  69146. { return complex < _Tp > ( log ( std :: abs ( __z ) ) , std :: arg ( __z ) ) ; }
  69147. #785
  69148. template < typename _Tp >
  69149. inline complex < _Tp >
  69150. log ( const complex < _Tp > & __z ) { return __complex_log ( __z ) ; }
  69151.  
  69152.  
  69153. template < typename _Tp >
  69154. inline complex < _Tp >
  69155. log10 ( const complex < _Tp > & __z )
  69156. { return std :: log ( __z ) / log ( _Tp ( 10.0 ) ) ; }
  69157.  
  69158.  
  69159. template < typename _Tp >
  69160. inline complex < _Tp >
  69161. __complex_sin ( const complex < _Tp > & __z )
  69162. {
  69163. const _Tp __x = __z . real ( ) ;
  69164. const _Tp __y = __z . imag ( ) ;
  69165. return complex < _Tp > ( sin ( __x ) * cosh ( __y ) , cos ( __x ) * sinh ( __y ) ) ;
  69166. }
  69167. #820
  69168. template < typename _Tp >
  69169. inline complex < _Tp >
  69170. sin ( const complex < _Tp > & __z ) { return __complex_sin ( __z ) ; }
  69171.  
  69172.  
  69173.  
  69174. template < typename _Tp >
  69175. inline complex < _Tp >
  69176. __complex_sinh ( const complex < _Tp > & __z )
  69177. {
  69178. const _Tp __x = __z . real ( ) ;
  69179. const _Tp __y = __z . imag ( ) ;
  69180. return complex < _Tp > ( sinh ( __x ) * cos ( __y ) , cosh ( __x ) * sin ( __y ) ) ;
  69181. }
  69182. #850
  69183. template < typename _Tp >
  69184. inline complex < _Tp >
  69185. sinh ( const complex < _Tp > & __z ) { return __complex_sinh ( __z ) ; }
  69186.  
  69187.  
  69188.  
  69189.  
  69190. template < typename _Tp >
  69191. complex < _Tp >
  69192. __complex_sqrt ( const complex < _Tp > & __z )
  69193. {
  69194. _Tp __x = __z . real ( ) ;
  69195. _Tp __y = __z . imag ( ) ;
  69196.  
  69197. if ( __x == _Tp ( ) )
  69198. {
  69199. _Tp __t = sqrt ( abs ( __y ) / 2 ) ;
  69200. return complex < _Tp > ( __t , __y < _Tp ( ) ? - __t : __t ) ;
  69201. }
  69202. else
  69203. {
  69204. _Tp __t = sqrt ( 2 * ( std :: abs ( __z ) + abs ( __x ) ) ) ;
  69205. _Tp __u = __t / 2 ;
  69206. return __x > _Tp ( )
  69207. ? complex < _Tp > ( __u , __y / __t )
  69208. : complex < _Tp > ( abs ( __y ) / __t , __y < _Tp ( ) ? - __u : __u ) ;
  69209. }
  69210. }
  69211. #894
  69212. template < typename _Tp >
  69213. inline complex < _Tp >
  69214. sqrt ( const complex < _Tp > & __z ) { return __complex_sqrt ( __z ) ; }
  69215.  
  69216.  
  69217.  
  69218.  
  69219. template < typename _Tp >
  69220. inline complex < _Tp >
  69221. __complex_tan ( const complex < _Tp > & __z )
  69222. { return std :: sin ( __z ) / std :: cos ( __z ) ; }
  69223. #921
  69224. template < typename _Tp >
  69225. inline complex < _Tp >
  69226. tan ( const complex < _Tp > & __z ) { return __complex_tan ( __z ) ; }
  69227.  
  69228.  
  69229.  
  69230.  
  69231.  
  69232. template < typename _Tp >
  69233. inline complex < _Tp >
  69234. __complex_tanh ( const complex < _Tp > & __z )
  69235. { return std :: sinh ( __z ) / std :: cosh ( __z ) ; }
  69236. #949
  69237. template < typename _Tp >
  69238. inline complex < _Tp >
  69239. tanh ( const complex < _Tp > & __z ) { return __complex_tanh ( __z ) ; }
  69240. #987
  69241. template < typename _Tp >
  69242. complex < _Tp >
  69243. pow ( const complex < _Tp > & __x , const _Tp & __y )
  69244. {
  69245.  
  69246. if ( __x == _Tp ( ) )
  69247. return _Tp ( ) ;
  69248.  
  69249. if ( __x . imag ( ) == _Tp ( ) && __x . real ( ) > _Tp ( ) )
  69250. return pow ( __x . real ( ) , __y ) ;
  69251.  
  69252. complex < _Tp > __t = std :: log ( __x ) ;
  69253. return std :: polar ( exp ( __y * __t . real ( ) ) , __y * __t . imag ( ) ) ;
  69254. }
  69255.  
  69256. template < typename _Tp >
  69257. inline complex < _Tp >
  69258. __complex_pow ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  69259. { return __x == _Tp ( ) ? _Tp ( ) : std :: exp ( __y * std :: log ( __x ) ) ; }
  69260. #1026
  69261. template < typename _Tp >
  69262. inline complex < _Tp >
  69263. pow ( const complex < _Tp > & __x , const complex < _Tp > & __y )
  69264. { return __complex_pow ( __x , __y ) ; }
  69265.  
  69266.  
  69267. template < typename _Tp >
  69268. inline complex < _Tp >
  69269. pow ( const _Tp & __x , const complex < _Tp > & __y )
  69270. {
  69271. return __x > _Tp ( ) ? std :: polar ( pow ( __x , __y . real ( ) ) ,
  69272. __y . imag ( ) * log ( __x ) )
  69273. : std :: pow ( complex < _Tp > ( __x ) , __y ) ;
  69274. }
  69275.  
  69276.  
  69277.  
  69278. template < >
  69279. struct complex < float >
  69280. {
  69281. typedef float value_type ;
  69282. typedef __complex__ float _ComplexT ;
  69283.  
  69284. constexpr complex ( _ComplexT __z ) : _M_value ( __z ) { }
  69285.  
  69286. constexpr complex ( float __r = 0.0f , float __i = 0.0f )
  69287.  
  69288. : _M_value { __r , __i } { }
  69289. #1061
  69290. explicit constexpr complex ( const complex < double > & ) ;
  69291. explicit constexpr complex ( const complex < long double > & ) ;
  69292.  
  69293.  
  69294.  
  69295.  
  69296. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  69297. constexpr float
  69298. real ( ) { return __real__ _M_value ; }
  69299.  
  69300. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  69301. constexpr float
  69302. imag ( ) { return __imag__ _M_value ; }
  69303. #1090
  69304. void
  69305. real ( float __val ) { __real__ _M_value = __val ; }
  69306.  
  69307. void
  69308. imag ( float __val ) { __imag__ _M_value = __val ; }
  69309.  
  69310. complex &
  69311. operator = ( float __f )
  69312. {
  69313. _M_value = __f ;
  69314. return * this ;
  69315. }
  69316.  
  69317. complex &
  69318. operator += ( float __f )
  69319. {
  69320. _M_value += __f ;
  69321. return * this ;
  69322. }
  69323.  
  69324. complex &
  69325. operator -= ( float __f )
  69326. {
  69327. _M_value -= __f ;
  69328. return * this ;
  69329. }
  69330.  
  69331. complex &
  69332. operator *= ( float __f )
  69333. {
  69334. _M_value *= __f ;
  69335. return * this ;
  69336. }
  69337.  
  69338. complex &
  69339. operator /= ( float __f )
  69340. {
  69341. _M_value /= __f ;
  69342. return * this ;
  69343. }
  69344.  
  69345.  
  69346.  
  69347.  
  69348.  
  69349. template < typename _Tp >
  69350. complex &
  69351. operator = ( const complex < _Tp > & __z )
  69352. {
  69353. __real__ _M_value = __z . real ( ) ;
  69354. __imag__ _M_value = __z . imag ( ) ;
  69355. return * this ;
  69356. }
  69357.  
  69358. template < typename _Tp >
  69359. complex &
  69360. operator += ( const complex < _Tp > & __z )
  69361. {
  69362. __real__ _M_value += __z . real ( ) ;
  69363. __imag__ _M_value += __z . imag ( ) ;
  69364. return * this ;
  69365. }
  69366.  
  69367. template < class _Tp >
  69368. complex &
  69369. operator -= ( const complex < _Tp > & __z )
  69370. {
  69371. __real__ _M_value -= __z . real ( ) ;
  69372. __imag__ _M_value -= __z . imag ( ) ;
  69373. return * this ;
  69374. }
  69375.  
  69376. template < class _Tp >
  69377. complex &
  69378. operator *= ( const complex < _Tp > & __z )
  69379. {
  69380. _ComplexT __t ;
  69381. __real__ __t = __z . real ( ) ;
  69382. __imag__ __t = __z . imag ( ) ;
  69383. _M_value *= __t ;
  69384. return * this ;
  69385. }
  69386.  
  69387. template < class _Tp >
  69388. complex &
  69389. operator /= ( const complex < _Tp > & __z )
  69390. {
  69391. _ComplexT __t ;
  69392. __real__ __t = __z . real ( ) ;
  69393. __imag__ __t = __z . imag ( ) ;
  69394. _M_value /= __t ;
  69395. return * this ;
  69396. }
  69397.  
  69398. constexpr _ComplexT __rep ( ) const { return _M_value ; }
  69399.  
  69400. private :
  69401. _ComplexT _M_value ;
  69402. } ;
  69403.  
  69404.  
  69405.  
  69406. template < >
  69407. struct complex < double >
  69408. {
  69409. typedef double value_type ;
  69410. typedef __complex__ double _ComplexT ;
  69411.  
  69412. constexpr complex ( _ComplexT __z ) : _M_value ( __z ) { }
  69413.  
  69414. constexpr complex ( double __r = 0.0 , double __i = 0.0 )
  69415.  
  69416. : _M_value { __r , __i } { }
  69417. #1210
  69418. constexpr complex ( const complex < float > & __z )
  69419. : _M_value ( __z . __rep ( ) ) { }
  69420.  
  69421. explicit constexpr complex ( const complex < long double > & ) ;
  69422.  
  69423.  
  69424.  
  69425.  
  69426. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  69427. constexpr double
  69428. real ( ) { return __real__ _M_value ; }
  69429.  
  69430. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  69431. constexpr double
  69432. imag ( ) { return __imag__ _M_value ; }
  69433. #1241
  69434. void
  69435. real ( double __val ) { __real__ _M_value = __val ; }
  69436.  
  69437. void
  69438. imag ( double __val ) { __imag__ _M_value = __val ; }
  69439.  
  69440. complex &
  69441. operator = ( double __d )
  69442. {
  69443. _M_value = __d ;
  69444. return * this ;
  69445. }
  69446.  
  69447. complex &
  69448. operator += ( double __d )
  69449. {
  69450. _M_value += __d ;
  69451. return * this ;
  69452. }
  69453.  
  69454. complex &
  69455. operator -= ( double __d )
  69456. {
  69457. _M_value -= __d ;
  69458. return * this ;
  69459. }
  69460.  
  69461. complex &
  69462. operator *= ( double __d )
  69463. {
  69464. _M_value *= __d ;
  69465. return * this ;
  69466. }
  69467.  
  69468. complex &
  69469. operator /= ( double __d )
  69470. {
  69471. _M_value /= __d ;
  69472. return * this ;
  69473. }
  69474.  
  69475.  
  69476.  
  69477.  
  69478. template < typename _Tp >
  69479. complex &
  69480. operator = ( const complex < _Tp > & __z )
  69481. {
  69482. __real__ _M_value = __z . real ( ) ;
  69483. __imag__ _M_value = __z . imag ( ) ;
  69484. return * this ;
  69485. }
  69486.  
  69487. template < typename _Tp >
  69488. complex &
  69489. operator += ( const complex < _Tp > & __z )
  69490. {
  69491. __real__ _M_value += __z . real ( ) ;
  69492. __imag__ _M_value += __z . imag ( ) ;
  69493. return * this ;
  69494. }
  69495.  
  69496. template < typename _Tp >
  69497. complex &
  69498. operator -= ( const complex < _Tp > & __z )
  69499. {
  69500. __real__ _M_value -= __z . real ( ) ;
  69501. __imag__ _M_value -= __z . imag ( ) ;
  69502. return * this ;
  69503. }
  69504.  
  69505. template < typename _Tp >
  69506. complex &
  69507. operator *= ( const complex < _Tp > & __z )
  69508. {
  69509. _ComplexT __t ;
  69510. __real__ __t = __z . real ( ) ;
  69511. __imag__ __t = __z . imag ( ) ;
  69512. _M_value *= __t ;
  69513. return * this ;
  69514. }
  69515.  
  69516. template < typename _Tp >
  69517. complex &
  69518. operator /= ( const complex < _Tp > & __z )
  69519. {
  69520. _ComplexT __t ;
  69521. __real__ __t = __z . real ( ) ;
  69522. __imag__ __t = __z . imag ( ) ;
  69523. _M_value /= __t ;
  69524. return * this ;
  69525. }
  69526.  
  69527. constexpr _ComplexT __rep ( ) const { return _M_value ; }
  69528.  
  69529. private :
  69530. _ComplexT _M_value ;
  69531. } ;
  69532.  
  69533.  
  69534.  
  69535. template < >
  69536. struct complex < long double >
  69537. {
  69538. typedef long double value_type ;
  69539. typedef __complex__ long double _ComplexT ;
  69540.  
  69541. constexpr complex ( _ComplexT __z ) : _M_value ( __z ) { }
  69542.  
  69543. constexpr complex ( long double __r = 0.0L ,
  69544. long double __i = 0.0L )
  69545.  
  69546. : _M_value { __r , __i } { }
  69547. #1361
  69548. constexpr complex ( const complex < float > & __z )
  69549. : _M_value ( __z . __rep ( ) ) { }
  69550.  
  69551. constexpr complex ( const complex < double > & __z )
  69552. : _M_value ( __z . __rep ( ) ) { }
  69553.  
  69554.  
  69555.  
  69556.  
  69557. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  69558. constexpr long double
  69559. real ( ) { return __real__ _M_value ; }
  69560.  
  69561. __attribute__ ( ( __abi_tag__ ( "cxx11" ) ) )
  69562. constexpr long double
  69563. imag ( ) { return __imag__ _M_value ; }
  69564. #1393
  69565. void
  69566. real ( long double __val ) { __real__ _M_value = __val ; }
  69567.  
  69568. void
  69569. imag ( long double __val ) { __imag__ _M_value = __val ; }
  69570.  
  69571. complex &
  69572. operator = ( long double __r )
  69573. {
  69574. _M_value = __r ;
  69575. return * this ;
  69576. }
  69577.  
  69578. complex &
  69579. operator += ( long double __r )
  69580. {
  69581. _M_value += __r ;
  69582. return * this ;
  69583. }
  69584.  
  69585. complex &
  69586. operator -= ( long double __r )
  69587. {
  69588. _M_value -= __r ;
  69589. return * this ;
  69590. }
  69591.  
  69592. complex &
  69593. operator *= ( long double __r )
  69594. {
  69595. _M_value *= __r ;
  69596. return * this ;
  69597. }
  69598.  
  69599. complex &
  69600. operator /= ( long double __r )
  69601. {
  69602. _M_value /= __r ;
  69603. return * this ;
  69604. }
  69605.  
  69606.  
  69607.  
  69608.  
  69609. template < typename _Tp >
  69610. complex &
  69611. operator = ( const complex < _Tp > & __z )
  69612. {
  69613. __real__ _M_value = __z . real ( ) ;
  69614. __imag__ _M_value = __z . imag ( ) ;
  69615. return * this ;
  69616. }
  69617.  
  69618. template < typename _Tp >
  69619. complex &
  69620. operator += ( const complex < _Tp > & __z )
  69621. {
  69622. __real__ _M_value += __z . real ( ) ;
  69623. __imag__ _M_value += __z . imag ( ) ;
  69624. return * this ;
  69625. }
  69626.  
  69627. template < typename _Tp >
  69628. complex &
  69629. operator -= ( const complex < _Tp > & __z )
  69630. {
  69631. __real__ _M_value -= __z . real ( ) ;
  69632. __imag__ _M_value -= __z . imag ( ) ;
  69633. return * this ;
  69634. }
  69635.  
  69636. template < typename _Tp >
  69637. complex &
  69638. operator *= ( const complex < _Tp > & __z )
  69639. {
  69640. _ComplexT __t ;
  69641. __real__ __t = __z . real ( ) ;
  69642. __imag__ __t = __z . imag ( ) ;
  69643. _M_value *= __t ;
  69644. return * this ;
  69645. }
  69646.  
  69647. template < typename _Tp >
  69648. complex &
  69649. operator /= ( const complex < _Tp > & __z )
  69650. {
  69651. _ComplexT __t ;
  69652. __real__ __t = __z . real ( ) ;
  69653. __imag__ __t = __z . imag ( ) ;
  69654. _M_value /= __t ;
  69655. return * this ;
  69656. }
  69657.  
  69658. constexpr _ComplexT __rep ( ) const { return _M_value ; }
  69659.  
  69660. private :
  69661. _ComplexT _M_value ;
  69662. } ;
  69663.  
  69664.  
  69665.  
  69666. inline constexpr
  69667. complex < float > :: complex ( const complex < double > & __z )
  69668. : _M_value ( __z . __rep ( ) ) { }
  69669.  
  69670. inline constexpr
  69671. complex < float > :: complex ( const complex < long double > & __z )
  69672. : _M_value ( __z . __rep ( ) ) { }
  69673.  
  69674. inline constexpr
  69675. complex < double > :: complex ( const complex < long double > & __z )
  69676. : _M_value ( __z . __rep ( ) ) { }
  69677.  
  69678.  
  69679.  
  69680.  
  69681.  
  69682. extern template istream & operator >> ( istream & , complex < float > & ) ;
  69683. extern template ostream & operator << ( ostream & , const complex < float > & ) ;
  69684. extern template istream & operator >> ( istream & , complex < double > & ) ;
  69685. extern template ostream & operator << ( ostream & , const complex < double > & ) ;
  69686. extern template istream & operator >> ( istream & , complex < long double > & ) ;
  69687. extern template ostream & operator << ( ostream & , const complex < long double > & ) ;
  69688.  
  69689.  
  69690. extern template wistream & operator >> ( wistream & , complex < float > & ) ;
  69691. extern template wostream & operator << ( wostream & , const complex < float > & ) ;
  69692. extern template wistream & operator >> ( wistream & , complex < double > & ) ;
  69693. extern template wostream & operator << ( wostream & , const complex < double > & ) ;
  69694. extern template wistream & operator >> ( wistream & , complex < long double > & ) ;
  69695. extern template wostream & operator << ( wostream & , const complex < long double > & ) ;
  69696. #1530
  69697. }
  69698.  
  69699. namespace __gnu_cxx
  69700. {
  69701.  
  69702.  
  69703.  
  69704. template < typename _Tp , typename _Up >
  69705. struct __promote_2 < std :: complex < _Tp > , _Up >
  69706. {
  69707. public :
  69708. typedef std :: complex < typename __promote_2 < _Tp , _Up > :: __type > __type ;
  69709. } ;
  69710.  
  69711. template < typename _Tp , typename _Up >
  69712. struct __promote_2 < _Tp , std :: complex < _Up > >
  69713. {
  69714. public :
  69715. typedef std :: complex < typename __promote_2 < _Tp , _Up > :: __type > __type ;
  69716. } ;
  69717.  
  69718. template < typename _Tp , typename _Up >
  69719. struct __promote_2 < std :: complex < _Tp > , std :: complex < _Up > >
  69720. {
  69721. public :
  69722. typedef std :: complex < typename __promote_2 < _Tp , _Up > :: __type > __type ;
  69723. } ;
  69724.  
  69725.  
  69726. }
  69727.  
  69728.  
  69729.  
  69730. namespace std
  69731. {
  69732.  
  69733.  
  69734.  
  69735. template < typename _Tp > std :: complex < _Tp > acos ( const std :: complex < _Tp > & ) ;
  69736. template < typename _Tp > std :: complex < _Tp > asin ( const std :: complex < _Tp > & ) ;
  69737. template < typename _Tp > std :: complex < _Tp > atan ( const std :: complex < _Tp > & ) ;
  69738.  
  69739. template < typename _Tp > std :: complex < _Tp > acosh ( const std :: complex < _Tp > & ) ;
  69740. template < typename _Tp > std :: complex < _Tp > asinh ( const std :: complex < _Tp > & ) ;
  69741. template < typename _Tp > std :: complex < _Tp > atanh ( const std :: complex < _Tp > & ) ;
  69742.  
  69743. template < typename _Tp > _Tp fabs ( const std :: complex < _Tp > & ) ;
  69744.  
  69745. template < typename _Tp >
  69746. inline std :: complex < _Tp >
  69747. __complex_acos ( const std :: complex < _Tp > & __z )
  69748. {
  69749. const std :: complex < _Tp > __t = std :: asin ( __z ) ;
  69750. const _Tp __pi_2 = 1.5707963267948966192313216916397514L ;
  69751. return std :: complex < _Tp > ( __pi_2 - __t . real ( ) , - __t . imag ( ) ) ;
  69752. }
  69753. #1608
  69754. template < typename _Tp >
  69755. inline std :: complex < _Tp >
  69756. acos ( const std :: complex < _Tp > & __z )
  69757. { return __complex_acos ( __z ) ; }
  69758.  
  69759.  
  69760. template < typename _Tp >
  69761. inline std :: complex < _Tp >
  69762. __complex_asin ( const std :: complex < _Tp > & __z )
  69763. {
  69764. std :: complex < _Tp > __t ( - __z . imag ( ) , __z . real ( ) ) ;
  69765. __t = std :: asinh ( __t ) ;
  69766. return std :: complex < _Tp > ( __t . imag ( ) , - __t . real ( ) ) ;
  69767. }
  69768. #1644
  69769. template < typename _Tp >
  69770. inline std :: complex < _Tp >
  69771. asin ( const std :: complex < _Tp > & __z )
  69772. { return __complex_asin ( __z ) ; }
  69773.  
  69774.  
  69775. template < typename _Tp >
  69776. std :: complex < _Tp >
  69777. __complex_atan ( const std :: complex < _Tp > & __z )
  69778. {
  69779. const _Tp __r2 = __z . real ( ) * __z . real ( ) ;
  69780. const _Tp __x = _Tp ( 1.0 ) - __r2 - __z . imag ( ) * __z . imag ( ) ;
  69781.  
  69782. _Tp __num = __z . imag ( ) + _Tp ( 1.0 ) ;
  69783. _Tp __den = __z . imag ( ) - _Tp ( 1.0 ) ;
  69784.  
  69785. __num = __r2 + __num * __num ;
  69786. __den = __r2 + __den * __den ;
  69787.  
  69788. return std :: complex < _Tp > ( _Tp ( 0.5 ) * atan2 ( _Tp ( 2.0 ) * __z . real ( ) , __x ) ,
  69789. _Tp ( 0.25 ) * log ( __num / __den ) ) ;
  69790. }
  69791. #1688
  69792. template < typename _Tp >
  69793. inline std :: complex < _Tp >
  69794. atan ( const std :: complex < _Tp > & __z )
  69795. { return __complex_atan ( __z ) ; }
  69796.  
  69797.  
  69798. template < typename _Tp >
  69799. std :: complex < _Tp >
  69800. __complex_acosh ( const std :: complex < _Tp > & __z )
  69801. {
  69802.  
  69803. return _Tp ( 2.0 ) * std :: log ( std :: sqrt ( _Tp ( 0.5 ) * ( __z + _Tp ( 1.0 ) ) )
  69804. + std :: sqrt ( _Tp ( 0.5 ) * ( __z - _Tp ( 1.0 ) ) ) ) ;
  69805. }
  69806. #1724
  69807. template < typename _Tp >
  69808. inline std :: complex < _Tp >
  69809. acosh ( const std :: complex < _Tp > & __z )
  69810. { return __complex_acosh ( __z ) ; }
  69811.  
  69812.  
  69813. template < typename _Tp >
  69814. std :: complex < _Tp >
  69815. __complex_asinh ( const std :: complex < _Tp > & __z )
  69816. {
  69817. std :: complex < _Tp > __t ( ( __z . real ( ) - __z . imag ( ) )
  69818. * ( __z . real ( ) + __z . imag ( ) ) + _Tp ( 1.0 ) ,
  69819. _Tp ( 2.0 ) * __z . real ( ) * __z . imag ( ) ) ;
  69820. __t = std :: sqrt ( __t ) ;
  69821.  
  69822. return std :: log ( __t + __z ) ;
  69823. }
  69824. #1763
  69825. template < typename _Tp >
  69826. inline std :: complex < _Tp >
  69827. asinh ( const std :: complex < _Tp > & __z )
  69828. { return __complex_asinh ( __z ) ; }
  69829.  
  69830.  
  69831. template < typename _Tp >
  69832. std :: complex < _Tp >
  69833. __complex_atanh ( const std :: complex < _Tp > & __z )
  69834. {
  69835. const _Tp __i2 = __z . imag ( ) * __z . imag ( ) ;
  69836. const _Tp __x = _Tp ( 1.0 ) - __i2 - __z . real ( ) * __z . real ( ) ;
  69837.  
  69838. _Tp __num = _Tp ( 1.0 ) + __z . real ( ) ;
  69839. _Tp __den = _Tp ( 1.0 ) - __z . real ( ) ;
  69840.  
  69841. __num = __i2 + __num * __num ;
  69842. __den = __i2 + __den * __den ;
  69843.  
  69844. return std :: complex < _Tp > ( _Tp ( 0.25 ) * ( log ( __num ) - log ( __den ) ) ,
  69845. _Tp ( 0.5 ) * atan2 ( _Tp ( 2.0 ) * __z . imag ( ) , __x ) ) ;
  69846. }
  69847. #1807
  69848. template < typename _Tp >
  69849. inline std :: complex < _Tp >
  69850. atanh ( const std :: complex < _Tp > & __z )
  69851. { return __complex_atanh ( __z ) ; }
  69852.  
  69853.  
  69854. template < typename _Tp >
  69855. inline _Tp
  69856.  
  69857.  
  69858.  
  69859. fabs ( const std :: complex < _Tp > & __z )
  69860. { return std :: abs ( __z ) ; }
  69861.  
  69862.  
  69863. template < typename _Tp >
  69864. inline typename __gnu_cxx :: __promote < _Tp > :: __type
  69865. arg ( _Tp __x )
  69866. {
  69867. typedef typename __gnu_cxx :: __promote < _Tp > :: __type __type ;
  69868.  
  69869. return std :: signbit ( __x ) ? __type ( 3.1415926535897932384626433832795029L )
  69870. : __type ( ) ;
  69871.  
  69872.  
  69873.  
  69874. }
  69875.  
  69876. template < typename _Tp >
  69877. inline typename __gnu_cxx :: __promote < _Tp > :: __type
  69878. imag ( _Tp )
  69879. { return _Tp ( ) ; }
  69880.  
  69881. template < typename _Tp >
  69882. inline typename __gnu_cxx :: __promote < _Tp > :: __type
  69883. norm ( _Tp __x )
  69884. {
  69885. typedef typename __gnu_cxx :: __promote < _Tp > :: __type __type ;
  69886. return __type ( __x ) * __type ( __x ) ;
  69887. }
  69888.  
  69889. template < typename _Tp >
  69890. inline typename __gnu_cxx :: __promote < _Tp > :: __type
  69891. real ( _Tp __x )
  69892. { return __x ; }
  69893.  
  69894. template < typename _Tp , typename _Up >
  69895. inline std :: complex < typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type >
  69896. pow ( const std :: complex < _Tp > & __x , const _Up & __y )
  69897. {
  69898. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  69899. return std :: pow ( std :: complex < __type > ( __x ) , __type ( __y ) ) ;
  69900. }
  69901.  
  69902. template < typename _Tp , typename _Up >
  69903. inline std :: complex < typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type >
  69904. pow ( const _Tp & __x , const std :: complex < _Up > & __y )
  69905. {
  69906. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  69907. return std :: pow ( __type ( __x ) , std :: complex < __type > ( __y ) ) ;
  69908. }
  69909.  
  69910. template < typename _Tp , typename _Up >
  69911. inline std :: complex < typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type >
  69912. pow ( const std :: complex < _Tp > & __x , const std :: complex < _Up > & __y )
  69913. {
  69914. typedef typename __gnu_cxx :: __promote_2 < _Tp , _Up > :: __type __type ;
  69915. return std :: pow ( std :: complex < __type > ( __x ) ,
  69916. std :: complex < __type > ( __y ) ) ;
  69917. }
  69918.  
  69919.  
  69920.  
  69921. template < typename _Tp > std :: complex < _Tp > proj ( const std :: complex < _Tp > & ) ;
  69922.  
  69923. template < typename _Tp >
  69924. std :: complex < _Tp >
  69925. __complex_proj ( const std :: complex < _Tp > & __z )
  69926. {
  69927. const _Tp __den = ( __z . real ( ) * __z . real ( )
  69928. + __z . imag ( ) * __z . imag ( ) + _Tp ( 1.0 ) ) ;
  69929.  
  69930. return std :: complex < _Tp > ( ( _Tp ( 2.0 ) * __z . real ( ) ) / __den ,
  69931. ( _Tp ( 2.0 ) * __z . imag ( ) ) / __den ) ;
  69932. }
  69933. #1911
  69934. template < typename _Tp >
  69935. inline std :: complex < _Tp >
  69936. proj ( const std :: complex < _Tp > & __z )
  69937. { return __complex_proj ( __z ) ; }
  69938.  
  69939.  
  69940.  
  69941. template < typename _Tp >
  69942. inline typename __gnu_cxx :: __promote < _Tp > :: __type
  69943. proj ( _Tp __x )
  69944. { return __x ; }
  69945.  
  69946. template < typename _Tp >
  69947. inline typename __gnu_cxx :: __promote < _Tp > :: __type
  69948. conj ( _Tp __x )
  69949. { return __x ; }
  69950.  
  69951.  
  69952. }
  69953. #1 "./boost/preprocessor/repetition/repeat_from_to.hpp"
  69954. #1 "./boost/preprocessor/detail/auto_rec.hpp"
  69955. #47 "./boost/functional/hash/extensions.hpp"
  69956. namespace boost
  69957. {
  69958. template < class A , class B >
  69959. std :: size_t hash_value ( std :: pair < A , B > const & ) ;
  69960. template < class T , class A >
  69961. std :: size_t hash_value ( std :: vector < T , A > const & ) ;
  69962. template < class T , class A >
  69963. std :: size_t hash_value ( std :: list < T , A > const & v ) ;
  69964. template < class T , class A >
  69965. std :: size_t hash_value ( std :: deque < T , A > const & v ) ;
  69966. template < class K , class C , class A >
  69967. std :: size_t hash_value ( std :: set < K , C , A > const & v ) ;
  69968. template < class K , class C , class A >
  69969. std :: size_t hash_value ( std :: multiset < K , C , A > const & v ) ;
  69970. template < class K , class T , class C , class A >
  69971. std :: size_t hash_value ( std :: map < K , T , C , A > const & v ) ;
  69972. template < class K , class T , class C , class A >
  69973. std :: size_t hash_value ( std :: multimap < K , T , C , A > const & v ) ;
  69974.  
  69975. template < class T >
  69976. std :: size_t hash_value ( std :: complex < T > const & ) ;
  69977.  
  69978. template < class A , class B >
  69979. std :: size_t hash_value ( std :: pair < A , B > const & v )
  69980. {
  69981. std :: size_t seed = 0 ;
  69982. boost :: hash_combine ( seed , v . first ) ;
  69983. boost :: hash_combine ( seed , v . second ) ;
  69984. return seed ;
  69985. }
  69986.  
  69987. template < class T , class A >
  69988. std :: size_t hash_value ( std :: vector < T , A > const & v )
  69989. {
  69990. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  69991. }
  69992.  
  69993. template < class T , class A >
  69994. std :: size_t hash_value ( std :: list < T , A > const & v )
  69995. {
  69996. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  69997. }
  69998.  
  69999. template < class T , class A >
  70000. std :: size_t hash_value ( std :: deque < T , A > const & v )
  70001. {
  70002. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  70003. }
  70004.  
  70005. template < class K , class C , class A >
  70006. std :: size_t hash_value ( std :: set < K , C , A > const & v )
  70007. {
  70008. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  70009. }
  70010.  
  70011. template < class K , class C , class A >
  70012. std :: size_t hash_value ( std :: multiset < K , C , A > const & v )
  70013. {
  70014. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  70015. }
  70016.  
  70017. template < class K , class T , class C , class A >
  70018. std :: size_t hash_value ( std :: map < K , T , C , A > const & v )
  70019. {
  70020. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  70021. }
  70022.  
  70023. template < class K , class T , class C , class A >
  70024. std :: size_t hash_value ( std :: multimap < K , T , C , A > const & v )
  70025. {
  70026. return boost :: hash_range ( v . begin ( ) , v . end ( ) ) ;
  70027. }
  70028.  
  70029. template < class T >
  70030. std :: size_t hash_value ( std :: complex < T > const & v )
  70031. {
  70032. boost :: hash < T > hasher ;
  70033. std :: size_t seed = hasher ( v . imag ( ) ) ;
  70034. seed ^= hasher ( v . real ( ) ) + ( seed << 6 ) + ( seed >> 2 ) ;
  70035. return seed ;
  70036. }
  70037. #263
  70038. template < class T > struct hash
  70039. : std :: unary_function < T , std :: size_t >
  70040. {
  70041.  
  70042. std :: size_t operator ( ) ( T const & val ) const
  70043. {
  70044. return hash_value ( val ) ;
  70045. }
  70046. #277
  70047. } ;
  70048. #377
  70049. }
  70050. #36 "./boost/regex/v4/basic_regex.hpp"
  70051. namespace boost {
  70052. #45
  70053. namespace re_detail {
  70054.  
  70055.  
  70056.  
  70057.  
  70058. template < class charT , class traits >
  70059. class basic_regex_parser ;
  70060.  
  70061. template < class I >
  70062. void bubble_down_one ( I first , I last )
  70063. {
  70064. if ( first != last )
  70065. {
  70066. I next = last - 1 ;
  70067. while ( ( next != first ) && ( * next < * ( next - 1 ) ) )
  70068. {
  70069. ( next - 1 ) -> swap ( * next ) ;
  70070. -- next ;
  70071. }
  70072. }
  70073. }
  70074.  
  70075. template < class Iterator >
  70076. inline int hash_value_from_capture_name ( Iterator i , Iterator j )
  70077. {
  70078. std :: size_t r = boost :: hash_range ( i , j ) ;
  70079. r %= ( ( std :: numeric_limits < int > :: max ) ( ) - 10001 ) ;
  70080. r += 10000 ;
  70081. return static_cast < int > ( r ) ;
  70082. }
  70083.  
  70084. class named_subexpressions
  70085. {
  70086. public :
  70087. struct name
  70088. {
  70089. template < class charT >
  70090. name ( const charT * i , const charT * j , int idx )
  70091. : index ( idx )
  70092. {
  70093. hash = hash_value_from_capture_name ( i , j ) ;
  70094. }
  70095. name ( int h , int idx )
  70096. : index ( idx ) , hash ( h )
  70097. {
  70098. }
  70099. int index ;
  70100. int hash ;
  70101. bool operator < ( const name & other ) const
  70102. {
  70103. return hash < other . hash ;
  70104. }
  70105. bool operator == ( const name & other ) const
  70106. {
  70107. return hash == other . hash ;
  70108. }
  70109. void swap ( name & other )
  70110. {
  70111. std :: swap ( index , other . index ) ;
  70112. std :: swap ( hash , other . hash ) ;
  70113. }
  70114. } ;
  70115.  
  70116. typedef std :: vector < name > :: const_iterator const_iterator ;
  70117. typedef std :: pair < const_iterator , const_iterator > range_type ;
  70118.  
  70119. named_subexpressions ( ) { }
  70120.  
  70121. template < class charT >
  70122. void set_name ( const charT * i , const charT * j , int index )
  70123. {
  70124. m_sub_names . push_back ( name ( i , j , index ) ) ;
  70125. bubble_down_one ( m_sub_names . begin ( ) , m_sub_names . end ( ) ) ;
  70126. }
  70127. template < class charT >
  70128. int get_id ( const charT * i , const charT * j ) const
  70129. {
  70130. name t ( i , j , 0 ) ;
  70131. typename std :: vector < name > :: const_iterator pos = std :: lower_bound ( m_sub_names . begin ( ) , m_sub_names . end
  70132. #123
  70133. ( ) , t ) ;
  70134. if ( ( pos != m_sub_names . end ( ) ) && ( * pos == t ) )
  70135. {
  70136. return pos -> index ;
  70137. }
  70138. return - 1 ;
  70139. }
  70140. template < class charT >
  70141. range_type equal_range ( const charT * i , const charT * j ) const
  70142. {
  70143. name t ( i , j , 0 ) ;
  70144. return std :: equal_range ( m_sub_names . begin ( ) , m_sub_names . end ( ) , t ) ;
  70145. }
  70146. int get_id ( int h ) const
  70147. {
  70148. name t ( h , 0 ) ;
  70149. std :: vector < name > :: const_iterator pos = std :: lower_bound ( m_sub_names . begin ( ) , m_sub_names . end ( ) , t )
  70150. #139
  70151. ;
  70152. if ( ( pos != m_sub_names . end ( ) ) && ( * pos == t ) )
  70153. {
  70154. return pos -> index ;
  70155. }
  70156. return - 1 ;
  70157. }
  70158. range_type equal_range ( int h ) const
  70159. {
  70160. name t ( h , 0 ) ;
  70161. return std :: equal_range ( m_sub_names . begin ( ) , m_sub_names . end ( ) , t ) ;
  70162. }
  70163. private :
  70164. std :: vector < name > m_sub_names ;
  70165. } ;
  70166.  
  70167.  
  70168.  
  70169.  
  70170.  
  70171. template < class charT , class traits >
  70172. struct regex_data : public named_subexpressions
  70173. {
  70174. typedef regex_constants :: syntax_option_type flag_type ;
  70175. typedef std :: size_t size_type ;
  70176.  
  70177. regex_data ( const :: boost :: shared_ptr <
  70178. :: boost :: regex_traits_wrapper < traits > > & t )
  70179. : m_ptraits ( t ) , m_expression ( 0 ) , m_expression_len ( 0 ) { }
  70180. regex_data ( )
  70181. : m_ptraits ( new :: boost :: regex_traits_wrapper < traits > ( ) ) , m_expression ( 0 ) , m_expression_len ( 0 ) { }
  70182.  
  70183. :: boost :: shared_ptr <
  70184. :: boost :: regex_traits_wrapper < traits >
  70185. > m_ptraits ;
  70186. flag_type m_flags ;
  70187. int m_status ;
  70188. const charT * m_expression ;
  70189. std :: ptrdiff_t m_expression_len ;
  70190. size_type m_mark_count ;
  70191. re_detail :: re_syntax_base * m_first_state ;
  70192. unsigned m_restart_type ;
  70193. unsigned char m_startmap [ 1 << 8 ] ;
  70194. unsigned int m_can_be_null ;
  70195. re_detail :: raw_storage m_data ;
  70196. typename traits :: char_class_type m_word_mask ;
  70197. std :: vector <
  70198. std :: pair <
  70199. std :: size_t , std :: size_t > > m_subs ;
  70200. bool m_has_recursions ;
  70201. } ;
  70202.  
  70203.  
  70204.  
  70205.  
  70206. template < class charT , class traits >
  70207. class basic_regex_implementation
  70208. : public regex_data < charT , traits >
  70209. {
  70210. public :
  70211. typedef regex_constants :: syntax_option_type flag_type ;
  70212. typedef std :: ptrdiff_t difference_type ;
  70213. typedef std :: size_t size_type ;
  70214. typedef typename traits :: locale_type locale_type ;
  70215. typedef const charT * const_iterator ;
  70216.  
  70217. basic_regex_implementation ( ) { }
  70218. basic_regex_implementation ( const :: boost :: shared_ptr <
  70219. :: boost :: regex_traits_wrapper < traits > > & t )
  70220. : regex_data < charT , traits > ( t ) { }
  70221. void assign ( const charT * arg_first ,
  70222. const charT * arg_last ,
  70223. flag_type f )
  70224. {
  70225. regex_data < charT , traits > * pdat = this ;
  70226. basic_regex_parser < charT , traits > parser ( pdat ) ;
  70227. parser . parse ( arg_first , arg_last , f ) ;
  70228. }
  70229.  
  70230. locale_type imbue ( locale_type l )
  70231. {
  70232. return this -> m_ptraits -> imbue ( l ) ;
  70233. }
  70234. locale_type getloc ( ) const
  70235. {
  70236. return this -> m_ptraits -> getloc ( ) ;
  70237. }
  70238. std :: basic_string < charT > str ( ) const
  70239. {
  70240. std :: basic_string < charT > result ;
  70241. if ( this -> m_status == 0 )
  70242. result = std :: basic_string < charT > ( this -> m_expression , this -> m_expression_len ) ;
  70243. return result ;
  70244. }
  70245. const_iterator expression ( ) const
  70246. {
  70247. return this -> m_expression ;
  70248. }
  70249. std :: pair < const_iterator , const_iterator > subexpression ( std :: size_t n ) const
  70250. {
  70251. if ( n == 0 )
  70252. boost :: throw_exception ( std :: out_of_range ( "0 is not a valid subexpression index." ) ) ;
  70253. const std :: pair < std :: size_t , std :: size_t > & pi = this -> m_subs . at ( n - 1 ) ;
  70254. std :: pair < const_iterator , const_iterator > p ( expression ( ) + pi . first , expression ( ) + pi . second ) ;
  70255. return p ;
  70256. }
  70257.  
  70258.  
  70259. const_iterator begin ( ) const
  70260. {
  70261. return ( this -> m_status ? 0 : this -> m_expression ) ;
  70262. }
  70263. const_iterator end ( ) const
  70264. {
  70265. return ( this -> m_status ? 0 : this -> m_expression + this -> m_expression_len ) ;
  70266. }
  70267. flag_type flags ( ) const
  70268. {
  70269. return this -> m_flags ;
  70270. }
  70271. size_type size ( ) const
  70272. {
  70273. return this -> m_expression_len ;
  70274. }
  70275. int status ( ) const
  70276. {
  70277. return this -> m_status ;
  70278. }
  70279. size_type mark_count ( ) const
  70280. {
  70281. return this -> m_mark_count ;
  70282. }
  70283. const re_detail :: re_syntax_base * get_first_state ( ) const
  70284. {
  70285. return this -> m_first_state ;
  70286. }
  70287. unsigned get_restart_type ( ) const
  70288. {
  70289. return this -> m_restart_type ;
  70290. }
  70291. const unsigned char * get_map ( ) const
  70292. {
  70293. return this -> m_startmap ;
  70294. }
  70295. const :: boost :: regex_traits_wrapper < traits > & get_traits ( ) const
  70296. {
  70297. return * ( this -> m_ptraits ) ;
  70298. }
  70299. bool can_be_null ( ) const
  70300. {
  70301. return this -> m_can_be_null ;
  70302. }
  70303. const regex_data < charT , traits > & get_data ( ) const
  70304. {
  70305. basic_regex_implementation < charT , traits > const * p = this ;
  70306. return * static_cast < const regex_data < charT , traits > * > ( p ) ;
  70307. }
  70308. } ;
  70309.  
  70310. }
  70311. #308
  70312. template < class charT , class traits >
  70313.  
  70314. class basic_regex : public regbase
  70315. {
  70316. public :
  70317.  
  70318. typedef std :: size_t traits_size_type ;
  70319. typedef typename traits :: string_type traits_string_type ;
  70320. typedef charT char_type ;
  70321. typedef traits traits_type ;
  70322.  
  70323. typedef charT value_type ;
  70324. typedef charT & reference ;
  70325. typedef const charT & const_reference ;
  70326. typedef const charT * const_iterator ;
  70327. typedef const_iterator iterator ;
  70328. typedef std :: ptrdiff_t difference_type ;
  70329. typedef std :: size_t size_type ;
  70330. typedef regex_constants :: syntax_option_type flag_type ;
  70331.  
  70332.  
  70333.  
  70334. typedef typename traits :: locale_type locale_type ;
  70335.  
  70336. public :
  70337. explicit basic_regex ( ) { }
  70338. explicit basic_regex ( const charT * p , flag_type f = regex_constants :: normal )
  70339. {
  70340. assign ( p , f ) ;
  70341. }
  70342. basic_regex ( const charT * p1 , const charT * p2 , flag_type f = regex_constants :: normal )
  70343. {
  70344. assign ( p1 , p2 , f ) ;
  70345. }
  70346. basic_regex ( const charT * p , size_type len , flag_type f )
  70347. {
  70348. assign ( p , len , f ) ;
  70349. }
  70350. basic_regex ( const basic_regex & that )
  70351. : m_pimpl ( that . m_pimpl ) { }
  70352. ~ basic_regex ( ) { }
  70353. basic_regex & operator = ( const basic_regex & that )
  70354. {
  70355. return assign ( that ) ;
  70356. }
  70357. basic_regex & operator = ( const charT * ptr )
  70358. {
  70359. return assign ( ptr ) ;
  70360. }
  70361.  
  70362.  
  70363.  
  70364. basic_regex & assign ( const basic_regex & that )
  70365. {
  70366. m_pimpl = that . m_pimpl ;
  70367. return * this ;
  70368. }
  70369. basic_regex & assign ( const charT * p , flag_type f = regex_constants :: normal )
  70370. {
  70371. return assign ( p , p + traits :: length ( p ) , f ) ;
  70372. }
  70373. basic_regex & assign ( const charT * p , size_type len , flag_type f )
  70374. {
  70375. return assign ( p , p + len , f ) ;
  70376. }
  70377. private :
  70378. basic_regex & do_assign ( const charT * p1 ,
  70379. const charT * p2 ,
  70380. flag_type f ) ;
  70381. public :
  70382. basic_regex & assign ( const charT * p1 ,
  70383. const charT * p2 ,
  70384. flag_type f = regex_constants :: normal )
  70385. {
  70386. return do_assign ( p1 , p2 , f ) ;
  70387. }
  70388.  
  70389.  
  70390. template < class ST , class SA >
  70391. unsigned int set_expression ( const std :: basic_string < charT , ST , SA > & p , flag_type f = regex_constants :: normal
  70392. #387
  70393. )
  70394. {
  70395. return set_expression ( p . data ( ) , p . data ( ) + p . size ( ) , f ) ;
  70396. }
  70397.  
  70398. template < class ST , class SA >
  70399. explicit basic_regex ( const std :: basic_string < charT , ST , SA > & p , flag_type f = regex_constants :: normal )
  70400. {
  70401. assign ( p , f ) ;
  70402. }
  70403.  
  70404. template < class InputIterator >
  70405. basic_regex ( InputIterator arg_first , InputIterator arg_last , flag_type f = regex_constants :: normal )
  70406. {
  70407. typedef typename traits :: string_type seq_type ;
  70408. seq_type a ( arg_first , arg_last ) ;
  70409. if ( a . size ( ) )
  70410. assign ( static_cast < const charT * > ( & * a . begin ( ) ) , static_cast < const charT * > ( & * a . begin ( ) + a . size
  70411. #404
  70412. ( ) ) , f ) ;
  70413. else
  70414. assign ( static_cast < const charT * > ( 0 ) , static_cast < const charT * > ( 0 ) , f ) ;
  70415. }
  70416.  
  70417. template < class ST , class SA >
  70418. basic_regex & operator = ( const std :: basic_string < charT , ST , SA > & p )
  70419. {
  70420. return assign ( p . data ( ) , p . data ( ) + p . size ( ) , regex_constants :: normal ) ;
  70421. }
  70422.  
  70423. template < class string_traits , class A >
  70424. basic_regex & assign (
  70425. const std :: basic_string < charT , string_traits , A > & s ,
  70426. flag_type f = regex_constants :: normal )
  70427. {
  70428. return assign ( s . data ( ) , s . data ( ) + s . size ( ) , f ) ;
  70429. }
  70430.  
  70431. template < class InputIterator >
  70432. basic_regex & assign ( InputIterator arg_first ,
  70433. InputIterator arg_last ,
  70434. flag_type f = regex_constants :: normal )
  70435. {
  70436. typedef typename traits :: string_type seq_type ;
  70437. seq_type a ( arg_first , arg_last ) ;
  70438. if ( a . size ( ) )
  70439. {
  70440. const charT * p1 = & * a . begin ( ) ;
  70441. const charT * p2 = & * a . begin ( ) + a . size ( ) ;
  70442. return assign ( p1 , p2 , f ) ;
  70443. }
  70444. return assign ( static_cast < const charT * > ( 0 ) , static_cast < const charT * > ( 0 ) , f ) ;
  70445. }
  70446. #465
  70447. locale_type imbue ( locale_type l ) ;
  70448. locale_type getloc ( ) const
  70449. {
  70450. return m_pimpl . get ( ) ? m_pimpl -> getloc ( ) : locale_type ( ) ;
  70451. }
  70452.  
  70453.  
  70454.  
  70455.  
  70456. flag_type getflags ( ) const
  70457. {
  70458. return flags ( ) ;
  70459. }
  70460. flag_type flags ( ) const
  70461. {
  70462. return m_pimpl . get ( ) ? m_pimpl -> flags ( ) : 0 ;
  70463. }
  70464.  
  70465.  
  70466. std :: basic_string < charT > str ( ) const
  70467. {
  70468. return m_pimpl . get ( ) ? m_pimpl -> str ( ) : std :: basic_string < charT > ( ) ;
  70469. }
  70470.  
  70471.  
  70472. std :: pair < const_iterator , const_iterator > subexpression ( std :: size_t n ) const
  70473. {
  70474. if ( ! m_pimpl . get ( ) )
  70475. boost :: throw_exception ( std :: logic_error ( "Can't access subexpressions in an invalid regex." ) ) ;
  70476. return m_pimpl -> subexpression ( n ) ;
  70477. }
  70478. const_iterator begin ( ) const
  70479. {
  70480. return ( m_pimpl . get ( ) ? m_pimpl -> begin ( ) : 0 ) ;
  70481. }
  70482. const_iterator end ( ) const
  70483. {
  70484. return ( m_pimpl . get ( ) ? m_pimpl -> end ( ) : 0 ) ;
  70485. }
  70486.  
  70487.  
  70488. void swap ( basic_regex & that ) throw ( )
  70489. {
  70490. m_pimpl . swap ( that . m_pimpl ) ;
  70491. }
  70492.  
  70493.  
  70494. size_type size ( ) const
  70495. {
  70496. return ( m_pimpl . get ( ) ? m_pimpl -> size ( ) : 0 ) ;
  70497. }
  70498.  
  70499.  
  70500. size_type max_size ( ) const
  70501. {
  70502. return 4294967295U ;
  70503. }
  70504.  
  70505.  
  70506. bool empty ( ) const
  70507. {
  70508. return ( m_pimpl . get ( ) ? 0 != m_pimpl -> status ( ) : true ) ;
  70509. }
  70510.  
  70511. size_type mark_count ( ) const
  70512. {
  70513. return ( m_pimpl . get ( ) ? m_pimpl -> mark_count ( ) : 0 ) ;
  70514. }
  70515.  
  70516. int status ( ) const
  70517. {
  70518. return ( m_pimpl . get ( ) ? m_pimpl -> status ( ) : regex_constants :: error_empty ) ;
  70519. }
  70520.  
  70521. int compare ( const basic_regex & that ) const
  70522. {
  70523. if ( m_pimpl . get ( ) == that . m_pimpl . get ( ) )
  70524. return 0 ;
  70525. if ( ! m_pimpl . get ( ) )
  70526. return - 1 ;
  70527. if ( ! that . m_pimpl . get ( ) )
  70528. return 1 ;
  70529. if ( status ( ) != that . status ( ) )
  70530. return status ( ) - that . status ( ) ;
  70531. if ( flags ( ) != that . flags ( ) )
  70532. return flags ( ) - that . flags ( ) ;
  70533. return str ( ) . compare ( that . str ( ) ) ;
  70534. }
  70535. bool operator == ( const basic_regex & e ) const
  70536. {
  70537. return compare ( e ) == 0 ;
  70538. }
  70539. bool operator != ( const basic_regex & e ) const
  70540. {
  70541. return compare ( e ) != 0 ;
  70542. }
  70543. bool operator < ( const basic_regex & e ) const
  70544. {
  70545. return compare ( e ) < 0 ;
  70546. }
  70547. bool operator > ( const basic_regex & e ) const
  70548. {
  70549. return compare ( e ) > 0 ;
  70550. }
  70551. bool operator <= ( const basic_regex & e ) const
  70552. {
  70553. return compare ( e ) <= 0 ;
  70554. }
  70555. bool operator >= ( const basic_regex & e ) const
  70556. {
  70557. return compare ( e ) >= 0 ;
  70558. }
  70559.  
  70560.  
  70561.  
  70562.  
  70563. const charT * expression ( ) const
  70564. {
  70565. return ( m_pimpl . get ( ) && ! m_pimpl -> status ( ) ? m_pimpl -> expression ( ) : 0 ) ;
  70566. }
  70567. unsigned int set_expression ( const charT * p1 , const charT * p2 , flag_type f = regex_constants :: normal )
  70568. {
  70569. assign ( p1 , p2 , f | regex_constants :: no_except ) ;
  70570. return status ( ) ;
  70571. }
  70572. unsigned int set_expression ( const charT * p , flag_type f = regex_constants :: normal )
  70573. {
  70574. assign ( p , f | regex_constants :: no_except ) ;
  70575. return status ( ) ;
  70576. }
  70577. unsigned int error_code ( ) const
  70578. {
  70579. return status ( ) ;
  70580. }
  70581.  
  70582.  
  70583.  
  70584. const re_detail :: re_syntax_base * get_first_state ( ) const
  70585. {
  70586. ( ( void ) 0 ) ;
  70587. return m_pimpl -> get_first_state ( ) ;
  70588. }
  70589. unsigned get_restart_type ( ) const
  70590. {
  70591. ( ( void ) 0 ) ;
  70592. return m_pimpl -> get_restart_type ( ) ;
  70593. }
  70594. const unsigned char * get_map ( ) const
  70595. {
  70596. ( ( void ) 0 ) ;
  70597. return m_pimpl -> get_map ( ) ;
  70598. }
  70599. const :: boost :: regex_traits_wrapper < traits > & get_traits ( ) const
  70600. {
  70601. ( ( void ) 0 ) ;
  70602. return m_pimpl -> get_traits ( ) ;
  70603. }
  70604. bool can_be_null ( ) const
  70605. {
  70606. ( ( void ) 0 ) ;
  70607. return m_pimpl -> can_be_null ( ) ;
  70608. }
  70609. const re_detail :: regex_data < charT , traits > & get_data ( ) const
  70610. {
  70611. ( ( void ) 0 ) ;
  70612. return m_pimpl -> get_data ( ) ;
  70613. }
  70614. boost :: shared_ptr < re_detail :: named_subexpressions > get_named_subs ( ) const
  70615. {
  70616. return m_pimpl ;
  70617. }
  70618.  
  70619. private :
  70620. shared_ptr < re_detail :: basic_regex_implementation < charT , traits > > m_pimpl ;
  70621. } ;
  70622. #647
  70623. template < class charT , class traits >
  70624. basic_regex < charT , traits > & basic_regex < charT , traits > :: do_assign ( const charT * p1 ,
  70625. const charT * p2 ,
  70626. flag_type f )
  70627. {
  70628. shared_ptr < re_detail :: basic_regex_implementation < charT , traits > > temp ;
  70629. if ( ! m_pimpl . get ( ) )
  70630. {
  70631. temp = shared_ptr < re_detail :: basic_regex_implementation < charT , traits > > ( new re_detail :: basic_regex_implementation
  70632. #655
  70633. < charT , traits > ( ) ) ;
  70634. }
  70635. else
  70636. {
  70637. temp = shared_ptr < re_detail :: basic_regex_implementation < charT , traits > > ( new re_detail :: basic_regex_implementation
  70638. #659
  70639. < charT , traits > ( m_pimpl -> m_ptraits ) ) ;
  70640. }
  70641. temp -> assign ( p1 , p2 , f ) ;
  70642. temp . swap ( m_pimpl ) ;
  70643. return * this ;
  70644. }
  70645.  
  70646. template < class charT , class traits >
  70647. typename basic_regex < charT , traits > :: locale_type basic_regex < charT , traits > :: imbue ( locale_type l )
  70648. {
  70649. shared_ptr < re_detail :: basic_regex_implementation < charT , traits > > temp ( new re_detail :: basic_regex_implementation
  70650. #669
  70651. < charT , traits > ( ) ) ;
  70652. locale_type result = temp -> imbue ( l ) ;
  70653. temp . swap ( m_pimpl ) ;
  70654. return result ;
  70655. }
  70656.  
  70657.  
  70658.  
  70659.  
  70660. template < class charT , class traits >
  70661. void swap ( basic_regex < charT , traits > & e1 , basic_regex < charT , traits > & e2 )
  70662. {
  70663. e1 . swap ( e2 ) ;
  70664. }
  70665.  
  70666.  
  70667. template < class charT , class traits , class traits2 >
  70668. std :: basic_ostream < charT , traits > &
  70669. operator << ( std :: basic_ostream < charT , traits > & os ,
  70670. const basic_regex < charT , traits2 > & e )
  70671. {
  70672. return ( os << e . str ( ) ) ;
  70673. }
  70674. #708
  70675. template < class charT , class traits >
  70676.  
  70677. class reg_expression : public basic_regex < charT , traits >
  70678. {
  70679. public :
  70680. typedef typename basic_regex < charT , traits > :: flag_type flag_type ;
  70681. typedef typename basic_regex < charT , traits > :: size_type size_type ;
  70682. explicit reg_expression ( ) { }
  70683. explicit reg_expression ( const charT * p , flag_type f = regex_constants :: normal )
  70684. : basic_regex < charT , traits > ( p , f ) { }
  70685. reg_expression ( const charT * p1 , const charT * p2 , flag_type f = regex_constants :: normal )
  70686. : basic_regex < charT , traits > ( p1 , p2 , f ) { }
  70687. reg_expression ( const charT * p , size_type len , flag_type f )
  70688. : basic_regex < charT , traits > ( p , len , f ) { }
  70689. reg_expression ( const reg_expression & that )
  70690. : basic_regex < charT , traits > ( that ) { }
  70691. ~ reg_expression ( ) { }
  70692. reg_expression & operator = ( const reg_expression & that )
  70693. {
  70694. return this -> assign ( that ) ;
  70695. }
  70696.  
  70697.  
  70698. template < class ST , class SA >
  70699. explicit reg_expression ( const std :: basic_string < charT , ST , SA > & p , flag_type f = regex_constants :: normal )
  70700. : basic_regex < charT , traits > ( p , f )
  70701. {
  70702. }
  70703.  
  70704. template < class InputIterator >
  70705. reg_expression ( InputIterator arg_first , InputIterator arg_last , flag_type f = regex_constants :: normal )
  70706. : basic_regex < charT , traits > ( arg_first , arg_last , f )
  70707. {
  70708. }
  70709.  
  70710. template < class ST , class SA >
  70711. reg_expression & operator = ( const std :: basic_string < charT , ST , SA > & p )
  70712. {
  70713. this -> assign ( p ) ;
  70714. return * this ;
  70715. }
  70716. #762
  70717. } ;
  70718.  
  70719.  
  70720.  
  70721.  
  70722.  
  70723. }
  70724. #1 "./boost/regex/v4/basic_regex_creator.hpp"
  70725. #39
  70726. namespace boost {
  70727.  
  70728. namespace re_detail {
  70729.  
  70730. template < class charT >
  70731. struct digraph : public std :: pair < charT , charT >
  70732. {
  70733. digraph ( ) : std :: pair < charT , charT > ( 0 , 0 ) { }
  70734. digraph ( charT c1 ) : std :: pair < charT , charT > ( c1 , 0 ) { }
  70735. digraph ( charT c1 , charT c2 ) : std :: pair < charT , charT > ( c1 , c2 )
  70736. { }
  70737.  
  70738. digraph ( const digraph < charT > & d ) : std :: pair < charT , charT > ( d . first , d . second ) { }
  70739.  
  70740. template < class Seq >
  70741. digraph ( const Seq & s ) : std :: pair < charT , charT > ( )
  70742. {
  70743. ( ( void ) 0 ) ;
  70744. ( ( void ) 0 ) ;
  70745. this -> first = s [ 0 ] ;
  70746. this -> second = ( s . size ( ) > 1 ) ? s [ 1 ] : 0 ;
  70747. }
  70748. } ;
  70749.  
  70750. template < class charT , class traits >
  70751. class basic_char_set
  70752. {
  70753. public :
  70754. typedef digraph < charT > digraph_type ;
  70755. typedef typename traits :: string_type string_type ;
  70756. typedef typename traits :: char_class_type m_type ;
  70757.  
  70758. basic_char_set ( )
  70759. {
  70760. m_negate = false ;
  70761. m_has_digraphs = false ;
  70762. m_classes = 0 ;
  70763. m_negated_classes = 0 ;
  70764. m_empty = true ;
  70765. }
  70766.  
  70767. void add_single ( const digraph_type & s )
  70768. {
  70769. m_singles . insert ( m_singles . end ( ) , s ) ;
  70770. if ( s . second )
  70771. m_has_digraphs = true ;
  70772. m_empty = false ;
  70773. }
  70774. void add_range ( const digraph_type & first , const digraph_type & end )
  70775. {
  70776. m_ranges . insert ( m_ranges . end ( ) , first ) ;
  70777. m_ranges . insert ( m_ranges . end ( ) , end ) ;
  70778. if ( first . second )
  70779. {
  70780. m_has_digraphs = true ;
  70781. add_single ( first ) ;
  70782. }
  70783. if ( end . second )
  70784. {
  70785. m_has_digraphs = true ;
  70786. add_single ( end ) ;
  70787. }
  70788. m_empty = false ;
  70789. }
  70790. void add_class ( m_type m )
  70791. {
  70792. m_classes |= m ;
  70793. m_empty = false ;
  70794. }
  70795. void add_negated_class ( m_type m )
  70796. {
  70797. m_negated_classes |= m ;
  70798. m_empty = false ;
  70799. }
  70800. void add_equivalent ( const digraph_type & s )
  70801. {
  70802. m_equivalents . insert ( m_equivalents . end ( ) , s ) ;
  70803. if ( s . second )
  70804. {
  70805. m_has_digraphs = true ;
  70806. add_single ( s ) ;
  70807. }
  70808. m_empty = false ;
  70809. }
  70810. void negate ( )
  70811. {
  70812. m_negate = true ;
  70813.  
  70814. }
  70815.  
  70816.  
  70817.  
  70818.  
  70819. bool has_digraphs ( ) const
  70820. {
  70821. return m_has_digraphs ;
  70822. }
  70823. bool is_negated ( ) const
  70824. {
  70825. return m_negate ;
  70826. }
  70827. typedef typename std :: vector < digraph_type > :: const_iterator list_iterator ;
  70828. list_iterator singles_begin ( ) const
  70829. {
  70830. return m_singles . begin ( ) ;
  70831. }
  70832. list_iterator singles_end ( ) const
  70833. {
  70834. return m_singles . end ( ) ;
  70835. }
  70836. list_iterator ranges_begin ( ) const
  70837. {
  70838. return m_ranges . begin ( ) ;
  70839. }
  70840. list_iterator ranges_end ( ) const
  70841. {
  70842. return m_ranges . end ( ) ;
  70843. }
  70844. list_iterator equivalents_begin ( ) const
  70845. {
  70846. return m_equivalents . begin ( ) ;
  70847. }
  70848. list_iterator equivalents_end ( ) const
  70849. {
  70850. return m_equivalents . end ( ) ;
  70851. }
  70852. m_type classes ( ) const
  70853. {
  70854. return m_classes ;
  70855. }
  70856. m_type negated_classes ( ) const
  70857. {
  70858. return m_negated_classes ;
  70859. }
  70860. bool empty ( ) const
  70861. {
  70862. return m_empty ;
  70863. }
  70864. private :
  70865. std :: vector < digraph_type > m_singles ;
  70866. std :: vector < digraph_type > m_ranges ;
  70867. bool m_negate ;
  70868. bool m_has_digraphs ;
  70869. m_type m_classes ;
  70870. m_type m_negated_classes ;
  70871. bool m_empty ;
  70872. std :: vector < digraph_type > m_equivalents ;
  70873. } ;
  70874.  
  70875. template < class charT , class traits >
  70876. class basic_regex_creator
  70877. {
  70878. public :
  70879. basic_regex_creator ( regex_data < charT , traits > * data ) ;
  70880. std :: ptrdiff_t getoffset ( void * addr )
  70881. {
  70882. return getoffset ( addr , m_pdata -> m_data . data ( ) ) ;
  70883. }
  70884. std :: ptrdiff_t getoffset ( const void * addr , const void * base )
  70885. {
  70886. return static_cast < const char * > ( addr ) - static_cast < const char * > ( base ) ;
  70887. }
  70888. re_syntax_base * getaddress ( std :: ptrdiff_t off )
  70889. {
  70890. return getaddress ( off , m_pdata -> m_data . data ( ) ) ;
  70891. }
  70892. re_syntax_base * getaddress ( std :: ptrdiff_t off , void * base )
  70893. {
  70894. return static_cast < re_syntax_base * > ( static_cast < void * > ( static_cast < char * > ( base ) + off ) ) ;
  70895. }
  70896. void init ( unsigned l_flags )
  70897. {
  70898. m_pdata -> m_flags = l_flags ;
  70899. m_icase = l_flags & regex_constants :: icase ;
  70900. }
  70901. regbase :: flag_type flags ( )
  70902. {
  70903. return m_pdata -> m_flags ;
  70904. }
  70905. void flags ( regbase :: flag_type f )
  70906. {
  70907. m_pdata -> m_flags = f ;
  70908. if ( m_icase != static_cast < bool > ( f & regbase :: icase ) )
  70909. {
  70910. m_icase = static_cast < bool > ( f & regbase :: icase ) ;
  70911. }
  70912. }
  70913. re_syntax_base * append_state ( syntax_element_type t , std :: size_t s = sizeof ( re_syntax_base ) ) ;
  70914. re_syntax_base * insert_state ( std :: ptrdiff_t pos , syntax_element_type t , std :: size_t s = sizeof ( re_syntax_base
  70915. #227
  70916. ) ) ;
  70917. re_literal * append_literal ( charT c ) ;
  70918. re_syntax_base * append_set ( const basic_char_set < charT , traits > & char_set ) ;
  70919. re_syntax_base * append_set ( const basic_char_set < charT , traits > & char_set , mpl :: false_ * ) ;
  70920. re_syntax_base * append_set ( const basic_char_set < charT , traits > & char_set , mpl :: true_ * ) ;
  70921. void finalize ( const charT * p1 , const charT * p2 ) ;
  70922. protected :
  70923. regex_data < charT , traits > * m_pdata ;
  70924. const :: boost :: regex_traits_wrapper < traits > &
  70925. m_traits ;
  70926. re_syntax_base * m_last_state ;
  70927. bool m_icase ;
  70928. unsigned m_repeater_id ;
  70929. bool m_has_backrefs ;
  70930. unsigned m_backrefs ;
  70931. boost :: uintmax_t m_bad_repeats ;
  70932. bool m_has_recursions ;
  70933. std :: vector < bool > m_recursion_checks ;
  70934. typename traits :: char_class_type m_word_mask ;
  70935. typename traits :: char_class_type m_mask_space ;
  70936. typename traits :: char_class_type m_lower_mask ;
  70937. typename traits :: char_class_type m_upper_mask ;
  70938. typename traits :: char_class_type m_alpha_mask ;
  70939. private :
  70940. basic_regex_creator & operator = ( const basic_regex_creator & ) ;
  70941. basic_regex_creator ( const basic_regex_creator & ) ;
  70942.  
  70943. void fixup_pointers ( re_syntax_base * state ) ;
  70944. void fixup_recursions ( re_syntax_base * state ) ;
  70945. void create_startmaps ( re_syntax_base * state ) ;
  70946. int calculate_backstep ( re_syntax_base * state ) ;
  70947. void create_startmap ( re_syntax_base * state , unsigned char * l_map , unsigned int * pnull , unsigned char mask ) ;
  70948. unsigned get_restart_type ( re_syntax_base * state ) ;
  70949. void set_all_masks ( unsigned char * bits , unsigned char ) ;
  70950. bool is_bad_repeat ( re_syntax_base * pt ) ;
  70951. void set_bad_repeat ( re_syntax_base * pt ) ;
  70952. syntax_element_type get_repeat_type ( re_syntax_base * state ) ;
  70953. void probe_leading_repeat ( re_syntax_base * state ) ;
  70954. } ;
  70955.  
  70956. template < class charT , class traits >
  70957. basic_regex_creator < charT , traits > :: basic_regex_creator ( regex_data < charT , traits > * data )
  70958. : m_pdata ( data ) , m_traits ( * ( data -> m_ptraits ) ) , m_last_state ( 0 ) , m_repeater_id ( 0 ) , m_has_backrefs ( false
  70959. #269
  70960. ) , m_backrefs ( 0 ) , m_has_recursions ( false )
  70961. {
  70962. m_pdata -> m_data . clear ( ) ;
  70963. m_pdata -> m_status = :: boost :: regex_constants :: error_ok ;
  70964. static const charT w = 'w' ;
  70965. static const charT s = 's' ;
  70966. static const charT l [ 5 ] = { 'l' , 'o' , 'w' , 'e' , 'r' , } ;
  70967. static const charT u [ 5 ] = { 'u' , 'p' , 'p' , 'e' , 'r' , } ;
  70968. static const charT a [ 5 ] = { 'a' , 'l' , 'p' , 'h' , 'a' , } ;
  70969. m_word_mask = m_traits . lookup_classname ( & w , & w + 1 ) ;
  70970. m_mask_space = m_traits . lookup_classname ( & s , & s + 1 ) ;
  70971. m_lower_mask = m_traits . lookup_classname ( l , l + 5 ) ;
  70972. m_upper_mask = m_traits . lookup_classname ( u , u + 5 ) ;
  70973. m_alpha_mask = m_traits . lookup_classname ( a , a + 5 ) ;
  70974. m_pdata -> m_word_mask = m_word_mask ;
  70975. ( ( void ) 0 ) ;
  70976. ( ( void ) 0 ) ;
  70977. ( ( void ) 0 ) ;
  70978. ( ( void ) 0 ) ;
  70979. ( ( void ) 0 ) ;
  70980. }
  70981.  
  70982. template < class charT , class traits >
  70983. re_syntax_base * basic_regex_creator < charT , traits > :: append_state ( syntax_element_type t , std :: size_t s )
  70984. {
  70985.  
  70986. if ( t == syntax_element_backref )
  70987. this -> m_has_backrefs = true ;
  70988.  
  70989. m_pdata -> m_data . align ( ) ;
  70990.  
  70991. if ( m_last_state )
  70992. m_last_state -> next . i = m_pdata -> m_data . size ( ) - getoffset ( m_last_state ) ;
  70993.  
  70994. m_last_state = static_cast < re_syntax_base * > ( m_pdata -> m_data . extend ( s ) ) ;
  70995.  
  70996. m_last_state -> next . i = 0 ;
  70997. m_last_state -> type = t ;
  70998. return m_last_state ;
  70999. }
  71000.  
  71001. template < class charT , class traits >
  71002. re_syntax_base * basic_regex_creator < charT , traits > :: insert_state ( std :: ptrdiff_t pos , syntax_element_type t ,
  71003. #311
  71004. std :: size_t s )
  71005. {
  71006.  
  71007. m_pdata -> m_data . align ( ) ;
  71008.  
  71009. if ( m_last_state )
  71010. m_last_state -> next . i = m_pdata -> m_data . size ( ) - getoffset ( m_last_state ) ;
  71011.  
  71012. std :: ptrdiff_t off = getoffset ( m_last_state ) + s ;
  71013.  
  71014. re_syntax_base * new_state = static_cast < re_syntax_base * > ( m_pdata -> m_data . insert ( pos , s ) ) ;
  71015.  
  71016. new_state -> next . i = s ;
  71017. new_state -> type = t ;
  71018. m_last_state = getaddress ( off ) ;
  71019. return new_state ;
  71020. }
  71021.  
  71022. template < class charT , class traits >
  71023. re_literal * basic_regex_creator < charT , traits > :: append_literal ( charT c )
  71024. {
  71025. re_literal * result ;
  71026.  
  71027. if ( ( 0 == m_last_state ) || ( m_last_state -> type != syntax_element_literal ) )
  71028. {
  71029.  
  71030. result = static_cast < re_literal * > ( append_state ( syntax_element_literal , sizeof ( re_literal ) + sizeof ( charT )
  71031. #337
  71032. ) ) ;
  71033. result -> length = 1 ;
  71034. * static_cast < charT * > ( static_cast < void * > ( result + 1 ) ) = m_traits . translate ( c , m_icase ) ;
  71035. }
  71036. else
  71037. {
  71038.  
  71039. std :: ptrdiff_t off = getoffset ( m_last_state ) ;
  71040. m_pdata -> m_data . extend ( sizeof ( charT ) ) ;
  71041. m_last_state = result = static_cast < re_literal * > ( getaddress ( off ) ) ;
  71042. charT * characters = static_cast < charT * > ( static_cast < void * > ( result + 1 ) ) ;
  71043. characters [ result -> length ] = m_traits . translate ( c , m_icase ) ;
  71044. ++ ( result -> length ) ;
  71045. }
  71046. return result ;
  71047. }
  71048.  
  71049. template < class charT , class traits >
  71050. inline re_syntax_base * basic_regex_creator < charT , traits > :: append_set (
  71051. const basic_char_set < charT , traits > & char_set )
  71052. {
  71053. typedef mpl :: bool_ < ( sizeof ( charT ) == 1 ) > truth_type ;
  71054. return char_set . has_digraphs ( )
  71055. ? append_set ( char_set , static_cast < mpl :: false_ * > ( 0 ) )
  71056. : append_set ( char_set , static_cast < truth_type * > ( 0 ) ) ;
  71057. }
  71058.  
  71059. template < class charT , class traits >
  71060. re_syntax_base * basic_regex_creator < charT , traits > :: append_set (
  71061. const basic_char_set < charT , traits > & char_set , mpl :: false_ * )
  71062. {
  71063. typedef typename traits :: string_type string_type ;
  71064. typedef typename basic_char_set < charT , traits > :: list_iterator item_iterator ;
  71065. typedef typename traits :: char_class_type m_type ;
  71066.  
  71067. re_set_long < m_type > * result = static_cast < re_set_long < m_type > * > ( append_state ( syntax_element_long_set , sizeof
  71068. #372
  71069. ( re_set_long < m_type > ) ) ) ;
  71070.  
  71071.  
  71072.  
  71073. result -> csingles = static_cast < unsigned int > ( :: boost :: re_detail :: distance ( char_set . singles_begin ( ) , char_set
  71074. #376
  71075. . singles_end ( ) ) ) ;
  71076. result -> cranges = static_cast < unsigned int > ( :: boost :: re_detail :: distance ( char_set . ranges_begin ( ) , char_set
  71077. #377
  71078. . ranges_end ( ) ) ) / 2 ;
  71079. result -> cequivalents = static_cast < unsigned int > ( :: boost :: re_detail :: distance ( char_set . equivalents_begin
  71080. #378
  71081. ( ) , char_set . equivalents_end ( ) ) ) ;
  71082. result -> cclasses = char_set . classes ( ) ;
  71083. result -> cnclasses = char_set . negated_classes ( ) ;
  71084. if ( flags ( ) & regbase :: icase )
  71085. {
  71086.  
  71087. if ( ( ( result -> cclasses & m_lower_mask ) == m_lower_mask ) || ( ( result -> cclasses & m_upper_mask ) == m_upper_mask
  71088. #384
  71089. ) )
  71090. result -> cclasses |= m_alpha_mask ;
  71091. if ( ( ( result -> cnclasses & m_lower_mask ) == m_lower_mask ) || ( ( result -> cnclasses & m_upper_mask ) == m_upper_mask
  71092. #386
  71093. ) )
  71094. result -> cnclasses |= m_alpha_mask ;
  71095. }
  71096.  
  71097. result -> isnot = char_set . is_negated ( ) ;
  71098. result -> singleton = ! char_set . has_digraphs ( ) ;
  71099.  
  71100.  
  71101.  
  71102. std :: ptrdiff_t offset = getoffset ( result ) ;
  71103.  
  71104.  
  71105.  
  71106. item_iterator first , last ;
  71107. first = char_set . singles_begin ( ) ;
  71108. last = char_set . singles_end ( ) ;
  71109. while ( first != last )
  71110. {
  71111. charT * p = static_cast < charT * > ( this -> m_pdata -> m_data . extend ( sizeof ( charT ) * ( first -> second ? 3 : 2 )
  71112. #404
  71113. ) ) ;
  71114. p [ 0 ] = m_traits . translate ( first -> first , m_icase ) ;
  71115. if ( first -> second )
  71116. {
  71117. p [ 1 ] = m_traits . translate ( first -> second , m_icase ) ;
  71118. p [ 2 ] = 0 ;
  71119. }
  71120. else
  71121. p [ 1 ] = 0 ;
  71122. ++ first ;
  71123. }
  71124.  
  71125.  
  71126.  
  71127. first = char_set . ranges_begin ( ) ;
  71128. last = char_set . ranges_end ( ) ;
  71129. while ( first != last )
  71130. {
  71131.  
  71132. digraph < charT > c1 = * first ;
  71133. c1 . first = this -> m_traits . translate ( c1 . first , this -> m_icase ) ;
  71134. c1 . second = this -> m_traits . translate ( c1 . second , this -> m_icase ) ;
  71135. ++ first ;
  71136. digraph < charT > c2 = * first ;
  71137. c2 . first = this -> m_traits . translate ( c2 . first , this -> m_icase ) ;
  71138. c2 . second = this -> m_traits . translate ( c2 . second , this -> m_icase ) ;
  71139. ++ first ;
  71140. string_type s1 , s2 ;
  71141.  
  71142. if ( flags ( ) & regex_constants :: collate )
  71143. {
  71144. #445
  71145. charT a1 [ 3 ] = { c1 . first , c1 . second , charT ( 0 ) , } ;
  71146. charT a2 [ 3 ] = { c2 . first , c2 . second , charT ( 0 ) , } ;
  71147. s1 = this -> m_traits . transform ( a1 , ( a1 [ 1 ] ? a1 + 2 : a1 + 1 ) ) ;
  71148. s2 = this -> m_traits . transform ( a2 , ( a2 [ 1 ] ? a2 + 2 : a2 + 1 ) ) ;
  71149.  
  71150. if ( s1 . size ( ) == 0 )
  71151. s1 = string_type ( 1 , charT ( 0 ) ) ;
  71152. if ( s2 . size ( ) == 0 )
  71153. s2 = string_type ( 1 , charT ( 0 ) ) ;
  71154. }
  71155. else
  71156. {
  71157. if ( c1 . second )
  71158. {
  71159. s1 . insert ( s1 . end ( ) , c1 . first ) ;
  71160. s1 . insert ( s1 . end ( ) , c1 . second ) ;
  71161. }
  71162. else
  71163. s1 = string_type ( 1 , c1 . first ) ;
  71164. if ( c2 . second )
  71165. {
  71166. s2 . insert ( s2 . end ( ) , c2 . first ) ;
  71167. s2 . insert ( s2 . end ( ) , c2 . second ) ;
  71168. }
  71169. else
  71170. s2 . insert ( s2 . end ( ) , c2 . first ) ;
  71171. }
  71172. if ( s1 > s2 )
  71173. {
  71174.  
  71175. return 0 ;
  71176. }
  71177. charT * p = static_cast < charT * > ( this -> m_pdata -> m_data . extend ( sizeof ( charT ) * ( s1 . size ( ) + s2 . size
  71178. #477
  71179. ( ) + 2 ) ) ) ;
  71180. re_detail :: copy ( s1 . begin ( ) , s1 . end ( ) , p ) ;
  71181. p [ s1 . size ( ) ] = charT ( 0 ) ;
  71182. p += s1 . size ( ) + 1 ;
  71183. re_detail :: copy ( s2 . begin ( ) , s2 . end ( ) , p ) ;
  71184. p [ s2 . size ( ) ] = charT ( 0 ) ;
  71185. }
  71186.  
  71187.  
  71188.  
  71189. first = char_set . equivalents_begin ( ) ;
  71190. last = char_set . equivalents_end ( ) ;
  71191. while ( first != last )
  71192. {
  71193. string_type s ;
  71194. if ( first -> second )
  71195. {
  71196. #500
  71197. charT cs [ 3 ] = { first -> first , first -> second , charT ( 0 ) , } ;
  71198. s = m_traits . transform_primary ( cs , cs + 2 ) ;
  71199.  
  71200. }
  71201. else
  71202. s = m_traits . transform_primary ( & first -> first , & first -> first + 1 ) ;
  71203. if ( s . empty ( ) )
  71204. return 0 ;
  71205. charT * p = static_cast < charT * > ( this -> m_pdata -> m_data . extend ( sizeof ( charT ) * ( s . size ( ) + 1 ) ) ) ;
  71206. #508
  71207.  
  71208. re_detail :: copy ( s . begin ( ) , s . end ( ) , p ) ;
  71209. p [ s . size ( ) ] = charT ( 0 ) ;
  71210. ++ first ;
  71211. }
  71212.  
  71213.  
  71214.  
  71215. m_last_state = result = static_cast < re_set_long < m_type > * > ( getaddress ( offset ) ) ;
  71216. return result ;
  71217. }
  71218.  
  71219. template < class T >
  71220. inline bool char_less ( T t1 , T t2 )
  71221. {
  71222. return t1 < t2 ;
  71223. }
  71224. inline bool char_less ( char t1 , char t2 )
  71225. {
  71226. return static_cast < unsigned char > ( t1 ) < static_cast < unsigned char > ( t2 ) ;
  71227. }
  71228. inline bool char_less ( signed char t1 , signed char t2 )
  71229. {
  71230. return static_cast < unsigned char > ( t1 ) < static_cast < unsigned char > ( t2 ) ;
  71231. }
  71232.  
  71233. template < class charT , class traits >
  71234. re_syntax_base * basic_regex_creator < charT , traits > :: append_set (
  71235. const basic_char_set < charT , traits > & char_set , mpl :: true_ * )
  71236. {
  71237. typedef typename traits :: string_type string_type ;
  71238. typedef typename basic_char_set < charT , traits > :: list_iterator item_iterator ;
  71239.  
  71240. re_set * result = static_cast < re_set * > ( append_state ( syntax_element_set , sizeof ( re_set ) ) ) ;
  71241. bool negate = char_set . is_negated ( ) ;
  71242. std :: memset ( result -> _map , 0 , sizeof ( result -> _map ) ) ;
  71243.  
  71244.  
  71245.  
  71246. item_iterator first , last ;
  71247. first = char_set . singles_begin ( ) ;
  71248. last = char_set . singles_end ( ) ;
  71249. while ( first != last )
  71250. {
  71251. for ( unsigned int i = 0 ; i < ( 1 << 8 ) ; ++ i )
  71252. {
  71253. if ( this -> m_traits . translate ( static_cast < charT > ( i ) , this -> m_icase )
  71254. == this -> m_traits . translate ( first -> first , this -> m_icase ) )
  71255. result -> _map [ i ] = true ;
  71256. }
  71257. ++ first ;
  71258. }
  71259.  
  71260.  
  71261.  
  71262. first = char_set . ranges_begin ( ) ;
  71263. last = char_set . ranges_end ( ) ;
  71264. while ( first != last )
  71265. {
  71266.  
  71267. charT c1 = this -> m_traits . translate ( first -> first , this -> m_icase ) ;
  71268. ++ first ;
  71269. charT c2 = this -> m_traits . translate ( first -> first , this -> m_icase ) ;
  71270. ++ first ;
  71271.  
  71272. if ( flags ( ) & regex_constants :: collate )
  71273. {
  71274.  
  71275. charT c3 [ 2 ] = { c1 , charT ( 0 ) , } ;
  71276. string_type s1 = this -> m_traits . transform ( c3 , c3 + 1 ) ;
  71277. c3 [ 0 ] = c2 ;
  71278. string_type s2 = this -> m_traits . transform ( c3 , c3 + 1 ) ;
  71279. if ( s1 > s2 )
  71280. {
  71281.  
  71282. return 0 ;
  71283. }
  71284. ( ( void ) 0 ) ;
  71285. for ( unsigned i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71286. {
  71287. c3 [ 0 ] = static_cast < charT > ( i ) ;
  71288. string_type s3 = this -> m_traits . transform ( c3 , c3 + 1 ) ;
  71289. if ( ( s1 <= s3 ) && ( s3 <= s2 ) )
  71290. result -> _map [ i ] = true ;
  71291. }
  71292. }
  71293. else
  71294. {
  71295. if ( char_less ( c2 , c1 ) )
  71296. {
  71297.  
  71298. return 0 ;
  71299. }
  71300.  
  71301. std :: memset ( result -> _map + static_cast < unsigned char > ( c1 ) , true , 1 + static_cast < unsigned char > ( c2 ) -
  71302. #602
  71303. static_cast < unsigned char > ( c1 ) ) ;
  71304. }
  71305. }
  71306.  
  71307.  
  71308.  
  71309. typedef typename traits :: char_class_type m_type ;
  71310. m_type m = char_set . classes ( ) ;
  71311. if ( flags ( ) & regbase :: icase )
  71312. {
  71313.  
  71314. if ( ( ( m & m_lower_mask ) == m_lower_mask ) || ( ( m & m_upper_mask ) == m_upper_mask ) )
  71315. m |= m_alpha_mask ;
  71316. }
  71317. if ( m != 0 )
  71318. {
  71319. for ( unsigned i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71320. {
  71321. if ( this -> m_traits . isctype ( static_cast < charT > ( i ) , m ) )
  71322. result -> _map [ i ] = true ;
  71323. }
  71324. }
  71325.  
  71326.  
  71327.  
  71328. m = char_set . negated_classes ( ) ;
  71329. if ( flags ( ) & regbase :: icase )
  71330. {
  71331.  
  71332. if ( ( ( m & m_lower_mask ) == m_lower_mask ) || ( ( m & m_upper_mask ) == m_upper_mask ) )
  71333. m |= m_alpha_mask ;
  71334. }
  71335. if ( m != 0 )
  71336. {
  71337. for ( unsigned i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71338. {
  71339. if ( 0 == this -> m_traits . isctype ( static_cast < charT > ( i ) , m ) )
  71340. result -> _map [ i ] = true ;
  71341. }
  71342. }
  71343.  
  71344.  
  71345.  
  71346. first = char_set . equivalents_begin ( ) ;
  71347. last = char_set . equivalents_end ( ) ;
  71348. while ( first != last )
  71349. {
  71350. string_type s ;
  71351. ( ( void ) 0 ) ;
  71352. s = m_traits . transform_primary ( & first -> first , & first -> first + 1 ) ;
  71353. if ( s . empty ( ) )
  71354. return 0 ;
  71355. for ( unsigned i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71356. {
  71357. charT c [ 2 ] = { ( static_cast < charT > ( i ) ) , charT ( 0 ) , } ;
  71358. string_type s2 = this -> m_traits . transform_primary ( c , c + 1 ) ;
  71359. if ( s == s2 )
  71360. result -> _map [ i ] = true ;
  71361. }
  71362. ++ first ;
  71363. }
  71364. if ( negate )
  71365. {
  71366. for ( unsigned i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71367. {
  71368. result -> _map [ i ] = ! ( result -> _map [ i ] ) ;
  71369. }
  71370. }
  71371. return result ;
  71372. }
  71373.  
  71374. template < class charT , class traits >
  71375. void basic_regex_creator < charT , traits > :: finalize ( const charT * p1 , const charT * p2 )
  71376. {
  71377. if ( this -> m_pdata -> m_status )
  71378. return ;
  71379.  
  71380.  
  71381. append_state ( syntax_element_match ) ;
  71382.  
  71383. std :: ptrdiff_t len = p2 - p1 ;
  71384. m_pdata -> m_expression_len = len ;
  71385. charT * ps = static_cast < charT * > ( m_pdata -> m_data . extend ( sizeof ( charT ) * ( 1 + ( p2 - p1 ) ) ) ) ;
  71386. m_pdata -> m_expression = ps ;
  71387. re_detail :: copy ( p1 , p2 , ps ) ;
  71388. ps [ p2 - p1 ] = 0 ;
  71389.  
  71390.  
  71391. m_pdata -> m_status = 0 ;
  71392.  
  71393. m_pdata -> m_first_state = static_cast < re_syntax_base * > ( m_pdata -> m_data . data ( ) ) ;
  71394.  
  71395. fixup_pointers ( m_pdata -> m_first_state ) ;
  71396. if ( m_has_recursions )
  71397. {
  71398. m_pdata -> m_has_recursions = true ;
  71399. fixup_recursions ( m_pdata -> m_first_state ) ;
  71400. if ( this -> m_pdata -> m_status )
  71401. return ;
  71402. }
  71403. else
  71404. m_pdata -> m_has_recursions = false ;
  71405.  
  71406. create_startmaps ( m_pdata -> m_first_state ) ;
  71407.  
  71408. std :: memset ( m_pdata -> m_startmap , 0 , sizeof ( m_pdata -> m_startmap ) ) ;
  71409. m_pdata -> m_can_be_null = 0 ;
  71410.  
  71411. m_bad_repeats = 0 ;
  71412. if ( m_has_recursions )
  71413. m_recursion_checks . assign ( 1 + m_pdata -> m_mark_count , false ) ;
  71414. create_startmap ( m_pdata -> m_first_state , m_pdata -> m_startmap , & ( m_pdata -> m_can_be_null ) , mask_all ) ;
  71415.  
  71416. m_pdata -> m_restart_type = get_restart_type ( m_pdata -> m_first_state ) ;
  71417.  
  71418. probe_leading_repeat ( m_pdata -> m_first_state ) ;
  71419. }
  71420.  
  71421. template < class charT , class traits >
  71422. void basic_regex_creator < charT , traits > :: fixup_pointers ( re_syntax_base * state )
  71423. {
  71424. while ( state )
  71425. {
  71426. switch ( state -> type )
  71427. {
  71428. case syntax_element_recurse :
  71429. m_has_recursions = true ;
  71430. if ( state -> next . i )
  71431. state -> next . p = getaddress ( state -> next . i , state ) ;
  71432. else
  71433. state -> next . p = 0 ;
  71434. break ;
  71435. case syntax_element_rep :
  71436. case syntax_element_dot_rep :
  71437. case syntax_element_char_rep :
  71438. case syntax_element_short_set_rep :
  71439. case syntax_element_long_set_rep :
  71440.  
  71441. static_cast < re_repeat * > ( state ) -> state_id = m_repeater_id ++ ;
  71442. ( ( void ) 0 ) ;
  71443. case syntax_element_alt :
  71444. std :: memset ( static_cast < re_alt * > ( state ) -> _map , 0 , sizeof ( static_cast < re_alt * > ( state ) -> _map ) )
  71445. #743
  71446. ;
  71447. static_cast < re_alt * > ( state ) -> can_be_null = 0 ;
  71448. ( ( void ) 0 ) ;
  71449. case syntax_element_jump :
  71450. static_cast < re_jump * > ( state ) -> alt . p = getaddress ( static_cast < re_jump * > ( state ) -> alt . i , state ) ;
  71451. #747
  71452.  
  71453. ( ( void ) 0 ) ;
  71454. default :
  71455. if ( state -> next . i )
  71456. state -> next . p = getaddress ( state -> next . i , state ) ;
  71457. else
  71458. state -> next . p = 0 ;
  71459. }
  71460. state = state -> next . p ;
  71461. }
  71462. }
  71463.  
  71464. template < class charT , class traits >
  71465. void basic_regex_creator < charT , traits > :: fixup_recursions ( re_syntax_base * state )
  71466. {
  71467. re_syntax_base * base = state ;
  71468. while ( state )
  71469. {
  71470. switch ( state -> type )
  71471. {
  71472. case syntax_element_assert_backref :
  71473. {
  71474.  
  71475. int idx = static_cast < const re_brace * > ( state ) -> index ;
  71476. if ( idx < 0 )
  71477. {
  71478. idx = - idx - 1 ;
  71479. if ( idx >= 10000 )
  71480. {
  71481. idx = m_pdata -> get_id ( idx ) ;
  71482. if ( idx <= 0 )
  71483. {
  71484.  
  71485. if ( 0 == this -> m_pdata -> m_status )
  71486. this -> m_pdata -> m_status = boost :: regex_constants :: error_bad_pattern ;
  71487.  
  71488.  
  71489.  
  71490. this -> m_pdata -> m_expression = 0 ;
  71491. this -> m_pdata -> m_expression_len = 0 ;
  71492.  
  71493.  
  71494.  
  71495. if ( 0 == ( this -> flags ( ) & regex_constants :: no_except ) )
  71496. {
  71497. std :: string message = "Encountered a forward reference to a marked sub-expression that does not exist." ;
  71498. boost :: regex_error e ( message , boost :: regex_constants :: error_bad_pattern , 0 ) ;
  71499. e . raise ( ) ;
  71500. }
  71501. }
  71502. }
  71503. }
  71504. }
  71505. break ;
  71506. case syntax_element_recurse :
  71507. {
  71508. bool ok = false ;
  71509. re_syntax_base * p = base ;
  71510. std :: ptrdiff_t idx = static_cast < re_jump * > ( state ) -> alt . i ;
  71511. if ( idx > 10000 )
  71512. {
  71513.  
  71514.  
  71515.  
  71516.  
  71517. idx = m_pdata -> get_id ( static_cast < int > ( idx ) ) ;
  71518. }
  71519. while ( p )
  71520. {
  71521. if ( ( p -> type == syntax_element_startmark ) && ( static_cast < re_brace * > ( p ) -> index == idx ) )
  71522. {
  71523.  
  71524.  
  71525.  
  71526. static_cast < re_jump * > ( state ) -> alt . p = p ;
  71527. ok = true ;
  71528.  
  71529.  
  71530.  
  71531. p = p -> next . p ;
  71532. int next_rep_id = 0 ;
  71533. while ( p )
  71534. {
  71535. switch ( p -> type )
  71536. {
  71537. case syntax_element_rep :
  71538. case syntax_element_dot_rep :
  71539. case syntax_element_char_rep :
  71540. case syntax_element_short_set_rep :
  71541. case syntax_element_long_set_rep :
  71542. next_rep_id = static_cast < re_repeat * > ( p ) -> state_id ;
  71543. break ;
  71544. case syntax_element_endmark :
  71545. if ( static_cast < const re_brace * > ( p ) -> index == idx )
  71546. next_rep_id = - 1 ;
  71547. break ;
  71548. default :
  71549. break ;
  71550. }
  71551. if ( next_rep_id )
  71552. break ;
  71553. p = p -> next . p ;
  71554. }
  71555. if ( next_rep_id > 0 )
  71556. {
  71557. static_cast < re_recurse * > ( state ) -> state_id = next_rep_id - 1 ;
  71558. }
  71559.  
  71560. break ;
  71561. }
  71562. p = p -> next . p ;
  71563. }
  71564. if ( ! ok )
  71565. {
  71566.  
  71567. if ( 0 == this -> m_pdata -> m_status )
  71568. this -> m_pdata -> m_status = boost :: regex_constants :: error_bad_pattern ;
  71569.  
  71570.  
  71571.  
  71572. this -> m_pdata -> m_expression = 0 ;
  71573. this -> m_pdata -> m_expression_len = 0 ;
  71574.  
  71575.  
  71576.  
  71577. if ( 0 == ( this -> flags ( ) & regex_constants :: no_except ) )
  71578. {
  71579. std :: string message = "Encountered a forward reference to a recursive sub-expression that does not exist." ;
  71580. boost :: regex_error e ( message , boost :: regex_constants :: error_bad_pattern , 0 ) ;
  71581. e . raise ( ) ;
  71582. }
  71583. }
  71584. }
  71585. break ;
  71586. default :
  71587. break ;
  71588. }
  71589. state = state -> next . p ;
  71590. }
  71591. }
  71592.  
  71593. template < class charT , class traits >
  71594. void basic_regex_creator < charT , traits > :: create_startmaps ( re_syntax_base * state )
  71595. {
  71596. #899
  71597. bool l_icase = m_icase ;
  71598. std :: vector < std :: pair < bool , re_syntax_base * > > v ;
  71599.  
  71600. while ( state )
  71601. {
  71602. switch ( state -> type )
  71603. {
  71604. case syntax_element_toggle_case :
  71605.  
  71606. m_icase = static_cast < re_case * > ( state ) -> icase ;
  71607. state = state -> next . p ;
  71608. continue ;
  71609. case syntax_element_alt :
  71610. case syntax_element_rep :
  71611. case syntax_element_dot_rep :
  71612. case syntax_element_char_rep :
  71613. case syntax_element_short_set_rep :
  71614. case syntax_element_long_set_rep :
  71615.  
  71616. v . push_back ( std :: pair < bool , re_syntax_base * > ( m_icase , state ) ) ;
  71617. state = state -> next . p ;
  71618. break ;
  71619. case syntax_element_backstep :
  71620.  
  71621. static_cast < re_brace * > ( state ) -> index
  71622. = this -> calculate_backstep ( state -> next . p ) ;
  71623. if ( static_cast < re_brace * > ( state ) -> index < 0 )
  71624. {
  71625.  
  71626. if ( 0 == this -> m_pdata -> m_status )
  71627. this -> m_pdata -> m_status = boost :: regex_constants :: error_bad_pattern ;
  71628.  
  71629.  
  71630.  
  71631. this -> m_pdata -> m_expression = 0 ;
  71632. this -> m_pdata -> m_expression_len = 0 ;
  71633.  
  71634.  
  71635.  
  71636. if ( 0 == ( this -> flags ( ) & regex_constants :: no_except ) )
  71637. {
  71638. std :: string message = "Invalid lookbehind assertion encountered in the regular expression." ;
  71639. boost :: regex_error e ( message , boost :: regex_constants :: error_bad_pattern , 0 ) ;
  71640. e . raise ( ) ;
  71641. }
  71642. }
  71643. ( ( void ) 0 ) ;
  71644. default :
  71645. state = state -> next . p ;
  71646. }
  71647. }
  71648.  
  71649.  
  71650. while ( v . size ( ) )
  71651. {
  71652.  
  71653. if ( m_has_recursions )
  71654. m_recursion_checks . assign ( 1 + m_pdata -> m_mark_count , false ) ;
  71655.  
  71656. const std :: pair < bool , re_syntax_base * > & p = v . back ( ) ;
  71657. m_icase = p . first ;
  71658. state = p . second ;
  71659. v . pop_back ( ) ;
  71660.  
  71661.  
  71662. m_bad_repeats = 0 ;
  71663. create_startmap ( state -> next . p , static_cast < re_alt * > ( state ) -> _map , & static_cast < re_alt * > ( state ) ->
  71664. #965
  71665. can_be_null , mask_take ) ;
  71666. m_bad_repeats = 0 ;
  71667.  
  71668. if ( m_has_recursions )
  71669. m_recursion_checks . assign ( 1 + m_pdata -> m_mark_count , false ) ;
  71670. create_startmap ( static_cast < re_alt * > ( state ) -> alt . p , static_cast < re_alt * > ( state ) -> _map , & static_cast
  71671. #970
  71672. < re_alt * > ( state ) -> can_be_null , mask_skip ) ;
  71673.  
  71674. state -> type = this -> get_repeat_type ( state ) ;
  71675. }
  71676.  
  71677. m_icase = l_icase ;
  71678. }
  71679.  
  71680. template < class charT , class traits >
  71681. int basic_regex_creator < charT , traits > :: calculate_backstep ( re_syntax_base * state )
  71682. {
  71683. typedef typename traits :: char_class_type m_type ;
  71684. int result = 0 ;
  71685. while ( state )
  71686. {
  71687. switch ( state -> type )
  71688. {
  71689. case syntax_element_startmark :
  71690. if ( ( static_cast < re_brace * > ( state ) -> index == - 1 )
  71691. || ( static_cast < re_brace * > ( state ) -> index == - 2 ) )
  71692. {
  71693. state = static_cast < re_jump * > ( state -> next . p ) -> alt . p -> next . p ;
  71694. continue ;
  71695. }
  71696. else if ( static_cast < re_brace * > ( state ) -> index == - 3 )
  71697. {
  71698. state = state -> next . p -> next . p ;
  71699. continue ;
  71700. }
  71701. break ;
  71702. case syntax_element_endmark :
  71703. if ( ( static_cast < re_brace * > ( state ) -> index == - 1 )
  71704. || ( static_cast < re_brace * > ( state ) -> index == - 2 ) )
  71705. return result ;
  71706. break ;
  71707. case syntax_element_literal :
  71708. result += static_cast < re_literal * > ( state ) -> length ;
  71709. break ;
  71710. case syntax_element_wild :
  71711. case syntax_element_set :
  71712. result += 1 ;
  71713. break ;
  71714. case syntax_element_dot_rep :
  71715. case syntax_element_char_rep :
  71716. case syntax_element_short_set_rep :
  71717. case syntax_element_backref :
  71718. case syntax_element_rep :
  71719. case syntax_element_combining :
  71720. case syntax_element_long_set_rep :
  71721. case syntax_element_backstep :
  71722. {
  71723. re_repeat * rep = static_cast < re_repeat * > ( state ) ;
  71724.  
  71725. state -> type = this -> get_repeat_type ( state ) ;
  71726. if ( ( state -> type == syntax_element_dot_rep )
  71727. || ( state -> type == syntax_element_char_rep )
  71728. || ( state -> type == syntax_element_short_set_rep ) )
  71729. {
  71730. if ( rep -> max != rep -> min )
  71731. return - 1 ;
  71732. result += static_cast < int > ( rep -> min ) ;
  71733. state = rep -> alt . p ;
  71734. continue ;
  71735. }
  71736. else if ( state -> type == syntax_element_long_set_rep )
  71737. {
  71738. ( ( void ) 0 ) ;
  71739. if ( static_cast < re_set_long < m_type > * > ( rep -> next . p ) -> singleton == 0 )
  71740. return - 1 ;
  71741. if ( rep -> max != rep -> min )
  71742. return - 1 ;
  71743. result += static_cast < int > ( rep -> min ) ;
  71744. state = rep -> alt . p ;
  71745. continue ;
  71746. }
  71747. }
  71748. return - 1 ;
  71749. case syntax_element_long_set :
  71750. if ( static_cast < re_set_long < m_type > * > ( state ) -> singleton == 0 )
  71751. return - 1 ;
  71752. result += 1 ;
  71753. break ;
  71754. case syntax_element_jump :
  71755. state = static_cast < re_jump * > ( state ) -> alt . p ;
  71756. continue ;
  71757. case syntax_element_alt :
  71758. {
  71759. int r1 = calculate_backstep ( state -> next . p ) ;
  71760. int r2 = calculate_backstep ( static_cast < re_alt * > ( state ) -> alt . p ) ;
  71761. if ( ( r1 < 0 ) || ( r1 != r2 ) )
  71762. return - 1 ;
  71763. return result + r1 ;
  71764. }
  71765. default :
  71766. break ;
  71767. }
  71768. state = state -> next . p ;
  71769. }
  71770. return - 1 ;
  71771. }
  71772.  
  71773. template < class charT , class traits >
  71774. void basic_regex_creator < charT , traits > :: create_startmap ( re_syntax_base * state , unsigned char * l_map , unsigned
  71775. #1072
  71776. int * pnull , unsigned char mask )
  71777. {
  71778. int not_last_jump = 1 ;
  71779. re_syntax_base * recursion_start = 0 ;
  71780. int recursion_sub = 0 ;
  71781. re_syntax_base * recursion_restart = 0 ;
  71782.  
  71783.  
  71784. bool l_icase = m_icase ;
  71785.  
  71786. while ( state )
  71787. {
  71788. switch ( state -> type )
  71789. {
  71790. case syntax_element_toggle_case :
  71791. l_icase = static_cast < re_case * > ( state ) -> icase ;
  71792. state = state -> next . p ;
  71793. break ;
  71794. case syntax_element_literal :
  71795. {
  71796.  
  71797.  
  71798. if ( l_map )
  71799. {
  71800. l_map [ 0 ] |= mask_init ;
  71801. charT first_char = * static_cast < charT * > ( static_cast < void * > ( static_cast < re_literal * > ( state ) + 1 ) ) ;
  71802. #1097
  71803.  
  71804. for ( unsigned int i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71805. {
  71806. if ( m_traits . translate ( static_cast < charT > ( i ) , l_icase ) == first_char )
  71807. l_map [ i ] |= mask ;
  71808. }
  71809. }
  71810. return ;
  71811. }
  71812. case syntax_element_end_line :
  71813. {
  71814.  
  71815. if ( l_map )
  71816. {
  71817. l_map [ 0 ] |= mask_init ;
  71818. l_map [ static_cast < unsigned > ( '\n' ) ] |= mask ;
  71819. l_map [ static_cast < unsigned > ( '\r' ) ] |= mask ;
  71820. l_map [ static_cast < unsigned > ( '\f' ) ] |= mask ;
  71821. l_map [ 0x85 ] |= mask ;
  71822. }
  71823.  
  71824. if ( pnull )
  71825. create_startmap ( state -> next . p , 0 , pnull , mask ) ;
  71826. return ;
  71827. }
  71828. case syntax_element_recurse :
  71829. {
  71830. if ( state -> type == syntax_element_startmark )
  71831. recursion_sub = static_cast < re_brace * > ( state ) -> index ;
  71832. else
  71833. recursion_sub = 0 ;
  71834. if ( m_recursion_checks [ recursion_sub ] )
  71835. {
  71836.  
  71837. if ( 0 == this -> m_pdata -> m_status )
  71838. this -> m_pdata -> m_status = boost :: regex_constants :: error_bad_pattern ;
  71839.  
  71840.  
  71841.  
  71842. this -> m_pdata -> m_expression = 0 ;
  71843. this -> m_pdata -> m_expression_len = 0 ;
  71844.  
  71845.  
  71846.  
  71847. if ( 0 == ( this -> flags ( ) & regex_constants :: no_except ) )
  71848. {
  71849. std :: string message = "Encountered an infinite recursion." ;
  71850. boost :: regex_error e ( message , boost :: regex_constants :: error_bad_pattern , 0 ) ;
  71851. e . raise ( ) ;
  71852. }
  71853. }
  71854. else if ( recursion_start == 0 )
  71855. {
  71856. recursion_start = state ;
  71857. recursion_restart = state -> next . p ;
  71858. state = static_cast < re_jump * > ( state ) -> alt . p ;
  71859. m_recursion_checks [ recursion_sub ] = true ;
  71860. break ;
  71861. }
  71862. m_recursion_checks [ recursion_sub ] = true ;
  71863.  
  71864. ( ( void ) 0 ) ;
  71865. }
  71866. case syntax_element_backref :
  71867.  
  71868. if ( pnull )
  71869. * pnull |= mask ;
  71870. ( ( void ) 0 ) ;
  71871. case syntax_element_wild :
  71872. {
  71873.  
  71874. set_all_masks ( l_map , mask ) ;
  71875. return ;
  71876. }
  71877. case syntax_element_match :
  71878. {
  71879.  
  71880. set_all_masks ( l_map , mask ) ;
  71881. if ( pnull )
  71882. * pnull |= mask ;
  71883. return ;
  71884. }
  71885. case syntax_element_word_start :
  71886. {
  71887.  
  71888. create_startmap ( state -> next . p , l_map , pnull , mask ) ;
  71889. if ( l_map )
  71890. {
  71891. l_map [ 0 ] |= mask_init ;
  71892. for ( unsigned int i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71893. {
  71894. if ( ! m_traits . isctype ( static_cast < charT > ( i ) , m_word_mask ) )
  71895. l_map [ i ] &= static_cast < unsigned char > ( ~ mask ) ;
  71896. }
  71897. }
  71898. return ;
  71899. }
  71900. case syntax_element_word_end :
  71901. {
  71902.  
  71903. create_startmap ( state -> next . p , l_map , pnull , mask ) ;
  71904. if ( l_map )
  71905. {
  71906. l_map [ 0 ] |= mask_init ;
  71907. for ( unsigned int i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71908. {
  71909. if ( m_traits . isctype ( static_cast < charT > ( i ) , m_word_mask ) )
  71910. l_map [ i ] &= static_cast < unsigned char > ( ~ mask ) ;
  71911. }
  71912. }
  71913. return ;
  71914. }
  71915. case syntax_element_buffer_end :
  71916. {
  71917.  
  71918. if ( pnull )
  71919. * pnull |= mask ;
  71920. return ;
  71921. }
  71922. case syntax_element_long_set :
  71923. if ( l_map )
  71924. {
  71925. typedef typename traits :: char_class_type m_type ;
  71926. if ( static_cast < re_set_long < m_type > * > ( state ) -> singleton )
  71927. {
  71928. l_map [ 0 ] |= mask_init ;
  71929. for ( unsigned int i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71930. {
  71931. charT c = static_cast < charT > ( i ) ;
  71932. if ( & c != re_is_set_member ( & c , & c + 1 , static_cast < re_set_long < m_type > * > ( state ) , * m_pdata , l_icase )
  71933. #1226
  71934. )
  71935. l_map [ i ] |= mask ;
  71936. }
  71937. }
  71938. else
  71939. set_all_masks ( l_map , mask ) ;
  71940. }
  71941. return ;
  71942. case syntax_element_set :
  71943. if ( l_map )
  71944. {
  71945. l_map [ 0 ] |= mask_init ;
  71946. for ( unsigned int i = 0 ; i < ( 1u << 8 ) ; ++ i )
  71947. {
  71948. if ( static_cast < re_set * > ( state ) -> _map [
  71949. static_cast < unsigned char > ( m_traits . translate ( static_cast < charT > ( i ) , l_icase ) ) ] )
  71950. l_map [ i ] |= mask ;
  71951. }
  71952. }
  71953. return ;
  71954. case syntax_element_jump :
  71955.  
  71956. state = static_cast < re_alt * > ( state ) -> alt . p ;
  71957. not_last_jump = - 1 ;
  71958. break ;
  71959. case syntax_element_alt :
  71960. case syntax_element_rep :
  71961. case syntax_element_dot_rep :
  71962. case syntax_element_char_rep :
  71963. case syntax_element_short_set_rep :
  71964. case syntax_element_long_set_rep :
  71965. {
  71966. re_alt * rep = static_cast < re_alt * > ( state ) ;
  71967. if ( rep -> _map [ 0 ] & mask_init )
  71968. {
  71969. if ( l_map )
  71970. {
  71971.  
  71972. l_map [ 0 ] |= mask_init ;
  71973. for ( unsigned int i = 0 ; i <= 255 ; ++ i )
  71974. {
  71975. if ( rep -> _map [ i ] & mask_any )
  71976. l_map [ i ] |= mask ;
  71977. }
  71978. }
  71979. if ( pnull )
  71980. {
  71981. if ( rep -> can_be_null & mask_any )
  71982. * pnull |= mask ;
  71983. }
  71984. }
  71985. else
  71986. {
  71987.  
  71988.  
  71989. if ( is_bad_repeat ( state ) )
  71990. {
  71991. set_all_masks ( l_map , mask ) ;
  71992. if ( pnull )
  71993. * pnull |= mask ;
  71994. return ;
  71995. }
  71996. set_bad_repeat ( state ) ;
  71997. create_startmap ( state -> next . p , l_map , pnull , mask ) ;
  71998. if ( ( state -> type == syntax_element_alt )
  71999. || ( static_cast < re_repeat * > ( state ) -> min == 0 )
  72000. || ( not_last_jump == 0 ) )
  72001. create_startmap ( rep -> alt . p , l_map , pnull , mask ) ;
  72002. }
  72003. }
  72004. return ;
  72005. case syntax_element_soft_buffer_end :
  72006.  
  72007. if ( l_map )
  72008. {
  72009. l_map [ 0 ] |= mask_init ;
  72010. l_map [ static_cast < unsigned > ( '\n' ) ] |= mask ;
  72011. l_map [ static_cast < unsigned > ( '\r' ) ] |= mask ;
  72012. }
  72013. if ( pnull )
  72014. * pnull |= mask ;
  72015. return ;
  72016. case syntax_element_endmark :
  72017.  
  72018. if ( static_cast < re_brace * > ( state ) -> index < 0 )
  72019. {
  72020.  
  72021. set_all_masks ( l_map , mask ) ;
  72022. if ( pnull )
  72023. * pnull |= mask ;
  72024. return ;
  72025. }
  72026. else if ( recursion_start && ( recursion_sub != 0 ) && ( recursion_sub == static_cast < re_brace * > ( state ) -> index )
  72027. #1318
  72028. )
  72029. {
  72030.  
  72031. recursion_start = 0 ;
  72032. state = recursion_restart ;
  72033. break ;
  72034. }
  72035. #1332
  72036. if ( m_pdata -> m_has_recursions && static_cast < re_brace * > ( state ) -> index )
  72037. {
  72038. bool ok = false ;
  72039. re_syntax_base * p = m_pdata -> m_first_state ;
  72040. while ( p )
  72041. {
  72042. if ( p -> type == syntax_element_recurse )
  72043. {
  72044. re_brace * p2 = static_cast < re_brace * > ( static_cast < re_jump * > ( p ) -> alt . p ) ;
  72045. if ( ( p2 -> type == syntax_element_startmark ) && ( p2 -> index == static_cast < re_brace * > ( state ) -> index ) )
  72046. {
  72047. ok = true ;
  72048. break ;
  72049. }
  72050. }
  72051. p = p -> next . p ;
  72052. }
  72053. if ( ok )
  72054. {
  72055. create_startmap ( p -> next . p , l_map , pnull , mask ) ;
  72056. }
  72057. }
  72058. state = state -> next . p ;
  72059. break ;
  72060.  
  72061. case syntax_element_startmark :
  72062.  
  72063. if ( static_cast < re_brace * > ( state ) -> index == - 3 )
  72064. {
  72065. state = state -> next . p -> next . p ;
  72066. break ;
  72067. }
  72068. ( ( void ) 0 ) ;
  72069. default :
  72070. state = state -> next . p ;
  72071. }
  72072. ++ not_last_jump ;
  72073. }
  72074. }
  72075.  
  72076. template < class charT , class traits >
  72077. unsigned basic_regex_creator < charT , traits > :: get_restart_type ( re_syntax_base * state )
  72078. {
  72079.  
  72080.  
  72081.  
  72082. while ( state )
  72083. {
  72084. switch ( state -> type )
  72085. {
  72086. case syntax_element_startmark :
  72087. case syntax_element_endmark :
  72088. state = state -> next . p ;
  72089. continue ;
  72090. case syntax_element_start_line :
  72091. return regbase :: restart_line ;
  72092. case syntax_element_word_start :
  72093. return regbase :: restart_word ;
  72094. case syntax_element_buffer_start :
  72095. return regbase :: restart_buf ;
  72096. case syntax_element_restart_continue :
  72097. return regbase :: restart_continue ;
  72098. default :
  72099. state = 0 ;
  72100. continue ;
  72101. }
  72102. }
  72103. return regbase :: restart_any ;
  72104. }
  72105.  
  72106. template < class charT , class traits >
  72107. void basic_regex_creator < charT , traits > :: set_all_masks ( unsigned char * bits , unsigned char mask )
  72108. {
  72109.  
  72110.  
  72111.  
  72112.  
  72113.  
  72114. if ( bits )
  72115. {
  72116. if ( bits [ 0 ] == 0 )
  72117. ( std :: memset ) ( bits , mask , 1u << 8 ) ;
  72118. else
  72119. {
  72120. for ( unsigned i = 0 ; i < ( 1u << 8 ) ; ++ i )
  72121. bits [ i ] |= mask ;
  72122. }
  72123. bits [ 0 ] |= mask_init ;
  72124. }
  72125. }
  72126.  
  72127. template < class charT , class traits >
  72128. bool basic_regex_creator < charT , traits > :: is_bad_repeat ( re_syntax_base * pt )
  72129. {
  72130. switch ( pt -> type )
  72131. {
  72132. case syntax_element_rep :
  72133. case syntax_element_dot_rep :
  72134. case syntax_element_char_rep :
  72135. case syntax_element_short_set_rep :
  72136. case syntax_element_long_set_rep :
  72137. {
  72138. unsigned state_id = static_cast < re_repeat * > ( pt ) -> state_id ;
  72139. if ( state_id > sizeof ( m_bad_repeats ) * 8 )
  72140. return true ;
  72141. static const boost :: uintmax_t one = 1uL ;
  72142. return m_bad_repeats & ( one << state_id ) ;
  72143. }
  72144. default :
  72145. return false ;
  72146. }
  72147. }
  72148.  
  72149. template < class charT , class traits >
  72150. void basic_regex_creator < charT , traits > :: set_bad_repeat ( re_syntax_base * pt )
  72151. {
  72152. switch ( pt -> type )
  72153. {
  72154. case syntax_element_rep :
  72155. case syntax_element_dot_rep :
  72156. case syntax_element_char_rep :
  72157. case syntax_element_short_set_rep :
  72158. case syntax_element_long_set_rep :
  72159. {
  72160. unsigned state_id = static_cast < re_repeat * > ( pt ) -> state_id ;
  72161. static const boost :: uintmax_t one = 1uL ;
  72162. if ( state_id <= sizeof ( m_bad_repeats ) * 8 )
  72163. m_bad_repeats |= ( one << state_id ) ;
  72164. }
  72165. break ;
  72166. default :
  72167. break ;
  72168. }
  72169. }
  72170.  
  72171. template < class charT , class traits >
  72172. syntax_element_type basic_regex_creator < charT , traits > :: get_repeat_type ( re_syntax_base * state )
  72173. {
  72174. typedef typename traits :: char_class_type m_type ;
  72175. if ( state -> type == syntax_element_rep )
  72176. {
  72177.  
  72178. if ( state -> next . p -> next . p -> next . p == static_cast < re_alt * > ( state ) -> alt . p )
  72179. {
  72180. switch ( state -> next . p -> type )
  72181. {
  72182. case re_detail :: syntax_element_wild :
  72183. return re_detail :: syntax_element_dot_rep ;
  72184. case re_detail :: syntax_element_literal :
  72185. return re_detail :: syntax_element_char_rep ;
  72186. case re_detail :: syntax_element_set :
  72187. return re_detail :: syntax_element_short_set_rep ;
  72188. case re_detail :: syntax_element_long_set :
  72189. if ( static_cast < re_detail :: re_set_long < m_type > * > ( state -> next . p ) -> singleton )
  72190. return re_detail :: syntax_element_long_set_rep ;
  72191. break ;
  72192. default :
  72193. break ;
  72194. }
  72195. }
  72196. }
  72197. return state -> type ;
  72198. }
  72199.  
  72200. template < class charT , class traits >
  72201. void basic_regex_creator < charT , traits > :: probe_leading_repeat ( re_syntax_base * state )
  72202. {
  72203.  
  72204.  
  72205. do
  72206. {
  72207. switch ( state -> type )
  72208. {
  72209. case syntax_element_startmark :
  72210. if ( static_cast < re_brace * > ( state ) -> index >= 0 )
  72211. {
  72212. state = state -> next . p ;
  72213. continue ;
  72214. }
  72215. if ( ( static_cast < re_brace * > ( state ) -> index == - 1 )
  72216. || ( static_cast < re_brace * > ( state ) -> index == - 2 ) )
  72217. {
  72218.  
  72219. state = static_cast < const re_jump * > ( state -> next . p ) -> alt . p -> next . p ;
  72220. continue ;
  72221. }
  72222. if ( static_cast < re_brace * > ( state ) -> index == - 3 )
  72223. {
  72224.  
  72225. state = state -> next . p -> next . p ;
  72226. continue ;
  72227. }
  72228. return ;
  72229. case syntax_element_endmark :
  72230. case syntax_element_start_line :
  72231. case syntax_element_end_line :
  72232. case syntax_element_word_boundary :
  72233. case syntax_element_within_word :
  72234. case syntax_element_word_start :
  72235. case syntax_element_word_end :
  72236. case syntax_element_buffer_start :
  72237. case syntax_element_buffer_end :
  72238. case syntax_element_restart_continue :
  72239. state = state -> next . p ;
  72240. break ;
  72241. case syntax_element_dot_rep :
  72242. case syntax_element_char_rep :
  72243. case syntax_element_short_set_rep :
  72244. case syntax_element_long_set_rep :
  72245. if ( this -> m_has_backrefs == 0 )
  72246. static_cast < re_repeat * > ( state ) -> leading = true ;
  72247. ( ( void ) 0 ) ;
  72248. default :
  72249. return ;
  72250. }
  72251. } while ( state ) ;
  72252. }
  72253.  
  72254.  
  72255. }
  72256.  
  72257. }
  72258. #1 "./boost/regex/v4/basic_regex_parser.hpp"
  72259. #33
  72260. namespace boost {
  72261. namespace re_detail {
  72262. #41
  72263. template < class charT , class traits >
  72264. class basic_regex_parser : public basic_regex_creator < charT , traits >
  72265. {
  72266. public :
  72267. basic_regex_parser ( regex_data < charT , traits > * data ) ;
  72268. void parse ( const charT * p1 , const charT * p2 , unsigned flags ) ;
  72269. void fail ( regex_constants :: error_type error_code , std :: ptrdiff_t position ) ;
  72270. void fail ( regex_constants :: error_type error_code , std :: ptrdiff_t position , std :: string message , std :: ptrdiff_t
  72271. #48
  72272. start_pos ) ;
  72273. void fail ( regex_constants :: error_type error_code , std :: ptrdiff_t position , const std :: string & message )
  72274. {
  72275. fail ( error_code , position , message , position ) ;
  72276. }
  72277.  
  72278. bool parse_all ( ) ;
  72279. bool parse_basic ( ) ;
  72280. bool parse_extended ( ) ;
  72281. bool parse_literal ( ) ;
  72282. bool parse_open_paren ( ) ;
  72283. bool parse_basic_escape ( ) ;
  72284. bool parse_extended_escape ( ) ;
  72285. bool parse_match_any ( ) ;
  72286. bool parse_repeat ( std :: size_t low = 0 , std :: size_t high = ( std :: numeric_limits < std :: size_t > :: max ) ( ) )
  72287. #62
  72288. ;
  72289. bool parse_repeat_range ( bool isbasic ) ;
  72290. bool parse_alt ( ) ;
  72291. bool parse_set ( ) ;
  72292. bool parse_backref ( ) ;
  72293. void parse_set_literal ( basic_char_set < charT , traits > & char_set ) ;
  72294. bool parse_inner_set ( basic_char_set < charT , traits > & char_set ) ;
  72295. bool parse_QE ( ) ;
  72296. bool parse_perl_extension ( ) ;
  72297. bool add_emacs_code ( bool negate ) ;
  72298. bool unwind_alts ( std :: ptrdiff_t last_paren_start ) ;
  72299. digraph < charT > get_next_set_literal ( basic_char_set < charT , traits > & char_set ) ;
  72300. charT unescape_character ( ) ;
  72301. regex_constants :: syntax_option_type parse_options ( ) ;
  72302.  
  72303. private :
  72304. typedef bool ( basic_regex_parser :: * parser_proc_type ) ( ) ;
  72305. typedef typename traits :: string_type string_type ;
  72306. typedef typename traits :: char_class_type char_class_type ;
  72307. parser_proc_type m_parser_proc ;
  72308. const charT * m_base ;
  72309. const charT * m_end ;
  72310. const charT * m_position ;
  72311. unsigned m_mark_count ;
  72312. int m_mark_reset ;
  72313. unsigned m_max_mark ;
  72314. std :: ptrdiff_t m_paren_start ;
  72315. std :: ptrdiff_t m_alt_insert_point ;
  72316. bool m_has_case_change ;
  72317. #97
  72318. std :: vector < std :: ptrdiff_t > m_alt_jumps ;
  72319.  
  72320.  
  72321. basic_regex_parser & operator = ( const basic_regex_parser & ) ;
  72322. basic_regex_parser ( const basic_regex_parser & ) ;
  72323. } ;
  72324.  
  72325. template < class charT , class traits >
  72326. basic_regex_parser < charT , traits > :: basic_regex_parser ( regex_data < charT , traits > * data )
  72327. : basic_regex_creator < charT , traits > ( data ) , m_mark_count ( 0 ) , m_mark_reset ( - 1 ) , m_max_mark ( 0 ) , m_paren_start
  72328. #106
  72329. ( 0 ) , m_alt_insert_point ( 0 ) , m_has_case_change ( false )
  72330. {
  72331. }
  72332.  
  72333. template < class charT , class traits >
  72334. void basic_regex_parser < charT , traits > :: parse ( const charT * p1 , const charT * p2 , unsigned l_flags )
  72335. {
  72336.  
  72337. this -> init ( l_flags ) ;
  72338.  
  72339. m_position = m_base = p1 ;
  72340. m_end = p2 ;
  72341.  
  72342. if ( ( p1 == p2 ) &&
  72343. (
  72344. ( ( l_flags & regbase :: main_option_type ) != regbase :: perl_syntax_group )
  72345. || ( l_flags & regbase :: no_empty_expressions )
  72346. )
  72347. )
  72348. {
  72349. fail ( regex_constants :: error_empty , 0 ) ;
  72350. return ;
  72351. }
  72352.  
  72353. switch ( l_flags & regbase :: main_option_type )
  72354. {
  72355. case regbase :: perl_syntax_group :
  72356. {
  72357. m_parser_proc = & basic_regex_parser < charT , traits > :: parse_extended ;
  72358.  
  72359.  
  72360.  
  72361. re_brace * br = static_cast < re_brace * > ( this -> append_state ( syntax_element_startmark , sizeof ( re_brace ) ) ) ;
  72362. #138
  72363.  
  72364. br -> index = 0 ;
  72365. br -> icase = this -> flags ( ) & regbase :: icase ;
  72366. break ;
  72367. }
  72368. case regbase :: basic_syntax_group :
  72369. m_parser_proc = & basic_regex_parser < charT , traits > :: parse_basic ;
  72370. break ;
  72371. case regbase :: literal :
  72372. m_parser_proc = & basic_regex_parser < charT , traits > :: parse_literal ;
  72373. break ;
  72374. default :
  72375.  
  72376.  
  72377. fail ( regex_constants :: error_unknown , 0 , "An invalid combination of regular expression syntax flags was used." ) ;
  72378. return ;
  72379. }
  72380.  
  72381.  
  72382. bool result = parse_all ( ) ;
  72383.  
  72384.  
  72385.  
  72386. unwind_alts ( - 1 ) ;
  72387.  
  72388. this -> flags ( l_flags ) ;
  72389.  
  72390.  
  72391. if ( ! result )
  72392. {
  72393. fail ( regex_constants :: error_paren , :: boost :: re_detail :: distance ( m_base , m_position ) , "Found a closing ) with no corresponding openening parenthesis."
  72394. #168
  72395. ) ;
  72396. return ;
  72397. }
  72398.  
  72399. if ( this -> m_pdata -> m_status )
  72400. return ;
  72401.  
  72402. this -> m_pdata -> m_mark_count = 1 + m_mark_count ;
  72403. this -> finalize ( p1 , p2 ) ;
  72404. }
  72405.  
  72406. template < class charT , class traits >
  72407. void basic_regex_parser < charT , traits > :: fail ( regex_constants :: error_type error_code , std :: ptrdiff_t position
  72408. #180
  72409. )
  72410. {
  72411.  
  72412. std :: string message = this -> m_pdata -> m_ptraits -> error_string ( error_code ) ;
  72413. fail ( error_code , position , message ) ;
  72414. }
  72415.  
  72416. template < class charT , class traits >
  72417. void basic_regex_parser < charT , traits > :: fail ( regex_constants :: error_type error_code , std :: ptrdiff_t position
  72418. #188
  72419. , std :: string message , std :: ptrdiff_t start_pos )
  72420. {
  72421. if ( 0 == this -> m_pdata -> m_status )
  72422. this -> m_pdata -> m_status = error_code ;
  72423. m_position = m_end ;
  72424.  
  72425.  
  72426.  
  72427.  
  72428.  
  72429. if ( start_pos == position )
  72430. start_pos = ( std :: max ) ( static_cast < std :: ptrdiff_t > ( 0 ) , position - static_cast < std :: ptrdiff_t > ( 10 )
  72431. #199
  72432. ) ;
  72433. std :: ptrdiff_t end_pos = ( std :: min ) ( position + static_cast < std :: ptrdiff_t > ( 10 ) , static_cast < std :: ptrdiff_t
  72434. #200
  72435. > ( m_end - m_base ) ) ;
  72436. if ( error_code != regex_constants :: error_empty )
  72437. {
  72438. if ( ( start_pos != 0 ) || ( end_pos != ( m_end - m_base ) ) )
  72439. message += "  The error occurred while parsing the regular expression fragment: '" ;
  72440. else
  72441. message += "  The error occurred while parsing the regular expression: '" ;
  72442. if ( start_pos != end_pos )
  72443. {
  72444. message += std :: string ( m_base + start_pos , m_base + position ) ;
  72445. message += ">>>HERE>>>" ;
  72446. message += std :: string ( m_base + position , m_base + end_pos ) ;
  72447. }
  72448. message += "'." ;
  72449. }
  72450.  
  72451.  
  72452.  
  72453. if ( 0 == ( this -> flags ( ) & regex_constants :: no_except ) )
  72454. {
  72455. boost :: regex_error e ( message , error_code , position ) ;
  72456. e . raise ( ) ;
  72457. }
  72458.  
  72459.  
  72460.  
  72461. }
  72462.  
  72463. template < class charT , class traits >
  72464. bool basic_regex_parser < charT , traits > :: parse_all ( )
  72465. {
  72466. bool result = true ;
  72467. while ( result && ( m_position != m_end ) )
  72468. {
  72469. result = ( this ->* m_parser_proc ) ( ) ;
  72470. }
  72471. return result ;
  72472. }
  72473.  
  72474.  
  72475.  
  72476.  
  72477.  
  72478. template < class charT , class traits >
  72479. bool basic_regex_parser < charT , traits > :: parse_basic ( )
  72480. {
  72481. switch ( this -> m_traits . syntax_type ( * m_position ) )
  72482. {
  72483. case regex_constants :: syntax_escape :
  72484. return parse_basic_escape ( ) ;
  72485. case regex_constants :: syntax_dot :
  72486. return parse_match_any ( ) ;
  72487. case regex_constants :: syntax_caret :
  72488. ++ m_position ;
  72489. this -> append_state ( syntax_element_start_line ) ;
  72490. break ;
  72491. case regex_constants :: syntax_dollar :
  72492. ++ m_position ;
  72493. this -> append_state ( syntax_element_end_line ) ;
  72494. break ;
  72495. case regex_constants :: syntax_star :
  72496. if ( ! ( this -> m_last_state ) || ( this -> m_last_state -> type == syntax_element_start_line ) )
  72497. return parse_literal ( ) ;
  72498. else
  72499. {
  72500. ++ m_position ;
  72501. return parse_repeat ( ) ;
  72502. }
  72503. case regex_constants :: syntax_plus :
  72504. if ( ! ( this -> m_last_state ) || ( this -> m_last_state -> type == syntax_element_start_line ) || ! ( this -> flags ( )
  72505. #269
  72506. & regbase :: emacs_ex ) )
  72507. return parse_literal ( ) ;
  72508. else
  72509. {
  72510. ++ m_position ;
  72511. return parse_repeat ( 1 ) ;
  72512. }
  72513. case regex_constants :: syntax_question :
  72514. if ( ! ( this -> m_last_state ) || ( this -> m_last_state -> type == syntax_element_start_line ) || ! ( this -> flags ( )
  72515. #277
  72516. & regbase :: emacs_ex ) )
  72517. return parse_literal ( ) ;
  72518. else
  72519. {
  72520. ++ m_position ;
  72521. return parse_repeat ( 0 , 1 ) ;
  72522. }
  72523. case regex_constants :: syntax_open_set :
  72524. return parse_set ( ) ;
  72525. case regex_constants :: syntax_newline :
  72526. if ( this -> flags ( ) & regbase :: newline_alt )
  72527. return parse_alt ( ) ;
  72528. else
  72529. return parse_literal ( ) ;
  72530. default :
  72531. return parse_literal ( ) ;
  72532. }
  72533. return true ;
  72534. }
  72535.  
  72536. template < class charT , class traits >
  72537. bool basic_regex_parser < charT , traits > :: parse_extended ( )
  72538. {
  72539. bool result = true ;
  72540. switch ( this -> m_traits . syntax_type ( * m_position ) )
  72541. {
  72542. case regex_constants :: syntax_open_mark :
  72543. return parse_open_paren ( ) ;
  72544. case regex_constants :: syntax_close_mark :
  72545. return false ;
  72546. case regex_constants :: syntax_escape :
  72547. return parse_extended_escape ( ) ;
  72548. case regex_constants :: syntax_dot :
  72549. return parse_match_any ( ) ;
  72550. case regex_constants :: syntax_caret :
  72551. ++ m_position ;
  72552. this -> append_state (
  72553. ( this -> flags ( ) & regex_constants :: no_mod_m ? syntax_element_buffer_start : syntax_element_start_line ) ) ;
  72554. break ;
  72555. case regex_constants :: syntax_dollar :
  72556. ++ m_position ;
  72557. this -> append_state (
  72558. ( this -> flags ( ) & regex_constants :: no_mod_m ? syntax_element_buffer_end : syntax_element_end_line ) ) ;
  72559. break ;
  72560. case regex_constants :: syntax_star :
  72561. if ( m_position == this -> m_base )
  72562. {
  72563. fail ( regex_constants :: error_badrepeat , 0 , "The repeat operator \"*\" cannot start a regular expression." ) ;
  72564. return false ;
  72565. }
  72566. ++ m_position ;
  72567. return parse_repeat ( ) ;
  72568. case regex_constants :: syntax_question :
  72569. if ( m_position == this -> m_base )
  72570. {
  72571. fail ( regex_constants :: error_badrepeat , 0 , "The repeat operator \"?\" cannot start a regular expression." ) ;
  72572. return false ;
  72573. }
  72574. ++ m_position ;
  72575. return parse_repeat ( 0 , 1 ) ;
  72576. case regex_constants :: syntax_plus :
  72577. if ( m_position == this -> m_base )
  72578. {
  72579. fail ( regex_constants :: error_badrepeat , 0 , "The repeat operator \"+\" cannot start a regular expression." ) ;
  72580. return false ;
  72581. }
  72582. ++ m_position ;
  72583. return parse_repeat ( 1 ) ;
  72584. case regex_constants :: syntax_open_brace :
  72585. ++ m_position ;
  72586. return parse_repeat_range ( false ) ;
  72587. case regex_constants :: syntax_close_brace :
  72588. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , "Found a closing repetition operator } with no corresponding {."
  72589. #349
  72590. ) ;
  72591. return false ;
  72592. case regex_constants :: syntax_or :
  72593. return parse_alt ( ) ;
  72594. case regex_constants :: syntax_open_set :
  72595. return parse_set ( ) ;
  72596. case regex_constants :: syntax_newline :
  72597. if ( this -> flags ( ) & regbase :: newline_alt )
  72598. return parse_alt ( ) ;
  72599. else
  72600. return parse_literal ( ) ;
  72601. case regex_constants :: syntax_hash :
  72602.  
  72603.  
  72604.  
  72605.  
  72606. if ( ( this -> flags ( )
  72607. & ( regbase :: no_perl_ex | regbase :: mod_x ) )
  72608. == regbase :: mod_x )
  72609. {
  72610. while ( ( m_position != m_end ) && ! is_separator ( * m_position ++ ) ) { }
  72611. return true ;
  72612. }
  72613. ( ( void ) 0 ) ;
  72614. default :
  72615. result = parse_literal ( ) ;
  72616. break ;
  72617. }
  72618. return result ;
  72619. }
  72620.  
  72621.  
  72622.  
  72623.  
  72624. template < class charT , class traits >
  72625. bool basic_regex_parser < charT , traits > :: parse_literal ( )
  72626. {
  72627.  
  72628.  
  72629. if (
  72630. ( ( this -> flags ( )
  72631. & ( regbase :: main_option_type | regbase :: mod_x | regbase :: no_perl_ex ) )
  72632. != regbase :: mod_x )
  72633. || ! this -> m_traits . isctype ( * m_position , this -> m_mask_space ) )
  72634. this -> append_literal ( * m_position ) ;
  72635. ++ m_position ;
  72636. return true ;
  72637. }
  72638.  
  72639. template < class charT , class traits >
  72640. bool basic_regex_parser < charT , traits > :: parse_open_paren ( )
  72641. {
  72642.  
  72643.  
  72644.  
  72645. if ( ++ m_position == m_end )
  72646. {
  72647. fail ( regex_constants :: error_paren , m_position - m_base ) ;
  72648. return false ;
  72649. }
  72650.  
  72651.  
  72652.  
  72653. if (
  72654. ( ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) == 0 )
  72655. || ( ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: emacs_ex ) ) == ( regbase :: basic_syntax_group | regbase
  72656. #414
  72657. :: emacs_ex ) )
  72658. )
  72659. {
  72660. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_question )
  72661. return parse_perl_extension ( ) ;
  72662. }
  72663.  
  72664.  
  72665.  
  72666. unsigned markid = 0 ;
  72667. if ( 0 == ( this -> flags ( ) & regbase :: nosubs ) )
  72668. {
  72669. markid = ++ m_mark_count ;
  72670.  
  72671. if ( this -> flags ( ) & regbase :: save_subexpression_location )
  72672. this -> m_pdata -> m_subs . push_back ( std :: pair < std :: size_t , std :: size_t > ( std :: distance ( m_base , m_position
  72673. #429
  72674. ) - 1 , 0 ) ) ;
  72675.  
  72676.  
  72677.  
  72678.  
  72679. }
  72680. re_brace * pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_startmark , sizeof ( re_brace ) ) ) ;
  72681. #435
  72682.  
  72683. pb -> index = markid ;
  72684. pb -> icase = this -> flags ( ) & regbase :: icase ;
  72685. std :: ptrdiff_t last_paren_start = this -> getoffset ( pb ) ;
  72686.  
  72687. std :: ptrdiff_t last_alt_point = m_alt_insert_point ;
  72688. this -> m_pdata -> m_data . align ( ) ;
  72689. m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  72690.  
  72691.  
  72692.  
  72693. regex_constants :: syntax_option_type opts = this -> flags ( ) ;
  72694. bool old_case_change = m_has_case_change ;
  72695. m_has_case_change = false ;
  72696.  
  72697.  
  72698.  
  72699. int mark_reset = m_mark_reset ;
  72700. m_mark_reset = - 1 ;
  72701.  
  72702.  
  72703.  
  72704.  
  72705. parse_all ( ) ;
  72706.  
  72707.  
  72708.  
  72709. if ( 0 == unwind_alts ( last_paren_start ) )
  72710. return false ;
  72711.  
  72712.  
  72713.  
  72714. if ( m_has_case_change )
  72715. {
  72716.  
  72717.  
  72718.  
  72719. static_cast < re_case * > (
  72720. this -> append_state ( syntax_element_toggle_case , sizeof ( re_case ) )
  72721. ) -> icase = opts & regbase :: icase ;
  72722. }
  72723. this -> flags ( opts ) ;
  72724. m_has_case_change = old_case_change ;
  72725.  
  72726.  
  72727.  
  72728. m_mark_reset = mark_reset ;
  72729.  
  72730.  
  72731.  
  72732. if ( m_position == m_end )
  72733. {
  72734. this -> fail ( regex_constants :: error_paren , :: boost :: re_detail :: distance ( m_base , m_end ) ) ;
  72735. return false ;
  72736. }
  72737. ( ( void ) 0 ) ;
  72738.  
  72739. if ( markid && ( this -> flags ( ) & regbase :: save_subexpression_location ) )
  72740. this -> m_pdata -> m_subs . at ( markid - 1 ) . second = std :: distance ( m_base , m_position ) ;
  72741.  
  72742.  
  72743.  
  72744.  
  72745. ++ m_position ;
  72746.  
  72747.  
  72748.  
  72749. pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_endmark , sizeof ( re_brace ) ) ) ;
  72750. pb -> index = markid ;
  72751. pb -> icase = this -> flags ( ) & regbase :: icase ;
  72752. this -> m_paren_start = last_paren_start ;
  72753.  
  72754.  
  72755.  
  72756. this -> m_alt_insert_point = last_alt_point ;
  72757.  
  72758.  
  72759.  
  72760. if ( ( markid > 0 ) && ( markid < sizeof ( unsigned ) * 8 ) )
  72761. this -> m_backrefs |= 1u << ( markid - 1 ) ;
  72762.  
  72763. return true ;
  72764. }
  72765.  
  72766. template < class charT , class traits >
  72767. bool basic_regex_parser < charT , traits > :: parse_basic_escape ( )
  72768. {
  72769. ++ m_position ;
  72770. bool result = true ;
  72771. switch ( this -> m_traits . escape_syntax_type ( * m_position ) )
  72772. {
  72773. case regex_constants :: syntax_open_mark :
  72774. return parse_open_paren ( ) ;
  72775. case regex_constants :: syntax_close_mark :
  72776. return false ;
  72777. case regex_constants :: syntax_plus :
  72778. if ( this -> flags ( ) & regex_constants :: bk_plus_qm )
  72779. {
  72780. ++ m_position ;
  72781. return parse_repeat ( 1 ) ;
  72782. }
  72783. else
  72784. return parse_literal ( ) ;
  72785. case regex_constants :: syntax_question :
  72786. if ( this -> flags ( ) & regex_constants :: bk_plus_qm )
  72787. {
  72788. ++ m_position ;
  72789. return parse_repeat ( 0 , 1 ) ;
  72790. }
  72791. else
  72792. return parse_literal ( ) ;
  72793. case regex_constants :: syntax_open_brace :
  72794. if ( this -> flags ( ) & regbase :: no_intervals )
  72795. return parse_literal ( ) ;
  72796. ++ m_position ;
  72797. return parse_repeat_range ( true ) ;
  72798. case regex_constants :: syntax_close_brace :
  72799. if ( this -> flags ( ) & regbase :: no_intervals )
  72800. return parse_literal ( ) ;
  72801. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , "Found a closing repetition operator } with no corresponding {."
  72802. #554
  72803. ) ;
  72804. return false ;
  72805. case regex_constants :: syntax_or :
  72806. if ( this -> flags ( ) & regbase :: bk_vbar )
  72807. return parse_alt ( ) ;
  72808. else
  72809. result = parse_literal ( ) ;
  72810. break ;
  72811. case regex_constants :: syntax_digit :
  72812. return parse_backref ( ) ;
  72813. case regex_constants :: escape_type_start_buffer :
  72814. if ( this -> flags ( ) & regbase :: emacs_ex )
  72815. {
  72816. ++ m_position ;
  72817. this -> append_state ( syntax_element_buffer_start ) ;
  72818. }
  72819. else
  72820. result = parse_literal ( ) ;
  72821. break ;
  72822. case regex_constants :: escape_type_end_buffer :
  72823. if ( this -> flags ( ) & regbase :: emacs_ex )
  72824. {
  72825. ++ m_position ;
  72826. this -> append_state ( syntax_element_buffer_end ) ;
  72827. }
  72828. else
  72829. result = parse_literal ( ) ;
  72830. break ;
  72831. case regex_constants :: escape_type_word_assert :
  72832. if ( this -> flags ( ) & regbase :: emacs_ex )
  72833. {
  72834. ++ m_position ;
  72835. this -> append_state ( syntax_element_word_boundary ) ;
  72836. }
  72837. else
  72838. result = parse_literal ( ) ;
  72839. break ;
  72840. case regex_constants :: escape_type_not_word_assert :
  72841. if ( this -> flags ( ) & regbase :: emacs_ex )
  72842. {
  72843. ++ m_position ;
  72844. this -> append_state ( syntax_element_within_word ) ;
  72845. }
  72846. else
  72847. result = parse_literal ( ) ;
  72848. break ;
  72849. case regex_constants :: escape_type_left_word :
  72850. if ( this -> flags ( ) & regbase :: emacs_ex )
  72851. {
  72852. ++ m_position ;
  72853. this -> append_state ( syntax_element_word_start ) ;
  72854. }
  72855. else
  72856. result = parse_literal ( ) ;
  72857. break ;
  72858. case regex_constants :: escape_type_right_word :
  72859. if ( this -> flags ( ) & regbase :: emacs_ex )
  72860. {
  72861. ++ m_position ;
  72862. this -> append_state ( syntax_element_word_end ) ;
  72863. }
  72864. else
  72865. result = parse_literal ( ) ;
  72866. break ;
  72867. default :
  72868. if ( this -> flags ( ) & regbase :: emacs_ex )
  72869. {
  72870. bool negate = true ;
  72871. switch ( * m_position )
  72872. {
  72873. case 'w' :
  72874. negate = false ;
  72875. ( ( void ) 0 ) ;
  72876. case 'W' :
  72877. {
  72878. basic_char_set < charT , traits > char_set ;
  72879. if ( negate )
  72880. char_set . negate ( ) ;
  72881. char_set . add_class ( this -> m_word_mask ) ;
  72882. if ( 0 == this -> append_set ( char_set ) )
  72883. {
  72884. fail ( regex_constants :: error_ctype , m_position - m_base ) ;
  72885. return false ;
  72886. }
  72887. ++ m_position ;
  72888. return true ;
  72889. }
  72890. case 's' :
  72891. negate = false ;
  72892. ( ( void ) 0 ) ;
  72893. case 'S' :
  72894. return add_emacs_code ( negate ) ;
  72895. case 'c' :
  72896. case 'C' :
  72897.  
  72898. fail ( regex_constants :: error_escape , m_position - m_base , "The \\c and \\C escape sequences are not supported by POSIX basic regular expressions: try the Perl syntax instead."
  72899. #649
  72900. ) ;
  72901. return false ;
  72902. default :
  72903. break ;
  72904. }
  72905. }
  72906. result = parse_literal ( ) ;
  72907. break ;
  72908. }
  72909. return result ;
  72910. }
  72911.  
  72912. template < class charT , class traits >
  72913. bool basic_regex_parser < charT , traits > :: parse_extended_escape ( )
  72914. {
  72915. ++ m_position ;
  72916. if ( m_position == m_end )
  72917. {
  72918. fail ( regex_constants :: error_escape , m_position - m_base , "Incomplete escape sequence found." ) ;
  72919. return false ;
  72920. }
  72921. bool negate = false ;
  72922. switch ( this -> m_traits . escape_syntax_type ( * m_position ) )
  72923. {
  72924. case regex_constants :: escape_type_not_class :
  72925. negate = true ;
  72926. ( ( void ) 0 ) ;
  72927. case regex_constants :: escape_type_class :
  72928. {
  72929. escape_type_class_jump :
  72930. typedef typename traits :: char_class_type m_type ;
  72931. m_type m = this -> m_traits . lookup_classname ( m_position , m_position + 1 ) ;
  72932. if ( m != 0 )
  72933. {
  72934. basic_char_set < charT , traits > char_set ;
  72935. if ( negate )
  72936. char_set . negate ( ) ;
  72937. char_set . add_class ( m ) ;
  72938. if ( 0 == this -> append_set ( char_set ) )
  72939. {
  72940. fail ( regex_constants :: error_ctype , m_position - m_base ) ;
  72941. return false ;
  72942. }
  72943. ++ m_position ;
  72944. return true ;
  72945. }
  72946.  
  72947.  
  72948.  
  72949. this -> append_literal ( unescape_character ( ) ) ;
  72950. break ;
  72951. }
  72952. case regex_constants :: syntax_digit :
  72953. return parse_backref ( ) ;
  72954. case regex_constants :: escape_type_left_word :
  72955. ++ m_position ;
  72956. this -> append_state ( syntax_element_word_start ) ;
  72957. break ;
  72958. case regex_constants :: escape_type_right_word :
  72959. ++ m_position ;
  72960. this -> append_state ( syntax_element_word_end ) ;
  72961. break ;
  72962. case regex_constants :: escape_type_start_buffer :
  72963. ++ m_position ;
  72964. this -> append_state ( syntax_element_buffer_start ) ;
  72965. break ;
  72966. case regex_constants :: escape_type_end_buffer :
  72967. ++ m_position ;
  72968. this -> append_state ( syntax_element_buffer_end ) ;
  72969. break ;
  72970. case regex_constants :: escape_type_word_assert :
  72971. ++ m_position ;
  72972. this -> append_state ( syntax_element_word_boundary ) ;
  72973. break ;
  72974. case regex_constants :: escape_type_not_word_assert :
  72975. ++ m_position ;
  72976. this -> append_state ( syntax_element_within_word ) ;
  72977. break ;
  72978. case regex_constants :: escape_type_Z :
  72979. ++ m_position ;
  72980. this -> append_state ( syntax_element_soft_buffer_end ) ;
  72981. break ;
  72982. case regex_constants :: escape_type_Q :
  72983. return parse_QE ( ) ;
  72984. case regex_constants :: escape_type_C :
  72985. return parse_match_any ( ) ;
  72986. case regex_constants :: escape_type_X :
  72987. ++ m_position ;
  72988. this -> append_state ( syntax_element_combining ) ;
  72989. break ;
  72990. case regex_constants :: escape_type_G :
  72991. ++ m_position ;
  72992. this -> append_state ( syntax_element_restart_continue ) ;
  72993. break ;
  72994. case regex_constants :: escape_type_not_property :
  72995. negate = true ;
  72996. ( ( void ) 0 ) ;
  72997. case regex_constants :: escape_type_property :
  72998. {
  72999. ++ m_position ;
  73000. char_class_type m ;
  73001. if ( m_position == m_end )
  73002. {
  73003. fail ( regex_constants :: error_escape , m_position - m_base , "Incomplete property escape found." ) ;
  73004. return false ;
  73005. }
  73006.  
  73007. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_open_brace )
  73008. {
  73009. const charT * base = m_position ;
  73010.  
  73011. while ( ( m_position != m_end ) && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_brace
  73012. #760
  73013. ) )
  73014. ++ m_position ;
  73015. if ( m_position == m_end )
  73016. {
  73017. fail ( regex_constants :: error_escape , m_position - m_base , "Closing } missing from property escape sequence." ) ;
  73018. return false ;
  73019. }
  73020. m = this -> m_traits . lookup_classname ( ++ base , m_position ++ ) ;
  73021. }
  73022. else
  73023. {
  73024. m = this -> m_traits . lookup_classname ( m_position , m_position + 1 ) ;
  73025. ++ m_position ;
  73026. }
  73027. if ( m != 0 )
  73028. {
  73029. basic_char_set < charT , traits > char_set ;
  73030. if ( negate )
  73031. char_set . negate ( ) ;
  73032. char_set . add_class ( m ) ;
  73033. if ( 0 == this -> append_set ( char_set ) )
  73034. {
  73035. fail ( regex_constants :: error_ctype , m_position - m_base ) ;
  73036. return false ;
  73037. }
  73038. return true ;
  73039. }
  73040. fail ( regex_constants :: error_ctype , m_position - m_base , "Escape sequence was neither a valid property nor a valid character class name."
  73041. #787
  73042. ) ;
  73043. return false ;
  73044. }
  73045. case regex_constants :: escape_type_reset_start_mark :
  73046. if ( 0 == ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) )
  73047. {
  73048. re_brace * pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_startmark , sizeof ( re_brace ) ) ) ;
  73049. #793
  73050.  
  73051. pb -> index = - 5 ;
  73052. pb -> icase = this -> flags ( ) & regbase :: icase ;
  73053. this -> m_pdata -> m_data . align ( ) ;
  73054. ++ m_position ;
  73055. return true ;
  73056. }
  73057. goto escape_type_class_jump ;
  73058. case regex_constants :: escape_type_line_ending :
  73059. if ( 0 == ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) )
  73060. {
  73061. const charT * e = get_escape_R_string < charT > ( ) ;
  73062. const charT * old_position = m_position ;
  73063. const charT * old_end = m_end ;
  73064. const charT * old_base = m_base ;
  73065. m_position = e ;
  73066. m_base = e ;
  73067. m_end = e + traits :: length ( e ) ;
  73068. bool r = parse_all ( ) ;
  73069. m_position = ++ old_position ;
  73070. m_end = old_end ;
  73071. m_base = old_base ;
  73072. return r ;
  73073. }
  73074. goto escape_type_class_jump ;
  73075. case regex_constants :: escape_type_extended_backref :
  73076. if ( 0 == ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) )
  73077. {
  73078. bool have_brace = false ;
  73079. bool negative = false ;
  73080. static const char * incomplete_message = "Incomplete \\g escape found." ;
  73081. if ( ++ m_position == m_end )
  73082. {
  73083. fail ( regex_constants :: error_escape , m_position - m_base , incomplete_message ) ;
  73084. return false ;
  73085. }
  73086.  
  73087. regex_constants :: syntax_type syn = this -> m_traits . syntax_type ( * m_position ) ;
  73088. regex_constants :: syntax_type syn_end = 0 ;
  73089. if ( ( syn == regex_constants :: syntax_open_brace )
  73090. || ( syn == regex_constants :: escape_type_left_word )
  73091. || ( syn == regex_constants :: escape_type_end_buffer ) )
  73092. {
  73093. if ( ++ m_position == m_end )
  73094. {
  73095. fail ( regex_constants :: error_escape , m_position - m_base , incomplete_message ) ;
  73096. return false ;
  73097. }
  73098. have_brace = true ;
  73099. switch ( syn )
  73100. {
  73101. case regex_constants :: syntax_open_brace :
  73102. syn_end = regex_constants :: syntax_close_brace ;
  73103. break ;
  73104. case regex_constants :: escape_type_left_word :
  73105. syn_end = regex_constants :: escape_type_right_word ;
  73106. break ;
  73107. default :
  73108. syn_end = regex_constants :: escape_type_end_buffer ;
  73109. break ;
  73110. }
  73111. }
  73112. negative = ( * m_position == static_cast < charT > ( '-' ) ) ;
  73113. if ( ( negative ) && ( ++ m_position == m_end ) )
  73114. {
  73115. fail ( regex_constants :: error_escape , m_position - m_base , incomplete_message ) ;
  73116. return false ;
  73117. }
  73118. const charT * pc = m_position ;
  73119. int i = this -> m_traits . toi ( pc , m_end , 10 ) ;
  73120. if ( ( i < 0 ) && syn_end )
  73121. {
  73122.  
  73123. const charT * base = m_position ;
  73124. while ( ( m_position != m_end ) && ( this -> m_traits . syntax_type ( * m_position ) != syn_end ) )
  73125. {
  73126. ++ m_position ;
  73127. }
  73128. i = hash_value_from_capture_name ( base , m_position ) ;
  73129. pc = m_position ;
  73130. }
  73131. if ( negative )
  73132. i = 1 + m_mark_count - i ;
  73133. if ( ( ( i > 0 ) && ( this -> m_backrefs & ( 1u << ( i - 1 ) ) ) ) || ( ( i > 10000 ) && ( this -> m_pdata -> get_id ( i
  73134. #876
  73135. ) > 0 ) && ( this -> m_backrefs & ( 1u << ( this -> m_pdata -> get_id ( i ) - 1 ) ) ) ) )
  73136. {
  73137. m_position = pc ;
  73138. re_brace * pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_backref , sizeof ( re_brace ) ) ) ;
  73139. pb -> index = i ;
  73140. pb -> icase = this -> flags ( ) & regbase :: icase ;
  73141. }
  73142. else
  73143. {
  73144. fail ( regex_constants :: error_backref , m_position - m_base ) ;
  73145. return false ;
  73146. }
  73147. m_position = pc ;
  73148. if ( have_brace )
  73149. {
  73150. if ( ( m_position == m_end ) || ( this -> m_traits . syntax_type ( * m_position ) != syn_end ) )
  73151. {
  73152. fail ( regex_constants :: error_escape , m_position - m_base , incomplete_message ) ;
  73153. return false ;
  73154. }
  73155. ++ m_position ;
  73156. }
  73157. return true ;
  73158. }
  73159. goto escape_type_class_jump ;
  73160. case regex_constants :: escape_type_control_v :
  73161. if ( 0 == ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) )
  73162. goto escape_type_class_jump ;
  73163. ( ( void ) 0 ) ;
  73164. default :
  73165. this -> append_literal ( unescape_character ( ) ) ;
  73166. break ;
  73167. }
  73168. return true ;
  73169. }
  73170.  
  73171. template < class charT , class traits >
  73172. bool basic_regex_parser < charT , traits > :: parse_match_any ( )
  73173. {
  73174.  
  73175.  
  73176.  
  73177. ++ m_position ;
  73178. static_cast < re_dot * > (
  73179. this -> append_state ( syntax_element_wild , sizeof ( re_dot ) )
  73180. ) -> mask = static_cast < unsigned char > ( this -> flags ( ) & regbase :: no_mod_s
  73181. ? re_detail :: force_not_newline
  73182. : this -> flags ( ) & regbase :: mod_s ?
  73183. re_detail :: force_newline : re_detail :: dont_care ) ;
  73184. return true ;
  73185. }
  73186.  
  73187. template < class charT , class traits >
  73188. bool basic_regex_parser < charT , traits > :: parse_repeat ( std :: size_t low , std :: size_t high )
  73189. {
  73190. bool greedy = true ;
  73191. bool pocessive = false ;
  73192. std :: size_t insert_point ;
  73193.  
  73194.  
  73195.  
  73196. if ( ( m_position != m_end )
  73197. && (
  73198. ( 0 == ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) )
  73199. || ( ( regbase :: basic_syntax_group | regbase :: emacs_ex ) == ( this -> flags ( ) & ( regbase :: main_option_type | regbase
  73200. #940
  73201. :: emacs_ex ) ) )
  73202. )
  73203. )
  73204. {
  73205.  
  73206. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_question )
  73207. {
  73208. greedy = false ;
  73209. ++ m_position ;
  73210. }
  73211.  
  73212. if ( ( m_position != m_end )
  73213. && ( 0 == ( this -> flags ( ) & regbase :: main_option_type ) )
  73214. && ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_plus ) )
  73215. {
  73216. pocessive = true ;
  73217. ++ m_position ;
  73218. }
  73219. }
  73220. if ( 0 == this -> m_last_state )
  73221. {
  73222. fail ( regex_constants :: error_badrepeat , :: boost :: re_detail :: distance ( m_base , m_position ) , "Nothing to repeat."
  73223. #961
  73224. ) ;
  73225. return false ;
  73226. }
  73227. if ( this -> m_last_state -> type == syntax_element_endmark )
  73228. {
  73229.  
  73230. insert_point = this -> m_paren_start ;
  73231. }
  73232. else if ( ( this -> m_last_state -> type == syntax_element_literal ) && ( static_cast < re_literal * > ( this -> m_last_state
  73233. #969
  73234. ) -> length > 1 ) )
  73235. {
  73236.  
  73237. re_literal * lit = static_cast < re_literal * > ( this -> m_last_state ) ;
  73238. charT c = ( static_cast < charT * > ( static_cast < void * > ( lit + 1 ) ) ) [ lit -> length - 1 ] ;
  73239. -- ( lit -> length ) ;
  73240.  
  73241. lit = static_cast < re_literal * > ( this -> append_state ( syntax_element_literal , sizeof ( re_literal ) + sizeof ( charT
  73242. #976
  73243. ) ) ) ;
  73244. lit -> length = 1 ;
  73245. ( static_cast < charT * > ( static_cast < void * > ( lit + 1 ) ) ) [ 0 ] = c ;
  73246. insert_point = this -> getoffset ( this -> m_last_state ) ;
  73247. }
  73248. else
  73249. {
  73250.  
  73251. switch ( this -> m_last_state -> type )
  73252. {
  73253. case syntax_element_start_line :
  73254. case syntax_element_end_line :
  73255. case syntax_element_word_boundary :
  73256. case syntax_element_within_word :
  73257. case syntax_element_word_start :
  73258. case syntax_element_word_end :
  73259. case syntax_element_buffer_start :
  73260. case syntax_element_buffer_end :
  73261. case syntax_element_alt :
  73262. case syntax_element_soft_buffer_end :
  73263. case syntax_element_restart_continue :
  73264. case syntax_element_jump :
  73265. case syntax_element_startmark :
  73266. case syntax_element_backstep :
  73267.  
  73268. fail ( regex_constants :: error_badrepeat , m_position - m_base ) ;
  73269. return false ;
  73270. default :
  73271.  
  73272. break ;
  73273. }
  73274. insert_point = this -> getoffset ( this -> m_last_state ) ;
  73275. }
  73276.  
  73277.  
  73278.  
  73279. re_repeat * rep = static_cast < re_repeat * > ( this -> insert_state ( insert_point , syntax_element_rep , re_repeater_size
  73280. #1012
  73281. ) ) ;
  73282. rep -> min = low ;
  73283. rep -> max = high ;
  73284. rep -> greedy = greedy ;
  73285. rep -> leading = false ;
  73286.  
  73287. std :: ptrdiff_t rep_off = this -> getoffset ( rep ) ;
  73288.  
  73289. re_jump * jmp = static_cast < re_jump * > ( this -> append_state ( syntax_element_jump , sizeof ( re_jump ) ) ) ;
  73290. jmp -> alt . i = rep_off - this -> getoffset ( jmp ) ;
  73291. this -> m_pdata -> m_data . align ( ) ;
  73292.  
  73293. rep = static_cast < re_repeat * > ( this -> getaddress ( rep_off ) ) ;
  73294. rep -> alt . i = this -> m_pdata -> m_data . size ( ) - rep_off ;
  73295.  
  73296.  
  73297.  
  73298.  
  73299. if ( pocessive )
  73300. {
  73301. if ( m_position != m_end )
  73302. {
  73303.  
  73304.  
  73305.  
  73306.  
  73307. switch ( this -> m_traits . syntax_type ( * m_position ) )
  73308. {
  73309. case regex_constants :: syntax_star :
  73310. case regex_constants :: syntax_plus :
  73311. case regex_constants :: syntax_question :
  73312. case regex_constants :: syntax_open_brace :
  73313. fail ( regex_constants :: error_badrepeat , m_position - m_base ) ;
  73314. return false ;
  73315. }
  73316. }
  73317. re_brace * pb = static_cast < re_brace * > ( this -> insert_state ( insert_point , syntax_element_startmark , sizeof ( re_brace
  73318. #1048
  73319. ) ) ) ;
  73320. pb -> index = - 3 ;
  73321. pb -> icase = this -> flags ( ) & regbase :: icase ;
  73322. jmp = static_cast < re_jump * > ( this -> insert_state ( insert_point + sizeof ( re_brace ) , syntax_element_jump , sizeof
  73323. #1051
  73324. ( re_jump ) ) ) ;
  73325. this -> m_pdata -> m_data . align ( ) ;
  73326. jmp -> alt . i = this -> m_pdata -> m_data . size ( ) - this -> getoffset ( jmp ) ;
  73327. pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_endmark , sizeof ( re_brace ) ) ) ;
  73328. pb -> index = - 3 ;
  73329. pb -> icase = this -> flags ( ) & regbase :: icase ;
  73330. }
  73331. return true ;
  73332. }
  73333.  
  73334. template < class charT , class traits >
  73335. bool basic_regex_parser < charT , traits > :: parse_repeat_range ( bool isbasic )
  73336. {
  73337. static const char * incomplete_message = "Missing } in quantified repetition." ;
  73338.  
  73339.  
  73340.  
  73341. std :: size_t min , max ;
  73342. int v ;
  73343.  
  73344. while ( ( m_position != m_end ) && this -> m_traits . isctype ( * m_position , this -> m_mask_space ) )
  73345. ++ m_position ;
  73346. if ( this -> m_position == this -> m_end )
  73347. {
  73348. if ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) )
  73349. {
  73350. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73351. return false ;
  73352. }
  73353.  
  73354. -- m_position ;
  73355. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_brace ) -- m_position ;
  73356. return parse_literal ( ) ;
  73357. }
  73358.  
  73359. v = this -> m_traits . toi ( m_position , m_end , 10 ) ;
  73360.  
  73361. if ( v < 0 )
  73362. {
  73363. if ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) )
  73364. {
  73365. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73366. return false ;
  73367. }
  73368.  
  73369. -- m_position ;
  73370. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_brace ) -- m_position ;
  73371. return parse_literal ( ) ;
  73372. }
  73373. while ( ( m_position != m_end ) && this -> m_traits . isctype ( * m_position , this -> m_mask_space ) )
  73374. ++ m_position ;
  73375. if ( this -> m_position == this -> m_end )
  73376. {
  73377. if ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) )
  73378. {
  73379. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73380. return false ;
  73381. }
  73382.  
  73383. -- m_position ;
  73384. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_brace ) -- m_position ;
  73385. return parse_literal ( ) ;
  73386. }
  73387. min = v ;
  73388.  
  73389. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_comma )
  73390. {
  73391.  
  73392. ++ m_position ;
  73393.  
  73394. while ( ( m_position != m_end ) && this -> m_traits . isctype ( * m_position , this -> m_mask_space ) )
  73395. ++ m_position ;
  73396. if ( this -> m_position == this -> m_end )
  73397. {
  73398. if ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) )
  73399. {
  73400. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73401. return false ;
  73402. }
  73403.  
  73404. -- m_position ;
  73405. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_brace ) -- m_position ;
  73406. return parse_literal ( ) ;
  73407. }
  73408.  
  73409. v = this -> m_traits . toi ( m_position , m_end , 10 ) ;
  73410. max = ( v >= 0 ) ? ( std :: size_t ) v : ( std :: numeric_limits < std :: size_t > :: max ) ( ) ;
  73411. }
  73412. else
  73413. {
  73414.  
  73415. max = min ;
  73416. }
  73417.  
  73418. while ( ( m_position != m_end ) && this -> m_traits . isctype ( * m_position , this -> m_mask_space ) )
  73419. ++ m_position ;
  73420.  
  73421. if ( this -> m_position == this -> m_end )
  73422. {
  73423. if ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_perl_ex ) )
  73424. {
  73425. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73426. return false ;
  73427. }
  73428.  
  73429. -- m_position ;
  73430. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_brace ) -- m_position ;
  73431. return parse_literal ( ) ;
  73432. }
  73433. if ( isbasic )
  73434. {
  73435. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_escape )
  73436. {
  73437. ++ m_position ;
  73438. if ( this -> m_position == this -> m_end )
  73439. {
  73440. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73441. return false ;
  73442. }
  73443. }
  73444. else
  73445. {
  73446. fail ( regex_constants :: error_brace , this -> m_position - this -> m_base , incomplete_message ) ;
  73447. return false ;
  73448. }
  73449. }
  73450. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_close_brace )
  73451. ++ m_position ;
  73452. else
  73453. {
  73454.  
  73455. -- m_position ;
  73456. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_brace ) -- m_position ;
  73457. return parse_literal ( ) ;
  73458. }
  73459.  
  73460.  
  73461.  
  73462. if ( min > max )
  73463. {
  73464.  
  73465. m_position -= 2 ;
  73466. while ( this -> m_traits . isctype ( * m_position , this -> m_word_mask ) ) -- m_position ;
  73467. ++ m_position ;
  73468. fail ( regex_constants :: error_badbrace , m_position - m_base ) ;
  73469. return false ;
  73470. }
  73471. return parse_repeat ( min , max ) ;
  73472. }
  73473.  
  73474. template < class charT , class traits >
  73475. bool basic_regex_parser < charT , traits > :: parse_alt ( )
  73476. {
  73477.  
  73478.  
  73479.  
  73480.  
  73481. if (
  73482. ( ( this -> m_last_state == 0 ) || ( this -> m_last_state -> type == syntax_element_startmark ) )
  73483. &&
  73484. ! (
  73485. ( ( this -> flags ( ) & regbase :: main_option_type ) == regbase :: perl_syntax_group )
  73486. &&
  73487. ( ( this -> flags ( ) & regbase :: no_empty_expressions ) == 0 )
  73488. )
  73489. )
  73490. {
  73491. fail ( regex_constants :: error_empty , this -> m_position - this -> m_base , "A regular expression can start with the alternation operator |."
  73492. #1218
  73493. ) ;
  73494. return false ;
  73495. }
  73496.  
  73497.  
  73498.  
  73499. if ( m_max_mark < m_mark_count )
  73500. m_max_mark = m_mark_count ;
  73501. if ( m_mark_reset >= 0 )
  73502. m_mark_count = m_mark_reset ;
  73503.  
  73504. ++ m_position ;
  73505.  
  73506.  
  73507.  
  73508. re_syntax_base * pj = this -> append_state ( re_detail :: syntax_element_jump , sizeof ( re_jump ) ) ;
  73509. std :: ptrdiff_t jump_offset = this -> getoffset ( pj ) ;
  73510.  
  73511.  
  73512.  
  73513. re_alt * palt = static_cast < re_alt * > ( this -> insert_state ( this -> m_alt_insert_point , syntax_element_alt , re_alt_size
  73514. #1238
  73515. ) ) ;
  73516. jump_offset += re_alt_size ;
  73517. this -> m_pdata -> m_data . align ( ) ;
  73518. palt -> alt . i = this -> m_pdata -> m_data . size ( ) - this -> getoffset ( palt ) ;
  73519.  
  73520.  
  73521.  
  73522.  
  73523. this -> m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  73524.  
  73525.  
  73526.  
  73527.  
  73528. if ( m_has_case_change )
  73529. {
  73530. static_cast < re_case * > (
  73531. this -> append_state ( syntax_element_toggle_case , sizeof ( re_case ) )
  73532. ) -> icase = this -> m_icase ;
  73533. }
  73534. #1263
  73535. m_alt_jumps . push_back ( jump_offset ) ;
  73536. return true ;
  73537. }
  73538.  
  73539. template < class charT , class traits >
  73540. bool basic_regex_parser < charT , traits > :: parse_set ( )
  73541. {
  73542. static const char * incomplete_message = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content."
  73543. #1270
  73544. ;
  73545. ++ m_position ;
  73546. if ( m_position == m_end )
  73547. {
  73548. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73549. return false ;
  73550. }
  73551. basic_char_set < charT , traits > char_set ;
  73552.  
  73553. const charT * base = m_position ;
  73554. const charT * item_base = m_position ;
  73555.  
  73556. while ( m_position != m_end )
  73557. {
  73558. switch ( this -> m_traits . syntax_type ( * m_position ) )
  73559. {
  73560. case regex_constants :: syntax_caret :
  73561. if ( m_position == base )
  73562. {
  73563. char_set . negate ( ) ;
  73564. ++ m_position ;
  73565. item_base = m_position ;
  73566. }
  73567. else
  73568. parse_set_literal ( char_set ) ;
  73569. break ;
  73570. case regex_constants :: syntax_close_set :
  73571. if ( m_position == item_base )
  73572. {
  73573. parse_set_literal ( char_set ) ;
  73574. break ;
  73575. }
  73576. else
  73577. {
  73578. ++ m_position ;
  73579. if ( 0 == this -> append_set ( char_set ) )
  73580. {
  73581. fail ( regex_constants :: error_ctype , m_position - m_base ) ;
  73582. return false ;
  73583. }
  73584. }
  73585. return true ;
  73586. case regex_constants :: syntax_open_set :
  73587. if ( parse_inner_set ( char_set ) )
  73588. break ;
  73589. return true ;
  73590. case regex_constants :: syntax_escape :
  73591. {
  73592.  
  73593.  
  73594.  
  73595.  
  73596. ++ m_position ;
  73597. if ( this -> m_traits . escape_syntax_type ( * m_position )
  73598. == regex_constants :: escape_type_class )
  73599. {
  73600. char_class_type m = this -> m_traits . lookup_classname ( m_position , m_position + 1 ) ;
  73601. if ( m != 0 )
  73602. {
  73603. char_set . add_class ( m ) ;
  73604. ++ m_position ;
  73605. break ;
  73606. }
  73607. }
  73608. else if ( this -> m_traits . escape_syntax_type ( * m_position )
  73609. == regex_constants :: escape_type_not_class )
  73610. {
  73611.  
  73612. char_class_type m = this -> m_traits . lookup_classname ( m_position , m_position + 1 ) ;
  73613. if ( m != 0 )
  73614. {
  73615. char_set . add_negated_class ( m ) ;
  73616. ++ m_position ;
  73617. break ;
  73618. }
  73619. }
  73620.  
  73621. -- m_position ;
  73622. parse_set_literal ( char_set ) ;
  73623. break ;
  73624. }
  73625. default :
  73626. parse_set_literal ( char_set ) ;
  73627. break ;
  73628. }
  73629. }
  73630. return m_position != m_end ;
  73631. }
  73632.  
  73633. template < class charT , class traits >
  73634. bool basic_regex_parser < charT , traits > :: parse_inner_set ( basic_char_set < charT , traits > & char_set )
  73635. {
  73636. static const char * incomplete_message = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content."
  73637. #1362
  73638. ;
  73639.  
  73640.  
  73641.  
  73642.  
  73643.  
  73644. if ( m_end == ++ m_position )
  73645. {
  73646. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73647. return false ;
  73648. }
  73649. switch ( this -> m_traits . syntax_type ( * m_position ) )
  73650. {
  73651. case regex_constants :: syntax_dot :
  73652.  
  73653.  
  73654.  
  73655. -- m_position ;
  73656. parse_set_literal ( char_set ) ;
  73657. return true ;
  73658. case regex_constants :: syntax_colon :
  73659. {
  73660.  
  73661. if ( ( this -> flags ( ) & ( regbase :: main_option_type | regbase :: no_char_classes ) )
  73662. == ( regbase :: basic_syntax_group | regbase :: no_char_classes ) )
  73663. {
  73664. -- m_position ;
  73665. parse_set_literal ( char_set ) ;
  73666. return true ;
  73667. }
  73668.  
  73669. if ( m_end == ++ m_position )
  73670. {
  73671. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73672. return false ;
  73673. }
  73674. const charT * name_first = m_position ;
  73675.  
  73676. if ( m_end == ++ m_position )
  73677. {
  73678. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73679. return false ;
  73680. }
  73681. while ( ( m_position != m_end )
  73682. && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_colon ) )
  73683. ++ m_position ;
  73684. const charT * name_last = m_position ;
  73685. if ( m_end == m_position )
  73686. {
  73687. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73688. return false ;
  73689. }
  73690. if ( ( m_end == ++ m_position )
  73691. || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_set ) )
  73692. {
  73693. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73694. return false ;
  73695. }
  73696.  
  73697.  
  73698.  
  73699. bool negated = false ;
  73700. if ( this -> m_traits . syntax_type ( * name_first ) == regex_constants :: syntax_caret )
  73701. {
  73702. ++ name_first ;
  73703. negated = true ;
  73704. }
  73705. typedef typename traits :: char_class_type m_type ;
  73706. m_type m = this -> m_traits . lookup_classname ( name_first , name_last ) ;
  73707. if ( m == 0 )
  73708. {
  73709. if ( char_set . empty ( ) && ( name_last - name_first == 1 ) )
  73710. {
  73711.  
  73712. ++ m_position ;
  73713. if ( ( m_position != m_end )
  73714. && ( this -> m_traits . syntax_type ( * m_position )
  73715. == regex_constants :: syntax_close_set ) )
  73716. {
  73717. if ( this -> m_traits . escape_syntax_type ( * name_first )
  73718. == regex_constants :: escape_type_left_word )
  73719. {
  73720. ++ m_position ;
  73721. this -> append_state ( syntax_element_word_start ) ;
  73722. return false ;
  73723. }
  73724. if ( this -> m_traits . escape_syntax_type ( * name_first )
  73725. == regex_constants :: escape_type_right_word )
  73726. {
  73727. ++ m_position ;
  73728. this -> append_state ( syntax_element_word_end ) ;
  73729. return false ;
  73730. }
  73731. }
  73732. }
  73733. fail ( regex_constants :: error_ctype , name_first - m_base ) ;
  73734. return false ;
  73735. }
  73736. if ( negated == false )
  73737. char_set . add_class ( m ) ;
  73738. else
  73739. char_set . add_negated_class ( m ) ;
  73740. ++ m_position ;
  73741. break ;
  73742. }
  73743. case regex_constants :: syntax_equal :
  73744. {
  73745.  
  73746. if ( m_end == ++ m_position )
  73747. {
  73748. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73749. return false ;
  73750. }
  73751. const charT * name_first = m_position ;
  73752.  
  73753. if ( m_end == ++ m_position )
  73754. {
  73755. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73756. return false ;
  73757. }
  73758. while ( ( m_position != m_end )
  73759. && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_equal ) )
  73760. ++ m_position ;
  73761. const charT * name_last = m_position ;
  73762. if ( m_end == m_position )
  73763. {
  73764. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73765. return false ;
  73766. }
  73767. if ( ( m_end == ++ m_position )
  73768. || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_set ) )
  73769. {
  73770. fail ( regex_constants :: error_brack , m_position - m_base , incomplete_message ) ;
  73771. return false ;
  73772. }
  73773. string_type m = this -> m_traits . lookup_collatename ( name_first , name_last ) ;
  73774. if ( ( 0 == m . size ( ) ) || ( m . size ( ) > 2 ) )
  73775. {
  73776. fail ( regex_constants :: error_collate , name_first - m_base ) ;
  73777. return false ;
  73778. }
  73779. digraph < charT > d ;
  73780. d . first = m [ 0 ] ;
  73781. if ( m . size ( ) > 1 )
  73782. d . second = m [ 1 ] ;
  73783. else
  73784. d . second = 0 ;
  73785. char_set . add_equivalent ( d ) ;
  73786. ++ m_position ;
  73787. break ;
  73788. }
  73789. default :
  73790. -- m_position ;
  73791. parse_set_literal ( char_set ) ;
  73792. break ;
  73793. }
  73794. return true ;
  73795. }
  73796.  
  73797. template < class charT , class traits >
  73798. void basic_regex_parser < charT , traits > :: parse_set_literal ( basic_char_set < charT , traits > & char_set )
  73799. {
  73800. digraph < charT > start_range ( get_next_set_literal ( char_set ) ) ;
  73801. if ( m_end == m_position )
  73802. {
  73803. fail ( regex_constants :: error_brack , m_position - m_base ) ;
  73804. return ;
  73805. }
  73806. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_dash )
  73807. {
  73808.  
  73809. if ( m_end == ++ m_position )
  73810. {
  73811. fail ( regex_constants :: error_brack , m_position - m_base ) ;
  73812. return ;
  73813. }
  73814. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_set )
  73815. {
  73816. digraph < charT > end_range = get_next_set_literal ( char_set ) ;
  73817. char_set . add_range ( start_range , end_range ) ;
  73818. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_dash )
  73819. {
  73820. if ( m_end == ++ m_position )
  73821. {
  73822. fail ( regex_constants :: error_brack , m_position - m_base ) ;
  73823. return ;
  73824. }
  73825. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_close_set )
  73826. {
  73827.  
  73828. -- m_position ;
  73829. return ;
  73830. }
  73831. fail ( regex_constants :: error_range , m_position - m_base ) ;
  73832. return ;
  73833. }
  73834. return ;
  73835. }
  73836. -- m_position ;
  73837. }
  73838. char_set . add_single ( start_range ) ;
  73839. }
  73840.  
  73841. template < class charT , class traits >
  73842. digraph < charT > basic_regex_parser < charT , traits > :: get_next_set_literal ( basic_char_set < charT , traits > & char_set
  73843. #1566
  73844. )
  73845. {
  73846. digraph < charT > result ;
  73847. switch ( this -> m_traits . syntax_type ( * m_position ) )
  73848. {
  73849. case regex_constants :: syntax_dash :
  73850. if ( ! char_set . empty ( ) )
  73851. {
  73852.  
  73853. if ( ( ++ m_position == m_end ) || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_set
  73854. #1575
  73855. ) )
  73856. {
  73857. fail ( regex_constants :: error_range , m_position - m_base ) ;
  73858. return result ;
  73859. }
  73860. -- m_position ;
  73861. }
  73862. result . first = * m_position ++ ;
  73863. return result ;
  73864. case regex_constants :: syntax_escape :
  73865.  
  73866. if ( this -> flags ( ) & regex_constants :: no_escape_in_lists )
  73867. {
  73868. result = * m_position ++ ;
  73869. break ;
  73870. }
  73871. ++ m_position ;
  73872. result = unescape_character ( ) ;
  73873. break ;
  73874. case regex_constants :: syntax_open_set :
  73875. {
  73876. if ( m_end == ++ m_position )
  73877. {
  73878. fail ( regex_constants :: error_collate , m_position - m_base ) ;
  73879. return result ;
  73880. }
  73881. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_dot )
  73882. {
  73883. -- m_position ;
  73884. result . first = * m_position ;
  73885. ++ m_position ;
  73886. return result ;
  73887. }
  73888. if ( m_end == ++ m_position )
  73889. {
  73890. fail ( regex_constants :: error_collate , m_position - m_base ) ;
  73891. return result ;
  73892. }
  73893. const charT * name_first = m_position ;
  73894.  
  73895. if ( m_end == ++ m_position )
  73896. {
  73897. fail ( regex_constants :: error_collate , name_first - m_base ) ;
  73898. return result ;
  73899. }
  73900. while ( ( m_position != m_end )
  73901. && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_dot ) )
  73902. ++ m_position ;
  73903. const charT * name_last = m_position ;
  73904. if ( m_end == m_position )
  73905. {
  73906. fail ( regex_constants :: error_collate , name_first - m_base ) ;
  73907. return result ;
  73908. }
  73909. if ( ( m_end == ++ m_position )
  73910. || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_set ) )
  73911. {
  73912. fail ( regex_constants :: error_collate , name_first - m_base ) ;
  73913. return result ;
  73914. }
  73915. ++ m_position ;
  73916. string_type s = this -> m_traits . lookup_collatename ( name_first , name_last ) ;
  73917. if ( s . empty ( ) || ( s . size ( ) > 2 ) )
  73918. {
  73919. fail ( regex_constants :: error_collate , name_first - m_base ) ;
  73920. return result ;
  73921. }
  73922. result . first = s [ 0 ] ;
  73923. if ( s . size ( ) > 1 )
  73924. result . second = s [ 1 ] ;
  73925. else
  73926. result . second = 0 ;
  73927. return result ;
  73928. }
  73929. default :
  73930. result = * m_position ++ ;
  73931. }
  73932. return result ;
  73933. }
  73934.  
  73935.  
  73936.  
  73937.  
  73938. template < class charT >
  73939. bool valid_value ( charT , int v , const mpl :: true_ & )
  73940. {
  73941. return ( v >> ( sizeof ( charT ) * 8 ) ) == 0 ;
  73942. }
  73943. template < class charT >
  73944. bool valid_value ( charT , int , const mpl :: false_ & )
  73945. {
  73946. return true ;
  73947. }
  73948. template < class charT >
  73949. bool valid_value ( charT c , int v )
  73950. {
  73951. return valid_value ( c , v , mpl :: bool_ < ( sizeof ( charT ) < sizeof ( int ) ) > ( ) ) ;
  73952. }
  73953.  
  73954. template < class charT , class traits >
  73955. charT basic_regex_parser < charT , traits > :: unescape_character ( )
  73956. {
  73957.  
  73958.  
  73959.  
  73960.  
  73961. charT result ( 0 ) ;
  73962. if ( m_position == m_end )
  73963. {
  73964. fail ( regex_constants :: error_escape , m_position - m_base , "Escape sequence terminated prematurely." ) ;
  73965. return false ;
  73966. }
  73967. switch ( this -> m_traits . escape_syntax_type ( * m_position ) )
  73968. {
  73969. case regex_constants :: escape_type_control_a :
  73970. result = charT ( '\a' ) ;
  73971. break ;
  73972. case regex_constants :: escape_type_e :
  73973. result = charT ( 27 ) ;
  73974. break ;
  73975. case regex_constants :: escape_type_control_f :
  73976. result = charT ( '\f' ) ;
  73977. break ;
  73978. case regex_constants :: escape_type_control_n :
  73979. result = charT ( '\n' ) ;
  73980. break ;
  73981. case regex_constants :: escape_type_control_r :
  73982. result = charT ( '\r' ) ;
  73983. break ;
  73984. case regex_constants :: escape_type_control_t :
  73985. result = charT ( '\t' ) ;
  73986. break ;
  73987. case regex_constants :: escape_type_control_v :
  73988. result = charT ( '\v' ) ;
  73989. break ;
  73990. case regex_constants :: escape_type_word_assert :
  73991. result = charT ( '\b' ) ;
  73992. break ;
  73993. case regex_constants :: escape_type_ascii_control :
  73994. ++ m_position ;
  73995. if ( m_position == m_end )
  73996. {
  73997.  
  73998. -- m_position ;
  73999. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74000. fail ( regex_constants :: error_escape , m_position - m_base , "ASCII escape sequence terminated prematurely." ) ;
  74001. return result ;
  74002. }
  74003. result = static_cast < charT > ( * m_position % 32 ) ;
  74004. break ;
  74005. case regex_constants :: escape_type_hex :
  74006. ++ m_position ;
  74007. if ( m_position == m_end )
  74008. {
  74009.  
  74010. -- m_position ;
  74011. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74012. fail ( regex_constants :: error_escape , m_position - m_base , "Hexadecimal escape sequence terminated prematurely." ) ;
  74013. #1732
  74014.  
  74015. return result ;
  74016. }
  74017.  
  74018. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_open_brace )
  74019. {
  74020. ++ m_position ;
  74021. if ( m_position == m_end )
  74022. {
  74023.  
  74024. -- m_position ;
  74025. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74026. fail ( regex_constants :: error_escape , m_position - m_base , "Missing } in hexadecimal escape sequence." ) ;
  74027. return result ;
  74028. }
  74029. int i = this -> m_traits . toi ( m_position , m_end , 16 ) ;
  74030. if ( ( m_position == m_end )
  74031. || ( i < 0 )
  74032. || ( ( std :: numeric_limits < charT > :: is_specialized ) && ( i > ( int ) ( std :: numeric_limits < charT > :: max ) (
  74033. #1750
  74034. ) ) )
  74035. || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_brace ) )
  74036. {
  74037.  
  74038. -- m_position ;
  74039. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74040. fail ( regex_constants :: error_badbrace , m_position - m_base , "Hexadecimal escape sequence was invalid." ) ;
  74041. return result ;
  74042. }
  74043. ++ m_position ;
  74044. result = charT ( i ) ;
  74045. }
  74046. else
  74047. {
  74048. std :: ptrdiff_t len = ( std :: min ) ( static_cast < std :: ptrdiff_t > ( 2 ) , static_cast < std :: ptrdiff_t > ( m_end
  74049. #1764
  74050. - m_position ) ) ;
  74051. int i = this -> m_traits . toi ( m_position , m_position + len , 16 ) ;
  74052. if ( ( i < 0 )
  74053. || ! valid_value ( charT ( 0 ) , i ) )
  74054. {
  74055.  
  74056. -- m_position ;
  74057. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74058. fail ( regex_constants :: error_escape , m_position - m_base , "Escape sequence did not encode a valid character." ) ;
  74059. return result ;
  74060. }
  74061. result = charT ( i ) ;
  74062. }
  74063. return result ;
  74064. case regex_constants :: syntax_digit :
  74065. {
  74066.  
  74067.  
  74068. std :: ptrdiff_t len = ( std :: min ) ( :: boost :: re_detail :: distance ( m_position , m_end ) , static_cast < std :: ptrdiff_t
  74069. #1782
  74070. > ( 4 ) ) ;
  74071. const charT * bp = m_position ;
  74072. int val = this -> m_traits . toi ( bp , bp + 1 , 8 ) ;
  74073. if ( val != 0 )
  74074. {
  74075.  
  74076. -- m_position ;
  74077. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74078.  
  74079. fail ( regex_constants :: error_escape , m_position - m_base , "Invalid octal escape sequence." ) ;
  74080. return result ;
  74081. }
  74082. val = this -> m_traits . toi ( m_position , m_position + len , 8 ) ;
  74083. if ( val < 0 )
  74084. {
  74085.  
  74086. -- m_position ;
  74087. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74088. fail ( regex_constants :: error_escape , m_position - m_base , "Octal escape sequence is invalid." ) ;
  74089. return result ;
  74090. }
  74091. return static_cast < charT > ( val ) ;
  74092. }
  74093. case regex_constants :: escape_type_named_char :
  74094. {
  74095. ++ m_position ;
  74096. if ( m_position == m_end )
  74097. {
  74098.  
  74099. -- m_position ;
  74100. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74101. fail ( regex_constants :: error_escape , m_position - m_base ) ;
  74102. return false ;
  74103. }
  74104.  
  74105. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_open_brace )
  74106. {
  74107. const charT * base = m_position ;
  74108.  
  74109. while ( ( m_position != m_end ) && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_brace
  74110. #1821
  74111. ) )
  74112. ++ m_position ;
  74113. if ( m_position == m_end )
  74114. {
  74115.  
  74116. -- m_position ;
  74117. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74118. fail ( regex_constants :: error_escape , m_position - m_base ) ;
  74119. return false ;
  74120. }
  74121. string_type s = this -> m_traits . lookup_collatename ( ++ base , m_position ++ ) ;
  74122. if ( s . empty ( ) )
  74123. {
  74124.  
  74125. -- m_position ;
  74126. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74127. fail ( regex_constants :: error_collate , m_position - m_base ) ;
  74128. return false ;
  74129. }
  74130. if ( s . size ( ) == 1 )
  74131. {
  74132. return s [ 0 ] ;
  74133. }
  74134. }
  74135.  
  74136.  
  74137. -- m_position ;
  74138. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74139. fail ( regex_constants :: error_escape , m_position - m_base ) ;
  74140. return false ;
  74141. }
  74142. default :
  74143. result = * m_position ;
  74144. break ;
  74145. }
  74146. ++ m_position ;
  74147. return result ;
  74148.  
  74149.  
  74150.  
  74151. }
  74152.  
  74153. template < class charT , class traits >
  74154. bool basic_regex_parser < charT , traits > :: parse_backref ( )
  74155. {
  74156. ( ( void ) 0 ) ;
  74157. const charT * pc = m_position ;
  74158. int i = this -> m_traits . toi ( pc , pc + 1 , 10 ) ;
  74159. if ( ( i == 0 ) || ( ( ( this -> flags ( ) & regbase :: main_option_type ) == regbase :: perl_syntax_group ) && ( this ->
  74160. #1869
  74161. flags ( ) & regbase :: no_bk_refs ) ) )
  74162. {
  74163.  
  74164. charT c = unescape_character ( ) ;
  74165. this -> append_literal ( c ) ;
  74166. }
  74167. else if ( ( i > 0 ) && ( this -> m_backrefs & ( 1u << ( i - 1 ) ) ) )
  74168. {
  74169. m_position = pc ;
  74170. re_brace * pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_backref , sizeof ( re_brace ) ) ) ;
  74171. pb -> index = i ;
  74172. pb -> icase = this -> flags ( ) & regbase :: icase ;
  74173. }
  74174. else
  74175. {
  74176.  
  74177. -- m_position ;
  74178. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74179. fail ( regex_constants :: error_backref , m_position - m_base ) ;
  74180. return false ;
  74181. }
  74182. return true ;
  74183. }
  74184.  
  74185. template < class charT , class traits >
  74186. bool basic_regex_parser < charT , traits > :: parse_QE ( )
  74187. {
  74188. #1903
  74189. ++ m_position ;
  74190. const charT * start = m_position ;
  74191. const charT * end ;
  74192. do
  74193. {
  74194. while ( ( m_position != m_end )
  74195. && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) )
  74196. ++ m_position ;
  74197. if ( m_position == m_end )
  74198. {
  74199.  
  74200. end = m_position ;
  74201. break ;
  74202. }
  74203. if ( ++ m_position == m_end )
  74204. {
  74205. fail ( regex_constants :: error_escape , m_position - m_base , "Unterminated \\Q...\\E sequence." ) ;
  74206. return false ;
  74207. }
  74208.  
  74209. if ( this -> m_traits . escape_syntax_type ( * m_position ) == regex_constants :: escape_type_E )
  74210. {
  74211. ++ m_position ;
  74212. end = m_position - 2 ;
  74213. break ;
  74214. }
  74215.  
  74216. } while ( true ) ;
  74217.  
  74218.  
  74219.  
  74220. while ( start != end )
  74221. {
  74222. this -> append_literal ( * start ) ;
  74223. ++ start ;
  74224. }
  74225. return true ;
  74226.  
  74227.  
  74228.  
  74229. }
  74230.  
  74231. template < class charT , class traits >
  74232. bool basic_regex_parser < charT , traits > :: parse_perl_extension ( )
  74233. {
  74234. if ( ++ m_position == m_end )
  74235. {
  74236.  
  74237. -- m_position ;
  74238. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74239. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74240. return false ;
  74241. }
  74242.  
  74243.  
  74244.  
  74245.  
  74246.  
  74247. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_hash )
  74248. {
  74249. while ( ( m_position != m_end )
  74250. && ( this -> m_traits . syntax_type ( * m_position ++ ) != regex_constants :: syntax_close_mark ) )
  74251. { }
  74252. return true ;
  74253. }
  74254.  
  74255.  
  74256.  
  74257. int markid = 0 ;
  74258. std :: ptrdiff_t jump_offset = 0 ;
  74259. re_brace * pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_startmark , sizeof ( re_brace ) ) ) ;
  74260. #1973
  74261.  
  74262. pb -> icase = this -> flags ( ) & regbase :: icase ;
  74263. std :: ptrdiff_t last_paren_start = this -> getoffset ( pb ) ;
  74264.  
  74265. std :: ptrdiff_t last_alt_point = m_alt_insert_point ;
  74266. this -> m_pdata -> m_data . align ( ) ;
  74267. m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  74268. std :: ptrdiff_t expected_alt_point = m_alt_insert_point ;
  74269. bool restore_flags = true ;
  74270. regex_constants :: syntax_option_type old_flags = this -> flags ( ) ;
  74271. bool old_case_change = m_has_case_change ;
  74272. m_has_case_change = false ;
  74273. charT name_delim ;
  74274. int mark_reset = m_mark_reset ;
  74275. int max_mark = m_max_mark ;
  74276. m_mark_reset = - 1 ;
  74277. m_max_mark = m_mark_count ;
  74278. int v ;
  74279.  
  74280.  
  74281.  
  74282. switch ( this -> m_traits . syntax_type ( * m_position ) )
  74283. {
  74284. case regex_constants :: syntax_or :
  74285. m_mark_reset = m_mark_count ;
  74286. ( ( void ) 0 ) ;
  74287. case regex_constants :: syntax_colon :
  74288.  
  74289.  
  74290.  
  74291. pb -> index = markid = 0 ;
  74292. ++ m_position ;
  74293. break ;
  74294. case regex_constants :: syntax_digit :
  74295. {
  74296.  
  74297.  
  74298.  
  74299. v = this -> m_traits . toi ( m_position , m_end , 10 ) ;
  74300. if ( ( v < 0 ) || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark ) )
  74301. {
  74302.  
  74303. -- m_position ;
  74304. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74305. fail ( regex_constants :: error_perl_extension , m_position - m_base , "The recursive sub-expression refers to an invalid marking group, or is unterminated."
  74306. #2017
  74307. ) ;
  74308. return false ;
  74309. }
  74310. insert_recursion :
  74311. pb -> index = markid = 0 ;
  74312. re_recurse * pr = static_cast < re_recurse * > ( this -> append_state ( syntax_element_recurse , sizeof ( re_recurse ) )
  74313. #2022
  74314. ) ;
  74315. pr -> alt . i = v ;
  74316. pr -> state_id = 0 ;
  74317. static_cast < re_case * > (
  74318. this -> append_state ( syntax_element_toggle_case , sizeof ( re_case ) )
  74319. ) -> icase = this -> flags ( ) & regbase :: icase ;
  74320. break ;
  74321. }
  74322. case regex_constants :: syntax_plus :
  74323.  
  74324.  
  74325.  
  74326. ++ m_position ;
  74327. v = this -> m_traits . toi ( m_position , m_end , 10 ) ;
  74328. if ( ( v <= 0 ) || ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark ) )
  74329. {
  74330.  
  74331. -- m_position ;
  74332. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74333. fail ( regex_constants :: error_perl_extension , m_position - m_base , "An invalid or unterminated recursive sub-expression."
  74334. #2041
  74335. ) ;
  74336. return false ;
  74337. }
  74338. v += m_mark_count ;
  74339. goto insert_recursion ;
  74340. case regex_constants :: syntax_dash :
  74341.  
  74342.  
  74343.  
  74344. ++ m_position ;
  74345. v = this -> m_traits . toi ( m_position , m_end , 10 ) ;
  74346. if ( v <= 0 )
  74347. {
  74348. -- m_position ;
  74349.  
  74350. goto option_group_jump ;
  74351. }
  74352. v = m_mark_count + 1 - v ;
  74353. if ( v <= 0 )
  74354. {
  74355.  
  74356. -- m_position ;
  74357. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74358. fail ( regex_constants :: error_perl_extension , m_position - m_base , "An invalid or unterminated recursive sub-expression."
  74359. #2064
  74360. ) ;
  74361. return false ;
  74362. }
  74363. goto insert_recursion ;
  74364. case regex_constants :: syntax_equal :
  74365. pb -> index = markid = - 1 ;
  74366. ++ m_position ;
  74367. jump_offset = this -> getoffset ( this -> append_state ( syntax_element_jump , sizeof ( re_jump ) ) ) ;
  74368. this -> m_pdata -> m_data . align ( ) ;
  74369. m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  74370. break ;
  74371. case regex_constants :: syntax_not :
  74372. pb -> index = markid = - 2 ;
  74373. ++ m_position ;
  74374. jump_offset = this -> getoffset ( this -> append_state ( syntax_element_jump , sizeof ( re_jump ) ) ) ;
  74375. this -> m_pdata -> m_data . align ( ) ;
  74376. m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  74377. break ;
  74378. case regex_constants :: escape_type_left_word :
  74379. {
  74380.  
  74381. if ( ++ m_position == m_end )
  74382. {
  74383.  
  74384. -- m_position ;
  74385. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74386. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74387. return false ;
  74388. }
  74389. regex_constants :: syntax_type t = this -> m_traits . syntax_type ( * m_position ) ;
  74390. if ( t == regex_constants :: syntax_not )
  74391. pb -> index = markid = - 2 ;
  74392. else if ( t == regex_constants :: syntax_equal )
  74393. pb -> index = markid = - 1 ;
  74394. else
  74395. {
  74396.  
  74397. name_delim = '>' ;
  74398. -- m_position ;
  74399. goto named_capture_jump ;
  74400. }
  74401. ++ m_position ;
  74402. jump_offset = this -> getoffset ( this -> append_state ( syntax_element_jump , sizeof ( re_jump ) ) ) ;
  74403. this -> append_state ( syntax_element_backstep , sizeof ( re_brace ) ) ;
  74404. this -> m_pdata -> m_data . align ( ) ;
  74405. m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  74406. break ;
  74407. }
  74408. case regex_constants :: escape_type_right_word :
  74409.  
  74410.  
  74411.  
  74412. pb -> index = markid = - 3 ;
  74413. ++ m_position ;
  74414. jump_offset = this -> getoffset ( this -> append_state ( syntax_element_jump , sizeof ( re_jump ) ) ) ;
  74415. this -> m_pdata -> m_data . align ( ) ;
  74416. m_alt_insert_point = this -> m_pdata -> m_data . size ( ) ;
  74417. break ;
  74418. case regex_constants :: syntax_open_mark :
  74419. {
  74420.  
  74421. pb -> index = markid = - 4 ;
  74422. if ( ++ m_position == m_end )
  74423. {
  74424.  
  74425. -- m_position ;
  74426. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74427. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74428. return false ;
  74429. }
  74430. v = this -> m_traits . toi ( m_position , m_end , 10 ) ;
  74431. if ( m_position == m_end )
  74432. {
  74433.  
  74434. -- m_position ;
  74435. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74436. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74437. return false ;
  74438. }
  74439. if ( * m_position == charT ( 'R' ) )
  74440. {
  74441. if ( ++ m_position == m_end )
  74442. {
  74443.  
  74444. -- m_position ;
  74445. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74446. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74447. return false ;
  74448. }
  74449. if ( * m_position == charT ( '&' ) )
  74450. {
  74451. const charT * base = ++ m_position ;
  74452. while ( ( m_position != m_end ) && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark
  74453. #2156
  74454. ) )
  74455. ++ m_position ;
  74456. if ( m_position == m_end )
  74457. {
  74458.  
  74459. -- m_position ;
  74460. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74461. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74462. return false ;
  74463. }
  74464. v = - static_cast < int > ( hash_value_from_capture_name ( base , m_position ) ) ;
  74465. }
  74466. else
  74467. {
  74468. v = - this -> m_traits . toi ( m_position , m_end , 10 ) ;
  74469. }
  74470. re_brace * br = static_cast < re_brace * > ( this -> append_state ( syntax_element_assert_backref , sizeof ( re_brace ) )
  74471. #2172
  74472. ) ;
  74473. br -> index = v < 0 ? ( v - 1 ) : 0 ;
  74474. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark )
  74475. {
  74476.  
  74477. -- m_position ;
  74478. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74479. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74480. return false ;
  74481. }
  74482. if ( ++ m_position == m_end )
  74483. {
  74484.  
  74485. -- m_position ;
  74486. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74487. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74488. return false ;
  74489. }
  74490. }
  74491. else if ( ( * m_position == charT ( '\'' ) ) || ( * m_position == charT ( '<' ) ) )
  74492. {
  74493. const charT * base = ++ m_position ;
  74494. while ( ( m_position != m_end ) && ( * m_position != charT ( '>' ) ) && ( * m_position != charT ( '\'' ) ) )
  74495. ++ m_position ;
  74496. if ( m_position == m_end )
  74497. {
  74498.  
  74499. -- m_position ;
  74500. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74501. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74502. return false ;
  74503. }
  74504. v = static_cast < int > ( hash_value_from_capture_name ( base , m_position ) ) ;
  74505. re_brace * br = static_cast < re_brace * > ( this -> append_state ( syntax_element_assert_backref , sizeof ( re_brace ) )
  74506. #2205
  74507. ) ;
  74508. br -> index = v ;
  74509. if ( ( ( * m_position != charT ( '>' ) ) && ( * m_position != charT ( '\'' ) ) ) || ( ++ m_position == m_end ) )
  74510. {
  74511.  
  74512. -- m_position ;
  74513. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74514. fail ( regex_constants :: error_perl_extension , m_position - m_base , "Unterminated named capture." ) ;
  74515. return false ;
  74516. }
  74517. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark )
  74518. {
  74519.  
  74520. -- m_position ;
  74521. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74522. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74523. return false ;
  74524. }
  74525. if ( ++ m_position == m_end )
  74526. {
  74527.  
  74528. -- m_position ;
  74529. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74530. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74531. return false ;
  74532. }
  74533. }
  74534. else if ( * m_position == charT ( 'D' ) )
  74535. {
  74536. const char * def = "DEFINE" ;
  74537. while ( * def && ( m_position != m_end ) && ( * m_position == charT ( * def ) ) )
  74538. ++ m_position , ++ def ;
  74539. if ( ( m_position == m_end ) || * def )
  74540. {
  74541.  
  74542. -- m_position ;
  74543. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74544. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74545. return false ;
  74546. }
  74547. re_brace * br = static_cast < re_brace * > ( this -> append_state ( syntax_element_assert_backref , sizeof ( re_brace ) )
  74548. #2245
  74549. ) ;
  74550. br -> index = 9999 ;
  74551. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark )
  74552. {
  74553.  
  74554. -- m_position ;
  74555. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74556. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74557. return false ;
  74558. }
  74559. if ( ++ m_position == m_end )
  74560. {
  74561.  
  74562. -- m_position ;
  74563. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74564. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74565. return false ;
  74566. }
  74567. }
  74568. else if ( v > 0 )
  74569. {
  74570. re_brace * br = static_cast < re_brace * > ( this -> append_state ( syntax_element_assert_backref , sizeof ( re_brace ) )
  74571. #2266
  74572. ) ;
  74573. br -> index = v ;
  74574. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark )
  74575. {
  74576.  
  74577. -- m_position ;
  74578. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74579. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74580. return false ;
  74581. }
  74582. if ( ++ m_position == m_end )
  74583. {
  74584.  
  74585. -- m_position ;
  74586. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74587. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74588. return false ;
  74589. }
  74590. }
  74591. else
  74592. {
  74593.  
  74594. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_question )
  74595. {
  74596.  
  74597. -- m_position ;
  74598. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74599. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74600. return false ;
  74601. }
  74602. if ( ++ m_position == m_end )
  74603. {
  74604.  
  74605. -- m_position ;
  74606. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74607. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74608. return false ;
  74609. }
  74610. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: escape_type_left_word )
  74611. {
  74612. if ( ++ m_position == m_end )
  74613. {
  74614.  
  74615. -- m_position ;
  74616. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74617. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74618. return false ;
  74619. }
  74620. if ( ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_equal )
  74621. && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_not ) )
  74622. {
  74623.  
  74624. -- m_position ;
  74625. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74626. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74627. return false ;
  74628. }
  74629. m_position -= 3 ;
  74630. }
  74631. else
  74632. {
  74633. if ( ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_equal )
  74634. && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_not ) )
  74635. {
  74636.  
  74637. -- m_position ;
  74638. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74639. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74640. return false ;
  74641. }
  74642. m_position -= 2 ;
  74643. }
  74644. }
  74645. break ;
  74646. }
  74647. case regex_constants :: syntax_close_mark :
  74648.  
  74649. -- m_position ;
  74650. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74651. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74652. return false ;
  74653. case regex_constants :: escape_type_end_buffer :
  74654. {
  74655. name_delim = * m_position ;
  74656. named_capture_jump :
  74657. markid = 0 ;
  74658. if ( 0 == ( this -> flags ( ) & regbase :: nosubs ) )
  74659. {
  74660. markid = ++ m_mark_count ;
  74661.  
  74662. if ( this -> flags ( ) & regbase :: save_subexpression_location )
  74663. this -> m_pdata -> m_subs . push_back ( std :: pair < std :: size_t , std :: size_t > ( std :: distance ( m_base , m_position
  74664. #2357
  74665. ) - 2 , 0 ) ) ;
  74666.  
  74667.  
  74668.  
  74669.  
  74670. }
  74671. pb -> index = markid ;
  74672. const charT * base = ++ m_position ;
  74673. if ( m_position == m_end )
  74674. {
  74675.  
  74676. -- m_position ;
  74677. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74678. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74679. return false ;
  74680. }
  74681. while ( ( m_position != m_end ) && ( * m_position != name_delim ) )
  74682. ++ m_position ;
  74683. if ( m_position == m_end )
  74684. {
  74685.  
  74686. -- m_position ;
  74687. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74688. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74689. return false ;
  74690. }
  74691. this -> m_pdata -> set_name ( base , m_position , markid ) ;
  74692. ++ m_position ;
  74693. break ;
  74694. }
  74695. default :
  74696. if ( * m_position == charT ( 'R' ) )
  74697. {
  74698. ++ m_position ;
  74699. v = 0 ;
  74700. if ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark )
  74701. {
  74702.  
  74703. -- m_position ;
  74704. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74705. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74706. return false ;
  74707. }
  74708. goto insert_recursion ;
  74709. }
  74710. if ( * m_position == charT ( '&' ) )
  74711. {
  74712. ++ m_position ;
  74713. const charT * base = m_position ;
  74714. while ( ( m_position != m_end ) && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark
  74715. #2406
  74716. ) )
  74717. ++ m_position ;
  74718. if ( m_position == m_end )
  74719. {
  74720.  
  74721. -- m_position ;
  74722. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74723. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74724. return false ;
  74725. }
  74726. v = static_cast < int > ( hash_value_from_capture_name ( base , m_position ) ) ;
  74727. goto insert_recursion ;
  74728. }
  74729. if ( * m_position == charT ( 'P' ) )
  74730. {
  74731. ++ m_position ;
  74732. if ( m_position == m_end )
  74733. {
  74734.  
  74735. -- m_position ;
  74736. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74737. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74738. return false ;
  74739. }
  74740. if ( * m_position == charT ( '>' ) )
  74741. {
  74742. ++ m_position ;
  74743. const charT * base = m_position ;
  74744. while ( ( m_position != m_end ) && ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_close_mark
  74745. #2434
  74746. ) )
  74747. ++ m_position ;
  74748. if ( m_position == m_end )
  74749. {
  74750.  
  74751. -- m_position ;
  74752. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74753. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74754. return false ;
  74755. }
  74756. v = static_cast < int > ( hash_value_from_capture_name ( base , m_position ) ) ;
  74757. goto insert_recursion ;
  74758. }
  74759. }
  74760.  
  74761.  
  74762.  
  74763. option_group_jump :
  74764. regex_constants :: syntax_option_type opts = parse_options ( ) ;
  74765. if ( m_position == m_end )
  74766. {
  74767.  
  74768. -- m_position ;
  74769. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74770. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74771. return false ;
  74772. }
  74773.  
  74774. m_has_case_change = ( ( opts & regbase :: icase ) != ( this -> flags ( ) & regbase :: icase ) ) ;
  74775. pb -> index = markid = 0 ;
  74776. if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_close_mark )
  74777. {
  74778.  
  74779. this -> flags ( opts ) ;
  74780. restore_flags = false ;
  74781. old_case_change |= m_has_case_change ;
  74782. }
  74783. else if ( this -> m_traits . syntax_type ( * m_position ) == regex_constants :: syntax_colon )
  74784. {
  74785.  
  74786. this -> flags ( opts ) ;
  74787. ++ m_position ;
  74788. }
  74789. else
  74790. {
  74791.  
  74792. -- m_position ;
  74793. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74794. fail ( regex_constants :: error_perl_extension , m_position - m_base ) ;
  74795. return false ;
  74796. }
  74797.  
  74798.  
  74799. if ( m_has_case_change )
  74800. {
  74801. static_cast < re_case * > (
  74802. this -> append_state ( syntax_element_toggle_case , sizeof ( re_case ) )
  74803. ) -> icase = opts & regbase :: icase ;
  74804. }
  74805.  
  74806. }
  74807.  
  74808.  
  74809.  
  74810.  
  74811. parse_all ( ) ;
  74812.  
  74813.  
  74814.  
  74815. if ( 0 == unwind_alts ( last_paren_start ) )
  74816. {
  74817.  
  74818. -- m_position ;
  74819. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74820. fail ( regex_constants :: error_perl_extension , m_position - m_base , "Invalid alternation operators within (?...) block."
  74821. #2508
  74822. ) ;
  74823. return false ;
  74824. }
  74825.  
  74826.  
  74827.  
  74828. if ( m_position == m_end )
  74829. {
  74830.  
  74831. -- m_position ;
  74832. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74833. this -> fail ( regex_constants :: error_paren , :: boost :: re_detail :: distance ( m_base , m_end ) ) ;
  74834. return false ;
  74835. }
  74836. ( ( void ) 0 ) ;
  74837. ++ m_position ;
  74838.  
  74839.  
  74840.  
  74841. if ( restore_flags )
  74842. {
  74843.  
  74844. if ( m_has_case_change )
  74845. {
  74846. static_cast < re_case * > (
  74847. this -> append_state ( syntax_element_toggle_case , sizeof ( re_case ) )
  74848. ) -> icase = old_flags & regbase :: icase ;
  74849. }
  74850. this -> flags ( old_flags ) ;
  74851. }
  74852.  
  74853.  
  74854.  
  74855. if ( jump_offset )
  74856. {
  74857. this -> m_pdata -> m_data . align ( ) ;
  74858. re_jump * jmp = static_cast < re_jump * > ( this -> getaddress ( jump_offset ) ) ;
  74859. jmp -> alt . i = this -> m_pdata -> m_data . size ( ) - this -> getoffset ( jmp ) ;
  74860. if ( ( this -> m_last_state == jmp ) && ( markid != - 2 ) )
  74861. {
  74862.  
  74863.  
  74864.  
  74865.  
  74866. -- m_position ;
  74867. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74868. fail ( regex_constants :: error_perl_extension , m_position - m_base , "Invalid or empty zero width assertion." ) ;
  74869. return false ;
  74870. }
  74871. }
  74872.  
  74873.  
  74874.  
  74875.  
  74876. if ( markid == - 4 )
  74877. {
  74878. re_syntax_base * b = this -> getaddress ( expected_alt_point ) ;
  74879.  
  74880. if ( b -> type != syntax_element_alt )
  74881. {
  74882. re_alt * alt = static_cast < re_alt * > ( this -> insert_state ( expected_alt_point , syntax_element_alt , sizeof ( re_alt
  74883. #2568
  74884. ) ) ) ;
  74885. alt -> alt . i = this -> m_pdata -> m_data . size ( ) - this -> getoffset ( alt ) ;
  74886. }
  74887. else if ( this -> getaddress ( static_cast < re_alt * > ( b ) -> alt . i , b ) -> type == syntax_element_alt )
  74888. {
  74889.  
  74890.  
  74891. -- m_position ;
  74892. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74893. fail ( regex_constants :: error_bad_pattern , m_position - m_base , "More than one alternation operator | was encountered inside a conditional expression."
  74894. #2577
  74895. ) ;
  74896. return false ;
  74897. }
  74898. else
  74899. {
  74900.  
  74901. b = this -> getaddress ( b -> next . i , b ) ;
  74902. if ( ( b -> type == syntax_element_assert_backref ) && ( static_cast < re_brace * > ( b ) -> index == 9999 ) )
  74903. {
  74904.  
  74905. -- m_position ;
  74906. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74907. fail ( regex_constants :: error_bad_pattern , m_position - m_base , "Alternation operators are not allowed inside a DEFINE block."
  74908. #2589
  74909. ) ;
  74910. return false ;
  74911. }
  74912. }
  74913.  
  74914. b = this -> getaddress ( expected_alt_point ) ;
  74915. b = this -> getaddress ( static_cast < re_alt * > ( b ) -> next . i , b ) ;
  74916. if ( ( b -> type != syntax_element_assert_backref )
  74917. && ( b -> type != syntax_element_startmark ) )
  74918. {
  74919.  
  74920. -- m_position ;
  74921. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  74922. fail ( regex_constants :: error_badrepeat , m_position - m_base , "A repetition operator cannot be applied to a zero-width assertion."
  74923. #2602
  74924. ) ;
  74925. return false ;
  74926. }
  74927. }
  74928.  
  74929.  
  74930.  
  74931. pb = static_cast < re_brace * > ( this -> append_state ( syntax_element_endmark , sizeof ( re_brace ) ) ) ;
  74932. pb -> index = markid ;
  74933. pb -> icase = this -> flags ( ) & regbase :: icase ;
  74934. this -> m_paren_start = last_paren_start ;
  74935.  
  74936.  
  74937.  
  74938. this -> m_alt_insert_point = last_alt_point ;
  74939.  
  74940.  
  74941.  
  74942. m_has_case_change = old_case_change ;
  74943.  
  74944.  
  74945.  
  74946. if ( m_max_mark > m_mark_count )
  74947. {
  74948. m_mark_count = m_max_mark ;
  74949. }
  74950. m_mark_reset = mark_reset ;
  74951. m_max_mark = max_mark ;
  74952.  
  74953.  
  74954. if ( markid > 0 )
  74955. {
  74956.  
  74957. if ( this -> flags ( ) & regbase :: save_subexpression_location )
  74958. this -> m_pdata -> m_subs . at ( markid - 1 ) . second = std :: distance ( m_base , m_position ) - 1 ;
  74959. #2644
  74960. if ( ( markid > 0 ) && ( markid < ( int ) ( sizeof ( unsigned ) * 8 ) ) )
  74961. this -> m_backrefs |= 1u << ( markid - 1 ) ;
  74962. }
  74963. return true ;
  74964. }
  74965.  
  74966. template < class charT , class traits >
  74967. bool basic_regex_parser < charT , traits > :: add_emacs_code ( bool negate )
  74968. {
  74969.  
  74970.  
  74971.  
  74972. if ( ++ m_position == m_end )
  74973. {
  74974.  
  74975. -- m_position ;
  74976. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_escape ) -- m_position ;
  74977. fail ( regex_constants :: error_escape , m_position - m_base ) ;
  74978. return false ;
  74979. }
  74980. basic_char_set < charT , traits > char_set ;
  74981. if ( negate )
  74982. char_set . negate ( ) ;
  74983.  
  74984. static const charT s_punct [ 5 ] = { 'p' , 'u' , 'n' , 'c' , 't' , } ;
  74985.  
  74986. switch ( * m_position )
  74987. {
  74988. case 's' :
  74989. case ' ' :
  74990. char_set . add_class ( this -> m_mask_space ) ;
  74991. break ;
  74992. case 'w' :
  74993. char_set . add_class ( this -> m_word_mask ) ;
  74994. break ;
  74995. case '_' :
  74996. char_set . add_single ( digraph < charT > ( charT ( '$' ) ) ) ;
  74997. char_set . add_single ( digraph < charT > ( charT ( '&' ) ) ) ;
  74998. char_set . add_single ( digraph < charT > ( charT ( '*' ) ) ) ;
  74999. char_set . add_single ( digraph < charT > ( charT ( '+' ) ) ) ;
  75000. char_set . add_single ( digraph < charT > ( charT ( '-' ) ) ) ;
  75001. char_set . add_single ( digraph < charT > ( charT ( '_' ) ) ) ;
  75002. char_set . add_single ( digraph < charT > ( charT ( '<' ) ) ) ;
  75003. char_set . add_single ( digraph < charT > ( charT ( '>' ) ) ) ;
  75004. break ;
  75005. case '.' :
  75006. char_set . add_class ( this -> m_traits . lookup_classname ( s_punct , s_punct + 5 ) ) ;
  75007. break ;
  75008. case '(' :
  75009. char_set . add_single ( digraph < charT > ( charT ( '(' ) ) ) ;
  75010. char_set . add_single ( digraph < charT > ( charT ( '[' ) ) ) ;
  75011. char_set . add_single ( digraph < charT > ( charT ( '{' ) ) ) ;
  75012. break ;
  75013. case ')' :
  75014. char_set . add_single ( digraph < charT > ( charT ( ')' ) ) ) ;
  75015. char_set . add_single ( digraph < charT > ( charT ( ']' ) ) ) ;
  75016. char_set . add_single ( digraph < charT > ( charT ( '}' ) ) ) ;
  75017. break ;
  75018. case '"' :
  75019. char_set . add_single ( digraph < charT > ( charT ( '"' ) ) ) ;
  75020. char_set . add_single ( digraph < charT > ( charT ( '\'' ) ) ) ;
  75021. char_set . add_single ( digraph < charT > ( charT ( '`' ) ) ) ;
  75022. break ;
  75023. case '\'' :
  75024. char_set . add_single ( digraph < charT > ( charT ( '\'' ) ) ) ;
  75025. char_set . add_single ( digraph < charT > ( charT ( ',' ) ) ) ;
  75026. char_set . add_single ( digraph < charT > ( charT ( '#' ) ) ) ;
  75027. break ;
  75028. case '<' :
  75029. char_set . add_single ( digraph < charT > ( charT ( ';' ) ) ) ;
  75030. break ;
  75031. case '>' :
  75032. char_set . add_single ( digraph < charT > ( charT ( '\n' ) ) ) ;
  75033. char_set . add_single ( digraph < charT > ( charT ( '\f' ) ) ) ;
  75034. break ;
  75035. default :
  75036. fail ( regex_constants :: error_ctype , m_position - m_base ) ;
  75037. return false ;
  75038. }
  75039. if ( 0 == this -> append_set ( char_set ) )
  75040. {
  75041. fail ( regex_constants :: error_ctype , m_position - m_base ) ;
  75042. return false ;
  75043. }
  75044. ++ m_position ;
  75045. return true ;
  75046. }
  75047.  
  75048. template < class charT , class traits >
  75049. regex_constants :: syntax_option_type basic_regex_parser < charT , traits > :: parse_options ( )
  75050. {
  75051.  
  75052. regex_constants :: syntax_option_type f = this -> flags ( ) ;
  75053. bool breakout = false ;
  75054. do
  75055. {
  75056. switch ( * m_position )
  75057. {
  75058. case 's' :
  75059. f |= regex_constants :: mod_s ;
  75060. f &= ~ regex_constants :: no_mod_s ;
  75061. break ;
  75062. case 'm' :
  75063. f &= ~ regex_constants :: no_mod_m ;
  75064. break ;
  75065. case 'i' :
  75066. f |= regex_constants :: icase ;
  75067. break ;
  75068. case 'x' :
  75069. f |= regex_constants :: mod_x ;
  75070. break ;
  75071. default :
  75072. breakout = true ;
  75073. continue ;
  75074. }
  75075. if ( ++ m_position == m_end )
  75076. {
  75077.  
  75078. -- m_position ;
  75079. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  75080. fail ( regex_constants :: error_paren , m_position - m_base ) ;
  75081. return false ;
  75082. }
  75083. }
  75084. while ( ! breakout ) ;
  75085.  
  75086. breakout = false ;
  75087.  
  75088. if ( * m_position == static_cast < charT > ( '-' ) )
  75089. {
  75090. if ( ++ m_position == m_end )
  75091. {
  75092.  
  75093. -- m_position ;
  75094. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  75095. fail ( regex_constants :: error_paren , m_position - m_base ) ;
  75096. return false ;
  75097. }
  75098. do
  75099. {
  75100. switch ( * m_position )
  75101. {
  75102. case 's' :
  75103. f &= ~ regex_constants :: mod_s ;
  75104. f |= regex_constants :: no_mod_s ;
  75105. break ;
  75106. case 'm' :
  75107. f |= regex_constants :: no_mod_m ;
  75108. break ;
  75109. case 'i' :
  75110. f &= ~ regex_constants :: icase ;
  75111. break ;
  75112. case 'x' :
  75113. f &= ~ regex_constants :: mod_x ;
  75114. break ;
  75115. default :
  75116. breakout = true ;
  75117. continue ;
  75118. }
  75119. if ( ++ m_position == m_end )
  75120. {
  75121.  
  75122. -- m_position ;
  75123. while ( this -> m_traits . syntax_type ( * m_position ) != regex_constants :: syntax_open_mark ) -- m_position ;
  75124. fail ( regex_constants :: error_paren , m_position - m_base ) ;
  75125. return false ;
  75126. }
  75127. }
  75128. while ( ! breakout ) ;
  75129. }
  75130. return f ;
  75131. }
  75132.  
  75133. template < class charT , class traits >
  75134. bool basic_regex_parser < charT , traits > :: unwind_alts ( std :: ptrdiff_t last_paren_start )
  75135. {
  75136.  
  75137.  
  75138.  
  75139.  
  75140. if ( ( this -> m_alt_insert_point == static_cast < std :: ptrdiff_t > ( this -> m_pdata -> m_data . size ( ) ) )
  75141. && m_alt_jumps . size ( ) && ( m_alt_jumps . back ( ) > last_paren_start )
  75142. &&
  75143. ! (
  75144. ( ( this -> flags ( ) & regbase :: main_option_type ) == regbase :: perl_syntax_group )
  75145. &&
  75146. ( ( this -> flags ( ) & regbase :: no_empty_expressions ) == 0 )
  75147. )
  75148. )
  75149. {
  75150. fail ( regex_constants :: error_empty , this -> m_position - this -> m_base , "Can't terminate a sub-expression with an alternation operator |."
  75151. #2834
  75152. ) ;
  75153. return false ;
  75154. }
  75155.  
  75156.  
  75157.  
  75158. while ( m_alt_jumps . size ( ) && ( m_alt_jumps . back ( ) > last_paren_start ) )
  75159. {
  75160.  
  75161.  
  75162.  
  75163.  
  75164. std :: ptrdiff_t jump_offset = m_alt_jumps . back ( ) ;
  75165. m_alt_jumps . pop_back ( ) ;
  75166. this -> m_pdata -> m_data . align ( ) ;
  75167. re_jump * jmp = static_cast < re_jump * > ( this -> getaddress ( jump_offset ) ) ;
  75168. ( ( void ) 0 ) ;
  75169. jmp -> alt . i = this -> m_pdata -> m_data . size ( ) - jump_offset ;
  75170. }
  75171. return true ;
  75172. }
  75173.  
  75174.  
  75175.  
  75176.  
  75177.  
  75178. }
  75179. }
  75180. #1 "./boost/regex/v4/sub_match.hpp"
  75181. #33
  75182. namespace boost {
  75183.  
  75184. template < class BidiIterator >
  75185. struct sub_match : public std :: pair < BidiIterator , BidiIterator >
  75186. {
  75187. typedef typename re_detail :: regex_iterator_traits < BidiIterator > :: value_type value_type ;
  75188.  
  75189.  
  75190.  
  75191. typedef typename re_detail :: regex_iterator_traits < BidiIterator > :: difference_type difference_type ;
  75192.  
  75193. typedef BidiIterator iterator_type ;
  75194. typedef BidiIterator iterator ;
  75195. typedef BidiIterator const_iterator ;
  75196.  
  75197. bool matched ;
  75198.  
  75199. sub_match ( ) : std :: pair < BidiIterator , BidiIterator > ( ) , matched ( false ) { }
  75200. sub_match ( BidiIterator i ) : std :: pair < BidiIterator , BidiIterator > ( i , i ) , matched ( false ) { }
  75201.  
  75202.  
  75203.  
  75204.  
  75205. template < class T , class A >
  75206. operator std :: basic_string < value_type , T , A > ( ) const
  75207. {
  75208. return matched ? std :: basic_string < value_type , T , A > ( this -> first , this -> second ) : std :: basic_string < value_type
  75209. #59
  75210. , T , A > ( ) ;
  75211. }
  75212. #67
  75213. difference_type length ( ) const
  75214. {
  75215. difference_type n = matched ? :: boost :: re_detail :: distance ( ( BidiIterator ) this -> first , ( BidiIterator ) this
  75216. #69
  75217. -> second ) : 0 ;
  75218. return n ;
  75219. }
  75220. std :: basic_string < value_type > str ( ) const
  75221. {
  75222. std :: basic_string < value_type > result ;
  75223. if ( matched )
  75224. {
  75225. std :: size_t len = :: boost :: re_detail :: distance ( ( BidiIterator ) this -> first , ( BidiIterator ) this -> second
  75226. #77
  75227. ) ;
  75228. result . reserve ( len ) ;
  75229. BidiIterator i = this -> first ;
  75230. while ( i != this -> second )
  75231. {
  75232. result . append ( 1 , * i ) ;
  75233. ++ i ;
  75234. }
  75235. }
  75236. return result ;
  75237. }
  75238. int compare ( const sub_match & s ) const
  75239. {
  75240. if ( matched != s . matched )
  75241. return static_cast < int > ( matched ) - static_cast < int > ( s . matched ) ;
  75242. return str ( ) . compare ( s . str ( ) ) ;
  75243. }
  75244. int compare ( const std :: basic_string < value_type > & s ) const
  75245. {
  75246. return str ( ) . compare ( s ) ;
  75247. }
  75248. int compare ( const value_type * p ) const
  75249. {
  75250. return str ( ) . compare ( p ) ;
  75251. }
  75252.  
  75253. bool operator == ( const sub_match & that ) const
  75254. { return compare ( that ) == 0 ; }
  75255. bool operator != ( const sub_match & that ) const
  75256. { return compare ( that ) != 0 ; }
  75257. bool operator < ( const sub_match & that ) const
  75258. { return compare ( that ) < 0 ; }
  75259. bool operator > ( const sub_match & that ) const
  75260. { return compare ( that ) > 0 ; }
  75261. bool operator <= ( const sub_match & that ) const
  75262. { return compare ( that ) <= 0 ; }
  75263. bool operator >= ( const sub_match & that ) const
  75264. { return compare ( that ) >= 0 ; }
  75265. #140
  75266. sub_match ( const sub_match & that , bool
  75267.  
  75268.  
  75269.  
  75270. = true
  75271. )
  75272. : std :: pair < BidiIterator , BidiIterator > ( that ) ,
  75273. matched ( that . matched )
  75274. {
  75275.  
  75276.  
  75277.  
  75278.  
  75279.  
  75280. }
  75281. sub_match & operator = ( const sub_match & that )
  75282. {
  75283. this -> first = that . first ;
  75284. this -> second = that . second ;
  75285. matched = that . matched ;
  75286.  
  75287.  
  75288.  
  75289.  
  75290. return * this ;
  75291. }
  75292. #183
  75293. } ;
  75294.  
  75295. typedef sub_match < const char * > csub_match ;
  75296. typedef sub_match < std :: string :: const_iterator > ssub_match ;
  75297.  
  75298. typedef sub_match < const wchar_t * > wcsub_match ;
  75299. typedef sub_match < std :: wstring :: const_iterator > wssub_match ;
  75300.  
  75301.  
  75302.  
  75303. template < class RandomAccessIterator , class traits , class Allocator >
  75304. inline bool operator == ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator
  75305. #194
  75306. > :: value_type , traits , Allocator > & s ,
  75307. const sub_match < RandomAccessIterator > & m )
  75308. { return s . compare ( m . str ( ) ) == 0 ; }
  75309. template < class RandomAccessIterator , class traits , class Allocator >
  75310. inline bool operator != ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator
  75311. #198
  75312. > :: value_type , traits , Allocator > & s ,
  75313. const sub_match < RandomAccessIterator > & m )
  75314. { return s . compare ( m . str ( ) ) != 0 ; }
  75315. template < class RandomAccessIterator , class traits , class Allocator >
  75316. inline bool operator < ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator >
  75317. #202
  75318. :: value_type , traits , Allocator > & s ,
  75319. const sub_match < RandomAccessIterator > & m )
  75320. { return s . compare ( m . str ( ) ) < 0 ; }
  75321. template < class RandomAccessIterator , class traits , class Allocator >
  75322. inline bool operator <= ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator
  75323. #206
  75324. > :: value_type , traits , Allocator > & s ,
  75325. const sub_match < RandomAccessIterator > & m )
  75326. { return s . compare ( m . str ( ) ) <= 0 ; }
  75327. template < class RandomAccessIterator , class traits , class Allocator >
  75328. inline bool operator >= ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator
  75329. #210
  75330. > :: value_type , traits , Allocator > & s ,
  75331. const sub_match < RandomAccessIterator > & m )
  75332. { return s . compare ( m . str ( ) ) >= 0 ; }
  75333. template < class RandomAccessIterator , class traits , class Allocator >
  75334. inline bool operator > ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator >
  75335. #214
  75336. :: value_type , traits , Allocator > & s ,
  75337. const sub_match < RandomAccessIterator > & m )
  75338. { return s . compare ( m . str ( ) ) > 0 ; }
  75339.  
  75340. template < class RandomAccessIterator , class traits , class Allocator >
  75341. inline bool operator == ( const sub_match < RandomAccessIterator > & m ,
  75342. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75343. #220
  75344. Allocator > & s )
  75345. { return m . str ( ) . compare ( s ) == 0 ; }
  75346. template < class RandomAccessIterator , class traits , class Allocator >
  75347. inline bool operator != ( const sub_match < RandomAccessIterator > & m ,
  75348. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75349. #224
  75350. Allocator > & s )
  75351. { return m . str ( ) . compare ( s ) != 0 ; }
  75352. template < class RandomAccessIterator , class traits , class Allocator >
  75353. inline bool operator < ( const sub_match < RandomAccessIterator > & m ,
  75354. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75355. #228
  75356. Allocator > & s )
  75357. { return m . str ( ) . compare ( s ) < 0 ; }
  75358. template < class RandomAccessIterator , class traits , class Allocator >
  75359. inline bool operator > ( const sub_match < RandomAccessIterator > & m ,
  75360. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75361. #232
  75362. Allocator > & s )
  75363. { return m . str ( ) . compare ( s ) > 0 ; }
  75364. template < class RandomAccessIterator , class traits , class Allocator >
  75365. inline bool operator <= ( const sub_match < RandomAccessIterator > & m ,
  75366. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75367. #236
  75368. Allocator > & s )
  75369. { return m . str ( ) . compare ( s ) <= 0 ; }
  75370. template < class RandomAccessIterator , class traits , class Allocator >
  75371. inline bool operator >= ( const sub_match < RandomAccessIterator > & m ,
  75372. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75373. #240
  75374. Allocator > & s )
  75375. { return m . str ( ) . compare ( s ) >= 0 ; }
  75376.  
  75377. template < class RandomAccessIterator >
  75378. inline bool operator == ( const sub_match < RandomAccessIterator > & m ,
  75379. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75380. { return m . str ( ) . compare ( s ) == 0 ; }
  75381. template < class RandomAccessIterator >
  75382. inline bool operator != ( const sub_match < RandomAccessIterator > & m ,
  75383. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75384. { return m . str ( ) . compare ( s ) != 0 ; }
  75385. template < class RandomAccessIterator >
  75386. inline bool operator > ( const sub_match < RandomAccessIterator > & m ,
  75387. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75388. { return m . str ( ) . compare ( s ) > 0 ; }
  75389. template < class RandomAccessIterator >
  75390. inline bool operator < ( const sub_match < RandomAccessIterator > & m ,
  75391. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75392. { return m . str ( ) . compare ( s ) < 0 ; }
  75393. template < class RandomAccessIterator >
  75394. inline bool operator >= ( const sub_match < RandomAccessIterator > & m ,
  75395. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75396. { return m . str ( ) . compare ( s ) >= 0 ; }
  75397. template < class RandomAccessIterator >
  75398. inline bool operator <= ( const sub_match < RandomAccessIterator > & m ,
  75399. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75400. { return m . str ( ) . compare ( s ) <= 0 ; }
  75401.  
  75402. template < class RandomAccessIterator >
  75403. inline bool operator == ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75404. #269
  75405.  
  75406. const sub_match < RandomAccessIterator > & m )
  75407. { return m . str ( ) . compare ( s ) == 0 ; }
  75408. template < class RandomAccessIterator >
  75409. inline bool operator != ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75410. #273
  75411.  
  75412. const sub_match < RandomAccessIterator > & m )
  75413. { return m . str ( ) . compare ( s ) != 0 ; }
  75414. template < class RandomAccessIterator >
  75415. inline bool operator < ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75416. const sub_match < RandomAccessIterator > & m )
  75417. { return m . str ( ) . compare ( s ) > 0 ; }
  75418. template < class RandomAccessIterator >
  75419. inline bool operator > ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75420. const sub_match < RandomAccessIterator > & m )
  75421. { return m . str ( ) . compare ( s ) < 0 ; }
  75422. template < class RandomAccessIterator >
  75423. inline bool operator <= ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75424. #285
  75425.  
  75426. const sub_match < RandomAccessIterator > & m )
  75427. { return m . str ( ) . compare ( s ) >= 0 ; }
  75428. template < class RandomAccessIterator >
  75429. inline bool operator >= ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75430. #289
  75431.  
  75432. const sub_match < RandomAccessIterator > & m )
  75433. { return m . str ( ) . compare ( s ) <= 0 ; }
  75434.  
  75435.  
  75436. template < class RandomAccessIterator >
  75437. inline bool operator == ( const sub_match < RandomAccessIterator > & m ,
  75438. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75439. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) == 0 ; }
  75440. template < class RandomAccessIterator >
  75441. inline bool operator != ( const sub_match < RandomAccessIterator > & m ,
  75442. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75443. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) != 0 ; }
  75444. template < class RandomAccessIterator >
  75445. inline bool operator > ( const sub_match < RandomAccessIterator > & m ,
  75446. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75447. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) > 0 ; }
  75448. template < class RandomAccessIterator >
  75449. inline bool operator < ( const sub_match < RandomAccessIterator > & m ,
  75450. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75451. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) < 0 ; }
  75452. template < class RandomAccessIterator >
  75453. inline bool operator >= ( const sub_match < RandomAccessIterator > & m ,
  75454. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75455. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) >= 0 ; }
  75456. template < class RandomAccessIterator >
  75457. inline bool operator <= ( const sub_match < RandomAccessIterator > & m ,
  75458. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75459. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) <= 0 ; }
  75460.  
  75461. template < class RandomAccessIterator >
  75462. inline bool operator == ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75463. #320
  75464.  
  75465. const sub_match < RandomAccessIterator > & m )
  75466. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) == 0 ; }
  75467. template < class RandomAccessIterator >
  75468. inline bool operator != ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75469. #324
  75470.  
  75471. const sub_match < RandomAccessIterator > & m )
  75472. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) != 0 ; }
  75473. template < class RandomAccessIterator >
  75474. inline bool operator < ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75475. const sub_match < RandomAccessIterator > & m )
  75476. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) > 0 ; }
  75477. template < class RandomAccessIterator >
  75478. inline bool operator > ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75479. const sub_match < RandomAccessIterator > & m )
  75480. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) < 0 ; }
  75481. template < class RandomAccessIterator >
  75482. inline bool operator <= ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75483. #336
  75484.  
  75485. const sub_match < RandomAccessIterator > & m )
  75486. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) >= 0 ; }
  75487. template < class RandomAccessIterator >
  75488. inline bool operator >= ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75489. #340
  75490.  
  75491. const sub_match < RandomAccessIterator > & m )
  75492. { return m . str ( ) . compare ( 0 , m . length ( ) , & s , 1 ) <= 0 ; }
  75493.  
  75494.  
  75495. template < class RandomAccessIterator , class traits , class Allocator >
  75496. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits
  75497. #346
  75498. , Allocator >
  75499. operator + ( const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type
  75500. #347
  75501. , traits , Allocator > & s ,
  75502. const sub_match < RandomAccessIterator > & m )
  75503. {
  75504. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits , Allocator
  75505. #350
  75506. > result ;
  75507. result . reserve ( s . size ( ) + m . length ( ) + 1 ) ;
  75508. return result . append ( s ) . append ( m . first , m . second ) ;
  75509. }
  75510. template < class RandomAccessIterator , class traits , class Allocator >
  75511. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits
  75512. #355
  75513. , Allocator >
  75514. operator + ( const sub_match < RandomAccessIterator > & m ,
  75515. const std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits ,
  75516. #357
  75517. Allocator > & s )
  75518. {
  75519. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type , traits , Allocator
  75520. #359
  75521. > result ;
  75522. result . reserve ( s . size ( ) + m . length ( ) + 1 ) ;
  75523. return result . append ( m . first , m . second ) . append ( s ) ;
  75524. }
  75525.  
  75526. template < class RandomAccessIterator >
  75527. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type >
  75528. operator + ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s ,
  75529. const sub_match < RandomAccessIterator > & m )
  75530. {
  75531. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type > result ;
  75532. result . reserve ( std :: char_traits < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type
  75533. #370
  75534. > :: length ( s ) + m . length ( ) + 1 ) ;
  75535. return result . append ( s ) . append ( m . first , m . second ) ;
  75536. }
  75537. template < class RandomAccessIterator >
  75538. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type >
  75539. operator + ( const sub_match < RandomAccessIterator > & m ,
  75540. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const * s )
  75541. {
  75542. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type > result ;
  75543. result . reserve ( std :: char_traits < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type
  75544. #379
  75545. > :: length ( s ) + m . length ( ) + 1 ) ;
  75546. return result . append ( m . first , m . second ) . append ( s ) ;
  75547. }
  75548. #399
  75549. template < class RandomAccessIterator >
  75550. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type >
  75551. operator + ( typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s ,
  75552. const sub_match < RandomAccessIterator > & m )
  75553. {
  75554. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type > result ;
  75555. result . reserve ( m . length ( ) + 2 ) ;
  75556. return result . append ( 1 , s ) . append ( m . first , m . second ) ;
  75557. }
  75558. template < class RandomAccessIterator >
  75559. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type >
  75560. operator + ( const sub_match < RandomAccessIterator > & m ,
  75561. typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type const & s )
  75562. {
  75563. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type > result ;
  75564. result . reserve ( m . length ( ) + 2 ) ;
  75565. return result . append ( m . first , m . second ) . append ( 1 , s ) ;
  75566. }
  75567. template < class RandomAccessIterator >
  75568. inline std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type >
  75569. operator + ( const sub_match < RandomAccessIterator > & m1 ,
  75570. const sub_match < RandomAccessIterator > & m2 )
  75571. {
  75572. std :: basic_string < typename re_detail :: regex_iterator_traits < RandomAccessIterator > :: value_type > result ;
  75573. result . reserve ( m1 . length ( ) + m2 . length ( ) + 1 ) ;
  75574. return result . append ( m1 . first , m1 . second ) . append ( m2 . first , m2 . second ) ;
  75575. }
  75576.  
  75577. template < class charT , class traits , class RandomAccessIterator >
  75578. std :: basic_ostream < charT , traits > &
  75579. operator << ( std :: basic_ostream < charT , traits > & os ,
  75580. const sub_match < RandomAccessIterator > & s )
  75581. {
  75582. return ( os << s . str ( ) ) ;
  75583. }
  75584. #498
  75585. }
  75586. #1 "./boost/regex/v4/regex_format.hpp"
  75587. #1 "./boost/type_traits/is_pointer.hpp"
  75588. #1 "./boost/type_traits/is_member_pointer.hpp"
  75589. #1 "./boost/type_traits/is_member_function_pointer.hpp"
  75590. #1 "./boost/type_traits/detail/is_mem_fun_pointer_impl.hpp"
  75591. #25
  75592. namespace boost {
  75593. namespace type_traits {
  75594.  
  75595. template < typename T >
  75596. struct is_mem_fun_pointer_impl
  75597. {
  75598. static const bool value = false ;
  75599. } ;
  75600.  
  75601.  
  75602.  
  75603.  
  75604.  
  75605. template < class R , class T >
  75606. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ) > { static const bool value = true ; } ;
  75607.  
  75608. template < class R , class T >
  75609. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ... ) > { static const bool value = true ; } ;
  75610.  
  75611.  
  75612.  
  75613. template < class R , class T >
  75614. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ) const > { static const bool value = true ; } ;
  75615.  
  75616. template < class R , class T >
  75617. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ) volatile > { static const bool value = true ; } ;
  75618.  
  75619. template < class R , class T >
  75620. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ) const volatile > { static const bool value = true ; } ;
  75621.  
  75622.  
  75623. template < class R , class T >
  75624. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ... ) const > { static const bool value = true ; } ;
  75625.  
  75626. template < class R , class T >
  75627. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ... ) volatile > { static const bool value = true ; } ;
  75628.  
  75629. template < class R , class T >
  75630. struct is_mem_fun_pointer_impl < R ( T :: * ) ( ... ) const volatile > { static const bool value = true ; } ;
  75631.  
  75632.  
  75633. template < class R , class T , class T0 >
  75634. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ) > { static const bool value = true ; } ;
  75635.  
  75636. template < class R , class T , class T0 >
  75637. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ... ) > { static const bool value = true ; } ;
  75638.  
  75639.  
  75640.  
  75641. template < class R , class T , class T0 >
  75642. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ) const > { static const bool value = true ; } ;
  75643.  
  75644. template < class R , class T , class T0 >
  75645. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ) volatile > { static const bool value = true ; } ;
  75646.  
  75647. template < class R , class T , class T0 >
  75648. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ) const volatile > { static const bool value = true ; } ;
  75649.  
  75650.  
  75651. template < class R , class T , class T0 >
  75652. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ... ) const > { static const bool value = true ; } ;
  75653.  
  75654. template < class R , class T , class T0 >
  75655. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ... ) volatile > { static const bool value = true ; } ;
  75656.  
  75657. template < class R , class T , class T0 >
  75658. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 ... ) const volatile > { static const bool value = true ; } ;
  75659.  
  75660.  
  75661. template < class R , class T , class T0 , class T1 >
  75662. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ) > { static const bool value = true ; } ;
  75663.  
  75664. template < class R , class T , class T0 , class T1 >
  75665. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ... ) > { static const bool value = true ; } ;
  75666.  
  75667.  
  75668.  
  75669. template < class R , class T , class T0 , class T1 >
  75670. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ) const > { static const bool value = true ; } ;
  75671.  
  75672. template < class R , class T , class T0 , class T1 >
  75673. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ) volatile > { static const bool value = true ; } ;
  75674.  
  75675. template < class R , class T , class T0 , class T1 >
  75676. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ) const volatile > { static const bool value = true ; } ;
  75677.  
  75678.  
  75679. template < class R , class T , class T0 , class T1 >
  75680. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ... ) const > { static const bool value = true ; } ;
  75681.  
  75682. template < class R , class T , class T0 , class T1 >
  75683. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ... ) volatile > { static const bool value = true ; } ;
  75684.  
  75685. template < class R , class T , class T0 , class T1 >
  75686. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 ... ) const volatile > { static const bool value = true ; } ;
  75687.  
  75688.  
  75689. template < class R , class T , class T0 , class T1 , class T2 >
  75690. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ) > { static const bool value = true ; } ;
  75691.  
  75692. template < class R , class T , class T0 , class T1 , class T2 >
  75693. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ... ) > { static const bool value = true ; } ;
  75694.  
  75695.  
  75696.  
  75697. template < class R , class T , class T0 , class T1 , class T2 >
  75698. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ) const > { static const bool value = true ; } ;
  75699.  
  75700. template < class R , class T , class T0 , class T1 , class T2 >
  75701. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ) volatile > { static const bool value = true ; } ;
  75702.  
  75703. template < class R , class T , class T0 , class T1 , class T2 >
  75704. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ) const volatile > { static const bool value = true ; } ;
  75705.  
  75706.  
  75707. template < class R , class T , class T0 , class T1 , class T2 >
  75708. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ... ) const > { static const bool value = true ; } ;
  75709.  
  75710. template < class R , class T , class T0 , class T1 , class T2 >
  75711. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ... ) volatile > { static const bool value = true ; } ;
  75712.  
  75713. template < class R , class T , class T0 , class T1 , class T2 >
  75714. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 ... ) const volatile > { static const bool value = true ; }
  75715. #147
  75716. ;
  75717.  
  75718.  
  75719. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75720. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ) > { static const bool value = true ; } ;
  75721.  
  75722. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75723. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ... ) > { static const bool value = true ; } ;
  75724.  
  75725.  
  75726.  
  75727. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75728. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ) const > { static const bool value = true ; } ;
  75729.  
  75730. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75731. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ) volatile > { static const bool value = true ; } ;
  75732.  
  75733. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75734. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ) const volatile > { static const bool value = true ; }
  75735. #165
  75736. ;
  75737.  
  75738.  
  75739. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75740. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ... ) const > { static const bool value = true ; } ;
  75741.  
  75742. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75743. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ... ) volatile > { static const bool value = true ; } ;
  75744. #172
  75745.  
  75746.  
  75747. template < class R , class T , class T0 , class T1 , class T2 , class T3 >
  75748. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 ... ) const volatile > { static const bool value = true
  75749. #175
  75750. ; } ;
  75751.  
  75752.  
  75753. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75754. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ) > { static const bool value = true ; } ;
  75755.  
  75756. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75757. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ... ) > { static const bool value = true ; } ;
  75758.  
  75759.  
  75760.  
  75761. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75762. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ) const > { static const bool value = true ; } ;
  75763.  
  75764. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75765. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ) volatile > { static const bool value = true ; }
  75766. #190
  75767. ;
  75768.  
  75769. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75770. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ) const volatile > { static const bool value = true
  75771. #193
  75772. ; } ;
  75773.  
  75774.  
  75775. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75776. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ... ) const > { static const bool value = true ; }
  75777. #197
  75778. ;
  75779.  
  75780. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75781. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ... ) volatile > { static const bool value = true
  75782. #200
  75783. ; } ;
  75784.  
  75785. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 >
  75786. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 ... ) const volatile > { static const bool value =
  75787. #203
  75788. true ; } ;
  75789.  
  75790.  
  75791. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75792. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ) > { static const bool value = true ; } ;
  75793.  
  75794. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75795. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ... ) > { static const bool value = true ; }
  75796. #210
  75797. ;
  75798.  
  75799.  
  75800.  
  75801. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75802. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ) const > { static const bool value = true ;
  75803. #215
  75804. } ;
  75805.  
  75806. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75807. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ) volatile > { static const bool value = true
  75808. #218
  75809. ; } ;
  75810.  
  75811. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75812. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ) const volatile > { static const bool value
  75813. #221
  75814. = true ; } ;
  75815.  
  75816.  
  75817. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75818. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ... ) const > { static const bool value = true
  75819. #225
  75820. ; } ;
  75821.  
  75822. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75823. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ... ) volatile > { static const bool value =
  75824. #228
  75825. true ; } ;
  75826.  
  75827. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
  75828. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 ... ) const volatile > { static const bool value
  75829. #231
  75830. = true ; } ;
  75831.  
  75832.  
  75833. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75834. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ) > { static const bool value = true ; }
  75835. #235
  75836. ;
  75837.  
  75838. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75839. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ... ) > { static const bool value = true
  75840. #238
  75841. ; } ;
  75842.  
  75843.  
  75844.  
  75845. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75846. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ) const > { static const bool value = true
  75847. #243
  75848. ; } ;
  75849.  
  75850. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75851. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ) volatile > { static const bool value =
  75852. #246
  75853. true ; } ;
  75854.  
  75855. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75856. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ) const volatile > { static const bool value
  75857. #249
  75858. = true ; } ;
  75859.  
  75860.  
  75861. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75862. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ... ) const > { static const bool value
  75863. #253
  75864. = true ; } ;
  75865.  
  75866. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75867. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ... ) volatile > { static const bool value
  75868. #256
  75869. = true ; } ;
  75870.  
  75871. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
  75872. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 ... ) const volatile > { static const bool
  75873. #259
  75874. value = true ; } ;
  75875.  
  75876.  
  75877. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75878. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ) > { static const bool value = true
  75879. #263
  75880. ; } ;
  75881.  
  75882. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75883. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ... ) > { static const bool value =
  75884. #266
  75885. true ; } ;
  75886.  
  75887.  
  75888.  
  75889. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75890. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ) const > { static const bool value
  75891. #271
  75892. = true ; } ;
  75893.  
  75894. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75895. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ) volatile > { static const bool value
  75896. #274
  75897. = true ; } ;
  75898.  
  75899. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75900. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ) const volatile > { static const bool
  75901. #277
  75902. value = true ; } ;
  75903.  
  75904.  
  75905. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75906. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ... ) const > { static const bool value
  75907. #281
  75908. = true ; } ;
  75909.  
  75910. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75911. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ... ) volatile > { static const bool
  75912. #284
  75913. value = true ; } ;
  75914.  
  75915. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
  75916. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ... ) const volatile > { static const
  75917. #287
  75918. bool value = true ; } ;
  75919.  
  75920.  
  75921. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75922. #290
  75923. T8 >
  75924. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) > { static const bool value
  75925. #291
  75926. = true ; } ;
  75927.  
  75928. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75929. #293
  75930. T8 >
  75931. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ... ) > { static const bool value
  75932. #294
  75933. = true ; } ;
  75934.  
  75935.  
  75936.  
  75937. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75938. #298
  75939. T8 >
  75940. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) const > { static const bool
  75941. #299
  75942. value = true ; } ;
  75943.  
  75944. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75945. #301
  75946. T8 >
  75947. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) volatile > { static const bool
  75948. #302
  75949. value = true ; } ;
  75950.  
  75951. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75952. #304
  75953. T8 >
  75954. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) const volatile > { static const
  75955. #305
  75956. bool value = true ; } ;
  75957.  
  75958.  
  75959. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75960. #308
  75961. T8 >
  75962. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ... ) const > { static const bool
  75963. #309
  75964. value = true ; } ;
  75965.  
  75966. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75967. #311
  75968. T8 >
  75969. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ... ) volatile > { static const
  75970. #312
  75971. bool value = true ; } ;
  75972.  
  75973. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75974. #314
  75975. T8 >
  75976. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ... ) const volatile > { static
  75977. #315
  75978. const bool value = true ; } ;
  75979.  
  75980.  
  75981. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75982. #318
  75983. T8 , class T9 >
  75984. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) > { static const bool value
  75985. #319
  75986. = true ; } ;
  75987.  
  75988. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75989. #321
  75990. T8 , class T9 >
  75991. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ... ) > { static const bool
  75992. #322
  75993. value = true ; } ;
  75994.  
  75995.  
  75996.  
  75997. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  75998. #326
  75999. T8 , class T9 >
  76000. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) const > { static const
  76001. #327
  76002. bool value = true ; } ;
  76003.  
  76004. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76005. #329
  76006. T8 , class T9 >
  76007. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) volatile > { static const
  76008. #330
  76009. bool value = true ; } ;
  76010.  
  76011. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76012. #332
  76013. T8 , class T9 >
  76014. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) const volatile > { static
  76015. #333
  76016. const bool value = true ; } ;
  76017.  
  76018.  
  76019. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76020. #336
  76021. T8 , class T9 >
  76022. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ... ) const > { static const
  76023. #337
  76024. bool value = true ; } ;
  76025.  
  76026. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76027. #339
  76028. T8 , class T9 >
  76029. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ... ) volatile > { static
  76030. #340
  76031. const bool value = true ; } ;
  76032.  
  76033. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76034. #342
  76035. T8 , class T9 >
  76036. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ... ) const volatile > {
  76037. #343
  76038. static const bool value = true ; } ;
  76039.  
  76040.  
  76041. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76042. #346
  76043. T8 , class T9 , class T10 >
  76044. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ) > { static const
  76045. #347
  76046. bool value = true ; } ;
  76047.  
  76048. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76049. #349
  76050. T8 , class T9 , class T10 >
  76051. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ... ) > { static const
  76052. #350
  76053. bool value = true ; } ;
  76054.  
  76055.  
  76056.  
  76057. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76058. #354
  76059. T8 , class T9 , class T10 >
  76060. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ) const > { static
  76061. #355
  76062. const bool value = true ; } ;
  76063.  
  76064. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76065. #357
  76066. T8 , class T9 , class T10 >
  76067. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ) volatile > { static
  76068. #358
  76069. const bool value = true ; } ;
  76070.  
  76071. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76072. #360
  76073. T8 , class T9 , class T10 >
  76074. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ) const volatile >
  76075. #361
  76076. { static const bool value = true ; } ;
  76077.  
  76078.  
  76079. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76080. #364
  76081. T8 , class T9 , class T10 >
  76082. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ... ) const > { static
  76083. #365
  76084. const bool value = true ; } ;
  76085.  
  76086. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76087. #367
  76088. T8 , class T9 , class T10 >
  76089. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ... ) volatile > {
  76090. #368
  76091. static const bool value = true ; } ;
  76092.  
  76093. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76094. #370
  76095. T8 , class T9 , class T10 >
  76096. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ... ) const volatile
  76097. #371
  76098. > { static const bool value = true ; } ;
  76099.  
  76100.  
  76101. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76102. #374
  76103. T8 , class T9 , class T10 , class T11 >
  76104. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ) > { static
  76105. #375
  76106. const bool value = true ; } ;
  76107.  
  76108. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76109. #377
  76110. T8 , class T9 , class T10 , class T11 >
  76111. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ... ) > { static
  76112. #378
  76113. const bool value = true ; } ;
  76114.  
  76115.  
  76116.  
  76117. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76118. #382
  76119. T8 , class T9 , class T10 , class T11 >
  76120. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ) const > { static
  76121. #383
  76122. const bool value = true ; } ;
  76123.  
  76124. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76125. #385
  76126. T8 , class T9 , class T10 , class T11 >
  76127. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ) volatile >
  76128. #386
  76129. { static const bool value = true ; } ;
  76130.  
  76131. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76132. #388
  76133. T8 , class T9 , class T10 , class T11 >
  76134. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ) const volatile
  76135. #389
  76136. > { static const bool value = true ; } ;
  76137.  
  76138.  
  76139. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76140. #392
  76141. T8 , class T9 , class T10 , class T11 >
  76142. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ... ) const >
  76143. #393
  76144. { static const bool value = true ; } ;
  76145.  
  76146. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76147. #395
  76148. T8 , class T9 , class T10 , class T11 >
  76149. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ... ) volatile
  76150. #396
  76151. > { static const bool value = true ; } ;
  76152.  
  76153. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76154. #398
  76155. T8 , class T9 , class T10 , class T11 >
  76156. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ... ) const volatile
  76157. #399
  76158. > { static const bool value = true ; } ;
  76159.  
  76160.  
  76161. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76162. #402
  76163. T8 , class T9 , class T10 , class T11 , class T12 >
  76164. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ) > { static
  76165. #403
  76166. const bool value = true ; } ;
  76167.  
  76168. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76169. #405
  76170. T8 , class T9 , class T10 , class T11 , class T12 >
  76171. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ... ) >
  76172. #406
  76173. { static const bool value = true ; } ;
  76174.  
  76175.  
  76176.  
  76177. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76178. #410
  76179. T8 , class T9 , class T10 , class T11 , class T12 >
  76180. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ) const
  76181. #411
  76182. > { static const bool value = true ; } ;
  76183.  
  76184. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76185. #413
  76186. T8 , class T9 , class T10 , class T11 , class T12 >
  76187. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ) volatile
  76188. #414
  76189. > { static const bool value = true ; } ;
  76190.  
  76191. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76192. #416
  76193. T8 , class T9 , class T10 , class T11 , class T12 >
  76194. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ) const
  76195. #417
  76196. volatile > { static const bool value = true ; } ;
  76197.  
  76198.  
  76199. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76200. #420
  76201. T8 , class T9 , class T10 , class T11 , class T12 >
  76202. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ... ) const
  76203. #421
  76204. > { static const bool value = true ; } ;
  76205.  
  76206. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76207. #423
  76208. T8 , class T9 , class T10 , class T11 , class T12 >
  76209. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ... ) volatile
  76210. #424
  76211. > { static const bool value = true ; } ;
  76212.  
  76213. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76214. #426
  76215. T8 , class T9 , class T10 , class T11 , class T12 >
  76216. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ... ) const
  76217. #427
  76218. volatile > { static const bool value = true ; } ;
  76219.  
  76220.  
  76221. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76222. #430
  76223. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76224. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 )
  76225. #431
  76226. > { static const bool value = true ; } ;
  76227.  
  76228. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76229. #433
  76230. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76231. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...
  76232. #434
  76233. ) > { static const bool value = true ; } ;
  76234.  
  76235.  
  76236.  
  76237. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76238. #438
  76239. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76240. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 )
  76241. #439
  76242. const > { static const bool value = true ; } ;
  76243.  
  76244. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76245. #441
  76246. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76247. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 )
  76248. #442
  76249. volatile > { static const bool value = true ; } ;
  76250.  
  76251. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76252. #444
  76253. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76254. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 )
  76255. #445
  76256. const volatile > { static const bool value = true ; } ;
  76257.  
  76258.  
  76259. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76260. #448
  76261. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76262. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...
  76263. #449
  76264. ) const > { static const bool value = true ; } ;
  76265.  
  76266. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76267. #451
  76268. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76269. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...
  76270. #452
  76271. ) volatile > { static const bool value = true ; } ;
  76272.  
  76273. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76274. #454
  76275. T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
  76276. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...
  76277. #455
  76278. ) const volatile > { static const bool value = true ; } ;
  76279.  
  76280.  
  76281. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76282. #458
  76283. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76284. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76285. #459
  76286. T14 ) > { static const bool value = true ; } ;
  76287.  
  76288. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76289. #461
  76290. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76291. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76292. #462
  76293. T14 ... ) > { static const bool value = true ; } ;
  76294.  
  76295.  
  76296.  
  76297. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76298. #466
  76299. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76300. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76301. #467
  76302. T14 ) const > { static const bool value = true ; } ;
  76303.  
  76304. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76305. #469
  76306. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76307. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76308. #470
  76309. T14 ) volatile > { static const bool value = true ; } ;
  76310.  
  76311. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76312. #472
  76313. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76314. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76315. #473
  76316. T14 ) const volatile > { static const bool value = true ; } ;
  76317.  
  76318.  
  76319. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76320. #476
  76321. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76322. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76323. #477
  76324. T14 ... ) const > { static const bool value = true ; } ;
  76325.  
  76326. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76327. #479
  76328. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76329. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76330. #480
  76331. T14 ... ) volatile > { static const bool value = true ; } ;
  76332.  
  76333. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76334. #482
  76335. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
  76336. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76337. #483
  76338. T14 ... ) const volatile > { static const bool value = true ; } ;
  76339.  
  76340.  
  76341. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76342. #486
  76343. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76344. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76345. #487
  76346. T14 , T15 ) > { static const bool value = true ; } ;
  76347.  
  76348. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76349. #489
  76350. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76351. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76352. #490
  76353. T14 , T15 ... ) > { static const bool value = true ; } ;
  76354.  
  76355.  
  76356.  
  76357. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76358. #494
  76359. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76360. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76361. #495
  76362. T14 , T15 ) const > { static const bool value = true ; } ;
  76363.  
  76364. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76365. #497
  76366. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76367. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76368. #498
  76369. T14 , T15 ) volatile > { static const bool value = true ; } ;
  76370.  
  76371. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76372. #500
  76373. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76374. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76375. #501
  76376. T14 , T15 ) const volatile > { static const bool value = true ; } ;
  76377.  
  76378.  
  76379. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76380. #504
  76381. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76382. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76383. #505
  76384. T14 , T15 ... ) const > { static const bool value = true ; } ;
  76385.  
  76386. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76387. #507
  76388. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76389. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76390. #508
  76391. T14 , T15 ... ) volatile > { static const bool value = true ; } ;
  76392.  
  76393. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76394. #510
  76395. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
  76396. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76397. #511
  76398. T14 , T15 ... ) const volatile > { static const bool value = true ; } ;
  76399.  
  76400.  
  76401. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76402. #514
  76403. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76404. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76405. #515
  76406. T14 , T15 , T16 ) > { static const bool value = true ; } ;
  76407.  
  76408. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76409. #517
  76410. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76411. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76412. #518
  76413. T14 , T15 , T16 ... ) > { static const bool value = true ; } ;
  76414.  
  76415.  
  76416.  
  76417. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76418. #522
  76419. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76420. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76421. #523
  76422. T14 , T15 , T16 ) const > { static const bool value = true ; } ;
  76423.  
  76424. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76425. #525
  76426. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76427. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76428. #526
  76429. T14 , T15 , T16 ) volatile > { static const bool value = true ; } ;
  76430.  
  76431. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76432. #528
  76433. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76434. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76435. #529
  76436. T14 , T15 , T16 ) const volatile > { static const bool value = true ; } ;
  76437.  
  76438.  
  76439. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76440. #532
  76441. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76442. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76443. #533
  76444. T14 , T15 , T16 ... ) const > { static const bool value = true ; } ;
  76445.  
  76446. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76447. #535
  76448. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76449. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76450. #536
  76451. T14 , T15 , T16 ... ) volatile > { static const bool value = true ; } ;
  76452.  
  76453. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76454. #538
  76455. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 >
  76456. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76457. #539
  76458. T14 , T15 , T16 ... ) const volatile > { static const bool value = true ; } ;
  76459.  
  76460.  
  76461. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76462. #542
  76463. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76464. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76465. #543
  76466. T14 , T15 , T16 , T17 ) > { static const bool value = true ; } ;
  76467.  
  76468. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76469. #545
  76470. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76471. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76472. #546
  76473. T14 , T15 , T16 , T17 ... ) > { static const bool value = true ; } ;
  76474.  
  76475.  
  76476.  
  76477. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76478. #550
  76479. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76480. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76481. #551
  76482. T14 , T15 , T16 , T17 ) const > { static const bool value = true ; } ;
  76483.  
  76484. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76485. #553
  76486. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76487. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76488. #554
  76489. T14 , T15 , T16 , T17 ) volatile > { static const bool value = true ; } ;
  76490.  
  76491. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76492. #556
  76493. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76494. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76495. #557
  76496. T14 , T15 , T16 , T17 ) const volatile > { static const bool value = true ; } ;
  76497.  
  76498.  
  76499. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76500. #560
  76501. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76502. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76503. #561
  76504. T14 , T15 , T16 , T17 ... ) const > { static const bool value = true ; } ;
  76505.  
  76506. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76507. #563
  76508. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76509. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76510. #564
  76511. T14 , T15 , T16 , T17 ... ) volatile > { static const bool value = true ; } ;
  76512.  
  76513. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76514. #566
  76515. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 >
  76516. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76517. #567
  76518. T14 , T15 , T16 , T17 ... ) const volatile > { static const bool value = true ; } ;
  76519.  
  76520.  
  76521. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76522. #570
  76523. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76524. #570
  76525. >
  76526. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76527. #571
  76528. T14 , T15 , T16 , T17 , T18 ) > { static const bool value = true ; } ;
  76529.  
  76530. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76531. #573
  76532. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76533. #573
  76534. >
  76535. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76536. #574
  76537. T14 , T15 , T16 , T17 , T18 ... ) > { static const bool value = true ; } ;
  76538.  
  76539.  
  76540.  
  76541. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76542. #578
  76543. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76544. #578
  76545. >
  76546. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76547. #579
  76548. T14 , T15 , T16 , T17 , T18 ) const > { static const bool value = true ; } ;
  76549.  
  76550. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76551. #581
  76552. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76553. #581
  76554. >
  76555. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76556. #582
  76557. T14 , T15 , T16 , T17 , T18 ) volatile > { static const bool value = true ; } ;
  76558.  
  76559. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76560. #584
  76561. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76562. #584
  76563. >
  76564. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76565. #585
  76566. T14 , T15 , T16 , T17 , T18 ) const volatile > { static const bool value = true ; } ;
  76567.  
  76568.  
  76569. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76570. #588
  76571. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76572. #588
  76573. >
  76574. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76575. #589
  76576. T14 , T15 , T16 , T17 , T18 ... ) const > { static const bool value = true ; } ;
  76577.  
  76578. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76579. #591
  76580. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76581. #591
  76582. >
  76583. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76584. #592
  76585. T14 , T15 , T16 , T17 , T18 ... ) volatile > { static const bool value = true ; } ;
  76586.  
  76587. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76588. #594
  76589. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76590. #594
  76591. >
  76592. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76593. #595
  76594. T14 , T15 , T16 , T17 , T18 ... ) const volatile > { static const bool value = true ; } ;
  76595.  
  76596.  
  76597. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76598. #598
  76599. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76600. #598
  76601. , class T19 >
  76602. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76603. #599
  76604. T14 , T15 , T16 , T17 , T18 , T19 ) > { static const bool value = true ; } ;
  76605.  
  76606. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76607. #601
  76608. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76609. #601
  76610. , class T19 >
  76611. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76612. #602
  76613. T14 , T15 , T16 , T17 , T18 , T19 ... ) > { static const bool value = true ; } ;
  76614.  
  76615.  
  76616.  
  76617. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76618. #606
  76619. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76620. #606
  76621. , class T19 >
  76622. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76623. #607
  76624. T14 , T15 , T16 , T17 , T18 , T19 ) const > { static const bool value = true ; } ;
  76625.  
  76626. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76627. #609
  76628. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76629. #609
  76630. , class T19 >
  76631. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76632. #610
  76633. T14 , T15 , T16 , T17 , T18 , T19 ) volatile > { static const bool value = true ; } ;
  76634.  
  76635. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76636. #612
  76637. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76638. #612
  76639. , class T19 >
  76640. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76641. #613
  76642. T14 , T15 , T16 , T17 , T18 , T19 ) const volatile > { static const bool value = true ; } ;
  76643.  
  76644.  
  76645. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76646. #616
  76647. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76648. #616
  76649. , class T19 >
  76650. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76651. #617
  76652. T14 , T15 , T16 , T17 , T18 , T19 ... ) const > { static const bool value = true ; } ;
  76653.  
  76654. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76655. #619
  76656. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76657. #619
  76658. , class T19 >
  76659. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76660. #620
  76661. T14 , T15 , T16 , T17 , T18 , T19 ... ) volatile > { static const bool value = true ; } ;
  76662.  
  76663. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76664. #622
  76665. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76666. #622
  76667. , class T19 >
  76668. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76669. #623
  76670. T14 , T15 , T16 , T17 , T18 , T19 ... ) const volatile > { static const bool value = true ; } ;
  76671.  
  76672.  
  76673. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76674. #626
  76675. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76676. #626
  76677. , class T19 , class T20 >
  76678. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76679. #627
  76680. T14 , T15 , T16 , T17 , T18 , T19 , T20 ) > { static const bool value = true ; } ;
  76681.  
  76682. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76683. #629
  76684. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76685. #629
  76686. , class T19 , class T20 >
  76687. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76688. #630
  76689. T14 , T15 , T16 , T17 , T18 , T19 , T20 ... ) > { static const bool value = true ; } ;
  76690.  
  76691.  
  76692.  
  76693. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76694. #634
  76695. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76696. #634
  76697. , class T19 , class T20 >
  76698. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76699. #635
  76700. T14 , T15 , T16 , T17 , T18 , T19 , T20 ) const > { static const bool value = true ; } ;
  76701.  
  76702. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76703. #637
  76704. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76705. #637
  76706. , class T19 , class T20 >
  76707. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76708. #638
  76709. T14 , T15 , T16 , T17 , T18 , T19 , T20 ) volatile > { static const bool value = true ; } ;
  76710.  
  76711. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76712. #640
  76713. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76714. #640
  76715. , class T19 , class T20 >
  76716. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76717. #641
  76718. T14 , T15 , T16 , T17 , T18 , T19 , T20 ) const volatile > { static const bool value = true ; } ;
  76719.  
  76720.  
  76721. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76722. #644
  76723. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76724. #644
  76725. , class T19 , class T20 >
  76726. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76727. #645
  76728. T14 , T15 , T16 , T17 , T18 , T19 , T20 ... ) const > { static const bool value = true ; } ;
  76729.  
  76730. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76731. #647
  76732. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76733. #647
  76734. , class T19 , class T20 >
  76735. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76736. #648
  76737. T14 , T15 , T16 , T17 , T18 , T19 , T20 ... ) volatile > { static const bool value = true ; } ;
  76738.  
  76739. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76740. #650
  76741. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76742. #650
  76743. , class T19 , class T20 >
  76744. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76745. #651
  76746. T14 , T15 , T16 , T17 , T18 , T19 , T20 ... ) const volatile > { static const bool value = true ; } ;
  76747.  
  76748.  
  76749. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76750. #654
  76751. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76752. #654
  76753. , class T19 , class T20 , class T21 >
  76754. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76755. #655
  76756. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ) > { static const bool value = true ; } ;
  76757.  
  76758. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76759. #657
  76760. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76761. #657
  76762. , class T19 , class T20 , class T21 >
  76763. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76764. #658
  76765. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ... ) > { static const bool value = true ; } ;
  76766.  
  76767.  
  76768.  
  76769. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76770. #662
  76771. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76772. #662
  76773. , class T19 , class T20 , class T21 >
  76774. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76775. #663
  76776. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ) const > { static const bool value = true ; } ;
  76777.  
  76778. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76779. #665
  76780. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76781. #665
  76782. , class T19 , class T20 , class T21 >
  76783. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76784. #666
  76785. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ) volatile > { static const bool value = true ; } ;
  76786.  
  76787. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76788. #668
  76789. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76790. #668
  76791. , class T19 , class T20 , class T21 >
  76792. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76793. #669
  76794. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ) const volatile > { static const bool value = true ; } ;
  76795.  
  76796.  
  76797. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76798. #672
  76799. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76800. #672
  76801. , class T19 , class T20 , class T21 >
  76802. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76803. #673
  76804. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ... ) const > { static const bool value = true ; } ;
  76805.  
  76806. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76807. #675
  76808. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76809. #675
  76810. , class T19 , class T20 , class T21 >
  76811. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76812. #676
  76813. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ... ) volatile > { static const bool value = true ; } ;
  76814.  
  76815. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76816. #678
  76817. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76818. #678
  76819. , class T19 , class T20 , class T21 >
  76820. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76821. #679
  76822. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ... ) const volatile > { static const bool value = true ; } ;
  76823.  
  76824.  
  76825. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76826. #682
  76827. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76828. #682
  76829. , class T19 , class T20 , class T21 , class T22 >
  76830. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76831. #683
  76832. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ) > { static const bool value = true ; } ;
  76833.  
  76834. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76835. #685
  76836. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76837. #685
  76838. , class T19 , class T20 , class T21 , class T22 >
  76839. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76840. #686
  76841. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ... ) > { static const bool value = true ; } ;
  76842.  
  76843.  
  76844.  
  76845. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76846. #690
  76847. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76848. #690
  76849. , class T19 , class T20 , class T21 , class T22 >
  76850. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76851. #691
  76852. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ) const > { static const bool value = true ; } ;
  76853.  
  76854. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76855. #693
  76856. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76857. #693
  76858. , class T19 , class T20 , class T21 , class T22 >
  76859. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76860. #694
  76861. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ) volatile > { static const bool value = true ; } ;
  76862.  
  76863. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76864. #696
  76865. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76866. #696
  76867. , class T19 , class T20 , class T21 , class T22 >
  76868. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76869. #697
  76870. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ) const volatile > { static const bool value = true ; } ;
  76871.  
  76872.  
  76873. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76874. #700
  76875. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76876. #700
  76877. , class T19 , class T20 , class T21 , class T22 >
  76878. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76879. #701
  76880. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ... ) const > { static const bool value = true ; } ;
  76881.  
  76882. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76883. #703
  76884. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76885. #703
  76886. , class T19 , class T20 , class T21 , class T22 >
  76887. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76888. #704
  76889. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ... ) volatile > { static const bool value = true ; } ;
  76890.  
  76891. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76892. #706
  76893. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76894. #706
  76895. , class T19 , class T20 , class T21 , class T22 >
  76896. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76897. #707
  76898. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ... ) const volatile > { static const bool value = true ; } ;
  76899.  
  76900.  
  76901. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76902. #710
  76903. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76904. #710
  76905. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76906. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76907. #711
  76908. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ) > { static const bool value = true ; } ;
  76909.  
  76910. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76911. #713
  76912. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76913. #713
  76914. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76915. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76916. #714
  76917. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ... ) > { static const bool value = true ; } ;
  76918.  
  76919.  
  76920.  
  76921. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76922. #718
  76923. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76924. #718
  76925. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76926. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76927. #719
  76928. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ) const > { static const bool value = true ; } ;
  76929.  
  76930. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76931. #721
  76932. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76933. #721
  76934. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76935. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76936. #722
  76937. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ) volatile > { static const bool value = true ; } ;
  76938.  
  76939. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76940. #724
  76941. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76942. #724
  76943. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76944. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76945. #725
  76946. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ) const volatile > { static const bool value = true ; } ;
  76947.  
  76948.  
  76949. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76950. #728
  76951. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76952. #728
  76953. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76954. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76955. #729
  76956. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ... ) const > { static const bool value = true ; } ;
  76957.  
  76958. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76959. #731
  76960. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76961. #731
  76962. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76963. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76964. #732
  76965. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ... ) volatile > { static const bool value = true ; } ;
  76966.  
  76967. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76968. #734
  76969. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76970. #734
  76971. , class T19 , class T20 , class T21 , class T22 , class T23 >
  76972. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76973. #735
  76974. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ... ) const volatile > { static const bool value = true ; } ;
  76975.  
  76976.  
  76977. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76978. #738
  76979. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76980. #738
  76981. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  76982. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76983. #739
  76984. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ) > { static const bool value = true ; } ;
  76985.  
  76986. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76987. #741
  76988. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  76989. #741
  76990. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  76991. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  76992. #742
  76993. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ... ) > { static const bool value = true ; } ;
  76994.  
  76995.  
  76996.  
  76997. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  76998. #746
  76999. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  77000. #746
  77001. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  77002. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  77003. #747
  77004. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ) const > { static const bool value = true ; } ;
  77005.  
  77006. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  77007. #749
  77008. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  77009. #749
  77010. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  77011. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  77012. #750
  77013. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ) volatile > { static const bool value = true ; } ;
  77014.  
  77015. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  77016. #752
  77017. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  77018. #752
  77019. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  77020. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  77021. #753
  77022. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ) const volatile > { static const bool value = true ; } ;
  77023. #753
  77024.  
  77025.  
  77026.  
  77027. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  77028. #756
  77029. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  77030. #756
  77031. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  77032. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  77033. #757
  77034. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ... ) const > { static const bool value = true ; } ;
  77035.  
  77036. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  77037. #759
  77038. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  77039. #759
  77040. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  77041. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  77042. #760
  77043. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ... ) volatile > { static const bool value = true ; } ;
  77044.  
  77045. template < class R , class T , class T0 , class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class
  77046. #762
  77047. T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 , class T16 , class T17 , class T18
  77048. #762
  77049. , class T19 , class T20 , class T21 , class T22 , class T23 , class T24 >
  77050. struct is_mem_fun_pointer_impl < R ( T :: * ) ( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ,
  77051. #763
  77052. T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ... ) const volatile > { static const bool value = true ;
  77053. #763
  77054. } ;
  77055. #776
  77056. }
  77057. }
  77058. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  77059. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  77060. #38 "./boost/type_traits/is_member_function_pointer.hpp"
  77061. namespace boost {
  77062. #48
  77063. template < typename T > struct is_member_function_pointer : public :: boost :: integral_constant < bool , :: boost :: type_traits
  77064. #48
  77065. :: is_mem_fun_pointer_impl < typename remove_cv < T > :: type > :: value > { public : } ;
  77066. #132
  77067. }
  77068. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  77069. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  77070. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  77071. #41 "./boost/type_traits/is_member_pointer.hpp"
  77072. namespace boost {
  77073. #50
  77074. template < typename T > struct is_member_pointer : public :: boost :: integral_constant < bool , :: boost :: is_member_function_pointer
  77075. #50
  77076. < T > :: value > { public : } ;
  77077. template < typename T , typename U > struct is_member_pointer < U T :: * > : public :: boost :: integral_constant < bool
  77078. #51
  77079. , true > { public : } ;
  77080.  
  77081.  
  77082. template < typename T , typename U > struct is_member_pointer < U T :: * const > : public :: boost :: integral_constant <
  77083. #54
  77084. bool , true > { public : } ;
  77085. template < typename T , typename U > struct is_member_pointer < U T :: * volatile > : public :: boost :: integral_constant
  77086. #55
  77087. < bool , true > { public : } ;
  77088. template < typename T , typename U > struct is_member_pointer < U T :: * const volatile > : public :: boost :: integral_constant
  77089. #56
  77090. < bool , true > { public : } ;
  77091. #112
  77092. }
  77093. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  77094. #1 "./boost/type_traits/detail/bool_trait_def.hpp"
  77095. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  77096. #43 "./boost/type_traits/is_pointer.hpp"
  77097. namespace boost {
  77098.  
  77099.  
  77100.  
  77101.  
  77102.  
  77103. namespace detail {
  77104.  
  77105. template < typename T > struct is_pointer_helper
  77106. {
  77107. static const bool value = false ;
  77108. } ;
  77109. #63
  77110. template < typename T > struct is_pointer_helper < T * > { static const bool value = true ; } ;
  77111.  
  77112.  
  77113.  
  77114. template < typename T >
  77115. struct is_pointer_impl
  77116. {
  77117. #87
  77118. static const bool value = ( :: boost :: type_traits :: ice_and < :: boost :: detail :: is_pointer_helper < typename remove_cv
  77119. #87
  77120. < T > :: type > :: value , :: boost :: type_traits :: ice_not < :: boost :: is_member_pointer < T > :: value > :: value >
  77121. #87
  77122. :: value ) ;
  77123.  
  77124. } ;
  77125.  
  77126. }
  77127.  
  77128. template < typename T > struct is_pointer : public :: boost :: integral_constant < bool , :: boost :: detail :: is_pointer_impl
  77129. #93
  77130. < T > :: value > { public : } ;
  77131. #158
  77132. }
  77133. #1 "./boost/type_traits/detail/bool_trait_undef.hpp"
  77134. #1 "./boost/type_traits/remove_pointer.hpp"
  77135. #1 "./boost/type_traits/detail/type_trait_def.hpp"
  77136. #1 "./boost/type_traits/detail/template_arity_spec.hpp"
  77137. #28 "./boost/type_traits/remove_pointer.hpp"
  77138. namespace boost {
  77139. #76
  77140. template < typename T > struct remove_pointer { public : typedef T type ; } ;
  77141. template < typename T > struct remove_pointer < T * > { public : typedef T type ; } ;
  77142. template < typename T > struct remove_pointer < T * const > { public : typedef T type ; } ;
  77143. template < typename T > struct remove_pointer < T * volatile > { public : typedef T type ; } ;
  77144. template < typename T > struct remove_pointer < T * const volatile > { public : typedef T type ; } ;
  77145. #88
  77146. }
  77147. #1 "./boost/type_traits/detail/type_trait_undef.hpp"
  77148. #1 "./boost/mpl/if.hpp"
  77149. #1 "./boost/mpl/aux_/value_wknd.hpp"
  77150. #1 "./boost/mpl/aux_/config/integral.hpp"
  77151. #73 "./boost/mpl/aux_/value_wknd.hpp"
  77152. namespace boost { namespace mpl { namespace aux {
  77153.  
  77154. template < typename T > struct value_type_wknd
  77155. {
  77156. typedef typename T :: value_type type ;
  77157. } ;
  77158. #87
  77159. } } }
  77160. #25 "./boost/mpl/if.hpp"
  77161. namespace boost { namespace mpl {
  77162.  
  77163.  
  77164.  
  77165. template <
  77166. bool C
  77167. , typename T1
  77168. , typename T2
  77169. >
  77170. struct if_c
  77171. {
  77172. typedef T1 type ;
  77173. } ;
  77174.  
  77175. template <
  77176. typename T1
  77177. , typename T2
  77178. >
  77179. struct if_c < false , T1 , T2 >
  77180. {
  77181. typedef T2 type ;
  77182. } ;
  77183.  
  77184.  
  77185.  
  77186. template <
  77187. typename T1 = na
  77188. , typename T2 = na
  77189. , typename T3 = na
  77190. >
  77191. struct if_
  77192. {
  77193. private :
  77194.  
  77195. typedef if_c <
  77196.  
  77197.  
  77198.  
  77199. static_cast < bool > ( T1 :: value )
  77200.  
  77201. , T2
  77202. , T3
  77203. > almost_type_ ;
  77204.  
  77205. public :
  77206. typedef typename almost_type_ :: type type ;
  77207.  
  77208.  
  77209. } ;
  77210. #131
  77211. template < > struct if_ < na , na , na > { template < typename T1 , typename T2 , typename T3 , typename T4 = na , typename
  77212. #131
  77213. T5 = na > struct apply : if_ < T1 , T2 , T3 > { } ; } ; template < typename Tag > struct lambda < if_ < na , na , na > ,
  77214. #131
  77215. Tag > { typedef false_ is_le ; typedef if_ < na , na , na > result_ ; typedef if_ < na , na , na > type ; } ;
  77216.  
  77217. } }
  77218. #1 "./boost/mpl/and.hpp"
  77219. #1 "./boost/mpl/aux_/config/use_preprocessed.hpp"
  77220. #1 "./boost/mpl/aux_/nested_type_wknd.hpp"
  77221. #25
  77222. namespace boost { namespace mpl { namespace aux {
  77223. template < typename T > struct nested_type_wknd
  77224. : T :: type
  77225. {
  77226. } ;
  77227. } } }
  77228. #1 "./boost/mpl/aux_/include_preprocessed.hpp"
  77229. #1 "./boost/mpl/aux_/config/compiler.hpp"
  77230. #1 "./boost/preprocessor/stringize.hpp"
  77231. #1 "./boost/mpl/aux_/preprocessed/plain/and.hpp"
  77232. #12
  77233. namespace boost { namespace mpl {
  77234.  
  77235. namespace aux {
  77236.  
  77237. template < bool C_ , typename T1 , typename T2 , typename T3 , typename T4 >
  77238. struct and_impl
  77239. : false_
  77240. {
  77241. } ;
  77242.  
  77243. template < typename T1 , typename T2 , typename T3 , typename T4 >
  77244. struct and_impl < true , T1 , T2 , T3 , T4 >
  77245. : and_impl <
  77246. :: boost :: mpl :: aux :: nested_type_wknd < T1 > :: value
  77247. , T2 , T3 , T4
  77248. , true_
  77249. >
  77250. {
  77251. } ;
  77252.  
  77253. template < >
  77254. struct and_impl <
  77255. true
  77256. , true_ , true_ , true_ , true_
  77257. >
  77258. : true_
  77259. {
  77260. } ;
  77261.  
  77262. }
  77263.  
  77264. template <
  77265. typename T1 = na
  77266. , typename T2 = na
  77267. , typename T3 = true_ , typename T4 = true_ , typename T5 = true_
  77268. >
  77269. struct and_
  77270.  
  77271. : aux :: and_impl <
  77272. :: boost :: mpl :: aux :: nested_type_wknd < T1 > :: value
  77273. , T2 , T3 , T4 , T5
  77274. >
  77275.  
  77276. {
  77277. } ;
  77278.  
  77279.  
  77280.  
  77281.  
  77282.  
  77283. template < > struct and_ < na , na > { template < typename T1 , typename T2 , typename T3 = na , typename T4 = na , typename
  77284. #62
  77285. T5 = na > struct apply : and_ < T1 , T2 > { } ; } ; template < typename Tag > struct lambda < and_ < na , na > , Tag > {
  77286. #62
  77287. typedef false_ is_le ; typedef and_ < na , na > result_ ; typedef and_ < na , na > type ; } ;
  77288.  
  77289. } }
  77290. #1 "./boost/mpl/not.hpp"
  77291. #23
  77292. namespace boost { namespace mpl {
  77293.  
  77294. namespace aux {
  77295.  
  77296. template < long C_ >
  77297. struct not_impl
  77298. : bool_ < ! C_ >
  77299. {
  77300. } ;
  77301.  
  77302. }
  77303.  
  77304.  
  77305. template <
  77306. typename T = na
  77307. >
  77308. struct not_
  77309. : aux :: not_impl <
  77310. :: boost :: mpl :: aux :: nested_type_wknd < T > :: value
  77311. >
  77312. {
  77313.  
  77314. } ;
  77315.  
  77316. template < > struct not_ < na > { template < typename T1 , typename T2 = na , typename T3 = na , typename T4 = na , typename
  77317. #47
  77318. T5 = na > struct apply : not_ < T1 > { } ; } ; template < typename Tag > struct lambda < not_ < na > , Tag > { typedef false_
  77319. #47
  77320. is_le ; typedef not_ < na > result_ ; typedef not_ < na > type ; } ;
  77321.  
  77322. } }
  77323. #1 "./boost/ref.hpp"
  77324. #1 "./boost/utility/addressof.hpp"
  77325. #18
  77326. namespace boost
  77327. {
  77328.  
  77329. namespace detail
  77330. {
  77331.  
  77332. template < class T > struct addr_impl_ref
  77333. {
  77334. T & v_ ;
  77335.  
  77336. inline addr_impl_ref ( T & v ) : v_ ( v ) { }
  77337. inline operator T & ( ) const { return v_ ; }
  77338.  
  77339. private :
  77340. addr_impl_ref & operator = ( const addr_impl_ref & ) ;
  77341. } ;
  77342.  
  77343. template < class T > struct addressof_impl
  77344. {
  77345. static inline T * f ( T & v , long )
  77346. {
  77347. return reinterpret_cast < T * > (
  77348. & const_cast < char & > ( reinterpret_cast < const volatile char & > ( v ) ) ) ;
  77349. }
  77350.  
  77351. static inline T * f ( T * v , int )
  77352. {
  77353. return v ;
  77354. }
  77355. } ;
  77356.  
  77357. }
  77358.  
  77359. template < class T > T * addressof ( T & v )
  77360. {
  77361.  
  77362.  
  77363. return boost :: detail :: addressof_impl < T > :: f ( v , 0 ) ;
  77364. #62
  77365. }
  77366.  
  77367.  
  77368.  
  77369. namespace detail
  77370. {
  77371.  
  77372. template < class T > struct addressof_addp
  77373. {
  77374. typedef T * type ;
  77375. } ;
  77376.  
  77377. }
  77378.  
  77379. template < class T , std :: size_t N >
  77380. typename detail :: addressof_addp < T [ N ] > :: type addressof ( T ( & t ) [ N ] )
  77381. {
  77382. return & t ;
  77383. }
  77384. #100
  77385. }
  77386. #29 "./boost/ref.hpp"
  77387. namespace boost
  77388. {
  77389.  
  77390. template < class T > class reference_wrapper
  77391. {
  77392. public :
  77393. typedef T type ;
  77394. #43
  77395. explicit reference_wrapper ( T & t ) : t_ ( boost :: addressof ( t ) ) { }
  77396.  
  77397.  
  77398.  
  77399. operator T & ( ) const { return * t_ ; }
  77400.  
  77401. T & get ( ) const { return * t_ ; }
  77402.  
  77403. T * get_pointer ( ) const { return t_ ; }
  77404.  
  77405. private :
  77406.  
  77407. T * t_ ;
  77408. } ;
  77409. #64
  77410. template < class T > inline reference_wrapper < T > const ref ( T & t )
  77411. {
  77412. return reference_wrapper < T > ( t ) ;
  77413. }
  77414.  
  77415. template < class T > inline reference_wrapper < T const > const cref ( T const & t )
  77416. {
  77417. return reference_wrapper < T const > ( t ) ;
  77418. }
  77419.  
  77420.  
  77421.  
  77422.  
  77423.  
  77424. template < typename T >
  77425. class is_reference_wrapper
  77426. : public mpl :: false_
  77427. {
  77428. } ;
  77429.  
  77430. template < typename T >
  77431. class unwrap_reference
  77432. {
  77433. public :
  77434. typedef T type ;
  77435. } ;
  77436. #106
  77437. template < typename T > class is_reference_wrapper < reference_wrapper < T > > : public mpl :: true_ { } ; template < typename
  77438. #106
  77439. T > class unwrap_reference < reference_wrapper < T > > { public : typedef T type ; } ;
  77440.  
  77441. template < typename T > class is_reference_wrapper < reference_wrapper < T > const > : public mpl :: true_ { } ; template
  77442. #108
  77443. < typename T > class unwrap_reference < reference_wrapper < T > const > { public : typedef T type ; } ;
  77444. template < typename T > class is_reference_wrapper < reference_wrapper < T > volatile > : public mpl :: true_ { } ; template
  77445. #109
  77446. < typename T > class unwrap_reference < reference_wrapper < T > volatile > { public : typedef T type ; } ;
  77447. template < typename T > class is_reference_wrapper < reference_wrapper < T > const volatile > : public mpl :: true_ { } ;
  77448. #110
  77449. template < typename T > class unwrap_reference < reference_wrapper < T > const volatile > { public : typedef T type ; } ;
  77450. #110
  77451.  
  77452. #176
  77453. template < class T > inline typename unwrap_reference < T > :: type &
  77454. unwrap_ref ( T & t )
  77455. {
  77456. return t ;
  77457. }
  77458.  
  77459. template < class T > inline T * get_pointer ( reference_wrapper < T > const & r )
  77460. {
  77461. return r . get_pointer ( ) ;
  77462. }
  77463.  
  77464. }
  77465. #39 "./boost/regex/v4/regex_format.hpp"
  77466. namespace boost {
  77467. #55
  77468. template < class BidiIterator , class Allocator = typename std :: vector < sub_match < BidiIterator > > :: allocator_type
  77469. #55
  77470. >
  77471. class match_results ;
  77472.  
  77473. namespace re_detail {
  77474. #65
  77475. template < class charT >
  77476. struct trivial_format_traits
  77477. {
  77478. typedef charT char_type ;
  77479.  
  77480. static std :: ptrdiff_t length ( const charT * p )
  77481. {
  77482. return global_length ( p ) ;
  77483. }
  77484. static charT tolower ( charT c )
  77485. {
  77486. return :: boost :: re_detail :: global_lower ( c ) ;
  77487. }
  77488. static charT toupper ( charT c )
  77489. {
  77490. return :: boost :: re_detail :: global_upper ( c ) ;
  77491. }
  77492. static int value ( const charT c , int radix )
  77493. {
  77494. int result = global_value ( c ) ;
  77495. return result >= radix ? - 1 : result ;
  77496. }
  77497. int toi ( const charT * & p1 , const charT * p2 , int radix ) const
  77498. {
  77499. return global_toi ( p1 , p2 , radix , * this ) ;
  77500. }
  77501. } ;
  77502.  
  77503. template < class OutputIterator , class Results , class traits , class ForwardIter >
  77504. class basic_regex_formatter
  77505. {
  77506. public :
  77507. typedef typename traits :: char_type char_type ;
  77508. basic_regex_formatter ( OutputIterator o , const Results & r , const traits & t )
  77509. : m_traits ( t ) , m_results ( r ) , m_out ( o ) , m_state ( output_copy ) , m_restore_state ( output_copy ) , m_have_conditional
  77510. #99
  77511. ( false ) { }
  77512. OutputIterator format ( ForwardIter p1 , ForwardIter p2 , match_flag_type f ) ;
  77513. OutputIterator format ( ForwardIter p1 , match_flag_type f )
  77514. {
  77515. return format ( p1 , p1 + m_traits . length ( p1 ) , f ) ;
  77516. }
  77517. private :
  77518. typedef typename Results :: value_type sub_match_type ;
  77519. enum output_state
  77520. {
  77521. output_copy ,
  77522. output_next_lower ,
  77523. output_next_upper ,
  77524. output_lower ,
  77525. output_upper ,
  77526. output_none
  77527. } ;
  77528.  
  77529. void put ( char_type c ) ;
  77530. void put ( const sub_match_type & sub ) ;
  77531. void format_all ( ) ;
  77532. void format_perl ( ) ;
  77533. void format_escape ( ) ;
  77534. void format_conditional ( ) ;
  77535. void format_until_scope_end ( ) ;
  77536. bool handle_perl_verb ( bool have_brace ) ;
  77537.  
  77538. inline typename Results :: value_type const & get_named_sub ( ForwardIter i , ForwardIter j , const mpl :: false_ & )
  77539. {
  77540. std :: vector < char_type > v ( i , j ) ;
  77541. return ( i != j ) ? this -> m_results . named_subexpression ( & v [ 0 ] , & v [ 0 ] + v . size ( ) )
  77542. : this -> m_results . named_subexpression ( static_cast < const char_type * > ( 0 ) , static_cast < const char_type * > (
  77543. #130
  77544. 0 ) ) ;
  77545. }
  77546. inline typename Results :: value_type const & get_named_sub ( ForwardIter i , ForwardIter j , const mpl :: true_ & )
  77547. {
  77548. return this -> m_results . named_subexpression ( i , j ) ;
  77549. }
  77550. inline typename Results :: value_type const & get_named_sub ( ForwardIter i , ForwardIter j )
  77551. {
  77552. typedef typename boost :: is_convertible < ForwardIter , const char_type * > :: type tag_type ;
  77553. return get_named_sub ( i , j , tag_type ( ) ) ;
  77554. }
  77555. inline int get_named_sub_index ( ForwardIter i , ForwardIter j , const mpl :: false_ & )
  77556. {
  77557. std :: vector < char_type > v ( i , j ) ;
  77558. return ( i != j ) ? this -> m_results . named_subexpression_index ( & v [ 0 ] , & v [ 0 ] + v . size ( ) )
  77559. : this -> m_results . named_subexpression_index ( static_cast < const char_type * > ( 0 ) , static_cast < const char_type
  77560. #145
  77561. * > ( 0 ) ) ;
  77562. }
  77563. inline int get_named_sub_index ( ForwardIter i , ForwardIter j , const mpl :: true_ & )
  77564. {
  77565. return this -> m_results . named_subexpression_index ( i , j ) ;
  77566. }
  77567. inline int get_named_sub_index ( ForwardIter i , ForwardIter j )
  77568. {
  77569. typedef typename boost :: is_convertible < ForwardIter , const char_type * > :: type tag_type ;
  77570. return get_named_sub_index ( i , j , tag_type ( ) ) ;
  77571. }
  77572.  
  77573.  
  77574.  
  77575.  
  77576.  
  77577. inline int toi ( ForwardIter & i , ForwardIter j , int base , const boost :: mpl :: false_ & )
  77578. {
  77579. if ( i != j )
  77580. {
  77581. std :: vector < char_type > v ( i , j ) ;
  77582. const char_type * start = & v [ 0 ] ;
  77583. const char_type * pos = start ;
  77584. int r = m_traits . toi ( pos , & v [ 0 ] + v . size ( ) , base ) ;
  77585. std :: advance ( i , pos - start ) ;
  77586. return r ;
  77587. }
  77588. return - 1 ;
  77589. }
  77590.  
  77591.  
  77592.  
  77593. inline int toi ( ForwardIter & i , ForwardIter j , int base , const boost :: mpl :: true_ & )
  77594. {
  77595. return m_traits . toi ( i , j , base ) ;
  77596. }
  77597. inline int toi ( ForwardIter & i , ForwardIter j , int base )
  77598. {
  77599.  
  77600.  
  77601.  
  77602.  
  77603.  
  77604. typedef typename boost :: is_convertible < ForwardIter , const char_type * & > :: type tag_type ;
  77605. return toi ( i , j , base , tag_type ( ) ) ;
  77606.  
  77607. }
  77608.  
  77609. const traits & m_traits ;
  77610. const Results & m_results ;
  77611. OutputIterator m_out ;
  77612. ForwardIter m_position ;
  77613. ForwardIter m_end ;
  77614. match_flag_type m_flags ;
  77615. output_state m_state ;
  77616. output_state m_restore_state ;
  77617. bool m_have_conditional ;
  77618. private :
  77619. basic_regex_formatter ( const basic_regex_formatter & ) ;
  77620. basic_regex_formatter & operator = ( const basic_regex_formatter & ) ;
  77621. } ;
  77622.  
  77623. template < class OutputIterator , class Results , class traits , class ForwardIter >
  77624. OutputIterator basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: format ( ForwardIter p1 , ForwardIter
  77625. #208
  77626. p2 , match_flag_type f )
  77627. {
  77628. m_position = p1 ;
  77629. m_end = p2 ;
  77630. m_flags = f ;
  77631. format_all ( ) ;
  77632. return m_out ;
  77633. }
  77634.  
  77635. template < class OutputIterator , class Results , class traits , class ForwardIter >
  77636. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: format_all ( )
  77637. {
  77638.  
  77639. while ( m_position != m_end )
  77640. {
  77641. switch ( * m_position )
  77642. {
  77643. case '&' :
  77644. if ( m_flags & :: boost :: regex_constants :: format_sed )
  77645. {
  77646. ++ m_position ;
  77647. put ( m_results [ 0 ] ) ;
  77648. break ;
  77649. }
  77650. put ( * m_position ++ ) ;
  77651. break ;
  77652. case '\\' :
  77653. format_escape ( ) ;
  77654. break ;
  77655. case '(' :
  77656. if ( m_flags & boost :: regex_constants :: format_all )
  77657. {
  77658. ++ m_position ;
  77659. bool have_conditional = m_have_conditional ;
  77660. m_have_conditional = false ;
  77661. format_until_scope_end ( ) ;
  77662. m_have_conditional = have_conditional ;
  77663. if ( m_position == m_end )
  77664. return ;
  77665. ( ( void ) 0 ) ;
  77666. ++ m_position ;
  77667. break ;
  77668. }
  77669. put ( * m_position ) ;
  77670. ++ m_position ;
  77671. break ;
  77672. case ')' :
  77673. if ( m_flags & boost :: regex_constants :: format_all )
  77674. {
  77675. return ;
  77676. }
  77677. put ( * m_position ) ;
  77678. ++ m_position ;
  77679. break ;
  77680. case ':' :
  77681. if ( ( m_flags & boost :: regex_constants :: format_all ) && m_have_conditional )
  77682. {
  77683. return ;
  77684. }
  77685. put ( * m_position ) ;
  77686. ++ m_position ;
  77687. break ;
  77688. case '?' :
  77689. if ( m_flags & boost :: regex_constants :: format_all )
  77690. {
  77691. ++ m_position ;
  77692. format_conditional ( ) ;
  77693. break ;
  77694. }
  77695. put ( * m_position ) ;
  77696. ++ m_position ;
  77697. break ;
  77698. case '$' :
  77699. if ( ( m_flags & format_sed ) == 0 )
  77700. {
  77701. format_perl ( ) ;
  77702. break ;
  77703. }
  77704.  
  77705. ( ( void ) 0 ) ;
  77706. default :
  77707. put ( * m_position ) ;
  77708. ++ m_position ;
  77709. break ;
  77710. }
  77711. }
  77712. }
  77713.  
  77714. template < class OutputIterator , class Results , class traits , class ForwardIter >
  77715. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: format_perl ( )
  77716. {
  77717.  
  77718.  
  77719.  
  77720.  
  77721. ( ( void ) 0 ) ;
  77722.  
  77723.  
  77724.  
  77725. if ( ++ m_position == m_end )
  77726. {
  77727. -- m_position ;
  77728. put ( * m_position ) ;
  77729. ++ m_position ;
  77730. return ;
  77731. }
  77732.  
  77733.  
  77734.  
  77735. bool have_brace = false ;
  77736. ForwardIter save_position = m_position ;
  77737. switch ( * m_position )
  77738. {
  77739. case '&' :
  77740. ++ m_position ;
  77741. put ( this -> m_results [ 0 ] ) ;
  77742. break ;
  77743. case '`' :
  77744. ++ m_position ;
  77745. put ( this -> m_results . prefix ( ) ) ;
  77746. break ;
  77747. case '\'' :
  77748. ++ m_position ;
  77749. put ( this -> m_results . suffix ( ) ) ;
  77750. break ;
  77751. case '$' :
  77752. put ( * m_position ++ ) ;
  77753. break ;
  77754. case '+' :
  77755. if ( ( ++ m_position != m_end ) && ( * m_position == '{' ) )
  77756. {
  77757. ForwardIter base = ++ m_position ;
  77758. while ( ( m_position != m_end ) && ( * m_position != '}' ) ) ++ m_position ;
  77759. if ( m_position != m_end )
  77760. {
  77761.  
  77762. put ( get_named_sub ( base , m_position ) ) ;
  77763. ++ m_position ;
  77764. break ;
  77765. }
  77766. else
  77767. {
  77768. m_position = -- base ;
  77769. }
  77770. }
  77771. put ( ( this -> m_results ) [ this -> m_results . size ( ) > 1 ? static_cast < int > ( this -> m_results . size ( ) - 1 )
  77772. #353
  77773. : 1 ] ) ;
  77774. break ;
  77775. case '{' :
  77776. have_brace = true ;
  77777. ++ m_position ;
  77778. ( ( void ) 0 ) ;
  77779. default :
  77780.  
  77781. {
  77782. std :: ptrdiff_t len = :: boost :: re_detail :: distance ( m_position , m_end ) ;
  77783.  
  77784. int v = this -> toi ( m_position , m_position + len , 10 ) ;
  77785. if ( ( v < 0 ) || ( have_brace && ( ( m_position == m_end ) || ( * m_position != '}' ) ) ) )
  77786. {
  77787.  
  77788. if ( ! handle_perl_verb ( have_brace ) )
  77789. {
  77790.  
  77791. m_position = -- save_position ;
  77792. put ( * m_position ) ;
  77793. ++ m_position ;
  77794. }
  77795. break ;
  77796. }
  77797.  
  77798. put ( this -> m_results [ v ] ) ;
  77799. if ( have_brace )
  77800. ++ m_position ;
  77801. }
  77802. }
  77803. }
  77804.  
  77805. template < class OutputIterator , class Results , class traits , class ForwardIter >
  77806. bool basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: handle_perl_verb ( bool have_brace )
  77807. {
  77808.  
  77809.  
  77810.  
  77811. static const char_type MATCH [ ] = { 'M' , 'A' , 'T' , 'C' , 'H' } ;
  77812. static const char_type PREMATCH [ ] = { 'P' , 'R' , 'E' , 'M' , 'A' , 'T' , 'C' , 'H' } ;
  77813. static const char_type POSTMATCH [ ] = { 'P' , 'O' , 'S' , 'T' , 'M' , 'A' , 'T' , 'C' , 'H' } ;
  77814. static const char_type LAST_PAREN_MATCH [ ] = { 'L' , 'A' , 'S' , 'T' , '_' , 'P' , 'A' , 'R' , 'E' , 'N' , '_' , 'M' , 'A'
  77815. #394
  77816. , 'T' , 'C' , 'H' } ;
  77817. static const char_type LAST_SUBMATCH_RESULT [ ] = { 'L' , 'A' , 'S' , 'T' , '_' , 'S' , 'U' , 'B' , 'M' , 'A' , 'T' , 'C'
  77818. #395
  77819. , 'H' , '_' , 'R' , 'E' , 'S' , 'U' , 'L' , 'T' } ;
  77820. static const char_type LAST_SUBMATCH_RESULT_ALT [ ] = { '^' , 'N' } ;
  77821.  
  77822. if ( m_position == m_end )
  77823. return false ;
  77824. if ( have_brace && ( * m_position == '^' ) )
  77825. ++ m_position ;
  77826.  
  77827. std :: ptrdiff_t max_len = m_end - m_position ;
  77828.  
  77829. if ( ( max_len >= 5 ) && std :: equal ( m_position , m_position + 5 , MATCH ) )
  77830. {
  77831. m_position += 5 ;
  77832. if ( have_brace )
  77833. {
  77834. if ( ( m_position != m_end ) && ( * m_position == '}' ) )
  77835. ++ m_position ;
  77836. else
  77837. {
  77838. m_position -= 5 ;
  77839. return false ;
  77840. }
  77841. }
  77842. put ( this -> m_results [ 0 ] ) ;
  77843. return true ;
  77844. }
  77845. if ( ( max_len >= 8 ) && std :: equal ( m_position , m_position + 8 , PREMATCH ) )
  77846. {
  77847. m_position += 8 ;
  77848. if ( have_brace )
  77849. {
  77850. if ( ( m_position != m_end ) && ( * m_position == '}' ) )
  77851. ++ m_position ;
  77852. else
  77853. {
  77854. m_position -= 8 ;
  77855. return false ;
  77856. }
  77857. }
  77858. put ( this -> m_results . prefix ( ) ) ;
  77859. return true ;
  77860. }
  77861. if ( ( max_len >= 9 ) && std :: equal ( m_position , m_position + 9 , POSTMATCH ) )
  77862. {
  77863. m_position += 9 ;
  77864. if ( have_brace )
  77865. {
  77866. if ( ( m_position != m_end ) && ( * m_position == '}' ) )
  77867. ++ m_position ;
  77868. else
  77869. {
  77870. m_position -= 9 ;
  77871. return false ;
  77872. }
  77873. }
  77874. put ( this -> m_results . suffix ( ) ) ;
  77875. return true ;
  77876. }
  77877. if ( ( max_len >= 16 ) && std :: equal ( m_position , m_position + 16 , LAST_PAREN_MATCH ) )
  77878. {
  77879. m_position += 16 ;
  77880. if ( have_brace )
  77881. {
  77882. if ( ( m_position != m_end ) && ( * m_position == '}' ) )
  77883. ++ m_position ;
  77884. else
  77885. {
  77886. m_position -= 16 ;
  77887. return false ;
  77888. }
  77889. }
  77890. put ( ( this -> m_results ) [ this -> m_results . size ( ) > 1 ? static_cast < int > ( this -> m_results . size ( ) - 1 )
  77891. #466
  77892. : 1 ] ) ;
  77893. return true ;
  77894. }
  77895. if ( ( max_len >= 20 ) && std :: equal ( m_position , m_position + 20 , LAST_SUBMATCH_RESULT ) )
  77896. {
  77897. m_position += 20 ;
  77898. if ( have_brace )
  77899. {
  77900. if ( ( m_position != m_end ) && ( * m_position == '}' ) )
  77901. ++ m_position ;
  77902. else
  77903. {
  77904. m_position -= 20 ;
  77905. return false ;
  77906. }
  77907. }
  77908. put ( this -> m_results . get_last_closed_paren ( ) ) ;
  77909. return true ;
  77910. }
  77911. if ( ( max_len >= 2 ) && std :: equal ( m_position , m_position + 2 , LAST_SUBMATCH_RESULT_ALT ) )
  77912. {
  77913. m_position += 2 ;
  77914. if ( have_brace )
  77915. {
  77916. if ( ( m_position != m_end ) && ( * m_position == '}' ) )
  77917. ++ m_position ;
  77918. else
  77919. {
  77920. m_position -= 2 ;
  77921. return false ;
  77922. }
  77923. }
  77924. put ( this -> m_results . get_last_closed_paren ( ) ) ;
  77925. return true ;
  77926. }
  77927. return false ;
  77928. }
  77929.  
  77930. template < class OutputIterator , class Results , class traits , class ForwardIter >
  77931. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: format_escape ( )
  77932. {
  77933.  
  77934. if ( ++ m_position == m_end )
  77935. {
  77936. put ( static_cast < char_type > ( '\\' ) ) ;
  77937. return ;
  77938. }
  77939.  
  77940. switch ( * m_position )
  77941. {
  77942. case 'a' :
  77943. put ( static_cast < char_type > ( '\a' ) ) ;
  77944. ++ m_position ;
  77945. break ;
  77946. case 'f' :
  77947. put ( static_cast < char_type > ( '\f' ) ) ;
  77948. ++ m_position ;
  77949. break ;
  77950. case 'n' :
  77951. put ( static_cast < char_type > ( '\n' ) ) ;
  77952. ++ m_position ;
  77953. break ;
  77954. case 'r' :
  77955. put ( static_cast < char_type > ( '\r' ) ) ;
  77956. ++ m_position ;
  77957. break ;
  77958. case 't' :
  77959. put ( static_cast < char_type > ( '\t' ) ) ;
  77960. ++ m_position ;
  77961. break ;
  77962. case 'v' :
  77963. put ( static_cast < char_type > ( '\v' ) ) ;
  77964. ++ m_position ;
  77965. break ;
  77966. case 'x' :
  77967. if ( ++ m_position == m_end )
  77968. {
  77969. put ( static_cast < char_type > ( 'x' ) ) ;
  77970. return ;
  77971. }
  77972.  
  77973. if ( * m_position == static_cast < char_type > ( '{' ) )
  77974. {
  77975. ++ m_position ;
  77976. int val = this -> toi ( m_position , m_end , 16 ) ;
  77977. if ( val < 0 )
  77978. {
  77979.  
  77980. put ( static_cast < char_type > ( 'x' ) ) ;
  77981. put ( static_cast < char_type > ( '{' ) ) ;
  77982. return ;
  77983. }
  77984. if ( ( m_position == m_end ) || ( * m_position != static_cast < char_type > ( '}' ) ) )
  77985. {
  77986. -- m_position ;
  77987. while ( * m_position != static_cast < char_type > ( '\\' ) )
  77988. -- m_position ;
  77989. ++ m_position ;
  77990. put ( * m_position ++ ) ;
  77991. return ;
  77992. }
  77993. ++ m_position ;
  77994. put ( static_cast < char_type > ( val ) ) ;
  77995. return ;
  77996. }
  77997. else
  77998. {
  77999. std :: ptrdiff_t len = :: boost :: re_detail :: distance ( m_position , m_end ) ;
  78000. len = ( std :: min ) ( static_cast < std :: ptrdiff_t > ( 2 ) , len ) ;
  78001. int val = this -> toi ( m_position , m_position + len , 16 ) ;
  78002. if ( val < 0 )
  78003. {
  78004. -- m_position ;
  78005. put ( * m_position ++ ) ;
  78006. return ;
  78007. }
  78008. put ( static_cast < char_type > ( val ) ) ;
  78009. }
  78010. break ;
  78011. case 'c' :
  78012. if ( ++ m_position == m_end )
  78013. {
  78014. -- m_position ;
  78015. put ( * m_position ++ ) ;
  78016. return ;
  78017. }
  78018. put ( static_cast < char_type > ( * m_position ++ % 32 ) ) ;
  78019. break ;
  78020. case 'e' :
  78021. put ( static_cast < char_type > ( 27 ) ) ;
  78022. ++ m_position ;
  78023. break ;
  78024. default :
  78025.  
  78026. if ( ( m_flags & boost :: regex_constants :: format_sed ) == 0 )
  78027. {
  78028. bool breakout = false ;
  78029. switch ( * m_position )
  78030. {
  78031. case 'l' :
  78032. ++ m_position ;
  78033. m_restore_state = m_state ;
  78034. m_state = output_next_lower ;
  78035. breakout = true ;
  78036. break ;
  78037. case 'L' :
  78038. ++ m_position ;
  78039. m_state = output_lower ;
  78040. breakout = true ;
  78041. break ;
  78042. case 'u' :
  78043. ++ m_position ;
  78044. m_restore_state = m_state ;
  78045. m_state = output_next_upper ;
  78046. breakout = true ;
  78047. break ;
  78048. case 'U' :
  78049. ++ m_position ;
  78050. m_state = output_upper ;
  78051. breakout = true ;
  78052. break ;
  78053. case 'E' :
  78054. ++ m_position ;
  78055. m_state = output_copy ;
  78056. breakout = true ;
  78057. break ;
  78058. }
  78059. if ( breakout )
  78060. break ;
  78061. }
  78062.  
  78063. std :: ptrdiff_t len = :: boost :: re_detail :: distance ( m_position , m_end ) ;
  78064. len = ( std :: min ) ( static_cast < std :: ptrdiff_t > ( 1 ) , len ) ;
  78065. int v = this -> toi ( m_position , m_position + len , 10 ) ;
  78066. if ( ( v > 0 ) || ( ( v == 0 ) && ( m_flags & :: boost :: regex_constants :: format_sed ) ) )
  78067. {
  78068. put ( m_results [ v ] ) ;
  78069. break ;
  78070. }
  78071. else if ( v == 0 )
  78072. {
  78073.  
  78074. -- m_position ;
  78075. len = :: boost :: re_detail :: distance ( m_position , m_end ) ;
  78076. len = ( std :: min ) ( static_cast < std :: ptrdiff_t > ( 4 ) , len ) ;
  78077. v = this -> toi ( m_position , m_position + len , 8 ) ;
  78078. ( ( void ) 0 ) ;
  78079. put ( static_cast < char_type > ( v ) ) ;
  78080. break ;
  78081. }
  78082.  
  78083. put ( * m_position ++ ) ;
  78084. break ;
  78085. }
  78086. }
  78087.  
  78088. template < class OutputIterator , class Results , class traits , class ForwardIter >
  78089. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: format_conditional ( )
  78090. {
  78091. if ( m_position == m_end )
  78092. {
  78093.  
  78094. put ( static_cast < char_type > ( '?' ) ) ;
  78095. return ;
  78096. }
  78097. int v ;
  78098. if ( * m_position == '{' )
  78099. {
  78100. ForwardIter base = m_position ;
  78101. ++ m_position ;
  78102. v = this -> toi ( m_position , m_end , 10 ) ;
  78103. if ( v < 0 )
  78104. {
  78105.  
  78106. while ( ( m_position != m_end ) && ( * m_position != '}' ) )
  78107. ++ m_position ;
  78108. v = this -> get_named_sub_index ( base + 1 , m_position ) ;
  78109. }
  78110. if ( ( v < 0 ) || ( * m_position != '}' ) )
  78111. {
  78112. m_position = base ;
  78113.  
  78114. put ( static_cast < char_type > ( '?' ) ) ;
  78115. return ;
  78116. }
  78117.  
  78118. ++ m_position ;
  78119. }
  78120. else
  78121. {
  78122. std :: ptrdiff_t len = :: boost :: re_detail :: distance ( m_position , m_end ) ;
  78123. len = ( std :: min ) ( static_cast < std :: ptrdiff_t > ( 2 ) , len ) ;
  78124. v = this -> toi ( m_position , m_position + len , 10 ) ;
  78125. }
  78126. if ( v < 0 )
  78127. {
  78128.  
  78129. put ( static_cast < char_type > ( '?' ) ) ;
  78130. return ;
  78131. }
  78132.  
  78133.  
  78134. if ( m_results [ v ] . matched )
  78135. {
  78136. m_have_conditional = true ;
  78137. format_all ( ) ;
  78138. m_have_conditional = false ;
  78139. if ( ( m_position != m_end ) && ( * m_position == static_cast < char_type > ( ':' ) ) )
  78140. {
  78141.  
  78142. ++ m_position ;
  78143.  
  78144. output_state saved_state = m_state ;
  78145. m_state = output_none ;
  78146.  
  78147. format_until_scope_end ( ) ;
  78148.  
  78149. m_state = saved_state ;
  78150. }
  78151. }
  78152. else
  78153. {
  78154.  
  78155. output_state saved_state = m_state ;
  78156. m_state = output_none ;
  78157.  
  78158. m_have_conditional = true ;
  78159. format_all ( ) ;
  78160. m_have_conditional = false ;
  78161.  
  78162. m_state = saved_state ;
  78163. if ( ( m_position != m_end ) && ( * m_position == static_cast < char_type > ( ':' ) ) )
  78164. {
  78165.  
  78166. ++ m_position ;
  78167.  
  78168. format_until_scope_end ( ) ;
  78169. }
  78170. }
  78171. }
  78172.  
  78173. template < class OutputIterator , class Results , class traits , class ForwardIter >
  78174. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: format_until_scope_end ( )
  78175. {
  78176. do
  78177. {
  78178. format_all ( ) ;
  78179. if ( ( m_position == m_end ) || ( * m_position == static_cast < char_type > ( ')' ) ) )
  78180. return ;
  78181. put ( * m_position ++ ) ;
  78182. } while ( m_position != m_end ) ;
  78183. }
  78184.  
  78185. template < class OutputIterator , class Results , class traits , class ForwardIter >
  78186. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: put ( char_type c )
  78187. {
  78188.  
  78189.  
  78190. switch ( this -> m_state )
  78191. {
  78192. case output_none :
  78193. return ;
  78194. case output_next_lower :
  78195. c = m_traits . tolower ( c ) ;
  78196. this -> m_state = m_restore_state ;
  78197. break ;
  78198. case output_next_upper :
  78199. c = m_traits . toupper ( c ) ;
  78200. this -> m_state = m_restore_state ;
  78201. break ;
  78202. case output_lower :
  78203. c = m_traits . tolower ( c ) ;
  78204. break ;
  78205. case output_upper :
  78206. c = m_traits . toupper ( c ) ;
  78207. break ;
  78208. default :
  78209. break ;
  78210. }
  78211. * m_out = c ;
  78212. ++ m_out ;
  78213. }
  78214.  
  78215. template < class OutputIterator , class Results , class traits , class ForwardIter >
  78216. void basic_regex_formatter < OutputIterator , Results , traits , ForwardIter > :: put ( const sub_match_type & sub )
  78217. {
  78218. typedef typename sub_match_type :: iterator iterator_type ;
  78219. iterator_type i = sub . first ;
  78220. while ( i != sub . second )
  78221. {
  78222. put ( * i ) ;
  78223. ++ i ;
  78224. }
  78225. }
  78226.  
  78227. template < class S >
  78228. class string_out_iterator
  78229.  
  78230. : public std :: iterator < std :: output_iterator_tag , typename S :: value_type >
  78231.  
  78232. {
  78233. S * out ;
  78234. public :
  78235. string_out_iterator ( S & s ) : out ( & s ) { }
  78236. string_out_iterator & operator ++ ( ) { return * this ; }
  78237. string_out_iterator & operator ++ ( int ) { return * this ; }
  78238. string_out_iterator & operator * ( ) { return * this ; }
  78239. string_out_iterator & operator = ( typename S :: value_type v )
  78240. {
  78241. out -> append ( 1 , v ) ;
  78242. return * this ;
  78243. }
  78244. #826
  78245. } ;
  78246.  
  78247. template < class OutputIterator , class Iterator , class Alloc , class ForwardIter , class traits >
  78248. OutputIterator regex_format_imp ( OutputIterator out ,
  78249. const match_results < Iterator , Alloc > & m ,
  78250. ForwardIter p1 , ForwardIter p2 ,
  78251. match_flag_type flags ,
  78252. const traits & t
  78253. )
  78254. {
  78255. if ( flags & regex_constants :: format_literal )
  78256. {
  78257. return re_detail :: copy ( p1 , p2 , out ) ;
  78258. }
  78259.  
  78260. re_detail :: basic_regex_formatter <
  78261. OutputIterator ,
  78262. match_results < Iterator , Alloc > ,
  78263. traits , ForwardIter > f ( out , m , t ) ;
  78264. return f . format ( p1 , p2 , flags ) ;
  78265. }
  78266.  
  78267.  
  78268.  
  78269. template < typename T , typename fallback_ = boost :: mpl :: bool_ < false > > struct has_const_iterator { struct gcc_3_2_wknd
  78270. #850
  78271. { template < typename U > static boost :: mpl :: aux :: yes_tag test ( boost :: mpl :: aux :: type_wrapper < U > const volatile
  78272. #850
  78273. * , boost :: mpl :: aux :: type_wrapper < typename U :: const_iterator > * = 0 ) ; static boost :: mpl :: aux :: no_tag test
  78274. #850
  78275. ( ... ) ; } ; typedef boost :: mpl :: aux :: type_wrapper < T > t_ ; static const bool value = sizeof ( gcc_3_2_wknd :: test
  78276. #850
  78277. ( static_cast < t_ * > ( 0 ) ) ) == sizeof ( boost :: mpl :: aux :: yes_tag ) ; typedef boost :: mpl :: bool_ < value > type
  78278. #850
  78279. ; } ;
  78280.  
  78281. struct any_type
  78282. {
  78283. template < class T >
  78284. any_type ( const T & ) ;
  78285. template < class T , class U >
  78286. any_type ( const T & , const U & ) ;
  78287. template < class T , class U , class V >
  78288. any_type ( const T & , const U & , const V & ) ;
  78289. } ;
  78290. typedef char no_type ;
  78291. typedef char ( & unary_type ) [ 2 ] ;
  78292. typedef char ( & binary_type ) [ 3 ] ;
  78293. typedef char ( & ternary_type ) [ 4 ] ;
  78294.  
  78295. no_type check_is_formatter ( unary_type , binary_type , ternary_type ) ;
  78296. template < typename T >
  78297. unary_type check_is_formatter ( T const & , binary_type , ternary_type ) ;
  78298. template < typename T >
  78299. binary_type check_is_formatter ( unary_type , T const & , ternary_type ) ;
  78300. template < typename T , typename U >
  78301. binary_type check_is_formatter ( T const & , U const & , ternary_type ) ;
  78302. template < typename T >
  78303. ternary_type check_is_formatter ( unary_type , binary_type , T const & ) ;
  78304. template < typename T , typename U >
  78305. ternary_type check_is_formatter ( T const & , binary_type , U const & ) ;
  78306. template < typename T , typename U >
  78307. ternary_type check_is_formatter ( unary_type , T const & , U const & ) ;
  78308. template < typename T , typename U , typename V >
  78309. ternary_type check_is_formatter ( T const & , U const & , V const & ) ;
  78310.  
  78311. struct unary_binary_ternary
  78312. {
  78313. typedef unary_type ( * unary_fun ) ( any_type ) ;
  78314. typedef binary_type ( * binary_fun ) ( any_type , any_type ) ;
  78315. typedef ternary_type ( * ternary_fun ) ( any_type , any_type , any_type ) ;
  78316. operator unary_fun ( ) ;
  78317. operator binary_fun ( ) ;
  78318. operator ternary_fun ( ) ;
  78319. } ;
  78320.  
  78321. template < typename Formatter , bool IsFunction = boost :: is_function < Formatter > :: value >
  78322. struct formatter_wrapper
  78323. : Formatter
  78324. , unary_binary_ternary
  78325. {
  78326. formatter_wrapper ( ) { }
  78327. } ;
  78328.  
  78329. template < typename Formatter >
  78330. struct formatter_wrapper < Formatter , true >
  78331. : unary_binary_ternary
  78332. {
  78333. operator Formatter * ( ) ;
  78334. } ;
  78335.  
  78336. template < typename Formatter >
  78337. struct formatter_wrapper < Formatter * , false >
  78338. : unary_binary_ternary
  78339. {
  78340. operator Formatter * ( ) ;
  78341. } ;
  78342.  
  78343. template < class F , class M , class O >
  78344. struct format_traits_imp
  78345. {
  78346. private :
  78347.  
  78348.  
  78349.  
  78350. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( ( :: boost :: is_pointer
  78351. #921
  78352. < F > :: value || :: boost :: is_function < F > :: value || :: boost :: is_class < F > :: value ) ) > ) > boost_static_assert_typedef_921
  78353. #921
  78354. ;
  78355. static formatter_wrapper < typename unwrap_reference < F > :: type > f ;
  78356. static M m ;
  78357. static O out ;
  78358. static boost :: regex_constants :: match_flag_type flags ;
  78359. public :
  78360. static const int value = sizeof ( check_is_formatter ( f ( m ) , f ( m , out ) , f ( m , out , flags ) ) ) ;
  78361. } ;
  78362.  
  78363. template < class F , class M , class O >
  78364. struct format_traits
  78365. {
  78366. public :
  78367. #943
  78368. typedef typename boost :: mpl :: if_ <
  78369. boost :: mpl :: and_ < boost :: is_pointer < F > , boost :: mpl :: not_ < boost :: is_function < typename boost :: remove_pointer
  78370. #944
  78371. < F > :: type > > > ,
  78372. boost :: mpl :: int_ < 0 > ,
  78373. typename boost :: mpl :: if_ <
  78374. has_const_iterator < F > ,
  78375. boost :: mpl :: int_ < 1 > ,
  78376. boost :: mpl :: int_ < format_traits_imp < F , M , O > :: value >
  78377. > :: type
  78378. > :: type type ;
  78379.  
  78380.  
  78381.  
  78382.  
  78383. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( boost :: is_class < F
  78384. #956
  78385. > :: value && ! has_const_iterator < F > :: value ? ( type :: value > 1 ) : true ) > ) > boost_static_assert_typedef_956
  78386. #956
  78387. ;
  78388. } ;
  78389. #983
  78390. template < class Base , class Match >
  78391. struct format_functor3
  78392. {
  78393. format_functor3 ( Base b ) : func ( b ) { }
  78394. template < class OutputIter >
  78395. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type f )
  78396. {
  78397. return boost :: unwrap_ref ( func ) ( m , i , f ) ;
  78398. }
  78399. template < class OutputIter , class Traits >
  78400. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type f , const Traits &
  78401. #993
  78402. )
  78403. {
  78404. return ( * this ) ( m , i , f ) ;
  78405. }
  78406. private :
  78407. Base func ;
  78408. format_functor3 ( const format_functor3 & ) ;
  78409. format_functor3 & operator = ( const format_functor3 & ) ;
  78410. } ;
  78411.  
  78412. template < class Base , class Match >
  78413. struct format_functor2
  78414. {
  78415. format_functor2 ( Base b ) : func ( b ) { }
  78416. template < class OutputIter >
  78417. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type )
  78418. {
  78419. return boost :: unwrap_ref ( func ) ( m , i ) ;
  78420. }
  78421. template < class OutputIter , class Traits >
  78422. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type f , const Traits &
  78423. #1013
  78424. )
  78425. {
  78426. return ( * this ) ( m , i , f ) ;
  78427. }
  78428. private :
  78429. Base func ;
  78430. format_functor2 ( const format_functor2 & ) ;
  78431. format_functor2 & operator = ( const format_functor2 & ) ;
  78432. } ;
  78433.  
  78434. template < class Base , class Match >
  78435. struct format_functor1
  78436. {
  78437. format_functor1 ( Base b ) : func ( b ) { }
  78438.  
  78439. template < class S , class OutputIter >
  78440. OutputIter do_format_string ( const S & s , OutputIter i )
  78441. {
  78442. return re_detail :: copy ( s . begin ( ) , s . end ( ) , i ) ;
  78443. }
  78444. template < class S , class OutputIter >
  78445. inline OutputIter do_format_string ( const S * s , OutputIter i )
  78446. {
  78447. while ( s && * s )
  78448. {
  78449. * i = * s ;
  78450. ++ i ;
  78451. ++ s ;
  78452. }
  78453. return i ;
  78454. }
  78455. template < class OutputIter >
  78456. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type )
  78457. {
  78458. return do_format_string ( boost :: unwrap_ref ( func ) ( m ) , i ) ;
  78459. }
  78460. template < class OutputIter , class Traits >
  78461. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type f , const Traits &
  78462. #1050
  78463. )
  78464. {
  78465. return ( * this ) ( m , i , f ) ;
  78466. }
  78467. private :
  78468. Base func ;
  78469. format_functor1 ( const format_functor1 & ) ;
  78470. format_functor1 & operator = ( const format_functor1 & ) ;
  78471. } ;
  78472.  
  78473. template < class charT , class Match , class Traits >
  78474. struct format_functor_c_string
  78475. {
  78476. format_functor_c_string ( const charT * ps ) : func ( ps ) { }
  78477.  
  78478. template < class OutputIter >
  78479. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type f , const Traits &
  78480. #1066
  78481. t = Traits ( ) )
  78482. {
  78483.  
  78484. const charT * end = func ;
  78485. while ( * end ) ++ end ;
  78486. return regex_format_imp ( i , m , func , end , f , t ) ;
  78487. }
  78488. private :
  78489. const charT * func ;
  78490. format_functor_c_string ( const format_functor_c_string & ) ;
  78491. format_functor_c_string & operator = ( const format_functor_c_string & ) ;
  78492. } ;
  78493.  
  78494. template < class Container , class Match , class Traits >
  78495. struct format_functor_container
  78496. {
  78497. format_functor_container ( const Container & c ) : func ( c ) { }
  78498.  
  78499. template < class OutputIter >
  78500. OutputIter operator ( ) ( const Match & m , OutputIter i , boost :: regex_constants :: match_flag_type f , const Traits &
  78501. #1085
  78502. t = Traits ( ) )
  78503. {
  78504.  
  78505. return re_detail :: regex_format_imp ( i , m , func . begin ( ) , func . end ( ) , f , t ) ;
  78506. }
  78507. private :
  78508. const Container & func ;
  78509. format_functor_container ( const format_functor_container & ) ;
  78510. format_functor_container & operator = ( const format_functor_container & ) ;
  78511. } ;
  78512.  
  78513. template < class Func , class Match , class OutputIterator , class Traits = re_detail :: trivial_format_traits < typename
  78514. #1096
  78515. Match :: char_type > >
  78516. struct compute_functor_type
  78517. {
  78518. typedef typename format_traits < Func , Match , OutputIterator > :: type tag ;
  78519. typedef typename boost :: remove_cv < typename boost :: remove_pointer < Func > :: type > :: type maybe_char_type ;
  78520.  
  78521. typedef typename mpl :: if_ <
  78522. :: boost :: is_same < tag , mpl :: int_ < 0 > > , format_functor_c_string < maybe_char_type , Match , Traits > ,
  78523. typename mpl :: if_ <
  78524. :: boost :: is_same < tag , mpl :: int_ < 1 > > , format_functor_container < Func , Match , Traits > ,
  78525. typename mpl :: if_ <
  78526. :: boost :: is_same < tag , mpl :: int_ < 2 > > , format_functor1 < Func , Match > ,
  78527. typename mpl :: if_ <
  78528. :: boost :: is_same < tag , mpl :: int_ < 3 > > , format_functor2 < Func , Match > ,
  78529. format_functor3 < Func , Match >
  78530. > :: type
  78531. > :: type
  78532. > :: type
  78533. > :: type type ;
  78534. } ;
  78535.  
  78536. }
  78537.  
  78538. template < class OutputIterator , class Iterator , class Allocator , class Functor >
  78539. inline OutputIterator regex_format ( OutputIterator out ,
  78540. const match_results < Iterator , Allocator > & m ,
  78541. Functor fmt ,
  78542. match_flag_type flags = format_all
  78543. )
  78544. {
  78545. return m . format ( out , fmt , flags ) ;
  78546. }
  78547.  
  78548. template < class Iterator , class Allocator , class Functor >
  78549. inline std :: basic_string < typename match_results < Iterator , Allocator > :: char_type > regex_format ( const match_results
  78550. #1130
  78551. < Iterator , Allocator > & m ,
  78552. Functor fmt ,
  78553. match_flag_type flags = format_all )
  78554. {
  78555. return m . format ( fmt , flags ) ;
  78556. }
  78557. #1148
  78558. }
  78559. #1 "./boost/regex/v4/match_results.hpp"
  78560. #33
  78561. namespace boost {
  78562. #42
  78563. namespace re_detail {
  78564.  
  78565. class named_subexpressions ;
  78566.  
  78567. }
  78568.  
  78569. template < class BidiIterator , class Allocator >
  78570. class match_results
  78571. {
  78572. private :
  78573.  
  78574. typedef std :: vector < sub_match < BidiIterator > , Allocator > vector_type ;
  78575.  
  78576.  
  78577.  
  78578. public :
  78579. typedef sub_match < BidiIterator > value_type ;
  78580.  
  78581. typedef typename Allocator :: const_reference const_reference ;
  78582.  
  78583.  
  78584.  
  78585. typedef const_reference reference ;
  78586. typedef typename vector_type :: const_iterator const_iterator ;
  78587. typedef const_iterator iterator ;
  78588. typedef typename re_detail :: regex_iterator_traits <
  78589. BidiIterator > :: difference_type difference_type ;
  78590. typedef typename Allocator :: size_type size_type ;
  78591. typedef Allocator allocator_type ;
  78592. typedef typename re_detail :: regex_iterator_traits <
  78593. BidiIterator > :: value_type char_type ;
  78594. typedef std :: basic_string < char_type > string_type ;
  78595. typedef re_detail :: named_subexpressions named_sub_type ;
  78596.  
  78597.  
  78598. explicit match_results ( const Allocator & a = Allocator ( ) )
  78599.  
  78600. : m_subs ( a ) , m_base ( ) , m_last_closed_paren ( 0 ) , m_is_singular ( true ) { }
  78601.  
  78602.  
  78603.  
  78604. match_results ( const match_results & m )
  78605. : m_subs ( m . m_subs ) , m_named_subs ( m . m_named_subs ) , m_last_closed_paren ( m . m_last_closed_paren ) , m_is_singular
  78606. #84
  78607. ( m . m_is_singular )
  78608. {
  78609. if ( ! m_is_singular )
  78610. {
  78611. m_base = m . m_base ;
  78612. m_null = m . m_null ;
  78613. }
  78614. }
  78615. match_results & operator = ( const match_results & m )
  78616. {
  78617. m_subs = m . m_subs ;
  78618. m_named_subs = m . m_named_subs ;
  78619. m_last_closed_paren = m . m_last_closed_paren ;
  78620. m_is_singular = m . m_is_singular ;
  78621. if ( ! m_is_singular )
  78622. {
  78623. m_base = m . m_base ;
  78624. m_null = m . m_null ;
  78625. }
  78626. return * this ;
  78627. }
  78628. ~ match_results ( ) { }
  78629.  
  78630.  
  78631. size_type size ( ) const
  78632. { return empty ( ) ? 0 : m_subs . size ( ) - 2 ; }
  78633. size_type max_size ( ) const
  78634. { return m_subs . max_size ( ) ; }
  78635. bool empty ( ) const
  78636. { return m_subs . size ( ) < 2 ; }
  78637.  
  78638. difference_type length ( int sub = 0 ) const
  78639. {
  78640. if ( m_is_singular )
  78641. raise_logic_error ( ) ;
  78642. sub += 2 ;
  78643. if ( ( sub < ( int ) m_subs . size ( ) ) && ( sub > 0 ) )
  78644. return m_subs [ sub ] . length ( ) ;
  78645. return 0 ;
  78646. }
  78647. difference_type length ( const char_type * sub ) const
  78648. {
  78649. if ( m_is_singular )
  78650. raise_logic_error ( ) ;
  78651. const char_type * sub_end = sub ;
  78652. while ( * sub_end ) ++ sub_end ;
  78653. return length ( named_subexpression_index ( sub , sub_end ) ) ;
  78654. }
  78655. template < class charT >
  78656. difference_type length ( const charT * sub ) const
  78657. {
  78658. if ( m_is_singular )
  78659. raise_logic_error ( ) ;
  78660. const charT * sub_end = sub ;
  78661. while ( * sub_end ) ++ sub_end ;
  78662. return length ( named_subexpression_index ( sub , sub_end ) ) ;
  78663. }
  78664. template < class charT , class Traits , class A >
  78665. difference_type length ( const std :: basic_string < charT , Traits , A > & sub ) const
  78666. {
  78667. return length ( sub . c_str ( ) ) ;
  78668. }
  78669. difference_type position ( size_type sub = 0 ) const
  78670. {
  78671. if ( m_is_singular )
  78672. raise_logic_error ( ) ;
  78673. sub += 2 ;
  78674. if ( sub < m_subs . size ( ) )
  78675. {
  78676. const sub_match < BidiIterator > & s = m_subs [ sub ] ;
  78677. if ( s . matched || ( sub == 2 ) )
  78678. {
  78679. return :: boost :: re_detail :: distance ( ( BidiIterator ) ( m_base ) , ( BidiIterator ) ( s . first ) ) ;
  78680. }
  78681. }
  78682. return ~ static_cast < difference_type > ( 0 ) ;
  78683. }
  78684. difference_type position ( const char_type * sub ) const
  78685. {
  78686. const char_type * sub_end = sub ;
  78687. while ( * sub_end ) ++ sub_end ;
  78688. return position ( named_subexpression_index ( sub , sub_end ) ) ;
  78689. }
  78690. template < class charT >
  78691. difference_type position ( const charT * sub ) const
  78692. {
  78693. const charT * sub_end = sub ;
  78694. while ( * sub_end ) ++ sub_end ;
  78695. return position ( named_subexpression_index ( sub , sub_end ) ) ;
  78696. }
  78697. template < class charT , class Traits , class A >
  78698. difference_type position ( const std :: basic_string < charT , Traits , A > & sub ) const
  78699. {
  78700. return position ( sub . c_str ( ) ) ;
  78701. }
  78702. string_type str ( int sub = 0 ) const
  78703. {
  78704. if ( m_is_singular )
  78705. raise_logic_error ( ) ;
  78706. sub += 2 ;
  78707. string_type result ;
  78708. if ( sub < ( int ) m_subs . size ( ) && ( sub > 0 ) )
  78709. {
  78710. const sub_match < BidiIterator > & s = m_subs [ sub ] ;
  78711. if ( s . matched )
  78712. {
  78713. result = s . str ( ) ;
  78714. }
  78715. }
  78716. return result ;
  78717. }
  78718. string_type str ( const char_type * sub ) const
  78719. {
  78720. return ( * this ) [ sub ] . str ( ) ;
  78721. }
  78722. template < class Traits , class A >
  78723. string_type str ( const std :: basic_string < char_type , Traits , A > & sub ) const
  78724. {
  78725. return ( * this ) [ sub ] . str ( ) ;
  78726. }
  78727. template < class charT >
  78728. string_type str ( const charT * sub ) const
  78729. {
  78730. return ( * this ) [ sub ] . str ( ) ;
  78731. }
  78732. template < class charT , class Traits , class A >
  78733. string_type str ( const std :: basic_string < charT , Traits , A > & sub ) const
  78734. {
  78735. return ( * this ) [ sub ] . str ( ) ;
  78736. }
  78737. const_reference operator [ ] ( int sub ) const
  78738. {
  78739. if ( m_is_singular && m_subs . empty ( ) )
  78740. raise_logic_error ( ) ;
  78741. sub += 2 ;
  78742. if ( sub < ( int ) m_subs . size ( ) && ( sub >= 0 ) )
  78743. {
  78744. return m_subs [ sub ] ;
  78745. }
  78746. return m_null ;
  78747. }
  78748.  
  78749.  
  78750.  
  78751. const_reference named_subexpression ( const char_type * i , const char_type * j ) const
  78752. {
  78753.  
  78754.  
  78755.  
  78756. if ( m_is_singular )
  78757. raise_logic_error ( ) ;
  78758. re_detail :: named_subexpressions :: range_type r = m_named_subs -> equal_range ( i , j ) ;
  78759. while ( ( r . first != r . second ) && ( ( * this ) [ r . first -> index ] . matched == false ) )
  78760. ++ r . first ;
  78761. return r . first != r . second ? ( * this ) [ r . first -> index ] : m_null ;
  78762. }
  78763. template < class charT >
  78764. const_reference named_subexpression ( const charT * i , const charT * j ) const
  78765. {
  78766. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( sizeof ( charT ) <= sizeof
  78767. #243
  78768. ( char_type ) ) > ) > boost_static_assert_typedef_243 ;
  78769. if ( i == j )
  78770. return m_null ;
  78771. std :: vector < char_type > s ;
  78772. while ( i != j )
  78773. s . insert ( s . end ( ) , * i ++ ) ;
  78774. return named_subexpression ( & * s . begin ( ) , & * s . begin ( ) + s . size ( ) ) ;
  78775. }
  78776. int named_subexpression_index ( const char_type * i , const char_type * j ) const
  78777. {
  78778.  
  78779.  
  78780.  
  78781.  
  78782.  
  78783. if ( m_is_singular )
  78784. raise_logic_error ( ) ;
  78785. re_detail :: named_subexpressions :: range_type s , r ;
  78786. s = r = m_named_subs -> equal_range ( i , j ) ;
  78787. while ( ( r . first != r . second ) && ( ( * this ) [ r . first -> index ] . matched == false ) )
  78788. ++ r . first ;
  78789. if ( r . first == r . second )
  78790. r = s ;
  78791. return r . first != r . second ? r . first -> index : - 20 ;
  78792. }
  78793. template < class charT >
  78794. int named_subexpression_index ( const charT * i , const charT * j ) const
  78795. {
  78796. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( sizeof ( charT ) <= sizeof
  78797. #271
  78798. ( char_type ) ) > ) > boost_static_assert_typedef_271 ;
  78799. if ( i == j )
  78800. return - 20 ;
  78801. std :: vector < char_type > s ;
  78802. while ( i != j )
  78803. s . insert ( s . end ( ) , * i ++ ) ;
  78804. return named_subexpression_index ( & * s . begin ( ) , & * s . begin ( ) + s . size ( ) ) ;
  78805. }
  78806. template < class Traits , class A >
  78807. const_reference operator [ ] ( const std :: basic_string < char_type , Traits , A > & s ) const
  78808. {
  78809. return named_subexpression ( s . c_str ( ) , s . c_str ( ) + s . size ( ) ) ;
  78810. }
  78811. const_reference operator [ ] ( const char_type * p ) const
  78812. {
  78813. const char_type * e = p ;
  78814. while ( * e ) ++ e ;
  78815. return named_subexpression ( p , e ) ;
  78816. }
  78817.  
  78818. template < class charT >
  78819. const_reference operator [ ] ( const charT * p ) const
  78820. {
  78821. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( sizeof ( charT ) <= sizeof
  78822. #294
  78823. ( char_type ) ) > ) > boost_static_assert_typedef_294 ;
  78824. if ( * p == 0 )
  78825. return m_null ;
  78826. std :: vector < char_type > s ;
  78827. while ( * p )
  78828. s . insert ( s . end ( ) , * p ++ ) ;
  78829. return named_subexpression ( & * s . begin ( ) , & * s . begin ( ) + s . size ( ) ) ;
  78830. }
  78831. template < class charT , class Traits , class A >
  78832. const_reference operator [ ] ( const std :: basic_string < charT , Traits , A > & ns ) const
  78833. {
  78834. typedef :: boost :: static_assert_test < sizeof ( :: boost :: STATIC_ASSERTION_FAILURE < ( bool ) ( sizeof ( charT ) <= sizeof
  78835. #305
  78836. ( char_type ) ) > ) > boost_static_assert_typedef_305 ;
  78837. if ( ns . empty ( ) )
  78838. return m_null ;
  78839. std :: vector < char_type > s ;
  78840. for ( unsigned i = 0 ; i < ns . size ( ) ; ++ i )
  78841. s . insert ( s . end ( ) , ns [ i ] ) ;
  78842. return named_subexpression ( & * s . begin ( ) , & * s . begin ( ) + s . size ( ) ) ;
  78843. }
  78844.  
  78845. const_reference prefix ( ) const
  78846. {
  78847. if ( m_is_singular )
  78848. raise_logic_error ( ) ;
  78849. return ( * this ) [ - 1 ] ;
  78850. }
  78851.  
  78852. const_reference suffix ( ) const
  78853. {
  78854. if ( m_is_singular )
  78855. raise_logic_error ( ) ;
  78856. return ( * this ) [ - 2 ] ;
  78857. }
  78858. const_iterator begin ( ) const
  78859. {
  78860. return ( m_subs . size ( ) > 2 ) ? ( m_subs . begin ( ) + 2 ) : m_subs . end ( ) ;
  78861. }
  78862. const_iterator end ( ) const
  78863. {
  78864. return m_subs . end ( ) ;
  78865. }
  78866.  
  78867. template < class OutputIterator , class Functor >
  78868. OutputIterator format ( OutputIterator out ,
  78869. Functor fmt ,
  78870. match_flag_type flags = format_default ) const
  78871. {
  78872. if ( m_is_singular )
  78873. raise_logic_error ( ) ;
  78874. typedef typename re_detail :: compute_functor_type < Functor , match_results < BidiIterator , Allocator > , OutputIterator
  78875. #343
  78876. > :: type F ;
  78877. F func ( fmt ) ;
  78878. return func ( * this , out , flags ) ;
  78879. }
  78880. template < class Functor >
  78881. string_type format ( Functor fmt , match_flag_type flags = format_default ) const
  78882. {
  78883. if ( m_is_singular )
  78884. raise_logic_error ( ) ;
  78885. std :: basic_string < char_type > result ;
  78886. re_detail :: string_out_iterator < std :: basic_string < char_type > > i ( result ) ;
  78887.  
  78888. typedef typename re_detail :: compute_functor_type < Functor , match_results < BidiIterator , Allocator > , re_detail ::
  78889. #355
  78890. string_out_iterator < std :: basic_string < char_type > > > :: type F ;
  78891. F func ( fmt ) ;
  78892.  
  78893. func ( * this , i , flags ) ;
  78894. return result ;
  78895. }
  78896.  
  78897. template < class OutputIterator , class Functor , class RegexT >
  78898. OutputIterator format ( OutputIterator out ,
  78899. Functor fmt ,
  78900. match_flag_type flags ,
  78901. const RegexT & re ) const
  78902. {
  78903. if ( m_is_singular )
  78904. raise_logic_error ( ) ;
  78905. typedef :: boost :: regex_traits_wrapper < typename RegexT :: traits_type > traits_type ;
  78906. typedef typename re_detail :: compute_functor_type < Functor , match_results < BidiIterator , Allocator > , OutputIterator
  78907. #371
  78908. , traits_type > :: type F ;
  78909. F func ( fmt ) ;
  78910. return func ( * this , out , flags , re . get_traits ( ) ) ;
  78911. }
  78912. template < class RegexT , class Functor >
  78913. string_type format ( Functor fmt ,
  78914. match_flag_type flags ,
  78915. const RegexT & re ) const
  78916. {
  78917. if ( m_is_singular )
  78918. raise_logic_error ( ) ;
  78919. typedef :: boost :: regex_traits_wrapper < typename RegexT :: traits_type > traits_type ;
  78920. std :: basic_string < char_type > result ;
  78921. re_detail :: string_out_iterator < std :: basic_string < char_type > > i ( result ) ;
  78922.  
  78923. typedef typename re_detail :: compute_functor_type < Functor , match_results < BidiIterator , Allocator > , re_detail ::
  78924. #386
  78925. string_out_iterator < std :: basic_string < char_type > > , traits_type > :: type F ;
  78926. F func ( fmt ) ;
  78927.  
  78928. func ( * this , i , flags , re . get_traits ( ) ) ;
  78929. return result ;
  78930. }
  78931.  
  78932. const_reference get_last_closed_paren ( ) const
  78933. {
  78934. if ( m_is_singular )
  78935. raise_logic_error ( ) ;
  78936. return m_last_closed_paren == 0 ? m_null : ( * this ) [ m_last_closed_paren ] ;
  78937. }
  78938.  
  78939. allocator_type get_allocator ( ) const
  78940. {
  78941.  
  78942. return m_subs . get_allocator ( ) ;
  78943.  
  78944.  
  78945.  
  78946. }
  78947. void swap ( match_results & that )
  78948. {
  78949. std :: swap ( m_subs , that . m_subs ) ;
  78950. std :: swap ( m_named_subs , that . m_named_subs ) ;
  78951. std :: swap ( m_last_closed_paren , that . m_last_closed_paren ) ;
  78952. if ( m_is_singular )
  78953. {
  78954. if ( ! that . m_is_singular )
  78955. {
  78956. m_base = that . m_base ;
  78957. m_null = that . m_null ;
  78958. }
  78959. }
  78960. else if ( that . m_is_singular )
  78961. {
  78962. that . m_base = m_base ;
  78963. that . m_null = m_null ;
  78964. }
  78965. else
  78966. {
  78967. std :: swap ( m_base , that . m_base ) ;
  78968. std :: swap ( m_null , that . m_null ) ;
  78969. }
  78970. std :: swap ( m_is_singular , that . m_is_singular ) ;
  78971. }
  78972. bool operator == ( const match_results & that ) const
  78973. {
  78974. if ( m_is_singular )
  78975. {
  78976. return that . m_is_singular ;
  78977. }
  78978. else if ( that . m_is_singular )
  78979. {
  78980. return false ;
  78981. }
  78982. return ( m_subs == that . m_subs ) && ( m_base == that . m_base ) && ( m_last_closed_paren == that . m_last_closed_paren
  78983. #443
  78984. ) ;
  78985. }
  78986. bool operator != ( const match_results & that ) const
  78987. { return ! ( * this == that ) ; }
  78988. #461
  78989. void set_second ( BidiIterator i )
  78990. {
  78991. ( ( void ) 0 ) ;
  78992. m_subs [ 2 ] . second = i ;
  78993. m_subs [ 2 ] . matched = true ;
  78994. m_subs [ 0 ] . first = i ;
  78995. m_subs [ 0 ] . matched = ( m_subs [ 0 ] . first != m_subs [ 0 ] . second ) ;
  78996. m_null . first = i ;
  78997. m_null . second = i ;
  78998. m_null . matched = false ;
  78999. m_is_singular = false ;
  79000. }
  79001.  
  79002. void set_second ( BidiIterator i , size_type pos , bool m = true , bool escape_k = false )
  79003. {
  79004. if ( pos )
  79005. m_last_closed_paren = static_cast < int > ( pos ) ;
  79006. pos += 2 ;
  79007. ( ( void ) 0 ) ;
  79008. m_subs [ pos ] . second = i ;
  79009. m_subs [ pos ] . matched = m ;
  79010. if ( ( pos == 2 ) && ! escape_k )
  79011. {
  79012. m_subs [ 0 ] . first = i ;
  79013. m_subs [ 0 ] . matched = ( m_subs [ 0 ] . first != m_subs [ 0 ] . second ) ;
  79014. m_null . first = i ;
  79015. m_null . second = i ;
  79016. m_null . matched = false ;
  79017. m_is_singular = false ;
  79018. }
  79019. }
  79020. void set_size ( size_type n , BidiIterator i , BidiIterator j )
  79021. {
  79022. value_type v ( j ) ;
  79023. size_type len = m_subs . size ( ) ;
  79024. if ( len > n + 2 )
  79025. {
  79026. m_subs . erase ( m_subs . begin ( ) + n + 2 , m_subs . end ( ) ) ;
  79027. std :: fill ( m_subs . begin ( ) , m_subs . end ( ) , v ) ;
  79028. }
  79029. else
  79030. {
  79031. std :: fill ( m_subs . begin ( ) , m_subs . end ( ) , v ) ;
  79032. if ( n + 2 != len )
  79033. m_subs . insert ( m_subs . end ( ) , n + 2 - len , v ) ;
  79034. }
  79035. m_subs [ 1 ] . first = i ;
  79036. m_last_closed_paren = 0 ;
  79037. }
  79038. void set_base ( BidiIterator pos )
  79039. {
  79040. m_base = pos ;
  79041. }
  79042. BidiIterator base ( ) const
  79043. {
  79044. return m_base ;
  79045. }
  79046. void set_first ( BidiIterator i )
  79047. {
  79048. ( ( void ) 0 ) ;
  79049.  
  79050. m_subs [ 1 ] . second = i ;
  79051. m_subs [ 1 ] . matched = ( m_subs [ 1 ] . first != i ) ;
  79052.  
  79053. m_subs [ 2 ] . first = i ;
  79054.  
  79055. for ( size_type n = 3 ; n < m_subs . size ( ) ; ++ n )
  79056. {
  79057. m_subs [ n ] . first = m_subs [ n ] . second = m_subs [ 0 ] . second ;
  79058. m_subs [ n ] . matched = false ;
  79059. }
  79060. }
  79061. void set_first ( BidiIterator i , size_type pos , bool escape_k = false )
  79062. {
  79063. ( ( void ) 0 ) ;
  79064. if ( pos || escape_k )
  79065. {
  79066. m_subs [ pos + 2 ] . first = i ;
  79067. if ( escape_k )
  79068. {
  79069. m_subs [ 1 ] . second = i ;
  79070. m_subs [ 1 ] . matched = ( m_subs [ 1 ] . first != m_subs [ 1 ] . second ) ;
  79071. }
  79072. }
  79073. else
  79074. set_first ( i ) ;
  79075. }
  79076. void maybe_assign ( const match_results < BidiIterator , Allocator > & m ) ;
  79077.  
  79078. void set_named_subs ( boost :: shared_ptr < named_sub_type > subs )
  79079. {
  79080. m_named_subs = subs ;
  79081. }
  79082.  
  79083. private :
  79084.  
  79085.  
  79086.  
  79087. static void raise_logic_error ( )
  79088. {
  79089. std :: logic_error e ( "Attempt to access an uninitialzed boost::match_results<> class." ) ;
  79090. boost :: throw_exception ( e ) ;
  79091. }
  79092.  
  79093.  
  79094. vector_type m_subs ;
  79095. BidiIterator m_base ;
  79096. sub_match < BidiIterator > m_null ;
  79097. boost :: shared_ptr < named_sub_type > m_named_subs ;
  79098. int m_last_closed_paren ;
  79099. bool m_is_singular ;
  79100. } ;
  79101.  
  79102. template < class BidiIterator , class Allocator >
  79103. void match_results < BidiIterator , Allocator > :: maybe_assign ( const match_results < BidiIterator , Allocator > & m )
  79104. #575
  79105.  
  79106. {
  79107. if ( m_is_singular )
  79108. {
  79109. * this = m ;
  79110. return ;
  79111. }
  79112. const_iterator p1 , p2 ;
  79113. p1 = begin ( ) ;
  79114. p2 = m . begin ( ) ;
  79115. #595
  79116. BidiIterator l_end = this -> suffix ( ) . second ;
  79117. BidiIterator l_base = ( p1 -> first == l_end ) ? this -> prefix ( ) . first : ( * this ) [ 0 ] . first ;
  79118. difference_type len1 = 0 ;
  79119. difference_type len2 = 0 ;
  79120. difference_type base1 = 0 ;
  79121. difference_type base2 = 0 ;
  79122. std :: size_t i ;
  79123. for ( i = 0 ; i < size ( ) ; ++ i , ++ p1 , ++ p2 )
  79124. {
  79125. #611
  79126. if ( p1 -> first == l_end )
  79127. {
  79128. if ( p2 -> first != l_end )
  79129. {
  79130.  
  79131.  
  79132. base1 = 1 ;
  79133. base2 = 0 ;
  79134. break ;
  79135. }
  79136. else
  79137. {
  79138.  
  79139.  
  79140. if ( ( p1 -> matched == false ) && ( p2 -> matched == true ) )
  79141. break ;
  79142. if ( ( p1 -> matched == true ) && ( p2 -> matched == false ) )
  79143. return ;
  79144. continue ;
  79145. }
  79146. }
  79147. else if ( p2 -> first == l_end )
  79148. {
  79149.  
  79150. return ;
  79151. }
  79152. base1 = :: boost :: re_detail :: distance ( l_base , p1 -> first ) ;
  79153. base2 = :: boost :: re_detail :: distance ( l_base , p2 -> first ) ;
  79154. ( ( void ) 0 ) ;
  79155. ( ( void ) 0 ) ;
  79156. if ( base1 < base2 ) return ;
  79157. if ( base2 < base1 ) break ;
  79158.  
  79159. len1 = :: boost :: re_detail :: distance ( ( BidiIterator ) p1 -> first , ( BidiIterator ) p1 -> second ) ;
  79160. len2 = :: boost :: re_detail :: distance ( ( BidiIterator ) p2 -> first , ( BidiIterator ) p2 -> second ) ;
  79161. ( ( void ) 0 ) ;
  79162. ( ( void ) 0 ) ;
  79163. if ( ( len1 != len2 ) || ( ( p1 -> matched == false ) && ( p2 -> matched == true ) ) )
  79164. break ;
  79165. if ( ( p1 -> matched == true ) && ( p2 -> matched == false ) )
  79166. return ;
  79167. }
  79168. if ( i == size ( ) )
  79169. return ;
  79170. if ( base2 < base1 )
  79171. * this = m ;
  79172. else if ( ( len2 > len1 ) || ( ( p1 -> matched == false ) && ( p2 -> matched == true ) ) )
  79173. * this = m ;
  79174. }
  79175.  
  79176. template < class BidiIterator , class Allocator >
  79177. void swap ( match_results < BidiIterator , Allocator > & a , match_results < BidiIterator , Allocator > & b )
  79178. {
  79179. a . swap ( b ) ;
  79180. }
  79181.  
  79182.  
  79183. template < class charT , class traits , class BidiIterator , class Allocator >
  79184. std :: basic_ostream < charT , traits > &
  79185. operator << ( std :: basic_ostream < charT , traits > & os ,
  79186. const match_results < BidiIterator , Allocator > & s )
  79187. {
  79188. return ( os << s . str ( ) ) ;
  79189. }
  79190. #687
  79191. }
  79192. #1 "./boost/regex/v4/protected_call.hpp"
  79193. #34
  79194. namespace boost {
  79195. namespace re_detail {
  79196.  
  79197. class abstract_protected_call
  79198. {
  79199. public :
  79200. bool execute ( ) const ;
  79201.  
  79202. virtual ~ abstract_protected_call ( ) { }
  79203. private :
  79204. virtual bool call ( ) const = 0 ;
  79205. } ;
  79206.  
  79207. template < class T >
  79208. class concrete_protected_call
  79209. : public abstract_protected_call
  79210. {
  79211. public :
  79212. typedef bool ( T :: * proc_type ) ( ) ;
  79213. concrete_protected_call ( T * o , proc_type p )
  79214. : obj ( o ) , proc ( p ) { }
  79215. private :
  79216. virtual bool call ( ) const ;
  79217. T * obj ;
  79218. proc_type proc ;
  79219. } ;
  79220.  
  79221. template < class T >
  79222. bool concrete_protected_call < T > :: call ( ) const
  79223. {
  79224. return ( obj ->* proc ) ( ) ;
  79225. }
  79226.  
  79227. }
  79228. }
  79229. #1 "./boost/regex/v4/perl_matcher.hpp"
  79230. #1 "./boost/regex/v4/iterator_category.hpp"
  79231. #28
  79232. namespace boost {
  79233. namespace detail {
  79234.  
  79235. template < class I >
  79236. struct is_random_imp
  79237. {
  79238.  
  79239. private :
  79240. typedef typename std :: iterator_traits < I > :: iterator_category cat ;
  79241. public :
  79242. static const bool value = ( :: boost :: is_convertible < cat * , std :: random_access_iterator_tag * > :: value ) ;
  79243.  
  79244.  
  79245.  
  79246. } ;
  79247.  
  79248. template < class I >
  79249. struct is_random_pointer_imp
  79250. {
  79251. static const bool value = true ;
  79252. } ;
  79253.  
  79254. template < bool is_pointer_type >
  79255. struct is_random_imp_selector
  79256. {
  79257. template < class I >
  79258. struct rebind
  79259. {
  79260. typedef is_random_imp < I > type ;
  79261. } ;
  79262. } ;
  79263.  
  79264. template < >
  79265. struct is_random_imp_selector < true >
  79266. {
  79267. template < class I >
  79268. struct rebind
  79269. {
  79270. typedef is_random_pointer_imp < I > type ;
  79271. } ;
  79272. } ;
  79273.  
  79274. }
  79275.  
  79276. template < class I >
  79277. struct is_random_access_iterator
  79278. {
  79279. private :
  79280. typedef detail :: is_random_imp_selector < :: boost :: is_pointer < I > :: value > selector ;
  79281. typedef typename selector :: template rebind < I > bound_type ;
  79282. typedef typename bound_type :: type answer ;
  79283. public :
  79284. static const bool value = answer :: value ;
  79285. } ;
  79286.  
  79287.  
  79288. template < class I >
  79289. const bool is_random_access_iterator < I > :: value ;
  79290.  
  79291.  
  79292. }
  79293. #33 "./boost/regex/v4/perl_matcher.hpp"
  79294. namespace boost {
  79295. namespace re_detail {
  79296.  
  79297.  
  79298.  
  79299.  
  79300. void verify_options ( boost :: regex_constants :: syntax_option_type ef , match_flag_type mf ) ;
  79301.  
  79302.  
  79303.  
  79304. template < class charT >
  79305. inline bool can_start ( charT c , const unsigned char * map , unsigned char mask )
  79306. {
  79307. return ( ( c < static_cast < charT > ( 0 ) ) ? true : ( ( c >= static_cast < charT > ( 1 << 8 ) ) ? true : map [ c ] & mask
  79308. #46
  79309. ) ) ;
  79310. }
  79311. inline bool can_start ( char c , const unsigned char * map , unsigned char mask )
  79312. {
  79313. return map [ ( unsigned char ) c ] & mask ;
  79314. }
  79315. inline bool can_start ( signed char c , const unsigned char * map , unsigned char mask )
  79316. {
  79317. return map [ ( unsigned char ) c ] & mask ;
  79318. }
  79319. inline bool can_start ( unsigned char c , const unsigned char * map , unsigned char mask )
  79320. {
  79321. return map [ c ] & mask ;
  79322. }
  79323. inline bool can_start ( unsigned short c , const unsigned char * map , unsigned char mask )
  79324. {
  79325. return ( ( c >= ( 1 << 8 ) ) ? true : map [ c ] & mask ) ;
  79326. }
  79327. #73
  79328. inline bool can_start ( unsigned int c , const unsigned char * map , unsigned char mask )
  79329. {
  79330. return ( ( ( c >= static_cast < unsigned int > ( 1u << 8 ) ) ? true : map [ c ] & mask ) ) ;
  79331. }
  79332. #90
  79333. template < class C , class T , class A >
  79334. inline int string_compare ( const std :: basic_string < C , T , A > & s , const C * p )
  79335. {
  79336. if ( 0 == * p )
  79337. {
  79338. if ( s . empty ( ) || ( ( s . size ( ) == 1 ) && ( s [ 0 ] == 0 ) ) )
  79339. return 0 ;
  79340. }
  79341. return s . compare ( p ) ;
  79342. }
  79343. #121
  79344. template < class Seq , class C >
  79345. inline int string_compare ( const Seq & s , const C * p )
  79346. {
  79347. std :: size_t i = 0 ;
  79348. while ( ( i < s . size ( ) ) && ( p [ i ] == s [ i ] ) )
  79349. {
  79350. ++ i ;
  79351. }
  79352. return ( i == s . size ( ) ) ? - p [ i ] : s [ i ] - p [ i ] ;
  79353. }
  79354.  
  79355.  
  79356. template < class charT >
  79357. inline const charT * re_skip_past_null ( const charT * p )
  79358. {
  79359. while ( * p != static_cast < charT > ( 0 ) ) ++ p ;
  79360. return ++ p ;
  79361. }
  79362.  
  79363. template < class iterator , class charT , class traits_type , class char_classT >
  79364. iterator re_is_set_member ( iterator next ,
  79365. iterator last ,
  79366. const re_set_long < char_classT > * set_ ,
  79367. const regex_data < charT , traits_type > & e , bool icase )
  79368. {
  79369. const charT * p = reinterpret_cast < const charT * > ( set_ + 1 ) ;
  79370. iterator ptr ;
  79371. unsigned int i ;
  79372.  
  79373.  
  79374. if ( next == last ) return next ;
  79375.  
  79376. typedef typename traits_type :: string_type traits_string_type ;
  79377. const :: boost :: regex_traits_wrapper < traits_type > & traits_inst = * ( e . m_ptraits ) ;
  79378.  
  79379.  
  79380.  
  79381. ( void ) traits_inst ;
  79382.  
  79383.  
  79384.  
  79385. for ( i = 0 ; i < set_ -> csingles ; ++ i )
  79386. {
  79387. ptr = next ;
  79388. if ( * p == static_cast < charT > ( 0 ) )
  79389. {
  79390.  
  79391. if ( traits_inst . translate ( * ptr , icase ) != * p )
  79392. {
  79393. while ( * p == static_cast < charT > ( 0 ) ) ++ p ;
  79394. continue ;
  79395. }
  79396. return set_ -> isnot ? next : ( ptr == next ) ? ++ next : ptr ;
  79397. }
  79398. else
  79399. {
  79400. while ( * p && ( ptr != last ) )
  79401. {
  79402. if ( traits_inst . translate ( * ptr , icase ) != * p )
  79403. break ;
  79404. ++ p ;
  79405. ++ ptr ;
  79406. }
  79407.  
  79408. if ( * p == static_cast < charT > ( 0 ) )
  79409. return set_ -> isnot ? next : ( ptr == next ) ? ++ next : ptr ;
  79410.  
  79411. p = re_skip_past_null ( p ) ;
  79412. }
  79413. }
  79414.  
  79415. charT col = traits_inst . translate ( * next , icase ) ;
  79416.  
  79417.  
  79418. if ( set_ -> cranges || set_ -> cequivalents )
  79419. {
  79420. traits_string_type s1 ;
  79421.  
  79422.  
  79423. if ( set_ -> cranges )
  79424. {
  79425. if ( ( e . m_flags & regex_constants :: collate ) == 0 )
  79426. s1 . assign ( 1 , col ) ;
  79427. else
  79428. {
  79429. charT a [ 2 ] = { col , charT ( 0 ) , } ;
  79430. s1 = traits_inst . transform ( a , a + 1 ) ;
  79431. }
  79432. for ( i = 0 ; i < set_ -> cranges ; ++ i )
  79433. {
  79434. if ( string_compare ( s1 , p ) >= 0 )
  79435. {
  79436. do { ++ p ; } while ( * p ) ;
  79437. ++ p ;
  79438. if ( string_compare ( s1 , p ) <= 0 )
  79439. return set_ -> isnot ? next : ++ next ;
  79440. }
  79441. else
  79442. {
  79443.  
  79444. do { ++ p ; } while ( * p ) ;
  79445. ++ p ;
  79446. }
  79447.  
  79448. do { ++ p ; } while ( * p ) ;
  79449. ++ p ;
  79450. }
  79451. }
  79452.  
  79453.  
  79454. if ( set_ -> cequivalents )
  79455. {
  79456. charT a [ 2 ] = { col , charT ( 0 ) , } ;
  79457. s1 = traits_inst . transform_primary ( a , a + 1 ) ;
  79458. for ( i = 0 ; i < set_ -> cequivalents ; ++ i )
  79459. {
  79460. if ( string_compare ( s1 , p ) == 0 )
  79461. return set_ -> isnot ? next : ++ next ;
  79462.  
  79463. do { ++ p ; } while ( * p ) ;
  79464. ++ p ;
  79465. }
  79466. }
  79467. }
  79468. if ( traits_inst . isctype ( col , set_ -> cclasses ) == true )
  79469. return set_ -> isnot ? next : ++ next ;
  79470. if ( ( set_ -> cnclasses != 0 ) && ( traits_inst . isctype ( col , set_ -> cnclasses ) == false ) )
  79471. return set_ -> isnot ? next : ++ next ;
  79472. return set_ -> isnot ? ++ next : next ;
  79473. }
  79474.  
  79475. template < class BidiIterator >
  79476. class repeater_count
  79477. {
  79478. repeater_count * * stack ;
  79479. repeater_count * next ;
  79480. int state_id ;
  79481. std :: size_t count ;
  79482. BidiIterator start_pos ;
  79483. public :
  79484. repeater_count ( repeater_count * * s )
  79485. {
  79486. stack = s ;
  79487. next = 0 ;
  79488. state_id = - 1 ;
  79489. count = 0 ;
  79490. }
  79491. repeater_count ( int i , repeater_count * * s , BidiIterator start )
  79492. : start_pos ( start )
  79493. {
  79494. state_id = i ;
  79495. stack = s ;
  79496. next = * stack ;
  79497. * stack = this ;
  79498. if ( state_id > next -> state_id )
  79499. count = 0 ;
  79500. else
  79501. {
  79502. repeater_count * p = next ;
  79503. while ( p && ( p -> state_id != state_id ) )
  79504. p = p -> next ;
  79505. if ( p )
  79506. {
  79507. count = p -> count ;
  79508. start_pos = p -> start_pos ;
  79509. }
  79510. else
  79511. count = 0 ;
  79512. }
  79513. }
  79514. ~ repeater_count ( )
  79515. {
  79516. if ( next )
  79517. * stack = next ;
  79518. }
  79519. std :: size_t get_count ( ) { return count ; }
  79520. int get_id ( ) { return state_id ; }
  79521. std :: size_t operator ++ ( ) { return ++ count ; }
  79522. bool check_null_repeat ( const BidiIterator & pos , std :: size_t max )
  79523. {
  79524.  
  79525.  
  79526.  
  79527. bool result = ( count == 0 ) ? false : ( pos == start_pos ) ;
  79528. if ( result )
  79529. count = max ;
  79530. else
  79531. start_pos = pos ;
  79532. return result ;
  79533. }
  79534. } ;
  79535.  
  79536. struct saved_state ;
  79537.  
  79538. enum saved_state_type
  79539. {
  79540. saved_type_end = 0 ,
  79541. saved_type_paren = 1 ,
  79542. saved_type_recurse = 2 ,
  79543. saved_type_assertion = 3 ,
  79544. saved_state_alt = 4 ,
  79545. saved_state_repeater_count = 5 ,
  79546. saved_state_extra_block = 6 ,
  79547. saved_state_greedy_single_repeat = 7 ,
  79548. saved_state_rep_slow_dot = 8 ,
  79549. saved_state_rep_fast_dot = 9 ,
  79550. saved_state_rep_char = 10 ,
  79551. saved_state_rep_short_set = 11 ,
  79552. saved_state_rep_long_set = 12 ,
  79553. saved_state_non_greedy_long_repeat = 13 ,
  79554. saved_state_count = 14
  79555. } ;
  79556.  
  79557. template < class Results >
  79558. struct recursion_info
  79559. {
  79560. typedef typename Results :: value_type value_type ;
  79561. typedef typename value_type :: iterator iterator ;
  79562. int idx ;
  79563. const re_syntax_base * preturn_address ;
  79564. Results results ;
  79565. repeater_count < iterator > * repeater_stack ;
  79566. } ;
  79567. #353
  79568. template < class BidiIterator , class Allocator , class traits >
  79569. class perl_matcher
  79570. {
  79571. public :
  79572. typedef typename traits :: char_type char_type ;
  79573. typedef perl_matcher < BidiIterator , Allocator , traits > self_type ;
  79574. typedef bool ( self_type :: * matcher_proc_type ) ( void ) ;
  79575. typedef std :: size_t traits_size_type ;
  79576. typedef typename is_byte < char_type > :: width_type width_type ;
  79577. typedef typename regex_iterator_traits < BidiIterator > :: difference_type difference_type ;
  79578. typedef match_results < BidiIterator , Allocator > results_type ;
  79579.  
  79580. perl_matcher ( BidiIterator first , BidiIterator end ,
  79581. match_results < BidiIterator , Allocator > & what ,
  79582. const basic_regex < char_type , traits > & e ,
  79583. match_flag_type f ,
  79584. BidiIterator l_base )
  79585. : m_result ( what ) , base ( first ) , last ( end ) ,
  79586. position ( first ) , backstop ( l_base ) , re ( e ) , traits_inst ( e . get_traits ( ) ) ,
  79587. m_independent ( false ) , next_count ( & rep_obj ) , rep_obj ( & next_count )
  79588. {
  79589. construct_init ( e , f ) ;
  79590. }
  79591.  
  79592. bool match ( ) ;
  79593. bool find ( ) ;
  79594.  
  79595. void setf ( match_flag_type f )
  79596. { m_match_flags |= f ; }
  79597. void unsetf ( match_flag_type f )
  79598. { m_match_flags &= ~ f ; }
  79599.  
  79600. private :
  79601. void construct_init ( const basic_regex < char_type , traits > & e , match_flag_type f ) ;
  79602.  
  79603. bool find_imp ( ) ;
  79604. bool match_imp ( ) ;
  79605.  
  79606.  
  79607.  
  79608.  
  79609. void estimate_max_state_count ( std :: random_access_iterator_tag * ) ;
  79610. void estimate_max_state_count ( void * ) ;
  79611. bool match_prefix ( ) ;
  79612. bool match_all_states ( ) ;
  79613.  
  79614.  
  79615. bool match_startmark ( ) ;
  79616. bool match_endmark ( ) ;
  79617. bool match_literal ( ) ;
  79618. bool match_start_line ( ) ;
  79619. bool match_end_line ( ) ;
  79620. bool match_wild ( ) ;
  79621. bool match_match ( ) ;
  79622. bool match_word_boundary ( ) ;
  79623. bool match_within_word ( ) ;
  79624. bool match_word_start ( ) ;
  79625. bool match_word_end ( ) ;
  79626. bool match_buffer_start ( ) ;
  79627. bool match_buffer_end ( ) ;
  79628. bool match_backref ( ) ;
  79629. bool match_long_set ( ) ;
  79630. bool match_set ( ) ;
  79631. bool match_jump ( ) ;
  79632. bool match_alt ( ) ;
  79633. bool match_rep ( ) ;
  79634. bool match_combining ( ) ;
  79635. bool match_soft_buffer_end ( ) ;
  79636. bool match_restart_continue ( ) ;
  79637. bool match_long_set_repeat ( ) ;
  79638. bool match_set_repeat ( ) ;
  79639. bool match_char_repeat ( ) ;
  79640. bool match_dot_repeat_fast ( ) ;
  79641. bool match_dot_repeat_slow ( ) ;
  79642. bool match_dot_repeat_dispatch ( )
  79643. {
  79644. return :: boost :: is_random_access_iterator < BidiIterator > :: value ? match_dot_repeat_fast ( ) : match_dot_repeat_slow
  79645. #429
  79646. ( ) ;
  79647. }
  79648. bool match_backstep ( ) ;
  79649. bool match_assert_backref ( ) ;
  79650. bool match_toggle_case ( ) ;
  79651.  
  79652.  
  79653.  
  79654. bool match_recursion ( ) ;
  79655.  
  79656.  
  79657. bool find_restart_any ( ) ;
  79658. bool find_restart_word ( ) ;
  79659. bool find_restart_line ( ) ;
  79660. bool find_restart_buf ( ) ;
  79661. bool find_restart_lit ( ) ;
  79662.  
  79663. private :
  79664.  
  79665. match_results < BidiIterator , Allocator > & m_result ;
  79666.  
  79667. scoped_ptr < match_results < BidiIterator , Allocator > > m_temp_match ;
  79668.  
  79669. match_results < BidiIterator , Allocator > * m_presult ;
  79670.  
  79671. BidiIterator base ;
  79672.  
  79673. BidiIterator last ;
  79674.  
  79675. BidiIterator position ;
  79676.  
  79677. BidiIterator restart ;
  79678.  
  79679. BidiIterator search_base ;
  79680.  
  79681. BidiIterator backstop ;
  79682.  
  79683. const basic_regex < char_type , traits > & re ;
  79684.  
  79685. const :: boost :: regex_traits_wrapper < traits > & traits_inst ;
  79686.  
  79687. const re_syntax_base * pstate ;
  79688.  
  79689. match_flag_type m_match_flags ;
  79690.  
  79691. std :: ptrdiff_t state_count ;
  79692.  
  79693. std :: ptrdiff_t max_state_count ;
  79694.  
  79695. bool icase ;
  79696.  
  79697. bool m_has_partial_match ;
  79698.  
  79699. bool m_has_found_match ;
  79700.  
  79701. bool m_independent ;
  79702.  
  79703. repeater_count < BidiIterator > * next_count ;
  79704.  
  79705. repeater_count < BidiIterator > rep_obj ;
  79706.  
  79707. typename traits :: char_class_type m_word_mask ;
  79708.  
  79709. unsigned char match_any_mask ;
  79710.  
  79711. std :: vector < recursion_info < results_type > > recursion_stack ;
  79712.  
  79713.  
  79714.  
  79715.  
  79716.  
  79717. typedef bool ( self_type :: * unwind_proc_type ) ( bool ) ;
  79718.  
  79719. void extend_stack ( ) ;
  79720. bool unwind ( bool ) ;
  79721. bool unwind_end ( bool ) ;
  79722. bool unwind_paren ( bool ) ;
  79723. bool unwind_recursion_stopper ( bool ) ;
  79724. bool unwind_assertion ( bool ) ;
  79725. bool unwind_alt ( bool ) ;
  79726. bool unwind_repeater_counter ( bool ) ;
  79727. bool unwind_extra_block ( bool ) ;
  79728. bool unwind_greedy_single_repeat ( bool ) ;
  79729. bool unwind_slow_dot_repeat ( bool ) ;
  79730. bool unwind_fast_dot_repeat ( bool ) ;
  79731. bool unwind_char_repeat ( bool ) ;
  79732. bool unwind_short_set_repeat ( bool ) ;
  79733. bool unwind_long_set_repeat ( bool ) ;
  79734. bool unwind_non_greedy_repeat ( bool ) ;
  79735. bool unwind_recursion ( bool ) ;
  79736. bool unwind_recursion_pop ( bool ) ;
  79737. void destroy_single_repeat ( ) ;
  79738. void push_matched_paren ( int index , const sub_match < BidiIterator > & sub ) ;
  79739. void push_recursion_stopper ( ) ;
  79740. void push_assertion ( const re_syntax_base * ps , bool positive ) ;
  79741. void push_alt ( const re_syntax_base * ps ) ;
  79742. void push_repeater_count ( int i , repeater_count < BidiIterator > * * s ) ;
  79743. void push_single_repeat ( std :: size_t c , const re_repeat * r , BidiIterator last_position , int state_id ) ;
  79744. void push_non_greedy_repeat ( const re_syntax_base * ps ) ;
  79745. void push_recursion ( int idx , const re_syntax_base * p , results_type * presults ) ;
  79746. void push_recursion_pop ( ) ;
  79747.  
  79748.  
  79749. saved_state * m_stack_base ;
  79750.  
  79751. saved_state * m_backup_state ;
  79752.  
  79753.  
  79754. bool m_recursive_result ;
  79755.  
  79756. unsigned used_block_count ;
  79757.  
  79758.  
  79759.  
  79760.  
  79761. perl_matcher & operator = ( const perl_matcher & )
  79762. {
  79763. return * this ;
  79764. }
  79765. perl_matcher ( const perl_matcher & that )
  79766. : m_result ( that . m_result ) , re ( that . re ) , traits_inst ( that . traits_inst ) , rep_obj ( 0 ) { }
  79767. } ;
  79768.  
  79769.  
  79770.  
  79771.  
  79772.  
  79773. }
  79774. #569
  79775. }
  79776. #1 "./boost/regex/v4/perl_matcher_non_recursive.hpp"
  79777. #40
  79778. namespace boost {
  79779. namespace re_detail {
  79780.  
  79781. template < class T >
  79782. inline void inplace_destroy ( T * p )
  79783. {
  79784. ( void ) p ;
  79785. p -> ~ T ( ) ;
  79786. }
  79787.  
  79788. struct saved_state
  79789. {
  79790. union {
  79791. unsigned int state_id ;
  79792.  
  79793. std :: size_t padding1 ;
  79794. std :: ptrdiff_t padding2 ;
  79795. void * padding3 ;
  79796. } ;
  79797. saved_state ( unsigned i ) : state_id ( i ) { }
  79798. } ;
  79799.  
  79800. template < class BidiIterator >
  79801. struct saved_matched_paren : public saved_state
  79802. {
  79803. int index ;
  79804. sub_match < BidiIterator > sub ;
  79805. saved_matched_paren ( int i , const sub_match < BidiIterator > & s ) : saved_state ( 1 ) , index ( i ) , sub ( s ) { } ;
  79806. #67
  79807.  
  79808. } ;
  79809.  
  79810. template < class BidiIterator >
  79811. struct saved_position : public saved_state
  79812. {
  79813. const re_syntax_base * pstate ;
  79814. BidiIterator position ;
  79815. saved_position ( const re_syntax_base * ps , BidiIterator pos , int i ) : saved_state ( i ) , pstate ( ps ) , position (
  79816. #75
  79817. pos ) { } ;
  79818. } ;
  79819.  
  79820. template < class BidiIterator >
  79821. struct saved_assertion : public saved_position < BidiIterator >
  79822. {
  79823. bool positive ;
  79824. saved_assertion ( bool p , const re_syntax_base * ps , BidiIterator pos )
  79825. : saved_position < BidiIterator > ( ps , pos , saved_type_assertion ) , positive ( p ) { } ;
  79826. } ;
  79827.  
  79828. template < class BidiIterator >
  79829. struct saved_repeater : public saved_state
  79830. {
  79831. repeater_count < BidiIterator > count ;
  79832. saved_repeater ( int i , repeater_count < BidiIterator > * * s , BidiIterator start )
  79833. : saved_state ( saved_state_repeater_count ) , count ( i , s , start ) { }
  79834. } ;
  79835.  
  79836. struct saved_extra_block : public saved_state
  79837. {
  79838. saved_state * base , * end ;
  79839. saved_extra_block ( saved_state * b , saved_state * e )
  79840. : saved_state ( saved_state_extra_block ) , base ( b ) , end ( e ) { }
  79841. } ;
  79842.  
  79843. struct save_state_init
  79844. {
  79845. saved_state * * stack ;
  79846. save_state_init ( saved_state * * base , saved_state * * end )
  79847. : stack ( base )
  79848. {
  79849. * base = static_cast < saved_state * > ( get_mem_block ( ) ) ;
  79850. * end = reinterpret_cast < saved_state * > ( reinterpret_cast < char * > ( * base ) + 4096 ) ;
  79851. -- ( * end ) ;
  79852. ( void ) new ( * end ) saved_state ( 0 ) ;
  79853. ( ( void ) 0 ) ;
  79854. }
  79855. ~ save_state_init ( )
  79856. {
  79857. put_mem_block ( * stack ) ;
  79858. * stack = 0 ;
  79859. }
  79860. } ;
  79861.  
  79862. template < class BidiIterator >
  79863. struct saved_single_repeat : public saved_state
  79864. {
  79865. std :: size_t count ;
  79866. const re_repeat * rep ;
  79867. BidiIterator last_position ;
  79868. saved_single_repeat ( std :: size_t c , const re_repeat * r , BidiIterator lp , int arg_id )
  79869. : saved_state ( arg_id ) , count ( c ) , rep ( r ) , last_position ( lp ) { }
  79870. } ;
  79871.  
  79872. template < class Results >
  79873. struct saved_recursion : public saved_state
  79874. {
  79875. saved_recursion ( int idx , const re_syntax_base * p , Results * pr )
  79876. : saved_state ( 14 ) , recursion_id ( idx ) , preturn_address ( p ) , results ( * pr )
  79877. { }
  79878. int recursion_id ;
  79879. const re_syntax_base * preturn_address ;
  79880. Results results ;
  79881. } ;
  79882.  
  79883. template < class BidiIterator , class Allocator , class traits >
  79884. bool perl_matcher < BidiIterator , Allocator , traits > :: match_all_states ( )
  79885. {
  79886. static matcher_proc_type const s_match_vtable [ 30 ] =
  79887. {
  79888. ( & perl_matcher < BidiIterator , Allocator , traits > :: match_startmark ) ,
  79889. & perl_matcher < BidiIterator , Allocator , traits > :: match_endmark ,
  79890. & perl_matcher < BidiIterator , Allocator , traits > :: match_literal ,
  79891. & perl_matcher < BidiIterator , Allocator , traits > :: match_start_line ,
  79892. & perl_matcher < BidiIterator , Allocator , traits > :: match_end_line ,
  79893. & perl_matcher < BidiIterator , Allocator , traits > :: match_wild ,
  79894. & perl_matcher < BidiIterator , Allocator , traits > :: match_match ,
  79895. & perl_matcher < BidiIterator , Allocator , traits > :: match_word_boundary ,
  79896. & perl_matcher < BidiIterator , Allocator , traits > :: match_within_word ,
  79897. & perl_matcher < BidiIterator , Allocator , traits > :: match_word_start ,
  79898. & perl_matcher < BidiIterator , Allocator , traits > :: match_word_end ,
  79899. & perl_matcher < BidiIterator , Allocator , traits > :: match_buffer_start ,
  79900. & perl_matcher < BidiIterator , Allocator , traits > :: match_buffer_end ,
  79901. & perl_matcher < BidiIterator , Allocator , traits > :: match_backref ,
  79902. & perl_matcher < BidiIterator , Allocator , traits > :: match_long_set ,
  79903. & perl_matcher < BidiIterator , Allocator , traits > :: match_set ,
  79904. & perl_matcher < BidiIterator , Allocator , traits > :: match_jump ,
  79905. & perl_matcher < BidiIterator , Allocator , traits > :: match_alt ,
  79906. & perl_matcher < BidiIterator , Allocator , traits > :: match_rep ,
  79907. & perl_matcher < BidiIterator , Allocator , traits > :: match_combining ,
  79908. & perl_matcher < BidiIterator , Allocator , traits > :: match_soft_buffer_end ,
  79909. & perl_matcher < BidiIterator , Allocator , traits > :: match_restart_continue ,
  79910.  
  79911.  
  79912.  
  79913.  
  79914. & perl_matcher < BidiIterator , Allocator , traits > :: match_dot_repeat_dispatch ,
  79915. & perl_matcher < BidiIterator , Allocator , traits > :: match_char_repeat ,
  79916. & perl_matcher < BidiIterator , Allocator , traits > :: match_set_repeat ,
  79917. & perl_matcher < BidiIterator , Allocator , traits > :: match_long_set_repeat ,
  79918. & perl_matcher < BidiIterator , Allocator , traits > :: match_backstep ,
  79919. & perl_matcher < BidiIterator , Allocator , traits > :: match_assert_backref ,
  79920. & perl_matcher < BidiIterator , Allocator , traits > :: match_toggle_case ,
  79921. & perl_matcher < BidiIterator , Allocator , traits > :: match_recursion ,
  79922. } ;
  79923.  
  79924. push_recursion_stopper ( ) ;
  79925. do {
  79926. while ( pstate )
  79927. {
  79928. matcher_proc_type proc = s_match_vtable [ pstate -> type ] ;
  79929. ++ state_count ;
  79930. if ( ! ( this ->* proc ) ( ) )
  79931. {
  79932. if ( state_count > max_state_count )
  79933. raise_error ( traits_inst , regex_constants :: error_complexity ) ;
  79934. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  79935. m_has_partial_match = true ;
  79936. bool successful_unwind = unwind ( false ) ;
  79937. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  79938. m_has_partial_match = true ;
  79939. if ( false == successful_unwind )
  79940. return m_recursive_result ;
  79941. }
  79942. }
  79943. } while ( unwind ( true ) ) ;
  79944. return m_recursive_result ;
  79945. }
  79946.  
  79947. template < class BidiIterator , class Allocator , class traits >
  79948. void perl_matcher < BidiIterator , Allocator , traits > :: extend_stack ( )
  79949. {
  79950. if ( used_block_count )
  79951. {
  79952. -- used_block_count ;
  79953. saved_state * stack_base ;
  79954. saved_state * backup_state ;
  79955. stack_base = static_cast < saved_state * > ( get_mem_block ( ) ) ;
  79956. backup_state = reinterpret_cast < saved_state * > ( reinterpret_cast < char * > ( stack_base ) + 4096 ) ;
  79957. saved_extra_block * block = static_cast < saved_extra_block * > ( backup_state ) ;
  79958. -- block ;
  79959. ( void ) new ( block ) saved_extra_block ( m_stack_base , m_backup_state ) ;
  79960. m_stack_base = stack_base ;
  79961. m_backup_state = block ;
  79962. }
  79963. else
  79964. raise_error ( traits_inst , regex_constants :: error_stack ) ;
  79965. }
  79966.  
  79967. template < class BidiIterator , class Allocator , class traits >
  79968. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_matched_paren ( int index , const sub_match < BidiIterator
  79969. #226
  79970. > & sub )
  79971. {
  79972.  
  79973. saved_matched_paren < BidiIterator > * pmp = static_cast < saved_matched_paren < BidiIterator > * > ( m_backup_state ) ;
  79974. #229
  79975.  
  79976. -- pmp ;
  79977. if ( pmp < m_stack_base )
  79978. {
  79979. extend_stack ( ) ;
  79980. pmp = static_cast < saved_matched_paren < BidiIterator > * > ( m_backup_state ) ;
  79981. -- pmp ;
  79982. }
  79983. ( void ) new ( pmp ) saved_matched_paren < BidiIterator > ( index , sub ) ;
  79984. m_backup_state = pmp ;
  79985. }
  79986.  
  79987. template < class BidiIterator , class Allocator , class traits >
  79988. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_recursion_stopper ( )
  79989. {
  79990. saved_state * pmp = m_backup_state ;
  79991. -- pmp ;
  79992. if ( pmp < m_stack_base )
  79993. {
  79994. extend_stack ( ) ;
  79995. pmp = m_backup_state ;
  79996. -- pmp ;
  79997. }
  79998. ( void ) new ( pmp ) saved_state ( saved_type_recurse ) ;
  79999. m_backup_state = pmp ;
  80000. }
  80001.  
  80002. template < class BidiIterator , class Allocator , class traits >
  80003. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_assertion ( const re_syntax_base * ps , bool positive
  80004. #257
  80005. )
  80006. {
  80007. saved_assertion < BidiIterator > * pmp = static_cast < saved_assertion < BidiIterator > * > ( m_backup_state ) ;
  80008. -- pmp ;
  80009. if ( pmp < m_stack_base )
  80010. {
  80011. extend_stack ( ) ;
  80012. pmp = static_cast < saved_assertion < BidiIterator > * > ( m_backup_state ) ;
  80013. -- pmp ;
  80014. }
  80015. ( void ) new ( pmp ) saved_assertion < BidiIterator > ( positive , ps , position ) ;
  80016. m_backup_state = pmp ;
  80017. }
  80018.  
  80019. template < class BidiIterator , class Allocator , class traits >
  80020. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_alt ( const re_syntax_base * ps )
  80021. {
  80022. saved_position < BidiIterator > * pmp = static_cast < saved_position < BidiIterator > * > ( m_backup_state ) ;
  80023. -- pmp ;
  80024. if ( pmp < m_stack_base )
  80025. {
  80026. extend_stack ( ) ;
  80027. pmp = static_cast < saved_position < BidiIterator > * > ( m_backup_state ) ;
  80028. -- pmp ;
  80029. }
  80030. ( void ) new ( pmp ) saved_position < BidiIterator > ( ps , position , saved_state_alt ) ;
  80031. m_backup_state = pmp ;
  80032. }
  80033.  
  80034. template < class BidiIterator , class Allocator , class traits >
  80035. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_non_greedy_repeat ( const re_syntax_base * ps )
  80036. {
  80037. saved_position < BidiIterator > * pmp = static_cast < saved_position < BidiIterator > * > ( m_backup_state ) ;
  80038. -- pmp ;
  80039. if ( pmp < m_stack_base )
  80040. {
  80041. extend_stack ( ) ;
  80042. pmp = static_cast < saved_position < BidiIterator > * > ( m_backup_state ) ;
  80043. -- pmp ;
  80044. }
  80045. ( void ) new ( pmp ) saved_position < BidiIterator > ( ps , position , saved_state_non_greedy_long_repeat ) ;
  80046. m_backup_state = pmp ;
  80047. }
  80048.  
  80049. template < class BidiIterator , class Allocator , class traits >
  80050. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_repeater_count ( int i , repeater_count < BidiIterator
  80051. #302
  80052. > * * s )
  80053. {
  80054. saved_repeater < BidiIterator > * pmp = static_cast < saved_repeater < BidiIterator > * > ( m_backup_state ) ;
  80055. -- pmp ;
  80056. if ( pmp < m_stack_base )
  80057. {
  80058. extend_stack ( ) ;
  80059. pmp = static_cast < saved_repeater < BidiIterator > * > ( m_backup_state ) ;
  80060. -- pmp ;
  80061. }
  80062. ( void ) new ( pmp ) saved_repeater < BidiIterator > ( i , s , position ) ;
  80063. m_backup_state = pmp ;
  80064. }
  80065.  
  80066. template < class BidiIterator , class Allocator , class traits >
  80067. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_single_repeat ( std :: size_t c , const re_repeat
  80068. #317
  80069. * r , BidiIterator last_position , int state_id )
  80070. {
  80071. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80072. #319
  80073.  
  80074. -- pmp ;
  80075. if ( pmp < m_stack_base )
  80076. {
  80077. extend_stack ( ) ;
  80078. pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80079. -- pmp ;
  80080. }
  80081. ( void ) new ( pmp ) saved_single_repeat < BidiIterator > ( c , r , last_position , state_id ) ;
  80082. m_backup_state = pmp ;
  80083. }
  80084.  
  80085. template < class BidiIterator , class Allocator , class traits >
  80086. inline void perl_matcher < BidiIterator , Allocator , traits > :: push_recursion ( int idx , const re_syntax_base * p , results_type
  80087. #332
  80088. * presults )
  80089. {
  80090. saved_recursion < results_type > * pmp = static_cast < saved_recursion < results_type > * > ( m_backup_state ) ;
  80091. -- pmp ;
  80092. if ( pmp < m_stack_base )
  80093. {
  80094. extend_stack ( ) ;
  80095. pmp = static_cast < saved_recursion < results_type > * > ( m_backup_state ) ;
  80096. -- pmp ;
  80097. }
  80098. ( void ) new ( pmp ) saved_recursion < results_type > ( idx , p , presults ) ;
  80099. m_backup_state = pmp ;
  80100. }
  80101.  
  80102. template < class BidiIterator , class Allocator , class traits >
  80103. bool perl_matcher < BidiIterator , Allocator , traits > :: match_startmark ( )
  80104. {
  80105. int index = static_cast < const re_brace * > ( pstate ) -> index ;
  80106. icase = static_cast < const re_brace * > ( pstate ) -> icase ;
  80107. switch ( index )
  80108. {
  80109. case 0 :
  80110. pstate = pstate -> next . p ;
  80111. break ;
  80112. case - 1 :
  80113. case - 2 :
  80114. {
  80115.  
  80116. const re_syntax_base * next_pstate = static_cast < const re_jump * > ( pstate -> next . p ) -> alt . p -> next . p ;
  80117. pstate = pstate -> next . p -> next . p ;
  80118. push_assertion ( next_pstate , index == - 1 ) ;
  80119. break ;
  80120. }
  80121. case - 3 :
  80122. {
  80123.  
  80124. bool old_independent = m_independent ;
  80125. m_independent = true ;
  80126. const re_syntax_base * next_pstate = static_cast < const re_jump * > ( pstate -> next . p ) -> alt . p -> next . p ;
  80127. pstate = pstate -> next . p -> next . p ;
  80128. bool r = match_all_states ( ) ;
  80129. pstate = next_pstate ;
  80130. m_independent = old_independent ;
  80131. #402
  80132. return r ;
  80133. }
  80134. case - 4 :
  80135. {
  80136.  
  80137. const re_alt * alt = static_cast < const re_alt * > ( pstate -> next . p ) ;
  80138. ( ( void ) 0 ) ;
  80139. pstate = alt -> next . p ;
  80140. if ( pstate -> type == syntax_element_assert_backref )
  80141. {
  80142. if ( ! match_assert_backref ( ) )
  80143. pstate = alt -> alt . p ;
  80144. break ;
  80145. }
  80146. else
  80147. {
  80148.  
  80149. ( ( void ) 0 ) ;
  80150. bool negated = static_cast < const re_brace * > ( pstate ) -> index == - 2 ;
  80151. BidiIterator saved_position = position ;
  80152. const re_syntax_base * next_pstate = static_cast < const re_jump * > ( pstate -> next . p ) -> alt . p -> next . p ;
  80153. pstate = pstate -> next . p -> next . p ;
  80154. bool r = match_all_states ( ) ;
  80155. position = saved_position ;
  80156. if ( negated )
  80157. r = ! r ;
  80158. if ( r )
  80159. pstate = next_pstate ;
  80160. else
  80161. pstate = alt -> alt . p ;
  80162. break ;
  80163. }
  80164. }
  80165. case - 5 :
  80166. {
  80167. push_matched_paren ( 0 , ( * m_presult ) [ 0 ] ) ;
  80168. m_presult -> set_first ( position , 0 , true ) ;
  80169. pstate = pstate -> next . p ;
  80170. break ;
  80171. }
  80172. default :
  80173. {
  80174. ( ( void ) 0 ) ;
  80175. if ( ( m_match_flags & match_nosubs ) == 0 )
  80176. {
  80177. push_matched_paren ( index , ( * m_presult ) [ index ] ) ;
  80178. m_presult -> set_first ( position , index ) ;
  80179. }
  80180. pstate = pstate -> next . p ;
  80181. break ;
  80182. }
  80183. }
  80184. return true ;
  80185. }
  80186.  
  80187. template < class BidiIterator , class Allocator , class traits >
  80188. bool perl_matcher < BidiIterator , Allocator , traits > :: match_alt ( )
  80189. {
  80190. bool take_first , take_second ;
  80191. const re_alt * jmp = static_cast < const re_alt * > ( pstate ) ;
  80192.  
  80193.  
  80194. if ( position == last )
  80195. {
  80196. take_first = jmp -> can_be_null & mask_take ;
  80197. take_second = jmp -> can_be_null & mask_skip ;
  80198. }
  80199. else
  80200. {
  80201. take_first = can_start ( * position , jmp -> _map , ( unsigned char ) mask_take ) ;
  80202. take_second = can_start ( * position , jmp -> _map , ( unsigned char ) mask_skip ) ;
  80203. }
  80204.  
  80205. if ( take_first )
  80206. {
  80207.  
  80208.  
  80209. if ( take_second )
  80210. {
  80211. push_alt ( jmp -> alt . p ) ;
  80212. }
  80213. pstate = pstate -> next . p ;
  80214. return true ;
  80215. }
  80216. if ( take_second )
  80217. {
  80218. pstate = jmp -> alt . p ;
  80219. return true ;
  80220. }
  80221. return false ;
  80222. }
  80223.  
  80224. template < class BidiIterator , class Allocator , class traits >
  80225. bool perl_matcher < BidiIterator , Allocator , traits > :: match_rep ( )
  80226. {
  80227. #504
  80228. const re_repeat * rep = static_cast < const re_repeat * > ( pstate ) ;
  80229.  
  80230.  
  80231. bool take_first , take_second ;
  80232. if ( position == last )
  80233. {
  80234. take_first = rep -> can_be_null & mask_take ;
  80235. take_second = rep -> can_be_null & mask_skip ;
  80236. }
  80237. else
  80238. {
  80239. take_first = can_start ( * position , rep -> _map , ( unsigned char ) mask_take ) ;
  80240. take_second = can_start ( * position , rep -> _map , ( unsigned char ) mask_skip ) ;
  80241. }
  80242.  
  80243. if ( ( m_backup_state -> state_id != saved_state_repeater_count )
  80244. || ( static_cast < saved_repeater < BidiIterator > * > ( m_backup_state ) -> count . get_id ( ) != rep -> state_id )
  80245. || ( next_count -> get_id ( ) != rep -> state_id ) )
  80246. {
  80247.  
  80248.  
  80249. push_repeater_count ( rep -> state_id , & next_count ) ;
  80250. }
  80251.  
  80252.  
  80253.  
  80254.  
  80255.  
  80256. next_count -> check_null_repeat ( position , rep -> max ) ;
  80257.  
  80258. if ( next_count -> get_count ( ) < rep -> min )
  80259. {
  80260.  
  80261. if ( take_first )
  80262. {
  80263.  
  80264. ++ ( * next_count ) ;
  80265. pstate = rep -> next . p ;
  80266. return true ;
  80267. }
  80268. return false ;
  80269. }
  80270.  
  80271. bool greedy = ( rep -> greedy ) && ( ! ( m_match_flags & regex_constants :: match_any ) || m_independent ) ;
  80272. if ( greedy )
  80273. {
  80274.  
  80275. if ( ( next_count -> get_count ( ) < rep -> max ) && take_first )
  80276. {
  80277. if ( take_second )
  80278. {
  80279.  
  80280. push_alt ( rep -> alt . p ) ;
  80281. }
  80282.  
  80283. ++ ( * next_count ) ;
  80284. pstate = rep -> next . p ;
  80285. return true ;
  80286. }
  80287. else if ( take_second )
  80288. {
  80289. pstate = rep -> alt . p ;
  80290. return true ;
  80291. }
  80292. return false ;
  80293. }
  80294. else
  80295. {
  80296.  
  80297. if ( take_second )
  80298. {
  80299. if ( ( next_count -> get_count ( ) < rep -> max ) && take_first )
  80300. {
  80301.  
  80302. push_non_greedy_repeat ( rep -> next . p ) ;
  80303. }
  80304. pstate = rep -> alt . p ;
  80305. return true ;
  80306. }
  80307. if ( ( next_count -> get_count ( ) < rep -> max ) && take_first )
  80308. {
  80309.  
  80310. ++ ( * next_count ) ;
  80311. pstate = rep -> next . p ;
  80312. return true ;
  80313. }
  80314. }
  80315. return false ;
  80316. #598
  80317. }
  80318.  
  80319. template < class BidiIterator , class Allocator , class traits >
  80320. bool perl_matcher < BidiIterator , Allocator , traits > :: match_dot_repeat_slow ( )
  80321. {
  80322. unsigned count = 0 ;
  80323. const re_repeat * rep = static_cast < const re_repeat * > ( pstate ) ;
  80324. re_syntax_base * psingle = rep -> next . p ;
  80325.  
  80326. while ( count < rep -> min )
  80327. {
  80328. pstate = psingle ;
  80329. if ( ! match_wild ( ) )
  80330. return false ;
  80331. ++ count ;
  80332. }
  80333. bool greedy = ( rep -> greedy ) && ( ! ( m_match_flags & regex_constants :: match_any ) || m_independent ) ;
  80334. if ( greedy )
  80335. {
  80336.  
  80337. while ( count < rep -> max )
  80338. {
  80339. pstate = psingle ;
  80340. if ( ! match_wild ( ) )
  80341. break ;
  80342. ++ count ;
  80343. }
  80344.  
  80345. if ( ( rep -> leading ) && ( count < rep -> max ) )
  80346. restart = position ;
  80347.  
  80348. if ( count - rep -> min )
  80349. push_single_repeat ( count , rep , position , saved_state_greedy_single_repeat ) ;
  80350.  
  80351. pstate = rep -> alt . p ;
  80352. return true ;
  80353. }
  80354. else
  80355. {
  80356.  
  80357. if ( count < rep -> max )
  80358. push_single_repeat ( count , rep , position , saved_state_rep_slow_dot ) ;
  80359. pstate = rep -> alt . p ;
  80360. return ( position == last ) ? ( rep -> can_be_null & mask_skip ) : can_start ( * position , rep -> _map , mask_skip ) ;
  80361. }
  80362. }
  80363.  
  80364. template < class BidiIterator , class Allocator , class traits >
  80365. bool perl_matcher < BidiIterator , Allocator , traits > :: match_dot_repeat_fast ( )
  80366. {
  80367. if ( m_match_flags & match_not_dot_null )
  80368. return match_dot_repeat_slow ( ) ;
  80369. if ( ( static_cast < const re_dot * > ( pstate -> next . p ) -> mask & match_any_mask ) == 0 )
  80370. return match_dot_repeat_slow ( ) ;
  80371.  
  80372. const re_repeat * rep = static_cast < const re_repeat * > ( pstate ) ;
  80373. bool greedy = ( rep -> greedy ) && ( ! ( m_match_flags & regex_constants :: match_any ) || m_independent ) ;
  80374. unsigned count = static_cast < unsigned > ( ( std :: min ) ( static_cast < unsigned > ( :: boost :: re_detail :: distance
  80375. #655
  80376. ( position , last ) ) , static_cast < unsigned > ( greedy ? rep -> max : rep -> min ) ) ) ;
  80377. if ( rep -> min > count )
  80378. {
  80379. position = last ;
  80380. return false ;
  80381. }
  80382. std :: advance ( position , count ) ;
  80383.  
  80384. if ( greedy )
  80385. {
  80386. if ( ( rep -> leading ) && ( count < rep -> max ) )
  80387. restart = position ;
  80388.  
  80389. if ( count - rep -> min )
  80390. push_single_repeat ( count , rep , position , saved_state_greedy_single_repeat ) ;
  80391.  
  80392. pstate = rep -> alt . p ;
  80393. return true ;
  80394. }
  80395. else
  80396. {
  80397.  
  80398. if ( count < rep -> max )
  80399. push_single_repeat ( count , rep , position , saved_state_rep_fast_dot ) ;
  80400. pstate = rep -> alt . p ;
  80401. return ( position == last ) ? ( rep -> can_be_null & mask_skip ) : can_start ( * position , rep -> _map , mask_skip ) ;
  80402. }
  80403. }
  80404.  
  80405. template < class BidiIterator , class Allocator , class traits >
  80406. bool perl_matcher < BidiIterator , Allocator , traits > :: match_char_repeat ( )
  80407. {
  80408. #694
  80409. const re_repeat * rep = static_cast < const re_repeat * > ( pstate ) ;
  80410. ( ( void ) 0 ) ;
  80411. const char_type what = * reinterpret_cast < const char_type * > ( static_cast < const re_literal * > ( rep -> next . p )
  80412. #696
  80413. + 1 ) ;
  80414. std :: size_t count = 0 ;
  80415.  
  80416.  
  80417.  
  80418. bool greedy = ( rep -> greedy ) && ( ! ( m_match_flags & regex_constants :: match_any ) || m_independent ) ;
  80419. std :: size_t desired = greedy ? rep -> max : rep -> min ;
  80420. if ( :: boost :: is_random_access_iterator < BidiIterator > :: value )
  80421. {
  80422. BidiIterator end = position ;
  80423. std :: advance ( end , ( std :: min ) ( ( std :: size_t ) :: boost :: re_detail :: distance ( position , last ) , desired
  80424. #706
  80425. ) ) ;
  80426. BidiIterator origin ( position ) ;
  80427. while ( ( position != end ) && ( traits_inst . translate ( * position , icase ) == what ) )
  80428. {
  80429. ++ position ;
  80430. }
  80431. count = ( unsigned ) :: boost :: re_detail :: distance ( origin , position ) ;
  80432. }
  80433. else
  80434. {
  80435. while ( ( count < desired ) && ( position != last ) && ( traits_inst . translate ( * position , icase ) == what ) )
  80436. {
  80437. ++ position ;
  80438. ++ count ;
  80439. }
  80440. }
  80441.  
  80442. if ( count < rep -> min )
  80443. return false ;
  80444.  
  80445. if ( greedy )
  80446. {
  80447. if ( ( rep -> leading ) && ( count < rep -> max ) )
  80448. restart = position ;
  80449.  
  80450. if ( count - rep -> min )
  80451. push_single_repeat ( count , rep , position , saved_state_greedy_single_repeat ) ;
  80452.  
  80453. pstate = rep -> alt . p ;
  80454. return true ;
  80455. }
  80456. else
  80457. {
  80458.  
  80459. if ( count < rep -> max )
  80460. push_single_repeat ( count , rep , position , saved_state_rep_char ) ;
  80461. pstate = rep -> alt . p ;
  80462. return ( position == last ) ? ( rep -> can_be_null & mask_skip ) : can_start ( * position , rep -> _map , mask_skip ) ;
  80463. }
  80464. #751
  80465. }
  80466.  
  80467. template < class BidiIterator , class Allocator , class traits >
  80468. bool perl_matcher < BidiIterator , Allocator , traits > :: match_set_repeat ( )
  80469. {
  80470. #763
  80471. const re_repeat * rep = static_cast < const re_repeat * > ( pstate ) ;
  80472. const unsigned char * map = static_cast < const re_set * > ( rep -> next . p ) -> _map ;
  80473. std :: size_t count = 0 ;
  80474.  
  80475.  
  80476.  
  80477. bool greedy = ( rep -> greedy ) && ( ! ( m_match_flags & regex_constants :: match_any ) || m_independent ) ;
  80478. std :: size_t desired = greedy ? rep -> max : rep -> min ;
  80479. if ( :: boost :: is_random_access_iterator < BidiIterator > :: value )
  80480. {
  80481. BidiIterator end = position ;
  80482. std :: advance ( end , ( std :: min ) ( ( std :: size_t ) :: boost :: re_detail :: distance ( position , last ) , desired
  80483. #774
  80484. ) ) ;
  80485. BidiIterator origin ( position ) ;
  80486. while ( ( position != end ) && map [ static_cast < unsigned char > ( traits_inst . translate ( * position , icase ) ) ] )
  80487. #776
  80488.  
  80489. {
  80490. ++ position ;
  80491. }
  80492. count = ( unsigned ) :: boost :: re_detail :: distance ( origin , position ) ;
  80493. }
  80494. else
  80495. {
  80496. while ( ( count < desired ) && ( position != last ) && map [ static_cast < unsigned char > ( traits_inst . translate ( *
  80497. #784
  80498. position , icase ) ) ] )
  80499. {
  80500. ++ position ;
  80501. ++ count ;
  80502. }
  80503. }
  80504.  
  80505. if ( count < rep -> min )
  80506. return false ;
  80507.  
  80508. if ( greedy )
  80509. {
  80510. if ( ( rep -> leading ) && ( count < rep -> max ) )
  80511. restart = position ;
  80512.  
  80513. if ( count - rep -> min )
  80514. push_single_repeat ( count , rep , position , saved_state_greedy_single_repeat ) ;
  80515.  
  80516. pstate = rep -> alt . p ;
  80517. return true ;
  80518. }
  80519. else
  80520. {
  80521.  
  80522. if ( count < rep -> max )
  80523. push_single_repeat ( count , rep , position , saved_state_rep_short_set ) ;
  80524. pstate = rep -> alt . p ;
  80525. return ( position == last ) ? ( rep -> can_be_null & mask_skip ) : can_start ( * position , rep -> _map , mask_skip ) ;
  80526. }
  80527. #819
  80528. }
  80529.  
  80530. template < class BidiIterator , class Allocator , class traits >
  80531. bool perl_matcher < BidiIterator , Allocator , traits > :: match_long_set_repeat ( )
  80532. {
  80533. #831
  80534. typedef typename traits :: char_class_type m_type ;
  80535. const re_repeat * rep = static_cast < const re_repeat * > ( pstate ) ;
  80536. const re_set_long < m_type > * set = static_cast < const re_set_long < m_type > * > ( pstate -> next . p ) ;
  80537. std :: size_t count = 0 ;
  80538.  
  80539.  
  80540.  
  80541. bool greedy = ( rep -> greedy ) && ( ! ( m_match_flags & regex_constants :: match_any ) || m_independent ) ;
  80542. std :: size_t desired = greedy ? rep -> max : rep -> min ;
  80543. if ( :: boost :: is_random_access_iterator < BidiIterator > :: value )
  80544. {
  80545. BidiIterator end = position ;
  80546. std :: advance ( end , ( std :: min ) ( ( std :: size_t ) :: boost :: re_detail :: distance ( position , last ) , desired
  80547. #843
  80548. ) ) ;
  80549. BidiIterator origin ( position ) ;
  80550. while ( ( position != end ) && ( position != re_is_set_member ( position , last , set , re . get_data ( ) , icase ) ) )
  80551. {
  80552. ++ position ;
  80553. }
  80554. count = ( unsigned ) :: boost :: re_detail :: distance ( origin , position ) ;
  80555. }
  80556. else
  80557. {
  80558. while ( ( count < desired ) && ( position != last ) && ( position != re_is_set_member ( position , last , set , re . get_data
  80559. #853
  80560. ( ) , icase ) ) )
  80561. {
  80562. ++ position ;
  80563. ++ count ;
  80564. }
  80565. }
  80566.  
  80567. if ( count < rep -> min )
  80568. return false ;
  80569.  
  80570. if ( greedy )
  80571. {
  80572. if ( ( rep -> leading ) && ( count < rep -> max ) )
  80573. restart = position ;
  80574.  
  80575. if ( count - rep -> min )
  80576. push_single_repeat ( count , rep , position , saved_state_greedy_single_repeat ) ;
  80577.  
  80578. pstate = rep -> alt . p ;
  80579. return true ;
  80580. }
  80581. else
  80582. {
  80583.  
  80584. if ( count < rep -> max )
  80585. push_single_repeat ( count , rep , position , saved_state_rep_long_set ) ;
  80586. pstate = rep -> alt . p ;
  80587. return ( position == last ) ? ( rep -> can_be_null & mask_skip ) : can_start ( * position , rep -> _map , mask_skip ) ;
  80588. }
  80589. #888
  80590. }
  80591.  
  80592. template < class BidiIterator , class Allocator , class traits >
  80593. bool perl_matcher < BidiIterator , Allocator , traits > :: match_recursion ( )
  80594. {
  80595. ( ( void ) 0 ) ;
  80596.  
  80597.  
  80598.  
  80599. push_recursion_pop ( ) ;
  80600.  
  80601.  
  80602.  
  80603. if ( recursion_stack . capacity ( ) == 0 )
  80604. {
  80605. recursion_stack . reserve ( 50 ) ;
  80606. }
  80607. recursion_stack . push_back ( recursion_info < results_type > ( ) ) ;
  80608. recursion_stack . back ( ) . preturn_address = pstate -> next . p ;
  80609. recursion_stack . back ( ) . results = * m_presult ;
  80610. if ( static_cast < const re_recurse * > ( pstate ) -> state_id > 0 )
  80611. {
  80612. push_repeater_count ( static_cast < const re_recurse * > ( pstate ) -> state_id , & next_count ) ;
  80613. }
  80614. pstate = static_cast < const re_jump * > ( pstate ) -> alt . p ;
  80615. recursion_stack . back ( ) . idx = static_cast < const re_brace * > ( pstate ) -> index ;
  80616.  
  80617. return true ;
  80618. }
  80619.  
  80620. template < class BidiIterator , class Allocator , class traits >
  80621. bool perl_matcher < BidiIterator , Allocator , traits > :: match_endmark ( )
  80622. {
  80623. int index = static_cast < const re_brace * > ( pstate ) -> index ;
  80624. icase = static_cast < const re_brace * > ( pstate ) -> icase ;
  80625. if ( index > 0 )
  80626. {
  80627. if ( ( m_match_flags & match_nosubs ) == 0 )
  80628. {
  80629. m_presult -> set_second ( position , index ) ;
  80630. }
  80631. if ( ! recursion_stack . empty ( ) )
  80632. {
  80633. if ( index == recursion_stack . back ( ) . idx )
  80634. {
  80635. pstate = recursion_stack . back ( ) . preturn_address ;
  80636. * m_presult = recursion_stack . back ( ) . results ;
  80637. push_recursion ( recursion_stack . back ( ) . idx , recursion_stack . back ( ) . preturn_address , & recursion_stack . back
  80638. #935
  80639. ( ) . results ) ;
  80640. recursion_stack . pop_back ( ) ;
  80641. }
  80642. }
  80643. }
  80644. else if ( ( index < 0 ) && ( index != - 4 ) )
  80645. {
  80646.  
  80647. pstate = 0 ;
  80648. return true ;
  80649. }
  80650. pstate = pstate -> next . p ;
  80651. return true ;
  80652. }
  80653.  
  80654. template < class BidiIterator , class Allocator , class traits >
  80655. bool perl_matcher < BidiIterator , Allocator , traits > :: match_match ( )
  80656. {
  80657. if ( ! recursion_stack . empty ( ) )
  80658. {
  80659. ( ( void ) 0 ) ;
  80660. pstate = recursion_stack . back ( ) . preturn_address ;
  80661. * m_presult = recursion_stack . back ( ) . results ;
  80662. push_recursion ( recursion_stack . back ( ) . idx , recursion_stack . back ( ) . preturn_address , & recursion_stack . back
  80663. #958
  80664. ( ) . results ) ;
  80665. recursion_stack . pop_back ( ) ;
  80666. return true ;
  80667. }
  80668. if ( ( m_match_flags & match_not_null ) && ( position == ( * m_presult ) [ 0 ] . first ) )
  80669. return false ;
  80670. if ( ( m_match_flags & match_all ) && ( position != last ) )
  80671. return false ;
  80672. if ( ( m_match_flags & regex_constants :: match_not_initial_null ) && ( position == search_base ) )
  80673. return false ;
  80674. m_presult -> set_second ( position ) ;
  80675. pstate = 0 ;
  80676. m_has_found_match = true ;
  80677. if ( ( m_match_flags & match_posix ) == match_posix )
  80678. {
  80679. m_result . maybe_assign ( * m_presult ) ;
  80680. if ( ( m_match_flags & match_any ) == 0 )
  80681. return false ;
  80682. }
  80683. #985
  80684. return true ;
  80685. }
  80686. #995
  80687. template < class BidiIterator , class Allocator , class traits >
  80688. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind ( bool have_match )
  80689. {
  80690. static unwind_proc_type const s_unwind_table [ 18 ] =
  80691. {
  80692. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_end ,
  80693. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_paren ,
  80694. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_recursion_stopper ,
  80695. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_assertion ,
  80696. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_alt ,
  80697. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_repeater_counter ,
  80698. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_extra_block ,
  80699. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_greedy_single_repeat ,
  80700. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_slow_dot_repeat ,
  80701. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_fast_dot_repeat ,
  80702. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_char_repeat ,
  80703. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_short_set_repeat ,
  80704. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_long_set_repeat ,
  80705. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_non_greedy_repeat ,
  80706. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_recursion ,
  80707. & perl_matcher < BidiIterator , Allocator , traits > :: unwind_recursion_pop ,
  80708. } ;
  80709.  
  80710. m_recursive_result = have_match ;
  80711. unwind_proc_type unwinder ;
  80712. bool cont ;
  80713.  
  80714.  
  80715.  
  80716. do
  80717. {
  80718. unwinder = s_unwind_table [ m_backup_state -> state_id ] ;
  80719. cont = ( this ->* unwinder ) ( m_recursive_result ) ;
  80720. } while ( cont ) ;
  80721.  
  80722.  
  80723.  
  80724. return pstate ? true : false ;
  80725. }
  80726.  
  80727. template < class BidiIterator , class Allocator , class traits >
  80728. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_end ( bool )
  80729. {
  80730. pstate = 0 ;
  80731. return false ;
  80732. }
  80733.  
  80734. template < class BidiIterator , class Allocator , class traits >
  80735. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_paren ( bool have_match )
  80736. {
  80737. saved_matched_paren < BidiIterator > * pmp = static_cast < saved_matched_paren < BidiIterator > * > ( m_backup_state ) ;
  80738. #1045
  80739.  
  80740.  
  80741. if ( have_match == false )
  80742. {
  80743. m_presult -> set_first ( pmp -> sub . first , pmp -> index , pmp -> index == 0 ) ;
  80744. m_presult -> set_second ( pmp -> sub . second , pmp -> index , pmp -> sub . matched , pmp -> index == 0 ) ;
  80745. }
  80746. #1060
  80747. m_backup_state = pmp + 1 ;
  80748. boost :: re_detail :: inplace_destroy ( pmp ) ;
  80749. return true ;
  80750. }
  80751.  
  80752. template < class BidiIterator , class Allocator , class traits >
  80753. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_recursion_stopper ( bool )
  80754. {
  80755. boost :: re_detail :: inplace_destroy ( m_backup_state ++ ) ;
  80756. pstate = 0 ;
  80757. return false ;
  80758. }
  80759.  
  80760. template < class BidiIterator , class Allocator , class traits >
  80761. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_assertion ( bool r )
  80762. {
  80763. saved_assertion < BidiIterator > * pmp = static_cast < saved_assertion < BidiIterator > * > ( m_backup_state ) ;
  80764. pstate = pmp -> pstate ;
  80765. position = pmp -> position ;
  80766. bool result = ( r == pmp -> positive ) ;
  80767. m_recursive_result = pmp -> positive ? r : ! r ;
  80768. boost :: re_detail :: inplace_destroy ( pmp ++ ) ;
  80769. m_backup_state = pmp ;
  80770. return ! result ;
  80771. }
  80772.  
  80773. template < class BidiIterator , class Allocator , class traits >
  80774. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_alt ( bool r )
  80775. {
  80776. saved_position < BidiIterator > * pmp = static_cast < saved_position < BidiIterator > * > ( m_backup_state ) ;
  80777. if ( ! r )
  80778. {
  80779. pstate = pmp -> pstate ;
  80780. position = pmp -> position ;
  80781. }
  80782. boost :: re_detail :: inplace_destroy ( pmp ++ ) ;
  80783. m_backup_state = pmp ;
  80784. return r ;
  80785. }
  80786.  
  80787. template < class BidiIterator , class Allocator , class traits >
  80788. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_repeater_counter ( bool )
  80789. {
  80790. saved_repeater < BidiIterator > * pmp = static_cast < saved_repeater < BidiIterator > * > ( m_backup_state ) ;
  80791. boost :: re_detail :: inplace_destroy ( pmp ++ ) ;
  80792. m_backup_state = pmp ;
  80793. return true ;
  80794. }
  80795.  
  80796. template < class BidiIterator , class Allocator , class traits >
  80797. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_extra_block ( bool )
  80798. {
  80799. saved_extra_block * pmp = static_cast < saved_extra_block * > ( m_backup_state ) ;
  80800. void * condemmed = m_stack_base ;
  80801. m_stack_base = pmp -> base ;
  80802. m_backup_state = pmp -> end ;
  80803. boost :: re_detail :: inplace_destroy ( pmp ) ;
  80804. put_mem_block ( condemmed ) ;
  80805. return true ;
  80806. }
  80807.  
  80808. template < class BidiIterator , class Allocator , class traits >
  80809. inline void perl_matcher < BidiIterator , Allocator , traits > :: destroy_single_repeat ( )
  80810. {
  80811. saved_single_repeat < BidiIterator > * p = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80812. boost :: re_detail :: inplace_destroy ( p ++ ) ;
  80813. m_backup_state = p ;
  80814. }
  80815.  
  80816. template < class BidiIterator , class Allocator , class traits >
  80817. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_greedy_single_repeat ( bool r )
  80818. {
  80819. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80820. #1132
  80821.  
  80822.  
  80823.  
  80824. if ( r )
  80825. {
  80826. destroy_single_repeat ( ) ;
  80827. return true ;
  80828. }
  80829.  
  80830. const re_repeat * rep = pmp -> rep ;
  80831. std :: size_t count = pmp -> count ;
  80832. ( ( void ) 0 ) ;
  80833. ( ( void ) 0 ) ;
  80834.  
  80835. count -= rep -> min ;
  80836.  
  80837. if ( ( m_match_flags & match_partial ) && ( position == last ) )
  80838. m_has_partial_match = true ;
  80839.  
  80840. ( ( void ) 0 ) ;
  80841. position = pmp -> last_position ;
  80842.  
  80843.  
  80844. do
  80845. {
  80846. -- position ;
  80847. -- count ;
  80848. ++ state_count ;
  80849. } while ( count && ! can_start ( * position , rep -> _map , mask_skip ) ) ;
  80850.  
  80851.  
  80852. if ( count == 0 )
  80853. {
  80854. destroy_single_repeat ( ) ;
  80855. if ( ! can_start ( * position , rep -> _map , mask_skip ) )
  80856. return true ;
  80857. }
  80858. else
  80859. {
  80860. pmp -> count = count + rep -> min ;
  80861. pmp -> last_position = position ;
  80862. }
  80863. pstate = rep -> alt . p ;
  80864. return false ;
  80865. }
  80866.  
  80867. template < class BidiIterator , class Allocator , class traits >
  80868. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_slow_dot_repeat ( bool r )
  80869. {
  80870. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80871. #1181
  80872.  
  80873.  
  80874.  
  80875. if ( r )
  80876. {
  80877. destroy_single_repeat ( ) ;
  80878. return true ;
  80879. }
  80880.  
  80881. const re_repeat * rep = pmp -> rep ;
  80882. std :: size_t count = pmp -> count ;
  80883. ( ( void ) 0 ) ;
  80884. ( ( void ) 0 ) ;
  80885. ( ( void ) 0 ) ;
  80886. ( ( void ) 0 ) ;
  80887.  
  80888. ( ( void ) 0 ) ;
  80889. pstate = rep -> next . p ;
  80890. position = pmp -> last_position ;
  80891.  
  80892. if ( position != last )
  80893. {
  80894.  
  80895. do
  80896. {
  80897. if ( ! match_wild ( ) )
  80898. {
  80899.  
  80900. destroy_single_repeat ( ) ;
  80901. return true ;
  80902. }
  80903. ++ count ;
  80904. ++ state_count ;
  80905. pstate = rep -> next . p ;
  80906. } while ( ( count < rep -> max ) && ( position != last ) && ! can_start ( * position , rep -> _map , mask_skip ) ) ;
  80907. }
  80908. if ( position == last )
  80909. {
  80910.  
  80911. destroy_single_repeat ( ) ;
  80912. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  80913. m_has_partial_match = true ;
  80914. if ( 0 == ( rep -> can_be_null & mask_skip ) )
  80915. return true ;
  80916. }
  80917. else if ( count == rep -> max )
  80918. {
  80919.  
  80920. destroy_single_repeat ( ) ;
  80921. if ( ! can_start ( * position , rep -> _map , mask_skip ) )
  80922. return true ;
  80923. }
  80924. else
  80925. {
  80926. pmp -> count = count ;
  80927. pmp -> last_position = position ;
  80928. }
  80929. pstate = rep -> alt . p ;
  80930. return false ;
  80931. }
  80932.  
  80933. template < class BidiIterator , class Allocator , class traits >
  80934. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_fast_dot_repeat ( bool r )
  80935. {
  80936. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80937. #1245
  80938.  
  80939.  
  80940.  
  80941. if ( r )
  80942. {
  80943. destroy_single_repeat ( ) ;
  80944. return true ;
  80945. }
  80946.  
  80947. const re_repeat * rep = pmp -> rep ;
  80948. std :: size_t count = pmp -> count ;
  80949.  
  80950. ( ( void ) 0 ) ;
  80951. position = pmp -> last_position ;
  80952. if ( position != last )
  80953. {
  80954.  
  80955.  
  80956. do
  80957. {
  80958. ++ position ;
  80959. ++ count ;
  80960. ++ state_count ;
  80961. } while ( ( count < rep -> max ) && ( position != last ) && ! can_start ( * position , rep -> _map , mask_skip ) ) ;
  80962. }
  80963.  
  80964.  
  80965. if ( ( rep -> leading ) && ( count < rep -> max ) )
  80966. restart = position ;
  80967. if ( position == last )
  80968. {
  80969.  
  80970. destroy_single_repeat ( ) ;
  80971. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  80972. m_has_partial_match = true ;
  80973. if ( 0 == ( rep -> can_be_null & mask_skip ) )
  80974. return true ;
  80975. }
  80976. else if ( count == rep -> max )
  80977. {
  80978.  
  80979. destroy_single_repeat ( ) ;
  80980. if ( ! can_start ( * position , rep -> _map , mask_skip ) )
  80981. return true ;
  80982. }
  80983. else
  80984. {
  80985. pmp -> count = count ;
  80986. pmp -> last_position = position ;
  80987. }
  80988. pstate = rep -> alt . p ;
  80989. return false ;
  80990. }
  80991.  
  80992. template < class BidiIterator , class Allocator , class traits >
  80993. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_char_repeat ( bool r )
  80994. {
  80995. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  80996. #1302
  80997.  
  80998.  
  80999.  
  81000. if ( r )
  81001. {
  81002. destroy_single_repeat ( ) ;
  81003. return true ;
  81004. }
  81005.  
  81006. const re_repeat * rep = pmp -> rep ;
  81007. std :: size_t count = pmp -> count ;
  81008. pstate = rep -> next . p ;
  81009. const char_type what = * reinterpret_cast < const char_type * > ( static_cast < const re_literal * > ( pstate ) + 1 ) ;
  81010. position = pmp -> last_position ;
  81011.  
  81012. ( ( void ) 0 ) ;
  81013. ( ( void ) 0 ) ;
  81014. ( ( void ) 0 ) ;
  81015. ( ( void ) 0 ) ;
  81016. ( ( void ) 0 ) ;
  81017.  
  81018. if ( position != last )
  81019. {
  81020.  
  81021. do
  81022. {
  81023. if ( traits_inst . translate ( * position , icase ) != what )
  81024. {
  81025.  
  81026. destroy_single_repeat ( ) ;
  81027. return true ;
  81028. }
  81029. ++ count ;
  81030. ++ position ;
  81031. ++ state_count ;
  81032. pstate = rep -> next . p ;
  81033. } while ( ( count < rep -> max ) && ( position != last ) && ! can_start ( * position , rep -> _map , mask_skip ) ) ;
  81034. }
  81035.  
  81036. if ( ( rep -> leading ) && ( count < rep -> max ) )
  81037. restart = position ;
  81038. if ( position == last )
  81039. {
  81040.  
  81041. destroy_single_repeat ( ) ;
  81042. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  81043. m_has_partial_match = true ;
  81044. if ( 0 == ( rep -> can_be_null & mask_skip ) )
  81045. return true ;
  81046. }
  81047. else if ( count == rep -> max )
  81048. {
  81049.  
  81050. destroy_single_repeat ( ) ;
  81051. if ( ! can_start ( * position , rep -> _map , mask_skip ) )
  81052. return true ;
  81053. }
  81054. else
  81055. {
  81056. pmp -> count = count ;
  81057. pmp -> last_position = position ;
  81058. }
  81059. pstate = rep -> alt . p ;
  81060. return false ;
  81061. }
  81062.  
  81063. template < class BidiIterator , class Allocator , class traits >
  81064. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_short_set_repeat ( bool r )
  81065. {
  81066. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  81067. #1371
  81068.  
  81069.  
  81070.  
  81071. if ( r )
  81072. {
  81073. destroy_single_repeat ( ) ;
  81074. return true ;
  81075. }
  81076.  
  81077. const re_repeat * rep = pmp -> rep ;
  81078. std :: size_t count = pmp -> count ;
  81079. pstate = rep -> next . p ;
  81080. const unsigned char * map = static_cast < const re_set * > ( rep -> next . p ) -> _map ;
  81081. position = pmp -> last_position ;
  81082.  
  81083. ( ( void ) 0 ) ;
  81084. ( ( void ) 0 ) ;
  81085. ( ( void ) 0 ) ;
  81086. ( ( void ) 0 ) ;
  81087. ( ( void ) 0 ) ;
  81088.  
  81089. if ( position != last )
  81090. {
  81091.  
  81092. do
  81093. {
  81094. if ( ! map [ static_cast < unsigned char > ( traits_inst . translate ( * position , icase ) ) ] )
  81095. {
  81096.  
  81097. destroy_single_repeat ( ) ;
  81098. return true ;
  81099. }
  81100. ++ count ;
  81101. ++ position ;
  81102. ++ state_count ;
  81103. pstate = rep -> next . p ;
  81104. } while ( ( count < rep -> max ) && ( position != last ) && ! can_start ( * position , rep -> _map , mask_skip ) ) ;
  81105. }
  81106.  
  81107. if ( ( rep -> leading ) && ( count < rep -> max ) )
  81108. restart = position ;
  81109. if ( position == last )
  81110. {
  81111.  
  81112. destroy_single_repeat ( ) ;
  81113. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  81114. m_has_partial_match = true ;
  81115. if ( 0 == ( rep -> can_be_null & mask_skip ) )
  81116. return true ;
  81117. }
  81118. else if ( count == rep -> max )
  81119. {
  81120.  
  81121. destroy_single_repeat ( ) ;
  81122. if ( ! can_start ( * position , rep -> _map , mask_skip ) )
  81123. return true ;
  81124. }
  81125. else
  81126. {
  81127. pmp -> count = count ;
  81128. pmp -> last_position = position ;
  81129. }
  81130. pstate = rep -> alt . p ;
  81131. return false ;
  81132. }
  81133.  
  81134. template < class BidiIterator , class Allocator , class traits >
  81135. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_long_set_repeat ( bool r )
  81136. {
  81137. typedef typename traits :: char_class_type m_type ;
  81138. saved_single_repeat < BidiIterator > * pmp = static_cast < saved_single_repeat < BidiIterator > * > ( m_backup_state ) ;
  81139. #1441
  81140.  
  81141.  
  81142.  
  81143. if ( r )
  81144. {
  81145. destroy_single_repeat ( ) ;
  81146. return true ;
  81147. }
  81148.  
  81149. const re_repeat * rep = pmp -> rep ;
  81150. std :: size_t count = pmp -> count ;
  81151. pstate = rep -> next . p ;
  81152. const re_set_long < m_type > * set = static_cast < const re_set_long < m_type > * > ( pstate ) ;
  81153. position = pmp -> last_position ;
  81154.  
  81155. ( ( void ) 0 ) ;
  81156. ( ( void ) 0 ) ;
  81157. ( ( void ) 0 ) ;
  81158. ( ( void ) 0 ) ;
  81159. ( ( void ) 0 ) ;
  81160.  
  81161. if ( position != last )
  81162. {
  81163.  
  81164. do
  81165. {
  81166. if ( position == re_is_set_member ( position , last , set , re . get_data ( ) , icase ) )
  81167. {
  81168.  
  81169. destroy_single_repeat ( ) ;
  81170. return true ;
  81171. }
  81172. ++ position ;
  81173. ++ count ;
  81174. ++ state_count ;
  81175. pstate = rep -> next . p ;
  81176. } while ( ( count < rep -> max ) && ( position != last ) && ! can_start ( * position , rep -> _map , mask_skip ) ) ;
  81177. }
  81178.  
  81179. if ( ( rep -> leading ) && ( count < rep -> max ) )
  81180. restart = position ;
  81181. if ( position == last )
  81182. {
  81183.  
  81184. destroy_single_repeat ( ) ;
  81185. if ( ( m_match_flags & match_partial ) && ( position == last ) && ( position != search_base ) )
  81186. m_has_partial_match = true ;
  81187. if ( 0 == ( rep -> can_be_null & mask_skip ) )
  81188. return true ;
  81189. }
  81190. else if ( count == rep -> max )
  81191. {
  81192.  
  81193. destroy_single_repeat ( ) ;
  81194. if ( ! can_start ( * position , rep -> _map , mask_skip ) )
  81195. return true ;
  81196. }
  81197. else
  81198. {
  81199. pmp -> count = count ;
  81200. pmp -> last_position = position ;
  81201. }
  81202. pstate = rep -> alt . p ;
  81203. return false ;
  81204. }
  81205.  
  81206. template < class BidiIterator , class Allocator , class traits >
  81207. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_non_greedy_repeat ( bool r )
  81208. {
  81209. saved_position < BidiIterator > * pmp = static_cast < saved_position < BidiIterator > * > ( m_backup_state ) ;
  81210. if ( ! r )
  81211. {
  81212. position = pmp -> position ;
  81213. pstate = pmp -> pstate ;
  81214. ++ ( * next_count ) ;
  81215. }
  81216. boost :: re_detail :: inplace_destroy ( pmp ++ ) ;
  81217. m_backup_state = pmp ;
  81218. return r ;
  81219. }
  81220.  
  81221. template < class BidiIterator , class Allocator , class traits >
  81222. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_recursion ( bool r )
  81223. {
  81224. saved_recursion < results_type > * pmp = static_cast < saved_recursion < results_type > * > ( m_backup_state ) ;
  81225. if ( ! r )
  81226. {
  81227. recursion_stack . push_back ( recursion_info < results_type > ( ) ) ;
  81228. recursion_stack . back ( ) . idx = pmp -> recursion_id ;
  81229. recursion_stack . back ( ) . preturn_address = pmp -> preturn_address ;
  81230. recursion_stack . back ( ) . results = pmp -> results ;
  81231. }
  81232. boost :: re_detail :: inplace_destroy ( pmp ++ ) ;
  81233. m_backup_state = pmp ;
  81234. return true ;
  81235. }
  81236.  
  81237. template < class BidiIterator , class Allocator , class traits >
  81238. bool perl_matcher < BidiIterator , Allocator , traits > :: unwind_recursion_pop ( bool r )
  81239. {
  81240. saved_state * pmp = static_cast < saved_state * > ( m_backup_state ) ;
  81241. if ( ! r )
  81242. {
  81243. recursion_stack . pop_back ( ) ;
  81244. }
  81245. boost :: re_detail :: inplace_destroy ( pmp ++ ) ;
  81246. m_backup_state = pmp ;
  81247. return true ;
  81248. }
  81249.  
  81250. template < class BidiIterator , class Allocator , class traits >
  81251. void perl_matcher < BidiIterator , Allocator , traits > :: push_recursion_pop ( )
  81252. {
  81253. saved_state * pmp = static_cast < saved_state * > ( m_backup_state ) ;
  81254. -- pmp ;
  81255. if ( pmp < m_stack_base )
  81256. {
  81257. extend_stack ( ) ;
  81258. pmp = static_cast < saved_state * > ( m_backup_state ) ;
  81259. -- pmp ;
  81260. }
  81261. ( void ) new ( pmp ) saved_state ( 15 ) ;
  81262. m_backup_state = pmp ;
  81263. }
  81264. #1622
  81265. }
  81266. }
  81267. #1 "./boost/regex/v4/perl_matcher_common.hpp"
  81268. #42
  81269. namespace boost {
  81270. namespace re_detail {
  81271.  
  81272. template < class BidiIterator , class Allocator , class traits >
  81273. void perl_matcher < BidiIterator , Allocator , traits > :: construct_init ( const basic_regex < char_type , traits > & e
  81274. #46
  81275. , match_flag_type f )
  81276. {
  81277. typedef typename regex_iterator_traits < BidiIterator > :: iterator_category category ;
  81278. typedef typename basic_regex < char_type , traits > :: flag_type expression_flag_type ;
  81279.  
  81280. if ( e . empty ( ) )
  81281. {
  81282.  
  81283. std :: invalid_argument ex ( "Invalid regular expression object" ) ;
  81284. boost :: throw_exception ( ex ) ;
  81285. }
  81286. pstate = 0 ;
  81287. m_match_flags = f ;
  81288. estimate_max_state_count ( static_cast < category * > ( 0 ) ) ;
  81289. expression_flag_type re_f = re . flags ( ) ;
  81290. icase = re_f & regex_constants :: icase ;
  81291. if ( ! ( m_match_flags & ( match_perl | match_posix ) ) )
  81292. {
  81293. if ( ( re_f & ( regbase :: main_option_type | regbase :: no_perl_ex ) ) == 0 )
  81294. m_match_flags |= match_perl ;
  81295. else if ( ( re_f & ( regbase :: main_option_type | regbase :: emacs_ex ) ) == ( regbase :: basic_syntax_group | regbase ::
  81296. #66
  81297. emacs_ex ) )
  81298. m_match_flags |= match_perl ;
  81299. else if ( ( re_f & ( regbase :: main_option_type | regbase :: literal ) ) == ( regbase :: literal ) )
  81300. m_match_flags |= match_perl ;
  81301. else
  81302. m_match_flags |= match_posix ;
  81303. }
  81304. if ( m_match_flags & match_posix )
  81305. {
  81306. m_temp_match . reset ( new match_results < BidiIterator , Allocator > ( ) ) ;
  81307. m_presult = m_temp_match . get ( ) ;
  81308. }
  81309. else
  81310. m_presult = & m_result ;
  81311.  
  81312. m_stack_base = 0 ;
  81313. m_backup_state = 0 ;
  81314.  
  81315.  
  81316. m_word_mask = re . get_data ( ) . m_word_mask ;
  81317.  
  81318. match_any_mask = static_cast < unsigned char > ( ( f & match_not_dot_newline ) ? re_detail :: test_not_newline : re_detail
  81319. #87
  81320. :: test_newline ) ;
  81321. }
  81322.  
  81323. template < class BidiIterator , class Allocator , class traits >
  81324. void perl_matcher < BidiIterator , Allocator , traits > :: estimate_max_state_count ( std :: random_access_iterator_tag *
  81325. #91
  81326. )
  81327. {
  81328. #103
  81329. static const std :: ptrdiff_t k = 100000 ;
  81330. std :: ptrdiff_t dist = boost :: re_detail :: distance ( base , last ) ;
  81331. if ( dist == 0 )
  81332. dist = 1 ;
  81333. std :: ptrdiff_t states = re . size ( ) ;
  81334. if ( states == 0 )
  81335. states = 1 ;
  81336. states *= states ;
  81337. if ( ( std :: numeric_limits < std :: ptrdiff_t > :: max ) ( ) / dist < states )
  81338. {
  81339. max_state_count = ( std :: min ) ( ( std :: ptrdiff_t ) 100000000 , ( std :: numeric_limits < std :: ptrdiff_t > :: max )
  81340. #113
  81341. ( ) - 2 ) ;
  81342. return ;
  81343. }
  81344. states *= dist ;
  81345. if ( ( std :: numeric_limits < std :: ptrdiff_t > :: max ) ( ) - k < states )
  81346. {
  81347. max_state_count = ( std :: min ) ( ( std :: ptrdiff_t ) 100000000 , ( std :: numeric_limits < std :: ptrdiff_t > :: max )
  81348. #119
  81349. ( ) - 2 ) ;
  81350. return ;
  81351. }
  81352. states += k ;
  81353.  
  81354. max_state_count = states ;
  81355.  
  81356.  
  81357.  
  81358.  
  81359. states = dist ;
  81360. if ( ( std :: numeric_limits < std :: ptrdiff_t > :: max ) ( ) / dist < states )
  81361. {
  81362. max_state_count = ( std :: min ) ( ( std :: ptrdiff_t ) 100000000 , ( std :: numeric_limits < std :: ptrdiff_t > :: max )
  81363. #132
  81364. ( ) - 2 ) ;
  81365. return ;
  81366. }
  81367. states *= dist ;
  81368. if ( ( std :: numeric_limits < std :: ptrdiff_t > :: max ) ( ) - k < states )
  81369. {
  81370. max_state_count = ( std :: min ) ( ( std :: ptrdiff_t ) 100000000 , ( std :: numeric_limits < std :: ptrdiff_t > :: max )
  81371. #138
  81372. ( ) - 2 ) ;
  81373. return ;
  81374. }
  81375. states += k ;
  81376.  
  81377.  
  81378.  
  81379.  
  81380. if ( states > 100000000 )
  81381. states = 100000000 ;
  81382.  
  81383.  
  81384.  
  81385.  
  81386. if ( states > max_state_count )
  81387. max_state_count = states ;
  81388. }
  81389.  
  81390. template < class BidiIterator , class Allocator , class traits >
  81391. inline void perl_matcher < BidiIterator , Allocator , traits > :: estimate_max_state_count ( void * )
  81392. {
  81393.  
  81394. max_state_count = 100000000 ;
  81395. }
  81396. #176
  81397. template < class BidiIterator , class Allocator , class traits >
  81398. inline bool perl_matcher < BidiIterator , Allocator , traits > :: match ( )
  81399. {
  81400.  
  81401.  
  81402.  
  81403. return match_imp ( ) ;
  81404.  
  81405. }
  81406.  
  81407. template < class BidiIterator , class Allocator , class traits >
  81408. bool perl_matcher < BidiIterator , Allocator , traits > :: match_imp ( )
  81409. {
  81410.  
  81411.  
  81412. save_state_init init ( & m_stack_base , & m_backup_state ) ;
  81413. used_block_count = 1024 ;
  81414.  
  81415. try {
  81416.  
  81417.  
  81418.  
  81419.  
  81420. position = base ;
  81421. search_base = base ;
  81422. state_count = 0 ;
  81423. m_match_flags |= regex_constants :: match_all ;
  81424. m_presult -> set_size ( ( m_match_flags & match_nosubs ) ? 1 : re . mark_count ( ) , search_base , last ) ;
  81425. m_presult -> set_base ( base ) ;
  81426. m_presult -> set_named_subs ( this -> re . get_named_subs ( ) ) ;
  81427. if ( m_match_flags & match_posix )
  81428. m_result = * m_presult ;
  81429. verify_options ( re . flags ( ) , m_match_flags ) ;
  81430. if ( 0 == match_prefix ( ) )
  81431. return false ;
  81432. return ( m_result [ 0 ] . second == last ) && ( m_result [ 0 ] . first == base ) ;
  81433.  
  81434.  
  81435. }
  81436. catch ( ... )
  81437. {
  81438.  
  81439.  
  81440.  
  81441. while ( unwind ( true ) ) { }
  81442. throw ;
  81443. }
  81444.  
  81445. }
  81446.  
  81447. template < class BidiIterator , class Allocator , class traits >
  81448. inline bool perl_matcher < BidiIterator , Allocator , traits > :: find ( )
  81449. {
  81450.  
  81451.  
  81452.  
  81453. return find_imp ( ) ;
  81454.  
  81455. }
  81456.  
  81457. template < class BidiIterator , class Allocator , class traits >
  81458. bool perl_matcher < BidiIterator , Allocator , traits > :: find_imp ( )
  81459. {
  81460. static matcher_proc_type const s_find_vtable [ 7 ] =
  81461. {
  81462. & perl_matcher < BidiIterator , Allocator , traits > :: find_restart_any ,
  81463. & perl_matcher < BidiIterator , Allocator , traits > :: find_restart_word ,
  81464. & perl_matcher < BidiIterator , Allocator , traits > :: find_restart_line ,
  81465. & perl_matcher < BidiIterator , Allocator , traits > :: find_restart_buf ,
  81466. & perl_matcher < BidiIterator , Allocator , traits > :: match_prefix ,
  81467. & perl_matcher < BidiIterator , Allocator , traits > :: find_restart_lit ,
  81468. & perl_matcher < BidiIterator , Allocator , traits > :: find_restart_lit ,
  81469. } ;
  81470.  
  81471.  
  81472.  
  81473. save_state_init init ( & m_stack_base , & m_backup_state ) ;
  81474. used_block_count = 1024 ;
  81475.  
  81476. try {
  81477.  
  81478.  
  81479.  
  81480. state_count = 0 ;
  81481. if ( ( m_match_flags & regex_constants :: match_init ) == 0 )
  81482. {
  81483.  
  81484. search_base = position = base ;
  81485. pstate = re . get_first_state ( ) ;
  81486. m_presult -> set_size ( ( m_match_flags & match_nosubs ) ? 1 : re . mark_count ( ) , base , last ) ;
  81487. m_presult -> set_base ( base ) ;
  81488. m_presult -> set_named_subs ( this -> re . get_named_subs ( ) ) ;
  81489. m_match_flags |= regex_constants :: match_init ;
  81490. }
  81491. else
  81492. {
  81493.  
  81494. search_base = position = m_result [ 0 ] . second ;
  81495.  
  81496.  
  81497. if ( ( ( m_match_flags & match_not_null ) == 0 ) && ( m_result . length ( ) == 0 ) )
  81498. {
  81499. if ( position == last )
  81500. return false ;
  81501. else
  81502. ++ position ;
  81503. }
  81504.  
  81505. m_presult -> set_size ( ( m_match_flags & match_nosubs ) ? 1 : re . mark_count ( ) , search_base , last ) ;
  81506.  
  81507.  
  81508. }
  81509. if ( m_match_flags & match_posix )
  81510. {
  81511. m_result . set_size ( re . mark_count ( ) , base , last ) ;
  81512. m_result . set_base ( base ) ;
  81513. }
  81514.  
  81515. verify_options ( re . flags ( ) , m_match_flags ) ;
  81516.  
  81517. unsigned type = ( m_match_flags & match_continuous ) ?
  81518. static_cast < unsigned int > ( regbase :: restart_continue )
  81519. : static_cast < unsigned int > ( re . get_restart_type ( ) ) ;
  81520.  
  81521.  
  81522. matcher_proc_type proc = s_find_vtable [ type ] ;
  81523. return ( this ->* proc ) ( ) ;
  81524.  
  81525.  
  81526. }
  81527. catch ( ... )
  81528. {
  81529.  
  81530.  
  81531.  
  81532. while ( unwind ( true ) ) { }
  81533. throw ;
  81534. }
  81535.  
  81536. }
  81537.  
  81538. template < class BidiIterator , class Allocator , class traits >
  81539. bool perl_matcher < BidiIterator , Allocator , traits > :: match_prefix ( )
  81540. {
  81541. m_has_partial_match = false ;
  81542. m_has_found_match = false ;
  81543. pstate = re . get_first_state ( ) ;
  81544. m_presult -> set_first ( position ) ;
  81545. restart = position ;
  81546. match_all_states ( ) ;
  81547. if ( ! m_has_found_match && m_has_partial_match && ( m_match_flags & match_partial ) )
  81548. {
  81549. m_has_found_match = true ;
  81550. m_presult -> set_second ( last , 0 , false ) ;
  81551. position = last ;
  81552. if ( ( m_match_flags & match_posix ) == match_posix )
  81553. {
  81554. m_result . maybe_assign ( * m_presult ) ;
  81555. }
  81556. }
  81557. #349
  81558. if ( ! m_has_found_match )
  81559. position = restart ;
  81560. return m_has_found_match ;
  81561. }
  81562.  
  81563. template < class BidiIterator , class Allocator , class traits >
  81564. bool perl_matcher < BidiIterator , Allocator , traits > :: match_literal ( )
  81565. {
  81566. unsigned int len = static_cast < const re_literal * > ( pstate ) -> length ;
  81567. const char_type * what = reinterpret_cast < const char_type * > ( static_cast < const re_literal * > ( pstate ) + 1 ) ;
  81568.  
  81569.  
  81570.  
  81571. for ( unsigned int i = 0 ; i < len ; ++ i , ++ position )
  81572. {
  81573. if ( ( position == last ) || ( traits_inst . translate ( * position , icase ) != what [ i ] ) )
  81574. return false ;
  81575. }
  81576. pstate = pstate -> next . p ;
  81577. return true ;
  81578. }
  81579.  
  81580. template < class BidiIterator , class Allocator , class traits >
  81581. bool perl_matcher < BidiIterator , Allocator , traits > :: match_start_line ( )
  81582. {
  81583. if ( position == backstop )
  81584. {
  81585. if ( ( m_match_flags & match_prev_avail ) == 0 )
  81586. {
  81587. if ( ( m_match_flags & match_not_bol ) == 0 )
  81588. {
  81589. pstate = pstate -> next . p ;
  81590. return true ;
  81591. }
  81592. return false ;
  81593. }
  81594. }
  81595. else if ( m_match_flags & match_single_line )
  81596. return false ;
  81597.  
  81598.  
  81599. BidiIterator t ( position ) ;
  81600. -- t ;
  81601. if ( position != last )
  81602. {
  81603. if ( is_separator ( * t ) && ! ( ( * t == static_cast < char_type > ( '\r' ) ) && ( * position == static_cast < char_type
  81604. #394
  81605. > ( '\n' ) ) ) )
  81606. {
  81607. pstate = pstate -> next . p ;
  81608. return true ;
  81609. }
  81610. }
  81611. else if ( is_separator ( * t ) )
  81612. {
  81613. pstate = pstate -> next . p ;
  81614. return true ;
  81615. }
  81616. return false ;
  81617. }
  81618.  
  81619. template < class BidiIterator , class Allocator , class traits >
  81620. bool perl_matcher < BidiIterator , Allocator , traits > :: match_end_line ( )
  81621. {
  81622. if ( position != last )
  81623. {
  81624. if ( m_match_flags & match_single_line )
  81625. return false ;
  81626.  
  81627. if ( is_separator ( * position ) )
  81628. {
  81629. if ( ( position != backstop ) || ( m_match_flags & match_prev_avail ) )
  81630. {
  81631.  
  81632. BidiIterator t ( position ) ;
  81633. -- t ;
  81634. if ( ( * t == static_cast < char_type > ( '\r' ) ) && ( * position == static_cast < char_type > ( '\n' ) ) )
  81635. {
  81636. return false ;
  81637. }
  81638. }
  81639. pstate = pstate -> next . p ;
  81640. return true ;
  81641. }
  81642. }
  81643. else if ( ( m_match_flags & match_not_eol ) == 0 )
  81644. {
  81645. pstate = pstate -> next . p ;
  81646. return true ;
  81647. }
  81648. return false ;
  81649. }
  81650.  
  81651. template < class BidiIterator , class Allocator , class traits >
  81652. bool perl_matcher < BidiIterator , Allocator , traits > :: match_wild ( )
  81653. {
  81654. if ( position == last )
  81655. return false ;
  81656. if ( is_separator ( * position ) && ( ( match_any_mask & static_cast < const re_dot * > ( pstate ) -> mask ) == 0 ) )
  81657. return false ;
  81658. if ( ( * position == char_type ( 0 ) ) && ( m_match_flags & match_not_dot_null ) )
  81659. return false ;
  81660. pstate = pstate -> next . p ;
  81661. ++ position ;
  81662. return true ;
  81663. }
  81664.  
  81665. template < class BidiIterator , class Allocator , class traits >
  81666. bool perl_matcher < BidiIterator , Allocator , traits > :: match_word_boundary ( )
  81667. {
  81668. bool b ;
  81669. if ( position != last )
  81670. {
  81671.  
  81672.  
  81673.  
  81674.  
  81675. b = traits_inst . isctype ( * position , m_word_mask ) ;
  81676.  
  81677. }
  81678. else
  81679. {
  81680. b = ( m_match_flags & match_not_eow ) ? true : false ;
  81681. }
  81682. if ( ( position == backstop ) && ( ( m_match_flags & match_prev_avail ) == 0 ) )
  81683. {
  81684. if ( m_match_flags & match_not_bow )
  81685. b ^= true ;
  81686. else
  81687. b ^= false ;
  81688. }
  81689. else
  81690. {
  81691. -- position ;
  81692. b ^= traits_inst . isctype ( * position , m_word_mask ) ;
  81693. ++ position ;
  81694. }
  81695. if ( b )
  81696. {
  81697. pstate = pstate -> next . p ;
  81698. return true ;
  81699. }
  81700. return false ;
  81701. }
  81702.  
  81703. template < class BidiIterator , class Allocator , class traits >
  81704. bool perl_matcher < BidiIterator , Allocator , traits > :: match_within_word ( )
  81705. {
  81706. if ( position == last )
  81707. return false ;
  81708.  
  81709. bool prev = traits_inst . isctype ( * position , m_word_mask ) ;
  81710. {
  81711. bool b ;
  81712. if ( ( position == backstop ) && ( ( m_match_flags & match_prev_avail ) == 0 ) )
  81713. return false ;
  81714. else
  81715. {
  81716. -- position ;
  81717. b = traits_inst . isctype ( * position , m_word_mask ) ;
  81718. ++ position ;
  81719. }
  81720. if ( b == prev )
  81721. {
  81722. pstate = pstate -> next . p ;
  81723. return true ;
  81724. }
  81725. }
  81726. return false ;
  81727. }
  81728.  
  81729. template < class BidiIterator , class Allocator , class traits >
  81730. bool perl_matcher < BidiIterator , Allocator , traits > :: match_word_start ( )
  81731. {
  81732. if ( position == last )
  81733. return false ;
  81734. if ( ! traits_inst . isctype ( * position , m_word_mask ) )
  81735. return false ;
  81736. if ( ( position == backstop ) && ( ( m_match_flags & match_prev_avail ) == 0 ) )
  81737. {
  81738. if ( m_match_flags & match_not_bow )
  81739. return false ;
  81740. }
  81741. else
  81742. {
  81743.  
  81744. BidiIterator t ( position ) ;
  81745. -- t ;
  81746. if ( traits_inst . isctype ( * t , m_word_mask ) )
  81747. return false ;
  81748. }
  81749.  
  81750. pstate = pstate -> next . p ;
  81751. return true ;
  81752. }
  81753.  
  81754. template < class BidiIterator , class Allocator , class traits >
  81755. bool perl_matcher < BidiIterator , Allocator , traits > :: match_word_end ( )
  81756. {
  81757. if ( ( position == backstop ) && ( ( m_match_flags & match_prev_avail ) == 0 ) )
  81758. return false ;
  81759. BidiIterator t ( position ) ;
  81760. -- t ;
  81761. if ( traits_inst . isctype ( * t , m_word_mask ) == false )
  81762. return false ;
  81763.  
  81764. if ( position == last )
  81765. {
  81766. if ( m_match_flags & match_not_eow )
  81767. return false ;
  81768. }
  81769. else
  81770. {
  81771.  
  81772. if ( traits_inst . isctype ( * position , m_word_mask ) )
  81773. return false ;
  81774. }
  81775. pstate = pstate -> next . p ;
  81776. return true ;
  81777. }
  81778.  
  81779. template < class BidiIterator , class Allocator , class traits >
  81780. bool perl_matcher < BidiIterator , Allocator , traits > :: match_buffer_start ( )
  81781. {
  81782. if ( ( position != backstop ) || ( m_match_flags & match_not_bob ) )
  81783. return false ;
  81784.  
  81785. pstate = pstate -> next . p ;
  81786. return true ;
  81787. }
  81788.  
  81789. template < class BidiIterator , class Allocator , class traits >
  81790. bool perl_matcher < BidiIterator , Allocator , traits > :: match_buffer_end ( )
  81791. {
  81792. if ( ( position != last ) || ( m_match_flags & match_not_eob ) )
  81793. return false ;
  81794.  
  81795. pstate = pstate -> next . p ;
  81796. return true ;
  81797. }
  81798.  
  81799. template < class BidiIterator , class Allocator , class traits >
  81800. bool perl_matcher < BidiIterator , Allocator , traits > :: match_backref ( )
  81801. {
  81802. #597
  81803. int index = static_cast < const re_brace * > ( pstate ) -> index ;
  81804. if ( index >= 10000 )
  81805. {
  81806. named_subexpressions :: range_type r = re . get_data ( ) . equal_range ( index ) ;
  81807. ( ( void ) 0 ) ;
  81808. do
  81809. {
  81810. index = r . first -> index ;
  81811. ++ r . first ;
  81812. } while ( ( r . first != r . second ) && ( ( * m_presult ) [ index ] . matched != true ) ) ;
  81813. }
  81814.  
  81815. if ( ( m_match_flags & match_perl ) && ! ( * m_presult ) [ index ] . matched )
  81816. return false ;
  81817.  
  81818. BidiIterator i = ( * m_presult ) [ index ] . first ;
  81819. BidiIterator j = ( * m_presult ) [ index ] . second ;
  81820. while ( i != j )
  81821. {
  81822. if ( ( position == last ) || ( traits_inst . translate ( * position , icase ) != traits_inst . translate ( * i , icase )
  81823. #616
  81824. ) )
  81825. return false ;
  81826. ++ i ;
  81827. ++ position ;
  81828. }
  81829. pstate = pstate -> next . p ;
  81830. return true ;
  81831. }
  81832.  
  81833. template < class BidiIterator , class Allocator , class traits >
  81834. bool perl_matcher < BidiIterator , Allocator , traits > :: match_long_set ( )
  81835. {
  81836. typedef typename traits :: char_class_type char_class_type ;
  81837.  
  81838. if ( position == last )
  81839. return false ;
  81840. BidiIterator t = re_is_set_member ( position , last , static_cast < const re_set_long < char_class_type > * > ( pstate )
  81841. #632
  81842. , re . get_data ( ) , icase ) ;
  81843. if ( t != position )
  81844. {
  81845. pstate = pstate -> next . p ;
  81846. position = t ;
  81847. return true ;
  81848. }
  81849. return false ;
  81850. }
  81851.  
  81852. template < class BidiIterator , class Allocator , class traits >
  81853. bool perl_matcher < BidiIterator , Allocator , traits > :: match_set ( )
  81854. {
  81855. if ( position == last )
  81856. return false ;
  81857. if ( static_cast < const re_set * > ( pstate ) -> _map [ static_cast < unsigned char > ( traits_inst . translate ( * position
  81858. #647
  81859. , icase ) ) ] )
  81860. {
  81861. pstate = pstate -> next . p ;
  81862. ++ position ;
  81863. return true ;
  81864. }
  81865. return false ;
  81866. }
  81867.  
  81868. template < class BidiIterator , class Allocator , class traits >
  81869. bool perl_matcher < BidiIterator , Allocator , traits > :: match_jump ( )
  81870. {
  81871. pstate = static_cast < const re_jump * > ( pstate ) -> alt . p ;
  81872. return true ;
  81873. }
  81874.  
  81875. template < class BidiIterator , class Allocator , class traits >
  81876. bool perl_matcher < BidiIterator , Allocator , traits > :: match_combining ( )
  81877. {
  81878. if ( position == last )
  81879. return false ;
  81880. if ( is_combining ( traits_inst . translate ( * position , icase ) ) )
  81881. return false ;
  81882. ++ position ;
  81883. while ( ( position != last ) && is_combining ( traits_inst . translate ( * position , icase ) ) )
  81884. ++ position ;
  81885. pstate = pstate -> next . p ;
  81886. return true ;
  81887. }
  81888.  
  81889. template < class BidiIterator , class Allocator , class traits >
  81890. bool perl_matcher < BidiIterator , Allocator , traits > :: match_soft_buffer_end ( )
  81891. {
  81892. if ( m_match_flags & match_not_eob )
  81893. return false ;
  81894. BidiIterator p ( position ) ;
  81895. while ( ( p != last ) && is_separator ( traits_inst . translate ( * p , icase ) ) ) ++ p ;
  81896. if ( p != last )
  81897. return false ;
  81898. pstate = pstate -> next . p ;
  81899. return true ;
  81900. }
  81901.  
  81902. template < class BidiIterator , class Allocator , class traits >
  81903. bool perl_matcher < BidiIterator , Allocator , traits > :: match_restart_continue ( )
  81904. {
  81905. if ( position == search_base )
  81906. {
  81907. pstate = pstate -> next . p ;
  81908. return true ;
  81909. }
  81910. return false ;
  81911. }
  81912.  
  81913. template < class BidiIterator , class Allocator , class traits >
  81914. bool perl_matcher < BidiIterator , Allocator , traits > :: match_backstep ( )
  81915. {
  81916.  
  81917.  
  81918.  
  81919.  
  81920. if ( :: boost :: is_random_access_iterator < BidiIterator > :: value )
  81921. {
  81922. std :: ptrdiff_t maxlen = :: boost :: re_detail :: distance ( backstop , position ) ;
  81923. if ( maxlen < static_cast < const re_brace * > ( pstate ) -> index )
  81924. return false ;
  81925. std :: advance ( position , - static_cast < const re_brace * > ( pstate ) -> index ) ;
  81926. }
  81927. else
  81928. {
  81929. int c = static_cast < const re_brace * > ( pstate ) -> index ;
  81930. while ( c -- )
  81931. {
  81932. if ( position == backstop )
  81933. return false ;
  81934. -- position ;
  81935. }
  81936. }
  81937. pstate = pstate -> next . p ;
  81938. return true ;
  81939.  
  81940.  
  81941.  
  81942. }
  81943.  
  81944. template < class BidiIterator , class Allocator , class traits >
  81945. inline bool perl_matcher < BidiIterator , Allocator , traits > :: match_assert_backref ( )
  81946. {
  81947.  
  81948. int index = static_cast < const re_brace * > ( pstate ) -> index ;
  81949. bool result = false ;
  81950. if ( index == 9999 )
  81951. {
  81952.  
  81953. return false ;
  81954. }
  81955. else if ( index > 0 )
  81956. {
  81957.  
  81958.  
  81959. if ( index >= 10000 )
  81960. {
  81961. named_subexpressions :: range_type r = re . get_data ( ) . equal_range ( index ) ;
  81962. while ( r . first != r . second )
  81963. {
  81964. if ( ( * m_presult ) [ r . first -> index ] . matched )
  81965. {
  81966. result = true ;
  81967. break ;
  81968. }
  81969. ++ r . first ;
  81970. }
  81971. }
  81972. else
  81973. {
  81974. result = ( * m_presult ) [ index ] . matched ;
  81975. }
  81976. pstate = pstate -> next . p ;
  81977. }
  81978. else
  81979. {
  81980.  
  81981.  
  81982. int idx = - index - 1 ;
  81983. if ( idx >= 10000 )
  81984. {
  81985. named_subexpressions :: range_type r = re . get_data ( ) . equal_range ( idx ) ;
  81986. int stack_index = recursion_stack . empty ( ) ? - 1 : recursion_stack . back ( ) . idx ;
  81987. while ( r . first != r . second )
  81988. {
  81989. result |= ( stack_index == r . first -> index ) ;
  81990. if ( result ) break ;
  81991. ++ r . first ;
  81992. }
  81993. }
  81994. else
  81995. {
  81996. result = ! recursion_stack . empty ( ) && ( ( recursion_stack . back ( ) . idx == idx ) || ( index == 0 ) ) ;
  81997. }
  81998. pstate = pstate -> next . p ;
  81999. }
  82000. return result ;
  82001. }
  82002.  
  82003. template < class BidiIterator , class Allocator , class traits >
  82004. bool perl_matcher < BidiIterator , Allocator , traits > :: match_toggle_case ( )
  82005. {
  82006.  
  82007. this -> icase = static_cast < const re_case * > ( pstate ) -> icase ;
  82008. pstate = pstate -> next . p ;
  82009. return true ;
  82010. }
  82011.  
  82012.  
  82013. template < class BidiIterator , class Allocator , class traits >
  82014. bool perl_matcher < BidiIterator , Allocator , traits > :: find_restart_any ( )
  82015. {
  82016.  
  82017.  
  82018.  
  82019.  
  82020. const unsigned char * _map = re . get_map ( ) ;
  82021. while ( true )
  82022. {
  82023.  
  82024. while ( ( position != last ) && ! can_start ( * position , _map , ( unsigned char ) mask_any ) )
  82025. ++ position ;
  82026. if ( position == last )
  82027. {
  82028.  
  82029. if ( re . can_be_null ( ) )
  82030. return match_prefix ( ) ;
  82031. break ;
  82032. }
  82033.  
  82034. if ( match_prefix ( ) )
  82035. return true ;
  82036. if ( position == last )
  82037. return false ;
  82038. ++ position ;
  82039. }
  82040. return false ;
  82041.  
  82042.  
  82043.  
  82044. }
  82045.  
  82046. template < class BidiIterator , class Allocator , class traits >
  82047. bool perl_matcher < BidiIterator , Allocator , traits > :: find_restart_word ( )
  82048. {
  82049.  
  82050.  
  82051.  
  82052.  
  82053.  
  82054. const unsigned char * _map = re . get_map ( ) ;
  82055. if ( ( m_match_flags & match_prev_avail ) || ( position != base ) )
  82056. -- position ;
  82057. else if ( match_prefix ( ) )
  82058. return true ;
  82059. do
  82060. {
  82061. while ( ( position != last ) && traits_inst . isctype ( * position , m_word_mask ) )
  82062. ++ position ;
  82063. while ( ( position != last ) && ! traits_inst . isctype ( * position , m_word_mask ) )
  82064. ++ position ;
  82065. if ( position == last )
  82066. break ;
  82067.  
  82068. if ( can_start ( * position , _map , ( unsigned char ) mask_any ) )
  82069. {
  82070. if ( match_prefix ( ) )
  82071. return true ;
  82072. }
  82073. if ( position == last )
  82074. break ;
  82075. } while ( true ) ;
  82076. return false ;
  82077.  
  82078.  
  82079.  
  82080. }
  82081.  
  82082. template < class BidiIterator , class Allocator , class traits >
  82083. bool perl_matcher < BidiIterator , Allocator , traits > :: find_restart_line ( )
  82084. {
  82085.  
  82086. const unsigned char * _map = re . get_map ( ) ;
  82087. if ( match_prefix ( ) )
  82088. return true ;
  82089. while ( position != last )
  82090. {
  82091. while ( ( position != last ) && ! is_separator ( * position ) )
  82092. ++ position ;
  82093. if ( position == last )
  82094. return false ;
  82095. ++ position ;
  82096. if ( position == last )
  82097. {
  82098. if ( re . can_be_null ( ) && match_prefix ( ) )
  82099. return true ;
  82100. return false ;
  82101. }
  82102.  
  82103. if ( can_start ( * position , _map , ( unsigned char ) mask_any ) )
  82104. {
  82105. if ( match_prefix ( ) )
  82106. return true ;
  82107. }
  82108. if ( position == last )
  82109. return false ;
  82110.  
  82111. }
  82112. return false ;
  82113. }
  82114.  
  82115. template < class BidiIterator , class Allocator , class traits >
  82116. bool perl_matcher < BidiIterator , Allocator , traits > :: find_restart_buf ( )
  82117. {
  82118. if ( ( position == base ) && ( ( m_match_flags & match_not_bob ) == 0 ) )
  82119. return match_prefix ( ) ;
  82120. return false ;
  82121. }
  82122.  
  82123. template < class BidiIterator , class Allocator , class traits >
  82124. bool perl_matcher < BidiIterator , Allocator , traits > :: find_restart_lit ( )
  82125. {
  82126. #970
  82127. return false ;
  82128. }
  82129.  
  82130. }
  82131.  
  82132. }
  82133. #1 "./boost/regex/v4/instances.hpp"
  82134. #25
  82135. namespace boost {
  82136. #215
  82137. }
  82138. #1 "./boost/regex/v4/instances.hpp"
  82139. #25
  82140. namespace boost {
  82141. #215
  82142. }
  82143. #128 "./boost/regex/v4/regex.hpp"
  82144. namespace boost {
  82145. #136
  82146. typedef match_results < const char * > cmatch ;
  82147. typedef match_results < std :: string :: const_iterator > smatch ;
  82148.  
  82149. typedef match_results < const wchar_t * > wcmatch ;
  82150. typedef match_results < std :: wstring :: const_iterator > wsmatch ;
  82151.  
  82152.  
  82153. }
  82154. #1 "./boost/regex/v4/regex_match.hpp"
  82155. #25
  82156. namespace boost {
  82157. #43
  82158. template < class BidiIterator , class Allocator , class charT , class traits >
  82159. bool regex_match ( BidiIterator first , BidiIterator last ,
  82160. match_results < BidiIterator , Allocator > & m ,
  82161. const basic_regex < charT , traits > & e ,
  82162. match_flag_type flags = match_default )
  82163. {
  82164. re_detail :: perl_matcher < BidiIterator , Allocator , traits > matcher ( first , last , m , e , flags , first ) ;
  82165. return matcher . match ( ) ;
  82166. }
  82167. template < class iterator , class charT , class traits >
  82168. bool regex_match ( iterator first , iterator last ,
  82169. const basic_regex < charT , traits > & e ,
  82170. match_flag_type flags = match_default )
  82171. {
  82172. match_results < iterator > m ;
  82173. return regex_match ( first , last , m , e , flags | regex_constants :: match_any ) ;
  82174. }
  82175. #67
  82176. template < class charT , class Allocator , class traits >
  82177. inline bool regex_match ( const charT * str ,
  82178. match_results < const charT * , Allocator > & m ,
  82179. const basic_regex < charT , traits > & e ,
  82180. match_flag_type flags = match_default )
  82181. {
  82182. return regex_match ( str , str + traits :: length ( str ) , m , e , flags ) ;
  82183. }
  82184.  
  82185. template < class ST , class SA , class Allocator , class charT , class traits >
  82186. inline bool regex_match ( const std :: basic_string < charT , ST , SA > & s ,
  82187. match_results < typename std :: basic_string < charT , ST , SA > :: const_iterator , Allocator > & m ,
  82188. const basic_regex < charT , traits > & e ,
  82189. match_flag_type flags = match_default )
  82190. {
  82191. return regex_match ( s . begin ( ) , s . end ( ) , m , e , flags ) ;
  82192. }
  82193. template < class charT , class traits >
  82194. inline bool regex_match ( const charT * str ,
  82195. const basic_regex < charT , traits > & e ,
  82196. match_flag_type flags = match_default )
  82197. {
  82198. match_results < const charT * > m ;
  82199. return regex_match ( str , str + traits :: length ( str ) , m , e , flags | regex_constants :: match_any ) ;
  82200. }
  82201.  
  82202. template < class ST , class SA , class charT , class traits >
  82203. inline bool regex_match ( const std :: basic_string < charT , ST , SA > & s ,
  82204. const basic_regex < charT , traits > & e ,
  82205. match_flag_type flags = match_default )
  82206. {
  82207. typedef typename std :: basic_string < charT , ST , SA > :: const_iterator iterator ;
  82208. match_results < iterator > m ;
  82209. return regex_match ( s . begin ( ) , s . end ( ) , m , e , flags | regex_constants :: match_any ) ;
  82210. }
  82211. #362
  82212. }
  82213. #1 "./boost/regex/v4/regex_search.hpp"
  82214. #23
  82215. namespace boost {
  82216. #36
  82217. template < class BidiIterator , class Allocator , class charT , class traits >
  82218. bool regex_search ( BidiIterator first , BidiIterator last ,
  82219. match_results < BidiIterator , Allocator > & m ,
  82220. const basic_regex < charT , traits > & e ,
  82221. match_flag_type flags = match_default )
  82222. {
  82223. return regex_search ( first , last , m , e , flags , first ) ;
  82224. }
  82225.  
  82226. template < class BidiIterator , class Allocator , class charT , class traits >
  82227. bool regex_search ( BidiIterator first , BidiIterator last ,
  82228. match_results < BidiIterator , Allocator > & m ,
  82229. const basic_regex < charT , traits > & e ,
  82230. match_flag_type flags ,
  82231. BidiIterator base )
  82232. {
  82233. if ( e . flags ( ) & regex_constants :: failbit )
  82234. return false ;
  82235.  
  82236. re_detail :: perl_matcher < BidiIterator , Allocator , traits > matcher ( first , last , m , e , flags , base ) ;
  82237. return matcher . find ( ) ;
  82238. }
  82239. #66
  82240. template < class charT , class Allocator , class traits >
  82241. inline bool regex_search ( const charT * str ,
  82242. match_results < const charT * , Allocator > & m ,
  82243. const basic_regex < charT , traits > & e ,
  82244. match_flag_type flags = match_default )
  82245. {
  82246. return regex_search ( str , str + traits :: length ( str ) , m , e , flags ) ;
  82247. }
  82248.  
  82249. template < class ST , class SA , class Allocator , class charT , class traits >
  82250. inline bool regex_search ( const std :: basic_string < charT , ST , SA > & s ,
  82251. match_results < typename std :: basic_string < charT , ST , SA > :: const_iterator , Allocator > & m ,
  82252. const basic_regex < charT , traits > & e ,
  82253. match_flag_type flags = match_default )
  82254. {
  82255. return regex_search ( s . begin ( ) , s . end ( ) , m , e , flags ) ;
  82256. }
  82257. #134
  82258. template < class BidiIterator , class charT , class traits >
  82259. bool regex_search ( BidiIterator first , BidiIterator last ,
  82260. const basic_regex < charT , traits > & e ,
  82261. match_flag_type flags = match_default )
  82262. {
  82263. if ( e . flags ( ) & regex_constants :: failbit )
  82264. return false ;
  82265.  
  82266. match_results < BidiIterator > m ;
  82267. typedef typename match_results < BidiIterator > :: allocator_type match_alloc_type ;
  82268. re_detail :: perl_matcher < BidiIterator , match_alloc_type , traits > matcher ( first , last , m , e , flags | regex_constants
  82269. #144
  82270. :: match_any , first ) ;
  82271. return matcher . find ( ) ;
  82272. }
  82273.  
  82274.  
  82275.  
  82276. template < class charT , class traits >
  82277. inline bool regex_search ( const charT * str ,
  82278. const basic_regex < charT , traits > & e ,
  82279. match_flag_type flags = match_default )
  82280. {
  82281. return regex_search ( str , str + traits :: length ( str ) , e , flags ) ;
  82282. }
  82283.  
  82284. template < class ST , class SA , class charT , class traits >
  82285. inline bool regex_search ( const std :: basic_string < charT , ST , SA > & s ,
  82286. const basic_regex < charT , traits > & e ,
  82287. match_flag_type flags = match_default )
  82288. {
  82289. return regex_search ( s . begin ( ) , s . end ( ) , e , flags ) ;
  82290. }
  82291. #213
  82292. }
  82293. #1 "./boost/regex/v4/regex_iterator.hpp"
  82294. #24
  82295. namespace boost {
  82296. #37
  82297. template < class BidirectionalIterator ,
  82298. class charT ,
  82299. class traits >
  82300. class regex_iterator_implementation
  82301. {
  82302. typedef basic_regex < charT , traits > regex_type ;
  82303.  
  82304. match_results < BidirectionalIterator > what ;
  82305. BidirectionalIterator base ;
  82306. BidirectionalIterator end ;
  82307. const regex_type re ;
  82308. match_flag_type flags ;
  82309.  
  82310. public :
  82311. regex_iterator_implementation ( const regex_type * p , BidirectionalIterator last , match_flag_type f )
  82312. : base ( ) , end ( last ) , re ( * p ) , flags ( f ) { }
  82313. bool init ( BidirectionalIterator first )
  82314. {
  82315. base = first ;
  82316. return regex_search ( first , end , what , re , flags ) ;
  82317. }
  82318. bool compare ( const regex_iterator_implementation & that )
  82319. {
  82320. if ( this == & that ) return true ;
  82321. return ( & re . get_data ( ) == & that . re . get_data ( ) ) && ( end == that . end ) && ( flags == that . flags ) && ( what
  82322. #61
  82323. [ 0 ] . first == that . what [ 0 ] . first ) && ( what [ 0 ] . second == that . what [ 0 ] . second ) ;
  82324. }
  82325. const match_results < BidirectionalIterator > & get ( )
  82326. { return what ; }
  82327. bool next ( )
  82328. {
  82329.  
  82330.  
  82331. BidirectionalIterator next_start = what [ 0 ] . second ;
  82332. match_flag_type f ( flags ) ;
  82333. if ( ! what . length ( ) || ( f & regex_constants :: match_posix ) )
  82334. f |= regex_constants :: match_not_initial_null ;
  82335.  
  82336.  
  82337. bool result = regex_search ( next_start , end , what , re , f , base ) ;
  82338. if ( result )
  82339. what . set_base ( base ) ;
  82340. return result ;
  82341. }
  82342. private :
  82343. regex_iterator_implementation & operator = ( const regex_iterator_implementation & ) ;
  82344. } ;
  82345.  
  82346. template < class BidirectionalIterator ,
  82347. class charT = typename re_detail :: regex_iterator_traits < BidirectionalIterator > :: value_type ,
  82348. class traits = regex_traits < charT > >
  82349. class regex_iterator
  82350.  
  82351. : public std :: iterator <
  82352. std :: forward_iterator_tag ,
  82353. match_results < BidirectionalIterator > ,
  82354. typename re_detail :: regex_iterator_traits < BidirectionalIterator > :: difference_type ,
  82355. const match_results < BidirectionalIterator > * ,
  82356. const match_results < BidirectionalIterator > & >
  82357.  
  82358. {
  82359. private :
  82360. typedef regex_iterator_implementation < BidirectionalIterator , charT , traits > impl ;
  82361. typedef shared_ptr < impl > pimpl ;
  82362. public :
  82363. typedef basic_regex < charT , traits > regex_type ;
  82364. typedef match_results < BidirectionalIterator > value_type ;
  82365. typedef typename re_detail :: regex_iterator_traits < BidirectionalIterator > :: difference_type
  82366. difference_type ;
  82367. typedef const value_type * pointer ;
  82368. typedef const value_type & reference ;
  82369. typedef std :: forward_iterator_tag iterator_category ;
  82370.  
  82371. regex_iterator ( ) { }
  82372. regex_iterator ( BidirectionalIterator a , BidirectionalIterator b ,
  82373. const regex_type & re ,
  82374. match_flag_type m = match_default )
  82375. : pdata ( new impl ( & re , b , m ) )
  82376. {
  82377. if ( ! pdata -> init ( a ) )
  82378. {
  82379. pdata . reset ( ) ;
  82380. }
  82381. }
  82382. regex_iterator ( const regex_iterator & that )
  82383. : pdata ( that . pdata ) { }
  82384. regex_iterator & operator = ( const regex_iterator & that )
  82385. {
  82386. pdata = that . pdata ;
  82387. return * this ;
  82388. }
  82389. bool operator == ( const regex_iterator & that ) const
  82390. {
  82391. if ( ( pdata . get ( ) == 0 ) || ( that . pdata . get ( ) == 0 ) )
  82392. return pdata . get ( ) == that . pdata . get ( ) ;
  82393. return pdata -> compare ( * ( that . pdata . get ( ) ) ) ;
  82394. }
  82395. bool operator != ( const regex_iterator & that ) const
  82396. { return ! ( * this == that ) ; }
  82397. const value_type & operator * ( ) const
  82398. { return pdata -> get ( ) ; }
  82399. const value_type * operator -> ( ) const
  82400. { return & ( pdata -> get ( ) ) ; }
  82401. regex_iterator & operator ++ ( )
  82402. {
  82403. cow ( ) ;
  82404. if ( 0 == pdata -> next ( ) )
  82405. {
  82406. pdata . reset ( ) ;
  82407. }
  82408. return * this ;
  82409. }
  82410. regex_iterator operator ++ ( int )
  82411. {
  82412. regex_iterator result ( * this ) ;
  82413. ++ ( * this ) ;
  82414. return result ;
  82415. }
  82416. private :
  82417.  
  82418. pimpl pdata ;
  82419.  
  82420. void cow ( )
  82421. {
  82422.  
  82423. if ( pdata . get ( ) && ! pdata . unique ( ) )
  82424. {
  82425. pdata . reset ( new impl ( * ( pdata . get ( ) ) ) ) ;
  82426. }
  82427. }
  82428. } ;
  82429.  
  82430. typedef regex_iterator < const char * > cregex_iterator ;
  82431. typedef regex_iterator < std :: string :: const_iterator > sregex_iterator ;
  82432.  
  82433. typedef regex_iterator < const wchar_t * > wcregex_iterator ;
  82434. typedef regex_iterator < std :: wstring :: const_iterator > wsregex_iterator ;
  82435.  
  82436.  
  82437.  
  82438. template < class charT , class traits >
  82439. inline regex_iterator < const charT * , charT , traits > make_regex_iterator ( const charT * p , const basic_regex < charT
  82440. #177
  82441. , traits > & e , regex_constants :: match_flag_type m = regex_constants :: match_default )
  82442. {
  82443. return regex_iterator < const charT * , charT , traits > ( p , p + traits :: length ( p ) , e , m ) ;
  82444. }
  82445. template < class charT , class traits , class ST , class SA >
  82446. inline regex_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > make_regex_iterator
  82447. #182
  82448. ( const std :: basic_string < charT , ST , SA > & p , const basic_regex < charT , traits > & e , regex_constants :: match_flag_type
  82449. #182
  82450. m = regex_constants :: match_default )
  82451. {
  82452. return regex_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > ( p . begin
  82453. #184
  82454. ( ) , p . end ( ) , e , m ) ;
  82455. }
  82456. #198
  82457. }
  82458. #1 "./boost/regex/v4/regex_token_iterator.hpp"
  82459. #37
  82460. namespace boost {
  82461. #54
  82462. template < class BidirectionalIterator ,
  82463. class charT ,
  82464. class traits >
  82465. class regex_token_iterator_implementation
  82466. {
  82467. typedef basic_regex < charT , traits > regex_type ;
  82468. typedef sub_match < BidirectionalIterator > value_type ;
  82469.  
  82470. match_results < BidirectionalIterator > what ;
  82471. BidirectionalIterator base ;
  82472. BidirectionalIterator end ;
  82473. const regex_type re ;
  82474. match_flag_type flags ;
  82475. value_type result ;
  82476. int N ;
  82477. std :: vector < int > subs ;
  82478.  
  82479. public :
  82480. regex_token_iterator_implementation ( const regex_type * p , BidirectionalIterator last , int sub , match_flag_type f )
  82481. : end ( last ) , re ( * p ) , flags ( f ) { subs . push_back ( sub ) ; }
  82482. regex_token_iterator_implementation ( const regex_type * p , BidirectionalIterator last , const std :: vector < int > & v
  82483. #74
  82484. , match_flag_type f )
  82485. : end ( last ) , re ( * p ) , flags ( f ) , subs ( v ) { }
  82486. #94
  82487. template < std :: size_t CN >
  82488. regex_token_iterator_implementation ( const regex_type * p , BidirectionalIterator last , const int ( & submatches ) [ CN
  82489. #95
  82490. ] , match_flag_type f )
  82491. : end ( last ) , re ( * p ) , flags ( f )
  82492. {
  82493. for ( std :: size_t i = 0 ; i < CN ; ++ i )
  82494. {
  82495. subs . push_back ( submatches [ i ] ) ;
  82496. }
  82497. }
  82498.  
  82499.  
  82500. bool init ( BidirectionalIterator first )
  82501. {
  82502. N = 0 ;
  82503. base = first ;
  82504. if ( regex_search ( first , end , what , re , flags , base ) == true )
  82505. {
  82506. N = 0 ;
  82507. result = ( ( subs [ N ] == - 1 ) ? what . prefix ( ) : what [ ( int ) subs [ N ] ] ) ;
  82508. return true ;
  82509. }
  82510. else if ( ( subs [ N ] == - 1 ) && ( first != end ) )
  82511. {
  82512. result . first = first ;
  82513. result . second = end ;
  82514. result . matched = ( first != end ) ;
  82515. N = - 1 ;
  82516. return true ;
  82517. }
  82518. return false ;
  82519. }
  82520. bool compare ( const regex_token_iterator_implementation & that )
  82521. {
  82522. if ( this == & that ) return true ;
  82523. return ( & re . get_data ( ) == & that . re . get_data ( ) )
  82524. && ( end == that . end )
  82525. && ( flags == that . flags )
  82526. && ( N == that . N )
  82527. && ( what [ 0 ] . first == that . what [ 0 ] . first )
  82528. && ( what [ 0 ] . second == that . what [ 0 ] . second ) ;
  82529. }
  82530. const value_type & get ( )
  82531. { return result ; }
  82532. bool next ( )
  82533. {
  82534. if ( N == - 1 )
  82535. return false ;
  82536. if ( N + 1 < ( int ) subs . size ( ) )
  82537. {
  82538. ++ N ;
  82539. result = ( ( subs [ N ] == - 1 ) ? what . prefix ( ) : what [ subs [ N ] ] ) ;
  82540. return true ;
  82541. }
  82542.  
  82543.  
  82544. BidirectionalIterator last_end ( what [ 0 ] . second ) ;
  82545. if ( regex_search ( last_end , end , what , re , ( ( what [ 0 ] . first == what [ 0 ] . second ) ? flags | regex_constants
  82546. #150
  82547. :: match_not_initial_null : flags ) , base ) )
  82548. {
  82549. N = 0 ;
  82550. result = ( ( subs [ N ] == - 1 ) ? what . prefix ( ) : what [ subs [ N ] ] ) ;
  82551. return true ;
  82552. }
  82553. else if ( ( last_end != end ) && ( subs [ 0 ] == - 1 ) )
  82554. {
  82555. N = - 1 ;
  82556. result . first = last_end ;
  82557. result . second = end ;
  82558. result . matched = ( last_end != end ) ;
  82559. return true ;
  82560. }
  82561. return false ;
  82562. }
  82563. private :
  82564. regex_token_iterator_implementation & operator = ( const regex_token_iterator_implementation & ) ;
  82565. } ;
  82566.  
  82567. template < class BidirectionalIterator ,
  82568. class charT = typename re_detail :: regex_iterator_traits < BidirectionalIterator > :: value_type ,
  82569. class traits = regex_traits < charT > >
  82570. class regex_token_iterator
  82571.  
  82572. : public std :: iterator <
  82573. std :: forward_iterator_tag ,
  82574. sub_match < BidirectionalIterator > ,
  82575. typename re_detail :: regex_iterator_traits < BidirectionalIterator > :: difference_type ,
  82576. const sub_match < BidirectionalIterator > * ,
  82577. const sub_match < BidirectionalIterator > & >
  82578.  
  82579. {
  82580. private :
  82581. typedef regex_token_iterator_implementation < BidirectionalIterator , charT , traits > impl ;
  82582. typedef shared_ptr < impl > pimpl ;
  82583. public :
  82584. typedef basic_regex < charT , traits > regex_type ;
  82585. typedef sub_match < BidirectionalIterator > value_type ;
  82586. typedef typename re_detail :: regex_iterator_traits < BidirectionalIterator > :: difference_type
  82587. difference_type ;
  82588. typedef const value_type * pointer ;
  82589. typedef const value_type & reference ;
  82590. typedef std :: forward_iterator_tag iterator_category ;
  82591.  
  82592. regex_token_iterator ( ) { }
  82593. regex_token_iterator ( BidirectionalIterator a , BidirectionalIterator b , const regex_type & re ,
  82594. int submatch = 0 , match_flag_type m = match_default )
  82595. : pdata ( new impl ( & re , b , submatch , m ) )
  82596. {
  82597. if ( ! pdata -> init ( a ) )
  82598. pdata . reset ( ) ;
  82599. }
  82600. regex_token_iterator ( BidirectionalIterator a , BidirectionalIterator b , const regex_type & re ,
  82601. const std :: vector < int > & submatches , match_flag_type m = match_default )
  82602. : pdata ( new impl ( & re , b , submatches , m ) )
  82603. {
  82604. if ( ! pdata -> init ( a ) )
  82605. pdata . reset ( ) ;
  82606. }
  82607. #224
  82608. template < std :: size_t N >
  82609. regex_token_iterator ( BidirectionalIterator a , BidirectionalIterator b , const regex_type & re ,
  82610. const int ( & submatches ) [ N ] , match_flag_type m = match_default )
  82611. : pdata ( new impl ( & re , b , submatches , m ) )
  82612. {
  82613. if ( ! pdata -> init ( a ) )
  82614. pdata . reset ( ) ;
  82615. }
  82616.  
  82617.  
  82618. regex_token_iterator ( const regex_token_iterator & that )
  82619. : pdata ( that . pdata ) { }
  82620. regex_token_iterator & operator = ( const regex_token_iterator & that )
  82621. {
  82622. pdata = that . pdata ;
  82623. return * this ;
  82624. }
  82625. bool operator == ( const regex_token_iterator & that ) const
  82626. {
  82627. if ( ( pdata . get ( ) == 0 ) || ( that . pdata . get ( ) == 0 ) )
  82628. return pdata . get ( ) == that . pdata . get ( ) ;
  82629. return pdata -> compare ( * ( that . pdata . get ( ) ) ) ;
  82630. }
  82631. bool operator != ( const regex_token_iterator & that ) const
  82632. { return ! ( * this == that ) ; }
  82633. const value_type & operator * ( ) const
  82634. { return pdata -> get ( ) ; }
  82635. const value_type * operator -> ( ) const
  82636. { return & ( pdata -> get ( ) ) ; }
  82637. regex_token_iterator & operator ++ ( )
  82638. {
  82639. cow ( ) ;
  82640. if ( 0 == pdata -> next ( ) )
  82641. {
  82642. pdata . reset ( ) ;
  82643. }
  82644. return * this ;
  82645. }
  82646. regex_token_iterator operator ++ ( int )
  82647. {
  82648. regex_token_iterator result ( * this ) ;
  82649. ++ ( * this ) ;
  82650. return result ;
  82651. }
  82652. private :
  82653.  
  82654. pimpl pdata ;
  82655.  
  82656. void cow ( )
  82657. {
  82658.  
  82659. if ( pdata . get ( ) && ! pdata . unique ( ) )
  82660. {
  82661. pdata . reset ( new impl ( * ( pdata . get ( ) ) ) ) ;
  82662. }
  82663. }
  82664. } ;
  82665.  
  82666. typedef regex_token_iterator < const char * > cregex_token_iterator ;
  82667. typedef regex_token_iterator < std :: string :: const_iterator > sregex_token_iterator ;
  82668.  
  82669. typedef regex_token_iterator < const wchar_t * > wcregex_token_iterator ;
  82670. typedef regex_token_iterator < std :: wstring :: const_iterator > wsregex_token_iterator ;
  82671.  
  82672.  
  82673. template < class charT , class traits >
  82674. inline regex_token_iterator < const charT * , charT , traits > make_regex_token_iterator ( const charT * p , const basic_regex
  82675. #290
  82676. < charT , traits > & e , int submatch = 0 , regex_constants :: match_flag_type m = regex_constants :: match_default )
  82677. {
  82678. return regex_token_iterator < const charT * , charT , traits > ( p , p + traits :: length ( p ) , e , submatch , m ) ;
  82679. }
  82680. template < class charT , class traits , class ST , class SA >
  82681. inline regex_token_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > make_regex_token_iterator
  82682. #295
  82683. ( const std :: basic_string < charT , ST , SA > & p , const basic_regex < charT , traits > & e , int submatch = 0 , regex_constants
  82684. #295
  82685. :: match_flag_type m = regex_constants :: match_default )
  82686. {
  82687. return regex_token_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > ( p .
  82688. #297
  82689. begin ( ) , p . end ( ) , e , submatch , m ) ;
  82690. }
  82691.  
  82692. template < class charT , class traits , std :: size_t N >
  82693. inline regex_token_iterator < const charT * , charT , traits > make_regex_token_iterator ( const charT * p , const basic_regex
  82694. #301
  82695. < charT , traits > & e , const int ( & submatch ) [ N ] , regex_constants :: match_flag_type m = regex_constants :: match_default
  82696. #301
  82697. )
  82698. {
  82699. return regex_token_iterator < const charT * , charT , traits > ( p , p + traits :: length ( p ) , e , submatch , m ) ;
  82700. }
  82701. template < class charT , class traits , class ST , class SA , std :: size_t N >
  82702. inline regex_token_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > make_regex_token_iterator
  82703. #306
  82704. ( const std :: basic_string < charT , ST , SA > & p , const basic_regex < charT , traits > & e , const int ( & submatch )
  82705. #306
  82706. [ N ] , regex_constants :: match_flag_type m = regex_constants :: match_default )
  82707. {
  82708. return regex_token_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > ( p .
  82709. #308
  82710. begin ( ) , p . end ( ) , e , submatch , m ) ;
  82711. }
  82712.  
  82713. template < class charT , class traits >
  82714. inline regex_token_iterator < const charT * , charT , traits > make_regex_token_iterator ( const charT * p , const basic_regex
  82715. #312
  82716. < charT , traits > & e , const std :: vector < int > & submatch , regex_constants :: match_flag_type m = regex_constants
  82717. #312
  82718. :: match_default )
  82719. {
  82720. return regex_token_iterator < const charT * , charT , traits > ( p , p + traits :: length ( p ) , e , submatch , m ) ;
  82721. }
  82722. template < class charT , class traits , class ST , class SA >
  82723. inline regex_token_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > make_regex_token_iterator
  82724. #317
  82725. ( const std :: basic_string < charT , ST , SA > & p , const basic_regex < charT , traits > & e , const std :: vector < int
  82726. #317
  82727. > & submatch , regex_constants :: match_flag_type m = regex_constants :: match_default )
  82728. {
  82729. return regex_token_iterator < typename std :: basic_string < charT , ST , SA > :: const_iterator , charT , traits > ( p .
  82730. #319
  82731. begin ( ) , p . end ( ) , e , submatch , m ) ;
  82732. }
  82733. #336
  82734. }
  82735. #1 "./boost/regex/v4/regex_grep.hpp"
  82736. #23
  82737. namespace boost {
  82738. #40
  82739. template < class Predicate , class BidiIterator , class charT , class traits >
  82740. inline unsigned int regex_grep ( Predicate foo ,
  82741. BidiIterator first ,
  82742. BidiIterator last ,
  82743. const basic_regex < charT , traits > & e ,
  82744. match_flag_type flags = match_default )
  82745. {
  82746. if ( e . flags ( ) & regex_constants :: failbit )
  82747. return false ;
  82748.  
  82749. typedef typename match_results < BidiIterator > :: allocator_type match_allocator_type ;
  82750.  
  82751. match_results < BidiIterator > m ;
  82752. re_detail :: perl_matcher < BidiIterator , match_allocator_type , traits > matcher ( first , last , m , e , flags , first
  82753. #53
  82754. ) ;
  82755. unsigned int count = 0 ;
  82756. while ( matcher . find ( ) )
  82757. {
  82758. ++ count ;
  82759. if ( 0 == foo ( m ) )
  82760. return count ;
  82761. if ( m [ 0 ] . second == last )
  82762. return count ;
  82763. if ( m . length ( ) == 0 )
  82764. {
  82765. if ( m [ 0 ] . second == last )
  82766. return count ;
  82767.  
  82768.  
  82769. match_results < BidiIterator , match_allocator_type > m2 ( m ) ;
  82770. matcher . setf ( match_not_null | match_continuous ) ;
  82771. if ( matcher . find ( ) )
  82772. {
  82773. ++ count ;
  82774. if ( 0 == foo ( m ) )
  82775. return count ;
  82776. }
  82777. else
  82778. {
  82779.  
  82780. m = m2 ;
  82781. }
  82782. matcher . unsetf ( ( match_not_null | match_continuous ) & ~ flags ) ;
  82783. }
  82784. }
  82785. return count ;
  82786. }
  82787. #94
  82788. template < class Predicate , class charT , class traits >
  82789. inline unsigned int regex_grep ( Predicate foo , const charT * str ,
  82790. const basic_regex < charT , traits > & e ,
  82791. match_flag_type flags = match_default )
  82792. {
  82793. return regex_grep ( foo , str , str + traits :: length ( str ) , e , flags ) ;
  82794. }
  82795.  
  82796. template < class Predicate , class ST , class SA , class charT , class traits >
  82797. inline unsigned int regex_grep ( Predicate foo , const std :: basic_string < charT , ST , SA > & s ,
  82798. const basic_regex < charT , traits > & e ,
  82799. match_flag_type flags = match_default )
  82800. {
  82801. return regex_grep ( foo , s . begin ( ) , s . end ( ) , e , flags ) ;
  82802. }
  82803. #152
  82804. }
  82805. #1 "./boost/regex/v4/regex_replace.hpp"
  82806. #25
  82807. namespace boost {
  82808. #38
  82809. template < class OutputIterator , class BidirectionalIterator , class traits , class charT , class Formatter >
  82810. OutputIterator regex_replace ( OutputIterator out ,
  82811. BidirectionalIterator first ,
  82812. BidirectionalIterator last ,
  82813. const basic_regex < charT , traits > & e ,
  82814. Formatter fmt ,
  82815. match_flag_type flags = match_default )
  82816. {
  82817. regex_iterator < BidirectionalIterator , charT , traits > i ( first , last , e , flags ) ;
  82818. regex_iterator < BidirectionalIterator , charT , traits > j ;
  82819. if ( i == j )
  82820. {
  82821. if ( ! ( flags & regex_constants :: format_no_copy ) )
  82822. out = re_detail :: copy ( first , last , out ) ;
  82823. }
  82824. else
  82825. {
  82826. BidirectionalIterator last_m ( first ) ;
  82827. while ( i != j )
  82828. {
  82829. if ( ! ( flags & regex_constants :: format_no_copy ) )
  82830. out = re_detail :: copy ( i -> prefix ( ) . first , i -> prefix ( ) . second , out ) ;
  82831. out = i -> format ( out , fmt , flags , e ) ;
  82832. last_m = ( * i ) [ 0 ] . second ;
  82833. if ( flags & regex_constants :: format_first_only )
  82834. break ;
  82835. ++ i ;
  82836. }
  82837. if ( ! ( flags & regex_constants :: format_no_copy ) )
  82838. out = re_detail :: copy ( last_m , last , out ) ;
  82839. }
  82840. return out ;
  82841. }
  82842.  
  82843. template < class traits , class charT , class Formatter >
  82844. std :: basic_string < charT > regex_replace ( const std :: basic_string < charT > & s ,
  82845. const basic_regex < charT , traits > & e ,
  82846. Formatter fmt ,
  82847. match_flag_type flags = match_default )
  82848. {
  82849. std :: basic_string < charT > result ;
  82850. re_detail :: string_out_iterator < std :: basic_string < charT > > i ( result ) ;
  82851. regex_replace ( i , s . begin ( ) , s . end ( ) , e , fmt , flags ) ;
  82852. return result ;
  82853. }
  82854. #95
  82855. }
  82856. #1 "./boost/regex/v4/regex_merge.hpp"
  82857. #25
  82858. namespace boost {
  82859. #38
  82860. template < class OutputIterator , class Iterator , class traits , class charT >
  82861. inline OutputIterator regex_merge ( OutputIterator out ,
  82862. Iterator first ,
  82863. Iterator last ,
  82864. const basic_regex < charT , traits > & e ,
  82865. const charT * fmt ,
  82866. match_flag_type flags = match_default )
  82867. {
  82868. return regex_replace ( out , first , last , e , fmt , flags ) ;
  82869. }
  82870.  
  82871. template < class OutputIterator , class Iterator , class traits , class charT >
  82872. inline OutputIterator regex_merge ( OutputIterator out ,
  82873. Iterator first ,
  82874. Iterator last ,
  82875. const basic_regex < charT , traits > & e ,
  82876. const std :: basic_string < charT > & fmt ,
  82877. match_flag_type flags = match_default )
  82878. {
  82879. return regex_merge ( out , first , last , e , fmt . c_str ( ) , flags ) ;
  82880. }
  82881.  
  82882. template < class traits , class charT >
  82883. inline std :: basic_string < charT > regex_merge ( const std :: basic_string < charT > & s ,
  82884. const basic_regex < charT , traits > & e ,
  82885. const charT * fmt ,
  82886. match_flag_type flags = match_default )
  82887. {
  82888. return regex_replace ( s , e , fmt , flags ) ;
  82889. }
  82890.  
  82891. template < class traits , class charT >
  82892. inline std :: basic_string < charT > regex_merge ( const std :: basic_string < charT > & s ,
  82893. const basic_regex < charT , traits > & e ,
  82894. const std :: basic_string < charT > & fmt ,
  82895. match_flag_type flags = match_default )
  82896. {
  82897. return regex_replace ( s , e , fmt , flags ) ;
  82898. }
  82899. #89
  82900. }
  82901. #1 "./boost/regex/v4/regex_split.hpp"
  82902. #24
  82903. namespace boost {
  82904. #42
  82905. namespace re_detail {
  82906.  
  82907. template < class charT >
  82908. const basic_regex < charT > & get_default_expression ( charT )
  82909. {
  82910. static const charT expression_text [ 4 ] = { '\\' , 's' , '+' , '\00' , } ;
  82911. static const basic_regex < charT > e ( expression_text ) ;
  82912. return e ;
  82913. }
  82914.  
  82915. template < class OutputIterator , class charT , class Traits1 , class Alloc1 >
  82916. class split_pred
  82917. {
  82918. typedef std :: basic_string < charT , Traits1 , Alloc1 > string_type ;
  82919. typedef typename string_type :: const_iterator iterator_type ;
  82920. iterator_type * p_last ;
  82921. OutputIterator * p_out ;
  82922. std :: size_t * p_max ;
  82923. std :: size_t initial_max ;
  82924. public :
  82925. split_pred ( iterator_type * a , OutputIterator * b , std :: size_t * c )
  82926. : p_last ( a ) , p_out ( b ) , p_max ( c ) , initial_max ( * c ) { }
  82927.  
  82928. bool operator ( ) ( const match_results < iterator_type > & what ) ;
  82929. } ;
  82930.  
  82931. template < class OutputIterator , class charT , class Traits1 , class Alloc1 >
  82932. bool split_pred < OutputIterator , charT , Traits1 , Alloc1 > :: operator ( )
  82933. ( const match_results < iterator_type > & what )
  82934. {
  82935. * p_last = what [ 0 ] . second ;
  82936. if ( what . size ( ) > 1 )
  82937. {
  82938.  
  82939. for ( unsigned i = 1 ; i < what . size ( ) ; ++ i )
  82940. {
  82941. * ( * p_out ) = what . str ( i ) ;
  82942. ++ ( * p_out ) ;
  82943. if ( 0 == -- * p_max ) return false ;
  82944. }
  82945. return * p_max != 0 ;
  82946. }
  82947. else
  82948. {
  82949.  
  82950. const sub_match < iterator_type > & sub = what [ - 1 ] ;
  82951. if ( ( sub . first != sub . second ) || ( * p_max != initial_max ) )
  82952. {
  82953. * ( * p_out ) = sub . str ( ) ;
  82954. ++ ( * p_out ) ;
  82955. return -- * p_max ;
  82956. }
  82957. }
  82958.  
  82959.  
  82960. return true ;
  82961. }
  82962.  
  82963. }
  82964.  
  82965. template < class OutputIterator , class charT , class Traits1 , class Alloc1 , class Traits2 >
  82966. std :: size_t regex_split ( OutputIterator out ,
  82967. std :: basic_string < charT , Traits1 , Alloc1 > & s ,
  82968. const basic_regex < charT , Traits2 > & e ,
  82969. match_flag_type flags ,
  82970. std :: size_t max_split )
  82971. {
  82972. typedef typename std :: basic_string < charT , Traits1 , Alloc1 > :: const_iterator ci_t ;
  82973.  
  82974. ci_t last = s . begin ( ) ;
  82975. std :: size_t init_size = max_split ;
  82976. re_detail :: split_pred < OutputIterator , charT , Traits1 , Alloc1 > pred ( & last , & out , & max_split ) ;
  82977. ci_t i , j ;
  82978. i = s . begin ( ) ;
  82979. j = s . end ( ) ;
  82980. regex_grep ( pred , i , j , e , flags ) ;
  82981.  
  82982.  
  82983.  
  82984.  
  82985. if ( max_split && ( last != s . end ( ) ) && ( e . mark_count ( ) == 1 ) )
  82986. {
  82987. * out = std :: basic_string < charT , Traits1 , Alloc1 > ( ( ci_t ) last , ( ci_t ) s . end ( ) ) ;
  82988. ++ out ;
  82989. last = s . end ( ) ;
  82990. -- max_split ;
  82991. }
  82992.  
  82993.  
  82994. s . erase ( 0 , last - s . begin ( ) ) ;
  82995.  
  82996.  
  82997. return init_size - max_split ;
  82998. }
  82999.  
  83000. template < class OutputIterator , class charT , class Traits1 , class Alloc1 , class Traits2 >
  83001. inline std :: size_t regex_split ( OutputIterator out ,
  83002. std :: basic_string < charT , Traits1 , Alloc1 > & s ,
  83003. const basic_regex < charT , Traits2 > & e ,
  83004. match_flag_type flags = match_default )
  83005. {
  83006. return regex_split ( out , s , e , flags , 4294967295U ) ;
  83007. }
  83008.  
  83009. template < class OutputIterator , class charT , class Traits1 , class Alloc1 >
  83010. inline std :: size_t regex_split ( OutputIterator out ,
  83011. std :: basic_string < charT , Traits1 , Alloc1 > & s )
  83012. {
  83013. return regex_split ( out , s , re_detail :: get_default_expression ( charT ( 0 ) ) , match_default , 4294967295U ) ;
  83014. }
  83015. #168
  83016. }
  83017. #1 "./boost/cregex.hpp"
  83018. #1 "./boost/regex/v4/cregex.hpp"
  83019. #48
  83020. namespace boost {
  83021. extern "C" {
  83022.  
  83023.  
  83024.  
  83025. typedef std :: ptrdiff_t regoff_t ;
  83026. typedef std :: size_t regsize_t ;
  83027.  
  83028.  
  83029.  
  83030.  
  83031.  
  83032. typedef struct
  83033. {
  83034. unsigned int re_magic ;
  83035.  
  83036. std :: size_t re_nsub ;
  83037.  
  83038.  
  83039.  
  83040. const char * re_endp ;
  83041. void * guts ;
  83042. match_flag_type eflags ;
  83043. } regex_tA ;
  83044.  
  83045.  
  83046. typedef struct
  83047. {
  83048. unsigned int re_magic ;
  83049.  
  83050. std :: size_t re_nsub ;
  83051.  
  83052.  
  83053.  
  83054. const wchar_t * re_endp ;
  83055. void * guts ;
  83056. match_flag_type eflags ;
  83057. } regex_tW ;
  83058.  
  83059.  
  83060. typedef struct
  83061. {
  83062. regoff_t rm_so ;
  83063. regoff_t rm_eo ;
  83064. } regmatch_t ;
  83065.  
  83066.  
  83067. typedef enum {
  83068. REG_BASIC = 0000 ,
  83069. REG_EXTENDED = 0001 ,
  83070. REG_ICASE = 0002 ,
  83071. REG_NOSUB = 0004 ,
  83072. REG_NEWLINE = 0010 ,
  83073. REG_NOSPEC = 0020 ,
  83074. REG_PEND = 0040 ,
  83075. REG_DUMP = 0200 ,
  83076. REG_NOCOLLATE = 0400 ,
  83077. REG_ESCAPE_IN_LISTS = 01000 ,
  83078. REG_NEWLINE_ALT = 02000 ,
  83079. REG_PERLEX = 04000 ,
  83080.  
  83081. REG_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS | REG_PERLEX ,
  83082. REG_AWK = REG_EXTENDED | REG_ESCAPE_IN_LISTS ,
  83083. REG_GREP = REG_BASIC | REG_NEWLINE_ALT ,
  83084. REG_EGREP = REG_EXTENDED | REG_NEWLINE_ALT ,
  83085.  
  83086. REG_ASSERT = 15 ,
  83087. REG_INVARG = 16 ,
  83088. REG_ATOI = 255 ,
  83089. REG_ITOA = 0400
  83090. } reg_comp_flags ;
  83091.  
  83092.  
  83093. typedef enum {
  83094. REG_NOTBOL = 00001 ,
  83095. REG_NOTEOL = 00002 ,
  83096. REG_STARTEND = 00004
  83097. } reg_exec_flags ;
  83098.  
  83099.  
  83100.  
  83101.  
  83102. typedef unsigned reg_error_t ;
  83103. typedef reg_error_t reg_errcode_t ;
  83104.  
  83105. static const reg_error_t REG_NOERROR = 0 ;
  83106. static const reg_error_t REG_NOMATCH = 1 ;
  83107.  
  83108.  
  83109.  
  83110. static const reg_error_t REG_BADPAT = 2 ;
  83111. static const reg_error_t REG_ECOLLATE = 3 ;
  83112. static const reg_error_t REG_ECTYPE = 4 ;
  83113. static const reg_error_t REG_EESCAPE = 5 ;
  83114. static const reg_error_t REG_ESUBREG = 6 ;
  83115. static const reg_error_t REG_EBRACK = 7 ;
  83116. static const reg_error_t REG_EPAREN = 8 ;
  83117. static const reg_error_t REG_EBRACE = 9 ;
  83118. static const reg_error_t REG_BADBR = 10 ;
  83119. static const reg_error_t REG_ERANGE = 11 ;
  83120. static const reg_error_t REG_ESPACE = 12 ;
  83121. static const reg_error_t REG_BADRPT = 13 ;
  83122. static const reg_error_t REG_EEND = 14 ;
  83123. static const reg_error_t REG_ESIZE = 15 ;
  83124. static const reg_error_t REG_ERPAREN = 8 ;
  83125. static const reg_error_t REG_EMPTY = 17 ;
  83126. static const reg_error_t REG_E_MEMORY = 15 ;
  83127. static const reg_error_t REG_ECOMPLEXITY = 18 ;
  83128. static const reg_error_t REG_ESTACK = 19 ;
  83129. static const reg_error_t REG_E_PERL = 20 ;
  83130. static const reg_error_t REG_E_UNKNOWN = 21 ;
  83131. static const reg_error_t REG_ENOSYS = 21 ;
  83132.  
  83133. int regcompA ( regex_tA * , const char * , int ) ;
  83134. regsize_t regerrorA ( int , const regex_tA * , char * , regsize_t ) ;
  83135. int regexecA ( const regex_tA * , const char * , regsize_t , regmatch_t * , int ) ;
  83136. void regfreeA ( regex_tA * ) ;
  83137.  
  83138.  
  83139. int regcompW ( regex_tW * , const wchar_t * , int ) ;
  83140. regsize_t regerrorW ( int , const regex_tW * , wchar_t * , regsize_t ) ;
  83141. int regexecW ( const regex_tW * , const wchar_t * , regsize_t , regmatch_t * , int ) ;
  83142. void regfreeW ( regex_tW * ) ;
  83143. #199
  83144. }
  83145. }
  83146. #209
  83147. namespace boost {
  83148. #222
  83149. class RegEx ;
  83150.  
  83151. namespace re_detail {
  83152.  
  83153. class RegExData ;
  83154. struct pred1 ;
  83155. struct pred2 ;
  83156. struct pred3 ;
  83157. struct pred4 ;
  83158.  
  83159. }
  83160. #239
  83161. typedef bool ( * GrepCallback ) ( const RegEx & expression ) ;
  83162. typedef bool ( * GrepFileCallback ) ( const char * file , const RegEx & expression ) ;
  83163. typedef bool ( * FindFilesCallback ) ( const char * file ) ;
  83164.  
  83165.  
  83166. class RegEx
  83167. {
  83168. private :
  83169. re_detail :: RegExData * pdata ;
  83170. public :
  83171. RegEx ( ) ;
  83172. RegEx ( const RegEx & o ) ;
  83173. ~ RegEx ( ) ;
  83174. explicit RegEx ( const char * c , bool icase = false ) ;
  83175. explicit RegEx ( const std :: string & s , bool icase = false ) ;
  83176. RegEx & operator = ( const RegEx & o ) ;
  83177. RegEx & operator = ( const char * p ) ;
  83178. RegEx & operator = ( const std :: string & s ) { return this -> operator = ( s . c_str ( ) ) ; }
  83179. unsigned int SetExpression ( const char * p , bool icase = false ) ;
  83180. unsigned int SetExpression ( const std :: string & s , bool icase = false ) { return SetExpression ( s . c_str ( ) , icase
  83181. #258
  83182. ) ; }
  83183. std :: string Expression ( ) const ;
  83184. unsigned int error_code ( ) const ;
  83185.  
  83186.  
  83187.  
  83188. bool Match ( const char * p , match_flag_type flags = match_default ) ;
  83189. bool Match ( const std :: string & s , match_flag_type flags = match_default ) { return Match ( s . c_str ( ) , flags ) ;
  83190. #265
  83191. }
  83192. bool Search ( const char * p , match_flag_type flags = match_default ) ;
  83193. bool Search ( const std :: string & s , match_flag_type flags = match_default ) { return Search ( s . c_str ( ) , flags )
  83194. #267
  83195. ; }
  83196. unsigned int Grep ( GrepCallback cb , const char * p , match_flag_type flags = match_default ) ;
  83197. unsigned int Grep ( GrepCallback cb , const std :: string & s , match_flag_type flags = match_default ) { return Grep ( cb
  83198. #269
  83199. , s . c_str ( ) , flags ) ; }
  83200. unsigned int Grep ( std :: vector < std :: string > & v , const char * p , match_flag_type flags = match_default ) ;
  83201. unsigned int Grep ( std :: vector < std :: string > & v , const std :: string & s , match_flag_type flags = match_default
  83202. #271
  83203. ) { return Grep ( v , s . c_str ( ) , flags ) ; }
  83204. unsigned int Grep ( std :: vector < std :: size_t > & v , const char * p , match_flag_type flags = match_default ) ;
  83205. unsigned int Grep ( std :: vector < std :: size_t > & v , const std :: string & s , match_flag_type flags = match_default
  83206. #273
  83207. ) { return Grep ( v , s . c_str ( ) , flags ) ; }
  83208.  
  83209. unsigned int GrepFiles ( GrepFileCallback cb , const char * files , bool recurse = false , match_flag_type flags = match_default
  83210. #275
  83211. ) ;
  83212. unsigned int GrepFiles ( GrepFileCallback cb , const std :: string & files , bool recurse = false , match_flag_type flags
  83213. #276
  83214. = match_default ) { return GrepFiles ( cb , files . c_str ( ) , recurse , flags ) ; }
  83215. unsigned int FindFiles ( FindFilesCallback cb , const char * files , bool recurse = false , match_flag_type flags = match_default
  83216. #277
  83217. ) ;
  83218. unsigned int FindFiles ( FindFilesCallback cb , const std :: string & files , bool recurse = false , match_flag_type flags
  83219. #278
  83220. = match_default ) { return FindFiles ( cb , files . c_str ( ) , recurse , flags ) ; }
  83221.  
  83222.  
  83223. std :: string Merge ( const std :: string & in , const std :: string & fmt ,
  83224. bool copy = true , match_flag_type flags = match_default ) ;
  83225. std :: string Merge ( const char * in , const char * fmt ,
  83226. bool copy = true , match_flag_type flags = match_default ) ;
  83227.  
  83228. std :: size_t Split ( std :: vector < std :: string > & v , std :: string & s , match_flag_type flags = match_default , unsigned
  83229. #286
  83230. max_count = ~ 0 ) ;
  83231.  
  83232.  
  83233.  
  83234. std :: size_t Position ( int i = 0 ) const ;
  83235. std :: size_t Length ( int i = 0 ) const ;
  83236. bool Matched ( int i = 0 ) const ;
  83237. std :: size_t Marks ( ) const ;
  83238. std :: string What ( int i = 0 ) const ;
  83239. std :: string operator [ ] ( int i ) const { return What ( i ) ; }
  83240.  
  83241. static const std :: size_t npos ;
  83242.  
  83243. friend struct re_detail :: pred1 ;
  83244. friend struct re_detail :: pred2 ;
  83245. friend struct re_detail :: pred3 ;
  83246. friend struct re_detail :: pred4 ;
  83247. } ;
  83248. #316
  83249. }
  83250. #1 "./boost/regex/v4/fileiter.hpp"
  83251. #1 "./boost/assert.hpp"
  83252. #1 "/usr/include/assert.h"
  83253. #1 "/opt/SolarisStudio12.4-beta_jul14-solaris-x86/lib/compilers/CC-gcc/include/c++/4.8.2/cassert"
  83254. #41
  83255. #pragma GCC system_header
  83256. #1 "/usr/include/assert.h"
  83257. #1 "/usr/include/dirent.h"
  83258. #16
  83259. #pragma ident "@(#)dirent.h 1.37    04/09/28 SMI"
  83260. #1 "/usr/include/sys/dirent.h"
  83261. #16
  83262. #pragma ident "@(#)dirent.h 1.36    04/09/28 SMI"
  83263. #21
  83264. extern "C" {
  83265.  
  83266.  
  83267.  
  83268.  
  83269.  
  83270. typedef struct dirent {
  83271. ino_t d_ino ;
  83272. off_t d_off ;
  83273. unsigned short d_reclen ;
  83274. char d_name [ 1 ] ;
  83275. } dirent_t ;
  83276. #52
  83277. typedef struct dirent64 {
  83278. ino64_t d_ino ;
  83279. off64_t d_off ;
  83280. unsigned short d_reclen ;
  83281. char d_name [ 1 ] ;
  83282. } dirent64_t ;
  83283. #93
  83284. #pragma redefine_extname getdents64 getdents
  83285. #102
  83286. extern int getdents ( int , struct dirent * , size_t ) ;
  83287. #113
  83288. }
  83289. #24 "/usr/include/dirent.h"
  83290. extern "C" {
  83291. #46
  83292. typedef struct {
  83293. int d_fd ;
  83294. int d_loc ;
  83295. int d_size ;
  83296. char * d_buf ;
  83297. } DIR ;
  83298. #73
  83299. #pragma redefine_extname readdir64 readdir
  83300. #pragma redefine_extname scandir64 scandir
  83301. #pragma redefine_extname alphasort64 alphasort
  83302. #83
  83303. extern DIR * opendir ( const char * ) ;
  83304.  
  83305.  
  83306. extern DIR * fdopendir ( int ) ;
  83307.  
  83308.  
  83309. extern int scandir ( const char * , struct dirent * ( * [ ] ) ,
  83310. int ( * ) ( const struct dirent * ) ,
  83311. int ( * ) ( const struct dirent * * ,
  83312. const struct dirent * * ) ) ;
  83313. extern int alphasort ( const struct dirent * * ,
  83314. const struct dirent * * ) ;
  83315.  
  83316. extern struct dirent * readdir ( DIR * ) ;
  83317.  
  83318.  
  83319. extern long telldir ( DIR * ) ;
  83320. extern void seekdir ( DIR * , long ) ;
  83321.  
  83322. extern void rewinddir ( DIR * ) ;
  83323. extern int closedir ( DIR * ) ;
  83324.  
  83325.  
  83326.  
  83327.  
  83328. extern struct dirent64 * readdir64 ( DIR * ) ;
  83329.  
  83330. extern int scandir64 ( const char * , struct dirent64 * ( * [ ] ) ,
  83331. int ( * ) ( const struct dirent64 * ) ,
  83332. int ( * ) ( const struct dirent64 * * ,
  83333. const struct dirent64 * * ) ) ;
  83334. extern int alphasort64 ( const struct dirent64 * * , const struct dirent64 * * ) ;
  83335. #204
  83336. #pragma redefine_extname readdir64_r readdir_r
  83337. #215
  83338. extern int readdir_r ( DIR * , struct dirent * ,
  83339. struct dirent * * ) ;
  83340. #223
  83341. extern int readdir64_r ( DIR * , struct dirent64 * ,
  83342. struct dirent64 * * ) ;
  83343. #290
  83344. }
  83345. #79 "./boost/regex/v4/fileiter.hpp"
  83346. using std :: list ;
  83347. #86
  83348. namespace boost {
  83349. namespace re_detail {
  83350.  
  83351.  
  83352.  
  83353.  
  83354.  
  83355. struct _fi_find_data
  83356. {
  83357. unsigned dwFileAttributes ;
  83358. char cFileName [ 256 ] ;
  83359. } ;
  83360.  
  83361. struct _fi_priv_data ;
  83362.  
  83363. typedef _fi_priv_data * _fi_find_handle ;
  83364.  
  83365.  
  83366.  
  83367. _fi_find_handle _fi_FindFirstFile ( const char * lpFileName , _fi_find_data * lpFindFileData ) ;
  83368. bool _fi_FindNextFile ( _fi_find_handle hFindFile , _fi_find_data * lpFindFileData ) ;
  83369. bool _fi_FindClose ( _fi_find_handle hFindFile ) ;
  83370.  
  83371.  
  83372.  
  83373.  
  83374.  
  83375. }
  83376. }
  83377. #132
  83378. namespace boost {
  83379. namespace re_detail {
  83380. #165
  83381. class mapfile_iterator ;
  83382.  
  83383. class mapfile
  83384. {
  83385. typedef char * pointer ;
  83386. std :: FILE * hfile ;
  83387. long int _size ;
  83388. pointer * _first ;
  83389. pointer * _last ;
  83390. mutable std :: list < pointer * > condemed ;
  83391. enum sizes
  83392. {
  83393. buf_size = 4096
  83394. } ;
  83395. void lock ( pointer * node ) const ;
  83396. void unlock ( pointer * node ) const ;
  83397. public :
  83398.  
  83399. typedef mapfile_iterator iterator ;
  83400.  
  83401. mapfile ( ) { hfile = 0 ; _size = 0 ; _first = _last = 0 ; }
  83402. mapfile ( const char * file ) { hfile = 0 ; _size = 0 ; _first = _last = 0 ; open ( file ) ; }
  83403. ~ mapfile ( ) { close ( ) ; }
  83404. void open ( const char * file ) ;
  83405. void close ( ) ;
  83406. iterator begin ( ) const ;
  83407. iterator end ( ) const ;
  83408. unsigned long size ( ) const { return _size ; }
  83409. bool valid ( ) const { return hfile != 0 ; }
  83410. friend class mapfile_iterator ;
  83411. } ;
  83412.  
  83413. class mapfile_iterator
  83414.  
  83415. : public std :: iterator < std :: random_access_iterator_tag , char >
  83416.  
  83417. {
  83418. typedef mapfile :: pointer internal_pointer ;
  83419. internal_pointer * node ;
  83420. const mapfile * file ;
  83421. unsigned long offset ;
  83422. long position ( ) const
  83423. {
  83424. return file ? ( ( node - file -> _first ) * mapfile :: buf_size + offset ) : 0 ;
  83425. }
  83426. void position ( long pos )
  83427. {
  83428. if ( file )
  83429. {
  83430. node = file -> _first + ( pos / mapfile :: buf_size ) ;
  83431. offset = pos % mapfile :: buf_size ;
  83432. }
  83433. }
  83434. public :
  83435. typedef std :: ptrdiff_t difference_type ;
  83436. typedef char value_type ;
  83437. typedef const char * pointer ;
  83438. typedef const char & reference ;
  83439. typedef std :: random_access_iterator_tag iterator_category ;
  83440.  
  83441. mapfile_iterator ( ) { node = 0 ; file = 0 ; offset = 0 ; }
  83442. mapfile_iterator ( const mapfile * f , long arg_position )
  83443. {
  83444. file = f ;
  83445. node = f -> _first + arg_position / mapfile :: buf_size ;
  83446. offset = arg_position % mapfile :: buf_size ;
  83447. if ( file )
  83448. file -> lock ( node ) ;
  83449. }
  83450. mapfile_iterator ( const mapfile_iterator & i )
  83451. {
  83452. file = i . file ;
  83453. node = i . node ;
  83454. offset = i . offset ;
  83455. if ( file )
  83456. file -> lock ( node ) ;
  83457. }
  83458. ~ mapfile_iterator ( )
  83459. {
  83460. if ( file && node )
  83461. file -> unlock ( node ) ;
  83462. }
  83463. mapfile_iterator & operator = ( const mapfile_iterator & i ) ;
  83464. char operator * ( ) const
  83465. {
  83466. ( ( void ) 0 ) ;
  83467. ( ( void ) 0 ) ;
  83468. return file ? * ( * node + sizeof ( int ) + offset ) : char ( 0 ) ;
  83469. }
  83470. char operator [ ] ( long off ) const
  83471. {
  83472. mapfile_iterator tmp ( * this ) ;
  83473. tmp += off ;
  83474. return * tmp ;
  83475. }
  83476. mapfile_iterator & operator ++ ( ) ;
  83477. mapfile_iterator operator ++ ( int ) ;
  83478. mapfile_iterator & operator -- ( ) ;
  83479. mapfile_iterator operator -- ( int ) ;
  83480.  
  83481. mapfile_iterator & operator += ( long off )
  83482. {
  83483. position ( position ( ) + off ) ;
  83484. return * this ;
  83485. }
  83486. mapfile_iterator & operator -= ( long off )
  83487. {
  83488. position ( position ( ) - off ) ;
  83489. return * this ;
  83490. }
  83491.  
  83492. friend inline bool operator == ( const mapfile_iterator & i , const mapfile_iterator & j )
  83493. {
  83494. return ( i . file == j . file ) && ( i . node == j . node ) && ( i . offset == j . offset ) ;
  83495. }
  83496.  
  83497. friend inline bool operator != ( const mapfile_iterator & i , const mapfile_iterator & j )
  83498. {
  83499. return ! ( i == j ) ;
  83500. }
  83501.  
  83502. friend inline bool operator < ( const mapfile_iterator & i , const mapfile_iterator & j )
  83503. {
  83504. return i . position ( ) < j . position ( ) ;
  83505. }
  83506. friend inline bool operator > ( const mapfile_iterator & i , const mapfile_iterator & j )
  83507. {
  83508. return i . position ( ) > j . position ( ) ;
  83509. }
  83510. friend inline bool operator <= ( const mapfile_iterator & i , const mapfile_iterator & j )
  83511. {
  83512. return i . position ( ) <= j . position ( ) ;
  83513. }
  83514. friend inline bool operator >= ( const mapfile_iterator & i , const mapfile_iterator & j )
  83515. {
  83516. return i . position ( ) >= j . position ( ) ;
  83517. }
  83518.  
  83519. friend mapfile_iterator operator + ( const mapfile_iterator & i , long off ) ;
  83520. friend mapfile_iterator operator + ( long off , const mapfile_iterator & i )
  83521. {
  83522. mapfile_iterator tmp ( i ) ;
  83523. return tmp += off ;
  83524. }
  83525. friend mapfile_iterator operator - ( const mapfile_iterator & i , long off ) ;
  83526. friend inline long operator - ( const mapfile_iterator & i , const mapfile_iterator & j )
  83527. {
  83528. return i . position ( ) - j . position ( ) ;
  83529. }
  83530. } ;
  83531.  
  83532.  
  83533.  
  83534.  
  83535. extern const char * _fi_sep ;
  83536.  
  83537. struct file_iterator_ref
  83538. {
  83539. _fi_find_handle hf ;
  83540. _fi_find_data _data ;
  83541. long count ;
  83542. } ;
  83543.  
  83544.  
  83545. class file_iterator
  83546. {
  83547. char * _root ;
  83548. char * _path ;
  83549. char * ptr ;
  83550. file_iterator_ref * ref ;
  83551.  
  83552. public :
  83553. typedef std :: ptrdiff_t difference_type ;
  83554. typedef const char * value_type ;
  83555. typedef const char * * pointer ;
  83556. typedef const char * & reference ;
  83557. typedef std :: input_iterator_tag iterator_category ;
  83558.  
  83559. file_iterator ( ) ;
  83560. file_iterator ( const char * wild ) ;
  83561. ~ file_iterator ( ) ;
  83562. file_iterator ( const file_iterator & ) ;
  83563. file_iterator & operator = ( const file_iterator & ) ;
  83564. const char * root ( ) const { return _root ; }
  83565. const char * path ( ) const { return _path ; }
  83566. const char * name ( ) const { return ptr ; }
  83567. _fi_find_data * data ( ) { return & ( ref -> _data ) ; }
  83568. void next ( ) ;
  83569. file_iterator & operator ++ ( ) { next ( ) ; return * this ; }
  83570. file_iterator operator ++ ( int ) ;
  83571. const char * operator * ( ) { return path ( ) ; }
  83572.  
  83573. friend inline bool operator == ( const file_iterator & f1 , const file_iterator & f2 )
  83574. {
  83575. return ( ( f1 . ref -> hf == 0 ) && ( f2 . ref -> hf == 0 ) ) ;
  83576. }
  83577.  
  83578. friend inline bool operator != ( const file_iterator & f1 , const file_iterator & f2 )
  83579. {
  83580. return ! ( f1 == f2 ) ;
  83581. }
  83582.  
  83583. } ;
  83584.  
  83585.  
  83586. inline bool operator < ( const file_iterator & , const file_iterator & )
  83587. {
  83588. return false ;
  83589. }
  83590.  
  83591.  
  83592. class directory_iterator
  83593. {
  83594. char * _root ;
  83595. char * _path ;
  83596. char * ptr ;
  83597. file_iterator_ref * ref ;
  83598.  
  83599. public :
  83600. typedef std :: ptrdiff_t difference_type ;
  83601. typedef const char * value_type ;
  83602. typedef const char * * pointer ;
  83603. typedef const char * & reference ;
  83604. typedef std :: input_iterator_tag iterator_category ;
  83605.  
  83606. directory_iterator ( ) ;
  83607. directory_iterator ( const char * wild ) ;
  83608. ~ directory_iterator ( ) ;
  83609. directory_iterator ( const directory_iterator & other ) ;
  83610. directory_iterator & operator = ( const directory_iterator & other ) ;
  83611.  
  83612. const char * root ( ) const { return _root ; }
  83613. const char * path ( ) const { return _path ; }
  83614. const char * name ( ) const { return ptr ; }
  83615. _fi_find_data * data ( ) { return & ( ref -> _data ) ; }
  83616. void next ( ) ;
  83617. directory_iterator & operator ++ ( ) { next ( ) ; return * this ; }
  83618. directory_iterator operator ++ ( int ) ;
  83619. const char * operator * ( ) { return path ( ) ; }
  83620.  
  83621. static const char * separator ( ) { return _fi_sep ; }
  83622.  
  83623. friend inline bool operator == ( const directory_iterator & f1 , const directory_iterator & f2 )
  83624. {
  83625. return ( ( f1 . ref -> hf == 0 ) && ( f2 . ref -> hf == 0 ) ) ;
  83626. }
  83627.  
  83628.  
  83629. friend inline bool operator != ( const directory_iterator & f1 , const directory_iterator & f2 )
  83630. {
  83631. return ! ( f1 == f2 ) ;
  83632. }
  83633.  
  83634. } ;
  83635.  
  83636. inline bool operator < ( const directory_iterator & , const directory_iterator & )
  83637. {
  83638. return false ;
  83639. }
  83640. #430
  83641. }
  83642. using boost :: re_detail :: directory_iterator ;
  83643. using boost :: re_detail :: file_iterator ;
  83644. using boost :: re_detail :: mapfile ;
  83645. }
  83646. #28 "libs/regex/src/cregex.cpp"
  83647. typedef boost :: match_flag_type match_flag_type ;
  83648. #38
  83649. namespace boost {
  83650. #51
  83651. namespace {
  83652.  
  83653. template < class iterator >
  83654. std :: string to_string ( iterator i , iterator j )
  83655. {
  83656. std :: string s ;
  83657. while ( i != j )
  83658. {
  83659. s . append ( 1 , * i ) ;
  83660. ++ i ;
  83661. }
  83662. return s ;
  83663. }
  83664.  
  83665. inline std :: string to_string ( const char * i , const char * j )
  83666. {
  83667. return std :: string ( i , j ) ;
  83668. }
  83669.  
  83670. }
  83671. namespace re_detail {
  83672.  
  83673. class RegExData
  83674. {
  83675. public :
  83676. enum type
  83677. {
  83678. type_pc ,
  83679. type_pf ,
  83680. type_copy
  83681. } ;
  83682. regex e ;
  83683. cmatch m ;
  83684.  
  83685. match_results < mapfile :: iterator > fm ;
  83686.  
  83687. type t ;
  83688. const char * pbase ;
  83689.  
  83690. mapfile :: iterator fbase ;
  83691.  
  83692. std :: map < int , std :: string , std :: less < int > > strings ;
  83693. std :: map < int , std :: ptrdiff_t , std :: less < int > > positions ;
  83694. void update ( ) ;
  83695. void clean ( ) ;
  83696. RegExData ( ) : e ( ) , m ( ) ,
  83697.  
  83698. fm ( ) ,
  83699.  
  83700. t ( type_copy ) , pbase ( 0 ) ,
  83701.  
  83702. fbase ( ) ,
  83703.  
  83704. strings ( ) , positions ( ) { }
  83705. } ;
  83706.  
  83707. void RegExData :: update ( )
  83708. {
  83709. strings . erase ( strings . begin ( ) , strings . end ( ) ) ;
  83710. positions . erase ( positions . begin ( ) , positions . end ( ) ) ;
  83711. if ( t == type_pc )
  83712. {
  83713. for ( unsigned int i = 0 ; i < m . size ( ) ; ++ i )
  83714. {
  83715. if ( m [ i ] . matched ) strings [ i ] = std :: string ( m [ i ] . first , m [ i ] . second ) ;
  83716. positions [ i ] = m [ i ] . matched ? m [ i ] . first - pbase : - 1 ;
  83717. }
  83718. }
  83719.  
  83720. else
  83721. {
  83722. for ( unsigned int i = 0 ; i < fm . size ( ) ; ++ i )
  83723. {
  83724. if ( fm [ i ] . matched ) strings [ i ] = to_string ( fm [ i ] . first , fm [ i ] . second ) ;
  83725. positions [ i ] = fm [ i ] . matched ? fm [ i ] . first - fbase : - 1 ;
  83726. }
  83727. }
  83728.  
  83729. t = type_copy ;
  83730. }
  83731.  
  83732. void RegExData :: clean ( )
  83733. {
  83734.  
  83735. fbase = mapfile :: iterator ( ) ;
  83736. fm = match_results < mapfile :: iterator > ( ) ;
  83737.  
  83738. }
  83739.  
  83740. }
  83741.  
  83742. RegEx :: RegEx ( )
  83743. {
  83744. pdata = new re_detail :: RegExData ( ) ;
  83745. }
  83746.  
  83747. RegEx :: RegEx ( const RegEx & o )
  83748. {
  83749. pdata = new re_detail :: RegExData ( * ( o . pdata ) ) ;
  83750. }
  83751.  
  83752. RegEx :: ~ RegEx ( )
  83753. {
  83754. delete pdata ;
  83755. }
  83756.  
  83757. RegEx :: RegEx ( const char * c , bool icase )
  83758. {
  83759. pdata = new re_detail :: RegExData ( ) ;
  83760. SetExpression ( c , icase ) ;
  83761. }
  83762.  
  83763. RegEx :: RegEx ( const std :: string & s , bool icase )
  83764. {
  83765. pdata = new re_detail :: RegExData ( ) ;
  83766. SetExpression ( s . c_str ( ) , icase ) ;
  83767. }
  83768.  
  83769. RegEx & RegEx :: operator = ( const RegEx & o )
  83770. {
  83771. * pdata = * ( o . pdata ) ;
  83772. return * this ;
  83773. }
  83774.  
  83775. RegEx & RegEx :: operator = ( const char * p )
  83776. {
  83777. SetExpression ( p , false ) ;
  83778. return * this ;
  83779. }
  83780.  
  83781. unsigned int RegEx :: SetExpression ( const char * p , bool icase )
  83782. {
  83783. boost :: uint_fast32_t f = icase ? regex :: normal | regex :: icase : regex :: normal ;
  83784. return pdata -> e . set_expression ( p , f ) ;
  83785. }
  83786.  
  83787. unsigned int RegEx :: error_code ( ) const
  83788. {
  83789. return pdata -> e . error_code ( ) ;
  83790. }
  83791.  
  83792.  
  83793. std :: string RegEx :: Expression ( ) const
  83794. {
  83795. return pdata -> e . expression ( ) ;
  83796. }
  83797.  
  83798.  
  83799.  
  83800.  
  83801. bool RegEx :: Match ( const char * p , match_flag_type flags )
  83802. {
  83803. pdata -> t = re_detail :: RegExData :: type_pc ;
  83804. pdata -> pbase = p ;
  83805. const char * end = p ;
  83806. while ( * end ) ++ end ;
  83807.  
  83808. if ( regex_match ( p , end , pdata -> m , pdata -> e , flags ) )
  83809. {
  83810. pdata -> update ( ) ;
  83811. return true ;
  83812. }
  83813. return false ;
  83814. }
  83815.  
  83816. bool RegEx :: Search ( const char * p , match_flag_type flags )
  83817. {
  83818. pdata -> t = re_detail :: RegExData :: type_pc ;
  83819. pdata -> pbase = p ;
  83820. const char * end = p ;
  83821. while ( * end ) ++ end ;
  83822.  
  83823. if ( regex_search ( p , end , pdata -> m , pdata -> e , flags ) )
  83824. {
  83825. pdata -> update ( ) ;
  83826. return true ;
  83827. }
  83828. return false ;
  83829. }
  83830. namespace re_detail {
  83831. struct pred1
  83832. {
  83833. GrepCallback cb ;
  83834. RegEx * pe ;
  83835. pred1 ( GrepCallback c , RegEx * i ) : cb ( c ) , pe ( i ) { }
  83836. bool operator ( ) ( const cmatch & m )
  83837. {
  83838. pe -> pdata -> m = m ;
  83839. return cb ( * pe ) ;
  83840. }
  83841. } ;
  83842. }
  83843. unsigned int RegEx :: Grep ( GrepCallback cb , const char * p , match_flag_type flags )
  83844. {
  83845. pdata -> t = re_detail :: RegExData :: type_pc ;
  83846. pdata -> pbase = p ;
  83847. const char * end = p ;
  83848. while ( * end ) ++ end ;
  83849.  
  83850. unsigned int result = regex_grep ( re_detail :: pred1 ( cb , this ) , p , end , pdata -> e , flags ) ;
  83851. if ( result )
  83852. pdata -> update ( ) ;
  83853. return result ;
  83854. }
  83855. namespace re_detail {
  83856. struct pred2
  83857. {
  83858. std :: vector < std :: string > & v ;
  83859. RegEx * pe ;
  83860. pred2 ( std :: vector < std :: string > & o , RegEx * e ) : v ( o ) , pe ( e ) { }
  83861. bool operator ( ) ( const cmatch & m )
  83862. {
  83863. pe -> pdata -> m = m ;
  83864. v . push_back ( std :: string ( m [ 0 ] . first , m [ 0 ] . second ) ) ;
  83865. return true ;
  83866. }
  83867. private :
  83868. pred2 & operator = ( const pred2 & ) ;
  83869. } ;
  83870. }
  83871.  
  83872. unsigned int RegEx :: Grep ( std :: vector < std :: string > & v , const char * p , match_flag_type flags )
  83873. {
  83874. pdata -> t = re_detail :: RegExData :: type_pc ;
  83875. pdata -> pbase = p ;
  83876. const char * end = p ;
  83877. while ( * end ) ++ end ;
  83878.  
  83879. unsigned int result = regex_grep ( re_detail :: pred2 ( v , this ) , p , end , pdata -> e , flags ) ;
  83880. if ( result )
  83881. pdata -> update ( ) ;
  83882. return result ;
  83883. }
  83884. namespace re_detail {
  83885. struct pred3
  83886. {
  83887. std :: vector < std :: size_t > & v ;
  83888. const char * base ;
  83889. RegEx * pe ;
  83890. pred3 ( std :: vector < std :: size_t > & o , const char * pb , RegEx * p ) : v ( o ) , base ( pb ) , pe ( p ) { }
  83891. bool operator ( ) ( const cmatch & m )
  83892. {
  83893. pe -> pdata -> m = m ;
  83894. v . push_back ( static_cast < std :: size_t > ( m [ 0 ] . first - base ) ) ;
  83895. return true ;
  83896. }
  83897. private :
  83898. pred3 & operator = ( const pred3 & ) ;
  83899. } ;
  83900. }
  83901. unsigned int RegEx :: Grep ( std :: vector < std :: size_t > & v , const char * p , match_flag_type flags )
  83902. {
  83903. pdata -> t = re_detail :: RegExData :: type_pc ;
  83904. pdata -> pbase = p ;
  83905. const char * end = p ;
  83906. while ( * end ) ++ end ;
  83907.  
  83908. unsigned int result = regex_grep ( re_detail :: pred3 ( v , p , this ) , p , end , pdata -> e , flags ) ;
  83909. if ( result )
  83910. pdata -> update ( ) ;
  83911. return result ;
  83912. }
  83913.  
  83914. namespace re_detail {
  83915. struct pred4
  83916. {
  83917. GrepFileCallback cb ;
  83918. RegEx * pe ;
  83919. const char * file ;
  83920. bool ok ;
  83921. pred4 ( GrepFileCallback c , RegEx * i , const char * f ) : cb ( c ) , pe ( i ) , file ( f ) , ok ( true ) { }
  83922. bool operator ( ) ( const match_results < mapfile :: iterator > & m )
  83923. {
  83924. pe -> pdata -> t = RegExData :: type_pf ;
  83925. pe -> pdata -> fm = m ;
  83926. pe -> pdata -> update ( ) ;
  83927. ok = cb ( file , * pe ) ;
  83928. return ok ;
  83929. }
  83930. } ;
  83931. }
  83932. namespace {
  83933. void BuildFileList ( std :: list < std :: string > * pl , const char * files , bool recurse )
  83934. {
  83935. file_iterator start ( files ) ;
  83936. file_iterator end ;
  83937. if ( recurse )
  83938. {
  83939.  
  83940. char buf [ 256 ] ;
  83941. re_detail :: overflow_error_if_not_zero ( re_detail :: strcpy_s ( buf , 256 , start . root ( ) ) ) ;
  83942. if ( * buf == 0 )
  83943. {
  83944. re_detail :: overflow_error_if_not_zero ( re_detail :: strcpy_s ( buf , 256 , "." ) ) ;
  83945. re_detail :: overflow_error_if_not_zero ( re_detail :: strcat_s ( buf , 256 , directory_iterator :: separator ( ) ) ) ;
  83946. re_detail :: overflow_error_if_not_zero ( re_detail :: strcat_s ( buf , 256 , "*" ) ) ;
  83947. }
  83948. else
  83949. {
  83950. re_detail :: overflow_error_if_not_zero ( re_detail :: strcat_s ( buf , 256 , directory_iterator :: separator ( ) ) ) ;
  83951. re_detail :: overflow_error_if_not_zero ( re_detail :: strcat_s ( buf , 256 , "*" ) ) ;
  83952. }
  83953. directory_iterator dstart ( buf ) ;
  83954. directory_iterator dend ;
  83955.  
  83956.  
  83957. const char * ptr = files ;
  83958. while ( * ptr ) ++ ptr ;
  83959. while ( ( ptr != files ) && ( * ptr != * directory_iterator :: separator ( ) ) && ( * ptr != '/' ) ) -- ptr ;
  83960. if ( ptr != files ) ++ ptr ;
  83961.  
  83962. while ( dstart != dend )
  83963. {
  83964.  
  83965. if ( std :: strlen ( dstart . path ( ) ) + std :: strlen ( directory_iterator :: separator ( ) ) + std :: strlen ( ptr )
  83966. #365
  83967. >= 256 )
  83968. {
  83969.  
  83970. ++ dstart ;
  83971. continue ;
  83972. }
  83973.  
  83974.  
  83975.  
  83976. int r = ( std :: sprintf ) ( buf , "%s%s%s" , dstart . path ( ) , directory_iterator :: separator ( ) , ptr ) ;
  83977.  
  83978. if ( r < 0 )
  83979. {
  83980.  
  83981. ++ dstart ;
  83982. continue ;
  83983. }
  83984. BuildFileList ( pl , buf , recurse ) ;
  83985. ++ dstart ;
  83986. }
  83987. }
  83988. while ( start != end )
  83989. {
  83990. pl -> push_back ( * start ) ;
  83991. ++ start ;
  83992. }
  83993. }
  83994. }
  83995.  
  83996. unsigned int RegEx :: GrepFiles ( GrepFileCallback cb , const char * files , bool recurse , match_flag_type flags )
  83997. {
  83998. unsigned int result = 0 ;
  83999. std :: list < std :: string > file_list ;
  84000. BuildFileList ( & file_list , files , recurse ) ;
  84001. std :: list < std :: string > :: iterator start , end ;
  84002. start = file_list . begin ( ) ;
  84003. end = file_list . end ( ) ;
  84004.  
  84005. while ( start != end )
  84006. {
  84007. mapfile map ( ( * start ) . c_str ( ) ) ;
  84008. pdata -> t = re_detail :: RegExData :: type_pf ;
  84009. pdata -> fbase = map . begin ( ) ;
  84010. re_detail :: pred4 pred ( cb , this , ( * start ) . c_str ( ) ) ;
  84011. int r = regex_grep ( pred , map . begin ( ) , map . end ( ) , pdata -> e , flags ) ;
  84012. result += r ;
  84013. ++ start ;
  84014. pdata -> clean ( ) ;
  84015. if ( pred . ok == false )
  84016. return result ;
  84017. }
  84018.  
  84019. return result ;
  84020. }
  84021.  
  84022.  
  84023. unsigned int RegEx :: FindFiles ( FindFilesCallback cb , const char * files , bool recurse , match_flag_type flags )
  84024. {
  84025. unsigned int result = 0 ;
  84026. std :: list < std :: string > file_list ;
  84027. BuildFileList ( & file_list , files , recurse ) ;
  84028. std :: list < std :: string > :: iterator start , end ;
  84029. start = file_list . begin ( ) ;
  84030. end = file_list . end ( ) ;
  84031.  
  84032. while ( start != end )
  84033. {
  84034. mapfile map ( ( * start ) . c_str ( ) ) ;
  84035. pdata -> t = re_detail :: RegExData :: type_pf ;
  84036. pdata -> fbase = map . begin ( ) ;
  84037.  
  84038. if ( regex_search ( map . begin ( ) , map . end ( ) , pdata -> fm , pdata -> e , flags ) )
  84039. {
  84040. ++ result ;
  84041. if ( false == cb ( ( * start ) . c_str ( ) ) )
  84042. return result ;
  84043. }
  84044.  
  84045. ++ start ;
  84046.  
  84047. }
  84048.  
  84049. return result ;
  84050. }
  84051. #455
  84052. std :: string RegEx :: Merge ( const std :: string & in , const std :: string & fmt ,
  84053. bool copy , match_flag_type flags )
  84054. {
  84055. std :: string result ;
  84056. re_detail :: string_out_iterator < std :: string > i ( result ) ;
  84057. if ( ! copy ) flags |= format_no_copy ;
  84058. regex_replace ( i , in . begin ( ) , in . end ( ) , pdata -> e , fmt . c_str ( ) , flags ) ;
  84059. return result ;
  84060. }
  84061.  
  84062. std :: string RegEx :: Merge ( const char * in , const char * fmt ,
  84063. bool copy , match_flag_type flags )
  84064. {
  84065. std :: string result ;
  84066. if ( ! copy ) flags |= format_no_copy ;
  84067. re_detail :: string_out_iterator < std :: string > i ( result ) ;
  84068. regex_replace ( i , in , in + std :: strlen ( in ) , pdata -> e , fmt , flags ) ;
  84069. return result ;
  84070. }
  84071.  
  84072. std :: size_t RegEx :: Split ( std :: vector < std :: string > & v ,
  84073. std :: string & s ,
  84074. match_flag_type flags ,
  84075. unsigned max_count )
  84076. {
  84077. return regex_split ( std :: back_inserter ( v ) , s , pdata -> e , flags , max_count ) ;
  84078. }
  84079. #488
  84080. std :: size_t RegEx :: Position ( int i ) const
  84081. {
  84082. switch ( pdata -> t )
  84083. {
  84084. case re_detail :: RegExData :: type_pc :
  84085. return pdata -> m [ i ] . matched ? pdata -> m [ i ] . first - pdata -> pbase : RegEx :: npos ;
  84086.  
  84087. case re_detail :: RegExData :: type_pf :
  84088. return pdata -> fm [ i ] . matched ? pdata -> fm [ i ] . first - pdata -> fbase : RegEx :: npos ;
  84089.  
  84090. case re_detail :: RegExData :: type_copy :
  84091. {
  84092. std :: map < int , std :: ptrdiff_t , std :: less < int > > :: iterator pos = pdata -> positions . find ( i ) ;
  84093. if ( pos == pdata -> positions . end ( ) )
  84094. return RegEx :: npos ;
  84095. return ( * pos ) . second ;
  84096. }
  84097. }
  84098. return RegEx :: npos ;
  84099. }
  84100.  
  84101. std :: size_t RegEx :: Marks ( ) const
  84102. {
  84103. return pdata -> e . mark_count ( ) ;
  84104. }
  84105.  
  84106.  
  84107. std :: size_t RegEx :: Length ( int i ) const
  84108. {
  84109. switch ( pdata -> t )
  84110. {
  84111. case re_detail :: RegExData :: type_pc :
  84112. return pdata -> m [ i ] . matched ? pdata -> m [ i ] . second - pdata -> m [ i ] . first : RegEx :: npos ;
  84113.  
  84114. case re_detail :: RegExData :: type_pf :
  84115. return pdata -> fm [ i ] . matched ? pdata -> fm [ i ] . second - pdata -> fm [ i ] . first : RegEx :: npos ;
  84116.  
  84117. case re_detail :: RegExData :: type_copy :
  84118. {
  84119. std :: map < int , std :: string , std :: less < int > > :: iterator pos = pdata -> strings . find ( i ) ;
  84120. if ( pos == pdata -> strings . end ( ) )
  84121. return RegEx :: npos ;
  84122. return ( * pos ) . second . size ( ) ;
  84123. }
  84124. }
  84125. return RegEx :: npos ;
  84126. }
  84127.  
  84128. bool RegEx :: Matched ( int i ) const
  84129. {
  84130. switch ( pdata -> t )
  84131. {
  84132. case re_detail :: RegExData :: type_pc :
  84133. return pdata -> m [ i ] . matched ;
  84134.  
  84135. case re_detail :: RegExData :: type_pf :
  84136. return pdata -> fm [ i ] . matched ;
  84137.  
  84138. case re_detail :: RegExData :: type_copy :
  84139. {
  84140. std :: map < int , std :: string , std :: less < int > > :: iterator pos = pdata -> strings . find ( i ) ;
  84141. if ( pos == pdata -> strings . end ( ) )
  84142. return false ;
  84143. return true ;
  84144. }
  84145. }
  84146. return false ;
  84147. }
  84148.  
  84149.  
  84150. std :: string RegEx :: What ( int i ) const
  84151. {
  84152. std :: string result ;
  84153. switch ( pdata -> t )
  84154. {
  84155. case re_detail :: RegExData :: type_pc :
  84156. if ( pdata -> m [ i ] . matched )
  84157. result . assign ( pdata -> m [ i ] . first , pdata -> m [ i ] . second ) ;
  84158. break ;
  84159. case re_detail :: RegExData :: type_pf :
  84160. if ( pdata -> m [ i ] . matched )
  84161. result . assign ( to_string ( pdata -> m [ i ] . first , pdata -> m [ i ] . second ) ) ;
  84162. break ;
  84163. case re_detail :: RegExData :: type_copy :
  84164. {
  84165. std :: map < int , std :: string , std :: less < int > > :: iterator pos = pdata -> strings . find ( i ) ;
  84166. if ( pos != pdata -> strings . end ( ) )
  84167. result = ( * pos ) . second ;
  84168. break ;
  84169. }
  84170. }
  84171. return result ;
  84172. }
  84173.  
  84174. const std :: size_t RegEx :: npos = ~ static_cast < std :: size_t > ( 0 ) ;
  84175.  
  84176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement