GCC4.5でこれをコンパイルできない理由を理解するのに苦労しています。
#include <iostream>
#include <bitset>
#define WIDTH 512
#define HEIGHT 512
#define CEIL_POS(X) ((X - (unsigned int)(X)) > 0 ? (unsigned int)(X + 1) : (unsigned int)(X))
int main ()
{
const unsigned int length = static_cast<const unsigned int>(CEIL_POS(static_cast<float>(WIDTH * HEIGHT) / 8.0));
std::bitset<length> bits;
return 0;
}
VS2010では問題なく動作します。私は何が欠けていますか?
更新:私は急いでいて、コード全体を貼り付けませんでした。申し訳ありません:(
PS:タイトルが言うように、私が受け取るエラーは、「長さは定数式に表示できません」です。