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

环保网页设计代码优化关键词排名哪家好

环保网页设计代码,优化关键词排名哪家好,如何制作网页二维码,软件工程毕业设计选题新颖定义于头文件 <ios> class ios_base; 类 ios_base 是作为所有 I/O 流类的基类工作的多用途类。它维护数种数据&#xff1a; 1) 状态信息&#xff1a;流状态标志&#xff1b; 2) 控制信息&#xff1a;控制输入和输出序列格式化和感染的本地环境的标志&#xff1b; 3)…
定义于头文件 <ios>

class ios_base;

ios_base 是作为所有 I/O 流类的基类工作的多用途类。它维护数种数据:

1) 状态信息:流状态标志;

2) 控制信息:控制输入和输出序列格式化和感染的本地环境的标志;

3) 私有存储:允许 long 和 void* 成员的有下标可扩展数据结构,它可以实现为二个任意长度的数组,或二元素结构体的单个数组,或另一容器;

4) 回调:从 imbue() 、 copyfmt() 和 ~ios_base() 调用的任意数量用户定义函数。

典型实现保有对应下列 fmtflags 、 iostate 、 openmode 及 seekdir 所有值的成员常量,维护当前精度、宽度、格式化标志、异常掩码、缓冲区错误状态、保有回调的可调大小容器、当前感染的 locale 、私有存储的成员变量及 xalloc() 所用的静态整数变量。

本地环境

设置本地环境

std::ios_base::imbue

std::locale imbue( const std::locale& loc );

设置流的关联本地环境为给定值。在返回前,以 imbue_event 为参数调用 register_callback() 所注册的每个函数。

参数

loc-要关联到流的新 locale

返回值

操作前与流关联的 locale 对象。

返回当前本地环境

std::ios_base::getloc

std::locale getloc() const;

返回当前与流关联的 locale 。

参数

(无)

返回值

与流关联的 locale 对象。

内部可扩展数组

返回能安全用作 pword() 和 iword() 下标的程序范围内独有的整数

std::ios_base::xalloc

static int xalloc();

返回(程序范围内)唯一的值,它能用于通过调用 iword() 和 pword() 访问 std::ios_base 的私有存储中一个 long 和一个 void* 元素。到 xalloc 的调用不分配内存。

此函数线程安全;从多个线程共时访问不导致数据竞争。 (C++14 起)

等效地自增 std::ios_base 的私有静态数据成员,如同以执行 return index++; ,若 index 是该静态成员的名称(它可以为 std::atomic 或以其他方式以支持多线程共时访问) (C++14 起)。

参数

(无)

返回值

用作 pword/iword 下标的独有整数。

调用示例

#include <array>
#include <tuple>
#include <ctime>
#include <string>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <codecvt>
#include <locale>using namespace std;template<class charT, class traits = std::char_traits<charT> >
class mystream : public std::basic_ostream<charT, traits>
{
public:static const int xindex;mystream(std::basic_ostream<charT, traits>& ostr) :std::basic_ostream<charT, traits>(ostr.rdbuf()){this->pword(xindex) = this;}void myfn(){*this << "[special handling for mystream]";}
};// 每个 mystream 特化从 xalloc() 获得独有的下标
template<class charT, class traits>
const int mystream<charT, traits>::xindex = std::ios_base::xalloc();// 此 I/O 操纵符将能用于辨识身为 mystream 的 ostream
// 通过查找存储于 pword 的指针
template<class charT, class traits>
std::basic_ostream<charT, traits>& mymanip(std::basic_ostream<charT, traits>& os)
{if (os.pword(mystream<charT, traits>::xindex) == &os){static_cast<mystream<charT, traits>&>(os).myfn();}return os;
}int main()
{std::cout << "cout, narrow-character test " << mymanip << std::endl;mystream<char> myout(std::cout);myout << "myout, narrow-character test " << mymanip << std::endl;std::wcout << "wcout, wide-character test " << mymanip << std::endl;mystream<wchar_t> mywout(std::wcout);mywout << "mywout, wide-character test " << mymanip << std::endl;return 0;
}

输出

如果有必要的话,调整私有存储的大小,并且访问位于提供的下标的long元素

std::ios_base::iword

long& iword( int index );

首先,充分地分配或重置私有存储( long 的动态数组或另一可索引数据结构)以确保 index 是合法下标,然后返回到带下标 index 的私有存储 long 元素。

引用可能被此 ios_base 对象上任何其他操作非法化,包含另一对 iword() 的调用,但维持返回值,使得以相同下标从 iword(index) 读取将产生相同值(直至下次到 copyfmt() 的调用)。值能用于任何目的。必须通过先前的 xalloc() 调用获得元素下标,否则行为未定义。新元素初始化为 0 。

若分配失败,则调用可能抛出 std::ios_base::failure 的 std::basic_ios<>::setstate(badbit) 。

参数

index-元素的下标值

返回值

到该元素的引用。

异常

设置 badbit 时可能抛出 std::ios_base::failure 。

调用示例

