title: How can I store a id<MTLBuffer> inside of c++ code?
body: <p>I am writing a cross-platform engine to do some rendering. I am trying to create a cross-platform structure that essentially manages a type of geometry that is drawn.</p>
  
  <p>The goal is that there is a c++ class that holds a void* to a block of memory allocated for a buffer and then that pointer is passed into a MTLBuffer or a Vulcan Buffer for use in rendering. As such one of the fields of this class is going to need to be a buffer but in a cross-platform sense.</p>
  
  <p>For a portion of my drawing, the code should look like</p>
  
  <pre><code>func draw() {
     CrossPlatformBuffers* buffs = // preset list
     for (buffer in buffs {
        PlatformSpecificEngine.drawWith((PlatformSpecificBuffer)buffs-&gt;buffer)
     }
  }
  </code></pre>
  
  <p>So essentially I need to be able to store my MTLBuffer as a void* within a c++ class. This is confusing to me as I am not exactly sure how c++ plays with objective-c ARC or exactly what id is supposed to mean.</p>
  
  <p>Would I encounter any issues if I just casted the id into a void* and passed it into a c++ class as and later called delete on it?</p>