Commit 731a473
authored
Fix implicitly-deleted default constructor error on older Xcode version. (#8719)
Older versions of Clang (particularly those shipped with older Xcode
versions) are more strict about the initialization of const members.
According to the C++ standard, if a class has a const member that is not
initialized at the point of declaration and lacks a user-provided
default constructor that initializes it, the default constructor is
implicitly deleted.
While newer versions of Clang and other compilers may allow this if the
member has a trivial default constructor (like our View struct, which
has an inline initializer for its only member), older versions of Apple
Clang have been known to reject this, leading to build failures when
inheriting from IString (e.g., in the Name class).
This change provides an explicit default constructor for IString that
initializes the 'str' member, ensuring compatibility across a wider
range of compiler versions.1 parent aef8534 commit 731a473
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
0 commit comments