由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - pointer to override function?
相关主题
another tougth pointer examplea c++ question
about STL functor and function pointerspointer to function
A tough pointer concept把一个function pointer作为参数传入一个function的语法是什么?
function pointer 和 call-back function 有什么区别?can you insert several function pointers into a queue ?
一个c语言的问题friend function 不能virtual 怎么搞呢?
c++ pointer conversion questionc++ question
c++太神奇了听说pointer to member function只支持最多128个virtual functi
Question: Given a pointer to a functionC++ Function Pointer Array 的问题
相关话题的讨论汇总
话题: function话题: float话题: override话题: pointer话题: int
进入Programming版参与讨论
1 (共1页)
J*****n
发帖数: 48
1
I need to let function A be an argument for function B,
but function A has two forms (override), how can I
include the two types as a general form of A in argument of B?
for example
float A(int);
float A(int, double);
I want
float B((*A)(?),other arguments)
how do I substitute content denoted by "?"
p***o
发帖数: 1252
2
Then how to call them in B?

【在 J*****n 的大作中提到】
: I need to let function A be an argument for function B,
: but function A has two forms (override), how can I
: include the two types as a general form of A in argument of B?
: for example
: float A(int);
: float A(int, double);
: I want
: float B((*A)(?),other arguments)
: how do I substitute content denoted by "?"

J*****n
发帖数: 48
3
you are right, this design is problematic.

【在 p***o 的大作中提到】
: Then how to call them in B?
Q**g
发帖数: 183
4
可以用function object吧
class A{
float operator()(int){...}
float operator()(int, double){...}
}
然后传一个A的实例的指针给B.

【在 J*****n 的大作中提到】
: I need to let function A be an argument for function B,
: but function A has two forms (override), how can I
: include the two types as a general form of A in argument of B?
: for example
: float A(int);
: float A(int, double);
: I want
: float B((*A)(?),other arguments)
: how do I substitute content denoted by "?"

1 (共1页)
进入Programming版参与讨论
相关主题
C++ Function Pointer Array 的问题一个c语言的问题
关于Function Pointer的简单问题,望指教c++ pointer conversion question
function in c++c++太神奇了
C++ Q90 - Q92 (转载)Question: Given a pointer to a function
another tougth pointer examplea c++ question
about STL functor and function pointerspointer to function
A tough pointer concept把一个function pointer作为参数传入一个function的语法是什么?
function pointer 和 call-back function 有什么区别?can you insert several function pointers into a queue ?
相关话题的讨论汇总
话题: function话题: float话题: override话题: pointer话题: int