Mark constants as `_INLINE_VAR constexpr`. (#2792)

This commit is contained in:
Stephan T. Lavavej 2022-06-15 18:35:17 -07:00 коммит произвёл GitHub
Родитель 5419d49ee3
Коммит ea32e86dee
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -722,7 +722,7 @@ private:
virtual const void* _Get() const noexcept = 0;
};
constexpr size_t _Space_size = (_Small_object_num_ptrs - 1) * sizeof(void*);
_INLINE_VAR constexpr size_t _Space_size = (_Small_object_num_ptrs - 1) * sizeof(void*);
template <class _Impl> // determine whether _Impl must be dynamically allocated
_INLINE_VAR constexpr bool _Is_large = sizeof(_Impl) > _Space_size || alignof(_Impl) > alignof(max_align_t)

Просмотреть файл

@ -1155,16 +1155,16 @@ _NODISCARD bool operator!=(const match_results<_BidIt, _Alloc>& _Left, const mat
}
#endif // !_HAS_CXX20
const unsigned int _BRE_MAX_GRP = 9U;
_INLINE_VAR constexpr unsigned int _BRE_MAX_GRP = 9U;
const unsigned int _Bmp_max = 256U; // must fit in an unsigned int
const unsigned int _Bmp_shift = 3U;
const unsigned int _Bmp_chrs = 1U << _Bmp_shift; // # of bits to be stored in each char
const unsigned int _Bmp_mask = _Bmp_chrs - 1U;
const unsigned int _Bmp_size = (_Bmp_max + _Bmp_chrs - 1U) / _Bmp_chrs;
_INLINE_VAR constexpr unsigned int _Bmp_max = 256U; // must fit in an unsigned int
_INLINE_VAR constexpr unsigned int _Bmp_shift = 3U;
_INLINE_VAR constexpr unsigned int _Bmp_chrs = 1U << _Bmp_shift; // # of bits to be stored in each char
_INLINE_VAR constexpr unsigned int _Bmp_mask = _Bmp_chrs - 1U;
_INLINE_VAR constexpr unsigned int _Bmp_size = (_Bmp_max + _Bmp_chrs - 1U) / _Bmp_chrs;
const unsigned int _Buf_incr = 16U;
const unsigned int _ARRAY_THRESHOLD = 4U;
_INLINE_VAR constexpr unsigned int _Buf_incr = 16U;
_INLINE_VAR constexpr unsigned int _ARRAY_THRESHOLD = 4U;
enum _Node_flags : int { // flags for nfa nodes with special properties
_Fl_none = 0x00,

Просмотреть файл

@ -2108,8 +2108,9 @@ vector(_Iter, _Iter, _Alloc = _Alloc()) -> vector<_Iter_value_t<_Iter>, _Alloc>;
template <class _Alloc>
class vector<bool, _Alloc>;
using _Vbase = unsigned int; // word type for vector<bool> representation
constexpr int _VBITS = 8 * sizeof(_Vbase); // at least CHAR_BITS bits per word
using _Vbase = unsigned int; // word type for vector<bool> representation
_INLINE_VAR constexpr int _VBITS = 8 * sizeof(_Vbase); // at least CHAR_BITS bits per word
template <class _Ty, class _Alloc>
_NODISCARD _CONSTEXPR20 bool operator==(const vector<_Ty, _Alloc>& _Left, const vector<_Ty, _Alloc>& _Right) {

Просмотреть файл

@ -2324,8 +2324,9 @@ public:
size_type _Myres = 0; // current storage reserved for string
};
// get _Ty's size after being EBCO'd
template <class _Ty>
constexpr size_t _Size_after_ebco_v = is_empty_v<_Ty> ? 0 : sizeof(_Ty); // get _Ty's size after being EBCO'd
_INLINE_VAR constexpr size_t _Size_after_ebco_v = is_empty_v<_Ty> ? 0 : sizeof(_Ty);
struct _String_constructor_concat_tag {
// tag to select constructors used by basic_string's concatenation operators (operator+)