title: C++/cli I'm having an issue that my std::list is empty
body: <p>My problem is that I am trying to save 3 strings in a list to take the same place how ever it doesn't work for me for some reason, I have tried using vector instead of list but same issue appeared. I know for a fact that the variables have correct input so I don't understand why it wouldn't push the values to the list correctly.</p>
  <p>This is my Lists.h</p>
  <pre><code>#pragma once
  #include &lt;list&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  namespace JobStatus
  {
  using namespace System::Collections::Generic;
  using namespace System::Text;
  using namespace std;
  
  class service_Order
  {
  private:
      string serviceOrder_Number;
      string serviceOrder_Status;
      string time_Stamp;
  
  public:
      string GetserviceOrder_Number()
      {
          return serviceOrder_Number;
      }
      string SetserviceOrder_Number(string serviceOrderNumber)
      {
          serviceOrderNumber = serviceOrder_Number;
          return serviceOrderNumber;
      }
  
      string GetserviceOrder_Status()
      {
          return serviceOrder_Status;
      }
      string SetserviceOrder_Status(string serviceOrderStatus)
      {
          serviceOrderStatus = serviceOrder_Status;
          return serviceOrderStatus;
      }
  
      string Gettime_Stamp()
      {
          return time_Stamp;
      }
      string Settime_Stamp(string timeStamp)
      {
          timeStamp = time_Stamp;
          return timeStamp;
      }
  };
  
  class Lists
  {
  public:
      list&lt;service_Order&gt; service_Order_List;
  };
  }
  </code></pre>
  <p>This is part of my Add_Job_Info.h</p>
  <pre><code> private: System::Void Add_Job_Click(System::Object^ sender, System::EventArgs^ e)
      {           
          //Gets SO number from the text box
          String^ service_order_number = Service_Order_Number-&gt;Text;
          ClrStringToStdString(serviceOrderNumber, service_order_number);
  
          //Gets SO status from the select box
          String^ service_order_status = Job_Status-&gt;Text;
          ClrStringToStdString(serviceOrderStatus, service_order_status);
  
          //Gets time from the system
          Time t;
          t.setTime();
          if (t.timeinfo.tm_min &lt; 10)
          {
              String^ timestamp = (t.timeinfo.tm_hour + &quot;:0&quot; + t.timeinfo.tm_min);
              ClrStringToStdString(timeStamp, timestamp);
          }
          else
          {
              String^ timestamp = (t.timeinfo.tm_hour + &quot;:&quot; + t.timeinfo.tm_min);
              ClrStringToStdString(timeStamp, timestamp);
          }
  
          
  
          //Saves all of the above in a List
          newSO.SetserviceOrder_Number(serviceOrderNumber);
          newSO.SetserviceOrder_Status(serviceOrderStatus);
          newSO.Settime_Stamp(timeStamp);
          service_order_lists.service_Order_List.push_back(newSO);
  
          for each (newSO in service_order_lists.service_Order_List)
          {
              cout &lt;&lt; serviceOrderNumber; //shows service order number correct
              cout &lt;&lt; serviceOrderStatus; //shows service order status correct
              cout &lt;&lt; timeStamp; //shows time stamp correctly
              cout &lt;&lt; newSO.GetserviceOrder_Number() &lt;&lt; &quot;:&quot; &lt;&lt; newSO.Gettime_Stamp() &lt;&lt; &quot;:&quot; &lt;&lt; newSO.GetserviceOrder_Status(); //This returns only ::
          }
  
          this-&gt;Close();
      }
  </code></pre>
  <p>This converts windows String to std string</p>
  <pre><code> static void ClrStringToStdString(string&amp; outStr, String^ str) //Converts Windows managed Strings to std unmanaged strings
      {
          IntPtr ansiStr = Marshal::StringToHGlobalAnsi(str);
          outStr = (const char*)ansiStr.ToPointer();
          Marshal::FreeHGlobal(ansiStr);
      }
  </code></pre>
  <p>If you need me to show my full Add_Job_Info.h then I will edit the post, I just didn't want to annoy anyone by posting too much code</p>