diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-06-23 00:32:38 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-06-23 00:32:38 +0100 |
| commit | 0fa623093366351ad47583f47add6e51f56a56d8 (patch) | |
| tree | 3eaaa64f5c9b88798d2b971d2810f85cc3e06cd6 /nihil.ucl/real.ccm | |
| parent | 8cbb82a1f6eb6605a4615d30922b777e7bf1e4d8 (diff) | |
| download | nihil-0fa623093366351ad47583f47add6e51f56a56d8.tar.gz nihil-0fa623093366351ad47583f47add6e51f56a56d8.tar.bz2 | |
nihil.ucl: improve tests
Diffstat (limited to 'nihil.ucl/real.ccm')
| -rw-r--r-- | nihil.ucl/real.ccm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nihil.ucl/real.ccm b/nihil.ucl/real.ccm index 51607f2..260e993 100644 --- a/nihil.ucl/real.ccm +++ b/nihil.ucl/real.ccm @@ -17,7 +17,7 @@ import :object; namespace nihil::ucl { export struct real final : object { - using value_type = double; + using contained_type = double; inline static constexpr object_type ucl_type = object_type::real; @@ -42,7 +42,7 @@ export struct real final : object { {} // Create a new real from a value. - explicit real(value_type value) + explicit real(contained_type value) : object(noref, ::ucl_object_fromdouble(value)) { if (_object == nullptr) @@ -50,9 +50,9 @@ export struct real final : object { } // Return the value of this real. - auto value(this real const &self) -> value_type + auto value(this real const &self) -> contained_type { - auto v = value_type{}; + auto v = contained_type{}; auto const *uobj = self.get_ucl_object(); if (::ucl_object_todouble_safe(uobj, &v)) @@ -78,13 +78,13 @@ export auto operator<=> (real const &a, real const &b) return a.value() <=> b.value(); } -export auto operator== (real const &a, real::value_type b) +export auto operator== (real const &a, real::contained_type b) -> bool { return a.value() == b; } -export auto operator<=> (real const &a, real::value_type b) +export auto operator<=> (real const &a, real::contained_type b) -> std::partial_ordering { return a.value() <=> b; |
