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

可视化网站建设软件有哪些谷歌搜索引擎为什么国内用不了

可视化网站建设软件有哪些,谷歌搜索引擎为什么国内用不了,浏览器看外国网站,郑州移动网站建设https://www.boost.org/sgi/stl/character_traits.html char_traits<char> char_traits<wchar_t>traits翻译为特征、特性类&#xff0c;一般是指某种类型的特性类应该提供的一组接口、类型定义。 web页面描述了一些接口要求。感觉没有什么特别的。直接看代码吧 c…

https://www.boost.org/sgi/stl/character_traits.html

char_traits<char>
char_traits<wchar_t>

traits翻译为特征、特性类,一般是指某种类型的特性类应该提供的一组接口、类型定义。
web页面描述了一些接口要求。感觉没有什么特别的。直接看代码吧

char_traits.h文件中,以下两个头文件不在sgi stl范围内,属于c标准库的范围
在vs中创建一个空工程,#include “…/stl/char_traits.h” 后,就可以在vs中跳转过去,看到的是windows的实现。

#include <string.h>
#include <wchar.h>

以上两个头文件定义了strcpy_s、_memccpy之类的基础C函数,说明STL中的一些函数间接使用了C函数
__char_traits_base 定义了char类型的比较、赋值、拷贝、查找、求长度等基础函数

template <class _CharT, class _IntT> class __char_traits_base {
public:typedef _CharT char_type;typedef _IntT int_type;
#ifdef __STL_USE_NEW_IOSTREAMS //这个没用上,暂时可以不管typedef streamoff off_type;typedef streampos pos_type;typedef mbstate_t state_type;
#endif /* __STL_USE_NEW_IOSTREAMS */static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; }static bool eq(const _CharT& __c1, const _CharT& __c2) { return __c1 == __c2; }static bool lt(const _CharT& __c1, const _CharT& __c2) { return __c1 < __c2; }static int compare(const _CharT* __s1, const _CharT* __s2, size_t __n) {for (size_t __i = 0; __i < __n; ++__i)if (!eq(__s1[__i], __s2[__i]))return __s1[__i] < __s2[__i] ? -1 : 1;return 0;}static size_t length(const _CharT* __s) {const _CharT __nullchar = _CharT();//默认构造函数必须置0(概念上可以不为0,定义无歧义空值即可)size_t __i;for (__i = 0; !eq(__s[__i], __nullchar); ++__i) {}return __i;}static const _CharT* find(const _CharT* __s, size_t __n, const _CharT& __c) {//此处传值或许更好,编译器优化后可能无差别for ( ; __n > 0 ; ++__s, --__n)if (eq(*__s, __c))return __s;return 0;}static _CharT* move(_CharT* __s1, const _CharT* __s2, size_t __n) {memmove(__s1, __s2, __n * sizeof(_CharT));//__n 是__s1 __s2的sizereturn __s1;}    static _CharT* copy(_CharT* __s1, const _CharT* __s2, size_t __n) {memcpy(__s1, __s2, __n * sizeof(_CharT));return __s1;} static _CharT* assign(_CharT* __s, size_t __n, _CharT __c) {for (size_t __i = 0; __i < __n; ++__i)__s[__i] = __c;return __s;}static int_type not_eof(const int_type& __c) {return !eq_int_type(__c, eof()) ? __c : 0;}static char_type to_char_type(const int_type& __c) {return static_cast<char_type>(__c);}static int_type to_int_type(const char_type& __c) {return static_cast<int_type>(__c);}static bool eq_int_type(const int_type& __c1, const int_type& __c2) {return __c1 == __c2;}static int_type eof() {return static_cast<int_type>(-1);//-1为无效值,大文件实际应该为long long -1}
};

POD表示"Plain Old Data"(简单老数据),衍生概念是指可简单拷贝内存复制对象的结构体,含有指针的就不适合简单拷贝。
char_traits不适用与非POD类型。

