Skip to content

Conversation

@tderensis
Copy link

No description provided.

constexpr explicit vec(const vec<U,1> & v) : vec(static_cast<T>(v.x)) {}
constexpr const T & operator[] (int i) const { return x; }
LINALG_CONSTEXPR14 T & operator[] (int i) { return x; }
constexpr const T & operator[] (int i) const { (void)i; return x; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing i would have the same effect I think:

constexpr const T & operator[] (int) const { return x; }

see https://godbolt.org/z/6E5r88sdx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants