From 927235d8713e26c344d0bfd0dae74922bb390309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gro=C3=9F?= Date: Fri, 29 Jun 2012 07:42:16 +0200 Subject: [PATCH] Add templated constructor to Boxed_Number to allow creating from primitive number types. --- include/chaiscript/dispatchkit/boxed_number.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/chaiscript/dispatchkit/boxed_number.hpp b/include/chaiscript/dispatchkit/boxed_number.hpp index 89775d34..1fe4e954 100644 --- a/include/chaiscript/dispatchkit/boxed_number.hpp +++ b/include/chaiscript/dispatchkit/boxed_number.hpp @@ -313,6 +313,11 @@ namespace chaiscript validate_boxed_number(v); } + template explicit Boxed_Number(T t) + : bv(Boxed_Value(t)) + { + validate_boxed_number(bv); + } bool operator==(const Boxed_Number &t_rhs) const {