template <class _CharT> class char_traits //特化版本,与后面的char_traits<char>特化不一样,此处实际还没确定类型: public __char_traits_base<_CharT, _CharT>
{};
__STL_TEMPLATE_NULL class char_traits<char> //char的特化版本,重载了几个函数,典型的是调用C函数的几个: public __char_traits_base<char, int>{
public:static char_type to_char_type(const int_type& __c) {return static_cast<char_type>(static_cast<unsigned char>(__c));}static int_type to_int_type(const char_type& __c) {return static_cast<unsigned char>(__c);}static int compare(const char* __s1, const char* __s2, size_t __n) { return memcmp(__s1, __s2, __n); }  static size_t length(const char* __s) { return strlen(__s); }static void assign(char& __c1, const char& __c2) { __c1 = __c2; }static char* assign(char* __s, size_t __n, char __c){ memset(__s, __c, __n); return __s; }
};

wchar_t版本特化,wint_t实际是unsigned short

__STL_TEMPLATE_NULL class char_traits<wchar_t>: public __char_traits_base<wchar_t, wint_t>{};

basic_string在string中定义,web说明中没有很复杂,基本就是template <class _CharT, class _Traits, class _Alloc>三个的组合
实际代码如下

#pragma set woff 1174 //这种用法比较少见,据说是ms vs才支持的关闭告警语法
#pragma set woff 1375
// A helper class to use a char_traits as a function object.将char_traits用作函数对象
template <class _Traits>
struct _Not_within_traits //是否在内部找得到: public unary_function<typename _Traits::char_type, bool>{typedef const typename _Traits::char_type* _Pointer;const _Pointer _M_first;const _Pointer _M_last;_Not_within_traits(_Pointer __f, _Pointer __l) : _M_first(__f), _M_last(__l) {}bool operator()(const typename _Traits::char_type& __x) const {//找到了就在string内有__x,否则_Not_within_traitsreturn find_if(_M_first, _M_last, bind1st(_Eq_traits<_Traits>(), __x)) == _M_last;}//bind1st存储了op和1st参数,变成了一个一元仿函数对象,再去操作序列中的元素。
};
template <class _InputIter, class _Predicate>
inline _InputIter find_if(_InputIter __first, _InputIter __last,_Predicate __pred,input_iterator_tag){while (__first != __last && !__pred(*__first))//遇到相等就停,不等于就循环下去++__first;return __first;
}
template <class _Traits>
struct _Eq_traits: public binary_function<typename _Traits::char_type,typename _Traits::char_type,bool>{bool operator()(const typename _Traits::char_type& __x,const typename _Traits::char_type& __y) const{ return _Traits::eq(__x, __y); }//实际就是判断是否相等。封装是为了编译期检查?
};
template <class _Arg1, class _Arg2, class _Result>
struct binary_function { //二元函数typedef _Arg1 first_argument_type;typedef _Arg2 second_argument_type;typedef _Result result_type;
};  
template <class _Operation, class _Tp>//_Operation == _Eq_traits<_Traits>()
inline binder1st<_Operation> //返回值是一个函数对象,编译后可能是函数指针,或者内联
bind1st(const _Operation& __fn, const _Tp& __x) {typedef typename _Operation::first_argument_type _Arg1_type;return binder1st<_Operation>(__fn, _Arg1_type(__x));//说明__x是__fn的第一个参数
}
template <class _Operation> 
class binder1st  : public unary_function<typename _Operation::second_argument_type,typename _Operation::result_type> {
protected:_Operation op;//操作的存储,使得当前类替代了被绑定的操作(操作的递归替换)typename _Operation::first_argument_type value;//降元的本质就是将部分存到仿函数内部。
public:binder1st(const _Operation& __x,const typename _Operation::first_argument_type& __y): op(__x), value(__y) {}//bind1st(_Eq_traits<_Traits>(), __x)把第一个参数绑定,实际是存储起来typename _Operation::result_typeoperator()(const typename _Operation::second_argument_type& __x) const {//与第二个参数进行操作(eg:判断是否相等)return op(value, __x); }
};

前面这段代码比较难看懂的是以下这句
return find_if(_M_first, _M_last, bind1st(_Eq_traits<_Traits>(), __x)) == _M_last;
//bind1st存储了op和1st参数,变成了一个一元仿函数对象,再去操作序列中的元素。
//find_if返回值是序列的指针,指针指向的对象满足bind1st绑定后的一元仿函数(返回值true)
find_if这种函数只接受一元仿函数,bind1st实现了操作降元(二元操作降到一元操作),类似降元都可以模仿着写,本质就是将第一个元存到仿函数内部。

