Passing operator as a parameter

后端 未结 4 1642
我在风中等你
我在风中等你 2021-02-05 03:25

I want to have a function that evaluates 2 bool vars (like a truth table)

for example:

since

T | F : T

then

myfunc(\'t\', \'f         


        
4条回答
  •  我寻月下人不归
    2021-02-05 03:30

    It's hard to be realized. In C++, function parameter need an memroy address to find its object, but operator is decided in compile time. Operator won't be a object. So you can think about MACRO to finish your task.

提交回复
热议问题