~ubuntu-branches/ubuntu/trusty/emscripten/trusty-proposed

« back to all changes in this revision

Viewing changes to system/include/libcxx/locale

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140119141240-jg1l42cc158j59tn
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
    typedef typename Codecvt::state_type                      state_type;
94
94
    typedef typename wide_string::traits_type::int_type       int_type;
95
95
 
96
 
    wstring_convert(Codecvt* pcvt = new Codecvt);
 
96
    explicit wstring_convert(Codecvt* pcvt = new Codecvt);          // explicit in C++14
97
97
    wstring_convert(Codecvt* pcvt, state_type state);
98
 
    wstring_convert(const byte_string& byte_err,
 
98
    explicit wstring_convert(const byte_string& byte_err,           // explicit in C++14
99
99
                    const wide_string& wide_err = wide_string());
 
100
    wstring_convert(const wstring_convert&) = delete;               // C++14
 
101
    wstring_convert & operator=(const wstring_convert &) = delete;  // C++14
100
102
    ~wstring_convert();
101
103
 
102
104
    wide_string from_bytes(char byte);
109
111
    byte_string to_bytes(const wide_string& wstr);
110
112
    byte_string to_bytes(const Elem* first, const Elem* last);
111
113
 
112
 
    size_t converted() const;
 
114
    size_t converted() const; // noexcept in C++14
113
115
    state_type state() const;
114
116
};
115
117
 
120
122
public:
121
123
    typedef typename Tr::state_type state_type;
122
124
 
123
 
    wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt,
124
 
                    state_type state = state_type());
125
 
 
 
125
    explicit wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt,
 
126
                    state_type state = state_type());       // explicit in C++14
 
127
    wbuffer_convert(const wbuffer_convert&) = delete;               // C++14
 
128
    wbuffer_convert & operator=(const wbuffer_convert &) = delete;  // C++14
 
129
    ~wbuffer_convert();                                             // C++14
 
130
    
126
131
    streambuf* rdbuf() const;
127
132
    streambuf* rdbuf(streambuf* bytebuf);
128
133
 
186
191
#endif
187
192
#include <cstdlib>
188
193
#include <ctime>
189
 
#ifdef _LIBCPP_MSVCRT
 
194
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
190
195
#include <support/win32/locale_win32.h>
191
196
#else // _LIBCPP_MSVCRT
192
197
#include <nl_types.h>
211
216
#else
212
217
#  define _LIBCPP_GET_C_LOCALE __cloc()
213
218
   // Get the C locale object
214
 
   locale_t __cloc();
 
219
   _LIBCPP_FUNC_VIS locale_t __cloc();
215
220
#define __cloc_defined
216
221
#endif
217
222
 
224
229
// OSX has nice foo_l() functions that let you turn off use of the global
225
230
// locale.  Linux, not so much.  The following functions avoid the locale when
226
231
// that's possible and otherwise do the wrong thing.  FIXME.
227
 
#if defined(__linux__) || defined(__EMSCRIPTEN__)
 
232
#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX)
228
233
 
229
234
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
230
235
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
234
239
  return MB_CUR_MAX_L(__l);
235
240
}
236
241
#else  // _LIBCPP_LOCALE__L_EXTENSIONS
237
 
_LIBCPP_ALWAYS_INLINE inline
 
242
inline _LIBCPP_ALWAYS_INLINE
238
243
decltype(MB_CUR_MAX) __mb_cur_max_l(locale_t __l)
239
244
{
240
245
  __locale_raii __current(uselocale(__l), uselocale);
242
247
}
243
248
#endif // _LIBCPP_LOCALE__L_EXTENSIONS
244
249
 
245
 
_LIBCPP_ALWAYS_INLINE inline
 
250
inline _LIBCPP_ALWAYS_INLINE
246
251
wint_t __btowc_l(int __c, locale_t __l)
247
252
{
248
253
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
253
258
#endif
254
259
}
255
260
 
256
 
_LIBCPP_ALWAYS_INLINE inline
 
261
inline _LIBCPP_ALWAYS_INLINE
257
262
int __wctob_l(wint_t __c, locale_t __l)
258
263
{
259
264
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
264
269
#endif
265
270
}
266
271
 
267
 
_LIBCPP_ALWAYS_INLINE inline
 
272
inline _LIBCPP_ALWAYS_INLINE
268
273
size_t __wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
269
274
                      size_t __len, mbstate_t *__ps, locale_t __l)
270
275
{
276
281
#endif
277
282
}
278
283
 
279
 
_LIBCPP_ALWAYS_INLINE inline
 
284
inline _LIBCPP_ALWAYS_INLINE
280
285
size_t __wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
281
286
{
282
287
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
287
292
#endif
288
293
}
289
294
 
290
 
_LIBCPP_ALWAYS_INLINE inline
 
295
inline _LIBCPP_ALWAYS_INLINE
291
296
size_t __mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
292
297
                      size_t __len, mbstate_t *__ps, locale_t __l)
293
298
{
299
304
#endif
300
305
}
301
306
 
302
 
_LIBCPP_ALWAYS_INLINE inline
 
307
inline _LIBCPP_ALWAYS_INLINE
303
308
size_t __mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
304
309
                   mbstate_t *__ps, locale_t __l)
305
310
{
311
316
#endif
312
317
}
313
318
 
314
 
_LIBCPP_ALWAYS_INLINE inline
 
319
inline _LIBCPP_ALWAYS_INLINE
315
320
int __mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
316
321
{
317
322
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
322
327
#endif
323
328
}
324
329
 
325
 
_LIBCPP_ALWAYS_INLINE inline
 
330
inline _LIBCPP_ALWAYS_INLINE
326
331
size_t __mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
327
332
{
328
333
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
333
338
#endif
334
339
}
335
340
 
336
 
_LIBCPP_ALWAYS_INLINE inline
 
341
inline _LIBCPP_ALWAYS_INLINE
337
342
lconv *__localeconv_l(locale_t __l)
338
343
{
339
344
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
344
349
#endif
345
350
}
346
351
 
347
 
_LIBCPP_ALWAYS_INLINE inline
 
