mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-02-08 02:36:49 +08:00
Add templated constructor to Boxed_Number to allow creating from primitive number types.
This commit is contained in:
parent
bf4f90a4ff
commit
927235d871
@ -313,6 +313,11 @@ namespace chaiscript
|
|||||||
validate_boxed_number(v);
|
validate_boxed_number(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T> explicit Boxed_Number(T t)
|
||||||
|
: bv(Boxed_Value(t))
|
||||||
|
{
|
||||||
|
validate_boxed_number(bv);
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(const Boxed_Number &t_rhs) const
|
bool operator==(const Boxed_Number &t_rhs) const
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user