From 3d4f5f645d78a09a41e106e82203c4dd8808356c Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Sun, 12 Jun 2022 17:46:54 +0900 Subject: [PATCH] Fix constexpr declaration Signed-off-by: yamacir-kit --- README.md | 6 +++--- VERSION | 2 +- include/meevax/kernel/object.hpp | 4 ++-- include/meevax/memory/nan_boxing_pointer.hpp | 20 ++++++++++---------- src/kernel/library.cpp | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 320de8e91..72bba3ebb 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |:-------------------|:-- -| `all` (default) | Build shared-library `libmeevax.0.4.58.so` and executable `meevax`. +| `all` (default) | Build shared-library `libmeevax.0.4.59.so` and executable `meevax`. | `test` | Test executable `meevax`. -| `package` | Generate debian package `meevax_0.4.58_amd64.deb`. +| `package` | Generate debian package `meevax_0.4.59_amd64.deb`. | `install` | Copy files into `/usr/local` __(1)__. | `install.deb` | `all` + `package` + `sudo apt install .deb` | `safe-install.deb` | `all` + `test` + `package` + `sudo apt install .deb` @@ -120,7 +120,7 @@ __(1)__ Meevax installed by `make install` cannot be uninstalled by the system's ## Usage ``` -Meevax Lisp System, version 0.4.58 +Meevax Lisp System, version 0.4.59 Usage: meevax [OPTION...] [FILE...] diff --git a/VERSION b/VERSION index f96de0bf2..b7c7a484a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.58 +0.4.59 diff --git a/include/meevax/kernel/object.hpp b/include/meevax/kernel/object.hpp index 44dbfcc0a..958698de4 100644 --- a/include/meevax/kernel/object.hpp +++ b/include/meevax/kernel/object.hpp @@ -50,13 +50,13 @@ inline namespace kernel }; template - constexpr auto make(Ts&&... xs) + auto make(Ts&&... xs) { return lvalue::allocate(std::forward(xs)...); // NOTE: This leaks memory if exception thrown from T's constructor. } template - constexpr auto make(T&& x) + auto make(T&& x) { return lvalue::allocate::type>(std::forward(x)); } diff --git a/include/meevax/memory/nan_boxing_pointer.hpp b/include/meevax/memory/nan_boxing_pointer.hpp index 87c723db4..99436d382 100644 --- a/include/meevax/memory/nan_boxing_pointer.hpp +++ b/include/meevax/memory/nan_boxing_pointer.hpp @@ -72,12 +72,12 @@ inline namespace memory auto operator =(nan_boxing_pointer const&) -> nan_boxing_pointer & = default; - constexpr nan_boxing_pointer(std::nullptr_t = nullptr) + nan_boxing_pointer(std::nullptr_t = nullptr) : nan_boxing_pointer { static_cast(nullptr) } {} #define DEFINE(TYPE) \ - constexpr nan_boxing_pointer(TYPE const& value) noexcept \ + nan_boxing_pointer(TYPE const& value) noexcept \ : data { reinterpret_cast( \ signature_##TYPE | bit_cast>(value)) } \ {} \ @@ -109,17 +109,17 @@ inline namespace memory #undef DEFINE - constexpr auto operator ->() const + auto operator ->() const { return get(); } - constexpr auto operator *() const -> decltype(auto) + auto operator *() const -> decltype(auto) { return *get(); } - constexpr explicit operator bool() const noexcept + explicit operator bool() const noexcept { return get() != nullptr; } @@ -139,17 +139,17 @@ inline namespace memory } } - constexpr auto dereferenceable() const noexcept + auto dereferenceable() const noexcept { return signature() == signature_pointer; } - constexpr auto equivalent_to(nan_boxing_pointer const& nbp) const noexcept + auto equivalent_to(nan_boxing_pointer const& nbp) const noexcept { return data == nbp.data; } - constexpr auto get() const noexcept -> pointer + auto get() const noexcept -> pointer { return dereferenceable() ? reinterpret_cast(reinterpret_cast(data) & mask_payload) : nullptr; } @@ -160,12 +160,12 @@ inline namespace memory return type() == typeid(typename std::decay::type); } - constexpr auto signature() const noexcept + auto signature() const noexcept { return reinterpret_cast(data) & mask_signature; } - constexpr auto type() const noexcept -> decltype(auto) + auto type() const noexcept -> decltype(auto) { switch (signature()) { diff --git a/src/kernel/library.cpp b/src/kernel/library.cpp index a21b278eb..aff410047 100644 --- a/src/kernel/library.cpp +++ b/src/kernel/library.cpp @@ -968,7 +968,7 @@ inline namespace kernel library::library(write_library_t) { - define("%write-simple", [this](let const& xs) + define("%write-simple", [](let const& xs) { write(cadr(xs), car(xs)); return unspecified_object;