mirror of https://github.com/SeanOMik/libki.git
pclass: Second attempt to fix BitInteger casters on CI
This commit is contained in:
parent
8c70a249d8
commit
c512185115
|
@ -12,33 +12,6 @@ namespace pclass
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* A utility to call ValueCaster::declare<SrcT, DestT> with
|
|
||||||
* bi<N> and bui<N> as the destination type.
|
|
||||||
*
|
|
||||||
* N is automatically decremented until it reaches 0.
|
|
||||||
*/
|
|
||||||
template <typename T, int N = 7>
|
|
||||||
struct bit_integer_declarer
|
|
||||||
{
|
|
||||||
static void declare()
|
|
||||||
{
|
|
||||||
bit_integer_declarer<T, N - 1>::declare();
|
|
||||||
ValueCaster::declare<T, bi<N>>();
|
|
||||||
ValueCaster::declare<T, bui<N>>();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specialization for bit_integer_declarer.
|
|
||||||
* Stop decrementing N when it reaches 0.
|
|
||||||
*/
|
|
||||||
template <typename T>
|
|
||||||
struct bit_integer_declarer<T, 0>
|
|
||||||
{
|
|
||||||
static void declare() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether a type can be assigned to a
|
* Determines whether a type can be assigned to a
|
||||||
* nlohmann::json object.
|
* nlohmann::json object.
|
||||||
|
@ -202,6 +175,33 @@ namespace detail
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A utility to call ValueCaster::declare<SrcT, DestT> with
|
||||||
|
* bi<N> and bui<N> as the destination type.
|
||||||
|
*
|
||||||
|
* N is automatically decremented until it reaches 0.
|
||||||
|
*/
|
||||||
|
template <typename T, int N = 7>
|
||||||
|
struct bit_integer_declarer
|
||||||
|
{
|
||||||
|
static void declare()
|
||||||
|
{
|
||||||
|
bit_integer_declarer<T, N - 1>::declare();
|
||||||
|
ValueCaster::declare<T, bi<N>>();
|
||||||
|
ValueCaster::declare<T, bui<N>>();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specialization for bit_integer_declarer.
|
||||||
|
* Stop decrementing N when it reaches 0.
|
||||||
|
*/
|
||||||
|
template <typename T>
|
||||||
|
struct bit_integer_declarer<T, 0>
|
||||||
|
{
|
||||||
|
static void declare() {}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class used by TypeSystem to declare casters for each
|
* Utility class used by TypeSystem to declare casters for each
|
||||||
* primitive type.
|
* primitive type.
|
||||||
|
|
Loading…
Reference in New Issue