Skip to content

Commit

Permalink
missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
leissa committed Dec 6, 2023
1 parent 3ab6319 commit c55098f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions include/thorin/normalize.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include <thorin/util/util.h>

namespace thorin {

class Res {
public:
Res()
: data_{} {}
template<class T>
Res(T val)
: data_(thorin::bitcast<u64>(val)) {}

constexpr const u64& operator*() const& { return *data_; }
constexpr u64& operator*() & { return *data_; }
explicit operator bool() const { return data_.has_value(); }

private:
std::optional<u64> data_;
};

} // namespace thorin

0 comments on commit c55098f

Please sign in to comment.