From 3efd42f6e4bb6305f493ec29339ba57d527f82f9 Mon Sep 17 00:00:00 2001 From: Samuel Herts Date: Wed, 18 Sep 2024 10:41:37 -0400 Subject: [PATCH] add to_string method --- bigint.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bigint.h b/bigint.h index 522a7c2..c0ffe87 100644 --- a/bigint.h +++ b/bigint.h @@ -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);