手机版
热门标签
站点地图
我要投稿
广告合作
联系我们
搜 索
广告位招租
广告位招租
切换导航
首页
人工智能
编程教程
编程导航
编程百科
编程问答
编程博文
编程实例
硬件设备
网络运营
软件教程
移动数码
办公软件
操作系统
网络运维
技术频道
▸ 编程语言
▸ 前端开发
▸ 移动开发
▸ 开发工具
▸ 程序设计
▸ 行业应用
▸ CMS系统
▸ 服务器
▸ 数据库
公众号推荐
微信公众号搜
"智元新知"
关注
微信扫一扫可直接关注哦!
function-pointers
function-pointers专题提供function-pointers的最新资讯内容,帮你更好的了解function-pointers。
c – 功能指针
我在Codeproject上经过Don Clugston的 article.这是一篇很棒的文章,很有名.在下面的代码片段中,我发现了一个非常难以理解的特定概念: class A { public: virtual int Afunc() { return 2; }; }; class B { public: int Bfunc() { return 3; }; }
作者:佚名 时间:2019-04-22
为什么c函数的地址总是为真?
为什么会, #include <iostream> using namespace std; int afunction () {return 0;}; int anotherfunction () {return 0;}; int main () { cout << &afunction << endl; } 给这个, 1 >为什么每个函数都能解决? >如果所有函数共享(看起来)
作者:佚名 时间:2019-08-30
C静态成员指向函数的指针 – 如何初始化它?
我有一个静态指针,像我的类中的以下函数,但我不知道如何实例化它: class Foo{ private: static double (*my_ptr_fun)(double,double); }; 与在C 03中初始化每个其他静态成员对象的方式相同: class Foo{ private: stat
作者:佚名 时间:2019-08-30
返回函数指针语法的函数
我在C中遇到以下语法问题: float (*func(unsigned id))(float value) { ... } 我明白那个: >它是一个名为func的函数的定义 > func接受一个unsigned类型为id的参数 > func返回一个指向函数的指针,如下所示:float f(float value) 但我不明白为什么f(返回的函数指针)的返回值与其参数列表分开. 另外,是:f
作者:佚名 时间:2019-09-05
使用std :: function作为C 11中的委托
假设我有这三种不同的功能,我可能想指出: float test1(int a, int b) { return 7.0f; } struct TestClass { float test2(int a, int b) { return 5.0f; } }; struct TestClass2 { float test3(int a, int b
作者:佚名 时间:2019-09-15
C中的函数指针和未知数量的参数
我遇到了以下奇怪的代码块.想象你有以下typedef: typedef int (*MyFunctionPointer)(int param_1, int param_2); 然后,在函数中,我们尝试以下列方式从DLL运行函数: LPCWSTR DllFileName; //Path to the dll stored here LPCSTR _FunctionName; // (man
作者:佚名 时间:2019-09-20
类和子类中的C成员函数指针
我有一个基类,它包含像这样的函数指针的映射 typedef void (BaseClass::*event_t)(); class BaseClass { protected: std::map<std::string, event_t> events; public: // Example event void onFoo() {
作者:佚名 时间:2019-09-23
c – 作为函数指针的运算符
我想基于类中的选项设置一个类实现operator()几种不同的方法.因为这将被大量调用,我不想使用任何分支.理想情况下,operator()将是一个可以使用方法设置的函数指针.但是,我不确定这实际上会是什么样子.我试过了: #include <iostream> class Test { public: int (*operator())(); int DoIt1() { re
作者:佚名 时间:2019-09-25
c – 检测函数对象(仿函数)和lambda特征
如何检测nullary和unary函数指针,std :: function对象和functor(包括lambdas)的返回类型和参数类型? Boost的function_traits和functional traits并没有让我开箱即用,但我愿意补充或更换它们. 我可以这样做: namespace nsDetail { class Dummy { Dummy(); }; } templa
作者:佚名 时间:2019-10-03
c – 为什么这些功能签名不一样?
我一定是误会了,因为我认为这两种情况是一样的: #include <iostream> void function() { std::cout << "Hi\n"; } int main() { std::vector<void(*)()> funcPtrVec; std::vector<void()> funcVec;
作者:佚名 时间:2019-10-13
c – 将存储在std :: function中的带有子句的lambda转换为原始函数指针
由于我的 last recent question令人遗憾的措辞并导致解决另一个问题然后我的,我将在这里尝试以明确的方式制定我的实际问题. 在我们开始之前,作为旁注,我正在将Javascript引擎V8集成到我的C应用程序中.这就是示例中所有类型的来源.这也是我最终需要一个原始函数指针这一事实的原因.但我在下面详细说明. 从类内部我需要将一个带有capture子句[=]的lambda表达式作为st
作者:佚名 时间:2019-10-24
c – 函数指针的函数重载
有一个关于重载函数的问题.看看这段代码: #include<iostream> void fv(int){} void fc(const int){} void fvr(int&){} void fcr(const int&){} void fm(void(*fun)(const int)) { std::cout << "Constant called" << std::endl;
作者:佚名 时间:2019-10-30
c – [[noreturn]]函数指针
当我使用clang(版本3.4(主干194574))来编译它: typedef void (* FunctionThatNeverReturns [[ noreturn ]])(); 我明白了: error: 'noreturn' attribute only applies to functions and methods 这让我感到惊讶,因为它与旧版本的clang完美搭配. 那么如何定义指向[
作者:佚名 时间:2019-11-12
c – 在1个语句中将自定义函数作为模板参数传递
我成功地传递了一个函数作为参数. // this is in a scope of a normal function class DummyClass{ public: static int dummyFunction(G& goo){ return goo.doSomething (); //non-static function //Edit 3: i
作者:佚名 时间:2019-11-14
c – 应该采用模板化函数的地址触发其编译?
我得到了 this question的正式答案,decltype不应该触发函数编译.事实上,声明但未定义的函数的decltype是合法的. 接下来的问题,应该取一个函数的地址触发一个函数的编译?以this example为例: template <typename T> void foo(T&& x) { x.func(); } int main() { auto bar = &foo<
作者:佚名 时间:2019-11-18
C指向函数调用的指针不在范围内
我花了最后3个小时试图弄清楚我做错了什么.我只需要另外一些眼睛,我已经尝试了我能想到的一切,甚至各种随机排列,试图让编译器告诉我一些有用的东西. 这是我现在的位置: 码: class villain { public: villain(); //lots of other stuff bool Type1EnemyBlasts(); bool Type2EnemyBlast
作者:佚名 时间:2019-11-25
c – 指向函数和ODR的指针
关于ODR有很多问题,但是我找不到我要找的东西,所以如果这个副本或标题不合适就道歉. 考虑以下: struct t {t(*id)();}; template<typename T> t type() {return {type<T>};} 这是我对定义unique identifier per type的尝试的过度简化,希望在不同的编译单元中保持唯一. 特别是,给定一个类似于std :: st
作者:佚名 时间:2019-11-26
c – 设置std :: function变量以引用std :: sin函数
我有一个关于如何正确使用新的C 11 std :: function变量的问题.我已经看过几个搜索互联网的例子,但它们似乎并没有涵盖我正在考虑的用例.以这个最小的例子为例,其中函数fdiff是在numeric.hxx中定义的有限前向差分算法的实现(这不是问题,我只是想给出一个上下文的原因,为什么我想要任意函数和传递它). #include <functional> #include <iostre
作者:佚名 时间:2019-12-01
函数名作为C中main的参数
我有一个主要功能如下: #include <stdio.h> int main(int argc, char *argv[]) { int i, sum = 0; char *func_user = argv[1]; // execute func_user function return 0; } void foo1(void) { printf(
作者:佚名 时间:2019-12-03
c – typedef’ing函数*签名*(不是指针),以便它可以重用?
编辑:动机 假设我将Handler类定义为 class Handler { public: class Message { /*...*/ }; typedef int (*Callback)(Message *msg); void registerCallback(int msgclass, Callback f); }; 客户可以做到 int f1(Handler::Message
作者:佚名 时间:2019-12-04
上一页
6
7
8
9
10
11
12
13
14
下一页
小编推荐
苹果市值2025年有望达4万亿美元
• 联想拯救者新一代Y700平板通过IMDA认证
• 最新AI生图模型Flux1.1刷屏!添加单反相
• 联发科天玑 9400 频率敲定,3.626GHz 最
• 苹果新品发布会来了!5款产品面临停产
• 佳能R5C Mark II配置曝光:双系统设计,
• AI应用的东风,奥特曼不想错过
• 为新品让路!苹果定制版Mac发货延期
热门标签
更多
python
JavaScript
java
HTML
PHP
reactjs
C#
Android
CSS
Node.js
sql
r
python-3.x
MysqL
jQuery
c++
pandas
Flutter
angular
IOS
django
linux
swift
typescript
路由器
JSON
路由器设置
无线路由器
h3c
华三
华三路由器设置
华三路由器
电脑软件教程
arrays
docker
软件图文教程
C
vue.js
laravel
spring-boot