1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-24 07:26:49 +02:00
mu/lib/utils/mu-option.hh
Dirk-Jan C. Binnema 3dd721d5a3 clang-format: update c/cc coding style
Update all cc code using .clang-format; please do so as well for future PRs
etc.; emacs has a handy 'clang-format' mode to make this automatic.

For comparing old changes with git blame, we can disregard this one using
--ignore-rev

(see https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame )
2021-10-20 12:26:16 +03:00

34 lines
840 B
C++

/*
* Created on 2020-11-08 by Dirk-Jan C. Binnema <dbinnema@logitech.com>
*
* Copyright (c) 2020 Logitech, Inc. All Rights Reserved
* This program is a trade secret of LOGITECH, and it is not to be reproduced,
* published, disclosed to others, copied, adapted, distributed or displayed
* without the prior authorization of LOGITECH.
*
* Licensee agrees to attach or embed this notice on all copies of the program,
* including partial copies or modified versions thereof.
*
*/
#ifndef MU_OPTION__
#define MU_OPTION__
#include "optional.hpp"
namespace Mu {
/// Either a value of type T, or None
template <typename T> using Option = tl::optional<T>;
template <typename T>
Option<T>
Some(T&& t)
{
return std::move(t);
}
constexpr auto Nothing = tl::nullopt; // 'None' is take already
} // namespace Mu
#endif /*MU_OPTION__*/