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

做网站得做多少网页国内搜索引擎排名第一的是

做网站得做多少网页,国内搜索引擎排名第一的是,qq自助下单平台网站,做网站banner图必备的模板通常使用类型作为参数&#xff0c;但它们也可以使用值。使用类型和可选名称声明一个值模板参数&#xff0c;方式与声明函数参数类似。值模板参数仅限于可以指定编译时常量的类型是bool、char、int等&#xff0c;但不允许使用浮点类型、字符串字面值和类。 #include <io…

模板通常使用类型作为参数,但它们也可以使用值。使用类型和可选名称声明一个值模板参数,方式与声明函数参数类似。值模板参数仅限于可以指定编译时常量的类型是bool、char、int等,但不允许使用浮点类型、字符串字面值和类。

#include <iostream>
#include <array>
#include <utility>template<class T, int N>
class Polygon{
public:Polygon(const std::array<std::pair<T, T>, N>& pts){for(int i = 0; i < N; ++i){points_[i].x_ = pts[i].first;points_[i].y_ = pts[i].second;}std::cout << __PRETTY_FUNCTION__ << std::endl;}virtual ~Polygon(){std::cout << __PRETTY_FUNCTION__ << std::endl;}struct Point{T x_;T y_;
};void draw(){for(int i = 0; i < N; ++i){std::cout << points_[i].x_ << ", " << points_[i].y_ << std::endl;}
}private:Point points_[N];
};/* N=1的特化版本 */
template<class T>
class Polygon<T,1>{
public:Polygon(){std::cout << __PRETTY_FUNCTION__ << std::endl;}virtual ~Polygon(){std::cout << __PRETTY_FUNCTION__ << std::endl;}struct Point{T x_;T y_;
};void draw(){std::cout << "One point only!\n";
}private:Point points_[1];
};int main() {std::array<std::pair<float, float>, 5> pts = {std::pair<float, float>{1.f,2.f},std::pair<float, float>{3.f,4.f},std::pair<float, float>{4.f,5.f},std::pair<float, float>{6.f,7.f},std::pair<float, float>{7.f,8.f}};Polygon<float,5> poly1(pts);poly1.draw();Polygon<int,1> poly2;poly2.draw();
}

输出:

Polygon<T, N>::Polygon(const std::array<std::pair<T, T>, N>&) [with T = float; int N = 5]
1, 2
3, 4
4, 5
6, 7
7, 8
Polygon<T, 1>::Polygon() [with T = int]
One point only!
Polygon<T, 1>::~Polygon() [with T = int]
Polygon<T, N>::~Polygon() [with T = float; int N = 5]
http://www.khdw.cn/news/64905.html

相关文章:

  • godaddy服务器做网站企业邮箱账号
  • PHP MySQL 网站开发实例百度地图轨迹导航
  • 拟定一个农产品电商网站的建设需求搭建网站教程
  • 四川省工程建设信息官方网站设计公司排名
  • 城管网站内容建设方案谷歌浏览器下载官网
  • 互联网定制网站seo营销排名
  • 怎么备份网站数据库今日百度小说排行榜
  • wordpress 连接ftp百度seo最成功的优化
  • 南沙哪有做网站的semiconductor是什么意思
  • wordpress win10seo属于运营还是技术
  • 个人可以做b2b网站上海企业网站seo
  • seo是做网站源码还是什么关键词投放
  • 做网站能赚钱十大技能培训机构排名
  • 东山县建设官方网站谷歌seo是什么意思
  • 企业网站 联系我们知道百度
  • 做网站公司找哪家西安官网seo
  • 外贸销售平台现在有哪些厦门seo服务
  • 网上订酒店 网站开发关键词查网站
  • 赤峰是住房和城乡建设局网站网页界面设计
  • 地方生活门户网站有哪些网络优化培训要多少钱
  • 郑州地区网站建设公司专业网站推广优化
  • 包头网站开发公司免费网站流量统计
  • 导航到光明城市sem优化师是什么意思
  • 创新网站建设工作网络营销的实现方式有哪些
  • 腾讯云网站建设视频教程国外网站开发
  • 如何建网站服务器微信群二维码推广平台
  • 上海做网站品牌公司长春seo排名
  • 12306网站做的好丑百度关键词优化推广
  • 建设一个电影网站怎么做天天外链
  • 下载源代码的网站搜索引擎推广成功的案例