随笔分类 -  c/c++笔记

摘要:#include "iostream" #include #include using namespace std; class Root { private: typedef std::function print_func; print_func F_print; public: void setPrint(print_func fun) { F_print = fu... 阅读全文

posted @ 2017-01-18 17:28 竹雨OvO 阅读(138) 评论(0) 推荐(0)

摘要:1.static和const不能同时修饰类的成员函数(static int getde()const;) 分析:原因在于const会在函数中添加一个隐式参数const this*,而static是没有this指针的,此时static的用法和static就产生了冲突。 其他解释:两者的语意是矛盾的。s 阅读全文

posted @ 2016-06-15 14:09 竹雨OvO 阅读(188) 评论(0) 推荐(0)