@@ -74,12 +74,18 @@ public:
74
74
75
75
class _CRTIMP2_PURE_IMPORT id { // identifier stamp, unique for each distinct kind of facet
76
76
public:
77
+ #ifdef _CRTBLD // TRANSITION, ABI: preserved for binary compatibility
77
78
__CLR_OR_THIS_CALL id(size_t _Val = 0) : _Id(_Val) {}
79
+ #else // ^^^ defined(_CRTBLD) / !defined(_CRTBLD) vvv
80
+ template <int = 0> // TRANSITION, ABI
81
+ id() noexcept /* strengthened */ {}
82
+ #endif // ^^^ !defined(_CRTBLD) ^^^
78
83
79
84
id(const id&) = delete;
80
85
id& operator=(const id&) = delete;
81
86
82
- __CLR_OR_THIS_CALL operator size_t() { // get stamp, with lazy allocation
87
+ template <int = 0> // TRANSITION, ABI
88
+ size_t _Get_index() { // get stamp, with lazy allocation
83
89
if (_Id == 0) { // still zero, allocate stamp
84
90
_BEGIN_LOCK(_LOCK_LOCALE)
85
91
if (_Id == 0) {
@@ -90,8 +96,14 @@ public:
90
96
return _Id;
91
97
}
92
98
99
+ #ifdef _CRTBLD // TRANSITION, ABI: preserved for binary compatibility
100
+ __CLR_OR_THIS_CALL operator size_t() {
101
+ return _Get_index();
102
+ }
103
+ #endif // defined(_CRTBLD)
104
+
93
105
private:
94
- size_t _Id; // the identifier stamp
106
+ size_t _Id = 0 ; // the identifier stamp
95
107
96
108
__PURE_APPDOMAIN_GLOBAL static int _Id_cnt;
97
109
};
@@ -223,7 +235,7 @@ public:
223
235
_CATCH_END
224
236
225
237
_Locimp* _Newimp = _Locimp::_New_Locimp(*_Ptr);
226
- _Newimp->_Addfac(_Facptr, _Facet::id);
238
+ _Newimp->_Addfac(_Facptr, _Facet::id._Get_index() );
227
239
_Newimp->_Catmask = none;
228
240
_Newimp->_Name = "*";
229
241
return locale{_Secret_locale_construct_tag{}, _Newimp};
@@ -232,7 +244,7 @@ public:
232
244
template <class _Facet>
233
245
locale(const locale& _Loc, const _Facet* _Facptr) : _Ptr(_Locimp::_New_Locimp(*_Loc._Ptr)) {
234
246
if (_Facptr) { // replace facet
235
- _Ptr->_Addfac(const_cast<_Facet*>(_Facptr), _Facet::id);
247
+ _Ptr->_Addfac(const_cast<_Facet*>(_Facptr), _Facet::id._Get_index() );
236
248
_Ptr->_Catmask = none;
237
249
_Ptr->_Name = "*";
238
250
}
@@ -421,7 +433,7 @@ const _Facet& __CRTDECL use_facet(const locale& _Loc) { // get facet reference f
421
433
_BEGIN_LOCK(_LOCK_LOCALE) // the thread lock, make get atomic
422
434
const locale::facet* _Psave = _Facetptr<_Facet>::_Psave; // static pointer to lazy facet
423
435
424
- const size_t _Id = _Facet::id;
436
+ const size_t _Id = _Facet::id._Get_index() ;
425
437
const locale::facet* _Pf = _Loc._Getfacet(_Id);
426
438
427
439
if (!_Pf) {
0 commit comments