Commit 18c84074 authored by Pawel Sznajder's avatar Pawel Sznajder
Browse files

make `toString()` function const partons/core/partons#7

parent 89539a5b
...@@ -67,7 +67,7 @@ public: ...@@ -67,7 +67,7 @@ public:
* Returns a formatted string displaying the type. * Returns a formatted string displaying the type.
* @return std::string * @return std::string
*/ */
std::string toString(); std::string toString() const;
/** /**
* Returns a short name for the type. * Returns a short name for the type.
......
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
* *
* @return std::string * @return std::string
*/ */
std::string toString(); std::string toString() const;
private: private:
double m_z; ///< z-coordinate. double m_z; ///< z-coordinate.
......
...@@ -44,7 +44,7 @@ IntegratorType1D::operator IntegratorType1D::Type() const { ...@@ -44,7 +44,7 @@ IntegratorType1D::operator IntegratorType1D::Type() const {
return m_type; return m_type;
} }
std::string IntegratorType1D::toString() { std::string IntegratorType1D::toString() const {
switch (m_type) { switch (m_type) {
case TRAPEZOIDAL: case TRAPEZOIDAL:
return "TRAPEZOIDAL"; return "TRAPEZOIDAL";
......
...@@ -29,7 +29,7 @@ void Vector3D::setZ(double z) { ...@@ -29,7 +29,7 @@ void Vector3D::setZ(double z) {
m_z = z; m_z = z;
} }
std::string Vector3D::toString() { std::string Vector3D::toString() const {
std::ostringstream os; std::ostringstream 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