Skip to content

Commit

Permalink
[lua.nil] lua nil objects can now be constructed with a value paramet…
Browse files Browse the repository at this point in the history
…er, which is completely ignored
  • Loading branch information
harrand committed Mar 14, 2024
1 parent 948b7ed commit 4c07009
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tz/lua/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@

namespace tz::lua
{
struct nil{};
struct nil
{
// allow construction with parameter (which we proceed to completely ignore)
// this is basically so its easy to assign a lua_generic to a value with a visitor (coz if its nil it will still compile but still be nil)
nil([[maybe_unused]] auto t){}
nil(){}
};
namespace impl
{
using fn_t = int(*)(void*);
Expand Down

0 comments on commit 4c07009

Please sign in to comment.