/* * This source code is released into the public domain. */ module; #include #include export module nihil.ucl:real; import :object; import :type; namespace nihil::ucl { export struct real final : object { using contained_type = double; inline static constexpr object_type ucl_type = object_type::real; // Create a new real from a UCL object. real(ref_t, ::ucl_object_t const *uobj); real(noref_t, ::ucl_object_t *uobj); // Create a default-initialised real. real(); // Create a new real from a value. explicit real(contained_type value); // Return the value of this real. auto value(this real const &self) -> contained_type; }; /* * Comparison operators. */ export auto operator== (real const &a, real const &b) -> bool; export auto operator== (real const &a, real::contained_type b) -> bool; export auto operator<=> (real const &a, real const &b) -> std::partial_ordering; export auto operator<=> (real const &a, real::contained_type b) -> std::partial_ordering; } // namespace nihil::ucl