From c5075348e8d1053acd9583f4539960afaeafa058 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 11 Jul 2022 21:51:00 +0000 Subject: [PATCH] better test casting --- tests/src/unit-custom-integer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/src/unit-custom-integer.cpp b/tests/src/unit-custom-integer.cpp index 9de1fda02..cfb945f9a 100644 --- a/tests/src/unit-custom-integer.cpp +++ b/tests/src/unit-custom-integer.cpp @@ -43,7 +43,11 @@ class wrapped_int return val; } wrapped_int() = default; - /* implicit */ wrapped_int(T val) : val(val) {} + explicit wrapped_int(T val) : val(val) {} + + // allow implicit conversions from anything that `T` allows conversions from + template::value>::type> + wrapped_int(T2 val) : val(val) {} bool operator==(const wrapped_int& other) const {