-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNpos.cpp
More file actions
33 lines (24 loc) · 790 Bytes
/
Npos.cpp
File metadata and controls
33 lines (24 loc) · 790 Bytes
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
/**
* \file Npos.cpp
* \brief npos is a static member constant value with the greatest possible value for an element of type size_t
*
* static const size_t npos = -1;
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//--------------------------------------------------------------------------------------------------
int main(int, char **)
{
std::size_t i = -1;
if (i == std::string::npos) {
std::cout << STD_TRACE_VAR(i) << " - as string::npos" << std::endl;
}
std::cout << STD_TRACE_VAR(i) << std::endl;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------------------------------------
#if OUTPUT
i: 18446744073709551615 - as string::npos
i: 18446744073709551615
#endif