title: Boost Spirit x3: parse into structs
body: <p>From the Boost Spirit X3 tutorial:</p>
  
  <blockquote>
    <p>First, let's create a struct representing an employee:</p>
  
  <pre><code>namespace client { namespace ast
  {
     struct employee
     {
         int age;
         std::string surname;
         std::string forename;
         double salary;
     };
  }}
  </code></pre>
    
    <p>Then, we need to tell Boost.Fusion about our employee struct to make it a 
    first-class fusion citizen that the grammar can utilize.</p>
  
  <pre><code>BOOST_FUSION_ADAPT_STRUCT(
      client::ast::employee,
      (int, age)
      (std::string, surname)
      (std::string, forename)
      (double, salary)
  )`
  </code></pre>
    
    <p>[...]
    In fusion's view, a struct is just a form of a tuple. You can adapt any 
    struct to be a fully conforming fusion tuple.
    [...]
    Applying our collapsing rules above, the RHS has an attribute of:
        <code>fusion::vector&lt;int, std::string, std::string, double&gt;</code>
    The struct employee IS compatible with 
    fusion::vector. 
    So, the RHS of start uses start's attribute (a struct employee) in-situ 
    when it does its work.</p>
  </blockquote>
  
  <p>If I well understood, this logic heavily relies on the order of the attributes.</p>
  
  <p>Now, I am in a situation where I need to parse something like</p>
  
  <pre><code>Layer "L1" {
      number = 23
      color = green
      visible = true
  }
  </code></pre>
  
  <p>into a struct</p>
  
  <pre><code>struct LayerInfo
  {
      std::string layerName;
      int layerNumber;
      std::string color;
      bool visible;
  }
  </code></pre>
  
  <p>The problem is, <strong>the order of the layer properties can change</strong>, which is in opposition with the logic seen above.</p>
  
  <p>Which is the correct way to parse into a struct like this?
  Do I need necessarily need to use semantic actions?</p>