如何使用GCC 6.1檢測Concepts TS的存在?使用GCC 6.1檢測概念TS
This page建議宏__cpp_experimental_concepts
應該在支持Concepts TS的實現中預定義。但是,下面的測試程序沒有錯誤編譯的GCC 6.1與-fconcepts
標誌:
#ifdef __cpp_experimental_concepts
static_assert(false, "Concepts TS found");
#endif
template <typename T>
concept bool Identity = true;
int main() {}
(我希望無論是static_assert
火,或concept
關鍵字去無法識別)
有誰知道任何其他方法來基於Concepts是否可用來有條件地編譯代碼?
你可以用'echo | g ++ -E -dM -fconcepts -x C++ - | fgrep概念' –