Skip to content

Commit

Permalink
Make sure that operator[] return the right types (key4hep#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored Mar 12, 2024
1 parent 69a9738 commit 0e91f93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ components:
constexpr Vector3d(const Vector3f& v) : x(v.x), y(v.y), z(v.z) {}\n
constexpr bool operator==(const Vector3d& v) const { return (x==v.x&&y==v.y&&z==v.z) ; }\n
constexpr bool operator!=(const Vector3d& v) const { return !(*this == v) ; }\n
constexpr float operator[](unsigned i) const {\n
constexpr double operator[](unsigned i) const {\n
static_assert(\n
(offsetof(Vector3d,x)+sizeof(Vector3d::x) == offsetof(Vector3d,y)) &&\n
(offsetof(Vector3d,y)+sizeof(Vector3d::y) == offsetof(Vector3d,z)),\n
Expand All @@ -93,7 +93,7 @@ components:
constexpr Vector2i( const int32_t* v) : a(v[0]), b(v[1]) {}\n
constexpr bool operator==(const Vector2i& v) const { return (a==v.a&&b==v.b) ; }\n
constexpr bool operator!=(const Vector2i& v) const { return !(*this == v) ; }\n
constexpr float operator[](unsigned i) const {\n
constexpr int operator[](unsigned i) const {\n
static_assert(\n
offsetof(Vector2i,a)+sizeof(Vector2i::a) == offsetof(Vector2i,b),\n
\"operator[] requires no padding\");\n
Expand Down

0 comments on commit 0e91f93

Please sign in to comment.