352
inline _LIBCPP_ALWAYS_INLINE
348
353
size_t __mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
349
354
                     mbstate_t *__ps, locale_t __l)
350
355
{
528
533
    return __kb;
529
534
}
530
535
 
531
 
struct __num_get_base
 
536
struct _LIBCPP_TYPE_VIS __num_get_base
532
537
{
533
538
    static const int __num_get_buf_sz = 40;
534
539
 
536
541
    static const char __src[33];
537
542
};
538
543
 
 
544
_LIBCPP_FUNC_VIS
539
545
void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end,
540
546
                      ios_base::iostate& __err);
541
547
 
686
692
    return 0;
687
693
}
688
694
 
689
 
_LIBCPP_EXTERN_TEMPLATE(struct __num_get<char>)
690
 
_LIBCPP_EXTERN_TEMPLATE(struct __num_get<wchar_t>)
 
695
_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<char>)
 
696
_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<wchar_t>)
691
697
 
692
698
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
693
 
class _LIBCPP_TYPE_VIS num_get
 
699
class _LIBCPP_TYPE_VIS_ONLY num_get
694
700
    : public locale::facet,
695
701
      private __num_get<_CharT>
696
702
{
785
791
    _LIBCPP_ALWAYS_INLINE
786
792
    ~num_get() {}
787
793
 
 
794
    template <class _Fp>
 
795
    iter_type __do_get_floating_point
 
796
                            (iter_type __b, iter_type __e, ios_base& __iob,
 
797
                             ios_base::iostate& __err, _Fp& __v) const;
 
798
 
 
799
    template <class _Signed>
 
800
    iter_type __do_get_signed
 
801
                            (iter_type __b, iter_type __e, ios_base& __iob,
 
802
                             ios_base::iostate& __err, _Signed& __v) const;
 
803
 
 
804
    template <class _Unsigned>
 
805
    iter_type __do_get_unsigned
 
806
                            (iter_type __b, iter_type __e, ios_base& __iob,
 
807
                             ios_base::iostate& __err, _Unsigned& __v) const;
 
808
 
 
809
 
788
810
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
789
811
                             ios_base::iostate& __err, bool& __v) const;
790
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
791
 
                             ios_base::iostate& __err, long& __v) const;
792
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
793
 
                             ios_base::iostate& __err, long long& __v) const;
794
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
795
 
                             ios_base::iostate& __err, unsigned short& __v) const;
796
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
797
 
                             ios_base::iostate& __err, unsigned int& __v) const;
798
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
799
 
                             ios_base::iostate& __err, unsigned long& __v) const;
800
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
801
 
                             ios_base::iostate& __err, unsigned long long& __v) const;
802
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
803
 
                             ios_base::iostate& __err, float& __v) const;
804
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
805
 
                             ios_base::iostate& __err, double& __v) const;
806
 
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
807
 
                             ios_base::iostate& __err, long double& __v) const;
 
812
 
 
813
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
814
                             ios_base::iostate& __err, long& __v) const
 
815
    { return this->__do_get_signed ( __b, __e, __iob, __err, __v ); }
 
816
 
 
817
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
818
                             ios_base::iostate& __err, long long& __v) const
 
819
    { return this->__do_get_signed ( __b, __e, __iob, __err, __v ); }
 
820
 
 
821
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
822
                             ios_base::iostate& __err, unsigned short& __v) const
 
823
    { return this->__do_get_unsigned ( __b, __e, __iob, __err, __v ); }
 
824
 
 
825
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
826
                             ios_base::iostate& __err, unsigned int& __v) const
 
827
    { return this->__do_get_unsigned ( __b, __e, __iob, __err, __v ); }
 
828
 
 
829
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
830
                             ios_base::iostate& __err, unsigned long& __v) const
 
831
    { return this->__do_get_unsigned ( __b, __e, __iob, __err, __v ); }
 
832
 
 
833
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
834
                             ios_base::iostate& __err, unsigned long long& __v) const
 
835
    { return this->__do_get_unsigned ( __b, __e, __iob, __err, __v ); }
 
836
 
 
837
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
838
                             ios_base::iostate& __err, float& __v) const
 
839
    { return this->__do_get_floating_point ( __b, __e, __iob, __err, __v ); }
 
840
 
 
841
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
842
                             ios_base::iostate& __err, double& __v) const
 
843
    { return this->__do_get_floating_point ( __b, __e, __iob, __err, __v ); }
 
844
 
 
845
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
 
846
                             ios_base::iostate& __err, long double& __v) const
 
847
    { return this->__do_get_floating_point ( __b, __e, __iob, __err, __v ); }
 
848
 
808
849
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
809
850
                             ios_base::iostate& __err, void*& __v) const;
810
851
};
946
987
    return __b;
947
988
}
948
989
 
949
 
template <class _CharT, class _InputIterator>
950
 
_InputIterator
951
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
952
 
                                        ios_base& __iob,
953
 
                                        ios_base::iostate& __err,
954
 
                                        long& __v) const
955
 
{
956
 
    // Stage 1
957
 
    int __base = this->__get_base(__iob);
958
 
    // Stage 2
959
 
    char_type __atoms[26];
960
 
    char_type __thousands_sep;
961
 
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
962
 
    string __buf;
963
 
    __buf.resize(__buf.capacity());
964
 
    char* __a = &__buf[0];
965
 
    char* __a_end = __a;
966
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
967
 
    unsigned* __g_end = __g;
968
 
    unsigned __dc = 0;
969
 
    for (; __b != __e; ++__b)
970
 
    {
971
 
        if (__a_end - __a == __buf.size())
972
 
        {
973
 
            size_t __tmp = __buf.size();
974
 
            __buf.resize(2*__buf.size());
975
 
            __buf.resize(__buf.capacity());
976
 
            __a = &__buf[0];
977
 
            __a_end = __a + __tmp;
978
 
        }
979
 
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
980
 
                                    __thousands_sep, __grouping, __g, __g_end,
981
 
                                    __atoms))
982
 
            break;
983
 
    }
984
 
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
985
 
        *__g_end++ = __dc;
986
 
    // Stage 3
987
 
    __v = __num_get_signed_integral<long>(__a, __a_end, __err, __base);
988
 
    // Digit grouping checked
989
 
    __check_grouping(__grouping, __g, __g_end, __err);
990
 
    // EOF checked
991
 
    if (__b == __e)
992
 
        __err |= ios_base::eofbit;
993
 
    return __b;
994
 
}
995
 
 
996
 
template <class _CharT, class _InputIterator>
997
 
_InputIterator
998
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
999
 
                                        ios_base& __iob,
1000
 
                                        ios_base::iostate& __err,
1001
 
                                        long long& __v) const
1002
 
{
1003
 
    // Stage 1
1004
 
    int __base = this->__get_base(__iob);
1005
 
    // Stage 2
1006
 
    char_type __atoms[26];
1007
 
    char_type __thousands_sep;
1008
 
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
1009
 
    string __buf;
1010
 
    __buf.resize(__buf.capacity());
1011
 
    char* __a = &__buf[0];
1012
 
    char* __a_end = __a;
1013
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1014
 
    unsigned* __g_end = __g;
1015
 
    unsigned __dc = 0;
1016
 
    for (; __b != __e; ++__b)
1017
 
    {
1018
 
        if (__a_end - __a == __buf.size())
1019
 
        {
1020
 
            size_t __tmp = __buf.size();
1021
 
            __buf.resize(2*__buf.size());
1022
 
            __buf.resize(__buf.capacity());
1023
 
            __a = &__buf[0];
1024
 
            __a_end = __a + __tmp;
1025
 
        }
1026
 
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
1027
 
                                    __thousands_sep, __grouping, __g, __g_end,
1028
 
                                    __atoms))
1029
 
            break;
1030
 
    }
1031
 
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
1032
 
        *__g_end++ = __dc;
1033
 
    // Stage 3
1034
 
    __v = __num_get_signed_integral<long long>(__a, __a_end, __err, __base);
1035
 
    // Digit grouping checked
1036
 
    __check_grouping(__grouping, __g, __g_end, __err);
1037
 
    // EOF checked
1038
 
    if (__b == __e)
1039
 
        __err |= ios_base::eofbit;
1040
 
    return __b;
1041
 
}
1042
 
 
1043
 
template <class _CharT, class _InputIterator>
1044
 
_InputIterator
1045
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1046
 
                                        ios_base& __iob,
1047
 
                                        ios_base::iostate& __err,
1048
 
                                        unsigned short& __v) const
1049
 
{
1050
 
    // Stage 1
1051
 
    int __base = this->__get_base(__iob);
1052
 
    // Stage 2
1053
 
    char_type __atoms[26];
1054
 
    char_type __thousands_sep;
1055
 
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
1056
 
    string __buf;
1057
 
    __buf.resize(__buf.capacity());
1058
 
    char* __a = &__buf[0];
1059
 
    char* __a_end = __a;
1060
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1061
 
    unsigned* __g_end = __g;
1062
 
    unsigned __dc = 0;
1063
 
    for (; __b != __e; ++__b)
1064
 
    {
1065
 
        if (__a_end - __a == __buf.size())
1066
 
        {
1067
 
            size_t __tmp = __buf.size();
1068
 
            __buf.resize(2*__buf.size());
1069
 
            __buf.resize(__buf.capacity());
1070
 
            __a = &__buf[0];
1071
 
            __a_end = __a + __tmp;
1072
 
        }
1073
 
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
1074
 
                                    __thousands_sep, __grouping, __g, __g_end,
1075
 
                                    __atoms))
1076
 
            break;
1077
 
    }
1078
 
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
1079
 
        *__g_end++ = __dc;
1080
 
    // Stage 3
1081
 
    __v = __num_get_unsigned_integral<unsigned short>(__a, __a_end, __err, __base);
1082
 
    // Digit grouping checked
1083
 
    __check_grouping(__grouping, __g, __g_end, __err);
1084
 
    // EOF checked
1085
 
    if (__b == __e)
1086
 
        __err |= ios_base::eofbit;
1087
 
    return __b;
1088
 
}
1089
 
 
1090
 
template <class _CharT, class _InputIterator>
1091
 
_InputIterator
1092
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1093
 
                                        ios_base& __iob,
1094
 
                                        ios_base::iostate& __err,
1095
 
                                        unsigned int& __v) const
1096
 
{
1097
 
    // Stage 1
1098
 
    int __base = this->__get_base(__iob);
1099
 
    // Stage 2
1100
 
    char_type __atoms[26];
1101
 
    char_type __thousands_sep;
1102
 
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
1103
 
    string __buf;
1104
 
    __buf.resize(__buf.capacity());
1105
 
    char* __a = &__buf[0];
1106
 
    char* __a_end = __a;
1107
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1108
 
    unsigned* __g_end = __g;
1109
 
    unsigned __dc = 0;
1110
 
    for (; __b != __e; ++__b)
1111
 
    {
1112
 
        if (__a_end - __a == __buf.size())
1113
 
        {
1114
 
            size_t __tmp = __buf.size();
1115
 
            __buf.resize(2*__buf.size());
1116
 
            __buf.resize(__buf.capacity());
1117
 
            __a = &__buf[0];
1118
 
            __a_end = __a + __tmp;
1119
 
        }
1120
 
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
1121
 
                                    __thousands_sep, __grouping, __g, __g_end,
1122
 
                                    __atoms))
1123
 
            break;
1124
 
    }
1125
 
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
1126
 
        *__g_end++ = __dc;
1127
 
    // Stage 3
1128
 
    __v = __num_get_unsigned_integral<unsigned int>(__a, __a_end, __err, __base);
1129
 
    // Digit grouping checked
1130
 
    __check_grouping(__grouping, __g, __g_end, __err);
1131
 
    // EOF checked
1132
 
    if (__b == __e)
1133
 
        __err |= ios_base::eofbit;
1134
 
    return __b;
1135
 
}
1136
 
 
1137
 
template <class _CharT, class _InputIterator>
1138
 
_InputIterator
1139
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1140
 
                                        ios_base& __iob,
1141
 
                                        ios_base::iostate& __err,
1142
 
                                        unsigned long& __v) const
1143
 
