Use Vector3<int> as foo

Hi guys,

I was wondering if it’s possible to do something like

use cgmath::Vector3<f64> as vector;

It seems I can do

use cgmath::Vector3 as vector;
vector<f64> foo;

but was wondering if there was a way to do so since it would make my code look possibly cleaner. Thanks!

Use a type alias:

type vector = cgmath::Vector3<f64>;
4 Likes

Completely forgot about the type alias. Thanks so much!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.