[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/ArashPartow/exprtk/master/exprtk_simple_example_24.cpp [Back]  [Original]

/*
 **************************************************************
 *         C++ Mathematical Expression Toolkit Library        *
 *                                                            *
 * Simple Example 24                                          *
 * Author: Arash Partow (1999-2025)                           *
 * URL: https://www.partow.net/programming/exprtk/index.html  *
 *                                                            *
 * Copyright notice:                                          *
 * Free use of the Mathematical Expression Toolkit Library is *
 * permitted under the guidelines and in accordance with the  *
 * most current version of the MIT License.                   *
 * https://www.opensource.org/licenses/MIT                    *
 * SPDX-License-Identifier: MIT                               *
 *                                                            *
 **************************************************************
*/


#include 
#include 

#include "exprtk.hpp"


template 
struct char_process : public exprtk::igeneric_function
{
   typedef typename exprtk::igeneric_function igfun_t;
   typedef typename igfun_t::parameter_list_t    parameter_list_t;
   typedef typename igfun_t::generic_type        generic_type;
   typedef typename generic_type::string_view    string_t;

   using exprtk::igeneric_function::operator();

   char_process()
   : exprtk::igeneric_function("S")
   {}

   inline T operator()(parameter_list_t parameters)
   {
      const unsigned char c = string_t(parameters[0])[0];
      return Process(c);
   }
};

template 
T is_digit_func(const unsigned char c)
{
   return (('0' 

Web Proxy Viewer  |  New URL  |  Original Page