From dfeded73f45229558693e227bc1c9f52102ea0af Mon Sep 17 00:00:00 2001 From: Dominik Laskowski Date: Tue, 15 Nov 2022 16:53:53 -0500 Subject: FTL: Add mixins for type-safe wrappers For now, allow mixing in construction, default construction, equality, ordering, incrementing, and addition. Bug: 185536303 Test: ftl_test Change-Id: I9017e124656ba0e7f13f378814c5b1c19a36655b --- include/ftl/enum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ftl/enum.h') diff --git a/include/ftl/enum.h b/include/ftl/enum.h index 82af1d6cf8..075d12bd17 100644 --- a/include/ftl/enum.h +++ b/include/ftl/enum.h @@ -92,7 +92,7 @@ inline constexpr bool is_scoped_enum_v = is_scoped_enum::value; // enum class E { A, B, C }; // static_assert(ftl::to_underlying(E::B) == 1); // -template +template >> constexpr auto to_underlying(E v) { return static_cast>(v); } -- cgit v1.2.3-59-g8ed1b