Skip to content

Commit

Permalink
Fix error: template-id not allowed for constructor in C++20 [-Werror=…
Browse files Browse the repository at this point in the history
…template-id-cdtor] (valhalla#5110)
  • Loading branch information
jeremiahpslewis authored Feb 17, 2025
1 parent 33624f2 commit 064dcae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* FIXED: Get CostMatrix allow second pass option from new location in config [#5055](https://github.com/valhalla/valhalla/pull/5055/)
* FIXED: Slim down Matrix PBF response [#5066](https://github.com/valhalla/valhalla/pull/5066)
* FIXED: restore ignoring hierarchy limits for bicycle and pedestrian [#5080](https://github.com/valhalla/valhalla/pull/5080)
* FIXED: GCC warning 'template-id not allowed for constructor in C++20' [#5110](https://github.com/valhalla/valhalla/pull/5110)
* **Enhancement**
* ADDED: Consider smoothness in all profiles that use surface [#4949](https://github.com/valhalla/valhalla/pull/4949)
* ADDED: `admin_crossings` request parameter for `/route` [#4941](https://github.com/valhalla/valhalla/pull/4941)
Expand Down
10 changes: 5 additions & 5 deletions valhalla/midgard/vector2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@ template <typename PrecisionT> class VectorXY {
/**
* Default constructor
*/
VectorXY<PrecisionT>() : x_(0.0), y_(0.0) {
VectorXY() : x_(0.0), y_(0.0) {
}

/**
* Constructor given a point. Essentially a vector from the
* origin to the point.
* @param p Point.
*/
VectorXY<PrecisionT>(const PointXY<PrecisionT>& p) : x_(p.x()), y_(p.y()) {
VectorXY(const PointXY<PrecisionT>& p) : x_(p.x()), y_(p.y()) {
}

/**
* Constructor given components of the vector.
* @param x x component of the vector.
* @param y y component of the vector.
*/
VectorXY<PrecisionT>(const PrecisionT x, const PrecisionT y) : x_(x), y_(y) {
VectorXY(const PrecisionT x, const PrecisionT y) : x_(x), y_(y) {
}

/**
* Constructor from one point to another.
* @param from Point at origin of the vector.
* @param to Point at end of vector
*/
VectorXY<PrecisionT>(const PointXY<PrecisionT>& from, const PointXY<PrecisionT>& to)
VectorXY(const PointXY<PrecisionT>& from, const PointXY<PrecisionT>& to)
: x_(to.x() - from.x()), y_(to.y() - from.y()) {
}

/**
* Copy constructor.
* @param w Vector to copy to the new vector.
*/
VectorXY<PrecisionT>(const VectorXY<PrecisionT>& w) : x_(w.x()), y_(w.y()) {
VectorXY(const VectorXY<PrecisionT>& w) : x_(w.x()), y_(w.y()) {
}

/**
Expand Down

0 comments on commit 064dcae

Please sign in to comment.