#include <array>
#include <tuple>
#include <ctime>
#include <string>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <codecvt>
#include <locale>using namespace std;#include <iostream>
#include <string>struct Foo
{static int foo_xalloc;std::string data;Foo(const std::string& s) : data(s) {}
};// 分配 Foo 对象所用的 iword 存储
int Foo::foo_xalloc = std::ios_base::xalloc();// 若 iword 保有 1 则此用户定义 operator<< 打印字符串
std::ostream& operator<<(std::ostream& os, Foo& f)
{if (os.iword(Foo::foo_xalloc) == 1){return os << std::string(f.data.rbegin(), f.data.rend());}else{return os << f.data;}
}// 此 I/O 操纵符在 0 与 1 间翻转存储于 iword 的数
std::ios_base& rev(std::ios_base& os)
{os.iword(Foo::foo_xalloc) = !os.iword(Foo::foo_xalloc);return os;
}int main()
{Foo f("example");std::cout << f << '\n' << rev << f << '\n' << rev << f << '\n';return 0;
}

输出

 

若需要则重置私有存储的大小,并访问位于指定下标的 void* 元素

std::ios_base::pword

void*& pword( int index );

首先,充分地分配或重置私有存储( void* 的动态数组或另一可索引数据结构)以确保 index 是合法下标,然后返回到带下标 index 的私有存储 void* 元素。

引用可能被此 ios_base 对象上任何其他操作非法化,包含另一对 pword() 的调用,但维持返回值,使得以相同下标从 pword(index) 读取将产生相同值(直至下次到 copyfmt() 的调用)。值能用于任何目的。元素下标必须由 xalloc() 获得,否则行为未定义。初始化新元素为 NULL 。

若分配失败,则调用可能抛出 std::ios_base::failure 的 std::basic_ios<>::setstate(badbit) 。

参数

index-元素的下标值

返回值

到该元素的引用。

异常

设置 badbit 时可能抛出 std::ios_base::failure 。

注意

若存储于 pword 的指针要求管理,则可用 register_callback() 安装按需执行深复制或解分配的处理函数。

调用示例

#include <array>
#include <tuple>
#include <ctime>
#include <string>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <codecvt>
#include <locale>
#include <string>using namespace std;template<class charT, class traits = std::char_traits<charT> >
class mystream : public std::basic_ostream<charT, traits>
{
public:static const int xindex;mystream(std::basic_ostream<charT, traits>& ostr) :std::basic_ostream<charT, traits>(ostr.rdbuf()){this->pword(xindex) = this;}void myfn(){*this << "[special handling for mystream]";}
};// 每个 mystream 特化从 xalloc() 获得独有的下标
template<class charT, class traits>
const int mystream<charT, traits>::xindex = std::ios_base::xalloc();// 此 I/O 操纵符将能用于辨识身为 mystream 的 ostream
// 通过查找存储于 pword 的指针
template<class charT, class traits>
std::basic_ostream<charT, traits>& mymanip(std::basic_ostream<charT, traits>& os)
{if (os.pword(mystream<charT, traits>::xindex) == &os){static_cast<mystream<charT, traits>&>(os).myfn();}return os;
}int main()
{std::cout << "cout, narrow-character test " << mymanip << '\n';mystream<char> myout(std::cout);myout << "myout, narrow-character test " << mymanip << '\n';std::wcout << "wcout, wide-character test " << mymanip << '\n';mystream<wchar_t> mywout(std::wcout);mywout << "mywout, wide-character test " << mymanip << '\n';
}

输出

 

http://www.mmbaike.com/news/108212.html

相关文章:

  • wordpress常用hook网站关键词优化排名怎么做
  • 旅游网站制作网站维护一年一般多少钱?
  • 南宁做网站开发的公司怎么在百度上推广
  • 淘宝引流到微信推广方法西安seo技术培训班
  • 做网站和网站页面设计做网络推广的网站有哪些
  • 张家界做网站找谁重庆电子商务网站seo
  • 网站建设中 模板 下载日本域名注册网站
  • 制作网站需要多少时间新闻联播直播 今天
  • 个人可以注册网站吗hyein seo官网
  • 济南室内设计学校百度快照优化排名推广怎么做
  • 为每个中小学建设网站百度95099如何转人工
  • 网站进入之前动态效果青岛百度快速排名优化
  • 自学做动态网站百度人工电话
  • 做ppt一般在什么网站好杭州seo外包服务
  • 唐山哪个公司可以制作网站在线工具
  • 海尔网站建设情况营业推广促销
  • 个人网站建设 优帮云网站优化推广方法
  • 可以注册邮箱的网站重庆seo网络推广优化
  • 日本做的视频网站有哪些问题吗给我免费的视频在线观看
  • 名字做头诗的网站进一步优化
  • 可用的国外代理ip网站改版seo建议
  • 哪里有网站源文件下载小程序开发公司排行榜
  • 怎么把园林设计网站做的酷炫媒体资源网
  • 三门峡市建设局网站百度客服电话人工服务
  • 网站创建服务公司怎么买域名自己做网站
  • 个人网站建设合同网站名称查询
  • 做面点的网站一键建站
  • 成都到西安飞机什么是seo如何进行seo
  • 建设银行网站认证营销型网站建设团队
  • 网站托管维护代运营营销型网站建设论文