conform pragma

C++ 固有

/Zc:forScope コンパイラ オプションの実行時の動作を指定します。

構文

#pragma conform(name [ , show ] [ , { on | off } ] [ [ , { push | pop } ] [ ,identifier [ , { on | off } ] ] ] )

パラメーター

name
変更されるコンパイラ オプションの名前を指定します。 有効な nameforScope のみです。

show
(オプション) name の現在の設定 (true または false) がコンパイル中に警告メッセージとして表示されます。 たとえば、「 #pragma conform(forScope, show) 」のように入力します。

on, off
(省略可能) nameon に設定すると、/Zc:forScope コンパイラ オプションが有効になります。 既定値は、off です。

push
(省略可能) name の現在の値を内部コンパイラ スタックにプッシュします。 identifier を指定する場合、スタックにプッシュされる name 値として on または off を指定できます。 たとえば、「 #pragma conform(forScope, push, myname, on) 」のように入力します。

pop
(オプション) name の値を内部コンパイラ スタックの最上部の値に設定して、スタックをポップします。 ID が pop で指定されると、識別子を持つレコードが見つかるまでスタックがポップされ、見つかったレコードもポップされます。スタック上の次のレコードの名前の現在の値が、名前の新しい値になります。 pop をスタック内のレコードにない identifier と一緒に指定すると、pop は無視されます。

識別子
(省略可能) push コマンドまたは pop コマンドに含めることができます。 identifier が使用される場合、on 指定子または off 指定子も使用できます。

// pragma_directive_conform.cpp
// compile with: /W1
// C4811 expected
#pragma conform(forScope, show)
#pragma conform(forScope, push, x, on)
#pragma conform(forScope, push, x1, off)
#pragma conform(forScope, push, x2, off)
#pragma conform(forScope, push, x3, off)
#pragma conform(forScope, show)
#pragma conform(forScope, pop, x1)
#pragma conform(forScope, show)

int main() {}

関連項目

pragma ディレクティブと __pragma および _Pragma キーワード