title: Enum as a function parameter
body: <p>is there anything wrong with this code in c++?</p>
  
  <pre><code>enum OpenMode{
      Read = 0x1,
      Write = 0x2,
      Append = 0x4
  };
  
  void main(){
      open_file("./something", OpenMode::Write); //!!!!!!!!!
  }
  
  void open_file(string name, OpenMode om){
      .
      .
      .
  }
  </code></pre>
  
  <p>All i need to do is to pass an enum to function without creating an instance of it.</p>
  
  <p>Ok, Have you ever noticed the way ios works? For example:</p>
  
  <pre><code>somefile.open(file_name, ios::in | ios::out)
  </code></pre>
  
  <p>I need a way to do something like this: "something::something"!</p>