Change structure member sType to non-const to allow default assignment operator. Make copy constructor and copy assignment default. The latter is required for C++20 designated initializers. Delegate the constructor from C-type to the copy constructor by casting rhs accordingly. Fix warnings on gcc/clang.
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
char const * appName = "DesignatedInitializers";
|
||||
|
||||
Reference in New Issue
Block a user