'error: invalid static_cast from type ‘__m256i’ {aka ‘__vector(4) long long int’} to type ‘void*’

I'm trying to compile a piece of code where it calls uses static_cast to do something like the following:

  __m256i values;
  int64_t i = 1;
  static_cast<void*>(values + i);

but this results in the error

error: invalid static_cast from type ‘__m256i’ {aka ‘__vector(4) long long int’} to type ‘void*’

It appears this conversion invalid or static_cast is not appropriate here? Is there an alternative approach to perform the conversion?

This is pretty low level stuff, and I'm not too familiar with this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source