質問

How do I convert the following macro into a function?

#define xtime(x)   ((x<<1) ^ (((x>>7) & 1) * 0x1b))
役に立ちましたか?

解決

template<typename T>
T xtime(T x)
{
    return ((x<<1) ^ (((x>>7) & 1) * 0x1b));
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top