Originally posted by atomsymbol
View Post
Announcement
Collapse
No announcement yet.
Coroutines & Modules Added For C++20
Collapse
X
-
Originally posted by atomsymbol View Post[I]C++ forces the programmer to define types of fields of a struct/class before the struct/class is defined. This is putting a very strict constraint on the ordering of struct data types in the source code. You cannot call a virtual method (defined elsewhere !!!) before the struct definition has seen the definition of the types of its fields, while obviously the knowledge of fields is immaterial to the virtual method call.
- 2 likes
Comment
-
Regarding modules: Apart from those who just want modules to improve build speeds, there are also those who dream of shipping binary "modules" rather than libraries + source header files because they dislike open source as a business model, and hope that "modules" will be easier to ship without lots of source code in lengthy header files. Only time will tell how often this feature will be used an abused. And whether compiler makers will succeed to let modules actually work faster and more flexible than "pre-compiled headers".
- 1 like
Comment
-
Originally posted by atomsymbol View PostI still think the requirement of knowing sizeof(T) and alignof(T)
Originally posted by atomsymbol View PostInvoking T's default constructor, destructor, assignment operator, or copy-constructor: These are plain function calls, unless inlining. Default constructor/etc are automatically marked as inline by current compilers - a current-compiler-specific feature.
Comment
-
Originally posted by cj.wijtmans View Post
so you cant import a module? the compiler should be able to use the same information that a header contains (except for macros and certain templates but those shouldnt exist in C++ anyway)
Modules are imported almost like headers are, but unlike headers they don't ship macros.
Comment
-
Originally posted by coder View PostI still think you don't understand what a "use case" is.
To invoke a default constructor/destructor/copy-constructor/assignment operator requires the compiler to instantiate them, for which it needs the full details of the members.
Comment
Comment