diff options
Diffstat (limited to 'nihil.ucl/real.ccm')
| -rw-r--r-- | nihil.ucl/real.ccm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nihil.ucl/real.ccm b/nihil.ucl/real.ccm index d968667..51607f2 100644 --- a/nihil.ucl/real.ccm +++ b/nihil.ucl/real.ccm @@ -36,14 +36,20 @@ export struct real final : object { throw type_mismatch(ucl_type, type()); } + // Create a default-initialised real. + real() + : real(0) + {} + // Create a new real from a value. - real(value_type value) + explicit real(value_type value) : object(noref, ::ucl_object_fromdouble(value)) { if (_object == nullptr) throw error("failed to create UCL object"); } + // Return the value of this real. auto value(this real const &self) -> value_type { auto v = value_type{}; |
