Skip to content

Commit

Permalink
add to_string method
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Herts committed Sep 18, 2024
1 parent e72bf03 commit 3efd42f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bigint.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ namespace BigInt {
return vec.back();
}

explicit operator std::string() {
return vector_to_string((*this).vec);
}

friend std::ostream &operator<<(std::ostream &stream, const bigint &n)
{
stream << vector_to_string(n.vec);
Expand Down

0 comments on commit 3efd42f

Please sign in to comment.