Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created May 5, 2012 14:13
Show Gist options
  • Save tetsuok/2602770 to your computer and use it in GitHub Desktop.
Save tetsuok/2602770 to your computer and use it in GitHub Desktop.
C++ code that clang++ does not accept but g++ does
#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