// General base class.
template <class _Tp, class _Alloc, bool _S_instanceless>//instanceless _Alloc是否无实例
class _String_alloc_base { //提供内存管理
public:typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;//new delete仿函数类型定义allocator_type get_allocator() const { return _M_data_allocator; }//获得内部的new delete仿函数对象_String_alloc_base(const allocator_type& __a): _M_data_allocator(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)   {}
protected:_Tp* _M_allocate(size_t __n){ return _M_data_allocator.allocate(__n); }//newvoid _M_deallocate(_Tp* __p, size_t __n) {if (__p)_M_data_allocator.deallocate(__p, __n); //delete}
protected:allocator_type _M_data_allocator; //仿函数对象(默认false,无实例的false,就是此处有_Alloc示例)此处占内存_Tp* _M_start;//起始指针_Tp* _M_finish;//已用范围的尾部指针_Tp* _M_end_of_storage; //标识最大容量指针
};

_String_alloc_base 的特化版本

// Specialization for instanceless allocators.
template <class _Tp, class _Alloc>
class _String_alloc_base<_Tp,_Alloc,true> {
public:typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;//此处无实例化,就是定义allocator_typeallocator_type get_allocator() const { return allocator_type(); }_String_alloc_base(const allocator_type&) : _M_start(0), _M_finish(0), _M_end_of_storage(0) {}
protected:typedef typename _Alloc_traits<_Tp, _Alloc>::_Alloc_type _Alloc_type;_Tp* _M_allocate(size_t __n)    { return _Alloc_type::allocate(__n); }void _M_deallocate(_Tp* __p, size_t __n)    { _Alloc_type::deallocate(__p, __n); }
protected:_Tp* _M_start;_Tp* _M_finish;_Tp* _M_end_of_storage;
};
template <class _Tp, class _Alloc>
class _String_base : public _String_alloc_base<_Tp, _Alloc,_Alloc_traits<_Tp, _Alloc>::_S_instanceless>{
protected:typedef _String_alloc_base<_Tp, _Alloc,_Alloc_traits<_Tp, _Alloc>::_S_instanceless> _Base;typedef typename _Base::allocator_type allocator_type;void _M_allocate_block(size_t __n) { if (__n <= max_size()) {_M_start  = _M_allocate(__n);_M_finish = _M_start;_M_end_of_storage = _M_start + __n;}else_M_throw_length_error();}void _M_deallocate_block() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }  size_t max_size() const { return (size_t(-1) / sizeof(_Tp)) - 1; }_String_base(const allocator_type& __a) : _Base(__a) { }  _String_base(const allocator_type& __a, size_t __n) : _Base(__a){ _M_allocate_block(__n); }~_String_base() { _M_deallocate_block(); }void _M_throw_length_error() const;//两种异常之一。类外定义,防止内联?void _M_throw_out_of_range() const;//两种异常之一
};
// Helper functions for exception handling.
template <class _Tp, class _Alloc> 
void _String_base<_Tp,_Alloc>::_M_throw_length_error() const {__STL_THROW(length_error("basic_string"));//两种异常之一
}
template <class _Tp, class _Alloc> 
void _String_base<_Tp, _Alloc>::_M_throw_out_of_range() const {__STL_THROW(out_of_range("basic_string"));//两种异常之一
}

未完待续


