Created
May 5, 2012 14:13
-
-
Save tetsuok/2602770 to your computer and use it in GitHub Desktop.
C++ code that clang++ does not accept but g++ does
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
struct Entry { | |
unsigned char key; | |
std::size_t value; | |
}; | |
template <typename EntryT> | |
class Klass { | |
public: | |
static std::size_t size(std::size_t size) { | |
return size * sizeof(Entry); | |
} | |
Klass() {} | |
~Klass() {} | |
}; | |
int main() { | |
char mem[Klass<Entry>::size(10)]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment