/
iterator_helper.hpp
1118 lines (990 loc) · 43.7 KB
/
iterator_helper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* /////////////////////////////////////////////////////////////////////////
* File: stlsoft/util/std/iterator_helper.hpp
*
* Purpose: Definition of iterator class templates and macros for
* abstracting away standard library inconsistencies.
*
* Created: 2nd January 2000
* Updated: 9th March 2010
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2000-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
* any contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
/** \file stlsoft/util/std/iterator_helper.hpp
*
* \brief [C++ only] Definition of iterator class templates and macros for
* abstracting away standard library inconsistencies
* (\ref group__library__utility "Utility" Library).
*/
#ifndef STLSOFT_INCL_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER
#define STLSOFT_INCL_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER_MAJOR 5
# define STLSOFT_VER_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER_MINOR 3
# define STLSOFT_VER_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER_REVISION 1
# define STLSOFT_VER_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER_EDIT 109
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
* Compatibility
*/
/*
[<[STLSOFT-AUTO:NO-UNITTEST]>]
[Incompatibilies-start]
STLSOFT_COMPILER_IS_WATCOM:
[Incompatibilies-end]
*/
/* /////////////////////////////////////////////////////////////////////////
* Includes
*/
#ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
# include <stlsoft/stlsoft.h>
#endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
#ifndef STLSOFT_INCL_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR
# include <stlsoft/util/std/library_discriminator.hpp>
#endif /* !STLSOFT_INCL_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR */
#ifndef STLSOFT_INCL_ITERATOR
# define STLSOFT_INCL_ITERATOR
# include <iterator> // for std::iterator, std::reverse_iterator, std::reverse_bidirectional_iterator
#endif /* !STLSOFT_INCL_ITERATOR */
#ifdef STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED_XXXX
# ifndef STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_POINTER
# include <stlsoft/meta/typefixer/pointer.hpp>
# endif /* !STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_POINTER */
# ifndef STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_POINTER_TYPE
# include <stlsoft/meta/typefixer/pointer_type.hpp>
# endif /* !STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_POINTER_TYPE */
# ifndef STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_REFERENCE
# include <stlsoft/meta/typefixer/reference.hpp>
# endif /* !STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_REFERENCE */
# ifndef STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_REFERENCE_TYPE
# include <stlsoft/meta/typefixer/reference_type.hpp>
# endif /* !STLSOFT_INCL_STLSOFT_META_TYPEFIXER_HPP_REFERENCE_TYPE */
#endif /* STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED */
/* /////////////////////////////////////////////////////////////////////////
* Warnings
*/
/* This is here temporarily, until a better solution can be found. */
#ifdef STLSOFT_COMPILER_IS_MSVC
# pragma warning(disable : 4097) // suppresses: typedef-name 'identifier1' used as synonym for class-name 'identifier2'
#endif /* compiler */
/* /////////////////////////////////////////////////////////////////////////
* Namespace
*/
#ifndef _STLSOFT_NO_NAMESPACE
namespace stlsoft
{
#endif /* _STLSOFT_NO_NAMESPACE */
/* /////////////////////////////////////////////////////////////////////////
* Tested compatibilities
*/
#if !defined(STLSOFT_OVERRIDE_COMPILER_STD_LIBRARY_CHECK)
# if 0
/* Now we Must be either Dinkumware or STLport if compiling with Intel or Visual C++
*/
# if ( defined(STLSOFT_COMPILER_IS_INTEL) || \
( defined(STLSOFT_COMPILER_IS_MSVC) && \
_MSC_VER >= 1200 && \
_MSC_VER < 1310)) && \
( !defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC) && \
!defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT))
# error When compiling with Intel C/C++ or Microsoft Visual C++, only the Dinkumware or STLport STL implementations are currently supported.
# error Please contact Synesis Software (www.synesis.com.au) if you need to support a different STL implementation with these compilers.
# endif /* (Intel || MSVC) && !DinkumWare && !STLport */
# endif /* 0 */
#endif /* !STLSOFT_OVERRIDE_COMPILER_STD_LIBRARY_CHECK */
/* /////////////////////////////////////////////////////////////////////////
* Iterator macros
*/
/* iterator
*
* There are
*
* 1. Form 1. This is the standard (C++-98: 24.2) form, and looks like the following
*
* template< typename C
* , typename V
* , typename D = ptrdiff_t
* , typename P = V*
* , typename R = V&
* >
* struct iterator
* {
* typedef C iterator_category;
* typedef V value_type;
* typedef D difference_type;
* typedef P pointer;
* typedef R reference;
* };
*
* 2. Form 2. This is found with Dinkumware / Visual C++ (versions 4.2, 5.0, 6.0)
*
* template< typename C
* , typename V
* , typename D = ptrdiff_t
* >
* struct iterator
* {
* typedef C iterator_category;
* typedef V value_type;
* typedef D distance_type;
* };
*
* 3. Form 3. This is found in quite old versions of the STL, and in fact does not define
* an iterator template at all. Each container has its own iterator type
*/
#ifdef STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
# undef STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#endif /* !STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT */
#ifdef STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT
# undef STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT
#endif /* !STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT */
#ifdef STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT
# undef STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT
#endif /* !STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT */
#if defined(STLSOFT_COMPILER_IS_GCC) && \
__GNUC__ < 3
/* GCC 2.95 */
# define STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_BORLAND)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC)
# if STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_4_2 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_5_0 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_6_0
/* Visual C++ + Dinkumware (pre v7.0) */
# define STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT
# else
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
# endif /* STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC */
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_MSL)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_HP_SGI)
# if defined(__STL_USE_NAMESPACES)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
# else /* ? __STL_USE_NAMESPACES */
# define STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT
# endif /* __STL_USE_NAMESPACES */
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_HP_SGI_GNU)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_HP_RW)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_SUNPRO_RW)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#elif defined(STLSOFT_CF_STD_LIBRARY_IS_WATCOM_PATCH)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
#else
# error Library version not recognised
#endif /* library */
/* reverse_iterator
*
* There are four known forms for reverse_iterators:
*
* 1. Form 1. This is the standard (C++-98: 24.4.1.1) form, and looks like the following
*
* template <typename I>
* : public iterator< typename iterator_traits<I>::iterator_category,
* typename iterator_traits<I>::value_type,
* typename iterator_traits<I>::difference_type,
* typename iterator_traits<I>::pointer,
* typename iterator_traits<I>::reference>
* {
* . . .
* typedef I iterator_type;
* typedef typename iterator_traits<I>::difference_type difference_type;
* typedef typename iterator_traits<I>::reference reference;
* typedef typename iterator_traits<I>::pointer pointer;
* . . .
* };
*
*
* 2. Form 2. This is effectively standard, but does not derive from std::iterator. It looks
* like the following
*
* template <typename I>
* {
* typedef typename iterator_traits<I>::iterator_category iterator_category;
* typedef typename iterator_traits<I>::value_type value_type;
* typedef typename iterator_traits<I>::difference_type difference_type;
* typedef typename iterator_traits<I>::pointer pointer;
* typedef typename iterator_traits<I>::reference reference;
* . . .
* };
*
* 3. Form 3.
*
* template< typename I
* , typename V
* , typename R = V&
* , typename P = V*
* , typename D = ptrdiff_t
* >
* : public _Ranit<V, D>
* {
* . . .
* typedef _Rt reference_type;
* typedef _Pt pointer_type;
* . . .
* };
*
*
* 4. Form 4.
*
* template< typename I
* , typename IC
* , typename V
* , typename R = V&
* , typename P = V*
* , typename D = ptrdiff_t
* >
* class reverse_iterator
* : public iterator<IC, V, D, P, R>
* {
* typedef D difference_type;
* typedef V value_type;
* typedef R reference;
* typedef P pointer;
* . . .
* };
*
*
* 5. Form 5.
*
* template< typename I
* , typename V
* , typename R = V&
* , typename D = ptrdiff_t
* >
* class reverse_iterator
* : public iterator<I, V, R, D>
* {
* typedef random_access_iterator_tag iterator_category;
* typedef V value_type;
* typedef D difference_type;
* typedef V* pointer;
* typedef R reference;
* . . .
* };
*
*/
#ifdef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# undef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
#endif /* !STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT */
#ifdef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM2_SUPPORT
# undef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM2_SUPPORT
#endif /* !STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM2_SUPPORT */
#ifdef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT
# undef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT
#endif /* !STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT */
#ifdef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM4_SUPPORT
# undef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM4_SUPPORT
#endif /* !STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM4_SUPPORT */
#ifdef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM5_SUPPORT
# undef STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM5_SUPPORT
#endif /* !STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM5_SUPPORT */
/* Determine whether we can support bidirectional iterators
*
* This used to be in each compiler's capability file
* (include/stlsoft/internal/cccap/xxxx.h), but is moved here because it is
* actually a library feature (somewhat dependent on compilers's abilities).
*/
#if defined(STLSOFT_COMPILER_IS_BORLAND)
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
#elif defined(STLSOFT_COMPILER_IS_COMO)
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
#elif defined(STLSOFT_COMPILER_IS_DMC)
# if (__DMC__ >= 0x0829)
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
# endif /* __DMC__ >= 0x0829 */
#elif defined(STLSOFT_COMPILER_IS_GCC)
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
#elif defined(STLSOFT_COMPILER_IS_INTEL)
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
#elif defined(STLSOFT_COMPILER_IS_MSVC)
# if _MSC_VER >= 1200
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
# endif /* _MSC_VER */
#elif defined(STLSOFT_COMPILER_IS_MWERKS)
# define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
#elif defined(STLSOFT_COMPILER_IS_SUNPRO)
# if !defined(STLSOFT_CF_STD_LIBRARY_IS_SUNPRO_RW)
# define STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT
# endif /* !STLSOFT_CF_STD_LIBRARY_IS_SUNPRO_RW */
/* #elif defined(STLSOFT_COMPILER_IS_UNKNOWN) */
/* # define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
#elif defined(STLSOFT_COMPILER_IS_VECTORC)
/* #define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
#elif defined(STLSOFT_COMPILER_IS_WATCOM)
/* #define STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
#else /* ? compiler/library */
# error Compiler/library configuration not recognised. Contact Synesis Software
#endif /* compiler/library */
/* Obsolete definition: STLSOFT_CF_BIDIRECTIONAL_ITERATOR_SUPPORT */
#ifdef STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
# define STLSOFT_CF_BIDIRECTIONAL_ITERATOR_SUPPORT
#else /* ? STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
# ifdef STLSOFT_CF_BIDIRECTIONAL_ITERATOR_SUPPORT
# undef STLSOFT_CF_BIDIRECTIONAL_ITERATOR_SUPPORT
# endif /* STLSOFT_CF_BIDIRECTIONAL_ITERATOR_SUPPORT */
#endif /* STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
#if defined(STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT)
/* Form 1 / Form 5 */
# if defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT)
/* STLport is form 1 when not using the old form */
# if /* defined(__STL_CLASS_PARTIAL_SPECIALIZATION) || \
*/defined(_STLP_CLASS_PARTIAL_SPECIALIZATION)
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# else /* ?_STLP_CLASS_PARTIAL_SPECIALIZATION */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM5_SUPPORT
# endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
# elif defined(STLSOFT_CF_STD_LIBRARY_IS_HP_RW)
/* Borland + HP/RogueWave standard library */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# elif defined(STLSOFT_CF_STD_LIBRARY_IS_HP_SGI_GNU)
/* GCC + Gnu/FSF standard library */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# elif defined(STLSOFT_CF_STD_LIBRARY_IS_MSL)
/* CodeWarrior + MSL */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# elif defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_BORLAND)
/* Borland C++ + Dinkumware */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# elif defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC) && \
( \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_7_0 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_7_1 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_8_0 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_9_0 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_10_0 || \
0 \
)
/* Visual C++ + Dinkumware */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT
# endif /* compiler / library */
/* Form 2 / Form 5 */
# if defined(STLSOFT_CF_STD_LIBRARY_IS_HP_SGI)
/* HP/SGI or HP/SGI/Comeau */
# if defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM2_SUPPORT
# else /* ?__STL_CLASS_PARTIAL_SPECIALIZATION */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM5_SUPPORT
# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
# endif /* compiler / library */
/* Form 3 */
# if defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC) && \
( \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_4_2 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_5_0 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_6_0 || \
0 \
)
/* Visual C++ + Dinkumware */
# define STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT
# endif /* compiler / library */
/* Form 4 */
/* stlsoft_reverse_iterator() */
# if defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM1_SUPPORT) || \
defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM2_SUPPORT)
# define stlsoft_reverse_iterator(I, V, R, P, D) stlsoft_ns_qual_std(reverse_iterator)<I>
# elif defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT)
# define stlsoft_reverse_iterator(I, V, R, P, D) stlsoft_ns_qual_std(reverse_iterator)<I, V, R, P, D>
//# elif defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM4_SUPPORT)
//# define stlsoft_reverse_iterator(I, V, R, P, D) stlsoft_ns_qual_std(reverse_iterator)<I, C, V, R, P, D>
# elif defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM5_SUPPORT)
# define stlsoft_reverse_iterator(I, V, R, P, D) stlsoft_ns_qual_std(reverse_iterator)<I, V, R, D>
# else
# error reverse_iterator form not recognised
# endif /* compiler */
/* stlsoft_reverse_bidirectional_iterator() */
# if defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC) && \
( STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_4_2 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_5_0 || \
STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION == STLSOFT_CF_DINKUMWARE_VC_VERSION_6_0)
# define stlsoft_reverse_bidirectional_iterator(I, V, R, P, D) stlsoft_ns_qual_std(reverse_bidirectional_iterator)<I, V, R, P, D>
# elif defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT) && \
!defined(_STLP_CLASS_PARTIAL_SPECIALIZATION)
# define stlsoft_reverse_bidirectional_iterator(I, V, R, P, D) stlsoft_ns_qual_std(reverse_bidirectional_iterator)<I, V, R, P, D>
# else
# define stlsoft_reverse_bidirectional_iterator(I, V, R, P, D) stlsoft_reverse_iterator(I, V, R, P, D)
# endif /* */
#endif /* STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
/* /////////////////////////////////////////////////////////////////////////
* Iterators
*/
// class iterator_base
/** \brief Base type for <b><code>iterator</code></b> types
*
* \ingroup group__library__utility
*/
//
/** \brief This class abstract std::iterator functionality for deriving classes, hiding
* the inconsistencies and incompatibilities of the various compilers and/or
* libraries supported by the STLSoft libraries.
*
* \ingroup group__library__utility
*
* \param C The iterator category
* \param V The value type
* \param D The distance type
* \param P The pointer type
* \param R The reference type
*/
template< ss_typename_param_k C /* iterator category */
, ss_typename_param_k V /* value type */
, ss_typename_param_k D /* distance type */
, ss_typename_param_k P /* pointer */
, ss_typename_param_k R /* reference */
>
struct iterator_base
#if defined(STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT)
: public stlsoft_ns_qual_std(iterator)<C, V, D, P, R>
#elif defined(STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT)
: public stlsoft_ns_qual_std(iterator)<C, V, D>
#elif defined(STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT)
/* Form 3 does not provide an iterator from which we can derive */
#else
# error Further iterator form discrimination required
#endif /* STLSOFT_ITERATOR_ITERATOR_FORM?_SUPPORT */
{
private:
#if defined(STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT)
typedef stlsoft_ns_qual_std(iterator)<C, V, D, P, R> parent_class_type;
#elif defined(STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT)
typedef stlsoft_ns_qual_std(iterator)<C, V, D> parent_class_type;
#elif defined(STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT)
/* Form 3 does not provide an iterator from which we can derive */
typedef void parent_class_type;
#else
# error Further iterator form discrimination required
#endif /* STLSOFT_ITERATOR_ITERATOR_FORM?_SUPPORT */
# ifdef STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED_XXXX
private:
// iterator_category
enum { has_member_iterator_category = 0 != has_iterator_category<parent_class_type>::value };
// value_type
enum { has_member_value_type = 0 != has_value_type<parent_class_type>::value };
// distance_type
enum { has_member_distance_type = 0 != has_distance_type<parent_class_type>::value };
// pointer
enum { has_member_pointer = 0 != has_pointer<parent_class_type>::value };
enum { has_member_pointer_type = 0 != has_pointer_type<parent_class_type>::value };
// reference
enum { has_member_reference = 0 != has_reference<parent_class_type>::value };
enum { has_member_reference_type = 0 != has_reference_type<parent_class_type>::value };
typedef C iterator_category_candidate;
typedef V value_type_candidate;
typedef D distance_candidate;
typedef P pointer_candidate;
typedef R reference_candidate;
public:
/// The pointer type
typedef ss_typename_type_k select_first_type_if<ss_typename_type_k fixer_pointer_type<parent_class_type, has_member_pointer_type>::pointer_type
, ss_typename_type_k fixer_pointer<parent_class_type, has_member_pointer>::pointer
, has_member_pointer_type
>::type pointer;
/// The reference type
typedef ss_typename_type_k select_first_type_if<ss_typename_type_k fixer_reference_type<parent_class_type, has_member_reference_type>::reference_type
, ss_typename_type_k fixer_reference<parent_class_type, has_member_reference>::reference
, has_member_reference_type
>::type reference;
# else /* ? STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED */
public:
#if defined(STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT)
typedef C iterator_category;
typedef V value_type;
typedef D difference_type;
typedef P pointer;
typedef R reference;
#else
/* Forms 1 or 2 */
typedef ss_typename_type_k parent_class_type::iterator_category iterator_category;
typedef ss_typename_type_k parent_class_type::value_type value_type;
# if defined(STLSOFT_ITERATOR_ITERATOR_FORM1_SUPPORT)
typedef ss_typename_type_k parent_class_type::difference_type difference_type;
typedef ss_typename_type_k parent_class_type::pointer pointer;
typedef ss_typename_type_k parent_class_type::reference reference;
# elif defined(STLSOFT_ITERATOR_ITERATOR_FORM2_SUPPORT)
typedef ss_typename_type_k parent_class_type::distance_type difference_type;
typedef P pointer;
typedef R reference;
# else
# error Further iterator form discrimination required
# endif /* STLSOFT_ITERATOR_ITERATOR_FORM?_SUPPORT */
#endif /* STLSOFT_ITERATOR_ITERATOR_FORM3_SUPPORT */
# endif /* STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED */
/* These two are for compatibility with older non-standard implementations, and
* will be benignly ignored by anything not requiring them.
*/
typedef pointer pointer_type;
typedef reference reference_type;
};
#ifdef STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT
// reverse_iterator_base, const_reverse_iterator_base,
// reverse_bidirectional_iterator_base and const_reverse_bidirectional_iterator_base
//
// These classes act as the base for reverse iterators, insulating deriving
// classes from the inconsistencies and incompatibilities of the various
// compilers and/or libraries supported by the STLSoft libraries.
// class reverse_iterator_base
/** \brief Base type for <b><code>reverse_iterator</code></b> types
*
* \ingroup group__library__utility
*/
//
/** \brief This class acts as the base for reverse iterators, insulating deriving
* classes from the inconsistencies and incompatibilities of the various
* compilers and/or libraries supported by the STLSoft libraries.
*
* \ingroup group__library__utility
*
* \param I The iterator type
* \param V The value type
* \param R The reference type
* \param P The pointer type
* \param D The distance type
*/
template< ss_typename_param_k I /* iterator */
, ss_typename_param_k V /* value type */
, ss_typename_param_k R /* reference */
, ss_typename_param_k P /* pointer */
, ss_typename_param_k D /* distance type */
>
struct reverse_iterator_base
: public stlsoft_reverse_iterator(I, V, R, P, D)
{
public:
typedef stlsoft_reverse_iterator(I, V, R, P, D) parent_class_type;
typedef ss_typename_type_k parent_class_type::iterator_category iterator_category;
typedef ss_typename_type_k parent_class_type::value_type value_type;
# if defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT)
typedef ss_typename_type_k parent_class_type::distance_type difference_type;
typedef ss_typename_type_k parent_class_type::pointer_type pointer;
typedef ss_typename_type_k parent_class_type::reference_type reference;
# else /* ? STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT */
typedef ss_typename_type_k parent_class_type::difference_type difference_type;
typedef ss_typename_type_k parent_class_type::pointer pointer;
typedef ss_typename_type_k parent_class_type::reference reference;
# endif /* STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT */
/* These two are for compatibility with older non-standard implementations, and
* will be benignly ignored by anything not requiring them.
*/
typedef pointer pointer_type;
typedef reference reference_type;
// Construction
public:
/// Constructor
ss_explicit_k reverse_iterator_base(I i)
: parent_class_type(i)
{}
};
// class const_reverse_iterator_base
/** \brief Base type for <b><code>const_reverse_iterator</code></b> types
*
* \ingroup group__library__utility
*/
//
/** \brief This class acts as the base for const reverse iterators, insulating deriving
* classes from the inconsistencies and incompatibilities of the various
* compilers and/or libraries supported by the STLSoft libraries.
*
* \ingroup group__library__utility
*
* \param I The iterator type
* \param V The value type
* \param R The reference type
* \param P The pointer type
* \param D The distance type
*/
template< ss_typename_param_k I /* iterator */
, ss_typename_param_k V /* value type */
, ss_typename_param_k R /* reference */
, ss_typename_param_k P /* pointer */
, ss_typename_param_k D /* distance type */
>
struct const_reverse_iterator_base // For all current compilers/libraries, ...
: public reverse_iterator_base<I, V, R, P, D> // ... this is the same as reverse_iterator_base
{
public:
typedef reverse_iterator_base<I, V, R, P, D> parent_class_type;
/// The iterator category type
typedef ss_typename_type_k parent_class_type::iterator_category iterator_category;
/// The value type
typedef ss_typename_type_k parent_class_type::value_type value_type;
/// The difference type
typedef ss_typename_type_k parent_class_type::difference_type difference_type;
/// The pointer type
typedef ss_typename_type_k parent_class_type::pointer pointer;
/// The reference type
typedef ss_typename_type_k parent_class_type::reference reference;
/* These two are for compatibility with older non-standard implementations, and
* will be benignly ignored by anything not requiring them.
*/
/// The alternate pointer type (for backwards compatibility)
typedef ss_typename_type_k parent_class_type::pointer_type pointer_type;
/// The alternate reference type (for backwards compatibility)
typedef ss_typename_type_k parent_class_type::reference_type reference_type;
// Construction
public:
/// Constructor
ss_explicit_k const_reverse_iterator_base(I i)
: parent_class_type(i)
{}
// This constructor facilitates conversion from mutable (non-const)
// reverse iterators
template< ss_typename_param_k I2
, ss_typename_param_k V2
, ss_typename_param_k R2
, ss_typename_param_k P2
, ss_typename_param_k D2
>
const_reverse_iterator_base(reverse_iterator_base<I2, V2, R2, P2, D2> const& rhs)
: parent_class_type(rhs.base())
{}
};
template< ss_typename_param_k I1, ss_typename_param_k V1, ss_typename_param_k R1, ss_typename_param_k P1, ss_typename_param_k D
, ss_typename_param_k I2, ss_typename_param_k V2, ss_typename_param_k R2, ss_typename_param_k P2
>
inline bool operator !=(
const_reverse_iterator_base<I1, V1, R1, P1, D> const& lhs
, reverse_iterator_base<I2, V2, R2, P2, D> const& rhs
)
{
return lhs.base() != rhs.base();
}
template< ss_typename_param_k I1, ss_typename_param_k V1, ss_typename_param_k R1, ss_typename_param_k P1, ss_typename_param_k D
, ss_typename_param_k I2, ss_typename_param_k V2, ss_typename_param_k R2, ss_typename_param_k P2
>
inline bool operator !=(
reverse_iterator_base<I1, V1, R1, P1, D> const& lhs
, const_reverse_iterator_base<I2, V2, R2, P2, D> const& rhs
)
{
return lhs.base() != rhs.base();
}
template< ss_typename_param_k I1, ss_typename_param_k V1, ss_typename_param_k R1, ss_typename_param_k P1, ss_typename_param_k D
>
inline bool operator !=(
const_reverse_iterator_base<I1, V1, R1, P1, D> const& lhs
, const_reverse_iterator_base<I1, V1, R1, P1, D> const& rhs
)
{
return lhs.base() != rhs.base();
}
// class reverse_bidirectional_iterator_base
/** \brief Base type for <b><code>reverse_bidirectional_iterator</code></b> types
*
* \ingroup group__library__utility
*/
//
/** \brief This class acts as the base for reverse bidirectional iterators,
* insulating deriving classes from the inconsistencies and incompatibilities
* of the various compilers and/or libraries supported by the STLSoft libraries.
*
* \ingroup group__library__utility
*
* \param I The iterator type
* \param V The value type
* \param R The reference type
* \param P The pointer type
* \param D The distance type
*/
template< ss_typename_param_k I /* iterator */
, ss_typename_param_k V /* value type */
, ss_typename_param_k R /* reference */
, ss_typename_param_k P /* pointer */
, ss_typename_param_k D /* distance type */
>
struct reverse_bidirectional_iterator_base
: public stlsoft_reverse_bidirectional_iterator(I, V, R, P, D)
{
public:
typedef stlsoft_reverse_bidirectional_iterator(I, V, R, P, D) parent_class_type;
typedef ss_typename_type_k parent_class_type::iterator_category iterator_category;
typedef ss_typename_type_k parent_class_type::value_type value_type;
# if defined(STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT)
typedef ss_typename_type_k parent_class_type::distance_type difference_type;
typedef ss_typename_type_k parent_class_type::pointer_type pointer;
typedef ss_typename_type_k parent_class_type::reference_type reference;
#else /* ? STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT */
typedef ss_typename_type_k parent_class_type::difference_type difference_type;
typedef ss_typename_type_k parent_class_type::pointer pointer;
typedef ss_typename_type_k parent_class_type::reference reference;
#endif /* STLSOFT_ITERATOR_REVERSE_ITERATOR_FORM3_SUPPORT */
/* These two are for compatibility with older non-standard implementations, and
* will be benignly ignored by anything not requiring them.
*/
typedef pointer pointer_type;
typedef reference reference_type;
// Construction
public:
/// Constructor
ss_explicit_k reverse_bidirectional_iterator_base(I i)
: parent_class_type(i)
{}
};
// class const_reverse_bidirectional_iterator_base
/** \brief Base type for <b><code>const_reverse_bidirectional_iterator</code></b> types
*
* \ingroup group__library__utility
*/
//
/** \brief This class acts as the base for const reverse bidirectional iterators,
* insulating deriving classes from the inconsistencies and incompatibilities
* of the various compilers and/or libraries supported by the STLSoft libraries.
*
* \ingroup group__library__utility
*
* \param I The iterator type
* \param V The value type
* \param R The reference type
* \param P The pointer type
* \param D The distance type
*/
template< ss_typename_param_k I /* iterator */
, ss_typename_param_k V /* value type */
, ss_typename_param_k R /* reference */
, ss_typename_param_k P /* pointer */
, ss_typename_param_k D /* distance type */
>
struct const_reverse_bidirectional_iterator_base // For all current compilers/libraries, ...
: public reverse_bidirectional_iterator_base<I, V, R, P, D> // ... this is the same as reverse_iterator_base
{
public:
typedef reverse_bidirectional_iterator_base<I, V, R, P, D> parent_class_type;
typedef ss_typename_type_k parent_class_type::iterator_category iterator_category;
typedef ss_typename_type_k parent_class_type::value_type value_type;
typedef ss_typename_type_k parent_class_type::difference_type difference_type;
typedef ss_typename_type_k parent_class_type::pointer_type pointer;
typedef ss_typename_type_k parent_class_type::reference_type reference;
/* These two are for compatibility with older non-standard implementations, and
* will be benignly ignored by anything not requiring them.
*/
typedef ss_typename_type_k parent_class_type::pointer pointer_type;
typedef ss_typename_type_k parent_class_type::reference reference_type;
// Construction
public:
/// Constructor
ss_explicit_k const_reverse_bidirectional_iterator_base(I i)
: parent_class_type(i)
{}
};
#endif /* STLSOFT_LF_BIDIRECTIONAL_ITERATOR_SUPPORT */
/* /////////////////////////////////////////////////////////////////////////
* Random access iterator support
*/
// This is all some hideous kludge caused by Dinkumware's standard library's
// failure to leave behind any definitive discriminatable vestige of its
// presence.
//
// The discriminators are determined in stlsoft/util/std/library_discriminator.hpp
#ifdef _STLSOFT_CF_MIGHT_BE_DINKUMWARE_MS_NAUGHTIES
#ifndef _STLSOFT_NO_NAMESPACE
} // namespace stlsoft
#endif /* _STLSOFT_NO_NAMESPACE */
template< ss_typename_param_k _Ty
, ss_typename_param_k _Diff
, ss_typename_param_k _Pointer
, ss_typename_param_k _Reference
, ss_typename_param_k _Pointer2
, ss_typename_param_k _Reference2
>
class _Ptrit
{
public:
typedef _Pointer iterator_type;
private:
char x[1024];
};
namespace std
{
namespace test_dinkumware
{
template< ss_typename_param_k T1
, ss_typename_param_k T2
, bool S
>
struct select_type
{
typedef T1 selected_type;
};
#ifdef STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
template< ss_typename_param_k T1
, ss_typename_param_k T2
>
struct select_type<T1, T2, false>
{
typedef T2 selected_type;
};
#endif // STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
template< class V
, class P
, class R
>
class _Ptrit_tdkw
{
typedef _Ptrit<V, stlsoft_ns_qual(ss_ptrdiff_t), P, R, P, R> _Ptrit_type;
public:
typedef ss_typename_type_k select_type<_Ptrit_type, P, sizeof(_Ptrit_type) < 1024>::selected_type iterator_type;
};
} // namespace test_dinkumware
} // namespace std
#ifndef _STLSOFT_NO_NAMESPACE
namespace stlsoft
{
#endif /* _STLSOFT_NO_NAMESPACE */
#endif /* !_STLSOFT_CF_MIGHT_BE_DINKUMWARE_MS_NAUGHTIES */
/** \brief Pointer iterator type
*
* \ingroup group__library__utility
*
* \param V The value type
* \param P The pointer type
* \param R The reference type
*/
template< ss_typename_param_k V
, ss_typename_param_k P
, ss_typename_param_k R
>
struct pointer_iterator
{
#if defined(_STLSOFT_CF_MIGHT_BE_DINKUMWARE_MS_NAUGHTIES) && \
!defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT)
# if defined(_STLSOFT_CF_MIGHT_BE_DINKUMWARE_MS_NAUGHTIES_1300)
typedef std::test_dinkumware::_Ptrit_tdkw<V, P, R>::iterator_type type;
# else
typedef P type;
# endif /* _STLSOFT_CF_MIGHT_BE_DINKUMWARE_MS_NAUGHTIES_1300 */
#elif defined(STLSOFT_COMPILER_IS_MSVC) && \
!defined(STLSOFT_CF_STD_LIBRARY_IS_STLPORT) && \
defined(_XUTILITY_) && \
_MSC_VER == 1300
typedef std::_Ptrit<V, stlsoft_ns_qual(ss_ptrdiff_t), P, R, P, R> type;
#else
typedef P type;
#endif /* !_STLSOFT_CF_MIGHT_BE_DINKUMWARE_MS_NAUGHTIES */