So, a simple question is really illustrated by the example below. When you compile this, the compiler appropriately (?) Reports a warning (which we compare barfoo<int>::bar with barfoo<foo>::bar ), now this bar is an enumeration - can I safely ignore this warning?
#include <iostream> using namespace std; struct foo { }; template <typename bob = int> struct barfoo { enum bar { ONE, TWO, THREE }; bar action() const { return TWO; } }; template <barfoo<>::bar eAction = barfoo<>::ONE> struct IsAction { template <typename bf> static bool check(bf const& cState) { return cState.action() == eAction; } }; int main(void) { barfoo<foo> c; cout << IsAction<>::check(c) << endl; return 0; }
Given that I am committed to removing warning messages, is there a way to satisfy the compiler without moving the enum out?
source share