AS
Size: a a a
AS
AC
VS
A static data member may be declared inline. An inline static data member can be defined in the class definition and may specify an initializer. It does not need an out-of-class definition:
struct X
{
inline static int n = 1;
};
AS
VS
AS
AS
VS
AS
// tu1.cpp
constexpr int global = 10;
// tu2.cpp
constexpr int global = 10; // нарушение ODR
// tu1.cpp
inline constexpr int global = 10;
// tu2.cpp
inline constexpr int global = 10; // ok
LA
AC
// tu1.cpp
constexpr int global = 10;
// tu2.cpp
constexpr int global = 10; // нарушение ODR
// tu1.cpp
inline constexpr int global = 10;
// tu2.cpp
inline constexpr int global = 10; // ok
VS
C
AM
A
int a[] = {1, {}, 2, 3};
AM
int a[] = {1, {}, 2, 3};
AB
AM
ПК
AB
template <size_t L, typename T, typename... Pairs>
std::array<T, L> init(Pairs... pairs) {
std::array<T, L> res{};
((res[pairs.first] = pairs.second), ...);
return res;
}