Pagini recente » Cod sursa (job #448538) | Cod sursa (job #281637) | Profil: | Cod sursa (job #674640) | Cod sursa (job #3203206)
#include <iostream>
template<int CppVersion, int GccMajor, int GccMinor, int GccPatch>
struct CheckVersions {
static_assert(CppVersion != CppVersion, "Failed to meet version requirements.");
};
int main() {
// This instantiation is designed to fail.
// The compiler error message will include the instantiated template with actual values,
// indirectly showing the versions.
CheckVersions<__cplusplus, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__> check;
return 0;
}