mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 05:20:38 +00:00
d01addc625
Co-authored-by: Rodactor <rodactor@roblox.com>
18 lines
428 B
C++
18 lines
428 B
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
#pragma once
|
|
|
|
#include <ostream>
|
|
|
|
inline std::ostream& operator<<(std::ostream& lhs, const std::nullopt_t&)
|
|
{
|
|
return lhs << "none";
|
|
}
|
|
|
|
template<typename T>
|
|
std::ostream& operator<<(std::ostream& lhs, const std::optional<T>& t)
|
|
{
|
|
if (t)
|
|
return lhs << *t;
|
|
else
|
|
return lhs << "none";
|
|
}
|