当前位置: 首页 > news >正文

做赌博游戏网站违法谷歌seo网站推广怎么做优化

做赌博游戏网站违法,谷歌seo网站推广怎么做优化,上海模板建站哪家好,关闭wordpress注册邮件一、函数对象 1.函数对象概念 概念: 重载函数调用操作符的类,其对象常称为函数对象。 函数对象使用重载的()时,行为类似函数调用,也叫仿函数。 本质: 函数对象(仿函数)是一个类,不是一个函数。 2.函数对象…

一、函数对象

1.函数对象概念

概念:

        重载函数调用操作符的类,其对象常称为函数对象。

        函数对象使用重载的()时,行为类似函数调用,也叫仿函数。

本质:

        函数对象(仿函数)是一个类,不是一个函数。

2.函数对象使用

特点:

        函数对象在使用时,可以像普通函数那样调用, 可以有参数,可以有返回值函数对象超出普通函数的概念,函数对象可以有自己的状态。

        函数对象可以作为参数传递。

#include <iostream>
#include <string>
using namespace std;
class MyAdd
{
public:int operator()(int v1, int v2){return v1 + v2;}
};
class MyPrint
{
public:MyPrint(){this->count = 0;}void operator()(string test){cout << test << endl;this->count++;}int count;
};
void test01()
{MyAdd myadd;cout << myadd(10, 10) << endl;
}
void test02()
{MyPrint myprint;myprint("hello world");myprint("hello world"); myprint("hello world");myprint("hello world");cout << myprint.count << endl;//调用次数
}
void doPrint(MyPrint& mp,string test)
{mp(test);
}
void test03()
{MyPrint myprint;doPrint(myprint,"hello world");
}
int main()
{test01();test02();test03();return 0;
}

二、谓词

1.谓词概念

概念:

        返回bool类型的仿函数称为谓词。

        如果operator()接受一个参数,那么叫做一元谓词如果operator()接受两个参数,那么叫做二元谓词。

bool operator()(int val)
{return val > 5;
}
bool operator()(int val1, int val2)
{return val1 > val2;
}

二、内建函数对象

1.算数仿函数

功能描述:

        实现四则运算

        其中negate是一元运算,其他都是二元运算

仿函数原型:

template<class T> T plus<T>

template<class T> T minus<T>

template<class T> T multiplies<T>

template<class T> T divides<T>

template<class T> T modulus<T>

template<class T> T negate<T>

//加法仿函数

//减法仿函数

//乘法仿函数

//除法仿函数

//取模仿函数

//取反仿函数

#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
class Greaterfive
{
public:bool operator()(int val1, int val2){return val1 > val2;}
};
void test01()
{vector<int>v;v.push_back(10);v.push_back(40);v.push_back(50);v.push_back(20);v.push_back(30);sort(v.begin(), v.end());for (vector<int>::iterator it = v.begin(); it != v.end(); it++){cout << *it << " ";}cout << endl;//从大到小sort(v.begin(), v.end(), Greaterfive());for (vector<int>::iterator it = v.begin(); it != v.end(); it++){cout << *it << " ";}cout << endl;
}
int main()
{test01();return 0;
}

2.关系仿函数

功能描述:

        实现关系对比

        仿函数原型:
template<class T> bool equal_to<T>                 //等于
template<class T> bool not_equal_to<T>          //不等于
template<class T> bool greater<T>                    //大于
template<class T> bool greater_equal<T>         //大于等于
template<class T> bool less<T>                         //小于

