title: C++ Templates: Inlined code and Compiler Optimzations
body: <p>Is it safe to assume that the following code when optimized and inlined by the compiler would remove the branch needed to evaluate the ternary operation? Or with most mainstream compilers would it be wiser to break the method below into two separate methods to avoid the branch?</p>
  
  <pre><code>/*! \brief this method returns the cos of an angle. User can specify if it is
   * in degrees or radians.
   */
  template &lt;typename T, angle_mode AM&gt;
  T cos(const T &amp;angle)
  { 
    return (AM == radians) ? 
      std::cos(angle) :
      std::cos(degrees_to_radians(angle));
  }
  </code></pre>