x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
regex_workaround.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\regex\v4\regex_workaround.hpp
旋转
特效
属性
历史版本
/* * * Copyright (c) 1998-2005 * John Maddock * * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_workarounds.cpp * VERSION see
* DESCRIPTION: Declares Misc workarounds. */ #ifndef BOOST_REGEX_WORKAROUND_HPP #define BOOST_REGEX_WORKAROUND_HPP #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef BOOST_NO_STD_LOCALE # include
#endif #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::sprintf; using ::strcpy; using ::strcat; using ::strlen; } #endif namespace boost{ namespace re_detail{ #ifdef BOOST_NO_STD_DISTANCE template
std::ptrdiff_t distance(const T& x, const T& y) { return y - x; } #else using std::distance; #endif }} #ifdef BOOST_REGEX_NO_BOOL # define BOOST_REGEX_MAKE_BOOL(x) static_cast
((x) ? true : false) #else # define BOOST_REGEX_MAKE_BOOL(x) static_cast
(x) #endif /***************************************************************************** * * Fix broken broken namespace support: * ****************************************************************************/ #if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus) namespace std{ using ::ptrdiff_t; using ::size_t; using ::abs; using ::memset; using ::memcpy; } #endif /***************************************************************************** * * helper functions pointer_construct/pointer_destroy: * ****************************************************************************/ #ifdef __cplusplus namespace boost{ namespace re_detail{ #ifdef BOOST_MSVC #pragma warning (push) #pragma warning (disable : 4100) #endif template
inline void pointer_destroy(T* p) { p->~T(); (void)p; } #ifdef BOOST_MSVC #pragma warning (pop) #endif template
inline void pointer_construct(T* p, const T& t) { new (p) T(t); } }} // namespaces #endif /***************************************************************************** * * helper function copy: * ****************************************************************************/ #ifdef __cplusplus namespace boost{ namespace re_detail{ #if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) // // MSVC 8 will either emit warnings or else refuse to compile // code that makes perfectly legitimate use of std::copy, when // the OutputIterator type is a user-defined class (apparently all user // defined iterators are "unsafe"). This code works around that: // template
inline OutputIterator copy( InputIterator first, InputIterator last, OutputIterator dest ) { return stdext::unchecked_copy(first, last, dest); } template
inline bool equal( InputIterator1 first, InputIterator1 last, InputIterator2 with ) { return stdext::unchecked_equal(first, last, with); } #else using std::copy; using std::equal; #endif #if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__ // use safe versions of strcpy etc: using ::strcpy_s; using ::strcat_s; #else inline std::size_t strcpy_s( char *strDestination, std::size_t sizeInBytes, const char *strSource ) { if(std::strlen(strSource)+1 > sizeInBytes) return 1; std::strcpy(strDestination, strSource); return 0; } inline std::size_t strcat_s( char *strDestination, std::size_t sizeInBytes, const char *strSource ) { if(std::strlen(strSource) + std::strlen(strDestination) + 1 > sizeInBytes) return 1; std::strcat(strDestination, strSource); return 0; } #endif inline void overflow_error_if_not_zero(std::size_t i) { if(i) { std::overflow_error e("String buffer too small"); boost::throw_exception(e); } } }} // namespaces #endif // __cplusplus #endif // include guard
regex_workaround.hpp
网页地址
文件地址
上一页
37/43
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.