mirror of
https://github.com/wuye9036/CppTemplateTutorial.git
synced 2024-03-22 13:11:16 +08:00
Fixed #19
This commit is contained in:
parent
45c001f8a3
commit
c4f8640f63
|
@ -729,7 +729,7 @@ Variant addFloatOrMulInt(Variant const* a, Variant const* b)
|
||||||
更常见的是 `void*`:
|
更常见的是 `void*`:
|
||||||
|
|
||||||
``` C++
|
``` C++
|
||||||
#define BIN_OP(type, a, op, b, result) (*(type const *)(result)) = (*(type const *)(a)) op (*(type const*)(b))
|
#define BIN_OP(type, a, op, b, result) (*(type *)(result)) = (*(type const *)(a)) op (*(type const*)(b))
|
||||||
void doDiv(void* out, void const* data0, void const* data1, DATA_TYPE type)
|
void doDiv(void* out, void const* data0, void const* data1, DATA_TYPE type)
|
||||||
{
|
{
|
||||||
if(type == TYPE_INT)
|
if(type == TYPE_INT)
|
||||||
|
@ -1030,7 +1030,7 @@ void PrintID()
|
||||||
// TypeToID 的模板“原型”
|
// TypeToID 的模板“原型”
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
template <typename T> class TypeToID<float>
|
template <> class TypeToID<float>
|
||||||
{
|
{
|
||||||
static int const ID = 0xF10A7;
|
static int const ID = 0xF10A7;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user