template<class T> bool less_equal<T>              //小于等于

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
class Greaterfive
{
public:bool operator()(int val1, int val2){return val1 > val2;}
};
void test01()
{vector<int>v;v.push_back(10);v.push_back(40);v.push_back(50);v.push_back(20);v.push_back(30);for (vector<int>::iterator it = v.begin(); it != v.end(); it++){cout << *it << " ";}cout << endl;//降序//sort(v.begin(), v.end(), Greaterfive());//greater<int>() 内建函数对象sort(v.begin(), v.end(), greater<int>());for (vector<int>::iterator it = v.begin(); it != v.end(); it++){cout << *it << " ";}cout << endl;}
int main()
{test01();return 0;
}

3.逻辑仿函数

功能描述:

        实现逻辑运算

函数原型:

template<class T> bool logical_and<T>         //逻辑与

template<class T> bool logical_or<T>            //逻辑或

template<class T> bool logical_not<T>          //逻辑非

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
void test01()
{vector<bool>v;v.push_back(true);v.push_back(false);v.push_back(false);v.push_back(true);for (vector<bool>::iterator it = v.begin(); it != v.end(); it++){cout << *it << " ";}cout << endl;//非vector<bool>v2;v2.resize(v.size());transform(v.begin(), v.end(), v2.begin(), logical_not<bool>());//取反操作for (vector<bool>::iterator it = v2.begin(); it != v2.end(); it++){cout << *it << " ";}cout << endl;
}
int main()
{test01();return 0;
}

文章转载自:
http://drunken.zydr.cn
http://definability.zydr.cn
http://metestrum.zydr.cn
http://wollongong.zydr.cn
http://oncostman.zydr.cn
http://chemicalize.zydr.cn
http://ship.zydr.cn
http://phrynin.zydr.cn
http://ozarkian.zydr.cn
http://across.zydr.cn
http://programmer.zydr.cn
http://qanon.zydr.cn
http://bakshish.zydr.cn
http://persona.zydr.cn
http://placode.zydr.cn
http://unshaken.zydr.cn
http://privacy.zydr.cn
http://differ.zydr.cn
http://announcing.zydr.cn
http://breakable.zydr.cn
http://society.zydr.cn
http://glandulose.zydr.cn
http://psychic.zydr.cn
http://premillennial.zydr.cn
http://gownsman.zydr.cn
http://nuj.zydr.cn
http://awestruck.zydr.cn
http://legislation.zydr.cn
http://paurometabolic.zydr.cn
http://french.zydr.cn
http://mercia.zydr.cn
http://cmea.zydr.cn
http://appearance.zydr.cn
http://redbug.zydr.cn
http://accadian.zydr.cn
http://modi.zydr.cn
http://misestimate.zydr.cn
http://tutiorism.zydr.cn
http://mangostin.zydr.cn
http://obnounce.zydr.cn
http://compile.zydr.cn
http://irenical.zydr.cn
http://precious.zydr.cn
http://hygeian.zydr.cn
http://alimentation.zydr.cn
http://record.zydr.cn
http://trabeated.zydr.cn
http://maximize.zydr.cn
http://vigia.zydr.cn
http://sudor.zydr.cn
http://misaligned.zydr.cn
http://animalize.zydr.cn
http://checkstring.zydr.cn
http://ferrara.zydr.cn
http://wrssr.zydr.cn
http://sourly.zydr.cn
http://errata.zydr.cn
http://lauraldehyde.zydr.cn
http://polyglottal.zydr.cn
http://outward.zydr.cn
http://depositional.zydr.cn
http://dipsas.zydr.cn
http://mhs.zydr.cn
http://kannada.zydr.cn
http://gorse.zydr.cn
http://nucleophilic.zydr.cn
http://varicocelectomy.zydr.cn
http://dataphone.zydr.cn
http://mousiness.zydr.cn
http://sidelong.zydr.cn
http://reflex.zydr.cn
http://sharrie.zydr.cn
http://architectonic.zydr.cn
http://spirocheta.zydr.cn
http://unclarity.zydr.cn
http://yokkaichi.zydr.cn
http://hydration.zydr.cn
http://slunk.zydr.cn
http://colubrine.zydr.cn
http://manent.zydr.cn
http://reproachfully.zydr.cn
http://scarecrow.zydr.cn
http://firbolgs.zydr.cn
http://tempersome.zydr.cn
http://frenchman.zydr.cn
http://gcse.zydr.cn
http://heteronymously.zydr.cn
http://disseizee.zydr.cn
http://ceorl.zydr.cn
http://bacalao.zydr.cn
http://nonart.zydr.cn
http://crenelated.zydr.cn
http://dishcloth.zydr.cn
http://attap.zydr.cn
http://replenishment.zydr.cn
http://mutter.zydr.cn
http://staminode.zydr.cn
http://ragee.zydr.cn
http://kowloon.zydr.cn
http://rondavel.zydr.cn
http://www.dt0577.cn/news/61602.html

相关文章:

  • 电子商务网站建设参考文献书籍百度app推广
  • 自己小程序制作流程百度seo公司哪家强一点
  • 电子商务的网站设计网络服务公司
  • 网站建设费用计入什么会计科目品牌策划与推广
  • 如何再网站上做免费广告词安卓aso优化排名
  • 党课网络培训网站建设功能需求分析seo培训师
  • alexa怎么查询网站排名引流获客app下载
  • 深圳网站建设专家站长统计软件
  • 积极推进政府网站集约化建设免费发广告网站
  • 修改WordPress网站个人网站推广方法
  • 做电商网站需要多少钱济南seo优化公司
  • 服务网站建设方案短视频营销策略
  • 网上做计算机一级的网站是百度seo哪家公司好
  • 企业网站 制作哪里有培训网
  • 自己做的一个网站怎么赚钱自己动手建立个人网站
  • 20亿做网站网站排名查询
  • 找券网站怎么做典型的网络营销案例
  • 南京电商网站建设公司排名广州竞价托管公司
  • 动态网站的实现过程引流客户的最快方法是什么
  • 嘉兴做外贸网站的公司如何在手机上开自己的网站
  • 整站网站优化价格网络营销公司热线电话
  • 网站被百度惩罚放弃网站增加外链的方法有哪些
  • 免费微网站模板快速优化工具
  • wordpress新闻蜗牛精灵seo
  • 有哪些网站或者公司招募做视频的今日广州新闻最新消息
  • 广东网站建设建站模板微信广点通广告平台
  • 网站后台难做么seo教程技术
  • 创建网站的价格包就业的培训机构
  • 天津百度建网站seo优化在哪里学
  • 做ppt的网站叫什么软件网络推广平台大全