diff --git a/Jupiter/Readable_String.h b/Jupiter/Readable_String.h index 95f6da3..49ecab4 100644 --- a/Jupiter/Readable_String.h +++ b/Jupiter/Readable_String.h @@ -361,12 +361,18 @@ namespace Jupiter /** * @brief Move constructor for the TokenizeResult class. */ - TokenizeResult(const TokenizeResult &&source); + TokenizeResult(TokenizeResult &&source); /** * @brief Destructor for the TokenizeResult class. */ ~TokenizeResult(); + + /** Assignment Operator */ + inline TokenizeResult &operator=(const TokenizeResult &right); + + /** Move Operator */ + inline TokenizeResult &operator=(TokenizeResult &&right); }; /** diff --git a/Jupiter/Readable_String_Imp.h b/Jupiter/Readable_String_Imp.h index e1edf34..05c7701 100644 --- a/Jupiter/Readable_String_Imp.h +++ b/Jupiter/Readable_String_Imp.h @@ -1332,7 +1332,7 @@ template template class R> Jupiter::Readable_Stri } } -template template class R> Jupiter::Readable_String::TokenizeResult::TokenizeResult(const TokenizeResult &&source) +template template class R> Jupiter::Readable_String::TokenizeResult::TokenizeResult(TokenizeResult &&source) { Jupiter::Readable_String::TokenizeResult::tokens = source.tokens; Jupiter::Readable_String::TokenizeResult::token_count = source.token_count; @@ -1353,6 +1353,29 @@ template template class R> const R &Jupiter::R return R::empty; } +// TokenizeResult Operators + +template template class R> inline typename Jupiter::Readable_String::TokenizeResult &Jupiter::Readable_String::TokenizeResult::operator=(typename const Jupiter::Readable_String::TokenizeResult &right) +{ + Jupiter::Readable_String::TokenizeResult::tokens = new R[source.token_count]; + Jupiter::Readable_String::TokenizeResult::token_count = 0; + while (Jupiter::Readable_String::TokenizeResult::token_count != source.token_count) + { + Jupiter::Readable_String::TokenizeResult::tokens[Jupiter::Readable_String::TokenizeResult::token_count] = source.tokens[Jupiter::Readable_String::TokenizeResult::token_count]; + ++Jupiter::Readable_String::TokenizeResult::token_count; + } + return *this; +} + +template template class R> inline typename Jupiter::Readable_String::TokenizeResult &Jupiter::Readable_String::TokenizeResult::operator=(typename Jupiter::Readable_String::TokenizeResult &&right) +{ + Jupiter::Readable_String::TokenizeResult::tokens = source.tokens; + Jupiter::Readable_String::TokenizeResult::token_count = source.token_count; + source.tokens = nullptr; + source.token_count = 0; + return *this; +} + // tokenize template template class R> typename Jupiter::Readable_String::TokenizeResult Jupiter::Readable_String::tokenize(const Jupiter::Readable_String &in, const T &token) diff --git a/Release/Jupiter.lib b/Release/Jupiter.lib index f0f1838..33337b6 100644 Binary files a/Release/Jupiter.lib and b/Release/Jupiter.lib differ