Skip to content

Commit

Permalink
axis_:
Browse files Browse the repository at this point in the history
- changed base_type to uint16 to match the (new) joker default (awaiting a proper solution)
- added conversion operators to Content/value
- attempt to make axis_ w/ empty Content an empty class.
  • Loading branch information
Domagoj Šarić committed Jul 22, 2023
1 parent 76f2aae commit d9855a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/kwk/settings/axis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace kwk::__
using is_product_type = void;
using axis_kind = axis_<ID,joker>;
using content_type = Content;
using base_type = std::int32_t;
using base_type = std::uint16_t;
using id_type = decltype(ID);

static constexpr auto identifier = ID;
Expand Down Expand Up @@ -103,7 +103,13 @@ namespace kwk::__
return axis_<ID,decltype(v)>{v};
}

Content value = {};
KWK_PURE explicit constexpr operator Content () const noexcept { return value; }
KWK_PURE constexpr Content operator*() const noexcept { return value; }

#ifndef _WIN32 // https://github.com/llvm/llvm-project/issues/49358 Missing [[no_unique_address]] support on Windows
[[no_unique_address]] // allow empty axis_ for empty Content (e.g. joker)
#endif
Content value{};
};

template<auto ID, typename C1, typename C2>
Expand Down

0 comments on commit d9855a9

Please sign in to comment.