{
1144
 
    // Stage 1
1145
 
    int __base = this->__get_base(__iob);
1146
 
    // Stage 2
1147
 
    char_type __atoms[26];
1148
 
    char_type __thousands_sep;
1149
 
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
1150
 
    string __buf;
1151
 
    __buf.resize(__buf.capacity());
1152
 
    char* __a = &__buf[0];
1153
 
    char* __a_end = __a;
1154
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1155
 
    unsigned* __g_end = __g;
1156
 
    unsigned __dc = 0;
1157
 
    for (; __b != __e; ++__b)
1158
 
    {
1159
 
        if (__a_end - __a == __buf.size())
1160
 
        {
1161
 
            size_t __tmp = __buf.size();
1162
 
            __buf.resize(2*__buf.size());
1163
 
            __buf.resize(__buf.capacity());
1164
 
            __a = &__buf[0];
1165
 
            __a_end = __a + __tmp;
1166
 
        }
1167
 
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
1168
 
                                    __thousands_sep, __grouping, __g, __g_end,
1169
 
                                    __atoms))
1170
 
            break;
1171
 
    }
1172
 
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
1173
 
        *__g_end++ = __dc;
1174
 
    // Stage 3
1175
 
    __v = __num_get_unsigned_integral<unsigned long>(__a, __a_end, __err, __base);
1176
 
    // Digit grouping checked
1177
 
    __check_grouping(__grouping, __g, __g_end, __err);
1178
 
    // EOF checked
1179
 
    if (__b == __e)
1180
 
        __err |= ios_base::eofbit;
1181
 
    return __b;
1182
 
}
1183
 
 
1184
 
template <class _CharT, class _InputIterator>
1185
 
_InputIterator
1186
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1187
 
                                        ios_base& __iob,
1188
 
                                        ios_base::iostate& __err,
1189
 
                                        unsigned long long& __v) const
1190
 
{
1191
 
    // Stage 1
1192
 
    int __base = this->__get_base(__iob);
1193
 
    // Stage 2
1194
 
    char_type __atoms[26];
1195
 
    char_type __thousands_sep;
1196
 
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
1197
 
    string __buf;
1198
 
    __buf.resize(__buf.capacity());
1199
 
    char* __a = &__buf[0];
1200
 
    char* __a_end = __a;
1201
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1202
 
    unsigned* __g_end = __g;
1203
 
    unsigned __dc = 0;
1204
 
    for (; __b != __e; ++__b)
1205
 
    {
1206
 
        if (__a_end - __a == __buf.size())
1207
 
        {
1208
 
            size_t __tmp = __buf.size();
1209
 
            __buf.resize(2*__buf.size());
1210
 
            __buf.resize(__buf.capacity());
1211
 
            __a = &__buf[0];
1212
 
            __a_end = __a + __tmp;
1213
 
        }
1214
 
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
1215
 
                                    __thousands_sep, __grouping, __g, __g_end,
1216
 
                                    __atoms))
1217
 
            break;
1218
 
    }
1219
 
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
1220
 
        *__g_end++ = __dc;
1221
 
    // Stage 3
1222
 
    __v = __num_get_unsigned_integral<unsigned long long>(__a, __a_end, __err, __base);
1223
 
    // Digit grouping checked
1224
 
    __check_grouping(__grouping, __g, __g_end, __err);
1225
 
    // EOF checked
1226
 
    if (__b == __e)
1227
 
        __err |= ios_base::eofbit;
1228
 
    return __b;
1229
 
}
1230
 
 
1231
 
template <class _CharT, class _InputIterator>
1232
 
_InputIterator
1233
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1234
 
                                        ios_base& __iob,
1235
 
                                        ios_base::iostate& __err,
1236
 
                                        float& __v) const
1237
 
{
1238
 
    // Stage 1, nothing to do
1239
 
    // Stage 2
1240
 
    char_type __atoms[32];
1241
 
    char_type __decimal_point;
1242
 
    char_type __thousands_sep;
1243
 
    string __grouping = this->__stage2_float_prep(__iob, __atoms,
1244
 
                                                  __decimal_point,
1245
 
                                                  __thousands_sep);
1246
 
    string __buf;
1247
 
    __buf.resize(__buf.capacity());
1248
 
    char* __a = &__buf[0];
1249
 
    char* __a_end = __a;
1250
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1251
 
    unsigned* __g_end = __g;
1252
 
    unsigned __dc = 0;
1253
 
    bool __in_units = true;
1254
 
    char __exp = 'E';
1255
 
    for (; __b != __e; ++__b)
1256
 
    {
1257
 
        if (__a_end - __a == __buf.size())
1258
 
        {
1259
 
            size_t __tmp = __buf.size();
1260
 
            __buf.resize(2*__buf.size());
1261
 
            __buf.resize(__buf.capacity());
1262
 
            __a = &__buf[0];
1263
 
            __a_end = __a + __tmp;
1264
 
        }
1265
 
        if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
1266
 
                                      __decimal_point, __thousands_sep,
1267
 
                                      __grouping, __g, __g_end,
1268
 
                                      __dc, __atoms))
1269
 
            break;
1270
 
    }
1271
 
    if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
1272
 
        *__g_end++ = __dc;
1273
 
    // Stage 3
1274
 
    __v = __num_get_float<float>(__a, __a_end, __err);
1275
 
    // Digit grouping checked
1276
 
    __check_grouping(__grouping, __g, __g_end, __err);
1277
 
    // EOF checked
1278
 
    if (__b == __e)
1279
 
        __err |= ios_base::eofbit;
1280
 
    return __b;
1281
 
}
1282
 
 
1283
 
template <class _CharT, class _InputIterator>
1284
 
_InputIterator
1285
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1286
 
                                        ios_base& __iob,
1287
 
                                        ios_base::iostate& __err,
1288
 
                                        double& __v) const
1289
 
