有人可以解释这个C ++ typedef吗? [英] Can somebody explain this C++ typedef?

查看:67
本文介绍了有人可以解释这个C ++ typedef吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有一段时间没有使用C ++了,但是我才刚开始使用它.尽管大部分内容都说得通,但我还是发现了一些困惑.例如,有人可以解释一下此行的作用吗?

I've just started working with C++ after not having worked with it for quite a while. While most of it makes sense, there are some bits that I'm finding a bit confuddling. For example, could somebody please explain what this line does:

typedef bool (OptionManager::* OptionHandler)(const ABString& value);

推荐答案

它将类型 OptionHandler 定义为指向类 OptionManager 的成员函数的指针,并且其中该成员函数采用类型为 const ABString& 的参数并返回 bool .

It defines the type OptionHandler to be a pointer to a member function of the class OptionManager, and where this member function takes a parameter of type const ABString& and returns bool.

这篇关于有人可以解释这个C ++ typedef吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