Skip to content

Commit

Permalink
Fix constexpr declaration
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Jun 12, 2022
1 parent cde20d2 commit 3d4f5f6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <meevax>.deb`
| `safe-install.deb` | `all` + `test` + `package` + `sudo apt install <meevax>.deb`
Expand All @@ -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...]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.58
0.4.59
4 changes: 2 additions & 2 deletions include/meevax/kernel/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ inline namespace kernel
};

template <typename T, typename... Ts>
constexpr auto make(Ts&&... xs)
auto make(Ts&&... xs)
{
return lvalue::allocate<T>(std::forward<decltype(xs)>(xs)...); // NOTE: This leaks memory if exception thrown from T's constructor.
}

template <typename T>
constexpr auto make(T&& x)
auto make(T&& x)
{
return lvalue::allocate<typename std::decay<T>::type>(std::forward<decltype(x)>(x));
}
Expand Down
20 changes: 10 additions & 10 deletions include/meevax/memory/nan_boxing_pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<pointer>(nullptr) }
{}

#define DEFINE(TYPE) \
constexpr nan_boxing_pointer(TYPE const& value) noexcept \
nan_boxing_pointer(TYPE const& value) noexcept \
: data { reinterpret_cast<pointer>( \
signature_##TYPE | bit_cast<uintN_t<sizeof(TYPE)>>(value)) } \
{} \
Expand Down Expand Up @@ -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;
}
Expand All @@ -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<pointer>(reinterpret_cast<std::uintptr_t>(data) & mask_payload) : nullptr;
}
Expand All @@ -160,12 +160,12 @@ inline namespace memory
return type() == typeid(typename std::decay<U>::type);
}

constexpr auto signature() const noexcept
auto signature() const noexcept
{
return reinterpret_cast<std::uintptr_t>(data) & mask_signature;
}

constexpr auto type() const noexcept -> decltype(auto)
auto type() const noexcept -> decltype(auto)
{
switch (signature())
{
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ inline namespace kernel

library::library(write_library_t)
{
define<procedure>("%write-simple", [this](let const& xs)
define<procedure>("%write-simple", [](let const& xs)
{
write(cadr(xs), car(xs));
return unspecified_object;
Expand Down

0 comments on commit 3d4f5f6

Please sign in to comment.