{
1290
 
    // Stage 1, nothing to do
1291
 
    // Stage 2
1292
 
    char_type __atoms[32];
1293
 
    char_type __decimal_point;
1294
 
    char_type __thousands_sep;
1295
 
    string __grouping = this->__stage2_float_prep(__iob, __atoms,
1296
 
                                                  __decimal_point,
1297
 
                                                  __thousands_sep);
1298
 
    string __buf;
1299
 
    __buf.resize(__buf.capacity());
1300
 
    char* __a = &__buf[0];
1301
 
    char* __a_end = __a;
1302
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1303
 
    unsigned* __g_end = __g;
1304
 
    unsigned __dc = 0;
1305
 
    bool __in_units = true;
1306
 
    char __exp = 'E';
1307
 
    for (; __b != __e; ++__b)
1308
 
    {
1309
 
        if (__a_end - __a == __buf.size())
1310
 
        {
1311
 
            size_t __tmp = __buf.size();
1312
 
            __buf.resize(2*__buf.size());
1313
 
            __buf.resize(__buf.capacity());
1314
 
            __a = &__buf[0];
1315
 
            __a_end = __a + __tmp;
1316
 
        }
1317
 
        if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
1318
 
                                      __decimal_point, __thousands_sep,
1319
 
                                      __grouping, __g, __g_end,
1320
 
                                      __dc, __atoms))
1321
 
            break;
1322
 
    }
1323
 
    if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
1324
 
        *__g_end++ = __dc;
1325
 
    // Stage 3
1326
 
    __v = __num_get_float<double>(__a, __a_end, __err);
1327
 
    // Digit grouping checked
1328
 
    __check_grouping(__grouping, __g, __g_end, __err);
1329
 
    // EOF checked
1330
 
    if (__b == __e)
1331
 
        __err |= ios_base::eofbit;
1332
 
    return __b;
1333
 
}
1334
 
 
1335
 
template <class _CharT, class _InputIterator>
1336
 
_InputIterator
1337
 
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1338
 
                                        ios_base& __iob,
1339
 
                                        ios_base::iostate& __err,
1340
 
                                        long double& __v) const
1341
 
{
1342
 
    // Stage 1, nothing to do
1343
 
    // Stage 2
1344
 
    char_type __atoms[32];
1345
 
    char_type __decimal_point;
1346
 
    char_type __thousands_sep;
1347
 
    string __grouping = this->__stage2_float_prep(__iob, __atoms,
1348
 
                                                  __decimal_point,
1349
 
                                                  __thousands_sep);
1350
 
    string __buf;
1351
 
    __buf.resize(__buf.capacity());
1352
 
    char* __a = &__buf[0];
1353
 
    char* __a_end = __a;
1354
 
    unsigned __g[__num_get_base::__num_get_buf_sz];
1355
 
    unsigned* __g_end = __g;
1356
 
    unsigned __dc = 0;
1357
 
    bool __in_units = true;
1358
 
    char __exp = 'E';
1359
 
    for (; __b != __e; ++__b)
1360
 
    {
1361
 
        if (__a_end - __a == __buf.size())
1362
 
        {
1363
 
            size_t __tmp = __buf.size();
1364
 
            __buf.resize(2*__buf.size());
1365
 
            __buf.resize(__buf.capacity());
1366
 
            __a = &__buf[0];
1367
 
            __a_end = __a + __tmp;
1368
 
        }
1369
 
        if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
1370
 
                                      __decimal_point, __thousands_sep,
1371
 
                                      __grouping, __g, __g_end,
1372
 
                                      __dc, __atoms))
1373
 
            break;
1374
 
    }
1375
 
    if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
1376
 
        *__g_end++ = __dc;
1377
 
    // Stage 3
1378
 
    __v = __num_get_float<long double>(__a, __a_end, __err);
 
990
// signed
 
991
 
 
992
template <class _CharT, class _InputIterator>
 
993
template <class _Signed>
 
994
_InputIterator
 
995
num_get<_CharT, _InputIterator>::__do_get_signed(iter_type __b, iter_type __e,
 
996
                                        ios_base& __iob,
 
997
                                        ios_base::iostate& __err,
 
998
                                        _Signed& __v) const
 
999
{
 
1000
    // Stage 1
 
1001
    int __base = this->__get_base(__iob);
 
1002
    // Stage 2
 
1003
    char_type __atoms[26];
 
1004
    char_type __thousands_sep;
 
1005
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
 
1006
    string __buf;
 
1007
    __buf.resize(__buf.capacity());
 
1008
    char* __a = &__buf[0];
 
1009
    char* __a_end = __a;
 
1010
    unsigned __g[__num_get_base::__num_get_buf_sz];
 
1011
    unsigned* __g_end = __g;
 
1012
    unsigned __dc = 0;
 
1013
    for (; __b != __e; ++__b)
 
1014
    {
 
1015
        if (__a_end - __a == __buf.size())
 
1016
        {
 
1017
            size_t __tmp = __buf.size();
 
1018
            __buf.resize(2*__buf.size());
 
1019
            __buf.resize(__buf.capacity());
 
1020
            __a = &__buf[0];
 
1021
            __a_end = __a + __tmp;
 
1022
        }
 
1023
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
 
1024
                                    __thousands_sep, __grouping, __g, __g_end,
 
1025
                                    __atoms))
 
1026
            break;
 
1027
    }
 
1028
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
 
1029
        *__g_end++ = __dc;
 
1030
    // Stage 3
 
1031
    __v = __num_get_signed_integral<_Signed>(__a, __a_end, __err, __base);
 
1032
    // Digit grouping checked
 
1033
    __check_grouping(__grouping, __g, __g_end, __err);
 
1034
    // EOF checked
 
1035
    if (__b == __e)
 
1036
        __err |= ios_base::eofbit;
 
1037
    return __b;
 
1038
}
 
1039
 
 
1040
// unsigned
 
1041
 
 
1042
template <class _CharT, class _InputIterator>
 
1043
template <class _Unsigned>
 
1044
_InputIterator
 
1045
num_get<_CharT, _InputIterator>::__do_get_unsigned(iter_type __b, iter_type __e,
 
1046
                                        ios_base& __iob,
 
1047
                                        ios_base::iostate& __err,
 
1048
                                        _Unsigned& __v) const
 
