Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
tests
regress
27.streambuf.imbue.stdcxx-307.cpp
Go to the documentation of this file.
1
27
#include <cassert>
28
#include <locale>
29
#include <streambuf>
30
31
struct
MyFacet
: std::locale::facet
32
{
33
static
std::locale::id
id
;
34
};
35
36
std::locale::id
MyFacet::id
;
37
38
int
main
()
39
{
40
struct
MyBuf
: std::streambuf {
41
void
imbue (
const
std::locale &
loc
) {
42
std::streambuf::imbue (
loc
);
43
}
44
}
buf
;
45
46
const
std::locale
loc
(
buf
.getloc (),
new
MyFacet
);
47
48
assert
(
_STD_HAS_FACET
(
MyFacet
,
loc
));
49
assert
(!
_STD_HAS_FACET
(
MyFacet
,
buf
.getloc ()));
50
51
buf
.imbue (
loc
);
52
53
assert
(!
_STD_HAS_FACET
(
MyFacet
,
buf
.getloc ()));
54
55
buf
.pubimbue (
loc
);
56
57
assert
(
_STD_HAS_FACET
(
MyFacet
,
buf
.getloc ()));
58
59
return
0;
60
}
loc
#define loc
Definition
17.names.cpp:492
buf
#define buf
Definition
17.names.cpp:452
main
int main()
Definition
27.streambuf.imbue.stdcxx-307.cpp:38
assert
#define assert(expr)
Definition
_cassert.h:40
_STD_HAS_FACET
#define _STD_HAS_FACET(type, arg)
Definition
_defs.h:917
MyBuf
Definition
27.ostream.unformatted.stdcxx-626.cpp:35
MyFacet
Definition
has_facet.cpp:39
MyFacet::id
static std::locale::id id
Definition
has_facet.cpp:40
Generated by
1.9.8