re-write all vec- and tmp-vec- operations using metafunctions