1049
{
 
1050
    // Stage 1
 
1051
    int __base = this->__get_base(__iob);
 
1052
    // Stage 2
 
1053
    char_type __atoms[26];
 
1054
    char_type __thousands_sep;
 
1055
    string __grouping = this->__stage2_int_prep(__iob, __atoms, __thousands_sep);
 
1056
    string __buf;
 
1057
    __buf.resize(__buf.capacity());
 
1058
    char* __a = &__buf[0];
 
1059
    char* __a_end = __a;
 
1060
    unsigned __g[__num_get_base::__num_get_buf_sz];
 
1061
    unsigned* __g_end = __g;
 
1062
    unsigned __dc = 0;
 
1063
    for (; __b != __e; ++__b)
 
1064
    {
 
1065
        if (__a_end - __a == __buf.size())
 
1066
        {
 
1067
            size_t __tmp = __buf.size();
 
1068
            __buf.resize(2*__buf.size());
 
1069
            __buf.resize(__buf.capacity());
 
1070
            __a = &__buf[0];
 
1071
            __a_end = __a + __tmp;
 
1072
        }
 
1073
        if (this->__stage2_int_loop(*__b, __base, __a, __a_end, __dc,
 
1074
                                    __thousands_sep, __grouping, __g, __g_end,
 
1075
                                    __atoms))
 
1076
            break;
 
1077
    }
 
1078
    if (__grouping.size() != 0 && __g_end-__g < __num_get_base::__num_get_buf_sz)
 
1079
        *__g_end++ = __dc;
 
1080
    // Stage 3
 
1081
    __v = __num_get_unsigned_integral<_Unsigned>(__a, __a_end, __err, __base);
 
1082
    // Digit grouping checked
 
1083
    __check_grouping(__grouping, __g, __g_end, __err);
 
1084
    // EOF checked
 
1085
    if (__b == __e)
 
1086
        __err |= ios_base::eofbit;
 
1087
    return __b;
 
1088
}
 
1089
 
 
1090
// floating point
 
1091
 
 
1092
template <class _CharT, class _InputIterator>
 
1093
template <class _Fp>
 
1094
_InputIterator
 
1095
num_get<_CharT, _InputIterator>::__do_get_floating_point(iter_type __b, iter_type __e,
 
1096
                                        ios_base& __iob,
 
1097
                                        ios_base::iostate& __err,
 
1098
                                        _Fp& __v) const
 
1099
{
 
1100
    // Stage 1, nothing to do
 
1101
    // Stage 2
 
1102
    char_type __atoms[32];
 
1103
    char_type __decimal_point;
 
1104
    char_type __thousands_sep;
 
1105
    string __grouping = this->__stage2_float_prep(__iob, __atoms,
 
1106
                                                  __decimal_point,
 
1107
                                                  __thousands_sep);
 
1108
    string __buf;
 
1109
    __buf.resize(__buf.capacity());
 
1110
    char* __a = &__buf[0];
 
1111
    char* __a_end = __a;
 
1112
    unsigned __g[__num_get_base::__num_get_buf_sz];
 
1113
    unsigned* __g_end = __g;
 
1114
    unsigned __dc = 0;
 
1115
    bool __in_units = true;
 
1116
    char __exp = 'E';
 
1117
    for (; __b != __e; ++__b)
 
1118
    {
 
1119
        if (__a_end - __a == __buf.size())
 
1120
        {
 
1121
            size_t __tmp = __buf.size();
 
1122
            __buf.resize(2*__buf.size());
 
1123
            __buf.resize(__buf.capacity());
 
1124
            __a = &__buf[0];
 
1125
            __a_end = __a + __tmp;
 
1126
        }
 
1127
        if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
 
1128
                                      __decimal_point, __thousands_sep,
 
1129
                                      __grouping, __g, __g_end,
 
1130
                                      __dc, __atoms))
 
1131
            break;
 
1132
    }
 
1133
    if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
 
1134
        *__g_end++ = __dc;
 
1135
    // Stage 3
 
1136
    __v = __num_get_float<_Fp>(__a, __a_end, __err);
1379
1137
    // Digit grouping checked
1380
1138
    __check_grouping(__grouping, __g, __g_end, __err);
1381
1139
    // EOF checked
1435
1193
    return __b;
1436
1194
}
1437
1195
 
1438
 
_LIBCPP_EXTERN_TEMPLATE(class num_get<char>)
1439
 
_LIBCPP_EXTERN_TEMPLATE(class num_get<wchar_t>)
 
1196
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<char>)
 
1197
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<wchar_t>)
1440
1198
 
1441
 
struct __num_put_base
 
1199
struct _LIBCPP_TYPE_VIS __num_put_base
1442
1200
{
1443
1201
protected:
1444
1202
    static void __format_int(char* __fmt, const char* __len, bool __signd,
1585
1343
        __op = __ob + (__np - __nb);
1586
1344
}
1587
1345
 
1588
 
_LIBCPP_EXTERN_TEMPLATE(struct __num_put<char>)
1589
 
_LIBCPP_EXTERN_TEMPLATE(struct __num_put<wchar_t>)
 
1346
_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<char>)
 
1347
_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<wchar_t>)
1590
1348
 
1591
1349
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
1592
 
class _LIBCPP_TYPE_VIS num_put
 
1350
class _LIBCPP_TYPE_VIS_ONLY num_put
1593
1351
    : public locale::facet,
1594
1352
      private __num_put<_CharT>
1595
1353
{
1769
1527
        return do_put(__s, __iob, __fl, (unsigned long)__v);
1770
1528
    const numpunct<char_type>& __np = use_facet<numpunct<char_type> >(__iob.getloc());
1771
1529
    typedef typename numpunct<char_type>::string_type string_type;
 
1530
#if _LIBCPP_DEBUG_LEVEL >= 2
 
1531
    string_type __tmp(__v ? __np.truename() : __np.falsename());
 
1532
    string_type __nm = _VSTD::move(__tmp);
 
1533
#else
1772
1534
    string_type __nm = __v ? __np.truename() : __np.falsename();
 
1535
#endif
1773
1536
    for (typename string_type::iterator __i = __nm.begin(); __i != __nm.end(); ++__i, ++__s)
1774
1537
        *__s = *__i;
1775
1538
    return __s;
2065
1828
    return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
2066
1829
}
2067
1830
 
2068
 
_LIBCPP_EXTERN_TEMPLATE(class num_put<char>)
2069
 
