jweinst1
1/2/2018 - 2:05 AM

creates flags inside c++ class

creates flags inside c++ class

#include <iostream>

// creates flag inside a class

class Typer
{
public:
enum flag
{
  foo,
  doo
};
private:
   int _num;
public:
   
   Typer(int i): _num(i)
   {}
   ~Typer(){}
};

int main() {
  Typer::flag f = Typer::doo;
  std::cout << "Hello World!\n";
  std::cout << f << std::endl;
}