Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created June 18, 2012 16:53
Show Gist options
  • Select an option

  • Save tetsuok/2949380 to your computer and use it in GitHub Desktop.

Select an option

Save tetsuok/2949380 to your computer and use it in GitHub Desktop.
unnamed type
// clang++ 3.1 warns template argument uses unnamed type [-Wunnamed-type-template-args],
// but compiles without error although GCC (4.2, 4.4.3) complained.
#include <algorithm>
#include <vector>
using namespace std;
enum {
SENTINEL = -1
};
int main() {
vector<int> v(5);
fill(v.begin(), v.end(), SENTINEL);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment