title: How to initialize POD struct with private/protected members without creating constructor?
body: <p><a href="https://stackoverflow.com/a/4762944/9173835">POD can have private/protected members</a></p>
  <p>Because of protected members, it is impossible to initialize struct like this:</p>
  <pre><code>struct SomePOD_t {
  protected:
      char *p_begin;
      char *p_end;
  };
  
  void foo() {
      const char *STR = &quot;Some data&quot;;
      SomePOD_t data = { STR, STR + strlen(STR)+1 }; // error &quot;no mathing constructor for
                                                     // initialization of SomePOD_t&quot;
  }
  </code></pre>
  <p>My question is how to make easier passing POD types to functions:</p>
  <pre><code>// gonna use this foo
  void foo_uses_some_pod(SomePOD_t data);
  
  void foo()
  {
       const char *STR = &quot;Some data&quot;;
  
        //error &quot;no matching function for call to 'foo_uses_some_pod'&quot;
        // &quot;candidate function not viable: cannot convert initializer list argument to 'SomePOD_t'&quot;
       foo_uses_some_pod({STR, STR + strlen(STR)+1});
  
       //ok, if SomePOD_t::static_built_function is defined.
       foo_uses_some_pod(SomePOD_t::static_built_function(STR, STR + strlen(STR)+1)); 
  }
  </code></pre>
  <p>I think explicit type mapping <code>SomePOD_t{STR, STR + strlen(STR)+1}</code> in the function call is a good practice, but excess <code>static_built_function</code> in <code>SomePOD_t::static_built_function(STR, STR + strlen(STR)+1)</code> is too much.</p>
  <p>If I add constructor to <code>SomePOD_t</code> it will not be POD anymore, so all types, that use <code>SomePOD_t</code> will become non-POD too and I have to add constructors for every type with <code>SomePOD_t</code> as member, or type with type that has type ... ... that has <code>SomePOD_t</code> as member.</p>
  <p>Can type  be POD, have private/protected members and support initializer-list inititalization? How?</p>