前提・実現したいこと
C++で将棋エンジンを作成していて、指し手生成の部分で
cpp
1#define FOREACH_BB(bitboard, sq, process) \ 2{\ 3 for (uint64_t temp_bits = (bitboard).extract<1>(); temp_bits; temp_bits = _blsr_u64(temp_bits)) { \ 4 sq = (Square)(_tzcnt_u64(temp_bits) + 63ULL); \ 5 process \ 6 } \ 7 for (uint64_t temp_bits = (bitboard).extract<0>(); temp_bits; temp_bits = _blsr_u64(temp_bits)) { \ 8 sq = (Square)_tzcnt_u64(temp_bits); \ 9 process \ 10 } \ 11}\
このようなマクロを定義して
cpp
1Square sq; 2FOREACH_BB(pieces, sq, { 3 Bitboard effect = P == GenKyosha ? computeKyoshaEffect(C, sq, occ) 4 : P == GenKeima ? keima_effect(C, sq) 5 : P == GenGin ? gin_effect(C, sq) 6 : zero_bb(); 7 8 moves = _add_moves<P, C, All>(sq, dest_bb & effect, moves); 9})
のように使っているのですが、「左側の 中かっこ '{' に対応するものがファイルの最後まで検出されませんでした。」というコンパイルエラーが出ます。何かマクロの定義、あるいは使い方に問題があるでしょうか。マクロを使わずに書くとエラーは消えます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。