function
<atomic>

std::kill_dependency

template <class T>
  T kill_dependency (T y) noexcept;
Kill dependency
Returns the value of y without carrying a dependency.

Atomic operations that use memory_order_consume as memory order require the compiler to check for the dependencies carried by accessing memory locations used to produce the value released. Synchronizing such carried dependencies may cause certain hardware fences to be set up and force the compiler to forego certain potential optimizations involving these memory locations.

Calling this function indicates the compiler that any dependencies in y should not be carried over to the returned value, not requiring them to be synchronized.

Parameters

y
A value.

Return value

The value y without carrying dependencies.

Exception safety

No-throw guarantee: never throws exceptions.

See also