_LIBCPP_EXTERN_TEMPLATE(class num_put<wchar_t>)
 
1831
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<char>)
 
1832
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<wchar_t>)
2070
1833
 
2071
1834
template <class _CharT, class _InputIterator>
2072
1835
_LIBCPP_HIDDEN
2108
1871
};
2109
1872
 
2110
1873
template <class _CharT>
2111
 
class __time_get_c_storage  // purposefully not decorated
 
1874
class _LIBCPP_TYPE_VIS __time_get_c_storage
2112
1875
{
2113
1876
protected:
2114
1877
    typedef basic_string<_CharT> string_type;
2123
1886
};
2124
1887
 
2125
1888
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
2126
 
class _LIBCPP_TYPE_VIS time_get
 
1889
class _LIBCPP_TYPE_VIS_ONLY time_get
2127
1890
    : public locale::facet,
2128
1891
      public time_base,
2129
1892
      private __time_get_c_storage<_CharT>
2732
2495
    return __b;
2733
2496
}
2734
2497
 
2735
 
_LIBCPP_EXTERN_TEMPLATE(class time_get<char>)
2736
 
_LIBCPP_EXTERN_TEMPLATE(class time_get<wchar_t>)
 
2498
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<char>)
 
2499
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<wchar_t>)
2737
2500
 
2738
 
class __time_get
 
2501
class _LIBCPP_TYPE_VIS __time_get
2739
2502
{
2740
2503
protected:
2741
2504
    locale_t __loc_;
2746
2509
};
2747
2510
 
2748
2511
template <class _CharT>
2749
 
class __time_get_storage
 
2512
class _LIBCPP_TYPE_VIS __time_get_storage
2750
2513
    : public __time_get
2751
2514
{
2752
2515
protected:
2773
2536
};
2774
2537
 
2775
2538
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
2776
 
class _LIBCPP_TYPE_VIS time_get_byname
 
2539
class _LIBCPP_TYPE_VIS_ONLY time_get_byname
2777
2540
    : public time_get<_CharT, _InputIterator>,
2778
2541
      private __time_get_storage<_CharT>
2779
2542
{
2815
2578
    virtual const string_type& __X() const      {return this->__X_;}
2816
2579
};
2817
2580
 
2818
 
_LIBCPP_EXTERN_TEMPLATE(class time_get_byname<char>)
2819
 
_LIBCPP_EXTERN_TEMPLATE(class time_get_byname<wchar_t>)
 
2581
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<char>)
 
2582
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<wchar_t>)
2820
2583
 
2821
 
class __time_put
 
2584
class _LIBCPP_TYPE_VIS __time_put
2822
2585
{
2823
2586
    locale_t __loc_;
2824
2587
protected:
2833
2596
};
2834
2597
 
2835
2598
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
2836
 
class _LIBCPP_TYPE_VIS time_put
 
2599
class _LIBCPP_TYPE_VIS_ONLY time_put
2837
2600
    : public locale::facet,
2838
2601
      private __time_put
2839
2602
{
2928
2691
    return _VSTD::copy(__nb, __ne, __s);
2929
2692
}
2930
2693
 
2931
 
_LIBCPP_EXTERN_TEMPLATE(class time_put<char>)
2932
 
_LIBCPP_EXTERN_TEMPLATE(class time_put<wchar_t>)
 
2694
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put<char>)
 
2695
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put<wchar_t>)
2933
2696
 
2934
2697
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
2935
 
class _LIBCPP_TYPE_VIS time_put_byname
 
2698
class _LIBCPP_TYPE_VIS_ONLY time_put_byname
2936
2699
    : public time_put<_CharT, _OutputIterator>
2937
2700
{
2938
2701
public:
2949
2712
    ~time_put_byname() {}
2950
2713
};
2951
2714
 
2952
 
_LIBCPP_EXTERN_TEMPLATE(class time_put_byname<char>)
2953
 
_LIBCPP_EXTERN_TEMPLATE(class time_put_byname<wchar_t>)
 
2715
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<char>)
 
2716
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<wchar_t>)
2954
2717
 
2955
2718
// money_base
2956
2719
 
2966
2729
// moneypunct
2967
2730
 
2968
2731
template <class _CharT, bool _International = false>
2969
 
class _LIBCPP_TYPE_VIS moneypunct
 
2732
class _LIBCPP_TYPE_VIS_ONLY moneypunct
2970
2733
    : public locale::facet,
2971
2734
      public money_base
2972
2735
{
3016
2779
const bool
3017
2780
moneypunct<_CharT, _International>::intl;
3018
2781
 
3019
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, false>)
3020
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, true>)
3021
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, false>)
3022
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, true>)
 
2782
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, false>)
 
2783
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, true>)
 
2784
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, false>)
 
2785
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, true>)
3023
2786
 
3024
2787
// moneypunct_byname
3025
2788
 
3026
2789
template <class _CharT, bool _International = false>
3027
 
class _LIBCPP_TYPE_VIS moneypunct_byname
 
2790
class _LIBCPP_TYPE_VIS_ONLY moneypunct_byname
3028
2791
    : public moneypunct<_CharT, _International>
3029
2792
{
3030
2793
public:
3073
2836
template<> void moneypunct_byname<wchar_t, false>::init(const char*);
3074
2837
template<> void moneypunct_byname<wchar_t, true>::init(const char*);
3075
2838
 
3076
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<char, false>)
3077
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<char, true>)
3078
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<wchar_t, false>)
3079
 
_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<wchar_t, true>)
 
2839
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, false>)
 
2840
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, true>)
 
2841
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, false>)
 
2842
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, true>)
3080
2843
 
3081
2844
// money_get
3082
2845
 
3132
2895
    }
3133
2896
}
3134
2897
 
3135
 
_LIBCPP_EXTERN_TEMPLATE(class __money_get<char>)
3136
 
_LIBCPP_EXTERN_TEMPLATE(class __money_get<wchar_t>)
 
2898
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<char>)
 
2899
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<wchar_t>)
3137
2900
 
3138
2901
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
3139
 
class _LIBCPP_TYPE_VIS money_get
 
2902
class _LIBCPP_TYPE_VIS_ONLY money_get
3140
2903
    : public locale::facet,
