Templating of lvec_get and lvec_set