Skip to content

Commit

Permalink
Add const to constexpr methods
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmoene committed Apr 20, 2016
1 parent 3e21b03 commit 4460c33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions phys/units/quantity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,26 @@ class quantity
// /**
// * convert to compatible unit, for example: (3._dm).to(meter) gives 0.3;
// */
// constexpr value_type to( quantity const & x ) { return *this / x; }
// constexpr value_type to( quantity const & x ) const { return *this / x; }

/**
* convert to given unit, for example: (3._dm).to(meter) gives 0.3;
*/
template <typename DX, typename X>
constexpr auto to( quantity<DX,X> const & x ) -> detail::Quotient<Dims,DX,T,X>
constexpr auto to( quantity<DX,X> const & x ) const -> detail::Quotient<Dims,DX,T,X>
{
return *this / x;
}

/**
* the quantity's magnitude.
*/
constexpr value_type magnitude() { return m_value; }
constexpr value_type magnitude() const { return m_value; }

/**
* the quantity's dimensions.
*/
constexpr dimension_type dimension() { return dimension_type{}; }
constexpr dimension_type dimension() const { return dimension_type{}; }

/**
* We need a "zero" of each type -- for comparisons, to initialize running
Expand Down

0 comments on commit 4460c33

Please sign in to comment.