-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullInserterExtractor.h
More file actions
34 lines (26 loc) · 953 Bytes
/
NullInserterExtractor.h
File metadata and controls
34 lines (26 loc) · 953 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
#ifndef COOL_NULLINSERTEREXTRACTOR_H_
#define COOL_NULLINSERTEREXTRACTOR_H_
#include <istream>
#include <ostream>
///////////////////////////////////////////////////////////////////////////////
//
// NullInserterExtractor
//
// An inserter/extractor that does nothing and contains no state
//
///////////////////////////////////////////////////////////////////////////////
namespace cool
{
class NullInserterExtractor
{
template<typename charT, typename traits>
friend constexpr std::basic_istream<charT, traits>&
operator>>(std::basic_istream<charT, traits>& is, NullInserterExtractor) noexcept
{ return is; }
template<typename charT, typename traits>
friend constexpr std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os, NullInserterExtractor) noexcept
{ return os; }
};
} // cool namespace
#endif /* COOL_NULLINSERTEREXTRACTOR_H_ */