3141
2904
      private __money_get<_CharT>
3142
2905
{
3190
2953
locale::id
3191
2954
money_get<_CharT, _InputIterator>::id;
3192
2955
 
3193
 
void __do_nothing(void*);
 
2956
_LIBCPP_FUNC_VIS void __do_nothing(void*);
3194
2957
 
3195
2958
template <class _Tp>
3196
2959
_LIBCPP_HIDDEN
3320
3083
            bool __more_needed = __trailing_sign ||
3321
3084
                                 (__p < 2)       ||
3322
3085
                                 (__p == 2 && __pat.field[3] != static_cast<char>(money_base::none));
3323
 
            bool __sb = __flags & ios_base::showbase;
 
3086
            bool __sb = (__flags & ios_base::showbase) != 0;
3324
3087
            if (__sb || __more_needed)
3325
3088
            {
3326
3089
                typename string_type::const_iterator __sym_space_end = __sym.begin();
3513
3276
    return __b;
3514
3277
}
3515
3278
 
3516
 
_LIBCPP_EXTERN_TEMPLATE(class money_get<char>)
3517
 
_LIBCPP_EXTERN_TEMPLATE(class money_get<wchar_t>)
 
3279
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<char>)
 
3280
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<wchar_t>)
3518
3281
 
3519
3282
// money_put
3520
3283
 
3688
3451
        __mi = __mb;
3689
3452
}
3690
3453
 
3691
 
_LIBCPP_EXTERN_TEMPLATE(class __money_put<char>)
3692
 
_LIBCPP_EXTERN_TEMPLATE(class __money_put<wchar_t>)
 
3454
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<char>)
 
3455
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<wchar_t>)
3693
3456
 
3694
3457
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
3695
 
class _LIBCPP_TYPE_VIS money_put
 
3458
class _LIBCPP_TYPE_VIS_ONLY money_put
3696
3459
    : public locale::facet,
3697
3460
      private __money_put<_CharT>
3698
3461
{
3845
3608
    return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
3846
3609
}
3847
3610
 
3848
 
_LIBCPP_EXTERN_TEMPLATE(class money_put<char>)
3849
 
_LIBCPP_EXTERN_TEMPLATE(class money_put<wchar_t>)
 
3611
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<char>)
 
3612
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<wchar_t>)
3850
3613
 
3851
3614
// messages
3852
3615
 
3859
3622
};
3860
3623
 
3861
3624
template <class _CharT>
3862
 
class _LIBCPP_TYPE_VIS messages
 
3625
class _LIBCPP_TYPE_VIS_ONLY messages
3863
3626
    : public locale::facet,
3864
3627
      public messages_base
3865
3628
{
3955
3718
#endif // !_WIN32
3956
3719
}
3957
3720
 
3958
 
_LIBCPP_EXTERN_TEMPLATE(class messages<char>)
3959
 
_LIBCPP_EXTERN_TEMPLATE(class messages<wchar_t>)
 
3721
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages<char>)
 
3722
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages<wchar_t>)
3960
3723
 
3961
3724
template <class _CharT>
3962
 
class _LIBCPP_TYPE_VIS messages_byname
 
3725
class _LIBCPP_TYPE_VIS_ONLY messages_byname
3963
3726
    : public messages<_CharT>
3964
3727
{
3965
3728
public:
3979
3742
    ~messages_byname() {}
3980
3743
};
3981
3744
 
3982
 
_LIBCPP_EXTERN_TEMPLATE(class messages_byname<char>)
3983
 
_LIBCPP_EXTERN_TEMPLATE(class messages_byname<wchar_t>)
 
3745
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<char>)
 
3746
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<wchar_t>)
3984
3747
 
3985
3748
template<class _Codecvt, class _Elem = wchar_t,
3986
3749
         class _Wide_alloc = allocator<_Elem>,
3987
3750
         class _Byte_alloc = allocator<char> >
3988
 
class _LIBCPP_TYPE_VIS wstring_convert
 
3751
class _LIBCPP_TYPE_VIS_ONLY wstring_convert
3989
3752
{
3990
3753
public:
3991
3754
    typedef basic_string<char, char_traits<char>, _Byte_alloc>   byte_string;
4003
3766
    wstring_convert(const wstring_convert& __wc);
4004
3767
    wstring_convert& operator=(const wstring_convert& __wc);
4005
3768
public:
4006
 
    wstring_convert(_Codecvt* __pcvt = new _Codecvt);
 
3769
    _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(_Codecvt* __pcvt = new _Codecvt);
4007
3770
    wstring_convert(_Codecvt* __pcvt, state_type __state);
4008
 
    wstring_convert(const byte_string& __byte_err,
 
3771
    _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
4009
3772
                    const wide_string& __wide_err = wide_string());
4010
3773
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4011
3774
    wstring_convert(wstring_convert&& __wc);
4035
3798
    byte_string to_bytes(const _Elem* __first, const _Elem* __last);
4036
3799
 
4037
3800
    _LIBCPP_ALWAYS_INLINE
4038
 
    size_t converted() const {return __cvtcount_;}
 
3801
    size_t converted() const _NOEXCEPT {return __cvtcount_;}
4039
3802
    _LIBCPP_ALWAYS_INLINE
4040
3803
    state_type state() const {return __cvtstate_;}
4041
3804
};
4238
4001
}
4239
4002
 
4240
4003
template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
4241
 
class _LIBCPP_TYPE_VIS wbuffer_convert
 
4004
class _LIBCPP_TYPE_VIS_ONLY wbuffer_convert
4242
4005
    : public basic_streambuf<_Elem, _Tr>
4243
4006
{
4244
4007
public:
4269
4032
    wbuffer_convert(const wbuffer_convert&);
4270
4033
    wbuffer_convert& operator=(const wbuffer_convert&);
4271
4034
public:
4272
 
    wbuffer_convert(streambuf* __bytebuf = 0, _Codecvt* __pcvt = new _Codecvt,
4273
 
                    state_type __state = state_type());
 
4035
    _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = 0, 
 
4036
            _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type());
4274
4037
    ~wbuffer_convert();
4275
4038
 
4276
4039
    _LIBCPP_INLINE_VISIBILITY