Commit 34f2f7e2 authored by Alexis Lebis's avatar Alexis Lebis

fix unlinked obj while rebasing

parent 4579ad4e
...@@ -24,9 +24,11 @@ int main(int argc, char* argv[]){ ...@@ -24,9 +24,11 @@ int main(int argc, char* argv[]){
} }
catch(MagnitudeException e) catch(MagnitudeException e)
{ {
std::cout << "Memory adr of m is : " << &m << std::endl;
e.getMagnitude().rebase(); e.getMagnitude().rebase();
std::cout << "REBASE! New magnitude value is" << e.getMagnitude().rebase() << std::endl; std::cout << "REBASE! New magnitude value is" << e.getMagnitude().rebase() << std::endl;
std::cout << "Accessing magnitude value : " << e.getMagnitude().value() << std::endl; std::cout << "Accessing magnitude value : " << e.getMagnitude().value() << std::endl;
std::cout << "magnitude value of M : " << m.value() << std::endl;
} }
......
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
#include <exception> #include <exception>
#include <string> #include <string>
#include <iostream>
#include "../magnitude.h" #include "../magnitude.h"
class MagnitudeException : public std::exception class MagnitudeException : public std::exception
{ {
private: private:
Magnitude _triedValue; Magnitude & _triedValue;
std::string _phrase; std::string _phrase;
public: public:
...@@ -27,7 +28,7 @@ class MagnitudeException : public std::exception ...@@ -27,7 +28,7 @@ class MagnitudeException : public std::exception
virtual ~MagnitudeException() throw() virtual ~MagnitudeException() throw()
{} {}
Magnitude getMagnitude() const {return this->_triedValue;} Magnitude & getMagnitude() const {return this->_triedValue;}
}; };
#endif // SRC_EXCEPTION_MAGNITUDE_EXCEPTION_H_ #endif // SRC_EXCEPTION_MAGNITUDE_EXCEPTION_H_
\ No newline at end of file
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