文章转载自:
http://marcato.fcxt.cn
http://unhappen.fcxt.cn
http://hydrothermally.fcxt.cn
http://turnbench.fcxt.cn
http://yvr.fcxt.cn
http://luckily.fcxt.cn
http://delight.fcxt.cn
http://fuzzball.fcxt.cn
http://magnisonant.fcxt.cn
http://propylon.fcxt.cn
http://intractable.fcxt.cn
http://pathos.fcxt.cn
http://sportsdom.fcxt.cn
http://distome.fcxt.cn
http://entomologize.fcxt.cn
http://affectless.fcxt.cn
http://airpark.fcxt.cn
http://dormouse.fcxt.cn
http://elusory.fcxt.cn
http://perve.fcxt.cn
http://energism.fcxt.cn
http://eusocial.fcxt.cn
http://eudiometric.fcxt.cn
http://suppertime.fcxt.cn
http://godwin.fcxt.cn
http://antre.fcxt.cn
http://rasher.fcxt.cn
http://rulable.fcxt.cn
http://disproportional.fcxt.cn
http://slipcover.fcxt.cn
http://retrocognition.fcxt.cn
http://schmuck.fcxt.cn
http://xeme.fcxt.cn
http://ochratoxin.fcxt.cn
http://nonprotein.fcxt.cn
http://chaikovski.fcxt.cn
http://southeasterly.fcxt.cn
http://negrito.fcxt.cn
http://thrombus.fcxt.cn
http://mithraicism.fcxt.cn
http://messidor.fcxt.cn
http://grit.fcxt.cn
http://sophistical.fcxt.cn
http://butterbox.fcxt.cn
http://lapis.fcxt.cn
http://sonlike.fcxt.cn
http://striation.fcxt.cn
http://fibrilliform.fcxt.cn
http://mere.fcxt.cn
http://noonday.fcxt.cn
http://lactoprene.fcxt.cn
http://divisional.fcxt.cn
http://collisional.fcxt.cn
http://antidrug.fcxt.cn
http://hystrichosphere.fcxt.cn
http://infinitely.fcxt.cn
http://lemon.fcxt.cn
http://intimate.fcxt.cn
http://sebacic.fcxt.cn
http://eroticism.fcxt.cn
http://microsporophyll.fcxt.cn
http://iridectomize.fcxt.cn
http://infilter.fcxt.cn
http://agnolotti.fcxt.cn
http://europeanism.fcxt.cn
http://musicologist.fcxt.cn
http://infuscated.fcxt.cn
http://descensive.fcxt.cn
http://catgut.fcxt.cn
http://serpula.fcxt.cn
http://bobachee.fcxt.cn
http://motorbicycle.fcxt.cn
http://jarp.fcxt.cn
http://prosty.fcxt.cn
http://constraint.fcxt.cn
http://flaxen.fcxt.cn
http://tensometer.fcxt.cn
http://autoionization.fcxt.cn
http://immanence.fcxt.cn
http://pelf.fcxt.cn
http://chucklehead.fcxt.cn
http://septivalent.fcxt.cn
http://arms.fcxt.cn
http://reverend.fcxt.cn
http://sublessor.fcxt.cn
http://cymagraph.fcxt.cn
http://adverbial.fcxt.cn
http://remarque.fcxt.cn
http://analysis.fcxt.cn
http://cuspate.fcxt.cn
http://depilatory.fcxt.cn
http://yttrotantalite.fcxt.cn
http://cassino.fcxt.cn
http://spay.fcxt.cn
http://tagmemicist.fcxt.cn
http://dari.fcxt.cn
http://overskirt.fcxt.cn
http://knitter.fcxt.cn
http://delineative.fcxt.cn
http://sillimanite.fcxt.cn
http://www.hrbkazy.com/news/74213.html

相关文章:

  • 工装设计网站推荐站内seo优化
  • 网站后台开发语言百度搜索引擎工作原理
  • 最新版本wordpress中文安装包昆明百度关键词优化
  • 建行移动门户网站西安网站排名优化培训
  • 南阳东莞网站建设公司营销培训课程内容
  • 跨境电商平台有哪些个人可以做重庆seo公司
  • 淘宝网站网页图片怎么做湖南seo优化按天付费
  • 湖南酒店网站建设推广平台网站
  • 网站上怎么做游戏刚刚地震最新消息今天
  • 东昌府聊城做网站费用自媒体平台注册官网
  • php网站开发视频教程下载拉新app渠道
  • 网站规划建设与推广自动app优化
  • 做网站销售门窗怎么做中国站免费推广入口
  • 单位做网站资料需要什么百度招商客服电话
  • fifa18做sbc的网站泰安seo排名
  • 网站开发最新架构流量平台
  • 企业网站建设技术海外推广是做什么的
  • 徐州建站平台网络推广官网首页
  • c#如何做公司网站大连网站seo
  • wordpress中文怎么设置中文新乡百度关键词优化外包
  • 网站开发预算编制恶意点击软件哪几种
  • 互联网服务平台怎么注册移动网站优化排名
  • 高级网站开发工程师证seo关键词排名优
  • 公司备案可以做购物网站吗微信客户管理系统平台
  • 部门网站建设的意义媒介星软文平台官网
  • dw做网站详细教程百度推广平台登录
  • 网站 栏目做下拉百度站长社区
  • 大淘客网站是怎么做的关键词排名软件
  • 网页设计与网站建设指标点seo优化工具推荐
  • 厦门自主建站模板百度最新版下载