-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperatorOutput.cpp
More file actions
50 lines (40 loc) · 1.01 KB
/
OperatorOutput.cpp
File metadata and controls
50 lines (40 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* \file OperatorOutput.cpp
* \brief
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//-------------------------------------------------------------------------------------------------
class StdStream
{
public:
template<typename T>
static void
format(std::ostream &a_os, const T &a_value)
{
a_os << (const char *)a_value.c_str();
}
};
//-------------------------------------------------------------------------------------------------
using ustring_t = std::basic_string<unsigned char>;
inline std::ostream &
operator << (
std::ostream &a_os,
const ::ustring_t &a_value
)
{
StdStream::format(a_os, a_value);
return a_os;
}
//-------------------------------------------------------------------------------------------------
int main(int, char **)
{
::ustring_t s(10, 'g');
std::cout << STD_TRACE_VAR(s) << std::endl;
return 0;
}
//-------------------------------------------------------------------------------------------------
#if OUTPUT
s: gggggggggg
#endif