$darkmode
evaluate.cpp File Reference
#include <cloe/utility/evaluate.hpp>
#include <algorithm>
#include <functional>
#include <string>
#include <boost/lexical_cast.hpp>
Include dependency graph for evaluate.cpp:

Functions

std::function< bool(double)> cloe::utility::compile_evaluation (const std::string &s)
 
std::function< bool(double)> cloe::utility::compile_evaluation (const std::string &op, double val)
 

Detailed Description

Function Documentation

◆ compile_evaluation()

std::function< bool(double)> cloe::utility::compile_evaluation ( const std::string &  s)

Compile an evaluation string into a function that evaluates a single double.

For example:

  • "<50" returns a function that returns true when input is less than 50.
  • ">60" returns a function that returns true when input is greater than 60.

An out_of_range error is thrown if the operator is not one of the following: ==, !=, <, <=, >, >=

Here is the call graph for this function:
Here is the caller graph for this function: