title: Generic template with packed and unpacked padding
body: <p>EDIT: Fixed constructor names in the packed example.</p>
  <p>We use this generic template to generate strong types for C++ interfaces:</p>
  <pre><code>/// @brief template for strong types
      /// Usage:
      /// using MyStrongIntegerRadius = StrongType&lt;uint32_t, struct InteregerRadius&gt;;
      /// see: https://www.fluentcpp.com/2016/12/08/strong-types-for-strong-interfaces/
      template&lt;typename T, typename Parameter&gt;
      class StrongType
      {
      public:
          constexpr StrongType()
          {
          }
          constexpr explicit StrongType(T const&amp; value) : value_(value)
          {
          }
          constexpr explicit StrongType(T&amp;&amp; value) : value_(std::move(value))
          {
          }
          T&amp; get()
          {
              return value_;
          }
          T const&amp; get() const
          {
              return value_;
          }
  // More code...
      private:
          T value_ { };
      };
  </code></pre>
  <p>This works fine in general. Now I have to deal with saving several of these strong typed variables  based on <code>uint8_t</code> to flash memory on a 32 bit embedded device. Since the flash space is very limited, I need to use a packed form of the template. This template could look like this:</p>
  <pre><code>    template&lt;typename T, typename Parameter&gt;
      class StrongTypePacked
      {
      public:
          constexpr StrongTypePacked()
          {
          }
          constexpr explicit StrongTypePacked(T const&amp; value) : value_(value)
          {
          }
          constexpr explicit StrongTypePacked(T&amp;&amp; value) : value_(std::move(value))
          {
          }
          T&amp; get()
          {
              return value_;
          }
          T const&amp; get() const
          {
              return value_;
          }
  // More code...
      private:
          T value_ { };
      } __attribute__((__packed__));
  </code></pre>
  <p>This creates a lot of redundant code, which I would like to avoid if possible. Thus my question is, if it is possible to write a generic form of this template for which packing can be activated at need? Note that the project uses C++14 and that pre-processor usage is limited due to functional safety requirements on code readability.</p>