[UNTESTED] Basic queue and fan-in fabric implementation without full template generalization
This commit is contained in:
35
include/weaver/bitwise.h
Normal file
35
include/weaver/bitwise.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef THWEAVER_BITWISE_H
|
||||
#define THWEAVER_BITWISE_H
|
||||
|
||||
#include <concepts>
|
||||
|
||||
template <typename T>
|
||||
concept Bitwise =
|
||||
requires(T a, T b) {
|
||||
{
|
||||
a & b
|
||||
}
|
||||
-> std::same_as<T>;
|
||||
{
|
||||
a | b
|
||||
}
|
||||
-> std::same_as<T>;
|
||||
{
|
||||
a ^ b
|
||||
}
|
||||
-> std::same_as<T>;
|
||||
{
|
||||
~a
|
||||
}
|
||||
-> std::same_as<T>;
|
||||
{
|
||||
a << 1
|
||||
}
|
||||
-> std::same_as<T>;
|
||||
{
|
||||
a >> 1
|
||||
}
|
||||
-> std::same_as<T>;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user