title: How exactly would one implement auto update on assignment
body: <p>Consider the following code:</p>
  
  <pre><code>struct data
  {
      int foo;
      int bar;
  };
  
  data a;
  a.foo = 200;
  a.bar = 300;
  
  static void update(data* a, int rspec)
  {
    if (!rspec) //my data management
    {
        3rdPartyApi-&gt;CreateStream();
        3rdPartyApi-&gt;PushData(a-&gt;foo);
        3rdPartyApi-&gt;PushData(a-&gt;bar);
        3rdPartyApi-&gt;CloseStream();
    }
    else // internal data management
    {
        3rdPartyApi-&gt;CreateStream();
        3rdPartyApi-&gt;PushData(3rdPartyApi-&gt;BufferQueue);
        3rdPartyApi-&gt;CloseStream();
    }
    3rdPartyApi-&gt;PushStream(3rdPartyApi-&gt;GetLastStreamBuffer().POD());
  }
  </code></pre>
  
  <p>Lets say I change the value of a.foo or a.bar, and it requires me to call Update there-after the assignment.  Can this be done, without actually calling Update() on each change manually?</p>
  
  <p>[EDIT]<br>
  Note that the update function created is also assigned to a function pointer for
  the third party API, so it can do it's own internal updating.  So making the update function non-global is impossible, and thus is why the current update function is global.<br>
  [EDIT]<br>
  I also rewrote my example to be more understanding and correct to the actual API I'm using</p>
  
  <p>e.g</p>
  
  <pre><code>3rdPartyApi-&gt;StreamUpdate((void (*)(void*, int))update);
  </code></pre>