title: cplex constraint function of a variable
body: <p>I have an <em>optimization variable</em> x and a constant y. </p>
  
  <p>I want to express a constraint </p>
  
  <pre><code>f(x) &lt;= y. 
  </code></pre>
  
  <p>I tried doing</p>
  
  <pre><code> 27: IloRange rng = (f(cplex-&gt;getValue(x)) &lt;= y);
   28: model.add(rng);
  </code></pre>
  
  <p>But I get the error</p>
  
  <pre><code>cplex.cpp:27: error: conversion from 'bool' to non-scalar type 'IloRange' requested
  </code></pre>
  
  <p>Can someone help me write a constraint of this form?</p>