Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
std_catch_conversions.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#pragma once
5
6#include <ostream>
7#include <optional>
8
9template<typename T>
10inline std::ostream& operator<<(std::ostream& os, const std::optional<T>& optional) {
11 os << "std::optional{\n\t";
12 if (optional) os << optional.value();
13 else os <<"nullopt";
14
15 return os << "\n};";
16}