Skip to content

Create type aliases for vec3: point3, color #422

@hollasch

Description

@hollasch

See #417

The idea here is that we introduce the following to vec3.h:

using point3 = vec3;
using color = vec3;

These will create C++ weak types, where point3 and color are effectively aliases for the vec3 class. In this sense, the code can still freely mix usages of any of the three types. For example, if a function takes a point3 and we pass in a color, the compiler will not warn us. Normally a sad limitation of C++, but in this case it means we don't break existing APIs, and can at least hint at expected use for each value.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions