Pagini recente » Cod sursa (job #192669) | Cod sursa (job #3193742) | Cod sursa (job #2261502) | Solutii preONI 2006 - Runda 1 | 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;
}