-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
operator== on truth tables? #88
Comments
These functions are implemented in the header |
Ah thanks! I did not even notice these. FWIW I ended up implementing something pretty similar but using SFINAE to ensure the functions are only callable with truth tables: template<typename T1, typename T2,
// make this only compile for Kitty’s truth table types
typename std::enable_if<kitty::is_truth_table<T1>::value && kitty::is_truth_table<T2>::value>::type* = nullptr>
static bool equal(const T1 &x, const T2 &y) {
... |
Actually I just realized why I ran into this issue in the first place. Kitty does not implement template<int NumVars>
bool operator==( const static_truth_table<NumVars>& first, const dynamic_truth_table& second ); Would it be possible to implement a comparator that handles this case as well? I do not seem to have the ability to re-open this issue. |
That's a good point. |
static_truth_table
anddynamic_truth_table
do not implementoperator==
andoperator!=
, so code likett1 == tt2
does not work. It seems you still can compare truth tables with something like the following (untested) code:Is it possible to implement
operator==
andoperator!=
on these classes to avoid having to do this? It should be possible to do some template-based specialization to optimize these too.OTOH perhaps I've misunderstood something and equality comparison makes no sense on these classes. In which case, I would be interested to learn of this too.
The text was updated successfully, but these errors were encountered: