Hi Richard,

I think there are some major issues with this. The key thing is that
it needs to be type generic, and behave similarly to if you wrote
*p = x; So that means you cannot use the type of expression 'x' 
and use that to determine the type of '*p'... I suggest you try a few
cases like *char = int, *char = 1, *int = float etc, since these should
give some interesting wrong results...

You might be able to use the type of *p to select the right intrinsic -
since that is an lvalue, it might work better. However this still doesn't
feel like a good approach. It's best to have a look at other type-generic
intrinsics (such as GCC's atomics) to see how they are implemented.

Cheers,
Wilco

Reply via email to