Tag: struct
4 posts
-
C++ struct vs class: The One Language Difference and the Conventions Built on It
struct and class differ only in default member and base-class access. What that means for inheritance, POD and aggregates, and when to pick which keyword.
-
Go in 2 Weeks #03: Structs, Methods, Pointer vs Value Receivers and Embedding Instead of Inheritance
No class keyword in Go: structs, methods, pointer vs value receivers, embedding, and NewXxx constructors compared to C++.
-
C++20 Designated Initializers: Named Struct Fields, Order Rules and Nested Configs
C++20 designated initializers: declaration-order rules, what C allows that C++ rejects, real GCC errors, defaults, nested structs and config-struct patterns.
-
C++ Aggregate Initialization: What Counts as an Aggregate, C++17/20 Rule Changes, and Designated Initializers
Which structs and arrays are aggregates, why a defaulted constructor stops counting in C++20, base classes, designated initializers, parenthesized init, and narrowing errors.