@@ -60,66 +60,64 @@ namespace concurrency = Concurrency;
60
60
#pragma warning(disable : 4718)
61
61
#endif
62
62
63
- #ifndef _MS_WINDOWS
64
- // TFS 579628 - 1206: figure out how to avoid having this specialization for Linux (beware of 64-bit Linux)
65
- namespace std {
63
+ namespace Concurrency
64
+ {
65
+ // / Library for asychronous streams.
66
+ namespace streams
67
+ {
68
+ // / <summary>
69
+ // / Extending the standard char_traits type with one that adds values and types
70
+ // / that are unique to "C++ REST SDK" streams.
71
+ // / </summary>
72
+ // / <typeparam name="_CharType">
73
+ // / The data type of the basic element of the stream.
74
+ // / </typeparam>
75
+ template <typename _CharType>
76
+ struct char_traits : std::char_traits<_CharType>
77
+ {
78
+ // / <summary>
79
+ // / Some synchronous functions will return this value if the operation
80
+ // / requires an asynchronous call in a given situation.
81
+ // / </summary>
82
+ // / <returns>An <c>int_type</c> value which implies that an asynchronous call is required.</returns>
83
+ static typename std::char_traits<_CharType>::int_type requires_async () { return std::char_traits<_CharType>::eof ()-1 ; }
84
+ };
85
+ #if !defined(_MS_WINDOWS)
66
86
template <>
67
- struct char_traits <unsigned char > : private char_traits<char >
87
+ struct char_traits <unsigned char > : private std:: char_traits<char >
68
88
{
69
89
public:
70
90
typedef unsigned char char_type;
71
91
72
- using char_traits<char >::eof;
73
- using char_traits<char >::int_type;
74
- using char_traits<char >::off_type;
75
- using char_traits<char >::pos_type;
92
+ using std:: char_traits<char >::eof;
93
+ using std:: char_traits<char >::int_type;
94
+ using std:: char_traits<char >::off_type;
95
+ using std:: char_traits<char >::pos_type;
76
96
77
97
static size_t length (const unsigned char * str)
78
98
{
79
- return char_traits<char >::length (reinterpret_cast <const char *>(str));
99
+ return std:: char_traits<char >::length (reinterpret_cast <const char *>(str));
80
100
}
81
101
82
102
static void assign (unsigned char & left, const unsigned char & right) { left = right; }
83
103
static unsigned char * assign (unsigned char * left, size_t n, unsigned char value)
84
104
{
85
- return reinterpret_cast <unsigned char *>(char_traits<char >::assign (reinterpret_cast <char *>(left), n, static_cast <char >(value)));
105
+ return reinterpret_cast <unsigned char *>(std:: char_traits<char >::assign (reinterpret_cast <char *>(left), n, static_cast <char >(value)));
86
106
}
87
107
88
108
static unsigned char * copy (unsigned char * left, const unsigned char * right, size_t n)
89
109
{
90
- return reinterpret_cast <unsigned char *>(char_traits<char >::copy (reinterpret_cast <char *>(left), reinterpret_cast <const char *>(right), n));
110
+ return reinterpret_cast <unsigned char *>(std:: char_traits<char >::copy (reinterpret_cast <char *>(left), reinterpret_cast <const char *>(right), n));
91
111
}
92
112
93
113
static unsigned char * move (unsigned char * left, const unsigned char * right, size_t n)
94
114
{
95
- return reinterpret_cast <unsigned char *>(char_traits<char >::move (reinterpret_cast <char *>(left), reinterpret_cast <const char *>(right), n));
115
+ return reinterpret_cast <unsigned char *>(std:: char_traits<char >::move (reinterpret_cast <char *>(left), reinterpret_cast <const char *>(right), n));
96
116
}
97
- };
98
- }
99
- #endif // _MS_WINDOWS
100
117
101
- namespace Concurrency
102
- {
103
- // / Library for asychronous streams.
104
- namespace streams
105
- {
106
- // / <summary>
107
- // / Extending the standard char_traits type with one that adds values and types
108
- // / that are unique to "C++ REST SDK" streams.
109
- // / </summary>
110
- // / <typeparam name="_CharType">
111
- // / The data type of the basic element of the stream.
112
- // / </typeparam>
113
- template <typename _CharType>
114
- struct char_traits : std::char_traits<_CharType>
115
- {
116
- // / <summary>
117
- // / Some synchronous functions will return this value if the operation
118
- // / requires an asynchronous call in a given situation.
119
- // / </summary>
120
- // / <returns>An <c>int_type</c> value which implies that an asynchronous call is required.</returns>
121
- static typename std::char_traits<_CharType>::int_type requires_async () { return std::char_traits<_CharType>::eof ()-1 ; }
118
+ static int_type requires_async () { return eof ()-1 ; }
122
119
};
120
+ #endif
123
121
124
122
namespace details {
125
123
0 commit comments