Open C++ Libraries.org develop
Loading...
Searching...
No Matches
io_fwd.hpp
1// SPDX-License-Identifier: BSL-1.0
2// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org)
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5// Official repository: https://github.com/open-cpp-libraries/core
6
7#ifndef OCL_CORE_IO
8#define OCL_CORE_IO
9
10#include <ocl/detail/config.hpp>
11
12#ifndef OCL_FREESTANDING
13#define console_io_out ::std::cout
14#define console_io_in ::std::cin
15
16#include <iostream>
17#else
18#define console_io_out ::ocl::io::void_cout
19#define console_io_in ::ocl::io::void_cin
20
21#warning The OCL doesnt define IO streams in freestanding mode.
22
23namespace ocl::io
24{
25
26 class void_stream final
27 {
28 public:
29 void_stream() = default;
30 ~void_stream() = default;
31
32 void_stream& operator=(const void_stream&) = default;
33 void_stream(const void_stream&) = default;
34
35 void_stream& operator<<(...) = delete;
36 void_stream& operator>>(...) = delete;
37
38 }
39
40 inline void_stream void_cout;
41 inline void_stream void_cin;
42
43} // namespace ocl::io
44
45#endif
46#endif
This file takes care of I/O manip.
Definition print_fwd.hpp:20