Skip to content

Commit

Permalink
Remove explicit uint64_t cast from Value
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Aug 24, 2020
1 parent e1dce16 commit ebc654e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions lib/fizzy/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ union Value
template <typename T>
constexpr Value(T) = delete;

constexpr operator uint64_t() const noexcept { return i64; }

/// Get the value as the given type. Handy in templates.
/// Only required specializations are provided.
template <typename T>
Expand Down
7 changes: 0 additions & 7 deletions test/unittests/value_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,3 @@ TEST(value, as_floating_point)
EXPECT_EQ(Value{d}.f64, d);
EXPECT_EQ(Value{d}.as<double>(), d);
}

TEST(value, implicit_conversion_to_i64)
{
const Value v{1};
const uint64_t x = v;
EXPECT_EQ(x, 1);
}

0 comments on commit ebc654e

Please sign in to comment.