Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- YOU HAVE TO EDIT THIS FILE
- */
- #include "MaxValue.h"
- #include <algorithm>
- std::vector<int> MaxValue::s_Values;
- MaxValue::MaxValue( int value )
- {
- m_Value = s_Values.size();
- s_Values.push_back(value);
- }
- MaxValue::~MaxValue()
- {
- s_Values[m_Value] = 0;
- }
- int MaxValue::CurrentMaximum()
- {
- if (s_Values.size()>0)
- {
- return *std::max_element(s_Values.begin(), s_Values.end());
- }
- }
- MaxValue::MaxValue(const MaxValue& other)
- {
- m_Value = s_Values.size();
- s_Values.push_back(s_Values[other.m_Value]);
- }
- MaxValue& MaxValue::operator=(MaxValue other)
- {
- s_Values[m_Value] = s_Values[other.m_Value];
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement