 extension AnyArrayBuffer where Dispatch: FactorArrayDispatch {
   /// Returns the errors, at `x`, of the factors.
   func errors(at x: VariableAssignments) -> [Double] {
-    withUnsafePointer(to: storage) { dispatch.errors($0, x) }
+    dispatch.errors(.init(self), x)
   }
 }
 

  /// - Requires: `storage` is the address of an `ArrayStorage` whose `Element` has a
  ///   subclass-specific `VectorFactor` type.
  final let errorVectors:
    (_ storage: UnsafeRawPointer, _ x: VariableAssignments) -> AnyVectorArrayBuffer

  /// A function returning the linearizations, at `x`, of the factors in `storage`.
  ///
  /// - Requires: `storage` is the address of an `ArrayStorage` whose `Element` has a
  ///   subclass-specific `VectorFactor` type.
  final let linearized:
    (_ storage: UnsafeRawPointer, _ x: VariableAssignments) -> AnyGaussianFactorArrayBuffer

  /// Creates an instance for elements of type `Element` using the given `Linearization`.
  init<Element: VectorFactor, Linearization: LinearApproximationFactor>(
    _: Type<Element>, linearization: Type<Linearization>
  )
    where Linearization.Variables == Element.LinearizableComponent.Variables.TangentVector,
          Linearization.ErrorVector == Element.ErrorVector
  {
    let storageType = Type<ArrayStorage<Element>>()

    errorVectors = { storage, x in
      .init(storage[as: storageType].errorVectors(at: x))
    }
    
    linearized = { storage, x in
      .init(storage[as: storageType].linearized(at: x) as ArrayBuffer<Linearization>)
    }
    super.init(Type<Element>())
  }
}


  /// - Requires: `storage` is the address of an `ArrayStorage` whose `Element` has a
  ///   subclass-specific `GaussianFactor` type.
  final let errorVectors_linearComponent:
    (_ self_: Self_,_ x: VariableAssignments) -> AnyVectorArrayBuffer

  /// A function that accumulates the adjoint (aka "transpose" or "dual") of `errorVectors` at `y`
  /// into `result`.
