macros for inplace operations