File tree Expand file tree Collapse file tree 5 files changed +19
-18
lines changed Expand file tree Collapse file tree 5 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -35,27 +35,27 @@ namespace compat {
35
35
// in length.`
36
36
template <typename T>
37
37
struct CanBeAtomic {
38
- static const bool value = false ;
38
+ static constexpr bool value = false ;
39
39
};
40
40
41
41
template <>
42
42
struct CanBeAtomic <int32_t > {
43
- static const bool value = true ;
43
+ static constexpr bool value = true ;
44
44
};
45
45
46
46
template <>
47
47
struct CanBeAtomic <uint32_t > {
48
- static const bool value = true ;
48
+ static constexpr bool value = true ;
49
49
};
50
50
51
51
template <>
52
52
struct CanBeAtomic <int64_t > {
53
- static const bool value = true ;
53
+ static constexpr bool value = true ;
54
54
};
55
55
56
56
template <>
57
57
struct CanBeAtomic <uint64_t > {
58
- static const bool value = true ;
58
+ static constexpr bool value = true ;
59
59
};
60
60
61
61
// Provides a minimal atomic counter, required to implement SharedPtr.
Original file line number Diff line number Diff line change @@ -42,27 +42,27 @@ struct remove_reference<T&&> {
42
42
43
43
template <typename T>
44
44
struct is_array {
45
- static const bool value = false ;
45
+ static constexpr bool value = false ;
46
46
};
47
47
48
48
template <typename T>
49
49
struct is_array <T[]> {
50
- static const bool value = true ;
50
+ static constexpr bool value = true ;
51
51
};
52
52
53
53
template <typename T, std::size_t N>
54
54
struct is_array <T[N]> {
55
- static const bool value = true ;
55
+ static constexpr bool value = true ;
56
56
};
57
57
58
58
template <typename T>
59
59
struct is_lvalue_reference {
60
- static const bool value = false ;
60
+ static constexpr bool value = false ;
61
61
};
62
62
63
63
template <typename T>
64
64
struct is_lvalue_reference <T&> {
65
- static const bool value = true ;
65
+ static constexpr bool value = true ;
66
66
};
67
67
68
68
// NOLINTNEXTLINE - allow namespace overridden
Original file line number Diff line number Diff line change @@ -1139,7 +1139,7 @@ class Variant {
1139
1139
char small_string[sizeof (BlobValue)];
1140
1140
} value_;
1141
1141
1142
- static const size_t kMaxSmallStringSize = sizeof (Value::small_string);
1142
+ static constexpr size_t kMaxSmallStringSize = sizeof (Value::small_string);
1143
1143
1144
1144
friend class firebase ::internal::VariantInternal;
1145
1145
};
Original file line number Diff line number Diff line change @@ -100,18 +100,18 @@ class ReferenceCountedFutureImpl : public detail::FutureApiInterface {
100
100
public:
101
101
// / This handle will never be returned by @ref Alloc, so you can use it
102
102
// / to signify an uninitialized or invalid value.
103
- static const FutureHandle kInvalidHandle = kInvalidFutureHandle ;
103
+ static constexpr FutureHandle kInvalidHandle = kInvalidFutureHandle ;
104
104
105
105
// / Returned by @ref GetFutureError when the passed in handle is invalid.
106
- static const int kErrorFutureIsNoLongerValid = -1 ;
106
+ static constexpr int kErrorFutureIsNoLongerValid = -1 ;
107
107
108
108
// / Returned by @ref GetFutureErrorMessage when the passed in handle is
109
109
// / invalid.
110
110
static const char kErrorMessageFutureIsNoLongerValid [];
111
111
112
112
// / Pass into @ref Alloc for `fn_idx` when you don't want to update any
113
113
// / function.
114
- static const int kNoFunctionIndex = -1 ;
114
+ static constexpr int kNoFunctionIndex = -1 ;
115
115
116
116
explicit ReferenceCountedFutureImpl (size_t last_result_count)
117
117
: next_future_handle_(kInvalidHandle + 1 ),
Original file line number Diff line number Diff line change @@ -32,10 +32,11 @@ class PushChildNameGenerator {
32
32
33
33
private:
34
34
static const char * const kPushChars ;
35
- static const int kNumPushChars = 64 ;
36
- static const int kNumTimestampChars = 8 ;
37
- static const int kNumRandomChars = 12 ;
38
- static const int kGeneratedNameLength = kNumTimestampChars + kNumRandomChars ;
35
+ static constexpr int kNumPushChars = 64 ;
36
+ static constexpr int kNumTimestampChars = 8 ;
37
+ static constexpr int kNumRandomChars = 12 ;
38
+ static constexpr int kGeneratedNameLength =
39
+ kNumTimestampChars + kNumRandomChars ;
39
40
40
41
// For random number generation.
41
42
std::random_device random_device_;
You can’t perform that action at this time.
0 commit comments