title: How To Optimize This find_if Code?
body: <p>I have function to check if a string contains only alphanumeric and underscore character... </p>
  
  <pre><code>inline bool IsValidChar(char x) 
  { 
      return (isalnum(x) || (x == '_')); 
  } 
  </code></pre>
  
  <p>My find_if code is: </p>
  
  <pre><code>if(find_if(str.begin(), str.end(), IsValidChar) != str.end()) 
  { 
      ... 
  } 
  </code></pre>
  
  <p>I just want to remove the IsValidChar function and directly put it's contents in the find_if line of code.. </p>