Prevent accidental aggregates

*  The compiler can provide many non-explicit constructors for
   aggregate types.  This is sometimes desired, but it can
   happen accidentally, resulting in run-time errors.

*  This commit assures that no types are aggregates unless existing
   code is using aggregate initialization.
This commit is contained in:
Howard Hinnant
2018-04-04 11:56:20 -04:00
committed by Nikolaos D. Bougalis
parent b7335fdff5
commit db3b4dd396
110 changed files with 400 additions and 28 deletions

View File

@@ -44,6 +44,8 @@ struct custom_delete;
template <>
struct custom_delete <RSA>
{
explicit custom_delete() = default;
void operator() (RSA* rsa) const
{
RSA_free (rsa);
@@ -53,6 +55,8 @@ struct custom_delete <RSA>
template <>
struct custom_delete <EVP_PKEY>
{
explicit custom_delete() = default;
void operator() (EVP_PKEY* evp_pkey) const
{
EVP_PKEY_free (evp_pkey);
@@ -62,6 +66,8 @@ struct custom_delete <EVP_PKEY>
template <>
struct custom_delete <X509>
{
explicit custom_delete() = default;
void operator() (X509* x509) const
{
X509_free (x509);
@@ -71,6 +77,8 @@ struct custom_delete <X509>
template <>
struct custom_delete <DH>
{
explicit custom_delete() = default;
void operator() (DH* dh) const
{
DH_free (dh);