title: How to initialize the std::optional of a user defined data type
body: <p>I am trying to learn new features of C++ 17.</p>
  
  <p>Please find the below code:</p>
  
  <pre><code>class Test
  {
  public:
        Test(int x):y(x){}
        ~Test(){}
        int getx()
        {
            return x;
        }
  private:
        int x;
  };
  struct Container
  {
      std::optional&lt;Test&gt; test;
  };
  int main()
  {
      struct Container obj;
      // here i want to initialize the member "test" of 
      // struct Container
      obj.test = make_optional&lt;Test&gt;(10); ----&gt; is this correct??
  }
  </code></pre>
  
  <p>Can someone please let me know how to initialize a <code>std::optional</code>? For example, if I declare it like:</p>
  
  <pre><code>std::optional&lt;Test&gt; t
  </code></pre>
  
  <p>How can I initialize it?</p>