Commit 137ffaf7 by Maarten L. Hekkelman

Merge remote-tracking branch 'github/new-docs' into develop

parents 747c6d30 4585968b
...@@ -29,4 +29,4 @@ ...@@ -29,4 +29,4 @@
/// \file io.hpp /// \file io.hpp
/// \deprecated This file is no longer used. Please use "cif++/pdb.hpp" instead /// \deprecated This file is no longer used. Please use "cif++/pdb.hpp" instead
#warning "Use of this file is deprecated, please use "cif++/pdb.hpp" #warning "Use of this file is deprecated, please use "cif++/pdb.hpp"
\ No newline at end of file
...@@ -523,10 +523,10 @@ struct point_type ...@@ -523,10 +523,10 @@ struct point_type
} }
/// \brief Add the points @a lhs and @a rhs and return the result /// \brief Add the points @a lhs and @a rhs and return the result
template <typename F1, typename F2> template <typename F2>
friend constexpr auto operator+(const point_type<F1> &lhs, const point_type<F2> &rhs) friend constexpr auto operator+(const point_type &lhs, const point_type<F2> &rhs)
{ {
return point_type<std::common_type_t<F1, F2>>(lhs.m_x + rhs.m_x, lhs.m_y + rhs.m_y, lhs.m_z + rhs.m_z); return point_type<std::common_type_t<value_type, F2>>(lhs.m_x + rhs.m_x, lhs.m_y + rhs.m_y, lhs.m_z + rhs.m_z);
} }
/// \brief subtract @a rhs /// \brief subtract @a rhs
...@@ -550,17 +550,16 @@ struct point_type ...@@ -550,17 +550,16 @@ struct point_type
} }
/// \brief Subtract the points @a lhs and @a rhs and return the result /// \brief Subtract the points @a lhs and @a rhs and return the result
template <typename F1, typename F2> template <typename F2>
friend constexpr auto operator-(const point_type<F1> &lhs, const point_type<F2> &rhs) friend constexpr auto operator-(const point_type &lhs, const point_type<F2> &rhs)
{ {
return point_type<std::common_type_t<F1, F2>>(lhs.m_x - rhs.m_x, lhs.m_y - rhs.m_y, lhs.m_z - rhs.m_z); return point_type<std::common_type_t<value_type, F2>>(lhs.m_x - rhs.m_x, lhs.m_y - rhs.m_y, lhs.m_z - rhs.m_z);
} }
/// \brief Return the negative copy of @a pt /// \brief Return the negative copy of @a pt
template <typename F1> friend constexpr point_type operator-(const point_type &pt)
friend constexpr point_type<F1> operator-(const point_type<F1> &pt)
{ {
return point_type<F>(-pt.m_x, -pt.m_y, -pt.m_z); return point_type(-pt.m_x, -pt.m_y, -pt.m_z);
} }
/// \brief multiply all members with @a rhs /// \brief multiply all members with @a rhs
...@@ -573,17 +572,17 @@ struct point_type ...@@ -573,17 +572,17 @@ struct point_type
} }
/// \brief multiply point @a pt with value @a f and return the result /// \brief multiply point @a pt with value @a f and return the result
template <typename F1, typename F2> template <typename F2>
friend constexpr auto operator*(const point_type<F1> &pt, F2 f) friend constexpr auto operator*(const point_type &pt, F2 f)
{ {
return point_type<std::common_type_t<F1, F2>>(pt.m_x * f, pt.m_y * f, pt.m_z * f); return point_type<std::common_type_t<value_type, F2>>(pt.m_x * f, pt.m_y * f, pt.m_z * f);
} }
/// \brief multiply point @a pt with value @a f and return the result /// \brief multiply point @a pt with value @a f and return the result
template <typename F1, typename F2> template <typename F2>
friend constexpr auto operator*(F1 f, const point_type<F2> &pt) friend constexpr auto operator*(F2 f, const point_type &pt)
{ {
return point_type<std::common_type_t<F1, F2>>(pt.m_x * f, pt.m_y * f, pt.m_z * f); return point_type<std::common_type_t<value_type, F2>>(pt.m_x * f, pt.m_y * f, pt.m_z * f);
} }
/// \brief divide all members by @a rhs /// \brief divide all members by @a rhs
...@@ -596,10 +595,10 @@ struct point_type ...@@ -596,10 +595,10 @@ struct point_type
} }
/// \brief divide point @a pt by value @a f and return the result /// \brief divide point @a pt by value @a f and return the result
template <typename F1, typename F2> template <typename F2>
friend constexpr auto operator/(const point_type<F1> &pt, F2 f) friend constexpr auto operator/(const point_type &pt, F2 f)
{ {
return point_type<std::common_type_t<F1, F2>>(pt.m_x / f, pt.m_y / f, pt.m_z / f); return point_type<std::common_type_t<value_type, F2>>(pt.m_x / f, pt.m_y / f, pt.m_z / f);
} }
/** /**
...@@ -683,8 +682,7 @@ struct point_type ...@@ -683,8 +682,7 @@ struct point_type
} }
/// \brief Print out the point @a pt to @a os /// \brief Print out the point @a pt to @a os
template <typename F1> friend std::ostream &operator<<(std::ostream &os, const point_type &pt)
friend std::ostream &operator<<(std::ostream &os, const point_type<F1> &pt)
{ {
os << '(' << pt.m_x << ',' << pt.m_y << ',' << pt.m_z << ')'; os << '(' << pt.m_x << ',' << pt.m_y << ',' << pt.m_z << ')';
return os; return os;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment